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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/lib/affix/index.js +1 -319
  2. package/lib/alert/index.js +1 -215
  3. package/lib/animate-number/index.js +1 -155
  4. package/lib/backtop/index.js +1 -188
  5. package/lib/badge/index.js +1 -236
  6. package/lib/breadcrumb/index.js +1 -309
  7. package/lib/button/index.js +1 -321
  8. package/lib/card/index.js +1 -274
  9. package/lib/cascader/index.js +2 -2019
  10. package/lib/cascader/index.js.LICENSE.txt +1 -0
  11. package/lib/checkbox/index.js +1 -542
  12. package/lib/code-diff/index.js +1 -5501
  13. package/lib/collapse/index.js +1 -518
  14. package/lib/collapse-transition/index.js +1 -178
  15. package/lib/color-picker/index.js +1 -2662
  16. package/lib/components.js +1 -530
  17. package/lib/config-provider/index.js +1 -317
  18. package/lib/container/index.js +1 -343
  19. package/lib/date-picker/index.js +1 -5481
  20. package/lib/dialog/index.js +2 -1266
  21. package/lib/dialog/index.js.LICENSE.txt +1 -0
  22. package/lib/directives/index.js +2 -1335
  23. package/lib/directives/index.js.LICENSE.txt +14 -0
  24. package/lib/dist.index.js +1 -87
  25. package/lib/divider/index.js +1 -169
  26. package/lib/dropdown/index.js +1 -369
  27. package/lib/exception/index.js +1 -385
  28. package/lib/fixed-navbar/index.js +1 -154
  29. package/lib/form/index.js +1 -918
  30. package/lib/hooks.js +1 -73
  31. package/lib/icon/angle-double-down-line.js +1 -481
  32. package/lib/icon/angle-double-left-line.js +1 -481
  33. package/lib/icon/angle-double-left.js +1 -481
  34. package/lib/icon/angle-double-right-line.js +1 -481
  35. package/lib/icon/angle-double-right.js +1 -481
  36. package/lib/icon/angle-double-up-line.js +1 -481
  37. package/lib/icon/angle-down-fill.js +1 -481
  38. package/lib/icon/angle-down-line.js +1 -481
  39. package/lib/icon/angle-down.js +1 -481
  40. package/lib/icon/angle-left.js +1 -481
  41. package/lib/icon/angle-right.js +1 -481
  42. package/lib/icon/angle-up-fill.js +1 -481
  43. package/lib/icon/angle-up.js +1 -481
  44. package/lib/icon/archive-fill.js +1 -481
  45. package/lib/icon/arrows-left.js +1 -481
  46. package/lib/icon/arrows-right.js +1 -481
  47. package/lib/icon/assistant.js +1 -481
  48. package/lib/icon/audio-fill.js +1 -481
  49. package/lib/icon/bk.js +1 -481
  50. package/lib/icon/circle.js +1 -481
  51. package/lib/icon/close-line.js +1 -481
  52. package/lib/icon/close.js +1 -481
  53. package/lib/icon/code.js +1 -481
  54. package/lib/icon/cog-shape.js +1 -481
  55. package/lib/icon/collapse-left.js +1 -481
  56. package/lib/icon/copy-shape.js +1 -481
  57. package/lib/icon/copy.js +1 -481
  58. package/lib/icon/data-shape.js +1 -481
  59. package/lib/icon/del.js +1 -481
  60. package/lib/icon/doc-fill.js +1 -481
  61. package/lib/icon/done.js +1 -481
  62. package/lib/icon/down-shape.js +1 -481
  63. package/lib/icon/down-small.js +1 -481
  64. package/lib/icon/edit-line.js +1 -481
  65. package/lib/icon/ellipsis.js +1 -481
  66. package/lib/icon/enlarge-line.js +1 -481
  67. package/lib/icon/error.js +1 -481
  68. package/lib/icon/excel-fill.js +1 -481
  69. package/lib/icon/exclamation-circle-shape.js +1 -481
  70. package/lib/icon/eye.js +1 -481
  71. package/lib/icon/filliscreen-line.js +1 -481
  72. package/lib/icon/fix-line.js +1 -481
  73. package/lib/icon/fix-shape.js +1 -481
  74. package/lib/icon/folder-open.js +1 -481
  75. package/lib/icon/folder-shape-open.js +1 -481
  76. package/lib/icon/folder-shape.js +1 -481
  77. package/lib/icon/folder.js +1 -481
  78. package/lib/icon/funnel.js +1 -481
  79. package/lib/icon/help-document-fill.js +1 -481
  80. package/lib/icon/help-fill.js +1 -481
  81. package/lib/icon/help.js +1 -481
  82. package/lib/icon/image-fill.js +1 -527
  83. package/lib/icon/img-error.js +1 -527
  84. package/lib/icon/img-placehoulder.js +1 -527
  85. package/lib/icon/index.js +1 -2367
  86. package/lib/icon/info-line.js +1 -527
  87. package/lib/icon/info.js +1 -527
  88. package/lib/icon/left-shape.js +1 -527
  89. package/lib/icon/left-turn-line.js +1 -527
  90. package/lib/icon/narrow-line.js +1 -527
  91. package/lib/icon/original.js +1 -527
  92. package/lib/icon/pdf-fill.js +1 -527
  93. package/lib/icon/play-shape.js +1 -527
  94. package/lib/icon/plus.js +1 -527
  95. package/lib/icon/ppt-fill.js +1 -527
  96. package/lib/icon/qq.js +1 -527
  97. package/lib/icon/right-shape.js +1 -527
  98. package/lib/icon/right-turn-line.js +1 -527
  99. package/lib/icon/search.js +1 -527
  100. package/lib/icon/share.js +1 -527
  101. package/lib/icon/spinner.js +1 -527
  102. package/lib/icon/success.js +1 -527
  103. package/lib/icon/switcher-loading.js +1 -527
  104. package/lib/icon/text-file.js +1 -527
  105. package/lib/icon/text-fill.js +1 -527
  106. package/lib/icon/transfer.js +1 -527
  107. package/lib/icon/tree-application-shape.js +1 -527
  108. package/lib/icon/unfull-screen.js +1 -527
  109. package/lib/icon/unvisible.js +1 -527
  110. package/lib/icon/up-shape.js +1 -527
  111. package/lib/icon/upload.js +1 -527
  112. package/lib/icon/video-fill.js +1 -527
  113. package/lib/icon/warn.js +1 -527
  114. package/lib/icon/weixin-pro.js +1 -527
  115. package/lib/icon/weixin.js +1 -527
  116. package/lib/image/index.js +1 -593
  117. package/lib/index.js +1 -97
  118. package/lib/info-box/index.js +2 -1456
  119. package/lib/info-box/index.js.LICENSE.txt +1 -0
  120. package/lib/input/index.js +2 -1528
  121. package/lib/input/index.js.LICENSE.txt +1 -0
  122. package/lib/link/index.js +1 -160
  123. package/lib/loading/index.js +1 -379
  124. package/lib/locale/index.js +1 -465
  125. package/lib/menu/index.js +1 -725
  126. package/lib/message/index.js +2 -1790
  127. package/lib/message/index.js.LICENSE.txt +6 -0
  128. package/lib/modal/index.js +1 -337
  129. package/lib/navigation/index.js +1 -367
  130. package/lib/notify/index.js +1 -394
  131. package/lib/overflow-title/index.js +1 -485
  132. package/lib/pagination/index.js +1 -880
  133. package/lib/plugin-popover/index.js +1 -4067
  134. package/lib/plugins/index.js +1 -63
  135. package/lib/pop-confirm/index.js +1 -273
  136. package/lib/popover/index.js +1 -4075
  137. package/lib/popover2/index.js +1 -107
  138. package/lib/preset.js +1 -93
  139. package/lib/process/index.js +2 -1099
  140. package/lib/process/index.js.LICENSE.txt +1 -0
  141. package/lib/progress/index.js +1 -428
  142. package/lib/radio/index.js +1 -627
  143. package/lib/rate/index.js +1 -338
  144. package/lib/resize-layout/index.js +1 -430
  145. package/lib/search-select/index.js +2 -3036
  146. package/lib/search-select/index.js.LICENSE.txt +1 -0
  147. package/lib/select/index.js +2 -2571
  148. package/lib/select/index.js.LICENSE.txt +1 -0
  149. package/lib/shared/index.js +1 -2865
  150. package/lib/sideslider/index.js +2 -1005
  151. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  152. package/lib/slider/index.js +2 -1629
  153. package/lib/slider/index.js.LICENSE.txt +1 -0
  154. package/lib/steps/index.js +2 -1163
  155. package/lib/steps/index.js.LICENSE.txt +1 -0
  156. package/lib/swiper/index.js +1 -336
  157. package/lib/switcher/index.js +1 -277
  158. package/lib/tab/index.js +1 -859
  159. package/lib/table/index.js +1 -6568
  160. package/lib/table-column/index.js +1 -730
  161. package/lib/tag/index.js +1 -233
  162. package/lib/tag-input/index.js +1 -1652
  163. package/lib/time-picker/index.js +1 -71
  164. package/lib/timeline/index.js +1 -242
  165. package/lib/transfer/index.js +1 -673
  166. package/lib/tree/index.js +1 -2625
  167. package/lib/upload/index.js +2 -3193
  168. package/lib/upload/index.js.LICENSE.txt +1 -0
  169. package/lib/virtual-render/index.js +1 -748
  170. package/package.json +1 -1
@@ -1,3036 +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__config_provider_9d0186d9__ from "../config-provider";
4
- import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
5
- import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
6
- import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
7
- import * as __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__ from "../checkbox";
8
- import * as __WEBPACK_EXTERNAL_MODULE__radio_904c495d__ from "../radio";
9
- /******/ var __webpack_modules__ = ({
10
-
11
- /***/ 7609:
12
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
13
-
14
- var _typeof = (__webpack_require__(7425)["default"]);
15
- function _regeneratorRuntime() {
16
- "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
17
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
18
- return exports;
19
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
20
- var exports = {},
21
- Op = Object.prototype,
22
- hasOwn = Op.hasOwnProperty,
23
- defineProperty = Object.defineProperty || function (obj, key, desc) {
24
- obj[key] = desc.value;
25
- },
26
- $Symbol = "function" == typeof Symbol ? Symbol : {},
27
- iteratorSymbol = $Symbol.iterator || "@@iterator",
28
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
29
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
30
- function define(obj, key, value) {
31
- return Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: !0,
34
- configurable: !0,
35
- writable: !0
36
- }), obj[key];
37
- }
38
- try {
39
- define({}, "");
40
- } catch (err) {
41
- define = function define(obj, key, value) {
42
- return obj[key] = value;
43
- };
44
- }
45
- function wrap(innerFn, outerFn, self, tryLocsList) {
46
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
47
- generator = Object.create(protoGenerator.prototype),
48
- context = new Context(tryLocsList || []);
49
- return defineProperty(generator, "_invoke", {
50
- value: makeInvokeMethod(innerFn, self, context)
51
- }), generator;
52
- }
53
- function tryCatch(fn, obj, arg) {
54
- try {
55
- return {
56
- type: "normal",
57
- arg: fn.call(obj, arg)
58
- };
59
- } catch (err) {
60
- return {
61
- type: "throw",
62
- arg: err
63
- };
64
- }
65
- }
66
- exports.wrap = wrap;
67
- var ContinueSentinel = {};
68
- function Generator() {}
69
- function GeneratorFunction() {}
70
- function GeneratorFunctionPrototype() {}
71
- var IteratorPrototype = {};
72
- define(IteratorPrototype, iteratorSymbol, function () {
73
- return this;
74
- });
75
- var getProto = Object.getPrototypeOf,
76
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
77
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
78
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
79
- function defineIteratorMethods(prototype) {
80
- ["next", "throw", "return"].forEach(function (method) {
81
- define(prototype, method, function (arg) {
82
- return this._invoke(method, arg);
83
- });
84
- });
85
- }
86
- function AsyncIterator(generator, PromiseImpl) {
87
- function invoke(method, arg, resolve, reject) {
88
- var record = tryCatch(generator[method], generator, arg);
89
- if ("throw" !== record.type) {
90
- var result = record.arg,
91
- value = result.value;
92
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
93
- invoke("next", value, resolve, reject);
94
- }, function (err) {
95
- invoke("throw", err, resolve, reject);
96
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
97
- result.value = unwrapped, resolve(result);
98
- }, function (error) {
99
- return invoke("throw", error, resolve, reject);
100
- });
101
- }
102
- reject(record.arg);
103
- }
104
- var previousPromise;
105
- defineProperty(this, "_invoke", {
106
- value: function value(method, arg) {
107
- function callInvokeWithMethodAndArg() {
108
- return new PromiseImpl(function (resolve, reject) {
109
- invoke(method, arg, resolve, reject);
110
- });
111
- }
112
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
113
- }
114
- });
115
- }
116
- function makeInvokeMethod(innerFn, self, context) {
117
- var state = "suspendedStart";
118
- return function (method, arg) {
119
- if ("executing" === state) throw new Error("Generator is already running");
120
- if ("completed" === state) {
121
- if ("throw" === method) throw arg;
122
- return doneResult();
123
- }
124
- for (context.method = method, context.arg = arg;;) {
125
- var delegate = context.delegate;
126
- if (delegate) {
127
- var delegateResult = maybeInvokeDelegate(delegate, context);
128
- if (delegateResult) {
129
- if (delegateResult === ContinueSentinel) continue;
130
- return delegateResult;
131
- }
132
- }
133
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
134
- if ("suspendedStart" === state) throw state = "completed", context.arg;
135
- context.dispatchException(context.arg);
136
- } else "return" === context.method && context.abrupt("return", context.arg);
137
- state = "executing";
138
- var record = tryCatch(innerFn, self, context);
139
- if ("normal" === record.type) {
140
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
141
- return {
142
- value: record.arg,
143
- done: context.done
144
- };
145
- }
146
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
147
- }
148
- };
149
- }
150
- function maybeInvokeDelegate(delegate, context) {
151
- var methodName = context.method,
152
- method = delegate.iterator[methodName];
153
- 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;
154
- var record = tryCatch(method, delegate.iterator, context.arg);
155
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
156
- var info = record.arg;
157
- 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);
158
- }
159
- function pushTryEntry(locs) {
160
- var entry = {
161
- tryLoc: locs[0]
162
- };
163
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
164
- }
165
- function resetTryEntry(entry) {
166
- var record = entry.completion || {};
167
- record.type = "normal", delete record.arg, entry.completion = record;
168
- }
169
- function Context(tryLocsList) {
170
- this.tryEntries = [{
171
- tryLoc: "root"
172
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
173
- }
174
- function values(iterable) {
175
- if (iterable) {
176
- var iteratorMethod = iterable[iteratorSymbol];
177
- if (iteratorMethod) return iteratorMethod.call(iterable);
178
- if ("function" == typeof iterable.next) return iterable;
179
- if (!isNaN(iterable.length)) {
180
- var i = -1,
181
- next = function next() {
182
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
183
- return next.value = undefined, next.done = !0, next;
184
- };
185
- return next.next = next;
186
- }
187
- }
188
- return {
189
- next: doneResult
190
- };
191
- }
192
- function doneResult() {
193
- return {
194
- value: undefined,
195
- done: !0
196
- };
197
- }
198
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
199
- value: GeneratorFunctionPrototype,
200
- configurable: !0
201
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
202
- value: GeneratorFunction,
203
- configurable: !0
204
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
205
- var ctor = "function" == typeof genFun && genFun.constructor;
206
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
207
- }, exports.mark = function (genFun) {
208
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
209
- }, exports.awrap = function (arg) {
210
- return {
211
- __await: arg
212
- };
213
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
214
- return this;
215
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
216
- void 0 === PromiseImpl && (PromiseImpl = Promise);
217
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
218
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
219
- return result.done ? result.value : iter.next();
220
- });
221
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
222
- return this;
223
- }), define(Gp, "toString", function () {
224
- return "[object Generator]";
225
- }), exports.keys = function (val) {
226
- var object = Object(val),
227
- keys = [];
228
- for (var key in object) keys.push(key);
229
- return keys.reverse(), function next() {
230
- for (; keys.length;) {
231
- var key = keys.pop();
232
- if (key in object) return next.value = key, next.done = !1, next;
233
- }
234
- return next.done = !0, next;
235
- };
236
- }, exports.values = values, Context.prototype = {
237
- constructor: Context,
238
- reset: function reset(skipTempReset) {
239
- 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);
240
- },
241
- stop: function stop() {
242
- this.done = !0;
243
- var rootRecord = this.tryEntries[0].completion;
244
- if ("throw" === rootRecord.type) throw rootRecord.arg;
245
- return this.rval;
246
- },
247
- dispatchException: function dispatchException(exception) {
248
- if (this.done) throw exception;
249
- var context = this;
250
- function handle(loc, caught) {
251
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
252
- }
253
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
254
- var entry = this.tryEntries[i],
255
- record = entry.completion;
256
- if ("root" === entry.tryLoc) return handle("end");
257
- if (entry.tryLoc <= this.prev) {
258
- var hasCatch = hasOwn.call(entry, "catchLoc"),
259
- hasFinally = hasOwn.call(entry, "finallyLoc");
260
- if (hasCatch && hasFinally) {
261
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
262
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
263
- } else if (hasCatch) {
264
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
265
- } else {
266
- if (!hasFinally) throw new Error("try statement without catch or finally");
267
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
268
- }
269
- }
270
- }
271
- },
272
- abrupt: function abrupt(type, arg) {
273
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
274
- var entry = this.tryEntries[i];
275
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
276
- var finallyEntry = entry;
277
- break;
278
- }
279
- }
280
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
281
- var record = finallyEntry ? finallyEntry.completion : {};
282
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
283
- },
284
- complete: function complete(record, afterLoc) {
285
- if ("throw" === record.type) throw record.arg;
286
- 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;
287
- },
288
- finish: function finish(finallyLoc) {
289
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
290
- var entry = this.tryEntries[i];
291
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
292
- }
293
- },
294
- "catch": function _catch(tryLoc) {
295
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
296
- var entry = this.tryEntries[i];
297
- if (entry.tryLoc === tryLoc) {
298
- var record = entry.completion;
299
- if ("throw" === record.type) {
300
- var thrown = record.arg;
301
- resetTryEntry(entry);
302
- }
303
- return thrown;
304
- }
305
- }
306
- throw new Error("illegal catch attempt");
307
- },
308
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
309
- return this.delegate = {
310
- iterator: values(iterable),
311
- resultName: resultName,
312
- nextLoc: nextLoc
313
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
314
- }
315
- }, exports;
316
- }
317
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
318
-
319
- /***/ }),
320
-
321
- /***/ 7425:
322
- /***/ ((module) => {
323
-
324
- function _typeof(obj) {
325
- "@babel/helpers - typeof";
326
-
327
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
328
- return typeof obj;
329
- } : function (obj) {
330
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
331
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
332
- }
333
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
334
-
335
- /***/ }),
336
-
337
- /***/ 2841:
338
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
339
-
340
- // TODO(Babel 8): Remove this file.
341
-
342
- var runtime = __webpack_require__(7609)();
343
- module.exports = runtime;
344
-
345
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
346
- try {
347
- regeneratorRuntime = runtime;
348
- } catch (accidentalStrictMode) {
349
- if (typeof globalThis === "object") {
350
- globalThis.regeneratorRuntime = runtime;
351
- } else {
352
- Function("r", "regeneratorRuntime = r")(runtime);
353
- }
354
- }
355
-
356
-
357
- /***/ })
358
-
359
- /******/ });
360
- /************************************************************************/
361
- /******/ // The module cache
362
- /******/ var __webpack_module_cache__ = {};
363
- /******/
364
- /******/ // The require function
365
- /******/ function __webpack_require__(moduleId) {
366
- /******/ // Check if module is in cache
367
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
368
- /******/ if (cachedModule !== undefined) {
369
- /******/ return cachedModule.exports;
370
- /******/ }
371
- /******/ // Create a new module (and put it into the cache)
372
- /******/ var module = __webpack_module_cache__[moduleId] = {
373
- /******/ // no module.id needed
374
- /******/ // no module.loaded needed
375
- /******/ exports: {}
376
- /******/ };
377
- /******/
378
- /******/ // Execute the module function
379
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
380
- /******/
381
- /******/ // Return the exports of the module
382
- /******/ return module.exports;
383
- /******/ }
384
- /******/
385
- /************************************************************************/
386
- /******/ /* webpack/runtime/compat get default export */
387
- /******/ (() => {
388
- /******/ // getDefaultExport function for compatibility with non-harmony modules
389
- /******/ __webpack_require__.n = (module) => {
390
- /******/ var getter = module && module.__esModule ?
391
- /******/ () => (module['default']) :
392
- /******/ () => (module);
393
- /******/ __webpack_require__.d(getter, { a: getter });
394
- /******/ return getter;
395
- /******/ };
396
- /******/ })();
397
- /******/
398
- /******/ /* webpack/runtime/define property getters */
399
- /******/ (() => {
400
- /******/ // define getter functions for harmony exports
401
- /******/ __webpack_require__.d = (exports, definition) => {
402
- /******/ for(var key in definition) {
403
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
404
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
405
- /******/ }
406
- /******/ }
407
- /******/ };
408
- /******/ })();
409
- /******/
410
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
411
- /******/ (() => {
412
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
413
- /******/ })();
414
- /******/
415
- /************************************************************************/
416
- var __webpack_exports__ = {};
417
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
418
- (() => {
419
-
420
- // EXPORTS
421
- __webpack_require__.d(__webpack_exports__, {
422
- r: () => (/* binding */ BkSearchSelect),
423
- Z: () => (/* binding */ src)
424
- });
425
-
426
- ;// CONCATENATED MODULE: external "../shared"
427
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
428
- var y = x => () => x
429
- const external_shared_namespaceObject = x({ ["debounce"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.debounce, ["random"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.random, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
430
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
431
- function _typeof(obj) {
432
- "@babel/helpers - typeof";
433
-
434
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
435
- return typeof obj;
436
- } : function (obj) {
437
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
438
- }, _typeof(obj);
439
- }
440
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
441
-
442
- function _toPrimitive(input, hint) {
443
- if (_typeof(input) !== "object" || input === null) return input;
444
- var prim = input[Symbol.toPrimitive];
445
- if (prim !== undefined) {
446
- var res = prim.call(input, hint || "default");
447
- if (_typeof(res) !== "object") return res;
448
- throw new TypeError("@@toPrimitive must return a primitive value.");
449
- }
450
- return (hint === "string" ? String : Number)(input);
451
- }
452
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
453
-
454
-
455
- function _toPropertyKey(arg) {
456
- var key = _toPrimitive(arg, "string");
457
- return _typeof(key) === "symbol" ? key : String(key);
458
- }
459
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
460
-
461
- function _defineProperty(obj, key, value) {
462
- key = _toPropertyKey(key);
463
- if (key in obj) {
464
- Object.defineProperty(obj, key, {
465
- value: value,
466
- enumerable: true,
467
- configurable: true,
468
- writable: true
469
- });
470
- } else {
471
- obj[key] = value;
472
- }
473
- return obj;
474
- }
475
- ;// CONCATENATED MODULE: external "vue"
476
- var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
477
- var external_vue_y = x => () => x
478
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
479
- ;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
480
- var raf = null;
481
- function requestAnimationFrame (callback) {
482
- if (!raf) {
483
- raf = (
484
- window.requestAnimationFrame ||
485
- window.webkitRequestAnimationFrame ||
486
- window.mozRequestAnimationFrame ||
487
- function (callback) {
488
- return setTimeout(callback, 16)
489
- }
490
- ).bind(window);
491
- }
492
- return raf(callback)
493
- }
494
-
495
- var caf = null;
496
- function cancelAnimationFrame (id) {
497
- if (!caf) {
498
- caf = (
499
- window.cancelAnimationFrame ||
500
- window.webkitCancelAnimationFrame ||
501
- window.mozCancelAnimationFrame ||
502
- function (id) {
503
- clearTimeout(id);
504
- }
505
- ).bind(window);
506
- }
507
-
508
- caf(id);
509
- }
510
-
511
- function createStyles (styleText) {
512
- var style = document.createElement('style');
513
-
514
- if (style.styleSheet) {
515
- style.styleSheet.cssText = styleText;
516
- } else {
517
- style.appendChild(document.createTextNode(styleText));
518
- }
519
- (document.querySelector('head') || document.body).appendChild(style);
520
- return style
521
- }
522
-
523
- function createElement (tagName, props) {
524
- if ( props === void 0 ) props = {};
525
-
526
- var elem = document.createElement(tagName);
527
- Object.keys(props).forEach(function (key) {
528
- elem[key] = props[key];
529
- });
530
- return elem
531
- }
532
-
533
- function getComputedStyle (elem, prop, pseudo) {
534
- // for older versions of Firefox, `getComputedStyle` required
535
- // the second argument and may return `null` for some elements
536
- // when `display: none`
537
- var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
538
- display: 'none'
539
- };
540
-
541
- return computedStyle[prop]
542
- }
543
-
544
- function getRenderInfo (elem) {
545
- if (!document.documentElement.contains(elem)) {
546
- return {
547
- detached: true,
548
- rendered: false
549
- }
550
- }
551
-
552
- var current = elem;
553
- while (current !== document) {
554
- if (getComputedStyle(current, 'display') === 'none') {
555
- return {
556
- detached: false,
557
- rendered: false
558
- }
559
- }
560
- current = current.parentNode;
561
- }
562
-
563
- return {
564
- detached: false,
565
- rendered: true
566
- }
567
- }
568
-
569
- var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
570
-
571
- var total = 0;
572
- var style = null;
573
-
574
- function addListener (elem, callback) {
575
- if (!elem.__resize_mutation_handler__) {
576
- elem.__resize_mutation_handler__ = handleMutation.bind(elem);
577
- }
578
-
579
- var listeners = elem.__resize_listeners__;
580
-
581
- if (!listeners) {
582
- elem.__resize_listeners__ = [];
583
- if (window.ResizeObserver) {
584
- var offsetWidth = elem.offsetWidth;
585
- var offsetHeight = elem.offsetHeight;
586
- var ro = new ResizeObserver(function () {
587
- if (!elem.__resize_observer_triggered__) {
588
- elem.__resize_observer_triggered__ = true;
589
- if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
590
- return
591
- }
592
- }
593
- runCallbacks(elem);
594
- });
595
-
596
- // initially display none won't trigger ResizeObserver callback
597
- var ref = getRenderInfo(elem);
598
- var detached = ref.detached;
599
- var rendered = ref.rendered;
600
- elem.__resize_observer_triggered__ = detached === false && rendered === false;
601
- elem.__resize_observer__ = ro;
602
- ro.observe(elem);
603
- } else if (elem.attachEvent && elem.addEventListener) {
604
- // targeting IE9/10
605
- elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
606
- runCallbacks(elem);
607
- };
608
- elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
609
- document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
610
- } else {
611
- if (!total) {
612
- style = createStyles(css_248z);
613
- }
614
- initTriggers(elem);
615
-
616
- elem.__resize_rendered__ = getRenderInfo(elem).rendered;
617
- if (window.MutationObserver) {
618
- var mo = new MutationObserver(elem.__resize_mutation_handler__);
619
- mo.observe(document, {
620
- attributes: true,
621
- childList: true,
622
- characterData: true,
623
- subtree: true
624
- });
625
- elem.__resize_mutation_observer__ = mo;
626
- }
627
- }
628
- }
629
-
630
- elem.__resize_listeners__.push(callback);
631
- total++;
632
- }
633
-
634
- function removeListener (elem, callback) {
635
- var listeners = elem.__resize_listeners__;
636
- if (!listeners) {
637
- return
638
- }
639
-
640
- if (callback) {
641
- listeners.splice(listeners.indexOf(callback), 1);
642
- }
643
-
644
- // no listeners exist, or removing all listeners
645
- if (!listeners.length || !callback) {
646
- // targeting IE9/10
647
- if (elem.detachEvent && elem.removeEventListener) {
648
- elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
649
- document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
650
- return
651
- }
652
-
653
- if (elem.__resize_observer__) {
654
- elem.__resize_observer__.unobserve(elem);
655
- elem.__resize_observer__.disconnect();
656
- elem.__resize_observer__ = null;
657
- } else {
658
- if (elem.__resize_mutation_observer__) {
659
- elem.__resize_mutation_observer__.disconnect();
660
- elem.__resize_mutation_observer__ = null;
661
- }
662
- elem.removeEventListener('scroll', handleScroll);
663
- elem.removeChild(elem.__resize_triggers__.triggers);
664
- elem.__resize_triggers__ = null;
665
- }
666
- elem.__resize_listeners__ = null;
667
- }
668
-
669
- if (!--total && style) {
670
- style.parentNode.removeChild(style);
671
- }
672
- }
673
-
674
- function getUpdatedSize (elem) {
675
- var ref = elem.__resize_last__;
676
- var width = ref.width;
677
- var height = ref.height;
678
- var offsetWidth = elem.offsetWidth;
679
- var offsetHeight = elem.offsetHeight;
680
- if (offsetWidth !== width || offsetHeight !== height) {
681
- return {
682
- width: offsetWidth,
683
- height: offsetHeight
684
- }
685
- }
686
- return null
687
- }
688
-
689
- function handleMutation () {
690
- // `this` denotes the scrolling element
691
- var ref = getRenderInfo(this);
692
- var rendered = ref.rendered;
693
- var detached = ref.detached;
694
- if (rendered !== this.__resize_rendered__) {
695
- if (!detached && this.__resize_triggers__) {
696
- resetTriggers(this);
697
- this.addEventListener('scroll', handleScroll, true);
698
- }
699
- this.__resize_rendered__ = rendered;
700
- runCallbacks(this);
701
- }
702
- }
703
-
704
- function handleScroll () {
705
- var this$1 = this;
706
-
707
- // `this` denotes the scrolling element
708
- resetTriggers(this);
709
- if (this.__resize_raf__) {
710
- cancelAnimationFrame(this.__resize_raf__);
711
- }
712
- this.__resize_raf__ = requestAnimationFrame(function () {
713
- var updated = getUpdatedSize(this$1);
714
- if (updated) {
715
- this$1.__resize_last__ = updated;
716
- runCallbacks(this$1);
717
- }
718
- });
719
- }
720
-
721
- function runCallbacks (elem) {
722
- if (!elem || !elem.__resize_listeners__) {
723
- return
724
- }
725
- elem.__resize_listeners__.forEach(function (callback) {
726
- callback.call(elem, elem);
727
- });
728
- }
729
-
730
- function initTriggers (elem) {
731
- var position = getComputedStyle(elem, 'position');
732
- if (!position || position === 'static') {
733
- elem.style.position = 'relative';
734
- }
735
-
736
- elem.__resize_old_position__ = position;
737
- elem.__resize_last__ = {};
738
-
739
- var triggers = createElement('div', {
740
- className: 'resize-triggers'
741
- });
742
- var expand = createElement('div', {
743
- className: 'resize-expand-trigger'
744
- });
745
- var expandChild = createElement('div');
746
- var contract = createElement('div', {
747
- className: 'resize-contract-trigger'
748
- });
749
- expand.appendChild(expandChild);
750
- triggers.appendChild(expand);
751
- triggers.appendChild(contract);
752
- elem.appendChild(triggers);
753
-
754
- elem.__resize_triggers__ = {
755
- triggers: triggers,
756
- expand: expand,
757
- expandChild: expandChild,
758
- contract: contract
759
- };
760
-
761
- resetTriggers(elem);
762
- elem.addEventListener('scroll', handleScroll, true);
763
-
764
- elem.__resize_last__ = {
765
- width: elem.offsetWidth,
766
- height: elem.offsetHeight
767
- };
768
- }
769
-
770
- function resetTriggers (elem) {
771
- var ref = elem.__resize_triggers__;
772
- var expand = ref.expand;
773
- var expandChild = ref.expandChild;
774
- var contract = ref.contract;
775
-
776
- // batch read
777
- var csw = contract.scrollWidth;
778
- var csh = contract.scrollHeight;
779
- var eow = expand.offsetWidth;
780
- var eoh = expand.offsetHeight;
781
- var esw = expand.scrollWidth;
782
- var esh = expand.scrollHeight;
783
-
784
- // batch write
785
- contract.scrollLeft = csw;
786
- contract.scrollTop = csh;
787
- expandChild.style.width = eow + 1 + 'px';
788
- expandChild.style.height = eoh + 1 + 'px';
789
- expand.scrollLeft = esw;
790
- expand.scrollTop = esh;
791
- }
792
-
793
-
794
-
795
- ;// CONCATENATED MODULE: external "../config-provider"
796
- var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
797
- var external_config_provider_y = x => () => x
798
- 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 });
799
- ;// CONCATENATED MODULE: external "../directives"
800
- var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
801
- var external_directives_y = x => () => x
802
- const external_directives_namespaceObject = external_directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.clickoutside });
803
- ;// CONCATENATED MODULE: external "../icon"
804
- var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
805
- var external_icon_y = x => () => x
806
- const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Search });
807
- // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
808
- var regenerator = __webpack_require__(2841);
809
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
810
- ;// CONCATENATED MODULE: ../../node_modules/tslib/tslib.es6.mjs
811
- /******************************************************************************
812
- Copyright (c) Microsoft Corporation.
813
-
814
- Permission to use, copy, modify, and/or distribute this software for any
815
- purpose with or without fee is hereby granted.
816
-
817
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
818
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
819
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
820
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
821
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
822
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
823
- PERFORMANCE OF THIS SOFTWARE.
824
- ***************************************************************************** */
825
- /* global Reflect, Promise, SuppressedError, Symbol */
826
-
827
- var extendStatics = function(d, b) {
828
- extendStatics = Object.setPrototypeOf ||
829
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
830
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
831
- return extendStatics(d, b);
832
- };
833
-
834
- function __extends(d, b) {
835
- if (typeof b !== "function" && b !== null)
836
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
837
- extendStatics(d, b);
838
- function __() { this.constructor = d; }
839
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
840
- }
841
-
842
- var __assign = function() {
843
- __assign = Object.assign || function __assign(t) {
844
- for (var s, i = 1, n = arguments.length; i < n; i++) {
845
- s = arguments[i];
846
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
847
- }
848
- return t;
849
- }
850
- return __assign.apply(this, arguments);
851
- }
852
-
853
- function __rest(s, e) {
854
- var t = {};
855
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
856
- t[p] = s[p];
857
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
858
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
859
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
860
- t[p[i]] = s[p[i]];
861
- }
862
- return t;
863
- }
864
-
865
- function __decorate(decorators, target, key, desc) {
866
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
867
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
868
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
869
- return c > 3 && r && Object.defineProperty(target, key, r), r;
870
- }
871
-
872
- function __param(paramIndex, decorator) {
873
- return function (target, key) { decorator(target, key, paramIndex); }
874
- }
875
-
876
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
877
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
878
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
879
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
880
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
881
- var _, done = false;
882
- for (var i = decorators.length - 1; i >= 0; i--) {
883
- var context = {};
884
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
885
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
886
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
887
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
888
- if (kind === "accessor") {
889
- if (result === void 0) continue;
890
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
891
- if (_ = accept(result.get)) descriptor.get = _;
892
- if (_ = accept(result.set)) descriptor.set = _;
893
- if (_ = accept(result.init)) initializers.unshift(_);
894
- }
895
- else if (_ = accept(result)) {
896
- if (kind === "field") initializers.unshift(_);
897
- else descriptor[key] = _;
898
- }
899
- }
900
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
901
- done = true;
902
- };
903
-
904
- function __runInitializers(thisArg, initializers, value) {
905
- var useValue = arguments.length > 2;
906
- for (var i = 0; i < initializers.length; i++) {
907
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
908
- }
909
- return useValue ? value : void 0;
910
- };
911
-
912
- function __propKey(x) {
913
- return typeof x === "symbol" ? x : "".concat(x);
914
- };
915
-
916
- function __setFunctionName(f, name, prefix) {
917
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
918
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
919
- };
920
-
921
- function __metadata(metadataKey, metadataValue) {
922
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
923
- }
924
-
925
- function __awaiter(thisArg, _arguments, P, generator) {
926
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
927
- return new (P || (P = Promise))(function (resolve, reject) {
928
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
929
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
930
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
931
- step((generator = generator.apply(thisArg, _arguments || [])).next());
932
- });
933
- }
934
-
935
- function __generator(thisArg, body) {
936
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
937
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
938
- function verb(n) { return function (v) { return step([n, v]); }; }
939
- function step(op) {
940
- if (f) throw new TypeError("Generator is already executing.");
941
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
942
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
943
- if (y = 0, t) op = [op[0] & 2, t.value];
944
- switch (op[0]) {
945
- case 0: case 1: t = op; break;
946
- case 4: _.label++; return { value: op[1], done: false };
947
- case 5: _.label++; y = op[1]; op = [0]; continue;
948
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
949
- default:
950
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
951
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
952
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
953
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
954
- if (t[2]) _.ops.pop();
955
- _.trys.pop(); continue;
956
- }
957
- op = body.call(thisArg, _);
958
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
959
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
960
- }
961
- }
962
-
963
- var __createBinding = Object.create ? (function(o, m, k, k2) {
964
- if (k2 === undefined) k2 = k;
965
- var desc = Object.getOwnPropertyDescriptor(m, k);
966
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
967
- desc = { enumerable: true, get: function() { return m[k]; } };
968
- }
969
- Object.defineProperty(o, k2, desc);
970
- }) : (function(o, m, k, k2) {
971
- if (k2 === undefined) k2 = k;
972
- o[k2] = m[k];
973
- });
974
-
975
- function __exportStar(m, o) {
976
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
977
- }
978
-
979
- function __values(o) {
980
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
981
- if (m) return m.call(o);
982
- if (o && typeof o.length === "number") return {
983
- next: function () {
984
- if (o && i >= o.length) o = void 0;
985
- return { value: o && o[i++], done: !o };
986
- }
987
- };
988
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
989
- }
990
-
991
- function __read(o, n) {
992
- var m = typeof Symbol === "function" && o[Symbol.iterator];
993
- if (!m) return o;
994
- var i = m.call(o), r, ar = [], e;
995
- try {
996
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
997
- }
998
- catch (error) { e = { error: error }; }
999
- finally {
1000
- try {
1001
- if (r && !r.done && (m = i["return"])) m.call(i);
1002
- }
1003
- finally { if (e) throw e.error; }
1004
- }
1005
- return ar;
1006
- }
1007
-
1008
- /** @deprecated */
1009
- function __spread() {
1010
- for (var ar = [], i = 0; i < arguments.length; i++)
1011
- ar = ar.concat(__read(arguments[i]));
1012
- return ar;
1013
- }
1014
-
1015
- /** @deprecated */
1016
- function __spreadArrays() {
1017
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
1018
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1019
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1020
- r[k] = a[j];
1021
- return r;
1022
- }
1023
-
1024
- function __spreadArray(to, from, pack) {
1025
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1026
- if (ar || !(i in from)) {
1027
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1028
- ar[i] = from[i];
1029
- }
1030
- }
1031
- return to.concat(ar || Array.prototype.slice.call(from));
1032
- }
1033
-
1034
- function __await(v) {
1035
- return this instanceof __await ? (this.v = v, this) : new __await(v);
1036
- }
1037
-
1038
- function __asyncGenerator(thisArg, _arguments, generator) {
1039
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1040
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
1041
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1042
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1043
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
1044
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1045
- function fulfill(value) { resume("next", value); }
1046
- function reject(value) { resume("throw", value); }
1047
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
1048
- }
1049
-
1050
- function __asyncDelegator(o) {
1051
- var i, p;
1052
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1053
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
1054
- }
1055
-
1056
- function __asyncValues(o) {
1057
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1058
- var m = o[Symbol.asyncIterator], i;
1059
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1060
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1061
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
1062
- }
1063
-
1064
- function __makeTemplateObject(cooked, raw) {
1065
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
1066
- return cooked;
1067
- };
1068
-
1069
- var __setModuleDefault = Object.create ? (function(o, v) {
1070
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1071
- }) : function(o, v) {
1072
- o["default"] = v;
1073
- };
1074
-
1075
- function __importStar(mod) {
1076
- if (mod && mod.__esModule) return mod;
1077
- var result = {};
1078
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1079
- __setModuleDefault(result, mod);
1080
- return result;
1081
- }
1082
-
1083
- function __importDefault(mod) {
1084
- return (mod && mod.__esModule) ? mod : { default: mod };
1085
- }
1086
-
1087
- function __classPrivateFieldGet(receiver, state, kind, f) {
1088
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
1089
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1090
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1091
- }
1092
-
1093
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
1094
- if (kind === "m") throw new TypeError("Private method is not writable");
1095
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1096
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1097
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1098
- }
1099
-
1100
- function __classPrivateFieldIn(state, receiver) {
1101
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
1102
- return typeof state === "function" ? receiver === state : state.has(receiver);
1103
- }
1104
-
1105
- function __addDisposableResource(env, value, async) {
1106
- if (value !== null && value !== void 0) {
1107
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
1108
- var dispose;
1109
- if (async) {
1110
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
1111
- dispose = value[Symbol.asyncDispose];
1112
- }
1113
- if (dispose === void 0) {
1114
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
1115
- dispose = value[Symbol.dispose];
1116
- }
1117
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
1118
- env.stack.push({ value: value, dispose: dispose, async: async });
1119
- }
1120
- else if (async) {
1121
- env.stack.push({ async: true });
1122
- }
1123
- return value;
1124
- }
1125
-
1126
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1127
- var e = new Error(message);
1128
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1129
- };
1130
-
1131
- function __disposeResources(env) {
1132
- function fail(e) {
1133
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
1134
- env.hasError = true;
1135
- }
1136
- function next() {
1137
- while (env.stack.length) {
1138
- var rec = env.stack.pop();
1139
- try {
1140
- var result = rec.dispose && rec.dispose.call(rec.value);
1141
- if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
1142
- }
1143
- catch (e) {
1144
- fail(e);
1145
- }
1146
- }
1147
- if (env.hasError) throw env.error;
1148
- }
1149
- return next();
1150
- }
1151
-
1152
- /* harmony default export */ const tslib_es6 = ({
1153
- __extends,
1154
- __assign,
1155
- __rest,
1156
- __decorate,
1157
- __param,
1158
- __metadata,
1159
- __awaiter,
1160
- __generator,
1161
- __createBinding,
1162
- __exportStar,
1163
- __values,
1164
- __read,
1165
- __spread,
1166
- __spreadArrays,
1167
- __spreadArray,
1168
- __await,
1169
- __asyncGenerator,
1170
- __asyncDelegator,
1171
- __asyncValues,
1172
- __makeTemplateObject,
1173
- __importStar,
1174
- __importDefault,
1175
- __classPrivateFieldGet,
1176
- __classPrivateFieldSet,
1177
- __classPrivateFieldIn,
1178
- __addDisposableResource,
1179
- __disposeResources,
1180
- });
1181
-
1182
- ;// CONCATENATED MODULE: external "../popover"
1183
- var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1184
- var external_popover_y = x => () => x
1185
- const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
1186
- ;// CONCATENATED MODULE: external "../checkbox"
1187
- var external_checkbox_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1188
- var external_checkbox_y = x => () => x
1189
- const external_checkbox_namespaceObject = external_checkbox_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__checkbox_a57bcb84__["default"] });
1190
- ;// CONCATENATED MODULE: external "../radio"
1191
- var external_radio_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
1192
- var external_radio_y = x => () => x
1193
- const external_radio_namespaceObject = external_radio_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__radio_904c495d__["default"] });
1194
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
1195
- function _classCallCheck(instance, Constructor) {
1196
- if (!(instance instanceof Constructor)) {
1197
- throw new TypeError("Cannot call a class as a function");
1198
- }
1199
- }
1200
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
1201
-
1202
- function _defineProperties(target, props) {
1203
- for (var i = 0; i < props.length; i++) {
1204
- var descriptor = props[i];
1205
- descriptor.enumerable = descriptor.enumerable || false;
1206
- descriptor.configurable = true;
1207
- if ("value" in descriptor) descriptor.writable = true;
1208
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
1209
- }
1210
- }
1211
- function _createClass(Constructor, protoProps, staticProps) {
1212
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1213
- if (staticProps) _defineProperties(Constructor, staticProps);
1214
- Object.defineProperty(Constructor, "prototype", {
1215
- writable: false
1216
- });
1217
- return Constructor;
1218
- }
1219
- ;// CONCATENATED MODULE: ../../packages/search-select/src/utils.ts
1220
-
1221
-
1222
- /*
1223
- * Tencent is pleased to support the open source community by making
1224
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1225
- *
1226
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1227
- *
1228
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1229
- *
1230
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1231
- *
1232
- * ---------------------------------------------------
1233
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1234
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1235
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1236
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1237
- *
1238
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1239
- * the Software.
1240
- *
1241
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1242
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1243
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1244
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1245
- * IN THE SOFTWARE.
1246
- */
1247
-
1248
- /**
1249
- * @description: 获取menu list方法
1250
- * @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
1251
- * @param {string} keyword 已输入的文本
1252
- * @return {*} menu list用于渲染选择弹层列表
1253
- */
1254
- var ValueBehavior;
1255
- (function (ValueBehavior) {
1256
- ValueBehavior["ALL"] = "all";
1257
- ValueBehavior["NEEDKEY"] = "need-key";
1258
- })(ValueBehavior || (ValueBehavior = {}));
1259
- var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
1260
- var useSearchSelectProvider = function useSearchSelectProvider(data) {
1261
- (0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
1262
- };
1263
- var useSearchSelectInject = function useSearchSelectInject() {
1264
- return (0,external_vue_namespaceObject.inject)(SEARCH_SLECT_PROVIDER_KEY);
1265
- };
1266
- var SearchInputMode;
1267
- (function (SearchInputMode) {
1268
- SearchInputMode["DEFAULT"] = "default";
1269
- SearchInputMode["EDIT"] = "edit";
1270
- })(SearchInputMode || (SearchInputMode = {}));
1271
- var SearchLogical;
1272
- (function (SearchLogical) {
1273
- SearchLogical["AND"] = "&";
1274
- SearchLogical["OR"] = "|";
1275
- })(SearchLogical || (SearchLogical = {}));
1276
- var SelectedItem = /*#__PURE__*/function () {
1277
- function SelectedItem(searchItem) {
1278
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1279
- _classCallCheck(this, SelectedItem);
1280
- this.searchItem = searchItem;
1281
- this.type = type;
1282
- this.values = [];
1283
- this.id = searchItem.id;
1284
- this.name = searchItem.name;
1285
- this.logical = searchItem.logical || SearchLogical.OR;
1286
- }
1287
- _createClass(SelectedItem, [{
1288
- key: "multiple",
1289
- get: function get() {
1290
- return !!this.searchItem.multiple;
1291
- }
1292
- }, {
1293
- key: "placeholder",
1294
- get: function get() {
1295
- return this.searchItem.placeholder || '';
1296
- }
1297
- }, {
1298
- key: "children",
1299
- get: function get() {
1300
- return this.searchItem.children || [];
1301
- }
1302
- }, {
1303
- key: "validate",
1304
- get: function get() {
1305
- return !this.searchItem.noValidate;
1306
- }
1307
- }, {
1308
- key: "inputInnerHtml",
1309
- get: function get() {
1310
- var _a;
1311
- if (this.isSpecialType()) return this.name;
1312
- return "".concat(this.keyInnerHtml).concat(((_a = this.values) === null || _a === void 0 ? void 0 : _a.map(function (item) {
1313
- return item.name;
1314
- }).join(" ".concat(this.logical, " "))) || '');
1315
- }
1316
- }, {
1317
- key: "inputInnerText",
1318
- get: function get() {
1319
- var _a;
1320
- if (this.isSpecialType()) return this.name;
1321
- return "".concat(this.keyInnerText).concat(((_a = this.values) === null || _a === void 0 ? void 0 : _a.map(function (item) {
1322
- return item.name;
1323
- }).join(" ".concat(this.logical, " "))) || '');
1324
- }
1325
- }, {
1326
- key: "keyInnerHtml",
1327
- get: function get() {
1328
- if (this.isSpecialType()) return this.name;
1329
- return this.name ? "".concat(this.name, ":\xA0") : '';
1330
- }
1331
- }, {
1332
- key: "keyInnerText",
1333
- get: function get() {
1334
- if (this.isSpecialType()) return this.name;
1335
- return this.name ? "".concat(this.name, ": ") : '';
1336
- }
1337
- }, {
1338
- key: "showLogical",
1339
- get: function get() {
1340
- return !!this.searchItem.showLogicalPanel;
1341
- }
1342
- }, {
1343
- key: "isSpecialType",
1344
- value: function isSpecialType() {
1345
- return ['text', 'condition'].includes(this.type);
1346
- }
1347
- }, {
1348
- key: "addValue",
1349
- value: function addValue(item) {
1350
- if (this.multiple) {
1351
- var index = this.values.findIndex(function (val) {
1352
- return val.id === item.id;
1353
- });
1354
- if (index > -1) {
1355
- this.values.splice(index, 1);
1356
- return;
1357
- }
1358
- this.values.push(item);
1359
- return;
1360
- }
1361
- this.values = [item];
1362
- }
1363
- }, {
1364
- key: "toValue",
1365
- value: function toValue() {
1366
- var _a;
1367
- var value = {
1368
- id: this.id,
1369
- name: this.name
1370
- };
1371
- if ((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) {
1372
- value.values = this.values.map(function (item) {
1373
- return {
1374
- id: item.id,
1375
- name: item.name
1376
- };
1377
- });
1378
- if (this.multiple && this.logical !== SearchLogical.OR) {
1379
- value.logical = this.logical;
1380
- }
1381
- }
1382
- if (this.type && this.type !== 'default') {
1383
- value.type = this.type;
1384
- }
1385
- return value;
1386
- }
1387
- }, {
1388
- key: "toValueKey",
1389
- value: function toValueKey() {
1390
- return JSON.stringify(this.toValue());
1391
- }
1392
- }, {
1393
- key: "isInValueList",
1394
- value: function isInValueList(item) {
1395
- return this.children.some(function (v) {
1396
- return v.id === (item === null || item === void 0 ? void 0 : item.id);
1397
- });
1398
- }
1399
- }]);
1400
- return SelectedItem;
1401
- }();
1402
- ;// CONCATENATED MODULE: ../../packages/search-select/src/menu.tsx
1403
-
1404
- /*
1405
- * Tencent is pleased to support the open source community by making
1406
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1407
- *
1408
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1409
- *
1410
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1411
- *
1412
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1413
- *
1414
- * ---------------------------------------------------
1415
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1416
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1417
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1418
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1419
- *
1420
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1421
- * the Software.
1422
- *
1423
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1424
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1425
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1426
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1427
- * IN THE SOFTWARE.
1428
- */
1429
-
1430
-
1431
-
1432
-
1433
- // import { Done } from '@bkui-vue/icon';
1434
-
1435
- /* harmony default export */ const menu = ((0,external_vue_namespaceObject.defineComponent)({
1436
- name: 'SearchSelectMenu',
1437
- props: {
1438
- list: {
1439
- type: Array
1440
- },
1441
- hoverId: String,
1442
- keyword: {
1443
- type: String,
1444
- "default": ''
1445
- },
1446
- multiple: {
1447
- type: Boolean,
1448
- "default": false
1449
- },
1450
- selected: {
1451
- type: Array,
1452
- "default": function _default() {
1453
- return [];
1454
- }
1455
- },
1456
- conditions: {
1457
- type: Array
1458
- },
1459
- footerBtns: {
1460
- type: Array,
1461
- "default": function _default() {
1462
- return [];
1463
- }
1464
- },
1465
- showLogical: {
1466
- type: Boolean,
1467
- "default": true
1468
- },
1469
- logical: {
1470
- type: String,
1471
- "default": SearchLogical.OR
1472
- }
1473
- },
1474
- emits: ['selectItem', 'selectCondition', 'footerClick', 'update:logical'],
1475
- setup: function setup(props, _ref) {
1476
- var emit = _ref.emit;
1477
- var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
1478
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1479
- resolveClassName = _usePrefix.resolveClassName;
1480
- var localFooterBtns = (0,external_vue_namespaceObject.computed)(function () {
1481
- if (props.footerBtns === undefined || props.footerBtns.length === 0) {
1482
- return [{
1483
- id: 'confirm',
1484
- name: t.value.ok
1485
- }, {
1486
- id: 'cancel',
1487
- name: t.value.cancel,
1488
- disabled: false
1489
- }];
1490
- }
1491
- return props.footerBtns;
1492
- });
1493
- // events
1494
- function handleClick(item) {
1495
- emit('selectItem', item);
1496
- }
1497
- function handleClickCondition(item) {
1498
- emit('selectCondition', item);
1499
- }
1500
- function handleClickFooterBtn(item) {
1501
- emit('footerClick', item);
1502
- }
1503
- var filterList = (0,external_vue_namespaceObject.computed)(function () {
1504
- var _a, _b;
1505
- if (!((_a = props.list) === null || _a === void 0 ? void 0 : _a.length)) return [];
1506
- if (!((_b = props.keyword) === null || _b === void 0 ? void 0 : _b.length)) return props.list;
1507
- return props.list.filter(function (item) {
1508
- return item.name.toLocaleLowerCase().includes(props.keyword.toLocaleLowerCase());
1509
- });
1510
- });
1511
- function transformNode(str) {
1512
- if (!str) return str;
1513
- var keyword = props.keyword;
1514
- var len = keyword.length;
1515
- if (!(keyword === null || keyword === void 0 ? void 0 : keyword.trim().length) || !str.toLocaleLowerCase().includes(keyword.toLocaleLowerCase())) return str;
1516
- var list = [];
1517
- var lastIndex = -1;
1518
- keyword = keyword.replace(/([.*/]{1})/gim, '\\$1');
1519
- str.replace(new RegExp("".concat(keyword), 'igm'), function (key, index) {
1520
- if (list.length === 0 && index !== 0) {
1521
- list.push(str.slice(0, index));
1522
- } else if (lastIndex >= 0) {
1523
- list.push(str.slice(lastIndex + key.length, index));
1524
- }
1525
- list.push((0,external_vue_namespaceObject.createVNode)("span", {
1526
- "class": "is-keyword"
1527
- }, [key]));
1528
- lastIndex = index;
1529
- return key;
1530
- });
1531
- if (lastIndex >= 0) {
1532
- list.push(str.slice(lastIndex + len));
1533
- }
1534
- return list.length ? list : str;
1535
- }
1536
- function getSearchNode(item) {
1537
- var _a;
1538
- if (!((_a = item.value) === null || _a === void 0 ? void 0 : _a.name)) return transformNode(item.name);
1539
- return [(0,external_vue_namespaceObject.createVNode)("span", {
1540
- "class": "menu-name"
1541
- }, [item.name, (0,external_vue_namespaceObject.createTextVNode)(":")]), item.value.name];
1542
- }
1543
- function handleSelectedChange(e, item) {
1544
- e.stopPropagation();
1545
- e.preventDefault();
1546
- handleClick(item);
1547
- }
1548
- function handleLogicalChange(value) {
1549
- emit('update:logical', value);
1550
- }
1551
- return {
1552
- handleClick: handleClick,
1553
- handleClickCondition: handleClickCondition,
1554
- handleClickFooterBtn: handleClickFooterBtn,
1555
- handleSelectedChange: handleSelectedChange,
1556
- handleLogicalChange: handleLogicalChange,
1557
- filterList: filterList,
1558
- getSearchNode: getSearchNode,
1559
- localFooterBtns: localFooterBtns,
1560
- resolveClassName: resolveClassName,
1561
- t: t
1562
- };
1563
- },
1564
- render: function render() {
1565
- var _this = this;
1566
- var _a, _b;
1567
- var listMenu = (0,external_vue_namespaceObject.createVNode)("ul", {
1568
- "class": "menu-content"
1569
- }, [(_a = this.list) === null || _a === void 0 ? void 0 : _a.map(function (item) {
1570
- return (0,external_vue_namespaceObject.createVNode)("li", {
1571
- "class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
1572
- "key": item.id,
1573
- "id": item.id,
1574
- "tabindex": "-1",
1575
- "onClick": function onClick() {
1576
- return !item.disabled && _this.handleClick(item);
1577
- }
1578
- }, [_this.$slots["default"] ? _this.$slots["default"]({
1579
- item: item,
1580
- list: _this.list,
1581
- multiple: !!_this.multiple,
1582
- hoverId: _this.hoverId,
1583
- getSearchNode: _this.getSearchNode
1584
- }) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1585
- "onClick": function onClick(e) {
1586
- return _this.handleSelectedChange(e, item);
1587
- }
1588
- }, [(0,external_vue_namespaceObject.createVNode)(external_checkbox_namespaceObject["default"], {
1589
- "modelValue": _this.selected.includes(item.id),
1590
- "class": "is-selected"
1591
- }, null)]), _this.getSearchNode(item)])]);
1592
- })]);
1593
- var getListMenu = function getListMenu() {
1594
- if (!_this.showLogical || !_this.multiple) return listMenu;
1595
- return (0,external_vue_namespaceObject.createVNode)("div", {
1596
- "class": "menu-content-wrapper"
1597
- }, [listMenu, (0,external_vue_namespaceObject.createVNode)("div", {
1598
- "class": "menu-condition"
1599
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
1600
- "class": "menu-condition-title"
1601
- }, [_this.t.logical]), (0,external_vue_namespaceObject.createVNode)(external_radio_namespaceObject["default"], {
1602
- "modelValue": _this.logical,
1603
- "onChange": _this.handleLogicalChange,
1604
- "label": "|"
1605
- }, {
1606
- "default": function _default() {
1607
- return [_this.t.or, (0,external_vue_namespaceObject.createTextVNode)(" |")];
1608
- }
1609
- }), (0,external_vue_namespaceObject.createVNode)(external_radio_namespaceObject["default"], {
1610
- "modelValue": _this.logical,
1611
- "onChange": _this.handleLogicalChange,
1612
- "label": "&"
1613
- }, {
1614
- "default": function _default() {
1615
- return [_this.t.and, (0,external_vue_namespaceObject.createTextVNode)(" &")];
1616
- }
1617
- })])]);
1618
- };
1619
- return (0,external_vue_namespaceObject.createVNode)("div", {
1620
- "class": this.resolveClassName('search-select-menu')
1621
- }, [!!((_b = this.conditions) === null || _b === void 0 ? void 0 : _b.length) && (0,external_vue_namespaceObject.createVNode)("ul", {
1622
- "class": "menu-header"
1623
- }, [this.conditions.map(function (item) {
1624
- return (0,external_vue_namespaceObject.createVNode)("li", {
1625
- "key": item.id,
1626
- "class": "menu-header-item ".concat(item.disabled ? 'is-disabled' : ''),
1627
- "onClick": function onClick() {
1628
- return !item.disabled && _this.handleClickCondition(item);
1629
- }
1630
- }, [item.name]);
1631
- })]), getListMenu()]);
1632
- }
1633
- }));
1634
- ;// CONCATENATED MODULE: ../../packages/search-select/src/input.tsx
1635
-
1636
-
1637
-
1638
- /*
1639
- * Tencent is pleased to support the open source community by making
1640
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1641
- *
1642
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1643
- *
1644
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1645
- *
1646
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1647
- *
1648
- * ---------------------------------------------------
1649
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1650
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1651
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1652
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1653
- *
1654
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1655
- * the Software.
1656
- *
1657
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1658
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1659
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1660
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1661
- * IN THE SOFTWARE.
1662
- */
1663
-
1664
-
1665
-
1666
-
1667
-
1668
-
1669
-
1670
- /* harmony default export */ const input = ((0,external_vue_namespaceObject.defineComponent)({
1671
- name: 'SearchSelectInput',
1672
- directives: {
1673
- clickoutside: external_directives_namespaceObject.clickoutside
1674
- },
1675
- props: {
1676
- data: {
1677
- type: Array,
1678
- required: true
1679
- },
1680
- showInputBefore: Boolean,
1681
- showCondition: Boolean,
1682
- clickOutside: Function,
1683
- placeholder: String,
1684
- conditions: {
1685
- type: Array,
1686
- "default": function _default() {
1687
- return [];
1688
- }
1689
- },
1690
- defautUsingItem: Object,
1691
- mode: {
1692
- type: String,
1693
- "default": SearchInputMode.DEFAULT
1694
- },
1695
- getMenuList: Function,
1696
- validateValues: Function,
1697
- valueBehavior: String
1698
- },
1699
- emits: ['focus', 'add', 'delete'],
1700
- setup: function setup(props, _ref) {
1701
- var emit = _ref.emit,
1702
- expose = _ref.expose;
1703
- var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
1704
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
1705
- resolveClassName = _usePrefix.resolveClassName;
1706
- var inputRef = (0,external_vue_namespaceObject.ref)(null);
1707
- var popoverRef = (0,external_vue_namespaceObject.ref)(null);
1708
- var keyword = (0,external_vue_namespaceObject.ref)('');
1709
- var showNoSelectValueError = (0,external_vue_namespaceObject.ref)(false);
1710
- var isFocus = (0,external_vue_namespaceObject.ref)(false);
1711
- var showPopover = (0,external_vue_namespaceObject.ref)(false);
1712
- var usingItem = (0,external_vue_namespaceObject.ref)(props.defautUsingItem);
1713
- var menuHoverId = (0,external_vue_namespaceObject.ref)('');
1714
- var loading = (0,external_vue_namespaceObject.ref)(false);
1715
- var debounceSetMenuList = (0,external_shared_namespaceObject.debounce)(300, setMenuList);
1716
- // const selectMenuList = ref<ICommonItem[]>([]);
1717
- var isBindEvent = false;
1718
- var remoteMenuList = (0,external_vue_namespaceObject.ref)([]);
1719
- var menuList = (0,external_vue_namespaceObject.ref)([]);
1720
- var _useSearchSelectInjec = useSearchSelectInject(),
1721
- editKey = _useSearchSelectInjec.editKey,
1722
- onValidate = _useSearchSelectInjec.onValidate;
1723
- var valueLoagic = (0,external_vue_namespaceObject.computed)(function () {
1724
- var _a;
1725
- return ((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.logical) || SearchLogical.OR;
1726
- });
1727
- (0,external_vue_namespaceObject.watch)(editKey, function () {
1728
- if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
1729
- showPopover.value = false;
1730
- }
1731
- });
1732
- // effects
1733
- (0,external_vue_namespaceObject.watchEffect)(function () {
1734
- if (!keyword.value) {
1735
- setInputText();
1736
- }
1737
- }, {
1738
- flush: 'pre'
1739
- });
1740
- (0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
1741
- var _a;
1742
- if (((_a = menuList.value) === null || _a === void 0 ? void 0 : _a.some(function (item) {
1743
- return !item.disabled;
1744
- })) && showPopover.value) {
1745
- if (!isBindEvent) {
1746
- if (props.valueBehavior === ValueBehavior.NEEDKEY) {
1747
- menuHoverId.value = menuList.value.find(function (item) {
1748
- return !item.disabled;
1749
- }).id;
1750
- } else {
1751
- menuHoverId.value = '';
1752
- }
1753
- isBindEvent = true;
1754
- document.addEventListener('keydown', handleDocumentKeydown);
1755
- }
1756
- } else {
1757
- document.removeEventListener('keydown', handleDocumentKeydown);
1758
- isBindEvent = false;
1759
- if (props.valueBehavior !== ValueBehavior.NEEDKEY) {
1760
- menuHoverId.value = '';
1761
- }
1762
- }
1763
- });
1764
- // events
1765
- function handleDocumentKeydown(e) {
1766
- switch (e.code) {
1767
- case 'ArrowDown':
1768
- case 'ArrowUp':
1769
- documentArrowEvent(e);
1770
- break;
1771
- case 'Enter':
1772
- case 'NumpadEnter':
1773
- documentEnterEvent(e);
1774
- break;
1775
- }
1776
- }
1777
- function documentArrowEvent(e) {
1778
- var _a;
1779
- e.preventDefault();
1780
- (_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur();
1781
- var len = menuList.value.length;
1782
- var i = len;
1783
- var index = menuList.value.findIndex(function (set) {
1784
- return set.id === menuHoverId.value;
1785
- });
1786
- while (i >= 0) {
1787
- index = e.code === 'ArrowDown' ? index + 1 : index - 1;
1788
- // eslint-disable-next-line no-nested-ternary
1789
- index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
1790
- var item = menuList.value[index];
1791
- if (item && !item.disabled) {
1792
- i = -1;
1793
- var dom = document.getElementById(item.id);
1794
- dom === null || dom === void 0 ? void 0 : dom.focus();
1795
- menuHoverId.value = item.id;
1796
- return;
1797
- }
1798
- i -= 1;
1799
- }
1800
- }
1801
- function documentEnterEvent(e) {
1802
- if (isBindEvent) {
1803
- e.preventDefault();
1804
- var item = menuList.value.find(function (item) {
1805
- return item.id === menuHoverId.value;
1806
- });
1807
- item && handleSelectItem(item);
1808
- }
1809
- }
1810
- function handleClickOutside(e) {
1811
- var _a, _b, _c, _d, _e;
1812
- if (!((_a = popoverRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && ((_b = props.clickOutside) === null || _b === void 0 ? void 0 : _b.call(props, e.target, popoverRef.value))) {
1813
- if (((_d = (_c = usingItem.value) === null || _c === void 0 ? void 0 : _c.values) === null || _d === void 0 ? void 0 : _d.length) && ((_e = usingItem.value) === null || _e === void 0 ? void 0 : _e.multiple)) {
1814
- keyword.value = '';
1815
- handleKeyEnter();
1816
- return;
1817
- }
1818
- showPopover.value = false;
1819
- isFocus.value = false;
1820
- emit('focus', isFocus.value);
1821
- }
1822
- }
1823
- function handleInputFocus(e) {
1824
- setInputFocus();
1825
- e && setMenuList();
1826
- }
1827
- function handleInputChange(event) {
1828
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1829
- clearInput();
1830
- var text = event.target.innerText;
1831
- if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
1832
- event.preventDefault();
1833
- text = text.replace(/(\r|\n)/gm, " ".concat(valueLoagic.value, " ")).replace(/\s{2}/gm, '');
1834
- inputRef.value.innerText = text;
1835
- setInputFocus();
1836
- keyword.value = text.replace(((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.keyInnerText) || '', '').trim();
1837
- debounceSetMenuList();
1838
- } else if (!keyword.value && text.length < (((_c = (_b = usingItem.value) === null || _b === void 0 ? void 0 : _b.inputInnerText) === null || _c === void 0 ? void 0 : _c.length) || 1)) {
1839
- var outerText = text.replace("\xA0", " ").replace(((_d = usingItem.value) === null || _d === void 0 ? void 0 : _d.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
1840
- var hasKeyword = text && ((_e = usingItem.value) === null || _e === void 0 ? void 0 : _e.keyInnerText) && text.replace("\xA0", " ").includes(usingItem.value.keyInnerText.replace("\xA0", " ").trim());
1841
- if (hasKeyword && outerText && ((_f = usingItem.value.values) === null || _f === void 0 ? void 0 : _f.length)) {
1842
- keyword.value = outerText;
1843
- console.info('outerText', outerText);
1844
- debounceSetMenuList();
1845
- return;
1846
- }
1847
- if (outerText || !(text === null || text === void 0 ? void 0 : text.length)) {
1848
- usingItem.value = null;
1849
- }
1850
- keyword.value = outerText ? text : '';
1851
- debounceSetMenuList();
1852
- } else if (!((_h = (_g = usingItem.value) === null || _g === void 0 ? void 0 : _g.values) === null || _h === void 0 ? void 0 : _h.length)) {
1853
- keyword.value = text.replace("\xA0", " ").replace(((_j = usingItem.value) === null || _j === void 0 ? void 0 : _j.keyInnerText.replace("\xA0", " ")) || '', '').trim();
1854
- setInputFocus();
1855
- debounceSetMenuList();
1856
- }
1857
- }
1858
- function handleInputKeyup(event) {
1859
- switch (event.code) {
1860
- case 'Enter':
1861
- case 'NumpadEnter':
1862
- if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
1863
- return item.id === menuHoverId.value;
1864
- })) return;
1865
- handleKeyEnter(event);
1866
- break;
1867
- case 'Backspace':
1868
- handleKeyBackspace();
1869
- default:
1870
- showNoSelectValueError.value = false;
1871
- break;
1872
- }
1873
- }
1874
- function handleKeyEnter(event) {
1875
- var _a;
1876
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee() {
1877
- var value, _res, values, valueList, _res2, _value, _res3, _value2, _res4, res;
1878
- return regenerator_default().wrap(function _callee$(_context) {
1879
- while (1) switch (_context.prev = _context.next) {
1880
- case 0:
1881
- event === null || event === void 0 ? void 0 : event.preventDefault();
1882
- // resolve 中文输入时直接按下enter的错误表现
1883
- _context.next = 3;
1884
- return new Promise(function (r) {
1885
- return setTimeout(r, 0);
1886
- });
1887
- case 3:
1888
- if (usingItem.value) {
1889
- _context.next = 16;
1890
- break;
1891
- }
1892
- if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
1893
- _context.next = 6;
1894
- break;
1895
- }
1896
- return _context.abrupt("return");
1897
- case 6:
1898
- value = {
1899
- id: keyword.value,
1900
- name: keyword.value
1901
- };
1902
- _context.next = 9;
1903
- return validateUsingItemValues(value);
1904
- case 9:
1905
- _res = _context.sent;
1906
- if (_res) {
1907
- _context.next = 12;
1908
- break;
1909
- }
1910
- return _context.abrupt("return");
1911
- case 12:
1912
- emit('add', new SelectedItem(value, 'text'));
1913
- keyword.value = '';
1914
- setMenuList();
1915
- return _context.abrupt("return");
1916
- case 16:
1917
- values = usingItem.value.values;
1918
- if (values === null || values === void 0 ? void 0 : values.length) {
1919
- _context.next = 43;
1920
- break;
1921
- }
1922
- if (!((_a = keyword.value) === null || _a === void 0 ? void 0 : _a.length)) {
1923
- _context.next = 41;
1924
- break;
1925
- }
1926
- if (!keyword.value.includes(valueLoagic.value)) {
1927
- _context.next = 29;
1928
- break;
1929
- }
1930
- valueList = keyword.value.split(valueLoagic.value);
1931
- _context.next = 23;
1932
- return validateUsingItemValues({
1933
- id: keyword.value,
1934
- name: keyword.value
1935
- });
1936
- case 23:
1937
- _res2 = _context.sent;
1938
- if (_res2) {
1939
- _context.next = 26;
1940
- break;
1941
- }
1942
- return _context.abrupt("return");
1943
- case 26:
1944
- valueList.forEach(function (v) {
1945
- return usingItem.value.addValue({
1946
- id: v,
1947
- name: v
1948
- });
1949
- });
1950
- _context.next = 36;
1951
- break;
1952
- case 29:
1953
- _value = {
1954
- id: keyword.value,
1955
- name: keyword.value
1956
- };
1957
- _context.next = 32;
1958
- return validateUsingItemValues(_value);
1959
- case 32:
1960
- _res3 = _context.sent;
1961
- if (_res3) {
1962
- _context.next = 35;
1963
- break;
1964
- }
1965
- return _context.abrupt("return");
1966
- case 35:
1967
- usingItem.value.addValue(_value);
1968
- case 36:
1969
- emit('add', usingItem.value);
1970
- keyword.value = '';
1971
- usingItem.value = null;
1972
- setInputFocus(true);
1973
- return _context.abrupt("return");
1974
- case 41:
1975
- showNoSelectValueError.value = true;
1976
- return _context.abrupt("return");
1977
- case 43:
1978
- if (!keyword.value) {
1979
- _context.next = 56;
1980
- break;
1981
- }
1982
- _value2 = {
1983
- id: keyword.value,
1984
- name: keyword.value
1985
- };
1986
- _context.next = 47;
1987
- return validateUsingItemValues(_value2);
1988
- case 47:
1989
- _res4 = _context.sent;
1990
- if (_res4) {
1991
- _context.next = 50;
1992
- break;
1993
- }
1994
- return _context.abrupt("return");
1995
- case 50:
1996
- usingItem.value.addValue(_value2);
1997
- emit('add', usingItem.value);
1998
- keyword.value = '';
1999
- usingItem.value = null;
2000
- setInputFocus(true);
2001
- return _context.abrupt("return");
2002
- case 56:
2003
- _context.next = 58;
2004
- return validateUsingItemValues();
2005
- case 58:
2006
- res = _context.sent;
2007
- if (res) {
2008
- _context.next = 61;
2009
- break;
2010
- }
2011
- return _context.abrupt("return");
2012
- case 61:
2013
- setSelectedItem();
2014
- case 62:
2015
- case "end":
2016
- return _context.stop();
2017
- }
2018
- }, _callee);
2019
- }));
2020
- }
2021
- function handleKeyBackspace() {
2022
- var _a, _b;
2023
- // 删除已选择项
2024
- if (!usingItem.value && !keyword.value) {
2025
- emit('delete');
2026
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
2027
- (0,external_vue_namespaceObject.nextTick)(setMenuList);
2028
- return;
2029
- }
2030
- if ((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.values.length) {
2031
- // 删除选项
2032
- if (((_b = usingItem.value) === null || _b === void 0 ? void 0 : _b.multiple) || usingItem.value.isInValueList(usingItem.value.values[0]) || props.mode === SearchInputMode.EDIT && !keyword.value) {
2033
- usingItem.value.values.splice(-1, 1);
2034
- keyword.value = '';
2035
- setInputFocus();
2036
- return;
2037
- }
2038
- } else if (!keyword.value) {
2039
- usingItem.value = null;
2040
- keyword.value = '';
2041
- setMenuList();
2042
- }
2043
- onValidate('');
2044
- }
2045
- function handleSelectItem(item, type) {
2046
- var _a, _b, _c, _d, _e, _f;
2047
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee2() {
2048
- var seleted, _res5, isCondition, res;
2049
- return regenerator_default().wrap(function _callee2$(_context2) {
2050
- while (1) switch (_context2.prev = _context2.next) {
2051
- case 0:
2052
- if (!((_a = item.value) === null || _a === void 0 ? void 0 : _a.id)) {
2053
- _context2.next = 20;
2054
- break;
2055
- }
2056
- if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
2057
- _context2.next = 8;
2058
- break;
2059
- }
2060
- seleted = new SelectedItem(Object.assign(Object.assign({}, item), {
2061
- id: (_b = item.realId) !== null && _b !== void 0 ? _b : item.id
2062
- }), type);
2063
- seleted.addValue(item.value);
2064
- setSelectedItem(seleted);
2065
- if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
2066
- setInputFocus(true);
2067
- }
2068
- menuHoverId.value = '';
2069
- return _context2.abrupt("return");
2070
- case 8:
2071
- usingItem.value = new SelectedItem(Object.assign(Object.assign({}, item), {
2072
- id: (_c = item.realId) !== null && _c !== void 0 ? _c : item.id
2073
- }), type);
2074
- usingItem.value.addValue(item.value);
2075
- _context2.next = 12;
2076
- return validateUsingItemValues(item.value);
2077
- case 12:
2078
- _res5 = _context2.sent;
2079
- if (_res5) {
2080
- _context2.next = 16;
2081
- break;
2082
- }
2083
- usingItem.value = null;
2084
- return _context2.abrupt("return");
2085
- case 16:
2086
- setSelectedItem(usingItem.value);
2087
- menuHoverId.value = '';
2088
- setInputFocus(true);
2089
- return _context2.abrupt("return");
2090
- case 20:
2091
- if (!(!usingItem.value || !((_d = inputRef === null || inputRef === void 0 ? void 0 : inputRef.value) === null || _d === void 0 ? void 0 : _d.innerText))) {
2092
- _context2.next = 28;
2093
- break;
2094
- }
2095
- usingItem.value = new SelectedItem(item, type);
2096
- keyword.value = '';
2097
- isCondition = type === 'condition';
2098
- isCondition && setSelectedItem();
2099
- showPopover.value = isCondition || !!usingItem.value.children.length;
2100
- setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
2101
- return _context2.abrupt("return");
2102
- case 28:
2103
- if (!(((_e = usingItem.value) === null || _e === void 0 ? void 0 : _e.type) === 'condition')) {
2104
- _context2.next = 32;
2105
- break;
2106
- }
2107
- usingItem.value = new SelectedItem(item, type);
2108
- setSelectedItem();
2109
- return _context2.abrupt("return");
2110
- case 32:
2111
- usingItem.value.addValue(item);
2112
- _context2.next = 35;
2113
- return validateUsingItemValues(item);
2114
- case 35:
2115
- res = _context2.sent;
2116
- if (res) {
2117
- _context2.next = 38;
2118
- break;
2119
- }
2120
- return _context2.abrupt("return");
2121
- case 38:
2122
- if (!usingItem.value.multiple) setSelectedItem();
2123
- if (props.valueBehavior === ValueBehavior.NEEDKEY && ((_f = usingItem.value) === null || _f === void 0 ? void 0 : _f.multiple)) {
2124
- setInputFocus();
2125
- }
2126
- case 40:
2127
- case "end":
2128
- return _context2.stop();
2129
- }
2130
- }, _callee2);
2131
- }));
2132
- }
2133
- function handleSelectCondtionItem(item) {
2134
- handleSelectItem(item, 'condition');
2135
- }
2136
- function handleMenuFooterClick(item) {
2137
- var _a;
2138
- switch (item.id) {
2139
- case 'confirm':
2140
- if (!((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.values.length)) return;
2141
- keyword.value = '';
2142
- handleKeyEnter();
2143
- break;
2144
- case 'cancel':
2145
- usingItem.value.values = [];
2146
- showPopover.value = false;
2147
- break;
2148
- }
2149
- }
2150
- // functions
2151
- function validateUsingItemValues(value) {
2152
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee3() {
2153
- var _usingItem$value, searchItem, validate, values;
2154
- return regenerator_default().wrap(function _callee3$(_context3) {
2155
- while (1) switch (_context3.prev = _context3.next) {
2156
- case 0:
2157
- if (usingItem.value) {
2158
- _context3.next = 4;
2159
- break;
2160
- }
2161
- _context3.next = 3;
2162
- return validateValues(null, [value]);
2163
- case 3:
2164
- return _context3.abrupt("return", _context3.sent);
2165
- case 4:
2166
- _usingItem$value = usingItem.value, searchItem = _usingItem$value.searchItem, validate = _usingItem$value.validate, values = _usingItem$value.values;
2167
- if (!(validate && typeof props.validateValues === 'function')) {
2168
- _context3.next = 9;
2169
- break;
2170
- }
2171
- _context3.next = 8;
2172
- return validateValues(searchItem, value ? [value] : values);
2173
- case 8:
2174
- return _context3.abrupt("return", _context3.sent);
2175
- case 9:
2176
- onValidate('');
2177
- return _context3.abrupt("return", true);
2178
- case 11:
2179
- case "end":
2180
- return _context3.stop();
2181
- }
2182
- }, _callee3);
2183
- }));
2184
- }
2185
- function validateValues(searchItem, value) {
2186
- var _a;
2187
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee4() {
2188
- var validateStr;
2189
- return regenerator_default().wrap(function _callee4$(_context4) {
2190
- while (1) switch (_context4.prev = _context4.next) {
2191
- case 0:
2192
- _context4.next = 2;
2193
- return (_a = props.validateValues) === null || _a === void 0 ? void 0 : _a.call(props, searchItem !== null && searchItem !== void 0 ? searchItem : null, value)["catch"](function () {
2194
- return false;
2195
- });
2196
- case 2:
2197
- validateStr = _context4.sent;
2198
- if (!(typeof validateStr === 'string' || validateStr === false)) {
2199
- _context4.next = 6;
2200
- break;
2201
- }
2202
- onValidate(validateStr || '校验错误');
2203
- return _context4.abrupt("return", false);
2204
- case 6:
2205
- onValidate('');
2206
- return _context4.abrupt("return", true);
2207
- case 8:
2208
- case "end":
2209
- return _context4.stop();
2210
- }
2211
- }, _callee4);
2212
- }));
2213
- }
2214
- function setInputFocus() {
2215
- var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2216
- if (refleshMenuList) {
2217
- (0,external_vue_namespaceObject.nextTick)().then(function () {
2218
- setMenuList();
2219
- });
2220
- }
2221
- isFocus.value = true;
2222
- showPopover.value = true;
2223
- showNoSelectValueError.value = false;
2224
- var timer = setTimeout(function () {
2225
- if (inputRef.value) {
2226
- inputRef.value.focus(); // 光标移至最后
2227
- var selection = window.getSelection();
2228
- if (selection.focusOffset === 0) {
2229
- selection.selectAllChildren(inputRef.value);
2230
- selection.collapseToEnd();
2231
- }
2232
- }
2233
- window.clearTimeout(timer);
2234
- }, 0);
2235
- emit('focus', isFocus.value);
2236
- }
2237
- function setMenuList() {
2238
- var _a, _b, _c, _d, _e;
2239
- return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee5() {
2240
- var list, hoverItem;
2241
- return regenerator_default().wrap(function _callee5$(_context5) {
2242
- while (1) switch (_context5.prev = _context5.next) {
2243
- case 0:
2244
- list = [];
2245
- if (!(typeof props.getMenuList === 'function' && (typeof ((_b = (_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.searchItem) === null || _b === void 0 ? void 0 : _b.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
2246
- _context5.next = 9;
2247
- break;
2248
- }
2249
- loading.value = true;
2250
- _context5.next = 5;
2251
- return props.getMenuList((_c = usingItem.value) === null || _c === void 0 ? void 0 : _c.searchItem, keyword.value)["catch"](function () {
2252
- return [];
2253
- });
2254
- case 5:
2255
- list = _context5.sent;
2256
- loading.value = false;
2257
- _context5.next = 10;
2258
- break;
2259
- case 9:
2260
- if (!(usingItem === null || usingItem === void 0 ? void 0 : usingItem.value)) {
2261
- if (!((_d = keyword.value) === null || _d === void 0 ? void 0 : _d.length)) {
2262
- list = props.data.filter(function (item) {
2263
- return !item.isSelected;
2264
- }).slice();
2265
- } else props.data.filter(function (item) {
2266
- return !item.isSelected;
2267
- }).forEach(function (item) {
2268
- var _a, _b;
2269
- var isMatched = item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
2270
- if (isMatched) {
2271
- var _list;
2272
- list.push(item);
2273
- var filterList = [];
2274
- (_a = item.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
2275
- filterList.push(Object.assign(Object.assign({}, item), {
2276
- realId: item.id,
2277
- id: (0,external_shared_namespaceObject.random)(10),
2278
- value: child
2279
- }));
2280
- });
2281
- !filterList.length && !item.onlyRecommendChildren && filterList.push(Object.assign(Object.assign({}, item), {
2282
- realId: item.id,
2283
- id: (0,external_shared_namespaceObject.random)(10),
2284
- value: {
2285
- id: keyword.value,
2286
- name: keyword.value
2287
- }
2288
- }));
2289
- (_list = list).push.apply(_list, filterList);
2290
- } else {
2291
- var _list2;
2292
- var _filterList = [];
2293
- (_b = item.children) === null || _b === void 0 ? void 0 : _b.forEach(function (child) {
2294
- if (child.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase())) {
2295
- _filterList.push(Object.assign(Object.assign({}, item), {
2296
- realId: item.id,
2297
- id: (0,external_shared_namespaceObject.random)(10),
2298
- value: child
2299
- }));
2300
- }
2301
- });
2302
- !_filterList.length && !item.onlyRecommendChildren && _filterList.push(Object.assign(Object.assign({}, item), {
2303
- value: {
2304
- id: keyword.value,
2305
- name: keyword.value
2306
- }
2307
- }));
2308
- (_list2 = list).push.apply(_list2, _filterList);
2309
- }
2310
- });
2311
- } else if (usingItem.value.type === 'condition') {
2312
- list = props.conditions;
2313
- } else if (!((_e = usingItem.value.values) === null || _e === void 0 ? void 0 : _e.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
2314
- list = usingItem.value.children.filter(function (item) {
2315
- return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
2316
- });
2317
- }
2318
- case 10:
2319
- menuList.value = list;
2320
- if (props.valueBehavior === ValueBehavior.NEEDKEY) {
2321
- hoverItem = list.find(function (item) {
2322
- return !item.disabled;
2323
- });
2324
- if (hoverItem && (!menuHoverId.value || menuHoverId.value && !list.some(function (item) {
2325
- return item.id === menuHoverId.value;
2326
- }))) {
2327
- menuHoverId.value = hoverItem.id;
2328
- }
2329
- }
2330
- case 12:
2331
- case "end":
2332
- return _context5.stop();
2333
- }
2334
- }, _callee5);
2335
- }));
2336
- }
2337
- function setSelectedItem(item) {
2338
- emit('add', item !== null && item !== void 0 ? item : usingItem.value);
2339
- usingItem.value = null;
2340
- keyword.value = '';
2341
- setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
2342
- }
2343
- function clearInput() {
2344
- var text = inputRef.value.innerText;
2345
- if (text[text.length - 1] === '\n' || text[0] === '\r') {
2346
- setInputText(text.slice(0, -1));
2347
- clearInput();
2348
- } else if (text[0] === '\n' || text[0] === '\r') {
2349
- setInputText(text.slice(1));
2350
- clearInput();
2351
- }
2352
- }
2353
- function setInputText() {
2354
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2355
- var _a;
2356
- if (inputRef.value) {
2357
- inputRef.value.innerHTML = text || ((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.inputInnerHtml) || '';
2358
- }
2359
- }
2360
- function handleLogicalChange(logical) {
2361
- if (!usingItem.value) return;
2362
- usingItem.value.logical = logical;
2363
- }
2364
- // expose
2365
- expose({
2366
- handleInputFocus: handleInputFocus,
2367
- isFocus: isFocus
2368
- });
2369
- return {
2370
- popoverRef: popoverRef,
2371
- inputRef: inputRef,
2372
- keyword: keyword,
2373
- loading: loading,
2374
- remoteMenuList: remoteMenuList,
2375
- menuList: menuList,
2376
- menuHoverId: menuHoverId,
2377
- isFocus: isFocus,
2378
- usingItem: usingItem,
2379
- showPopover: showPopover,
2380
- showNoSelectValueError: showNoSelectValueError,
2381
- debounceSetMenuList: debounceSetMenuList,
2382
- documentArrowEvent: documentArrowEvent,
2383
- handleClickOutside: handleClickOutside,
2384
- handleInputFocus: handleInputFocus,
2385
- handleInputChange: handleInputChange,
2386
- handleLogicalChange: handleLogicalChange,
2387
- handleInputKeyup: handleInputKeyup,
2388
- handleSelectItem: handleSelectItem,
2389
- handleSelectCondtionItem: handleSelectCondtionItem,
2390
- handleMenuFooterClick: handleMenuFooterClick,
2391
- resolveClassName: resolveClassName,
2392
- t: t
2393
- };
2394
- },
2395
- render: function render() {
2396
- var _this = this;
2397
- var _a, _b;
2398
- var _ref2 = this.usingItem || {},
2399
- multiple = _ref2.multiple,
2400
- values = _ref2.values,
2401
- placeholder = _ref2.placeholder,
2402
- inputInnerHtml = _ref2.inputInnerHtml;
2403
- var showInputAfter = !((_a = this.keyword) === null || _a === void 0 ? void 0 : _a.length) && !(values === null || values === void 0 ? void 0 : values.length) && placeholder;
2404
- var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_b = this.menuList) === null || _b === void 0 ? void 0 : _b.length);
2405
- var showCondition = !this.usingItem && this.showCondition;
2406
- var menuSlots = Object.assign({}, this.$slots.menu ? {
2407
- "default": function _default(data) {
2408
- var _a, _b;
2409
- return (_b = (_a = _this.$slots).menu) === null || _b === void 0 ? void 0 : _b.call(_a, data);
2410
- }
2411
- } : {});
2412
- var inputContent = function inputContent() {
2413
- var _a;
2414
- return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
2415
- "ref": "inputRef",
2416
- "class": {
2417
- 'div-input': true,
2418
- 'input-before': _this.showInputBefore && !((_a = _this.keyword) === null || _a === void 0 ? void 0 : _a.length),
2419
- 'input-after': showInputAfter
2420
- },
2421
- "contenteditable": true,
2422
- "data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
2423
- "data-tips": placeholder || '',
2424
- "spellcheck": "false",
2425
- "onFocus": _this.handleInputFocus,
2426
- "onInput": _this.handleInputChange,
2427
- "onKeydown": _this.handleInputKeyup
2428
- }, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2429
- };
2430
- var popoverContent = function popoverContent() {
2431
- var _a, _b, _c;
2432
- if (_this.loading) {
2433
- return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
2434
- }
2435
- if (_this.showNoSelectValueError) {
2436
- return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.filterQueryMustHasValue]);
2437
- }
2438
- return ((_a = _this.menuList) === null || _a === void 0 ? void 0 : _a.length) ? (0,external_vue_namespaceObject.createVNode)("div", {
2439
- "ref": "popoverRef",
2440
- "class": _this.resolveClassName('search-select-popover')
2441
- }, [(0,external_vue_namespaceObject.createVNode)(menu, {
2442
- "list": _this.menuList,
2443
- "keyword": _this.keyword,
2444
- "multiple": !!multiple,
2445
- "hoverId": _this.menuHoverId,
2446
- "selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
2447
- return item.id;
2448
- })) || [],
2449
- "conditions": showCondition ? _this.conditions : [],
2450
- "logical": (_b = _this.usingItem) === null || _b === void 0 ? void 0 : _b.logical,
2451
- "showLogical": (_c = _this.usingItem) === null || _c === void 0 ? void 0 : _c.showLogical,
2452
- "onUpdate:logical": _this.handleLogicalChange,
2453
- "onSelectItem": _this.handleSelectItem,
2454
- "onSelectCondition": _this.handleSelectCondtionItem,
2455
- "onFooterClick": _this.handleMenuFooterClick
2456
- }, Object.assign({}, menuSlots))]) : undefined;
2457
- };
2458
- return (0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], {
2459
- "trigger": "manual",
2460
- "theme": "light",
2461
- "placement": "bottom-start",
2462
- "arrow": false,
2463
- "disableOutsideClick": true,
2464
- "isShow": showPopover
2465
- }, {
2466
- "default": inputContent,
2467
- content: popoverContent
2468
- });
2469
- }
2470
- }));
2471
- ;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
2472
-
2473
- /*
2474
- * Tencent is pleased to support the open source community by making
2475
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2476
- *
2477
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2478
- *
2479
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2480
- *
2481
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2482
- *
2483
- * ---------------------------------------------------
2484
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2485
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2486
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2487
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2488
- *
2489
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2490
- * the Software.
2491
- *
2492
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2493
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2494
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2495
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2496
- * IN THE SOFTWARE.
2497
- */
2498
-
2499
-
2500
-
2501
-
2502
- /* harmony default export */ const selected = ((0,external_vue_namespaceObject.defineComponent)({
2503
- name: 'SearchSelected',
2504
- props: {
2505
- data: {
2506
- type: Array,
2507
- required: true
2508
- },
2509
- selectedList: {
2510
- type: Array,
2511
- required: true
2512
- },
2513
- overflowIndex: {
2514
- type: Number,
2515
- "default": -1
2516
- },
2517
- conditions: {
2518
- type: Array,
2519
- "default": function _default() {
2520
- return [];
2521
- }
2522
- },
2523
- getMenuList: Function,
2524
- validateValues: Function,
2525
- valueBehavior: String
2526
- },
2527
- emits: ['delete'],
2528
- setup: function setup(_props, _ref) {
2529
- var emit = _ref.emit;
2530
- var inputRef = (0,external_vue_namespaceObject.ref)(null);
2531
- var _useSearchSelectInjec = useSearchSelectInject(),
2532
- onEditClick = _useSearchSelectInjec.onEditClick,
2533
- onEditEnter = _useSearchSelectInjec.onEditEnter,
2534
- onEditBlur = _useSearchSelectInjec.onEditBlur,
2535
- editKey = _useSearchSelectInjec.editKey;
2536
- function handleDeleteSelected(index) {
2537
- emit('delete', index);
2538
- }
2539
- function handleEditSeleted(e, item, index) {
2540
- e.preventDefault();
2541
- e.stopPropagation();
2542
- onEditClick(item, index);
2543
- // magic code
2544
- setTimeout(function () {
2545
- return inputRef.value.handleInputFocus();
2546
- }, 200);
2547
- }
2548
- function handleAddSelected(item, index) {
2549
- onEditEnter(item, index);
2550
- }
2551
- function handleInputFocus(isFocus) {
2552
- if (isFocus) return;
2553
- onEditBlur();
2554
- }
2555
- function handleInputOutside() {
2556
- return true;
2557
- }
2558
- function copySeletedItem(item) {
2559
- var newItem = new SelectedItem(item.searchItem, item.type);
2560
- newItem.values = item.values.slice();
2561
- newItem.logical = item.logical || SearchLogical.OR;
2562
- return newItem;
2563
- }
2564
- return {
2565
- inputRef: inputRef,
2566
- editKey: editKey,
2567
- copySeletedItem: copySeletedItem,
2568
- handleDeleteSelected: handleDeleteSelected,
2569
- handleEditSeleted: handleEditSeleted,
2570
- handleInputOutside: handleInputOutside,
2571
- handleAddSelected: handleAddSelected,
2572
- handleInputFocus: handleInputFocus
2573
- };
2574
- },
2575
- render: function render() {
2576
- var _this = this;
2577
- var contentComponent = function contentComponent(item, index) {
2578
- return _this.editKey === "".concat(item.id, "_").concat(index) ? (0,external_vue_namespaceObject.createVNode)("div", {
2579
- "class": "selected-input",
2580
- "key": _this.editKey.toString()
2581
- }, [(0,external_vue_namespaceObject.createVNode)(input, {
2582
- "ref": "inputRef",
2583
- "key": _this.editKey.toString(),
2584
- "mode": SearchInputMode.EDIT,
2585
- "data": _this.data,
2586
- "showCondition": false,
2587
- "conditions": _this.conditions,
2588
- "defautUsingItem": _this.copySeletedItem(item),
2589
- "clickOutside": _this.handleInputOutside,
2590
- "getMenuList": _this.getMenuList,
2591
- "validateValues": _this.validateValues,
2592
- "valueBehavior": _this.valueBehavior,
2593
- "onAdd": function onAdd(v) {
2594
- return _this.handleAddSelected(v, index);
2595
- },
2596
- "onFocus": _this.handleInputFocus
2597
- }, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
2598
- "class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
2599
- "key": "".concat(item.id, "_").concat(index)
2600
- }, [(0,external_vue_namespaceObject.createVNode)("span", {
2601
- "class": "selected-name",
2602
- "onClick": function onClick(e) {
2603
- return _this.handleEditSeleted(e, item, index);
2604
- }
2605
- }, [item.inputInnerText]), (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
2606
- "class": "selected-clear",
2607
- "onClick": function onClick() {
2608
- return _this.handleDeleteSelected(index);
2609
- }
2610
- }, null)]);
2611
- };
2612
- return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [this.selectedList.map(function (item, index) {
2613
- return [_this.overflowIndex >= 0 && index === _this.overflowIndex && (0,external_vue_namespaceObject.createVNode)("div", {
2614
- "class": "search-container-selected overflow-selected"
2615
- }, [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selectedList.length - _this.overflowIndex]), contentComponent(item, index)];
2616
- })]);
2617
- }
2618
- }));
2619
- ;// CONCATENATED MODULE: ../../packages/search-select/src/search-select.tsx
2620
-
2621
-
2622
- /*
2623
- * Tencent is pleased to support the open source community by making
2624
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2625
- *
2626
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2627
- *
2628
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2629
- *
2630
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2631
- *
2632
- * ---------------------------------------------------
2633
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2634
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2635
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2636
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2637
- *
2638
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2639
- * the Software.
2640
- *
2641
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2642
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2643
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2644
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2645
- * IN THE SOFTWARE.
2646
- */
2647
-
2648
-
2649
-
2650
-
2651
-
2652
-
2653
-
2654
-
2655
-
2656
- var INPUT_PADDING_WIDTH = 40;
2657
- var SELETED_MARGING_RIGHT = 6;
2658
- var SearchSelectProps = {
2659
- data: {
2660
- type: Array,
2661
- "default": function _default() {
2662
- return [];
2663
- }
2664
- },
2665
- modelValue: {
2666
- type: Array,
2667
- "default": function _default() {
2668
- return [];
2669
- }
2670
- },
2671
- shrink: {
2672
- type: Boolean,
2673
- "default": true
2674
- },
2675
- maxHeight: {
2676
- type: Number,
2677
- "default": 120
2678
- },
2679
- minHeight: {
2680
- type: Number,
2681
- "default": 26
2682
- },
2683
- conditions: {
2684
- type: Array,
2685
- "default": function _default() {
2686
- return [];
2687
- }
2688
- },
2689
- clearable: {
2690
- type: Boolean,
2691
- "default": true
2692
- },
2693
- placeholder: String,
2694
- getMenuList: Function,
2695
- validateValues: Function,
2696
- uniqueSelect: {
2697
- type: Boolean,
2698
- "default": false
2699
- },
2700
- valueBehavior: {
2701
- type: String,
2702
- "default": ValueBehavior.ALL,
2703
- validator: function validator(v) {
2704
- return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
2705
- }
2706
- }
2707
- };
2708
- /* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
2709
- name: 'SearchSelect',
2710
- directives: {
2711
- clickoutside: external_directives_namespaceObject.clickoutside
2712
- },
2713
- props: SearchSelectProps,
2714
- emits: ['update:modelValue', 'search'],
2715
- setup: function setup(props, _ref) {
2716
- var emit = _ref.emit;
2717
- var t = (0,external_config_provider_namespaceObject.useLocale)('searchSelect');
2718
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
2719
- resolveClassName = _usePrefix.resolveClassName;
2720
- var localConditions = (0,external_vue_namespaceObject.computed)(function () {
2721
- if (props.conditions === undefined) {
2722
- return [{
2723
- id: 'or',
2724
- name: t.value.or
2725
- }, {
2726
- id: 'and',
2727
- name: t.value.and
2728
- }];
2729
- }
2730
- return props.conditions;
2731
- });
2732
- // refs
2733
- var inputRef = (0,external_vue_namespaceObject.ref)(null);
2734
- var wrapRef = (0,external_vue_namespaceObject.ref)(null);
2735
- // vars
2736
- var isFocus = (0,external_vue_namespaceObject.ref)(false);
2737
- var selectedList = (0,external_vue_namespaceObject.ref)([]);
2738
- var overflowIndex = (0,external_vue_namespaceObject.ref)(-1);
2739
- var debounceResize = (0,external_shared_namespaceObject.debounce)(32, handleResize);
2740
- var editKey = (0,external_vue_namespaceObject.ref)('');
2741
- var validateStr = (0,external_vue_namespaceObject.ref)('');
2742
- var copyData = (0,external_vue_namespaceObject.shallowRef)([]);
2743
- (0,external_vue_namespaceObject.watch)(function () {
2744
- return props.data;
2745
- }, function () {
2746
- var _a;
2747
- copyData.value = JSON.parse(JSON.stringify(props.data));
2748
- (_a = copyData.value) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
2749
- item.isSelected = props.uniqueSelect && !!props.modelValue.some(function (set) {
2750
- return set.id === item.id;
2751
- });
2752
- });
2753
- }, {
2754
- immediate: true
2755
- });
2756
- // effects
2757
- (0,external_vue_namespaceObject.watch)(function () {
2758
- return props.modelValue;
2759
- }, function (v) {
2760
- var _a, _b;
2761
- if (!(v === null || v === void 0 ? void 0 : v.length)) {
2762
- selectedList.value = [];
2763
- (_a = copyData.value) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
2764
- item.isSelected = false;
2765
- });
2766
- return;
2767
- }
2768
- var list = [];
2769
- v.forEach(function (item) {
2770
- var _a;
2771
- var seleted = selectedList.value.find(function (set) {
2772
- return set.id === item.id && set.name === item.name;
2773
- });
2774
- if ((seleted === null || seleted === void 0 ? void 0 : seleted.toValueKey()) === JSON.stringify(item)) {
2775
- seleted.values = item.values || [];
2776
- seleted.logical = item.logical || SearchLogical.OR;
2777
- list.push(seleted);
2778
- } else {
2779
- var searchItem = props.data.find(function (set) {
2780
- return set.id === item.id;
2781
- });
2782
- var searchType = 'default';
2783
- if (!searchItem) {
2784
- searchItem = props.conditions.find(function (set) {
2785
- return set.id === item.id;
2786
- });
2787
- searchItem && (searchType = 'condition');
2788
- }
2789
- if (!searchItem && !((_a = item.values) === null || _a === void 0 ? void 0 : _a.length)) {
2790
- searchType = 'text';
2791
- }
2792
- var newSelected = new SelectedItem(searchItem || item, searchType);
2793
- newSelected.values = item.values || [];
2794
- newSelected.logical = item.logical || SearchLogical.OR;
2795
- list.push(newSelected);
2796
- }
2797
- });
2798
- selectedList.value = list;
2799
- (_b = copyData.value) === null || _b === void 0 ? void 0 : _b.forEach(function (item) {
2800
- item.isSelected = props.uniqueSelect && !!list.some(function (set) {
2801
- return set.id === item.id;
2802
- });
2803
- });
2804
- }, {
2805
- immediate: true,
2806
- deep: true
2807
- });
2808
- // life hooks
2809
- (0,external_vue_namespaceObject.onMounted)(function () {
2810
- addListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
2811
- });
2812
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
2813
- removeListener(wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container'))), debounceResize);
2814
- });
2815
- // edit item
2816
- useSearchSelectProvider({
2817
- onEditClick: onEditClick,
2818
- onEditEnter: onEditEnter,
2819
- onEditBlur: onEditBlur,
2820
- onValidate: onValidate,
2821
- editKey: editKey
2822
- });
2823
- function onEditClick(item, index) {
2824
- editKey.value = "".concat(item.id, "_").concat(index);
2825
- }
2826
- function onEditEnter(item, index) {
2827
- var list = selectedList.value.slice();
2828
- list.splice(index, 1, item);
2829
- emit('update:modelValue', list.map(function (item) {
2830
- return item.toValue();
2831
- }));
2832
- editKey.value = '';
2833
- }
2834
- function onEditBlur() {
2835
- editKey.value = '';
2836
- onValidate('');
2837
- }
2838
- function onValidate(str) {
2839
- validateStr.value = str || '';
2840
- }
2841
- // events
2842
- function handleResize() {
2843
- if (isFocus.value || selectedList.value.length < 1) {
2844
- overflowIndex.value = -1;
2845
- return;
2846
- }
2847
- var inputEl = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')));
2848
- var maxWidth = wrapRef.value.querySelector('.search-container').clientWidth - SELETED_MARGING_RIGHT - 2;
2849
- var tagList = inputEl.querySelectorAll('.search-container-selected:not(.overflow-selected)');
2850
- var width = 0;
2851
- var index = 0;
2852
- var i = 0;
2853
- while (index === 0 && width <= maxWidth - INPUT_PADDING_WIDTH && i <= tagList.length - 1) {
2854
- var el = tagList[i];
2855
- if (el.clientHeight > props.minHeight) {
2856
- overflowIndex.value = i;
2857
- return;
2858
- }
2859
- width += el ? el.clientWidth + SELETED_MARGING_RIGHT : 0;
2860
- if (width >= maxWidth - INPUT_PADDING_WIDTH) {
2861
- index = i;
2862
- }
2863
- i += 1;
2864
- }
2865
- if (index === tagList.length - 1 && width <= maxWidth) {
2866
- overflowIndex.value = -1;
2867
- return;
2868
- }
2869
- overflowIndex.value = width >= maxWidth - INPUT_PADDING_WIDTH ? index : index - 1;
2870
- }
2871
- function handleWrapClick() {
2872
- if (!editKey.value) {
2873
- inputRef.value.handleInputFocus();
2874
- }
2875
- }
2876
- function handleClearAll() {
2877
- selectedList.value = [];
2878
- overflowIndex.value = -1;
2879
- emit('update:modelValue', []);
2880
- }
2881
- function handleInputOutside(target) {
2882
- var _a;
2883
- return !((_a = wrapRef.value) === null || _a === void 0 ? void 0 : _a.contains(target));
2884
- }
2885
- function handleAddSelected(item) {
2886
- var list = selectedList.value.slice();
2887
- list.push(item);
2888
- onValidate('');
2889
- emit('update:modelValue', list.map(function (item) {
2890
- return item.toValue();
2891
- }));
2892
- }
2893
- function handleDeleteSelected(index) {
2894
- var list = selectedList.value.slice();
2895
- list.splice(typeof index === 'number' ? index : selectedList.value.length - 1, 1);
2896
- onValidate('');
2897
- emit('update:modelValue', list.map(function (item) {
2898
- return item.toValue();
2899
- }));
2900
- }
2901
- function handleInputFocus(v) {
2902
- var _a;
2903
- v && (overflowIndex.value = -1);
2904
- if (v === false) {
2905
- (_a = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')))) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
2906
- }
2907
- isFocus.value = v;
2908
- }
2909
- function handleClickSearch(e) {
2910
- emit('search', e);
2911
- }
2912
- return {
2913
- inputRef: inputRef,
2914
- wrapRef: wrapRef,
2915
- isFocus: isFocus,
2916
- copyData: copyData,
2917
- selectedList: selectedList,
2918
- overflowIndex: overflowIndex,
2919
- validateStr: validateStr,
2920
- onEditClick: onEditClick,
2921
- onEditEnter: onEditEnter,
2922
- handleWrapClick: handleWrapClick,
2923
- handleInputFocus: handleInputFocus,
2924
- handleResize: handleResize,
2925
- handleClearAll: handleClearAll,
2926
- handleInputOutside: handleInputOutside,
2927
- handleAddSelected: handleAddSelected,
2928
- handleDeleteSelected: handleDeleteSelected,
2929
- handleClickSearch: handleClickSearch,
2930
- localConditions: localConditions,
2931
- resolveClassName: resolveClassName,
2932
- t: t
2933
- };
2934
- },
2935
- render: function render() {
2936
- var _this = this,
2937
- _ref2;
2938
- var _a, _b;
2939
- var maxHeight = "".concat(!this.shrink || this.isFocus ? this.maxHeight : this.minHeight, "px");
2940
- var showCondition = !!this.selectedList.length && this.selectedList.slice(-1)[0].type !== 'condition';
2941
- var menuSlots = Object.assign({}, this.$slots.menu ? {
2942
- menu: function menu(data) {
2943
- var _a, _b;
2944
- return (_b = (_a = _this.$slots).menu) === null || _b === void 0 ? void 0 : _b.call(_a, data);
2945
- }
2946
- } : {});
2947
- // render
2948
- return (0,external_vue_namespaceObject.createVNode)("div", {
2949
- "class": this.resolveClassName('search-select'),
2950
- "ref": "wrapRef"
2951
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
2952
- "class": (_ref2 = {}, _defineProperty(_ref2, this.resolveClassName('search-select-container'), true), _defineProperty(_ref2, 'is-focus', this.isFocus), _ref2),
2953
- "onClick": this.handleWrapClick
2954
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
2955
- "class": "search-prefix"
2956
- }, [(_b = (_a = this.$slots).prepend) === null || _b === void 0 ? void 0 : _b.call(_a)]), (0,external_vue_namespaceObject.createVNode)("div", {
2957
- "class": "search-container",
2958
- "style": {
2959
- maxHeight: maxHeight
2960
- }
2961
- }, [(0,external_vue_namespaceObject.createVNode)(selected, {
2962
- "data": this.copyData,
2963
- "conditions": this.localConditions,
2964
- "selectedList": this.selectedList,
2965
- "overflowIndex": this.overflowIndex,
2966
- "getMenuList": this.getMenuList,
2967
- "validateValues": this.validateValues,
2968
- "valueBehavior": this.valueBehavior,
2969
- "onDelete": this.handleDeleteSelected
2970
- }, Object.assign({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
2971
- "class": "search-container-input"
2972
- }, [(0,external_vue_namespaceObject.createVNode)(input, {
2973
- "ref": "inputRef",
2974
- "data": this.copyData,
2975
- "showInputBefore": !this.selectedList.length,
2976
- "showCondition": showCondition,
2977
- "conditions": this.localConditions,
2978
- "placeholder": this.placeholder || this.t.pleaseSelect,
2979
- "clickOutside": this.handleInputOutside,
2980
- "getMenuList": this.getMenuList,
2981
- "validateValues": this.validateValues,
2982
- "valueBehavior": this.valueBehavior,
2983
- "onAdd": this.handleAddSelected,
2984
- "onDelete": this.handleDeleteSelected,
2985
- "onFocus": this.handleInputFocus
2986
- }, Object.assign({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
2987
- "class": "search-nextfix"
2988
- }, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
2989
- "class": "search-clear",
2990
- "onClick": this.handleClearAll
2991
- }, null), this.$slots.append ? this.$slots.append() : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Search, {
2992
- "onClick": this.handleClickSearch,
2993
- "class": "search-nextfix-icon ".concat(this.isFocus ? 'is-focus' : '')
2994
- }, null)])]), !!this.validateStr.length && (0,external_vue_namespaceObject.createVNode)("div", {
2995
- "class": this.resolveClassName('search-select-tips')
2996
- }, [this.$slots.validate ? this.$slots.validate() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.ExclamationCircleShape, {
2997
- "class": "select-tips"
2998
- }, null), this.validateStr || ''])])]);
2999
- }
3000
- }));
3001
- ;// CONCATENATED MODULE: ../../packages/search-select/src/index.ts
3002
- /*
3003
- * Tencent is pleased to support the open source community by making
3004
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3005
- *
3006
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3007
- *
3008
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3009
- *
3010
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3011
- *
3012
- * ---------------------------------------------------
3013
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3014
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3015
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3016
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3017
- *
3018
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3019
- * the Software.
3020
- *
3021
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3022
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3023
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3024
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3025
- * IN THE SOFTWARE.
3026
- */
3027
-
3028
-
3029
- var BkSearchSelect = (0,external_shared_namespaceObject.withInstall)(search_select);
3030
- /* harmony default export */ const src = (BkSearchSelect);
3031
-
3032
- })();
3033
-
3034
- var __webpack_exports__BkSearchSelect = __webpack_exports__.r;
3035
- var __webpack_exports__default = __webpack_exports__.Z;
3036
- export { __webpack_exports__BkSearchSelect as BkSearchSelect, __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 n from"../config-provider";import*as r from"../directives";import*as i from"../icon";import*as a from"../popover";import*as o from"../checkbox";import*as l from"../radio";var u={7609:(e,t,n)=>{var r=n(7425).default;function i(){e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),l=new N(r||[]);return o(a,"_invoke",{value:E(e,n,l)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(I([])));w&&w!==n&&a.call(w,u)&&(y=w);var b=g.prototype=p.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,o,l,u){var c=f(e[i],e,o);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function E(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return{value:void 0,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=S(o,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function I(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 n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=g,o(b,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,s,"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,s,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new k(v(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(b),d(b,s,"Generator"),d(b,u,(function(){return this})),d(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,N.prototype={constructor:N,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(C),!e)for(var t in this)"t"===t.charAt(0)&&a.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 n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(o)},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),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){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(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var d={};(()=>{s.d(d,{r:()=>J,Z:()=>Z});const u=(c={debounce:()=>e.debounce,random:()=>e.random,withInstall:()=>e.withInstall},v={},s.d(v,c),v);var c,v;function f(e){return f="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},f(e)}function h(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}function p(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const m=(e=>{var t={};return s.d(t,e),t})({Fragment:()=>t.Fragment,computed:()=>t.computed,createTextVNode:()=>t.createTextVNode,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,inject:()=>t.inject,nextTick:()=>t.nextTick,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,provide:()=>t.provide,ref:()=>t.ref,resolveDirective:()=>t.resolveDirective,shallowRef:()=>t.shallowRef,watch:()=>t.watch,watchEffect:()=>t.watchEffect,withDirectives:()=>t.withDirectives});var g=null,y=null;function _(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function w(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function b(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===w(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var x=0,k=null;function E(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=S.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&C(e)})),a=b(e),o=a.detached,l=a.rendered;e.__resize_observer_triggered__=!1===o&&!1===l,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){C(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(x||(k=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=w(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=_("div",{className:"resize-triggers"}),r=_("div",{className:"resize-expand-trigger"}),i=_("div"),a=_("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(a),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:a},N(e),e.addEventListener("scroll",L,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=b(e).rendered,window.MutationObserver){var u=new MutationObserver(e.__resize_mutation_handler__);u.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=u}e.__resize_listeners__.push(t),x++}function S(){var e=b(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(N(this),this.addEventListener("scroll",L,!0)),this.__resize_rendered__=t,C(this))}function L(){var e,t,n=this;N(this),this.__resize_raf__&&(e=this.__resize_raf__,y||(y=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),y(e)),this.__resize_raf__=(t=function(){var e,t,r,i,a,o,l=(r=(t=(e=n).__resize_last__).width,i=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==r||o!==i?{width:a,height:o}:null);l&&(n.__resize_last__=l,C(n))},g||(g=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),g(t))}function C(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function N(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,a=i.scrollWidth,o=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,s=n.scrollHeight;i.scrollLeft=a,i.scrollTop=o,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=s}const I=(e=>{var t={};return s.d(t,e),t})({useLocale:()=>n.useLocale,usePrefix:()=>n.usePrefix}),V=(e=>{var t={};return s.d(t,e),t})({clickoutside:()=>r.clickoutside}),O=(e=>{var t={};return s.d(t,e),t})({Close:()=>i.Close,Error:()=>i.Error,ExclamationCircleShape:()=>i.ExclamationCircleShape,Search:()=>i.Search});var z=s(2841),T=s.n(z);function F(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const D=(e=>{var t={};return s.d(t,e),t})({default:()=>a.default}),j=(e=>{var t={};return s.d(t,e),t})({default:()=>o.default}),B=(e=>{var t={};return s.d(t,e),t})({default:()=>l.default});function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}var R;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(R||(R={}));var M,P,K=Symbol("SEARCH_SLECT_PROVIDER_KEY"),H=function(){return(0,m.inject)(K)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(M||(M={})),function(e){e.AND="&",e.OR="|"}(P||(P={}));var q=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.values=[],this.id=t.id,this.name=t.name,this.logical=t.logical||P.OR}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"showLogical",get:function(){return!!this.searchItem.showLogicalPanel}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}})),this.multiple&&this.logical!==P.OR&&(t.logical=this.logical)),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&A(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const Y=(0,m.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}},showLogical:{type:Boolean,default:!0},logical:{type:String,default:P.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup:function(e,t){var n=t.emit,r=(0,I.useLocale)("searchSelect"),i=(0,I.usePrefix)().resolveClassName,a=(0,m.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));function o(e){n("selectItem",e)}return{handleClick:o,handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},handleSelectedChange:function(e,t){e.stopPropagation(),e.preventDefault(),o(t)},handleLogicalChange:function(e){n("update:logical",e)},filterList:(0,m.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,m.createVNode)("span",{class:"menu-name"},[t.name,(0,m.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var i=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===i.length&&0!==n?i.push(t.slice(0,n)):a>=0&&i.push(t.slice(a+e.length,n)),i.push((0,m.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&i.push(t.slice(a+r)),i.length?i:t}(t.name)},localFooterBtns:a,resolveClassName:i,t:r}},render:function(){var e,t,n=this,r=(0,m.createVNode)("ul",{class:"menu-content"},[null===(e=this.list)||void 0===e?void 0:e.map((function(e){return(0,m.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(n.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&n.handleClick(e)}},[n.$slots.default?n.$slots.default({item:e,list:n.list,multiple:!!n.multiple,hoverId:n.hoverId,getSearchNode:n.getSearchNode}):(0,m.createVNode)(m.Fragment,null,[n.multiple&&(0,m.createVNode)("span",{onClick:function(t){return n.handleSelectedChange(t,e)}},[(0,m.createVNode)(j.default,{modelValue:n.selected.includes(e.id),class:"is-selected"},null)]),n.getSearchNode(e)])])}))]);return(0,m.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(t=this.conditions)||void 0===t?void 0:t.length)&&(0,m.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,m.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&n.handleClickCondition(e)}},[e.name])}))]),n.showLogical&&n.multiple?(0,m.createVNode)("div",{class:"menu-content-wrapper"},[r,(0,m.createVNode)("div",{class:"menu-condition"},[(0,m.createVNode)("div",{class:"menu-condition-title"},[n.t.logical]),(0,m.createVNode)(B.default,{modelValue:n.logical,onChange:n.handleLogicalChange,label:"|"},{default:function(){return[n.t.or,(0,m.createTextVNode)(" |")]}}),(0,m.createVNode)(B.default,{modelValue:n.logical,onChange:n.handleLogicalChange,label:"&"},{default:function(){return[n.t.and,(0,m.createTextVNode)(" &")]}})])]):r])}}),$=(0,m.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:V.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:M.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(e,t){var n=t.emit,r=t.expose,i=(0,I.useLocale)("searchSelect"),a=(0,I.usePrefix)().resolveClassName,o=(0,m.ref)(null),l=(0,m.ref)(null),c=(0,m.ref)(""),s=(0,m.ref)(!1),d=(0,m.ref)(!1),v=(0,m.ref)(!1),f=(0,m.ref)(e.defautUsingItem),h=(0,m.ref)(""),p=(0,m.ref)(!1),g=(0,u.debounce)(300,j),y=!1,_=(0,m.ref)([]),w=(0,m.ref)([]),b=H(),x=b.editKey,k=b.onValidate,E=(0,m.computed)((function(){var e;return(null===(e=f.value)||void 0===e?void 0:e.logical)||P.OR}));function S(e){switch(e.code){case"ArrowDown":case"ArrowUp":L(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=w.value.find((function(e){return e.id===h.value}));t&&V(t)}}(e)}}function L(e){var t;e.preventDefault(),null===(t=o.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===h.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var a=w.value[i];if(a&&!a.disabled){r=-1;var l=document.getElementById(a.id);return null==l||l.focus(),void(h.value=a.id)}r-=1}}function C(e){D(),e&&j()}function N(t){var r;return F(this,void 0,void 0,T().mark((function i(){var a,o,l,u,d;return T().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==t||t.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(f.value){i.next=16;break}if(c.value&&e.valueBehavior!==R.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return a={id:c.value,name:c.value},i.next=9,O(a);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return n("add",new q(a,"text")),c.value="",j(),i.abrupt("return");case 16:if(null==(o=f.value.values)?void 0:o.length){i.next=43;break}if(!(null===(r=c.value)||void 0===r?void 0:r.length)){i.next=41;break}if(!c.value.includes(E.value)){i.next=29;break}return l=c.value.split(E.value),i.next=23,O({id:c.value,name:c.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return f.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:c.value,name:c.value},i.next=32,O(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:f.value.addValue(u);case 36:return n("add",f.value),c.value="",f.value=null,D(!0),i.abrupt("return");case 41:return s.value=!0,i.abrupt("return");case 43:if(!c.value){i.next=56;break}return d={id:c.value,name:c.value},i.next=47,O(d);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return f.value.addValue(d),n("add",f.value),c.value="",f.value=null,D(!0),i.abrupt("return");case 56:return i.next=58,O();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:B();case 62:case"end":return i.stop()}}),i)})))}function V(t,n){var r,i,a,l,u,s;return F(this,void 0,void 0,T().mark((function d(){var p,m;return T().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=t.value)||void 0===r?void 0:r.id)){d.next=20;break}if((e.valueBehavior!==R.NEEDKEY||!t.value)&&e.validateValues){d.next=8;break}return(p=new q(Object.assign(Object.assign({},t),{id:null!==(i=t.realId)&&void 0!==i?i:t.id}),n)).addValue(t.value),B(p),e.valueBehavior===R.NEEDKEY&&h.value&&D(!0),h.value="",d.abrupt("return");case 8:return f.value=new q(Object.assign(Object.assign({},t),{id:null!==(a=t.realId)&&void 0!==a?a:t.id}),n),f.value.addValue(t.value),d.next=12,O(t.value);case 12:if(d.sent){d.next=16;break}return f.value=null,d.abrupt("return");case 16:return B(f.value),h.value="",D(!0),d.abrupt("return");case 20:if(f.value&&(null===(l=null==o?void 0:o.value)||void 0===l?void 0:l.innerText)){d.next=28;break}return f.value=new q(t,n),c.value="",(m="condition"===n)&&B(),v.value=m||!!f.value.children.length,D(e.valueBehavior===R.NEEDKEY&&!!h.value),d.abrupt("return");case 28:if("condition"!==(null===(u=f.value)||void 0===u?void 0:u.type)){d.next=32;break}return f.value=new q(t,n),B(),d.abrupt("return");case 32:return f.value.addValue(t),d.next=35,O(t);case 35:if(d.sent){d.next=38;break}return d.abrupt("return");case 38:f.value.multiple||B(),e.valueBehavior===R.NEEDKEY&&(null===(s=f.value)||void 0===s?void 0:s.multiple)&&D();case 40:case"end":return d.stop()}}),d)})))}function O(t){return F(this,void 0,void 0,T().mark((function n(){var r,i,a,o;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f.value){n.next=4;break}return n.next=3,z(null,[t]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=f.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof e.validateValues){n.next=9;break}return n.next=8,z(i,t?[t]:o);case 9:return k(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function z(t,n){var r;return F(this,void 0,void 0,T().mark((function i(){var a;return T().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=e.validateValues)||void 0===r?void 0:r.call(e,null!=t?t:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(a=i.sent)&&!1!==a){i.next=6;break}return k(a||"校验错误"),i.abrupt("return",!1);case 6:return k(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function D(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,m.nextTick)().then((function(){j()})),d.value=!0,v.value=!0,s.value=!1;var e=setTimeout((function(){if(o.value){o.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(o.value),t.collapseToEnd())}window.clearTimeout(e)}),0);n("focus",d.value)}function j(){var t,n,r,i,a;return F(this,void 0,void 0,T().mark((function o(){var l,s;return T().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(l=[],"function"!=typeof e.getMenuList||void 0!==(null===(n=null===(t=f.value)||void 0===t?void 0:t.searchItem)||void 0===n?void 0:n.async)&&!0!==f.value.searchItem.async){o.next=9;break}return p.value=!0,o.next=5,e.getMenuList(null===(r=f.value)||void 0===r?void 0:r.searchItem,c.value).catch((function(){return[]}));case 5:l=o.sent,p.value=!1,o.next=10;break;case 9:(null==f?void 0:f.value)?"condition"===f.value.type?l=e.conditions:(null===(a=f.value.values)||void 0===a?void 0:a.length)&&!f.value.multiple&&e.mode!==M.EDIT||(l=f.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(i=c.value)||void 0===i?void 0:i.length)?e.data.filter((function(e){return!e.isSelected})).forEach((function(e){var t,n;if(e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())){var r;l.push(e);var i=[];null===(t=e.children)||void 0===t||t.forEach((function(t){i.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:t}))})),!i.length&&!e.onlyRecommendChildren&&i.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:{id:c.value,name:c.value}})),(r=l).push.apply(r,i)}else{var a,o=[];null===(n=e.children)||void 0===n||n.forEach((function(t){t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&o.push(Object.assign(Object.assign({},e),{realId:e.id,id:(0,u.random)(10),value:t}))})),!o.length&&!e.onlyRecommendChildren&&o.push(Object.assign(Object.assign({},e),{value:{id:c.value,name:c.value}})),(a=l).push.apply(a,o)}})):l=e.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=l,e.valueBehavior===R.NEEDKEY&&(s=l.find((function(e){return!e.disabled})))&&(!h.value||h.value&&!l.some((function(e){return e.id===h.value})))&&(h.value=s.id);case 12:case"end":return o.stop()}}),o)})))}function B(t){n("add",null!=t?t:f.value),f.value=null,c.value="",D(e.valueBehavior===R.NEEDKEY)}function A(){var e=o.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(K(e.slice(0,-1)),A()):"\n"!==e[0]&&"\r"!==e[0]||(K(e.slice(1)),A())}function K(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o.value&&(o.value.innerHTML=t||(null===(e=f.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,m.watch)(x,(function(){e.mode===M.DEFAULT&&x.value&&(v.value=!1)})),(0,m.watchEffect)((function(){c.value||K()}),{flush:"pre"}),(0,m.watch)([w,v],(function(){var t;(null===(t=w.value)||void 0===t?void 0:t.some((function(e){return!e.disabled})))&&v.value?y||(e.valueBehavior===R.NEEDKEY?h.value=w.value.find((function(e){return!e.disabled})).id:h.value="",y=!0,document.addEventListener("keydown",S)):(document.removeEventListener("keydown",S),y=!1,e.valueBehavior!==R.NEEDKEY&&(h.value=""))})),r({handleInputFocus:C,isFocus:d}),{popoverRef:l,inputRef:o,keyword:c,loading:p,remoteMenuList:_,menuList:w,menuHoverId:h,isFocus:d,usingItem:f,showPopover:v,showNoSelectValueError:s,debounceSetMenuList:g,documentArrowEvent:L,handleClickOutside:function(t){var r,i,a,o,u;if(!(null===(r=l.value)||void 0===r?void 0:r.contains(t.target))&&(null===(i=e.clickOutside)||void 0===i?void 0:i.call(e,t.target,l.value))){if((null===(o=null===(a=f.value)||void 0===a?void 0:a.values)||void 0===o?void 0:o.length)&&(null===(u=f.value)||void 0===u?void 0:u.multiple))return c.value="",void N();v.value=!1,d.value=!1,n("focus",d.value)}},handleInputFocus:C,handleInputChange:function(e){var t,n,r,i,a,l,u,s,d;A();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm," ".concat(E.value," ")).replace(/\s{2}/gm,""),o.value.innerText=v,D(),c.value=v.replace((null===(t=f.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),g();else if(!c.value&&v.length<((null===(r=null===(n=f.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var h=v.replace(" "," ").replace((null===(i=f.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(a=f.value)||void 0===a?void 0:a.keyInnerText)&&v.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&h&&(null===(l=f.value.values)||void 0===l?void 0:l.length))return c.value=h,console.info("outerText",h),void g();!h&&(null==v?void 0:v.length)||(f.value=null),c.value=h?v:"",g()}else(null===(s=null===(u=f.value)||void 0===u?void 0:u.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=f.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),D(),g())},handleLogicalChange:function(e){f.value&&(f.value.logical=e)},handleInputKeyup:function(t){switch(t.code){case"Enter":case"NumpadEnter":if(e.valueBehavior===R.NEEDKEY&&w.value.some((function(e){return e.id===h.value})))return;N(t);break;case"Backspace":!function(){var t,r;if(!f.value&&!c.value)return n("delete"),void(0,m.nextTick)(j);if(null===(t=f.value)||void 0===t?void 0:t.values.length){if((null===(r=f.value)||void 0===r?void 0:r.multiple)||f.value.isInValueList(f.value.values[0])||e.mode===M.EDIT&&!c.value)return f.value.values.splice(-1,1),c.value="",void D()}else c.value||(f.value=null,c.value="",j());k("")}();default:s.value=!1}},handleSelectItem:V,handleSelectCondtionItem:function(e){V(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=f.value)||void 0===t?void 0:t.values.length))return;c.value="",N();break;case"cancel":f.value.values=[],v.value=!1}},resolveClassName:a,t:i}},render:function(){var e,t,n=this,r=this.usingItem||{},i=r.multiple,a=r.values,o=r.placeholder,l=r.inputInnerHtml,u=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&o,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),s=!this.usingItem&&this.showCondition,d=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,m.createVNode)(D.default,{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,m.withDirectives)((0,m.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":u},contenteditable:!0,"data-placeholder":l||n.keyword?"":n.placeholder,"data-tips":o||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,m.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e,t,r;return n.loading?(0,m.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,m.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,m.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,m.createVNode)(Y,{list:n.menuList,keyword:n.keyword,multiple:!!i,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:s?n.conditions:[],logical:null===(t=n.usingItem)||void 0===t?void 0:t.logical,showLogical:null===(r=n.usingItem)||void 0===r?void 0:r.showLogical,"onUpdate:logical":n.handleLogicalChange,onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},d))]):void 0}})}}),U=(0,m.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,m.ref)(null),i=H(),a=i.onEditClick,o=i.onEditEnter,l=i.onEditBlur,u=i.editKey;return{inputRef:r,editKey:u,copySeletedItem:function(e){var t=new q(e.searchItem,e.type);return t.values=e.values.slice(),t.logical=e.logical||P.OR,t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){o(e,t)},handleInputFocus:function(e){e||l()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,m.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,m.createVNode)($,{ref:"inputRef",key:e.editKey.toString(),mode:M.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,m.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,m.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,m.createVNode)(O.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,m.createVNode)(m.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,m.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,m.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var W={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:R.ALL,validator:function(e){return[R.ALL,R.NEEDKEY].includes(e)}}};const G=(0,m.defineComponent)({name:"SearchSelect",directives:{clickoutside:V.clickoutside},props:W,emits:["update:modelValue","search"],setup:function(e,t){var n,r=t.emit,i=(0,I.useLocale)("searchSelect"),a=(0,I.usePrefix)().resolveClassName,o=(0,m.computed)((function(){return void 0===e.conditions?[{id:"or",name:i.value.or},{id:"and",name:i.value.and}]:e.conditions})),l=(0,m.ref)(null),c=(0,m.ref)(null),s=(0,m.ref)(!1),d=(0,m.ref)([]),v=(0,m.ref)(-1),f=(0,u.debounce)(32,b),h=(0,m.ref)(""),p=(0,m.ref)(""),g=(0,m.shallowRef)([]);function y(e,t){h.value="".concat(e.id,"_").concat(t)}function _(e,t){var n=d.value.slice();n.splice(t,1,e),r("update:modelValue",n.map((function(e){return e.toValue()}))),h.value=""}function w(e){p.value=e||""}function b(){if(s.value||d.value.length<1)v.value=-1;else{for(var t=c.value.querySelector(".".concat(a("search-select-container"))),n=c.value.querySelector(".search-container").clientWidth-6-2,r=t.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,l=0;0===o&&i<=n-40&&l<=r.length-1;){var u=r[l];if(u.clientHeight>e.minHeight)return void(v.value=l);(i+=u?u.clientWidth+6:0)>=n-40&&(o=l),l+=1}o===r.length-1&&i<=n?v.value=-1:v.value=i>=n-40?o:o-1}}return(0,m.watch)((function(){return e.data}),(function(){var t;g.value=JSON.parse(JSON.stringify(e.data)),null===(t=g.value)||void 0===t||t.forEach((function(t){t.isSelected=e.uniqueSelect&&!!e.modelValue.some((function(e){return e.id===t.id}))}))}),{immediate:!0}),(0,m.watch)((function(){return e.modelValue}),(function(t){var n,r;if(!(null==t?void 0:t.length))return d.value=[],void(null===(n=g.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];t.forEach((function(t){var n,r=d.value.find((function(e){return e.id===t.id&&e.name===t.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(t))r.values=t.values||[],r.logical=t.logical||P.OR,i.push(r);else{var a=e.data.find((function(e){return e.id===t.id})),o="default";a||(a=e.conditions.find((function(e){return e.id===t.id})))&&(o="condition"),a||(null===(n=t.values)||void 0===n?void 0:n.length)||(o="text");var l=new q(a||t,o);l.values=t.values||[],l.logical=t.logical||P.OR,i.push(l)}})),d.value=i,null===(r=g.value)||void 0===r||r.forEach((function(t){t.isSelected=e.uniqueSelect&&!!i.some((function(e){return e.id===t.id}))}))}),{immediate:!0,deep:!0}),(0,m.onMounted)((function(){E(c.value.querySelector(".".concat(a("search-select-container"))),f)})),(0,m.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",L),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --x&&k&&k.parentNode.removeChild(k)}}(c.value.querySelector(".".concat(a("search-select-container"))),f)})),n={onEditClick:y,onEditEnter:_,onEditBlur:function(){h.value="",w("")},onValidate:w,editKey:h},(0,m.provide)(K,n),{inputRef:l,wrapRef:c,isFocus:s,copyData:g,selectedList:d,overflowIndex:v,validateStr:p,onEditClick:y,onEditEnter:_,handleWrapClick:function(){h.value||l.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(v.value=-1),!1===e&&(null===(t=c.value.querySelector(".".concat(a("search-select-container"))))||void 0===t||t.scrollTo(0,0)),s.value=e},handleResize:b,handleClearAll:function(){d.value=[],v.value=-1,r("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=c.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=d.value.slice();t.push(e),w(""),r("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=d.value.slice();t.splice("number"==typeof e?e:d.value.length-1,1),w(""),r("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){r("search",e)},localConditions:o,resolveClassName:a,t:i}},render:function(){var e,t,n,r=this,i="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),a=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,o=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,m.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,m.createVNode)("div",{class:(e={},p(e,this.resolveClassName("search-select-container"),!0),p(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,m.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,m.createVNode)("div",{class:"search-container",style:{maxHeight:i}},[(0,m.createVNode)(U,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},o)),(0,m.createVNode)("div",{class:"search-container-input"},[(0,m.createVNode)($,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:a,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},o))])]),(0,m.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,m.createVNode)(O.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,m.createVNode)(O.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,m.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,m.createVNode)(m.Fragment,null,[(0,m.createVNode)(O.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var J=(0,u.withInstall)(G);const Z=J})();var v=d.r,f=d.Z;export{v as BkSearchSelect,f as default};