bkui-vue 0.0.1-beta.468 → 0.0.1-beta.469

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 (168) hide show
  1. package/lib/affix/index.js +1 -335
  2. package/lib/alert/index.js +1 -276
  3. package/lib/animate-number/index.js +1 -219
  4. package/lib/backtop/index.js +1 -252
  5. package/lib/badge/index.js +1 -293
  6. package/lib/breadcrumb/index.js +1 -311
  7. package/lib/button/index.js +1 -388
  8. package/lib/card/index.js +1 -356
  9. package/lib/cascader/index.js +2 -2075
  10. package/lib/cascader/index.js.LICENSE.txt +1 -0
  11. package/lib/checkbox/index.js +1 -536
  12. package/lib/code-diff/index.js +1 -5535
  13. package/lib/collapse/index.js +1 -589
  14. package/lib/collapse-transition/index.js +1 -234
  15. package/lib/color-picker/index.js +1 -2701
  16. package/lib/components.js +1 -781
  17. package/lib/config-provider/index.js +1 -377
  18. package/lib/container/index.js +1 -390
  19. package/lib/date-picker/index.js +1 -5537
  20. package/lib/dialog/index.js +2 -1322
  21. package/lib/dialog/index.js.LICENSE.txt +1 -0
  22. package/lib/directives/index.js +2 -1357
  23. package/lib/directives/index.js.LICENSE.txt +14 -0
  24. package/lib/dist.index.js +1 -179
  25. package/lib/divider/index.js +1 -226
  26. package/lib/dropdown/index.js +1 -392
  27. package/lib/exception/index.js +1 -423
  28. package/lib/fixed-navbar/index.js +1 -210
  29. package/lib/form/index.js +1 -995
  30. package/lib/hooks.js +1 -133
  31. package/lib/icon/angle-double-down-line.js +1 -541
  32. package/lib/icon/angle-double-left-line.js +1 -541
  33. package/lib/icon/angle-double-left.js +1 -541
  34. package/lib/icon/angle-double-right-line.js +1 -541
  35. package/lib/icon/angle-double-right.js +1 -541
  36. package/lib/icon/angle-double-up-line.js +1 -541
  37. package/lib/icon/angle-down-fill.js +1 -541
  38. package/lib/icon/angle-down-line.js +1 -541
  39. package/lib/icon/angle-down.js +1 -541
  40. package/lib/icon/angle-left.js +1 -541
  41. package/lib/icon/angle-right.js +1 -541
  42. package/lib/icon/angle-up-fill.js +1 -541
  43. package/lib/icon/angle-up.js +1 -541
  44. package/lib/icon/archive-fill.js +1 -541
  45. package/lib/icon/arrows-left.js +1 -541
  46. package/lib/icon/arrows-right.js +1 -541
  47. package/lib/icon/audio-fill.js +1 -541
  48. package/lib/icon/bk.js +1 -541
  49. package/lib/icon/circle.js +1 -541
  50. package/lib/icon/close-line.js +1 -541
  51. package/lib/icon/close.js +1 -541
  52. package/lib/icon/code.js +1 -541
  53. package/lib/icon/cog-shape.js +1 -541
  54. package/lib/icon/collapse-left.js +1 -541
  55. package/lib/icon/copy-shape.js +1 -541
  56. package/lib/icon/copy.js +1 -541
  57. package/lib/icon/data-shape.js +1 -541
  58. package/lib/icon/del.js +1 -541
  59. package/lib/icon/doc-fill.js +1 -541
  60. package/lib/icon/done.js +1 -541
  61. package/lib/icon/down-shape.js +1 -541
  62. package/lib/icon/down-small.js +1 -541
  63. package/lib/icon/edit-line.js +1 -541
  64. package/lib/icon/ellipsis.js +1 -541
  65. package/lib/icon/enlarge-line.js +1 -541
  66. package/lib/icon/error.js +1 -541
  67. package/lib/icon/excel-fill.js +1 -541
  68. package/lib/icon/exclamation-circle-shape.js +1 -541
  69. package/lib/icon/eye.js +1 -541
  70. package/lib/icon/filliscreen-line.js +1 -541
  71. package/lib/icon/fix-line.js +1 -541
  72. package/lib/icon/fix-shape.js +1 -541
  73. package/lib/icon/folder-open.js +1 -541
  74. package/lib/icon/folder-shape-open.js +1 -541
  75. package/lib/icon/folder-shape.js +1 -541
  76. package/lib/icon/folder.js +1 -541
  77. package/lib/icon/funnel.js +1 -541
  78. package/lib/icon/help-document-fill.js +1 -541
  79. package/lib/icon/help-fill.js +1 -541
  80. package/lib/icon/help.js +1 -541
  81. package/lib/icon/image-fill.js +1 -563
  82. package/lib/icon/img-error.js +1 -563
  83. package/lib/icon/img-placehoulder.js +1 -563
  84. package/lib/icon/index.js +1 -2337
  85. package/lib/icon/info-line.js +1 -563
  86. package/lib/icon/info.js +1 -563
  87. package/lib/icon/left-shape.js +1 -563
  88. package/lib/icon/left-turn-line.js +1 -563
  89. package/lib/icon/narrow-line.js +1 -563
  90. package/lib/icon/original.js +1 -563
  91. package/lib/icon/pdf-fill.js +1 -563
  92. package/lib/icon/play-shape.js +1 -563
  93. package/lib/icon/plus.js +1 -563
  94. package/lib/icon/ppt-fill.js +1 -563
  95. package/lib/icon/qq.js +1 -563
  96. package/lib/icon/right-shape.js +1 -563
  97. package/lib/icon/right-turn-line.js +1 -563
  98. package/lib/icon/search.js +1 -563
  99. package/lib/icon/share.js +1 -563
  100. package/lib/icon/spinner.js +1 -563
  101. package/lib/icon/success.js +1 -563
  102. package/lib/icon/switcher-loading.js +1 -563
  103. package/lib/icon/text-file.js +1 -563
  104. package/lib/icon/text-fill.js +1 -563
  105. package/lib/icon/transfer.js +1 -563
  106. package/lib/icon/tree-application-shape.js +1 -563
  107. package/lib/icon/unfull-screen.js +1 -563
  108. package/lib/icon/unvisible.js +1 -563
  109. package/lib/icon/up-shape.js +1 -563
  110. package/lib/icon/upload.js +1 -563
  111. package/lib/icon/video-fill.js +1 -563
  112. package/lib/icon/warn.js +1 -563
  113. package/lib/icon/weixin-pro.js +1 -563
  114. package/lib/icon/weixin.js +1 -563
  115. package/lib/image/index.js +1 -944
  116. package/lib/index.js +1 -195
  117. package/lib/info-box/index.js +2 -1508
  118. package/lib/info-box/index.js.LICENSE.txt +1 -0
  119. package/lib/input/index.js +1 -963
  120. package/lib/link/index.js +1 -219
  121. package/lib/loading/index.js +1 -434
  122. package/lib/locale/index.js +1 -489
  123. package/lib/menu/index.js +1 -776
  124. package/lib/message/index.js +2 -1744
  125. package/lib/message/index.js.LICENSE.txt +6 -0
  126. package/lib/modal/index.js +1 -397
  127. package/lib/navigation/index.js +1 -423
  128. package/lib/notify/index.js +1 -437
  129. package/lib/overflow-title/index.js +1 -547
  130. package/lib/pagination/index.js +1 -987
  131. package/lib/plugin-popover/index.js +1 -4022
  132. package/lib/plugins/index.js +1 -130
  133. package/lib/pop-confirm/index.js +1 -365
  134. package/lib/popover/index.js +1 -4028
  135. package/lib/popover2/index.js +1 -171
  136. package/lib/preset.js +1 -164
  137. package/lib/process/index.js +2 -1143
  138. package/lib/process/index.js.LICENSE.txt +1 -0
  139. package/lib/progress/index.js +1 -476
  140. package/lib/radio/index.js +1 -611
  141. package/lib/rate/index.js +1 -348
  142. package/lib/resize-layout/index.js +1 -482
  143. package/lib/search-select/index.js +2 -2999
  144. package/lib/search-select/index.js.LICENSE.txt +1 -0
  145. package/lib/select/index.js +2 -2531
  146. package/lib/select/index.js.LICENSE.txt +1 -0
  147. package/lib/shared/index.js +1 -2713
  148. package/lib/sideslider/index.js +2 -1043
  149. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  150. package/lib/slider/index.js +2 -1667
  151. package/lib/slider/index.js.LICENSE.txt +1 -0
  152. package/lib/steps/index.js +2 -1212
  153. package/lib/steps/index.js.LICENSE.txt +1 -0
  154. package/lib/swiper/index.js +1 -350
  155. package/lib/switcher/index.js +1 -323
  156. package/lib/tab/index.js +1 -918
  157. package/lib/table/index.js +1 -6388
  158. package/lib/table-column/index.js +1 -801
  159. package/lib/tag/index.js +1 -300
  160. package/lib/tag-input/index.js +1 -1757
  161. package/lib/time-picker/index.js +1 -142
  162. package/lib/timeline/index.js +1 -297
  163. package/lib/transfer/index.js +1 -764
  164. package/lib/tree/index.js +1 -2608
  165. package/lib/upload/index.js +2 -3257
  166. package/lib/upload/index.js.LICENSE.txt +1 -0
  167. package/lib/virtual-render/index.js +1 -790
  168. package/package.json +1 -1
@@ -1,2075 +1,2 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("vue-types"), require("../config-provider"), require("../directives"), require("../icon"), require("../popover"), require("../tag"), require("../checkbox"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "vue-types", "../config-provider", "../directives", "../icon", "../popover", "../tag", "../checkbox"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("vue-types"), require("../config-provider"), require("../directives"), require("../icon"), require("../popover"), require("../tag"), require("../checkbox")) : factory(root["../shared"], root["vue"], root["vue-types"], root["../config-provider"], root["../directives"], root["../icon"], root["../popover"], root["../tag"], root["../checkbox"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__2717__, __WEBPACK_EXTERNAL_MODULE__4061__, __WEBPACK_EXTERNAL_MODULE__6870__, __WEBPACK_EXTERNAL_MODULE__5537__, __WEBPACK_EXTERNAL_MODULE__7739__, __WEBPACK_EXTERNAL_MODULE__5800__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ 5800:
15
- /***/ ((module) => {
16
-
17
- "use strict";
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__5800__;
19
-
20
- /***/ }),
21
-
22
- /***/ 2717:
23
- /***/ ((module) => {
24
-
25
- "use strict";
26
- module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
27
-
28
- /***/ }),
29
-
30
- /***/ 4061:
31
- /***/ ((module) => {
32
-
33
- "use strict";
34
- module.exports = __WEBPACK_EXTERNAL_MODULE__4061__;
35
-
36
- /***/ }),
37
-
38
- /***/ 6870:
39
- /***/ ((module) => {
40
-
41
- "use strict";
42
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
43
-
44
- /***/ }),
45
-
46
- /***/ 5537:
47
- /***/ ((module) => {
48
-
49
- "use strict";
50
- module.exports = __WEBPACK_EXTERNAL_MODULE__5537__;
51
-
52
- /***/ }),
53
-
54
- /***/ 4212:
55
- /***/ ((module) => {
56
-
57
- "use strict";
58
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
59
-
60
- /***/ }),
61
-
62
- /***/ 7739:
63
- /***/ ((module) => {
64
-
65
- "use strict";
66
- module.exports = __WEBPACK_EXTERNAL_MODULE__7739__;
67
-
68
- /***/ }),
69
-
70
- /***/ 748:
71
- /***/ ((module) => {
72
-
73
- "use strict";
74
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
75
-
76
- /***/ }),
77
-
78
- /***/ 210:
79
- /***/ ((module) => {
80
-
81
- "use strict";
82
- module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
83
-
84
- /***/ }),
85
-
86
- /***/ 7609:
87
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
88
-
89
- var _typeof = (__webpack_require__(7425)["default"]);
90
- function _regeneratorRuntime() {
91
- "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
92
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
93
- return exports;
94
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
95
- var exports = {},
96
- Op = Object.prototype,
97
- hasOwn = Op.hasOwnProperty,
98
- defineProperty = Object.defineProperty || function (obj, key, desc) {
99
- obj[key] = desc.value;
100
- },
101
- $Symbol = "function" == typeof Symbol ? Symbol : {},
102
- iteratorSymbol = $Symbol.iterator || "@@iterator",
103
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
104
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
105
- function define(obj, key, value) {
106
- return Object.defineProperty(obj, key, {
107
- value: value,
108
- enumerable: !0,
109
- configurable: !0,
110
- writable: !0
111
- }), obj[key];
112
- }
113
- try {
114
- define({}, "");
115
- } catch (err) {
116
- define = function define(obj, key, value) {
117
- return obj[key] = value;
118
- };
119
- }
120
- function wrap(innerFn, outerFn, self, tryLocsList) {
121
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
122
- generator = Object.create(protoGenerator.prototype),
123
- context = new Context(tryLocsList || []);
124
- return defineProperty(generator, "_invoke", {
125
- value: makeInvokeMethod(innerFn, self, context)
126
- }), generator;
127
- }
128
- function tryCatch(fn, obj, arg) {
129
- try {
130
- return {
131
- type: "normal",
132
- arg: fn.call(obj, arg)
133
- };
134
- } catch (err) {
135
- return {
136
- type: "throw",
137
- arg: err
138
- };
139
- }
140
- }
141
- exports.wrap = wrap;
142
- var ContinueSentinel = {};
143
- function Generator() {}
144
- function GeneratorFunction() {}
145
- function GeneratorFunctionPrototype() {}
146
- var IteratorPrototype = {};
147
- define(IteratorPrototype, iteratorSymbol, function () {
148
- return this;
149
- });
150
- var getProto = Object.getPrototypeOf,
151
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
152
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
153
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
154
- function defineIteratorMethods(prototype) {
155
- ["next", "throw", "return"].forEach(function (method) {
156
- define(prototype, method, function (arg) {
157
- return this._invoke(method, arg);
158
- });
159
- });
160
- }
161
- function AsyncIterator(generator, PromiseImpl) {
162
- function invoke(method, arg, resolve, reject) {
163
- var record = tryCatch(generator[method], generator, arg);
164
- if ("throw" !== record.type) {
165
- var result = record.arg,
166
- value = result.value;
167
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
168
- invoke("next", value, resolve, reject);
169
- }, function (err) {
170
- invoke("throw", err, resolve, reject);
171
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
172
- result.value = unwrapped, resolve(result);
173
- }, function (error) {
174
- return invoke("throw", error, resolve, reject);
175
- });
176
- }
177
- reject(record.arg);
178
- }
179
- var previousPromise;
180
- defineProperty(this, "_invoke", {
181
- value: function value(method, arg) {
182
- function callInvokeWithMethodAndArg() {
183
- return new PromiseImpl(function (resolve, reject) {
184
- invoke(method, arg, resolve, reject);
185
- });
186
- }
187
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
188
- }
189
- });
190
- }
191
- function makeInvokeMethod(innerFn, self, context) {
192
- var state = "suspendedStart";
193
- return function (method, arg) {
194
- if ("executing" === state) throw new Error("Generator is already running");
195
- if ("completed" === state) {
196
- if ("throw" === method) throw arg;
197
- return doneResult();
198
- }
199
- for (context.method = method, context.arg = arg;;) {
200
- var delegate = context.delegate;
201
- if (delegate) {
202
- var delegateResult = maybeInvokeDelegate(delegate, context);
203
- if (delegateResult) {
204
- if (delegateResult === ContinueSentinel) continue;
205
- return delegateResult;
206
- }
207
- }
208
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
209
- if ("suspendedStart" === state) throw state = "completed", context.arg;
210
- context.dispatchException(context.arg);
211
- } else "return" === context.method && context.abrupt("return", context.arg);
212
- state = "executing";
213
- var record = tryCatch(innerFn, self, context);
214
- if ("normal" === record.type) {
215
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
216
- return {
217
- value: record.arg,
218
- done: context.done
219
- };
220
- }
221
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
222
- }
223
- };
224
- }
225
- function maybeInvokeDelegate(delegate, context) {
226
- var methodName = context.method,
227
- method = delegate.iterator[methodName];
228
- 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;
229
- var record = tryCatch(method, delegate.iterator, context.arg);
230
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
231
- var info = record.arg;
232
- 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);
233
- }
234
- function pushTryEntry(locs) {
235
- var entry = {
236
- tryLoc: locs[0]
237
- };
238
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
239
- }
240
- function resetTryEntry(entry) {
241
- var record = entry.completion || {};
242
- record.type = "normal", delete record.arg, entry.completion = record;
243
- }
244
- function Context(tryLocsList) {
245
- this.tryEntries = [{
246
- tryLoc: "root"
247
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
248
- }
249
- function values(iterable) {
250
- if (iterable) {
251
- var iteratorMethod = iterable[iteratorSymbol];
252
- if (iteratorMethod) return iteratorMethod.call(iterable);
253
- if ("function" == typeof iterable.next) return iterable;
254
- if (!isNaN(iterable.length)) {
255
- var i = -1,
256
- next = function next() {
257
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
258
- return next.value = undefined, next.done = !0, next;
259
- };
260
- return next.next = next;
261
- }
262
- }
263
- return {
264
- next: doneResult
265
- };
266
- }
267
- function doneResult() {
268
- return {
269
- value: undefined,
270
- done: !0
271
- };
272
- }
273
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
274
- value: GeneratorFunctionPrototype,
275
- configurable: !0
276
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
277
- value: GeneratorFunction,
278
- configurable: !0
279
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
280
- var ctor = "function" == typeof genFun && genFun.constructor;
281
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
282
- }, exports.mark = function (genFun) {
283
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
284
- }, exports.awrap = function (arg) {
285
- return {
286
- __await: arg
287
- };
288
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
289
- return this;
290
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
291
- void 0 === PromiseImpl && (PromiseImpl = Promise);
292
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
293
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
294
- return result.done ? result.value : iter.next();
295
- });
296
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
297
- return this;
298
- }), define(Gp, "toString", function () {
299
- return "[object Generator]";
300
- }), exports.keys = function (val) {
301
- var object = Object(val),
302
- keys = [];
303
- for (var key in object) keys.push(key);
304
- return keys.reverse(), function next() {
305
- for (; keys.length;) {
306
- var key = keys.pop();
307
- if (key in object) return next.value = key, next.done = !1, next;
308
- }
309
- return next.done = !0, next;
310
- };
311
- }, exports.values = values, Context.prototype = {
312
- constructor: Context,
313
- reset: function reset(skipTempReset) {
314
- 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);
315
- },
316
- stop: function stop() {
317
- this.done = !0;
318
- var rootRecord = this.tryEntries[0].completion;
319
- if ("throw" === rootRecord.type) throw rootRecord.arg;
320
- return this.rval;
321
- },
322
- dispatchException: function dispatchException(exception) {
323
- if (this.done) throw exception;
324
- var context = this;
325
- function handle(loc, caught) {
326
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
327
- }
328
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
329
- var entry = this.tryEntries[i],
330
- record = entry.completion;
331
- if ("root" === entry.tryLoc) return handle("end");
332
- if (entry.tryLoc <= this.prev) {
333
- var hasCatch = hasOwn.call(entry, "catchLoc"),
334
- hasFinally = hasOwn.call(entry, "finallyLoc");
335
- if (hasCatch && hasFinally) {
336
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
337
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
338
- } else if (hasCatch) {
339
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
340
- } else {
341
- if (!hasFinally) throw new Error("try statement without catch or finally");
342
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
343
- }
344
- }
345
- }
346
- },
347
- abrupt: function abrupt(type, arg) {
348
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
349
- var entry = this.tryEntries[i];
350
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
351
- var finallyEntry = entry;
352
- break;
353
- }
354
- }
355
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
356
- var record = finallyEntry ? finallyEntry.completion : {};
357
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
358
- },
359
- complete: function complete(record, afterLoc) {
360
- if ("throw" === record.type) throw record.arg;
361
- 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;
362
- },
363
- finish: function finish(finallyLoc) {
364
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
365
- var entry = this.tryEntries[i];
366
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
367
- }
368
- },
369
- "catch": function _catch(tryLoc) {
370
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
371
- var entry = this.tryEntries[i];
372
- if (entry.tryLoc === tryLoc) {
373
- var record = entry.completion;
374
- if ("throw" === record.type) {
375
- var thrown = record.arg;
376
- resetTryEntry(entry);
377
- }
378
- return thrown;
379
- }
380
- }
381
- throw new Error("illegal catch attempt");
382
- },
383
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
384
- return this.delegate = {
385
- iterator: values(iterable),
386
- resultName: resultName,
387
- nextLoc: nextLoc
388
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
389
- }
390
- }, exports;
391
- }
392
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
393
-
394
- /***/ }),
395
-
396
- /***/ 7425:
397
- /***/ ((module) => {
398
-
399
- function _typeof(obj) {
400
- "@babel/helpers - typeof";
401
-
402
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
403
- return typeof obj;
404
- } : function (obj) {
405
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
406
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
407
- }
408
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
409
-
410
- /***/ }),
411
-
412
- /***/ 2841:
413
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
414
-
415
- // TODO(Babel 8): Remove this file.
416
-
417
- var runtime = __webpack_require__(7609)();
418
- module.exports = runtime;
419
-
420
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
421
- try {
422
- regeneratorRuntime = runtime;
423
- } catch (accidentalStrictMode) {
424
- if (typeof globalThis === "object") {
425
- globalThis.regeneratorRuntime = runtime;
426
- } else {
427
- Function("r", "regeneratorRuntime = r")(runtime);
428
- }
429
- }
430
-
431
-
432
- /***/ })
433
-
434
- /******/ });
435
- /************************************************************************/
436
- /******/ // The module cache
437
- /******/ var __webpack_module_cache__ = {};
438
- /******/
439
- /******/ // The require function
440
- /******/ function __webpack_require__(moduleId) {
441
- /******/ // Check if module is in cache
442
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
443
- /******/ if (cachedModule !== undefined) {
444
- /******/ return cachedModule.exports;
445
- /******/ }
446
- /******/ // Create a new module (and put it into the cache)
447
- /******/ var module = __webpack_module_cache__[moduleId] = {
448
- /******/ // no module.id needed
449
- /******/ // no module.loaded needed
450
- /******/ exports: {}
451
- /******/ };
452
- /******/
453
- /******/ // Execute the module function
454
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
455
- /******/
456
- /******/ // Return the exports of the module
457
- /******/ return module.exports;
458
- /******/ }
459
- /******/
460
- /************************************************************************/
461
- /******/ /* webpack/runtime/compat get default export */
462
- /******/ (() => {
463
- /******/ // getDefaultExport function for compatibility with non-harmony modules
464
- /******/ __webpack_require__.n = (module) => {
465
- /******/ var getter = module && module.__esModule ?
466
- /******/ () => (module['default']) :
467
- /******/ () => (module);
468
- /******/ __webpack_require__.d(getter, { a: getter });
469
- /******/ return getter;
470
- /******/ };
471
- /******/ })();
472
- /******/
473
- /******/ /* webpack/runtime/define property getters */
474
- /******/ (() => {
475
- /******/ // define getter functions for harmony exports
476
- /******/ __webpack_require__.d = (exports, definition) => {
477
- /******/ for(var key in definition) {
478
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
479
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
480
- /******/ }
481
- /******/ }
482
- /******/ };
483
- /******/ })();
484
- /******/
485
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
486
- /******/ (() => {
487
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
488
- /******/ })();
489
- /******/
490
- /******/ /* webpack/runtime/make namespace object */
491
- /******/ (() => {
492
- /******/ // define __esModule on exports
493
- /******/ __webpack_require__.r = (exports) => {
494
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
495
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
496
- /******/ }
497
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
498
- /******/ };
499
- /******/ })();
500
- /******/
501
- /************************************************************************/
502
- var __webpack_exports__ = {};
503
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
504
- (() => {
505
- "use strict";
506
- // ESM COMPAT FLAG
507
- __webpack_require__.r(__webpack_exports__);
508
-
509
- // EXPORTS
510
- __webpack_require__.d(__webpack_exports__, {
511
- BkCascader: () => (/* binding */ BkCascader),
512
- BkCascaderPanel: () => (/* reexport */ cascader_panel),
513
- "default": () => (/* binding */ src)
514
- });
515
-
516
- // EXTERNAL MODULE: external "../shared"
517
- var external_shared_ = __webpack_require__(4212);
518
- // EXTERNAL MODULE: external "vue"
519
- var external_vue_ = __webpack_require__(748);
520
- // EXTERNAL MODULE: external "vue-types"
521
- var external_vue_types_ = __webpack_require__(210);
522
- // EXTERNAL MODULE: external "../config-provider"
523
- var external_config_provider_ = __webpack_require__(2717);
524
- // EXTERNAL MODULE: external "../directives"
525
- var external_directives_ = __webpack_require__(4061);
526
- // EXTERNAL MODULE: external "../icon"
527
- var external_icon_ = __webpack_require__(6870);
528
- // EXTERNAL MODULE: external "../popover"
529
- var external_popover_ = __webpack_require__(5537);
530
- var external_popover_default = /*#__PURE__*/__webpack_require__.n(external_popover_);
531
- // EXTERNAL MODULE: external "../tag"
532
- var external_tag_ = __webpack_require__(7739);
533
- var external_tag_default = /*#__PURE__*/__webpack_require__.n(external_tag_);
534
- // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
535
- var regenerator = __webpack_require__(2841);
536
- ;// CONCATENATED MODULE: ../../packages/select/src/common.ts
537
-
538
-
539
- /*
540
- * Tencent is pleased to support the open source community by making
541
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
542
- *
543
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
544
- *
545
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
546
- *
547
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
548
- *
549
- * ---------------------------------------------------
550
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
551
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
552
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
553
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
554
- *
555
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
556
- * the Software.
557
- *
558
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
559
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
560
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
561
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
562
- * IN THE SOFTWARE.
563
- */
564
-
565
-
566
- var selectKey = Symbol('BkSelect');
567
- var optionGroupKey = Symbol('BkOptionGroup');
568
- function useHover() {
569
- var isHover = (0,external_vue_.ref)(false);
570
- var setHover = function setHover() {
571
- isHover.value = true;
572
- };
573
- var cancelHover = function cancelHover() {
574
- isHover.value = false;
575
- };
576
- return {
577
- isHover: isHover,
578
- setHover: setHover,
579
- cancelHover: cancelHover
580
- };
581
- }
582
- function useRegistry(data) {
583
- // 注册item
584
- var register = function register(key, item) {
585
- if (!item) return;
586
- if (data.value.has(key)) {
587
- console.warn("repeat ".concat(key), item);
588
- return;
589
- }
590
- return data.value.set(key, item);
591
- };
592
- // 删除item
593
- var unregister = function unregister(key) {
594
- data.value["delete"](key);
595
- };
596
- return {
597
- register: register,
598
- unregister: unregister
599
- };
600
- }
601
- function useDebouncedRef(value) {
602
- var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
603
- var timeout;
604
- var innerValue = value;
605
- return customRef(function (track, trigger) {
606
- return {
607
- get: function get() {
608
- track();
609
- return innerValue;
610
- },
611
- set: function set(newValue) {
612
- clearTimeout(timeout);
613
- if (newValue === undefined || newValue === '') {
614
- innerValue = newValue;
615
- trigger();
616
- } else {
617
- timeout = setTimeout(function () {
618
- innerValue = newValue;
619
- trigger();
620
- }, delay);
621
- }
622
- }
623
- };
624
- });
625
- }
626
- function usePopover(config, triggerRef) {
627
- var popoverMinWidth = config.popoverMinWidth;
628
- var observerIns = null;
629
- var popperWidth = ref('auto');
630
- var isPopoverShow = ref(false);
631
- var togglePopover = function togglePopover() {
632
- isPopoverShow.value = !isPopoverShow.value;
633
- };
634
- var hidePopover = function hidePopover() {
635
- isPopoverShow.value = false;
636
- };
637
- var showPopover = function showPopover() {
638
- isPopoverShow.value = true;
639
- };
640
- var triggerRefResize = function triggerRefResize() {
641
- var _a;
642
- popperWidth.value = Math.max((_a = triggerRef.value) === null || _a === void 0 ? void 0 : _a.offsetWidth, popoverMinWidth);
643
- };
644
- onMounted(function () {
645
- if (!triggerRef.value) return;
646
- observerIns = observerResize(triggerRef.value, triggerRefResize, 60, true);
647
- observerIns.start();
648
- });
649
- onBeforeUnmount(function () {
650
- observerIns === null || observerIns === void 0 ? void 0 : observerIns.stop();
651
- observerIns = null;
652
- });
653
- return {
654
- isPopoverShow: isPopoverShow,
655
- popperWidth: popperWidth,
656
- togglePopover: togglePopover,
657
- hidePopover: hidePopover,
658
- showPopover: showPopover
659
- };
660
- }
661
- function useRemoteSearch(method, callBack) {
662
- var _this = this;
663
- var searchKey = useDebouncedRef('');
664
- var searchLoading = ref(false);
665
- watch(searchKey, function () {
666
- return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
667
- return _regeneratorRuntime.wrap(function _callee$(_context) {
668
- while (1) switch (_context.prev = _context.next) {
669
- case 0:
670
- _context.prev = 0;
671
- searchLoading.value = true;
672
- _context.next = 4;
673
- return method(searchKey.value);
674
- case 4:
675
- searchLoading.value = false;
676
- _context.next = 10;
677
- break;
678
- case 7:
679
- _context.prev = 7;
680
- _context.t0 = _context["catch"](0);
681
- console.error(_context.t0);
682
- case 10:
683
- _context.prev = 10;
684
- callBack === null || callBack === void 0 ? void 0 : callBack();
685
- return _context.finish(10);
686
- case 13:
687
- case "end":
688
- return _context.stop();
689
- }
690
- }, _callee, null, [[0, 7, 10, 13]]);
691
- }));
692
- });
693
- return {
694
- searchKey: searchKey,
695
- searchLoading: searchLoading
696
- };
697
- }
698
- function toLowerCase() {
699
- var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
700
- if (!value) return value;
701
- return String(value).trim().toLowerCase();
702
- }
703
- ;
704
- ;// CONCATENATED MODULE: ../../packages/tag-input/src/common.ts
705
-
706
- /*
707
- * Tencent is pleased to support the open source community by making
708
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
709
- *
710
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
711
- *
712
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
713
- *
714
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
715
- *
716
- * ---------------------------------------------------
717
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
718
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
719
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
720
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
721
- *
722
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
723
- * the Software.
724
- *
725
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
726
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
727
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
728
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
729
- * IN THE SOFTWARE.
730
- */
731
-
732
- var INPUT_MIN_WIDTH = 12;
733
- function common_useDebouncedRef(value) {
734
- var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
735
- var timeout;
736
- var innerValue = value;
737
- return customRef(function (track, trigger) {
738
- return {
739
- get: function get() {
740
- track();
741
- return innerValue;
742
- },
743
- set: function set(newValue) {
744
- clearTimeout(timeout);
745
- timeout = setTimeout(function () {
746
- innerValue = newValue;
747
- trigger();
748
- }, delay);
749
- }
750
- };
751
- });
752
- }
753
- function usePage(pageSize) {
754
- var state = reactive({
755
- curPage: 1,
756
- totalSize: 0,
757
- totalPage: 0,
758
- pageSize: pageSize,
759
- isPageLoading: false,
760
- curPageList: [],
761
- renderListPaged: []
762
- });
763
- // 初始化分页信息
764
- var initPage = function initPage() {
765
- var _state$renderListPage, _state$curPageList;
766
- var allList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
767
- state.curPage = 1;
768
- state.totalSize = allList.length;
769
- state.totalPage = Math.ceil(state.totalSize / state.pageSize) || 1;
770
- var list = [];
771
- // 小于等于0会无限循环
772
- if (state.pageSize > 0) {
773
- for (var i = 0; i < state.totalSize; i += state.pageSize) {
774
- list.push(allList.slice(i, i + state.pageSize));
775
- }
776
- }
777
- (_state$renderListPage = state.renderListPaged).splice.apply(_state$renderListPage, [0, state.renderListPaged.length].concat(list));
778
- (_state$curPageList = state.curPageList).splice.apply(_state$curPageList, [0, state.curPageList.length].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
779
- };
780
- var pageChange = function pageChange(page) {
781
- var _state$curPageList2;
782
- state.curPage = page;
783
- (_state$curPageList2 = state.curPageList).splice.apply(_state$curPageList2, [state.curPageList.length, 0].concat(_toConsumableArray(state.renderListPaged[state.curPage - 1] || [])));
784
- state.isPageLoading = false;
785
- };
786
- return {
787
- pageState: state,
788
- initPage: initPage,
789
- pageChange: pageChange
790
- };
791
- }
792
- function useFlatList(props) {
793
- var _toRefs = toRefs(props),
794
- useGroup = _toRefs.useGroup,
795
- saveKey = _toRefs.saveKey,
796
- displayKey = _toRefs.displayKey,
797
- list = _toRefs.list;
798
- var flatList = ref([]);
799
- var saveKeyMap = ref({});
800
- watch([useGroup, saveKey, displayKey, list], function () {
801
- flatList.value = [];
802
- var formatList = markRaw(list.value);
803
- if (useGroup.value) {
804
- formatList = formatList.reduce(function (formatList, item) {
805
- var children = [];
806
- if (item.children) {
807
- children = item.children.map(function (child) {
808
- return Object.assign({
809
- group: {
810
- groupId: item[saveKey.value],
811
- groupName: item[displayKey.value]
812
- }
813
- }, child);
814
- });
815
- }
816
- return formatList.concat(children);
817
- }, []);
818
- }
819
- flatList.value = formatList;
820
- saveKeyMap.value = formatList.reduce(function (acc, item) {
821
- acc[item[saveKey.value]] = item;
822
- return acc;
823
- }, {});
824
- }, {
825
- immediate: true,
826
- deep: true
827
- });
828
- return {
829
- flatList: flatList,
830
- saveKeyMap: saveKeyMap
831
- };
832
- }
833
- /**
834
- * 获取字符长度,汉字两个字节
835
- * @param str 需要计算长度的字符
836
- * @returns 字符长度
837
- */
838
- var getCharLength = function getCharLength(str) {
839
- var len = str.length;
840
- var bitLen = 0;
841
- for (var i = 0; i < len; i++) {
842
- if ((str.charCodeAt(i) & 0xff00) !== 0) {
843
- bitLen += 1;
844
- }
845
- bitLen += 1;
846
- }
847
- return bitLen;
848
- };
849
- /**
850
- * 获取隐藏 tag index
851
- * @param tagInputRef 组件容器 ref
852
- * @param collapseTags 是否折叠 tags
853
- * @param selectedTagList 已选择 tags
854
- */
855
- var useTagsOverflow = function useTagsOverflow(tagInputRef, collapseTags, selectedTagList) {
856
- (0,external_vue_.watch)([selectedTagList, collapseTags], function () {
857
- calcOverflow();
858
- }, {
859
- flush: 'post'
860
- });
861
- var overflowTagIndex = (0,external_vue_.ref)(null);
862
- // 计算出现换行的索引
863
- var calcOverflow = function calcOverflow() {
864
- if (!collapseTags.value) return;
865
- overflowTagIndex.value = null;
866
- setTimeout(function () {
867
- var tags = Array.from(tagInputRef.value.querySelectorAll('.tag-item'));
868
- var tagIndexInSecondRow = tags.findIndex(function (currentTag, index) {
869
- if (!index) {
870
- return false;
871
- }
872
- var previousTag = tags[index - 1];
873
- return previousTag.offsetTop !== currentTag.offsetTop;
874
- });
875
- overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow - 1 : null;
876
- });
877
- };
878
- return {
879
- overflowTagIndex: overflowTagIndex
880
- };
881
- };
882
- // EXTERNAL MODULE: external "../checkbox"
883
- var external_checkbox_ = __webpack_require__(5800);
884
- var external_checkbox_default = /*#__PURE__*/__webpack_require__.n(external_checkbox_);
885
- ;// CONCATENATED MODULE: ../../packages/cascader/src/cascader-panel.tsx
886
-
887
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
888
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
889
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
890
- /*
891
- * Tencent is pleased to support the open source community by making
892
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
893
- *
894
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
895
- *
896
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
897
- *
898
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
899
- *
900
- * ---------------------------------------------------
901
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
902
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
903
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
904
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
905
- *
906
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
907
- * the Software.
908
- *
909
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
910
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
911
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
912
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
913
- * IN THE SOFTWARE.
914
- */
915
-
916
-
917
-
918
-
919
-
920
-
921
- /* harmony default export */ const cascader_panel = ((0,external_vue_.defineComponent)({
922
- name: 'CascaderPanel',
923
- props: {
924
- width: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def('auto'),
925
- height: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(216),
926
- store: external_shared_.PropTypes.object.def({}),
927
- separator: external_shared_.PropTypes.string.def(''),
928
- suggestions: external_shared_.PropTypes.arrayOf((0,external_vue_types_.object)()),
929
- isFiltering: external_shared_.PropTypes.bool.def(false),
930
- searchKey: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string, external_shared_.PropTypes.number]).def(''),
931
- modelValue: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.oneOfType([(0,external_vue_types_.array)(), String, Number]))
932
- },
933
- emits: ['update:modelValue'],
934
- setup: function setup(props, _ref) {
935
- var emit = _ref.emit;
936
- var t = (0,external_config_provider_.useLocale)('select');
937
- var store = props.store;
938
- var menus = (0,external_vue_.reactive)({
939
- list: [props.store.getNodes()]
940
- });
941
- var activePath = (0,external_vue_.ref)([]);
942
- var checkValue = (0,external_vue_.ref)([]);
943
- var getSizeComputed = function getSizeComputed(value) {
944
- if (typeof value === 'number') {
945
- return "".concat(value, "px");
946
- }
947
- return value;
948
- };
949
- var panelHeight = getSizeComputed(props.height);
950
- var panelWidth = getSizeComputed(props.width);
951
- var updateCheckValue = function updateCheckValue(value) {
952
- if (value.length === 0) {
953
- menus.list = menus.list.slice(0, 1);
954
- activePath.value = [];
955
- }
956
- expandByNodeList(value);
957
- checkValue.value = value;
958
- };
959
- var expandByNodeList = function expandByNodeList(value) {
960
- var targetList = [];
961
- // 如果配置了多选,找出最长的序列,即其最远的路径,以展开所有面板
962
- if (store.config.multiple) {
963
- var _iterator = _createForOfIteratorHelper(value),
964
- _step;
965
- try {
966
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
967
- var subArray = _step.value;
968
- if (subArray.length > targetList.length) {
969
- targetList = subArray;
970
- }
971
- }
972
- } catch (err) {
973
- _iterator.e(err);
974
- } finally {
975
- _iterator.f();
976
- }
977
- } else {
978
- targetList = value;
979
- }
980
- // 遍历最长路径的节点,如果节点有children,展开子面板
981
- targetList.forEach(function (id) {
982
- var node = store.getNodeById(id);
983
- nodeExpandHandler(node);
984
- });
985
- };
986
- /** 节点选中回调
987
- * 根据单选、多选配置checkValue
988
- * 派发事件,更新选中值
989
- */
990
- var nodeCheckHandler = function nodeCheckHandler(node) {
991
- if (node.isDisabled) {
992
- return;
993
- }
994
- if (node.config.multiple) {
995
- // 如果checkAnyLevel,返回所有check的节点; 否则只check 叶子节点
996
- var targets = store.config.checkAnyLevel ? store.getCheckedNodes() : store.getCheckedLeafNodes();
997
- checkValue.value = targets.map(function (node) {
998
- return node.path;
999
- }); // 如果任意级别可选,当前节点即为所选内容
1000
- } else {
1001
- checkValue.value = node.path;
1002
- }
1003
- emit('update:modelValue', checkValue.value);
1004
- };
1005
- /** node点击展开回调 */
1006
- var nodeExpandHandler = function nodeExpandHandler(node) {
1007
- var _a;
1008
- if (!node || (node === null || node === void 0 ? void 0 : node.isDisabled)) return;
1009
- menus.list = menus.list.slice(0, node.level);
1010
- activePath.value = activePath.value.slice(0, node.level - 1);
1011
- /** 如果所点击的node具有children元素,则直接展开
1012
- * 否则判断是否开启了远程加载,进行远程加载列表
1013
- */
1014
- if ((_a = node.children) === null || _a === void 0 ? void 0 : _a.length) {
1015
- menus.list.push(node.children);
1016
- activePath.value.push(node);
1017
- return;
1018
- }
1019
- if (store.config.isRemote && !node.isLeaf) {
1020
- node.loading = true;
1021
- var updateNodes = function updateNodes(nodeData) {
1022
- store.appendNodes(nodeData, node || null);
1023
- menus.list.push(node.children);
1024
- activePath.value.push(node);
1025
- node.loading = false;
1026
- };
1027
- store.config.remoteMethod(node, updateNodes);
1028
- }
1029
- };
1030
- var nodeEvent = function nodeEvent(node) {
1031
- var _node$config = node.config,
1032
- trigger = _node$config.trigger,
1033
- checkAnyLevel = _node$config.checkAnyLevel,
1034
- multiple = _node$config.multiple;
1035
- var events = {
1036
- onClick: function onClick(e) {
1037
- if (!node.isLeaf || multiple) e.stopPropagation();
1038
- trigger === 'click' && nodeExpandHandler(node);
1039
- checkAnyLevel && !multiple && nodeCheckHandler(node);
1040
- node.isLeaf && !multiple && nodeCheckHandler(node);
1041
- },
1042
- onMouseenter: function onMouseenter() {
1043
- trigger === 'hover' && nodeExpandHandler(node);
1044
- }
1045
- };
1046
- return events;
1047
- };
1048
- var searchPanelEvents = function searchPanelEvents(node) {
1049
- var multiple = node.config.multiple;
1050
- var events = {
1051
- onClick: function onClick(e) {
1052
- if (multiple) {
1053
- e.stopPropagation();
1054
- checkNode(node, !node.checked);
1055
- return;
1056
- }
1057
- nodeExpandHandler(node);
1058
- node.isLeaf && !multiple && nodeCheckHandler(node);
1059
- }
1060
- };
1061
- return events;
1062
- };
1063
- var noDataText = t.value.noData;
1064
- var isNodeInPath = function isNodeInPath(node) {
1065
- var currentLevel = activePath.value[node.level - 1] || {};
1066
- return currentLevel.id === node.id;
1067
- };
1068
- var isCheckedNode = function isCheckedNode(node, checkValue) {
1069
- var multiple = node.config.multiple;
1070
- if (multiple) {
1071
- return checkValue.some(function (val) {
1072
- return (0,external_shared_.arrayEqual)(val, node.path);
1073
- });
1074
- }
1075
- return (0,external_shared_.arrayEqual)(checkValue, node.path);
1076
- };
1077
- /** 多选节点checkbox点击的回调 */
1078
- var checkNode = function checkNode(node, value) {
1079
- node.setNodeCheck(value ? value : false);
1080
- nodeCheckHandler(node);
1081
- };
1082
- var iconRender = function iconRender(node) {
1083
- return node.loading ? (0,external_vue_.createVNode)(external_icon_.Spinner, {
1084
- "class": "icon-spinner"
1085
- }, null) : (0,external_vue_.createVNode)(external_icon_.AngleRight, {
1086
- "class": "icon-angle-right"
1087
- }, null);
1088
- };
1089
- (0,external_vue_.watch)(function () {
1090
- return props.modelValue;
1091
- }, function (value) {
1092
- updateCheckValue(value);
1093
- }, {
1094
- immediate: true
1095
- });
1096
- (0,external_vue_.watch)(function () {
1097
- return props.store;
1098
- }, function (value) {
1099
- menus.list = [value.getNodes()];
1100
- });
1101
- return {
1102
- menus: menus,
1103
- activePath: activePath,
1104
- nodeExpandHandler: nodeExpandHandler,
1105
- isNodeInPath: isNodeInPath,
1106
- nodeEvent: nodeEvent,
1107
- isCheckedNode: isCheckedNode,
1108
- checkValue: checkValue,
1109
- checkNode: checkNode,
1110
- iconRender: iconRender,
1111
- panelWidth: panelWidth,
1112
- panelHeight: panelHeight,
1113
- searchPanelEvents: searchPanelEvents,
1114
- expandByNodeList: expandByNodeList,
1115
- noDataText: noDataText
1116
- };
1117
- },
1118
- render: function render() {
1119
- var _this = this;
1120
- var emptyWidth = parseInt(this.panelWidth, 10) > 200 ? this.panelWidth : "".concat(200, "px");
1121
- var searchPanelRender = function searchPanelRender() {
1122
- return _this.suggestions.length ? (0,external_vue_.createVNode)("ul", {
1123
- "class": [(0,external_shared_.resolveClassName)('cascader-panel'), 'bk-scroll-y'],
1124
- "style": {
1125
- height: _this.panelHeight,
1126
- width: _this.panelWidth
1127
- }
1128
- }, [_this.suggestions.map(function (node) {
1129
- return (0,external_vue_.createVNode)("li", (0,external_vue_.mergeProps)({
1130
- "class": [(0,external_shared_.resolveClassName)('cascader-node'), {
1131
- 'is-selected': _this.isNodeInPath(node)
1132
- }, {
1133
- 'is-disabled': node.isDisabled
1134
- }, {
1135
- 'is-checked': _this.isCheckedNode(node, _this.checkValue)
1136
- }]
1137
- }, _this.searchPanelEvents(node)), [node.pathNames.join(_this.separator)]);
1138
- })]) : (0,external_vue_.createVNode)("div", {
1139
- "class": (0,external_shared_.resolveClassName)('cascader-search-empty'),
1140
- "style": {
1141
- width: emptyWidth
1142
- }
1143
- }, [(0,external_vue_.createVNode)("span", null, [(0,external_vue_.createTextVNode)("\u6682\u65E0\u641C\u7D22\u7ED3\u679C")])]);
1144
- };
1145
- return (0,external_vue_.createVNode)("div", {
1146
- "class": (0,external_shared_.resolveClassName)('cascader-panel-wrapper')
1147
- }, [this.isFiltering ? searchPanelRender() : this.menus.list.map(function (menu) {
1148
- return (0,external_vue_.createVNode)("ul", {
1149
- "class": [(0,external_shared_.resolveClassName)('cascader-panel'), 'bk-scroll-y'],
1150
- "style": {
1151
- height: _this.panelHeight,
1152
- width: _this.panelWidth
1153
- }
1154
- }, [menu.length ? menu.map(function (node) {
1155
- var _a, _b;
1156
- return (0,external_vue_.createVNode)("li", (0,external_vue_.mergeProps)({
1157
- "class": [(0,external_shared_.resolveClassName)('cascader-node'), {
1158
- 'is-selected': _this.isNodeInPath(node)
1159
- }, {
1160
- 'is-disabled': node.isDisabled
1161
- }, {
1162
- 'is-checked': !node.config.multiple && _this.isCheckedNode(node, _this.checkValue)
1163
- }]
1164
- }, Object.assign(_this.nodeEvent(node), node.config.multiple ? {} : {})), [node.config.multiple && (0,external_vue_.createVNode)((external_checkbox_default()), {
1165
- "disabled": node.isDisabled,
1166
- "modelValue": node.checked,
1167
- "onUpdate:modelValue": function onUpdateModelValue($event) {
1168
- return node.checked = $event;
1169
- },
1170
- "indeterminate": node.isIndeterminate,
1171
- "style": "margin-right: 5px",
1172
- "onChange": function onChange(val) {
1173
- return _this.checkNode(node, val);
1174
- }
1175
- }, null), (_b = (_a = _this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a, {
1176
- node: node,
1177
- data: node.data
1178
- }), !node.isLeaf ? _this.iconRender(node) : '']);
1179
- }) : (0,external_vue_.createVNode)("div", {
1180
- "class": (0,external_shared_.resolveClassName)('cascader-panel-empty-wrapper')
1181
- }, [_this.noDataText])]);
1182
- })]);
1183
- }
1184
- }));
1185
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
1186
- function _classCallCheck(instance, Constructor) {
1187
- if (!(instance instanceof Constructor)) {
1188
- throw new TypeError("Cannot call a class as a function");
1189
- }
1190
- }
1191
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
1192
- function _typeof(obj) {
1193
- "@babel/helpers - typeof";
1194
-
1195
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1196
- return typeof obj;
1197
- } : function (obj) {
1198
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1199
- }, _typeof(obj);
1200
- }
1201
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
1202
-
1203
- function _toPrimitive(input, hint) {
1204
- if (_typeof(input) !== "object" || input === null) return input;
1205
- var prim = input[Symbol.toPrimitive];
1206
- if (prim !== undefined) {
1207
- var res = prim.call(input, hint || "default");
1208
- if (_typeof(res) !== "object") return res;
1209
- throw new TypeError("@@toPrimitive must return a primitive value.");
1210
- }
1211
- return (hint === "string" ? String : Number)(input);
1212
- }
1213
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
1214
-
1215
-
1216
- function _toPropertyKey(arg) {
1217
- var key = _toPrimitive(arg, "string");
1218
- return _typeof(key) === "symbol" ? key : String(key);
1219
- }
1220
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
1221
-
1222
- function _defineProperties(target, props) {
1223
- for (var i = 0; i < props.length; i++) {
1224
- var descriptor = props[i];
1225
- descriptor.enumerable = descriptor.enumerable || false;
1226
- descriptor.configurable = true;
1227
- if ("value" in descriptor) descriptor.writable = true;
1228
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
1229
- }
1230
- }
1231
- function _createClass(Constructor, protoProps, staticProps) {
1232
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1233
- if (staticProps) _defineProperties(Constructor, staticProps);
1234
- Object.defineProperty(Constructor, "prototype", {
1235
- writable: false
1236
- });
1237
- return Constructor;
1238
- }
1239
- ;// CONCATENATED MODULE: ../../packages/cascader/src/node.ts
1240
-
1241
-
1242
- /*
1243
- * Tencent is pleased to support the open source community by making
1244
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1245
- *
1246
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1247
- *
1248
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1249
- *
1250
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1251
- *
1252
- * ---------------------------------------------------
1253
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1254
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1255
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1256
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1257
- *
1258
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1259
- * the Software.
1260
- *
1261
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1262
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1263
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1264
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1265
- * IN THE SOFTWARE.
1266
- */
1267
-
1268
- ;
1269
- /** 除了节点本身的disabled,如果父级是disabled,直接点也必须是disabled */
1270
- function isNodeDisabled(node) {
1271
- if (node.data.disabled) {
1272
- return true;
1273
- }
1274
- if (node.level !== 1) {
1275
- return isNodeDisabled(node.parent);
1276
- }
1277
- return node.data.disabled;
1278
- }
1279
- // 定义节点类实现INode接口
1280
- var Node = /*#__PURE__*/function () {
1281
- function Node(node, config, parent) {
1282
- _classCallCheck(this, Node);
1283
- this.data = node;
1284
- this.config = config;
1285
- this.parent = parent || null;
1286
- this.leaf = node.leaf;
1287
- this.level = !this.parent ? 1 : this.parent.level + 1;
1288
- this.initState();
1289
- }
1290
- // 初始化节点状态
1291
- _createClass(Node, [{
1292
- key: "initState",
1293
- value: function initState() {
1294
- var _this = this;
1295
- var _this$config = this.config,
1296
- idKey = _this$config.idKey,
1297
- nameKey = _this$config.nameKey,
1298
- childrenKey = _this$config.childrenKey;
1299
- this.id = this.data[idKey];
1300
- this.name = this.data[nameKey];
1301
- this.loading = false;
1302
- this.loaded = false;
1303
- this.checked = false;
1304
- var childrenData = this.data[childrenKey];
1305
- this.children = (childrenData || []).map(function (child) {
1306
- return new Node(child, _this.config, _this);
1307
- });
1308
- this.pathNodes = this.calculateNodesPath();
1309
- this.path = this.pathNodes.map(function (node) {
1310
- return node.id;
1311
- });
1312
- this.pathNames = this.pathNodes.map(function (node) {
1313
- return node.name;
1314
- });
1315
- }
1316
- // 判断是否是叶子节点
1317
- }, {
1318
- key: "isLeaf",
1319
- get: function get() {
1320
- var _a;
1321
- if (this.config.isRemote) {
1322
- var isLeaf = this.leaf || (this.loaded ? !this.children.length : false);
1323
- return isLeaf;
1324
- }
1325
- return !(Array.isArray(this.children) && ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) !== 0);
1326
- }
1327
- // 判断节点是否被禁用
1328
- }, {
1329
- key: "isDisabled",
1330
- get: function get() {
1331
- return isNodeDisabled(this);
1332
- }
1333
- // 向子节点广播事件
1334
- }, {
1335
- key: "broadcast",
1336
- value: function broadcast(event, checkStatus) {
1337
- var handlerName = "onParent".concat((0,external_shared_.capitalize)(event));
1338
- this.children.forEach(function (child) {
1339
- var _a;
1340
- if (child) {
1341
- // 自底向上广播事件
1342
- child.broadcast(event, checkStatus);
1343
- (_a = child[handlerName]) === null || _a === void 0 ? void 0 : _a.call(child, checkStatus);
1344
- }
1345
- });
1346
- }
1347
- // 向父节点发送事件
1348
- }, {
1349
- key: "emit",
1350
- value: function emit(event) {
1351
- var _a;
1352
- var parent = this.parent;
1353
- var handlerName = "onChild".concat((0,external_shared_.capitalize)(event));
1354
- if (parent) {
1355
- (_a = parent[handlerName]) === null || _a === void 0 ? void 0 : _a.call(parent);
1356
- parent.emit(event);
1357
- }
1358
- }
1359
- // 处理父节点的选中状态变化
1360
- }, {
1361
- key: "onParentCheck",
1362
- value: function onParentCheck(checked) {
1363
- if (!this.isDisabled) {
1364
- this.setCheckState(checked);
1365
- }
1366
- }
1367
- // 处理子节点的选中状态变化
1368
- }, {
1369
- key: "onChildCheck",
1370
- value: function onChildCheck() {
1371
- var children = this.children;
1372
- var validChildren = children.filter(function (child) {
1373
- return !child.isDisabled;
1374
- });
1375
- var checked = validChildren.length ? validChildren.every(function (child) {
1376
- return child.checked;
1377
- }) : false;
1378
- this.setCheckState(checked);
1379
- }
1380
- // 设置节点的选中状态
1381
- }, {
1382
- key: "setCheckState",
1383
- value: function setCheckState(checked) {
1384
- var totalNum = this.children.length;
1385
- var checkedNum = this.children.reduce(function (c, p) {
1386
- var tempNum = p.isIndeterminate ? 0.5 : 0;
1387
- var num = p.checked ? 1 : tempNum;
1388
- return c + num;
1389
- }, 0);
1390
- this.checked = checked;
1391
- this.isIndeterminate = checkedNum !== totalNum && checkedNum > 0;
1392
- }
1393
- // 设置节点及其子节点的选中状态
1394
- }, {
1395
- key: "setNodeCheck",
1396
- value: function setNodeCheck(status) {
1397
- if (this.config.checkAnyLevel) {
1398
- this.checked = status;
1399
- return;
1400
- }
1401
- this.broadcast('check', status);
1402
- this.setCheckState(status);
1403
- this.emit('check');
1404
- }
1405
- // 计算节点路径上的所有节点
1406
- }, {
1407
- key: "calculateNodesPath",
1408
- value: function calculateNodesPath() {
1409
- var nodes = [this];
1410
- var parent = this.parent;
1411
- while (parent) {
1412
- nodes.unshift(parent);
1413
- parent = parent.parent;
1414
- }
1415
- return nodes;
1416
- }
1417
- }]);
1418
- return Node;
1419
- }();
1420
- /* harmony default export */ const src_node = (Node);
1421
- ;// CONCATENATED MODULE: ../../packages/cascader/src/store.ts
1422
-
1423
-
1424
- /*
1425
- * Tencent is pleased to support the open source community by making
1426
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1427
- *
1428
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1429
- *
1430
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1431
- *
1432
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1433
- *
1434
- * ---------------------------------------------------
1435
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1436
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1437
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1438
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1439
- *
1440
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1441
- * the Software.
1442
- *
1443
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1444
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1445
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1446
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1447
- * IN THE SOFTWARE.
1448
- */
1449
-
1450
-
1451
- var flatNodes = function flatNodes(data, leafOnly) {
1452
- return data.reduce(function (acc, node) {
1453
- if (node.isLeaf) {
1454
- acc.push(node);
1455
- } else {
1456
- !leafOnly && acc.push(node);
1457
- // eslint-disable-next-line no-param-reassign
1458
- acc = acc.concat(flatNodes(node.children, leafOnly));
1459
- }
1460
- return acc;
1461
- }, []);
1462
- };
1463
- var Store = /*#__PURE__*/function () {
1464
- function Store(props) {
1465
- var _this = this;
1466
- _classCallCheck(this, Store);
1467
- var list = props.list;
1468
- this.data = list;
1469
- this.config = props;
1470
- this.nodes = this.data.map(function (node) {
1471
- return new src_node(node, _this.config);
1472
- });
1473
- }
1474
- _createClass(Store, [{
1475
- key: "getNodes",
1476
- value: function getNodes() {
1477
- return this.nodes;
1478
- }
1479
- /** 清空所有checked */
1480
- }, {
1481
- key: "clearChecked",
1482
- value: function clearChecked() {
1483
- this.getFlattedNodes().forEach(function (node) {
1484
- node.setNodeCheck(false);
1485
- node.isIndeterminate = false;
1486
- });
1487
- }
1488
- /** 移除某一个Tag的check状态 */
1489
- }, {
1490
- key: "removeTag",
1491
- value: function removeTag(tag) {
1492
- this.getFlattedNodes().find(function (node) {
1493
- if ((0,external_shared_.arrayEqual)(tag, node.path)) {
1494
- node.setNodeCheck(false);
1495
- return true;
1496
- }
1497
- return false;
1498
- });
1499
- }
1500
- /** 拍平节点,方便筛选 */
1501
- }, {
1502
- key: "getFlattedNodes",
1503
- value: function getFlattedNodes() {
1504
- var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1505
- return flatNodes(this.nodes, leafOnly);
1506
- }
1507
- /** 根据传入节点设置节点check状态 */
1508
- }, {
1509
- key: "setNodesCheck",
1510
- value: function setNodesCheck(nodes) {
1511
- var _this2 = this;
1512
- this.getFlattedNodes().forEach(function (node) {
1513
- node.setNodeCheck(false);
1514
- var checkedNode = nodes.find(function (nodeValue) {
1515
- return (0,external_shared_.arrayEqual)(node.path, nodeValue);
1516
- });
1517
- if (checkedNode) {
1518
- var currentNode = _this2.getNodeByValue(checkedNode);
1519
- currentNode.setNodeCheck(true);
1520
- }
1521
- });
1522
- }
1523
- /** 获取多选下,被选中(checked)的节点 */
1524
- }, {
1525
- key: "getCheckedNodes",
1526
- value: function getCheckedNodes() {
1527
- return this.getFlattedNodes().filter(function (node) {
1528
- return node.checked;
1529
- });
1530
- }
1531
- /** 获取多选下,被选中(checked),且为叶子节点的节点 */
1532
- }, {
1533
- key: "getCheckedLeafNodes",
1534
- value: function getCheckedLeafNodes() {
1535
- return this.getFlattedNodes().filter(function (node) {
1536
- return node.isLeaf && node.checked;
1537
- });
1538
- }
1539
- /** 根据值获得node实例 */
1540
- }, {
1541
- key: "getNodeByValue",
1542
- value: function getNodeByValue(value) {
1543
- var _a;
1544
- var nodes = this.getFlattedNodes().filter(function (node) {
1545
- return (0,external_shared_.arrayEqual)(node.path, value);
1546
- });
1547
- return (_a = nodes[0]) !== null && _a !== void 0 ? _a : null;
1548
- }
1549
- }, {
1550
- key: "getNodeById",
1551
- value: function getNodeById(id) {
1552
- return this.getFlattedNodes().find(function (node) {
1553
- return node.id === id;
1554
- });
1555
- }
1556
- /** 插入单个节点 */
1557
- }, {
1558
- key: "appendNode",
1559
- value: function appendNode(nodeData, parentNode) {
1560
- var node = new src_node(nodeData, this.config, parentNode);
1561
- var children = parentNode ? parentNode.children : this.nodes;
1562
- children.push(node);
1563
- }
1564
- }, {
1565
- key: "appendNodes",
1566
- value: function appendNodes(nodeDataList, parentNode) {
1567
- var _this3 = this;
1568
- nodeDataList.forEach(function (node) {
1569
- return _this3.appendNode(node, parentNode);
1570
- });
1571
- }
1572
- }]);
1573
- return Store;
1574
- }();
1575
- /* harmony default export */ const src_store = (Store);
1576
- ;// CONCATENATED MODULE: ../../packages/cascader/src/cascader.tsx
1577
-
1578
- /*
1579
- * Tencent is pleased to support the open source community by making
1580
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1581
- *
1582
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
1583
- *
1584
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1585
- *
1586
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1587
- *
1588
- * ---------------------------------------------------
1589
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1590
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1591
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1592
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1593
- *
1594
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1595
- * the Software.
1596
- *
1597
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1598
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1599
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1600
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1601
- * IN THE SOFTWARE.
1602
- */
1603
-
1604
-
1605
-
1606
-
1607
-
1608
-
1609
-
1610
-
1611
-
1612
-
1613
-
1614
-
1615
- /* harmony default export */ const cascader = ((0,external_vue_.defineComponent)({
1616
- name: 'Cascader',
1617
- directives: {
1618
- bkTooltips: external_directives_.bkTooltips
1619
- },
1620
- components: {
1621
- CascaderPanel: cascader_panel,
1622
- BkPopover: (external_popover_default()),
1623
- Tag: (external_tag_default())
1624
- },
1625
- props: {
1626
- modelValue: external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.oneOfType([(0,external_vue_types_.array)(), String, Number])),
1627
- list: external_shared_.PropTypes.array.def([]),
1628
- placeholder: external_shared_.PropTypes.string.def(''),
1629
- behavior: external_shared_.PropTypes.string.def('normal'),
1630
- filterable: external_shared_.PropTypes.bool.def(false),
1631
- multiple: external_shared_.PropTypes.bool.def(false),
1632
- disabled: external_shared_.PropTypes.bool.def(false),
1633
- clearable: external_shared_.PropTypes.bool.def(true),
1634
- trigger: external_shared_.PropTypes.string.def('click'),
1635
- checkAnyLevel: external_shared_.PropTypes.bool.def(false),
1636
- isRemote: external_shared_.PropTypes.bool.def(false),
1637
- remoteMethod: external_shared_.PropTypes.func,
1638
- showCompleteName: external_shared_.PropTypes.bool.def(true),
1639
- idKey: external_shared_.PropTypes.string.def('id'),
1640
- nameKey: external_shared_.PropTypes.string.def('name'),
1641
- childrenKey: external_shared_.PropTypes.string.def('children'),
1642
- separator: external_shared_.PropTypes.string.def('/'),
1643
- limitOneLine: external_shared_.PropTypes.bool.def(false),
1644
- extCls: external_shared_.PropTypes.string.def(''),
1645
- filterMethod: external_shared_.PropTypes.func.def(null),
1646
- scrollHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def(216),
1647
- scrollWidth: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.string]).def('auto'),
1648
- collapseTags: {
1649
- type: Boolean,
1650
- "default": true
1651
- },
1652
- floatMode: {
1653
- type: Boolean,
1654
- "default": false
1655
- }
1656
- },
1657
- emits: ['update:modelValue', 'change', 'clear', 'toggle', 'focus'],
1658
- setup: function setup(props, _ref) {
1659
- var emit = _ref.emit,
1660
- slots = _ref.slots;
1661
- var t = (0,external_config_provider_.useLocale)('select');
1662
- var separator = props.separator,
1663
- multiple = props.multiple;
1664
- // 用useHover自定义hook来处理鼠标hover状态
1665
- var _useHover = useHover(),
1666
- isHover = _useHover.isHover,
1667
- setHover = _useHover.setHover,
1668
- cancelHover = _useHover.cancelHover;
1669
- var store = (0,external_vue_.ref)(new src_store(props));
1670
- // 定义selectedText变量用于记录当前选择的值的文本
1671
- var selectedText = (0,external_vue_.ref)('');
1672
- // 定义selectedTags变量用于记录多选模式下已选的tag
1673
- var selectedTags = (0,external_vue_.ref)([]);
1674
- var _toRefs = (0,external_vue_.toRefs)(props),
1675
- modelValue = _toRefs.modelValue;
1676
- // 定义cascaderPanel 引用
1677
- var cascaderPanel = (0,external_vue_.ref)();
1678
- // 定义searchKey变量,支持搜索时,搜索框绑定变量
1679
- var searchKey = (0,external_vue_.ref)('');
1680
- // 定义suggestions变量,搜索功能打开时,面板给出的列表
1681
- var suggestions = (0,external_vue_.ref)([]);
1682
- // 定义isFiltering变量,记录是否正在搜索,过滤
1683
- var isFiltering = (0,external_vue_.ref)(false);
1684
- // 定义isEdit变量,记录是否处于编辑状态
1685
- var isEdit = (0,external_vue_.ref)(false);
1686
- // 定义isFocus变量,记录是否处于焦点状态
1687
- var isFocus = (0,external_vue_.ref)(false);
1688
- // 用computed定义checkedValue变量,用于监听modelValue的变化
1689
- var checkedValue = (0,external_vue_.computed)({
1690
- get: function get() {
1691
- return modelValue.value;
1692
- },
1693
- set: function set(value) {
1694
- emit('update:modelValue', value);
1695
- }
1696
- });
1697
- // 定义popover变量
1698
- var popover = (0,external_vue_.ref)(null);
1699
- // 定义bkCascaderRef和inputRef变量
1700
- var bkCascaderRef = (0,external_vue_.ref)(null);
1701
- var inputRef = (0,external_vue_.ref)(null);
1702
- // 用computed定义placeholder变量,用于处理props中的placeholder属性
1703
- var placeholder = (0,external_vue_.computed)(function () {
1704
- return props.placeholder ? props.placeholder : t.value.pleaseSelect;
1705
- });
1706
- // 根据配置,获取输入框显示的text
1707
- var getShowText = function getShowText(node) {
1708
- return props.showCompleteName ? node.pathNames.join(separator) : node.pathNames[node.pathNames.length - 1];
1709
- };
1710
- // 更新搜索框的值
1711
- var updateSearchKey = function updateSearchKey() {
1712
- searchKey.value = selectedText.value;
1713
- };
1714
- // 更新选中
1715
- var updateValue = function updateValue(val) {
1716
- var _a;
1717
- // 更新多选情况下的选中标签
1718
- if (multiple) {
1719
- store.value.setNodesCheck(val); // 同步节点选中的状态
1720
- selectedTags.value = store.value.getCheckedNodes().filter(function (node) {
1721
- return store.value.config.checkAnyLevel || node.isLeaf;
1722
- }) // 根据 checkAnyLevel 配置过滤选中的节点
1723
- .map(function (node) {
1724
- return {
1725
- text: getShowText(node),
1726
- key: node.id // 获取节点的唯一键
1727
- };
1728
- });
1729
-
1730
- selectedText.value = selectedTags.value.map(function (item) {
1731
- return item.text;
1732
- }).join(', '); // 生成选中文本
1733
- return;
1734
- }
1735
- // 如果 checkAnyLevel 配置为 false,则隐藏弹出框
1736
- if (!props.checkAnyLevel) {
1737
- (_a = popover === null || popover === void 0 ? void 0 : popover.value) === null || _a === void 0 ? void 0 : _a.hide();
1738
- }
1739
- // 获取与选中值对应的节点
1740
- var node = store.value.getNodeByValue(val);
1741
- selectedText.value = node ? getShowText(node) : ''; // 获取节点的显示文本,如果节点不存在则赋值为空字符串
1742
- updateSearchKey(); // 更新搜索关键字
1743
- };
1744
- // 清空所选内容,要stopPropagation防止触发下拉
1745
- var handleClear = function handleClear(e) {
1746
- e.stopPropagation();
1747
- store.value.clearChecked();
1748
- searchKey.value = '';
1749
- updateValue([]);
1750
- emit('update:modelValue', []);
1751
- emit('clear', JSON.parse(JSON.stringify(props.modelValue)));
1752
- };
1753
- // 移除tag
1754
- var removeTag = function removeTag(value, index, e) {
1755
- e.stopPropagation();
1756
- var current = JSON.parse(JSON.stringify(value));
1757
- var tag = current.splice(index, 1)[0];
1758
- isEdit.value = true; // 删除时也在编辑态,触发overflowTagIndex的计算
1759
- store.value.removeTag(tag);
1760
- updateValue(current);
1761
- emit('update:modelValue', store.value.getCheckedNodes().map(function (node) {
1762
- return node.path;
1763
- }));
1764
- // 计算过后,关闭编辑状态
1765
- setTimeout(function () {
1766
- isEdit.value = isFocus.value;
1767
- });
1768
- };
1769
- // modelValue的监听函数
1770
- var modelValueChangeHandler = function modelValueChangeHandler(value, oldValue) {
1771
- var _a;
1772
- updateValue(value);
1773
- // 派发相关事件
1774
- emit('update:modelValue', value);
1775
- oldValue !== undefined && emit('change', value); // oldValue = undefined代表初始化,init不派发change事件
1776
- // 如果有过滤搜索,选择后,自动focus到input
1777
- (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.value) === null || _a === void 0 ? void 0 : _a.focus();
1778
- };
1779
- // list的监听函数
1780
- var listChangeHandler = function listChangeHandler() {
1781
- store.value = new src_store(props);
1782
- updateValue(props.modelValue);
1783
- };
1784
- // popover的监听函数
1785
- var popoverChangeEmitter = function popoverChangeEmitter(val) {
1786
- emit('toggle', val.isShow);
1787
- isEdit.value = val.isShow;
1788
- // popover激活后,focus相应事件
1789
- isFocus.value = val.isShow;
1790
- (0,external_vue_.nextTick)(function () {
1791
- var _a;
1792
- val && ((_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.focus());
1793
- });
1794
- val.isShow && focusEmitter(); // 面板打开,触发focus事件
1795
- // 面板收起,搜索状态关闭
1796
- if (!val.isShow) {
1797
- isFiltering.value = false;
1798
- }
1799
- };
1800
- // 搜索框输入的处理函数
1801
- var searchInputHandler = (0,external_shared_.debounce)(200, function (e) {
1802
- var target = e.target;
1803
- searchKey.value = target.value;
1804
- if (searchKey.value === '') {
1805
- // 如果搜索关键字为空,则取消过滤
1806
- isFiltering.value = false;
1807
- return;
1808
- }
1809
- // 开始过滤
1810
- isFiltering.value = true;
1811
- isFiltering.value = true;
1812
- // 筛选方法,如果props中存在filterMethod,则使用props中的方法,否则使用默认方法
1813
- var filterMethod = props.filterMethod ? props.filterMethod : function (node) {
1814
- if (props.checkAnyLevel) {
1815
- // 检查是否需要搜索所有层级的节点
1816
- return node.pathNames.join(props.separator).includes(searchKey.value);
1817
- }
1818
- // 只搜索叶子节点,并且路径中包含搜索关键字
1819
- return node.isLeaf && node.pathNames.join(props.separator).includes(searchKey.value);
1820
- };
1821
- // 获取所有节点并进行过滤
1822
- var targetNodes = store.value.getFlattedNodes().filter(function (node) {
1823
- return filterMethod(node, searchKey.value);
1824
- });
1825
- suggestions.value = targetNodes;
1826
- // 如果popover存在且未显示,则显示popover
1827
- !(popover === null || popover === void 0 ? void 0 : popover.value.isShow) && (popover === null || popover === void 0 ? void 0 : popover.value.show());
1828
- });
1829
- // focus事件的处理函数
1830
- var focusEmitter = function focusEmitter() {
1831
- emit('focus');
1832
- };
1833
- // 监听modelValue的变化
1834
- (0,external_vue_.watch)(function () {
1835
- return props.modelValue;
1836
- }, modelValueChangeHandler, {
1837
- immediate: true
1838
- });
1839
- // 监听list的变化
1840
- (0,external_vue_.watch)(function () {
1841
- return props.list;
1842
- }, listChangeHandler, {
1843
- deep: true,
1844
- immediate: true
1845
- });
1846
- // 定义overflowTagIndex变量,用于处理tag的折叠
1847
- var tagList = (0,external_vue_.computed)(function () {
1848
- return selectedTags.value.map(function (item) {
1849
- return item.text;
1850
- });
1851
- });
1852
- var isCollapse = (0,external_vue_.computed)(function () {
1853
- return props.collapseTags ? props.collapseTags && isFocus.value : props.collapseTags;
1854
- });
1855
- var isEditMode = (0,external_vue_.computed)(function () {
1856
- return props.collapseTags ? props.collapseTags && isEdit.value : props.collapseTags;
1857
- });
1858
- // 如果使用了trigger插槽,则不存在bkCascaderRef,做兼容处理
1859
- var _ref2 = slots.trigger ? {
1860
- overflowTagIndex: null
1861
- } : useTagsOverflow(bkCascaderRef, isEditMode, tagList),
1862
- overflowTagIndex = _ref2.overflowTagIndex;
1863
- // 返回组件所需的变量和函数
1864
- return {
1865
- calcuPlaceholder: placeholder,
1866
- bkCascaderRef: bkCascaderRef,
1867
- inputRef: inputRef,
1868
- overflowTagIndex: overflowTagIndex,
1869
- isCollapse: isCollapse,
1870
- isFocus: isFocus,
1871
- store: store,
1872
- updateValue: updateValue,
1873
- selectedText: selectedText,
1874
- checkedValue: checkedValue,
1875
- handleClear: handleClear,
1876
- isHover: isHover,
1877
- setHover: setHover,
1878
- popover: popover,
1879
- cancelHover: cancelHover,
1880
- selectedTags: selectedTags,
1881
- removeTag: removeTag,
1882
- cascaderPanel: cascaderPanel,
1883
- popoverChangeEmitter: popoverChangeEmitter,
1884
- searchKey: searchKey,
1885
- suggestions: suggestions,
1886
- isFiltering: isFiltering,
1887
- searchInputHandler: searchInputHandler,
1888
- focusEmitter: focusEmitter,
1889
- tagList: tagList,
1890
- isEdit: isEdit
1891
- };
1892
- },
1893
- render: function render() {
1894
- var _this = this;
1895
- // 定义suffixIcon函数,用于根据不同情况渲染后缀图标
1896
- var suffixIcon = function suffixIcon() {
1897
- if (_this.clearable && _this.isHover && !_this.disabled) {
1898
- // 当可清空、鼠标悬浮且未禁用时,渲染清空图标
1899
- return (0,external_vue_.createVNode)(external_icon_.Close, {
1900
- "class": (0,external_shared_.resolveClassName)('icon-clear-icon'),
1901
- "onClick": _this.handleClear
1902
- }, null);
1903
- }
1904
- // 否则渲染展开/收起图标
1905
- return (0,external_vue_.createVNode)(external_icon_.AngleUp, {
1906
- "class": (0,external_shared_.resolveClassName)('icon-angle-up')
1907
- }, null);
1908
- };
1909
- // 因为cascader的tag长短不一,在计算时如果overflowIndex为0,会出现直接+n渲染的情况,因此需要对其进行修正
1910
- this.overflowTagIndex = this.overflowTagIndex === 0 ? 1 : this.overflowTagIndex;
1911
- // 根据overflowTagIndex获取需要收起的tag,并生成tooltip
1912
- var collapseTooltip = this.tagList.reduce(function (acc, cur, curIndex) {
1913
- if (_this.overflowTagIndex !== null && curIndex >= _this.overflowTagIndex) {
1914
- acc.push(cur);
1915
- }
1916
- return acc;
1917
- }, []);
1918
- // 定义renderTags函数,用于渲染选中的tag
1919
- var renderTags = function renderTags() {
1920
- if (_this.limitOneLine) {
1921
- // 如果limitOneLine为true,则只显示一行
1922
- return (0,external_vue_.createVNode)("span", {
1923
- "class": "cascader-selected-text"
1924
- }, [_this.selectedText]);
1925
- }
1926
- return (0,external_vue_.createVNode)("div", {
1927
- "class": "cascader-tag-list"
1928
- }, [_this.tagList.map(function (tag, index) {
1929
- var isOverflow = !_this.isCollapse && _this.overflowTagIndex !== null && index >= _this.overflowTagIndex;
1930
- // 根据tag是否超出显示范围,来决定是否渲染
1931
- return (0,external_vue_.createVNode)("span", {
1932
- "class": "tag-item",
1933
- "style": {
1934
- display: isOverflow ? 'none' : ''
1935
- },
1936
- "key": tag
1937
- }, [(0,external_vue_.createVNode)("span", {
1938
- "class": "tag-item-name"
1939
- }, [tag]), (0,external_vue_.createVNode)(external_icon_.Error, {
1940
- "class": (0,external_shared_.resolveClassName)('icon-clear-icon'),
1941
- "onClick": function onClick(e) {
1942
- e.stopPropagation();
1943
- _this.removeTag(_this.modelValue, index, e);
1944
- }
1945
- }, null)]);
1946
- }), _this.overflowTagIndex !== null && !_this.isCollapse && (0,external_vue_.withDirectives)((0,external_vue_.createVNode)((external_tag_default()), {
1947
- "style": "margin-top: 0"
1948
- }, {
1949
- "default": function _default() {
1950
- return [(0,external_vue_.createTextVNode)("+"), _this.selectedTags.length - _this.overflowTagIndex];
1951
- }
1952
- }), [[(0,external_vue_.resolveDirective)("bk-tooltips"), collapseTooltip.join(', ')]])]);
1953
- };
1954
- var textRender = function textRender() {
1955
- return (
1956
- // 多选时, text被tagRender填充,不需要进行text渲染
1957
- _this.multiple ? null : (0,external_vue_.createVNode)("span", null, [_this.selectedText])
1958
- );
1959
- };
1960
- // 定义popoverRender函数,用于渲染弹出框
1961
- var popoverRender = function popoverRender() {
1962
- return (0,external_vue_.createVNode)((external_popover_default()), {
1963
- "placement": "bottom-start",
1964
- "theme": "light ".concat((0,external_shared_.resolveClassName)('cascader-popover')),
1965
- "trigger": "click",
1966
- "arrow": false,
1967
- "disabled": _this.disabled,
1968
- "class": (0,external_shared_.resolveClassName)('cascader-popover-wrapper'),
1969
- "ref": "popover",
1970
- "onAfterHidden": _this.popoverChangeEmitter,
1971
- "onAfterShow": _this.popoverChangeEmitter,
1972
- "boundary": "body"
1973
- }, {
1974
- "default": function _default() {
1975
- return _this.$slots.trigger ? _this.$slots.trigger({
1976
- selected: _this.modelValue
1977
- }) : (0,external_vue_.createVNode)("div", {
1978
- "class": [(0,external_shared_.resolveClassName)('cascader-name'), 'bk-scroll-y']
1979
- }, [_this.multiple && _this.selectedTags.length > 0 && renderTags(), _this.filterable ? (_this.isCollapse || _this.selectedTags.length === 0) && (0,external_vue_.createVNode)("input", {
1980
- "class": [(0,external_shared_.resolveClassName)('cascader-search-input'), {
1981
- 'is-disabled': _this.disabled
1982
- }],
1983
- "type": "text",
1984
- "onInput": _this.searchInputHandler,
1985
- "placeholder": _this.calcuPlaceholder,
1986
- "value": _this.searchKey,
1987
- "disabled": _this.disabled,
1988
- "ref": "inputRef"
1989
- }, null) : textRender()]);
1990
- },
1991
- content: function content() {
1992
- return (0,external_vue_.createVNode)("div", {
1993
- "class": (0,external_shared_.resolveClassName)('cascader-popover')
1994
- }, [(0,external_vue_.createVNode)(cascader_panel, {
1995
- "store": _this.store,
1996
- "ref": "cascaderPanel",
1997
- "width": _this.scrollWidth,
1998
- "height": _this.scrollHeight,
1999
- "search-key": _this.searchKey,
2000
- "separator": _this.separator,
2001
- "is-filtering": _this.isFiltering,
2002
- "suggestions": _this.suggestions,
2003
- "modelValue": _this.checkedValue,
2004
- "onUpdate:modelValue": function onUpdateModelValue($event) {
2005
- return _this.checkedValue = $event;
2006
- }
2007
- }, {
2008
- "default": function _default(scope) {
2009
- return _this.$slots["default"] ? _this.$slots["default"](scope) : (0,external_vue_.createVNode)("span", {
2010
- "class": (0,external_shared_.resolveClassName)('cascader-node-name')
2011
- }, [scope.node.name]);
2012
- }
2013
- })]);
2014
- }
2015
- });
2016
- };
2017
- return (0,external_vue_.createVNode)("div", {
2018
- "class": [(0,external_shared_.resolveClassName)('cascader-wrapper'), this.floatMode ? 'float-mode' : '']
2019
- }, [this.$slots.trigger ? popoverRender() : (0,external_vue_.createVNode)("div", {
2020
- "class": [(0,external_shared_.resolveClassName)('cascader'), this.extCls, {
2021
- 'is-unselected': this.modelValue.length === 0,
2022
- 'is-hover': this.isHover,
2023
- 'is-filterable': this.filterable,
2024
- 'is-focus': this.isFocus,
2025
- 'is-disabled': this.disabled,
2026
- 'is-simplicity': this.behavior === 'simplicity'
2027
- }],
2028
- "tabindex": "0",
2029
- "data-placeholder": this.calcuPlaceholder,
2030
- "onMouseenter": this.setHover,
2031
- "onMouseleave": this.cancelHover,
2032
- "ref": "bkCascaderRef"
2033
- }, [suffixIcon(), popoverRender()])]);
2034
- }
2035
- }));
2036
- ;// CONCATENATED MODULE: ../../packages/cascader/src/index.ts
2037
- /*
2038
- * Tencent is pleased to support the open source community by making
2039
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2040
- *
2041
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2042
- *
2043
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2044
- *
2045
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2046
- *
2047
- * ---------------------------------------------------
2048
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2049
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2050
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2051
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2052
- *
2053
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2054
- * the Software.
2055
- *
2056
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2057
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2058
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2059
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2060
- * IN THE SOFTWARE.
2061
- */
2062
-
2063
-
2064
-
2065
- var BkCascader = (0,external_shared_.withInstallProps)(cascader, {
2066
- CascaderPanel: cascader_panel
2067
- });
2068
- /* harmony default export */ const src = (BkCascader);
2069
-
2070
- })();
2071
-
2072
- /******/ return __webpack_exports__;
2073
- /******/ })()
2074
- ;
2075
- });
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../tag"),require("../checkbox"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../config-provider","../directives","../icon","../popover","../tag","../checkbox"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../tag"),require("../checkbox")):t(e["../shared"],e.vue,e["vue-types"],e["../config-provider"],e["../directives"],e["../icon"],e["../popover"],e["../tag"],e["../checkbox"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,a,i,l,s)=>(()=>{var c={5800:e=>{"use strict";e.exports=s},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=o},6870:e=>{"use strict";e.exports=a},5537:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},7739:e=>{"use strict";e.exports=l},748:e=>{"use strict";e.exports=t},210:e=>{"use strict";e.exports=r},7609:(e,t,r)=>{var n=r(7425).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},l="function"==typeof Symbol?Symbol:{},s=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",u=l.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),l=new L(n||[]);return i(a,"_invoke",{value:x(e,r,l)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var h={};function v(){}function y(){}function g(){}var m={};d(m,s,(function(){return this}));var b=Object.getPrototypeOf,N=b&&b(b(S([])));N&&N!==r&&a.call(N,s)&&(m=N);var k=g.prototype=v.prototype=Object.create(m);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,l,s){var c=p(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==n(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,s)}),(function(e){r("throw",e,l,s)})):t.resolve(d).then((function(e){u.value=e,l(u)}),(function(e){return r("throw",e,l,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function x(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var l=P(i,r);if(l){if(l===h)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=p(e,t,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function P(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,P(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.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 C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function V(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function S(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(a.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:E}}function E(){return{value:void 0,done:!0}}return y.prototype=g,i(k,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:y,configurable:!0}),y.displayName=d(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},T(w.prototype),d(w.prototype,c,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new w(f(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},T(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=S,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(V),!e)for(var t in this)"t"===t.charAt(0)&&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 r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),s=a.call(o,"finallyLoc");if(l&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),V(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;V(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(r){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(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,r)=>{var n=r(7609)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return c[e](r,r.exports,d),r.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};return(()=>{"use strict";d.r(f),d.d(f,{BkCascader:()=>P,BkCascaderPanel:()=>v,default:()=>C});var e=d(4212),t=d(748),r=d(210),n=d(2717),o=d(4061),a=d(6870),i=d(5537),l=d.n(i),s=d(7739),c=d.n(s);d(2841),Symbol("BkSelect"),Symbol("BkOptionGroup");var u=d(5800),p=d.n(u);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const v=(0,t.defineComponent)({name:"CascaderPanel",props:{width:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto"),height:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),store:e.PropTypes.object.def({}),separator:e.PropTypes.string.def(""),suggestions:e.PropTypes.arrayOf((0,r.object)()),isFiltering:e.PropTypes.bool.def(!1),searchKey:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def(""),modelValue:e.PropTypes.arrayOf(e.PropTypes.oneOfType([(0,r.array)(),String,Number]))},emits:["update:modelValue"],setup:function(r,o){var i=o.emit,l=(0,n.useLocale)("select"),s=r.store,c=(0,t.reactive)({list:[r.store.getNodes()]}),u=(0,t.ref)([]),d=(0,t.ref)([]),f=function(e){return"number"==typeof e?"".concat(e,"px"):e},p=f(r.height),v=f(r.width),y=function(e){var t=[];if(s.config.multiple){var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;o.length>t.length&&(t=o)}}catch(e){n.e(e)}finally{n.f()}}else t=e;t.forEach((function(e){var t=s.getNodeById(e);m(t)}))},g=function(e){if(!e.isDisabled){if(e.config.multiple){var t=s.config.checkAnyLevel?s.getCheckedNodes():s.getCheckedLeafNodes();d.value=t.map((function(e){return e.path}))}else d.value=e.path;i("update:modelValue",d.value)}},m=function(e){var t;if(e&&!(null==e?void 0:e.isDisabled)){if(c.list=c.list.slice(0,e.level),u.value=u.value.slice(0,e.level-1),null===(t=e.children)||void 0===t?void 0:t.length)return c.list.push(e.children),void u.value.push(e);s.config.isRemote&&!e.isLeaf&&(e.loading=!0,s.config.remoteMethod(e,(function(t){s.appendNodes(t,e||null),c.list.push(e.children),u.value.push(e),e.loading=!1})))}},b=l.value.noData,N=function(e,t){e.setNodeCheck(t||!1),g(e)};return(0,t.watch)((function(){return r.modelValue}),(function(e){!function(e){0===e.length&&(c.list=c.list.slice(0,1),u.value=[]),y(e),d.value=e}(e)}),{immediate:!0}),(0,t.watch)((function(){return r.store}),(function(e){c.list=[e.getNodes()]})),{menus:c,activePath:u,nodeExpandHandler:m,isNodeInPath:function(e){return(u.value[e.level-1]||{}).id===e.id},nodeEvent:function(e){var t=e.config,r=t.trigger,n=t.checkAnyLevel,o=t.multiple;return{onClick:function(t){e.isLeaf&&!o||t.stopPropagation(),"click"===r&&m(e),n&&!o&&g(e),e.isLeaf&&!o&&g(e)},onMouseenter:function(){"hover"===r&&m(e)}}},isCheckedNode:function(t,r){return t.config.multiple?r.some((function(r){return(0,e.arrayEqual)(r,t.path)})):(0,e.arrayEqual)(r,t.path)},checkValue:d,checkNode:N,iconRender:function(e){return e.loading?(0,t.createVNode)(a.Spinner,{class:"icon-spinner"},null):(0,t.createVNode)(a.AngleRight,{class:"icon-angle-right"},null)},panelWidth:v,panelHeight:p,searchPanelEvents:function(e){var t=e.config.multiple;return{onClick:function(r){if(t)return r.stopPropagation(),void N(e,!e.checked);m(e),e.isLeaf&&!t&&g(e)}}},expandByNodeList:y,noDataText:b}},render:function(){var r=this,n=parseInt(this.panelWidth,10)>200?this.panelWidth:"".concat(200,"px");return(0,t.createVNode)("div",{class:(0,e.resolveClassName)("cascader-panel-wrapper")},[this.isFiltering?r.suggestions.length?(0,t.createVNode)("ul",{class:[(0,e.resolveClassName)("cascader-panel"),"bk-scroll-y"],style:{height:r.panelHeight,width:r.panelWidth}},[r.suggestions.map((function(n){return(0,t.createVNode)("li",(0,t.mergeProps)({class:[(0,e.resolveClassName)("cascader-node"),{"is-selected":r.isNodeInPath(n)},{"is-disabled":n.isDisabled},{"is-checked":r.isCheckedNode(n,r.checkValue)}]},r.searchPanelEvents(n)),[n.pathNames.join(r.separator)])}))]):(0,t.createVNode)("div",{class:(0,e.resolveClassName)("cascader-search-empty"),style:{width:n}},[(0,t.createVNode)("span",null,[(0,t.createTextVNode)("暂无搜索结果")])]):this.menus.list.map((function(n){return(0,t.createVNode)("ul",{class:[(0,e.resolveClassName)("cascader-panel"),"bk-scroll-y"],style:{height:r.panelHeight,width:r.panelWidth}},[n.length?n.map((function(n){var o,a;return(0,t.createVNode)("li",(0,t.mergeProps)({class:[(0,e.resolveClassName)("cascader-node"),{"is-selected":r.isNodeInPath(n)},{"is-disabled":n.isDisabled},{"is-checked":!n.config.multiple&&r.isCheckedNode(n,r.checkValue)}]},Object.assign(r.nodeEvent(n),(n.config.multiple,{}))),[n.config.multiple&&(0,t.createVNode)(p(),{disabled:n.isDisabled,modelValue:n.checked,"onUpdate:modelValue":function(e){return n.checked=e},indeterminate:n.isIndeterminate,style:"margin-right: 5px",onChange:function(e){return r.checkNode(n,e)}},null),null===(a=(o=r.$slots).default)||void 0===a?void 0:a.call(o,{node:n,data:n.data}),n.isLeaf?"":r.iconRender(n)])})):(0,t.createVNode)("div",{class:(0,e.resolveClassName)("cascader-panel-empty-wrapper")},[r.noDataText])])}))])}});function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(o=n.key,a=void 0,a=function(e,t){if("object"!==g(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o),"symbol"===g(a)?a:String(a)),n)}var o,a}function b(e,t,r){return t&&m(e.prototype,t),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e){return!!e.data.disabled||(1!==e.level?N(e.parent):e.data.disabled)}const k=function(){function t(e,r,n){y(this,t),this.data=e,this.config=r,this.parent=n||null,this.leaf=e.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}return b(t,[{key:"initState",value:function(){var e=this,r=this.config,n=r.idKey,o=r.nameKey,a=r.childrenKey;this.id=this.data[n],this.name=this.data[o],this.loading=!1,this.loaded=!1,this.checked=!1;var i=this.data[a];this.children=(i||[]).map((function(r){return new t(r,e.config,e)})),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map((function(e){return e.id})),this.pathNames=this.pathNodes.map((function(e){return e.name}))}},{key:"isLeaf",get:function(){var e;return this.config.isRemote?this.leaf||!!this.loaded&&!this.children.length:!(Array.isArray(this.children)&&0!==(null===(e=this.children)||void 0===e?void 0:e.length))}},{key:"isDisabled",get:function(){return N(this)}},{key:"broadcast",value:function(t,r){var n="onParent".concat((0,e.capitalize)(t));this.children.forEach((function(e){var o;e&&(e.broadcast(t,r),null===(o=e[n])||void 0===o||o.call(e,r))}))}},{key:"emit",value:function(t){var r,n=this.parent,o="onChild".concat((0,e.capitalize)(t));n&&(null===(r=n[o])||void 0===r||r.call(n),n.emit(t))}},{key:"onParentCheck",value:function(e){this.isDisabled||this.setCheckState(e)}},{key:"onChildCheck",value:function(){var e=this.children.filter((function(e){return!e.isDisabled})),t=!!e.length&&e.every((function(e){return e.checked}));this.setCheckState(t)}},{key:"setCheckState",value:function(e){var t=this.children.length,r=this.children.reduce((function(e,t){var r=t.isIndeterminate?.5:0;return e+(t.checked?1:r)}),0);this.checked=e,this.isIndeterminate=r!==t&&r>0}},{key:"setNodeCheck",value:function(e){this.config.checkAnyLevel?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check"))}},{key:"calculateNodesPath",value:function(){for(var e=[this],t=this.parent;t;)e.unshift(t),t=t.parent;return e}}]),t}();var T=function e(t,r){return t.reduce((function(t,n){return n.isLeaf?t.push(n):(!r&&t.push(n),t=t.concat(e(n.children,r))),t}),[])};const w=function(){function t(e){var r=this;y(this,t);var n=e.list;this.data=n,this.config=e,this.nodes=this.data.map((function(e){return new k(e,r.config)}))}return b(t,[{key:"getNodes",value:function(){return this.nodes}},{key:"clearChecked",value:function(){this.getFlattedNodes().forEach((function(e){e.setNodeCheck(!1),e.isIndeterminate=!1}))}},{key:"removeTag",value:function(t){this.getFlattedNodes().find((function(r){return!!(0,e.arrayEqual)(t,r.path)&&(r.setNodeCheck(!1),!0)}))}},{key:"getFlattedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return T(this.nodes,e)}},{key:"setNodesCheck",value:function(t){var r=this;this.getFlattedNodes().forEach((function(n){n.setNodeCheck(!1);var o=t.find((function(t){return(0,e.arrayEqual)(n.path,t)}));o&&r.getNodeByValue(o).setNodeCheck(!0)}))}},{key:"getCheckedNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.checked}))}},{key:"getCheckedLeafNodes",value:function(){return this.getFlattedNodes().filter((function(e){return e.isLeaf&&e.checked}))}},{key:"getNodeByValue",value:function(t){var r;return null!==(r=this.getFlattedNodes().filter((function(r){return(0,e.arrayEqual)(r.path,t)}))[0])&&void 0!==r?r:null}},{key:"getNodeById",value:function(e){return this.getFlattedNodes().find((function(t){return t.id===e}))}},{key:"appendNode",value:function(e,t){var r=new k(e,this.config,t);(t?t.children:this.nodes).push(r)}},{key:"appendNodes",value:function(e,t){var r=this;e.forEach((function(e){return r.appendNode(e,t)}))}}]),t}(),x=(0,t.defineComponent)({name:"Cascader",directives:{bkTooltips:o.bkTooltips},components:{CascaderPanel:v,BkPopover:l(),Tag:c()},props:{modelValue:e.PropTypes.arrayOf(e.PropTypes.oneOfType([(0,r.array)(),String,Number])),list:e.PropTypes.array.def([]),placeholder:e.PropTypes.string.def(""),behavior:e.PropTypes.string.def("normal"),filterable:e.PropTypes.bool.def(!1),multiple:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),clearable:e.PropTypes.bool.def(!0),trigger:e.PropTypes.string.def("click"),checkAnyLevel:e.PropTypes.bool.def(!1),isRemote:e.PropTypes.bool.def(!1),remoteMethod:e.PropTypes.func,showCompleteName:e.PropTypes.bool.def(!0),idKey:e.PropTypes.string.def("id"),nameKey:e.PropTypes.string.def("name"),childrenKey:e.PropTypes.string.def("children"),separator:e.PropTypes.string.def("/"),limitOneLine:e.PropTypes.bool.def(!1),extCls:e.PropTypes.string.def(""),filterMethod:e.PropTypes.func.def(null),scrollHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def(216),scrollWidth:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.string]).def("auto"),collapseTags:{type:Boolean,default:!0},floatMode:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear","toggle","focus"],setup:function(r,o){var a=o.emit,i=o.slots,l=(0,n.useLocale)("select"),s=r.separator,c=r.multiple,u=function(){var e=(0,t.ref)(!1);return{isHover:e,setHover:function(){e.value=!0},cancelHover:function(){e.value=!1}}}(),d=u.isHover,f=u.setHover,p=u.cancelHover,h=(0,t.ref)(new w(r)),v=(0,t.ref)(""),y=(0,t.ref)([]),g=(0,t.toRefs)(r).modelValue,m=(0,t.ref)(),b=(0,t.ref)(""),N=(0,t.ref)([]),k=(0,t.ref)(!1),T=(0,t.ref)(!1),x=(0,t.ref)(!1),P=(0,t.computed)({get:function(){return g.value},set:function(e){a("update:modelValue",e)}}),C=(0,t.ref)(null),V=(0,t.ref)(null),L=(0,t.ref)(null),S=(0,t.computed)((function(){return r.placeholder?r.placeholder:l.value.pleaseSelect})),E=function(e){return r.showCompleteName?e.pathNames.join(s):e.pathNames[e.pathNames.length-1]},O=function(e){var t;if(c)return h.value.setNodesCheck(e),y.value=h.value.getCheckedNodes().filter((function(e){return h.value.config.checkAnyLevel||e.isLeaf})).map((function(e){return{text:E(e),key:e.id}})),void(v.value=y.value.map((function(e){return e.text})).join(", "));r.checkAnyLevel||null===(t=null==C?void 0:C.value)||void 0===t||t.hide();var n=h.value.getNodeByValue(e);v.value=n?E(n):"",b.value=v.value},j=(0,e.debounce)(200,(function(e){var t=e.target;if(b.value=t.value,""!==b.value){k.value=!0,k.value=!0;var n=r.filterMethod?r.filterMethod:function(e){return(r.checkAnyLevel||e.isLeaf)&&e.pathNames.join(r.separator).includes(b.value)},o=h.value.getFlattedNodes().filter((function(e){return n(e,b.value)}));N.value=o,!(null==C?void 0:C.value.isShow)&&(null==C||C.value.show())}else k.value=!1})),I=function(){a("focus")};(0,t.watch)((function(){return r.modelValue}),(function(e,t){var r;O(e),a("update:modelValue",e),void 0!==t&&a("change",e),null===(r=null==L?void 0:L.value)||void 0===r||r.focus()}),{immediate:!0}),(0,t.watch)((function(){return r.list}),(function(){h.value=new w(r),O(r.modelValue)}),{deep:!0,immediate:!0});var _=(0,t.computed)((function(){return y.value.map((function(e){return e.text}))})),q=(0,t.computed)((function(){return r.collapseTags?r.collapseTags&&x.value:r.collapseTags})),A=(0,t.computed)((function(){return r.collapseTags?r.collapseTags&&T.value:r.collapseTags})),H=i.trigger?{overflowTagIndex:null}:function(e,r,n){(0,t.watch)([n,r],(function(){a()}),{flush:"post"});var o=(0,t.ref)(null),a=function(){r.value&&(o.value=null,setTimeout((function(){var t=Array.from(e.value.querySelectorAll(".tag-item")),r=t.findIndex((function(e,r){return!!r&&t[r-1].offsetTop!==e.offsetTop}));o.value=r>0?r-1:null})))};return{overflowTagIndex:o}}(V,A,_),F=H.overflowTagIndex;return{calcuPlaceholder:S,bkCascaderRef:V,inputRef:L,overflowTagIndex:F,isCollapse:q,isFocus:x,store:h,updateValue:O,selectedText:v,checkedValue:P,handleClear:function(e){e.stopPropagation(),h.value.clearChecked(),b.value="",O([]),a("update:modelValue",[]),a("clear",JSON.parse(JSON.stringify(r.modelValue)))},isHover:d,setHover:f,popover:C,cancelHover:p,selectedTags:y,removeTag:function(e,t,r){r.stopPropagation();var n=JSON.parse(JSON.stringify(e)),o=n.splice(t,1)[0];T.value=!0,h.value.removeTag(o),O(n),a("update:modelValue",h.value.getCheckedNodes().map((function(e){return e.path}))),setTimeout((function(){T.value=x.value}))},cascaderPanel:m,popoverChangeEmitter:function(e){a("toggle",e.isShow),T.value=e.isShow,x.value=e.isShow,(0,t.nextTick)((function(){var t;e&&(null===(t=L.value)||void 0===t||t.focus())})),e.isShow&&I(),e.isShow||(k.value=!1)},searchKey:b,suggestions:N,isFiltering:k,searchInputHandler:j,focusEmitter:I,tagList:_,isEdit:T}},render:function(){var r=this;this.overflowTagIndex=0===this.overflowTagIndex?1:this.overflowTagIndex;var n=this.tagList.reduce((function(e,t,n){return null!==r.overflowTagIndex&&n>=r.overflowTagIndex&&e.push(t),e}),[]),o=function(){return(0,t.createVNode)(l(),{placement:"bottom-start",theme:"light ".concat((0,e.resolveClassName)("cascader-popover")),trigger:"click",arrow:!1,disabled:r.disabled,class:(0,e.resolveClassName)("cascader-popover-wrapper"),ref:"popover",onAfterHidden:r.popoverChangeEmitter,onAfterShow:r.popoverChangeEmitter,boundary:"body"},{default:function(){return r.$slots.trigger?r.$slots.trigger({selected:r.modelValue}):(0,t.createVNode)("div",{class:[(0,e.resolveClassName)("cascader-name"),"bk-scroll-y"]},[r.multiple&&r.selectedTags.length>0&&(r.limitOneLine?(0,t.createVNode)("span",{class:"cascader-selected-text"},[r.selectedText]):(0,t.createVNode)("div",{class:"cascader-tag-list"},[r.tagList.map((function(n,o){var i=!r.isCollapse&&null!==r.overflowTagIndex&&o>=r.overflowTagIndex;return(0,t.createVNode)("span",{class:"tag-item",style:{display:i?"none":""},key:n},[(0,t.createVNode)("span",{class:"tag-item-name"},[n]),(0,t.createVNode)(a.Error,{class:(0,e.resolveClassName)("icon-clear-icon"),onClick:function(e){e.stopPropagation(),r.removeTag(r.modelValue,o,e)}},null)])})),null!==r.overflowTagIndex&&!r.isCollapse&&(0,t.withDirectives)((0,t.createVNode)(c(),{style:"margin-top: 0"},{default:function(){return[(0,t.createTextVNode)("+"),r.selectedTags.length-r.overflowTagIndex]}}),[[(0,t.resolveDirective)("bk-tooltips"),n.join(", ")]])])),r.filterable?(r.isCollapse||0===r.selectedTags.length)&&(0,t.createVNode)("input",{class:[(0,e.resolveClassName)("cascader-search-input"),{"is-disabled":r.disabled}],type:"text",onInput:r.searchInputHandler,placeholder:r.calcuPlaceholder,value:r.searchKey,disabled:r.disabled,ref:"inputRef"},null):r.multiple?null:(0,t.createVNode)("span",null,[r.selectedText])])},content:function(){return(0,t.createVNode)("div",{class:(0,e.resolveClassName)("cascader-popover")},[(0,t.createVNode)(v,{store:r.store,ref:"cascaderPanel",width:r.scrollWidth,height:r.scrollHeight,"search-key":r.searchKey,separator:r.separator,"is-filtering":r.isFiltering,suggestions:r.suggestions,modelValue:r.checkedValue,"onUpdate:modelValue":function(e){return r.checkedValue=e}},{default:function(n){return r.$slots.default?r.$slots.default(n):(0,t.createVNode)("span",{class:(0,e.resolveClassName)("cascader-node-name")},[n.node.name])}})])}})};return(0,t.createVNode)("div",{class:[(0,e.resolveClassName)("cascader-wrapper"),this.floatMode?"float-mode":""]},[this.$slots.trigger?o():(0,t.createVNode)("div",{class:[(0,e.resolveClassName)("cascader"),this.extCls,{"is-unselected":0===this.modelValue.length,"is-hover":this.isHover,"is-filterable":this.filterable,"is-focus":this.isFocus,"is-disabled":this.disabled,"is-simplicity":"simplicity"===this.behavior}],tabindex:"0","data-placeholder":this.calcuPlaceholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover,ref:"bkCascaderRef"},[r.clearable&&r.isHover&&!r.disabled?(0,t.createVNode)(a.Close,{class:(0,e.resolveClassName)("icon-clear-icon"),onClick:r.handleClear},null):(0,t.createVNode)(a.AngleUp,{class:(0,e.resolveClassName)("icon-angle-up")},null),o()])])}});var P=(0,e.withInstallProps)(x,{CascaderPanel:v});const C=P})(),f})()));