增加抽屉功能
This commit is contained in:
1 parent
0f3edc6925
commit
793735bd88
12 files changed
+394
-74
No files matched your search
Vendored
+123
-13
@@ -2544,6 +2544,9 @@ function _toConsumableArray(arr) {
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.string.starts-with.js
|
||||
var es6_string_starts_with = __webpack_require__("d31c");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.object.assign.js
|
||||
var es6_object_assign = __webpack_require__("6ba0");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.array.sort.js
|
||||
var es6_array_sort = __webpack_require__("3441");
|
||||
|
||||
@@ -2666,6 +2669,9 @@ var memory_MemoryCache = /*#__PURE__*/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(Object(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(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
@@ -2679,6 +2685,14 @@ function componentsvue_type_script_lang_js_objectSpread(target) { for (var i = 1
|
||||
var allMessages = {};
|
||||
var emojiMap = {};
|
||||
|
||||
var componentsvue_type_script_lang_js_toPx = function toPx(val) {
|
||||
return isString(val) ? val : "".concat(val, "px");
|
||||
};
|
||||
|
||||
var toPoint = function toPoint(str) {
|
||||
return str.replace("%", "") / 100;
|
||||
};
|
||||
|
||||
var renderDrawerContent = function renderDrawerContent() {};
|
||||
|
||||
/* harmony default export */ var componentsvue_type_script_lang_js_ = ({
|
||||
@@ -2690,12 +2704,12 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
},
|
||||
props: {
|
||||
width: {
|
||||
type: String,
|
||||
default: "850px"
|
||||
type: [String, Number],
|
||||
default: 850
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "580px"
|
||||
type: [String, Number],
|
||||
default: 580
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
@@ -2969,9 +2983,10 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
var h = this.$createElement;
|
||||
return h("div", {
|
||||
"style": {
|
||||
width: this.width,
|
||||
height: this.height
|
||||
width: componentsvue_type_script_lang_js_toPx(this.width),
|
||||
height: componentsvue_type_script_lang_js_toPx(this.height)
|
||||
},
|
||||
"ref": "wrapper",
|
||||
"class": ["lemon-wrapper", "lemon-wrapper--theme-".concat(this.theme), {
|
||||
"lemon-wrapper--simple": this.simple
|
||||
}, this.drawerVisible && "lemon-wrapper--drawer-show"]
|
||||
@@ -3140,7 +3155,8 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
_renderDrawer: function _renderDrawer() {
|
||||
var h = this.$createElement;
|
||||
return this._menuIsMessages() && this.currentContactId ? h("div", {
|
||||
"class": "lemon-drawer"
|
||||
"class": "lemon-drawer",
|
||||
"ref": "drawer"
|
||||
}, [renderDrawerContent(), useScopedSlot(this.$scopedSlots.drawer, "", this.currentContact)]) : "";
|
||||
},
|
||||
_isContactContainerCache: function _isContactContainerCache(name) {
|
||||
@@ -3185,9 +3201,9 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
}]
|
||||
}, [h("div", {
|
||||
"class": "lemon-container__title"
|
||||
}, [h("div", {
|
||||
}, [useScopedSlot(this.$scopedSlots["message-title"], h("div", {
|
||||
"class": "lemon-container__displayname"
|
||||
}, [useScopedSlot(this.$scopedSlots["message-title"], curact.displayName, curact)])]), h("lemon-messages", {
|
||||
}, [curact.displayName]), curact)]), h("lemon-messages", {
|
||||
"ref": "messages",
|
||||
"attrs": {
|
||||
"hide-time": this.hideMessageTime,
|
||||
@@ -3737,12 +3753,49 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
getMessages: function getMessages(contactId) {
|
||||
return (contactId ? allMessages[contactId] : allMessages) || [];
|
||||
},
|
||||
changeDrawer: function changeDrawer(render) {
|
||||
changeDrawer: function changeDrawer(params) {
|
||||
this.drawerVisible = !this.drawerVisible;
|
||||
if (this.drawerVisible == true) this.openDrawer(render);
|
||||
if (this.drawerVisible == true) this.openDrawer(params);
|
||||
},
|
||||
openDrawer: function openDrawer(render) {
|
||||
renderDrawerContent = render || new Function();
|
||||
// openDrawer(data) {
|
||||
// renderDrawerContent = data || new Function();
|
||||
// this.drawerVisible = true;
|
||||
// },
|
||||
openDrawer: function openDrawer(params) {
|
||||
renderDrawerContent = isFunction(params) ? params : params.render || new Function();
|
||||
var wrapperWidth = this.$refs.wrapper.clientWidth;
|
||||
var wrapperHeight = this.$refs.wrapper.clientHeight;
|
||||
var width = params.width || 200;
|
||||
var height = params.height || wrapperHeight;
|
||||
var offsetX = params.offsetX || 0;
|
||||
var offsetY = params.offsetY || 0;
|
||||
var position = params.position || "right";
|
||||
if (isString(width)) width = wrapperWidth * toPoint(width);
|
||||
if (isString(height)) height = wrapperHeight * toPoint(height);
|
||||
if (isString(offsetX)) offsetX = wrapperWidth * toPoint(offsetX);
|
||||
if (isString(offsetY)) offsetY = wrapperHeight * toPoint(offsetY);
|
||||
this.$refs.drawer.style.width = "".concat(width, "px");
|
||||
this.$refs.drawer.style.height = "".concat(height, "px");
|
||||
var left = 0;
|
||||
var top = 0;
|
||||
var shadow = "";
|
||||
|
||||
if (position == "right") {
|
||||
left = wrapperWidth;
|
||||
} else if (position == "rightInside") {
|
||||
left = wrapperWidth - width;
|
||||
shadow = "-15px 0 16px -14px rgba(0,0,0,0.08)";
|
||||
} else if (position == "center") {
|
||||
left = wrapperWidth / 2 - width / 2;
|
||||
top = wrapperHeight / 2 - height / 2;
|
||||
shadow = "0 0 20px rgba(0,0,0,0.08)";
|
||||
}
|
||||
|
||||
left += offsetX;
|
||||
top += offsetY + -1;
|
||||
this.$refs.drawer.style.top = "".concat(top, "px");
|
||||
this.$refs.drawer.style.left = "".concat(left, "px");
|
||||
this.$refs.drawer.style.boxShadow = shadow;
|
||||
this.drawerVisible = true;
|
||||
},
|
||||
closeDrawer: function closeDrawer() {
|
||||
@@ -5492,6 +5545,17 @@ try {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "6ba0":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// 19.1.3.1 Object.assign(target, source)
|
||||
var $export = __webpack_require__("e99b");
|
||||
|
||||
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("9f15") });
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "6bf8":
|
||||
@@ -5938,6 +6002,52 @@ module.exports = function (it) {
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "9f15":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// 19.1.2.1 Object.assign(target, source, ...)
|
||||
var DESCRIPTORS = __webpack_require__("26df");
|
||||
var getKeys = __webpack_require__("93ca");
|
||||
var gOPS = __webpack_require__("0c29");
|
||||
var pIE = __webpack_require__("35d4");
|
||||
var toObject = __webpack_require__("8078");
|
||||
var IObject = __webpack_require__("1b96");
|
||||
var $assign = Object.assign;
|
||||
|
||||
// should work with symbols and should have deterministic property order (V8 bug)
|
||||
module.exports = !$assign || __webpack_require__("0926")(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;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "a450":
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-tabs{background:#f6f6f6}.lemon-tabs-content{padding:15px}.lemon-tabs-content,.lemon-tabs-content__pane{width:100%;height:100%}.lemon-tabs-nav{display:-webkit-box;display:-ms-flexbox;display:flex;background:#eee}.lemon-tabs-nav__item{line-height:38px;padding:0 15px;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.lemon-tabs-nav__item--active{background:#f6f6f6}.lemon-button{outline:none;line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);color:rgba(0,0,0,.65);background-color:#fff;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);text-shadow:0 -1px 0 rgba(0,0,0,.12)}.lemon-button--color-default:hover:not([disabled]){border-color:#666;color:#333}.lemon-button--color-default:active{background-color:#ddd}.lemon-button--color-default[disabled]{cursor:not-allowed;color:#aaa;background:#eee}.lemon-button--color-grey{background:#e1e1e1;border-color:#e1e1e1;color:#666}.lemon-button--color-grey:hover:not([disabled]){border-color:#bbb}.lemon-badge{position:relative;display:inline-block}.lemon-badge__label{border-radius:10px;background:#f5222d;color:#fff;text-align:center;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10;position:absolute;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%;display:inline-block;padding:0 4px;height:18px;line-height:17px;min-width:10px;top:-4px;right:6px}.lemon-badge__label--dot{width:10px;height:10px;min-width:auto;padding:0;top:-3px;right:2px}.lemon-avatar{font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:inline-block;text-align:center;background:#ccc;color:hsla(0,0%,100%,.7);white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;border-radius:4px}.lemon-avatar--circle{border-radius:50%}.lemon-avatar img{width:100%;height:100%;display:block}.lemon-contact{padding:10px 14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#efefef;text-align:left}.lemon-contact p{margin:0}.lemon-contact--active{background:#bebdbd}.lemon-contact:hover:not(.lemon-contact--active){background:#e3e3e3}.lemon-contact:hover:not(.lemon-contact--active) .el-badge__content{border-color:#ddd}.lemon-contact__avatar{float:left;margin-right:10px}.lemon-contact__avatar img{display:block}.lemon-contact__avatar .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:18px;min-width:18px;top:-4px;right:7px}.lemon-contact__label{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-contact__time{font-size:12px;line-height:18px;padding-left:6px;color:#999;white-space:nowrap}.lemon-contact__name{display:block;width:100%}.lemon-contact__content,.lemon-contact__name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contact__content{font-size:12px;color:#999;height:18px;line-height:18px;margin-top:1px!important}.lemon-contact__content img{height:14px;display:inline-block;vertical-align:middle;margin:0 1px;position:relative;top:-1px}.lemon-contact--name-center .lemon-contact__label{padding-bottom:0;line-height:38px}.lemon-editor{height:200px;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-diLine truncated
|
||||
.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-tabs{background:#f6f6f6}.lemon-tabs-content{padding:15px}.lemon-tabs-content,.lemon-tabs-content__pane{width:100%;height:100%}.lemon-tabs-nav{display:-webkit-box;display:-ms-flexbox;display:flex;background:#eee}.lemon-tabs-nav__item{line-height:38px;padding:0 15px;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1)}.lemon-tabs-nav__item--active{background:#f6f6f6}.lemon-button{outline:none;line-height:1.499;display:inline-block;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;padding:0 15px;font-size:14px;border-radius:4px;height:32px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);color:rgba(0,0,0,.65);background-color:#fff;-webkit-box-shadow:0 2px 0 rgba(0,0,0,.015);box-shadow:0 2px 0 rgba(0,0,0,.015);text-shadow:0 -1px 0 rgba(0,0,0,.12)}.lemon-button--color-default:hover:not([disabled]){border-color:#666;color:#333}.lemon-button--color-default:active{background-color:#ddd}.lemon-button--color-default[disabled]{cursor:not-allowed;color:#aaa;background:#eee}.lemon-button--color-grey{background:#e1e1e1;border-color:#e1e1e1;color:#666}.lemon-button--color-grey:hover:not([disabled]){border-color:#bbb}.lemon-badge{position:relative;display:inline-block}.lemon-badge__label{border-radius:10px;background:#f5222d;color:#fff;text-align:center;font-size:12px;font-weight:400;white-space:nowrap;-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff;z-index:10;position:absolute;-webkit-transform:translateX(50%);transform:translateX(50%);-webkit-transform-origin:100%;transform-origin:100%;display:inline-block;padding:0 4px;height:18px;line-height:17px;min-width:10px;top:-4px;right:6px}.lemon-badge__label--dot{width:10px;height:10px;min-width:auto;padding:0;top:-3px;right:2px}.lemon-avatar{font-variant:tabular-nums;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;display:inline-block;text-align:center;background:#ccc;color:hsla(0,0%,100%,.7);white-space:nowrap;position:relative;overflow:hidden;vertical-align:middle;border-radius:4px}.lemon-avatar--circle{border-radius:50%}.lemon-avatar img{width:100%;height:100%;display:block}.lemon-contact{padding:10px 14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#efefef;text-align:left}.lemon-contact p{margin:0}.lemon-contact--active{background:#bebdbd}.lemon-contact:hover:not(.lemon-contact--active){background:#e3e3e3}.lemon-contact:hover:not(.lemon-contact--active) .el-badge__content{border-color:#ddd}.lemon-contact__avatar{float:left;margin-right:10px}.lemon-contact__avatar img{display:block}.lemon-contact__avatar .ant-badge-count{display:inline-block;padding:0 4px;height:18px;line-height:18px;min-width:18px;top:-4px;right:7px}.lemon-contact__label{display:-webkit-box;display:-ms-flexbox;display:flex}.lemon-contact__time{font-size:12px;line-height:18px;padding-left:6px;color:#999;white-space:nowrap}.lemon-contact__name{display:block;width:100%}.lemon-contact__content,.lemon-contact__name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.lemon-contact__content{font-size:12px;color:#999;height:18px;line-height:18px;margin-top:1px!important}.lemon-contact__content img{height:14px;display:inline-block;vertical-align:middle;margin:0 1px;position:relative;top:-1px}.lemon-contact--name-center .lemon-contact__label{padding-bottom:0;line-height:38px}.lemon-editor{height:200px;position:relative;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-diLine truncated
|
||||
Vendored
+123
-13
@@ -2553,6 +2553,9 @@ function _toConsumableArray(arr) {
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.string.starts-with.js
|
||||
var es6_string_starts_with = __webpack_require__("d31c");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.object.assign.js
|
||||
var es6_object_assign = __webpack_require__("6ba0");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.12@core-js/modules/es6.array.sort.js
|
||||
var es6_array_sort = __webpack_require__("3441");
|
||||
|
||||
@@ -2675,6 +2678,9 @@ var memory_MemoryCache = /*#__PURE__*/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(Object(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(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
@@ -2688,6 +2694,14 @@ function componentsvue_type_script_lang_js_objectSpread(target) { for (var i = 1
|
||||
var allMessages = {};
|
||||
var emojiMap = {};
|
||||
|
||||
var componentsvue_type_script_lang_js_toPx = function toPx(val) {
|
||||
return isString(val) ? val : "".concat(val, "px");
|
||||
};
|
||||
|
||||
var toPoint = function toPoint(str) {
|
||||
return str.replace("%", "") / 100;
|
||||
};
|
||||
|
||||
var renderDrawerContent = function renderDrawerContent() {};
|
||||
|
||||
/* harmony default export */ var componentsvue_type_script_lang_js_ = ({
|
||||
@@ -2699,12 +2713,12 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
},
|
||||
props: {
|
||||
width: {
|
||||
type: String,
|
||||
default: "850px"
|
||||
type: [String, Number],
|
||||
default: 850
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "580px"
|
||||
type: [String, Number],
|
||||
default: 580
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
@@ -2978,9 +2992,10 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
var h = this.$createElement;
|
||||
return h("div", {
|
||||
"style": {
|
||||
width: this.width,
|
||||
height: this.height
|
||||
width: componentsvue_type_script_lang_js_toPx(this.width),
|
||||
height: componentsvue_type_script_lang_js_toPx(this.height)
|
||||
},
|
||||
"ref": "wrapper",
|
||||
"class": ["lemon-wrapper", "lemon-wrapper--theme-".concat(this.theme), {
|
||||
"lemon-wrapper--simple": this.simple
|
||||
}, this.drawerVisible && "lemon-wrapper--drawer-show"]
|
||||
@@ -3149,7 +3164,8 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
_renderDrawer: function _renderDrawer() {
|
||||
var h = this.$createElement;
|
||||
return this._menuIsMessages() && this.currentContactId ? h("div", {
|
||||
"class": "lemon-drawer"
|
||||
"class": "lemon-drawer",
|
||||
"ref": "drawer"
|
||||
}, [renderDrawerContent(), useScopedSlot(this.$scopedSlots.drawer, "", this.currentContact)]) : "";
|
||||
},
|
||||
_isContactContainerCache: function _isContactContainerCache(name) {
|
||||
@@ -3194,9 +3210,9 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
}]
|
||||
}, [h("div", {
|
||||
"class": "lemon-container__title"
|
||||
}, [h("div", {
|
||||
}, [useScopedSlot(this.$scopedSlots["message-title"], h("div", {
|
||||
"class": "lemon-container__displayname"
|
||||
}, [useScopedSlot(this.$scopedSlots["message-title"], curact.displayName, curact)])]), h("lemon-messages", {
|
||||
}, [curact.displayName]), curact)]), h("lemon-messages", {
|
||||
"ref": "messages",
|
||||
"attrs": {
|
||||
"hide-time": this.hideMessageTime,
|
||||
@@ -3746,12 +3762,49 @@ var renderDrawerContent = function renderDrawerContent() {};
|
||||
getMessages: function getMessages(contactId) {
|
||||
return (contactId ? allMessages[contactId] : allMessages) || [];
|
||||
},
|
||||
changeDrawer: function changeDrawer(render) {
|
||||
changeDrawer: function changeDrawer(params) {
|
||||
this.drawerVisible = !this.drawerVisible;
|
||||
if (this.drawerVisible == true) this.openDrawer(render);
|
||||
if (this.drawerVisible == true) this.openDrawer(params);
|
||||
},
|
||||
openDrawer: function openDrawer(render) {
|
||||
renderDrawerContent = render || new Function();
|
||||
// openDrawer(data) {
|
||||
// renderDrawerContent = data || new Function();
|
||||
// this.drawerVisible = true;
|
||||
// },
|
||||
openDrawer: function openDrawer(params) {
|
||||
renderDrawerContent = isFunction(params) ? params : params.render || new Function();
|
||||
var wrapperWidth = this.$refs.wrapper.clientWidth;
|
||||
var wrapperHeight = this.$refs.wrapper.clientHeight;
|
||||
var width = params.width || 200;
|
||||
var height = params.height || wrapperHeight;
|
||||
var offsetX = params.offsetX || 0;
|
||||
var offsetY = params.offsetY || 0;
|
||||
var position = params.position || "right";
|
||||
if (isString(width)) width = wrapperWidth * toPoint(width);
|
||||
if (isString(height)) height = wrapperHeight * toPoint(height);
|
||||
if (isString(offsetX)) offsetX = wrapperWidth * toPoint(offsetX);
|
||||
if (isString(offsetY)) offsetY = wrapperHeight * toPoint(offsetY);
|
||||
this.$refs.drawer.style.width = "".concat(width, "px");
|
||||
this.$refs.drawer.style.height = "".concat(height, "px");
|
||||
var left = 0;
|
||||
var top = 0;
|
||||
var shadow = "";
|
||||
|
||||
if (position == "right") {
|
||||
left = wrapperWidth;
|
||||
} else if (position == "rightInside") {
|
||||
left = wrapperWidth - width;
|
||||
shadow = "-15px 0 16px -14px rgba(0,0,0,0.08)";
|
||||
} else if (position == "center") {
|
||||
left = wrapperWidth / 2 - width / 2;
|
||||
top = wrapperHeight / 2 - height / 2;
|
||||
shadow = "0 0 20px rgba(0,0,0,0.08)";
|
||||
}
|
||||
|
||||
left += offsetX;
|
||||
top += offsetY + -1;
|
||||
this.$refs.drawer.style.top = "".concat(top, "px");
|
||||
this.$refs.drawer.style.left = "".concat(left, "px");
|
||||
this.$refs.drawer.style.boxShadow = shadow;
|
||||
this.drawerVisible = true;
|
||||
},
|
||||
closeDrawer: function closeDrawer() {
|
||||
@@ -5501,6 +5554,17 @@ try {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "6ba0":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// 19.1.3.1 Object.assign(target, source)
|
||||
var $export = __webpack_require__("e99b");
|
||||
|
||||
$export($export.S + $export.F, 'Object', { assign: __webpack_require__("9f15") });
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "6bf8":
|
||||
@@ -5947,6 +6011,52 @@ module.exports = function (it) {
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "9f15":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// 19.1.2.1 Object.assign(target, source, ...)
|
||||
var DESCRIPTORS = __webpack_require__("26df");
|
||||
var getKeys = __webpack_require__("93ca");
|
||||
var gOPS = __webpack_require__("0c29");
|
||||
var pIE = __webpack_require__("35d4");
|
||||
var toObject = __webpack_require__("8078");
|
||||
var IObject = __webpack_require__("1b96");
|
||||
var $assign = Object.assign;
|
||||
|
||||
// should work with symbols and should have deterministic property order (V8 bug)
|
||||
module.exports = !$assign || __webpack_require__("0926")(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;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "a450":
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["index"]=e(require("vue")):t["index"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="112a")}({"01be":function(t,e,n){},"0353":function(t,e,n){"use strict";var r=n("6bf8"),i=RegExp.prototype.exec,o=String.prototype.replace,a=i,c="lastIndex",s=function(){var t=/a/,e=/b*/g;return i.call(t,"a"),i.call(e,"a"),0!==t[c]||0!==e[c]}(),u=void 0!==/()??/.exec("")[1],l=s||u;l&&(a=function(t){var e,n,a,l,f=this;return u&&(n=new RegExp("^"+f.source+"$(?!\\s)",r.call(f))),s&&(e=f[c]),a=i.call(f,t),s&&a&&(f[c]=f.global?a.index+a[0].length:e),u&&a&&a.length>1&&o.call(a[0],n,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(a[l]=void 0)})),a}),t.exports=a},"0451":function(t,e,n){var r=n("9cff"),i=n("d1cb"),o=n("839a")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}},"0484":function(t,e,n){},"04f4":function(t,e,n){"use strict";n("de97")},"05fd":function(t,e,n){t.exports=n("baa7")("native-function-to-string",Function.toString)},"065d":function(t,e,n){var r=n("bb8b"),i=n("5edc");t.exports=n("26df")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"065e":function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"0926":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"0b34":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"0c29":function(t,e){e.f=Object.getOwnPropertySymbols},"0c84":function(t,e,n){"use strict";var r=n("1663")(!0);n("120f")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},"0e15":function(t,e,n){"use strict";n("d5e9")},"112a":function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("e67d"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));n("a450"),n("1bc7");var i=n("8bbf"),o=n.n(i);n("3269"),n("25ba"),n("b3d7"),n("4057");function a(t){return"[object Object]"===Object.prototype.toString.call(t)}function c(t){return"string"==typeof t}function s(t){return(new Date).getTime()-t<864e5}function u(t){return!t||(!(!Array.isArray(t)||0!=t.length)||!(!a(t)||0!=Object.values(t).length))}function l(t){return t&&"function"===typeof t}n("6a61");function f(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,i)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){f(o,r,i,a,c,"next",t)}function c(t){f(o,r,i,a,c,"throw",t)}a(void 0)}))}}n("32ea"),n("aa18"),n("982e");var h,p,m=[],v={hover:function(t){},focus:function(t){var e=this;t.addEventListener("focus",(function(t){e.changeVisible()})),t.addEventListener("blur",(function(t){e.changeVisible()}))},click:function(t){var e=this;t.addEventListener("click",(function(t){t.stopPropagation(),$.hide(),e.changeVisible()}))},contextmenu:function(t){var e=this;t.addEventListener("contextmenu",(function(t){t.preventDefault(),e.changeVisible()}))}},g={name:"LemonPopover",props:{trigger:{type:String,default:"click",validator:function(t){return Object.keys(v).includes(t)}}},data:function(){return{popoverStyle:{},visible:!1}},created:function(){document.addEventListener("click",this._documentClickEvent),m.push(this.close)},mounted:function(){v[this.trigger].call(this,this.$slots.default[0].elm)},render:function(){var t=arguments[0];return t("span",{style:"position:relative"},[t("transition",{attrs:{name:"lemon-slide-top"}},[this.visible&&t("div",{class:"lemoLine truncated
|
||||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["index"]=e(require("vue")):t["index"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="112a")}({"01be":function(t,e,n){},"0353":function(t,e,n){"use strict";var r=n("6bf8"),i=RegExp.prototype.exec,o=String.prototype.replace,a=i,c="lastIndex",s=function(){var t=/a/,e=/b*/g;return i.call(t,"a"),i.call(e,"a"),0!==t[c]||0!==e[c]}(),u=void 0!==/()??/.exec("")[1],l=s||u;l&&(a=function(t){var e,n,a,l,f=this;return u&&(n=new RegExp("^"+f.source+"$(?!\\s)",r.call(f))),s&&(e=f[c]),a=i.call(f,t),s&&a&&(f[c]=f.global?a.index+a[0].length:e),u&&a&&a.length>1&&o.call(a[0],n,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(a[l]=void 0)})),a}),t.exports=a},"0451":function(t,e,n){var r=n("9cff"),i=n("d1cb"),o=n("839a")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}},"0484":function(t,e,n){},"04f4":function(t,e,n){"use strict";n("de97")},"05fd":function(t,e,n){t.exports=n("baa7")("native-function-to-string",Function.toString)},"065d":function(t,e,n){var r=n("bb8b"),i=n("5edc");t.exports=n("26df")?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},"065e":function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"0926":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"0b34":function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"0c29":function(t,e){e.f=Object.getOwnPropertySymbols},"0c84":function(t,e,n){"use strict";var r=n("1663")(!0);n("120f")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},"0e15":function(t,e,n){"use strict";n("d5e9")},"112a":function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("e67d"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));n("a450"),n("1bc7");var i=n("8bbf"),o=n.n(i);n("3269"),n("25ba"),n("b3d7"),n("4057");function a(t){return"[object Object]"===Object.prototype.toString.call(t)}function c(t){return"string"==typeof t}function s(t){return(new Date).getTime()-t<864e5}function u(t){return!t||(!(!Array.isArray(t)||0!=t.length)||!(!a(t)||0!=Object.values(t).length))}function l(t){return t&&"function"===typeof t}n("6a61");function f(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,i)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){f(o,r,i,a,c,"next",t)}function c(t){f(o,r,i,a,c,"throw",t)}a(void 0)}))}}n("32ea"),n("aa18"),n("982e");var h,p,m=[],v={hover:function(t){},focus:function(t){var e=this;t.addEventListener("focus",(function(t){e.changeVisible()})),t.addEventListener("blur",(function(t){e.changeVisible()}))},click:function(t){var e=this;t.addEventListener("click",(function(t){t.stopPropagation(),$.hide(),e.changeVisible()}))},contextmenu:function(t){var e=this;t.addEventListener("contextmenu",(function(t){t.preventDefault(),e.changeVisible()}))}},g={name:"LemonPopover",props:{trigger:{type:String,default:"click",validator:function(t){return Object.keys(v).includes(t)}}},data:function(){return{popoverStyle:{},visible:!1}},created:function(){document.addEventListener("click",this._documentClickEvent),m.push(this.close)},mounted:function(){v[this.trigger].call(this,this.$slots.default[0].elm)},render:function(){var t=arguments[0];return t("span",{style:"position:relative"},[t("transition",{attrs:{name:"lemon-slide-top"}},[this.visible&&t("div",{class:"lemoLine truncated
|
||||
+70
-14
@@ -383,6 +383,51 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">抽屉配置 DrawerOption</div>
|
||||
<table class="table">
|
||||
<tr class="table-head">
|
||||
<th>名称</th>
|
||||
<th>说明</th>
|
||||
<th>类型</th>
|
||||
<th>示例</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">width</td>
|
||||
<td width="350">宽度,可以设置百分比</td>
|
||||
<td width="150">String | Number</td>
|
||||
<td width="100">-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">height</td>
|
||||
<td width="350">高度,可以设置百分比</td>
|
||||
<td width="150">String | Number</td>
|
||||
<td width="100">-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">offsetX</td>
|
||||
<td width="350">X偏移值,可以设置百分比</td>
|
||||
<td width="150">String | Number</td>
|
||||
<td width="100">-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">offsetY</td>
|
||||
<td width="350">Y偏移值,可以设置百分比</td>
|
||||
<td width="150">String | Number</td>
|
||||
<td width="100">-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150">position</td>
|
||||
<td width="350">位置</td>
|
||||
<td width="150">right | rightInside | center</td>
|
||||
<td width="100">-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">组件属性</div>
|
||||
<table class="table">
|
||||
<tr class="table-head">
|
||||
@@ -656,7 +701,7 @@
|
||||
<tr>
|
||||
<td>changeDrawer</td>
|
||||
<td>切换右侧抽屉显示/隐藏,vnode 为抽屉内容</td>
|
||||
<td>Function(vnode)</td>
|
||||
<td>Function(DrawerOption)</td>
|
||||
<td>-</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -1799,22 +1844,31 @@ export default {
|
||||
});
|
||||
},
|
||||
changeDrawer(contact, instance) {
|
||||
instance.changeDrawer(() => {
|
||||
return (
|
||||
<div class="drawer-content">
|
||||
<p>
|
||||
<b>自定义抽屉</b>
|
||||
</p>
|
||||
<p>{contact.displayName}</p>
|
||||
</div>
|
||||
);
|
||||
instance.changeDrawer({
|
||||
//width: 240,
|
||||
//height: "90%",
|
||||
//offsetX:0 ,
|
||||
//offsetY: ,
|
||||
//position: "center",
|
||||
// inside: true,
|
||||
// offsetX: -280,
|
||||
// offsetY: -100,
|
||||
render: () => {
|
||||
return (
|
||||
<div class="drawer-content">
|
||||
<p>
|
||||
<b>自定义抽屉</b>
|
||||
</p>
|
||||
<p>{contact.displayName}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleChangeContact(contact, instance) {
|
||||
console.log("Event:change-contact");
|
||||
instance.updateContact({
|
||||
id: contact.id,
|
||||
//displayName: "123",
|
||||
unread: 0
|
||||
});
|
||||
instance.closeDrawer();
|
||||
@@ -1960,9 +2014,11 @@ a
|
||||
font-weight normal
|
||||
.imui-center
|
||||
margin-bottom 60px
|
||||
.lemon-wrapper,
|
||||
.lemon-wrapper--drawer-show .lemon-drawer
|
||||
box-shadow 0 0 30px rgba(0,0,0,0.1);
|
||||
.lemon-wrapper
|
||||
border:1px solid #ddd;
|
||||
.lemon-drawer
|
||||
border:1px solid #ddd;
|
||||
border-left:0;
|
||||
.drawer-content
|
||||
padding 15px
|
||||
.more
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.lemon-message.lemon-message-voice{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message.lemon-message-voice .lemon-message__content{border:2px solid #000;font-size:12px;cursor:pointer}.lemon-message.lemon-message-voice .lemon-message__content:before{display:none}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}body{font-family:Microsoft YaHei;background:#f6f6f6!important}#app{width:90%;margin:0 auto;padding-bottom:100px}#app .scroll-top{cursor:pointer;position:fixed;bottom:40px;left:50%;border-radius:50%;background:#fff;font-size:18px;overflow:hidden;width:40px;height:40px;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;-webkit-transform:rotate(-45deg) translateX(-50%);transform:rotate(-45deg) translateX(-50%);-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}#app .scroll-top:hover{font-size:22px}a{color:#0c5ed9;text-decoration:none;font-size:12px}.action{margin-top:20px}.action .lemon-button{margin-right:10px;margin-bottom:10px}.link{font-size:14px;margin-top:15px}.link a{margin:0 5px;text-decoration:none;background:#ffba00;border-radius:4px;padding:5px 10px;color:rgba(0,0,0,.8)}.link a,.logo{display:inline-block}.logo{position:relative;margin:60px auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.logo-text{font-size:38px}.logo-sub{font-size:18px;color:#999;font-weight:300}.logo-badge{position:absolute;top:-10px;left:230px;background:#000;border-radius:16px;color:#f9f9f9;font-size:12px;padding:4px 8px}.title{font-size:24px;line-height:26px;border-left:1px solid #ffba00;padding-left:15px;margin-bottom:15px;margin-top:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.table{width:100%;border-radius:10px;background:#fff;border-collapse:collapse}.table tr{cursor:pointer}.table tr:not(.table-head):hover{background:#ffba00!important}.table tr:nth-of-type(2n){background:#f9f9f9}.table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999}.table td,.table th{text-align:left;padding:10px 15px;font-size:14px;font-weight:400}.imui-center{margin-bottom:60px}.imui-center .lemon-wrapper{border:1px solid #ddd}.imui-center .lemon-drawer{border:1px solid #ddd;border-left:0}.drawer-content{padding:15px}.more{font-size:12px;line-height:24px;height:24px;position:absolute;top:14px;right:14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#f1f1f1;display:inline-block;border-radius:4px;background:#111;padding:0 8px}.more:active{background:#999}.bar{line-height:30px;background:#fff;margin:15px;color:#666;font-size:12px}.bar,.cover{text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cover{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cover i{font-size:84px;color:#e6e6e6}.cover p{font-size:18px;color:#ddd;line-height:50px}.article-item{line-height:34px;cursor:pointer}.article-item:hover{text-decoration:underline;color:#318efd}pre{background:#fff;border-radius:8px;padding:15px}.lemon-simple .lemon-container{z-index:5}.lemon-simple .lemon-drawer{z-index:4}input#switch[type=checkbox]{height:0;width:0;display:none}label#switch-label{cursor:pointer;text-indent:-9999px;width:34px;height:20px;background:#aaa;display:block;border-radius:100px;position:relative}label#switch-label:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:20px;-webkit-transition:.3s;transition:.3s}input#switch:checked+label{background:#0fd547}input#switch:checked+label:after{left:calc(100% - 2px);-webkit-transform:translateX(-100%);transform:translateX(-100%)}label#switch-label:active:after{width:20px}.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-10px) scale(.8);opacity:0}.lemon-tabs{background:Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
.lemon-message.lemon-message-voice{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.lemon-message.lemon-message-voice .lemon-message__content{border:2px solid #000;font-size:12px;cursor:pointer}.lemon-message.lemon-message-voice .lemon-message__content:before{display:none}::-moz-selection{background:#000;color:#fff}::selection{background:#000;color:#fff}body{font-family:Microsoft YaHei;background:#f6f6f6!important}#app{width:90%;margin:0 auto;padding-bottom:100px}#app .scroll-top{cursor:pointer;position:fixed;bottom:40px;left:50%;border-radius:50%;background:#fff;font-size:18px;overflow:hidden;width:40px;height:40px;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;-webkit-transform:rotate(-45deg) translateX(-50%);transform:rotate(-45deg) translateX(-50%);-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}#app .scroll-top:hover{font-size:22px}a{color:#0c5ed9;text-decoration:none;font-size:12px}.action{margin-top:20px}.action .lemon-button{margin-right:10px;margin-bottom:10px}.link{font-size:14px;margin-top:15px}.link a{margin:0 5px;text-decoration:none;background:#ffba00;border-radius:4px;padding:5px 10px;color:rgba(0,0,0,.8)}.link a,.logo{display:inline-block}.logo{position:relative;margin:60px auto;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.logo-text{font-size:38px}.logo-sub{font-size:18px;color:#999;font-weight:300}.logo-badge{position:absolute;top:-10px;left:230px;background:#000;border-radius:16px;color:#f9f9f9;font-size:12px;padding:4px 8px}.title{font-size:24px;line-height:26px;border-left:1px solid #ffba00;padding-left:15px;margin-bottom:15px;margin-top:30px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.table{width:100%;border-radius:10px;background:#fff;border-collapse:collapse}.table tr{cursor:pointer}.table tr:not(.table-head):hover{background:#ffba00!important}.table tr:nth-of-type(2n){background:#f9f9f9}.table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#999}.table td,.table th{text-align:left;padding:10px 15px;font-size:14px;font-weight:400}.imui-center{margin-bottom:60px}.imui-center .lemon-wrapper,.imui-center .lemon-wrapper--drawer-show .lemon-drawer{-webkit-box-shadow:0 0 30px rgba(0,0,0,.1);box-shadow:0 0 30px rgba(0,0,0,.1)}.drawer-content{padding:15px}.more{font-size:12px;line-height:24px;height:24px;position:absolute;top:14px;right:14px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#f1f1f1;display:inline-block;border-radius:4px;background:#111;padding:0 8px}.more:active{background:#999}.bar{line-height:30px;background:#fff;margin:15px;color:#666;font-size:12px}.bar,.cover{text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cover{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.cover i{font-size:84px;color:#e6e6e6}.cover p{font-size:18px;color:#ddd;line-height:50px}.article-item{line-height:34px;cursor:pointer}.article-item:hover{text-decoration:underline;color:#318efd}pre{background:#fff;border-radius:8px;padding:15px}.lemon-simple .lemon-container{z-index:5}.lemon-simple .lemon-drawer{z-index:4}input#switch[type=checkbox]{height:0;width:0;display:none}label#switch-label{cursor:pointer;text-indent:-9999px;width:34px;height:20px;background:#aaa;display:block;border-radius:100px;position:relative}label#switch-label:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:20px;-webkit-transition:.3s;transition:.3s}input#switch:checked+label{background:#0fd547}input#switch:checked+label:after{left:calc(100% - 2px);-webkit-transform:translateX(-100%);transform:translateX(-100%)}label#switch-label:active:after{width:20px}.lemon-popover{border:1px solid #eee;font-size:14px;font-variant:tabular-nums;line-height:1.5;color:rgba(0,0,0,.65);z-index:10;background-color:#fff;border-radius:4px;-webkit-box-shadow:0 2px 8px rgba(0,0,0,.08);box-shadow:0 2px 8px rgba(0,0,0,.08);position:absolute;-webkit-transform-origin:50% 150%;transform-origin:50% 150%}.lemon-popover__content{padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:1}.lemon-popover__arrow{left:50%;-webkit-transform:translateX(-50%) rotate(45deg);transform:translateX(-50%) rotate(45deg);position:absolute;z-index:0;bottom:-4px;-webkit-box-shadow:3px 3px 7px rgba(0,0,0,.07);box-shadow:3px 3px 7px rgba(0,0,0,.07);width:8px;height:8px;background:#fff}.lemon-slide-top-enter-active,.lemon-slide-top-leave-active{-webkit-transition:all .2s cubic-bezier(.645,.045,.355,1);transition:all .2s cubic-bezier(.645,.045,.355,1)}.lemon-slide-top-enter,.lemon-slide-top-leave-to{-webkit-transform:translateY(-10px) scale(.8);transform:translateY(-1Line truncated
|
||||
Vendored
+1
-1
@@ -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.e91d4c69.css rel=preload as=style><link href=js/chunk-vendors.2abee366.js rel=preload as=script><link href=js/index.6db35f89.js rel=preload as=script><link href=css/index.e91d4c69.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.2abee366.js></script><script src=js/index.6db35f89.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.4c3079e2.css rel=preload as=style><link href=js/chunk-vendors.2abee366.js rel=preload as=script><link href=js/index.eb3bbc56.js rel=preload as=script><link href=css/index.4c3079e2.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.2abee366.js></script><script src=js/index.eb3bbc56.js></script></body></html>
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
(function(t){function e(e){for(var i,r,o=e[0],c=e[1],d=e[2],u=0,m=[];u<o.length;u++)r=o[u],Object.prototype.hasOwnProperty.call(s,r)&&s[r]&&m.push(s[r][0]),s[r]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=c[i]);l&&l(e);while(m.length)m.shift()();return a.push.apply(a,d||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],i=!0,o=1;o<n.length;o++){var c=n[o];0!==s[c]&&(i=!1)}i&&(a.splice(e--,1),t=r(r.s=n[0]))}return t}var i={},s={index:0},a=[];function r(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var d=0;d<o.length;d++)e(o[d]);var l=c;a.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("c31f")},"01be":function(t,e,n){},"0484":function(t,e,n){},"04f4":function(t,e,n){"use strict";n("de97")},"0e15":function(t,e,n){"use strict";n("d5e9")},1179:function(t,e,n){},16636:function(t,e,n){"use strict";n("e706")},"1c18":function(t,e,n){},"1e45":function(t,e,n){"use strict";n("e021")},3423:function(t,e,n){"use strict";n("4942")},3550:function(t,e,n){},"436f":function(t,e,n){"use strict";n("1179")},"476d":function(t,e,n){"use strict";n("9c51")},4942:function(t,e,n){},"49c2":function(t,e,n){"use strict";n("5d33")},"4c4e":function(t,e,n){},"4d21":function(t,e,n){"use strict";n("1c18")},"5d33":function(t,e,n){},"6a2b":function(t,e,n){},"909e":function(t,e,n){"use strict";n("0484")},9224:function(t){t.exports=JSON.parse('{"name":"lemon-imui","version":"1.6.6","main":"dist/index.umd.min.js","description":"基于 VUE2.0 的 IM 聊天组件","homepage":"http://june000.gitee.io/lemon-im/","keywords":["vue","im","chat","vueim","vuechat","webim","webchat"],"repository":{"type":"git","url":"git+https://github.com/fanjyy/lemon-imui.git"},"scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build --target lib --name index packages/index.js","build-examples":"vue-cli-service build --dest examples/dist examples/main.js","lint":"vue-cli-service lint"},"dependencies":{"vue":"^2.6.10"},"devDependencies":{"@vue/cli-plugin-babel":"^3.6.0","@vue/cli-plugin-eslint":"^3.6.0","@vue/cli-service":"^3.6.0","@vue/eslint-config-prettier":"^4.0.1","babel-eslint":"^10.0.2","eslint":"^5.16.0","eslint-plugin-vue":"^5.2.3","stylus":"^0.54.5","stylus-loader":"^3.0.2","vue-template-compiler":"^2.5.21"},"author":"fanjun","license":"MIT"}')},"9b01":function(t,e,n){"use strict";n("aa55")},"9c51":function(t,e,n){},"9c9b":function(t,e,n){"use strict";n("dbd8")},aa55:function(t,e,n){},c31f:function(t,e,n){"use strict";n.r(e);n("25ba"),n("5f1c"),n("6ba0"),n("b47f");var i=n("a593"),s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"scroll-top",on:{click:t.scrollToTop}},[t._v("🚀")]),n("div",{staticClass:"logo"},[n("div",{staticClass:"logo-text"},[n("b",[t._v("Lemon")]),t._v(" IMUI"),n("span",{staticClass:"logo-badge"},[t._v(t._s(this.packageData.version))])]),n("div",{staticClass:"logo-sub"},[t._v(t._s(this.packageData.description))]),t._m(0),n("br"),t._m(1),t._m(2)]),n("div",{staticClass:"imui-center"},[n("lemon-imui",{ref:"IMUI",attrs:{user:t.user,contextmenu:t.contextmenu,"contact-contextmenu":t.contactContextmenu,theme:t.theme,"hide-menu":t.hideMenu,"hide-menu-avatar":t.hideMenuAvatar,"hide-message-name":t.hideMessageName,"hide-message-time":t.hideMessageTime},on:{"change-menu":t.handleChangeMenu,"change-contact":t.handleChangeContact,"pull-messages":t.handlePullMessages,"message-click":t.handleMessageClick,"menu-avatar-click":t.handleMenuAvatarClick,send:t.handleSend},scopedSlots:t._u([{key:"cover",fn:function(){return[n("div",{staticClass:"cover"},[n("i",{staticClass:"lemon-icon-message"}),n("p",[n("b",[t._v("自定义封面 Lemon")]),t._v(" IMUI")])])]},proxy:!0},{key:"message-title",fn:function(e){return[n("span",[t._v(t._s(e.displayName))]),n("small",{staticClass:"more",on:{click:function(n){return t.changeDrawer(e,t.$refs.IMUI)}}},[t._v(t._s(t.$refs.IMUI&&t.$refs.IMUI.drawerVisible?"关闭":"打开")+"抽屉")])]}}])}),n("a",{staticStyle:{"font-size":"14px"},attrs:{target:"_blank",href:"https://codesandbox.io/s/sweet-c
Line truncated
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
(function(t){function e(e){for(var i,r,o=e[0],c=e[1],d=e[2],u=0,m=[];u<o.length;u++)r=o[u],Object.prototype.hasOwnProperty.call(s,r)&&s[r]&&m.push(s[r][0]),s[r]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=c[i]);l&&l(e);while(m.length)m.shift()();return a.push.apply(a,d||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],i=!0,o=1;o<n.length;o++){var c=n[o];0!==s[c]&&(i=!1)}i&&(a.splice(e--,1),t=r(r.s=n[0]))}return t}var i={},s={index:0},a=[];function r(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var d=0;d<o.length;d++)e(o[d]);var l=c;a.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("c31f")},"01be":function(t,e,n){},"0484":function(t,e,n){},"04f4":function(t,e,n){"use strict";n("de97")},"0e15":function(t,e,n){"use strict";n("d5e9")},1179:function(t,e,n){},16636:function(t,e,n){"use strict";n("e706")},"1c18":function(t,e,n){},"1e45":function(t,e,n){"use strict";n("e021")},3423:function(t,e,n){"use strict";n("4942")},3550:function(t,e,n){},"436f":function(t,e,n){"use strict";n("1179")},"476d":function(t,e,n){"use strict";n("9c51")},4942:function(t,e,n){},"49c2":function(t,e,n){"use strict";n("5d33")},"4c4e":function(t,e,n){},"4d21":function(t,e,n){"use strict";n("1c18")},"5d33":function(t,e,n){},"6a2b":function(t,e,n){},"909e":function(t,e,n){"use strict";n("0484")},9224:function(t){t.exports=JSON.parse('{"name":"lemon-imui","version":"1.6.7","main":"dist/index.umd.min.js","description":"基于 VUE2.0 的 IM 聊天组件","homepage":"http://june000.gitee.io/lemon-im/","keywords":["vue","im","chat","vueim","vuechat","webim","webchat"],"repository":{"type":"git","url":"git+https://github.com/fanjyy/lemon-imui.git"},"scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build --target lib --name index packages/index.js","build-examples":"vue-cli-service build --dest examples/dist examples/main.js","lint":"vue-cli-service lint"},"dependencies":{"vue":"^2.6.10"},"devDependencies":{"@vue/cli-plugin-babel":"^3.6.0","@vue/cli-plugin-eslint":"^3.6.0","@vue/cli-service":"^3.6.0","@vue/eslint-config-prettier":"^4.0.1","babel-eslint":"^10.0.2","eslint":"^5.16.0","eslint-plugin-vue":"^5.2.3","stylus":"^0.54.5","stylus-loader":"^3.0.2","vue-template-compiler":"^2.5.21"},"author":"fanjun","license":"MIT"}')},"9b01":function(t,e,n){"use strict";n("aa55")},"9c51":function(t,e,n){},"9c9b":function(t,e,n){"use strict";n("dbd8")},aa55:function(t,e,n){},c31f:function(t,e,n){"use strict";n.r(e);n("25ba"),n("5f1c"),n("6ba0"),n("b47f");var i=n("a593"),s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"scroll-top",on:{click:t.scrollToTop}},[t._v("🚀")]),n("div",{staticClass:"logo"},[n("div",{staticClass:"logo-text"},[n("b",[t._v("Lemon")]),t._v(" IMUI"),n("span",{staticClass:"logo-badge"},[t._v(t._s(this.packageData.version))])]),n("div",{staticClass:"logo-sub"},[t._v(t._s(this.packageData.description))]),t._m(0),n("br"),t._m(1),t._m(2)]),n("div",{staticClass:"imui-center"},[n("lemon-imui",{ref:"IMUI",attrs:{user:t.user,contextmenu:t.contextmenu,"contact-contextmenu":t.contactContextmenu,theme:t.theme,"hide-menu":t.hideMenu,"hide-menu-avatar":t.hideMenuAvatar,"hide-message-name":t.hideMessageName,"hide-message-time":t.hideMessageTime},on:{"change-menu":t.handleChangeMenu,"change-contact":t.handleChangeContact,"pull-messages":t.handlePullMessages,"message-click":t.handleMessageClick,"menu-avatar-click":t.handleMenuAvatarClick,send:t.handleSend},scopedSlots:t._u([{key:"cover",fn:function(){return[n("div",{staticClass:"cover"},[n("i",{staticClass:"lemon-icon-message"}),n("p",[n("b",[t._v("自定义封面 Lemon")]),t._v(" IMUI")])])]},proxy:!0},{key:"message-title",fn:function(e){return[n("span",[t._v(t._s(e.displayName))]),n("small",{staticClass:"more",on:{click:function(n){return t.changeDrawer(e,t.$refs.IMUI)}}},[t._v(t._s(t.$refs.IMUI&&t.$refs.IMUI.drawerVisible?"关闭":"打开")+"抽屉")])]}}])}),n("a",{staticStyle:{"font-size":"14px"},attrs:{target:"_blank",href:"https://codesandbox.io/s/sweet-c
Line truncated
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lemon-imui",
|
||||
"version": "1.6.6",
|
||||
"version": "1.6.7",
|
||||
"main": "dist/index.umd.min.js",
|
||||
"description": "基于 VUE2.0 的 IM 聊天组件",
|
||||
"homepage": "http://june000.gitee.io/lemon-im/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { useScopedSlot, funCall, generateUUID, cloneDeep } from "utils";
|
||||
import { useScopedSlot, funCall, generateUUID } from "utils";
|
||||
import { isFunction, isString, isEmpty } from "utils/validate";
|
||||
import contextmenu from "../directives/contextmenu";
|
||||
import {
|
||||
@@ -13,6 +13,13 @@ import MemoryCache from "utils/cache/memory";
|
||||
|
||||
const allMessages = {};
|
||||
const emojiMap = {};
|
||||
const toPx = val => {
|
||||
return isString(val) ? val : `${val}px`;
|
||||
};
|
||||
const toPoint = str => {
|
||||
return str.replace("%", "") / 100;
|
||||
};
|
||||
|
||||
let renderDrawerContent = () => {};
|
||||
|
||||
export default {
|
||||
@@ -24,12 +31,12 @@ export default {
|
||||
},
|
||||
props: {
|
||||
width: {
|
||||
type: String,
|
||||
default: "850px"
|
||||
type: [String, Number],
|
||||
default: 850
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "580px"
|
||||
type: [String, Number],
|
||||
default: 580
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
@@ -259,9 +266,10 @@ export default {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
width: this.width,
|
||||
height: this.height
|
||||
width: toPx(this.width),
|
||||
height: toPx(this.height)
|
||||
}}
|
||||
ref="wrapper"
|
||||
class={[
|
||||
"lemon-wrapper",
|
||||
`lemon-wrapper--theme-${this.theme}`,
|
||||
@@ -420,7 +428,7 @@ export default {
|
||||
},
|
||||
_renderDrawer() {
|
||||
return this._menuIsMessages() && this.currentContactId ? (
|
||||
<div class="lemon-drawer">
|
||||
<div class="lemon-drawer" ref="drawer">
|
||||
{renderDrawerContent()}
|
||||
{useScopedSlot(this.$scopedSlots.drawer, "", this.currentContact)}
|
||||
</div>
|
||||
@@ -462,13 +470,13 @@ export default {
|
||||
v-show={this._menuIsMessages() && defIsShow && curact.id}
|
||||
>
|
||||
<div class="lemon-container__title">
|
||||
<div class="lemon-container__displayname">
|
||||
{useScopedSlot(
|
||||
this.$scopedSlots["message-title"],
|
||||
curact.displayName,
|
||||
curact
|
||||
)}
|
||||
</div>
|
||||
{useScopedSlot(
|
||||
this.$scopedSlots["message-title"],
|
||||
<div class="lemon-container__displayname">
|
||||
{curact.displayName}
|
||||
</div>,
|
||||
curact
|
||||
)}
|
||||
</div>
|
||||
<lemon-messages
|
||||
ref="messages"
|
||||
@@ -931,12 +939,52 @@ export default {
|
||||
getMessages(contactId) {
|
||||
return (contactId ? allMessages[contactId] : allMessages) || [];
|
||||
},
|
||||
changeDrawer(render) {
|
||||
changeDrawer(params) {
|
||||
this.drawerVisible = !this.drawerVisible;
|
||||
if (this.drawerVisible == true) this.openDrawer(render);
|
||||
if (this.drawerVisible == true) this.openDrawer(params);
|
||||
},
|
||||
openDrawer(render) {
|
||||
renderDrawerContent = render || new Function();
|
||||
// openDrawer(data) {
|
||||
// renderDrawerContent = data || new Function();
|
||||
// this.drawerVisible = true;
|
||||
// },
|
||||
openDrawer(params) {
|
||||
renderDrawerContent = isFunction(params)
|
||||
? params
|
||||
: params.render || new Function();
|
||||
const wrapperWidth = this.$refs.wrapper.clientWidth;
|
||||
const wrapperHeight = this.$refs.wrapper.clientHeight;
|
||||
let width = params.width || 200;
|
||||
let height = params.height || wrapperHeight;
|
||||
let offsetX = params.offsetX || 0;
|
||||
let offsetY = params.offsetY || 0;
|
||||
const position = params.position || "right";
|
||||
if (isString(width)) width = wrapperWidth * toPoint(width);
|
||||
if (isString(height)) height = wrapperHeight * toPoint(height);
|
||||
if (isString(offsetX)) offsetX = wrapperWidth * toPoint(offsetX);
|
||||
if (isString(offsetY)) offsetY = wrapperHeight * toPoint(offsetY);
|
||||
|
||||
this.$refs.drawer.style.width = `${width}px`;
|
||||
this.$refs.drawer.style.height = `${height}px`;
|
||||
|
||||
let left = 0;
|
||||
let top = 0;
|
||||
let shadow = "";
|
||||
if (position == "right") {
|
||||
left = wrapperWidth;
|
||||
} else if (position == "rightInside") {
|
||||
left = wrapperWidth - width;
|
||||
shadow = `-15px 0 16px -14px rgba(0,0,0,0.08)`;
|
||||
} else if (position == "center") {
|
||||
left = wrapperWidth / 2 - width / 2;
|
||||
top = wrapperHeight / 2 - height / 2;
|
||||
shadow = `0 0 20px rgba(0,0,0,0.08)`;
|
||||
}
|
||||
left += offsetX;
|
||||
top += offsetY + -1;
|
||||
this.$refs.drawer.style.top = `${top}px`;
|
||||
this.$refs.drawer.style.left = `${left}px`;
|
||||
this.$refs.drawer.style.boxShadow = shadow;
|
||||
|
||||
this.drawerVisible = true;
|
||||
},
|
||||
closeDrawer() {
|
||||
@@ -946,7 +994,6 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="stylus">
|
||||
drawer-width = 200px
|
||||
bezier = cubic-bezier(0.645, 0.045, 0.355, 1)
|
||||
@import '~styles/utils/index'
|
||||
|
||||
@@ -1033,18 +1080,15 @@ bezier = cubic-bezier(0.645, 0.045, 0.355, 1)
|
||||
+b(lemon-drawer)
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
overflow hidden
|
||||
background #f4f4f4
|
||||
background #f6f6f6
|
||||
transition width .4s bezier
|
||||
z-index 9
|
||||
width drawer-width
|
||||
height 100%
|
||||
box-sizing border-box
|
||||
z-index 11
|
||||
display none
|
||||
+b(lemon-wrapper)
|
||||
+m(drawer-show)
|
||||
+b(lemon-drawer)
|
||||
right -200px
|
||||
display block
|
||||
+b(lemon-contact-info)
|
||||
flex-column()
|
||||
justify-content center
|
||||
@@ -1097,7 +1141,7 @@ bezier = cubic-bezier(0.645, 0.045, 0.355, 1)
|
||||
font-variant tabular-nums
|
||||
line-height 1.5
|
||||
color rgba(0, 0, 0, 0.65)
|
||||
z-index 10
|
||||
z-index 9999
|
||||
background-color #fff
|
||||
border-radius 6px
|
||||
box-shadow 0 2px 8px rgba(0, 0, 0, 0.06)
|
||||
|
||||
Reference in new issue
Block a user