bkui-vue 0.0.2-beta.75 → 0.0.2-beta.77

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 (170) hide show
  1. package/lib/affix/index.js +1 -319
  2. package/lib/alert/index.js +1 -215
  3. package/lib/animate-number/index.js +1 -155
  4. package/lib/backtop/index.js +1 -188
  5. package/lib/badge/index.js +1 -236
  6. package/lib/breadcrumb/index.js +1 -309
  7. package/lib/button/index.js +1 -321
  8. package/lib/card/index.js +1 -274
  9. package/lib/cascader/index.js +2 -2019
  10. package/lib/cascader/index.js.LICENSE.txt +1 -0
  11. package/lib/checkbox/index.js +1 -542
  12. package/lib/code-diff/index.js +1 -5501
  13. package/lib/collapse/index.js +1 -518
  14. package/lib/collapse-transition/index.js +1 -178
  15. package/lib/color-picker/index.js +1 -2662
  16. package/lib/components.js +1 -530
  17. package/lib/config-provider/index.js +1 -317
  18. package/lib/container/index.js +1 -343
  19. package/lib/date-picker/index.js +1 -5481
  20. package/lib/dialog/index.js +2 -1266
  21. package/lib/dialog/index.js.LICENSE.txt +1 -0
  22. package/lib/directives/index.js +2 -1335
  23. package/lib/directives/index.js.LICENSE.txt +14 -0
  24. package/lib/dist.index.js +1 -87
  25. package/lib/divider/index.js +1 -169
  26. package/lib/dropdown/index.js +1 -369
  27. package/lib/exception/index.js +1 -385
  28. package/lib/fixed-navbar/index.js +1 -154
  29. package/lib/form/index.js +1 -918
  30. package/lib/hooks.js +1 -73
  31. package/lib/icon/angle-double-down-line.js +1 -481
  32. package/lib/icon/angle-double-left-line.js +1 -481
  33. package/lib/icon/angle-double-left.js +1 -481
  34. package/lib/icon/angle-double-right-line.js +1 -481
  35. package/lib/icon/angle-double-right.js +1 -481
  36. package/lib/icon/angle-double-up-line.js +1 -481
  37. package/lib/icon/angle-down-fill.js +1 -481
  38. package/lib/icon/angle-down-line.js +1 -481
  39. package/lib/icon/angle-down.js +1 -481
  40. package/lib/icon/angle-left.js +1 -481
  41. package/lib/icon/angle-right.js +1 -481
  42. package/lib/icon/angle-up-fill.js +1 -481
  43. package/lib/icon/angle-up.js +1 -481
  44. package/lib/icon/archive-fill.js +1 -481
  45. package/lib/icon/arrows-left.js +1 -481
  46. package/lib/icon/arrows-right.js +1 -481
  47. package/lib/icon/assistant.js +1 -481
  48. package/lib/icon/audio-fill.js +1 -481
  49. package/lib/icon/bk.js +1 -481
  50. package/lib/icon/circle.js +1 -481
  51. package/lib/icon/close-line.js +1 -481
  52. package/lib/icon/close.js +1 -481
  53. package/lib/icon/code.js +1 -481
  54. package/lib/icon/cog-shape.js +1 -481
  55. package/lib/icon/collapse-left.js +1 -481
  56. package/lib/icon/copy-shape.js +1 -481
  57. package/lib/icon/copy.js +1 -481
  58. package/lib/icon/data-shape.js +1 -481
  59. package/lib/icon/del.js +1 -481
  60. package/lib/icon/doc-fill.js +1 -481
  61. package/lib/icon/done.js +1 -481
  62. package/lib/icon/down-shape.js +1 -481
  63. package/lib/icon/down-small.js +1 -481
  64. package/lib/icon/edit-line.js +1 -481
  65. package/lib/icon/ellipsis.js +1 -481
  66. package/lib/icon/enlarge-line.js +1 -481
  67. package/lib/icon/error.js +1 -481
  68. package/lib/icon/excel-fill.js +1 -481
  69. package/lib/icon/exclamation-circle-shape.js +1 -481
  70. package/lib/icon/eye.js +1 -481
  71. package/lib/icon/filliscreen-line.js +1 -481
  72. package/lib/icon/fix-line.js +1 -481
  73. package/lib/icon/fix-shape.js +1 -481
  74. package/lib/icon/folder-open.js +1 -481
  75. package/lib/icon/folder-shape-open.js +1 -481
  76. package/lib/icon/folder-shape.js +1 -481
  77. package/lib/icon/folder.js +1 -481
  78. package/lib/icon/funnel.js +1 -481
  79. package/lib/icon/help-document-fill.js +1 -481
  80. package/lib/icon/help-fill.js +1 -481
  81. package/lib/icon/help.js +1 -481
  82. package/lib/icon/image-fill.js +1 -527
  83. package/lib/icon/img-error.js +1 -527
  84. package/lib/icon/img-placehoulder.js +1 -527
  85. package/lib/icon/index.js +1 -2367
  86. package/lib/icon/info-line.js +1 -527
  87. package/lib/icon/info.js +1 -527
  88. package/lib/icon/left-shape.js +1 -527
  89. package/lib/icon/left-turn-line.js +1 -527
  90. package/lib/icon/narrow-line.js +1 -527
  91. package/lib/icon/original.js +1 -527
  92. package/lib/icon/pdf-fill.js +1 -527
  93. package/lib/icon/play-shape.js +1 -527
  94. package/lib/icon/plus.js +1 -527
  95. package/lib/icon/ppt-fill.js +1 -527
  96. package/lib/icon/qq.js +1 -527
  97. package/lib/icon/right-shape.js +1 -527
  98. package/lib/icon/right-turn-line.js +1 -527
  99. package/lib/icon/search.js +1 -527
  100. package/lib/icon/share.js +1 -527
  101. package/lib/icon/spinner.js +1 -527
  102. package/lib/icon/success.js +1 -527
  103. package/lib/icon/switcher-loading.js +1 -527
  104. package/lib/icon/text-file.js +1 -527
  105. package/lib/icon/text-fill.js +1 -527
  106. package/lib/icon/transfer.js +1 -527
  107. package/lib/icon/tree-application-shape.js +1 -527
  108. package/lib/icon/unfull-screen.js +1 -527
  109. package/lib/icon/unvisible.js +1 -527
  110. package/lib/icon/up-shape.js +1 -527
  111. package/lib/icon/upload.js +1 -527
  112. package/lib/icon/video-fill.js +1 -527
  113. package/lib/icon/warn.js +1 -527
  114. package/lib/icon/weixin-pro.js +1 -527
  115. package/lib/icon/weixin.js +1 -527
  116. package/lib/image/index.js +1 -593
  117. package/lib/index.js +1 -97
  118. package/lib/info-box/index.js +2 -1456
  119. package/lib/info-box/index.js.LICENSE.txt +1 -0
  120. package/lib/input/index.js +2 -1528
  121. package/lib/input/index.js.LICENSE.txt +1 -0
  122. package/lib/link/index.js +1 -160
  123. package/lib/loading/index.js +1 -379
  124. package/lib/locale/index.js +1 -465
  125. package/lib/menu/index.js +1 -725
  126. package/lib/message/index.js +2 -1790
  127. package/lib/message/index.js.LICENSE.txt +6 -0
  128. package/lib/modal/index.js +1 -337
  129. package/lib/navigation/index.js +1 -367
  130. package/lib/notify/index.js +1 -394
  131. package/lib/overflow-title/index.js +1 -485
  132. package/lib/pagination/index.js +1 -880
  133. package/lib/plugin-popover/index.js +1 -4067
  134. package/lib/plugins/index.js +1 -63
  135. package/lib/pop-confirm/index.js +1 -273
  136. package/lib/popover/index.js +1 -4075
  137. package/lib/popover2/index.js +1 -107
  138. package/lib/preset.js +1 -93
  139. package/lib/process/index.js +2 -1099
  140. package/lib/process/index.js.LICENSE.txt +1 -0
  141. package/lib/progress/index.js +1 -428
  142. package/lib/radio/index.js +1 -627
  143. package/lib/rate/index.js +1 -338
  144. package/lib/resize-layout/index.js +1 -430
  145. package/lib/search-select/index.js +2 -3036
  146. package/lib/search-select/index.js.LICENSE.txt +1 -0
  147. package/lib/select/index.js +2 -2571
  148. package/lib/select/index.js.LICENSE.txt +1 -0
  149. package/lib/shared/index.js +1 -2865
  150. package/lib/sideslider/index.js +2 -1005
  151. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  152. package/lib/slider/index.js +2 -1629
  153. package/lib/slider/index.js.LICENSE.txt +1 -0
  154. package/lib/steps/index.js +2 -1163
  155. package/lib/steps/index.js.LICENSE.txt +1 -0
  156. package/lib/swiper/index.js +1 -336
  157. package/lib/switcher/index.js +1 -277
  158. package/lib/tab/index.js +1 -859
  159. package/lib/table/index.js +1 -6568
  160. package/lib/table-column/index.js +1 -730
  161. package/lib/tag/index.js +1 -233
  162. package/lib/tag-input/index.js +1 -1652
  163. package/lib/time-picker/index.js +1 -71
  164. package/lib/timeline/index.js +1 -242
  165. package/lib/transfer/index.js +1 -673
  166. package/lib/tree/index.js +1 -2625
  167. package/lib/upload/index.js +2 -3193
  168. package/lib/upload/index.js.LICENSE.txt +1 -0
  169. package/lib/virtual-render/index.js +1 -748
  170. package/package.json +1 -1
@@ -1,4067 +1 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
2
- import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
3
- import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
4
- import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
5
- import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
6
- /******/ var __webpack_modules__ = ({
7
-
8
- /***/ 8022:
9
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10
-
11
- var v1 = __webpack_require__(4481);
12
- var v4 = __webpack_require__(6426);
13
-
14
- var uuid = v4;
15
- uuid.v1 = v1;
16
- uuid.v4 = v4;
17
-
18
- module.exports = uuid;
19
-
20
-
21
- /***/ }),
22
-
23
- /***/ 8725:
24
- /***/ ((module) => {
25
-
26
- /**
27
- * Convert array of 16 byte values to UUID string format of the form:
28
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
29
- */
30
- var byteToHex = [];
31
- for (var i = 0; i < 256; ++i) {
32
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
33
- }
34
-
35
- function bytesToUuid(buf, offset) {
36
- var i = offset || 0;
37
- var bth = byteToHex;
38
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
39
- return ([
40
- bth[buf[i++]], bth[buf[i++]],
41
- bth[buf[i++]], bth[buf[i++]], '-',
42
- bth[buf[i++]], bth[buf[i++]], '-',
43
- bth[buf[i++]], bth[buf[i++]], '-',
44
- bth[buf[i++]], bth[buf[i++]], '-',
45
- bth[buf[i++]], bth[buf[i++]],
46
- bth[buf[i++]], bth[buf[i++]],
47
- bth[buf[i++]], bth[buf[i++]]
48
- ]).join('');
49
- }
50
-
51
- module.exports = bytesToUuid;
52
-
53
-
54
- /***/ }),
55
-
56
- /***/ 9157:
57
- /***/ ((module) => {
58
-
59
- // Unique ID creation requires a high quality random # generator. In the
60
- // browser this is a little complicated due to unknown quality of Math.random()
61
- // and inconsistent support for the `crypto` API. We do the best we can via
62
- // feature-detection
63
-
64
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
65
- // implementation. Also, find the complete implementation of crypto on IE11.
66
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
67
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
68
-
69
- if (getRandomValues) {
70
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
71
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
72
-
73
- module.exports = function whatwgRNG() {
74
- getRandomValues(rnds8);
75
- return rnds8;
76
- };
77
- } else {
78
- // Math.random()-based (RNG)
79
- //
80
- // If all else fails, use Math.random(). It's fast, but is of unspecified
81
- // quality.
82
- var rnds = new Array(16);
83
-
84
- module.exports = function mathRNG() {
85
- for (var i = 0, r; i < 16; i++) {
86
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
87
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
88
- }
89
-
90
- return rnds;
91
- };
92
- }
93
-
94
-
95
- /***/ }),
96
-
97
- /***/ 4481:
98
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
99
-
100
- var rng = __webpack_require__(9157);
101
- var bytesToUuid = __webpack_require__(8725);
102
-
103
- // **`v1()` - Generate time-based UUID**
104
- //
105
- // Inspired by https://github.com/LiosK/UUID.js
106
- // and http://docs.python.org/library/uuid.html
107
-
108
- var _nodeId;
109
- var _clockseq;
110
-
111
- // Previous uuid creation time
112
- var _lastMSecs = 0;
113
- var _lastNSecs = 0;
114
-
115
- // See https://github.com/uuidjs/uuid for API details
116
- function v1(options, buf, offset) {
117
- var i = buf && offset || 0;
118
- var b = buf || [];
119
-
120
- options = options || {};
121
- var node = options.node || _nodeId;
122
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
123
-
124
- // node and clockseq need to be initialized to random values if they're not
125
- // specified. We do this lazily to minimize issues related to insufficient
126
- // system entropy. See #189
127
- if (node == null || clockseq == null) {
128
- var seedBytes = rng();
129
- if (node == null) {
130
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
131
- node = _nodeId = [
132
- seedBytes[0] | 0x01,
133
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
134
- ];
135
- }
136
- if (clockseq == null) {
137
- // Per 4.2.2, randomize (14 bit) clockseq
138
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
139
- }
140
- }
141
-
142
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
143
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
144
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
145
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
146
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
147
-
148
- // Per 4.2.1.2, use count of uuid's generated during the current clock
149
- // cycle to simulate higher resolution clock
150
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
151
-
152
- // Time since last uuid creation (in msecs)
153
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
154
-
155
- // Per 4.2.1.2, Bump clockseq on clock regression
156
- if (dt < 0 && options.clockseq === undefined) {
157
- clockseq = clockseq + 1 & 0x3fff;
158
- }
159
-
160
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
161
- // time interval
162
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
163
- nsecs = 0;
164
- }
165
-
166
- // Per 4.2.1.2 Throw error if too many uuids are requested
167
- if (nsecs >= 10000) {
168
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
169
- }
170
-
171
- _lastMSecs = msecs;
172
- _lastNSecs = nsecs;
173
- _clockseq = clockseq;
174
-
175
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
176
- msecs += 12219292800000;
177
-
178
- // `time_low`
179
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
180
- b[i++] = tl >>> 24 & 0xff;
181
- b[i++] = tl >>> 16 & 0xff;
182
- b[i++] = tl >>> 8 & 0xff;
183
- b[i++] = tl & 0xff;
184
-
185
- // `time_mid`
186
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
187
- b[i++] = tmh >>> 8 & 0xff;
188
- b[i++] = tmh & 0xff;
189
-
190
- // `time_high_and_version`
191
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
192
- b[i++] = tmh >>> 16 & 0xff;
193
-
194
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
195
- b[i++] = clockseq >>> 8 | 0x80;
196
-
197
- // `clock_seq_low`
198
- b[i++] = clockseq & 0xff;
199
-
200
- // `node`
201
- for (var n = 0; n < 6; ++n) {
202
- b[i + n] = node[n];
203
- }
204
-
205
- return buf ? buf : bytesToUuid(b);
206
- }
207
-
208
- module.exports = v1;
209
-
210
-
211
- /***/ }),
212
-
213
- /***/ 6426:
214
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
215
-
216
- var rng = __webpack_require__(9157);
217
- var bytesToUuid = __webpack_require__(8725);
218
-
219
- function v4(options, buf, offset) {
220
- var i = buf && offset || 0;
221
-
222
- if (typeof(options) == 'string') {
223
- buf = options === 'binary' ? new Array(16) : null;
224
- options = null;
225
- }
226
- options = options || {};
227
-
228
- var rnds = options.random || (options.rng || rng)();
229
-
230
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
231
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
232
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
233
-
234
- // Copy bytes to buffer, if provided
235
- if (buf) {
236
- for (var ii = 0; ii < 16; ++ii) {
237
- buf[i + ii] = rnds[ii];
238
- }
239
- }
240
-
241
- return buf || bytesToUuid(rnds);
242
- }
243
-
244
- module.exports = v4;
245
-
246
-
247
- /***/ })
248
-
249
- /******/ });
250
- /************************************************************************/
251
- /******/ // The module cache
252
- /******/ var __webpack_module_cache__ = {};
253
- /******/
254
- /******/ // The require function
255
- /******/ function __webpack_require__(moduleId) {
256
- /******/ // Check if module is in cache
257
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
258
- /******/ if (cachedModule !== undefined) {
259
- /******/ return cachedModule.exports;
260
- /******/ }
261
- /******/ // Create a new module (and put it into the cache)
262
- /******/ var module = __webpack_module_cache__[moduleId] = {
263
- /******/ // no module.id needed
264
- /******/ // no module.loaded needed
265
- /******/ exports: {}
266
- /******/ };
267
- /******/
268
- /******/ // Execute the module function
269
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
270
- /******/
271
- /******/ // Return the exports of the module
272
- /******/ return module.exports;
273
- /******/ }
274
- /******/
275
- /************************************************************************/
276
- /******/ /* webpack/runtime/define property getters */
277
- /******/ (() => {
278
- /******/ // define getter functions for harmony exports
279
- /******/ __webpack_require__.d = (exports, definition) => {
280
- /******/ for(var key in definition) {
281
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
282
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
283
- /******/ }
284
- /******/ }
285
- /******/ };
286
- /******/ })();
287
- /******/
288
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
289
- /******/ (() => {
290
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
291
- /******/ })();
292
- /******/
293
- /************************************************************************/
294
- var __webpack_exports__ = {};
295
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
296
- (() => {
297
-
298
- // EXPORTS
299
- __webpack_require__.d(__webpack_exports__, {
300
- Z: () => (/* binding */ src)
301
- });
302
-
303
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
304
- function _typeof(obj) {
305
- "@babel/helpers - typeof";
306
-
307
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
308
- return typeof obj;
309
- } : function (obj) {
310
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
311
- }, _typeof(obj);
312
- }
313
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
314
-
315
- function _toPrimitive(input, hint) {
316
- if (_typeof(input) !== "object" || input === null) return input;
317
- var prim = input[Symbol.toPrimitive];
318
- if (prim !== undefined) {
319
- var res = prim.call(input, hint || "default");
320
- if (_typeof(res) !== "object") return res;
321
- throw new TypeError("@@toPrimitive must return a primitive value.");
322
- }
323
- return (hint === "string" ? String : Number)(input);
324
- }
325
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
326
-
327
-
328
- function _toPropertyKey(arg) {
329
- var key = _toPrimitive(arg, "string");
330
- return _typeof(key) === "symbol" ? key : String(key);
331
- }
332
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
333
-
334
- function _defineProperty(obj, key, value) {
335
- key = _toPropertyKey(key);
336
- if (key in obj) {
337
- Object.defineProperty(obj, key, {
338
- value: value,
339
- enumerable: true,
340
- configurable: true,
341
- writable: true
342
- });
343
- } else {
344
- obj[key] = value;
345
- }
346
- return obj;
347
- }
348
- ;// CONCATENATED MODULE: external "vue"
349
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
350
- var y = x => () => x
351
- const external_vue_namespaceObject = x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Text"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Text, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
352
- ;// CONCATENATED MODULE: external "../shared"
353
- var external_shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
354
- var external_shared_y = x => () => x
355
- const external_shared_namespaceObject = external_shared_x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PlacementEnum, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.RenderType, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.bkZIndexManager, ["placementType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.placementType, ["renderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.renderType, ["triggerType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.triggerType });
356
- ;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
357
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
358
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
359
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
360
- /*
361
- * Tencent is pleased to support the open source community by making
362
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
363
- *
364
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
365
- *
366
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
367
- *
368
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
369
- *
370
- * ---------------------------------------------------
371
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
372
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
373
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
374
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
375
- *
376
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
377
- * the Software.
378
- *
379
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
380
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
381
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
382
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
383
- * IN THE SOFTWARE.
384
- */
385
- var isElement = function isElement(e) {
386
- if (typeof Element === 'undefined') return false;
387
- return e instanceof Element;
388
- };
389
- var nodeList = new Map();
390
- var startClick;
391
- document.addEventListener('mousedown', function (e) {
392
- return startClick = e;
393
- });
394
- document.addEventListener('mouseup', function (e) {
395
- var _iterator = _createForOfIteratorHelper(nodeList.values()),
396
- _step;
397
- try {
398
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
399
- var handlers = _step.value;
400
- var _iterator2 = _createForOfIteratorHelper(handlers),
401
- _step2;
402
- try {
403
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
404
- var documentHandler = _step2.value.documentHandler;
405
- documentHandler(e, startClick);
406
- }
407
- } catch (err) {
408
- _iterator2.e(err);
409
- } finally {
410
- _iterator2.f();
411
- }
412
- }
413
- } catch (err) {
414
- _iterator.e(err);
415
- } finally {
416
- _iterator.f();
417
- }
418
- });
419
- function createDocumentHandler(el, binding) {
420
- var excludes = [];
421
- if (Array.isArray(binding.arg)) {
422
- excludes = binding.arg;
423
- } else if (isElement(binding.arg)) {
424
- excludes.push(binding.arg);
425
- }
426
- return function (mouseup, mousedown) {
427
- var popperRef = binding.instance.popperRef;
428
- var mouseUpTarget = mouseup.target;
429
- var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
430
- var isBound = !binding || !binding.instance;
431
- var isTargetExists = !mouseUpTarget || !mouseDownTarget;
432
- var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
433
- var isSelf = el === mouseUpTarget;
434
- var isTargetExcluded = excludes.length && excludes.some(function (item) {
435
- return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
436
- }) || excludes.length && excludes.includes(mouseDownTarget);
437
- var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
438
- if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
439
- return;
440
- }
441
- binding.value(mouseup, mousedown);
442
- };
443
- }
444
- var ClickOutside = {
445
- beforeMount: function beforeMount(el, binding) {
446
- if (!nodeList.has(el)) {
447
- nodeList.set(el, []);
448
- }
449
- nodeList.get(el).push({
450
- documentHandler: createDocumentHandler(el, binding),
451
- bindingFn: binding.value
452
- });
453
- },
454
- updated: function updated(el, binding) {
455
- if (!nodeList.has(el)) {
456
- nodeList.set(el, []);
457
- }
458
- var handlers = nodeList.get(el);
459
- var oldHandlerIndex = handlers.findIndex(function (item) {
460
- return item.bindingFn === binding.oldValue;
461
- });
462
- var newHandler = {
463
- documentHandler: createDocumentHandler(el, binding),
464
- bindingFn: binding.value
465
- };
466
- if (oldHandlerIndex >= 0) {
467
- // replace the old handler to the new handler
468
- handlers.splice(oldHandlerIndex, 1, newHandler);
469
- } else {
470
- handlers.push(newHandler);
471
- }
472
- },
473
- unmounted: function unmounted(el) {
474
- // remove all listeners when a component unmounted
475
- nodeList["delete"](el);
476
- }
477
- };
478
- ClickOutside.install = function (app) {
479
- app.directive('bkTooltips', ClickOutside);
480
- };
481
- /* harmony default export */ const clickoutside = (ClickOutside);
482
- ;// CONCATENATED MODULE: external "../config-provider"
483
- var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
484
- var external_config_provider_y = x => () => x
485
- const external_config_provider_namespaceObject = external_config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
486
- ;// CONCATENATED MODULE: ../../packages/popover/src/arrow.tsx
487
-
488
- /*
489
- * Tencent is pleased to support the open source community by making
490
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
491
- *
492
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
493
- *
494
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
495
- *
496
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
497
- *
498
- * ---------------------------------------------------
499
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
500
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
501
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
502
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
503
- *
504
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
505
- * the Software.
506
- *
507
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
508
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
509
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
510
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
511
- * IN THE SOFTWARE.
512
- */
513
-
514
-
515
- /* harmony default export */ const src_arrow = ((0,external_vue_namespaceObject.defineComponent)({
516
- name: 'PopArrow',
517
- render: function render() {
518
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
519
- resolveClassName = _usePrefix.resolveClassName;
520
- var arrowClassName = resolveClassName('pop2-arrow');
521
- return (0,external_vue_namespaceObject.createVNode)("div", {
522
- "class": arrowClassName
523
- }, null);
524
- }
525
- }));
526
- ;// CONCATENATED MODULE: ../../packages/popover/src/const.tsx
527
-
528
- var _EMIT_EVENT_TYPES;
529
- /* eslint-disable @typescript-eslint/naming-convention */
530
- /*
531
- * Tencent is pleased to support the open source community by making
532
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
533
- *
534
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
535
- *
536
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
537
- *
538
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
539
- *
540
- * ---------------------------------------------------
541
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
542
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
543
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
544
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
545
- *
546
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
547
- * the Software.
548
- *
549
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
550
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
551
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
552
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
553
- * IN THE SOFTWARE.
554
- */
555
- // eslint-disable-next-line @typescript-eslint/naming-convention
556
- var EMIT_EVENTS;
557
- (function (EMIT_EVENTS) {
558
- EMIT_EVENTS["CLICK_OUTSIDE"] = "clickoutside";
559
- EMIT_EVENTS["CONTENT_MOUSEENTER"] = "contentMouseenter";
560
- EMIT_EVENTS["CONTENT_MOUSELEAVE"] = "contentMouseleave";
561
- EMIT_EVENTS["CONTENT_AfterHidden"] = "afterHidden";
562
- EMIT_EVENTS["CONTENT_AfterShow"] = "afterShow";
563
- })(EMIT_EVENTS || (EMIT_EVENTS = {}));
564
- var EVENT_SHOW_HIDE_FN = function EVENT_SHOW_HIDE_FN(_args) {
565
- return true;
566
- };
567
- var EVENT_COMMON_FN = function EVENT_COMMON_FN(e) {
568
- return e;
569
- };
570
- var EVENT_CLICK_OUTSIDE_FN = function EVENT_CLICK_OUTSIDE_FN(_args) {
571
- return true;
572
- };
573
- var EMIT_EVENT_TYPES = (_EMIT_EVENT_TYPES = {}, _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CLICK_OUTSIDE, EVENT_CLICK_OUTSIDE_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_MOUSEENTER, EVENT_COMMON_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_MOUSELEAVE, EVENT_COMMON_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_AfterHidden, EVENT_SHOW_HIDE_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_AfterShow, EVENT_SHOW_HIDE_FN), _EMIT_EVENT_TYPES);
574
- ;// CONCATENATED MODULE: ../../packages/popover/src/content.tsx
575
-
576
- /*
577
- * Tencent is pleased to support the open source community by making
578
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
579
- *
580
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
581
- *
582
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
583
- *
584
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
585
- *
586
- * ---------------------------------------------------
587
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
588
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
589
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
590
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
591
- *
592
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
593
- * the Software.
594
- *
595
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
596
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
597
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
598
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
599
- * IN THE SOFTWARE.
600
- */
601
-
602
-
603
-
604
- /* harmony default export */ const content = ((0,external_vue_namespaceObject.defineComponent)({
605
- name: 'PopContent',
606
- props: {
607
- width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
608
- height: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
609
- maxHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
610
- maxWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
611
- extCls: external_shared_namespaceObject.PropTypes.string.def(''),
612
- visible: external_shared_namespaceObject.PropTypes.bool.def(false),
613
- eventDelay: external_shared_namespaceObject.PropTypes.number.def(0)
614
- },
615
- setup: function setup(props) {
616
- var resolveValToPix = function resolveValToPix(val) {
617
- if (/^\d+\.?\d*$/.test("".concat(val))) {
618
- return "".concat(val, "px");
619
- }
620
- return val;
621
- };
622
- var style = (0,external_vue_namespaceObject.computed)(function () {
623
- return {
624
- width: resolveValToPix(props.width),
625
- height: resolveValToPix(props.height),
626
- maxHeight: resolveValToPix(props.maxHeight),
627
- maxWidth: resolveValToPix(props.maxWidth)
628
- };
629
- });
630
- var refContent = (0,external_vue_namespaceObject.ref)(null);
631
- var refTimer = (0,external_vue_namespaceObject.ref)(null);
632
- var resetPointerEvent = function resetPointerEvent() {
633
- var _a;
634
- if (props.eventDelay === 0) {
635
- return;
636
- }
637
- refTimer.value && clearTimeout(refTimer.value);
638
- refTimer.value = setTimeout(function () {
639
- setContentPointerEvent('unset');
640
- }, (_a = props.eventDelay) !== null && _a !== void 0 ? _a : 300);
641
- };
642
- var setContentPointerEvent = function setContentPointerEvent(val) {
643
- var _a;
644
- if (props.eventDelay === 0) {
645
- return;
646
- }
647
- (_a = refContent.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('pointer-events', val);
648
- };
649
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
650
- resolveClassName = _usePrefix.resolveClassName;
651
- return {
652
- style: style,
653
- refContent: refContent,
654
- resolveClassName: resolveClassName,
655
- resetPointerEvent: resetPointerEvent,
656
- setContentPointerEvent: setContentPointerEvent
657
- };
658
- },
659
- render: function render() {
660
- var _this = this;
661
- var _a, _b, _c, _d, _e, _f, _g, _h;
662
- var className = [this.resolveClassName('popover'), this.resolveClassName('pop2-content'), this.extCls];
663
- var resolveContentStyle = function resolveContentStyle(slot) {
664
- var _a;
665
- if (external_vue_namespaceObject.Fragment === ((_a = slot === null || slot === void 0 ? void 0 : slot[0]) === null || _a === void 0 ? void 0 : _a.type)) {
666
- (0,external_vue_namespaceObject.nextTick)(function () {
667
- _this.setContentPointerEvent('none');
668
- _this.resetPointerEvent();
669
- });
670
- }
671
- return _this.style;
672
- };
673
- var style = resolveContentStyle((_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a));
674
- return (0,external_vue_namespaceObject.createVNode)("div", {
675
- "class": className,
676
- "style": style,
677
- "ref": "refContent"
678
- }, [(_e = (_d = (_c = this.$slots).arrow) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : '', (_h = (_g = (_f = this.$slots)["default"]) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : '']);
679
- }
680
- }));
681
- ;// CONCATENATED MODULE: external "vue-types"
682
- var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
683
- var external_vue_types_y = x => () => x
684
- const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
685
- ;// CONCATENATED MODULE: ../../packages/popover/src/props.ts
686
-
687
-
688
- var EventProps = {
689
- onAfterHidden: function onAfterHidden() {},
690
- onAfterShow: function onAfterShow() {}
691
- };
692
- var PopoverProps = {
693
- isShow: external_shared_namespaceObject.PropTypes.bool.def(false),
694
- always: external_shared_namespaceObject.PropTypes.bool.def(false),
695
- disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
696
- width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
697
- height: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
698
- maxWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
699
- maxHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
700
- content: (0,external_vue_types_namespaceObject.toType)('IContent', {}).def(''),
701
- target: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.instanceOf(HTMLElement), external_shared_namespaceObject.PropTypes.instanceOf(PointerEvent)]),
702
- allowHtml: external_shared_namespaceObject.PropTypes.bool.def(false),
703
- /**
704
- * 组件显示位置
705
- */
706
- // placement: placementType().def(PlacementEnum.TOP),
707
- placement: (0,external_shared_namespaceObject.placementType)().def(external_shared_namespaceObject.PlacementEnum.TOP_START),
708
- // 'dark', 'light'
709
- theme: external_shared_namespaceObject.PropTypes.string.def('dark'),
710
- /**
711
- * 触发方式
712
- * 支持 click hover manual
713
- * manual: 通过isShow控制显示、隐藏
714
- */
715
- // trigger: triggerType(),
716
- trigger: (0,external_shared_namespaceObject.triggerType)(),
717
- /**
718
- * content 渲染方式
719
- */
720
- renderType: (0,external_shared_namespaceObject.renderType)(),
721
- // 是否显示箭头
722
- arrow: external_shared_namespaceObject.PropTypes.bool.def(true),
723
- padding: external_shared_namespaceObject.PropTypes.number.def(5),
724
- offset: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.shape({
725
- mainAxis: external_shared_namespaceObject.PropTypes.number,
726
- crossAxis: external_shared_namespaceObject.PropTypes.number,
727
- alignmentAxis: external_shared_namespaceObject.PropTypes.number
728
- })]).def(6),
729
- /**
730
- * 弹出内容绑定元素
731
- */
732
- boundary: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string.def('parent'), external_shared_namespaceObject.PropTypes.instanceOf(HTMLElement)]),
733
- zIndex: external_shared_namespaceObject.PropTypes.number.def(undefined),
734
- disableTeleport: external_shared_namespaceObject.PropTypes.bool.def(false),
735
- /**
736
- * chooses the placement that has the most space available automatically
737
- */
738
- autoPlacement: external_shared_namespaceObject.PropTypes.bool.def(false),
739
- /**
740
- * 当有滚动条,滚动出可是范围时自动隐藏pop
741
- */
742
- autoVisibility: external_shared_namespaceObject.PropTypes.bool.def(true),
743
- /**
744
- * 是否禁用clickoutside
745
- */
746
- disableOutsideClick: external_shared_namespaceObject.PropTypes.bool.def(false),
747
- /**
748
- * 是否禁用样式的transform更新位移
749
- */
750
- disableTransform: external_shared_namespaceObject.PropTypes.bool.def(false),
751
- /**
752
- * 自定义 reference
753
- */
754
- reference: external_shared_namespaceObject.PropTypes.any,
755
- /**
756
- * 兼容v1版本遗留配置
757
- * 不建议使用
758
- */
759
- modifiers: external_shared_namespaceObject.PropTypes.array.def([]),
760
- /**
761
- * popover显示和隐藏的延时时间
762
- */
763
- popoverDelay: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.number)]).def(100),
764
- /**
765
- * 配置自定义样式类名,传入的类会被加在组件最外层的 DOM
766
- */
767
- extCls: external_shared_namespaceObject.PropTypes.string.def(''),
768
- /**
769
- * 自定义Content组件渲染,point-event延迟渲染时间
770
- * 避免子组件point-event渲染时触发popover鼠标事件
771
- * 如果设置为0,则不启用此设置
772
- */
773
- componentEventDelay: external_shared_namespaceObject.PropTypes.number.def(0),
774
- /**
775
- * 或略其他判定条件,强制监听clickoutside & 执行hide
776
- */
777
- forceClickoutside: external_shared_namespaceObject.PropTypes.bool.def(false)
778
- };
779
- ;// CONCATENATED MODULE: ../../packages/popover/src/reference.tsx
780
- /*
781
- * Tencent is pleased to support the open source community by making
782
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
783
- *
784
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
785
- *
786
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
787
- *
788
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
789
- *
790
- * ---------------------------------------------------
791
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
792
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
793
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
794
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
795
- *
796
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
797
- * the Software.
798
- *
799
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
800
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
801
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
802
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
803
- * IN THE SOFTWARE.
804
- */
805
-
806
- /* harmony default export */ const reference = ((0,external_vue_namespaceObject.defineComponent)({
807
- name: 'PopReference',
808
- render: function render() {
809
- var _a, _b, _c;
810
- return (_c = (_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '';
811
- }
812
- }));
813
- ;// CONCATENATED MODULE: ../../packages/popover/src/root.tsx
814
-
815
- /*
816
- * Tencent is pleased to support the open source community by making
817
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
818
- *
819
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
820
- *
821
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
822
- *
823
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
824
- *
825
- * ---------------------------------------------------
826
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
827
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
828
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
829
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
830
- *
831
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
832
- * the Software.
833
- *
834
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
835
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
836
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
837
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
838
- * IN THE SOFTWARE.
839
- */
840
-
841
-
842
- /* harmony default export */ const root = ((0,external_vue_namespaceObject.defineComponent)({
843
- props: {
844
- "class": external_shared_namespaceObject.PropTypes.string.def(''),
845
- mode: external_shared_namespaceObject.PropTypes.string.def('')
846
- },
847
- render: function render() {
848
- var _a, _b;
849
- return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)]);
850
- }
851
- }));
852
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
853
- function _arrayWithHoles(arr) {
854
- if (Array.isArray(arr)) return arr;
855
- }
856
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
857
- function _iterableToArrayLimit(arr, i) {
858
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
859
- if (null != _i) {
860
- var _s,
861
- _e,
862
- _x,
863
- _r,
864
- _arr = [],
865
- _n = !0,
866
- _d = !1;
867
- try {
868
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
869
- if (Object(_i) !== _i) return;
870
- _n = !1;
871
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
872
- } catch (err) {
873
- _d = !0, _e = err;
874
- } finally {
875
- try {
876
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
877
- } finally {
878
- if (_d) throw _e;
879
- }
880
- }
881
- return _arr;
882
- }
883
- }
884
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
885
- function arrayLikeToArray_arrayLikeToArray(arr, len) {
886
- if (len == null || len > arr.length) len = arr.length;
887
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
888
- return arr2;
889
- }
890
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
891
-
892
- function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
893
- if (!o) return;
894
- if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
895
- var n = Object.prototype.toString.call(o).slice(8, -1);
896
- if (n === "Object" && o.constructor) n = o.constructor.name;
897
- if (n === "Map" || n === "Set") return Array.from(o);
898
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
899
- }
900
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
901
- function _nonIterableRest() {
902
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
903
- }
904
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
905
-
906
-
907
-
908
-
909
- function _slicedToArray(arr, i) {
910
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || _nonIterableRest();
911
- }
912
- ;// CONCATENATED MODULE: external "lodash"
913
- var external_lodash_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
914
- var external_lodash_y = x => () => x
915
- const external_lodash_namespaceObject = external_lodash_x({ ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE_lodash__.isElement });
916
- ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
917
- const sides = ['top', 'right', 'bottom', 'left'];
918
- const alignments = ['start', 'end'];
919
- const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
920
- const floating_ui_utils_min = Math.min;
921
- const floating_ui_utils_max = Math.max;
922
- const round = Math.round;
923
- const floor = Math.floor;
924
- const createCoords = v => ({
925
- x: v,
926
- y: v
927
- });
928
- const oppositeSideMap = {
929
- left: 'right',
930
- right: 'left',
931
- bottom: 'top',
932
- top: 'bottom'
933
- };
934
- const oppositeAlignmentMap = {
935
- start: 'end',
936
- end: 'start'
937
- };
938
- function clamp(start, value, end) {
939
- return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
940
- }
941
- function floating_ui_utils_evaluate(value, param) {
942
- return typeof value === 'function' ? value(param) : value;
943
- }
944
- function floating_ui_utils_getSide(placement) {
945
- return placement.split('-')[0];
946
- }
947
- function floating_ui_utils_getAlignment(placement) {
948
- return placement.split('-')[1];
949
- }
950
- function floating_ui_utils_getOppositeAxis(axis) {
951
- return axis === 'x' ? 'y' : 'x';
952
- }
953
- function getAxisLength(axis) {
954
- return axis === 'y' ? 'height' : 'width';
955
- }
956
- function floating_ui_utils_getSideAxis(placement) {
957
- return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x';
958
- }
959
- function getAlignmentAxis(placement) {
960
- return floating_ui_utils_getOppositeAxis(floating_ui_utils_getSideAxis(placement));
961
- }
962
- function getAlignmentSides(placement, rects, rtl) {
963
- if (rtl === void 0) {
964
- rtl = false;
965
- }
966
- const alignment = floating_ui_utils_getAlignment(placement);
967
- const alignmentAxis = getAlignmentAxis(placement);
968
- const length = getAxisLength(alignmentAxis);
969
- let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
970
- if (rects.reference[length] > rects.floating[length]) {
971
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
972
- }
973
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
974
- }
975
- function getExpandedPlacements(placement) {
976
- const oppositePlacement = getOppositePlacement(placement);
977
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
978
- }
979
- function getOppositeAlignmentPlacement(placement) {
980
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
981
- }
982
- function getSideList(side, isStart, rtl) {
983
- const lr = ['left', 'right'];
984
- const rl = ['right', 'left'];
985
- const tb = ['top', 'bottom'];
986
- const bt = ['bottom', 'top'];
987
- switch (side) {
988
- case 'top':
989
- case 'bottom':
990
- if (rtl) return isStart ? rl : lr;
991
- return isStart ? lr : rl;
992
- case 'left':
993
- case 'right':
994
- return isStart ? tb : bt;
995
- default:
996
- return [];
997
- }
998
- }
999
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
1000
- const alignment = floating_ui_utils_getAlignment(placement);
1001
- let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl);
1002
- if (alignment) {
1003
- list = list.map(side => side + "-" + alignment);
1004
- if (flipAlignment) {
1005
- list = list.concat(list.map(getOppositeAlignmentPlacement));
1006
- }
1007
- }
1008
- return list;
1009
- }
1010
- function getOppositePlacement(placement) {
1011
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
1012
- }
1013
- function expandPaddingObject(padding) {
1014
- return {
1015
- top: 0,
1016
- right: 0,
1017
- bottom: 0,
1018
- left: 0,
1019
- ...padding
1020
- };
1021
- }
1022
- function getPaddingObject(padding) {
1023
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
1024
- top: padding,
1025
- right: padding,
1026
- bottom: padding,
1027
- left: padding
1028
- };
1029
- }
1030
- function rectToClientRect(rect) {
1031
- return {
1032
- ...rect,
1033
- top: rect.y,
1034
- left: rect.x,
1035
- right: rect.x + rect.width,
1036
- bottom: rect.y + rect.height
1037
- };
1038
- }
1039
-
1040
-
1041
-
1042
- ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1043
-
1044
-
1045
-
1046
- function computeCoordsFromPlacement(_ref, placement, rtl) {
1047
- let {
1048
- reference,
1049
- floating
1050
- } = _ref;
1051
- const sideAxis = floating_ui_utils_getSideAxis(placement);
1052
- const alignmentAxis = getAlignmentAxis(placement);
1053
- const alignLength = getAxisLength(alignmentAxis);
1054
- const side = floating_ui_utils_getSide(placement);
1055
- const isVertical = sideAxis === 'y';
1056
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
1057
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
1058
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1059
- let coords;
1060
- switch (side) {
1061
- case 'top':
1062
- coords = {
1063
- x: commonX,
1064
- y: reference.y - floating.height
1065
- };
1066
- break;
1067
- case 'bottom':
1068
- coords = {
1069
- x: commonX,
1070
- y: reference.y + reference.height
1071
- };
1072
- break;
1073
- case 'right':
1074
- coords = {
1075
- x: reference.x + reference.width,
1076
- y: commonY
1077
- };
1078
- break;
1079
- case 'left':
1080
- coords = {
1081
- x: reference.x - floating.width,
1082
- y: commonY
1083
- };
1084
- break;
1085
- default:
1086
- coords = {
1087
- x: reference.x,
1088
- y: reference.y
1089
- };
1090
- }
1091
- switch (floating_ui_utils_getAlignment(placement)) {
1092
- case 'start':
1093
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1094
- break;
1095
- case 'end':
1096
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1097
- break;
1098
- }
1099
- return coords;
1100
- }
1101
-
1102
- /**
1103
- * Computes the `x` and `y` coordinates that will place the floating element
1104
- * next to a reference element when it is given a certain positioning strategy.
1105
- *
1106
- * This export does not have any `platform` interface logic. You will need to
1107
- * write one for the platform you are using Floating UI with.
1108
- */
1109
- const computePosition = async (reference, floating, config) => {
1110
- const {
1111
- placement = 'bottom',
1112
- strategy = 'absolute',
1113
- middleware = [],
1114
- platform
1115
- } = config;
1116
- const validMiddleware = middleware.filter(Boolean);
1117
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
1118
- let rects = await platform.getElementRects({
1119
- reference,
1120
- floating,
1121
- strategy
1122
- });
1123
- let {
1124
- x,
1125
- y
1126
- } = computeCoordsFromPlacement(rects, placement, rtl);
1127
- let statefulPlacement = placement;
1128
- let middlewareData = {};
1129
- let resetCount = 0;
1130
- for (let i = 0; i < validMiddleware.length; i++) {
1131
- const {
1132
- name,
1133
- fn
1134
- } = validMiddleware[i];
1135
- const {
1136
- x: nextX,
1137
- y: nextY,
1138
- data,
1139
- reset
1140
- } = await fn({
1141
- x,
1142
- y,
1143
- initialPlacement: placement,
1144
- placement: statefulPlacement,
1145
- strategy,
1146
- middlewareData,
1147
- rects,
1148
- platform,
1149
- elements: {
1150
- reference,
1151
- floating
1152
- }
1153
- });
1154
- x = nextX != null ? nextX : x;
1155
- y = nextY != null ? nextY : y;
1156
- middlewareData = {
1157
- ...middlewareData,
1158
- [name]: {
1159
- ...middlewareData[name],
1160
- ...data
1161
- }
1162
- };
1163
- if (reset && resetCount <= 50) {
1164
- resetCount++;
1165
- if (typeof reset === 'object') {
1166
- if (reset.placement) {
1167
- statefulPlacement = reset.placement;
1168
- }
1169
- if (reset.rects) {
1170
- rects = reset.rects === true ? await platform.getElementRects({
1171
- reference,
1172
- floating,
1173
- strategy
1174
- }) : reset.rects;
1175
- }
1176
- ({
1177
- x,
1178
- y
1179
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1180
- }
1181
- i = -1;
1182
- continue;
1183
- }
1184
- }
1185
- return {
1186
- x,
1187
- y,
1188
- placement: statefulPlacement,
1189
- strategy,
1190
- middlewareData
1191
- };
1192
- };
1193
-
1194
- /**
1195
- * Resolves with an object of overflow side offsets that determine how much the
1196
- * element is overflowing a given clipping boundary on each side.
1197
- * - positive = overflowing the boundary by that number of pixels
1198
- * - negative = how many pixels left before it will overflow
1199
- * - 0 = lies flush with the boundary
1200
- * @see https://floating-ui.com/docs/detectOverflow
1201
- */
1202
- async function detectOverflow(state, options) {
1203
- var _await$platform$isEle;
1204
- if (options === void 0) {
1205
- options = {};
1206
- }
1207
- const {
1208
- x,
1209
- y,
1210
- platform,
1211
- rects,
1212
- elements,
1213
- strategy
1214
- } = state;
1215
- const {
1216
- boundary = 'clippingAncestors',
1217
- rootBoundary = 'viewport',
1218
- elementContext = 'floating',
1219
- altBoundary = false,
1220
- padding = 0
1221
- } = floating_ui_utils_evaluate(options, state);
1222
- const paddingObject = getPaddingObject(padding);
1223
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
1224
- const element = elements[altBoundary ? altContext : elementContext];
1225
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
1226
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
1227
- boundary,
1228
- rootBoundary,
1229
- strategy
1230
- }));
1231
- const rect = elementContext === 'floating' ? {
1232
- ...rects.floating,
1233
- x,
1234
- y
1235
- } : rects.reference;
1236
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
1237
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
1238
- x: 1,
1239
- y: 1
1240
- } : {
1241
- x: 1,
1242
- y: 1
1243
- };
1244
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1245
- rect,
1246
- offsetParent,
1247
- strategy
1248
- }) : rect);
1249
- return {
1250
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1251
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1252
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1253
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1254
- };
1255
- }
1256
-
1257
- /**
1258
- * Provides data to position an inner element of the floating element so that it
1259
- * appears centered to the reference element.
1260
- * @see https://floating-ui.com/docs/arrow
1261
- */
1262
- const arrow = options => ({
1263
- name: 'arrow',
1264
- options,
1265
- async fn(state) {
1266
- const {
1267
- x,
1268
- y,
1269
- placement,
1270
- rects,
1271
- platform,
1272
- elements
1273
- } = state;
1274
- // Since `element` is required, we don't Partial<> the type.
1275
- const {
1276
- element,
1277
- padding = 0
1278
- } = floating_ui_utils_evaluate(options, state) || {};
1279
- if (element == null) {
1280
- return {};
1281
- }
1282
- const paddingObject = getPaddingObject(padding);
1283
- const coords = {
1284
- x,
1285
- y
1286
- };
1287
- const axis = getAlignmentAxis(placement);
1288
- const length = getAxisLength(axis);
1289
- const arrowDimensions = await platform.getDimensions(element);
1290
- const isYAxis = axis === 'y';
1291
- const minProp = isYAxis ? 'top' : 'left';
1292
- const maxProp = isYAxis ? 'bottom' : 'right';
1293
- const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
1294
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1295
- const startDiff = coords[axis] - rects.reference[axis];
1296
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
1297
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1298
-
1299
- // DOM platform can return `window` as the `offsetParent`.
1300
- if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
1301
- clientSize = elements.floating[clientProp] || rects.floating[length];
1302
- }
1303
- const centerToReference = endDiff / 2 - startDiff / 2;
1304
-
1305
- // If the padding is large enough that it causes the arrow to no longer be
1306
- // centered, modify the padding so that it is centered.
1307
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1308
- const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding);
1309
- const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding);
1310
-
1311
- // Make sure the arrow doesn't overflow the floating element if the center
1312
- // point is outside the floating element's bounds.
1313
- const min$1 = minPadding;
1314
- const max = clientSize - arrowDimensions[length] - maxPadding;
1315
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1316
- const offset = clamp(min$1, center, max);
1317
-
1318
- // If the reference is small enough that the arrow's padding causes it to
1319
- // to point to nothing for an aligned placement, adjust the offset of the
1320
- // floating element itself. This stops `shift()` from taking action, but can
1321
- // be worked around by calling it again after the `arrow()` if desired.
1322
- const shouldAddOffset = floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1323
- const alignmentOffset = shouldAddOffset ? center < min$1 ? min$1 - center : max - center : 0;
1324
- return {
1325
- [axis]: coords[axis] - alignmentOffset,
1326
- data: {
1327
- [axis]: offset,
1328
- centerOffset: center - offset + alignmentOffset
1329
- }
1330
- };
1331
- }
1332
- });
1333
-
1334
- function getPlacementList(alignment, autoAlignment, allowedPlacements) {
1335
- const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => floating_ui_utils_getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => floating_ui_utils_getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => floating_ui_utils_getSide(placement) === placement);
1336
- return allowedPlacementsSortedByAlignment.filter(placement => {
1337
- if (alignment) {
1338
- return floating_ui_utils_getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
1339
- }
1340
- return true;
1341
- });
1342
- }
1343
- /**
1344
- * Optimizes the visibility of the floating element by choosing the placement
1345
- * that has the most space available automatically, without needing to specify a
1346
- * preferred placement. Alternative to `flip`.
1347
- * @see https://floating-ui.com/docs/autoPlacement
1348
- */
1349
- const autoPlacement = function (options) {
1350
- if (options === void 0) {
1351
- options = {};
1352
- }
1353
- return {
1354
- name: 'autoPlacement',
1355
- options,
1356
- async fn(state) {
1357
- var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
1358
- const {
1359
- rects,
1360
- middlewareData,
1361
- placement,
1362
- platform,
1363
- elements
1364
- } = state;
1365
- const {
1366
- crossAxis = false,
1367
- alignment,
1368
- allowedPlacements = placements,
1369
- autoAlignment = true,
1370
- ...detectOverflowOptions
1371
- } = floating_ui_utils_evaluate(options, state);
1372
- const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
1373
- const overflow = await detectOverflow(state, detectOverflowOptions);
1374
- const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
1375
- const currentPlacement = placements$1[currentIndex];
1376
- if (currentPlacement == null) {
1377
- return {};
1378
- }
1379
- const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
1380
-
1381
- // Make `computeCoords` start from the right place.
1382
- if (placement !== currentPlacement) {
1383
- return {
1384
- reset: {
1385
- placement: placements$1[0]
1386
- }
1387
- };
1388
- }
1389
- const currentOverflows = [overflow[floating_ui_utils_getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
1390
- const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
1391
- placement: currentPlacement,
1392
- overflows: currentOverflows
1393
- }];
1394
- const nextPlacement = placements$1[currentIndex + 1];
1395
-
1396
- // There are more placements to check.
1397
- if (nextPlacement) {
1398
- return {
1399
- data: {
1400
- index: currentIndex + 1,
1401
- overflows: allOverflows
1402
- },
1403
- reset: {
1404
- placement: nextPlacement
1405
- }
1406
- };
1407
- }
1408
- const placementsSortedByMostSpace = allOverflows.map(d => {
1409
- const alignment = floating_ui_utils_getAlignment(d.placement);
1410
- return [d.placement, alignment && crossAxis ?
1411
- // Check along the mainAxis and main crossAxis side.
1412
- d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
1413
- // Check only the mainAxis.
1414
- d.overflows[0], d.overflows];
1415
- }).sort((a, b) => a[1] - b[1]);
1416
- const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
1417
- // Aligned placements should not check their opposite crossAxis
1418
- // side.
1419
- floating_ui_utils_getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
1420
- const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
1421
- if (resetPlacement !== placement) {
1422
- return {
1423
- data: {
1424
- index: currentIndex + 1,
1425
- overflows: allOverflows
1426
- },
1427
- reset: {
1428
- placement: resetPlacement
1429
- }
1430
- };
1431
- }
1432
- return {};
1433
- }
1434
- };
1435
- };
1436
-
1437
- /**
1438
- * Optimizes the visibility of the floating element by flipping the `placement`
1439
- * in order to keep it in view when the preferred placement(s) will overflow the
1440
- * clipping boundary. Alternative to `autoPlacement`.
1441
- * @see https://floating-ui.com/docs/flip
1442
- */
1443
- const flip = function (options) {
1444
- if (options === void 0) {
1445
- options = {};
1446
- }
1447
- return {
1448
- name: 'flip',
1449
- options,
1450
- async fn(state) {
1451
- var _middlewareData$flip;
1452
- const {
1453
- placement,
1454
- middlewareData,
1455
- rects,
1456
- initialPlacement,
1457
- platform,
1458
- elements
1459
- } = state;
1460
- const {
1461
- mainAxis: checkMainAxis = true,
1462
- crossAxis: checkCrossAxis = true,
1463
- fallbackPlacements: specifiedFallbackPlacements,
1464
- fallbackStrategy = 'bestFit',
1465
- fallbackAxisSideDirection = 'none',
1466
- flipAlignment = true,
1467
- ...detectOverflowOptions
1468
- } = floating_ui_utils_evaluate(options, state);
1469
- const side = floating_ui_utils_getSide(placement);
1470
- const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement;
1471
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1472
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1473
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
1474
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1475
- }
1476
- const placements = [initialPlacement, ...fallbackPlacements];
1477
- const overflow = await detectOverflow(state, detectOverflowOptions);
1478
- const overflows = [];
1479
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
1480
- if (checkMainAxis) {
1481
- overflows.push(overflow[side]);
1482
- }
1483
- if (checkCrossAxis) {
1484
- const sides = getAlignmentSides(placement, rects, rtl);
1485
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
1486
- }
1487
- overflowsData = [...overflowsData, {
1488
- placement,
1489
- overflows
1490
- }];
1491
-
1492
- // One or more sides is overflowing.
1493
- if (!overflows.every(side => side <= 0)) {
1494
- var _middlewareData$flip2, _overflowsData$filter;
1495
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
1496
- const nextPlacement = placements[nextIndex];
1497
- if (nextPlacement) {
1498
- // Try next placement and re-run the lifecycle.
1499
- return {
1500
- data: {
1501
- index: nextIndex,
1502
- overflows: overflowsData
1503
- },
1504
- reset: {
1505
- placement: nextPlacement
1506
- }
1507
- };
1508
- }
1509
-
1510
- // First, find the candidates that fit on the mainAxis side of overflow,
1511
- // then find the placement that fits the best on the main crossAxis side.
1512
- let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
1513
-
1514
- // Otherwise fallback.
1515
- if (!resetPlacement) {
1516
- switch (fallbackStrategy) {
1517
- case 'bestFit':
1518
- {
1519
- var _overflowsData$map$so;
1520
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
1521
- if (placement) {
1522
- resetPlacement = placement;
1523
- }
1524
- break;
1525
- }
1526
- case 'initialPlacement':
1527
- resetPlacement = initialPlacement;
1528
- break;
1529
- }
1530
- }
1531
- if (placement !== resetPlacement) {
1532
- return {
1533
- reset: {
1534
- placement: resetPlacement
1535
- }
1536
- };
1537
- }
1538
- }
1539
- return {};
1540
- }
1541
- };
1542
- };
1543
-
1544
- function getSideOffsets(overflow, rect) {
1545
- return {
1546
- top: overflow.top - rect.height,
1547
- right: overflow.right - rect.width,
1548
- bottom: overflow.bottom - rect.height,
1549
- left: overflow.left - rect.width
1550
- };
1551
- }
1552
- function isAnySideFullyClipped(overflow) {
1553
- return sides.some(side => overflow[side] >= 0);
1554
- }
1555
- /**
1556
- * Provides data to hide the floating element in applicable situations, such as
1557
- * when it is not in the same clipping context as the reference element.
1558
- * @see https://floating-ui.com/docs/hide
1559
- */
1560
- const hide = function (options) {
1561
- if (options === void 0) {
1562
- options = {};
1563
- }
1564
- return {
1565
- name: 'hide',
1566
- options,
1567
- async fn(state) {
1568
- const {
1569
- rects
1570
- } = state;
1571
- const {
1572
- strategy = 'referenceHidden',
1573
- ...detectOverflowOptions
1574
- } = floating_ui_utils_evaluate(options, state);
1575
- switch (strategy) {
1576
- case 'referenceHidden':
1577
- {
1578
- const overflow = await detectOverflow(state, {
1579
- ...detectOverflowOptions,
1580
- elementContext: 'reference'
1581
- });
1582
- const offsets = getSideOffsets(overflow, rects.reference);
1583
- return {
1584
- data: {
1585
- referenceHiddenOffsets: offsets,
1586
- referenceHidden: isAnySideFullyClipped(offsets)
1587
- }
1588
- };
1589
- }
1590
- case 'escaped':
1591
- {
1592
- const overflow = await detectOverflow(state, {
1593
- ...detectOverflowOptions,
1594
- altBoundary: true
1595
- });
1596
- const offsets = getSideOffsets(overflow, rects.floating);
1597
- return {
1598
- data: {
1599
- escapedOffsets: offsets,
1600
- escaped: isAnySideFullyClipped(offsets)
1601
- }
1602
- };
1603
- }
1604
- default:
1605
- {
1606
- return {};
1607
- }
1608
- }
1609
- }
1610
- };
1611
- };
1612
-
1613
- function getBoundingRect(rects) {
1614
- const minX = floating_ui_utils_min(...rects.map(rect => rect.left));
1615
- const minY = floating_ui_utils_min(...rects.map(rect => rect.top));
1616
- const maxX = floating_ui_utils_max(...rects.map(rect => rect.right));
1617
- const maxY = floating_ui_utils_max(...rects.map(rect => rect.bottom));
1618
- return {
1619
- x: minX,
1620
- y: minY,
1621
- width: maxX - minX,
1622
- height: maxY - minY
1623
- };
1624
- }
1625
- function getRectsByLine(rects) {
1626
- const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
1627
- const groups = [];
1628
- let prevRect = null;
1629
- for (let i = 0; i < sortedRects.length; i++) {
1630
- const rect = sortedRects[i];
1631
- if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
1632
- groups.push([rect]);
1633
- } else {
1634
- groups[groups.length - 1].push(rect);
1635
- }
1636
- prevRect = rect;
1637
- }
1638
- return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
1639
- }
1640
- /**
1641
- * Provides improved positioning for inline reference elements that can span
1642
- * over multiple lines, such as hyperlinks or range selections.
1643
- * @see https://floating-ui.com/docs/inline
1644
- */
1645
- const inline = function (options) {
1646
- if (options === void 0) {
1647
- options = {};
1648
- }
1649
- return {
1650
- name: 'inline',
1651
- options,
1652
- async fn(state) {
1653
- const {
1654
- placement,
1655
- elements,
1656
- rects,
1657
- platform,
1658
- strategy
1659
- } = state;
1660
- // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
1661
- // ClientRect's bounds, despite the event listener being triggered. A
1662
- // padding of 2 seems to handle this issue.
1663
- const {
1664
- padding = 2,
1665
- x,
1666
- y
1667
- } = floating_ui_utils_evaluate(options, state);
1668
- const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
1669
- const clientRects = getRectsByLine(nativeClientRects);
1670
- const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
1671
- const paddingObject = getPaddingObject(padding);
1672
- function getBoundingClientRect() {
1673
- // There are two rects and they are disjoined.
1674
- if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
1675
- // Find the first rect in which the point is fully inside.
1676
- return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
1677
- }
1678
-
1679
- // There are 2 or more connected rects.
1680
- if (clientRects.length >= 2) {
1681
- if (floating_ui_utils_getSideAxis(placement) === 'y') {
1682
- const firstRect = clientRects[0];
1683
- const lastRect = clientRects[clientRects.length - 1];
1684
- const isTop = floating_ui_utils_getSide(placement) === 'top';
1685
- const top = firstRect.top;
1686
- const bottom = lastRect.bottom;
1687
- const left = isTop ? firstRect.left : lastRect.left;
1688
- const right = isTop ? firstRect.right : lastRect.right;
1689
- const width = right - left;
1690
- const height = bottom - top;
1691
- return {
1692
- top,
1693
- bottom,
1694
- left,
1695
- right,
1696
- width,
1697
- height,
1698
- x: left,
1699
- y: top
1700
- };
1701
- }
1702
- const isLeftSide = floating_ui_utils_getSide(placement) === 'left';
1703
- const maxRight = floating_ui_utils_max(...clientRects.map(rect => rect.right));
1704
- const minLeft = floating_ui_utils_min(...clientRects.map(rect => rect.left));
1705
- const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
1706
- const top = measureRects[0].top;
1707
- const bottom = measureRects[measureRects.length - 1].bottom;
1708
- const left = minLeft;
1709
- const right = maxRight;
1710
- const width = right - left;
1711
- const height = bottom - top;
1712
- return {
1713
- top,
1714
- bottom,
1715
- left,
1716
- right,
1717
- width,
1718
- height,
1719
- x: left,
1720
- y: top
1721
- };
1722
- }
1723
- return fallback;
1724
- }
1725
- const resetRects = await platform.getElementRects({
1726
- reference: {
1727
- getBoundingClientRect
1728
- },
1729
- floating: elements.floating,
1730
- strategy
1731
- });
1732
- if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
1733
- return {
1734
- reset: {
1735
- rects: resetRects
1736
- }
1737
- };
1738
- }
1739
- return {};
1740
- }
1741
- };
1742
- };
1743
-
1744
- // For type backwards-compatibility, the `OffsetOptions` type was also
1745
- // Derivable.
1746
- async function convertValueToCoords(state, options) {
1747
- const {
1748
- placement,
1749
- platform,
1750
- elements
1751
- } = state;
1752
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1753
- const side = floating_ui_utils_getSide(placement);
1754
- const alignment = floating_ui_utils_getAlignment(placement);
1755
- const isVertical = floating_ui_utils_getSideAxis(placement) === 'y';
1756
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
1757
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
1758
- const rawValue = floating_ui_utils_evaluate(options, state);
1759
-
1760
- // eslint-disable-next-line prefer-const
1761
- let {
1762
- mainAxis,
1763
- crossAxis,
1764
- alignmentAxis
1765
- } = typeof rawValue === 'number' ? {
1766
- mainAxis: rawValue,
1767
- crossAxis: 0,
1768
- alignmentAxis: null
1769
- } : {
1770
- mainAxis: 0,
1771
- crossAxis: 0,
1772
- alignmentAxis: null,
1773
- ...rawValue
1774
- };
1775
- if (alignment && typeof alignmentAxis === 'number') {
1776
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
1777
- }
1778
- return isVertical ? {
1779
- x: crossAxis * crossAxisMulti,
1780
- y: mainAxis * mainAxisMulti
1781
- } : {
1782
- x: mainAxis * mainAxisMulti,
1783
- y: crossAxis * crossAxisMulti
1784
- };
1785
- }
1786
-
1787
- /**
1788
- * Modifies the placement by translating the floating element along the
1789
- * specified axes.
1790
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
1791
- * object may be passed.
1792
- * @see https://floating-ui.com/docs/offset
1793
- */
1794
- const offset = function (options) {
1795
- if (options === void 0) {
1796
- options = 0;
1797
- }
1798
- return {
1799
- name: 'offset',
1800
- options,
1801
- async fn(state) {
1802
- const {
1803
- x,
1804
- y
1805
- } = state;
1806
- const diffCoords = await convertValueToCoords(state, options);
1807
- return {
1808
- x: x + diffCoords.x,
1809
- y: y + diffCoords.y,
1810
- data: diffCoords
1811
- };
1812
- }
1813
- };
1814
- };
1815
-
1816
- /**
1817
- * Optimizes the visibility of the floating element by shifting it in order to
1818
- * keep it in view when it will overflow the clipping boundary.
1819
- * @see https://floating-ui.com/docs/shift
1820
- */
1821
- const shift = function (options) {
1822
- if (options === void 0) {
1823
- options = {};
1824
- }
1825
- return {
1826
- name: 'shift',
1827
- options,
1828
- async fn(state) {
1829
- const {
1830
- x,
1831
- y,
1832
- placement
1833
- } = state;
1834
- const {
1835
- mainAxis: checkMainAxis = true,
1836
- crossAxis: checkCrossAxis = false,
1837
- limiter = {
1838
- fn: _ref => {
1839
- let {
1840
- x,
1841
- y
1842
- } = _ref;
1843
- return {
1844
- x,
1845
- y
1846
- };
1847
- }
1848
- },
1849
- ...detectOverflowOptions
1850
- } = floating_ui_utils_evaluate(options, state);
1851
- const coords = {
1852
- x,
1853
- y
1854
- };
1855
- const overflow = await detectOverflow(state, detectOverflowOptions);
1856
- const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement));
1857
- const mainAxis = floating_ui_utils_getOppositeAxis(crossAxis);
1858
- let mainAxisCoord = coords[mainAxis];
1859
- let crossAxisCoord = coords[crossAxis];
1860
- if (checkMainAxis) {
1861
- const minSide = mainAxis === 'y' ? 'top' : 'left';
1862
- const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
1863
- const min = mainAxisCoord + overflow[minSide];
1864
- const max = mainAxisCoord - overflow[maxSide];
1865
- mainAxisCoord = clamp(min, mainAxisCoord, max);
1866
- }
1867
- if (checkCrossAxis) {
1868
- const minSide = crossAxis === 'y' ? 'top' : 'left';
1869
- const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
1870
- const min = crossAxisCoord + overflow[minSide];
1871
- const max = crossAxisCoord - overflow[maxSide];
1872
- crossAxisCoord = clamp(min, crossAxisCoord, max);
1873
- }
1874
- const limitedCoords = limiter.fn({
1875
- ...state,
1876
- [mainAxis]: mainAxisCoord,
1877
- [crossAxis]: crossAxisCoord
1878
- });
1879
- return {
1880
- ...limitedCoords,
1881
- data: {
1882
- x: limitedCoords.x - x,
1883
- y: limitedCoords.y - y
1884
- }
1885
- };
1886
- }
1887
- };
1888
- };
1889
- /**
1890
- * Built-in `limiter` that will stop `shift()` at a certain point.
1891
- */
1892
- const limitShift = function (options) {
1893
- if (options === void 0) {
1894
- options = {};
1895
- }
1896
- return {
1897
- options,
1898
- fn(state) {
1899
- const {
1900
- x,
1901
- y,
1902
- placement,
1903
- rects,
1904
- middlewareData
1905
- } = state;
1906
- const {
1907
- offset = 0,
1908
- mainAxis: checkMainAxis = true,
1909
- crossAxis: checkCrossAxis = true
1910
- } = evaluate(options, state);
1911
- const coords = {
1912
- x,
1913
- y
1914
- };
1915
- const crossAxis = getSideAxis(placement);
1916
- const mainAxis = getOppositeAxis(crossAxis);
1917
- let mainAxisCoord = coords[mainAxis];
1918
- let crossAxisCoord = coords[crossAxis];
1919
- const rawOffset = evaluate(offset, state);
1920
- const computedOffset = typeof rawOffset === 'number' ? {
1921
- mainAxis: rawOffset,
1922
- crossAxis: 0
1923
- } : {
1924
- mainAxis: 0,
1925
- crossAxis: 0,
1926
- ...rawOffset
1927
- };
1928
- if (checkMainAxis) {
1929
- const len = mainAxis === 'y' ? 'height' : 'width';
1930
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1931
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1932
- if (mainAxisCoord < limitMin) {
1933
- mainAxisCoord = limitMin;
1934
- } else if (mainAxisCoord > limitMax) {
1935
- mainAxisCoord = limitMax;
1936
- }
1937
- }
1938
- if (checkCrossAxis) {
1939
- var _middlewareData$offse, _middlewareData$offse2;
1940
- const len = mainAxis === 'y' ? 'width' : 'height';
1941
- const isOriginSide = ['top', 'left'].includes(getSide(placement));
1942
- const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
1943
- const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
1944
- if (crossAxisCoord < limitMin) {
1945
- crossAxisCoord = limitMin;
1946
- } else if (crossAxisCoord > limitMax) {
1947
- crossAxisCoord = limitMax;
1948
- }
1949
- }
1950
- return {
1951
- [mainAxis]: mainAxisCoord,
1952
- [crossAxis]: crossAxisCoord
1953
- };
1954
- }
1955
- };
1956
- };
1957
-
1958
- /**
1959
- * Provides data that allows you to change the size of the floating element —
1960
- * for instance, prevent it from overflowing the clipping boundary or match the
1961
- * width of the reference element.
1962
- * @see https://floating-ui.com/docs/size
1963
- */
1964
- const size = function (options) {
1965
- if (options === void 0) {
1966
- options = {};
1967
- }
1968
- return {
1969
- name: 'size',
1970
- options,
1971
- async fn(state) {
1972
- const {
1973
- placement,
1974
- rects,
1975
- platform,
1976
- elements
1977
- } = state;
1978
- const {
1979
- apply = () => {},
1980
- ...detectOverflowOptions
1981
- } = evaluate(options, state);
1982
- const overflow = await detectOverflow(state, detectOverflowOptions);
1983
- const side = getSide(placement);
1984
- const alignment = getAlignment(placement);
1985
- const isYAxis = getSideAxis(placement) === 'y';
1986
- const {
1987
- width,
1988
- height
1989
- } = rects.floating;
1990
- let heightSide;
1991
- let widthSide;
1992
- if (side === 'top' || side === 'bottom') {
1993
- heightSide = side;
1994
- widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
1995
- } else {
1996
- widthSide = side;
1997
- heightSide = alignment === 'end' ? 'top' : 'bottom';
1998
- }
1999
- const overflowAvailableHeight = height - overflow[heightSide];
2000
- const overflowAvailableWidth = width - overflow[widthSide];
2001
- const noShift = !state.middlewareData.shift;
2002
- let availableHeight = overflowAvailableHeight;
2003
- let availableWidth = overflowAvailableWidth;
2004
- if (isYAxis) {
2005
- const maximumClippingWidth = width - overflow.left - overflow.right;
2006
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
2007
- } else {
2008
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
2009
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
2010
- }
2011
- if (noShift && !alignment) {
2012
- const xMin = max(overflow.left, 0);
2013
- const xMax = max(overflow.right, 0);
2014
- const yMin = max(overflow.top, 0);
2015
- const yMax = max(overflow.bottom, 0);
2016
- if (isYAxis) {
2017
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
2018
- } else {
2019
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
2020
- }
2021
- }
2022
- await apply({
2023
- ...state,
2024
- availableWidth,
2025
- availableHeight
2026
- });
2027
- const nextDimensions = await platform.getDimensions(elements.floating);
2028
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
2029
- return {
2030
- reset: {
2031
- rects: true
2032
- }
2033
- };
2034
- }
2035
- return {};
2036
- }
2037
- };
2038
- };
2039
-
2040
-
2041
-
2042
- ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs
2043
- function getNodeName(node) {
2044
- if (isNode(node)) {
2045
- return (node.nodeName || '').toLowerCase();
2046
- }
2047
- // Mocked nodes in testing environments may not be instances of Node. By
2048
- // returning `#document` an infinite loop won't occur.
2049
- // https://github.com/floating-ui/floating-ui/issues/2317
2050
- return '#document';
2051
- }
2052
- function getWindow(node) {
2053
- var _node$ownerDocument;
2054
- return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
2055
- }
2056
- function getDocumentElement(node) {
2057
- var _ref;
2058
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
2059
- }
2060
- function isNode(value) {
2061
- return value instanceof Node || value instanceof getWindow(value).Node;
2062
- }
2063
- function floating_ui_utils_dom_isElement(value) {
2064
- return value instanceof Element || value instanceof getWindow(value).Element;
2065
- }
2066
- function isHTMLElement(value) {
2067
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
2068
- }
2069
- function isShadowRoot(value) {
2070
- // Browsers without `ShadowRoot` support.
2071
- if (typeof ShadowRoot === 'undefined') {
2072
- return false;
2073
- }
2074
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2075
- }
2076
- function isOverflowElement(element) {
2077
- const {
2078
- overflow,
2079
- overflowX,
2080
- overflowY,
2081
- display
2082
- } = getComputedStyle(element);
2083
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
2084
- }
2085
- function isTableElement(element) {
2086
- return ['table', 'td', 'th'].includes(getNodeName(element));
2087
- }
2088
- function isContainingBlock(element) {
2089
- const webkit = isWebKit();
2090
- const css = getComputedStyle(element);
2091
-
2092
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2093
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
2094
- }
2095
- function isWebKit() {
2096
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
2097
- return CSS.supports('-webkit-backdrop-filter', 'none');
2098
- }
2099
- function isLastTraversableNode(node) {
2100
- return ['html', 'body', '#document'].includes(getNodeName(node));
2101
- }
2102
- function getComputedStyle(element) {
2103
- return getWindow(element).getComputedStyle(element);
2104
- }
2105
- function getNodeScroll(element) {
2106
- if (floating_ui_utils_dom_isElement(element)) {
2107
- return {
2108
- scrollLeft: element.scrollLeft,
2109
- scrollTop: element.scrollTop
2110
- };
2111
- }
2112
- return {
2113
- scrollLeft: element.pageXOffset,
2114
- scrollTop: element.pageYOffset
2115
- };
2116
- }
2117
- function getParentNode(node) {
2118
- if (getNodeName(node) === 'html') {
2119
- return node;
2120
- }
2121
- const result =
2122
- // Step into the shadow DOM of the parent of a slotted node.
2123
- node.assignedSlot ||
2124
- // DOM Element detected.
2125
- node.parentNode ||
2126
- // ShadowRoot detected.
2127
- isShadowRoot(node) && node.host ||
2128
- // Fallback.
2129
- getDocumentElement(node);
2130
- return isShadowRoot(result) ? result.host : result;
2131
- }
2132
- function getNearestOverflowAncestor(node) {
2133
- const parentNode = getParentNode(node);
2134
- if (isLastTraversableNode(parentNode)) {
2135
- return node.ownerDocument ? node.ownerDocument.body : node.body;
2136
- }
2137
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
2138
- return parentNode;
2139
- }
2140
- return getNearestOverflowAncestor(parentNode);
2141
- }
2142
- function getOverflowAncestors(node, list) {
2143
- var _node$ownerDocument2;
2144
- if (list === void 0) {
2145
- list = [];
2146
- }
2147
- const scrollableAncestor = getNearestOverflowAncestor(node);
2148
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
2149
- const win = getWindow(scrollableAncestor);
2150
- if (isBody) {
2151
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
2152
- }
2153
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
2154
- }
2155
-
2156
-
2157
-
2158
- ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2159
-
2160
-
2161
-
2162
-
2163
-
2164
-
2165
- function getCssDimensions(element) {
2166
- const css = getComputedStyle(element);
2167
- // In testing environments, the `width` and `height` properties are empty
2168
- // strings for SVG elements, returning NaN. Fallback to `0` in this case.
2169
- let width = parseFloat(css.width) || 0;
2170
- let height = parseFloat(css.height) || 0;
2171
- const hasOffset = isHTMLElement(element);
2172
- const offsetWidth = hasOffset ? element.offsetWidth : width;
2173
- const offsetHeight = hasOffset ? element.offsetHeight : height;
2174
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
2175
- if (shouldFallback) {
2176
- width = offsetWidth;
2177
- height = offsetHeight;
2178
- }
2179
- return {
2180
- width,
2181
- height,
2182
- $: shouldFallback
2183
- };
2184
- }
2185
-
2186
- function unwrapElement(element) {
2187
- return !floating_ui_utils_dom_isElement(element) ? element.contextElement : element;
2188
- }
2189
-
2190
- function getScale(element) {
2191
- const domElement = unwrapElement(element);
2192
- if (!isHTMLElement(domElement)) {
2193
- return createCoords(1);
2194
- }
2195
- const rect = domElement.getBoundingClientRect();
2196
- const {
2197
- width,
2198
- height,
2199
- $
2200
- } = getCssDimensions(domElement);
2201
- let x = ($ ? round(rect.width) : rect.width) / width;
2202
- let y = ($ ? round(rect.height) : rect.height) / height;
2203
-
2204
- // 0, NaN, or Infinity should always fallback to 1.
2205
-
2206
- if (!x || !Number.isFinite(x)) {
2207
- x = 1;
2208
- }
2209
- if (!y || !Number.isFinite(y)) {
2210
- y = 1;
2211
- }
2212
- return {
2213
- x,
2214
- y
2215
- };
2216
- }
2217
-
2218
- const noOffsets = /*#__PURE__*/createCoords(0);
2219
- function getVisualOffsets(element) {
2220
- const win = getWindow(element);
2221
- if (!isWebKit() || !win.visualViewport) {
2222
- return noOffsets;
2223
- }
2224
- return {
2225
- x: win.visualViewport.offsetLeft,
2226
- y: win.visualViewport.offsetTop
2227
- };
2228
- }
2229
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
2230
- if (isFixed === void 0) {
2231
- isFixed = false;
2232
- }
2233
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
2234
- return false;
2235
- }
2236
- return isFixed;
2237
- }
2238
-
2239
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
2240
- if (includeScale === void 0) {
2241
- includeScale = false;
2242
- }
2243
- if (isFixedStrategy === void 0) {
2244
- isFixedStrategy = false;
2245
- }
2246
- const clientRect = element.getBoundingClientRect();
2247
- const domElement = unwrapElement(element);
2248
- let scale = createCoords(1);
2249
- if (includeScale) {
2250
- if (offsetParent) {
2251
- if (floating_ui_utils_dom_isElement(offsetParent)) {
2252
- scale = getScale(offsetParent);
2253
- }
2254
- } else {
2255
- scale = getScale(element);
2256
- }
2257
- }
2258
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
2259
- let x = (clientRect.left + visualOffsets.x) / scale.x;
2260
- let y = (clientRect.top + visualOffsets.y) / scale.y;
2261
- let width = clientRect.width / scale.x;
2262
- let height = clientRect.height / scale.y;
2263
- if (domElement) {
2264
- const win = getWindow(domElement);
2265
- const offsetWin = offsetParent && floating_ui_utils_dom_isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2266
- let currentIFrame = win.frameElement;
2267
- while (currentIFrame && offsetParent && offsetWin !== win) {
2268
- const iframeScale = getScale(currentIFrame);
2269
- const iframeRect = currentIFrame.getBoundingClientRect();
2270
- const css = getComputedStyle(currentIFrame);
2271
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
2272
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
2273
- x *= iframeScale.x;
2274
- y *= iframeScale.y;
2275
- width *= iframeScale.x;
2276
- height *= iframeScale.y;
2277
- x += left;
2278
- y += top;
2279
- currentIFrame = getWindow(currentIFrame).frameElement;
2280
- }
2281
- }
2282
- return rectToClientRect({
2283
- width,
2284
- height,
2285
- x,
2286
- y
2287
- });
2288
- }
2289
-
2290
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2291
- let {
2292
- rect,
2293
- offsetParent,
2294
- strategy
2295
- } = _ref;
2296
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2297
- const documentElement = getDocumentElement(offsetParent);
2298
- if (offsetParent === documentElement) {
2299
- return rect;
2300
- }
2301
- let scroll = {
2302
- scrollLeft: 0,
2303
- scrollTop: 0
2304
- };
2305
- let scale = createCoords(1);
2306
- const offsets = createCoords(0);
2307
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
2308
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
2309
- scroll = getNodeScroll(offsetParent);
2310
- }
2311
- if (isHTMLElement(offsetParent)) {
2312
- const offsetRect = getBoundingClientRect(offsetParent);
2313
- scale = getScale(offsetParent);
2314
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2315
- offsets.y = offsetRect.y + offsetParent.clientTop;
2316
- }
2317
- }
2318
- return {
2319
- width: rect.width * scale.x,
2320
- height: rect.height * scale.y,
2321
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
2322
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
2323
- };
2324
- }
2325
-
2326
- function getClientRects(element) {
2327
- return Array.from(element.getClientRects());
2328
- }
2329
-
2330
- function getWindowScrollBarX(element) {
2331
- // If <html> has a CSS width greater than the viewport, then this will be
2332
- // incorrect for RTL.
2333
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
2334
- }
2335
-
2336
- // Gets the entire size of the scrollable document area, even extending outside
2337
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
2338
- function getDocumentRect(element) {
2339
- const html = getDocumentElement(element);
2340
- const scroll = getNodeScroll(element);
2341
- const body = element.ownerDocument.body;
2342
- const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
2343
- const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
2344
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2345
- const y = -scroll.scrollTop;
2346
- if (getComputedStyle(body).direction === 'rtl') {
2347
- x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
2348
- }
2349
- return {
2350
- width,
2351
- height,
2352
- x,
2353
- y
2354
- };
2355
- }
2356
-
2357
- function getViewportRect(element, strategy) {
2358
- const win = getWindow(element);
2359
- const html = getDocumentElement(element);
2360
- const visualViewport = win.visualViewport;
2361
- let width = html.clientWidth;
2362
- let height = html.clientHeight;
2363
- let x = 0;
2364
- let y = 0;
2365
- if (visualViewport) {
2366
- width = visualViewport.width;
2367
- height = visualViewport.height;
2368
- const visualViewportBased = isWebKit();
2369
- if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
2370
- x = visualViewport.offsetLeft;
2371
- y = visualViewport.offsetTop;
2372
- }
2373
- }
2374
- return {
2375
- width,
2376
- height,
2377
- x,
2378
- y
2379
- };
2380
- }
2381
-
2382
- // Returns the inner client rect, subtracting scrollbars if present.
2383
- function getInnerBoundingClientRect(element, strategy) {
2384
- const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
2385
- const top = clientRect.top + element.clientTop;
2386
- const left = clientRect.left + element.clientLeft;
2387
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2388
- const width = element.clientWidth * scale.x;
2389
- const height = element.clientHeight * scale.y;
2390
- const x = left * scale.x;
2391
- const y = top * scale.y;
2392
- return {
2393
- width,
2394
- height,
2395
- x,
2396
- y
2397
- };
2398
- }
2399
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2400
- let rect;
2401
- if (clippingAncestor === 'viewport') {
2402
- rect = getViewportRect(element, strategy);
2403
- } else if (clippingAncestor === 'document') {
2404
- rect = getDocumentRect(getDocumentElement(element));
2405
- } else if (floating_ui_utils_dom_isElement(clippingAncestor)) {
2406
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2407
- } else {
2408
- const visualOffsets = getVisualOffsets(element);
2409
- rect = {
2410
- ...clippingAncestor,
2411
- x: clippingAncestor.x - visualOffsets.x,
2412
- y: clippingAncestor.y - visualOffsets.y
2413
- };
2414
- }
2415
- return rectToClientRect(rect);
2416
- }
2417
- function hasFixedPositionAncestor(element, stopNode) {
2418
- const parentNode = getParentNode(element);
2419
- if (parentNode === stopNode || !floating_ui_utils_dom_isElement(parentNode) || isLastTraversableNode(parentNode)) {
2420
- return false;
2421
- }
2422
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
2423
- }
2424
-
2425
- // A "clipping ancestor" is an `overflow` element with the characteristic of
2426
- // clipping (or hiding) child elements. This returns all clipping ancestors
2427
- // of the given element up the tree.
2428
- function getClippingElementAncestors(element, cache) {
2429
- const cachedResult = cache.get(element);
2430
- if (cachedResult) {
2431
- return cachedResult;
2432
- }
2433
- let result = getOverflowAncestors(element).filter(el => floating_ui_utils_dom_isElement(el) && getNodeName(el) !== 'body');
2434
- let currentContainingBlockComputedStyle = null;
2435
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
2436
- let currentNode = elementIsFixed ? getParentNode(element) : element;
2437
-
2438
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2439
- while (floating_ui_utils_dom_isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2440
- const computedStyle = getComputedStyle(currentNode);
2441
- const currentNodeIsContaining = isContainingBlock(currentNode);
2442
- if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
2443
- currentContainingBlockComputedStyle = null;
2444
- }
2445
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2446
- if (shouldDropCurrentNode) {
2447
- // Drop non-containing blocks.
2448
- result = result.filter(ancestor => ancestor !== currentNode);
2449
- } else {
2450
- // Record last containing block for next iteration.
2451
- currentContainingBlockComputedStyle = computedStyle;
2452
- }
2453
- currentNode = getParentNode(currentNode);
2454
- }
2455
- cache.set(element, result);
2456
- return result;
2457
- }
2458
-
2459
- // Gets the maximum area that the element is visible in due to any number of
2460
- // clipping ancestors.
2461
- function getClippingRect(_ref) {
2462
- let {
2463
- element,
2464
- boundary,
2465
- rootBoundary,
2466
- strategy
2467
- } = _ref;
2468
- const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
2469
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2470
- const firstClippingAncestor = clippingAncestors[0];
2471
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2472
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2473
- accRect.top = floating_ui_utils_max(rect.top, accRect.top);
2474
- accRect.right = floating_ui_utils_min(rect.right, accRect.right);
2475
- accRect.bottom = floating_ui_utils_min(rect.bottom, accRect.bottom);
2476
- accRect.left = floating_ui_utils_max(rect.left, accRect.left);
2477
- return accRect;
2478
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2479
- return {
2480
- width: clippingRect.right - clippingRect.left,
2481
- height: clippingRect.bottom - clippingRect.top,
2482
- x: clippingRect.left,
2483
- y: clippingRect.top
2484
- };
2485
- }
2486
-
2487
- function getDimensions(element) {
2488
- return getCssDimensions(element);
2489
- }
2490
-
2491
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2492
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
2493
- const documentElement = getDocumentElement(offsetParent);
2494
- const isFixed = strategy === 'fixed';
2495
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2496
- let scroll = {
2497
- scrollLeft: 0,
2498
- scrollTop: 0
2499
- };
2500
- const offsets = createCoords(0);
2501
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2502
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
2503
- scroll = getNodeScroll(offsetParent);
2504
- }
2505
- if (isOffsetParentAnElement) {
2506
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2507
- offsets.x = offsetRect.x + offsetParent.clientLeft;
2508
- offsets.y = offsetRect.y + offsetParent.clientTop;
2509
- } else if (documentElement) {
2510
- offsets.x = getWindowScrollBarX(documentElement);
2511
- }
2512
- }
2513
- return {
2514
- x: rect.left + scroll.scrollLeft - offsets.x,
2515
- y: rect.top + scroll.scrollTop - offsets.y,
2516
- width: rect.width,
2517
- height: rect.height
2518
- };
2519
- }
2520
-
2521
- function getTrueOffsetParent(element, polyfill) {
2522
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
2523
- return null;
2524
- }
2525
- if (polyfill) {
2526
- return polyfill(element);
2527
- }
2528
- return element.offsetParent;
2529
- }
2530
- function getContainingBlock(element) {
2531
- let currentNode = getParentNode(element);
2532
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2533
- if (isContainingBlock(currentNode)) {
2534
- return currentNode;
2535
- } else {
2536
- currentNode = getParentNode(currentNode);
2537
- }
2538
- }
2539
- return null;
2540
- }
2541
-
2542
- // Gets the closest ancestor positioned element. Handles some edge cases,
2543
- // such as table ancestors and cross browser bugs.
2544
- function getOffsetParent(element, polyfill) {
2545
- const window = getWindow(element);
2546
- if (!isHTMLElement(element)) {
2547
- return window;
2548
- }
2549
- let offsetParent = getTrueOffsetParent(element, polyfill);
2550
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
2551
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2552
- }
2553
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
2554
- return window;
2555
- }
2556
- return offsetParent || getContainingBlock(element) || window;
2557
- }
2558
-
2559
- const getElementRects = async function (_ref) {
2560
- let {
2561
- reference,
2562
- floating,
2563
- strategy
2564
- } = _ref;
2565
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2566
- const getDimensionsFn = this.getDimensions;
2567
- return {
2568
- reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
2569
- floating: {
2570
- x: 0,
2571
- y: 0,
2572
- ...(await getDimensionsFn(floating))
2573
- }
2574
- };
2575
- };
2576
-
2577
- function isRTL(element) {
2578
- return getComputedStyle(element).direction === 'rtl';
2579
- }
2580
-
2581
- const platform = {
2582
- convertOffsetParentRelativeRectToViewportRelativeRect,
2583
- getDocumentElement: getDocumentElement,
2584
- getClippingRect,
2585
- getOffsetParent,
2586
- getElementRects,
2587
- getClientRects,
2588
- getDimensions,
2589
- getScale,
2590
- isElement: floating_ui_utils_dom_isElement,
2591
- isRTL
2592
- };
2593
-
2594
- // https://samthor.au/2021/observing-dom/
2595
- function observeMove(element, onMove) {
2596
- let io = null;
2597
- let timeoutId;
2598
- const root = getDocumentElement(element);
2599
- function cleanup() {
2600
- clearTimeout(timeoutId);
2601
- io && io.disconnect();
2602
- io = null;
2603
- }
2604
- function refresh(skip, threshold) {
2605
- if (skip === void 0) {
2606
- skip = false;
2607
- }
2608
- if (threshold === void 0) {
2609
- threshold = 1;
2610
- }
2611
- cleanup();
2612
- const {
2613
- left,
2614
- top,
2615
- width,
2616
- height
2617
- } = element.getBoundingClientRect();
2618
- if (!skip) {
2619
- onMove();
2620
- }
2621
- if (!width || !height) {
2622
- return;
2623
- }
2624
- const insetTop = floor(top);
2625
- const insetRight = floor(root.clientWidth - (left + width));
2626
- const insetBottom = floor(root.clientHeight - (top + height));
2627
- const insetLeft = floor(left);
2628
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2629
- const options = {
2630
- rootMargin,
2631
- threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1
2632
- };
2633
- let isFirstUpdate = true;
2634
- function handleObserve(entries) {
2635
- const ratio = entries[0].intersectionRatio;
2636
- if (ratio !== threshold) {
2637
- if (!isFirstUpdate) {
2638
- return refresh();
2639
- }
2640
- if (!ratio) {
2641
- timeoutId = setTimeout(() => {
2642
- refresh(false, 1e-7);
2643
- }, 100);
2644
- } else {
2645
- refresh(false, ratio);
2646
- }
2647
- }
2648
- isFirstUpdate = false;
2649
- }
2650
-
2651
- // Older browsers don't support a `document` as the root and will throw an
2652
- // error.
2653
- try {
2654
- io = new IntersectionObserver(handleObserve, {
2655
- ...options,
2656
- // Handle <iframe>s
2657
- root: root.ownerDocument
2658
- });
2659
- } catch (e) {
2660
- io = new IntersectionObserver(handleObserve, options);
2661
- }
2662
- io.observe(element);
2663
- }
2664
- refresh(true);
2665
- return cleanup;
2666
- }
2667
-
2668
- /**
2669
- * Automatically updates the position of the floating element when necessary.
2670
- * Should only be called when the floating element is mounted on the DOM or
2671
- * visible on the screen.
2672
- * @returns cleanup function that should be invoked when the floating element is
2673
- * removed from the DOM or hidden from the screen.
2674
- * @see https://floating-ui.com/docs/autoUpdate
2675
- */
2676
- function autoUpdate(reference, floating, update, options) {
2677
- if (options === void 0) {
2678
- options = {};
2679
- }
2680
- const {
2681
- ancestorScroll = true,
2682
- ancestorResize = true,
2683
- elementResize = typeof ResizeObserver === 'function',
2684
- layoutShift = typeof IntersectionObserver === 'function',
2685
- animationFrame = false
2686
- } = options;
2687
- const referenceEl = unwrapElement(reference);
2688
- const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
2689
- ancestors.forEach(ancestor => {
2690
- ancestorScroll && ancestor.addEventListener('scroll', update, {
2691
- passive: true
2692
- });
2693
- ancestorResize && ancestor.addEventListener('resize', update);
2694
- });
2695
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2696
- let reobserveFrame = -1;
2697
- let resizeObserver = null;
2698
- if (elementResize) {
2699
- resizeObserver = new ResizeObserver(_ref => {
2700
- let [firstEntry] = _ref;
2701
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2702
- // Prevent update loops when using the `size` middleware.
2703
- // https://github.com/floating-ui/floating-ui/issues/1740
2704
- resizeObserver.unobserve(floating);
2705
- cancelAnimationFrame(reobserveFrame);
2706
- reobserveFrame = requestAnimationFrame(() => {
2707
- resizeObserver && resizeObserver.observe(floating);
2708
- });
2709
- }
2710
- update();
2711
- });
2712
- if (referenceEl && !animationFrame) {
2713
- resizeObserver.observe(referenceEl);
2714
- }
2715
- resizeObserver.observe(floating);
2716
- }
2717
- let frameId;
2718
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
2719
- if (animationFrame) {
2720
- frameLoop();
2721
- }
2722
- function frameLoop() {
2723
- const nextRefRect = getBoundingClientRect(reference);
2724
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
2725
- update();
2726
- }
2727
- prevRefRect = nextRefRect;
2728
- frameId = requestAnimationFrame(frameLoop);
2729
- }
2730
- update();
2731
- return () => {
2732
- ancestors.forEach(ancestor => {
2733
- ancestorScroll && ancestor.removeEventListener('scroll', update);
2734
- ancestorResize && ancestor.removeEventListener('resize', update);
2735
- });
2736
- cleanupIo && cleanupIo();
2737
- resizeObserver && resizeObserver.disconnect();
2738
- resizeObserver = null;
2739
- if (animationFrame) {
2740
- cancelAnimationFrame(frameId);
2741
- }
2742
- };
2743
- }
2744
-
2745
- /**
2746
- * Computes the `x` and `y` coordinates that will place the floating element
2747
- * next to a reference element when it is given a certain CSS positioning
2748
- * strategy.
2749
- */
2750
- const floating_ui_dom_computePosition = (reference, floating, options) => {
2751
- // This caches the expensive `getClippingElementAncestors` function so that
2752
- // multiple lifecycle resets re-use the same result. It only lives for a
2753
- // single call. If other functions become expensive, we can add them as well.
2754
- const cache = new Map();
2755
- const mergedOptions = {
2756
- platform,
2757
- ...options
2758
- };
2759
- const platformWithCache = {
2760
- ...mergedOptions.platform,
2761
- _c: cache
2762
- };
2763
- return computePosition(reference, floating, {
2764
- ...mergedOptions,
2765
- platform: platformWithCache
2766
- });
2767
- };
2768
-
2769
-
2770
-
2771
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js
2772
- function _objectDestructuringEmpty(obj) {
2773
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
2774
- }
2775
- ;// CONCATENATED MODULE: ../../packages/popover/src/use-platform.tsx
2776
-
2777
- /*
2778
- * Tencent is pleased to support the open source community by making
2779
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2780
- *
2781
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2782
- *
2783
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2784
- *
2785
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2786
- *
2787
- * ---------------------------------------------------
2788
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2789
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2790
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2791
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2792
- *
2793
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2794
- * the Software.
2795
- *
2796
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2797
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2798
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2799
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2800
- * IN THE SOFTWARE.
2801
- */
2802
- /* harmony default export */ const use_platform = (function (fullscreenTarget) {
2803
- var getElementRects = function getElementRects(_ref) {
2804
- var reference = _ref.reference,
2805
- floating = _ref.floating;
2806
- var refRect = reference.getBoundingClientRect();
2807
- var floatRect = floating.getBoundingClientRect();
2808
- return {
2809
- reference: {
2810
- width: refRect.width,
2811
- height: refRect.height,
2812
- x: refRect.x,
2813
- y: refRect.y
2814
- },
2815
- floating: {
2816
- width: floatRect.width,
2817
- height: floatRect.height,
2818
- x: floatRect.x,
2819
- y: floatRect.y
2820
- }
2821
- };
2822
- };
2823
- var getDimensions = function getDimensions(element) {
2824
- var _element$getBoundingC = element.getBoundingClientRect(),
2825
- width = _element$getBoundingC.width,
2826
- height = _element$getBoundingC.height;
2827
- return {
2828
- width: width,
2829
- height: height
2830
- };
2831
- };
2832
- var getClippingRect = function getClippingRect(_ref2) {
2833
- _objectDestructuringEmpty(_ref2);
2834
- var _a;
2835
- var _ref3 = (_a = fullscreenTarget === null || fullscreenTarget === void 0 ? void 0 : fullscreenTarget.getBoundingClientRect()) !== null && _a !== void 0 ? _a : {},
2836
- _ref3$width = _ref3.width,
2837
- width = _ref3$width === void 0 ? 0 : _ref3$width,
2838
- _ref3$height = _ref3.height,
2839
- height = _ref3$height === void 0 ? 0 : _ref3$height;
2840
- return {
2841
- width: width,
2842
- height: height,
2843
- x: 0,
2844
- y: 0
2845
- };
2846
- };
2847
- return {
2848
- getElementRects: getElementRects,
2849
- getDimensions: getDimensions,
2850
- getClippingRect: getClippingRect
2851
- };
2852
- });
2853
- // EXTERNAL MODULE: ../../node_modules/uuid/index.js
2854
- var uuid = __webpack_require__(8022);
2855
- ;// CONCATENATED MODULE: ../../packages/popover/src/utils.ts
2856
- /*
2857
- * Tencent is pleased to support the open source community by making
2858
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2859
- *
2860
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2861
- *
2862
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2863
- *
2864
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2865
- *
2866
- * ---------------------------------------------------
2867
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2868
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2869
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2870
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2871
- *
2872
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2873
- * the Software.
2874
- *
2875
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2876
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2877
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2878
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2879
- * IN THE SOFTWARE.
2880
- */
2881
-
2882
- var CachedConst = {};
2883
- var isAvailableId = function isAvailableId(query) {
2884
- var container = document.querySelector(query);
2885
- return container instanceof HTMLElement;
2886
- };
2887
- var getFullscreenUid = function getFullscreenUid() {
2888
- if (!CachedConst.fullscreenReferId) {
2889
- CachedConst.fullscreenReferId = "id_".concat((0,uuid.v4)());
2890
- }
2891
- return CachedConst.fullscreenReferId;
2892
- };
2893
- var utils_isElement = function isElement(element) {
2894
- return element instanceof Element || element instanceof HTMLDocument;
2895
- };
2896
- var contentAsHTMLElement = function contentAsHTMLElement(content) {
2897
- if (utils_isElement(content)) {
2898
- return {
2899
- isElement: true,
2900
- content: content,
2901
- vNode: undefined
2902
- };
2903
- }
2904
- if (/^(#|\.)/.test(content)) {
2905
- var target = document.querySelector(content);
2906
- var isEle = utils_isElement(target);
2907
- return {
2908
- isElement: isEle,
2909
- content: isEle ? target : content,
2910
- vNode: isEle ? undefined : content
2911
- };
2912
- }
2913
- return {
2914
- isElement: false,
2915
- content: content,
2916
- vNode: content
2917
- };
2918
- };
2919
- ;// CONCATENATED MODULE: ../../packages/popover/src/use-floating.tsx
2920
-
2921
-
2922
- /*
2923
- * Tencent is pleased to support the open source community by making
2924
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2925
- *
2926
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2927
- *
2928
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2929
- *
2930
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2931
- *
2932
- * ---------------------------------------------------
2933
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2934
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2935
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2936
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2937
- *
2938
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2939
- * the Software.
2940
- *
2941
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2942
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2943
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2944
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2945
- * IN THE SOFTWARE.
2946
- */
2947
-
2948
-
2949
-
2950
-
2951
-
2952
-
2953
-
2954
- /**
2955
- * 解析popover相关配置
2956
- */
2957
- /* harmony default export */ const use_floating = (function (props, ctx, _ref) {
2958
- var refReference = _ref.refReference,
2959
- refContent = _ref.refContent,
2960
- refArrow = _ref.refArrow,
2961
- refRoot = _ref.refRoot;
2962
- var localIsShow = (0,external_vue_namespaceObject.ref)(false);
2963
- var fullScreenTarget = (0,external_vue_namespaceObject.ref)();
2964
- var isElementFullScreen = function isElementFullScreen() {
2965
- var _a, _b;
2966
- var elReference = resolveReferElement();
2967
- if ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) {
2968
- return document.fullscreenElement.shadowRoot.contains(elReference);
2969
- }
2970
- return (_b = document.fullscreenElement) === null || _b === void 0 ? void 0 : _b.contains(elReference);
2971
- };
2972
- /**
2973
- * 当全屏模式开启,获取指定选择器下面的全屏元素
2974
- * 如果是启用了webcomponent组件,则返回shadowRoot内指定的目标元素
2975
- * @param selector
2976
- * @returns
2977
- */
2978
- var getFullscreenRoot = function getFullscreenRoot(selector) {
2979
- if (isElementFullScreen()) {
2980
- if (document.fullscreenElement.shadowRoot) {
2981
- return document.fullscreenElement.shadowRoot.querySelector(selector);
2982
- }
2983
- return document.fullscreenElement.querySelector(selector);
2984
- }
2985
- return document.body;
2986
- };
2987
- var themeList = ['dark', 'light'];
2988
- /**
2989
- * 根据props.theme计算theme
2990
- * 返回systemTheme & customTheme
2991
- * systemTheme是指包含在 ['dark', 'light'] 内置主题
2992
- * customTheme是指自定义的theme,string类型
2993
- */
2994
- var compTheme = (0,external_vue_namespaceObject.computed)(function () {
2995
- var _a, _b;
2996
- var themes = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) !== null && _b !== void 0 ? _b : [];
2997
- themes.sort(function (a, b) {
2998
- return Number(themeList.includes(b)) - Number(themeList.includes(a));
2999
- });
3000
- var systemThemes = themes;
3001
- var customThemes = themes.filter(function (item) {
3002
- return !themeList.includes(item);
3003
- });
3004
- return {
3005
- systemThemes: systemThemes,
3006
- customThemes: customThemes
3007
- };
3008
- });
3009
- var isHideMiddlewareAvailable = function isHideMiddlewareAvailable() {
3010
- return props.autoVisibility;
3011
- };
3012
- var isAutoPlacementAvailable = function isAutoPlacementAvailable() {
3013
- return props.autoPlacement;
3014
- };
3015
- /**
3016
- * 解析弹出reference元素,content元素, arrow元素
3017
- * @returns
3018
- */
3019
- var resolvePopElements = function resolvePopElements() {
3020
- var _a, _b, _c;
3021
- var elReference = resolveReferElement();
3022
- var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3023
- var elArrow = props.arrow ? resolveTargetElement((_b = refArrow.value) === null || _b === void 0 ? void 0 : _b.$el) : null;
3024
- var root = resolveTargetElement((_c = refRoot.value) === null || _c === void 0 ? void 0 : _c.$el);
3025
- var _contentAsHTMLElement = contentAsHTMLElement(props.content),
3026
- isElement = _contentAsHTMLElement.isElement,
3027
- content = _contentAsHTMLElement.content;
3028
- if (elContent && isElement && !(elContent === null || elContent === void 0 ? void 0 : elContent.contains(content))) {
3029
- elContent.append(content);
3030
- }
3031
- return {
3032
- elReference: elReference,
3033
- elContent: elContent,
3034
- elArrow: elArrow,
3035
- root: root
3036
- };
3037
- };
3038
- var resolveReferElement = function resolveReferElement() {
3039
- var _a;
3040
- return resolveTargetElement(props.target) || resolveTargetElement((_a = refReference.value) === null || _a === void 0 ? void 0 : _a.$el);
3041
- };
3042
- var resolveModifiers = function resolveModifiers() {
3043
- var resolveResult = {};
3044
- if (Array.isArray(props.modifiers)) {
3045
- props.modifiers.forEach(function (m) {
3046
- var _a, _b, _c, _d;
3047
- var result;
3048
- if (m.name === 'offset') {
3049
- if (typeof ((_a = m.options) === null || _a === void 0 ? void 0 : _a.offset) === 'number') {
3050
- result = (_b = m.options) === null || _b === void 0 ? void 0 : _b.offset;
3051
- }
3052
- if (Array.isArray((_c = m.options) === null || _c === void 0 ? void 0 : _c.offset)) {
3053
- var _ref2 = (_d = m.options) === null || _d === void 0 ? void 0 : _d.offset,
3054
- _ref3 = _slicedToArray(_ref2, 2),
3055
- mainAxis = _ref3[0],
3056
- crossAxis = _ref3[1];
3057
- result = {
3058
- mainAxis: mainAxis,
3059
- crossAxis: crossAxis
3060
- };
3061
- }
3062
- Object.assign(resolveResult, {
3063
- offset: result
3064
- });
3065
- }
3066
- });
3067
- }
3068
- return resolveResult;
3069
- };
3070
- var resolvePopOptions = function resolvePopOptions(elArrow, props) {
3071
- var _a;
3072
- var modifiers = resolveModifiers();
3073
- var middleware = [offset(modifiers.offset || props.offset), shift({
3074
- padding: props.padding
3075
- })];
3076
- var options = {
3077
- placement: props.placement,
3078
- middleware: middleware
3079
- };
3080
- if (props.arrow) {
3081
- middleware.push(arrow({
3082
- element: elArrow
3083
- }));
3084
- }
3085
- if (isAutoPlacementAvailable()) {
3086
- middleware.push(autoPlacement());
3087
- } else {
3088
- middleware.unshift(inline());
3089
- middleware.push(flip());
3090
- }
3091
- if (isHideMiddlewareAvailable()) {
3092
- options.middleware.push(hide());
3093
- }
3094
- /**
3095
- * 如果是全屏元素或者指定的虚拟元素
3096
- * 则启用自定义的platform
3097
- * 在弹出的全屏元素中,元素相对位置有别于document下面元素
3098
- * 全屏模式下面,需要自定义当前元素的一个platform
3099
- */
3100
- if (isElementFullScreen() || props.isVirtualEl) {
3101
- var _usePlatform = use_platform(fullScreenTarget.value),
3102
- getElementRects = _usePlatform.getElementRects,
3103
- getDimensions = _usePlatform.getDimensions,
3104
- getClippingRect = _usePlatform.getClippingRect;
3105
- Object.assign(options, {
3106
- platform: Object.assign(Object.assign({}, (_a = props === null || props === void 0 ? void 0 : props.platform) !== null && _a !== void 0 ? _a : {}), {
3107
- getElementRects: getElementRects,
3108
- getDimensions: getDimensions,
3109
- getClippingRect: getClippingRect
3110
- })
3111
- });
3112
- }
3113
- return options;
3114
- };
3115
- var resolveTargetElement = function resolveTargetElement(target) {
3116
- if (target instanceof HTMLElement) {
3117
- return target;
3118
- }
3119
- if (target instanceof Text) {
3120
- return resolveTargetElement(target.nextElementSibling);
3121
- }
3122
- if (typeof (target === null || target === void 0 ? void 0 : target.getBoundingClientRect) === 'function') {
3123
- return target;
3124
- }
3125
- if (typeof target === 'string') {
3126
- var targetEl = document.querySelector(target);
3127
- if ((0,external_lodash_namespaceObject.isElement)(targetEl)) {
3128
- return targetEl;
3129
- }
3130
- return null;
3131
- }
3132
- if (target instanceof PointerEvent) {
3133
- return resolveTargetElement(target.target);
3134
- }
3135
- return null;
3136
- };
3137
- // 兼容多种样式处理规则
3138
- // class custom-theme
3139
- var customThemeCls = compTheme.value.customThemes.join(' ');
3140
- var customTheme = compTheme.value.customThemes.reduce(function (out, cur) {
3141
- return Object.assign(_defineProperty({}, "data-".concat(cur, "-theme"), true), out);
3142
- }, {});
3143
- var contentClass = "".concat(customThemeCls);
3144
- var cleanup = null;
3145
- var getRoundPixelVal = function getRoundPixelVal(val) {
3146
- var dpr = window.devicePixelRatio || 1;
3147
- return Math.round(val * dpr) / dpr || 0;
3148
- };
3149
- var updatePopContentStyle = function updatePopContentStyle(elContent, x, y, middlewareData) {
3150
- var _a;
3151
- if (props.disableTransform) {
3152
- Object.assign(elContent.style, {
3153
- left: "".concat(getRoundPixelVal(x), "px"),
3154
- top: "".concat(getRoundPixelVal(y), "px")
3155
- });
3156
- } else {
3157
- Object.assign(elContent.style, {
3158
- left: '0',
3159
- top: '0',
3160
- transform: "translate3d(".concat(getRoundPixelVal(x), "px,").concat(getRoundPixelVal(y), "px,0)")
3161
- });
3162
- }
3163
- var referenceHidden = isHideMiddlewareAvailable() ? (_a = middlewareData.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden : false;
3164
- Object.assign(elContent.style, {
3165
- visibility: referenceHidden ? 'hidden' : 'visible'
3166
- });
3167
- };
3168
- var updateArrowStyle = function updateArrowStyle(elArrow, resolvedPlacement, middlewareData) {
3169
- var _a;
3170
- if (props.arrow) {
3171
- var _ref4 = (_a = middlewareData.arrow) !== null && _a !== void 0 ? _a : {},
3172
- arrowX = _ref4.x,
3173
- arrowY = _ref4.y;
3174
- elArrow.setAttribute('data-arrow', resolvedPlacement);
3175
- var arrowConfig = {
3176
- left: '',
3177
- top: '',
3178
- bottom: '',
3179
- right: ''
3180
- };
3181
- Object.assign(elArrow.style, arrowConfig);
3182
- var arrowSide = {
3183
- top: 'bottom',
3184
- right: 'left',
3185
- bottom: 'top',
3186
- left: 'right'
3187
- }[resolvedPlacement];
3188
- Object.assign(elArrow.style, _defineProperty({
3189
- left: arrowX !== null ? "".concat(arrowX, "px") : '',
3190
- top: arrowY !== null ? "".concat(arrowY, "px") : ''
3191
- }, arrowSide, '-4px'));
3192
- }
3193
- };
3194
- var createPopInstance = function createPopInstance() {
3195
- var _resolvePopElements = resolvePopElements(),
3196
- elReference = _resolvePopElements.elReference,
3197
- elContent = _resolvePopElements.elContent;
3198
- cleanup = autoUpdate(elReference, elContent, function () {
3199
- if (localIsShow.value) {
3200
- updatePopover(null, props);
3201
- }
3202
- });
3203
- };
3204
- var updatePopover = function updatePopover() {
3205
- var virtualEl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
3206
- var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3207
- var callFn = arguments.length > 2 ? arguments[2] : undefined;
3208
- var _resolvePopElements2 = resolvePopElements(),
3209
- elReference = _resolvePopElements2.elReference,
3210
- elContent = _resolvePopElements2.elContent,
3211
- elArrow = _resolvePopElements2.elArrow;
3212
- var targetEl = virtualEl || elReference;
3213
- if (!targetEl || !elContent) return;
3214
- var options = resolvePopOptions(elArrow, props);
3215
- floating_ui_dom_computePosition(targetEl, elContent, options).then(function (_ref5) {
3216
- var x = _ref5.x,
3217
- y = _ref5.y,
3218
- placement = _ref5.placement,
3219
- middlewareData = _ref5.middlewareData;
3220
- var oldClass = elContent.className;
3221
- elContent.className = "".concat(oldClass.replace(contentClass, ''), " ").concat(contentClass).replace(/\s+/gm, ' ').replace(/^\s+|\s+$/g, '');
3222
- Object.keys(customTheme).forEach(function (key) {
3223
- elContent.setAttribute(key, customTheme[key]);
3224
- });
3225
- var placementStr = placement.split('-')[0];
3226
- var resolvedPlacement = placementStr;
3227
- if (!['left', 'right', 'top', 'bottom'].includes(placementStr)) {
3228
- resolvedPlacement = 'top';
3229
- }
3230
- updatePopContentStyle(elContent, x, y, middlewareData);
3231
- updateArrowStyle(elArrow, resolvedPlacement, middlewareData);
3232
- if (typeof callFn === 'function') {
3233
- callFn();
3234
- }
3235
- });
3236
- };
3237
- var popHideTimerId = undefined;
3238
- var popShowTimerId = undefined;
3239
- var isMouseenter = false;
3240
- var resolvePopoverDelay = function resolvePopoverDelay() {
3241
- if (Array.isArray(props.popoverDelay)) {
3242
- return [props.popoverDelay[0], props.popoverDelay.slice(-1)[0]];
3243
- }
3244
- return [props.popoverDelay, props.popoverDelay];
3245
- };
3246
- var showPopover = function showPopover() {
3247
- var delay = resolvePopoverDelay()[0];
3248
- // 设置settimeout避免hidePopover导致显示问题
3249
- popShowTimerId = setTimeout(function () {
3250
- if (popHideTimerId) {
3251
- clearTimeout(popHideTimerId);
3252
- }
3253
- if (!props.disabled) {
3254
- localIsShow.value = true;
3255
- }
3256
- }, delay);
3257
- };
3258
- var hidePopover = function hidePopover() {
3259
- var delay = resolvePopoverDelay()[1];
3260
- popHideTimerId = setTimeout(function () {
3261
- popShowTimerId && clearTimeout(popShowTimerId);
3262
- localIsShow.value = false;
3263
- }, delay);
3264
- };
3265
- var handlePopoverShow = function handlePopoverShow() {
3266
- var _a;
3267
- var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3268
- elContent.style.setProperty('display', 'block');
3269
- elContent.style.setProperty('z-index', "".concat(props.zIndex ? props.zIndex : external_shared_namespaceObject.bkZIndexManager.getPopperIndex()));
3270
- updatePopover();
3271
- ctx.emit(EMIT_EVENTS.CONTENT_AfterShow, {
3272
- isShow: true
3273
- });
3274
- };
3275
- var handlePopoverHide = function handlePopoverHide() {
3276
- var _a;
3277
- var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3278
- elContent.style.setProperty('display', 'none');
3279
- ctx.emit(EMIT_EVENTS.CONTENT_AfterHidden, {
3280
- isShow: false
3281
- });
3282
- };
3283
- var triggerPopover = function triggerPopover() {
3284
- if (!localIsShow.value) {
3285
- showPopover();
3286
- } else {
3287
- hidePopover();
3288
- }
3289
- };
3290
- var handleClickRef = function handleClickRef() {
3291
- triggerPopover();
3292
- };
3293
- var handlePopContentMouseEnter = function handlePopContentMouseEnter(e) {
3294
- if (props.trigger !== 'hover') {
3295
- return;
3296
- }
3297
- if (popHideTimerId) {
3298
- isMouseenter = true;
3299
- clearTimeout(popHideTimerId);
3300
- popHideTimerId = undefined;
3301
- }
3302
- emitPopContentMouseEnter(e);
3303
- };
3304
- var handlePopContentMouseLeave = function handlePopContentMouseLeave(e) {
3305
- if (isMouseenter) {
3306
- hidePopover();
3307
- isMouseenter = false;
3308
- emitPopContentMouseLeave(e);
3309
- }
3310
- };
3311
- /**
3312
- * 弹出内容鼠标移入事件
3313
- * 抛出相关事件,方便后续操作
3314
- * 例如:鼠标移入内容区域,则取消弹出内容隐藏操作
3315
- */
3316
- var emitPopContentMouseEnter = function emitPopContentMouseEnter(e) {
3317
- ctx.emit(EMIT_EVENTS.CONTENT_MOUSEENTER, e);
3318
- };
3319
- /**
3320
- * 弹出内容鼠标移出事件
3321
- */
3322
- var emitPopContentMouseLeave = function emitPopContentMouseLeave(e) {
3323
- ctx.emit(EMIT_EVENTS.CONTENT_MOUSELEAVE, e);
3324
- };
3325
- var resolveTriggerEvents = function resolveTriggerEvents() {
3326
- var _a;
3327
- var triggerEvents = {
3328
- hover: {
3329
- content: [['mouseenter', handlePopContentMouseEnter], ['mouseleave', handlePopContentMouseLeave]],
3330
- reference: [['mouseenter', showPopover], ['mouseleave', hidePopover], ['focus', showPopover], ['blur', hidePopover]]
3331
- },
3332
- click: [['click', handleClickRef]],
3333
- manual: {
3334
- content: [['mouseenter', emitPopContentMouseEnter], ['mouseleave', emitPopContentMouseLeave]],
3335
- reference: [[]]
3336
- }
3337
- };
3338
- return (_a = triggerEvents[props.trigger]) !== null && _a !== void 0 ? _a : [];
3339
- };
3340
- var updateFullscreenTarget = function updateFullscreenTarget(val) {
3341
- fullScreenTarget.value = val;
3342
- };
3343
- (0,external_vue_namespaceObject.watch)(function () {
3344
- return props.isShow;
3345
- }, function (val) {
3346
- localIsShow.value = val;
3347
- });
3348
- (0,external_vue_namespaceObject.watch)(localIsShow, function (val) {
3349
- if (val) {
3350
- handlePopoverShow();
3351
- } else {
3352
- handlePopoverHide();
3353
- }
3354
- });
3355
- var stopHide = function stopHide() {
3356
- if (popHideTimerId) {
3357
- isMouseenter = true;
3358
- clearTimeout(popHideTimerId);
3359
- popHideTimerId = undefined;
3360
- }
3361
- };
3362
- return {
3363
- showPopover: showPopover,
3364
- hidePopover: hidePopover,
3365
- resolveTriggerEvents: resolveTriggerEvents,
3366
- updatePopover: updatePopover,
3367
- triggerPopover: triggerPopover,
3368
- resolvePopElements: resolvePopElements,
3369
- isElementFullScreen: isElementFullScreen,
3370
- resolveTargetElement: resolveTargetElement,
3371
- createPopInstance: createPopInstance,
3372
- updateFullscreenTarget: updateFullscreenTarget,
3373
- getFullscreenRoot: getFullscreenRoot,
3374
- stopHide: stopHide,
3375
- localIsShow: localIsShow,
3376
- cleanup: cleanup
3377
- };
3378
- });
3379
- ;// CONCATENATED MODULE: ../../packages/popover/src/use-popper-id.ts
3380
- /*
3381
- * Tencent is pleased to support the open source community by making
3382
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3383
- *
3384
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3385
- *
3386
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3387
- *
3388
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3389
- *
3390
- * ---------------------------------------------------
3391
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3392
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3393
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3394
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3395
- *
3396
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3397
- * the Software.
3398
- *
3399
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3400
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3401
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3402
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3403
- * IN THE SOFTWARE.
3404
- */
3405
-
3406
-
3407
- var popContainerId = null;
3408
- var parentNodeReferId = null;
3409
- /* harmony default export */ const use_popper_id = (function (props) {
3410
- var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
3411
- var getPrefixId = function getPrefixId(root) {
3412
- var resolvedBoundary = null;
3413
- var resolveBoundary = function resolveBoundary(fn) {
3414
- if (resolvedBoundary === null) {
3415
- fn();
3416
- }
3417
- };
3418
- var resolveParentBoundary = function resolveParentBoundary() {
3419
- if (/^parent$/i.test(props.boundary)) {
3420
- resolvedBoundary = "".concat(prefix).concat(popContainerId);
3421
- var _ref = root || {},
3422
- parentNode = _ref.parentNode;
3423
- if (parentNode === null || parentNode === void 0 ? void 0 : parentNode.parentNode) {
3424
- parentNode.parentNode.setAttribute('data-pnode-id', parentNodeReferId);
3425
- resolvedBoundary = "[data-pnode-id=".concat(parentNodeReferId, "]");
3426
- }
3427
- }
3428
- };
3429
- var resolveCommonBoundary = function resolveCommonBoundary() {
3430
- if (!/^body$/i.test(props.boundary)) {
3431
- if (typeof props.boundary === 'string') {
3432
- if (!isAvailableId(props.boundary)) {
3433
- // console.error('props.boundary is not available selector');
3434
- resolvedBoundary = 'body';
3435
- return;
3436
- }
3437
- resolvedBoundary = props.boundary;
3438
- return;
3439
- }
3440
- if (utils_isElement(props.boundary)) {
3441
- resolvedBoundary = props.boundary;
3442
- return;
3443
- }
3444
- }
3445
- };
3446
- resolveBoundary(resolveParentBoundary);
3447
- resolveBoundary(resolveCommonBoundary);
3448
- resolveBoundary(function () {
3449
- resolvedBoundary = typeof props.boundary === 'string' ? props.boundary : "".concat(prefix).concat(popContainerId);
3450
- });
3451
- return resolvedBoundary;
3452
- };
3453
- if (popContainerId === null || !isAvailableId("#".concat(popContainerId))) {
3454
- popContainerId = "id_".concat((0,uuid.v4)());
3455
- var popContainer = document.createElement('div');
3456
- popContainer.setAttribute('id', popContainerId);
3457
- popContainer.setAttribute('data-popper-id', popContainerId);
3458
- document.body.append(popContainer);
3459
- }
3460
- if (parentNodeReferId === null) {
3461
- parentNodeReferId = "id_".concat((0,uuid.v4)());
3462
- }
3463
- return {
3464
- popContainerId: popContainerId,
3465
- prefixId: getPrefixId(),
3466
- getPrefixId: getPrefixId
3467
- };
3468
- });
3469
- ;// CONCATENATED MODULE: ../../packages/popover/src/use-popover-init.ts
3470
-
3471
- /*
3472
- * Tencent is pleased to support the open source community by making
3473
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3474
- *
3475
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3476
- *
3477
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3478
- *
3479
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3480
- *
3481
- * ---------------------------------------------------
3482
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3483
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3484
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3485
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3486
- *
3487
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3488
- * the Software.
3489
- *
3490
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3491
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3492
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3493
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3494
- * IN THE SOFTWARE.
3495
- */
3496
-
3497
-
3498
-
3499
-
3500
-
3501
- /* harmony default export */ const use_popover_init = (function (props, ctx, _ref) {
3502
- var refReference = _ref.refReference,
3503
- refContent = _ref.refContent,
3504
- refArrow = _ref.refArrow,
3505
- refRoot = _ref.refRoot;
3506
- var storeEvents = null;
3507
- var isFullscreen = (0,external_vue_namespaceObject.ref)(false);
3508
- var fullscreenReferId = getFullscreenUid();
3509
- var fullScreenTarget = (0,external_vue_namespaceObject.ref)();
3510
- var _useFloating = use_floating(props, ctx, {
3511
- refReference: refReference,
3512
- refContent: refContent,
3513
- refArrow: refArrow,
3514
- refRoot: refRoot
3515
- }),
3516
- localIsShow = _useFloating.localIsShow,
3517
- showPopover = _useFloating.showPopover,
3518
- hidePopover = _useFloating.hidePopover,
3519
- updatePopover = _useFloating.updatePopover,
3520
- cleanup = _useFloating.cleanup,
3521
- resolveTriggerEvents = _useFloating.resolveTriggerEvents,
3522
- resolvePopElements = _useFloating.resolvePopElements,
3523
- isElementFullScreen = _useFloating.isElementFullScreen,
3524
- updateFullscreenTarget = _useFloating.updateFullscreenTarget,
3525
- createPopInstance = _useFloating.createPopInstance,
3526
- getFullscreenRoot = _useFloating.getFullscreenRoot,
3527
- stopHide = _useFloating.stopHide;
3528
- var resetPopover = function resetPopover() {
3529
- cleanup === null || cleanup === void 0 ? void 0 : cleanup();
3530
- createPopInstance();
3531
- };
3532
- var showFn = function showFn() {
3533
- showPopover();
3534
- };
3535
- var hideFn = function hideFn() {
3536
- hidePopover();
3537
- };
3538
- var initPopInstance = function initPopInstance() {
3539
- createPopInstance();
3540
- if (props.always) {
3541
- showPopover();
3542
- } else {
3543
- addEventToPopTargetEl();
3544
- }
3545
- };
3546
- var addEventToPopTargetEl = function addEventToPopTargetEl() {
3547
- var _resolvePopElements = resolvePopElements(),
3548
- elReference = _resolvePopElements.elReference,
3549
- elContent = _resolvePopElements.elContent;
3550
- storeEvents = resolveTriggerEvents();
3551
- if (Array.isArray(storeEvents)) {
3552
- addEventToTargetEl(elReference, storeEvents);
3553
- } else {
3554
- var _storeEvents = storeEvents,
3555
- content = _storeEvents.content,
3556
- reference = _storeEvents.reference;
3557
- addEventToTargetEl(elReference, reference);
3558
- addEventToTargetEl(elContent, content);
3559
- }
3560
- };
3561
- var addEventToTargetEl = function addEventToTargetEl(target, evets) {
3562
- evets.forEach(function (_ref2) {
3563
- var _ref3 = _slicedToArray(_ref2, 2),
3564
- event = _ref3[0],
3565
- listener = _ref3[1];
3566
- if (event && typeof listener === 'function') {
3567
- target.addEventListener(event, listener);
3568
- }
3569
- });
3570
- };
3571
- var removeEventListener = function removeEventListener() {
3572
- if (storeEvents === null || storeEvents === void 0 ? void 0 : storeEvents.length) {
3573
- var _resolvePopElements2 = resolvePopElements(),
3574
- elReference = _resolvePopElements2.elReference;
3575
- if (elReference) {
3576
- storeEvents.forEach(function (_ref4) {
3577
- var _ref5 = _slicedToArray(_ref4, 2),
3578
- event = _ref5[0],
3579
- listener = _ref5[1];
3580
- if (event && typeof listener === 'function') {
3581
- elReference.removeEventListener(event, listener);
3582
- }
3583
- });
3584
- }
3585
- storeEvents = null;
3586
- }
3587
- };
3588
- var updateBoundary = function updateBoundary() {
3589
- var _resolvePopElements3 = resolvePopElements(),
3590
- elReference = _resolvePopElements3.elReference,
3591
- root = _resolvePopElements3.root;
3592
- if (isFullscreen.value) {
3593
- boundary.value = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value;
3594
- return;
3595
- }
3596
- boundary.value = getPrefixId(root || elReference);
3597
- };
3598
- var _usePopperId = use_popper_id(props, '#'),
3599
- getPrefixId = _usePopperId.getPrefixId;
3600
- var setFullscreenTag = function setFullscreenTag() {
3601
- var _a;
3602
- (_a = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value) === null || _a === void 0 ? void 0 : _a.setAttribute('data-fllsrn-id', fullscreenReferId);
3603
- };
3604
- var clearFullscreenTag = function clearFullscreenTag() {
3605
- var _a, _b;
3606
- var query = "[data-fllsrn-id=".concat(fullscreenReferId, "]");
3607
- ((_b = (_a = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value) === null || _a === void 0 ? void 0 : _a.querySelectorAll(query)) !== null && _b !== void 0 ? _b : []).forEach(function (element) {
3608
- element === null || element === void 0 ? void 0 : element.removeAttribute('data-fllsrn-id');
3609
- });
3610
- };
3611
- var boundary = (0,external_vue_namespaceObject.ref)();
3612
- var beforeInstanceUnmount = function beforeInstanceUnmount() {
3613
- removeEventListener();
3614
- };
3615
- var updateFullscreen = function updateFullscreen(target) {
3616
- fullScreenTarget.value = target;
3617
- updateFullscreenTarget(target);
3618
- isFullscreen.value = isElementFullScreen();
3619
- setFullscreenTag();
3620
- };
3621
- var handleFullscreenChange = function handleFullscreenChange(e) {
3622
- if (!document.fullscreenElement) {
3623
- clearFullscreenTag();
3624
- }
3625
- updateFullscreen(e.target);
3626
- updateBoundary();
3627
- updatePopover(null, props);
3628
- };
3629
- var onMountedFn = function onMountedFn() {
3630
- if (props.disabled) {
3631
- return;
3632
- }
3633
- initPopInstance();
3634
- if (isElementFullScreen()) {
3635
- var query = "[data-fllsrn-id=".concat(fullscreenReferId, "]");
3636
- var target = getFullscreenRoot(query);
3637
- updateFullscreen(target);
3638
- }
3639
- updateBoundary();
3640
- document.body.addEventListener('fullscreenchange', handleFullscreenChange);
3641
- };
3642
- var onUnmountedFn = function onUnmountedFn() {
3643
- beforeInstanceUnmount();
3644
- document.body.removeEventListener('fullscreenchange', handleFullscreenChange);
3645
- };
3646
- var handleClickOutside = function handleClickOutside(_e) {
3647
- ctx.emit(EMIT_EVENTS.CLICK_OUTSIDE, {
3648
- isShow: localIsShow.value,
3649
- event: _e
3650
- });
3651
- var needExec = props.disableOutsideClick || props.always || props.disabled || props.trigger === 'manual';
3652
- if (!props.forceClickoutside && needExec) {
3653
- return;
3654
- }
3655
- if (localIsShow.value) {
3656
- hideFn();
3657
- }
3658
- };
3659
- return {
3660
- onMountedFn: onMountedFn,
3661
- onUnmountedFn: onUnmountedFn,
3662
- handleClickOutside: handleClickOutside,
3663
- beforeInstanceUnmount: beforeInstanceUnmount,
3664
- updateBoundary: updateBoundary,
3665
- initPopInstance: initPopInstance,
3666
- updatePopover: updatePopover,
3667
- resetPopover: resetPopover,
3668
- showPopover: showPopover,
3669
- hidePopover: hidePopover,
3670
- showFn: showFn,
3671
- hideFn: hideFn,
3672
- stopHide: stopHide,
3673
- isFullscreen: isFullscreen,
3674
- boundary: boundary,
3675
- localIsShow: localIsShow
3676
- };
3677
- });
3678
- ;// CONCATENATED MODULE: ../../packages/popover/src/popover.tsx
3679
-
3680
- /*
3681
- * Tencent is pleased to support the open source community by making
3682
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3683
- *
3684
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3685
- *
3686
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3687
- *
3688
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3689
- *
3690
- * ---------------------------------------------------
3691
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3692
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3693
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3694
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3695
- *
3696
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3697
- * the Software.
3698
- *
3699
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3700
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3701
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3702
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3703
- * IN THE SOFTWARE.
3704
- */
3705
-
3706
-
3707
-
3708
-
3709
-
3710
-
3711
-
3712
-
3713
-
3714
-
3715
-
3716
- function _isSlot(s) {
3717
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
3718
- }
3719
- /* harmony default export */ const popover = ((0,external_vue_namespaceObject.defineComponent)({
3720
- name: 'Popover',
3721
- components: {
3722
- // eslint-disable-next-line vue/no-reserved-component-names
3723
- Content: content,
3724
- Arrow: src_arrow,
3725
- Root: root
3726
- },
3727
- directives: {
3728
- clickoutside: clickoutside
3729
- },
3730
- props: PopoverProps,
3731
- emits: EMIT_EVENT_TYPES,
3732
- setup: function setup(props, ctx) {
3733
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
3734
- reference = _toRefs.reference;
3735
- var refDefaultReference = (0,external_vue_namespaceObject.ref)();
3736
- var refContent = (0,external_vue_namespaceObject.ref)();
3737
- var refArrow = (0,external_vue_namespaceObject.ref)();
3738
- var refRoot = (0,external_vue_namespaceObject.ref)();
3739
- var refReference = (0,external_vue_namespaceObject.computed)(function () {
3740
- return reference.value || refDefaultReference.value;
3741
- });
3742
- var _usePopoverInit = use_popover_init(props, ctx, {
3743
- refReference: refReference,
3744
- refContent: refContent,
3745
- refArrow: refArrow,
3746
- refRoot: refRoot
3747
- }),
3748
- onMountedFn = _usePopoverInit.onMountedFn,
3749
- onUnmountedFn = _usePopoverInit.onUnmountedFn,
3750
- handleClickOutside = _usePopoverInit.handleClickOutside,
3751
- beforeInstanceUnmount = _usePopoverInit.beforeInstanceUnmount,
3752
- updateBoundary = _usePopoverInit.updateBoundary,
3753
- initPopInstance = _usePopoverInit.initPopInstance,
3754
- showFn = _usePopoverInit.showFn,
3755
- hideFn = _usePopoverInit.hideFn,
3756
- showPopover = _usePopoverInit.showPopover,
3757
- hidePopover = _usePopoverInit.hidePopover,
3758
- updatePopover = _usePopoverInit.updatePopover,
3759
- resetPopover = _usePopoverInit.resetPopover,
3760
- stopHide = _usePopoverInit.stopHide,
3761
- localIsShow = _usePopoverInit.localIsShow,
3762
- boundary = _usePopoverInit.boundary;
3763
- if (!props.always && !props.disabled) {
3764
- (0,external_vue_namespaceObject.watch)(function () {
3765
- return props.isShow;
3766
- }, function () {
3767
- props.isShow ? showPopover() : hidePopover();
3768
- }, {
3769
- immediate: true
3770
- });
3771
- }
3772
- (0,external_vue_namespaceObject.watch)(function () {
3773
- return [props.disabled];
3774
- }, function (val) {
3775
- if (val[0]) {
3776
- beforeInstanceUnmount();
3777
- } else {
3778
- initPopInstance();
3779
- }
3780
- });
3781
- updateBoundary();
3782
- (0,external_vue_namespaceObject.onMounted)(onMountedFn);
3783
- (0,external_vue_namespaceObject.onBeforeUnmount)(onUnmountedFn);
3784
- var transBoundary = (0,external_vue_namespaceObject.computed)(function () {
3785
- return !props.disableTeleport;
3786
- });
3787
- var show = function show() {
3788
- showFn();
3789
- };
3790
- var hide = function hide() {
3791
- hideFn();
3792
- };
3793
- var contentIsShow = (0,external_vue_namespaceObject.computed)(function () {
3794
- if (props.renderType === external_shared_namespaceObject.RenderType.AUTO) {
3795
- return true;
3796
- }
3797
- return localIsShow.value;
3798
- });
3799
- var renderContent = function renderContent() {
3800
- if (props.allowHtml) {
3801
- var _contentAsHTMLElement = contentAsHTMLElement(props.content),
3802
- vNode = _contentAsHTMLElement.vNode;
3803
- return vNode;
3804
- }
3805
- return props.content;
3806
- };
3807
- return {
3808
- boundary: boundary,
3809
- arrow: props.arrow,
3810
- refDefaultReference: refDefaultReference,
3811
- refContent: refContent,
3812
- refArrow: refArrow,
3813
- content: props.content,
3814
- theme: props.theme,
3815
- transBoundary: transBoundary,
3816
- handleClickOutside: handleClickOutside,
3817
- updatePopover: updatePopover,
3818
- resetPopover: resetPopover,
3819
- hide: hide,
3820
- show: show,
3821
- stopHide: stopHide,
3822
- contentIsShow: contentIsShow,
3823
- renderContent: renderContent,
3824
- localIsShow: localIsShow
3825
- };
3826
- },
3827
- render: function render() {
3828
- var _this = this;
3829
- var _slot;
3830
- var _a, _b, _c, _d, _e, _f;
3831
- var renderReferSlot = function renderReferSlot(slot) {
3832
- var _a;
3833
- if (external_vue_namespaceObject.Text === ((_a = slot === null || slot === void 0 ? void 0 : slot[0]) === null || _a === void 0 ? void 0 : _a.type)) {
3834
- return (0,external_vue_namespaceObject.createVNode)("span", null, [slot]);
3835
- }
3836
- return slot;
3837
- };
3838
- return (0,external_vue_namespaceObject.createVNode)(root, {
3839
- "ref": "refRoot"
3840
- }, {
3841
- "default": function _default() {
3842
- return [(0,external_vue_namespaceObject.createVNode)(reference, {
3843
- "ref": "refDefaultReference"
3844
- }, _isSlot(_slot = renderReferSlot((_c = (_b = (_a = _this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (0,external_vue_namespaceObject.createVNode)("span", null, null))) ? _slot : {
3845
- "default": function _default() {
3846
- return [_slot];
3847
- }
3848
- }), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Teleport, {
3849
- "to": _this.boundary,
3850
- "disabled": !_this.transBoundary
3851
- }, {
3852
- "default": function _default() {
3853
- return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)(content, {
3854
- "ref": "refContent",
3855
- "visible": _this.localIsShow,
3856
- "data-theme": _this.theme,
3857
- "extCls": _this.extCls,
3858
- "width": _this.width,
3859
- "height": _this.height,
3860
- "maxWidth": _this.maxWidth,
3861
- "maxHeight": _this.maxHeight,
3862
- "eventDelay": _this.componentEventDelay
3863
- }, {
3864
- "default": function _default() {
3865
- return [_this.contentIsShow ? (_f = (_e = (_d = _this.$slots).content) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : _this.renderContent() : ''];
3866
- },
3867
- arrow: function arrow() {
3868
- var _a, _b;
3869
- return _this.arrow ? (0,external_vue_namespaceObject.createVNode)(src_arrow, {
3870
- "ref": "refArrow"
3871
- }, {
3872
- "default": function _default() {
3873
- return [(_b = (_a = _this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a)];
3874
- }
3875
- }) : '';
3876
- }
3877
- }), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]])];
3878
- }
3879
- })];
3880
- }
3881
- });
3882
- }
3883
- }));
3884
- ;// CONCATENATED MODULE: ../../packages/popover/src/plugin-popover.tsx
3885
-
3886
-
3887
- /*
3888
- * Tencent is pleased to support the open source community by making
3889
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3890
- *
3891
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3892
- *
3893
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3894
- *
3895
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3896
- *
3897
- * ---------------------------------------------------
3898
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3899
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3900
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3901
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3902
- *
3903
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3904
- * the Software.
3905
- *
3906
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3907
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3908
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3909
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3910
- * IN THE SOFTWARE.
3911
- */
3912
-
3913
-
3914
-
3915
-
3916
- function createPopoverComponent(options) {
3917
- var $PopoverInstance = null;
3918
- var $PopoverInstanceVm = null;
3919
- var $PopoverInstanceEl = null;
3920
- var resolvedOptions = Object.assign(Object.assign({
3921
- boundary: 'body',
3922
- placement: 'top',
3923
- autoVisibility: true,
3924
- isShow: false,
3925
- trigger: 'manual'
3926
- }, options), {
3927
- allowHtml: true
3928
- });
3929
- var popoverComponent = {
3930
- name: '$popover',
3931
- setup: function setup(_, _ref) {
3932
- var expose = _ref.expose;
3933
- var formatOptions = function formatOptions() {
3934
- return Object.keys(PopoverProps).reduce(function (result, key) {
3935
- if (Object.prototype.hasOwnProperty.call(resolvedOptions, key)) {
3936
- Object.assign(result, _defineProperty({}, key, resolvedOptions[key]));
3937
- }
3938
- return result;
3939
- }, {
3940
- target: resolvedOptions.target
3941
- });
3942
- };
3943
- var refProps = (0,external_vue_namespaceObject.reactive)(formatOptions());
3944
- var refReference = (0,external_vue_namespaceObject.ref)();
3945
- var show = function show() {
3946
- var _a, _b;
3947
- (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a);
3948
- };
3949
- var hide = function hide() {
3950
- var _a, _b;
3951
- (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.hide) === null || _b === void 0 ? void 0 : _b.call(_a);
3952
- };
3953
- var stopHide = function stopHide() {
3954
- var _a, _b;
3955
- (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.stopHide) === null || _b === void 0 ? void 0 : _b.call(_a);
3956
- };
3957
- var updateTarget = function updateTarget(target) {
3958
- var _a, _b;
3959
- refProps.target = target;
3960
- (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.resetPopover) === null || _b === void 0 ? void 0 : _b.call(_a);
3961
- };
3962
- var handleContentMouseenter = function handleContentMouseenter() {
3963
- var _a;
3964
- (_a = resolvedOptions.onContentMouseenter) === null || _a === void 0 ? void 0 : _a.call(resolvedOptions);
3965
- };
3966
- var handleContentMouseleave = function handleContentMouseleave() {
3967
- var _a;
3968
- (_a = resolvedOptions.onContentMouseleave) === null || _a === void 0 ? void 0 : _a.call(resolvedOptions);
3969
- };
3970
- expose({
3971
- show: show,
3972
- hide: hide,
3973
- updateTarget: updateTarget,
3974
- stopHide: stopHide
3975
- });
3976
- return function () {
3977
- return (0,external_vue_namespaceObject.createVNode)(popover, (0,external_vue_namespaceObject.mergeProps)(refProps, {
3978
- "ref": refReference,
3979
- "onContentMouseenter": handleContentMouseenter,
3980
- "onContentMouseleave": handleContentMouseleave
3981
- }), null);
3982
- };
3983
- }
3984
- };
3985
- function getBoundaryDom(boundary) {
3986
- if (/^body$/i.test(boundary)) {
3987
- return document.body;
3988
- }
3989
- if (/^parent$/i.test(boundary)) {
3990
- if (utils_isElement(resolvedOptions.target)) {
3991
- return resolvedOptions.target.parentNode;
3992
- }
3993
- return resolvedOptions.target.target.parentNode;
3994
- }
3995
- if (typeof boundary === 'string' && isAvailableId(boundary)) {
3996
- return document.querySelector(boundary);
3997
- }
3998
- return document.body;
3999
- }
4000
- if ($PopoverInstance === null) {
4001
- $PopoverInstanceEl = document.createElement('div');
4002
- getBoundaryDom(resolvedOptions.boundary).append($PopoverInstanceEl);
4003
- $PopoverInstance = (0,external_vue_namespaceObject.createApp)(popoverComponent);
4004
- $PopoverInstanceVm = $PopoverInstance.mount($PopoverInstanceEl);
4005
- }
4006
- function close() {
4007
- if ($PopoverInstance) {
4008
- $PopoverInstance.unmount();
4009
- $PopoverInstanceVm = null;
4010
- $PopoverInstance = null;
4011
- $PopoverInstanceEl.remove();
4012
- }
4013
- }
4014
- function show() {
4015
- $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.show();
4016
- }
4017
- function update(e) {
4018
- $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.updateTarget(e);
4019
- }
4020
- function hide() {
4021
- $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.hide();
4022
- }
4023
- return {
4024
- close: close,
4025
- show: show,
4026
- hide: hide,
4027
- update: update,
4028
- get vm() {
4029
- return $PopoverInstanceVm;
4030
- },
4031
- get $el() {
4032
- return $PopoverInstanceVm.$el;
4033
- }
4034
- };
4035
- }
4036
- ;// CONCATENATED MODULE: ../../packages/plugin-popover/src/index.ts
4037
- /**
4038
- * Tencent is pleased to support the open source community by making
4039
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
4040
- *
4041
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4042
- *
4043
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
4044
- *
4045
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
4046
- *
4047
- * ---------------------------------------------------
4048
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4049
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
4050
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
4051
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4052
- *
4053
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
4054
- * the Software.
4055
- *
4056
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
4057
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4058
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
4059
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
4060
- * IN THE SOFTWARE.
4061
- */
4062
-
4063
- /* harmony default export */ const src = (createPopoverComponent);
4064
- })();
4065
-
4066
- var __webpack_exports__default = __webpack_exports__.Z;
4067
- export { __webpack_exports__default as default };
1
+ import*as e from"vue";import*as t from"../shared";import*as n from"../config-provider";import*as o from"vue-types";import*as r from"lodash";var i={8022:(e,t,n)=>{var o=n(4481),r=n(6426),i=r;i.v1=o,i.v4=r,e.exports=i},8725:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var o=n||0,r=t;return[r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]]].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 o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},4481:(e,t,n)=>{var o,r,i=n(9157),l=n(8725),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,s=t||[],f=(e=e||{}).node||o,d=void 0!==e.clockseq?e.clockseq:r;if(null==f||null==d){var p=i();null==f&&(f=o=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=r=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,y=v-a+(m-u)/1e4;if(y<0&&void 0===e.clockseq&&(d=d+1&16383),(y<0||v>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=v,u=m,r=d;var h=(1e4*(268435455&(v+=122192928e5))+m)%4294967296;s[c++]=h>>>24&255,s[c++]=h>>>16&255,s[c++]=h>>>8&255,s[c++]=255&h;var g=v/4294967296*1e4&268435455;s[c++]=g>>>8&255,s[c++]=255&g,s[c++]=g>>>24&15|16,s[c++]=g>>>16&255,s[c++]=d>>>8|128,s[c++]=255&d;for(var b=0;b<6;++b)s[c+b]=f[b];return t||l(s)}},6426:(e,t,n)=>{var o=n(9157),r=n(8725);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var l=(e=e||{}).random||(e.rng||o)();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t)for(var a=0;a<16;++a)t[i+a]=l[a];return t||r(l)}}},l={};function a(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[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);var u={};(()=>{function i(e){return i="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},i(e)}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}a.d(u,{Z:()=>Ye});const c=(s={Fragment:()=>e.Fragment,Teleport:()=>e.Teleport,Text:()=>e.Text,computed:()=>e.computed,createApp:()=>e.createApp,createVNode:()=>e.createVNode,defineComponent:()=>e.defineComponent,isVNode:()=>e.isVNode,mergeProps:()=>e.mergeProps,nextTick:()=>e.nextTick,onBeforeUnmount:()=>e.onBeforeUnmount,onMounted:()=>e.onMounted,reactive:()=>e.reactive,ref:()=>e.ref,resolveDirective:()=>e.resolveDirective,toRefs:()=>e.toRefs,watch:()=>e.watch,withDirectives:()=>e.withDirectives},f={},a.d(f,s),f);var s,f;const d=(e=>{var t={};return a.d(t,e),t})({PlacementEnum:()=>t.PlacementEnum,PropTypes:()=>t.PropTypes,RenderType:()=>t.RenderType,bkZIndexManager:()=>t.bkZIndexManager,placementType:()=>t.placementType,renderType:()=>t.renderType,triggerType:()=>t.triggerType});function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(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)?v(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){a=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(a)throw i}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var m,y=new Map;function h(e,t){var n,o=[];return Array.isArray(t.arg)?o=t.arg:(n=t.arg,"undefined"!=typeof Element&&n instanceof Element&&o.push(t.arg)),function(n,r){var i=t.instance.popperRef,l=n.target,a=null==r?void 0:r.target,u=!t||!t.instance,c=!l||!a,s=e.contains(l)||e.contains(a),f=e===l,d=o.length&&o.some((function(e){return null==e?void 0:e.contains(l)}))||o.length&&o.includes(a),p=i&&(i.contains(l)||i.contains(a));u||c||s||f||d||p||t.value(n,r)}}document.addEventListener("mousedown",(function(e){return m=e})),document.addEventListener("mouseup",(function(e){var t,n=p(y.values());try{for(n.s();!(t=n.n()).done;){var o,r=p(t.value);try{for(r.s();!(o=r.n()).done;)(0,o.value.documentHandler)(e,m)}catch(e){r.e(e)}finally{r.f()}}}catch(e){n.e(e)}finally{n.f()}}));var g={beforeMount:function(e,t){y.has(e)||y.set(e,[]),y.get(e).push({documentHandler:h(e,t),bindingFn:t.value})},updated:function(e,t){y.has(e)||y.set(e,[]);var n=y.get(e),o=n.findIndex((function(e){return e.bindingFn===t.oldValue})),r={documentHandler:h(e,t),bindingFn:t.value};o>=0?n.splice(o,1,r):n.push(r)},unmounted:function(e){y.delete(e)},install:function(e){e.directive("bkTooltips",g)}};const b=g,w=(e=>{var t={};return a.d(t,e),t})({usePrefix:()=>n.usePrefix}),T=(0,c.defineComponent)({name:"PopArrow",render:function(){var e=(0,(0,w.usePrefix)().resolveClassName)("pop2-arrow");return(0,c.createVNode)("div",{class:e},null)}});var x,P;!function(e){e.CLICK_OUTSIDE="clickoutside",e.CONTENT_MOUSEENTER="contentMouseenter",e.CONTENT_MOUSELEAVE="contentMouseleave",e.CONTENT_AfterHidden="afterHidden",e.CONTENT_AfterShow="afterShow"}(P||(P={}));var E=function(e){return!0},C=function(e){return e},R=(l(x={},P.CLICK_OUTSIDE,(function(e){return!0})),l(x,P.CONTENT_MOUSEENTER,C),l(x,P.CONTENT_MOUSELEAVE,C),l(x,P.CONTENT_AfterHidden,E),l(x,P.CONTENT_AfterShow,E),x);const O=(0,c.defineComponent)({name:"PopContent",props:{width:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),height:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),maxHeight:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),maxWidth:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),extCls:d.PropTypes.string.def(""),visible:d.PropTypes.bool.def(!1),eventDelay:d.PropTypes.number.def(0)},setup:function(e){var t=function(e){return/^\d+\.?\d*$/.test("".concat(e))?"".concat(e,"px"):e},n=(0,c.computed)((function(){return{width:t(e.width),height:t(e.height),maxHeight:t(e.maxHeight),maxWidth:t(e.maxWidth)}})),o=(0,c.ref)(null),r=(0,c.ref)(null),i=function(t){var n;0!==e.eventDelay&&(null===(n=o.value)||void 0===n||n.style.setProperty("pointer-events",t))},l=(0,w.usePrefix)().resolveClassName;return{style:n,refContent:o,resolveClassName:l,resetPointerEvent:function(){var t;0!==e.eventDelay&&(r.value&&clearTimeout(r.value),r.value=setTimeout((function(){i("unset")}),null!==(t=e.eventDelay)&&void 0!==t?t:300))},setContentPointerEvent:i}},render:function(){var e,t,n,o,r,i,l,a,u=this,s=[this.resolveClassName("popover"),this.resolveClassName("pop2-content"),this.extCls],f=function(e){var t;return c.Fragment===(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.type)&&(0,c.nextTick)((function(){u.setContentPointerEvent("none"),u.resetPointerEvent()})),u.style}(null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e));return(0,c.createVNode)("div",{class:s,style:f,ref:"refContent"},[null!==(r=null===(o=(n=this.$slots).arrow)||void 0===o?void 0:o.call(n))&&void 0!==r?r:"",null!==(a=null===(l=(i=this.$slots).default)||void 0===l?void 0:l.call(i))&&void 0!==a?a:""])}}),A=(e=>{var t={};return a.d(t,e),t})({toType:()=>o.toType});var S={isShow:d.PropTypes.bool.def(!1),always:d.PropTypes.bool.def(!1),disabled:d.PropTypes.bool.def(!1),width:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),height:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),maxWidth:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),maxHeight:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.number]).def("auto"),content:(0,A.toType)("IContent",{}).def(""),target:d.PropTypes.oneOfType([d.PropTypes.string,d.PropTypes.instanceOf(HTMLElement),d.PropTypes.instanceOf(PointerEvent)]),allowHtml:d.PropTypes.bool.def(!1),placement:(0,d.placementType)().def(d.PlacementEnum.TOP_START),theme:d.PropTypes.string.def("dark"),trigger:(0,d.triggerType)(),renderType:(0,d.renderType)(),arrow:d.PropTypes.bool.def(!0),padding:d.PropTypes.number.def(5),offset:d.PropTypes.oneOfType([d.PropTypes.number,d.PropTypes.shape({mainAxis:d.PropTypes.number,crossAxis:d.PropTypes.number,alignmentAxis:d.PropTypes.number})]).def(6),boundary:d.PropTypes.oneOfType([d.PropTypes.string.def("parent"),d.PropTypes.instanceOf(HTMLElement)]),zIndex:d.PropTypes.number.def(void 0),disableTeleport:d.PropTypes.bool.def(!1),autoPlacement:d.PropTypes.bool.def(!1),autoVisibility:d.PropTypes.bool.def(!0),disableOutsideClick:d.PropTypes.bool.def(!1),disableTransform:d.PropTypes.bool.def(!1),reference:d.PropTypes.any,modifiers:d.PropTypes.array.def([]),popoverDelay:d.PropTypes.oneOfType([d.PropTypes.number,d.PropTypes.arrayOf(d.PropTypes.number)]).def(100),extCls:d.PropTypes.string.def(""),componentEventDelay:d.PropTypes.number.def(0),forceClickoutside:d.PropTypes.bool.def(!1)};const N=(0,c.defineComponent)({name:"PopReference",render:function(){var e,t,n;return null!==(n=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==n?n:""}}),L=(0,c.defineComponent)({props:{class:d.PropTypes.string.def(""),mode:d.PropTypes.string.def("")},render:function(){var e,t;return(0,c.createVNode)(c.Fragment,null,[null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e)])}});function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,l,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=i.call(n)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(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)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const H=(e=>{var t={};return a.d(t,e),t})({isElement:()=>r.isElement}),k=["top","right","bottom","left"],M=["start","end"],F=k.reduce(((e,t)=>e.concat(t,t+"-"+M[0],t+"-"+M[1])),[]),V=Math.min,j=Math.max,$=Math.round,B=Math.floor,_=e=>({x:e,y:e}),U={left:"right",right:"left",bottom:"top",top:"bottom"},W={start:"end",end:"start"};function q(e,t,n){return j(e,V(t,n))}function z(e,t){return"function"==typeof e?e(t):e}function Z(e){return e.split("-")[0]}function K(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function Y(e){return"y"===e?"height":"width"}function G(e){return["top","bottom"].includes(Z(e))?"y":"x"}function J(e){return X(G(e))}function Q(e,t,n){void 0===n&&(n=!1);const o=K(e),r=J(e),i=Y(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=te(l)),[l,te(l)]}function ee(e){return e.replace(/start|end/g,(e=>W[e]))}function te(e){return e.replace(/left|right|bottom|top/g,(e=>U[e]))}function ne(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function oe(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function re(e,t,n){let{reference:o,floating:r}=e;const i=G(t),l=J(t),a=Y(l),u=Z(t),c="y"===i,s=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2;let p;switch(u){case"top":p={x:s,y:o.y-r.height};break;case"bottom":p={x:s,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(K(t)){case"start":p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}async function ie(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=z(t,e),v=ne(p),m=a[d?"floating"===f?"reference":"floating":f],y=oe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:s,strategy:u})),h="floating"===f?{...l.floating,x:o,y:r}:l.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=oe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h,offsetParent:g,strategy:u}):h);return{top:(y.top-w.top+v.top)/b.y,bottom:(w.bottom-y.bottom+v.bottom)/b.y,left:(y.left-w.left+v.left)/b.x,right:(w.right-y.right+v.right)/b.x}}function le(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ae(e){return k.some((t=>e[t]>=0))}function ue(e){const t=V(...e.map((e=>e.left))),n=V(...e.map((e=>e.top)));return{x:t,y:n,width:j(...e.map((e=>e.right)))-t,height:j(...e.map((e=>e.bottom)))-n}}const ce=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,r=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=Z(n),a=K(n),u="y"===G(n),c=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=z(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof v&&(p="end"===a?-1*v:v),u?{x:p*s,y:d*c}:{x:d*c,y:p*s}}(t,e);return{x:n+r.x,y:o+r.y,data:r}}}},se=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=z(e,t),c={x:n,y:o},s=await ie(t,u),f=G(Z(r)),d=X(f);let p=c[d],v=c[f];if(i){const e="y"===d?"bottom":"right";p=q(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";v=q(v+s["y"===f?"top":"left"],v,v-s[e])}const m=a.fn({...t,[d]:p,[f]:v});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function fe(e){return ve(e)?(e.nodeName||"").toLowerCase():"#document"}function de(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function pe(e){var t;return null==(t=(ve(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ve(e){return e instanceof Node||e instanceof de(e).Node}function me(e){return e instanceof Element||e instanceof de(e).Element}function ye(e){return e instanceof HTMLElement||e instanceof de(e).HTMLElement}function he(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof de(e).ShadowRoot)}function ge(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function be(e){return["table","td","th"].includes(fe(e))}function we(e){const t=Te(),n=Pe(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Te(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function xe(e){return["html","body","#document"].includes(fe(e))}function Pe(e){return de(e).getComputedStyle(e)}function Ee(e){return me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ce(e){if("html"===fe(e))return e;const t=e.assignedSlot||e.parentNode||he(e)&&e.host||pe(e);return he(t)?t.host:t}function Re(e){const t=Ce(e);return xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&&ge(t)?t:Re(t)}function Oe(e,t){var n;void 0===t&&(t=[]);const o=Re(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=de(o);return r?t.concat(i,i.visualViewport||[],ge(o)?o:[]):t.concat(o,Oe(o))}function Ae(e){const t=Pe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ye(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,a=$(n)!==i||$(o)!==l;return a&&(n=i,o=l),{width:n,height:o,$:a}}function Se(e){return me(e)?e:e.contextElement}function Ne(e){const t=Se(e);if(!ye(t))return _(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ae(t);let l=(i?$(n.width):n.width)/o,a=(i?$(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const Le=_(0);function De(e){const t=de(e);return Te()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Le}function Ie(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Se(e);let l=_(1);t&&(o?me(o)&&(l=Ne(o)):l=Ne(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==de(e))&&t}(i,n,o)?De(i):_(0);let u=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,s=r.width/l.x,f=r.height/l.y;if(i){const e=de(i),t=o&&me(o)?de(o):o;let n=e.frameElement;for(;n&&o&&t!==e;){const e=Ne(n),t=n.getBoundingClientRect(),o=Pe(n),r=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;u*=e.x,c*=e.y,s*=e.x,f*=e.y,u+=r,c+=i,n=de(n).frameElement}}return oe({width:s,height:f,x:u,y:c})}function He(e){return Ie(pe(e)).left+Ee(e).scrollLeft}function ke(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=de(e),o=pe(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,u=0;if(r){i=r.width,l=r.height;const e=Te();(!e||e&&"fixed"===t)&&(a=r.offsetLeft,u=r.offsetTop)}return{width:i,height:l,x:a,y:u}}(e,n);else if("document"===t)o=function(e){const t=pe(e),n=Ee(e),o=e.ownerDocument.body,r=j(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=j(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+He(e);const a=-n.scrollTop;return"rtl"===Pe(o).direction&&(l+=j(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}(pe(e));else if(me(t))o=function(e,t){const n=Ie(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ye(e)?Ne(e):_(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=De(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return oe(o)}function Me(e,t){const n=Ce(e);return!(n===t||!me(n)||xe(n))&&("fixed"===Pe(n).position||Me(n,t))}function Fe(e,t,n){const o=ye(t),r=pe(t),i="fixed"===n,l=Ie(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=_(0);if(o||!o&&!i)if(("body"!==fe(t)||ge(r))&&(a=Ee(t)),o){const e=Ie(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else r&&(u.x=He(r));return{x:l.left+a.scrollLeft-u.x,y:l.top+a.scrollTop-u.y,width:l.width,height:l.height}}function Ve(e,t){return ye(e)&&"fixed"!==Pe(e).position?t?t(e):e.offsetParent:null}function je(e,t){const n=de(e);if(!ye(e))return n;let o=Ve(e,t);for(;o&&be(o)&&"static"===Pe(o).position;)o=Ve(o,t);return o&&("html"===fe(o)||"body"===fe(o)&&"static"===Pe(o).position&&!we(o))?n:o||function(e){let t=Ce(e);for(;ye(t)&&!xe(t);){if(we(t))return t;t=Ce(t)}return null}(e)||n}const $e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:o}=e;const r=ye(n),i=pe(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a=_(1);const u=_(0);if((r||!r&&"fixed"!==o)&&(("body"!==fe(n)||ge(i))&&(l=Ee(n)),ye(n))){const e=Ie(n);a=Ne(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+u.x,y:t.y*a.y-l.scrollTop*a.y+u.y}},getDocumentElement:pe,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let o=Oe(e).filter((e=>me(e)&&"body"!==fe(e))),r=null;const i="fixed"===Pe(e).position;let l=i?Ce(e):e;for(;me(l)&&!xe(l);){const t=Pe(l),n=we(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||ge(l)&&!n&&Me(e,l))?o=o.filter((e=>e!==l)):r=t,l=Ce(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=i[0],a=i.reduce(((e,n)=>{const o=ke(t,n,r);return e.top=j(o.top,e.top),e.right=V(o.right,e.right),e.bottom=V(o.bottom,e.bottom),e.left=j(o.left,e.left),e}),ke(t,l,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:je,getElementRects:async function(e){let{reference:t,floating:n,strategy:o}=e;const r=this.getOffsetParent||je,i=this.getDimensions;return{reference:Fe(t,await r(n),o),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return Ae(e)},getScale:Ne,isElement:me,isRTL:function(e){return"rtl"===Pe(e).direction}};var Be=a(8022),_e={},Ue=function(e){return document.querySelector(e)instanceof HTMLElement},We=function(e){return e instanceof Element||e instanceof HTMLDocument},qe=function(e){if(We(e))return{isElement:!0,content:e,vNode:void 0};if(/^(#|\.)/.test(e)){var t=document.querySelector(e),n=We(t);return{isElement:n,content:n?t:e,vNode:n?void 0:e}}return{isElement:!1,content:e,vNode:e}};const ze=function(e,t,n){var o=n.refReference,r=n.refContent,i=n.refArrow,a=n.refRoot,u=(0,c.ref)(!1),s=(0,c.ref)(),f=function(){var e,t,n=g();return(null===(e=document.fullscreenElement)||void 0===e?void 0:e.shadowRoot)?document.fullscreenElement.shadowRoot.contains(n):null===(t=document.fullscreenElement)||void 0===t?void 0:t.contains(n)},p=["dark","light"],v=(0,c.computed)((function(){var t,n,o=null!==(n=null===(t=e.theme)||void 0===t?void 0:t.split(/\s+/))&&void 0!==n?n:[];return o.sort((function(e,t){return Number(p.includes(t))-Number(p.includes(e))})),{systemThemes:o,customThemes:o.filter((function(e){return!p.includes(e)}))}})),m=function(){return e.autoVisibility},y=function(){return e.autoPlacement},h=function(){var t,n,o,l=g(),u=T(null===(t=r.value)||void 0===t?void 0:t.$el),c=e.arrow?T(null===(n=i.value)||void 0===n?void 0:n.$el):null,s=T(null===(o=a.value)||void 0===o?void 0:o.$el),f=qe(e.content),d=f.isElement,p=f.content;return u&&d&&!(null==u?void 0:u.contains(p))&&u.append(p),{elReference:l,elContent:u,elArrow:c,root:s}},g=function(){var t;return T(e.target)||T(null===(t=o.value)||void 0===t?void 0:t.$el)},b=function(){var t={};return Array.isArray(e.modifiers)&&e.modifiers.forEach((function(e){var n,o,r,i,l;if("offset"===e.name){if("number"==typeof(null===(n=e.options)||void 0===n?void 0:n.offset)&&(l=null===(o=e.options)||void 0===o?void 0:o.offset),Array.isArray(null===(r=e.options)||void 0===r?void 0:r.offset)){var a=I(null===(i=e.options)||void 0===i?void 0:i.offset,2);l={mainAxis:a[0],crossAxis:a[1]}}Object.assign(t,{offset:l})}})),t},w=function(e,t){var n,o,r=b(),i=[ce(r.offset||t.offset),se({padding:t.padding})],l={placement:t.placement,middleware:i};if(t.arrow&&i.push((e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:l,elements:a}=t,{element:u,padding:c=0}=z(e,t)||{};if(null==u)return{};const s=ne(c),f={x:n,y:o},d=J(r),p=Y(d),v=await l.getDimensions(u),m="y"===d,y=m?"top":"left",h=m?"bottom":"right",g=m?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],T=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let x=T?T[g]:0;x&&await(null==l.isElement?void 0:l.isElement(T))||(x=a.floating[g]||i.floating[p]);const P=b/2-w/2,E=x/2-v[p]/2-1,C=V(s[y],E),R=V(s[h],E),O=C,A=x-v[p]-R,S=x/2-v[p]/2+P,N=q(O,S,A),L=null!=K(r)&&S!=N&&i.reference[p]/2-(S<O?C:R)-v[p]/2<0?S<O?O-S:A-S:0;return{[d]:f[d]-L,data:{[d]:N,centerOffset:S-N+L}}}}))({element:e})),y()?i.push(function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,r;const{rects:i,middlewareData:l,placement:a,platform:u,elements:c}=t,{crossAxis:s=!1,alignment:f,allowedPlacements:d=F,autoAlignment:p=!0,...v}=z(e,t),m=void 0!==f||d===F?function(e,t,n){return(e?[...n.filter((t=>K(t)===e)),...n.filter((t=>K(t)!==e))]:n.filter((e=>Z(e)===e))).filter((n=>!e||K(n)===e||!!t&&ee(n)!==n))}(f||null,p,d):d,y=await ie(t,v),h=(null==(n=l.autoPlacement)?void 0:n.index)||0,g=m[h];if(null==g)return{};const b=Q(g,i,await(null==u.isRTL?void 0:u.isRTL(c.floating)));if(a!==g)return{reset:{placement:m[0]}};const w=[y[Z(g)],y[b[0]],y[b[1]]],T=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:g,overflows:w}],x=m[h+1];if(x)return{data:{index:h+1,overflows:T},reset:{placement:x}};const P=T.map((e=>{const t=K(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce(((e,t)=>e+t),0):e.overflows[0],e.overflows]})).sort(((e,t)=>e[1]-t[1])),E=(null==(r=P.filter((e=>e[2].slice(0,K(e[0])?2:3).every((e=>e<=0))))[0])?void 0:r[0])||P[0][0];return E!==a?{data:{index:h+1,overflows:T},reset:{placement:E}}:{}}}}()):(i.unshift(function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:a=2,x:u,y:c}=z(e,t),s=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),f=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let o=null;for(let e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((e=>oe(ue(e))))}(s),d=oe(ue(s)),p=ne(a),v=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=u&&null!=c)return f.find((e=>u>e.left-p.left&&u<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom))||d;if(f.length>=2){if("y"===G(n)){const e=f[0],t=f[f.length-1],o="top"===Z(n),r=e.top,i=t.bottom,l=o?e.left:t.left,a=o?e.right:t.right;return{top:r,bottom:i,left:l,right:a,width:a-l,height:i-r,x:l,y:r}}const e="left"===Z(n),t=j(...f.map((e=>e.right))),o=V(...f.map((e=>e.left))),r=f.filter((n=>e?n.left===o:n.right===t)),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}}()),i.push(function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:s=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...m}=z(e,t),y=Z(o),h=Z(l)===l,g=await(null==a.isRTL?void 0:a.isRTL(u.floating)),b=f||(h||!v?[te(l)]:function(e){const t=te(e);return[ee(e),t,ee(t)]}(l));f||"none"===p||b.push(...function(e,t,n,o){const r=K(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:l;default:return[]}}(Z(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(ee)))),i}(l,v,p,g));const w=[l,...b],T=await ie(t,m),x=[];let P=(null==(n=r.flip)?void 0:n.overflows)||[];if(c&&x.push(T[y]),s){const e=Q(o,i,g);x.push(T[e[0]],T[e[1]])}if(P=[...P,{placement:o,overflows:x}],!x.every((e=>e<=0))){var E,C;const e=((null==(E=r.flip)?void 0:E.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(C=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(d){case"bestFit":{var R;const e=null==(R=P.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}}())),m()&&l.middleware.push(function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=z(e,t);switch(o){case"referenceHidden":{const e=le(await ie(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ae(e)}}}case"escaped":{const e=le(await ie(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ae(e)}}}default:return{}}}}}()),f()||t.isVirtualEl){var a=(o=s.value,{getElementRects:function(e){var t=e.reference,n=e.floating,o=t.getBoundingClientRect(),r=n.getBoundingClientRect();return{reference:{width:o.width,height:o.height,x:o.x,y:o.y},floating:{width:r.width,height:r.height,x:r.x,y:r.y}}},getDimensions:function(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height}},getClippingRect:function(e){var t;!function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e);var n=null!==(t=null==o?void 0:o.getBoundingClientRect())&&void 0!==t?t:{},r=n.width,i=void 0===r?0:r,l=n.height;return{width:i,height:void 0===l?0:l,x:0,y:0}}}),u=a.getElementRects,c=a.getDimensions,d=a.getClippingRect;Object.assign(l,{platform:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.platform)&&void 0!==n?n:{}),{getElementRects:u,getDimensions:c,getClippingRect:d})})}return l},T=function e(t){if(t instanceof HTMLElement)return t;if(t instanceof Text)return e(t.nextElementSibling);if("function"==typeof(null==t?void 0:t.getBoundingClientRect))return t;if("string"==typeof t){var n=document.querySelector(t);return(0,H.isElement)(n)?n:null}return t instanceof PointerEvent?e(t.target):null},x=v.value.customThemes.join(" "),E=v.value.customThemes.reduce((function(e,t){return Object.assign(l({},"data-".concat(t,"-theme"),!0),e)}),{}),C="".concat(x),R=null,O=function(e){var t=window.devicePixelRatio||1;return Math.round(e*t)/t||0},A=function(t,n,o,r){var i;e.disableTransform?Object.assign(t.style,{left:"".concat(O(n),"px"),top:"".concat(O(o),"px")}):Object.assign(t.style,{left:"0",top:"0",transform:"translate3d(".concat(O(n),"px,").concat(O(o),"px,0)")});var l=!!m()&&(null===(i=r.hide)||void 0===i?void 0:i.referenceHidden);Object.assign(t.style,{visibility:l?"hidden":"visible"})},S=function(t,n,o){var r;if(e.arrow){var i=null!==(r=o.arrow)&&void 0!==r?r:{},a=i.x,u=i.y;t.setAttribute("data-arrow",n),Object.assign(t.style,{left:"",top:"",bottom:"",right:""});var c={top:"bottom",right:"left",bottom:"top",left:"right"}[n];Object.assign(t.style,l({left:null!==a?"".concat(a,"px"):"",top:null!==u?"".concat(u,"px"):""},c,"-4px"))}},N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=h(),r=o.elReference,i=o.elContent,l=o.elArrow,a=e||r;if(a&&i){var u=w(l,t);((e,t,n)=>{const o=new Map,r={platform:$e,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:s,y:f}=re(c,o,u),d=o,p={},v=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:y,y:h,data:g,reset:b}=await m({x:s,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:c,platform:l,elements:{reference:e,floating:t}});s=null!=y?y:s,f=null!=h?h:f,p={...p,[i]:{...p[i],...g}},b&&v<=50&&(v++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:s,y:f}=re(c,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})})(a,i,u).then((function(e){var t=e.x,o=e.y,r=e.placement,a=e.middlewareData,u=i.className;i.className="".concat(u.replace(C,"")," ").concat(C).replace(/\s+/gm," ").replace(/^\s+|\s+$/g,""),Object.keys(E).forEach((function(e){i.setAttribute(e,E[e])}));var c=r.split("-")[0],s=c;["left","right","top","bottom"].includes(c)||(s="top"),A(i,t,o,a),S(l,s,a),"function"==typeof n&&n()}))}},L=void 0,D=void 0,k=!1,M=function(){return Array.isArray(e.popoverDelay)?[e.popoverDelay[0],e.popoverDelay.slice(-1)[0]]:[e.popoverDelay,e.popoverDelay]},$=function(){var t=M()[0];D=setTimeout((function(){L&&clearTimeout(L),e.disabled||(u.value=!0)}),t)},_=function(){var e=M()[1];L=setTimeout((function(){D&&clearTimeout(D),u.value=!1}),e)},U=function(){u.value?_():$()},W=function(){U()},X=function(t){"hover"===e.trigger&&(L&&(k=!0,clearTimeout(L),L=void 0),de(t))},fe=function(e){k&&(_(),k=!1,ve(e))},de=function(e){t.emit(P.CONTENT_MOUSEENTER,e)},ve=function(e){t.emit(P.CONTENT_MOUSELEAVE,e)};return(0,c.watch)((function(){return e.isShow}),(function(e){u.value=e})),(0,c.watch)(u,(function(n){var o,i;n?((i=T(null===(o=r.value)||void 0===o?void 0:o.$el)).style.setProperty("display","block"),i.style.setProperty("z-index","".concat(e.zIndex?e.zIndex:d.bkZIndexManager.getPopperIndex())),N(),t.emit(P.CONTENT_AfterShow,{isShow:!0})):function(){var e;T(null===(e=r.value)||void 0===e?void 0:e.$el).style.setProperty("display","none"),t.emit(P.CONTENT_AfterHidden,{isShow:!1})}()})),{showPopover:$,hidePopover:_,resolveTriggerEvents:function(){var t;return null!==(t={hover:{content:[["mouseenter",X],["mouseleave",fe]],reference:[["mouseenter",$],["mouseleave",_],["focus",$],["blur",_]]},click:[["click",W]],manual:{content:[["mouseenter",de],["mouseleave",ve]],reference:[[]]}}[e.trigger])&&void 0!==t?t:[]},updatePopover:N,triggerPopover:U,resolvePopElements:h,isElementFullScreen:f,resolveTargetElement:T,createPopInstance:function(){var t=h(),n=t.elReference,o=t.elContent;R=function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,c=Se(e),s=r||i?[...c?Oe(c):[],...Oe(t)]:[];s.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&a?function(e,t){let n,o=null;const r=pe(e);function i(){clearTimeout(n),o&&o.disconnect(),o=null}return function l(a,u){void 0===a&&(a=!1),void 0===u&&(u=1),i();const{left:c,top:s,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const p={rootMargin:-B(s)+"px "+-B(r.clientWidth-(c+f))+"px "+-B(r.clientHeight-(s+d))+"px "+-B(c)+"px",threshold:j(0,V(1,u))||1};let v=!0;function m(e){const t=e[0].intersectionRatio;if(t!==u){if(!v)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}v=!1}try{o=new IntersectionObserver(m,{...p,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(m,p)}o.observe(e)}(!0),i}(c,n):null;let d,p=-1,v=null;l&&(v=new ResizeObserver((e=>{let[o]=e;o&&o.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{v&&v.observe(t)}))),n()})),c&&!u&&v.observe(c),v.observe(t));let m=u?Ie(e):null;return u&&function t(){const o=Ie(e);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||n(),m=o,d=requestAnimationFrame(t)}(),n(),()=>{s.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),v&&v.disconnect(),v=null,u&&cancelAnimationFrame(d)}}(n,o,(function(){u.value&&N(null,e)}))},updateFullscreenTarget:function(e){s.value=e},getFullscreenRoot:function(e){return f()?document.fullscreenElement.shadowRoot?document.fullscreenElement.shadowRoot.querySelector(e):document.fullscreenElement.querySelector(e):document.body},stopHide:function(){L&&(k=!0,clearTimeout(L),L=void 0)},localIsShow:u,cleanup:R}};var Ze=null,Ke=null;const Xe=(0,c.defineComponent)({name:"Popover",components:{Content:O,Arrow:T,Root:L},directives:{clickoutside:b},props:S,emits:R,setup:function(e,t){var n=(0,c.toRefs)(e).reference,o=(0,c.ref)(),r=(0,c.ref)(),i=(0,c.ref)(),l=(0,c.ref)(),a=(0,c.computed)((function(){return n.value||o.value})),u=function(e,t,n){var o=n.refReference,r=n.refContent,i=n.refArrow,l=n.refRoot,a=null,u=(0,c.ref)(!1),s=(_e.fullscreenReferId||(_e.fullscreenReferId="id_".concat((0,Be.v4)())),_e.fullscreenReferId),f=(0,c.ref)(),d=ze(e,t,{refReference:o,refContent:r,refArrow:i,refRoot:l}),p=d.localIsShow,v=d.showPopover,m=d.hidePopover,y=d.updatePopover,h=d.cleanup,g=d.resolveTriggerEvents,b=d.resolvePopElements,w=d.isElementFullScreen,T=d.updateFullscreenTarget,x=d.createPopInstance,E=d.getFullscreenRoot,C=d.stopHide,R=function(){m()},O=function(){x(),e.always?v():A()},A=function(){var e=b(),t=e.elReference,n=e.elContent;if(a=g(),Array.isArray(a))S(t,a);else{var o=a,r=o.content,i=o.reference;S(t,i),S(n,r)}},S=function(e,t){t.forEach((function(t){var n=I(t,2),o=n[0],r=n[1];o&&"function"==typeof r&&e.addEventListener(o,r)}))},N=function(){var e=b(),t=e.elReference,n=e.root;u.value?H.value=null==f?void 0:f.value:H.value=D(n||t)},L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=function(n){var o=null,r=function(e){null===o&&e()};return r((function(){if(/^parent$/i.test(e.boundary)){o="".concat(t).concat(Ze);var r=(n||{}).parentNode;(null==r?void 0:r.parentNode)&&(r.parentNode.setAttribute("data-pnode-id",Ke),o="[data-pnode-id=".concat(Ke,"]"))}})),r((function(){if(!/^body$/i.test(e.boundary)){if("string"==typeof e.boundary)return Ue(e.boundary)?void(o=e.boundary):void(o="body");if(We(e.boundary))return void(o=e.boundary)}})),r((function(){o="string"==typeof e.boundary?e.boundary:"".concat(t).concat(Ze)})),o};if(null===Ze||!Ue("#".concat(Ze))){Ze="id_".concat((0,Be.v4)());var o=document.createElement("div");o.setAttribute("id",Ze),o.setAttribute("data-popper-id",Ze),document.body.append(o)}return null===Ke&&(Ke="id_".concat((0,Be.v4)())),{popContainerId:Ze,prefixId:n(),getPrefixId:n}}(e,"#"),D=L.getPrefixId,H=(0,c.ref)(),k=function(){!function(){if(null==a?void 0:a.length){var e=b().elReference;e&&a.forEach((function(t){var n=I(t,2),o=n[0],r=n[1];o&&"function"==typeof r&&e.removeEventListener(o,r)})),a=null}}()},M=function(e){var t;f.value=e,T(e),u.value=w(),null===(t=null==f?void 0:f.value)||void 0===t||t.setAttribute("data-fllsrn-id",s)},F=function(t){var n,o,r;document.fullscreenElement||(r="[data-fllsrn-id=".concat(s,"]"),(null!==(o=null===(n=null==f?void 0:f.value)||void 0===n?void 0:n.querySelectorAll(r))&&void 0!==o?o:[]).forEach((function(e){null==e||e.removeAttribute("data-fllsrn-id")}))),M(t.target),N(),y(null,e)};return{onMountedFn:function(){if(!e.disabled){if(O(),w()){var t="[data-fllsrn-id=".concat(s,"]"),n=E(t);M(n)}N(),document.body.addEventListener("fullscreenchange",F)}},onUnmountedFn:function(){k(),document.body.removeEventListener("fullscreenchange",F)},handleClickOutside:function(n){t.emit(P.CLICK_OUTSIDE,{isShow:p.value,event:n});var o=e.disableOutsideClick||e.always||e.disabled||"manual"===e.trigger;!e.forceClickoutside&&o||p.value&&R()},beforeInstanceUnmount:k,updateBoundary:N,initPopInstance:O,updatePopover:y,resetPopover:function(){null==h||h(),x()},showPopover:v,hidePopover:m,showFn:function(){v()},hideFn:R,stopHide:C,isFullscreen:u,boundary:H,localIsShow:p}}(e,t,{refReference:a,refContent:r,refArrow:i,refRoot:l}),s=u.onMountedFn,f=u.onUnmountedFn,p=u.handleClickOutside,v=u.beforeInstanceUnmount,m=u.updateBoundary,y=u.initPopInstance,h=u.showFn,g=u.hideFn,b=u.showPopover,w=u.hidePopover,T=u.updatePopover,x=u.resetPopover,E=u.stopHide,C=u.localIsShow,R=u.boundary;e.always||e.disabled||(0,c.watch)((function(){return e.isShow}),(function(){e.isShow?b():w()}),{immediate:!0}),(0,c.watch)((function(){return[e.disabled]}),(function(e){e[0]?v():y()})),m(),(0,c.onMounted)(s),(0,c.onBeforeUnmount)(f);var O=(0,c.computed)((function(){return!e.disableTeleport})),A=(0,c.computed)((function(){return e.renderType===d.RenderType.AUTO||C.value}));return{boundary:R,arrow:e.arrow,refDefaultReference:o,refContent:r,refArrow:i,content:e.content,theme:e.theme,transBoundary:O,handleClickOutside:p,updatePopover:T,resetPopover:x,hide:function(){g()},show:function(){h()},stopHide:E,contentIsShow:A,renderContent:function(){return e.allowHtml?qe(e.content).vNode:e.content},localIsShow:C}},render:function(){var e,t,n,o,r,i,l,a=this,u=function(e){var t;return c.Text===(null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.type)?(0,c.createVNode)("span",null,[e]):e};return(0,c.createVNode)(L,{ref:"refRoot"},{default:function(){return[(0,c.createVNode)(N,{ref:"refDefaultReference"},(s=e=u(null!==(o=null===(n=(t=a.$slots).default)||void 0===n?void 0:n.call(t))&&void 0!==o?o:(0,c.createVNode)("span",null,null)),"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!(0,c.isVNode)(s)?e:{default:function(){return[e]}})),(0,c.createVNode)(c.Teleport,{to:a.boundary,disabled:!a.transBoundary},{default:function(){return[(0,c.withDirectives)((0,c.createVNode)(O,{ref:"refContent",visible:a.localIsShow,"data-theme":a.theme,extCls:a.extCls,width:a.width,height:a.height,maxWidth:a.maxWidth,maxHeight:a.maxHeight,eventDelay:a.componentEventDelay},{default:function(){return[a.contentIsShow?null!==(l=null===(i=(r=a.$slots).content)||void 0===i?void 0:i.call(r))&&void 0!==l?l:a.renderContent():""]},arrow:function(){var e,t;return a.arrow?(0,c.createVNode)(T,{ref:"refArrow"},{default:function(){return[null===(t=(e=a.$slots).arrow)||void 0===t?void 0:t.call(e)]}}):""}}),[[(0,c.resolveDirective)("clickoutside"),a.handleClickOutside]])]}})];var s}})}}),Ye=function(e){var t,n=null,o=null,r=null,i=Object.assign(Object.assign({boundary:"body",placement:"top",autoVisibility:!0,isShow:!1,trigger:"manual"},e),{allowHtml:!0}),a={name:"$popover",setup:function(e,t){var n=t.expose,o=(0,c.reactive)(Object.keys(S).reduce((function(e,t){return Object.prototype.hasOwnProperty.call(i,t)&&Object.assign(e,l({},t,i[t])),e}),{target:i.target})),r=(0,c.ref)(),a=function(){var e;null===(e=i.onContentMouseenter)||void 0===e||e.call(i)},u=function(){var e;null===(e=i.onContentMouseleave)||void 0===e||e.call(i)};return n({show:function(){var e,t;null===(t=null===(e=r.value)||void 0===e?void 0:e.show)||void 0===t||t.call(e)},hide:function(){var e,t;null===(t=null===(e=r.value)||void 0===e?void 0:e.hide)||void 0===t||t.call(e)},updateTarget:function(e){var t,n;o.target=e,null===(n=null===(t=r.value)||void 0===t?void 0:t.resetPopover)||void 0===n||n.call(t)},stopHide:function(){var e,t;null===(t=null===(e=r.value)||void 0===e?void 0:e.stopHide)||void 0===t||t.call(e)}}),function(){return(0,c.createVNode)(Xe,(0,c.mergeProps)(o,{ref:r,onContentMouseenter:a,onContentMouseleave:u}),null)}}};return null===n&&(r=document.createElement("div"),(t=i.boundary,/^body$/i.test(t)?document.body:/^parent$/i.test(t)?We(i.target)?i.target.parentNode:i.target.target.parentNode:"string"==typeof t&&Ue(t)?document.querySelector(t):document.body).append(r),n=(0,c.createApp)(a),o=n.mount(r)),{close:function(){n&&(n.unmount(),o=null,n=null,r.remove())},show:function(){null==o||o.show()},hide:function(){null==o||o.hide()},update:function(e){null==o||o.updateTarget(e)},get vm(){return o},get $el(){return o.$el}}}})();var c=u.Z;export{c as default};