bm-admin-ui 1.0.20-alpha → 1.0.22-alpha

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 (49) hide show
  1. package/es/components/feedback/index.js +25 -1306
  2. package/es/components/float-table/index.js +36 -27
  3. package/es/components/form-create/index.js +2769 -0
  4. package/es/components/form-designer/index.js +4178 -9
  5. package/es/components/index.js +1 -0
  6. package/es/components/input-tags-display/index.js +27 -1187
  7. package/es/components/multi-cascader-compose/index.js +31 -1199
  8. package/es/components/over-tooltips/index.js +27 -20
  9. package/es/components/search-filter/index.js +52 -1253
  10. package/es/components/shops-filter/index.js +24 -1182
  11. package/es/components/staffs-selector/index.js +131 -1241
  12. package/es/components/timeline/index.js +6 -6
  13. package/es/components/upload/index.js +101 -1334
  14. package/es/utils/uniqueId.js +5 -0
  15. package/es/utils/vxe-table.js +4 -3
  16. package/lib/components/feedback/index.js +23 -1304
  17. package/lib/components/float-table/index.js +36 -27
  18. package/lib/components/form-create/index.js +2781 -0
  19. package/lib/components/form-designer/index.js +4183 -8
  20. package/lib/components/index.js +7 -0
  21. package/lib/components/input-tags-display/index.js +26 -1186
  22. package/lib/components/multi-cascader-compose/index.js +30 -1198
  23. package/lib/components/over-tooltips/index.js +27 -20
  24. package/lib/components/search-filter/index.js +51 -1252
  25. package/lib/components/shops-filter/index.js +23 -1181
  26. package/lib/components/staffs-selector/index.js +130 -1240
  27. package/lib/components/timeline/index.js +6 -6
  28. package/lib/components/upload/index.js +100 -1333
  29. package/lib/utils/uniqueId.js +8 -0
  30. package/lib/utils/vxe-table.js +3 -2
  31. package/package.json +9 -4
  32. package/theme-chalk/button.css +1 -1
  33. package/theme-chalk/feedback.css +1 -1
  34. package/theme-chalk/float-table.css +1 -1
  35. package/theme-chalk/floating-vue.css +1 -1
  36. package/theme-chalk/flow-designer.css +1 -1
  37. package/theme-chalk/form-create.css +1 -0
  38. package/theme-chalk/form-designer.css +1 -0
  39. package/theme-chalk/index.css +1 -1
  40. package/theme-chalk/input-tags-display.css +1 -1
  41. package/theme-chalk/modal.css +1 -1
  42. package/theme-chalk/multi-cascader-compose.css +1 -1
  43. package/theme-chalk/over-tooltips.css +1 -1
  44. package/theme-chalk/search-filter.css +1 -1
  45. package/theme-chalk/staffs-selector.css +1 -1
  46. package/theme-chalk/timeline.css +1 -1
  47. package/theme-chalk/upload.css +1 -1
  48. package/index.esm.js +0 -46662
  49. package/index.js +0 -46692
@@ -4,1191 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('bm-admin-ui/lib/utils/with-install');
6
6
  var vue = require('vue');
7
-
8
- /**
9
- * Take input from [0, n] and return it as [0, 1]
10
- * @hidden
11
- */
12
- function bound01(n, max) {
13
- if (isOnePointZero(n)) {
14
- n = '100%';
15
- }
16
- var isPercent = isPercentage(n);
17
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
18
- // Automatically convert percentage into number
19
- if (isPercent) {
20
- n = parseInt(String(n * max), 10) / 100;
21
- }
22
- // Handle floating point rounding errors
23
- if (Math.abs(n - max) < 0.000001) {
24
- return 1;
25
- }
26
- // Convert into [0, 1] range if it isn't already
27
- if (max === 360) {
28
- // If n is a hue given in degrees,
29
- // wrap around out-of-range values into [0, 360] range
30
- // then convert into [0, 1].
31
- n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
32
- }
33
- else {
34
- // If n not a hue given in degrees
35
- // Convert into [0, 1] range if it isn't already.
36
- n = (n % max) / parseFloat(String(max));
37
- }
38
- return n;
39
- }
40
- /**
41
- * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
42
- * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
43
- * @hidden
44
- */
45
- function isOnePointZero(n) {
46
- return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
47
- }
48
- /**
49
- * Check to see if string passed in is a percentage
50
- * @hidden
51
- */
52
- function isPercentage(n) {
53
- return typeof n === 'string' && n.indexOf('%') !== -1;
54
- }
55
- /**
56
- * Return a valid alpha value [0,1] with all invalid values being set to 1
57
- * @hidden
58
- */
59
- function boundAlpha(a) {
60
- a = parseFloat(a);
61
- if (isNaN(a) || a < 0 || a > 1) {
62
- a = 1;
63
- }
64
- return a;
65
- }
66
- /**
67
- * Replace a decimal with it's percentage value
68
- * @hidden
69
- */
70
- function convertToPercentage(n) {
71
- if (n <= 1) {
72
- return "".concat(Number(n) * 100, "%");
73
- }
74
- return n;
75
- }
76
- /**
77
- * Force a hex value to have 2 characters
78
- * @hidden
79
- */
80
- function pad2(c) {
81
- return c.length === 1 ? '0' + c : String(c);
82
- }
83
-
84
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
85
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
86
- /**
87
- * Handle bounds / percentage checking to conform to CSS color spec
88
- * <http://www.w3.org/TR/css3-color/>
89
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
90
- * *Returns:* { r, g, b } in [0, 255]
91
- */
92
- function rgbToRgb(r, g, b) {
93
- return {
94
- r: bound01(r, 255) * 255,
95
- g: bound01(g, 255) * 255,
96
- b: bound01(b, 255) * 255,
97
- };
98
- }
99
- function hue2rgb(p, q, t) {
100
- if (t < 0) {
101
- t += 1;
102
- }
103
- if (t > 1) {
104
- t -= 1;
105
- }
106
- if (t < 1 / 6) {
107
- return p + (q - p) * (6 * t);
108
- }
109
- if (t < 1 / 2) {
110
- return q;
111
- }
112
- if (t < 2 / 3) {
113
- return p + (q - p) * (2 / 3 - t) * 6;
114
- }
115
- return p;
116
- }
117
- /**
118
- * Converts an HSL color value to RGB.
119
- *
120
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
121
- * *Returns:* { r, g, b } in the set [0, 255]
122
- */
123
- function hslToRgb(h, s, l) {
124
- var r;
125
- var g;
126
- var b;
127
- h = bound01(h, 360);
128
- s = bound01(s, 100);
129
- l = bound01(l, 100);
130
- if (s === 0) {
131
- // achromatic
132
- g = l;
133
- b = l;
134
- r = l;
135
- }
136
- else {
137
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
138
- var p = 2 * l - q;
139
- r = hue2rgb(p, q, h + 1 / 3);
140
- g = hue2rgb(p, q, h);
141
- b = hue2rgb(p, q, h - 1 / 3);
142
- }
143
- return { r: r * 255, g: g * 255, b: b * 255 };
144
- }
145
- /**
146
- * Converts an RGB color value to HSV
147
- *
148
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
149
- * *Returns:* { h, s, v } in [0,1]
150
- */
151
- function rgbToHsv(r, g, b) {
152
- r = bound01(r, 255);
153
- g = bound01(g, 255);
154
- b = bound01(b, 255);
155
- var max = Math.max(r, g, b);
156
- var min = Math.min(r, g, b);
157
- var h = 0;
158
- var v = max;
159
- var d = max - min;
160
- var s = max === 0 ? 0 : d / max;
161
- if (max === min) {
162
- h = 0; // achromatic
163
- }
164
- else {
165
- switch (max) {
166
- case r:
167
- h = (g - b) / d + (g < b ? 6 : 0);
168
- break;
169
- case g:
170
- h = (b - r) / d + 2;
171
- break;
172
- case b:
173
- h = (r - g) / d + 4;
174
- break;
175
- }
176
- h /= 6;
177
- }
178
- return { h: h, s: s, v: v };
179
- }
180
- /**
181
- * Converts an HSV color value to RGB.
182
- *
183
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
184
- * *Returns:* { r, g, b } in the set [0, 255]
185
- */
186
- function hsvToRgb(h, s, v) {
187
- h = bound01(h, 360) * 6;
188
- s = bound01(s, 100);
189
- v = bound01(v, 100);
190
- var i = Math.floor(h);
191
- var f = h - i;
192
- var p = v * (1 - s);
193
- var q = v * (1 - f * s);
194
- var t = v * (1 - (1 - f) * s);
195
- var mod = i % 6;
196
- var r = [v, q, p, p, t, v][mod];
197
- var g = [t, v, v, q, p, p][mod];
198
- var b = [p, p, t, v, v, q][mod];
199
- return { r: r * 255, g: g * 255, b: b * 255 };
200
- }
201
- /**
202
- * Converts an RGB color to hex
203
- *
204
- * Assumes r, g, and b are contained in the set [0, 255]
205
- * Returns a 3 or 6 character hex
206
- */
207
- function rgbToHex(r, g, b, allow3Char) {
208
- var hex = [
209
- pad2(Math.round(r).toString(16)),
210
- pad2(Math.round(g).toString(16)),
211
- pad2(Math.round(b).toString(16)),
212
- ];
213
- // Return a 3 character hex if possible
214
- if (allow3Char &&
215
- hex[0].startsWith(hex[0].charAt(1)) &&
216
- hex[1].startsWith(hex[1].charAt(1)) &&
217
- hex[2].startsWith(hex[2].charAt(1))) {
218
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
219
- }
220
- return hex.join('');
221
- }
222
- /** Converts a hex value to a decimal */
223
- function convertHexToDecimal(h) {
224
- return parseIntFromHex(h) / 255;
225
- }
226
- /** Parse a base-16 hex value into a base-10 integer */
227
- function parseIntFromHex(val) {
228
- return parseInt(val, 16);
229
- }
230
-
231
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
232
- /**
233
- * @hidden
234
- */
235
- var names = {
236
- aliceblue: '#f0f8ff',
237
- antiquewhite: '#faebd7',
238
- aqua: '#00ffff',
239
- aquamarine: '#7fffd4',
240
- azure: '#f0ffff',
241
- beige: '#f5f5dc',
242
- bisque: '#ffe4c4',
243
- black: '#000000',
244
- blanchedalmond: '#ffebcd',
245
- blue: '#0000ff',
246
- blueviolet: '#8a2be2',
247
- brown: '#a52a2a',
248
- burlywood: '#deb887',
249
- cadetblue: '#5f9ea0',
250
- chartreuse: '#7fff00',
251
- chocolate: '#d2691e',
252
- coral: '#ff7f50',
253
- cornflowerblue: '#6495ed',
254
- cornsilk: '#fff8dc',
255
- crimson: '#dc143c',
256
- cyan: '#00ffff',
257
- darkblue: '#00008b',
258
- darkcyan: '#008b8b',
259
- darkgoldenrod: '#b8860b',
260
- darkgray: '#a9a9a9',
261
- darkgreen: '#006400',
262
- darkgrey: '#a9a9a9',
263
- darkkhaki: '#bdb76b',
264
- darkmagenta: '#8b008b',
265
- darkolivegreen: '#556b2f',
266
- darkorange: '#ff8c00',
267
- darkorchid: '#9932cc',
268
- darkred: '#8b0000',
269
- darksalmon: '#e9967a',
270
- darkseagreen: '#8fbc8f',
271
- darkslateblue: '#483d8b',
272
- darkslategray: '#2f4f4f',
273
- darkslategrey: '#2f4f4f',
274
- darkturquoise: '#00ced1',
275
- darkviolet: '#9400d3',
276
- deeppink: '#ff1493',
277
- deepskyblue: '#00bfff',
278
- dimgray: '#696969',
279
- dimgrey: '#696969',
280
- dodgerblue: '#1e90ff',
281
- firebrick: '#b22222',
282
- floralwhite: '#fffaf0',
283
- forestgreen: '#228b22',
284
- fuchsia: '#ff00ff',
285
- gainsboro: '#dcdcdc',
286
- ghostwhite: '#f8f8ff',
287
- goldenrod: '#daa520',
288
- gold: '#ffd700',
289
- gray: '#808080',
290
- green: '#008000',
291
- greenyellow: '#adff2f',
292
- grey: '#808080',
293
- honeydew: '#f0fff0',
294
- hotpink: '#ff69b4',
295
- indianred: '#cd5c5c',
296
- indigo: '#4b0082',
297
- ivory: '#fffff0',
298
- khaki: '#f0e68c',
299
- lavenderblush: '#fff0f5',
300
- lavender: '#e6e6fa',
301
- lawngreen: '#7cfc00',
302
- lemonchiffon: '#fffacd',
303
- lightblue: '#add8e6',
304
- lightcoral: '#f08080',
305
- lightcyan: '#e0ffff',
306
- lightgoldenrodyellow: '#fafad2',
307
- lightgray: '#d3d3d3',
308
- lightgreen: '#90ee90',
309
- lightgrey: '#d3d3d3',
310
- lightpink: '#ffb6c1',
311
- lightsalmon: '#ffa07a',
312
- lightseagreen: '#20b2aa',
313
- lightskyblue: '#87cefa',
314
- lightslategray: '#778899',
315
- lightslategrey: '#778899',
316
- lightsteelblue: '#b0c4de',
317
- lightyellow: '#ffffe0',
318
- lime: '#00ff00',
319
- limegreen: '#32cd32',
320
- linen: '#faf0e6',
321
- magenta: '#ff00ff',
322
- maroon: '#800000',
323
- mediumaquamarine: '#66cdaa',
324
- mediumblue: '#0000cd',
325
- mediumorchid: '#ba55d3',
326
- mediumpurple: '#9370db',
327
- mediumseagreen: '#3cb371',
328
- mediumslateblue: '#7b68ee',
329
- mediumspringgreen: '#00fa9a',
330
- mediumturquoise: '#48d1cc',
331
- mediumvioletred: '#c71585',
332
- midnightblue: '#191970',
333
- mintcream: '#f5fffa',
334
- mistyrose: '#ffe4e1',
335
- moccasin: '#ffe4b5',
336
- navajowhite: '#ffdead',
337
- navy: '#000080',
338
- oldlace: '#fdf5e6',
339
- olive: '#808000',
340
- olivedrab: '#6b8e23',
341
- orange: '#ffa500',
342
- orangered: '#ff4500',
343
- orchid: '#da70d6',
344
- palegoldenrod: '#eee8aa',
345
- palegreen: '#98fb98',
346
- paleturquoise: '#afeeee',
347
- palevioletred: '#db7093',
348
- papayawhip: '#ffefd5',
349
- peachpuff: '#ffdab9',
350
- peru: '#cd853f',
351
- pink: '#ffc0cb',
352
- plum: '#dda0dd',
353
- powderblue: '#b0e0e6',
354
- purple: '#800080',
355
- rebeccapurple: '#663399',
356
- red: '#ff0000',
357
- rosybrown: '#bc8f8f',
358
- royalblue: '#4169e1',
359
- saddlebrown: '#8b4513',
360
- salmon: '#fa8072',
361
- sandybrown: '#f4a460',
362
- seagreen: '#2e8b57',
363
- seashell: '#fff5ee',
364
- sienna: '#a0522d',
365
- silver: '#c0c0c0',
366
- skyblue: '#87ceeb',
367
- slateblue: '#6a5acd',
368
- slategray: '#708090',
369
- slategrey: '#708090',
370
- snow: '#fffafa',
371
- springgreen: '#00ff7f',
372
- steelblue: '#4682b4',
373
- tan: '#d2b48c',
374
- teal: '#008080',
375
- thistle: '#d8bfd8',
376
- tomato: '#ff6347',
377
- turquoise: '#40e0d0',
378
- violet: '#ee82ee',
379
- wheat: '#f5deb3',
380
- white: '#ffffff',
381
- whitesmoke: '#f5f5f5',
382
- yellow: '#ffff00',
383
- yellowgreen: '#9acd32',
384
- };
385
-
386
- /**
387
- * Given a string or object, convert that input to RGB
388
- *
389
- * Possible string inputs:
390
- * ```
391
- * "red"
392
- * "#f00" or "f00"
393
- * "#ff0000" or "ff0000"
394
- * "#ff000000" or "ff000000"
395
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
396
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
397
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
398
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
399
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
400
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
401
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
402
- * ```
403
- */
404
- function inputToRGB(color) {
405
- var rgb = { r: 0, g: 0, b: 0 };
406
- var a = 1;
407
- var s = null;
408
- var v = null;
409
- var l = null;
410
- var ok = false;
411
- var format = false;
412
- if (typeof color === 'string') {
413
- color = stringInputToObject(color);
414
- }
415
- if (typeof color === 'object') {
416
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
417
- rgb = rgbToRgb(color.r, color.g, color.b);
418
- ok = true;
419
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
420
- }
421
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
422
- s = convertToPercentage(color.s);
423
- v = convertToPercentage(color.v);
424
- rgb = hsvToRgb(color.h, s, v);
425
- ok = true;
426
- format = 'hsv';
427
- }
428
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
429
- s = convertToPercentage(color.s);
430
- l = convertToPercentage(color.l);
431
- rgb = hslToRgb(color.h, s, l);
432
- ok = true;
433
- format = 'hsl';
434
- }
435
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
436
- a = color.a;
437
- }
438
- }
439
- a = boundAlpha(a);
440
- return {
441
- ok: ok,
442
- format: color.format || format,
443
- r: Math.min(255, Math.max(rgb.r, 0)),
444
- g: Math.min(255, Math.max(rgb.g, 0)),
445
- b: Math.min(255, Math.max(rgb.b, 0)),
446
- a: a,
447
- };
448
- }
449
- // <http://www.w3.org/TR/css3-values/#integers>
450
- var CSS_INTEGER = '[-\\+]?\\d+%?';
451
- // <http://www.w3.org/TR/css3-values/#number-value>
452
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
453
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
454
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
455
- // Actual matching.
456
- // Parentheses and commas are optional, but not required.
457
- // Whitespace can take the place of commas or opening paren
458
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
459
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
460
- var matchers = {
461
- CSS_UNIT: new RegExp(CSS_UNIT),
462
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
463
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
464
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
465
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
466
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
467
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
468
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
469
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
470
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
471
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
472
- };
473
- /**
474
- * Permissive string parsing. Take in a number of formats, and output an object
475
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
476
- */
477
- function stringInputToObject(color) {
478
- color = color.trim().toLowerCase();
479
- if (color.length === 0) {
480
- return false;
481
- }
482
- var named = false;
483
- if (names[color]) {
484
- color = names[color];
485
- named = true;
486
- }
487
- else if (color === 'transparent') {
488
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
489
- }
490
- // Try to match string input using regular expressions.
491
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
492
- // Just return an object and let the conversion functions handle that.
493
- // This way the result will be the same whether the tinycolor is initialized with string or object.
494
- var match = matchers.rgb.exec(color);
495
- if (match) {
496
- return { r: match[1], g: match[2], b: match[3] };
497
- }
498
- match = matchers.rgba.exec(color);
499
- if (match) {
500
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
501
- }
502
- match = matchers.hsl.exec(color);
503
- if (match) {
504
- return { h: match[1], s: match[2], l: match[3] };
505
- }
506
- match = matchers.hsla.exec(color);
507
- if (match) {
508
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
509
- }
510
- match = matchers.hsv.exec(color);
511
- if (match) {
512
- return { h: match[1], s: match[2], v: match[3] };
513
- }
514
- match = matchers.hsva.exec(color);
515
- if (match) {
516
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
517
- }
518
- match = matchers.hex8.exec(color);
519
- if (match) {
520
- return {
521
- r: parseIntFromHex(match[1]),
522
- g: parseIntFromHex(match[2]),
523
- b: parseIntFromHex(match[3]),
524
- a: convertHexToDecimal(match[4]),
525
- format: named ? 'name' : 'hex8',
526
- };
527
- }
528
- match = matchers.hex6.exec(color);
529
- if (match) {
530
- return {
531
- r: parseIntFromHex(match[1]),
532
- g: parseIntFromHex(match[2]),
533
- b: parseIntFromHex(match[3]),
534
- format: named ? 'name' : 'hex',
535
- };
536
- }
537
- match = matchers.hex4.exec(color);
538
- if (match) {
539
- return {
540
- r: parseIntFromHex(match[1] + match[1]),
541
- g: parseIntFromHex(match[2] + match[2]),
542
- b: parseIntFromHex(match[3] + match[3]),
543
- a: convertHexToDecimal(match[4] + match[4]),
544
- format: named ? 'name' : 'hex8',
545
- };
546
- }
547
- match = matchers.hex3.exec(color);
548
- if (match) {
549
- return {
550
- r: parseIntFromHex(match[1] + match[1]),
551
- g: parseIntFromHex(match[2] + match[2]),
552
- b: parseIntFromHex(match[3] + match[3]),
553
- format: named ? 'name' : 'hex',
554
- };
555
- }
556
- return false;
557
- }
558
- /**
559
- * Check to see if it looks like a CSS unit
560
- * (see `matchers` above for definition).
561
- */
562
- function isValidCSSUnit(color) {
563
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
564
- }
565
-
566
- var hueStep = 2; // 色相阶梯
567
-
568
- var saturationStep = 0.16; // 饱和度阶梯,浅色部分
569
-
570
- var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
571
-
572
- var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
573
-
574
- var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
575
-
576
- var lightColorCount = 5; // 浅色数量,主色上
577
-
578
- var darkColorCount = 4; // 深色数量,主色下
579
- // 暗色主题颜色映射关系表
580
-
581
- var darkColorMap = [{
582
- index: 7,
583
- opacity: 0.15
584
- }, {
585
- index: 6,
586
- opacity: 0.25
587
- }, {
588
- index: 5,
589
- opacity: 0.3
590
- }, {
591
- index: 5,
592
- opacity: 0.45
593
- }, {
594
- index: 5,
595
- opacity: 0.65
596
- }, {
597
- index: 5,
598
- opacity: 0.85
599
- }, {
600
- index: 4,
601
- opacity: 0.9
602
- }, {
603
- index: 3,
604
- opacity: 0.95
605
- }, {
606
- index: 2,
607
- opacity: 0.97
608
- }, {
609
- index: 1,
610
- opacity: 0.98
611
- }]; // Wrapper function ported from TinyColor.prototype.toHsv
612
- // Keep it here because of `hsv.h * 360`
613
-
614
- function toHsv(_ref) {
615
- var r = _ref.r,
616
- g = _ref.g,
617
- b = _ref.b;
618
- var hsv = rgbToHsv(r, g, b);
619
- return {
620
- h: hsv.h * 360,
621
- s: hsv.s,
622
- v: hsv.v
623
- };
624
- } // Wrapper function ported from TinyColor.prototype.toHexString
625
- // Keep it here because of the prefix `#`
626
-
627
-
628
- function toHex(_ref2) {
629
- var r = _ref2.r,
630
- g = _ref2.g,
631
- b = _ref2.b;
632
- return "#".concat(rgbToHex(r, g, b, false));
633
- } // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
634
- // Amount in range [0, 1]
635
- // Assume color1 & color2 has no alpha, since the following src code did so.
636
-
637
-
638
- function mix(rgb1, rgb2, amount) {
639
- var p = amount / 100;
640
- var rgb = {
641
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
642
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
643
- b: (rgb2.b - rgb1.b) * p + rgb1.b
644
- };
645
- return rgb;
646
- }
647
-
648
- function getHue(hsv, i, light) {
649
- var hue; // 根据色相不同,色相转向不同
650
-
651
- if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
652
- hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
653
- } else {
654
- hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
655
- }
656
-
657
- if (hue < 0) {
658
- hue += 360;
659
- } else if (hue >= 360) {
660
- hue -= 360;
661
- }
662
-
663
- return hue;
664
- }
665
-
666
- function getSaturation(hsv, i, light) {
667
- // grey color don't change saturation
668
- if (hsv.h === 0 && hsv.s === 0) {
669
- return hsv.s;
670
- }
671
-
672
- var saturation;
673
-
674
- if (light) {
675
- saturation = hsv.s - saturationStep * i;
676
- } else if (i === darkColorCount) {
677
- saturation = hsv.s + saturationStep;
678
- } else {
679
- saturation = hsv.s + saturationStep2 * i;
680
- } // 边界值修正
681
-
682
-
683
- if (saturation > 1) {
684
- saturation = 1;
685
- } // 第一格的 s 限制在 0.06-0.1 之间
686
-
687
-
688
- if (light && i === lightColorCount && saturation > 0.1) {
689
- saturation = 0.1;
690
- }
691
-
692
- if (saturation < 0.06) {
693
- saturation = 0.06;
694
- }
695
-
696
- return Number(saturation.toFixed(2));
697
- }
698
-
699
- function getValue(hsv, i, light) {
700
- var value;
701
-
702
- if (light) {
703
- value = hsv.v + brightnessStep1 * i;
704
- } else {
705
- value = hsv.v - brightnessStep2 * i;
706
- }
707
-
708
- if (value > 1) {
709
- value = 1;
710
- }
711
-
712
- return Number(value.toFixed(2));
713
- }
714
-
715
- function generate$1(color) {
716
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
717
- var patterns = [];
718
- var pColor = inputToRGB(color);
719
-
720
- for (var i = lightColorCount; i > 0; i -= 1) {
721
- var hsv = toHsv(pColor);
722
- var colorString = toHex(inputToRGB({
723
- h: getHue(hsv, i, true),
724
- s: getSaturation(hsv, i, true),
725
- v: getValue(hsv, i, true)
726
- }));
727
- patterns.push(colorString);
728
- }
729
-
730
- patterns.push(toHex(pColor));
731
-
732
- for (var _i = 1; _i <= darkColorCount; _i += 1) {
733
- var _hsv = toHsv(pColor);
734
-
735
- var _colorString = toHex(inputToRGB({
736
- h: getHue(_hsv, _i),
737
- s: getSaturation(_hsv, _i),
738
- v: getValue(_hsv, _i)
739
- }));
740
-
741
- patterns.push(_colorString);
742
- } // dark theme patterns
743
-
744
-
745
- if (opts.theme === 'dark') {
746
- return darkColorMap.map(function (_ref3) {
747
- var index = _ref3.index,
748
- opacity = _ref3.opacity;
749
- var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
750
- return darkColorString;
751
- });
752
- }
753
-
754
- return patterns;
755
- }
756
-
757
- var presetPrimaryColors = {
758
- red: '#F5222D',
759
- volcano: '#FA541C',
760
- orange: '#FA8C16',
761
- gold: '#FAAD14',
762
- yellow: '#FADB14',
763
- lime: '#A0D911',
764
- green: '#52C41A',
765
- cyan: '#13C2C2',
766
- blue: '#1890FF',
767
- geekblue: '#2F54EB',
768
- purple: '#722ED1',
769
- magenta: '#EB2F96',
770
- grey: '#666666'
771
- };
772
- var presetPalettes = {};
773
- var presetDarkPalettes = {};
774
- Object.keys(presetPrimaryColors).forEach(function (key) {
775
- presetPalettes[key] = generate$1(presetPrimaryColors[key]);
776
- presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
777
-
778
- presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
779
- theme: 'dark',
780
- backgroundColor: '#141414'
781
- });
782
- presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
783
- });
784
- presetPalettes.red;
785
- presetPalettes.volcano;
786
- presetPalettes.gold;
787
- presetPalettes.orange;
788
- presetPalettes.yellow;
789
- presetPalettes.lime;
790
- presetPalettes.green;
791
- presetPalettes.cyan;
792
- presetPalettes.blue;
793
- presetPalettes.geekblue;
794
- presetPalettes.purple;
795
- presetPalettes.magenta;
796
- presetPalettes.grey;
797
-
798
- // https://github.com/substack/insert-css
799
- var containers = []; // will store container HTMLElement references
800
-
801
- var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
802
-
803
- var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
804
-
805
- function createStyleElement() {
806
- var styleElement = document.createElement('style');
807
- styleElement.setAttribute('type', 'text/css');
808
- return styleElement;
809
- } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
810
-
811
-
812
- function insertCss(css, options) {
813
- options = options || {};
814
-
815
- if (css === undefined) {
816
- throw new Error(usage);
817
- }
818
-
819
- var position = options.prepend === true ? 'prepend' : 'append';
820
- var container = options.container !== undefined ? options.container : document.querySelector('head');
821
- var containerId = containers.indexOf(container); // first time we see this container, create the necessary entries
822
-
823
- if (containerId === -1) {
824
- containerId = containers.push(container) - 1;
825
- styleElements[containerId] = {};
826
- } // try to get the correponding container + position styleElement, create it otherwise
827
-
828
-
829
- var styleElement;
830
-
831
- if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
832
- styleElement = styleElements[containerId][position];
833
- } else {
834
- styleElement = styleElements[containerId][position] = createStyleElement();
835
-
836
- if (position === 'prepend') {
837
- container.insertBefore(styleElement, container.childNodes[0]);
838
- } else {
839
- container.appendChild(styleElement);
840
- }
841
- } // strip potential UTF-8 BOM if css was read from a file
842
-
843
-
844
- if (css.charCodeAt(0) === 0xfeff) {
845
- css = css.substr(1, css.length);
846
- } // actually add the stylesheet
847
-
848
-
849
- if (styleElement.styleSheet) {
850
- styleElement.styleSheet.cssText += css;
851
- } else {
852
- styleElement.textContent += css;
853
- }
854
-
855
- return styleElement;
856
- }
857
-
858
- function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$6(target, key, source[key]); }); } return target; }
859
-
860
- function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
861
- function warn(valid, message) {
862
- // Support uglify
863
- if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
864
- console.error("Warning: ".concat(message));
865
- }
866
- }
867
- function warning(valid, message) {
868
- warn(valid, "[@ant-design/icons-vue] ".concat(message));
869
- } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
870
-
871
- function isIconDefinition(target) {
872
- return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
873
- }
874
- function generate(node, key, rootProps) {
875
- if (!rootProps) {
876
- return vue.h(node.tag, _objectSpread$6({
877
- key: key
878
- }, node.attrs), (node.children || []).map(function (child, index) {
879
- return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
880
- }));
881
- }
882
-
883
- return vue.h(node.tag, _objectSpread$6({
884
- key: key
885
- }, rootProps, node.attrs), (node.children || []).map(function (child, index) {
886
- return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
887
- }));
888
- }
889
- function getSecondaryColor(primaryColor) {
890
- // choose the second color
891
- return generate$1(primaryColor)[0];
892
- }
893
- function normalizeTwoToneColors(twoToneColor) {
894
- if (!twoToneColor) {
895
- return [];
896
- }
897
-
898
- return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
899
- } // These props make sure that the SVG behaviours like general text.
900
- var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
901
- var cssInjectedFlag = false;
902
- var useInsertStyles = function useInsertStyles() {
903
- var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
904
- vue.nextTick(function () {
905
- if (!cssInjectedFlag) {
906
- if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
907
- insertCss(styleStr, {
908
- prepend: true
909
- });
910
- }
911
-
912
- cssInjectedFlag = true;
913
- }
914
- });
915
- };
916
-
917
- var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
918
-
919
- function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
920
-
921
- function _objectWithoutPropertiesLoose$1(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
922
-
923
- function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } return target; }
924
-
925
- function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
926
- var twoToneColorPalette = {
927
- primaryColor: '#333',
928
- secondaryColor: '#E6E6E6',
929
- calculated: false
930
- };
931
-
932
- function setTwoToneColors(_ref) {
933
- var primaryColor = _ref.primaryColor,
934
- secondaryColor = _ref.secondaryColor;
935
- twoToneColorPalette.primaryColor = primaryColor;
936
- twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
937
- twoToneColorPalette.calculated = !!secondaryColor;
938
- }
939
-
940
- function getTwoToneColors() {
941
- return _objectSpread$5({}, twoToneColorPalette);
942
- }
943
-
944
- var IconBase = function IconBase(props, context) {
945
- var _props$context$attrs = _objectSpread$5({}, props, context.attrs),
946
- icon = _props$context$attrs.icon,
947
- primaryColor = _props$context$attrs.primaryColor,
948
- secondaryColor = _props$context$attrs.secondaryColor,
949
- restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
950
-
951
- var colors = twoToneColorPalette;
952
-
953
- if (primaryColor) {
954
- colors = {
955
- primaryColor: primaryColor,
956
- secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
957
- };
958
- }
959
-
960
- useInsertStyles();
961
- warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
962
-
963
- if (!isIconDefinition(icon)) {
964
- return null;
965
- }
966
-
967
- var target = icon;
968
-
969
- if (target && typeof target.icon === 'function') {
970
- target = _objectSpread$5({}, target, {
971
- icon: target.icon(colors.primaryColor, colors.secondaryColor)
972
- });
973
- }
974
-
975
- return generate(target.icon, "svg-".concat(target.name), _objectSpread$5({}, restProps, {
976
- 'data-icon': target.name,
977
- width: '1em',
978
- height: '1em',
979
- fill: 'currentColor',
980
- 'aria-hidden': 'true'
981
- })); // },
982
- };
983
-
984
- IconBase.props = {
985
- icon: Object,
986
- primaryColor: String,
987
- secondaryColor: String,
988
- focusable: String
989
- };
990
- IconBase.inheritAttrs = false;
991
- IconBase.displayName = 'IconBase';
992
- IconBase.getTwoToneColors = getTwoToneColors;
993
- IconBase.setTwoToneColors = setTwoToneColors;
994
- var VueIcon = IconBase;
995
-
996
- function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
997
-
998
- function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
999
-
1000
- function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
1001
-
1002
- function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1003
-
1004
- function _iterableToArrayLimit$1(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1005
-
1006
- function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
1007
- function setTwoToneColor(twoToneColor) {
1008
- var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1009
- _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2),
1010
- primaryColor = _normalizeTwoToneColo2[0],
1011
- secondaryColor = _normalizeTwoToneColo2[1];
1012
-
1013
- return VueIcon.setTwoToneColors({
1014
- primaryColor: primaryColor,
1015
- secondaryColor: secondaryColor
1016
- });
1017
- }
1018
- function getTwoToneColor() {
1019
- var colors = VueIcon.getTwoToneColors();
1020
-
1021
- if (!colors.calculated) {
1022
- return colors.primaryColor;
1023
- }
1024
-
1025
- return [colors.primaryColor, colors.secondaryColor];
1026
- }
1027
-
1028
- var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
1029
-
1030
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1031
-
1032
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1033
-
1034
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1035
-
1036
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1037
-
1038
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1039
-
1040
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1041
-
1042
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$4(target, key, source[key]); }); } return target; }
1043
-
1044
- function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1045
-
1046
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
1047
-
1048
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1049
-
1050
- setTwoToneColor('#1890ff');
1051
-
1052
- var Icon = function Icon(props, context) {
1053
- var _classObj;
1054
-
1055
- var _props$context$attrs = _objectSpread$4({}, props, context.attrs),
1056
- cls = _props$context$attrs["class"],
1057
- icon = _props$context$attrs.icon,
1058
- spin = _props$context$attrs.spin,
1059
- rotate = _props$context$attrs.rotate,
1060
- tabindex = _props$context$attrs.tabindex,
1061
- twoToneColor = _props$context$attrs.twoToneColor,
1062
- onClick = _props$context$attrs.onClick,
1063
- restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
1064
-
1065
- var classObj = (_classObj = {
1066
- anticon: true
1067
- }, _defineProperty$4(_classObj, "anticon-".concat(icon.name), Boolean(icon.name)), _defineProperty$4(_classObj, cls, cls), _classObj);
1068
- var svgClassString = spin === '' || !!spin || icon.name === 'loading' ? 'anticon-spin' : '';
1069
- var iconTabIndex = tabindex;
1070
-
1071
- if (iconTabIndex === undefined && onClick) {
1072
- iconTabIndex = -1;
1073
- restProps.tabindex = iconTabIndex;
1074
- }
1075
-
1076
- var svgStyle = rotate ? {
1077
- msTransform: "rotate(".concat(rotate, "deg)"),
1078
- transform: "rotate(".concat(rotate, "deg)")
1079
- } : undefined;
1080
-
1081
- var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1082
- _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
1083
- primaryColor = _normalizeTwoToneColo2[0],
1084
- secondaryColor = _normalizeTwoToneColo2[1];
1085
-
1086
- return vue.createVNode("span", _objectSpread$4({
1087
- "role": "img",
1088
- "aria-label": icon.name
1089
- }, restProps, {
1090
- "onClick": onClick,
1091
- "class": classObj
1092
- }), [vue.createVNode(VueIcon, {
1093
- "class": svgClassString,
1094
- "icon": icon,
1095
- "primaryColor": primaryColor,
1096
- "secondaryColor": secondaryColor,
1097
- "style": svgStyle
1098
- }, null)]);
1099
- };
1100
-
1101
- Icon.props = {
1102
- spin: Boolean,
1103
- rotate: Number,
1104
- icon: Object,
1105
- twoToneColor: String
1106
- };
1107
- Icon.displayName = 'AntdIcon';
1108
- Icon.inheritAttrs = false;
1109
- Icon.getTwoToneColor = getTwoToneColor;
1110
- Icon.setTwoToneColor = setTwoToneColor;
1111
- var AntdIcon = Icon;
1112
-
1113
- // This icon file is generated automatically.
1114
- var CloseCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, "name": "close-circle", "theme": "filled" };
1115
- var CloseCircleFilledSvg = CloseCircleFilled$2;
1116
-
1117
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
1118
-
1119
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1120
-
1121
- var CloseCircleFilled = function CloseCircleFilled(props, context) {
1122
- var p = _objectSpread$3({}, props, context.attrs);
1123
-
1124
- return vue.createVNode(AntdIcon, _objectSpread$3({}, p, {
1125
- "icon": CloseCircleFilledSvg
1126
- }), null);
1127
- };
1128
-
1129
- CloseCircleFilled.displayName = 'CloseCircleFilled';
1130
- CloseCircleFilled.inheritAttrs = false;
1131
- var CloseCircleFilled$1 = CloseCircleFilled;
1132
-
1133
- // This icon file is generated automatically.
1134
- var CloseOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" };
1135
- var CloseOutlinedSvg = CloseOutlined$2;
1136
-
1137
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } return target; }
1138
-
1139
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1140
-
1141
- var CloseOutlined = function CloseOutlined(props, context) {
1142
- var p = _objectSpread$2({}, props, context.attrs);
1143
-
1144
- return vue.createVNode(AntdIcon, _objectSpread$2({}, p, {
1145
- "icon": CloseOutlinedSvg
1146
- }), null);
1147
- };
1148
-
1149
- CloseOutlined.displayName = 'CloseOutlined';
1150
- CloseOutlined.inheritAttrs = false;
1151
- var CloseOutlined$1 = CloseOutlined;
1152
-
1153
- // This icon file is generated automatically.
1154
- var DownOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
1155
- var DownOutlinedSvg = DownOutlined$2;
1156
-
1157
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
1158
-
1159
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1160
-
1161
- var DownOutlined = function DownOutlined(props, context) {
1162
- var p = _objectSpread$1({}, props, context.attrs);
1163
-
1164
- return vue.createVNode(AntdIcon, _objectSpread$1({}, p, {
1165
- "icon": DownOutlinedSvg
1166
- }), null);
1167
- };
1168
-
1169
- DownOutlined.displayName = 'DownOutlined';
1170
- DownOutlined.inheritAttrs = false;
1171
- var DownOutlined$1 = DownOutlined;
1172
-
1173
- // This icon file is generated automatically.
1174
- var RightOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
1175
- var RightOutlinedSvg = RightOutlined$2;
1176
-
1177
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
1178
-
1179
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1180
-
1181
- var RightOutlined = function RightOutlined(props, context) {
1182
- var p = _objectSpread({}, props, context.attrs);
1183
-
1184
- return vue.createVNode(AntdIcon, _objectSpread({}, p, {
1185
- "icon": RightOutlinedSvg
1186
- }), null);
1187
- };
1188
-
1189
- RightOutlined.displayName = 'RightOutlined';
1190
- RightOutlined.inheritAttrs = false;
1191
- var RightOutlined$1 = RightOutlined;
7
+ var iconsVue = require('@ant-design/icons-vue');
1192
8
 
1193
9
  function multiCascaderComposeProps() {
1194
10
  return {
@@ -1352,7 +168,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1352
168
  tempRes.push({ checked: true });
1353
169
  } else {
1354
170
  let tempRes2 = tempChildren[j];
1355
- let tempIndex2 = props.modelValue.indexOf(tempRes2[props.optionValueName]);
171
+ let tempIndex2 = props.modelValue.indexOf(
172
+ tempRes2[props.optionValueName]
173
+ );
1356
174
  if (tempIndex2 !== -1) {
1357
175
  tempRes.push({ checked: true });
1358
176
  } else {
@@ -1378,7 +196,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1378
196
  if (tempChildren) {
1379
197
  for (let j = 0; j < tempChildren.length; j++) {
1380
198
  let tempRes2 = tempChildren[j];
1381
- let tempIndex2 = props.modelValue.indexOf(tempRes2[props.optionValueName]);
199
+ let tempIndex2 = props.modelValue.indexOf(
200
+ tempRes2[props.optionValueName]
201
+ );
1382
202
  if (path.value[i] && tempRes2[props.optionValueName] === path.value[i][props.optionValueName] && tempIndex2 !== -1) {
1383
203
  parentChecked = true;
1384
204
  break;
@@ -1460,7 +280,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1460
280
  checked.push(tempOption?.[props.optionValueName]);
1461
281
  if (tempOption?.children) {
1462
282
  let allSonValues = getAllSonValues(tempOption.children);
1463
- allSonValues = allSonValues.filter((item) => item !== tempOption?.[props.optionValueName]);
283
+ allSonValues = allSonValues.filter(
284
+ (item) => item !== tempOption?.[props.optionValueName]
285
+ );
1464
286
  unChecked = unChecked.concat(allSonValues);
1465
287
  }
1466
288
  for (let i = level; i > 0; i--) {
@@ -1475,7 +297,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1475
297
  checked.push(tempOption2[props.optionValueName]);
1476
298
  if (tempOption2.children) {
1477
299
  let allSonValues = getAllSonValues(tempOption2.children);
1478
- allSonValues = allSonValues.filter((item) => item !== tempOption2[props.optionValueName]);
300
+ allSonValues = allSonValues.filter(
301
+ (item) => item !== tempOption2[props.optionValueName]
302
+ );
1479
303
  unChecked = unChecked.concat(allSonValues);
1480
304
  }
1481
305
  }
@@ -1501,7 +325,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1501
325
  if (tempStatus.checked) {
1502
326
  checked = [];
1503
327
  } else {
1504
- checked = modulersOptions.value[level].children?.map((item) => item[props.optionValueName]) || [];
328
+ checked = modulersOptions.value[level].children?.map(
329
+ (item) => item[props.optionValueName]
330
+ ) || [];
1505
331
  }
1506
332
  } else {
1507
333
  if (tempStatus.checked) {
@@ -1524,7 +350,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1524
350
  checked.push(tempOption[props.optionValueName]);
1525
351
  if (tempOption.children) {
1526
352
  let allSonValues = getAllSonValues(tempOption.children);
1527
- allSonValues = allSonValues.filter((item) => item !== tempOption[props.optionValueName]);
353
+ allSonValues = allSonValues.filter(
354
+ (item) => item !== tempOption[props.optionValueName]
355
+ );
1528
356
  unChecked = unChecked.concat(allSonValues);
1529
357
  }
1530
358
  for (let i = level; i > 0; i--) {
@@ -1539,7 +367,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1539
367
  checked.push(tempOption2[props.optionValueName]);
1540
368
  if (tempOption2.children) {
1541
369
  let allSonValues = getAllSonValues(tempOption2.children);
1542
- allSonValues = allSonValues.filter((item) => item !== tempOption2[props.optionValueName]);
370
+ allSonValues = allSonValues.filter(
371
+ (item) => item !== tempOption2[props.optionValueName]
372
+ );
1543
373
  unChecked = unChecked.concat(allSonValues);
1544
374
  }
1545
375
  }
@@ -1625,7 +455,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1625
455
  return vue.openBlock(), vue.createElementBlock("div", {
1626
456
  key: index,
1627
457
  class: vue.normalizeClass(["bm-multi-cascader-item", {
1628
- "is-active": path.value.find((item) => option[props.optionValueName] === item[props.optionValueName])
458
+ "is-active": path.value.find(
459
+ (item) => option[props.optionValueName] === item[props.optionValueName]
460
+ )
1629
461
  }]),
1630
462
  onClick: ($event) => handleClick(option, level, index)
1631
463
  }, [
@@ -1644,7 +476,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1644
476
  }, 1024),
1645
477
  vue.createElementVNode("span", _hoisted_16, [
1646
478
  vue.createElementVNode("span", _hoisted_17, vue.toDisplayString(option[props.optionLabelName]), 1),
1647
- option.children ? (vue.openBlock(), vue.createBlock(vue.unref(RightOutlined$1), {
479
+ option.children ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.RightOutlined), {
1648
480
  key: 0,
1649
481
  class: "bm-multi-cascader-item-caret"
1650
482
  })) : vue.createCommentVNode("v-if", true)
@@ -1680,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1680
512
  class: "bm-multi-cascader-tag-close",
1681
513
  onClick: vue.withModifiers(($event) => removeItem(item[props.optionValueName]), ["stop"])
1682
514
  }, [
1683
- vue.createVNode(vue.unref(CloseOutlined$1), { class: "bm-multi-cascader-tag-close-inner" })
515
+ vue.createVNode(vue.unref(iconsVue.CloseOutlined), { class: "bm-multi-cascader-tag-close-inner" })
1684
516
  ], 8, _hoisted_6)
1685
517
  ]);
1686
518
  }), 128)),
@@ -1692,12 +524,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1692
524
  ]),
1693
525
  vue.createElementVNode("div", _hoisted_10, [
1694
526
  props.allowClear && props.modelValue.length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1695
- vue.createVNode(vue.unref(DownOutlined$1), { class: "bm-multi-cascader-icon bm-multi-cascader-caret" }),
1696
- vue.createVNode(vue.unref(CloseCircleFilled$1), {
527
+ vue.createVNode(vue.unref(iconsVue.DownOutlined), { class: "bm-multi-cascader-icon bm-multi-cascader-caret" }),
528
+ vue.createVNode(vue.unref(iconsVue.CloseCircleFilled), {
1697
529
  class: "bm-multi-cascader-icon bm-multi-cascader-remove-all",
1698
530
  onClick: vue.withModifiers(removeAll, ["stop"])
1699
531
  }, null, 8, ["onClick"])
1700
- ], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(DownOutlined$1), { key: 1 }))
532
+ ], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DownOutlined), { key: 1 }))
1701
533
  ])
1702
534
  ])
1703
535
  ]),