增加插槽:message-after

This commit is contained in:
fan
2021-01-25 22:37:09 +08:00
parent 3fcaa76826
commit 1f00b8128c
12 changed files with 197 additions and 216 deletions
+46 -87
View File
@@ -2826,52 +2826,6 @@ module.exports = function (TO_STRING) {
};
/***/ }),
/***/ "7333":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__("9e1e");
var getKeys = __webpack_require__("0d58");
var gOPS = __webpack_require__("2621");
var pIE = __webpack_require__("52a7");
var toObject = __webpack_require__("4bf8");
var IObject = __webpack_require__("626a");
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__("79e5")(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
}
} return T;
} : $assign;
/***/ }),
/***/ "7514":
@@ -5332,17 +5286,6 @@ $export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'Strin
})(document);
/***/ }),
/***/ "f751":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__("5ca1");
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
/***/ }),
/***/ "f772":
@@ -7006,7 +6949,14 @@ var messages_component = normalizeComponent(
/* harmony default export */ var basicvue_type_script_lang_js_ = ({
name: "lemonMessageBasic",
inject: ["IMUI"],
inject: {
IMUI: {
from: 'IMUI',
default: function _default() {
return this;
}
}
},
props: {
message: {
type: Object,
@@ -7036,7 +6986,7 @@ var messages_component = normalizeComponent(
status = _this$message.status,
sendTime = _this$message.sendTime;
return h("div", {
"class": ["lemon-message", {
"class": ["lemon-message", "lemon-message--status-".concat(status), {
"lemon-message--reverse": this.reverse,
"lemon-message--hide-name": this.hideName
}]
@@ -7064,8 +7014,15 @@ var messages_component = normalizeComponent(
}
}
}, [fromUser.displayName]), this.hideTime == true && h("span", {
"class": "lemon-message__time"
"class": "lemon-message__time",
"on": {
"click": function click(e) {
_this._emitClick(e, "sendTime");
}
}
}, [this.timeFormat(sendTime)])]), h("div", {
"class": "lemon-message__content-flex"
}, [h("div", {
"class": "lemon-message__content",
"on": {
"click": function click(e) {
@@ -7073,13 +7030,26 @@ var messages_component = normalizeComponent(
}
}
}, [useScopedSlot(this.$scopedSlots['content'], null, this.message)]), h("div", {
"class": "lemon-message__content-after"
}, [useScopedSlot(this.IMUI.$scopedSlots['message-after'], null, this.message)]), h("div", {
"class": "lemon-message__status",
"on": {
"click": function click(e) {
_this._emitClick(e, "status");
}
}
}, [this._renderStatue(status)])])]);
}, [h("i", {
"class": "lemon-icon-loading lemonani-spin"
}), h("i", {
"class": "lemon-icon-prompt",
"attrs": {
"title": "重发消息"
},
"style": {
color: "#ff2525",
cursor: "pointer"
}
}), this._renderStatue(status)])])])]);
},
created: function created() {},
mounted: function mounted() {},
@@ -7089,27 +7059,21 @@ var messages_component = normalizeComponent(
_emitClick: function _emitClick(e, key) {
this.IMUI.$emit("message-click", e, key, this.message, this.IMUI);
},
_renderStatue: function _renderStatue(status) {
var h = this.$createElement;
if (status == "going") {
return h("i", {
"class": "lemon-icon-loading lemonani-spin"
});
} else if (status == "failed") {
return h("i", {
"class": "lemon-icon-prompt",
"attrs": {
"title": "重发消息"
},
"style": {
color: "#ff2525",
cursor: "pointer"
}
});
}
return;
_renderStatue: function _renderStatue(status) {// if (status == "going") {
// return <i class="lemon-icon-loading lemonani-spin" />;
// } else if (status == "failed") {
// return (
// <i
// class="lemon-icon-prompt"
// title="重发消息"
// style={{
// color: "#ff2525",
// cursor: "pointer"
// }}
// />
// );
// }
// return;
}
}
});
@@ -7430,9 +7394,6 @@ function _toConsumableArray(arr) {
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
var es6_string_starts_with = __webpack_require__("f559");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
var es6_object_assign = __webpack_require__("f751");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.sort.js
var es6_array_sort = __webpack_require__("55dd");
@@ -7560,8 +7521,6 @@ function () {
function componentsvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function componentsvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { componentsvue_type_script_lang_js_ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { componentsvue_type_script_lang_js_ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
+1 -1
View File
File diff suppressed because one or more lines are too long
+46 -87
View File
@@ -2835,52 +2835,6 @@ module.exports = function (TO_STRING) {
};
/***/ }),
/***/ "7333":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__("9e1e");
var getKeys = __webpack_require__("0d58");
var gOPS = __webpack_require__("2621");
var pIE = __webpack_require__("52a7");
var toObject = __webpack_require__("4bf8");
var IObject = __webpack_require__("626a");
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__("79e5")(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
}
} return T;
} : $assign;
/***/ }),
/***/ "7514":
@@ -5341,17 +5295,6 @@ $export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'Strin
})(document);
/***/ }),
/***/ "f751":
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__("5ca1");
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
/***/ }),
/***/ "f772":
@@ -7015,7 +6958,14 @@ var messages_component = normalizeComponent(
/* harmony default export */ var basicvue_type_script_lang_js_ = ({
name: "lemonMessageBasic",
inject: ["IMUI"],
inject: {
IMUI: {
from: 'IMUI',
default: function _default() {
return this;
}
}
},
props: {
message: {
type: Object,
@@ -7045,7 +6995,7 @@ var messages_component = normalizeComponent(
status = _this$message.status,
sendTime = _this$message.sendTime;
return h("div", {
"class": ["lemon-message", {
"class": ["lemon-message", "lemon-message--status-".concat(status), {
"lemon-message--reverse": this.reverse,
"lemon-message--hide-name": this.hideName
}]
@@ -7073,8 +7023,15 @@ var messages_component = normalizeComponent(
}
}
}, [fromUser.displayName]), this.hideTime == true && h("span", {
"class": "lemon-message__time"
"class": "lemon-message__time",
"on": {
"click": function click(e) {
_this._emitClick(e, "sendTime");
}
}
}, [this.timeFormat(sendTime)])]), h("div", {
"class": "lemon-message__content-flex"
}, [h("div", {
"class": "lemon-message__content",
"on": {
"click": function click(e) {
@@ -7082,13 +7039,26 @@ var messages_component = normalizeComponent(
}
}
}, [useScopedSlot(this.$scopedSlots['content'], null, this.message)]), h("div", {
"class": "lemon-message__content-after"
}, [useScopedSlot(this.IMUI.$scopedSlots['message-after'], null, this.message)]), h("div", {
"class": "lemon-message__status",
"on": {
"click": function click(e) {
_this._emitClick(e, "status");
}
}
}, [this._renderStatue(status)])])]);
}, [h("i", {
"class": "lemon-icon-loading lemonani-spin"
}), h("i", {
"class": "lemon-icon-prompt",
"attrs": {
"title": "重发消息"
},
"style": {
color: "#ff2525",
cursor: "pointer"
}
}), this._renderStatue(status)])])])]);
},
created: function created() {},
mounted: function mounted() {},
@@ -7098,27 +7068,21 @@ var messages_component = normalizeComponent(
_emitClick: function _emitClick(e, key) {
this.IMUI.$emit("message-click", e, key, this.message, this.IMUI);
},
_renderStatue: function _renderStatue(status) {
var h = this.$createElement;
if (status == "going") {
return h("i", {
"class": "lemon-icon-loading lemonani-spin"
});
} else if (status == "failed") {
return h("i", {
"class": "lemon-icon-prompt",
"attrs": {
"title": "重发消息"
},
"style": {
color: "#ff2525",
cursor: "pointer"
}
});
}
return;
_renderStatue: function _renderStatue(status) {// if (status == "going") {
// return <i class="lemon-icon-loading lemonani-spin" />;
// } else if (status == "failed") {
// return (
// <i
// class="lemon-icon-prompt"
// title="重发消息"
// style={{
// color: "#ff2525",
// cursor: "pointer"
// }}
// />
// );
// }
// return;
}
}
});
@@ -7439,9 +7403,6 @@ function _toConsumableArray(arr) {
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
var es6_string_starts_with = __webpack_require__("f559");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
var es6_object_assign = __webpack_require__("f751");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.sort.js
var es6_array_sort = __webpack_require__("55dd");
@@ -7569,8 +7530,6 @@ function () {
function componentsvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function componentsvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { componentsvue_type_script_lang_js_ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { componentsvue_type_script_lang_js_ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
+1 -1
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -71,6 +71,10 @@
<span>{{ contact.displayName }}</span>
<small class="more" @click="changeDrawer(contact,$refs.SlotIMUI)">{{($refs.SlotIMUI ? $refs.SlotIMUI.drawerVisible : false) ? '关闭' : '打开'}}抽屉</small>
</template>
<template #message-after="message">
<span>未读</span>
</template>
<template #contact-info="contact">
自定义联系人信息 {{ contact.displayName }}
</template>
@@ -567,6 +571,11 @@
<td width="350">消息列表的标题</td>
<td width="150">Contact</td>
</tr>
<tr>
<td width="150">message-after</td>
<td width="350">每条消息的尾部</td>
<td width="150">Message</td>
</tr>
<tr>
<td width="150">sidebar-message</td>
<td width="350">左侧最新消息列表插槽</td>
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>Lemon IMUI</title><link href=css/index.28bed5a5.css rel=preload as=style><link href=js/chunk-vendors.e4810482.js rel=preload as=script><link href=js/index.4c7bb88e.js rel=preload as=script><link href=css/index.28bed5a5.css rel=stylesheet></head><body><noscript><strong>We're sorry but flat-im doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.e4810482.js></script><script src=js/index.4c7bb88e.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>Lemon IMUI</title><link href=css/index.436859f0.css rel=preload as=style><link href=js/chunk-vendors.e4810482.js rel=preload as=script><link href=js/index.0fb261d4.js rel=preload as=script><link href=css/index.436859f0.css rel=stylesheet></head><body><noscript><strong>We're sorry but flat-im doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.e4810482.js></script><script src=js/index.0fb261d4.js></script></body></html>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "lemon-imui",
"version": "1.3.1",
"version": "1.3.2",
"main": "dist/index.umd.min.js",
"description": "基于 VUE2.0 的 IM 聊天组件",
"homepage": "https://github.com/fanjyy/lemon-imui",
-1
View File
@@ -906,7 +906,6 @@ bezier = cubic-bezier(0.645, 0.045, 0.355, 1)
width drawer-width
height 100%
box-sizing border-box
//border-left 1px solid #e9e9e9
+b(lemon-wrapper)
+m(drawer-show)
+b(lemon-drawer)
+90 -35
View File
@@ -2,7 +2,14 @@
import { useScopedSlot} from "utils";
export default {
name: "lemonMessageBasic",
inject: ["IMUI"],
inject: {
IMUI: {
from:'IMUI',
default (){
return this;
}
}
},
props: {
message: {
type: Object,
@@ -27,6 +34,7 @@ export default {
<div
class={[
"lemon-message",
`lemon-message--status-${status}`,
{
"lemon-message--reverse": this.reverse,
"lemon-message--hide-name": this.hideName,
@@ -52,23 +60,41 @@ export default {
>
{fromUser.displayName}
</span>
{this.hideTime == true && <span class="lemon-message__time">{this.timeFormat(sendTime)}</span>}
{this.hideTime == true && <span class="lemon-message__time" on-click={e => {
this._emitClick(e, "sendTime");
}}>{this.timeFormat(sendTime)}</span>}
</div>
<div
class="lemon-message__content"
on-click={e => {
this._emitClick(e, "content");
}}
>
{useScopedSlot(this.$scopedSlots['content'],null,this.message)}
</div>
<div
class="lemon-message__status"
on-click={e => {
this._emitClick(e, "status");
}}
>
{this._renderStatue(status)}
<div class="lemon-message__content-flex">
<div
class="lemon-message__content"
on-click={e => {
this._emitClick(e, "content");
}}
>
{useScopedSlot(this.$scopedSlots['content'],null,this.message)}
</div>
<div
class="lemon-message__content-after"
>
{useScopedSlot(this.IMUI.$scopedSlots['message-after'],null,this.message)}
</div>
<div
class="lemon-message__status"
on-click={e => {
this._emitClick(e, "status");
}}
>
<i class="lemon-icon-loading lemonani-spin" />
<i
class="lemon-icon-prompt"
title="重发消息"
style={{
color: "#ff2525",
cursor: "pointer"
}}
/>
{this._renderStatue(status)}
</div>
</div>
</div>
</div>
@@ -83,21 +109,21 @@ export default {
this.IMUI.$emit("message-click", e, key, this.message,this.IMUI);
},
_renderStatue(status) {
if (status == "going") {
return <i class="lemon-icon-loading lemonani-spin" />;
} else if (status == "failed") {
return (
<i
class="lemon-icon-prompt"
title="重发消息"
style={{
color: "#ff2525",
cursor: "pointer"
}}
/>
);
}
return;
// if (status == "going") {
// return <i class="lemon-icon-loading lemonani-spin" />;
// } else if (status == "failed") {
// return (
// <i
// class="lemon-icon-prompt"
// title="重发消息"
// style={{
// color: "#ff2525",
// cursor: "pointer"
// }}
// />
// );
// }
// return;
},
}
};
@@ -131,6 +157,8 @@ arrow()
padding-bottom 6px
user-select none
color #666
+e(content-flex)
display flex
+e(content)
font-size 14px
line-height 20px
@@ -138,7 +166,7 @@ arrow()
background #fff
border-radius 4px
position relative
margin 0 46px 0 0
margin 0
img
video
background #e9e9e9
@@ -148,22 +176,49 @@ arrow()
left -4px
border-left none
border-right-color #fff
+e(content-after)
display block
width 48px
height 36px
padding-left 6px
flex none
font-size 12px
color #aaa
overflow hidden
visibility hidden
+e(status)
position absolute
top 23px
right 20px
color #aaa
font-size 20px
.lemon-icon-loading
.lemon-icon-prompt
display none
+m(status-going)
.lemon-icon-loading
display inline-block
+m(status-failed)
.lemon-icon-prompt
display inline-block
+m(status-succeed)
+e(content-after)
visibility visible
+m(reverse)
flex-direction row-reverse
+e(content-flex)
flex-direction row-reverse
+e(content-after)
padding-right 6px
padding-left 0
text-align right
+e(title)
flex-direction row-reverse
+e(status)
left 20px
left 26px
right auto
+e(content)
background #35d863
margin 0 0 0 46px
&:before
arrow()
left auto