bkui-vue 0.0.1-beta.392 → 0.0.1-beta.394

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.
Files changed (155) hide show
  1. package/dist/index.cjs.js +40 -40
  2. package/dist/index.esm.js +1129 -1100
  3. package/dist/index.umd.js +39 -39
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2447
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2453
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,2813 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("@popperjs/core"), require("lodash"), require("vue-types"), require("vue"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["@popperjs/core", "lodash", "vue-types", "vue"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("@popperjs/core"), require("lodash"), require("vue-types"), require("vue")) : factory(root["@popperjs/core"], root["lodash"], root["vue-types"], root["vue"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__5798__, __WEBPACK_EXTERNAL_MODULE__467__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__748__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 8022:
15
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16
-
17
- var v1 = __webpack_require__(4481);
18
- var v4 = __webpack_require__(6426);
19
-
20
- var uuid = v4;
21
- uuid.v1 = v1;
22
- uuid.v4 = v4;
23
-
24
- module.exports = uuid;
25
-
26
-
27
- /***/ }),
28
-
29
- /***/ 8725:
30
- /***/ ((module) => {
31
-
32
- /**
33
- * Convert array of 16 byte values to UUID string format of the form:
34
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
35
- */
36
- var byteToHex = [];
37
- for (var i = 0; i < 256; ++i) {
38
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
39
- }
40
-
41
- function bytesToUuid(buf, offset) {
42
- var i = offset || 0;
43
- var bth = byteToHex;
44
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
45
- return ([
46
- bth[buf[i++]], bth[buf[i++]],
47
- bth[buf[i++]], bth[buf[i++]], '-',
48
- bth[buf[i++]], bth[buf[i++]], '-',
49
- bth[buf[i++]], bth[buf[i++]], '-',
50
- bth[buf[i++]], bth[buf[i++]], '-',
51
- bth[buf[i++]], bth[buf[i++]],
52
- bth[buf[i++]], bth[buf[i++]],
53
- bth[buf[i++]], bth[buf[i++]]
54
- ]).join('');
55
- }
56
-
57
- module.exports = bytesToUuid;
58
-
59
-
60
- /***/ }),
61
-
62
- /***/ 9157:
63
- /***/ ((module) => {
64
-
65
- // Unique ID creation requires a high quality random # generator. In the
66
- // browser this is a little complicated due to unknown quality of Math.random()
67
- // and inconsistent support for the `crypto` API. We do the best we can via
68
- // feature-detection
69
-
70
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
71
- // implementation. Also, find the complete implementation of crypto on IE11.
72
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
73
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
74
-
75
- if (getRandomValues) {
76
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
77
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
78
-
79
- module.exports = function whatwgRNG() {
80
- getRandomValues(rnds8);
81
- return rnds8;
82
- };
83
- } else {
84
- // Math.random()-based (RNG)
85
- //
86
- // If all else fails, use Math.random(). It's fast, but is of unspecified
87
- // quality.
88
- var rnds = new Array(16);
89
-
90
- module.exports = function mathRNG() {
91
- for (var i = 0, r; i < 16; i++) {
92
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
93
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
94
- }
95
-
96
- return rnds;
97
- };
98
- }
99
-
100
-
101
- /***/ }),
102
-
103
- /***/ 4481:
104
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
105
-
106
- var rng = __webpack_require__(9157);
107
- var bytesToUuid = __webpack_require__(8725);
108
-
109
- // **`v1()` - Generate time-based UUID**
110
- //
111
- // Inspired by https://github.com/LiosK/UUID.js
112
- // and http://docs.python.org/library/uuid.html
113
-
114
- var _nodeId;
115
- var _clockseq;
116
-
117
- // Previous uuid creation time
118
- var _lastMSecs = 0;
119
- var _lastNSecs = 0;
120
-
121
- // See https://github.com/uuidjs/uuid for API details
122
- function v1(options, buf, offset) {
123
- var i = buf && offset || 0;
124
- var b = buf || [];
125
-
126
- options = options || {};
127
- var node = options.node || _nodeId;
128
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
129
-
130
- // node and clockseq need to be initialized to random values if they're not
131
- // specified. We do this lazily to minimize issues related to insufficient
132
- // system entropy. See #189
133
- if (node == null || clockseq == null) {
134
- var seedBytes = rng();
135
- if (node == null) {
136
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
137
- node = _nodeId = [
138
- seedBytes[0] | 0x01,
139
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
140
- ];
141
- }
142
- if (clockseq == null) {
143
- // Per 4.2.2, randomize (14 bit) clockseq
144
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
145
- }
146
- }
147
-
148
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
149
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
150
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
151
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
152
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
153
-
154
- // Per 4.2.1.2, use count of uuid's generated during the current clock
155
- // cycle to simulate higher resolution clock
156
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
157
-
158
- // Time since last uuid creation (in msecs)
159
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
160
-
161
- // Per 4.2.1.2, Bump clockseq on clock regression
162
- if (dt < 0 && options.clockseq === undefined) {
163
- clockseq = clockseq + 1 & 0x3fff;
164
- }
165
-
166
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
167
- // time interval
168
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
169
- nsecs = 0;
170
- }
171
-
172
- // Per 4.2.1.2 Throw error if too many uuids are requested
173
- if (nsecs >= 10000) {
174
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
175
- }
176
-
177
- _lastMSecs = msecs;
178
- _lastNSecs = nsecs;
179
- _clockseq = clockseq;
180
-
181
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
182
- msecs += 12219292800000;
183
-
184
- // `time_low`
185
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
186
- b[i++] = tl >>> 24 & 0xff;
187
- b[i++] = tl >>> 16 & 0xff;
188
- b[i++] = tl >>> 8 & 0xff;
189
- b[i++] = tl & 0xff;
190
-
191
- // `time_mid`
192
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
193
- b[i++] = tmh >>> 8 & 0xff;
194
- b[i++] = tmh & 0xff;
195
-
196
- // `time_high_and_version`
197
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
198
- b[i++] = tmh >>> 16 & 0xff;
199
-
200
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
201
- b[i++] = clockseq >>> 8 | 0x80;
202
-
203
- // `clock_seq_low`
204
- b[i++] = clockseq & 0xff;
205
-
206
- // `node`
207
- for (var n = 0; n < 6; ++n) {
208
- b[i + n] = node[n];
209
- }
210
-
211
- return buf ? buf : bytesToUuid(b);
212
- }
213
-
214
- module.exports = v1;
215
-
216
-
217
- /***/ }),
218
-
219
- /***/ 6426:
220
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
221
-
222
- var rng = __webpack_require__(9157);
223
- var bytesToUuid = __webpack_require__(8725);
224
-
225
- function v4(options, buf, offset) {
226
- var i = buf && offset || 0;
227
-
228
- if (typeof(options) == 'string') {
229
- buf = options === 'binary' ? new Array(16) : null;
230
- options = null;
231
- }
232
- options = options || {};
233
-
234
- var rnds = options.random || (options.rng || rng)();
235
-
236
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
237
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
238
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
239
-
240
- // Copy bytes to buffer, if provided
241
- if (buf) {
242
- for (var ii = 0; ii < 16; ++ii) {
243
- buf[i + ii] = rnds[ii];
244
- }
245
- }
246
-
247
- return buf || bytesToUuid(rnds);
248
- }
249
-
250
- module.exports = v4;
251
-
252
-
253
- /***/ }),
254
-
255
- /***/ 5798:
256
- /***/ ((module) => {
257
-
258
- "use strict";
259
- module.exports = __WEBPACK_EXTERNAL_MODULE__5798__;
260
-
261
- /***/ }),
262
-
263
- /***/ 467:
264
- /***/ ((module) => {
265
-
266
- "use strict";
267
- module.exports = __WEBPACK_EXTERNAL_MODULE__467__;
268
-
269
- /***/ }),
270
-
271
- /***/ 748:
272
- /***/ ((module) => {
273
-
274
- "use strict";
275
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
276
-
277
- /***/ }),
278
-
279
- /***/ 210:
280
- /***/ ((module) => {
281
-
282
- "use strict";
283
- module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
284
-
285
- /***/ })
286
-
287
- /******/ });
288
- /************************************************************************/
289
- /******/ // The module cache
290
- /******/ var __webpack_module_cache__ = {};
291
- /******/
292
- /******/ // The require function
293
- /******/ function __webpack_require__(moduleId) {
294
- /******/ // Check if module is in cache
295
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
296
- /******/ if (cachedModule !== undefined) {
297
- /******/ return cachedModule.exports;
298
- /******/ }
299
- /******/ // Create a new module (and put it into the cache)
300
- /******/ var module = __webpack_module_cache__[moduleId] = {
301
- /******/ // no module.id needed
302
- /******/ // no module.loaded needed
303
- /******/ exports: {}
304
- /******/ };
305
- /******/
306
- /******/ // Execute the module function
307
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
308
- /******/
309
- /******/ // Return the exports of the module
310
- /******/ return module.exports;
311
- /******/ }
312
- /******/
313
- /************************************************************************/
314
- /******/ /* webpack/runtime/define property getters */
315
- /******/ (() => {
316
- /******/ // define getter functions for harmony exports
317
- /******/ __webpack_require__.d = (exports, definition) => {
318
- /******/ for(var key in definition) {
319
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
320
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
321
- /******/ }
322
- /******/ }
323
- /******/ };
324
- /******/ })();
325
- /******/
326
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
327
- /******/ (() => {
328
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
329
- /******/ })();
330
- /******/
331
- /******/ /* webpack/runtime/make namespace object */
332
- /******/ (() => {
333
- /******/ // define __esModule on exports
334
- /******/ __webpack_require__.r = (exports) => {
335
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
336
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
337
- /******/ }
338
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
339
- /******/ };
340
- /******/ })();
341
- /******/
342
- /************************************************************************/
343
- var __webpack_exports__ = {};
344
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
345
- (() => {
346
- "use strict";
347
- // ESM COMPAT FLAG
348
- __webpack_require__.r(__webpack_exports__);
349
-
350
- // EXPORTS
351
- __webpack_require__.d(__webpack_exports__, {
352
- "AlignEnum": () => (/* reexport */ AlignEnum),
353
- "BKLAYERD_INDEX_EFAULT_VALUE": () => (/* reexport */ BKLAYERD_INDEX_EFAULT_VALUE),
354
- "BKLAYERTYPE": () => (/* reexport */ BKLAYERTYPE),
355
- "BKPopIndexManager": () => (/* reexport */ BKPopIndexManager),
356
- "BKPopover": () => (/* reexport */ BKPopover),
357
- "BkMaskManager": () => (/* reexport */ BkMaskManager),
358
- "DialogTypeEnum": () => (/* reexport */ DialogTypeEnum),
359
- "DirectionEnum": () => (/* reexport */ DirectionEnum),
360
- "EMPTY_OBJ": () => (/* binding */ EMPTY_OBJ),
361
- "InputBehaviorEnum": () => (/* reexport */ InputBehaviorEnum),
362
- "InputBehaviorType": () => (/* reexport */ InputBehaviorType),
363
- "LineStyleEnum": () => (/* reexport */ LineStyleEnum),
364
- "PlacementEnum": () => (/* reexport */ PlacementEnum),
365
- "Placements": () => (/* reexport */ Placements),
366
- "PropTypes": () => (/* reexport */ PropTypes),
367
- "RenderDirectiveEnum": () => (/* reexport */ RenderDirectiveEnum),
368
- "RenderType": () => (/* reexport */ RenderType),
369
- "SizeEnum": () => (/* reexport */ SizeEnum),
370
- "TagThemeEnum": () => (/* reexport */ TagThemeEnum),
371
- "TagThemeType": () => (/* reexport */ TagThemeType),
372
- "ThemeEnum": () => (/* reexport */ ThemeEnum),
373
- "TriggerEnum": () => (/* reexport */ TriggerEnum),
374
- "alignType": () => (/* reexport */ alignType),
375
- "arrayEqual": () => (/* binding */ arrayEqual),
376
- "bKMaskManager": () => (/* reexport */ bKMaskManager),
377
- "bkPopIndexManager": () => (/* reexport */ bkPopIndexManager),
378
- "bkZIndexManager": () => (/* reexport */ bkZIndexManager),
379
- "capitalize": () => (/* reexport */ capitalize),
380
- "checkOverflow": () => (/* reexport */ checkOverflow),
381
- "classes": () => (/* binding */ classes),
382
- "clone": () => (/* reexport */ clone),
383
- "debounce": () => (/* binding */ debounce),
384
- "dialogTypeUnion": () => (/* reexport */ dialogTypeUnion),
385
- "directionType": () => (/* reexport */ directionType),
386
- "elementsEqual": () => (/* reexport */ elementsEqual),
387
- "filterProperty": () => (/* binding */ filterProperty),
388
- "finiteOrDefault": () => (/* reexport */ finiteOrDefault),
389
- "formItemKey": () => (/* reexport */ formItemKey),
390
- "formKey": () => (/* reexport */ formKey),
391
- "getPopContainerId": () => (/* reexport */ getPopContainerId),
392
- "hasOverflowEllipsis": () => (/* reexport */ hasOverflowEllipsis),
393
- "isArray": () => (/* reexport */ isArray),
394
- "isElement": () => (/* reexport */ helper_isElement),
395
- "isEmpty": () => (/* reexport */ isEmpty),
396
- "isEmptyObj": () => (/* binding */ isEmptyObj),
397
- "isFinite": () => (/* reexport */ isNumberFinite),
398
- "isNullOrUndef": () => (/* reexport */ isNullOrUndef),
399
- "isObject": () => (/* reexport */ isObject),
400
- "lineStyleType": () => (/* reexport */ lineStyleType),
401
- "maybeShowTooltip": () => (/* reexport */ maybeShowTooltip),
402
- "merge": () => (/* reexport */ merge),
403
- "mergeIf": () => (/* reexport */ mergeIf),
404
- "mergerFn": () => (/* reexport */ mergerFn),
405
- "mergerIfFn": () => (/* reexport */ mergerIfFn),
406
- "noop": () => (/* binding */ noop),
407
- "observerResize": () => (/* reexport */ observerResize),
408
- "off": () => (/* reexport */ off),
409
- "on": () => (/* reexport */ on),
410
- "placementType": () => (/* reexport */ placementType),
411
- "random": () => (/* reexport */ random),
412
- "renderDirectiveType": () => (/* reexport */ renderDirectiveType),
413
- "renderEmptyVNode": () => (/* binding */ renderEmptyVNode),
414
- "renderType": () => (/* reexport */ renderType),
415
- "resolveClassName": () => (/* binding */ resolveClassName),
416
- "scrollTop": () => (/* reexport */ scrollTop),
417
- "scrollbarWidth": () => (/* reexport */ scrollbarWidth),
418
- "stringEnum": () => (/* reexport */ stringEnum),
419
- "triggerType": () => (/* reexport */ triggerType),
420
- "useForm": () => (/* reexport */ useForm),
421
- "useFormItem": () => (/* reexport */ useFormItem),
422
- "valueOrDefault": () => (/* reexport */ valueOrDefault),
423
- "withInstall": () => (/* binding */ withInstall),
424
- "withInstallProps": () => (/* binding */ withInstallProps)
425
- });
426
-
427
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
428
- function _classCallCheck(instance, Constructor) {
429
- if (!(instance instanceof Constructor)) {
430
- throw new TypeError("Cannot call a class as a function");
431
- }
432
- }
433
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
434
- function _defineProperties(target, props) {
435
- for (var i = 0; i < props.length; i++) {
436
- var descriptor = props[i];
437
- descriptor.enumerable = descriptor.enumerable || false;
438
- descriptor.configurable = true;
439
- if ("value" in descriptor) descriptor.writable = true;
440
- Object.defineProperty(target, descriptor.key, descriptor);
441
- }
442
- }
443
-
444
- function _createClass(Constructor, protoProps, staticProps) {
445
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
446
- if (staticProps) _defineProperties(Constructor, staticProps);
447
- Object.defineProperty(Constructor, "prototype", {
448
- writable: false
449
- });
450
- return Constructor;
451
- }
452
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
453
- function _defineProperty(obj, key, value) {
454
- if (key in obj) {
455
- Object.defineProperty(obj, key, {
456
- value: value,
457
- enumerable: true,
458
- configurable: true,
459
- writable: true
460
- });
461
- } else {
462
- obj[key] = value;
463
- }
464
-
465
- return obj;
466
- }
467
- ;// CONCATENATED MODULE: ../../packages/shared/src/z-index-manager.ts
468
-
469
-
470
-
471
-
472
- var _BKLAYERD_INDEX_EFAUL;
473
-
474
- /**
475
- * Tencent is pleased to support the open source community by making
476
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
477
- *
478
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
479
- *
480
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
481
- *
482
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
483
- *
484
- * ---------------------------------------------------
485
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
486
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
487
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
488
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
489
- *
490
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
491
- * the Software.
492
- *
493
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
494
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
495
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
496
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
497
- * IN THE SOFTWARE.
498
- */
499
-
500
- /**
501
- * 页面框架层级
502
- */
503
- var BKLAYERTYPE;
504
-
505
- (function (BKLAYERTYPE) {
506
- /** 网站内容的背景、拓扑的画布等 */
507
- BKLAYERTYPE["BOTTOM"] = "bottom";
508
- /** 页面呈现的各类内容 */
509
-
510
- BKLAYERTYPE["CONTENT"] = "content";
511
- /** 顶部导航、侧边导航以及用户信息等 */
512
-
513
- BKLAYERTYPE["NAVI"] = "navi";
514
- /** 页面需全屏操作的部分功能或编辑器的全屏模式 */
515
-
516
- BKLAYERTYPE["FULLSCREEN"] = "fullScreen";
517
- /** 各类功能插件 */
518
-
519
- BKLAYERTYPE["PLUGINS"] = "plugins";
520
- /** 各类弹窗或抽屉(非模态弹窗不考虑) */
521
-
522
- BKLAYERTYPE["MODAL"] = "modal";
523
- /** 各类消息提示 */
524
-
525
- BKLAYERTYPE["MESSAGE"] = "message";
526
- /** 各类popper提示 */
527
-
528
- BKLAYERTYPE["POPPER"] = "popper";
529
- })(BKLAYERTYPE || (BKLAYERTYPE = {}));
530
- /** 定义不同分层默认值 */
531
-
532
-
533
- var BKLAYERD_INDEX_EFAULT_VALUE = (_BKLAYERD_INDEX_EFAUL = {}, _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.BOTTOM, 0), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.CONTENT, 1), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.NAVI, 100), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.FULLSCREEN, 1000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MODAL, 3000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.PLUGINS, 8000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MESSAGE, 10000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.POPPER, 99999), _BKLAYERD_INDEX_EFAUL);
534
-
535
- var BKZIndexManager = /*#__PURE__*/function () {
536
- function BKZIndexManager() {
537
- _classCallCheck(this, BKZIndexManager);
538
-
539
- this.storageLayerIndexValue = {};
540
- this.copyDefaultValue();
541
- }
542
- /**
543
- *
544
- * @param type
545
- * @returns
546
- */
547
-
548
-
549
- _createClass(BKZIndexManager, [{
550
- key: "getNextIndex",
551
- value: function getNextIndex(type) {
552
- if (Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue, type)) {
553
- this.storageLayerIndexValue[type] = this.storageLayerIndexValue[type] + 1;
554
- return this.storageLayerIndexValue[type];
555
- }
556
-
557
- this.storageLayerIndexValue[BKLAYERTYPE.MODAL] = this.storageLayerIndexValue[BKLAYERTYPE.MODAL] + 1;
558
- return this.storageLayerIndexValue[BKLAYERTYPE.MODAL];
559
- }
560
- /** 获取弹窗类型最新zIndex的值 */
561
-
562
- }, {
563
- key: "getModalNextIndex",
564
- value: function getModalNextIndex() {
565
- return this.getNextIndex(BKLAYERTYPE.MODAL);
566
- }
567
- /** 获取Message类型最新zIndex的值 */
568
-
569
- }, {
570
- key: "getMessageNextIndex",
571
- value: function getMessageNextIndex() {
572
- return this.getNextIndex(BKLAYERTYPE.MESSAGE);
573
- }
574
- /** 获取全屏类型最新zIndex的值 */
575
-
576
- }, {
577
- key: "getFullScreenNextIndex",
578
- value: function getFullScreenNextIndex() {
579
- return this.getNextIndex(BKLAYERTYPE.FULLSCREEN);
580
- }
581
- /** 获取导航类型最新zIndex的值 */
582
-
583
- }, {
584
- key: "getNaviNextIndex",
585
- value: function getNaviNextIndex() {
586
- return this.getNextIndex(BKLAYERTYPE.NAVI);
587
- }
588
- /** 获取导航类型最新zIndex的值 */
589
-
590
- }, {
591
- key: "getPopperIndex",
592
- value: function getPopperIndex() {
593
- return BKLAYERD_INDEX_EFAULT_VALUE.popper;
594
- }
595
- /**
596
- * 更新自定义默认zIndex配置
597
- * @param config 配置项
598
- */
599
-
600
- }, {
601
- key: "setDefaultZIndex",
602
- value: function setDefaultZIndex(config) {
603
- var _this = this;
604
-
605
- Object.keys(config || {}).forEach(function (key) {
606
- if (Object.prototype.hasOwnProperty.call(_this.storageLayerIndexValue.__proto__, key)) {
607
- Object.assign(_this.storageLayerIndexValue.__proto__, _defineProperty({}, key, config[key]));
608
- }
609
- });
610
- this.copyDefaultValue();
611
- }
612
- /**
613
- * 重置zIndex
614
- * @param config 配置项
615
- */
616
-
617
- }, {
618
- key: "resetZIndex",
619
- value: function resetZIndex(config) {
620
- var _this2 = this;
621
-
622
- Object.keys(config || {}).forEach(function (key) {
623
- if (Object.prototype.hasOwnProperty.call(_this2.storageLayerIndexValue, key)) {
624
- Object.assign(_this2.storageLayerIndexValue, _defineProperty({}, key, config[key]));
625
- }
626
- });
627
- }
628
- /**
629
- * 根据默认设置创建副本
630
- */
631
-
632
- }, {
633
- key: "copyDefaultValue",
634
- value: function copyDefaultValue() {
635
- var properties = Object.keys(BKLAYERD_INDEX_EFAULT_VALUE).reduce(function (props, key) {
636
- return Object.assign(props, _defineProperty({}, key, {
637
- value: BKLAYERD_INDEX_EFAULT_VALUE[key],
638
- writable: true,
639
- configurable: true
640
- }));
641
- }, {});
642
- this.storageLayerIndexValue = Object.create(BKLAYERD_INDEX_EFAULT_VALUE, properties);
643
- }
644
- }]);
645
-
646
- return BKZIndexManager;
647
- }();
648
-
649
- var bkZIndexManager = new BKZIndexManager();
650
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
651
- function _typeof(obj) {
652
- "@babel/helpers - typeof";
653
-
654
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
655
- return typeof obj;
656
- } : function (obj) {
657
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
658
- }, _typeof(obj);
659
- }
660
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
661
- function _arrayLikeToArray(arr, len) {
662
- if (len == null || len > arr.length) len = arr.length;
663
-
664
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
665
- arr2[i] = arr[i];
666
- }
667
-
668
- return arr2;
669
- }
670
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
671
-
672
- function _arrayWithoutHoles(arr) {
673
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
674
- }
675
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
676
- function _iterableToArray(iter) {
677
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
678
- }
679
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
680
-
681
- function _unsupportedIterableToArray(o, minLen) {
682
- if (!o) return;
683
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
684
- var n = Object.prototype.toString.call(o).slice(8, -1);
685
- if (n === "Object" && o.constructor) n = o.constructor.name;
686
- if (n === "Map" || n === "Set") return Array.from(o);
687
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
688
- }
689
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
690
- function _nonIterableSpread() {
691
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
692
- }
693
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
694
-
695
-
696
-
697
-
698
- function _toConsumableArray(arr) {
699
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
700
- }
701
- // EXTERNAL MODULE: ../../node_modules/uuid/index.js
702
- var uuid = __webpack_require__(8022);
703
- // EXTERNAL MODULE: external "@popperjs/core"
704
- var core_ = __webpack_require__(5798);
705
- ;// CONCATENATED MODULE: ../../packages/shared/src/helper.ts
706
-
707
-
708
- /*
709
- * Tencent is pleased to support the open source community by making
710
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
711
- *
712
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
713
- *
714
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
715
- *
716
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
717
- *
718
- * ---------------------------------------------------
719
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
720
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
721
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
722
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
723
- *
724
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
725
- * the Software.
726
- *
727
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
728
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
729
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
730
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
731
- * IN THE SOFTWARE.
732
- */
733
-
734
- /* eslint-disable no-underscore-dangle */
735
-
736
- /**
737
- * Returns true if `value` is neither null nor undefined, else returns false.
738
- * @param {*} value - The value to test.
739
- * @returns {boolean}
740
- * @since 2.7.0
741
- */
742
- function isNullOrUndef(value) {
743
- return value === null || typeof value === 'undefined';
744
- }
745
- function isEmpty(value) {
746
- var IncludeNullUndefined = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
747
- return value === '' || (IncludeNullUndefined ? isNullOrUndef(value) : false);
748
- }
749
- /**
750
- * Returns true if `value` is an array (including typed arrays), else returns false.
751
- * @param {*} value - The value to test.
752
- * @returns {boolean}
753
- * @function
754
- */
755
-
756
- function isArray(value) {
757
- if (Array.isArray(value)) {
758
- return true;
759
- }
760
-
761
- var type = Object.prototype.toString.call(value);
762
-
763
- if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
764
- return true;
765
- }
766
-
767
- return false;
768
- }
769
- /**
770
- * Returns true if `value` is an object (excluding null), else returns false.
771
- * @param {*} value - The value to test.
772
- * @returns {boolean}
773
- * @since 2.7.0
774
- */
775
-
776
- function isObject(value) {
777
- return value !== null && /^\[object (Object|Module)\]/.test(Object.prototype.toString.call(value));
778
- }
779
- /**
780
- * Returns true if `value` is a finite number, else returns false
781
- * @param {*} value - The value to test.
782
- * @returns {boolean}
783
- */
784
-
785
- var isNumberFinite = function isNumberFinite(value) {
786
- return (typeof value === 'number' || value instanceof Number) && isFinite(+value);
787
- };
788
-
789
-
790
- /**
791
- * Returns `value` if finite, else returns `defaultValue`.
792
- * @param {*} value - The value to return if defined.
793
- * @param {*} defaultValue - The value to return if `value` is not finite.
794
- * @returns {*}
795
- */
796
-
797
- function finiteOrDefault(value, defaultValue) {
798
- return isNumberFinite(value) ? value : defaultValue;
799
- }
800
- /**
801
- * Returns `value` if defined, else returns `defaultValue`.
802
- * @param {*} value - The value to return if defined.
803
- * @param {*} defaultValue - The value to return if `value` is undefined.
804
- * @returns {*}
805
- */
806
-
807
- function valueOrDefault(value, defaultValue) {
808
- return typeof value === 'undefined' ? defaultValue : value;
809
- }
810
- /**
811
- * Returns true if the `a0` and `a1` arrays have the same content, else returns false.
812
- * @param {Array} a0 - The array to compare
813
- * @param {Array} a1 - The array to compare
814
- * @returns {boolean}
815
- * @private
816
- */
817
-
818
- function elementsEqual(a0, a1) {
819
- var i;
820
- var ilen;
821
- var v0;
822
- var v1;
823
-
824
- if (!a0 || !a1 || a0.length !== a1.length) {
825
- return false;
826
- }
827
-
828
- for (i = 0, ilen = a0.length; i < ilen; ++i) {
829
- v0 = a0[i];
830
- v1 = a1[i];
831
-
832
- if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {
833
- return false;
834
- }
835
- }
836
-
837
- return true;
838
- }
839
- /**
840
- * Returns a deep copy of `source` without keeping references on objects and arrays.
841
- * @param {*} source - The value to clone.
842
- * @returns {*}
843
- */
844
-
845
- function clone(source) {
846
- if (isArray(source)) {
847
- return source.map(clone);
848
- }
849
-
850
- if (isObject(source)) {
851
- var target = Object.create(null);
852
- var keys = Object.keys(source);
853
- var klen = keys.length;
854
- var k = 0;
855
-
856
- for (; k < klen; ++k) {
857
- target[keys[k]] = clone(source[keys[k]]);
858
- }
859
-
860
- return target;
861
- }
862
-
863
- return source;
864
- }
865
-
866
- function isValidKey(key) {
867
- return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
868
- }
869
- /**
870
- * The default merger when Chart.helpers.merge is called without merger option.
871
- * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.
872
- * @private
873
- */
874
-
875
-
876
- function mergerFn(key, target, source, options) {
877
- if (!isValidKey(key)) {
878
- return;
879
- }
880
-
881
- var tval = target[key];
882
- var sval = source[key];
883
-
884
- if (isObject(tval) && isObject(sval)) {
885
- // eslint-disable-next-line no-use-before-define
886
- merge(tval, sval, options);
887
- } else {
888
- // eslint-disable-next-line no-param-reassign
889
- target[key] = clone(sval);
890
- }
891
- }
892
- /**
893
- * Recursively deep copies `source` properties into `target` with the given `options`.
894
- * IMPORTANT: `target` is not cloned and will be updated with `source` properties.
895
- * @param {object} target - The target object in which all sources are merged into.
896
- * @param {object|object[]} source - Object(s) to merge into `target`.
897
- * @param {object} [options] - Merging options:
898
- * @param {function} [options.merger] - The merge method (key, target, source, options)
899
- * @returns {object} The `target` object.
900
- */
901
-
902
- function merge(target, source, options) {
903
- var sources = isArray(source) ? source : [source];
904
- var ilen = sources.length;
905
-
906
- if (!isObject(target)) {
907
- return target;
908
- } // eslint-disable-next-line no-param-reassign
909
-
910
-
911
- options = options || {};
912
- var merger = options.merger || mergerFn;
913
-
914
- for (var i = 0; i < ilen; ++i) {
915
- // eslint-disable-next-line no-param-reassign
916
- source = sources[i];
917
-
918
- if (!isObject(source)) {
919
- continue;
920
- }
921
-
922
- var keys = Object.keys(source);
923
-
924
- for (var k = 0, klen = keys.length; k < klen; ++k) {
925
- merger(keys[k], target, source, options);
926
- }
927
- }
928
-
929
- return target;
930
- }
931
- /**
932
- * Recursively deep copies `source` properties into `target` *only* if not defined in target.
933
- * IMPORTANT: `target` is not cloned and will be updated with `source` properties.
934
- * @param {object} target - The target object in which all sources are merged into.
935
- * @param {object|object[]} source - Object(s) to merge into `target`.
936
- * @returns {object} The `target` object.
937
- */
938
-
939
- function mergeIf(target, source) {
940
- // eslint-disable-next-line no-use-before-define
941
- return merge(target, source, {
942
- merger: mergerIfFn
943
- });
944
- }
945
- /**
946
- * Merges source[key] in target[key] only if target[key] is undefined.
947
- * @private
948
- */
949
-
950
- function mergerIfFn(key, target, source) {
951
- if (!isValidKey(key)) {
952
- return;
953
- }
954
-
955
- var tval = target[key];
956
- var sval = source[key];
957
-
958
- if (isObject(tval) && isObject(sval)) {
959
- mergeIf(tval, sval);
960
- } else if (!Object.prototype.hasOwnProperty.call(target, key)) {
961
- // eslint-disable-next-line no-param-reassign
962
- target[key] = clone(sval);
963
- }
964
- }
965
- /**
966
- * 检查当前元素是否为Html元素
967
- * @param obj
968
- * @returns
969
- */
970
-
971
- function helper_isElement(obj) {
972
- try {
973
- return obj instanceof HTMLElement;
974
- } catch (e) {
975
- return _typeof(obj) === 'object' && obj.nodeType === 1 && _typeof(obj.style) === 'object' && _typeof(obj.ownerDocument) === 'object';
976
- }
977
- }
978
- /**
979
- * Whether the text content is clipped due to CSS overflow, as in showing `...`.
980
- */
981
-
982
- function hasOverflowEllipsis(element) {
983
- return element.offsetWidth < element.scrollWidth || element.offsetHeight < element.scrollHeight;
984
- }
985
- /**
986
- * Sets the `title` attribute in the event's element target, when the text
987
- * content is clipped due to CSS overflow, as in showing `...`.
988
- */
989
-
990
- function maybeShowTooltip(target, title) {
991
- if (hasOverflowEllipsis(target)) {
992
- target.setAttribute('title', title);
993
- } else {
994
- target.removeAttribute('title');
995
- }
996
- }
997
- ;// CONCATENATED MODULE: ../../packages/shared/src/popover.ts
998
-
999
-
1000
-
1001
-
1002
-
1003
- /*
1004
- * Tencent is pleased to support the open source community by making
1005
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1006
- *
1007
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1008
- *
1009
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1010
- *
1011
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1012
- *
1013
- * ---------------------------------------------------
1014
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1015
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1016
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1017
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1018
- *
1019
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1020
- * the Software.
1021
- *
1022
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1023
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1024
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1025
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1026
- * IN THE SOFTWARE.
1027
- */
1028
-
1029
-
1030
-
1031
- var BKPopover = /*#__PURE__*/function () {
1032
- function BKPopover(reference, popperRefer, options) {
1033
- _classCallCheck(this, BKPopover);
1034
-
1035
- var _a, _b;
1036
- /** 当前提内容是否弹出 */
1037
-
1038
-
1039
- this.isShow = false;
1040
- /** 触发条件 */
1041
-
1042
- this.trigger = undefined;
1043
- /** 当前popperjs实例 */
1044
-
1045
- this.instance = undefined;
1046
- /** 是否总是可见 */
1047
-
1048
- this.always = false;
1049
- /** Popover 外层容器,触发Pop的元素 */
1050
-
1051
- this.reference = undefined;
1052
- /** Popover 弹出内容外层占位容器 */
1053
-
1054
- this.referenceTarget = undefined;
1055
- /** Popover Content 外层容器,目标元素:实际弹出内容 */
1056
-
1057
- this.popperRefer = undefined;
1058
- /** hide延时 */
1059
-
1060
- this.delay = 50;
1061
- /** 是否进入popperRefer */
1062
-
1063
- this.isInnerPopper = false;
1064
- /** 是否为禁用状态 */
1065
-
1066
- this.disabled = false;
1067
- /** 执行显示函数 */
1068
-
1069
- this.afterShow = null;
1070
- /** 执行隐藏函数 */
1071
-
1072
- this.afterHidden = null;
1073
- /** 弹出内容AppendTo */
1074
-
1075
- this.appendTo = 'parent';
1076
- /** 父级容器 */
1077
-
1078
- this.container = null;
1079
- /**
1080
- * 如果设置了appendTo为指定DOM,此配置项生效
1081
- * 是否将弹出内容固定到目标元素位置
1082
- * 例如:appendTo = document.body, fixOnBoundary = true,则弹出内容会一直固定到body
1083
- */
1084
-
1085
- this.fixOnBoundary = false;
1086
- this.instanceOptions = this.initDefaultOptions(options);
1087
- this.reference = this.resolveInputSelectorToHtmlElement(reference);
1088
- this.popperRefer = this.resolveInputSelectorToHtmlElement(popperRefer);
1089
- this.referenceTarget = this.getTargetReferenceElement();
1090
- this.container = (_a = this.popperRefer) === null || _a === void 0 ? void 0 : _a.parentElement;
1091
- this.isShow = !!((_b = this.instanceOptions) === null || _b === void 0 ? void 0 : _b.isShow);
1092
- this.always = this.instanceOptions.always;
1093
- this.trigger = this.instanceOptions.trigger;
1094
- this.disabled = this.instanceOptions.disabled;
1095
- this.appendTo = this.instanceOptions.appendTo;
1096
- this.afterHidden = typeof options.afterHidden === 'function' ? options.afterHidden : function () {};
1097
- this.afterShow = typeof options.afterShow === 'function' ? options.afterShow : function () {};
1098
- this.fixOnBoundary = this.instanceOptions.fixOnBoundary;
1099
- this.initInstance();
1100
- this.registerEvents();
1101
- /** 默认弹出 */
1102
-
1103
- if (this.isShow || this.always) {
1104
- this.show(null);
1105
- }
1106
- } // Synchronously updates the popper instance. Use this for low-frequency
1107
- // updates.
1108
-
1109
-
1110
- _createClass(BKPopover, [{
1111
- key: "forceUpdate",
1112
- value: function forceUpdate() {
1113
- var _a;
1114
-
1115
- (_a = this.instance) === null || _a === void 0 ? void 0 : _a.forceUpdate();
1116
- } // Asynchronously updates the popper instance, and returns a promise. Use this
1117
- // for high-frequency updates.
1118
-
1119
- }, {
1120
- key: "update",
1121
- value: function update() {
1122
- var _a;
1123
-
1124
- (_a = this.instance) === null || _a === void 0 ? void 0 : _a.update();
1125
- }
1126
- }, {
1127
- key: "updateOptions",
1128
- value: function updateOptions(options) {
1129
- var _a;
1130
-
1131
- this.instanceOptions = this.initDefaultOptions(options);
1132
- this.isShow = !!((_a = this.instanceOptions) === null || _a === void 0 ? void 0 : _a.isShow);
1133
- this.trigger = this.instanceOptions.trigger;
1134
- this.disabled = this.instanceOptions.disabled;
1135
- this.setOptions(this.instanceOptions);
1136
- } // Updates the options of the instance.
1137
-
1138
- }, {
1139
- key: "setOptions",
1140
- value: function setOptions(options) {
1141
- var _a;
1142
-
1143
- (_a = this.instance) === null || _a === void 0 ? void 0 : _a.setOptions(options);
1144
- } // Cleans up the instance.
1145
-
1146
- }, {
1147
- key: "destroy",
1148
- value: function destroy() {
1149
- var _a;
1150
-
1151
- (_a = this.instance) === null || _a === void 0 ? void 0 : _a.destroy();
1152
- } // 更新禁用状态
1153
-
1154
- }, {
1155
- key: "updateDisabled",
1156
- value: function updateDisabled(disabled) {
1157
- this.disabled = disabled !== null && disabled !== void 0 ? disabled : !this.disabled;
1158
- this.disabled && this.hide();
1159
- }
1160
- /**
1161
- * 展示Pop
1162
- * @param _event 触发事件
1163
- */
1164
-
1165
- }, {
1166
- key: "show",
1167
- value: function show(_event) {
1168
- var _a;
1169
-
1170
- if (!this.disabled) {
1171
- // Make the tooltip visible
1172
- (_a = this.popperRefer) === null || _a === void 0 ? void 0 : _a.setAttribute('data-show', ''); // Enable the event listeners
1173
-
1174
- this.setOptions({
1175
- modifiers: [].concat(_toConsumableArray(this.instanceOptions.modifiers || []), [{
1176
- name: 'eventListeners',
1177
- enabled: true
1178
- }])
1179
- }); // Update its position
1180
-
1181
- this.update();
1182
- this.isShow = true;
1183
- this.afterShow();
1184
-
1185
- if (!this.fixOnBoundary) {
1186
- this.appendToTarget();
1187
- }
1188
- }
1189
- }
1190
- /**
1191
- * 隐藏
1192
- * @param event 触发事件
1193
- */
1194
-
1195
- }, {
1196
- key: "hide",
1197
- value: function hide() {
1198
- var _a;
1199
-
1200
- if (this.always) return; // Hide the tooltip
1201
-
1202
- (_a = this.popperRefer) === null || _a === void 0 ? void 0 : _a.removeAttribute('data-show'); // Disable the event listeners
1203
-
1204
- this.setOptions({
1205
- modifiers: [].concat(_toConsumableArray(this.instanceOptions.modifiers || []), [{
1206
- name: 'eventListeners',
1207
- enabled: false
1208
- }])
1209
- });
1210
- this.isShow = false;
1211
- this.isInnerPopper = false;
1212
- this.afterHidden();
1213
-
1214
- if (!this.fixOnBoundary) {
1215
- this.restorePopContent();
1216
- }
1217
- }
1218
- /**
1219
- * 还原PopContent到初试位置
1220
- */
1221
-
1222
- }, {
1223
- key: "restorePopContent",
1224
- value: function restorePopContent() {
1225
- var target = this.getAppendToTarget();
1226
-
1227
- if (helper_isElement(target) && target.contains(this.popperRefer) && this.container && !this.container.contains(this.popperRefer)) {
1228
- this.container.append(this.popperRefer);
1229
- }
1230
- }
1231
- /**
1232
- * 挂载PopContent到目标位置
1233
- */
1234
-
1235
- }, {
1236
- key: "appendToTarget",
1237
- value: function appendToTarget() {
1238
- var target = this.getAppendToTarget();
1239
-
1240
- if (helper_isElement(target) && target.contains(this.popperRefer)) {
1241
- target.append(this.popperRefer);
1242
- }
1243
- }
1244
- /**
1245
- * 获取目标位置元素
1246
- * @returns
1247
- */
1248
-
1249
- }, {
1250
- key: "getAppendToTarget",
1251
- value: function getAppendToTarget() {
1252
- var appendTo = this.appendTo;
1253
- var target = appendTo;
1254
-
1255
- if (appendTo !== 'parent') {
1256
- if (typeof appendTo === 'string') {
1257
- target = document.querySelector(appendTo);
1258
- }
1259
- }
1260
-
1261
- return target;
1262
- }
1263
- /**
1264
- * 初始化默认配置
1265
- * @param opts
1266
- * @returns
1267
- */
1268
-
1269
- }, {
1270
- key: "initDefaultOptions",
1271
- value: function initDefaultOptions(opts) {
1272
- var _this = this;
1273
-
1274
- var defaultCfg = {
1275
- placement: 'top',
1276
- modifiers: [{
1277
- name: 'offset',
1278
- options: {
1279
- offset: [0, 8]
1280
- }
1281
- }],
1282
- strategy: 'absolute',
1283
- onFirstUpdate: undefined,
1284
- isShow: false,
1285
- theme: 'dark',
1286
- trigger: 'hover',
1287
- disabled: false
1288
- };
1289
- var targetOptions = merge(defaultCfg, opts || {});
1290
- var sourceOnFirstUpdate = targetOptions.onFirstUpdate;
1291
-
1292
- targetOptions.onFirstUpdate = function (state) {
1293
- if (typeof sourceOnFirstUpdate === 'function') {
1294
- sourceOnFirstUpdate.call(_this, state);
1295
-
1296
- _this.handleFirstUpdate();
1297
- }
1298
- };
1299
-
1300
- return targetOptions;
1301
- }
1302
- /**
1303
- * 判定是否需要将PopContent挂载到目标元素
1304
- */
1305
-
1306
- }, {
1307
- key: "handleFirstUpdate",
1308
- value: function handleFirstUpdate() {
1309
- if (this.fixOnBoundary) {
1310
- this.appendToTarget();
1311
- }
1312
- }
1313
- /**
1314
- * 剔除 Pop 外层容器,获取目标元素
1315
- * @returns
1316
- */
1317
-
1318
- }, {
1319
- key: "getTargetReferenceElement",
1320
- value: function getTargetReferenceElement() {
1321
- if (this.isElement(this.reference)) {
1322
- return this.reference.childElementCount === 1 ? this.reference.firstElementChild : this.reference;
1323
- }
1324
-
1325
- return this.reference;
1326
- }
1327
- /**
1328
- * 初始化Pop Instance
1329
- */
1330
-
1331
- }, {
1332
- key: "initInstance",
1333
- value: function initInstance() {
1334
- var _a, _b;
1335
-
1336
- if (this.referenceTarget) {
1337
- if (this.referenceTarget && this.popperRefer) {
1338
- this.instance = (0,core_.createPopper)(this.referenceTarget, this.popperRefer, this.instanceOptions);
1339
- (_a = this.popperRefer) === null || _a === void 0 ? void 0 : _a.setAttribute('data-theme', (_b = this.instanceOptions.theme) !== null && _b !== void 0 ? _b : 'dark');
1340
- } else {
1341
- console.error('reference or popperRefer is null, please check html element.');
1342
- }
1343
- }
1344
- }
1345
- /**
1346
- * 解析当前参数为对应的Html Element
1347
- * @param refer Html Element Selector Or Html Element
1348
- * @param checkVirtualDom 是否检查虚拟DOM
1349
- * @returns Html Element Or Null
1350
- */
1351
-
1352
- }, {
1353
- key: "resolveInputSelectorToHtmlElement",
1354
- value: function resolveInputSelectorToHtmlElement(refer) {
1355
- if (this.isElement(refer)) {
1356
- return refer;
1357
- }
1358
-
1359
- if (typeof refer === 'string') {
1360
- return document.querySelector(refer);
1361
- }
1362
-
1363
- if (_typeof(refer) === 'object') {
1364
- if (Object.prototype.hasOwnProperty.call(refer, 'getBoundingClientRect')) {
1365
- return refer;
1366
- }
1367
- } else {
1368
- console.error('\'getBoundingClientRect\' is needed when use virtual elements');
1369
- }
1370
-
1371
- return null;
1372
- }
1373
- /**
1374
- * 检查当前元素是否为Html元素
1375
- * @param obj
1376
- * @returns
1377
- */
1378
-
1379
- }, {
1380
- key: "isElement",
1381
- value: function isElement(obj) {
1382
- return helper_isElement(obj);
1383
- }
1384
- }, {
1385
- key: "registerEvents",
1386
- value: function registerEvents() {
1387
- var _this2 = this;
1388
-
1389
- if (this.isElement(this.referenceTarget)) {
1390
- if (this.trigger === 'hover') {
1391
- var showEvents = ['mouseenter', 'focus'];
1392
- var hideEvents = ['mouseleave', 'blur'];
1393
- var contentEvents = ['mouseenter', 'mouseleave'];
1394
- showEvents.forEach(function (event) {
1395
- _this2.referenceTarget.addEventListener(event, function (evt) {
1396
- if (event === 'mouseenter') _this2.isInnerPopper = true;
1397
-
1398
- _this2.show(evt);
1399
- });
1400
- });
1401
- hideEvents.forEach(function (event) {
1402
- _this2.referenceTarget.addEventListener(event, function () {
1403
- _this2.isInnerPopper = false;
1404
- setTimeout(function () {
1405
- !_this2.isInnerPopper && _this2.hide();
1406
- }, _this2.delay);
1407
- });
1408
- });
1409
-
1410
- if (this.isElement(this.popperRefer)) {
1411
- contentEvents.forEach(function (event) {
1412
- _this2.popperRefer.addEventListener(event, function () {
1413
- if (event === 'mouseenter') _this2.isInnerPopper = true;
1414
- if (event === 'mouseleave') _this2.hide();
1415
- });
1416
- });
1417
- }
1418
- }
1419
- }
1420
-
1421
- if (this.trigger === 'click') {
1422
- var _showEvents = ['click'];
1423
-
1424
- _showEvents.forEach(function (event) {
1425
- document.body.addEventListener(event, function (event) {
1426
- if (_this2.isSameElement(event.target, _this2.reference) || _this2.reference.contains(event.target)) {
1427
- _this2.show(event);
1428
- } else {
1429
- if (_this2.isShow && !_this2.isSameElement(event.target, _this2.popperRefer) && !_this2.popperRefer.contains(event.target)) {
1430
- _this2.hide();
1431
- }
1432
- }
1433
- });
1434
- });
1435
- }
1436
- }
1437
- }, {
1438
- key: "isSameElement",
1439
- value: function isSameElement(source, target) {
1440
- return source && (source === target || source === target.firstElementChild);
1441
- }
1442
- }]);
1443
-
1444
- return BKPopover;
1445
- }();
1446
- var popContainerId = null;
1447
- var getPopContainerId = function getPopContainerId() {
1448
- var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#';
1449
-
1450
- if (popContainerId === null) {
1451
- popContainerId = "id_".concat((0,uuid.v4)());
1452
- var popContainer = document.createElement('div');
1453
- popContainer.setAttribute('id', popContainerId);
1454
- popContainer.setAttribute('data-popper-id', popContainerId);
1455
- document.body.append(popContainer);
1456
- }
1457
-
1458
- return "".concat(prefix).concat(popContainerId);
1459
- };
1460
- // EXTERNAL MODULE: external "lodash"
1461
- var external_lodash_ = __webpack_require__(467);
1462
- ;// CONCATENATED MODULE: ../../packages/shared/src/utils.ts
1463
- /*
1464
- * Tencent is pleased to support the open source community by making
1465
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1466
- *
1467
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1468
- *
1469
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1470
- *
1471
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1472
- *
1473
- * ---------------------------------------------------
1474
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1475
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1476
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1477
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1478
- *
1479
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1480
- * the Software.
1481
- *
1482
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1483
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1484
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1485
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1486
- * IN THE SOFTWARE.
1487
- */
1488
-
1489
- var lowerStr = 'abcdefghijklmnopqrstuvwxyz0123456789';
1490
- /**
1491
- * 生成n位长度的字符串
1492
- * @param {Number} n
1493
- * @param str,默认26位字母及数字
1494
- */
1495
-
1496
- var random = function random(n) {
1497
- var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : lowerStr;
1498
- var result = '';
1499
-
1500
- for (var i = 0; i < n; i++) {
1501
- result += str[parseInt((Math.random() * str.length).toString(), 10)];
1502
- }
1503
-
1504
- return result;
1505
- };
1506
- /**
1507
- * 监听目标元素的Resize事件
1508
- * @param root 目标元素
1509
- * @param callbackFn 执行函数
1510
- * @param delay 延迟执行时间,默认 60
1511
- * @param immediate 是否立即执行回调函数
1512
- * @returns "{ start: () => void, stop: () => void }"
1513
- */
1514
-
1515
- var observerResize = function observerResize(root, callbackFn) {
1516
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
1517
- var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1518
- var callFn = (0,external_lodash_.throttle)(function () {
1519
- if (typeof callbackFn === 'function') {
1520
- callbackFn();
1521
- }
1522
- }, delay);
1523
- var resizeObserver = new ResizeObserver(function () {
1524
- callFn();
1525
- });
1526
-
1527
- if (immediate) {
1528
- if (typeof callbackFn === 'function') {
1529
- callbackFn();
1530
- }
1531
- }
1532
-
1533
- return {
1534
- start: function start() {
1535
- resizeObserver.observe(root);
1536
- },
1537
- stop: function stop() {
1538
- resizeObserver.disconnect();
1539
- resizeObserver.unobserve(root);
1540
- }
1541
- };
1542
- };
1543
- var capitalize = function capitalize(str) {
1544
- return str[0].toUpperCase() + str.slice(1);
1545
- };
1546
- /**
1547
- * 判断元素是否溢出容器
1548
- * @param {*} el
1549
- * @returns
1550
- */
1551
-
1552
- function checkOverflow(el) {
1553
- if (!el) return false;
1554
-
1555
- var createDom = function createDom(el, css) {
1556
- var dom = document.createElement('div');
1557
- var width = parseFloat(css.width) ? "".concat(Math.ceil(parseFloat(css.width)), "px") : css.width;
1558
- dom.style.cssText = "\n width: ".concat(width, ";\n line-height: ").concat(css['line-height'], ";\n font-size: ").concat(css['font-size'], ";\n word-break: ").concat(css['word-break'], ";\n padding: ").concat(css.padding, ";\n ");
1559
- dom.textContent = el.textContent;
1560
- return dom;
1561
- };
1562
-
1563
- var isOverflow = false;
1564
-
1565
- try {
1566
- var css = window.getComputedStyle(el, null);
1567
- var lineClamp = css.webkitLineClamp;
1568
-
1569
- if (lineClamp !== 'none') {
1570
- var targetHeight = parseFloat(css.height);
1571
- var dom = createDom(el, css);
1572
- document.body.appendChild(dom);
1573
- var domHeight = window.getComputedStyle(dom, null).height;
1574
- document.body.removeChild(dom);
1575
- isOverflow = targetHeight < parseFloat(domHeight);
1576
- } else {
1577
- isOverflow = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
1578
- }
1579
- } catch (e) {
1580
- console.warn('There is an error when check element overflow state: ', e);
1581
- }
1582
-
1583
- return isOverflow;
1584
- }
1585
- ;// CONCATENATED MODULE: ../../packages/shared/src/mask-manager.ts
1586
-
1587
-
1588
-
1589
- /*
1590
- * Tencent is pleased to support the open source community by making
1591
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1592
- *
1593
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1594
- *
1595
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1596
- *
1597
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1598
- *
1599
- * ---------------------------------------------------
1600
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1601
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1602
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1603
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1604
- *
1605
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1606
- * the Software.
1607
- *
1608
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1609
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1610
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1611
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1612
- * IN THE SOFTWARE.
1613
- */
1614
-
1615
-
1616
- var BkMaskManager = /*#__PURE__*/function () {
1617
- /**
1618
- * 遮罩管理器
1619
- *
1620
- * @param multiInstance 是否允许多实例
1621
- * @param maskAttrTag 遮罩DOM唯一标志,支持自定义和 auto
1622
- */
1623
- function BkMaskManager(config) {
1624
- _classCallCheck(this, BkMaskManager);
1625
-
1626
- /** 是否允许多个遮罩实例 */
1627
- this.multiInstance = false;
1628
- /** 遮罩控制器唯一标识 */
1629
-
1630
- this.uniqueMaskAttrTag = '';
1631
- /** 设置弹出层父级组件,默认是body */
1632
-
1633
- this.parentNode = document.body;
1634
- /** 遮罩当前显示组件实例 **/
1635
-
1636
- this.activeInstance = undefined;
1637
- /** 记录已在使用的z-index */
1638
-
1639
- this.zIndexStore = new Map();
1640
- /** 记录最后一个UUID */
1641
-
1642
- this.lastUUID = null;
1643
- /** 遮罩样式 **/
1644
-
1645
- this.maskStyle = {
1646
- position: 'absolute',
1647
- left: 0,
1648
- top: 0,
1649
- bottom: 0,
1650
- right: 0,
1651
- display: 'none',
1652
- 'background-color': 'rgba(0,0,0,.6)'
1653
- };
1654
-
1655
- var _ref = config || {},
1656
- _ref$multiInstance = _ref.multiInstance,
1657
- multiInstance = _ref$multiInstance === void 0 ? false : _ref$multiInstance,
1658
- _ref$maskAttrTag = _ref.maskAttrTag,
1659
- maskAttrTag = _ref$maskAttrTag === void 0 ? 'auto' : _ref$maskAttrTag,
1660
- _ref$parentNode = _ref.parentNode,
1661
- parentNode = _ref$parentNode === void 0 ? document.body : _ref$parentNode,
1662
- _ref$maskStyle = _ref.maskStyle,
1663
- maskStyle = _ref$maskStyle === void 0 ? {} : _ref$maskStyle,
1664
- _ref$onClick = _ref.onClick,
1665
- onClick = _ref$onClick === void 0 ? null : _ref$onClick;
1666
-
1667
- this.onClick = onClick;
1668
- this.activeInstance = undefined;
1669
- this.multiInstance = multiInstance;
1670
- this.uniqueMaskAttrTag = this.getMaskAttrTag(maskAttrTag);
1671
- this.parentNode = parentNode || document;
1672
- this.mask = this.getMask();
1673
- this.backupMask = this.createMask('data-bk-backup-uid');
1674
- this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
1675
- }
1676
-
1677
- _createClass(BkMaskManager, [{
1678
- key: "setOption",
1679
- value: function setOption(option) {
1680
- var _ref2 = option || {},
1681
- _ref2$parentNode = _ref2.parentNode,
1682
- parentNode = _ref2$parentNode === void 0 ? document.body : _ref2$parentNode,
1683
- _ref2$maskStyle = _ref2.maskStyle,
1684
- maskStyle = _ref2$maskStyle === void 0 ? {} : _ref2$maskStyle,
1685
- _ref2$onClick = _ref2.onClick,
1686
- onClick = _ref2$onClick === void 0 ? null : _ref2$onClick;
1687
-
1688
- this.onClick = onClick;
1689
- this.parentNode = parentNode || document;
1690
- this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
1691
- }
1692
- /**
1693
- * 显示遮罩
1694
- * @param content 遮罩内容
1695
- * @param zIndex z-index
1696
- * @param showMask 是否显示遮罩
1697
- * @param appendStyle 追加样式
1698
- * @param transfer 是否显示将内容加入遮罩下
1699
- */
1700
-
1701
- }, {
1702
- key: "show",
1703
- value: function show(content, zIndex) {
1704
- var showMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1705
- var appendStyle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1706
- var uuid = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
1707
- var transfer = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1708
- var uid = uuid !== null && uuid !== void 0 ? uuid : random(16); // @ts-ignore
1709
-
1710
- var localZIndex = /-?\d+/.test("".concat(zIndex)) ? zIndex : bkZIndexManager.getModalNextIndex();
1711
- var style = Object.assign({}, this.maskStyle, appendStyle || {});
1712
- /**
1713
- * 如果不显示遮罩,此处遮罩继承父级
1714
- * 同时,如果父级弹出层有遮罩,此处不能覆盖
1715
- */
1716
-
1717
- if (!showMask) {
1718
- if (this.lastUUID) {
1719
- var preStore = this.zIndexStore.get(this.lastUUID);
1720
- style = preStore.style;
1721
- }
1722
- }
1723
- /** 缓存当前z-index */
1724
-
1725
-
1726
- this.storeMaskInsCfg({
1727
- zIndex: localZIndex,
1728
- style: Object.assign({}, style),
1729
- uuid: uid,
1730
- preUID: this.lastUUID
1731
- });
1732
- this.setMaskStyle(style);
1733
- this.mask.style.setProperty('display', 'block');
1734
- this.mask.style.setProperty('z-index', "".concat(localZIndex));
1735
- this.backupMask.style.setProperty('z-index', "".concat(localZIndex - 1));
1736
-
1737
- if (content) {
1738
- if (transfer) content.style.setProperty('z-index', "".concat(localZIndex + 1)); // 表明内容不在遮罩下,内容区z-index + 1
1739
-
1740
- this.activeInstance = content;
1741
- if (!transfer) this.appendContentToMask(content); // 表明内容在body下,即在遮罩下
1742
- }
1743
- }
1744
- }, {
1745
- key: "hide",
1746
- value: function hide() {
1747
- var transfer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1748
- var content = arguments.length > 1 ? arguments[1] : undefined;
1749
- var uuid = arguments.length > 2 ? arguments[2] : undefined;
1750
-
1751
- var _a;
1752
-
1753
- var uid = uuid !== null && uuid !== void 0 ? uuid : this.lastUUID;
1754
- this.mask.style.setProperty('display', 'none');
1755
-
1756
- if (!transfer) {
1757
- content === null || content === void 0 ? void 0 : content.remove();
1758
- (_a = this.activeInstance) === null || _a === void 0 ? void 0 : _a.remove();
1759
- }
1760
-
1761
- this.activeInstance = undefined;
1762
- this.popIndexStore(uid);
1763
- }
1764
- }, {
1765
- key: "storeMaskInsCfg",
1766
- value: function storeMaskInsCfg(config) {
1767
- this.zIndexStore.set(config.uuid, config);
1768
- this.lastUUID = config.uuid;
1769
- return this.zIndexStore.get(config.uuid);
1770
- }
1771
- /**
1772
- * 移除最后一次缓存数据
1773
- */
1774
-
1775
- }, {
1776
- key: "popIndexStore",
1777
- value: function popIndexStore(uuid) {
1778
- if (this.zIndexStore.has(uuid)) {
1779
- var rmIns = this.zIndexStore.get(uuid);
1780
- this.lastUUID = rmIns.preUID;
1781
- return this.zIndexStore["delete"](uuid);
1782
- ;
1783
- }
1784
-
1785
- this.lastUUID = null;
1786
- return false;
1787
- }
1788
- }, {
1789
- key: "backupActiveInstance",
1790
- value: function backupActiveInstance() {
1791
- if (this.activeInstance) {
1792
- this.backupMask.append(this.activeInstance);
1793
- }
1794
- }
1795
- }, {
1796
- key: "backupContentElement",
1797
- value: function backupContentElement(content) {
1798
- content && this.backupMask.append(content);
1799
- }
1800
- }, {
1801
- key: "getActiveContentInstance",
1802
- value: function getActiveContentInstance() {
1803
- return this.activeInstance;
1804
- }
1805
- /**
1806
- * 初始化当前遮罩管理器
1807
- * @returns 当前遮罩容器
1808
- */
1809
-
1810
- }, {
1811
- key: "getMask",
1812
- value: function getMask() {
1813
- var _this = this;
1814
-
1815
- if (this.multiInstance) {
1816
- return this.createMask();
1817
- }
1818
-
1819
- var div = this.parentNode.querySelector("[data-bkmask-uid='".concat(this.uniqueMaskAttrTag, "']"));
1820
-
1821
- if (!div) {
1822
- div = this.createMask();
1823
- div.addEventListener('click', function (e) {
1824
- if (e.target === div) {
1825
- if (typeof _this.onClick === 'function') {
1826
- Reflect.apply(_this.onClick, _this, [e]);
1827
- }
1828
- }
1829
- }, true);
1830
- }
1831
-
1832
- return div;
1833
- }
1834
- /**
1835
- * 创建遮罩层DOM
1836
- * @returns 返回DOM
1837
- */
1838
-
1839
- }, {
1840
- key: "createMask",
1841
- value: function createMask() {
1842
- var attrName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'data-bk-mask-uid';
1843
- var div = document.createElement('div');
1844
- div.setAttribute(attrName, this.uniqueMaskAttrTag);
1845
- this.parentNode.append(div);
1846
- return div;
1847
- }
1848
- }, {
1849
- key: "setMaskStyle",
1850
- value: function setMaskStyle() {
1851
- var _this2 = this;
1852
-
1853
- var maskStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1854
-
1855
- if (this.mask) {
1856
- Object.entries(maskStyle).forEach(function (cfg) {
1857
- return _this2.mask.style.setProperty(cfg[0], cfg[1]);
1858
- });
1859
- }
1860
- }
1861
- /**
1862
- * 根据输入生成唯一遮罩标识
1863
- * @param tag 输入标识
1864
- * @returns string 返回唯一标识
1865
- */
1866
-
1867
- }, {
1868
- key: "getMaskAttrTag",
1869
- value: function getMaskAttrTag(tag) {
1870
- if (/^(auto|\s+)$/i.test(tag) || tag === null || tag === undefined || tag === '') {
1871
- return "__bk_mask_".concat(random(16));
1872
- }
1873
-
1874
- return tag;
1875
- }
1876
- }, {
1877
- key: "appendContentToMask",
1878
- value: function appendContentToMask(content) {
1879
- this.mask.append(content);
1880
- }
1881
- }]);
1882
-
1883
- return BkMaskManager;
1884
- }();
1885
- var bKMaskManager = new BkMaskManager({});
1886
- ;// CONCATENATED MODULE: ../../packages/shared/src/pop-manager.ts
1887
-
1888
-
1889
-
1890
- /*
1891
- * Tencent is pleased to support the open source community by making
1892
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1893
- *
1894
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1895
- *
1896
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1897
- *
1898
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1899
- *
1900
- * ---------------------------------------------------
1901
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1902
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1903
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1904
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1905
- *
1906
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1907
- * the Software.
1908
- *
1909
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1910
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1911
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1912
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1913
- * IN THE SOFTWARE.
1914
- */
1915
-
1916
-
1917
-
1918
- var BKPopIndexManager = /*#__PURE__*/function () {
1919
- function BKPopIndexManager() {
1920
- var _this = this;
1921
-
1922
- _classCallCheck(this, BKPopIndexManager);
1923
-
1924
- this.getActiveClickFnIndex = function (match) {
1925
- var filterFn = function filterFn(target) {
1926
- return typeof match === 'string' ? target.getAttribute(_this.uuidAttrName) === match : target === match;
1927
- };
1928
-
1929
- return _this.clickFn.findIndex(function (_ref) {
1930
- var target = _ref.target;
1931
- return filterFn(target);
1932
- });
1933
- };
1934
-
1935
- this.getActiveClickFn = function (match) {
1936
- var _a;
1937
-
1938
- return (_a = _this.clickFn[_this.getActiveClickFnIndex(match)]) === null || _a === void 0 ? void 0 : _a.fn;
1939
- };
1940
-
1941
- this.popInstanceList = [];
1942
- this.clickFn = [];
1943
- this.uuidAttrName = 'data-bk-pop-uuid';
1944
- this.activePopId = null;
1945
- bKMaskManager.setOption({
1946
- onClick: this.onMaskClickFn.bind(this)
1947
- });
1948
- }
1949
-
1950
- _createClass(BKPopIndexManager, [{
1951
- key: "onMaskClick",
1952
- value: function onMaskClick(callFn, target) {
1953
- this.clickFn.push({
1954
- fn: callFn,
1955
- target: target
1956
- });
1957
- }
1958
- /**
1959
- * 展示弹窗
1960
- * @param content 弹窗内容
1961
- * @param showMask 是否显示遮罩
1962
- * @param appendStyle 追加样式
1963
- * @param transfer 是否显示在body内(即是否显示在div#app内,默认为false)
1964
- * @returns
1965
- */
1966
-
1967
- }, {
1968
- key: "show",
1969
- value: function show(content) {
1970
- var showMask = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1971
- var appendStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1972
- var transfer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1973
- var zindex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
1974
-
1975
- if (!content) {
1976
- console.warn('pop show error: content is null or undefined');
1977
- return;
1978
- }
1979
-
1980
- var zIndex = typeof zindex === 'number' ? zindex : bkZIndexManager.getModalNextIndex();
1981
- var uuid = random(16);
1982
- content.setAttribute(this.uuidAttrName, uuid);
1983
- this.popInstanceList.push({
1984
- uuid: uuid,
1985
- zIndex: zIndex,
1986
- content: content,
1987
- showMask: showMask,
1988
- appendStyle: appendStyle
1989
- });
1990
- showMask && bKMaskManager.backupActiveInstance();
1991
- bKMaskManager.show(content, zIndex, showMask, appendStyle, uuid, transfer);
1992
- this.activePopId = uuid;
1993
- }
1994
- /**
1995
- * 销毁指定实例
1996
- * @param content 指定实例内容
1997
- * @param transfer
1998
- */
1999
-
2000
- }, {
2001
- key: "destroy",
2002
- value: function destroy(content) {
2003
- var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2004
-
2005
- var _a;
2006
-
2007
- var index = this.getActiveClickFnIndex(content);
2008
-
2009
- if (index >= 0) {
2010
- (_a = this.clickFn) === null || _a === void 0 ? void 0 : _a.splice(index, 1);
2011
- }
2012
-
2013
- this.hide(content, transfer);
2014
- }
2015
- /**
2016
- * 关闭最后一个弹窗 如果当前还有父级弹窗,则激活父级弹窗
2017
- * @param removeLastContent 默认:true 是否自动关闭最后一个弹窗实例 某些场景下,已经主动关闭最后一个弹窗,此处只需要处理其他逻辑
2018
- */
2019
-
2020
- }, {
2021
- key: "popHide",
2022
- value: function popHide() {
2023
- var removeLastContent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
2024
-
2025
- if (this.popInstanceList.length) {
2026
- if (removeLastContent) {
2027
- var lastItem = this.popInstanceList.pop();
2028
- bKMaskManager.popIndexStore(lastItem.uuid);
2029
- lastItem.remove();
2030
- this.activePopId = null;
2031
- }
2032
-
2033
- if (this.popInstanceList.length) {
2034
- var activeItem = this.popInstanceList.slice(-1)[0];
2035
- var zIndex = activeItem.zIndex,
2036
- content = activeItem.content,
2037
- showMask = activeItem.showMask,
2038
- appendStyle = activeItem.appendStyle,
2039
- uuid = activeItem.uuid;
2040
- bKMaskManager.show(content, zIndex, showMask, appendStyle, uuid);
2041
- this.activePopId = uuid;
2042
- } else {
2043
- bKMaskManager.hide();
2044
- this.activePopId = null;
2045
- this.clickFn.length = 0;
2046
- }
2047
- }
2048
- }
2049
- /**
2050
- * 关闭指定弹窗
2051
- * @param content { HTMLElement } 关闭弹窗内容
2052
- * **/
2053
-
2054
- }, {
2055
- key: "hide",
2056
- value: function hide(content) {
2057
- var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2058
-
2059
- /** 检查当前实例是否存在于已缓存列表 */
2060
- var uuid = content === null || content === void 0 ? void 0 : content.getAttribute(this.uuidAttrName);
2061
-
2062
- if (uuid) {
2063
- var itemIndex = this.popInstanceList.findIndex(function (item) {
2064
- return item.uuid === uuid;
2065
- });
2066
-
2067
- if (itemIndex >= 0) {
2068
- if (!transfer) this.popInstanceList[itemIndex].content.remove();
2069
- this.popInstanceList.splice(itemIndex, 1);
2070
- bKMaskManager.popIndexStore(uuid);
2071
-
2072
- if (!this.popInstanceList.length) {
2073
- bKMaskManager.hide(transfer);
2074
- this.activePopId = null;
2075
- this.clickFn.length = 0;
2076
- } else {
2077
- this.popHide(false);
2078
- }
2079
- }
2080
- } else {
2081
- content === null || content === void 0 ? void 0 : content.remove();
2082
- }
2083
- }
2084
- }, {
2085
- key: "onMaskClickFn",
2086
- value: function onMaskClickFn(e) {
2087
- var fn = this.getActiveClickFn(this.activePopId);
2088
-
2089
- if (fn) {
2090
- Reflect.apply(fn, this, [e]);
2091
- }
2092
- }
2093
- }]);
2094
-
2095
- return BKPopIndexManager;
2096
- }();
2097
- var bkPopIndexManager = new BKPopIndexManager();
2098
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
2099
- function _setPrototypeOf(o, p) {
2100
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
2101
- o.__proto__ = p;
2102
- return o;
2103
- };
2104
-
2105
- return _setPrototypeOf(o, p);
2106
- }
2107
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/inherits.js
2108
-
2109
- function _inherits(subClass, superClass) {
2110
- if (typeof superClass !== "function" && superClass !== null) {
2111
- throw new TypeError("Super expression must either be null or a function");
2112
- }
2113
-
2114
- subClass.prototype = Object.create(superClass && superClass.prototype, {
2115
- constructor: {
2116
- value: subClass,
2117
- writable: true,
2118
- configurable: true
2119
- }
2120
- });
2121
- Object.defineProperty(subClass, "prototype", {
2122
- writable: false
2123
- });
2124
- if (superClass) _setPrototypeOf(subClass, superClass);
2125
- }
2126
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
2127
- function _assertThisInitialized(self) {
2128
- if (self === void 0) {
2129
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2130
- }
2131
-
2132
- return self;
2133
- }
2134
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
2135
-
2136
-
2137
- function _possibleConstructorReturn(self, call) {
2138
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
2139
- return call;
2140
- } else if (call !== void 0) {
2141
- throw new TypeError("Derived constructors may only return object or undefined");
2142
- }
2143
-
2144
- return _assertThisInitialized(self);
2145
- }
2146
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
2147
- function _getPrototypeOf(o) {
2148
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
2149
- return o.__proto__ || Object.getPrototypeOf(o);
2150
- };
2151
- return _getPrototypeOf(o);
2152
- }
2153
- // EXTERNAL MODULE: external "vue-types"
2154
- var external_vue_types_ = __webpack_require__(210);
2155
- ;// CONCATENATED MODULE: ../../packages/shared/src/vue-types.ts
2156
-
2157
-
2158
-
2159
-
2160
-
2161
-
2162
- 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); }; }
2163
-
2164
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2165
-
2166
-
2167
- var propTypesNS = (0,external_vue_types_.createTypes)({}); // 用于创建字符串列表映射至 `K: V` 的函数
2168
-
2169
- function stringEnum(o) {
2170
- return o.reduce(function (res, key) {
2171
- res[key] = key;
2172
- return res;
2173
- }, Object.create(null));
2174
- }
2175
- var SizeEnum;
2176
-
2177
- (function (SizeEnum) {
2178
- SizeEnum["SMALL"] = "small";
2179
- SizeEnum["LARGE"] = "large";
2180
- SizeEnum["DEFAULT"] = "default";
2181
- })(SizeEnum || (SizeEnum = {}));
2182
-
2183
- var Placements;
2184
-
2185
- (function (Placements) {
2186
- Placements["Top"] = "top";
2187
- Placements["Left"] = "left";
2188
- Placements["Right"] = "right";
2189
- Placements["Bottom"] = "bottom";
2190
- })(Placements || (Placements = {}));
2191
-
2192
- var RenderDirectiveEnum;
2193
-
2194
- (function (RenderDirectiveEnum) {
2195
- RenderDirectiveEnum["IF"] = "if";
2196
- RenderDirectiveEnum["SHOW"] = "show";
2197
- })(RenderDirectiveEnum || (RenderDirectiveEnum = {}));
2198
-
2199
- function renderDirectiveType() {
2200
- return (0,external_vue_types_.toType)('renderDirective', {
2201
- "default": RenderDirectiveEnum.SHOW
2202
- });
2203
- }
2204
- ;
2205
- var AlignEnum;
2206
-
2207
- (function (AlignEnum) {
2208
- AlignEnum["LEFT"] = "left";
2209
- AlignEnum["CENTER"] = "center";
2210
- AlignEnum["RIGHT"] = "right";
2211
- })(AlignEnum || (AlignEnum = {}));
2212
-
2213
- function alignType() {
2214
- return (0,external_vue_types_.toType)('align', {
2215
- "default": AlignEnum.LEFT
2216
- }).def(AlignEnum.LEFT);
2217
- }
2218
- ;
2219
- var ThemeEnum;
2220
-
2221
- (function (ThemeEnum) {
2222
- ThemeEnum["PRIMARY"] = "primary";
2223
- ThemeEnum["WARNING"] = "warning";
2224
- ThemeEnum["SUCCESS"] = "success";
2225
- ThemeEnum["DANGER"] = "danger";
2226
- })(ThemeEnum || (ThemeEnum = {}));
2227
- /** 弹层出现位置选项 */
2228
-
2229
-
2230
- var PlacementEnum;
2231
-
2232
- (function (PlacementEnum) {
2233
- PlacementEnum["AUTO"] = "auto";
2234
- PlacementEnum["AUTO_START"] = "auto-start";
2235
- PlacementEnum["AUTO_END"] = "auto-end";
2236
- PlacementEnum["TOP"] = "top";
2237
- PlacementEnum["RIGHT"] = "right";
2238
- PlacementEnum["BOTTOM"] = "bottom";
2239
- PlacementEnum["LEFT"] = "left";
2240
- PlacementEnum["TOP_START"] = "top-start";
2241
- PlacementEnum["TOP_END"] = "top-end";
2242
- PlacementEnum["BOTTOM_START"] = "bottom-start";
2243
- PlacementEnum["BOTTOM_END"] = "bottom-end";
2244
- PlacementEnum["RIGHT_START"] = "right-start";
2245
- PlacementEnum["RIGHT_END"] = "right-end";
2246
- PlacementEnum["LEFT_START"] = "left-start";
2247
- PlacementEnum["LEFT_END"] = "left-end";
2248
- })(PlacementEnum || (PlacementEnum = {}));
2249
-
2250
- function placementType() {
2251
- return (0,external_vue_types_.toType)('placement', {}).def(PlacementEnum.BOTTOM);
2252
- }
2253
- ;
2254
- /** 弹层触发选项 */
2255
-
2256
- var TriggerEnum;
2257
-
2258
- (function (TriggerEnum) {
2259
- TriggerEnum["HOVER"] = "hover";
2260
- TriggerEnum["CLICK"] = "click";
2261
- TriggerEnum["MANUAL"] = "manual";
2262
- })(TriggerEnum || (TriggerEnum = {}));
2263
-
2264
- function triggerType() {
2265
- return (0,external_vue_types_.toType)('trigger', {}).def(TriggerEnum.HOVER);
2266
- }
2267
- ;
2268
- /** 内容渲染类型:目前是在popover内容渲染时使用 */
2269
-
2270
- var RenderType;
2271
-
2272
- (function (RenderType) {
2273
- RenderType["AUTO"] = "auto";
2274
- RenderType["SHOWN"] = "shown"; // 默认不渲染,只有在popover弹出之后才会渲染
2275
- })(RenderType || (RenderType = {}));
2276
-
2277
- function renderType() {
2278
- return (0,external_vue_types_.toType)('trigger', {}).def(RenderType.AUTO);
2279
- }
2280
- ;
2281
- var DialogTypeEnum;
2282
-
2283
- (function (DialogTypeEnum) {
2284
- DialogTypeEnum["SHOW"] = "show";
2285
- DialogTypeEnum["OPERATION"] = "operation";
2286
- DialogTypeEnum["CONFIRM"] = "confirm";
2287
- DialogTypeEnum["PROCESS"] = "process";
2288
- })(DialogTypeEnum || (DialogTypeEnum = {}));
2289
-
2290
- function dialogTypeUnion() {
2291
- return (0,external_vue_types_.toType)('dialogType', {
2292
- "default": DialogTypeEnum.OPERATION
2293
- });
2294
- }
2295
- var DirectionEnum;
2296
-
2297
- (function (DirectionEnum) {
2298
- DirectionEnum["HORIZONTAL"] = "horizontal";
2299
- DirectionEnum["VERTICAL"] = "vertical";
2300
- })(DirectionEnum || (DirectionEnum = {}));
2301
-
2302
- function directionType() {
2303
- return (0,external_vue_types_.toType)('direction', {}).def(DirectionEnum.HORIZONTAL);
2304
- }
2305
- var LineStyleEnum;
2306
-
2307
- (function (LineStyleEnum) {
2308
- LineStyleEnum["DASHED"] = "dashed";
2309
- LineStyleEnum["SOLID"] = "solid";
2310
- })(LineStyleEnum || (LineStyleEnum = {}));
2311
-
2312
- function lineStyleType() {
2313
- return (0,external_vue_types_.toType)('lineType', {}).def(LineStyleEnum.DASHED);
2314
- }
2315
- ;
2316
- var TagThemeEnum;
2317
-
2318
- (function (TagThemeEnum) {
2319
- TagThemeEnum["SUCCESS"] = "success";
2320
- TagThemeEnum["INFO"] = "info";
2321
- TagThemeEnum["WARNING"] = "warning";
2322
- TagThemeEnum["DANGER"] = "danger";
2323
- })(TagThemeEnum || (TagThemeEnum = {}));
2324
-
2325
- function TagThemeType() {
2326
- return (0,external_vue_types_.toType)('tagTheme', {}).def();
2327
- }
2328
- var InputBehaviorEnum;
2329
-
2330
- (function (InputBehaviorEnum) {
2331
- InputBehaviorEnum["SIMPLICITY"] = "simplicity";
2332
- InputBehaviorEnum["NORMAL"] = "normal";
2333
- })(InputBehaviorEnum || (InputBehaviorEnum = {}));
2334
-
2335
- function InputBehaviorType() {
2336
- return (0,external_vue_types_.toType)('behavior', {}).def(InputBehaviorEnum.NORMAL);
2337
- }
2338
- ;
2339
- var PropTypes = /*#__PURE__*/function (_propTypesNS) {
2340
- _inherits(PropTypes, _propTypesNS);
2341
-
2342
- var _super = _createSuper(PropTypes);
2343
-
2344
- function PropTypes() {
2345
- _classCallCheck(this, PropTypes);
2346
-
2347
- return _super.apply(this, arguments);
2348
- }
2349
-
2350
- _createClass(PropTypes, null, [{
2351
- key: "size",
2352
- value: function size() {
2353
- var defaultList = ['small', 'default', 'large'];
2354
- return (0,external_vue_types_.toType)('Size', {
2355
- validator: function validator(val) {
2356
- if (!val || defaultList.includes(val)) {
2357
- return true;
2358
- }
2359
-
2360
- console.error("invalid theme, ".concat(val, ", the theme must be one of \u3010").concat(defaultList.join(' | '), "\u3011"));
2361
- return false;
2362
- },
2363
- "default": 'default'
2364
- });
2365
- }
2366
- }, {
2367
- key: "theme",
2368
- value: function theme() {
2369
- var themes = ['primary', 'warning', 'success', 'danger'];
2370
- return (0,external_vue_types_.toType)('Theme', {
2371
- validator: function validator(val) {
2372
- if (!val || themes.includes(val)) {
2373
- return true;
2374
- }
2375
-
2376
- console.error("invalid theme, ".concat(val, ", the theme must be one of \u3010").concat(themes.join(' | '), "\u3011"));
2377
- return false;
2378
- }
2379
- });
2380
- }
2381
- }, {
2382
- key: "placement",
2383
- value: function placement() {
2384
- var placements = ['top', 'left', 'right', 'bottom'];
2385
- return (0,external_vue_types_.toType)('Placements', {
2386
- validator: function validator(val) {
2387
- if (!val || placements.includes(val)) {
2388
- return true;
2389
- }
2390
-
2391
- console.error("invalid placements, ".concat(val, ", the placement must be one of \u3010").concat(placements.join(' | '), "\u3011"));
2392
- return false;
2393
- },
2394
- "default": 'top'
2395
- });
2396
- }
2397
- }, {
2398
- key: "style",
2399
- value: function style() {
2400
- return (0,external_vue_types_.toType)('Style', {
2401
- type: [String, Object]
2402
- });
2403
- }
2404
- }, {
2405
- key: "position",
2406
- value: function position() {
2407
- var positions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
2408
- return (0,external_vue_types_.toType)('positions', {
2409
- type: String,
2410
- validator: function validator(val) {
2411
- if (!val || positions.includes(val)) {
2412
- return true;
2413
- }
2414
-
2415
- console.error("invalid positions, ".concat(val, ", the position must be one of \u3010").concat(positions.join(' | '), "\u3011"));
2416
- return false;
2417
- },
2418
- "default": 'top-center'
2419
- });
2420
- }
2421
- }]);
2422
-
2423
- return PropTypes;
2424
- }(propTypesNS);
2425
- ;// CONCATENATED MODULE: ../../packages/shared/src/scrollbar-width.ts
2426
- /*
2427
- * Tencent is pleased to support the open source community by making
2428
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2429
- *
2430
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2431
- *
2432
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2433
- *
2434
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2435
- *
2436
- * ---------------------------------------------------
2437
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2438
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2439
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2440
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2441
- *
2442
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2443
- * the Software.
2444
- *
2445
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2446
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2447
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2448
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2449
- * IN THE SOFTWARE.
2450
- */
2451
- var scrollBarWidth;
2452
- function scrollbarWidth() {
2453
- if (scrollBarWidth !== undefined) return scrollBarWidth;
2454
- var outer = document.createElement('div');
2455
- outer.className = 'bk-scrollbar-wrap';
2456
- outer.style.visibility = 'hidden';
2457
- outer.style.width = '100px';
2458
- outer.style.position = 'absolute';
2459
- outer.style.top = '-9999px';
2460
- document.body.appendChild(outer);
2461
- var widthNoScroll = outer.offsetWidth;
2462
- outer.style.overflow = 'scroll';
2463
- var inner = document.createElement('div');
2464
- inner.style.width = '100%';
2465
- outer.appendChild(inner);
2466
- var widthWithScroll = inner.offsetWidth;
2467
- outer.parentNode.removeChild(outer);
2468
- scrollBarWidth = widthNoScroll - widthWithScroll;
2469
- return scrollBarWidth;
2470
- }
2471
- ;// CONCATENATED MODULE: ../../packages/shared/src/token.ts
2472
- /*
2473
- * Tencent is pleased to support the open source community by making
2474
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2475
- *
2476
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2477
- *
2478
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2479
- *
2480
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2481
- *
2482
- * ---------------------------------------------------
2483
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2484
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2485
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2486
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2487
- *
2488
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2489
- * the Software.
2490
- *
2491
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2492
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2493
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2494
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2495
- * IN THE SOFTWARE.
2496
- */
2497
- var formKey = Symbol('form');
2498
- var formItemKey = Symbol('formItem');
2499
- // EXTERNAL MODULE: external "vue"
2500
- var external_vue_ = __webpack_require__(748);
2501
- ;// CONCATENATED MODULE: ../../packages/shared/src/hooks/use-form.ts
2502
- /*
2503
- * Tencent is pleased to support the open source community by making
2504
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2505
- *
2506
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2507
- *
2508
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2509
- *
2510
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2511
- *
2512
- * ---------------------------------------------------
2513
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2514
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2515
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2516
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2517
- *
2518
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2519
- * the Software.
2520
- *
2521
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2522
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2523
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2524
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2525
- * IN THE SOFTWARE.
2526
- */
2527
-
2528
-
2529
- var useForm = function useForm() {
2530
- return (0,external_vue_.inject)(formKey);
2531
- };
2532
- ;// CONCATENATED MODULE: ../../packages/shared/src/hooks/use-form-item.ts
2533
- /*
2534
- * Tencent is pleased to support the open source community by making
2535
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2536
- *
2537
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2538
- *
2539
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2540
- *
2541
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2542
- *
2543
- * ---------------------------------------------------
2544
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2545
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2546
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2547
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2548
- *
2549
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2550
- * the Software.
2551
- *
2552
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2553
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2554
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2555
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2556
- * IN THE SOFTWARE.
2557
- */
2558
-
2559
-
2560
- var useFormItem = function useFormItem() {
2561
- return (0,external_vue_.inject)(formItemKey, undefined);
2562
- };
2563
- ;// CONCATENATED MODULE: ../../packages/shared/src/dom.ts
2564
- /*
2565
- * Tencent is pleased to support the open source community by making
2566
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2567
- *
2568
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2569
- *
2570
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2571
- *
2572
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2573
- *
2574
- * ---------------------------------------------------
2575
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2576
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2577
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2578
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2579
- *
2580
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2581
- * the Software.
2582
- *
2583
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2584
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2585
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2586
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2587
- * IN THE SOFTWARE.
2588
- */
2589
- var on = function () {
2590
- if (document.addEventListener) {
2591
- return function (element, event, handler) {
2592
- if (element && event && handler) {
2593
- element.addEventListener(event, handler, true);
2594
- }
2595
- };
2596
- }
2597
-
2598
- return function (element, event, handler) {
2599
- if (element && event && handler) {
2600
- element.attachEvent("on".concat(event), handler);
2601
- }
2602
- };
2603
- }(); // 兼容浏览器,移除事件监听器
2604
-
2605
- var off = function () {
2606
- if (document.removeEventListener) {
2607
- return function (element, event, handler) {
2608
- if (element && event) {
2609
- element.removeEventListener(event, handler, true);
2610
- }
2611
- };
2612
- }
2613
-
2614
- return function (element, event, handler) {
2615
- if (element && event) {
2616
- element.detachEvent("on".concat(event), handler);
2617
- }
2618
- };
2619
- }(); // scrollTop animation
2620
-
2621
- function scrollTop(el) {
2622
- var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2623
- var to = arguments.length > 2 ? arguments[2] : undefined;
2624
- var duration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 500;
2625
- var endCallback = arguments.length > 4 ? arguments[4] : undefined;
2626
- var difference = Math.abs(from - to);
2627
- var step = Math.ceil(difference / duration * 50);
2628
-
2629
- function scroll(start, end, step) {
2630
- if (start === end) {
2631
- endCallback === null || endCallback === void 0 ? void 0 : endCallback();
2632
- return;
2633
- }
2634
-
2635
- var d = start + step > end ? end : start + step;
2636
-
2637
- if (start > end) {
2638
- d = start - step < end ? end : start - step;
2639
- }
2640
-
2641
- if (el === window) {
2642
- window.scrollTo(d, d);
2643
- } else {
2644
- el.scrollTop = d;
2645
- }
2646
-
2647
- window.requestAnimationFrame(function () {
2648
- return scroll(d, end, step);
2649
- });
2650
- }
2651
-
2652
- scroll(from, to, step);
2653
- }
2654
- ;// CONCATENATED MODULE: ../../packages/shared/src/index.ts
2655
-
2656
-
2657
-
2658
-
2659
-
2660
-
2661
-
2662
-
2663
-
2664
-
2665
-
2666
-
2667
- function classes(dynamicCls) {
2668
- var constCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2669
- return Object.entries(dynamicCls).filter(function (entry) {
2670
- return entry[1];
2671
- }).map(function (entry) {
2672
- return entry[0];
2673
- }).join(' ').concat(constCls ? " ".concat(constCls) : '');
2674
- }
2675
- var EMPTY_OBJ = Object.create({});
2676
- var noop = function noop() {};
2677
- var renderEmptyVNode = function renderEmptyVNode() {
2678
- return null;
2679
- };
2680
- var isEmptyObj = function isEmptyObj(target) {
2681
- return Object.keys(target).length < 1;
2682
- };
2683
- var withInstall = function withInstall(component) {
2684
- component.install = function (app) {
2685
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
2686
- prefix = _ref.prefix;
2687
-
2688
- var pre = app.config.globalProperties.bkUIPrefix || prefix || 'Bk';
2689
- app.component(pre + component.name, component);
2690
- };
2691
-
2692
- return component;
2693
- };
2694
- var withInstallProps = function withInstallProps(component, childComponents) {
2695
- var isProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2696
-
2697
- component.install = function (app) {
2698
- var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
2699
- prefix = _ref2.prefix;
2700
-
2701
- var pre = app.config.globalProperties.bkUIPrefix || prefix || 'Bk';
2702
- app.component(pre + component.name, component);
2703
- !isProps && Object.values(childComponents).forEach(function (child) {
2704
- app.component(pre + child.name, child);
2705
- });
2706
- };
2707
-
2708
- Object.keys(childComponents).forEach(function (key) {
2709
- component[key] = childComponents[key];
2710
- });
2711
- return component;
2712
- };
2713
- /**
2714
- * 解析当前组件ClassName,自动添加前缀
2715
- * @param clsName 当前ClassName
2716
- * @param prefix 前缀,默认为bk
2717
- * @returns prefix-clsName
2718
- */
2719
-
2720
- function resolveClassName(clsName) {
2721
- var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'bk';
2722
- return "".concat(prefix, "-").concat(clsName);
2723
- }
2724
- /**
2725
- * 函数防抖
2726
- * @param {*} fn 执行的函数
2727
- * @param {*} delay 延时时间
2728
- * @param {*} immediate 是否立即执行
2729
- */
2730
-
2731
- function debounce() {
2732
- var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
2733
- var fn = arguments.length > 1 ? arguments[1] : undefined;
2734
- var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2735
- var timeout;
2736
- var result;
2737
-
2738
- var debounced = function debounced() {
2739
- // eslint-disable-next-line @typescript-eslint/no-this-alias
2740
- var ctx = this; // 当前上下文
2741
- // eslint-disable-next-line prefer-rest-params
2742
-
2743
- var args = arguments; // fn的参数
2744
- // 取消之前的延时调用
2745
-
2746
- if (timeout) clearTimeout(timeout);
2747
-
2748
- if (immediate) {
2749
- var applyImmediate = !timeout; // 是否执行过
2750
-
2751
- timeout = setTimeout(function () {
2752
- timeout = null; // 标志是否执行过,与clearTimeout有区别,clearTimeout之后timeout不为null而是一个系统分配的队列ID
2753
- }, delay);
2754
- if (applyImmediate) result = fn.apply(ctx, args); // 立即调用
2755
- } else {
2756
- timeout = setTimeout(function () {
2757
- fn.apply(ctx, args);
2758
- }, delay);
2759
- }
2760
-
2761
- return result;
2762
- };
2763
-
2764
- debounced.cancel = function () {
2765
- clearTimeout(timeout);
2766
- timeout = null;
2767
- };
2768
-
2769
- return debounced;
2770
- }
2771
- /**
2772
- * 过滤(去除)对象中的某个属性
2773
- * @param data 需要处理的对象
2774
- * @param filter 过滤关键字
2775
- * @returns object 去除属性之后的对象
2776
- */
2777
-
2778
- function filterProperty(data, filter) {
2779
- return JSON.parse(JSON.stringify(data, function (key, value) {
2780
- if (filter.includes(key)) {
2781
- return undefined;
2782
- }
2783
-
2784
- return value;
2785
- }));
2786
- }
2787
- ;
2788
- function arrayEqual() {
2789
- var arr1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2790
- var arr2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
2791
-
2792
- if (arr1.length !== arr2.length) {
2793
- return false;
2794
- }
2795
-
2796
- for (var i = 0; i < arr1.length; i++) {
2797
- if (Array.isArray(arr1[i])) {
2798
- return arrayEqual(arr1[i], arr2[i]);
2799
- }
2800
-
2801
- if (arr1[i] !== arr2[i]) {
2802
- return false;
2803
- }
2804
- }
2805
-
2806
- return true;
2807
- }
2808
- })();
2809
-
2810
- /******/ return __webpack_exports__;
2811
- /******/ })()
2812
- ;
2813
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@popperjs/core"),require("lodash"),require("vue-types"),require("vue"));else if("function"==typeof define&&define.amd)define(["@popperjs/core","lodash","vue-types","vue"],t);else{var n="object"==typeof exports?t(require("@popperjs/core"),require("lodash"),require("vue-types"),require("vue")):t(e["@popperjs/core"],e.lodash,e["vue-types"],e.vue);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r)=>(()=>{var i={8022:(e,t,n)=>{var r=n(4481),i=n(6426),o=i;o.v1=r,o.v4=i,e.exports=o},8725:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},9157:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},4481:(e,t,n)=>{var r,i,o=n(9157),a=n(8725),s=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,l=t||[],p=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:i;if(null==p||null==f){var d=o();null==p&&(p=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==f&&(f=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,y=h-s+(v-u)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<0||h>s)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,u=v,i=f;var g=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=h/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var b=0;b<6;++b)l[c+b]=p[b];return t||a(l)}},6426:(e,t,n)=>{var r=n(9157),i=n(8725);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},5798:t=>{"use strict";t.exports=e},467:e=>{"use strict";e.exports=t},748:e=>{"use strict";e.exports=r},210:e=>{"use strict";e.exports=n}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e](n,n.exports,a),n.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i,o;a.r(s),a.d(s,{AlignEnum:()=>X,BKLAYERD_INDEX_EFAULT_VALUE:()=>u,BKLAYERTYPE:()=>o,BKPopIndexManager:()=>z,BKPopover:()=>j,BkMaskManager:()=>V,DialogTypeEnum:()=>re,DirectionEnum:()=>ie,EMPTY_OBJ:()=>je,InputBehaviorEnum:()=>se,InputBehaviorType:()=>be,LineStyleEnum:()=>oe,PlacementEnum:()=>ee,Placements:()=>J,PropTypes:()=>Te,RenderDirectiveEnum:()=>$,RenderType:()=>ne,SizeEnum:()=>Z,TagThemeEnum:()=>ae,TagThemeType:()=>me,ThemeEnum:()=>Q,TriggerEnum:()=>te,alignType:()=>pe,arrayEqual:()=>Ve,bKMaskManager:()=>B,bkPopIndexManager:()=>q,bkZIndexManager:()=>c,capitalize:()=>_,checkOverflow:()=>H,classes:()=>Re,clone:()=>I,debounce:()=>_e,dialogTypeUnion:()=>ve,directionType:()=>ye,elementsEqual:()=>O,filterProperty:()=>He,finiteOrDefault:()=>k,formItemKey:()=>Ee,formKey:()=>Ie,getPopContainerId:()=>N,hasOverflowEllipsis:()=>M,isArray:()=>g,isElement:()=>L,isEmpty:()=>y,isEmptyObj:()=>Ce,isFinite:()=>b,isNullOrUndef:()=>v,isObject:()=>m,lineStyleType:()=>ge,maybeShowTooltip:()=>R,merge:()=>w,mergeIf:()=>x,mergerFn:()=>S,mergerIfFn:()=>A,noop:()=>Pe,observerResize:()=>F,off:()=>Le,on:()=>Ae,placementType:()=>fe,random:()=>U,renderDirectiveType:()=>le,renderEmptyVNode:()=>Ne,renderType:()=>he,resolveClassName:()=>Fe,scrollTop:()=>Me,scrollbarWidth:()=>Oe,stringEnum:()=>ce,triggerType:()=>de,useForm:()=>we,useFormItem:()=>xe,valueOrDefault:()=>T,withInstall:()=>De,withInstallProps:()=>Ue}),function(e){e.BOTTOM="bottom",e.CONTENT="content",e.NAVI="navi",e.FULLSCREEN="fullScreen",e.PLUGINS="plugins",e.MODAL="modal",e.MESSAGE="message",e.POPPER="popper"}(o||(o={}));var u=(r(i={},o.BOTTOM,0),r(i,o.CONTENT,1),r(i,o.NAVI,100),r(i,o.FULLSCREEN,1e3),r(i,o.MODAL,3e3),r(i,o.PLUGINS,8e3),r(i,o.MESSAGE,1e4),r(i,o.POPPER,99999),i),c=new(function(){function t(){e(this,t),this.storageLayerIndexValue={},this.copyDefaultValue()}return n(t,[{key:"getNextIndex",value:function(e){return Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue,e)?(this.storageLayerIndexValue[e]=this.storageLayerIndexValue[e]+1,this.storageLayerIndexValue[e]):(this.storageLayerIndexValue[o.MODAL]=this.storageLayerIndexValue[o.MODAL]+1,this.storageLayerIndexValue[o.MODAL])}},{key:"getModalNextIndex",value:function(){return this.getNextIndex(o.MODAL)}},{key:"getMessageNextIndex",value:function(){return this.getNextIndex(o.MESSAGE)}},{key:"getFullScreenNextIndex",value:function(){return this.getNextIndex(o.FULLSCREEN)}},{key:"getNaviNextIndex",value:function(){return this.getNextIndex(o.NAVI)}},{key:"getPopperIndex",value:function(){return u.popper}},{key:"setDefaultZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue.__proto__,n)&&Object.assign(t.storageLayerIndexValue.__proto__,r({},n,e[n]))})),this.copyDefaultValue()}},{key:"resetZIndex",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){Object.prototype.hasOwnProperty.call(t.storageLayerIndexValue,n)&&Object.assign(t.storageLayerIndexValue,r({},n,e[n]))}))}},{key:"copyDefaultValue",value:function(){var e=Object.keys(u).reduce((function(e,t){return Object.assign(e,r({},t,{value:u[t],writable:!0,configurable:!0}))}),{});this.storageLayerIndexValue=Object.create(u,e)}}]),t}());function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d=a(8022),h=a(5798);function v(e){return null==e}function y(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return""===e||!!t&&v(e)}function g(e){if(Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)}function m(e){return null!==e&&/^\[object (Object|Module)\]/.test(Object.prototype.toString.call(e))}var b=function(e){return("number"==typeof e||e instanceof Number)&&isFinite(+e)};function k(e,t){return b(e)?e:t}function T(e,t){return void 0===e?t:e}function O(e,t){var n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function I(e){if(g(e))return e.map(I);if(m(e)){for(var t=Object.create(null),n=Object.keys(e),r=n.length,i=0;i<r;++i)t[n[i]]=I(e[n[i]]);return t}return e}function E(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function S(e,t,n,r){if(E(e)){var i=t[e],o=n[e];m(i)&&m(o)?w(i,o,r):t[e]=I(o)}}function w(e,t,n){var r=g(t)?t:[t],i=r.length;if(!m(e))return e;for(var o=(n=n||{}).merger||S,a=0;a<i;++a)if(m(t=r[a]))for(var s=Object.keys(t),u=0,c=s.length;u<c;++u)o(s[u],e,t,n);return e}function x(e,t){return w(e,t,{merger:A})}function A(e,t,n){if(E(e)){var r=t[e],i=n[e];m(r)&&m(i)?x(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=I(i))}}function L(e){try{return e instanceof HTMLElement}catch(t){return"object"===l(e)&&1===e.nodeType&&"object"===l(e.style)&&"object"===l(e.ownerDocument)}}function M(e){return e.offsetWidth<e.scrollWidth||e.offsetHeight<e.scrollHeight}function R(e,t){M(e)?e.setAttribute("title",t):e.removeAttribute("title")}var j=function(){function t(n,r,i){var o,a;e(this,t),this.isShow=!1,this.trigger=void 0,this.instance=void 0,this.always=!1,this.reference=void 0,this.referenceTarget=void 0,this.popperRefer=void 0,this.delay=50,this.isInnerPopper=!1,this.disabled=!1,this.afterShow=null,this.afterHidden=null,this.appendTo="parent",this.container=null,this.fixOnBoundary=!1,this.instanceOptions=this.initDefaultOptions(i),this.reference=this.resolveInputSelectorToHtmlElement(n),this.popperRefer=this.resolveInputSelectorToHtmlElement(r),this.referenceTarget=this.getTargetReferenceElement(),this.container=null===(o=this.popperRefer)||void 0===o?void 0:o.parentElement,this.isShow=!!(null===(a=this.instanceOptions)||void 0===a?void 0:a.isShow),this.always=this.instanceOptions.always,this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.appendTo=this.instanceOptions.appendTo,this.afterHidden="function"==typeof i.afterHidden?i.afterHidden:function(){},this.afterShow="function"==typeof i.afterShow?i.afterShow:function(){},this.fixOnBoundary=this.instanceOptions.fixOnBoundary,this.initInstance(),this.registerEvents(),(this.isShow||this.always)&&this.show(null)}return n(t,[{key:"forceUpdate",value:function(){var e;null===(e=this.instance)||void 0===e||e.forceUpdate()}},{key:"update",value:function(){var e;null===(e=this.instance)||void 0===e||e.update()}},{key:"updateOptions",value:function(e){var t;this.instanceOptions=this.initDefaultOptions(e),this.isShow=!!(null===(t=this.instanceOptions)||void 0===t?void 0:t.isShow),this.trigger=this.instanceOptions.trigger,this.disabled=this.instanceOptions.disabled,this.setOptions(this.instanceOptions)}},{key:"setOptions",value:function(e){var t;null===(t=this.instance)||void 0===t||t.setOptions(e)}},{key:"destroy",value:function(){var e;null===(e=this.instance)||void 0===e||e.destroy()}},{key:"updateDisabled",value:function(e){this.disabled=null!=e?e:!this.disabled,this.disabled&&this.hide()}},{key:"show",value:function(e){var t;this.disabled||(null===(t=this.popperRefer)||void 0===t||t.setAttribute("data-show",""),this.setOptions({modifiers:[].concat(f(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!0}])}),this.update(),this.isShow=!0,this.afterShow(),this.fixOnBoundary||this.appendToTarget())}},{key:"hide",value:function(){var e;this.always||(null===(e=this.popperRefer)||void 0===e||e.removeAttribute("data-show"),this.setOptions({modifiers:[].concat(f(this.instanceOptions.modifiers||[]),[{name:"eventListeners",enabled:!1}])}),this.isShow=!1,this.isInnerPopper=!1,this.afterHidden(),this.fixOnBoundary||this.restorePopContent())}},{key:"restorePopContent",value:function(){var e=this.getAppendToTarget();L(e)&&e.contains(this.popperRefer)&&this.container&&!this.container.contains(this.popperRefer)&&this.container.append(this.popperRefer)}},{key:"appendToTarget",value:function(){var e=this.getAppendToTarget();L(e)&&e.contains(this.popperRefer)&&e.append(this.popperRefer)}},{key:"getAppendToTarget",value:function(){var e=this.appendTo,t=e;return"parent"!==e&&"string"==typeof e&&(t=document.querySelector(e)),t}},{key:"initDefaultOptions",value:function(e){var t=this,n=w({placement:"top",modifiers:[{name:"offset",options:{offset:[0,8]}}],strategy:"absolute",onFirstUpdate:void 0,isShow:!1,theme:"dark",trigger:"hover",disabled:!1},e||{}),r=n.onFirstUpdate;return n.onFirstUpdate=function(e){"function"==typeof r&&(r.call(t,e),t.handleFirstUpdate())},n}},{key:"handleFirstUpdate",value:function(){this.fixOnBoundary&&this.appendToTarget()}},{key:"getTargetReferenceElement",value:function(){return this.isElement(this.reference)&&1===this.reference.childElementCount?this.reference.firstElementChild:this.reference}},{key:"initInstance",value:function(){var e,t;this.referenceTarget&&(this.referenceTarget&&this.popperRefer?(this.instance=(0,h.createPopper)(this.referenceTarget,this.popperRefer,this.instanceOptions),null===(e=this.popperRefer)||void 0===e||e.setAttribute("data-theme",null!==(t=this.instanceOptions.theme)&&void 0!==t?t:"dark")):console.error("reference or popperRefer is null, please check html element."))}},{key:"resolveInputSelectorToHtmlElement",value:function(e){if(this.isElement(e))return e;if("string"==typeof e)return document.querySelector(e);if("object"===l(e)){if(Object.prototype.hasOwnProperty.call(e,"getBoundingClientRect"))return e}else console.error("'getBoundingClientRect' is needed when use virtual elements");return null}},{key:"isElement",value:function(e){return L(e)}},{key:"registerEvents",value:function(){var e=this;this.isElement(this.referenceTarget)&&"hover"===this.trigger&&(["mouseenter","focus"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(n){"mouseenter"===t&&(e.isInnerPopper=!0),e.show(n)}))})),["mouseleave","blur"].forEach((function(t){e.referenceTarget.addEventListener(t,(function(){e.isInnerPopper=!1,setTimeout((function(){!e.isInnerPopper&&e.hide()}),e.delay)}))})),this.isElement(this.popperRefer)&&["mouseenter","mouseleave"].forEach((function(t){e.popperRefer.addEventListener(t,(function(){"mouseenter"===t&&(e.isInnerPopper=!0),"mouseleave"===t&&e.hide()}))}))),"click"===this.trigger&&["click"].forEach((function(t){document.body.addEventListener(t,(function(t){e.isSameElement(t.target,e.reference)||e.reference.contains(t.target)?e.show(t):!e.isShow||e.isSameElement(t.target,e.popperRefer)||e.popperRefer.contains(t.target)||e.hide()}))}))}},{key:"isSameElement",value:function(e,t){return e&&(e===t||e===t.firstElementChild)}}]),t}(),P=null,N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#";if(null===P){P="id_".concat((0,d.v4)());var t=document.createElement("div");t.setAttribute("id",P),t.setAttribute("data-popper-id",P),document.body.append(t)}return"".concat(e).concat(P)},C=a(467),D="abcdefghijklmnopqrstuvwxyz0123456789",U=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D,n="",r=0;r<e;r++)n+=t[parseInt((Math.random()*t.length).toString(),10)];return n},F=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(0,C.throttle)((function(){"function"==typeof t&&t()}),n),o=new ResizeObserver((function(){i()}));return r&&"function"==typeof t&&t(),{start:function(){o.observe(e)},stop:function(){o.disconnect(),o.unobserve(e)}}},_=function(e){return e[0].toUpperCase()+e.slice(1)};function H(e){if(!e)return!1;var t=!1;try{var n=window.getComputedStyle(e,null);if("none"!==n.webkitLineClamp){var r=parseFloat(n.height),i=function(e,t){var n=document.createElement("div"),r=parseFloat(t.width)?"".concat(Math.ceil(parseFloat(t.width)),"px"):t.width;return n.style.cssText="\n width: ".concat(r,";\n line-height: ").concat(t["line-height"],";\n font-size: ").concat(t["font-size"],";\n word-break: ").concat(t["word-break"],";\n padding: ").concat(t.padding,";\n "),n.textContent=e.textContent,n}(e,n);document.body.appendChild(i);var o=window.getComputedStyle(i,null).height;document.body.removeChild(i),t=r<parseFloat(o)}else t=e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight}catch(e){console.warn("There is an error when check element overflow state: ",e)}return t}var V=function(){function t(n){e(this,t),this.multiInstance=!1,this.uniqueMaskAttrTag="",this.parentNode=document.body,this.activeInstance=void 0,this.zIndexStore=new Map,this.lastUUID=null,this.maskStyle={position:"absolute",left:0,top:0,bottom:0,right:0,display:"none","background-color":"rgba(0,0,0,.6)"};var r=n||{},i=r.multiInstance,o=void 0!==i&&i,a=r.maskAttrTag,s=void 0===a?"auto":a,u=r.parentNode,c=void 0===u?document.body:u,l=r.maskStyle,p=void 0===l?{}:l,f=r.onClick,d=void 0===f?null:f;this.onClick=d,this.activeInstance=void 0,this.multiInstance=o,this.uniqueMaskAttrTag=this.getMaskAttrTag(s),this.parentNode=c||document,this.mask=this.getMask(),this.backupMask=this.createMask("data-bk-backup-uid"),this.setMaskStyle(Object.assign({},this.maskStyle,p))}return n(t,[{key:"setOption",value:function(e){var t=e||{},n=t.parentNode,r=void 0===n?document.body:n,i=t.maskStyle,o=void 0===i?{}:i,a=t.onClick,s=void 0===a?null:a;this.onClick=s,this.parentNode=r||document,this.setMaskStyle(Object.assign({},this.maskStyle,o))}},{key:"show",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=null!=i?i:U(16),s=/-?\d+/.test("".concat(t))?t:c.getModalNextIndex(),u=Object.assign({},this.maskStyle,r||{});if(!n&&this.lastUUID){var l=this.zIndexStore.get(this.lastUUID);u=l.style}this.storeMaskInsCfg({zIndex:s,style:Object.assign({},u),uuid:a,preUID:this.lastUUID}),this.setMaskStyle(u),this.mask.style.setProperty("display","block"),this.mask.style.setProperty("z-index","".concat(s)),this.backupMask.style.setProperty("z-index","".concat(s-1)),e&&(o&&e.style.setProperty("z-index","".concat(s+1)),this.activeInstance=e,o||this.appendContentToMask(e))}},{key:"hide",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=null!=r?r:this.lastUUID;this.mask.style.setProperty("display","none"),t||(null==n||n.remove(),null===(e=this.activeInstance)||void 0===e||e.remove()),this.activeInstance=void 0,this.popIndexStore(i)}},{key:"storeMaskInsCfg",value:function(e){return this.zIndexStore.set(e.uuid,e),this.lastUUID=e.uuid,this.zIndexStore.get(e.uuid)}},{key:"popIndexStore",value:function(e){if(this.zIndexStore.has(e)){var t=this.zIndexStore.get(e);return this.lastUUID=t.preUID,this.zIndexStore.delete(e)}return this.lastUUID=null,!1}},{key:"backupActiveInstance",value:function(){this.activeInstance&&this.backupMask.append(this.activeInstance)}},{key:"backupContentElement",value:function(e){e&&this.backupMask.append(e)}},{key:"getActiveContentInstance",value:function(){return this.activeInstance}},{key:"getMask",value:function(){var e=this;if(this.multiInstance)return this.createMask();var t=this.parentNode.querySelector("[data-bkmask-uid='".concat(this.uniqueMaskAttrTag,"']"));return t||(t=this.createMask()).addEventListener("click",(function(n){n.target===t&&"function"==typeof e.onClick&&Reflect.apply(e.onClick,e,[n])}),!0),t}},{key:"createMask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-bk-mask-uid",t=document.createElement("div");return t.setAttribute(e,this.uniqueMaskAttrTag),this.parentNode.append(t),t}},{key:"setMaskStyle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.mask&&Object.entries(t).forEach((function(t){return e.mask.style.setProperty(t[0],t[1])}))}},{key:"getMaskAttrTag",value:function(e){return/^(auto|\s+)$/i.test(e)||null==e||""===e?"__bk_mask_".concat(U(16)):e}},{key:"appendContentToMask",value:function(e){this.mask.append(e)}}]),t}(),B=new V({}),z=function(){function t(){var n=this;e(this,t),this.getActiveClickFnIndex=function(e){return n.clickFn.findIndex((function(t){return r=t.target,"string"==typeof e?r.getAttribute(n.uuidAttrName)===e:r===e;var r}))},this.getActiveClickFn=function(e){var t;return null===(t=n.clickFn[n.getActiveClickFnIndex(e)])||void 0===t?void 0:t.fn},this.popInstanceList=[],this.clickFn=[],this.uuidAttrName="data-bk-pop-uuid",this.activePopId=null,B.setOption({onClick:this.onMaskClickFn.bind(this)})}return n(t,[{key:"onMaskClick",value:function(e,t){this.clickFn.push({fn:e,target:t})}},{key:"show",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(e){var o="number"==typeof i?i:c.getModalNextIndex(),a=U(16);e.setAttribute(this.uuidAttrName,a),this.popInstanceList.push({uuid:a,zIndex:o,content:e,showMask:t,appendStyle:n}),t&&B.backupActiveInstance(),B.show(e,o,t,n,a,r),this.activePopId=a}else console.warn("pop show error: content is null or undefined")}},{key:"destroy",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getActiveClickFnIndex(e);r>=0&&(null===(t=this.clickFn)||void 0===t||t.splice(r,1)),this.hide(e,n)}},{key:"popHide",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.popInstanceList.length){if(e){var t=this.popInstanceList.pop();B.popIndexStore(t.uuid),t.remove(),this.activePopId=null}if(this.popInstanceList.length){var n=this.popInstanceList.slice(-1)[0],r=n.zIndex,i=n.content,o=n.showMask,a=n.appendStyle,s=n.uuid;B.show(i,r,o,a,s),this.activePopId=s}else B.hide(),this.activePopId=null,this.clickFn.length=0}}},{key:"hide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null==e?void 0:e.getAttribute(this.uuidAttrName);if(n){var r=this.popInstanceList.findIndex((function(e){return e.uuid===n}));r>=0&&(t||this.popInstanceList[r].content.remove(),this.popInstanceList.splice(r,1),B.popIndexStore(n),this.popInstanceList.length?this.popHide(!1):(B.hide(t),this.activePopId=null,this.clickFn.length=0))}else null==e||e.remove()}},{key:"onMaskClickFn",value:function(e){var t=this.getActiveClickFn(this.activePopId);t&&Reflect.apply(t,this,[e])}}]),t}(),q=new z;function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function W(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}var Y=a(210);var Z,J,$,X,Q,ee,te,ne,re,ie,oe,ae,se,ue=(0,Y.createTypes)({});function ce(e){return e.reduce((function(e,t){return e[t]=t,e}),Object.create(null))}function le(){return(0,Y.toType)("renderDirective",{default:$.SHOW})}function pe(){return(0,Y.toType)("align",{default:X.LEFT}).def(X.LEFT)}function fe(){return(0,Y.toType)("placement",{}).def(ee.BOTTOM)}function de(){return(0,Y.toType)("trigger",{}).def(te.HOVER)}function he(){return(0,Y.toType)("trigger",{}).def(ne.AUTO)}function ve(){return(0,Y.toType)("dialogType",{default:re.OPERATION})}function ye(){return(0,Y.toType)("direction",{}).def(ie.HORIZONTAL)}function ge(){return(0,Y.toType)("lineType",{}).def(oe.DASHED)}function me(){return(0,Y.toType)("tagTheme",{}).def()}function be(){return(0,Y.toType)("behavior",{}).def(se.NORMAL)}!function(e){e.SMALL="small",e.LARGE="large",e.DEFAULT="default"}(Z||(Z={})),function(e){e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom"}(J||(J={})),function(e){e.IF="if",e.SHOW="show"}($||($={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(X||(X={})),function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.DANGER="danger"}(Q||(Q={})),function(e){e.AUTO="auto",e.AUTO_START="auto-start",e.AUTO_END="auto-end",e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_START="top-start",e.TOP_END="top-end",e.BOTTOM_START="bottom-start",e.BOTTOM_END="bottom-end",e.RIGHT_START="right-start",e.RIGHT_END="right-end",e.LEFT_START="left-start",e.LEFT_END="left-end"}(ee||(ee={})),function(e){e.HOVER="hover",e.CLICK="click",e.MANUAL="manual"}(te||(te={})),function(e){e.AUTO="auto",e.SHOWN="shown"}(ne||(ne={})),function(e){e.SHOW="show",e.OPERATION="operation",e.CONFIRM="confirm",e.PROCESS="process"}(re||(re={})),function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(ie||(ie={})),function(e){e.DASHED="dashed",e.SOLID="solid"}(oe||(oe={})),function(e){e.SUCCESS="success",e.INFO="info",e.WARNING="warning",e.DANGER="danger"}(ae||(ae={})),function(e){e.SIMPLICITY="simplicity",e.NORMAL="normal"}(se||(se={}));var ke,Te=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(a,t);var r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=K(r);if(i){var n=K(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return W(this,e)});function a(){return e(this,a),o.apply(this,arguments)}return n(a,null,[{key:"size",value:function(){var e=["small","default","large"];return(0,Y.toType)("Size",{validator:function(t){return!(t&&!e.includes(t)&&(console.error("invalid theme, ".concat(t,", the theme must be one of 【").concat(e.join(" | "),"】")),1))},default:"default"})}},{key:"theme",value:function(){var e=["primary","warning","success","danger"];return(0,Y.toType)("Theme",{validator:function(t){return!(t&&!e.includes(t)&&(console.error("invalid theme, ".concat(t,", the theme must be one of 【").concat(e.join(" | "),"】")),1))}})}},{key:"placement",value:function(){var e=["top","left","right","bottom"];return(0,Y.toType)("Placements",{validator:function(t){return!(t&&!e.includes(t)&&(console.error("invalid placements, ".concat(t,", the placement must be one of 【").concat(e.join(" | "),"】")),1))},default:"top"})}},{key:"style",value:function(){return(0,Y.toType)("Style",{type:[String,Object]})}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["top-left","top-right","bottom-left","bottom-right"];return(0,Y.toType)("positions",{type:String,validator:function(t){return!(t&&!e.includes(t)&&(console.error("invalid positions, ".concat(t,", the position must be one of 【").concat(e.join(" | "),"】")),1))},default:"top-center"})}}]),a}(ue);function Oe(){if(void 0!==ke)return ke;var e=document.createElement("div");e.className="bk-scrollbar-wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var r=n.offsetWidth;return e.parentNode.removeChild(e),ke=t-r}var Ie=Symbol("form"),Ee=Symbol("formItem"),Se=a(748),we=function(){return(0,Se.inject)(Ie)},xe=function(){return(0,Se.inject)(Ee,void 0)},Ae=document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!0)}:function(e,t,n){e&&t&&n&&e.attachEvent("on".concat(t),n)},Le=document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!0)}:function(e,t,n){e&&t&&e.detachEvent("on".concat(t),n)};function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,i=arguments.length>4?arguments[4]:void 0,o=Math.abs(t-n),a=Math.ceil(o/r*50);function s(t,n,r){if(t!==n){var o=t+r>n?n:t+r;t>n&&(o=t-r<n?n:t-r),e===window?window.scrollTo(o,o):e.scrollTop=o,window.requestAnimationFrame((function(){return s(o,n,r)}))}else null==i||i()}s(t,n,a)}function Re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.entries(e).filter((function(e){return e[1]})).map((function(e){return e[0]})).join(" ").concat(t?" ".concat(t):"")}var je=Object.create({}),Pe=function(){},Ne=function(){return null},Ce=function(e){return Object.keys(e).length<1},De=function(e){return e.install=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.prefix,i=t.config.globalProperties.bkUIPrefix||r||"Bk";t.component(i+e.name,e)},e},Ue=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.install=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.prefix,a=r.config.globalProperties.bkUIPrefix||o||"Bk";r.component(a+e.name,e),!n&&Object.values(t).forEach((function(e){r.component(a+e.name,e)}))},Object.keys(t).forEach((function(n){e[n]=t[n]})),e};function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"bk";return"".concat(t,"-").concat(e)}function _e(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(){var o=this,a=arguments;if(e&&clearTimeout(e),i){var s=!e;e=setTimeout((function(){e=null}),n),s&&(t=r.apply(o,a))}else e=setTimeout((function(){r.apply(o,a)}),n);return t};return o.cancel=function(){clearTimeout(e),e=null},o}function He(e,t){return JSON.parse(JSON.stringify(e,(function(e,n){if(!t.includes(e))return n})))}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){if(Array.isArray(e[n]))return Ve(e[n],t[n]);if(e[n]!==t[n])return!1}return!0}})(),s})()));