bk-magic-vue 2.5.6 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bk-magic-vue.css +240 -2
- package/dist/bk-magic-vue.js +1137 -182
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/dist/fonts/iconcool.eot +0 -0
- package/dist/fonts/iconcool.svg +27 -0
- package/dist/fonts/iconcool.ttf +0 -0
- package/dist/fonts/iconcool.woff +0 -0
- package/lib/cascade.js +35 -32
- package/lib/locale/lang/en-US.js +5 -1
- package/lib/locale/lang/zh-CN.js +5 -1
- package/lib/message.js +1182 -623
- package/lib/option.js +692 -63
- package/lib/pagination.js +383 -105
- package/lib/search-select.js +1604 -1288
- package/lib/select.js +321 -43
- package/lib/table.js +17 -2
- package/lib/ui/bk-magic-vue.css +240 -2
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/common.css +36 -0
- package/lib/ui/common.min.css +1 -1
- package/lib/ui/common.min.css.map +1 -1
- package/lib/ui/fonts/iconcool.eot +0 -0
- package/lib/ui/fonts/iconcool.svg +27 -0
- package/lib/ui/fonts/iconcool.ttf +0 -0
- package/lib/ui/fonts/iconcool.woff +0 -0
- package/lib/ui/iconfont.css +36 -0
- package/lib/ui/iconfont.min.css +1 -1
- package/lib/ui/iconfont.min.css.map +1 -1
- package/lib/ui/message.css +233 -1
- package/lib/ui/message.min.css +1 -1
- package/lib/ui/message.min.css.map +1 -1
- package/lib/ui/search-select-menu.css +7 -1
- package/lib/ui/search-select-menu.min.css +1 -1
- package/lib/ui/search-select-menu.min.css.map +1 -1
- package/lib/ui/search-select.css +5 -0
- package/lib/ui/search-select.min.css +1 -1
- package/lib/ui/search-select.min.css.map +1 -1
- package/lib/ui/select.css +4 -0
- package/lib/ui/select.min.css +1 -1
- package/lib/ui/select.min.css.map +1 -1
- package/package.json +4 -2
package/dist/bk-magic-vue.js
CHANGED
|
@@ -8695,7 +8695,11 @@
|
|
|
8695
8695
|
},
|
|
8696
8696
|
message: {
|
|
8697
8697
|
copy: 'copy',
|
|
8698
|
-
copied: 'copied'
|
|
8698
|
+
copied: 'copied',
|
|
8699
|
+
assistant: 'Assistant',
|
|
8700
|
+
details: 'Details',
|
|
8701
|
+
copySuccess: 'Successfully',
|
|
8702
|
+
copyFailed: 'Copy Failed'
|
|
8699
8703
|
},
|
|
8700
8704
|
image: {
|
|
8701
8705
|
zoomIn: 'zoom in',
|
|
@@ -8854,7 +8858,11 @@
|
|
|
8854
8858
|
},
|
|
8855
8859
|
message: {
|
|
8856
8860
|
copy: '复制',
|
|
8857
|
-
copied: '已复制'
|
|
8861
|
+
copied: '已复制',
|
|
8862
|
+
assistant: '助手',
|
|
8863
|
+
details: '详情',
|
|
8864
|
+
copySuccess: '复制成功',
|
|
8865
|
+
copyFailed: '复制失败'
|
|
8858
8866
|
},
|
|
8859
8867
|
image: {
|
|
8860
8868
|
zoomIn: '放大',
|
|
@@ -30264,6 +30272,837 @@
|
|
|
30264
30272
|
|
|
30265
30273
|
var now$1 = now;
|
|
30266
30274
|
|
|
30275
|
+
var rApply = (_global.Reflect || {}).apply;
|
|
30276
|
+
var fApply = Function.apply;
|
|
30277
|
+
_export(_export.S + _export.F * !_fails(function () {
|
|
30278
|
+
rApply(function () { });
|
|
30279
|
+
}), 'Reflect', {
|
|
30280
|
+
apply: function apply(target, thisArgument, argumentsList) {
|
|
30281
|
+
var T = _aFunction(target);
|
|
30282
|
+
var L = _anObject(argumentsList);
|
|
30283
|
+
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
|
|
30284
|
+
}
|
|
30285
|
+
});
|
|
30286
|
+
|
|
30287
|
+
var apply = _core.Reflect.apply;
|
|
30288
|
+
|
|
30289
|
+
var apply$1 = apply;
|
|
30290
|
+
|
|
30291
|
+
var jsonFormatter_umd = createCommonjsModule(function (module, exports) {
|
|
30292
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){function t(t){return null===t?"null":typeof t}function e(t){return !!t&&"object"==typeof t}function r(t){if(void 0===t)return "";if(null===t)return "Object";if("object"==typeof t&&!t.constructor)return "Object";var e=/function ([^(]*)/.exec(t.constructor.toString());return e&&e.length>1?e[1]:""}function n(t,e,r){return "null"===t||"undefined"===t?t:("string"!==t&&"stringifiable"!==t||(r='"'+r.replace(/"/g,'\\"')+'"'),"function"===t?e.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":r)}function o(o){var i="";return e(o)?(i=r(o),Array.isArray(o)&&(i+="["+o.length+"]")):i=n(t(o),o,o),i}function i(t){return "json-formatter-"+t}function s(t,e,r){var n=document.createElement(t);return e&&n.classList.add(i(e)),void 0!==r&&(r instanceof Node?n.appendChild(r):n.appendChild(document.createTextNode(String(r)))),n}!function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");e.setAttribute("media","screen"),e.innerHTML=t,document.head.appendChild(e);}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var a=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,f=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,m=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,l=window.requestAnimationFrame||function(t){return t(),0},d={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null};return function(){function c(t,e,r,n){void 0===e&&(e=1),void 0===r&&(r=d),this.json=t,this.open=e,this.config=r,this.key=n,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=d.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=d.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=d.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=d.useToJSON),""===this.key&&(this.key='""');}return Object.defineProperty(c.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(t){this._isOpen=t;},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(a.test(this.json)||m.test(this.json)||f.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isUrl",{get:function(){return "string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isObject",{get:function(){return e(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isEmptyObject",{get:function(){return !this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"constructorName",{get:function(){return r(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":t(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"keys",{get:function(){if(this.isObject){var t=Object.keys(this.json);return !this.isArray&&this.config.sortPropertiesBy?t.sort(this.config.sortPropertiesBy):t}return []},enumerable:!0,configurable:!0}),c.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(i("open")));},c.prototype.openAtDepth=function(t){void 0===t&&(t=1),t<0||(this.open=t,this.isOpen=0!==t,this.element&&(this.removeChildren(!1),0===t?this.element.classList.remove(i("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(i("open")))));},c.prototype.getInlinepreview=function(){var t=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(o).join(", ")+"]";var e=this.keys,r=e.slice(0,this.config.hoverPreviewFieldCount).map((function(e){return e+":"+o(t.json[e])})),n=e.length>=this.config.hoverPreviewFieldCount?"…":"";return "{"+r.join(", ")+n+"}"},c.prototype.render=function(){this.element=s("div","row");var t=this.isObject?s("a","toggler-link"):s("span");if(this.isObject&&!this.useToJSON&&t.appendChild(s("span","toggler")),this.hasKey&&t.appendChild(s("span","key",this.key+":")),this.isObject&&!this.useToJSON){var e=s("span","value"),r=s("span"),o=s("span","constructor-name",this.constructorName);if(r.appendChild(o),this.isArray){var a=s("span");a.appendChild(s("span","bracket","[")),a.appendChild(s("span","number",this.json.length)),a.appendChild(s("span","bracket","]")),r.appendChild(a);}e.appendChild(r),t.appendChild(e);}else{(e=this.isUrl?s("a"):s("span")).classList.add(i(this.type)),this.isDate&&e.classList.add(i("date")),this.isUrl&&(e.classList.add(i("url")),e.setAttribute("href",this.json));var f=n(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);e.appendChild(document.createTextNode(f)),t.appendChild(e);}if(this.isObject&&this.config.hoverPreviewEnabled){var m=s("span","preview-text");m.appendChild(document.createTextNode(this.getInlinepreview())),t.appendChild(m);}var l=s("div","children");return this.isObject&&l.classList.add(i("object")),this.isArray&&l.classList.add(i("array")),this.isEmpty&&l.classList.add(i("empty")),this.config&&this.config.theme&&this.element.classList.add(i(this.config.theme)),this.isOpen&&this.element.classList.add(i("open")),this.element.appendChild(t),this.element.appendChild(l),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&t.addEventListener("click",this.toggleOpen.bind(this)),this.element},c.prototype.appendChildren=function(t){var e=this;void 0===t&&(t=!1);var r=this.element.querySelector("div."+i("children"));if(r&&!this.isEmpty)if(t){var n=0,o=function(){var t=e.keys[n],i=new c(e.json[t],e.open-1,e.config,t);r.appendChild(i.render()),(n+=1)<e.keys.length&&(n>10?o():l(o));};l(o);}else this.keys.forEach((function(t){var n=new c(e.json[t],e.open-1,e.config,t);r.appendChild(n.render());}));},c.prototype.removeChildren=function(t){void 0===t&&(t=!1);var e=this.element.querySelector("div."+i("children"));if(t){var r=0,n=function(){e&&e.children.length&&(e.removeChild(e.children[0]),(r+=1)>10?n():l(n));};l(n);}else e&&(e.innerHTML="");},c}()}));
|
|
30293
|
+
});
|
|
30294
|
+
|
|
30295
|
+
var clipboard = createCommonjsModule(function (module, exports) {
|
|
30296
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
30297
|
+
module.exports = factory();
|
|
30298
|
+
})(commonjsGlobal, function() {
|
|
30299
|
+
return (function() {
|
|
30300
|
+
var __webpack_modules__ = ({
|
|
30301
|
+
686:
|
|
30302
|
+
(function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
30303
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
30304
|
+
"default": function() { return clipboard; }
|
|
30305
|
+
});
|
|
30306
|
+
var tiny_emitter = __webpack_require__(279);
|
|
30307
|
+
var tiny_emitter_default = __webpack_require__.n(tiny_emitter);
|
|
30308
|
+
var listen = __webpack_require__(370);
|
|
30309
|
+
var listen_default = __webpack_require__.n(listen);
|
|
30310
|
+
var src_select = __webpack_require__(817);
|
|
30311
|
+
var select_default = __webpack_require__.n(src_select);
|
|
30312
|
+
function command(type) {
|
|
30313
|
+
try {
|
|
30314
|
+
return document.execCommand(type);
|
|
30315
|
+
} catch (err) {
|
|
30316
|
+
return false;
|
|
30317
|
+
}
|
|
30318
|
+
}
|
|
30319
|
+
var ClipboardActionCut = function ClipboardActionCut(target) {
|
|
30320
|
+
var selectedText = select_default()(target);
|
|
30321
|
+
command('cut');
|
|
30322
|
+
return selectedText;
|
|
30323
|
+
};
|
|
30324
|
+
var actions_cut = (ClipboardActionCut);
|
|
30325
|
+
function createFakeElement(value) {
|
|
30326
|
+
var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
|
30327
|
+
var fakeElement = document.createElement('textarea');
|
|
30328
|
+
fakeElement.style.fontSize = '12pt';
|
|
30329
|
+
fakeElement.style.border = '0';
|
|
30330
|
+
fakeElement.style.padding = '0';
|
|
30331
|
+
fakeElement.style.margin = '0';
|
|
30332
|
+
fakeElement.style.position = 'absolute';
|
|
30333
|
+
fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px';
|
|
30334
|
+
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
|
30335
|
+
fakeElement.style.top = "".concat(yPosition, "px");
|
|
30336
|
+
fakeElement.setAttribute('readonly', '');
|
|
30337
|
+
fakeElement.value = value;
|
|
30338
|
+
return fakeElement;
|
|
30339
|
+
}
|
|
30340
|
+
var fakeCopyAction = function fakeCopyAction(value, options) {
|
|
30341
|
+
var fakeElement = createFakeElement(value);
|
|
30342
|
+
options.container.appendChild(fakeElement);
|
|
30343
|
+
var selectedText = select_default()(fakeElement);
|
|
30344
|
+
command('copy');
|
|
30345
|
+
fakeElement.remove();
|
|
30346
|
+
return selectedText;
|
|
30347
|
+
};
|
|
30348
|
+
var ClipboardActionCopy = function ClipboardActionCopy(target) {
|
|
30349
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
30350
|
+
container: document.body
|
|
30351
|
+
};
|
|
30352
|
+
var selectedText = '';
|
|
30353
|
+
if (typeof target === 'string') {
|
|
30354
|
+
selectedText = fakeCopyAction(target, options);
|
|
30355
|
+
} else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
|
|
30356
|
+
selectedText = fakeCopyAction(target.value, options);
|
|
30357
|
+
} else {
|
|
30358
|
+
selectedText = select_default()(target);
|
|
30359
|
+
command('copy');
|
|
30360
|
+
}
|
|
30361
|
+
return selectedText;
|
|
30362
|
+
};
|
|
30363
|
+
var actions_copy = (ClipboardActionCopy);
|
|
30364
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
30365
|
+
var ClipboardActionDefault = function ClipboardActionDefault() {
|
|
30366
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30367
|
+
var _options$action = options.action,
|
|
30368
|
+
action = _options$action === void 0 ? 'copy' : _options$action,
|
|
30369
|
+
container = options.container,
|
|
30370
|
+
target = options.target,
|
|
30371
|
+
text = options.text;
|
|
30372
|
+
if (action !== 'copy' && action !== 'cut') {
|
|
30373
|
+
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
30374
|
+
}
|
|
30375
|
+
if (target !== undefined) {
|
|
30376
|
+
if (target && _typeof(target) === 'object' && target.nodeType === 1) {
|
|
30377
|
+
if (action === 'copy' && target.hasAttribute('disabled')) {
|
|
30378
|
+
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
30379
|
+
}
|
|
30380
|
+
if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
|
|
30381
|
+
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
|
|
30382
|
+
}
|
|
30383
|
+
} else {
|
|
30384
|
+
throw new Error('Invalid "target" value, use a valid Element');
|
|
30385
|
+
}
|
|
30386
|
+
}
|
|
30387
|
+
if (text) {
|
|
30388
|
+
return actions_copy(text, {
|
|
30389
|
+
container: container
|
|
30390
|
+
});
|
|
30391
|
+
}
|
|
30392
|
+
if (target) {
|
|
30393
|
+
return action === 'cut' ? actions_cut(target) : actions_copy(target, {
|
|
30394
|
+
container: container
|
|
30395
|
+
});
|
|
30396
|
+
}
|
|
30397
|
+
};
|
|
30398
|
+
var actions_default = (ClipboardActionDefault);
|
|
30399
|
+
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
|
|
30400
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30401
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
30402
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
30403
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
30404
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30405
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
30406
|
+
function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
30407
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30408
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
30409
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30410
|
+
function getAttributeValue(suffix, element) {
|
|
30411
|
+
var attribute = "data-clipboard-".concat(suffix);
|
|
30412
|
+
if (!element.hasAttribute(attribute)) {
|
|
30413
|
+
return;
|
|
30414
|
+
}
|
|
30415
|
+
return element.getAttribute(attribute);
|
|
30416
|
+
}
|
|
30417
|
+
var Clipboard = function (_Emitter) {
|
|
30418
|
+
_inherits(Clipboard, _Emitter);
|
|
30419
|
+
var _super = _createSuper(Clipboard);
|
|
30420
|
+
function Clipboard(trigger, options) {
|
|
30421
|
+
var _this;
|
|
30422
|
+
_classCallCheck(this, Clipboard);
|
|
30423
|
+
_this = _super.call(this);
|
|
30424
|
+
_this.resolveOptions(options);
|
|
30425
|
+
_this.listenClick(trigger);
|
|
30426
|
+
return _this;
|
|
30427
|
+
}
|
|
30428
|
+
_createClass(Clipboard, [{
|
|
30429
|
+
key: "resolveOptions",
|
|
30430
|
+
value: function resolveOptions() {
|
|
30431
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30432
|
+
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
|
|
30433
|
+
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
|
|
30434
|
+
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
|
|
30435
|
+
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
|
|
30436
|
+
}
|
|
30437
|
+
}, {
|
|
30438
|
+
key: "listenClick",
|
|
30439
|
+
value: function listenClick(trigger) {
|
|
30440
|
+
var _this2 = this;
|
|
30441
|
+
this.listener = listen_default()(trigger, 'click', function (e) {
|
|
30442
|
+
return _this2.onClick(e);
|
|
30443
|
+
});
|
|
30444
|
+
}
|
|
30445
|
+
}, {
|
|
30446
|
+
key: "onClick",
|
|
30447
|
+
value: function onClick(e) {
|
|
30448
|
+
var trigger = e.delegateTarget || e.currentTarget;
|
|
30449
|
+
var action = this.action(trigger) || 'copy';
|
|
30450
|
+
var text = actions_default({
|
|
30451
|
+
action: action,
|
|
30452
|
+
container: this.container,
|
|
30453
|
+
target: this.target(trigger),
|
|
30454
|
+
text: this.text(trigger)
|
|
30455
|
+
});
|
|
30456
|
+
this.emit(text ? 'success' : 'error', {
|
|
30457
|
+
action: action,
|
|
30458
|
+
text: text,
|
|
30459
|
+
trigger: trigger,
|
|
30460
|
+
clearSelection: function clearSelection() {
|
|
30461
|
+
if (trigger) {
|
|
30462
|
+
trigger.focus();
|
|
30463
|
+
}
|
|
30464
|
+
window.getSelection().removeAllRanges();
|
|
30465
|
+
}
|
|
30466
|
+
});
|
|
30467
|
+
}
|
|
30468
|
+
}, {
|
|
30469
|
+
key: "defaultAction",
|
|
30470
|
+
value: function defaultAction(trigger) {
|
|
30471
|
+
return getAttributeValue('action', trigger);
|
|
30472
|
+
}
|
|
30473
|
+
}, {
|
|
30474
|
+
key: "defaultTarget",
|
|
30475
|
+
value: function defaultTarget(trigger) {
|
|
30476
|
+
var selector = getAttributeValue('target', trigger);
|
|
30477
|
+
if (selector) {
|
|
30478
|
+
return document.querySelector(selector);
|
|
30479
|
+
}
|
|
30480
|
+
}
|
|
30481
|
+
}, {
|
|
30482
|
+
key: "defaultText",
|
|
30483
|
+
value: function defaultText(trigger) {
|
|
30484
|
+
return getAttributeValue('text', trigger);
|
|
30485
|
+
}
|
|
30486
|
+
}, {
|
|
30487
|
+
key: "destroy",
|
|
30488
|
+
value: function destroy() {
|
|
30489
|
+
this.listener.destroy();
|
|
30490
|
+
}
|
|
30491
|
+
}], [{
|
|
30492
|
+
key: "copy",
|
|
30493
|
+
value: function copy(target) {
|
|
30494
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
30495
|
+
container: document.body
|
|
30496
|
+
};
|
|
30497
|
+
return actions_copy(target, options);
|
|
30498
|
+
}
|
|
30499
|
+
}, {
|
|
30500
|
+
key: "cut",
|
|
30501
|
+
value: function cut(target) {
|
|
30502
|
+
return actions_cut(target);
|
|
30503
|
+
}
|
|
30504
|
+
}, {
|
|
30505
|
+
key: "isSupported",
|
|
30506
|
+
value: function isSupported() {
|
|
30507
|
+
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
|
|
30508
|
+
var actions = typeof action === 'string' ? [action] : action;
|
|
30509
|
+
var support = !!document.queryCommandSupported;
|
|
30510
|
+
actions.forEach(function (action) {
|
|
30511
|
+
support = support && !!document.queryCommandSupported(action);
|
|
30512
|
+
});
|
|
30513
|
+
return support;
|
|
30514
|
+
}
|
|
30515
|
+
}]);
|
|
30516
|
+
return Clipboard;
|
|
30517
|
+
}((tiny_emitter_default()));
|
|
30518
|
+
var clipboard = (Clipboard);
|
|
30519
|
+
}),
|
|
30520
|
+
828:
|
|
30521
|
+
(function(module) {
|
|
30522
|
+
var DOCUMENT_NODE_TYPE = 9;
|
|
30523
|
+
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
|
|
30524
|
+
var proto = Element.prototype;
|
|
30525
|
+
proto.matches = proto.matchesSelector ||
|
|
30526
|
+
proto.mozMatchesSelector ||
|
|
30527
|
+
proto.msMatchesSelector ||
|
|
30528
|
+
proto.oMatchesSelector ||
|
|
30529
|
+
proto.webkitMatchesSelector;
|
|
30530
|
+
}
|
|
30531
|
+
function closest (element, selector) {
|
|
30532
|
+
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
|
|
30533
|
+
if (typeof element.matches === 'function' &&
|
|
30534
|
+
element.matches(selector)) {
|
|
30535
|
+
return element;
|
|
30536
|
+
}
|
|
30537
|
+
element = element.parentNode;
|
|
30538
|
+
}
|
|
30539
|
+
}
|
|
30540
|
+
module.exports = closest;
|
|
30541
|
+
}),
|
|
30542
|
+
438:
|
|
30543
|
+
(function(module, __unused_webpack_exports, __webpack_require__) {
|
|
30544
|
+
var closest = __webpack_require__(828);
|
|
30545
|
+
function _delegate(element, selector, type, callback, useCapture) {
|
|
30546
|
+
var listenerFn = listener.apply(this, arguments);
|
|
30547
|
+
element.addEventListener(type, listenerFn, useCapture);
|
|
30548
|
+
return {
|
|
30549
|
+
destroy: function() {
|
|
30550
|
+
element.removeEventListener(type, listenerFn, useCapture);
|
|
30551
|
+
}
|
|
30552
|
+
}
|
|
30553
|
+
}
|
|
30554
|
+
function delegate(elements, selector, type, callback, useCapture) {
|
|
30555
|
+
if (typeof elements.addEventListener === 'function') {
|
|
30556
|
+
return _delegate.apply(null, arguments);
|
|
30557
|
+
}
|
|
30558
|
+
if (typeof type === 'function') {
|
|
30559
|
+
return _delegate.bind(null, document).apply(null, arguments);
|
|
30560
|
+
}
|
|
30561
|
+
if (typeof elements === 'string') {
|
|
30562
|
+
elements = document.querySelectorAll(elements);
|
|
30563
|
+
}
|
|
30564
|
+
return Array.prototype.map.call(elements, function (element) {
|
|
30565
|
+
return _delegate(element, selector, type, callback, useCapture);
|
|
30566
|
+
});
|
|
30567
|
+
}
|
|
30568
|
+
function listener(element, selector, type, callback) {
|
|
30569
|
+
return function(e) {
|
|
30570
|
+
e.delegateTarget = closest(e.target, selector);
|
|
30571
|
+
if (e.delegateTarget) {
|
|
30572
|
+
callback.call(element, e);
|
|
30573
|
+
}
|
|
30574
|
+
}
|
|
30575
|
+
}
|
|
30576
|
+
module.exports = delegate;
|
|
30577
|
+
}),
|
|
30578
|
+
879:
|
|
30579
|
+
(function(__unused_webpack_module, exports) {
|
|
30580
|
+
exports.node = function(value) {
|
|
30581
|
+
return value !== undefined
|
|
30582
|
+
&& value instanceof HTMLElement
|
|
30583
|
+
&& value.nodeType === 1;
|
|
30584
|
+
};
|
|
30585
|
+
exports.nodeList = function(value) {
|
|
30586
|
+
var type = Object.prototype.toString.call(value);
|
|
30587
|
+
return value !== undefined
|
|
30588
|
+
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
|
|
30589
|
+
&& ('length' in value)
|
|
30590
|
+
&& (value.length === 0 || exports.node(value[0]));
|
|
30591
|
+
};
|
|
30592
|
+
exports.string = function(value) {
|
|
30593
|
+
return typeof value === 'string'
|
|
30594
|
+
|| value instanceof String;
|
|
30595
|
+
};
|
|
30596
|
+
exports.fn = function(value) {
|
|
30597
|
+
var type = Object.prototype.toString.call(value);
|
|
30598
|
+
return type === '[object Function]';
|
|
30599
|
+
};
|
|
30600
|
+
}),
|
|
30601
|
+
370:
|
|
30602
|
+
(function(module, __unused_webpack_exports, __webpack_require__) {
|
|
30603
|
+
var is = __webpack_require__(879);
|
|
30604
|
+
var delegate = __webpack_require__(438);
|
|
30605
|
+
function listen(target, type, callback) {
|
|
30606
|
+
if (!target && !type && !callback) {
|
|
30607
|
+
throw new Error('Missing required arguments');
|
|
30608
|
+
}
|
|
30609
|
+
if (!is.string(type)) {
|
|
30610
|
+
throw new TypeError('Second argument must be a String');
|
|
30611
|
+
}
|
|
30612
|
+
if (!is.fn(callback)) {
|
|
30613
|
+
throw new TypeError('Third argument must be a Function');
|
|
30614
|
+
}
|
|
30615
|
+
if (is.node(target)) {
|
|
30616
|
+
return listenNode(target, type, callback);
|
|
30617
|
+
}
|
|
30618
|
+
else if (is.nodeList(target)) {
|
|
30619
|
+
return listenNodeList(target, type, callback);
|
|
30620
|
+
}
|
|
30621
|
+
else if (is.string(target)) {
|
|
30622
|
+
return listenSelector(target, type, callback);
|
|
30623
|
+
}
|
|
30624
|
+
else {
|
|
30625
|
+
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
|
|
30626
|
+
}
|
|
30627
|
+
}
|
|
30628
|
+
function listenNode(node, type, callback) {
|
|
30629
|
+
node.addEventListener(type, callback);
|
|
30630
|
+
return {
|
|
30631
|
+
destroy: function() {
|
|
30632
|
+
node.removeEventListener(type, callback);
|
|
30633
|
+
}
|
|
30634
|
+
}
|
|
30635
|
+
}
|
|
30636
|
+
function listenNodeList(nodeList, type, callback) {
|
|
30637
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
|
30638
|
+
node.addEventListener(type, callback);
|
|
30639
|
+
});
|
|
30640
|
+
return {
|
|
30641
|
+
destroy: function() {
|
|
30642
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
|
30643
|
+
node.removeEventListener(type, callback);
|
|
30644
|
+
});
|
|
30645
|
+
}
|
|
30646
|
+
}
|
|
30647
|
+
}
|
|
30648
|
+
function listenSelector(selector, type, callback) {
|
|
30649
|
+
return delegate(document.body, selector, type, callback);
|
|
30650
|
+
}
|
|
30651
|
+
module.exports = listen;
|
|
30652
|
+
}),
|
|
30653
|
+
817:
|
|
30654
|
+
(function(module) {
|
|
30655
|
+
function select(element) {
|
|
30656
|
+
var selectedText;
|
|
30657
|
+
if (element.nodeName === 'SELECT') {
|
|
30658
|
+
element.focus();
|
|
30659
|
+
selectedText = element.value;
|
|
30660
|
+
}
|
|
30661
|
+
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
|
30662
|
+
var isReadOnly = element.hasAttribute('readonly');
|
|
30663
|
+
if (!isReadOnly) {
|
|
30664
|
+
element.setAttribute('readonly', '');
|
|
30665
|
+
}
|
|
30666
|
+
element.select();
|
|
30667
|
+
element.setSelectionRange(0, element.value.length);
|
|
30668
|
+
if (!isReadOnly) {
|
|
30669
|
+
element.removeAttribute('readonly');
|
|
30670
|
+
}
|
|
30671
|
+
selectedText = element.value;
|
|
30672
|
+
}
|
|
30673
|
+
else {
|
|
30674
|
+
if (element.hasAttribute('contenteditable')) {
|
|
30675
|
+
element.focus();
|
|
30676
|
+
}
|
|
30677
|
+
var selection = window.getSelection();
|
|
30678
|
+
var range = document.createRange();
|
|
30679
|
+
range.selectNodeContents(element);
|
|
30680
|
+
selection.removeAllRanges();
|
|
30681
|
+
selection.addRange(range);
|
|
30682
|
+
selectedText = selection.toString();
|
|
30683
|
+
}
|
|
30684
|
+
return selectedText;
|
|
30685
|
+
}
|
|
30686
|
+
module.exports = select;
|
|
30687
|
+
}),
|
|
30688
|
+
279:
|
|
30689
|
+
(function(module) {
|
|
30690
|
+
function E () {
|
|
30691
|
+
}
|
|
30692
|
+
E.prototype = {
|
|
30693
|
+
on: function (name, callback, ctx) {
|
|
30694
|
+
var e = this.e || (this.e = {});
|
|
30695
|
+
(e[name] || (e[name] = [])).push({
|
|
30696
|
+
fn: callback,
|
|
30697
|
+
ctx: ctx
|
|
30698
|
+
});
|
|
30699
|
+
return this;
|
|
30700
|
+
},
|
|
30701
|
+
once: function (name, callback, ctx) {
|
|
30702
|
+
var self = this;
|
|
30703
|
+
function listener () {
|
|
30704
|
+
self.off(name, listener);
|
|
30705
|
+
callback.apply(ctx, arguments);
|
|
30706
|
+
} listener._ = callback;
|
|
30707
|
+
return this.on(name, listener, ctx);
|
|
30708
|
+
},
|
|
30709
|
+
emit: function (name) {
|
|
30710
|
+
var data = [].slice.call(arguments, 1);
|
|
30711
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
30712
|
+
var i = 0;
|
|
30713
|
+
var len = evtArr.length;
|
|
30714
|
+
for (i; i < len; i++) {
|
|
30715
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
30716
|
+
}
|
|
30717
|
+
return this;
|
|
30718
|
+
},
|
|
30719
|
+
off: function (name, callback) {
|
|
30720
|
+
var e = this.e || (this.e = {});
|
|
30721
|
+
var evts = e[name];
|
|
30722
|
+
var liveEvents = [];
|
|
30723
|
+
if (evts && callback) {
|
|
30724
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
|
30725
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
|
30726
|
+
liveEvents.push(evts[i]);
|
|
30727
|
+
}
|
|
30728
|
+
}
|
|
30729
|
+
(liveEvents.length)
|
|
30730
|
+
? e[name] = liveEvents
|
|
30731
|
+
: delete e[name];
|
|
30732
|
+
return this;
|
|
30733
|
+
}
|
|
30734
|
+
};
|
|
30735
|
+
module.exports = E;
|
|
30736
|
+
module.exports.TinyEmitter = E;
|
|
30737
|
+
})
|
|
30738
|
+
});
|
|
30739
|
+
var __webpack_module_cache__ = {};
|
|
30740
|
+
function __webpack_require__(moduleId) {
|
|
30741
|
+
if(__webpack_module_cache__[moduleId]) {
|
|
30742
|
+
return __webpack_module_cache__[moduleId].exports;
|
|
30743
|
+
}
|
|
30744
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
30745
|
+
exports: {}
|
|
30746
|
+
};
|
|
30747
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
30748
|
+
return module.exports;
|
|
30749
|
+
}
|
|
30750
|
+
!function() {
|
|
30751
|
+
__webpack_require__.n = function(module) {
|
|
30752
|
+
var getter = module && module.__esModule ?
|
|
30753
|
+
function() { return module['default']; } :
|
|
30754
|
+
function() { return module; };
|
|
30755
|
+
__webpack_require__.d(getter, { a: getter });
|
|
30756
|
+
return getter;
|
|
30757
|
+
};
|
|
30758
|
+
}();
|
|
30759
|
+
!function() {
|
|
30760
|
+
__webpack_require__.d = function(exports, definition) {
|
|
30761
|
+
for(var key in definition) {
|
|
30762
|
+
if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30763
|
+
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
30764
|
+
}
|
|
30765
|
+
}
|
|
30766
|
+
};
|
|
30767
|
+
}();
|
|
30768
|
+
!function() {
|
|
30769
|
+
__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); };
|
|
30770
|
+
}();
|
|
30771
|
+
return __webpack_require__(686);
|
|
30772
|
+
})()
|
|
30773
|
+
.default;
|
|
30774
|
+
});
|
|
30775
|
+
});
|
|
30776
|
+
var ClipboardJS = unwrapExports(clipboard);
|
|
30777
|
+
|
|
30778
|
+
var IMessageActionType = {
|
|
30779
|
+
ASSISTANT: 'assistant',
|
|
30780
|
+
DETAILS: 'details',
|
|
30781
|
+
FIX: 'fix',
|
|
30782
|
+
CLOSE: 'close'
|
|
30783
|
+
};
|
|
30784
|
+
var MessageContentType = {
|
|
30785
|
+
KEY_VALUE: 'key-value',
|
|
30786
|
+
JSON: 'json'
|
|
30787
|
+
};
|
|
30788
|
+
var sortActionIdList = [IMessageActionType.ASSISTANT, IMessageActionType.DETAILS, IMessageActionType.FIX, IMessageActionType.CLOSE];
|
|
30789
|
+
var MessageAdvanced = {
|
|
30790
|
+
name: 'bk-message-advanced',
|
|
30791
|
+
mixins: [locale.mixin],
|
|
30792
|
+
props: {
|
|
30793
|
+
message: {
|
|
30794
|
+
type: Object,
|
|
30795
|
+
default: function _default() {
|
|
30796
|
+
return {};
|
|
30797
|
+
}
|
|
30798
|
+
},
|
|
30799
|
+
actions: {
|
|
30800
|
+
type: Array,
|
|
30801
|
+
default: function _default() {
|
|
30802
|
+
return [];
|
|
30803
|
+
}
|
|
30804
|
+
},
|
|
30805
|
+
tipsIcon: {
|
|
30806
|
+
type: String,
|
|
30807
|
+
default: ''
|
|
30808
|
+
}
|
|
30809
|
+
},
|
|
30810
|
+
data: function data() {
|
|
30811
|
+
return {
|
|
30812
|
+
toolOperation: {
|
|
30813
|
+
isFix: false,
|
|
30814
|
+
isDetailShow: false
|
|
30815
|
+
},
|
|
30816
|
+
isInstallClipboardJS: false,
|
|
30817
|
+
copyStatus: '',
|
|
30818
|
+
copyStatusTimer: null
|
|
30819
|
+
};
|
|
30820
|
+
},
|
|
30821
|
+
computed: {
|
|
30822
|
+
defActionList: function defActionList() {
|
|
30823
|
+
var _this = this,
|
|
30824
|
+
_ref;
|
|
30825
|
+
return _ref = {}, _defineProperty(_ref, IMessageActionType.ASSISTANT, {
|
|
30826
|
+
id: IMessageActionType.ASSISTANT,
|
|
30827
|
+
icon: function icon(h) {
|
|
30828
|
+
return h('span', {
|
|
30829
|
+
class: 'bk-icon icon-weixin-pro'
|
|
30830
|
+
});
|
|
30831
|
+
},
|
|
30832
|
+
text: function text() {
|
|
30833
|
+
return _this.t('bk.message.assistant');
|
|
30834
|
+
},
|
|
30835
|
+
onClick: function onClick(e) {
|
|
30836
|
+
return _this.handleHeplerClick(e);
|
|
30837
|
+
}
|
|
30838
|
+
}), _defineProperty(_ref, IMessageActionType.DETAILS, {
|
|
30839
|
+
id: IMessageActionType.DETAILS,
|
|
30840
|
+
icon: function icon(h) {
|
|
30841
|
+
return _this.toolOperation.isDetailShow ? h('span', {
|
|
30842
|
+
class: 'bk-icon icon-angle-double-up'
|
|
30843
|
+
}) : h('span', {
|
|
30844
|
+
class: 'bk-icon icon-angle-double-down'
|
|
30845
|
+
});
|
|
30846
|
+
},
|
|
30847
|
+
text: function text() {
|
|
30848
|
+
return _this.t('bk.message.details');
|
|
30849
|
+
},
|
|
30850
|
+
onClick: function onClick(e) {
|
|
30851
|
+
return _this.setDetailsShow(e);
|
|
30852
|
+
}
|
|
30853
|
+
}), _defineProperty(_ref, IMessageActionType.FIX, {
|
|
30854
|
+
id: IMessageActionType.FIX,
|
|
30855
|
+
icon: function icon(h) {
|
|
30856
|
+
return _this.toolOperation.isFix ? h('span', {
|
|
30857
|
+
class: 'bk-icon icon-fix-shape'
|
|
30858
|
+
}) : h('span', {
|
|
30859
|
+
class: 'bk-icon icon-fix-line'
|
|
30860
|
+
});
|
|
30861
|
+
},
|
|
30862
|
+
classList: this.toolOperation.isFix ? 'fixed' : '',
|
|
30863
|
+
onClick: function onClick(e) {
|
|
30864
|
+
return _this.fixMesage(e);
|
|
30865
|
+
}
|
|
30866
|
+
}), _defineProperty(_ref, IMessageActionType.CLOSE, {
|
|
30867
|
+
id: IMessageActionType.CLOSE,
|
|
30868
|
+
classList: 'normal-color',
|
|
30869
|
+
icon: function icon(h) {
|
|
30870
|
+
return h('span', {
|
|
30871
|
+
class: 'bk-message-close'
|
|
30872
|
+
}, [h('i', {
|
|
30873
|
+
class: 'bk-icon icon-close'
|
|
30874
|
+
})]);
|
|
30875
|
+
},
|
|
30876
|
+
onClick: this.handleCloseClick
|
|
30877
|
+
}), _ref;
|
|
30878
|
+
},
|
|
30879
|
+
actionList: function actionList() {
|
|
30880
|
+
var _this2 = this;
|
|
30881
|
+
if (this.actions && this.actions.length > 0) {
|
|
30882
|
+
var resultList = this.actions.map(function (action) {
|
|
30883
|
+
var id = action.id.toLocaleLowerCase();
|
|
30884
|
+
var defAction = _this2.defActionList[id];
|
|
30885
|
+
var defClickFn = defAction.onClick;
|
|
30886
|
+
var target = _extends({}, _this2.defActionList[id] || {}, action);
|
|
30887
|
+
target.id = id;
|
|
30888
|
+
if (action.classList !== undefined) {
|
|
30889
|
+
var classList = isArray$1(action.classList) ? action.classList : [action.classList];
|
|
30890
|
+
var defClassList = [];
|
|
30891
|
+
if (defAction.classList !== undefined) {
|
|
30892
|
+
defClassList = isArray$1(defAction.classList) ? defAction.classList : [defAction.classList];
|
|
30893
|
+
}
|
|
30894
|
+
target.classList = [].concat(_toConsumableArray(defClassList), _toConsumableArray(classList));
|
|
30895
|
+
}
|
|
30896
|
+
if (typeof action.onClick === 'function') {
|
|
30897
|
+
target.onClick = function () {
|
|
30898
|
+
var resp = apply$1(action.onClick, _this2, []);
|
|
30899
|
+
if ((typeof resp === 'undefined' || resp) && typeof defClickFn === 'function') {
|
|
30900
|
+
apply$1(defClickFn, _this2, []);
|
|
30901
|
+
}
|
|
30902
|
+
};
|
|
30903
|
+
return target;
|
|
30904
|
+
}
|
|
30905
|
+
target.onClick = defClickFn;
|
|
30906
|
+
return target;
|
|
30907
|
+
});
|
|
30908
|
+
var appendList = sortActionIdList.filter(function (id) {
|
|
30909
|
+
return !resultList.some(function (action) {
|
|
30910
|
+
return action.id === id;
|
|
30911
|
+
});
|
|
30912
|
+
}).map(function (id) {
|
|
30913
|
+
return _this2.defActionList[id];
|
|
30914
|
+
});
|
|
30915
|
+
resultList.push.apply(resultList, _toConsumableArray(appendList));
|
|
30916
|
+
return resultList;
|
|
30917
|
+
}
|
|
30918
|
+
return sortActionIdList.map(function (id) {
|
|
30919
|
+
return _this2.defActionList[id];
|
|
30920
|
+
});
|
|
30921
|
+
}
|
|
30922
|
+
},
|
|
30923
|
+
methods: {
|
|
30924
|
+
handleCloseClick: function handleCloseClick() {
|
|
30925
|
+
this.$emit('close');
|
|
30926
|
+
},
|
|
30927
|
+
handleHeplerClick: function handleHeplerClick(e) {
|
|
30928
|
+
if (this.message.assistant) {
|
|
30929
|
+
window.open(this.message.assistant, '_blank');
|
|
30930
|
+
}
|
|
30931
|
+
},
|
|
30932
|
+
setDetailsShow: function setDetailsShow(e, isShow) {
|
|
30933
|
+
var _this3 = this;
|
|
30934
|
+
this.toolOperation.isDetailShow = isShow !== undefined ? isShow : !this.toolOperation.isDetailShow;
|
|
30935
|
+
this.fixMesage(e, this.toolOperation.isDetailShow);
|
|
30936
|
+
if (this.toolOperation.isDetailShow && _typeof(this.message) === 'object' && (this.message.type === MessageContentType.JSON || !this.message.type)) {
|
|
30937
|
+
var targetJson = this.parseJson(this.message.details);
|
|
30938
|
+
var formatter = new jsonFormatter_umd(targetJson);
|
|
30939
|
+
setTimeout(function () {
|
|
30940
|
+
if (_this3.$refs.refJsonContent) {
|
|
30941
|
+
_this3.$refs.refJsonContent.innerHTML = '';
|
|
30942
|
+
_this3.$refs.refJsonContent.append(formatter.render());
|
|
30943
|
+
}
|
|
30944
|
+
});
|
|
30945
|
+
}
|
|
30946
|
+
},
|
|
30947
|
+
fixMesage: function fixMesage(e, isFix) {
|
|
30948
|
+
this.toolOperation.isFix = isFix !== undefined ? isFix : !this.toolOperation.isFix;
|
|
30949
|
+
this.$emit('fix-message', this.toolOperation.isFix);
|
|
30950
|
+
},
|
|
30951
|
+
parseJson: function parseJson(value) {
|
|
30952
|
+
var targetJson = value;
|
|
30953
|
+
if (typeof value === 'string') {
|
|
30954
|
+
try {
|
|
30955
|
+
targetJson = JSON.parse(value);
|
|
30956
|
+
} catch (e) {
|
|
30957
|
+
console.error("Format Json Error: ".concat(e));
|
|
30958
|
+
}
|
|
30959
|
+
}
|
|
30960
|
+
return targetJson;
|
|
30961
|
+
},
|
|
30962
|
+
copyMessage: function copyMessage() {
|
|
30963
|
+
var _this4 = this;
|
|
30964
|
+
if (this.isInstallClipboardJS) {
|
|
30965
|
+
return;
|
|
30966
|
+
}
|
|
30967
|
+
var copyInstance = new ClipboardJS(this.$refs.refCopyMsgDiv, {
|
|
30968
|
+
text: function text() {
|
|
30969
|
+
return _this4.message.details;
|
|
30970
|
+
}
|
|
30971
|
+
});
|
|
30972
|
+
['success', 'error'].forEach(function (theme) {
|
|
30973
|
+
copyInstance.on(theme, function () {
|
|
30974
|
+
var target = _this4.$refs.refCopyStatus;
|
|
30975
|
+
_this4.copyStatus = theme;
|
|
30976
|
+
if (target) {
|
|
30977
|
+
var _target$classList, _target$classList2;
|
|
30978
|
+
(_target$classList = target.classList).remove.apply(_target$classList, ['success', 'error', 'is-hidden']);
|
|
30979
|
+
(_target$classList2 = target.classList).add.apply(_target$classList2, [theme, 'is-show']);
|
|
30980
|
+
_this4.copyStatusTimer && clearTimeout(_this4.copyStatusTimer);
|
|
30981
|
+
_this4.copyStatusTimer = setTimeout(function () {
|
|
30982
|
+
var _target$classList3, _target$classList4;
|
|
30983
|
+
(_target$classList3 = target.classList).remove.apply(_target$classList3, ['is-show']);
|
|
30984
|
+
(_target$classList4 = target.classList).add.apply(_target$classList4, ['is-hidden']);
|
|
30985
|
+
}, 2000);
|
|
30986
|
+
}
|
|
30987
|
+
});
|
|
30988
|
+
_this4.isInstallClipboardJS = true;
|
|
30989
|
+
setTimeout(function () {
|
|
30990
|
+
_this4.$refs.refCopyMsgDiv.click();
|
|
30991
|
+
});
|
|
30992
|
+
});
|
|
30993
|
+
}
|
|
30994
|
+
},
|
|
30995
|
+
render: function render(h) {
|
|
30996
|
+
var _this5 = this;
|
|
30997
|
+
var renderMsgDetail = function renderMsgDetail(msg) {
|
|
30998
|
+
if (msg.type === MessageContentType.KEY_VALUE) {
|
|
30999
|
+
var target = _this5.parseJson(msg.details || {});
|
|
31000
|
+
var keys = keys$1(target);
|
|
31001
|
+
return keys.map(function (key) {
|
|
31002
|
+
return h('div', {
|
|
31003
|
+
class: 'message-row'
|
|
31004
|
+
}, [h('label', key), target[key]]);
|
|
31005
|
+
});
|
|
31006
|
+
}
|
|
31007
|
+
return null;
|
|
31008
|
+
};
|
|
31009
|
+
var renderMessageActions = function renderMessageActions() {
|
|
31010
|
+
var renderIcon = function renderIcon(_ref2) {
|
|
31011
|
+
var icon = _ref2.icon;
|
|
31012
|
+
if (typeof icon === 'function') {
|
|
31013
|
+
return apply$1(icon, _this5, [h]);
|
|
31014
|
+
}
|
|
31015
|
+
return h('span', {
|
|
31016
|
+
class: icon
|
|
31017
|
+
});
|
|
31018
|
+
};
|
|
31019
|
+
var renderText = function renderText(_ref3) {
|
|
31020
|
+
var text = _ref3.text;
|
|
31021
|
+
var content;
|
|
31022
|
+
if (typeof text === 'function') {
|
|
31023
|
+
content = apply$1(text, _this5, [h]);
|
|
31024
|
+
}
|
|
31025
|
+
if (content === undefined) {
|
|
31026
|
+
return;
|
|
31027
|
+
}
|
|
31028
|
+
if (typeof content === 'string') {
|
|
31029
|
+
return h('span', {
|
|
31030
|
+
class: 'message-action-text'
|
|
31031
|
+
}, [content]);
|
|
31032
|
+
}
|
|
31033
|
+
return content;
|
|
31034
|
+
};
|
|
31035
|
+
var handleActionClick = function handleActionClick(e, action) {
|
|
31036
|
+
if (action.readonly || action.disabled) {
|
|
31037
|
+
return;
|
|
31038
|
+
}
|
|
31039
|
+
if (typeof action.onClick === 'function') {
|
|
31040
|
+
apply$1(action.onClick, _this5, [e, action]);
|
|
31041
|
+
}
|
|
31042
|
+
};
|
|
31043
|
+
var renderActionList = function renderActionList() {
|
|
31044
|
+
return _this5.actionList.map(function (action) {
|
|
31045
|
+
if (action.disabled) {
|
|
31046
|
+
return null;
|
|
31047
|
+
}
|
|
31048
|
+
if (typeof action.render === 'function') {
|
|
31049
|
+
return apply$1(action.render, _this5, []);
|
|
31050
|
+
}
|
|
31051
|
+
var classList = isArray$1(action.classList) ? action.classList.join(' ') : action.classList;
|
|
31052
|
+
return h('div', {
|
|
31053
|
+
class: ['tool', action.id, classList],
|
|
31054
|
+
on: {
|
|
31055
|
+
click: function click(e) {
|
|
31056
|
+
return handleActionClick(e, action);
|
|
31057
|
+
}
|
|
31058
|
+
}
|
|
31059
|
+
}, [renderIcon(action), renderText(action)]);
|
|
31060
|
+
});
|
|
31061
|
+
};
|
|
31062
|
+
return renderActionList();
|
|
31063
|
+
};
|
|
31064
|
+
var iconMap = {
|
|
31065
|
+
success: 'bk-icon icon-check-circle-shape',
|
|
31066
|
+
error: 'bk-icon icon-close-circle-shape'
|
|
31067
|
+
};
|
|
31068
|
+
return h('div', {
|
|
31069
|
+
class: 'bk-message-content multi'
|
|
31070
|
+
}, [h('div', {
|
|
31071
|
+
class: 'overview'
|
|
31072
|
+
}, [h('div', {
|
|
31073
|
+
class: 'left-content'
|
|
31074
|
+
}, [h('div', {
|
|
31075
|
+
class: 'bk-message-icon'
|
|
31076
|
+
}, [h('i', {
|
|
31077
|
+
class: ['bk-icon', this.tipsIcon]
|
|
31078
|
+
})]), h('div', {
|
|
31079
|
+
class: 'describe'
|
|
31080
|
+
}, this.message.title || "\u3010".concat(this.message.code, "\u3011").concat(this.message.overview, " ").concat(this.message.suggestion))]), h('div', {
|
|
31081
|
+
class: 'tools'
|
|
31082
|
+
}, [renderMessageActions()])]), this.toolOperation.isDetailShow ? h('div', {
|
|
31083
|
+
class: 'message-detail'
|
|
31084
|
+
}, [h('div', {
|
|
31085
|
+
class: 'message-copy',
|
|
31086
|
+
ref: 'refCopyMsgDiv',
|
|
31087
|
+
on: {
|
|
31088
|
+
click: this.copyMessage
|
|
31089
|
+
}
|
|
31090
|
+
}, [h('span', {
|
|
31091
|
+
class: 'bk-icon icon-copy-shape'
|
|
31092
|
+
}), h('div', {
|
|
31093
|
+
class: ['copy-status', this.copyStatus],
|
|
31094
|
+
ref: 'refCopyStatus'
|
|
31095
|
+
}, [h('div', {
|
|
31096
|
+
class: 'inner'
|
|
31097
|
+
}, [h('span', {
|
|
31098
|
+
class: [iconMap[this.copyStatus], this.copyStatus]
|
|
31099
|
+
}), this.copyStatus === 'success' ? this.t('bk.message.copySuccess') : this.t('bk.message.copyFailed')])])]), h('div', {
|
|
31100
|
+
class: 'message-tree',
|
|
31101
|
+
ref: 'refJsonContent'
|
|
31102
|
+
}, [renderMsgDetail(this.message)])]) : null]);
|
|
31103
|
+
}
|
|
31104
|
+
};
|
|
31105
|
+
|
|
30267
31106
|
var ICONS = {
|
|
30268
31107
|
primary: 'icon-info-circle-shape',
|
|
30269
31108
|
error: 'icon-close-circle-shape',
|
|
@@ -30272,6 +31111,9 @@
|
|
|
30272
31111
|
};
|
|
30273
31112
|
var script$D = {
|
|
30274
31113
|
name: 'bk-message',
|
|
31114
|
+
components: {
|
|
31115
|
+
MessageAdvanced: MessageAdvanced
|
|
31116
|
+
},
|
|
30275
31117
|
mixins: [locale.mixin],
|
|
30276
31118
|
data: function data() {
|
|
30277
31119
|
return {
|
|
@@ -30281,6 +31123,7 @@
|
|
|
30281
31123
|
icon: '',
|
|
30282
31124
|
dismissable: true,
|
|
30283
31125
|
verticalOffset: 0,
|
|
31126
|
+
zIndex: 2500,
|
|
30284
31127
|
horizonOffset: 0,
|
|
30285
31128
|
visible: false,
|
|
30286
31129
|
countID: null,
|
|
@@ -30288,7 +31131,11 @@
|
|
|
30288
31131
|
extCls: '',
|
|
30289
31132
|
copied: false,
|
|
30290
31133
|
ellipsisCopy: false,
|
|
30291
|
-
showCopyText: false
|
|
31134
|
+
showCopyText: false,
|
|
31135
|
+
showAdvanced: false,
|
|
31136
|
+
actions: [],
|
|
31137
|
+
isFixed: false,
|
|
31138
|
+
width: 560
|
|
30292
31139
|
};
|
|
30293
31140
|
},
|
|
30294
31141
|
computed: {
|
|
@@ -30297,7 +31144,9 @@
|
|
|
30297
31144
|
},
|
|
30298
31145
|
verticalStyle: function verticalStyle() {
|
|
30299
31146
|
return {
|
|
30300
|
-
top: "".concat(this.verticalOffset, "px")
|
|
31147
|
+
top: "".concat(this.verticalOffset, "px"),
|
|
31148
|
+
width: "".concat(this.width, "px"),
|
|
31149
|
+
zIndex: this.zIndex
|
|
30301
31150
|
};
|
|
30302
31151
|
},
|
|
30303
31152
|
tipsIcon: function tipsIcon() {
|
|
@@ -30322,19 +31171,30 @@
|
|
|
30322
31171
|
this.startCountDown();
|
|
30323
31172
|
},
|
|
30324
31173
|
methods: {
|
|
31174
|
+
handleFixMessage: function handleFixMessage(isFixed) {
|
|
31175
|
+
this.isFixed = isFixed;
|
|
31176
|
+
console.log('handleFixMessage', isFixed);
|
|
31177
|
+
if (isFixed) {
|
|
31178
|
+
this.stopCountDown();
|
|
31179
|
+
} else {
|
|
31180
|
+
this.startCountDown();
|
|
31181
|
+
}
|
|
31182
|
+
},
|
|
30325
31183
|
destroyEl: function destroyEl() {
|
|
30326
31184
|
this.$destroy();
|
|
30327
31185
|
this.$el.parentNode && this.$el.parentNode.removeChild(this.$el);
|
|
30328
31186
|
},
|
|
30329
31187
|
startCountDown: function startCountDown() {
|
|
30330
31188
|
var _this = this;
|
|
30331
|
-
if (this.delay > 0) {
|
|
31189
|
+
if (this.delay > 0 && !this.isFixed) {
|
|
30332
31190
|
this.countID = setTimeout(function () {
|
|
31191
|
+
console.log('--Close');
|
|
30333
31192
|
_this.visible && _this.close();
|
|
30334
31193
|
}, this.delay);
|
|
30335
31194
|
}
|
|
30336
31195
|
},
|
|
30337
31196
|
stopCountDown: function stopCountDown() {
|
|
31197
|
+
console.log('--stopCountDown');
|
|
30338
31198
|
clearTimeout(this.countID);
|
|
30339
31199
|
},
|
|
30340
31200
|
close: function close() {
|
|
@@ -30381,7 +31241,17 @@
|
|
|
30381
31241
|
"mouseenter": _vm.stopCountDown,
|
|
30382
31242
|
"mouseleave": _vm.startCountDown
|
|
30383
31243
|
}
|
|
30384
|
-
}, [_c('
|
|
31244
|
+
}, [_vm.showAdvanced ? [_c('message-advanced', {
|
|
31245
|
+
attrs: {
|
|
31246
|
+
"message": _vm.message,
|
|
31247
|
+
"actions": _vm.actions,
|
|
31248
|
+
"tips-icon": _vm.tipsIcon
|
|
31249
|
+
},
|
|
31250
|
+
on: {
|
|
31251
|
+
"fix-message": _vm.handleFixMessage,
|
|
31252
|
+
"close": _vm.close
|
|
31253
|
+
}
|
|
31254
|
+
})] : [_c('div', {
|
|
30385
31255
|
staticClass: "bk-message-icon"
|
|
30386
31256
|
}, [_c('i', {
|
|
30387
31257
|
class: ['bk-icon', _vm.tipsIcon]
|
|
@@ -30401,7 +31271,7 @@
|
|
|
30401
31271
|
on: {
|
|
30402
31272
|
"click": _vm.copyContent
|
|
30403
31273
|
}
|
|
30404
|
-
}, [_vm._v("\n
|
|
31274
|
+
}, [_vm._v("\n " + _vm._s(_vm.localeCopyText) + "\n ")]) : _vm._e(), _vm.dismissable ? _c('div', {
|
|
30405
31275
|
staticClass: "bk-message-close"
|
|
30406
31276
|
}, [_c('i', {
|
|
30407
31277
|
class: ['bk-icon icon-close', _vm.showCopyText ? 'ml10' : 'ml30'],
|
|
@@ -30411,7 +31281,7 @@
|
|
|
30411
31281
|
return _vm.close.apply(null, arguments);
|
|
30412
31282
|
}
|
|
30413
31283
|
}
|
|
30414
|
-
})]) : _vm._e()])]);
|
|
31284
|
+
})]) : _vm._e()]], 2)]);
|
|
30415
31285
|
};
|
|
30416
31286
|
var __vue_staticRenderFns__$D = [];
|
|
30417
31287
|
|
|
@@ -30438,6 +31308,7 @@
|
|
|
30438
31308
|
var messageList = [];
|
|
30439
31309
|
var seed$2 = 0;
|
|
30440
31310
|
var BkMessage = function BkMessage(config) {
|
|
31311
|
+
var originConfig = _typeof(config) === 'object' ? JSON.parse(stringify$1(config)) : config;
|
|
30441
31312
|
if (config.limit === 0) {
|
|
30442
31313
|
BkMessage.batchClose();
|
|
30443
31314
|
return;
|
|
@@ -30465,10 +31336,23 @@
|
|
|
30465
31336
|
var instance = new MessageComponent({
|
|
30466
31337
|
data: config
|
|
30467
31338
|
});
|
|
30468
|
-
if (
|
|
31339
|
+
if (originConfig.message !== null && _typeof(originConfig.message) === 'object' && originConfig.message.hasOwnProperty('componentOptions')) {
|
|
30469
31340
|
instance.$slots.default = [config.message];
|
|
30470
31341
|
instance.message = null;
|
|
30471
31342
|
}
|
|
31343
|
+
if (!originConfig.width) {
|
|
31344
|
+
instance.width = 560;
|
|
31345
|
+
}
|
|
31346
|
+
if (originConfig.message !== null && _typeof(originConfig.message) === 'object' && !originConfig.message.hasOwnProperty('componentOptions')) {
|
|
31347
|
+
instance.showAdvanced = true;
|
|
31348
|
+
instance.actions = originConfig.actions || [];
|
|
31349
|
+
if (!originConfig.width) {
|
|
31350
|
+
instance.width = 800;
|
|
31351
|
+
}
|
|
31352
|
+
if (!originConfig.delay) {
|
|
31353
|
+
instance.delay = 8000;
|
|
31354
|
+
}
|
|
31355
|
+
}
|
|
30472
31356
|
instance.id = instanceId;
|
|
30473
31357
|
instance.spacing = spacing;
|
|
30474
31358
|
instance.ellipsisLine = ellipsisLine;
|
|
@@ -30770,6 +31654,9 @@
|
|
|
30770
31654
|
|
|
30771
31655
|
var script$F = {
|
|
30772
31656
|
name: 'bk-option',
|
|
31657
|
+
components: {
|
|
31658
|
+
'bk-checkbox': __vue_component__$9
|
|
31659
|
+
},
|
|
30773
31660
|
props: {
|
|
30774
31661
|
id: {
|
|
30775
31662
|
type: [String, Number],
|
|
@@ -30797,6 +31684,9 @@
|
|
|
30797
31684
|
},
|
|
30798
31685
|
lowerName: function lowerName() {
|
|
30799
31686
|
return String(this.name).toLowerCase();
|
|
31687
|
+
},
|
|
31688
|
+
selectedStyle: function selectedStyle() {
|
|
31689
|
+
return this.select.selectedStyle;
|
|
30800
31690
|
}
|
|
30801
31691
|
},
|
|
30802
31692
|
created: function created() {
|
|
@@ -30861,12 +31751,17 @@
|
|
|
30861
31751
|
attrs: {
|
|
30862
31752
|
"title": _vm.name
|
|
30863
31753
|
}
|
|
30864
|
-
}, [_vm.
|
|
31754
|
+
}, [_vm.selectedStyle === 'checkbox' && _vm.select.multiple ? [_c('bk-checkbox', {
|
|
31755
|
+
staticClass: "bk-option-checkbox",
|
|
31756
|
+
attrs: {
|
|
31757
|
+
"value": _vm.isSelected
|
|
31758
|
+
}
|
|
31759
|
+
}, [_vm._v(_vm._s(_vm.name))])] : [_vm.select.multiple && _vm.isSelected ? _c('i', {
|
|
30865
31760
|
staticClass: "bk-option-icon bk-icon icon-check-1"
|
|
30866
31761
|
}) : _vm._e(), _c('span', {
|
|
30867
31762
|
staticClass: "bk-option-name",
|
|
30868
31763
|
class: _vm.select.fontSizeCls
|
|
30869
|
-
}, [_vm._v("\n
|
|
31764
|
+
}, [_vm._v("\n " + _vm._s(_vm.name) + "\n ")])]], 2)];
|
|
30870
31765
|
})], 2)]);
|
|
30871
31766
|
};
|
|
30872
31767
|
var __vue_staticRenderFns__$F = [];
|
|
@@ -32526,6 +33421,10 @@
|
|
|
32526
33421
|
default: function _default() {
|
|
32527
33422
|
return {};
|
|
32528
33423
|
}
|
|
33424
|
+
},
|
|
33425
|
+
selectedStyle: {
|
|
33426
|
+
type: String,
|
|
33427
|
+
default: 'check'
|
|
32529
33428
|
}
|
|
32530
33429
|
},
|
|
32531
33430
|
provide: function provide() {
|
|
@@ -51130,6 +52029,9 @@
|
|
|
51130
52029
|
|
|
51131
52030
|
var script$1h = {
|
|
51132
52031
|
name: 'bk-search-select-menu',
|
|
52032
|
+
components: {
|
|
52033
|
+
BkCheckbox: __vue_component__$9
|
|
52034
|
+
},
|
|
51133
52035
|
mixins: [locale.mixin],
|
|
51134
52036
|
props: {
|
|
51135
52037
|
list: {
|
|
@@ -51167,7 +52069,11 @@
|
|
|
51167
52069
|
type: String,
|
|
51168
52070
|
require: true
|
|
51169
52071
|
},
|
|
51170
|
-
isChildCondition: Boolean
|
|
52072
|
+
isChildCondition: Boolean,
|
|
52073
|
+
selectedStyle: {
|
|
52074
|
+
type: String,
|
|
52075
|
+
default: 'check'
|
|
52076
|
+
}
|
|
51171
52077
|
},
|
|
51172
52078
|
data: function data() {
|
|
51173
52079
|
return {
|
|
@@ -51201,7 +52107,11 @@
|
|
|
51201
52107
|
this.hasFocus = false;
|
|
51202
52108
|
this.handleDestroy();
|
|
51203
52109
|
} else {
|
|
51204
|
-
|
|
52110
|
+
if (this.selectedStyle === 'check') {
|
|
52111
|
+
this.$refs[item[this.primaryKey]].style.display = this.checked[item[this.primaryKey]] ? 'none' : 'block';
|
|
52112
|
+
} else {
|
|
52113
|
+
this.$refs[item[this.primaryKey]].setLocalValue(!this.checked[item[this.primaryKey]]);
|
|
52114
|
+
}
|
|
51205
52115
|
this.$emit('select-check', item, index);
|
|
51206
52116
|
}
|
|
51207
52117
|
},
|
|
@@ -51210,8 +52120,11 @@
|
|
|
51210
52120
|
},
|
|
51211
52121
|
setCheckValue: function setCheckValue(item, val) {
|
|
51212
52122
|
var ref = this.$refs[item[this.primaryKey]];
|
|
51213
|
-
if (ref)
|
|
52123
|
+
if (!ref) return;
|
|
52124
|
+
if (this.selectedStyle === 'check') {
|
|
51214
52125
|
ref.style.display = this.checked[item[this.primaryKey]] ? 'none' : 'block';
|
|
52126
|
+
} else {
|
|
52127
|
+
ref.etLocalValue(!this.checked[item[this.primaryKey]]);
|
|
51215
52128
|
}
|
|
51216
52129
|
},
|
|
51217
52130
|
handleSelectEnter: function handleSelectEnter(e) {
|
|
@@ -51257,9 +52170,15 @@
|
|
|
51257
52170
|
},
|
|
51258
52171
|
handleSelectCancel: function handleSelectCancel(e) {
|
|
51259
52172
|
var _this2 = this;
|
|
51260
|
-
|
|
51261
|
-
|
|
51262
|
-
|
|
52173
|
+
if (this.selectedStyle === 'check') {
|
|
52174
|
+
keys$1(this.checked).forEach(function (key) {
|
|
52175
|
+
_this2.$refs[key] && (_this2.$refs[key].style.display = 'none');
|
|
52176
|
+
});
|
|
52177
|
+
} else if (this.selectedStyle === 'checkbox') {
|
|
52178
|
+
keys$1(this.checked).forEach(function (key) {
|
|
52179
|
+
_this2.$refs[key] && _this2.$refs[key].setLocalValue(false);
|
|
52180
|
+
});
|
|
52181
|
+
}
|
|
51263
52182
|
this.$emit('select-cancel', e);
|
|
51264
52183
|
}
|
|
51265
52184
|
},
|
|
@@ -51283,7 +52202,8 @@
|
|
|
51283
52202
|
isChildCondition = _this$isChildConditio === void 0 ? false : _this$isChildConditio,
|
|
51284
52203
|
_this$error = this.error,
|
|
51285
52204
|
error = _this$error === void 0 ? '' : _this$error,
|
|
51286
|
-
hoverId = this.hoverId
|
|
52205
|
+
hoverId = this.hoverId,
|
|
52206
|
+
selectedStyle = this.selectedStyle;
|
|
51287
52207
|
if (error) {
|
|
51288
52208
|
return h("div", {
|
|
51289
52209
|
"class": {
|
|
@@ -51341,7 +52261,14 @@
|
|
|
51341
52261
|
'is-disabled': item.disabled,
|
|
51342
52262
|
'is-hover': !item.disabled && hoverId === id
|
|
51343
52263
|
}
|
|
51344
|
-
}, [h("
|
|
52264
|
+
}, [selectedStyle === 'checkbox' ? h("bk-checkbox", {
|
|
52265
|
+
"class": "search-list-checkbox",
|
|
52266
|
+
"directives": [{
|
|
52267
|
+
name: "show",
|
|
52268
|
+
value: multiable && child && !isChildCondition
|
|
52269
|
+
}],
|
|
52270
|
+
"ref": id
|
|
52271
|
+
}) : null, h("div", helper([{}, events, {
|
|
51345
52272
|
"class": {
|
|
51346
52273
|
'item-name': true
|
|
51347
52274
|
}
|
|
@@ -51349,7 +52276,7 @@
|
|
|
51349
52276
|
"class": {
|
|
51350
52277
|
'item-name-filter': true
|
|
51351
52278
|
}
|
|
51352
|
-
}, [filter]), next]) : text]), h("span", {
|
|
52279
|
+
}, [filter]), next]) : text]), selectedStyle === 'check' ? h("span", {
|
|
51353
52280
|
"directives": [{
|
|
51354
52281
|
name: "show",
|
|
51355
52282
|
value: multiable && child && checked[text] && !isChildCondition
|
|
@@ -51358,7 +52285,7 @@
|
|
|
51358
52285
|
"class": {
|
|
51359
52286
|
'bk-icon icon-check-1 item-icon': true
|
|
51360
52287
|
}
|
|
51361
|
-
})]);
|
|
52288
|
+
}) : null]);
|
|
51362
52289
|
});
|
|
51363
52290
|
if (multiable && child) {
|
|
51364
52291
|
footerEnterEvent['on']['click'] = function (e) {
|
|
@@ -51578,6 +52505,10 @@
|
|
|
51578
52505
|
extCls: {
|
|
51579
52506
|
type: String,
|
|
51580
52507
|
default: ''
|
|
52508
|
+
},
|
|
52509
|
+
selectedStyle: {
|
|
52510
|
+
type: String,
|
|
52511
|
+
default: 'check'
|
|
51581
52512
|
}
|
|
51582
52513
|
},
|
|
51583
52514
|
data: function data() {
|
|
@@ -51620,18 +52551,6 @@
|
|
|
51620
52551
|
return item[_this.primaryKey] === _this.menu.id;
|
|
51621
52552
|
}) || {};
|
|
51622
52553
|
},
|
|
51623
|
-
childList: function childList() {
|
|
51624
|
-
var ret = [];
|
|
51625
|
-
var i = 0;
|
|
51626
|
-
while (i < this.data.length) {
|
|
51627
|
-
var item = this.data[i];
|
|
51628
|
-
if (item.children && item.children.length) {
|
|
51629
|
-
ret.push.apply(ret, _toConsumableArray(item.children));
|
|
51630
|
-
}
|
|
51631
|
-
i++;
|
|
51632
|
-
}
|
|
51633
|
-
return ret;
|
|
51634
|
-
},
|
|
51635
52554
|
showItemPlaceholder: function showItemPlaceholder() {
|
|
51636
52555
|
return this.menu.active >= 0 && String(this.curItem.placeholder).length && this.input.value === this.curItem[this.displayKey] + this.explainCode;
|
|
51637
52556
|
}
|
|
@@ -51723,23 +52642,27 @@
|
|
|
51723
52642
|
},
|
|
51724
52643
|
initMenu: function initMenu() {
|
|
51725
52644
|
if (!this.menuInstance) {
|
|
51726
|
-
this.menuInstance = new Vue(__vue_component__$1j)
|
|
52645
|
+
this.menuInstance = new Vue(__vue_component__$1j);
|
|
51727
52646
|
this.menuInstance.condition = this.defaultCondition;
|
|
51728
52647
|
this.menuInstance.displayKey = this.displayKey;
|
|
51729
52648
|
this.menuInstance.primaryKey = this.primaryKey;
|
|
52649
|
+
this.menuInstance.selectedStyle = this.selectedStyle;
|
|
51730
52650
|
this.menuInstance.multiable = false;
|
|
52651
|
+
this.menuInstance.$mount();
|
|
51731
52652
|
this.menuInstance.$on('select', this.handleMenuSelect);
|
|
51732
52653
|
this.menuInstance.$on('select-conditon', this.handleSelectConditon);
|
|
51733
52654
|
}
|
|
51734
52655
|
},
|
|
51735
52656
|
initChildMenu: function initChildMenu() {
|
|
51736
|
-
this.menuChildInstance = new Vue(__vue_component__$1j)
|
|
52657
|
+
this.menuChildInstance = new Vue(__vue_component__$1j);
|
|
51737
52658
|
this.menuChildInstance.displayKey = this.displayKey;
|
|
51738
52659
|
this.menuChildInstance.primaryKey = this.primaryKey;
|
|
52660
|
+
this.menuChildInstance.selectedStyle = this.selectedStyle;
|
|
51739
52661
|
this.menuChildInstance.multiable = this.curItem.conditions && this.curItem.conditions.length ? false : this.curItem.multiable || false;
|
|
51740
52662
|
this.menuChildInstance.child = true;
|
|
51741
52663
|
this.menuChildInstance.remoteEmptyText = this.defaultRemoteEmptyText;
|
|
51742
52664
|
this.menuChildInstance.remoteLoadingText = this.defaultRemoteLoadingText;
|
|
52665
|
+
this.menuChildInstance.$mount();
|
|
51743
52666
|
this.menuChildInstance.$on('select', this.handleMenuChildSelect);
|
|
51744
52667
|
this.menuChildInstance.$on('select-check', this.handleSelectCheck);
|
|
51745
52668
|
this.menuChildInstance.$on('select-enter', this.handleKeyEnter);
|
|
@@ -51894,28 +52817,50 @@
|
|
|
51894
52817
|
}, _callee);
|
|
51895
52818
|
}))();
|
|
51896
52819
|
},
|
|
51897
|
-
|
|
52820
|
+
getRecommendList: function getRecommendList(v) {
|
|
51898
52821
|
var _this6 = this;
|
|
52822
|
+
if (!this.data.length) return [];
|
|
52823
|
+
var list = [];
|
|
52824
|
+
var i = 0;
|
|
52825
|
+
var setItem = function setItem(parent, child) {
|
|
52826
|
+
var _ref, _recommendValue, _objectSpread2;
|
|
52827
|
+
var childKey = child ? child[_this6.primaryKey] : v;
|
|
52828
|
+
var childName = child ? child[_this6.displayKey] : v;
|
|
52829
|
+
return _objectSpread({}, parent, (_objectSpread2 = {}, _defineProperty(_objectSpread2, _this6.displayKey, parent[_this6.displayKey] + _this6.explainCode + childName), _defineProperty(_objectSpread2, _this6.primaryKey, parent[_this6.primaryKey] + _this6.explainCode + childKey), _defineProperty(_objectSpread2, "recommendValue", (_recommendValue = {}, _defineProperty(_recommendValue, _this6.displayKey, parent[_this6.displayKey]), _defineProperty(_recommendValue, _this6.primaryKey, parent[_this6.primaryKey]), _defineProperty(_recommendValue, "values", [(_ref = {}, _defineProperty(_ref, _this6.displayKey, child ? child[_this6.displayKey] : v), _defineProperty(_ref, _this6.primaryKey, childKey), _ref)]), _recommendValue)), _objectSpread2));
|
|
52830
|
+
};
|
|
52831
|
+
var _loop = function _loop() {
|
|
52832
|
+
var item = _this6.data[i];
|
|
52833
|
+
i += 1;
|
|
52834
|
+
if (!item.children || !item.children.length) {
|
|
52835
|
+
list.push(setItem(item));
|
|
52836
|
+
return "continue";
|
|
52837
|
+
}
|
|
52838
|
+
var childList = item.children.filter(function (child) {
|
|
52839
|
+
return child[_this6.displayKey].includes(v);
|
|
52840
|
+
});
|
|
52841
|
+
if (!childList.length) {
|
|
52842
|
+
list.push(setItem(item));
|
|
52843
|
+
return "continue";
|
|
52844
|
+
}
|
|
52845
|
+
list.push.apply(list, _toConsumableArray(childList.map(function (child) {
|
|
52846
|
+
return setItem(item, child);
|
|
52847
|
+
})));
|
|
52848
|
+
};
|
|
52849
|
+
while (i < this.data.length) {
|
|
52850
|
+
var _ret = _loop();
|
|
52851
|
+
if (_ret === "continue") continue;
|
|
52852
|
+
}
|
|
52853
|
+
return list;
|
|
52854
|
+
},
|
|
52855
|
+
handleFilter: function handleFilter(v) {
|
|
52856
|
+
var _this7 = this;
|
|
51899
52857
|
var filterList = [];
|
|
51900
52858
|
if (!this.input.value.length || !~this.input.value.indexOf(this.explainCode)) {
|
|
51901
52859
|
if (this.filter && typeof this.filterMenuMethod === 'function') {
|
|
51902
52860
|
filterList = this.filterMenuMethod(this.data, v);
|
|
51903
52861
|
} else {
|
|
51904
52862
|
if (v.length) {
|
|
51905
|
-
|
|
51906
|
-
filterList = this.childList.filter(function (item) {
|
|
51907
|
-
return item[_this6.displayKey] && ~item[_this6.displayKey].indexOf(v);
|
|
51908
|
-
});
|
|
51909
|
-
if (filterList.length) {
|
|
51910
|
-
var item = filterList[filterList.length - 1];
|
|
51911
|
-
item = _objectSpread({}, item, {
|
|
51912
|
-
isGroup: true
|
|
51913
|
-
});
|
|
51914
|
-
filterList[filterList.length - 1] = item;
|
|
51915
|
-
}
|
|
51916
|
-
(_filterList = filterList).push.apply(_filterList, _toConsumableArray(this.data.filter(function (item) {
|
|
51917
|
-
return item[_this6.displayKey] && ~item[_this6.displayKey].indexOf(v);
|
|
51918
|
-
})));
|
|
52863
|
+
filterList = this.getRecommendList(v);
|
|
51919
52864
|
} else {
|
|
51920
52865
|
filterList = this.data;
|
|
51921
52866
|
}
|
|
@@ -51925,7 +52870,7 @@
|
|
|
51925
52870
|
filterList = this.filterChildrenMethod(this.curItem.children, v);
|
|
51926
52871
|
} else {
|
|
51927
52872
|
filterList = this.curItem.children.filter(function (item) {
|
|
51928
|
-
return item[
|
|
52873
|
+
return item[_this7.displayKey] && ~item[_this7.displayKey].indexOf(v);
|
|
51929
52874
|
});
|
|
51930
52875
|
}
|
|
51931
52876
|
}
|
|
@@ -51968,7 +52913,7 @@
|
|
|
51968
52913
|
this.$refs.input.focus();
|
|
51969
52914
|
},
|
|
51970
52915
|
handleInputClick: function handleInputClick(e) {
|
|
51971
|
-
var
|
|
52916
|
+
var _this8 = this;
|
|
51972
52917
|
this.input.focus = true;
|
|
51973
52918
|
if (!this.input.value) {
|
|
51974
52919
|
if (!this.menuInstance) {
|
|
@@ -51978,8 +52923,8 @@
|
|
|
51978
52923
|
this.menuInstance.list = this.data;
|
|
51979
52924
|
this.menu.child = false;
|
|
51980
52925
|
this.$nextTick(function (_) {
|
|
51981
|
-
|
|
51982
|
-
|
|
52926
|
+
_this8.handelePopperEventListener();
|
|
52927
|
+
_this8.showPopper(_this8.menuInstance.$el);
|
|
51983
52928
|
});
|
|
51984
52929
|
} else {
|
|
51985
52930
|
var cur = this.curItem;
|
|
@@ -52013,7 +52958,7 @@
|
|
|
52013
52958
|
this.$emit('input-focus', e);
|
|
52014
52959
|
},
|
|
52015
52960
|
updateChildMenu: function updateChildMenu(item, index, isCondition) {
|
|
52016
|
-
var
|
|
52961
|
+
var _this9 = this;
|
|
52017
52962
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
52018
52963
|
var isChild, isRemote, list;
|
|
52019
52964
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -52025,63 +52970,63 @@
|
|
|
52025
52970
|
_context2.next = 14;
|
|
52026
52971
|
break;
|
|
52027
52972
|
}
|
|
52028
|
-
|
|
52029
|
-
if (!
|
|
52030
|
-
|
|
52973
|
+
_this9.$refs.input.blur();
|
|
52974
|
+
if (!_this9.menuChildInstance || _this9.menuChildInstance.multiable || _this9.menuChildInstance.multiable !== _this9.curItem.multiable) {
|
|
52975
|
+
_this9.initChildMenu();
|
|
52031
52976
|
}
|
|
52032
|
-
|
|
52033
|
-
|
|
52034
|
-
|
|
52035
|
-
|
|
52036
|
-
|
|
52037
|
-
|
|
52038
|
-
|
|
52977
|
+
_this9.menuChildInstance.isChildCondition = isCondition;
|
|
52978
|
+
_this9.menuChildInstance.error = '';
|
|
52979
|
+
_this9.menuChildInstance.loading = false;
|
|
52980
|
+
_this9.menuChildInstance.checked = _this9.menu.checked;
|
|
52981
|
+
_this9.showPopper(_this9.menuChildInstance.$el);
|
|
52982
|
+
_this9.menu.child = false;
|
|
52983
|
+
_this9.menuChildInstance.list = item.conditions;
|
|
52039
52984
|
setTimeout(function () {
|
|
52040
|
-
|
|
52985
|
+
_this9.$refs.input.focus();
|
|
52041
52986
|
}, 20);
|
|
52042
52987
|
_context2.next = 37;
|
|
52043
52988
|
break;
|
|
52044
52989
|
case 14:
|
|
52045
|
-
isRemote =
|
|
52990
|
+
isRemote = _this9.curItem.remote && typeof _this9.remoteMethod === 'function';
|
|
52046
52991
|
if (!(isChild || isRemote)) {
|
|
52047
52992
|
_context2.next = 35;
|
|
52048
52993
|
break;
|
|
52049
52994
|
}
|
|
52050
|
-
|
|
52051
|
-
if (!
|
|
52052
|
-
|
|
52995
|
+
_this9.$refs.input.blur();
|
|
52996
|
+
if (!_this9.menuChildInstance || _this9.menuChildInstance.multiable || _this9.menuChildInstance.multiable !== _this9.curItem.multiable) {
|
|
52997
|
+
_this9.initChildMenu();
|
|
52053
52998
|
}
|
|
52054
|
-
|
|
52055
|
-
|
|
52056
|
-
|
|
52057
|
-
|
|
52058
|
-
|
|
52059
|
-
|
|
52999
|
+
_this9.menuChildInstance.isChildCondition = isCondition;
|
|
53000
|
+
_this9.menuChildInstance.error = '';
|
|
53001
|
+
_this9.menuChildInstance.loading = isRemote;
|
|
53002
|
+
_this9.menuChildInstance.checked = _this9.menu.checked;
|
|
53003
|
+
_this9.showPopper(_this9.menuChildInstance.$el);
|
|
53004
|
+
_this9.menu.child = true;
|
|
52060
53005
|
if (!isRemote) {
|
|
52061
53006
|
_context2.next = 31;
|
|
52062
53007
|
break;
|
|
52063
53008
|
}
|
|
52064
53009
|
_context2.next = 27;
|
|
52065
|
-
return
|
|
52066
|
-
|
|
53010
|
+
return _this9.remoteMethod(_this9.input.value, item, index).finally(function () {
|
|
53011
|
+
_this9.menuChildInstance.loading = false;
|
|
52067
53012
|
});
|
|
52068
53013
|
case 27:
|
|
52069
53014
|
list = _context2.sent;
|
|
52070
|
-
|
|
53015
|
+
_this9.menuChildInstance.list = list;
|
|
52071
53016
|
_context2.next = 32;
|
|
52072
53017
|
break;
|
|
52073
53018
|
case 31:
|
|
52074
|
-
|
|
53019
|
+
_this9.menuChildInstance.list = item.children;
|
|
52075
53020
|
case 32:
|
|
52076
53021
|
setTimeout(function () {
|
|
52077
|
-
|
|
53022
|
+
_this9.$refs.input.focus();
|
|
52078
53023
|
}, 20);
|
|
52079
53024
|
_context2.next = 37;
|
|
52080
53025
|
break;
|
|
52081
53026
|
case 35:
|
|
52082
|
-
|
|
53027
|
+
_this9.hidePopper();
|
|
52083
53028
|
setTimeout(function () {
|
|
52084
|
-
|
|
53029
|
+
_this9.handleInputFocus();
|
|
52085
53030
|
}, 20);
|
|
52086
53031
|
case 37:
|
|
52087
53032
|
case "end":
|
|
@@ -52092,15 +53037,21 @@
|
|
|
52092
53037
|
}))();
|
|
52093
53038
|
},
|
|
52094
53039
|
handleMenuSelect: function handleMenuSelect(item, index) {
|
|
52095
|
-
var
|
|
53040
|
+
var _this10 = this;
|
|
53041
|
+
if (item.recommendValue) {
|
|
53042
|
+
this.input.value = item[this.displayKey];
|
|
53043
|
+
this.updateInput(this.input.value);
|
|
53044
|
+
this.handleEnter(this.input.value, item.recommendValue, false);
|
|
53045
|
+
return;
|
|
53046
|
+
}
|
|
52096
53047
|
var isChildClick = ~this.data.findIndex(function (set) {
|
|
52097
|
-
return set[
|
|
53048
|
+
return set[_this10.primaryKey] === item[_this10.primaryKey];
|
|
52098
53049
|
});
|
|
52099
53050
|
if (!isChildClick) {
|
|
52100
53051
|
this.input.value = item[this.displayKey];
|
|
52101
53052
|
this.$nextTick().then(function () {
|
|
52102
|
-
|
|
52103
|
-
|
|
53053
|
+
_this10.updateInput(_this10.input.value);
|
|
53054
|
+
_this10.handleKeyEnter();
|
|
52104
53055
|
});
|
|
52105
53056
|
} else {
|
|
52106
53057
|
this.menu.active = ~isChildClick;
|
|
@@ -52108,9 +53059,9 @@
|
|
|
52108
53059
|
var isChildCondition = !!(this.curItem.conditions && this.curItem.conditions.length);
|
|
52109
53060
|
this.input.value = item[this.displayKey] + this.explainCode;
|
|
52110
53061
|
this.$nextTick().then(function () {
|
|
52111
|
-
|
|
52112
|
-
|
|
52113
|
-
|
|
53062
|
+
_this10.updateInput(_this10.input.value);
|
|
53063
|
+
_this10.updateChildMenu(item, index, isChildCondition);
|
|
53064
|
+
_this10.$emit('menu-select', item, index);
|
|
52114
53065
|
});
|
|
52115
53066
|
}
|
|
52116
53067
|
},
|
|
@@ -52163,7 +53114,7 @@
|
|
|
52163
53114
|
}
|
|
52164
53115
|
},
|
|
52165
53116
|
handleKeyBackspace: function handleKeyBackspace(e) {
|
|
52166
|
-
var
|
|
53117
|
+
var _this11 = this;
|
|
52167
53118
|
var keys = keys$1(this.menu.checked);
|
|
52168
53119
|
if (this.curItem.multiable && keys.length) {
|
|
52169
53120
|
var key = keys[keys.length - 1];
|
|
@@ -52187,7 +53138,7 @@
|
|
|
52187
53138
|
if (!this.input.value && !(!this.chip.list.length && !this.$refs.input.textContent.length)) {
|
|
52188
53139
|
var item = this.chip.list.pop();
|
|
52189
53140
|
this.$nextTick().then(function () {
|
|
52190
|
-
|
|
53141
|
+
_this11.showMenu(_this11.showPopoverTagChange);
|
|
52191
53142
|
});
|
|
52192
53143
|
this.$emit('change', this.chip.list);
|
|
52193
53144
|
this.$emit('key-delete', item);
|
|
@@ -52210,7 +53161,7 @@
|
|
|
52210
53161
|
}
|
|
52211
53162
|
},
|
|
52212
53163
|
handleKeyEnter: function handleKeyEnter(e) {
|
|
52213
|
-
var
|
|
53164
|
+
var _this12 = this;
|
|
52214
53165
|
var needShowPopover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
52215
53166
|
var needEmitKeyEnter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
52216
53167
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() {
|
|
@@ -52220,38 +53171,39 @@
|
|
|
52220
53171
|
case 0:
|
|
52221
53172
|
_context3.next = 2;
|
|
52222
53173
|
return new promise$1(function (resolve) {
|
|
52223
|
-
if (!
|
|
53174
|
+
if (!_this12.input.value) {
|
|
52224
53175
|
resolve();
|
|
52225
|
-
} else if (
|
|
53176
|
+
} else if (_this12.input.value === _this12.curItem[_this12.displayKey] + _this12.explainCode) {
|
|
52226
53177
|
e.preventDefault();
|
|
52227
|
-
if (!
|
|
52228
|
-
|
|
53178
|
+
if (!_this12.menuChildInstance) {
|
|
53179
|
+
_this12.initChildMenu();
|
|
52229
53180
|
}
|
|
52230
|
-
|
|
52231
|
-
|
|
52232
|
-
|
|
53181
|
+
_this12.menuChildInstance.error = _this12.defaultEmptyText;
|
|
53182
|
+
_this12.$nextTick(function (_) {
|
|
53183
|
+
_this12.showPopper(_this12.menuChildInstance.$el);
|
|
52233
53184
|
});
|
|
52234
|
-
|
|
53185
|
+
_this12.handleInputFocus();
|
|
52235
53186
|
resolve();
|
|
52236
53187
|
} else {
|
|
53188
|
+
e.preventDefault();
|
|
52237
53189
|
setTimeout(function () {
|
|
52238
|
-
if (
|
|
52239
|
-
var
|
|
52240
|
-
var val =
|
|
52241
|
-
if (keys$1(
|
|
52242
|
-
val = val.replace(
|
|
53190
|
+
if (_this12.menu.id !== null) {
|
|
53191
|
+
var _this12$handleEnter;
|
|
53192
|
+
var val = _this12.input.value.replace(_this12.curItem[_this12.displayKey] + _this12.explainCode, '');
|
|
53193
|
+
if (keys$1(_this12.menu.childCondition).length) {
|
|
53194
|
+
val = val.replace(_this12.menu.childCondition[_this12.displayKey], '');
|
|
52243
53195
|
}
|
|
52244
|
-
|
|
53196
|
+
_this12.handleEnter(_this12.input.value, (_this12$handleEnter = {}, _defineProperty(_this12$handleEnter, _this12.primaryKey, val), _defineProperty(_this12$handleEnter, _this12.displayKey, val), _this12$handleEnter), true, needShowPopover);
|
|
52245
53197
|
} else {
|
|
52246
|
-
var
|
|
52247
|
-
|
|
53198
|
+
var _this12$handleEnter2;
|
|
53199
|
+
_this12.handleEnter(_this12.input.value, (_this12$handleEnter2 = {}, _defineProperty(_this12$handleEnter2, _this12.primaryKey, _this12.input.value), _defineProperty(_this12$handleEnter2, _this12.displayKey, _this12.input.value), _this12$handleEnter2), false, needShowPopover);
|
|
52248
53200
|
}
|
|
52249
53201
|
resolve();
|
|
52250
53202
|
}, 10);
|
|
52251
53203
|
}
|
|
52252
53204
|
});
|
|
52253
53205
|
case 2:
|
|
52254
|
-
needEmitKeyEnter &&
|
|
53206
|
+
needEmitKeyEnter && _this12.$emit('key-enter', e);
|
|
52255
53207
|
case 3:
|
|
52256
53208
|
case "end":
|
|
52257
53209
|
return _context3.stop();
|
|
@@ -52261,7 +53213,7 @@
|
|
|
52261
53213
|
}))();
|
|
52262
53214
|
},
|
|
52263
53215
|
handleValidate: function handleValidate(valList) {
|
|
52264
|
-
var
|
|
53216
|
+
var _this13 = this;
|
|
52265
53217
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee4() {
|
|
52266
53218
|
var validate, selection;
|
|
52267
53219
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
@@ -52269,29 +53221,29 @@
|
|
|
52269
53221
|
switch (_context4.prev = _context4.next) {
|
|
52270
53222
|
case 0:
|
|
52271
53223
|
validate = true;
|
|
52272
|
-
if (!(
|
|
53224
|
+
if (!(_this13.curItem && _this13.curItem.validate && typeof _this13.curItem.validate === 'function')) {
|
|
52273
53225
|
_context4.next = 8;
|
|
52274
53226
|
break;
|
|
52275
53227
|
}
|
|
52276
53228
|
_context4.next = 4;
|
|
52277
|
-
return
|
|
53229
|
+
return _this13.curItem.validate(_toConsumableArray(valList), _this13.curItem);
|
|
52278
53230
|
case 4:
|
|
52279
53231
|
validate = _context4.sent;
|
|
52280
53232
|
if (typeof validate === 'string') {
|
|
52281
|
-
|
|
53233
|
+
_this13.validateStr = validate;
|
|
52282
53234
|
validate = false;
|
|
52283
53235
|
} else {
|
|
52284
|
-
validate && (
|
|
53236
|
+
validate && (_this13.validateStr = '');
|
|
52285
53237
|
}
|
|
52286
53238
|
_context4.next = 9;
|
|
52287
53239
|
break;
|
|
52288
53240
|
case 8:
|
|
52289
|
-
|
|
53241
|
+
_this13.validateStr = '';
|
|
52290
53242
|
case 9:
|
|
52291
53243
|
if (!validate) {
|
|
52292
53244
|
selection = window.getSelection();
|
|
52293
53245
|
if (selection.focusOffset === 0) {
|
|
52294
|
-
selection.selectAllChildren(
|
|
53246
|
+
selection.selectAllChildren(_this13.$refs.input);
|
|
52295
53247
|
selection.collapseToEnd();
|
|
52296
53248
|
}
|
|
52297
53249
|
}
|
|
@@ -52305,7 +53257,7 @@
|
|
|
52305
53257
|
}))();
|
|
52306
53258
|
},
|
|
52307
53259
|
handleEnter: function handleEnter(val, item) {
|
|
52308
|
-
var
|
|
53260
|
+
var _this14 = this;
|
|
52309
53261
|
var child = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
52310
53262
|
var needShowPopover = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
52311
53263
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee5() {
|
|
@@ -52318,25 +53270,25 @@
|
|
|
52318
53270
|
_context5.next = 19;
|
|
52319
53271
|
break;
|
|
52320
53272
|
}
|
|
52321
|
-
if (!(
|
|
53273
|
+
if (!(_this14.input.value === _this14.defaultCondition[_this14.displayKey])) {
|
|
52322
53274
|
_context5.next = 5;
|
|
52323
53275
|
break;
|
|
52324
53276
|
}
|
|
52325
|
-
|
|
53277
|
+
_this14.chip.list.push(_this14.defaultCondition);
|
|
52326
53278
|
_context5.next = 17;
|
|
52327
53279
|
break;
|
|
52328
53280
|
case 5:
|
|
52329
53281
|
values = [];
|
|
52330
|
-
if (keys$1(
|
|
52331
|
-
values = values$1(
|
|
53282
|
+
if (keys$1(_this14.menu.checked).length) {
|
|
53283
|
+
values = values$1(_this14.menu.checked);
|
|
52332
53284
|
} else {
|
|
52333
53285
|
values.push(item);
|
|
52334
53286
|
}
|
|
52335
|
-
data = _extends({},
|
|
53287
|
+
data = _extends({}, _this14.curItem, {
|
|
52336
53288
|
values: values
|
|
52337
53289
|
});
|
|
52338
|
-
if (keys$1(
|
|
52339
|
-
data['condition'] =
|
|
53290
|
+
if (keys$1(_this14.menu.childCondition).length) {
|
|
53291
|
+
data['condition'] = _this14.menu.childCondition;
|
|
52340
53292
|
}
|
|
52341
53293
|
if (data.children) {
|
|
52342
53294
|
delete data.children;
|
|
@@ -52345,7 +53297,7 @@
|
|
|
52345
53297
|
delete data.conditions;
|
|
52346
53298
|
}
|
|
52347
53299
|
_context5.next = 13;
|
|
52348
|
-
return
|
|
53300
|
+
return _this14.handleValidate(values);
|
|
52349
53301
|
case 13:
|
|
52350
53302
|
validate = _context5.sent;
|
|
52351
53303
|
if (validate) {
|
|
@@ -52354,13 +53306,13 @@
|
|
|
52354
53306
|
}
|
|
52355
53307
|
return _context5.abrupt("return");
|
|
52356
53308
|
case 16:
|
|
52357
|
-
|
|
53309
|
+
_this14.chip.list.push(data);
|
|
52358
53310
|
case 17:
|
|
52359
53311
|
_context5.next = 25;
|
|
52360
53312
|
break;
|
|
52361
53313
|
case 19:
|
|
52362
53314
|
_context5.next = 21;
|
|
52363
|
-
return
|
|
53315
|
+
return _this14.handleValidate([item]);
|
|
52364
53316
|
case 21:
|
|
52365
53317
|
_validate = _context5.sent;
|
|
52366
53318
|
if (_validate) {
|
|
@@ -52369,25 +53321,25 @@
|
|
|
52369
53321
|
}
|
|
52370
53322
|
return _context5.abrupt("return");
|
|
52371
53323
|
case 24:
|
|
52372
|
-
|
|
53324
|
+
_this14.chip.list.push(item);
|
|
52373
53325
|
case 25:
|
|
52374
|
-
|
|
52375
|
-
|
|
52376
|
-
|
|
52377
|
-
|
|
52378
|
-
|
|
52379
|
-
|
|
52380
|
-
if (
|
|
52381
|
-
|
|
53326
|
+
_this14.menu.checked = {};
|
|
53327
|
+
_this14.menu.active = -1;
|
|
53328
|
+
_this14.menu.id = null;
|
|
53329
|
+
_this14.input.value = '';
|
|
53330
|
+
_this14.menu.childCondition = {};
|
|
53331
|
+
_this14.updateInput();
|
|
53332
|
+
if (_this14.menuInstance) {
|
|
53333
|
+
_this14.menuInstance.filter = '';
|
|
52382
53334
|
}
|
|
52383
53335
|
if (needShowPopover) {
|
|
52384
|
-
|
|
52385
|
-
return
|
|
53336
|
+
_this14.$nextTick(function (_) {
|
|
53337
|
+
return _this14.showMenu(_this14.showPopoverTagChange);
|
|
52386
53338
|
});
|
|
52387
|
-
|
|
53339
|
+
_this14.$refs.input.focus();
|
|
52388
53340
|
}
|
|
52389
|
-
|
|
52390
|
-
|
|
53341
|
+
_this14.$emit('change', _this14.chip.list);
|
|
53342
|
+
_this14.dispatch('bk-form-item', 'form-change');
|
|
52391
53343
|
case 35:
|
|
52392
53344
|
case "end":
|
|
52393
53345
|
return _context5.stop();
|
|
@@ -52397,14 +53349,14 @@
|
|
|
52397
53349
|
}))();
|
|
52398
53350
|
},
|
|
52399
53351
|
handleClear: function handleClear(index, item) {
|
|
52400
|
-
var
|
|
53352
|
+
var _this15 = this;
|
|
52401
53353
|
var name = this.chip.list.splice(index, 1);
|
|
52402
53354
|
setTimeout(function () {
|
|
52403
|
-
|
|
52404
|
-
!
|
|
52405
|
-
|
|
52406
|
-
|
|
52407
|
-
|
|
53355
|
+
_this15.popperMenuInstance && _this15.popperMenuInstance.popperInstance && _this15.popperMenuInstance.popperInstance.update();
|
|
53356
|
+
!_this15.input.value.length && _this15.showMenu();
|
|
53357
|
+
_this15.$emit('change', _this15.chip.list);
|
|
53358
|
+
_this15.$emit('chip-del', name);
|
|
53359
|
+
_this15.dispatch('bk-form-item', 'form-change');
|
|
52408
53360
|
}, 0);
|
|
52409
53361
|
},
|
|
52410
53362
|
handleSelectConditon: function handleSelectConditon(item) {
|
|
@@ -52439,10 +53391,10 @@
|
|
|
52439
53391
|
}
|
|
52440
53392
|
},
|
|
52441
53393
|
updateCheckedInputVal: function updateCheckedInputVal() {
|
|
52442
|
-
var
|
|
53394
|
+
var _this16 = this;
|
|
52443
53395
|
if (this.menu.id !== null) {
|
|
52444
53396
|
var val = values$1(this.menu.checked).map(function (set) {
|
|
52445
|
-
return set[
|
|
53397
|
+
return set[_this16.displayKey];
|
|
52446
53398
|
}).join(this.splitCode);
|
|
52447
53399
|
this.input.value = this.curItem[this.displayKey] + this.explainCode + val;
|
|
52448
53400
|
this.updateInput(this.input.value);
|
|
@@ -55337,7 +56289,7 @@
|
|
|
55337
56289
|
for (var j = 0; j < _this.list.length; j++) {
|
|
55338
56290
|
if (valueList[i] === _this.list[j].id) {
|
|
55339
56291
|
_this.handleItemFn(_this.list[j], true);
|
|
55340
|
-
valueList.splice(
|
|
56292
|
+
valueList.splice(i, 1);
|
|
55341
56293
|
_this.$nextTick(function () {
|
|
55342
56294
|
_this.broadcast('bkCaspanel', 'change-selected', {
|
|
55343
56295
|
idList: valueList
|
|
@@ -55806,11 +56758,6 @@
|
|
|
55806
56758
|
}
|
|
55807
56759
|
}
|
|
55808
56760
|
},
|
|
55809
|
-
selectedName: function selectedName() {
|
|
55810
|
-
if (this.filterable && !this.multiple) {
|
|
55811
|
-
this.searchContent = this.selectedName;
|
|
55812
|
-
}
|
|
55813
|
-
},
|
|
55814
56761
|
list: {
|
|
55815
56762
|
handler: function handler(newValue) {
|
|
55816
56763
|
var _this = this;
|
|
@@ -55917,14 +56864,21 @@
|
|
|
55917
56864
|
});
|
|
55918
56865
|
},
|
|
55919
56866
|
mounted: function mounted() {
|
|
56867
|
+
var _this3 = this;
|
|
55920
56868
|
this.initValue();
|
|
55921
56869
|
if (this.isRemote) {
|
|
55922
56870
|
this.filterable = false;
|
|
55923
56871
|
}
|
|
56872
|
+
if (this.filterable && !this.multiple) {
|
|
56873
|
+
this.searchContent = this.selectedName;
|
|
56874
|
+
this.$nextTick(function () {
|
|
56875
|
+
_this3.tippyInstance();
|
|
56876
|
+
});
|
|
56877
|
+
}
|
|
55924
56878
|
},
|
|
55925
56879
|
methods: {
|
|
55926
56880
|
recurrenceNodes: function recurrenceNodes(list) {
|
|
55927
|
-
var
|
|
56881
|
+
var _this4 = this;
|
|
55928
56882
|
if (!isArray$1(list) || !list.length) {
|
|
55929
56883
|
return [];
|
|
55930
56884
|
}
|
|
@@ -55933,11 +56887,11 @@
|
|
|
55933
56887
|
nameKey = _this$nodeOptions.nameKey,
|
|
55934
56888
|
childrenKey = _this$nodeOptions.childrenKey;
|
|
55935
56889
|
list.forEach(function (item, index) {
|
|
55936
|
-
item.id =
|
|
56890
|
+
item.id = _this4.multiple ? String(item[idKey]) : item[idKey];
|
|
55937
56891
|
item.name = item[nameKey] || '';
|
|
55938
56892
|
var children = item[childrenKey];
|
|
55939
56893
|
if (isArray$1(children)) {
|
|
55940
|
-
item.children =
|
|
56894
|
+
item.children = _this4.recurrenceNodes(children);
|
|
55941
56895
|
}
|
|
55942
56896
|
});
|
|
55943
56897
|
return list;
|
|
@@ -55978,6 +56932,7 @@
|
|
|
55978
56932
|
this.selectedList = [];
|
|
55979
56933
|
this.tmpSelected = [];
|
|
55980
56934
|
this.exposedId(this.currentList, _oldId);
|
|
56935
|
+
this.searchContent = '';
|
|
55981
56936
|
}
|
|
55982
56937
|
this.broadcast('bkCaspanel', 'on-clear');
|
|
55983
56938
|
this.tippyInstance();
|
|
@@ -56043,28 +56998,28 @@
|
|
|
56043
56998
|
});
|
|
56044
56999
|
},
|
|
56045
57000
|
getSearchList: function getSearchList() {
|
|
56046
|
-
var
|
|
57001
|
+
var _this5 = this;
|
|
56047
57002
|
var selections = this.changeList();
|
|
56048
57003
|
this.searchList = selections.filter(function (item) {
|
|
56049
|
-
return item.name && item.name.indexOf(
|
|
57004
|
+
return item.name && item.name.indexOf(_this5.searchContent) > -1;
|
|
56050
57005
|
});
|
|
56051
57006
|
if (!this.multiple) {
|
|
56052
57007
|
this.searchList.forEach(function (item) {
|
|
56053
|
-
item.isSelected =
|
|
57008
|
+
item.isSelected = _this5.currentList.join(',') === item.id.join(',');
|
|
56054
57009
|
});
|
|
56055
57010
|
}
|
|
56056
57011
|
},
|
|
56057
57012
|
changeList: function changeList() {
|
|
56058
|
-
var
|
|
57013
|
+
var _this6 = this;
|
|
56059
57014
|
var listInfo = JSON.parse(stringify$1(this.cascadeList));
|
|
56060
57015
|
var selections = [];
|
|
56061
57016
|
var getSelections = function getSelections(arr, id, name) {
|
|
56062
57017
|
arr.forEach(function (item) {
|
|
56063
|
-
item.id = id ? id +
|
|
56064
|
-
item.name = name ? name +
|
|
56065
|
-
if (
|
|
57018
|
+
item.id = id ? id + _this6.separator + item.id : item.id;
|
|
57019
|
+
item.name = name ? name + _this6.separator + item.name : item.name;
|
|
57020
|
+
if (_this6.checkAnyLevel) {
|
|
56066
57021
|
selections.push({
|
|
56067
|
-
id: String(item.id).split(
|
|
57022
|
+
id: String(item.id).split(_this6.separator),
|
|
56068
57023
|
name: item.name,
|
|
56069
57024
|
disabled: !!item.disabled,
|
|
56070
57025
|
isSelected: !!item.isSelected
|
|
@@ -56082,7 +57037,7 @@
|
|
|
56082
57037
|
return false;
|
|
56083
57038
|
}
|
|
56084
57039
|
selections.push({
|
|
56085
|
-
id: item.id.split(
|
|
57040
|
+
id: item.id.split(_this6.separator),
|
|
56086
57041
|
name: item.name,
|
|
56087
57042
|
disabled: !!item.disabled,
|
|
56088
57043
|
isSelected: !!item.isSelected
|
|
@@ -56112,18 +57067,18 @@
|
|
|
56112
57067
|
});
|
|
56113
57068
|
},
|
|
56114
57069
|
recursiveList: function recursiveList(arr, valueList, type) {
|
|
56115
|
-
var
|
|
57070
|
+
var _this7 = this;
|
|
56116
57071
|
arr.forEach(function (arrItem) {
|
|
56117
57072
|
if (type === 'init') {
|
|
56118
|
-
|
|
56119
|
-
|
|
57073
|
+
_this7.$set(arrItem, 'isSelected', false);
|
|
57074
|
+
_this7.$set(arrItem, 'isIndeterminate', false);
|
|
56120
57075
|
}
|
|
56121
57076
|
valueList.forEach(function (item) {
|
|
56122
57077
|
if (isArray$1(item)) {
|
|
56123
57078
|
if (item[item.length - 1] === arrItem.id) {
|
|
56124
57079
|
arrItem.isSelected = true;
|
|
56125
57080
|
}
|
|
56126
|
-
if (!
|
|
57081
|
+
if (!_this7.checkAnyLevel) {
|
|
56127
57082
|
item.forEach(function (child) {
|
|
56128
57083
|
if (child === arrItem.id) {
|
|
56129
57084
|
arrItem.isIndeterminate = true;
|
|
@@ -56133,12 +57088,12 @@
|
|
|
56133
57088
|
}
|
|
56134
57089
|
});
|
|
56135
57090
|
if (arrItem.children && arrItem.children.length) {
|
|
56136
|
-
|
|
57091
|
+
_this7.recursiveList(arrItem.children, valueList, type);
|
|
56137
57092
|
}
|
|
56138
57093
|
});
|
|
56139
57094
|
},
|
|
56140
57095
|
checkListStatus: function checkListStatus(currentValue) {
|
|
56141
|
-
var
|
|
57096
|
+
var _this8 = this;
|
|
56142
57097
|
if (!this.checkAnyLevel) {
|
|
56143
57098
|
var valueList = [];
|
|
56144
57099
|
currentValue.forEach(function (item) {
|
|
@@ -56159,7 +57114,7 @@
|
|
|
56159
57114
|
}
|
|
56160
57115
|
});
|
|
56161
57116
|
};
|
|
56162
|
-
checkInfo(
|
|
57117
|
+
checkInfo(_this8.cascadeList);
|
|
56163
57118
|
};
|
|
56164
57119
|
for (var i = 0; i <= value; i++) {
|
|
56165
57120
|
_loop(i);
|
|
@@ -56167,7 +57122,7 @@
|
|
|
56167
57122
|
}
|
|
56168
57123
|
},
|
|
56169
57124
|
handleSelectItem: function handleSelectItem(item, index) {
|
|
56170
|
-
var
|
|
57125
|
+
var _this9 = this;
|
|
56171
57126
|
if (item.disabled) {
|
|
56172
57127
|
return;
|
|
56173
57128
|
}
|
|
@@ -56201,19 +57156,19 @@
|
|
|
56201
57156
|
this.selectedList = [];
|
|
56202
57157
|
this.updateSelected();
|
|
56203
57158
|
setTimeout(function () {
|
|
56204
|
-
|
|
56205
|
-
|
|
56206
|
-
|
|
57159
|
+
_this9.searchContent = _this9.selectedName;
|
|
57160
|
+
_this9.exposedId(_this9.currentList, oldVal);
|
|
57161
|
+
_this9.tippyInstance();
|
|
56207
57162
|
}, 0);
|
|
56208
57163
|
}
|
|
56209
57164
|
},
|
|
56210
57165
|
handleScrollToRight: function handleScrollToRight() {
|
|
56211
|
-
var
|
|
57166
|
+
var _this10 = this;
|
|
56212
57167
|
if (/^\d+(px|vh|vm|re?m)?$/.test(this.maxWidth)) {
|
|
56213
57168
|
if (this.$refs.refDropdownContent && this.$refs.refDropdownContent.$el) {
|
|
56214
57169
|
this.$nextTick(function () {
|
|
56215
|
-
var wrapper =
|
|
56216
|
-
var target =
|
|
57170
|
+
var wrapper = _this10.$refs.refDropContentWrapper;
|
|
57171
|
+
var target = _this10.$refs.refDropdownContent.$el;
|
|
56217
57172
|
var scrollWidth = target.clientWidth;
|
|
56218
57173
|
var parentWidth = wrapper.clientWidth;
|
|
56219
57174
|
var left = scrollWidth > parentWidth ? scrollWidth - parentWidth : 0;
|