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

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