增加抽屉功能
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
|
||||
Reference in new issue
Block a user