bkui-vue 0.0.2-beta.78 → 0.0.2-beta.79

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 (211) hide show
  1. package/dist/index.cjs.js +64 -64
  2. package/dist/index.esm.js +12188 -12269
  3. package/dist/index.umd.js +65 -65
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -321
  7. package/lib/alert/index.js +1 -214
  8. package/lib/animate-number/index.js +1 -155
  9. package/lib/backtop/index.js +1 -188
  10. package/lib/badge/index.js +1 -235
  11. package/lib/breadcrumb/index.js +1 -309
  12. package/lib/button/index.js +1 -321
  13. package/lib/card/index.js +1 -285
  14. package/lib/cascader/index.js +2 -2036
  15. package/lib/cascader/index.js.LICENSE.txt +1 -0
  16. package/lib/checkbox/index.js +1 -542
  17. package/lib/code-diff/index.js +1 -5501
  18. package/lib/collapse/index.js +1 -570
  19. package/lib/collapse-transition/index.js +1 -178
  20. package/lib/color-picker/index.js +1 -2665
  21. package/lib/components.js +1 -530
  22. package/lib/config-provider/index.js +1 -365
  23. package/lib/container/index.js +1 -391
  24. package/lib/date-picker/index.js +1 -5527
  25. package/lib/dialog/dialog.css +2 -0
  26. package/lib/dialog/dialog.variable.css +2 -0
  27. package/lib/dialog/index.js +2 -975
  28. package/lib/dialog/index.js.LICENSE.txt +1 -0
  29. package/lib/directives/index.js +2 -1375
  30. package/lib/directives/index.js.LICENSE.txt +14 -0
  31. package/lib/dist.index.js +1 -87
  32. package/lib/divider/index.js +1 -169
  33. package/lib/dropdown/index.js +1 -369
  34. package/lib/exception/index.js +1 -385
  35. package/lib/fixed-navbar/index.js +1 -154
  36. package/lib/form/index.js +1 -924
  37. package/lib/hooks.js +1 -73
  38. package/lib/icon/angle-double-down-line.js +1 -191
  39. package/lib/icon/angle-double-left-line.js +1 -191
  40. package/lib/icon/angle-double-left.js +1 -191
  41. package/lib/icon/angle-double-right-line.js +1 -191
  42. package/lib/icon/angle-double-right.js +1 -191
  43. package/lib/icon/angle-double-up-line.js +1 -191
  44. package/lib/icon/angle-down-fill.js +1 -191
  45. package/lib/icon/angle-down-line.js +1 -191
  46. package/lib/icon/angle-down.js +1 -191
  47. package/lib/icon/angle-left.js +1 -191
  48. package/lib/icon/angle-right.js +1 -191
  49. package/lib/icon/angle-up-fill.js +1 -191
  50. package/lib/icon/angle-up.js +1 -191
  51. package/lib/icon/archive-fill.js +1 -191
  52. package/lib/icon/arrows-left.js +1 -191
  53. package/lib/icon/arrows-right.js +1 -191
  54. package/lib/icon/assistant.js +1 -191
  55. package/lib/icon/audio-fill.js +1 -191
  56. package/lib/icon/bk.js +1 -191
  57. package/lib/icon/circle.js +1 -191
  58. package/lib/icon/close-line.js +1 -191
  59. package/lib/icon/close.js +1 -191
  60. package/lib/icon/code.js +1 -191
  61. package/lib/icon/cog-shape.js +1 -191
  62. package/lib/icon/collapse-left.js +1 -191
  63. package/lib/icon/copy-shape.js +1 -191
  64. package/lib/icon/copy.js +1 -191
  65. package/lib/icon/data-shape.js +1 -191
  66. package/lib/icon/del.js +1 -191
  67. package/lib/icon/doc-fill.js +1 -191
  68. package/lib/icon/done.js +1 -191
  69. package/lib/icon/down-shape.js +1 -191
  70. package/lib/icon/down-small.js +1 -191
  71. package/lib/icon/edit-line.js +1 -191
  72. package/lib/icon/ellipsis.js +1 -191
  73. package/lib/icon/enlarge-line.js +1 -191
  74. package/lib/icon/error.js +1 -191
  75. package/lib/icon/excel-fill.js +1 -191
  76. package/lib/icon/exclamation-circle-shape.js +1 -191
  77. package/lib/icon/eye.js +1 -191
  78. package/lib/icon/filliscreen-line.js +1 -191
  79. package/lib/icon/fix-line.js +1 -191
  80. package/lib/icon/fix-shape.js +1 -191
  81. package/lib/icon/folder-open.js +1 -191
  82. package/lib/icon/folder-shape-open.js +1 -191
  83. package/lib/icon/folder-shape.js +1 -191
  84. package/lib/icon/folder.js +1 -191
  85. package/lib/icon/funnel.js +1 -191
  86. package/lib/icon/help-document-fill.js +1 -191
  87. package/lib/icon/help-fill.js +1 -191
  88. package/lib/icon/help.js +1 -191
  89. package/lib/icon/image-fill.js +1 -276
  90. package/lib/icon/img-error.js +1 -276
  91. package/lib/icon/img-placehoulder.js +1 -276
  92. package/lib/icon/index.js +1 -2399
  93. package/lib/icon/info-line.js +1 -276
  94. package/lib/icon/info.js +1 -276
  95. package/lib/icon/left-shape.js +1 -276
  96. package/lib/icon/left-turn-line.js +1 -276
  97. package/lib/icon/narrow-line.js +1 -276
  98. package/lib/icon/original.js +1 -276
  99. package/lib/icon/pdf-fill.js +1 -276
  100. package/lib/icon/play-shape.js +1 -276
  101. package/lib/icon/plus.js +1 -276
  102. package/lib/icon/ppt-fill.js +1 -276
  103. package/lib/icon/qq.js +1 -276
  104. package/lib/icon/right-shape.js +1 -276
  105. package/lib/icon/right-turn-line.js +1 -276
  106. package/lib/icon/search.js +1 -276
  107. package/lib/icon/share.js +1 -276
  108. package/lib/icon/spinner.js +1 -276
  109. package/lib/icon/success.js +1 -276
  110. package/lib/icon/switcher-loading.js +1 -276
  111. package/lib/icon/text-file.js +1 -276
  112. package/lib/icon/text-fill.js +1 -276
  113. package/lib/icon/transfer.js +1 -276
  114. package/lib/icon/tree-application-shape.js +1 -276
  115. package/lib/icon/unfull-screen.js +1 -276
  116. package/lib/icon/unvisible.js +1 -276
  117. package/lib/icon/up-shape.js +1 -276
  118. package/lib/icon/upload.js +1 -276
  119. package/lib/icon/video-fill.js +1 -276
  120. package/lib/icon/warn.js +1 -276
  121. package/lib/icon/weixin-pro.js +1 -276
  122. package/lib/icon/weixin.js +1 -276
  123. package/lib/image/index.js +1 -641
  124. package/lib/index.js +1 -97
  125. package/lib/info-box/index.js +2 -1165
  126. package/lib/info-box/index.js.LICENSE.txt +1 -0
  127. package/lib/info-box/info-box.css +2 -0
  128. package/lib/info-box/info-box.less +2 -1
  129. package/lib/info-box/info-box.variable.css +2 -0
  130. package/lib/input/index.js +2 -1218
  131. package/lib/input/index.js.LICENSE.txt +1 -0
  132. package/lib/link/index.js +1 -160
  133. package/lib/loading/index.js +1 -381
  134. package/lib/locale/index.js +1 -465
  135. package/lib/menu/index.js +1 -724
  136. package/lib/message/index.js +2 -1795
  137. package/lib/message/index.js.LICENSE.txt +6 -0
  138. package/lib/modal/index.js +1 -396
  139. package/lib/modal/modal.css +2 -0
  140. package/lib/modal/modal.variable.css +2 -0
  141. package/lib/navigation/index.js +1 -367
  142. package/lib/notify/index.js +1 -397
  143. package/lib/overflow-title/index.js +1 -486
  144. package/lib/pagination/index.js +1 -880
  145. package/lib/plugin-popover/index.js +1 -3905
  146. package/lib/plugins/index.js +1 -63
  147. package/lib/pop-confirm/index.js +1 -273
  148. package/lib/popover/index.js +1 -3913
  149. package/lib/popover2/index.js +1 -107
  150. package/lib/preset.js +1 -93
  151. package/lib/process/index.js +2 -759
  152. package/lib/process/index.js.LICENSE.txt +1 -0
  153. package/lib/progress/index.js +1 -431
  154. package/lib/radio/index.js +1 -627
  155. package/lib/rate/index.js +1 -338
  156. package/lib/resize-layout/index.js +1 -429
  157. package/lib/search-select/index.js +2 -2729
  158. package/lib/search-select/index.js.LICENSE.txt +1 -0
  159. package/lib/select/index.js +2 -2240
  160. package/lib/select/index.js.LICENSE.txt +1 -0
  161. package/lib/shared/index.js +1 -2689
  162. package/lib/sideslider/index.js +2 -714
  163. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  164. package/lib/slider/index.js +2 -1291
  165. package/lib/slider/index.js.LICENSE.txt +1 -0
  166. package/lib/steps/index.js +2 -825
  167. package/lib/steps/index.js.LICENSE.txt +1 -0
  168. package/lib/swiper/index.js +1 -336
  169. package/lib/switcher/index.js +1 -277
  170. package/lib/tab/index.js +1 -914
  171. package/lib/table/components/table-column.d.ts +2 -0
  172. package/lib/table/const.d.ts +24 -2
  173. package/lib/table/index.d.ts +38 -0
  174. package/lib/table/index.js +1 -6406
  175. package/lib/table/plugins/use-column-resize.d.ts +30 -10
  176. package/lib/table/plugins/use-fixed-column.d.ts +9 -9
  177. package/lib/table/plugins/use-pagination.d.ts +7 -4
  178. package/lib/table/props.d.ts +22 -1
  179. package/lib/table/render.d.ts +7 -17
  180. package/lib/table/table.css +4 -1
  181. package/lib/table/table.d.ts +44 -23
  182. package/lib/table/table.less +4 -1
  183. package/lib/table/table.variable.css +4 -1
  184. package/lib/table/use-attributes.d.ts +55 -0
  185. package/lib/table/use-column.d.ts +177 -53
  186. package/lib/table/use-common.d.ts +1602 -76
  187. package/lib/table/use-render.d.ts +11 -0
  188. package/lib/table/utils.d.ts +22 -16
  189. package/lib/table-column/index.d.ts +6 -0
  190. package/lib/table-column/index.js +1 -731
  191. package/lib/tag/index.js +1 -233
  192. package/lib/tag-input/index.js +1 -1660
  193. package/lib/time-picker/index.js +1 -71
  194. package/lib/timeline/index.js +1 -241
  195. package/lib/transfer/index.js +1 -673
  196. package/lib/tree/index.d.ts +12 -0
  197. package/lib/tree/index.js +1 -2445
  198. package/lib/tree/props.d.ts +8 -1
  199. package/lib/tree/tree.d.ts +7 -0
  200. package/lib/tree/use-node-action.d.ts +2 -1
  201. package/lib/tree/use-node-attribute.d.ts +2 -0
  202. package/lib/tree/use-search.d.ts +2 -2
  203. package/lib/tree/util.d.ts +2 -2
  204. package/lib/upload/index.js +2 -2874
  205. package/lib/upload/index.js.LICENSE.txt +1 -0
  206. package/lib/virtual-render/index.d.ts +12 -0
  207. package/lib/virtual-render/index.js +1 -792
  208. package/lib/virtual-render/props.d.ts +4 -0
  209. package/lib/virtual-render/v-virtual-render.d.ts +19 -1
  210. package/lib/virtual-render/virtual-render.d.ts +7 -0
  211. package/package.json +1 -2
@@ -1,2240 +1,2 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
- import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
- import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
4
- import * as __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__ from "../checkbox";
5
- import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
6
- import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
7
- import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
8
- import * as __WEBPACK_EXTERNAL_MODULE__input_752b0149__ from "../input";
9
- import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
10
- import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
11
- import * as __WEBPACK_EXTERNAL_MODULE__virtual_render_2d1a77c9__ from "../virtual-render";
12
- import * as __WEBPACK_EXTERNAL_MODULE__tag_7d126a1d__ from "../tag";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 7609:
16
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
17
-
18
- var _typeof = (__webpack_require__(7425)["default"]);
19
- function _regeneratorRuntime() {
20
- "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
21
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
22
- return exports;
23
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
24
- var exports = {},
25
- Op = Object.prototype,
26
- hasOwn = Op.hasOwnProperty,
27
- defineProperty = Object.defineProperty || function (obj, key, desc) {
28
- obj[key] = desc.value;
29
- },
30
- $Symbol = "function" == typeof Symbol ? Symbol : {},
31
- iteratorSymbol = $Symbol.iterator || "@@iterator",
32
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
33
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
34
- function define(obj, key, value) {
35
- return Object.defineProperty(obj, key, {
36
- value: value,
37
- enumerable: !0,
38
- configurable: !0,
39
- writable: !0
40
- }), obj[key];
41
- }
42
- try {
43
- define({}, "");
44
- } catch (err) {
45
- define = function define(obj, key, value) {
46
- return obj[key] = value;
47
- };
48
- }
49
- function wrap(innerFn, outerFn, self, tryLocsList) {
50
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
51
- generator = Object.create(protoGenerator.prototype),
52
- context = new Context(tryLocsList || []);
53
- return defineProperty(generator, "_invoke", {
54
- value: makeInvokeMethod(innerFn, self, context)
55
- }), generator;
56
- }
57
- function tryCatch(fn, obj, arg) {
58
- try {
59
- return {
60
- type: "normal",
61
- arg: fn.call(obj, arg)
62
- };
63
- } catch (err) {
64
- return {
65
- type: "throw",
66
- arg: err
67
- };
68
- }
69
- }
70
- exports.wrap = wrap;
71
- var ContinueSentinel = {};
72
- function Generator() {}
73
- function GeneratorFunction() {}
74
- function GeneratorFunctionPrototype() {}
75
- var IteratorPrototype = {};
76
- define(IteratorPrototype, iteratorSymbol, function () {
77
- return this;
78
- });
79
- var getProto = Object.getPrototypeOf,
80
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
81
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
82
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
83
- function defineIteratorMethods(prototype) {
84
- ["next", "throw", "return"].forEach(function (method) {
85
- define(prototype, method, function (arg) {
86
- return this._invoke(method, arg);
87
- });
88
- });
89
- }
90
- function AsyncIterator(generator, PromiseImpl) {
91
- function invoke(method, arg, resolve, reject) {
92
- var record = tryCatch(generator[method], generator, arg);
93
- if ("throw" !== record.type) {
94
- var result = record.arg,
95
- value = result.value;
96
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
97
- invoke("next", value, resolve, reject);
98
- }, function (err) {
99
- invoke("throw", err, resolve, reject);
100
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
101
- result.value = unwrapped, resolve(result);
102
- }, function (error) {
103
- return invoke("throw", error, resolve, reject);
104
- });
105
- }
106
- reject(record.arg);
107
- }
108
- var previousPromise;
109
- defineProperty(this, "_invoke", {
110
- value: function value(method, arg) {
111
- function callInvokeWithMethodAndArg() {
112
- return new PromiseImpl(function (resolve, reject) {
113
- invoke(method, arg, resolve, reject);
114
- });
115
- }
116
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
117
- }
118
- });
119
- }
120
- function makeInvokeMethod(innerFn, self, context) {
121
- var state = "suspendedStart";
122
- return function (method, arg) {
123
- if ("executing" === state) throw new Error("Generator is already running");
124
- if ("completed" === state) {
125
- if ("throw" === method) throw arg;
126
- return doneResult();
127
- }
128
- for (context.method = method, context.arg = arg;;) {
129
- var delegate = context.delegate;
130
- if (delegate) {
131
- var delegateResult = maybeInvokeDelegate(delegate, context);
132
- if (delegateResult) {
133
- if (delegateResult === ContinueSentinel) continue;
134
- return delegateResult;
135
- }
136
- }
137
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
138
- if ("suspendedStart" === state) throw state = "completed", context.arg;
139
- context.dispatchException(context.arg);
140
- } else "return" === context.method && context.abrupt("return", context.arg);
141
- state = "executing";
142
- var record = tryCatch(innerFn, self, context);
143
- if ("normal" === record.type) {
144
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
145
- return {
146
- value: record.arg,
147
- done: context.done
148
- };
149
- }
150
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
151
- }
152
- };
153
- }
154
- function maybeInvokeDelegate(delegate, context) {
155
- var methodName = context.method,
156
- method = delegate.iterator[methodName];
157
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
158
- var record = tryCatch(method, delegate.iterator, context.arg);
159
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
160
- var info = record.arg;
161
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
162
- }
163
- function pushTryEntry(locs) {
164
- var entry = {
165
- tryLoc: locs[0]
166
- };
167
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
168
- }
169
- function resetTryEntry(entry) {
170
- var record = entry.completion || {};
171
- record.type = "normal", delete record.arg, entry.completion = record;
172
- }
173
- function Context(tryLocsList) {
174
- this.tryEntries = [{
175
- tryLoc: "root"
176
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
177
- }
178
- function values(iterable) {
179
- if (iterable) {
180
- var iteratorMethod = iterable[iteratorSymbol];
181
- if (iteratorMethod) return iteratorMethod.call(iterable);
182
- if ("function" == typeof iterable.next) return iterable;
183
- if (!isNaN(iterable.length)) {
184
- var i = -1,
185
- next = function next() {
186
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
187
- return next.value = undefined, next.done = !0, next;
188
- };
189
- return next.next = next;
190
- }
191
- }
192
- return {
193
- next: doneResult
194
- };
195
- }
196
- function doneResult() {
197
- return {
198
- value: undefined,
199
- done: !0
200
- };
201
- }
202
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
203
- value: GeneratorFunctionPrototype,
204
- configurable: !0
205
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
206
- value: GeneratorFunction,
207
- configurable: !0
208
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
209
- var ctor = "function" == typeof genFun && genFun.constructor;
210
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
211
- }, exports.mark = function (genFun) {
212
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
213
- }, exports.awrap = function (arg) {
214
- return {
215
- __await: arg
216
- };
217
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
218
- return this;
219
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
220
- void 0 === PromiseImpl && (PromiseImpl = Promise);
221
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
222
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
223
- return result.done ? result.value : iter.next();
224
- });
225
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
226
- return this;
227
- }), define(Gp, "toString", function () {
228
- return "[object Generator]";
229
- }), exports.keys = function (val) {
230
- var object = Object(val),
231
- keys = [];
232
- for (var key in object) keys.push(key);
233
- return keys.reverse(), function next() {
234
- for (; keys.length;) {
235
- var key = keys.pop();
236
- if (key in object) return next.value = key, next.done = !1, next;
237
- }
238
- return next.done = !0, next;
239
- };
240
- }, exports.values = values, Context.prototype = {
241
- constructor: Context,
242
- reset: function reset(skipTempReset) {
243
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
244
- },
245
- stop: function stop() {
246
- this.done = !0;
247
- var rootRecord = this.tryEntries[0].completion;
248
- if ("throw" === rootRecord.type) throw rootRecord.arg;
249
- return this.rval;
250
- },
251
- dispatchException: function dispatchException(exception) {
252
- if (this.done) throw exception;
253
- var context = this;
254
- function handle(loc, caught) {
255
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
256
- }
257
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
258
- var entry = this.tryEntries[i],
259
- record = entry.completion;
260
- if ("root" === entry.tryLoc) return handle("end");
261
- if (entry.tryLoc <= this.prev) {
262
- var hasCatch = hasOwn.call(entry, "catchLoc"),
263
- hasFinally = hasOwn.call(entry, "finallyLoc");
264
- if (hasCatch && hasFinally) {
265
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
266
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
267
- } else if (hasCatch) {
268
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
269
- } else {
270
- if (!hasFinally) throw new Error("try statement without catch or finally");
271
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
272
- }
273
- }
274
- }
275
- },
276
- abrupt: function abrupt(type, arg) {
277
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
278
- var entry = this.tryEntries[i];
279
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
280
- var finallyEntry = entry;
281
- break;
282
- }
283
- }
284
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
285
- var record = finallyEntry ? finallyEntry.completion : {};
286
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
287
- },
288
- complete: function complete(record, afterLoc) {
289
- if ("throw" === record.type) throw record.arg;
290
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
291
- },
292
- finish: function finish(finallyLoc) {
293
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
294
- var entry = this.tryEntries[i];
295
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
296
- }
297
- },
298
- "catch": function _catch(tryLoc) {
299
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
300
- var entry = this.tryEntries[i];
301
- if (entry.tryLoc === tryLoc) {
302
- var record = entry.completion;
303
- if ("throw" === record.type) {
304
- var thrown = record.arg;
305
- resetTryEntry(entry);
306
- }
307
- return thrown;
308
- }
309
- }
310
- throw new Error("illegal catch attempt");
311
- },
312
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
313
- return this.delegate = {
314
- iterator: values(iterable),
315
- resultName: resultName,
316
- nextLoc: nextLoc
317
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
318
- }
319
- }, exports;
320
- }
321
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
322
-
323
- /***/ }),
324
-
325
- /***/ 7425:
326
- /***/ ((module) => {
327
-
328
- function _typeof(obj) {
329
- "@babel/helpers - typeof";
330
-
331
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
332
- return typeof obj;
333
- } : function (obj) {
334
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
335
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
336
- }
337
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
338
-
339
- /***/ }),
340
-
341
- /***/ 2841:
342
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
343
-
344
- // TODO(Babel 8): Remove this file.
345
-
346
- var runtime = __webpack_require__(7609)();
347
- module.exports = runtime;
348
-
349
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
350
- try {
351
- regeneratorRuntime = runtime;
352
- } catch (accidentalStrictMode) {
353
- if (typeof globalThis === "object") {
354
- globalThis.regeneratorRuntime = runtime;
355
- } else {
356
- Function("r", "regeneratorRuntime = r")(runtime);
357
- }
358
- }
359
-
360
-
361
- /***/ })
362
-
363
- /******/ });
364
- /************************************************************************/
365
- /******/ // The module cache
366
- /******/ var __webpack_module_cache__ = {};
367
- /******/
368
- /******/ // The require function
369
- /******/ function __webpack_require__(moduleId) {
370
- /******/ // Check if module is in cache
371
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
372
- /******/ if (cachedModule !== undefined) {
373
- /******/ return cachedModule.exports;
374
- /******/ }
375
- /******/ // Create a new module (and put it into the cache)
376
- /******/ var module = __webpack_module_cache__[moduleId] = {
377
- /******/ // no module.id needed
378
- /******/ // no module.loaded needed
379
- /******/ exports: {}
380
- /******/ };
381
- /******/
382
- /******/ // Execute the module function
383
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
384
- /******/
385
- /******/ // Return the exports of the module
386
- /******/ return module.exports;
387
- /******/ }
388
- /******/
389
- /************************************************************************/
390
- /******/ /* webpack/runtime/compat get default export */
391
- /******/ (() => {
392
- /******/ // getDefaultExport function for compatibility with non-harmony modules
393
- /******/ __webpack_require__.n = (module) => {
394
- /******/ var getter = module && module.__esModule ?
395
- /******/ () => (module['default']) :
396
- /******/ () => (module);
397
- /******/ __webpack_require__.d(getter, { a: getter });
398
- /******/ return getter;
399
- /******/ };
400
- /******/ })();
401
- /******/
402
- /******/ /* webpack/runtime/define property getters */
403
- /******/ (() => {
404
- /******/ // define getter functions for harmony exports
405
- /******/ __webpack_require__.d = (exports, definition) => {
406
- /******/ for(var key in definition) {
407
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
408
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
409
- /******/ }
410
- /******/ }
411
- /******/ };
412
- /******/ })();
413
- /******/
414
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
415
- /******/ (() => {
416
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
417
- /******/ })();
418
- /******/
419
- /************************************************************************/
420
- var __webpack_exports__ = {};
421
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
422
- (() => {
423
-
424
- // EXPORTS
425
- __webpack_require__.d(__webpack_exports__, {
426
- T0: () => (/* reexport */ src_option),
427
- GE: () => (/* reexport */ optionGroup),
428
- i2: () => (/* binding */ BkSelect),
429
- ZP: () => (/* binding */ src)
430
- });
431
-
432
- ;// CONCATENATED MODULE: external "../shared"
433
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
434
- var y = x => () => x
435
- const external_shared_namespaceObject = x({ ["InputBehaviorType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.InputBehaviorType, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.RenderType, ["SelectedType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SelectedType, ["SelectedTypeEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SelectedTypeEnum, ["SizeEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.SizeEnum, ["TagThemeType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.TagThemeType, ["classes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.classes, ["observerResize"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.observerResize, ["useFormItem"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.useFormItem, ["withInstallProps"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstallProps });
436
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
437
- function _typeof(obj) {
438
- "@babel/helpers - typeof";
439
-
440
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
441
- return typeof obj;
442
- } : function (obj) {
443
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
444
- }, _typeof(obj);
445
- }
446
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
447
-
448
- function _toPrimitive(input, hint) {
449
- if (_typeof(input) !== "object" || input === null) return input;
450
- var prim = input[Symbol.toPrimitive];
451
- if (prim !== undefined) {
452
- var res = prim.call(input, hint || "default");
453
- if (_typeof(res) !== "object") return res;
454
- throw new TypeError("@@toPrimitive must return a primitive value.");
455
- }
456
- return (hint === "string" ? String : Number)(input);
457
- }
458
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
459
-
460
-
461
- function _toPropertyKey(arg) {
462
- var key = _toPrimitive(arg, "string");
463
- return _typeof(key) === "symbol" ? key : String(key);
464
- }
465
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
466
-
467
- function _defineProperty(obj, key, value) {
468
- key = _toPropertyKey(key);
469
- if (key in obj) {
470
- Object.defineProperty(obj, key, {
471
- value: value,
472
- enumerable: true,
473
- configurable: true,
474
- writable: true
475
- });
476
- } else {
477
- obj[key] = value;
478
- }
479
- return obj;
480
- }
481
- ;// CONCATENATED MODULE: external "vue"
482
- var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
483
- var external_vue_y = x => () => x
484
- const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["customRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.customRef, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeMount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vModelText"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vModelText, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
485
- ;// CONCATENATED MODULE: external "lodash"
486
- var external_lodash_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
487
- var external_lodash_y = x => () => x
488
- const external_lodash_namespaceObject = external_lodash_x({ ["debounce"]: () => __WEBPACK_EXTERNAL_MODULE_lodash__.debounce, ["isEqual"]: () => __WEBPACK_EXTERNAL_MODULE_lodash__.isEqual, ["merge"]: () => __WEBPACK_EXTERNAL_MODULE_lodash__.merge });
489
- ;// CONCATENATED MODULE: external "../checkbox"
490
- var external_checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
491
- var external_checkbox_y = x => () => x
492
- const external_checkbox_namespaceObject = external_checkbox_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__["default"] });
493
- ;// CONCATENATED MODULE: external "../config-provider"
494
- var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
495
- var external_config_provider_y = x => () => x
496
- const external_config_provider_namespaceObject = external_config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
497
- ;// CONCATENATED MODULE: external "../icon"
498
- var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
499
- var external_icon_y = x => () => x
500
- const external_icon_namespaceObject = external_icon_x({ ["AngleUp"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleUp, ["AngleUpFill"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleUpFill, ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Done, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Search });
501
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
502
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
503
- try {
504
- var info = gen[key](arg);
505
- var value = info.value;
506
- } catch (error) {
507
- reject(error);
508
- return;
509
- }
510
- if (info.done) {
511
- resolve(value);
512
- } else {
513
- Promise.resolve(value).then(_next, _throw);
514
- }
515
- }
516
- function _asyncToGenerator(fn) {
517
- return function () {
518
- var self = this,
519
- args = arguments;
520
- return new Promise(function (resolve, reject) {
521
- var gen = fn.apply(self, args);
522
- function _next(value) {
523
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
524
- }
525
- function _throw(err) {
526
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
527
- }
528
- _next(undefined);
529
- });
530
- };
531
- }
532
- // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
533
- var regenerator = __webpack_require__(2841);
534
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
535
- ;// CONCATENATED MODULE: ../../packages/select/src/common.ts
536
-
537
-
538
- /*
539
- * Tencent is pleased to support the open source community by making
540
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
541
- *
542
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
543
- *
544
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
545
- *
546
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
547
- *
548
- * ---------------------------------------------------
549
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
550
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
551
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
552
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
553
- *
554
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
555
- * the Software.
556
- *
557
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
558
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
559
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
560
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
561
- * IN THE SOFTWARE.
562
- */
563
-
564
-
565
- var selectKey = Symbol('BkSelect');
566
- var optionGroupKey = Symbol('BkOptionGroup');
567
- function useHover() {
568
- var isHover = (0,external_vue_namespaceObject.ref)(false);
569
- var setHover = function setHover() {
570
- isHover.value = true;
571
- };
572
- var cancelHover = function cancelHover() {
573
- isHover.value = false;
574
- };
575
- return {
576
- isHover: isHover,
577
- setHover: setHover,
578
- cancelHover: cancelHover
579
- };
580
- }
581
- function useRegistry(data) {
582
- // 注册item
583
- var register = function register(key, item) {
584
- if (!item) return;
585
- if (data.value.has(key)) {
586
- // console.warn(`repeat ${key}`, item);
587
- return;
588
- }
589
- return data.value.set(key, item);
590
- };
591
- // 删除item
592
- var unregister = function unregister(key) {
593
- data.value["delete"](key);
594
- };
595
- return {
596
- register: register,
597
- unregister: unregister
598
- };
599
- }
600
- function useDebouncedRef(value) {
601
- var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
602
- var timeout;
603
- var innerValue = value;
604
- return (0,external_vue_namespaceObject.customRef)(function (track, trigger) {
605
- return {
606
- get: function get() {
607
- track();
608
- return innerValue;
609
- },
610
- set: function set(newValue) {
611
- clearTimeout(timeout);
612
- if (newValue === undefined || newValue === '') {
613
- innerValue = newValue;
614
- trigger();
615
- } else {
616
- timeout = setTimeout(function () {
617
- innerValue = newValue;
618
- trigger();
619
- }, delay);
620
- }
621
- }
622
- };
623
- });
624
- }
625
- function usePopover(config, triggerRef) {
626
- var popoverMinWidth = config.popoverMinWidth;
627
- var observerIns = null;
628
- var popperWidth = (0,external_vue_namespaceObject.ref)('auto');
629
- var isPopoverShow = (0,external_vue_namespaceObject.ref)(false);
630
- var togglePopover = function togglePopover() {
631
- isPopoverShow.value = !isPopoverShow.value;
632
- };
633
- var hidePopover = function hidePopover() {
634
- isPopoverShow.value = false;
635
- };
636
- var showPopover = function showPopover() {
637
- isPopoverShow.value = true;
638
- };
639
- var triggerRefResize = function triggerRefResize() {
640
- var _triggerRef$value;
641
- popperWidth.value = Math.max((_triggerRef$value = triggerRef.value) === null || _triggerRef$value === void 0 ? void 0 : _triggerRef$value.offsetWidth, popoverMinWidth);
642
- };
643
- (0,external_vue_namespaceObject.onMounted)(function () {
644
- if (!triggerRef.value) return;
645
- observerIns = (0,external_shared_namespaceObject.observerResize)(triggerRef.value, triggerRefResize, 60, true);
646
- observerIns.start();
647
- });
648
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
649
- var _observerIns;
650
- (_observerIns = observerIns) === null || _observerIns === void 0 ? void 0 : _observerIns.stop();
651
- observerIns = null;
652
- });
653
- return {
654
- isPopoverShow: isPopoverShow,
655
- popperWidth: popperWidth,
656
- togglePopover: togglePopover,
657
- hidePopover: hidePopover,
658
- showPopover: showPopover
659
- };
660
- }
661
- function useRemoteSearch(method, callBack) {
662
- var searchKey = useDebouncedRef('');
663
- var searchLoading = (0,external_vue_namespaceObject.ref)(false);
664
- (0,external_vue_namespaceObject.watch)(searchKey, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
665
- return regenerator_default().wrap(function _callee$(_context) {
666
- while (1) switch (_context.prev = _context.next) {
667
- case 0:
668
- _context.prev = 0;
669
- searchLoading.value = true;
670
- _context.next = 4;
671
- return method(searchKey.value);
672
- case 4:
673
- searchLoading.value = false;
674
- _context.next = 10;
675
- break;
676
- case 7:
677
- _context.prev = 7;
678
- _context.t0 = _context["catch"](0);
679
- console.error(_context.t0);
680
- case 10:
681
- _context.prev = 10;
682
- callBack === null || callBack === void 0 ? void 0 : callBack();
683
- return _context.finish(10);
684
- case 13:
685
- case "end":
686
- return _context.stop();
687
- }
688
- }, _callee, null, [[0, 7, 10, 13]]);
689
- })));
690
- return {
691
- searchKey: searchKey,
692
- searchLoading: searchLoading
693
- };
694
- }
695
- function toLowerCase() {
696
- var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
697
- if (!value) return value;
698
- return String(value).trim().toLowerCase();
699
- }
700
- function isInViewPort(el, client) {
701
- if (!el || !client) return true;
702
- var _el$getBoundingClient = el.getBoundingClientRect(),
703
- elTop = _el$getBoundingClient.top,
704
- elBottom = _el$getBoundingClient.bottom;
705
- var _client$getBoundingCl = client.getBoundingClientRect(),
706
- clientTop = _client$getBoundingCl.top,
707
- clientBottom = _client$getBoundingCl.bottom;
708
- return elTop >= clientTop && elBottom <= clientBottom;
709
- }
710
- ;// CONCATENATED MODULE: ../../packages/select/src/option.tsx
711
-
712
-
713
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
714
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
715
- /* eslint-disable vue/no-reserved-component-names */
716
- /*
717
- * Tencent is pleased to support the open source community by making
718
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
719
- *
720
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
721
- *
722
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
723
- *
724
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
725
- *
726
- * ---------------------------------------------------
727
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
728
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
729
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
730
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
731
- *
732
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
733
- * the Software.
734
- *
735
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
736
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
737
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
738
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
739
- * IN THE SOFTWARE.
740
- */
741
-
742
-
743
-
744
-
745
-
746
-
747
-
748
- /* harmony default export */ const src_option = ((0,external_vue_namespaceObject.defineComponent)({
749
- name: 'Option',
750
- props: {
751
- id: {
752
- type: [String, Number, Object],
753
- require: true
754
- },
755
- name: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.string]),
756
- disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
757
- order: external_shared_namespaceObject.PropTypes.number.def(0)
758
- },
759
- setup: function setup(props, _ref) {
760
- var attrs = _ref.attrs;
761
- var _getCurrentInstance = (0,external_vue_namespaceObject.getCurrentInstance)(),
762
- proxy = _getCurrentInstance.proxy;
763
- var states = (0,external_vue_namespaceObject.reactive)({
764
- visible: true
765
- });
766
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
767
- disabled = _toRefs.disabled,
768
- id = _toRefs.id,
769
- name = _toRefs.name;
770
- // 兼容label
771
- var optionName = (0,external_vue_namespaceObject.computed)(function () {
772
- return name.value !== undefined ? name.value : attrs.label;
773
- });
774
- // 兼容value
775
- var optionID = (0,external_vue_namespaceObject.computed)(function () {
776
- return id.value !== undefined ? id.value : attrs.value;
777
- });
778
- var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
779
- var group = (0,external_vue_namespaceObject.inject)(optionGroupKey, null);
780
- var selected = (0,external_vue_namespaceObject.computed)(function () {
781
- var _select$selected;
782
- return select === null || select === void 0 || (_select$selected = select.selected) === null || _select$selected === void 0 ? void 0 : _select$selected.some(function (item) {
783
- return (0,external_lodash_namespaceObject.isEqual)(item.value, optionID.value);
784
- });
785
- });
786
- var multiple = (0,external_vue_namespaceObject.computed)(function () {
787
- return select === null || select === void 0 ? void 0 : select.multiple;
788
- });
789
- var isHover = (0,external_vue_namespaceObject.computed)(function () {
790
- return (select === null || select === void 0 ? void 0 : select.activeOptionValue) === optionID.value;
791
- });
792
- var showSelectedIcon = (0,external_vue_namespaceObject.computed)(function () {
793
- return (select === null || select === void 0 ? void 0 : select.showSelectedIcon) && multiple.value;
794
- });
795
- var selectedStyle = (0,external_vue_namespaceObject.computed)(function () {
796
- return select === null || select === void 0 ? void 0 : select.selectedStyle;
797
- });
798
- var handleOptionClick = function handleOptionClick() {
799
- if (disabled.value) return;
800
- select === null || select === void 0 ? void 0 : select.handleOptionSelected(proxy);
801
- };
802
- var handleMouseEnter = function handleMouseEnter() {
803
- select.activeOptionValue = optionID.value;
804
- };
805
- (0,external_vue_namespaceObject.onBeforeMount)(function () {
806
- select === null || select === void 0 ? void 0 : select.register(optionID.value, proxy);
807
- group === null || group === void 0 ? void 0 : group.register(optionID.value, proxy);
808
- });
809
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
810
- select === null || select === void 0 ? void 0 : select.unregister(optionID.value);
811
- group === null || group === void 0 ? void 0 : group.unregister(optionID.value);
812
- });
813
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
814
- resolveClassName = _usePrefix.resolveClassName;
815
- return _objectSpread(_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(states)), {}, {
816
- selected: selected,
817
- multiple: multiple,
818
- isHover: isHover,
819
- showSelectedIcon: showSelectedIcon,
820
- selectedStyle: selectedStyle,
821
- optionName: optionName,
822
- optionID: optionID,
823
- handleOptionClick: handleOptionClick,
824
- handleMouseEnter: handleMouseEnter,
825
- resolveClassName: resolveClassName
826
- });
827
- },
828
- render: function render() {
829
- var _this$$slots$default, _this$$slots$default2, _this$$slots;
830
- var selectItemClass = (0,external_shared_namespaceObject.classes)(_defineProperty({
831
- 'is-selected': this.selected,
832
- 'is-disabled': this.disabled,
833
- 'is-multiple': this.multiple,
834
- 'is-hover': this.isHover,
835
- 'is-checkbox': this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECKBOX
836
- }, this.resolveClassName('select-option'), true));
837
- return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("li", {
838
- "class": selectItemClass,
839
- "onClick": this.handleOptionClick,
840
- "onMouseenter": this.handleMouseEnter
841
- }, [this.showSelectedIcon && this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECKBOX && (0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
842
- "disabled": this.disabled,
843
- "class": this.resolveClassName('select-checkbox'),
844
- "modelValue": this.selected
845
- }, null), (_this$$slots$default = (_this$$slots$default2 = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : (0,external_vue_namespaceObject.createVNode)("span", {
846
- "class": this.resolveClassName('select-option-item'),
847
- "title": String(this.optionName)
848
- }, [this.optionName]), this.showSelectedIcon && this.selected && this.selectedStyle === external_shared_namespaceObject.SelectedTypeEnum.CHECK && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Done, {
849
- "class": this.resolveClassName('select-selected-icon'),
850
- "width": 22,
851
- "height": 22
852
- }, null)]), [[external_vue_namespaceObject.vShow, this.visible]]);
853
- }
854
- }));
855
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
856
- function _arrayLikeToArray(arr, len) {
857
- if (len == null || len > arr.length) len = arr.length;
858
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
859
- return arr2;
860
- }
861
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
862
-
863
- function _arrayWithoutHoles(arr) {
864
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
865
- }
866
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
867
- function _iterableToArray(iter) {
868
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
869
- }
870
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
871
-
872
- function _unsupportedIterableToArray(o, minLen) {
873
- if (!o) return;
874
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
875
- var n = Object.prototype.toString.call(o).slice(8, -1);
876
- if (n === "Object" && o.constructor) n = o.constructor.name;
877
- if (n === "Map" || n === "Set") return Array.from(o);
878
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
879
- }
880
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
881
- function _nonIterableSpread() {
882
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
883
- }
884
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
885
-
886
-
887
-
888
-
889
- function _toConsumableArray(arr) {
890
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
891
- }
892
- ;// CONCATENATED MODULE: ../../packages/select/src/optionGroup.tsx
893
-
894
-
895
-
896
- function optionGroup_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
897
- function optionGroup_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? optionGroup_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : optionGroup_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
898
- /*
899
- * Tencent is pleased to support the open source community by making
900
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
901
- *
902
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
903
- *
904
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
905
- *
906
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
907
- *
908
- * ---------------------------------------------------
909
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
910
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
911
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
912
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
913
- *
914
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
915
- * the Software.
916
- *
917
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
918
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
919
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
920
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
921
- * IN THE SOFTWARE.
922
- */
923
-
924
-
925
-
926
-
927
-
928
- /* harmony default export */ const optionGroup = ((0,external_vue_namespaceObject.defineComponent)({
929
- name: 'OptionGroup',
930
- props: {
931
- label: external_shared_namespaceObject.PropTypes.string.def(''),
932
- disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
933
- collapsible: external_shared_namespaceObject.PropTypes.bool.def(false),
934
- collapse: external_shared_namespaceObject.PropTypes.bool.def(false) // 是否折叠初始状态
935
- },
936
- setup: function setup(props, _ref) {
937
- var emit = _ref.emit;
938
- var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
939
- var proxy = instance.proxy;
940
- var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
941
- var states = (0,external_vue_namespaceObject.reactive)({
942
- groupCollapse: props.collapse,
943
- visible: true
944
- });
945
- var optionsMap = (0,external_vue_namespaceObject.ref)(new Map());
946
- var _useRegistry = useRegistry(optionsMap),
947
- register = _useRegistry.register,
948
- unregister = _useRegistry.unregister;
949
- var groupLabel = (0,external_vue_namespaceObject.computed)(function () {
950
- return "".concat(props.label, " (").concat(_toConsumableArray(optionsMap.value.values()).filter(function (option) {
951
- return option.visible;
952
- }).length, ")");
953
- });
954
- var handleToggleCollapse = function handleToggleCollapse() {
955
- if (!props.collapsible || props.disabled) return;
956
- states.groupCollapse = !states.groupCollapse;
957
- emit('update:collapse', states.groupCollapse);
958
- };
959
- (0,external_vue_namespaceObject.provide)(optionGroupKey, (0,external_vue_namespaceObject.reactive)(optionGroup_objectSpread(optionGroup_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(props)), {}, {
960
- register: register,
961
- unregister: unregister,
962
- groupCollapse: (0,external_vue_namespaceObject.toRef)(states, 'groupCollapse')
963
- })));
964
- (0,external_vue_namespaceObject.onBeforeMount)(function () {
965
- select === null || select === void 0 ? void 0 : select.registerGroup(instance.uid, proxy);
966
- });
967
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
968
- select === null || select === void 0 ? void 0 : select.unregisterGroup(instance.uid);
969
- });
970
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
971
- resolveClassName = _usePrefix.resolveClassName;
972
- return optionGroup_objectSpread(optionGroup_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(states)), {}, {
973
- groupLabel: groupLabel,
974
- handleToggleCollapse: handleToggleCollapse,
975
- resolveClassName: resolveClassName
976
- });
977
- },
978
- render: function render() {
979
- var _classes, _classes2, _this$$slots$default, _this$$slots;
980
- var groupClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, this.resolveClassName('option-group'), true), _defineProperty(_classes, "collapsible", this.collapsible), _defineProperty(_classes, "disabled", this.disabled), _classes));
981
- var groupLabelClass = (0,external_shared_namespaceObject.classes)((_classes2 = {}, _defineProperty(_classes2, this.resolveClassName('option-group-label'), true), _defineProperty(_classes2, "collapsible", this.collapsible), _classes2));
982
- var groupLabelIconClass = (0,external_shared_namespaceObject.classes)({
983
- 'default-group-label-icon': true,
984
- collapse: this.groupCollapse
985
- });
986
- return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
987
- "class": groupClass
988
- }, [(0,external_vue_namespaceObject.createVNode)("li", {
989
- "class": groupLabelClass,
990
- "onClick": this.handleToggleCollapse
991
- }, [this.$slots.label ? this.$slots.label() : (0,external_vue_namespaceObject.createVNode)("span", {
992
- "class": "default-group-label"
993
- }, [this.collapsible && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleUpFill, {
994
- "class": groupLabelIconClass
995
- }, null), (0,external_vue_namespaceObject.createVNode)("span", {
996
- "class": "default-group-label-title"
997
- }, [this.groupLabel])])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
998
- "class": this.resolveClassName('option-group-content')
999
- }, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]), [[external_vue_namespaceObject.vShow, !this.groupCollapse]])]), [[external_vue_namespaceObject.vShow, this.visible]]);
1000
- }
1001
- }));
1002
- ;// CONCATENATED MODULE: external "../directives"
1003
- var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1004
- var external_directives_y = x => () => x
1005
- const external_directives_namespaceObject = external_directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.clickoutside });
1006
- ;// CONCATENATED MODULE: external "../input"
1007
- var external_input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1008
- var external_input_y = x => () => x
1009
- const external_input_namespaceObject = external_input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__input_752b0149__["default"] });
1010
- ;// CONCATENATED MODULE: external "../loading"
1011
- var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1012
- var external_loading_y = x => () => x
1013
- const external_loading_namespaceObject = external_loading_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__["default"] });
1014
- ;// CONCATENATED MODULE: external "../popover"
1015
- var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1016
- var external_popover_y = x => () => x
1017
- const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
1018
- ;// CONCATENATED MODULE: external "../virtual-render"
1019
- var external_virtual_render_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1020
- var external_virtual_render_y = x => () => x
1021
- const external_virtual_render_namespaceObject = external_virtual_render_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__virtual_render_2d1a77c9__["default"] });
1022
- ;// CONCATENATED MODULE: external "../tag"
1023
- var external_tag_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1024
- var external_tag_y = x => () => x
1025
- const external_tag_namespaceObject = external_tag_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__tag_7d126a1d__["default"] });
1026
- ;// CONCATENATED MODULE: ../../packages/select/src/selectTagInput.tsx
1027
-
1028
-
1029
- /*
1030
- * Tencent is pleased to support the open source community by making
1031
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1032
- *
1033
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1034
- *
1035
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1036
- *
1037
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1038
- *
1039
- * ---------------------------------------------------
1040
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1041
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1042
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1043
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1044
- *
1045
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1046
- * the Software.
1047
- *
1048
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1049
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1050
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1051
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1052
- * IN THE SOFTWARE.
1053
- */
1054
-
1055
-
1056
-
1057
-
1058
-
1059
-
1060
- /* harmony default export */ const selectTagInput = ((0,external_vue_namespaceObject.defineComponent)({
1061
- name: 'SelectTagInput',
1062
- props: {
1063
- selected: {
1064
- type: Array,
1065
- "default": function _default() {
1066
- return [];
1067
- }
1068
- },
1069
- tagTheme: (0,external_shared_namespaceObject.TagThemeType)(),
1070
- placeholder: external_shared_namespaceObject.PropTypes.string.def(''),
1071
- filterable: external_shared_namespaceObject.PropTypes.bool.def(false),
1072
- allowCreate: external_shared_namespaceObject.PropTypes.bool.def(false),
1073
- disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
1074
- modelValue: external_shared_namespaceObject.PropTypes.any,
1075
- collapseTags: external_shared_namespaceObject.PropTypes.bool.def(false)
1076
- },
1077
- emits: ['update:modelValue', 'remove', 'enter', 'keydown'],
1078
- setup: function setup(props, _ref) {
1079
- var emit = _ref.emit;
1080
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1081
- resolveClassName = _usePrefix.resolveClassName;
1082
- var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
1083
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
1084
- modelValue = _toRefs.modelValue,
1085
- collapseTags = _toRefs.collapseTags,
1086
- selected = _toRefs.selected;
1087
- var value = (0,external_vue_namespaceObject.ref)(modelValue.value);
1088
- var inputRef = (0,external_vue_namespaceObject.ref)();
1089
- var overflowTagIndex = (0,external_vue_namespaceObject.ref)(null);
1090
- (0,external_vue_namespaceObject.watch)(modelValue, function () {
1091
- value.value = modelValue.value;
1092
- });
1093
- (0,external_vue_namespaceObject.watch)([selected, collapseTags], function () {
1094
- calcOverflow();
1095
- }, {
1096
- flush: 'post'
1097
- });
1098
- var handleRemoveTag = function handleRemoveTag(val) {
1099
- emit('remove', val);
1100
- };
1101
- var focus = function focus() {
1102
- var _inputRef$value;
1103
- (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.focus();
1104
- };
1105
- var handleInput = function handleInput(e) {
1106
- emit('update:modelValue', e.target.value);
1107
- };
1108
- var handleKeydown = function handleKeydown(e) {
1109
- switch (e.code) {
1110
- case 'Enter':
1111
- {
1112
- emit('enter', e.target.value, e);
1113
- break;
1114
- }
1115
- }
1116
- emit('keydown', e.target.value, e);
1117
- };
1118
- var tagsRefs = (0,external_vue_namespaceObject.ref)([]);
1119
- var collapseTagRef = (0,external_vue_namespaceObject.ref)();
1120
- var getTagDOM = function getTagDOM(index) {
1121
- var tagDomList = tagsRefs.value.map(function (item) {
1122
- return item === null || item === void 0 ? void 0 : item.$el;
1123
- }).filter(function (item) {
1124
- return !!item;
1125
- });
1126
- return typeof index === 'number' ? tagDomList[index] : tagDomList;
1127
- };
1128
- // 计算出现换行的索引
1129
- var calcOverflow = function calcOverflow() {
1130
- if (!collapseTags.value) return;
1131
- overflowTagIndex.value = null;
1132
- setTimeout(function () {
1133
- var _tags$overflowTagInde, _collapseTagRef$value;
1134
- var tags = getTagDOM();
1135
- // 出现换行的Index位置
1136
- var tagIndexInSecondRow = tags.findIndex(function (currentTag, index) {
1137
- if (!index) {
1138
- return false;
1139
- }
1140
- var previousTag = tags[index - 1];
1141
- return previousTag.offsetTop !== currentTag.offsetTop;
1142
- });
1143
- overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow : null;
1144
- // 剩余位置能否放下数字tag
1145
- if (((_tags$overflowTagInde = tags[overflowTagIndex.value]) === null || _tags$overflowTagInde === void 0 ? void 0 : _tags$overflowTagInde.offsetTop) !== ((_collapseTagRef$value = collapseTagRef.value) === null || _collapseTagRef$value === void 0 ? void 0 : _collapseTagRef$value.offsetTop) && overflowTagIndex.value > 1) {
1146
- overflowTagIndex.value -= 1;
1147
- }
1148
- });
1149
- };
1150
- // 监听Dom元素变化
1151
- var debounceFn = (0,external_lodash_namespaceObject.debounce)(calcOverflow, 150);
1152
- var tagWrapperRef = (0,external_vue_namespaceObject.ref)();
1153
- var resizeObserver = new ResizeObserver(function () {
1154
- debounceFn();
1155
- });
1156
- (0,external_vue_namespaceObject.onMounted)(function () {
1157
- tagWrapperRef.value && resizeObserver.observe(tagWrapperRef.value);
1158
- });
1159
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
1160
- tagWrapperRef.value && resizeObserver.unobserve(tagWrapperRef.value);
1161
- });
1162
- return {
1163
- collapseTagRef: collapseTagRef,
1164
- tagWrapperRef: tagWrapperRef,
1165
- tagsRefs: tagsRefs,
1166
- select: select,
1167
- overflowTagIndex: overflowTagIndex,
1168
- value: value,
1169
- inputRef: inputRef,
1170
- handleRemoveTag: handleRemoveTag,
1171
- focus: focus,
1172
- handleInput: handleInput,
1173
- handleKeydown: handleKeydown,
1174
- resolveClassName: resolveClassName
1175
- };
1176
- },
1177
- render: function render() {
1178
- var _this$$slots,
1179
- _this$$slots$prefix,
1180
- _classes,
1181
- _this$$slots2,
1182
- _this$$slots2$prefix,
1183
- _this$$slots$default,
1184
- _this$$slots$default2,
1185
- _this$$slots3,
1186
- _this = this,
1187
- _this$$slots4,
1188
- _this$$slots4$suffix;
1189
- var prefix = (_this$$slots = this.$slots) === null || _this$$slots === void 0 || (_this$$slots$prefix = _this$$slots.prefix) === null || _this$$slots$prefix === void 0 ? void 0 : _this$$slots$prefix.call(_this$$slots);
1190
- var selectTagClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, this.resolveClassName('select-tag'), true), _defineProperty(_classes, this.resolveClassName('select-tag--default'), true), _defineProperty(_classes, 'is-disabled', this.disabled), _defineProperty(_classes, 'collapse-tag', this.collapseTags), _defineProperty(_classes, 'has-prefix', !!prefix), _classes));
1191
- var tagWrapperClass = (0,external_shared_namespaceObject.classes)(_defineProperty({}, this.resolveClassName('select-tag-wrapper'), true));
1192
- var inputStyle = {
1193
- display: this.selected.length && !this.filterable ? 'none' : ''
1194
- };
1195
- return (0,external_vue_namespaceObject.createVNode)("div", {
1196
- "class": selectTagClass,
1197
- "ref": "tagWrapperRef"
1198
- }, [(_this$$slots2 = this.$slots) === null || _this$$slots2 === void 0 || (_this$$slots2$prefix = _this$$slots2.prefix) === null || _this$$slots2$prefix === void 0 ? void 0 : _this$$slots2$prefix.call(_this$$slots2), (0,external_vue_namespaceObject.createVNode)("div", {
1199
- "class": tagWrapperClass
1200
- }, [(_this$$slots$default = (_this$$slots$default2 = (_this$$slots3 = this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots3)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : this.selected.map(function (item, index) {
1201
- var _this$select;
1202
- return (0,external_vue_namespaceObject.createVNode)(external_tag_namespaceObject["default"], {
1203
- "closable": true,
1204
- "theme": _this.tagTheme,
1205
- "style": {
1206
- display: _this.collapseTags && _this.overflowTagIndex && index >= _this.overflowTagIndex ? 'none' : ''
1207
- },
1208
- "ref": function ref(el) {
1209
- return _this.tagsRefs[index] = el;
1210
- },
1211
- "onClose": function onClose() {
1212
- return _this.handleRemoveTag(item.value);
1213
- }
1214
- }, {
1215
- "default": function _default() {
1216
- return [(_this$select = _this.select) === null || _this$select === void 0 ? void 0 : _this$select.handleGetLabelByValue(item.value)];
1217
- }
1218
- });
1219
- }), (0,external_vue_namespaceObject.createVNode)(external_tag_namespaceObject["default"], {
1220
- "class": this.resolveClassName('select-overflow-tag'),
1221
- "style": {
1222
- display: !!this.overflowTagIndex && this.collapseTags ? '' : 'none'
1223
- },
1224
- "ref": "collapseTagRef"
1225
- }, {
1226
- "default": function _default() {
1227
- return [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selected.length - _this.overflowTagIndex];
1228
- }
1229
- }), (0,external_vue_namespaceObject.createVNode)("input", {
1230
- "class": this.resolveClassName('select-tag-input'),
1231
- "ref": "inputRef",
1232
- "type": "text",
1233
- "style": inputStyle,
1234
- "placeholder": !this.selected.length ? this.placeholder : '',
1235
- "readonly": !this.filterable,
1236
- "disabled": this.disabled,
1237
- "value": !this.filterable ? '' : this.value,
1238
- "onInput": this.handleInput,
1239
- "onKeydown": this.handleKeydown
1240
- }, null)]), (_this$$slots4 = this.$slots) === null || _this$$slots4 === void 0 || (_this$$slots4$suffix = _this$$slots4.suffix) === null || _this$$slots4$suffix === void 0 ? void 0 : _this$$slots4$suffix.call(_this$$slots4)]);
1241
- }
1242
- }));
1243
- ;// CONCATENATED MODULE: ../../packages/select/src/select.tsx
1244
-
1245
-
1246
-
1247
-
1248
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = select_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; } } }; }
1249
- function select_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return select_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 select_arrayLikeToArray(o, minLen); }
1250
- function select_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; }
1251
- function select_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1252
- function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? select_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : select_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1253
- /* eslint-disable vue/no-reserved-component-names */
1254
- /*
1255
- * Tencent is pleased to support the open source community by making
1256
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1257
- *
1258
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1259
- *
1260
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1261
- *
1262
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1263
- *
1264
- * ---------------------------------------------------
1265
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1266
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1267
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1268
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1269
- *
1270
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1271
- * the Software.
1272
- *
1273
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1274
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1275
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1276
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1277
- * IN THE SOFTWARE.
1278
- */
1279
-
1280
-
1281
-
1282
-
1283
-
1284
-
1285
-
1286
-
1287
-
1288
-
1289
-
1290
-
1291
-
1292
- /* harmony default export */ const src_select = ((0,external_vue_namespaceObject.defineComponent)({
1293
- name: 'Select',
1294
- directives: {
1295
- clickoutside: external_directives_namespaceObject.clickoutside
1296
- },
1297
- props: {
1298
- modelValue: external_shared_namespaceObject.PropTypes.any,
1299
- multiple: external_shared_namespaceObject.PropTypes.bool.def(false),
1300
- disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
1301
- size: external_shared_namespaceObject.PropTypes.size().def(external_shared_namespaceObject.SizeEnum.DEFAULT),
1302
- clearable: external_shared_namespaceObject.PropTypes.bool.def(true),
1303
- loading: external_shared_namespaceObject.PropTypes.bool.def(false),
1304
- filterable: external_shared_namespaceObject.PropTypes.bool.def(false),
1305
- remoteMethod: external_shared_namespaceObject.PropTypes.func,
1306
- scrollHeight: external_shared_namespaceObject.PropTypes.number.def(200),
1307
- showSelectAll: external_shared_namespaceObject.PropTypes.bool.def(false),
1308
- popoverMinWidth: external_shared_namespaceObject.PropTypes.number.def(0),
1309
- showOnInit: external_shared_namespaceObject.PropTypes.bool.def(false),
1310
- multipleMode: external_shared_namespaceObject.PropTypes.oneOf(['default', 'tag']).def('default'),
1311
- tagTheme: (0,external_shared_namespaceObject.TagThemeType)(),
1312
- behavior: (0,external_shared_namespaceObject.InputBehaviorType)(),
1313
- collapseTags: external_shared_namespaceObject.PropTypes.bool.def(false),
1314
- autoHeight: external_shared_namespaceObject.PropTypes.bool.def(true),
1315
- noDataText: external_shared_namespaceObject.PropTypes.string,
1316
- noMatchText: external_shared_namespaceObject.PropTypes.string,
1317
- loadingText: external_shared_namespaceObject.PropTypes.string,
1318
- placeholder: external_shared_namespaceObject.PropTypes.string,
1319
- searchPlaceholder: external_shared_namespaceObject.PropTypes.string,
1320
- selectAllText: external_shared_namespaceObject.PropTypes.string,
1321
- scrollLoading: external_shared_namespaceObject.PropTypes.bool.def(false),
1322
- allowCreate: external_shared_namespaceObject.PropTypes.bool.def(false),
1323
- popoverOptions: Object,
1324
- customContent: external_shared_namespaceObject.PropTypes.bool.def(false),
1325
- list: external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.any).def([]),
1326
- idKey: external_shared_namespaceObject.PropTypes.string.def('value'),
1327
- displayKey: external_shared_namespaceObject.PropTypes.string.def('label'),
1328
- withValidate: external_shared_namespaceObject.PropTypes.bool.def(true),
1329
- showSelectedIcon: external_shared_namespaceObject.PropTypes.bool.def(true),
1330
- inputSearch: external_shared_namespaceObject.PropTypes.bool.def(true),
1331
- enableVirtualRender: external_shared_namespaceObject.PropTypes.bool.def(false),
1332
- allowEmptyValues: external_shared_namespaceObject.PropTypes.array.def([]),
1333
- autoFocus: external_shared_namespaceObject.PropTypes.bool.def(false),
1334
- keepSearchValue: external_shared_namespaceObject.PropTypes.bool.def(false),
1335
- prefix: external_shared_namespaceObject.PropTypes.string,
1336
- selectedStyle: (0,external_shared_namespaceObject.SelectedType)(),
1337
- filterOption: {
1338
- type: [Boolean, Function],
1339
- "default": true
1340
- } // 配置当前options的过滤规则
1341
- },
1342
-
1343
- emits: ['update:modelValue', 'change', 'toggle', 'clear', 'scroll-end', 'focus', 'blur', 'tag-remove', 'select', 'deselect'],
1344
- setup: function setup(props, _ref) {
1345
- var emit = _ref.emit;
1346
- var t = (0,external_config_provider_namespaceObject.useLocale)('select');
1347
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1348
- resolveClassName = _usePrefix.resolveClassName;
1349
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
1350
- modelValue = _toRefs.modelValue,
1351
- disabled = _toRefs.disabled,
1352
- filterable = _toRefs.filterable,
1353
- multiple = _toRefs.multiple,
1354
- remoteMethod = _toRefs.remoteMethod,
1355
- loading = _toRefs.loading,
1356
- popoverMinWidth = _toRefs.popoverMinWidth,
1357
- showOnInit = _toRefs.showOnInit,
1358
- multipleMode = _toRefs.multipleMode,
1359
- allowCreate = _toRefs.allowCreate,
1360
- customContent = _toRefs.customContent,
1361
- showSelectedIcon = _toRefs.showSelectedIcon,
1362
- inputSearch = _toRefs.inputSearch,
1363
- enableVirtualRender = _toRefs.enableVirtualRender,
1364
- showSelectAll = _toRefs.showSelectAll,
1365
- scrollHeight = _toRefs.scrollHeight,
1366
- list = _toRefs.list,
1367
- displayKey = _toRefs.displayKey,
1368
- idKey = _toRefs.idKey,
1369
- collapseTags = _toRefs.collapseTags,
1370
- autoHeight = _toRefs.autoHeight,
1371
- popoverOptions = _toRefs.popoverOptions,
1372
- allowEmptyValues = _toRefs.allowEmptyValues,
1373
- autoFocus = _toRefs.autoFocus,
1374
- keepSearchValue = _toRefs.keepSearchValue,
1375
- selectedStyle = _toRefs.selectedStyle,
1376
- filterOption = _toRefs.filterOption;
1377
- var localNoDataText = (0,external_vue_namespaceObject.computed)(function () {
1378
- if (props.noDataText === undefined) {
1379
- return t.value.noData;
1380
- }
1381
- return props.noDataText;
1382
- });
1383
- var localNoMatchText = (0,external_vue_namespaceObject.computed)(function () {
1384
- if (props.noMatchText === undefined) {
1385
- return t.value.noMatchedData;
1386
- }
1387
- return props.noMatchText;
1388
- });
1389
- var localLoadingText = (0,external_vue_namespaceObject.computed)(function () {
1390
- if (props.loadingText === undefined) {
1391
- return t.value.loading;
1392
- }
1393
- return props.loadingText;
1394
- });
1395
- var localPlaceholder = (0,external_vue_namespaceObject.computed)(function () {
1396
- if (props.placeholder === undefined) {
1397
- return t.value.pleaseSelect;
1398
- }
1399
- return props.placeholder;
1400
- });
1401
- var localSearchPlaceholder = (0,external_vue_namespaceObject.computed)(function () {
1402
- if (props.searchPlaceholder === undefined) {
1403
- return t.value.enterKeywords;
1404
- }
1405
- return props.searchPlaceholder;
1406
- });
1407
- var localSelectAllText = (0,external_vue_namespaceObject.computed)(function () {
1408
- if (props.selectAllText === undefined) {
1409
- return t.value.all;
1410
- }
1411
- return props.selectAllText;
1412
- });
1413
- var formItem = (0,external_shared_namespaceObject.useFormItem)();
1414
- var inputRef = (0,external_vue_namespaceObject.ref)();
1415
- var triggerRef = (0,external_vue_namespaceObject.ref)();
1416
- var contentRef = (0,external_vue_namespaceObject.ref)();
1417
- var searchRef = (0,external_vue_namespaceObject.ref)();
1418
- var selectTagInputRef = (0,external_vue_namespaceObject.ref)();
1419
- var virtualRenderRef = (0,external_vue_namespaceObject.ref)();
1420
- var popoverRef = (0,external_vue_namespaceObject.ref)();
1421
- var optionsMap = (0,external_vue_namespaceObject.ref)(new Map());
1422
- var options = (0,external_vue_namespaceObject.computed)(function () {
1423
- return _toConsumableArray(optionsMap.value.values()).sort(function (cur, next) {
1424
- return cur.order - next.order;
1425
- });
1426
- });
1427
- var groupsMap = (0,external_vue_namespaceObject.ref)(new Map());
1428
- var selected = (0,external_vue_namespaceObject.ref)([]);
1429
- var cacheSelectedMap = (0,external_vue_namespaceObject.computed)(function () {
1430
- return selected.value.reduce(function (pre, item) {
1431
- pre[item.value] = item.label;
1432
- return pre;
1433
- }, {});
1434
- });
1435
- var activeOptionValue = (0,external_vue_namespaceObject.ref)(); // 当前悬浮的option
1436
- var listMap = (0,external_vue_namespaceObject.computed)(function () {
1437
- return list.value.reduce(function (pre, item) {
1438
- pre[item[idKey.value]] = item[displayKey.value];
1439
- return pre;
1440
- }, {});
1441
- });
1442
- (0,external_vue_namespaceObject.watch)(modelValue, function () {
1443
- handleSetSelectedData();
1444
- if (props.withValidate) {
1445
- var _formItem$validate;
1446
- formItem === null || formItem === void 0 || (_formItem$validate = formItem.validate) === null || _formItem$validate === void 0 ? void 0 : _formItem$validate.call(formItem, 'change');
1447
- }
1448
- }, {
1449
- deep: true
1450
- });
1451
- (0,external_vue_namespaceObject.watch)(selected, function () {
1452
- var _popoverRef$value;
1453
- (_popoverRef$value = popoverRef.value) === null || _popoverRef$value === void 0 ? void 0 : _popoverRef$value.updatePopover(null, popoverConfig.value);
1454
- });
1455
- // 虚拟滚动模式下搜索后的值
1456
- var virtualList = (0,external_vue_namespaceObject.computed)(function () {
1457
- return isRemoteSearch.value ? list.value : list.value.filter(function (item) {
1458
- var _toLowerCase;
1459
- return filterOptionFunc.value(searchKey.value, item) && ((_toLowerCase = toLowerCase(String(item[displayKey.value]))) === null || _toLowerCase === void 0 ? void 0 : _toLowerCase.includes(toLowerCase(searchKey.value)));
1460
- });
1461
- });
1462
- // select组件是否禁用
1463
- var isDisabled = (0,external_vue_namespaceObject.computed)(function () {
1464
- return disabled.value || loading.value;
1465
- });
1466
- // modelValue对应的label
1467
- var selectedLabel = (0,external_vue_namespaceObject.computed)(function () {
1468
- return selected.value.map(function (item) {
1469
- var _optionsMap$value;
1470
- return ((_optionsMap$value = optionsMap.value) === null || _optionsMap$value === void 0 || (_optionsMap$value = _optionsMap$value.get(item.value)) === null || _optionsMap$value === void 0 ? void 0 : _optionsMap$value.optionName) || listMap.value[item.value] || item.label;
1471
- });
1472
- });
1473
- // 是否全选(todo: 优化)
1474
- var isAllSelected = (0,external_vue_namespaceObject.computed)(function () {
1475
- var normalSelectedValues = options.value.reduce(function (pre, option) {
1476
- if (!option.disabled) {
1477
- pre.push(option.optionID);
1478
- }
1479
- return pre;
1480
- }, []);
1481
- return normalSelectedValues.length <= selected.value.length && normalSelectedValues.every(function (val) {
1482
- return selected.value.some(function (item) {
1483
- return item.value === val;
1484
- });
1485
- });
1486
- });
1487
- // 是否含有分组
1488
- var isGroup = (0,external_vue_namespaceObject.computed)(function () {
1489
- return !!groupsMap.value.size;
1490
- });
1491
- // options是否为空
1492
- var isOptionsEmpty = (0,external_vue_namespaceObject.computed)(function () {
1493
- return !options.value.length;
1494
- });
1495
- // 是否搜索为空
1496
- var isSearchEmpty = (0,external_vue_namespaceObject.computed)(function () {
1497
- return options.value.length && options.value.every(function (option) {
1498
- return !option.visible;
1499
- });
1500
- });
1501
- // 是否远程搜索
1502
- var isRemoteSearch = (0,external_vue_namespaceObject.computed)(function () {
1503
- return filterable.value && typeof remoteMethod.value === 'function';
1504
- });
1505
- // options过滤函数
1506
- var filterOptionFunc = (0,external_vue_namespaceObject.computed)(function () {
1507
- if (typeof filterOption.value === 'function') return filterOption.value;
1508
- return function () {
1509
- return filterOption.value;
1510
- };
1511
- });
1512
- // 是否显示select下拉内容
1513
- var isShowSelectContent = (0,external_vue_namespaceObject.computed)(function () {
1514
- return !(searchLoading.value || isOptionsEmpty.value || isSearchEmpty.value) || customContent.value;
1515
- });
1516
- // 是否显示全选
1517
- var isShowSelectAll = (0,external_vue_namespaceObject.computed)(function () {
1518
- return multiple.value && showSelectAll.value && (!searchKey.value || !filterable.value);
1519
- });
1520
- // 虚拟滚动高度 12 上下边距,32 显示全选时的高度
1521
- var virtualHeight = (0,external_vue_namespaceObject.computed)(function () {
1522
- return scrollHeight.value - 12 - (isShowSelectAll.value ? 32 : 0);
1523
- });
1524
- // 当前空状态时显示文案
1525
- var curContentText = (0,external_vue_namespaceObject.computed)(function () {
1526
- if (searchLoading.value) {
1527
- return localLoadingText.value;
1528
- }
1529
- if (isSearchEmpty.value || list.value.length && !virtualList.value.length) {
1530
- return localNoMatchText.value;
1531
- }
1532
- if (isOptionsEmpty.value) {
1533
- return localNoDataText.value;
1534
- }
1535
- return '';
1536
- });
1537
- // 是否合并tag以数字形式展示
1538
- var isCollapseTags = (0,external_vue_namespaceObject.computed)(function () {
1539
- return autoHeight.value ? collapseTags.value && !isPopoverShow.value : collapseTags.value;
1540
- });
1541
- var popoverConfig = (0,external_vue_namespaceObject.computed)(function () {
1542
- return (0,external_lodash_namespaceObject.merge)({
1543
- theme: "light ".concat(resolveClassName('select-popover')),
1544
- trigger: 'manual',
1545
- width: popperWidth.value,
1546
- arrow: false,
1547
- placement: 'bottom-start',
1548
- isShow: isPopoverShow.value,
1549
- reference: selectTagInputRef.value,
1550
- offset: 6,
1551
- popoverDelay: 0,
1552
- renderType: external_shared_namespaceObject.RenderType.AUTO
1553
- }, popoverOptions.value);
1554
- });
1555
- var _useRegistry = useRegistry(optionsMap),
1556
- register = _useRegistry.register,
1557
- unregister = _useRegistry.unregister;
1558
- var _useRegistry2 = useRegistry(groupsMap),
1559
- registerGroup = _useRegistry2.register,
1560
- unregisterGroup = _useRegistry2.unregister;
1561
- var _useHover = useHover(),
1562
- isHover = _useHover.isHover,
1563
- setHover = _useHover.setHover,
1564
- cancelHover = _useHover.cancelHover;
1565
- var isFocus = (0,external_vue_namespaceObject.ref)(false);
1566
- var handleFocus = function handleFocus() {
1567
- if (isFocus.value) return;
1568
- isFocus.value = true;
1569
- emit('focus');
1570
- };
1571
- var handleBlur = function handleBlur() {
1572
- if (!isFocus.value) return;
1573
- isFocus.value = false;
1574
- emit('blur');
1575
- };
1576
- var _usePopover = usePopover({
1577
- popoverMinWidth: popoverMinWidth.value
1578
- }, triggerRef),
1579
- popperWidth = _usePopover.popperWidth,
1580
- isPopoverShow = _usePopover.isPopoverShow,
1581
- hidePopover = _usePopover.hidePopover,
1582
- showPopover = _usePopover.showPopover,
1583
- togglePopover = _usePopover.togglePopover;
1584
- // 输入框是否可以输入内容
1585
- var isInput = (0,external_vue_namespaceObject.computed)(function () {
1586
- return (filterable.value && inputSearch.value || allowCreate.value) && isPopoverShow.value;
1587
- });
1588
- (0,external_vue_namespaceObject.watch)(isPopoverShow, function (isShow) {
1589
- emit('toggle', isPopoverShow.value);
1590
- if (!isShow) {
1591
- if (!keepSearchValue.value) {
1592
- searchKey.value = '';
1593
- }
1594
- document.removeEventListener('keydown', handleDocumentKeydown);
1595
- } else {
1596
- document.addEventListener('keydown', handleDocumentKeydown);
1597
- setTimeout(function () {
1598
- focusInput();
1599
- initActiveOptionValue();
1600
- }, 10); // 等待Popover content出来,options加载完成
1601
- }
1602
- });
1603
- // 初始化当前悬浮的option项
1604
- var initActiveOptionValue = function initActiveOptionValue() {
1605
- var firstSelected = selected.value[0];
1606
- var option = optionsMap.value.get(firstSelected === null || firstSelected === void 0 ? void 0 : firstSelected.value);
1607
- if (option && !option.disabled && option.visible) {
1608
- activeOptionValue.value = firstSelected === null || firstSelected === void 0 ? void 0 : firstSelected.value;
1609
- } else {
1610
- var _options$value$find;
1611
- activeOptionValue.value = (_options$value$find = options.value.find(function (option) {
1612
- return !option.disabled && option.visible;
1613
- })) === null || _options$value$find === void 0 ? void 0 : _options$value$find.optionID;
1614
- }
1615
- };
1616
- // 默认搜索方法
1617
- var defaultSearchMethod = function defaultSearchMethod(value) {
1618
- if (!filterable.value) return;
1619
- if (!value) {
1620
- options.value.forEach(function (option) {
1621
- option.visible = true;
1622
- });
1623
- } else {
1624
- options.value.forEach(function (option) {
1625
- var _toLowerCase2;
1626
- option.visible = filterOptionFunc.value(value, select_objectSpread({}, option.$props)) && ((_toLowerCase2 = toLowerCase(String(option.optionName))) === null || _toLowerCase2 === void 0 ? void 0 : _toLowerCase2.includes(toLowerCase(value)));
1627
- });
1628
- }
1629
- };
1630
- var _useRemoteSearch = useRemoteSearch(isRemoteSearch.value ? remoteMethod.value : defaultSearchMethod, initActiveOptionValue),
1631
- searchKey = _useRemoteSearch.searchKey,
1632
- searchLoading = _useRemoteSearch.searchLoading;
1633
- // 派发change事件
1634
- var emitChange = function emitChange(val) {
1635
- if (val === modelValue.value) return;
1636
- emit('update:modelValue', val, modelValue.value);
1637
- emit('change', val, modelValue.value);
1638
- };
1639
- // 派发toggle事件
1640
- var handleTogglePopover = function handleTogglePopover() {
1641
- if (isDisabled.value) return;
1642
- handleFocus();
1643
- togglePopover();
1644
- };
1645
- // 搜索
1646
- var handleInputChange = function handleInputChange(value) {
1647
- if (!filterable.value) return;
1648
- searchKey.value = value;
1649
- };
1650
- // allow create(创建自定义选项)
1651
- var handleCreateCustomOption = function handleCreateCustomOption(val) {
1652
- var value = String(val);
1653
- if (!allowCreate.value || !value) return;
1654
- var matchedOption = options.value.find(function (data) {
1655
- return toLowerCase(String(data.optionName)) === toLowerCase(value);
1656
- });
1657
- if (filterable.value && matchedOption) {
1658
- // 开启搜索后,正好匹配到自定义选项,则不进行创建操作
1659
- handleOptionSelected(matchedOption);
1660
- searchKey.value = '';
1661
- return;
1662
- }
1663
- var data = optionsMap.value.get(value);
1664
- if (data) return; // 已经存在相同值的option时不能创建
1665
- if (multiple.value) {
1666
- selected.value.push({
1667
- value: value,
1668
- label: value
1669
- });
1670
- emitChange(selected.value.map(function (item) {
1671
- return item.value;
1672
- }));
1673
- } else {
1674
- selected.value = [{
1675
- value: value,
1676
- label: value
1677
- }];
1678
- emitChange(value);
1679
- hidePopover();
1680
- }
1681
- searchKey.value = '';
1682
- };
1683
- // Option点击事件
1684
- var handleOptionSelected = function handleOptionSelected(option) {
1685
- if (isDisabled.value || !option) return;
1686
- if (multiple.value) {
1687
- // 多选
1688
- var index = selected.value.findIndex(function (item) {
1689
- return item.value === option.optionID;
1690
- });
1691
- if (index > -1) {
1692
- selected.value.splice(index, 1);
1693
- emitChange(selected.value.map(function (item) {
1694
- return item.value;
1695
- }));
1696
- emit('deselect', option.optionID);
1697
- } else {
1698
- selected.value.push({
1699
- value: option.optionID,
1700
- label: option.optionName || option.optionID
1701
- });
1702
- emitChange(selected.value.map(function (item) {
1703
- return item.value;
1704
- }));
1705
- emit('select', option.optionID);
1706
- }
1707
- } else {
1708
- // 单选
1709
- selected.value = [{
1710
- label: option.optionName || option.optionID,
1711
- value: option.optionID
1712
- }];
1713
- emitChange(option.optionID);
1714
- emit('select', option.optionID);
1715
- hidePopover();
1716
- }
1717
- focusInput();
1718
- };
1719
- // 聚焦输入框
1720
- var focusInput = function focusInput() {
1721
- setTimeout(function () {
1722
- if (!inputSearch.value && !allowCreate.value) {
1723
- var _searchRef$value;
1724
- (_searchRef$value = searchRef.value) === null || _searchRef$value === void 0 ? void 0 : _searchRef$value.focus();
1725
- } else {
1726
- if (multipleMode.value === 'tag') {
1727
- var _selectTagInputRef$va;
1728
- (_selectTagInputRef$va = selectTagInputRef.value) === null || _selectTagInputRef$va === void 0 ? void 0 : _selectTagInputRef$va.focus();
1729
- } else {
1730
- var _inputRef$value;
1731
- (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 ? void 0 : _inputRef$value.focus();
1732
- }
1733
- }
1734
- }, 0);
1735
- };
1736
- // 清空事件
1737
- var handleClear = function handleClear(e) {
1738
- e.stopPropagation();
1739
- selected.value = [];
1740
- emitChange(multiple.value ? [] : '');
1741
- emit('clear', multiple.value ? [] : '');
1742
- hidePopover();
1743
- };
1744
- // 全选/取消全选
1745
- var handleSelectedAllOptionMouseEnter = function handleSelectedAllOptionMouseEnter() {
1746
- activeOptionValue.value = '';
1747
- };
1748
- var handleToggleAll = function handleToggleAll() {
1749
- if (isAllSelected.value) {
1750
- selected.value = [];
1751
- } else {
1752
- var _list$value;
1753
- options.value.forEach(function (option) {
1754
- if (option.disabled || option.optionID in cacheSelectedMap.value) return;
1755
- selected.value.push({
1756
- value: option.optionID,
1757
- label: option.optionName || option.optionID
1758
- });
1759
- });
1760
- (_list$value = list.value) === null || _list$value === void 0 ? void 0 : _list$value.forEach(function (item) {
1761
- if (item.disabled || item[idKey.value] in cacheSelectedMap.value) return;
1762
- selected.value.push({
1763
- value: item[idKey.value],
1764
- label: item[displayKey.value]
1765
- });
1766
- });
1767
- }
1768
- emitChange(selected.value.map(function (item) {
1769
- return item.value;
1770
- }));
1771
- focusInput();
1772
- };
1773
- // 滚动事件
1774
- var handleScroll = function handleScroll(e) {
1775
- var _e$target = e.target,
1776
- scrollTop = _e$target.scrollTop,
1777
- clientHeight = _e$target.clientHeight,
1778
- scrollHeight = _e$target.scrollHeight;
1779
- if (scrollTop + clientHeight === scrollHeight) {
1780
- emit('scroll-end');
1781
- }
1782
- };
1783
- // tag删除事件
1784
- var handleDeleteTag = function handleDeleteTag(val) {
1785
- if (isDisabled.value) return;
1786
- var index = selected.value.findIndex(function (item) {
1787
- return item.value === val;
1788
- });
1789
- if (index > -1) {
1790
- selected.value.splice(index, 1);
1791
- emitChange(selected.value.map(function (item) {
1792
- return item.value;
1793
- }));
1794
- emit('tag-remove', val);
1795
- }
1796
- };
1797
- // options存在 > 上一次选择的label > 当前值
1798
- var handleGetLabelByValue = function handleGetLabelByValue(value) {
1799
- var _optionsMap$value2;
1800
- // 处理options value为对象类型,引用类型变更后,回显不对问题
1801
- var tmpValue = value;
1802
- if (_typeof(tmpValue) === 'object') {
1803
- var _iterator = _createForOfIteratorHelper(optionsMap.value.keys()),
1804
- _step;
1805
- try {
1806
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1807
- var key = _step.value;
1808
- if ((0,external_lodash_namespaceObject.isEqual)(key, tmpValue)) {
1809
- tmpValue = key;
1810
- break;
1811
- }
1812
- }
1813
- } catch (err) {
1814
- _iterator.e(err);
1815
- } finally {
1816
- _iterator.f();
1817
- }
1818
- }
1819
- return ((_optionsMap$value2 = optionsMap.value) === null || _optionsMap$value2 === void 0 || (_optionsMap$value2 = _optionsMap$value2.get(tmpValue)) === null || _optionsMap$value2 === void 0 ? void 0 : _optionsMap$value2.optionName) || listMap.value[tmpValue] || cacheSelectedMap.value[tmpValue] || tmpValue;
1820
- };
1821
- // 设置selected选项
1822
- var handleSetSelectedData = function handleSetSelectedData() {
1823
- // 同步内部value值
1824
- if (Array.isArray(modelValue.value)) {
1825
- selected.value = _toConsumableArray(modelValue.value.map(function (value) {
1826
- return {
1827
- value: value,
1828
- label: handleGetLabelByValue(value)
1829
- };
1830
- }));
1831
- } else {
1832
- if (modelValue.value !== undefined || allowEmptyValues.value.includes(modelValue.value)) {
1833
- selected.value = [{
1834
- value: modelValue.value,
1835
- label: handleGetLabelByValue(modelValue.value)
1836
- }];
1837
- } else {
1838
- selected.value = [];
1839
- }
1840
- }
1841
- };
1842
- // 处理键盘事件
1843
- var handleDocumentKeydown = function handleDocumentKeydown(e) {
1844
- if (!isPopoverShow.value) return;
1845
- var availableOptions = options.value.filter(function (option) {
1846
- return !option.disabled && option.visible;
1847
- });
1848
- var index = availableOptions.findIndex(function (option) {
1849
- return option.optionID === activeOptionValue.value;
1850
- });
1851
- // todo v-for循环时组件创建属性不固定
1852
- switch (e.code) {
1853
- // 下一个option
1854
- case 'ArrowUp':
1855
- case 'ArrowDown':
1856
- {
1857
- var _availableOptions$act, _availableOptions$act3;
1858
- e.preventDefault(); // 阻止滚动屏幕
1859
- var activeIndex = 0;
1860
- if (e.code === 'ArrowDown') {
1861
- activeIndex = index >= availableOptions.length - 1 ? 0 : index + 1;
1862
- } else {
1863
- activeIndex = index === 0 ? availableOptions.length - 1 : index - 1;
1864
- }
1865
- if (!isInViewPort((_availableOptions$act = availableOptions[activeIndex]) === null || _availableOptions$act === void 0 ? void 0 : _availableOptions$act.$el, contentRef.value)) {
1866
- var _availableOptions$act2;
1867
- (_availableOptions$act2 = availableOptions[activeIndex]) === null || _availableOptions$act2 === void 0 || (_availableOptions$act2 = _availableOptions$act2.$el) === null || _availableOptions$act2 === void 0 ? void 0 : _availableOptions$act2.scrollIntoView();
1868
- }
1869
- activeOptionValue.value = (_availableOptions$act3 = availableOptions[activeIndex]) === null || _availableOptions$act3 === void 0 ? void 0 : _availableOptions$act3.optionID;
1870
- break;
1871
- }
1872
- // 删除选项
1873
- case 'Backspace':
1874
- {
1875
- if (!multiple.value || !selected.value.length || searchKey.value.length || e.target === searchRef.value) return; // 单选和下拉搜索不支持回退键删除
1876
- selected.value.pop();
1877
- emitChange(selected.value.map(function (item) {
1878
- return item.value;
1879
- }));
1880
- break;
1881
- }
1882
- // 选择选项
1883
- case 'Enter':
1884
- {
1885
- var value = e.target.value;
1886
- if (allowCreate.value && value) return;
1887
- var option = optionsMap.value.get(activeOptionValue.value);
1888
- handleOptionSelected(option);
1889
- break;
1890
- }
1891
- }
1892
- };
1893
- var handleClickOutside = function handleClickOutside(_ref2) {
1894
- var _triggerRef$value;
1895
- var event = _ref2.event;
1896
- var target = event.target;
1897
- if ((_triggerRef$value = triggerRef.value) !== null && _triggerRef$value !== void 0 && _triggerRef$value.contains(target) || triggerRef.value === target) return;
1898
- hidePopover();
1899
- handleBlur();
1900
- };
1901
- var handlePopoverShow = function handlePopoverShow() {
1902
- setTimeout(function () {
1903
- var _virtualRenderRef$val, _virtualRenderRef$val2;
1904
- // 虚拟滚动首次未更新问题
1905
- enableVirtualRender.value && ((_virtualRenderRef$val = virtualRenderRef.value) === null || _virtualRenderRef$val === void 0 || (_virtualRenderRef$val2 = _virtualRenderRef$val.reset) === null || _virtualRenderRef$val2 === void 0 ? void 0 : _virtualRenderRef$val2.call(_virtualRenderRef$val));
1906
- });
1907
- };
1908
- (0,external_vue_namespaceObject.provide)(selectKey, (0,external_vue_namespaceObject.reactive)({
1909
- multiple: multiple,
1910
- selected: selected,
1911
- activeOptionValue: activeOptionValue,
1912
- showSelectedIcon: showSelectedIcon,
1913
- selectedStyle: selectedStyle,
1914
- register: register,
1915
- unregister: unregister,
1916
- registerGroup: registerGroup,
1917
- unregisterGroup: unregisterGroup,
1918
- handleOptionSelected: handleOptionSelected,
1919
- handleGetLabelByValue: handleGetLabelByValue
1920
- }));
1921
- (0,external_vue_namespaceObject.onMounted)(function () {
1922
- handleSetSelectedData();
1923
- setTimeout(function () {
1924
- showOnInit.value && showPopover();
1925
- autoFocus.value && focusInput();
1926
- });
1927
- });
1928
- return {
1929
- selected: selected,
1930
- isInput: isInput,
1931
- options: options,
1932
- isDisabled: isDisabled,
1933
- selectedLabel: selectedLabel,
1934
- isPopoverShow: isPopoverShow,
1935
- isHover: isHover,
1936
- popperWidth: popperWidth,
1937
- inputRef: inputRef,
1938
- triggerRef: triggerRef,
1939
- contentRef: contentRef,
1940
- searchRef: searchRef,
1941
- selectTagInputRef: selectTagInputRef,
1942
- virtualRenderRef: virtualRenderRef,
1943
- popoverRef: popoverRef,
1944
- searchLoading: searchLoading,
1945
- isOptionsEmpty: isOptionsEmpty,
1946
- isSearchEmpty: isSearchEmpty,
1947
- isFocus: isFocus,
1948
- isShowSelectContent: isShowSelectContent,
1949
- curContentText: curContentText,
1950
- isGroup: isGroup,
1951
- searchKey: searchKey,
1952
- isShowSelectAll: isShowSelectAll,
1953
- virtualHeight: virtualHeight,
1954
- virtualList: virtualList,
1955
- isCollapseTags: isCollapseTags,
1956
- popoverConfig: popoverConfig,
1957
- focusInput: focusInput,
1958
- setHover: setHover,
1959
- cancelHover: cancelHover,
1960
- handleFocus: handleFocus,
1961
- handleBlur: handleBlur,
1962
- handleTogglePopover: handleTogglePopover,
1963
- handleClear: handleClear,
1964
- hidePopover: hidePopover,
1965
- showPopover: showPopover,
1966
- handleToggleAll: handleToggleAll,
1967
- handleOptionSelected: handleOptionSelected,
1968
- handleClickOutside: handleClickOutside,
1969
- handleScroll: handleScroll,
1970
- handleDeleteTag: handleDeleteTag,
1971
- handleInputChange: handleInputChange,
1972
- handleSelectedAllOptionMouseEnter: handleSelectedAllOptionMouseEnter,
1973
- handlePopoverShow: handlePopoverShow,
1974
- localLoadingText: localLoadingText,
1975
- localPlaceholder: localPlaceholder,
1976
- localSearchPlaceholder: localSearchPlaceholder,
1977
- localSelectAllText: localSelectAllText,
1978
- resolveClassName: resolveClassName,
1979
- handleCreateCustomOption: handleCreateCustomOption
1980
- };
1981
- },
1982
- render: function render() {
1983
- var _classes,
1984
- _this = this;
1985
- var selectClass = (0,external_shared_namespaceObject.classes)((_classes = {}, _defineProperty(_classes, "".concat(this.resolveClassName('select')), true), _defineProperty(_classes, 'popover-show', this.isPopoverShow), _defineProperty(_classes, 'is-disabled', this.isDisabled), _defineProperty(_classes, 'is-focus', this.isFocus), _defineProperty(_classes, 'is-filterable', this.filterable), _defineProperty(_classes, this.size, true), _defineProperty(_classes, this.behavior, true), _classes));
1986
- var suffixIcon = function suffixIcon() {
1987
- if (_this.loading) {
1988
- return (0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
1989
- "loading": true,
1990
- "theme": "primary",
1991
- "class": "spinner",
1992
- "mode": "spin",
1993
- "size": "mini"
1994
- }, null);
1995
- }
1996
- if (_this.clearable && _this.isHover && _this.selected.length && !_this.isDisabled) {
1997
- return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
1998
- "class": "clear-icon",
1999
- "onClick": _this.handleClear
2000
- }, null);
2001
- }
2002
- return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleUp, {
2003
- "class": "angle-up"
2004
- }, null);
2005
- };
2006
- var renderPrefix = function renderPrefix() {
2007
- if (_this.prefix) {
2008
- return function () {
2009
- return (0,external_vue_namespaceObject.createVNode)("div", {
2010
- "class": "".concat(_this.resolveClassName('select--prefix-area'))
2011
- }, [(0,external_vue_namespaceObject.createVNode)("span", null, [_this.prefix])]);
2012
- };
2013
- }
2014
- return _this.$slots.prefix ? function () {
2015
- var _this$$slots$prefix, _this$$slots;
2016
- return (_this$$slots$prefix = (_this$$slots = _this.$slots).prefix) === null || _this$$slots$prefix === void 0 ? void 0 : _this$$slots$prefix.call(_this$$slots);
2017
- } : undefined;
2018
- };
2019
- var renderTriggerInput = function renderTriggerInput() {
2020
- if (_this.multipleMode === 'tag') {
2021
- return (0,external_vue_namespaceObject.createVNode)(selectTagInput, {
2022
- "ref": "selectTagInputRef",
2023
- "modelValue": _this.searchKey,
2024
- "onUpdate:modelValue": function onUpdateModelValue($event) {
2025
- return _this.searchKey = $event;
2026
- },
2027
- "selected": _this.selected,
2028
- "tagTheme": _this.tagTheme,
2029
- "placeholder": _this.localPlaceholder,
2030
- "filterable": _this.isInput,
2031
- "disabled": _this.isDisabled,
2032
- "onRemove": _this.handleDeleteTag,
2033
- "collapseTags": _this.isCollapseTags,
2034
- "onEnter": _this.handleCreateCustomOption
2035
- }, {
2036
- prefix: renderPrefix(),
2037
- "default": _this.$slots.tag && function () {
2038
- return _this.$slots.tag({
2039
- selected: _this.selected
2040
- });
2041
- },
2042
- suffix: function suffix() {
2043
- return suffixIcon();
2044
- }
2045
- });
2046
- }
2047
- return (0,external_vue_namespaceObject.createVNode)(external_input_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
2048
- "ref": "inputRef",
2049
- "type": "text",
2050
- "modelValue": _this.isInput ? _this.searchKey : _this.selectedLabel.join(','),
2051
- "placeholder": _this.isInput ? _this.selectedLabel.join(',') || _this.localPlaceholder : _this.localPlaceholder,
2052
- "readonly": !_this.isInput,
2053
- "selectReadonly": true,
2054
- "disabled": _this.isDisabled,
2055
- "behavior": _this.behavior,
2056
- "size": _this.size,
2057
- "withValidate": false,
2058
- "stopPropagation": false,
2059
- "onInput": _this.handleInputChange,
2060
- "onEnter": _this.handleCreateCustomOption
2061
- }, _this.prefix ? {
2062
- prefix: _this.prefix
2063
- } : null), {
2064
- "default": function _default() {
2065
- return [select_objectSpread(select_objectSpread({}, typeof _this.$slots.prefix === 'function' ? {
2066
- prefix: function prefix() {
2067
- var _this$$slots$prefix2, _this$$slots2;
2068
- return (_this$$slots$prefix2 = (_this$$slots2 = _this.$slots).prefix) === null || _this$$slots$prefix2 === void 0 ? void 0 : _this$$slots$prefix2.call(_this$$slots2);
2069
- }
2070
- } : null), {}, {
2071
- suffix: function suffix() {
2072
- return suffixIcon();
2073
- }
2074
- })];
2075
- }
2076
- });
2077
- };
2078
- var renderSelectTrigger = function renderSelectTrigger() {
2079
- var _this$$slots$trigger, _this$$slots3;
2080
- return (0,external_vue_namespaceObject.createVNode)("div", {
2081
- "class": _this.resolveClassName('select-trigger'),
2082
- "style": {
2083
- height: _this.autoHeight && _this.collapseTags ? '32px' : ''
2084
- },
2085
- "ref": "triggerRef",
2086
- "onClick": _this.handleTogglePopover,
2087
- "onMouseenter": _this.setHover,
2088
- "onMouseleave": _this.cancelHover
2089
- }, [((_this$$slots$trigger = (_this$$slots3 = _this.$slots).trigger) === null || _this$$slots$trigger === void 0 ? void 0 : _this$$slots$trigger.call(_this$$slots3, {
2090
- selected: _this.selected
2091
- })) || renderTriggerInput()]);
2092
- };
2093
- var renderSelectContent = function renderSelectContent() {
2094
- var _this$$slots$default, _this$$slots8;
2095
- return (0,external_vue_namespaceObject.createVNode)("div", {
2096
- "class": _this.resolveClassName('select-content-wrapper'),
2097
- "ref": "contentRef"
2098
- }, [_this.filterable && !_this.inputSearch && (0,external_vue_namespaceObject.createVNode)("div", {
2099
- "class": _this.resolveClassName('select-search-wrapper')
2100
- }, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Search, {
2101
- "class": "icon-search",
2102
- "width": 16,
2103
- "height": 16
2104
- }, null), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("input", {
2105
- "ref": "searchRef",
2106
- "class": _this.resolveClassName('select-search-input'),
2107
- "placeholder": _this.localSearchPlaceholder,
2108
- "onUpdate:modelValue": function onUpdateModelValue($event) {
2109
- return _this.searchKey = $event;
2110
- }
2111
- }, null), [[external_vue_namespaceObject.vModelText, _this.searchKey]])]), !_this.isShowSelectContent && (0,external_vue_namespaceObject.createVNode)("div", {
2112
- "class": _this.resolveClassName('select-empty')
2113
- }, [_this.searchLoading && (0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
2114
- "class": "mr5",
2115
- "theme": "primary",
2116
- "loading": true,
2117
- "mode": "spin",
2118
- "size": "mini"
2119
- }, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.curContentText])]), (0,external_vue_namespaceObject.createVNode)("div", {
2120
- "class": _this.resolveClassName('select-content')
2121
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
2122
- "class": _this.enableVirtualRender ? '' : _this.resolveClassName('select-dropdown'),
2123
- "style": {
2124
- maxHeight: "".concat(_this.scrollHeight, "px")
2125
- },
2126
- "onScroll": _this.handleScroll
2127
- }, [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
2128
- "class": _this.resolveClassName('select-options')
2129
- }, [_this.isShowSelectAll && (0,external_vue_namespaceObject.createVNode)("li", {
2130
- "class": _this.resolveClassName('select-option'),
2131
- "onMouseenter": _this.handleSelectedAllOptionMouseEnter,
2132
- "onClick": _this.handleToggleAll
2133
- }, [_this.localSelectAllText]), _this.enableVirtualRender ? (0,external_vue_namespaceObject.createVNode)(external_virtual_render_namespaceObject["default"], {
2134
- "list": _this.virtualList,
2135
- "height": _this.virtualHeight,
2136
- "lineHeight": 32,
2137
- "ref": "virtualRenderRef"
2138
- }, {
2139
- "default": function _default(_ref3) {
2140
- var _this$$slots4, _this$$slots5;
2141
- var data = _ref3.data;
2142
- var optionRender = ((_this$$slots4 = _this.$slots) === null || _this$$slots4 === void 0 ? void 0 : _this$$slots4.optionRender) || ((_this$$slots5 = _this.$slots) === null || _this$$slots5 === void 0 ? void 0 : _this$$slots5.virtualScrollRender);
2143
- return data.map(function (item) {
2144
- return (0,external_vue_namespaceObject.createVNode)(src_option, {
2145
- "key": item[_this.idKey],
2146
- "id": item[_this.idKey],
2147
- "name": item[_this.displayKey]
2148
- }, typeof optionRender === 'function' ? {
2149
- "default": function _default() {
2150
- return optionRender({
2151
- item: item
2152
- });
2153
- }
2154
- } : null);
2155
- });
2156
- }
2157
- }) : _this.list.map(function (item) {
2158
- var _this$$slots6;
2159
- return (0,external_vue_namespaceObject.createVNode)(src_option, {
2160
- "id": item[_this.idKey],
2161
- "name": item[_this.displayKey]
2162
- }, (_this$$slots6 = _this.$slots) !== null && _this$$slots6 !== void 0 && _this$$slots6.optionRender ? {
2163
- "default": function _default() {
2164
- var _this$$slots7, _this$$slots7$optionR;
2165
- return (_this$$slots7 = _this.$slots) === null || _this$$slots7 === void 0 || (_this$$slots7$optionR = _this$$slots7.optionRender) === null || _this$$slots7$optionR === void 0 ? void 0 : _this$$slots7$optionR.call(_this$$slots7, {
2166
- item: item
2167
- });
2168
- }
2169
- } : null);
2170
- }), (_this$$slots$default = (_this$$slots8 = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots8), _this.scrollLoading && (0,external_vue_namespaceObject.createVNode)("li", {
2171
- "class": _this.resolveClassName('select-options-loading')
2172
- }, [(0,external_vue_namespaceObject.createVNode)(external_loading_namespaceObject["default"], {
2173
- "class": "spinner mr5",
2174
- "theme": "primary",
2175
- "loading": true,
2176
- "mode": "spin",
2177
- "size": "mini"
2178
- }, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.localLoadingText])])]), [[external_vue_namespaceObject.vShow, _this.isShowSelectContent]])]), _this.$slots.extension && (0,external_vue_namespaceObject.createVNode)("div", {
2179
- "class": _this.resolveClassName('select-extension')
2180
- }, [_this.$slots.extension()])])]);
2181
- };
2182
- return (0,external_vue_namespaceObject.createVNode)("div", {
2183
- "class": selectClass
2184
- }, [(0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(this.popoverConfig, {
2185
- "onClickoutside": this.handleClickOutside,
2186
- "onAfterShow": this.handlePopoverShow,
2187
- "ref": "popoverRef"
2188
- }), {
2189
- "default": function _default() {
2190
- return renderSelectTrigger();
2191
- },
2192
- content: function content() {
2193
- return renderSelectContent();
2194
- }
2195
- })]);
2196
- }
2197
- }));
2198
- ;// CONCATENATED MODULE: ../../packages/select/src/index.ts
2199
- /*
2200
- * Tencent is pleased to support the open source community by making
2201
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2202
- *
2203
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2204
- *
2205
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2206
- *
2207
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2208
- *
2209
- * ---------------------------------------------------
2210
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2211
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2212
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2213
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2214
- *
2215
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2216
- * the Software.
2217
- *
2218
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2219
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2220
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2221
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2222
- * IN THE SOFTWARE.
2223
- */
2224
-
2225
-
2226
-
2227
-
2228
- var BkSelect = (0,external_shared_namespaceObject.withInstallProps)(src_select, {
2229
- Option: src_option,
2230
- Group: optionGroup
2231
- });
2232
- /* harmony default export */ const src = (BkSelect);
2233
-
2234
- })();
2235
-
2236
- var __webpack_exports__BkOption = __webpack_exports__.T0;
2237
- var __webpack_exports__BkOptionGroup = __webpack_exports__.GE;
2238
- var __webpack_exports__BkSelect = __webpack_exports__.i2;
2239
- var __webpack_exports__default = __webpack_exports__.ZP;
2240
- export { __webpack_exports__BkOption as BkOption, __webpack_exports__BkOptionGroup as BkOptionGroup, __webpack_exports__BkSelect as BkSelect, __webpack_exports__default as default };
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ import*as e from"../shared";import*as t from"vue";import*as o from"lodash";import*as r from"../checkbox";import*as n from"../config-provider";import*as l from"../icon";import*as a from"../directives";import*as i from"../input";import*as u from"../loading";import*as s from"../popover";import*as c from"../virtual-render";import*as d from"../tag";var v={7609:(e,t,o)=>{var r=o(7425).default;function n(){e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,l=o.hasOwnProperty,a=Object.defineProperty||function(e,t,o){e[t]=o.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function d(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,o){return e[t]=o}}function v(e,t,o,r){var n=t&&t.prototype instanceof h?t:h,l=Object.create(n.prototype),i=new I(r||[]);return a(l,"_invoke",{value:P(e,o,i)}),l}function p(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var f={};function h(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var b=Object.getPrototypeOf,T=b&&b(b(O([])));T&&T!==o&&l.call(T,u)&&(y=T);var w=g.prototype=h.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function o(n,a,i,u){var s=p(e[n],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==r(d)&&l.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,i,u)}),(function(e){o("throw",e,i,u)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return o("throw",e,i,u)}))}u(s.arg)}var n;a(this,"_invoke",{value:function(e,r){function l(){return new t((function(t,n){o(e,r,t,n)}))}return n=n?n.then(l,l):l()}})}function P(e,t,o){var r="suspendedStart";return function(n,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw l;return{value:void 0,done:!0}}for(o.method=n,o.arg=l;;){var a=o.delegate;if(a){var i=N(a,o);if(i){if(i===f)continue;return i}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var u=p(e,t,o);if("normal"===u.type){if(r=o.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(r="completed",o.method="throw",o.arg=u.arg)}}}function N(e,t){var o=t.method,r=e.iterator[o];if(void 0===r)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,N(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var l=n.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function O(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(l.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return m.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),d(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(e,o,r,n,l){void 0===l&&(l=Promise);var a=new S(v(e,o,r,n),l);return t.isGeneratorFunction(o)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,c,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var r in t)o.push(r);return o.reverse(),function e(){for(;o.length;){var r=o.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(o,r){return a.type="throw",a.arg=e,t.next=o,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var i=l.call(n,"catchLoc"),u=l.call(n,"finallyLoc");if(i&&u){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return o(n.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return o(n.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),V(o),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;V(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:O(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(o){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,o)=>{var r=o(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var o=p[e]={exports:{}};return v[e](o,o.exports,f),o.exports}f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var o in t)f.o(t,o)&&!f.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var h={};(()=>{f.d(h,{T0:()=>R,GE:()=>k,i2:()=>F,ZP:()=>U});const v=(p={InputBehaviorType:()=>e.InputBehaviorType,PropTypes:()=>e.PropTypes,RenderType:()=>e.RenderType,SelectedType:()=>e.SelectedType,SelectedTypeEnum:()=>e.SelectedTypeEnum,SizeEnum:()=>e.SizeEnum,TagThemeType:()=>e.TagThemeType,classes:()=>e.classes,observerResize:()=>e.observerResize,useFormItem:()=>e.useFormItem,withInstallProps:()=>e.withInstallProps},m={},f.d(m,p),m);var p,m;function g(e){return g="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},g(e)}function y(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===g(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const b=(e=>{var t={};return f.d(t,e),t})({computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,customRef:()=>t.customRef,defineComponent:()=>t.defineComponent,getCurrentInstance:()=>t.getCurrentInstance,inject:()=>t.inject,isVNode:()=>t.isVNode,mergeProps:()=>t.mergeProps,onBeforeMount:()=>t.onBeforeMount,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,provide:()=>t.provide,reactive:()=>t.reactive,ref:()=>t.ref,toRef:()=>t.toRef,toRefs:()=>t.toRefs,vModelText:()=>t.vModelText,vShow:()=>t.vShow,watch:()=>t.watch,withDirectives:()=>t.withDirectives}),T=(e=>{var t={};return f.d(t,e),t})({debounce:()=>o.debounce,isEqual:()=>o.isEqual,merge:()=>o.merge}),w=(e=>{var t={};return f.d(t,e),t})({default:()=>r.default}),x=(e=>{var t={};return f.d(t,e),t})({useLocale:()=>n.useLocale,usePrefix:()=>n.usePrefix}),S=(e=>{var t={};return f.d(t,e),t})({AngleUp:()=>l.AngleUp,AngleUpFill:()=>l.AngleUpFill,Close:()=>l.Close,Done:()=>l.Done,Search:()=>l.Search});var P=f(2841),N=f.n(P);Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var C=Symbol("BkSelect"),V=Symbol("BkOptionGroup");function I(e){return{register:function(t,o){if(o&&!e.value.has(t))return e.value.set(t,o)},unregister:function(t){e.value.delete(t)}}}function O(e,t){var o=this,r=function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=e;return(0,b.customRef)((function(e,n){return{get:function(){return e(),r},set:function(e){clearTimeout(t),void 0===e||""===e?(r=e,n()):t=setTimeout((function(){r=e,n()}),o)}}}))}(""),n=(0,b.ref)(!1);return(0,b.watch)(r,(function(){return l=o,a=void 0,i=void 0,u=N().mark((function o(){return N().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,n.value=!0,o.next=4,e(r.value);case 4:n.value=!1,o.next=10;break;case 7:o.prev=7,o.t0=o.catch(0),console.error(o.t0);case 10:return o.prev=10,null==t||t(),o.finish(10);case 13:case"end":return o.stop()}}),o,null,[[0,7,10,13]])})),new(i||(i=Promise))((function(e,t){function o(e){try{n(u.next(e))}catch(e){t(e)}}function r(e){try{n(u.throw(e))}catch(e){t(e)}}function n(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(o,r)}n((u=u.apply(l,a||[])).next())}));var l,a,i,u})),{searchKey:r,searchLoading:n}}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?String(e).trim().toLowerCase():e}const R=(0,b.defineComponent)({name:"Option",props:{id:{type:[String,Number,Object],require:!0},name:v.PropTypes.oneOfType([v.PropTypes.number,v.PropTypes.string]),disabled:v.PropTypes.bool.def(!1),order:v.PropTypes.number.def(0)},setup:function(e,t){var o=t.attrs,r=(0,b.getCurrentInstance)().proxy,n=(0,b.reactive)({visible:!0}),l=(0,b.toRefs)(e),a=l.disabled,i=l.id,u=l.name,s=(0,b.computed)((function(){return void 0!==u.value?u.value:o.label})),c=(0,b.computed)((function(){return void 0!==i.value?i.value:o.value})),d=(0,b.inject)(C,null),v=(0,b.inject)(V,null),p=(0,b.computed)((function(){var e;return null===(e=null==d?void 0:d.selected)||void 0===e?void 0:e.some((function(e){return(0,T.isEqual)(e.value,c.value)}))})),f=(0,b.computed)((function(){return null==d?void 0:d.multiple})),h=(0,b.computed)((function(){return(null==d?void 0:d.activeOptionValue)===c.value})),m=(0,b.computed)((function(){return(null==d?void 0:d.showSelectedIcon)&&f.value})),g=(0,b.computed)((function(){return null==d?void 0:d.selectedStyle}));(0,b.onBeforeMount)((function(){null==d||d.register(c.value,r),null==v||v.register(c.value,r)})),(0,b.onBeforeUnmount)((function(){null==d||d.unregister(c.value),null==v||v.unregister(c.value)}));var y=(0,x.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,b.toRefs)(n)),{selected:p,multiple:f,isHover:h,showSelectedIcon:m,selectedStyle:g,optionName:s,optionID:c,handleOptionClick:function(){a.value||null==d||d.handleOptionSelected(r)},handleMouseEnter:function(){d.activeOptionValue=c.value},resolveClassName:y})},render:function(){var e,t,o,r=(0,v.classes)(y({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"is-checkbox":this.selectedStyle===v.SelectedTypeEnum.CHECKBOX},this.resolveClassName("select-option"),!0));return(0,b.withDirectives)((0,b.createVNode)("li",{class:r,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[this.showSelectedIcon&&this.selectedStyle===v.SelectedTypeEnum.CHECKBOX&&(0,b.createVNode)(w.default,{disabled:this.disabled,class:this.resolveClassName("select-checkbox"),modelValue:this.selected},null),null!==(o=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==o?o:(0,b.createVNode)("span",{class:this.resolveClassName("select-option-item"),title:String(this.optionName)},[this.optionName]),this.showSelectedIcon&&this.selected&&this.selectedStyle===v.SelectedTypeEnum.CHECK&&(0,b.createVNode)(S.Done,{class:this.resolveClassName("select-selected-icon"),width:22,height:22},null)]),[[b.vShow,this.visible]])}});function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function j(e){return function(e){if(Array.isArray(e))return L(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?L(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const k=(0,b.defineComponent)({name:"OptionGroup",props:{label:v.PropTypes.string.def(""),disabled:v.PropTypes.bool.def(!1),collapsible:v.PropTypes.bool.def(!1),collapse:v.PropTypes.bool.def(!1)},setup:function(e,t){var o=t.emit,r=(0,b.getCurrentInstance)(),n=r.proxy,l=(0,b.inject)(C,null),a=(0,b.reactive)({groupCollapse:e.collapse,visible:!0}),i=(0,b.ref)(new Map),u=I(i),s=u.register,c=u.unregister,d=(0,b.computed)((function(){return"".concat(e.label," (").concat(j(i.value.values()).filter((function(e){return e.visible})).length,")")}));(0,b.provide)(V,(0,b.reactive)(Object.assign(Object.assign({},(0,b.toRefs)(e)),{register:s,unregister:c,groupCollapse:(0,b.toRef)(a,"groupCollapse")}))),(0,b.onBeforeMount)((function(){null==l||l.registerGroup(r.uid,n)})),(0,b.onBeforeUnmount)((function(){null==l||l.unregisterGroup(r.uid)}));var v=(0,x.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,b.toRefs)(a)),{groupLabel:d,handleToggleCollapse:function(){e.collapsible&&!e.disabled&&(a.groupCollapse=!a.groupCollapse,o("update:collapse",a.groupCollapse))},resolveClassName:v})},render:function(){var e,t,o,r,n=(0,v.classes)((y(e={},this.resolveClassName("option-group"),!0),y(e,"collapsible",this.collapsible),y(e,"disabled",this.disabled),e)),l=(0,v.classes)((y(t={},this.resolveClassName("option-group-label"),!0),y(t,"collapsible",this.collapsible),t)),a=(0,v.classes)({"default-group-label-icon":!0,collapse:this.groupCollapse});return(0,b.withDirectives)((0,b.createVNode)("ul",{class:n},[(0,b.createVNode)("li",{class:l,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():(0,b.createVNode)("span",{class:"default-group-label"},[this.collapsible&&(0,b.createVNode)(S.AngleUpFill,{class:a},null),(0,b.createVNode)("span",{class:"default-group-label-title"},[this.groupLabel])])]),(0,b.withDirectives)((0,b.createVNode)("ul",{class:this.resolveClassName("option-group-content")},[null===(r=(o=this.$slots).default)||void 0===r?void 0:r.call(o)]),[[b.vShow,!this.groupCollapse]])]),[[b.vShow,this.visible]])}}),D=(e=>{var t={};return f.d(t,e),t})({clickoutside:()=>a.clickoutside}),M=(e=>{var t={};return f.d(t,e),t})({default:()=>i.default}),A=(e=>{var t={};return f.d(t,e),t})({default:()=>u.default}),H=(e=>{var t={};return f.d(t,e),t})({default:()=>s.default}),$=(e=>{var t={};return f.d(t,e),t})({default:()=>c.default}),B=(e=>{var t={};return f.d(t,e),t})({default:()=>d.default}),_=(0,b.defineComponent)({name:"SelectTagInput",props:{selected:{type:Array,default:function(){return[]}},tagTheme:(0,v.TagThemeType)(),placeholder:v.PropTypes.string.def(""),filterable:v.PropTypes.bool.def(!1),allowCreate:v.PropTypes.bool.def(!1),disabled:v.PropTypes.bool.def(!1),modelValue:v.PropTypes.any,collapseTags:v.PropTypes.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup:function(e,t){var o=t.emit,r=(0,x.usePrefix)().resolveClassName,n=(0,b.inject)(C,null),l=(0,b.toRefs)(e),a=l.modelValue,i=l.collapseTags,u=l.selected,s=(0,b.ref)(a.value),c=(0,b.ref)(),d=(0,b.ref)(null);(0,b.watch)(a,(function(){s.value=a.value})),(0,b.watch)([u,i],(function(){f()}),{flush:"post"});var v=(0,b.ref)([]),p=(0,b.ref)(),f=function(){i.value&&(d.value=null,setTimeout((function(){var e,t,o=v.value.map((function(e){return null==e?void 0:e.$el})).filter((function(e){return!!e})),r=o.findIndex((function(e,t){return!!t&&o[t-1].offsetTop!==e.offsetTop}));d.value=r>0?r:null,(null===(e=o[d.value])||void 0===e?void 0:e.offsetTop)!==(null===(t=p.value)||void 0===t?void 0:t.offsetTop)&&d.value>1&&(d.value-=1)})))},h=(0,T.debounce)(f,150),m=(0,b.ref)(),g=new ResizeObserver((function(){h()}));return(0,b.onMounted)((function(){m.value&&g.observe(m.value)})),(0,b.onBeforeUnmount)((function(){m.value&&g.unobserve(m.value)})),{collapseTagRef:p,tagWrapperRef:m,tagsRefs:v,select:n,overflowTagIndex:d,value:s,inputRef:c,handleRemoveTag:function(e){o("remove",e)},focus:function(){var e;null===(e=c.value)||void 0===e||e.focus()},handleInput:function(e){o("update:modelValue",e.target.value)},handleKeydown:function(e){"Enter"===e.code&&o("enter",e.target.value,e),o("keydown",e.target.value,e)},resolveClassName:r}},render:function(){var e,t,o,r,n,l,a,i,u,s,c=this,d=null===(o=null===(t=this.$slots)||void 0===t?void 0:t.prefix)||void 0===o?void 0:o.call(t),p=(0,v.classes)((y(e={},this.resolveClassName("select-tag"),!0),y(e,this.resolveClassName("select-tag--default"),!0),y(e,"is-disabled",this.disabled),y(e,"collapse-tag",this.collapseTags),y(e,"has-prefix",!!d),e)),f=(0,v.classes)(y({},this.resolveClassName("select-tag-wrapper"),!0)),h={display:this.selected.length&&!this.filterable?"none":""};return(0,b.createVNode)("div",{class:p,ref:"tagWrapperRef"},[null===(n=null===(r=this.$slots)||void 0===r?void 0:r.prefix)||void 0===n?void 0:n.call(r),(0,b.createVNode)("div",{class:f},[null!==(i=null===(a=(l=this.$slots).default)||void 0===a?void 0:a.call(l))&&void 0!==i?i:this.selected.map((function(e,t){var o;return(0,b.createVNode)(B.default,{closable:!0,theme:c.tagTheme,style:{display:c.collapseTags&&c.overflowTagIndex&&t>=c.overflowTagIndex?"none":""},ref:function(e){return c.tagsRefs[t]=e},onClose:function(){return c.handleRemoveTag(e.value)}},{default:function(){return[null===(o=c.select)||void 0===o?void 0:o.handleGetLabelByValue(e.value)]}})})),(0,b.createVNode)(B.default,{class:this.resolveClassName("select-overflow-tag"),style:{display:this.overflowTagIndex&&this.collapseTags?"":"none"},ref:"collapseTagRef"},{default:function(){return[(0,b.createTextVNode)("+"),c.selected.length-c.overflowTagIndex]}}),(0,b.createVNode)("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:h,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),null===(s=null===(u=this.$slots)||void 0===u?void 0:u.suffix)||void 0===s?void 0:s.call(u)])}});function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}const G=(0,b.defineComponent)({name:"Select",directives:{clickoutside:D.clickoutside},props:{modelValue:v.PropTypes.any,multiple:v.PropTypes.bool.def(!1),disabled:v.PropTypes.bool.def(!1),size:v.PropTypes.size().def(v.SizeEnum.DEFAULT),clearable:v.PropTypes.bool.def(!0),loading:v.PropTypes.bool.def(!1),filterable:v.PropTypes.bool.def(!1),remoteMethod:v.PropTypes.func,scrollHeight:v.PropTypes.number.def(200),showSelectAll:v.PropTypes.bool.def(!1),popoverMinWidth:v.PropTypes.number.def(0),showOnInit:v.PropTypes.bool.def(!1),multipleMode:v.PropTypes.oneOf(["default","tag"]).def("default"),tagTheme:(0,v.TagThemeType)(),behavior:(0,v.InputBehaviorType)(),collapseTags:v.PropTypes.bool.def(!1),autoHeight:v.PropTypes.bool.def(!0),noDataText:v.PropTypes.string,noMatchText:v.PropTypes.string,loadingText:v.PropTypes.string,placeholder:v.PropTypes.string,searchPlaceholder:v.PropTypes.string,selectAllText:v.PropTypes.string,scrollLoading:v.PropTypes.bool.def(!1),allowCreate:v.PropTypes.bool.def(!1),popoverOptions:Object,customContent:v.PropTypes.bool.def(!1),list:v.PropTypes.arrayOf(v.PropTypes.any).def([]),idKey:v.PropTypes.string.def("value"),displayKey:v.PropTypes.string.def("label"),withValidate:v.PropTypes.bool.def(!0),showSelectedIcon:v.PropTypes.bool.def(!0),inputSearch:v.PropTypes.bool.def(!0),enableVirtualRender:v.PropTypes.bool.def(!1),allowEmptyValues:v.PropTypes.array.def([]),autoFocus:v.PropTypes.bool.def(!1),keepSearchValue:v.PropTypes.bool.def(!1),prefix:v.PropTypes.string,selectedStyle:(0,v.SelectedType)(),filterOption:{type:[Boolean,Function],default:!0}},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur","tag-remove","select","deselect"],setup:function(e,t){var o=t.emit,r=(0,x.useLocale)("select"),n=(0,x.usePrefix)().resolveClassName,l=(0,b.toRefs)(e),a=l.modelValue,i=l.disabled,u=l.filterable,s=l.multiple,c=l.remoteMethod,d=l.loading,p=l.popoverMinWidth,f=l.showOnInit,h=l.multipleMode,m=l.allowCreate,y=l.customContent,w=l.showSelectedIcon,S=l.inputSearch,P=l.enableVirtualRender,N=l.showSelectAll,V=l.scrollHeight,R=l.list,L=l.displayKey,k=l.idKey,D=l.collapseTags,M=l.autoHeight,A=l.popoverOptions,H=l.allowEmptyValues,$=l.autoFocus,B=l.keepSearchValue,_=l.selectedStyle,G=l.filterOption,F=(0,b.computed)((function(){return void 0===e.noDataText?r.value.noData:e.noDataText})),U=(0,b.computed)((function(){return void 0===e.noMatchText?r.value.noMatchedData:e.noMatchText})),z=(0,b.computed)((function(){return void 0===e.loadingText?r.value.loading:e.loadingText})),W=(0,b.computed)((function(){return void 0===e.placeholder?r.value.pleaseSelect:e.placeholder})),q=(0,b.computed)((function(){return void 0===e.searchPlaceholder?r.value.enterKeywords:e.searchPlaceholder})),X=(0,b.computed)((function(){return void 0===e.selectAllText?r.value.all:e.selectAllText})),Y=(0,v.useFormItem)(),Z=(0,b.ref)(),J=(0,b.ref)(),Q=(0,b.ref)(),ee=(0,b.ref)(),te=(0,b.ref)(),oe=(0,b.ref)(),re=(0,b.ref)(),ne=(0,b.ref)(new Map),le=(0,b.computed)((function(){return j(ne.value.values()).sort((function(e,t){return e.order-t.order}))})),ae=(0,b.ref)(new Map),ie=(0,b.ref)([]),ue=(0,b.computed)((function(){return ie.value.reduce((function(e,t){return e[t.value]=t.label,e}),{})})),se=(0,b.ref)(),ce=(0,b.computed)((function(){return R.value.reduce((function(e,t){return e[t[k.value]]=t[L.value],e}),{})}));(0,b.watch)(a,(function(){var t;et(),e.withValidate&&(null===(t=null==Y?void 0:Y.validate)||void 0===t||t.call(Y,"change"))}),{deep:!0}),(0,b.watch)(ie,(function(){var e;null===(e=re.value)||void 0===e||e.updatePopover(null,Ne.value)}));var de=(0,b.computed)((function(){return ye.value?R.value:R.value.filter((function(e){var t;return be.value(qe.value,e)&&(null===(t=E(String(e[L.value])))||void 0===t?void 0:t.includes(E(qe.value)))}))})),ve=(0,b.computed)((function(){return i.value||d.value})),pe=(0,b.computed)((function(){return ie.value.map((function(e){var t,o;return(null===(o=null===(t=ne.value)||void 0===t?void 0:t.get(e.value))||void 0===o?void 0:o.optionName)||ce.value[e.value]||e.label}))})),fe=(0,b.computed)((function(){var e=le.value.reduce((function(e,t){return t.disabled||e.push(t.optionID),e}),[]);return e.length<=ie.value.length&&e.every((function(e){return ie.value.some((function(t){return t.value===e}))}))})),he=(0,b.computed)((function(){return!!ae.value.size})),me=(0,b.computed)((function(){return!le.value.length})),ge=(0,b.computed)((function(){return le.value.length&&le.value.every((function(e){return!e.visible}))})),ye=(0,b.computed)((function(){return u.value&&"function"==typeof c.value})),be=(0,b.computed)((function(){return"function"==typeof G.value?G.value:function(){return G.value}})),Te=(0,b.computed)((function(){return!(Xe.value||me.value||ge.value)||y.value})),we=(0,b.computed)((function(){return s.value&&N.value&&(!qe.value||!u.value)})),xe=(0,b.computed)((function(){return V.value-12-(we.value?32:0)})),Se=(0,b.computed)((function(){return Xe.value?z.value:ge.value||R.value.length&&!de.value.length?U.value:me.value?F.value:""})),Pe=(0,b.computed)((function(){return M.value?D.value&&!_e.value:D.value})),Ne=(0,b.computed)((function(){return(0,T.merge)({theme:"light ".concat(n("select-popover")),trigger:"manual",width:Be.value,arrow:!1,placement:"bottom-start",isShow:_e.value,reference:te.value,offset:6,popoverDelay:0,renderType:v.RenderType.AUTO},A.value)})),Ce=I(ne),Ve=Ce.register,Ie=Ce.unregister,Oe=I(ae),Ee=Oe.register,Re=Oe.unregister,Le=function(){var e=(0,b.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),je=Le.isHover,ke=Le.setHover,De=Le.cancelHover,Me=(0,b.ref)(!1),Ae=function(){Me.value||(Me.value=!0,o("focus"))},He=function(){Me.value&&(Me.value=!1,o("blur"))},$e=function(e,t){var o=e.popoverMinWidth,r=null,n=(0,b.ref)("auto"),l=(0,b.ref)(!1),a=function(){var e;n.value=Math.max(null===(e=t.value)||void 0===e?void 0:e.offsetWidth,o)};return(0,b.onMounted)((function(){t.value&&(r=(0,v.observerResize)(t.value,a,60,!0)).start()})),(0,b.onBeforeUnmount)((function(){null==r||r.stop(),r=null})),{isPopoverShow:l,popperWidth:n,togglePopover:function(){l.value=!l.value},hidePopover:function(){l.value=!1},showPopover:function(){l.value=!0}}}({popoverMinWidth:p.value},J),Be=$e.popperWidth,_e=$e.isPopoverShow,Ke=$e.hidePopover,Ge=$e.showPopover,Fe=$e.togglePopover,Ue=(0,b.computed)((function(){return(u.value&&S.value||m.value)&&_e.value}));(0,b.watch)(_e,(function(e){o("toggle",_e.value),e?(document.addEventListener("keydown",tt),setTimeout((function(){Je(),ze()}),10)):(B.value||(qe.value=""),document.removeEventListener("keydown",tt))}));var ze=function(){var e,t=ie.value[0],o=ne.value.get(null==t?void 0:t.value);o&&!o.disabled&&o.visible?se.value=null==t?void 0:t.value:se.value=null===(e=le.value.find((function(e){return!e.disabled&&e.visible})))||void 0===e?void 0:e.optionID},We=O(ye.value?c.value:function(e){u.value&&(e?le.value.forEach((function(t){var o;t.visible=be.value(e,Object.assign({},t.$props))&&(null===(o=E(String(t.optionName)))||void 0===o?void 0:o.includes(E(e)))})):le.value.forEach((function(e){e.visible=!0})))},ze),qe=We.searchKey,Xe=We.searchLoading,Ye=function(e){e!==a.value&&(o("update:modelValue",e,a.value),o("change",e,a.value))},Ze=function(e){if(!ve.value&&e){if(s.value){var t=ie.value.findIndex((function(t){return t.value===e.optionID}));t>-1?(ie.value.splice(t,1),Ye(ie.value.map((function(e){return e.value}))),o("deselect",e.optionID)):(ie.value.push({value:e.optionID,label:e.optionName||e.optionID}),Ye(ie.value.map((function(e){return e.value}))),o("select",e.optionID))}else ie.value=[{label:e.optionName||e.optionID,value:e.optionID}],Ye(e.optionID),o("select",e.optionID),Ke();Je()}},Je=function(){setTimeout((function(){var e,t,o;S.value||m.value?"tag"===h.value?null===(t=te.value)||void 0===t||t.focus():null===(o=Z.value)||void 0===o||o.focus():null===(e=ee.value)||void 0===e||e.focus()}),0)},Qe=function(e){var t,o,r=e;if("object"===g(r)){var n,l=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return K(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?K(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}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 l,a=!0,i=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){i=!0,l=e},f:function(){try{a||null==o.return||o.return()}finally{if(i)throw l}}}}(ne.value.keys());try{for(l.s();!(n=l.n()).done;){var a=n.value;if((0,T.isEqual)(a,r)){r=a;break}}}catch(e){l.e(e)}finally{l.f()}}return(null===(o=null===(t=ne.value)||void 0===t?void 0:t.get(r))||void 0===o?void 0:o.optionName)||ce.value[r]||ue.value[r]||r},et=function(){Array.isArray(a.value)?ie.value=j(a.value.map((function(e){return{value:e,label:Qe(e)}}))):void 0!==a.value||H.value.includes(a.value)?ie.value=[{value:a.value,label:Qe(a.value)}]:ie.value=[]},tt=function(e){var t,o,r,n;if(_e.value){var l=le.value.filter((function(e){return!e.disabled&&e.visible})),a=l.findIndex((function(e){return e.optionID===se.value}));switch(e.code){case"ArrowUp":case"ArrowDown":e.preventDefault();var i;(function(e,t){if(!e||!t)return!0;var o=e.getBoundingClientRect(),r=o.top,n=o.bottom,l=t.getBoundingClientRect(),a=l.top,i=l.bottom;return r>=a&&n<=i})(null===(t=l[i="ArrowDown"===e.code?a>=l.length-1?0:a+1:0===a?l.length-1:a-1])||void 0===t?void 0:t.$el,Q.value)||null===(r=null===(o=l[i])||void 0===o?void 0:o.$el)||void 0===r||r.scrollIntoView(),se.value=null===(n=l[i])||void 0===n?void 0:n.optionID;break;case"Backspace":if(!s.value||!ie.value.length||qe.value.length||e.target===ee.value)return;ie.value.pop(),Ye(ie.value.map((function(e){return e.value})));break;case"Enter":var u=e.target.value;if(m.value&&u)return;var c=ne.value.get(se.value);Ze(c)}}};return(0,b.provide)(C,(0,b.reactive)({multiple:s,selected:ie,activeOptionValue:se,showSelectedIcon:w,selectedStyle:_,register:Ve,unregister:Ie,registerGroup:Ee,unregisterGroup:Re,handleOptionSelected:Ze,handleGetLabelByValue:Qe})),(0,b.onMounted)((function(){et(),setTimeout((function(){f.value&&Ge(),$.value&&Je()}))})),{selected:ie,isInput:Ue,options:le,isDisabled:ve,selectedLabel:pe,isPopoverShow:_e,isHover:je,popperWidth:Be,inputRef:Z,triggerRef:J,contentRef:Q,searchRef:ee,selectTagInputRef:te,virtualRenderRef:oe,popoverRef:re,searchLoading:Xe,isOptionsEmpty:me,isSearchEmpty:ge,isFocus:Me,isShowSelectContent:Te,curContentText:Se,isGroup:he,searchKey:qe,isShowSelectAll:we,virtualHeight:xe,virtualList:de,isCollapseTags:Pe,popoverConfig:Ne,focusInput:Je,setHover:ke,cancelHover:De,handleFocus:Ae,handleBlur:He,handleTogglePopover:function(){ve.value||(Ae(),Fe())},handleClear:function(e){e.stopPropagation(),ie.value=[],Ye(s.value?[]:""),o("clear",s.value?[]:""),Ke()},hidePopover:Ke,showPopover:Ge,handleToggleAll:function(){var e;fe.value?ie.value=[]:(le.value.forEach((function(e){e.disabled||e.optionID in ue.value||ie.value.push({value:e.optionID,label:e.optionName||e.optionID})})),null===(e=R.value)||void 0===e||e.forEach((function(e){e.disabled||e[k.value]in ue.value||ie.value.push({value:e[k.value],label:e[L.value]})}))),Ye(ie.value.map((function(e){return e.value}))),Je()},handleOptionSelected:Ze,handleClickOutside:function(e){var t,o=e.event.target;(null===(t=J.value)||void 0===t?void 0:t.contains(o))||J.value===o||(Ke(),He())},handleScroll:function(e){var t=e.target;t.scrollTop+t.clientHeight===t.scrollHeight&&o("scroll-end")},handleDeleteTag:function(e){if(!ve.value){var t=ie.value.findIndex((function(t){return t.value===e}));t>-1&&(ie.value.splice(t,1),Ye(ie.value.map((function(e){return e.value}))),o("tag-remove",e))}},handleInputChange:function(e){u.value&&(qe.value=e)},handleSelectedAllOptionMouseEnter:function(){se.value=""},handlePopoverShow:function(){setTimeout((function(){var e,t;P.value&&(null===(t=null===(e=oe.value)||void 0===e?void 0:e.reset)||void 0===t||t.call(e))}))},localLoadingText:z,localPlaceholder:W,localSearchPlaceholder:q,localSelectAllText:X,resolveClassName:n,handleCreateCustomOption:function(e){var t=String(e);if(m.value&&t){var o=le.value.find((function(e){return E(String(e.optionName))===E(t)}));if(u.value&&o)return Ze(o),void(qe.value="");ne.value.get(t)||(s.value?(ie.value.push({value:t,label:t}),Ye(ie.value.map((function(e){return e.value})))):(ie.value=[{value:t,label:t}],Ye(t),Ke()),qe.value="")}}}},render:function(){var e,t=this,o=(0,v.classes)((y(e={},"".concat(this.resolveClassName("select")),!0),y(e,"popover-show",this.isPopoverShow),y(e,"is-disabled",this.isDisabled),y(e,"is-focus",this.isFocus),y(e,"is-filterable",this.filterable),y(e,this.size,!0),y(e,this.behavior,!0),e)),r=function(){return t.loading?(0,b.createVNode)(A.default,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):t.clearable&&t.isHover&&t.selected.length&&!t.isDisabled?(0,b.createVNode)(S.Close,{class:"clear-icon",onClick:t.handleClear},null):(0,b.createVNode)(S.AngleUp,{class:"angle-up"},null)};return(0,b.createVNode)("div",{class:o},[(0,b.createVNode)(H.default,(0,b.mergeProps)(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:function(){return(0,b.createVNode)("div",{class:t.resolveClassName("select-trigger"),style:{height:t.autoHeight&&t.collapseTags?"32px":""},ref:"triggerRef",onClick:t.handleTogglePopover,onMouseenter:t.setHover,onMouseleave:t.cancelHover},[(null===(l=(n=t.$slots).trigger)||void 0===l?void 0:l.call(n,{selected:t.selected}))||("tag"===t.multipleMode?(0,b.createVNode)(_,{ref:"selectTagInputRef",modelValue:t.searchKey,"onUpdate:modelValue":function(e){return t.searchKey=e},selected:t.selected,tagTheme:t.tagTheme,placeholder:t.localPlaceholder,filterable:t.isInput,disabled:t.isDisabled,onRemove:t.handleDeleteTag,collapseTags:t.isCollapseTags,onEnter:t.handleCreateCustomOption},{prefix:t.prefix?function(){return(0,b.createVNode)("div",{class:"".concat(t.resolveClassName("select--prefix-area"))},[(0,b.createVNode)("span",null,[t.prefix])])}:t.$slots.prefix?function(){var e,o;return null===(o=(e=t.$slots).prefix)||void 0===o?void 0:o.call(e)}:void 0,default:t.$slots.tag&&function(){return t.$slots.tag({selected:t.selected})},suffix:function(){return r()}}):(0,b.createVNode)(M.default,(0,b.mergeProps)({ref:"inputRef",type:"text",modelValue:t.isInput?t.searchKey:t.selectedLabel.join(","),placeholder:t.isInput&&t.selectedLabel.join(",")||t.localPlaceholder,readonly:!t.isInput,selectReadonly:!0,disabled:t.isDisabled,behavior:t.behavior,size:t.size,withValidate:!1,stopPropagation:!1,onInput:t.handleInputChange,onEnter:t.handleCreateCustomOption},t.prefix?{prefix:t.prefix}:null),"function"==typeof(o=e=Object.assign(Object.assign({},"function"==typeof t.$slots.prefix?{prefix:function(){var e,o;return null===(o=(e=t.$slots).prefix)||void 0===o?void 0:o.call(e)}}:null),{suffix:function(){return r()}}))||"[object Object]"===Object.prototype.toString.call(o)&&!(0,b.isVNode)(o)?e:{default:function(){return[e]}}))]);var e,o,n,l},content:function(){return(0,b.createVNode)("div",{class:t.resolveClassName("select-content-wrapper"),ref:"contentRef"},[t.filterable&&!t.inputSearch&&(0,b.createVNode)("div",{class:t.resolveClassName("select-search-wrapper")},[(0,b.createVNode)(S.Search,{class:"icon-search",width:16,height:16},null),(0,b.withDirectives)((0,b.createVNode)("input",{ref:"searchRef",class:t.resolveClassName("select-search-input"),placeholder:t.localSearchPlaceholder,"onUpdate:modelValue":function(e){return t.searchKey=e}},null),[[b.vModelText,t.searchKey]])]),!t.isShowSelectContent&&(0,b.createVNode)("div",{class:t.resolveClassName("select-empty")},[t.searchLoading&&(0,b.createVNode)(A.default,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,b.createVNode)("span",null,[t.curContentText])]),(0,b.createVNode)("div",{class:t.resolveClassName("select-content")},[(0,b.createVNode)("div",{class:t.enableVirtualRender?"":t.resolveClassName("select-dropdown"),style:{maxHeight:"".concat(t.scrollHeight,"px")},onScroll:t.handleScroll},[(0,b.withDirectives)((0,b.createVNode)("ul",{class:t.resolveClassName("select-options")},[t.isShowSelectAll&&(0,b.createVNode)("li",{class:t.resolveClassName("select-option"),onMouseenter:t.handleSelectedAllOptionMouseEnter,onClick:t.handleToggleAll},[t.localSelectAllText]),t.enableVirtualRender?(0,b.createVNode)($.default,{list:t.virtualList,height:t.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:function(e){var o,r,n=e.data,l=(null===(o=t.$slots)||void 0===o?void 0:o.optionRender)||(null===(r=t.$slots)||void 0===r?void 0:r.virtualScrollRender);return n.map((function(e){return(0,b.createVNode)(R,{key:e[t.idKey],id:e[t.idKey],name:e[t.displayKey]},"function"==typeof l?{default:function(){return l({item:e})}}:null)}))}}):t.list.map((function(e){var o;return(0,b.createVNode)(R,{id:e[t.idKey],name:e[t.displayKey]},(null===(o=t.$slots)||void 0===o?void 0:o.optionRender)?{default:function(){var o,r;return null===(r=null===(o=t.$slots)||void 0===o?void 0:o.optionRender)||void 0===r?void 0:r.call(o,{item:e})}}:null)})),null===(o=(e=t.$slots).default)||void 0===o?void 0:o.call(e),t.scrollLoading&&(0,b.createVNode)("li",{class:t.resolveClassName("select-options-loading")},[(0,b.createVNode)(A.default,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),(0,b.createVNode)("span",null,[t.localLoadingText])])]),[[b.vShow,t.isShowSelectContent]])]),t.$slots.extension&&(0,b.createVNode)("div",{class:t.resolveClassName("select-extension")},[t.$slots.extension()])])]);var e,o}})])}});var F=(0,v.withInstallProps)(G,{Option:R,Group:k});const U=F})();var m=h.T0,g=h.GE,y=h.i2,b=h.ZP;export{m as BkOption,g as BkOptionGroup,y as BkSelect,b as default};