bm-admin-ui 1.0.0-alpha → 1.0.1-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 (126) hide show
  1. package/es/components/button/index.d.ts +9 -9
  2. package/es/components/button/index.js +1 -1
  3. package/es/components/button/src/button.vue.d.ts +9 -9
  4. package/es/components/float-table/index.d.ts +5 -0
  5. package/es/components/float-table/index.js +448 -0
  6. package/es/components/float-table/src/float-table.vue.d.ts +500 -0
  7. package/es/components/flow-designer/index.js +1 -1
  8. package/es/components/form-designer/index.js +1 -1
  9. package/es/components/index.d.ts +7 -0
  10. package/es/components/index.js +7 -0
  11. package/es/components/multi-cascader-compose/index.d.ts +135 -0
  12. package/es/components/multi-cascader-compose/index.js +1699 -0
  13. package/es/components/multi-cascader-compose/src/multi-cascader-compose.vue.d.ts +135 -0
  14. package/es/components/multi-cascader-compose/src/props.d.ts +32 -0
  15. package/es/components/multi-cascader-compose/types.d.ts +10 -0
  16. package/es/components/over-tooltips/index.d.ts +35 -0
  17. package/es/components/over-tooltips/index.js +117 -0
  18. package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +34 -0
  19. package/es/components/search-filter/index.d.ts +1 -1
  20. package/es/components/search-filter/index.js +593 -29
  21. package/es/components/search-filter/src/search-filter.vue.d.ts +1 -1
  22. package/es/components/shops-filter/index.d.ts +99 -0
  23. package/es/components/shops-filter/index.js +1614 -0
  24. package/es/components/shops-filter/src/shops-filter.d.ts +25 -0
  25. package/es/components/shops-filter/src/shops-filter.vue.d.ts +98 -0
  26. package/es/components/staffs-selector/index.d.ts +82 -0
  27. package/es/components/staffs-selector/index.js +1991 -0
  28. package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +79 -0
  29. package/es/components/staffs-selector/src/radioCmp.vue.d.ts +31 -0
  30. package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +81 -0
  31. package/es/components/staffs-selector/src/variedCmp.vue.d.ts +62 -0
  32. package/es/components/timeline/index.d.ts +93 -0
  33. package/es/components/timeline/index.js +164 -0
  34. package/es/components/timeline/src/props.d.ts +20 -0
  35. package/es/components/timeline/src/timeline-item.vue.d.ts +51 -0
  36. package/es/components/timeline/src/timeline.vue.d.ts +42 -0
  37. package/es/components/upload/index.d.ts +126 -0
  38. package/es/components/upload/index.js +1839 -0
  39. package/es/components/upload/src/icons.d.ts +13 -0
  40. package/es/components/upload/src/upload.vue.d.ts +125 -0
  41. package/es/components/upload/utils/index.d.ts +7 -0
  42. package/index.esm.js +62925 -1235
  43. package/index.js +63078 -1380
  44. package/lib/components/button/index.d.ts +9 -9
  45. package/lib/components/button/index.js +1 -1
  46. package/lib/components/button/src/button.vue.d.ts +9 -9
  47. package/lib/components/float-table/index.d.ts +5 -0
  48. package/lib/components/float-table/index.js +459 -0
  49. package/lib/components/float-table/src/float-table.vue.d.ts +500 -0
  50. package/lib/components/flow-designer/index.js +1 -1
  51. package/lib/components/form-designer/index.js +1 -1
  52. package/lib/components/index.d.ts +7 -0
  53. package/lib/components/index.js +49 -0
  54. package/lib/components/multi-cascader-compose/index.d.ts +135 -0
  55. package/lib/components/multi-cascader-compose/index.js +1704 -0
  56. package/lib/components/multi-cascader-compose/src/multi-cascader-compose.vue.d.ts +135 -0
  57. package/lib/components/multi-cascader-compose/src/props.d.ts +32 -0
  58. package/lib/components/multi-cascader-compose/types.d.ts +10 -0
  59. package/lib/components/over-tooltips/index.d.ts +35 -0
  60. package/lib/components/over-tooltips/index.js +122 -0
  61. package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +34 -0
  62. package/lib/components/search-filter/index.d.ts +1 -1
  63. package/lib/components/search-filter/index.js +592 -28
  64. package/lib/components/search-filter/src/search-filter.vue.d.ts +1 -1
  65. package/lib/components/shops-filter/index.d.ts +99 -0
  66. package/lib/components/shops-filter/index.js +1626 -0
  67. package/lib/components/shops-filter/src/shops-filter.d.ts +25 -0
  68. package/lib/components/shops-filter/src/shops-filter.vue.d.ts +98 -0
  69. package/lib/components/staffs-selector/index.d.ts +82 -0
  70. package/lib/components/staffs-selector/index.js +2005 -0
  71. package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +79 -0
  72. package/lib/components/staffs-selector/src/radioCmp.vue.d.ts +31 -0
  73. package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +81 -0
  74. package/lib/components/staffs-selector/src/variedCmp.vue.d.ts +62 -0
  75. package/lib/components/timeline/index.d.ts +93 -0
  76. package/lib/components/timeline/index.js +170 -0
  77. package/lib/components/timeline/src/props.d.ts +20 -0
  78. package/lib/components/timeline/src/timeline-item.vue.d.ts +51 -0
  79. package/lib/components/timeline/src/timeline.vue.d.ts +42 -0
  80. package/lib/components/upload/index.d.ts +126 -0
  81. package/lib/components/upload/index.js +1844 -0
  82. package/lib/components/upload/src/icons.d.ts +13 -0
  83. package/lib/components/upload/src/upload.vue.d.ts +125 -0
  84. package/lib/components/upload/utils/index.d.ts +7 -0
  85. package/package.json +6 -3
  86. package/theme-chalk/button.css +1 -1
  87. package/theme-chalk/float-table.css +1 -0
  88. package/theme-chalk/floating-vue.css +1 -0
  89. package/theme-chalk/flow-designer.css +1 -1
  90. package/theme-chalk/index.css +1 -1
  91. package/theme-chalk/multi-cascader-compose.css +1 -0
  92. package/theme-chalk/over-tooltips.css +1 -0
  93. package/theme-chalk/search-filter.css +1 -1
  94. package/theme-chalk/shops-filter.css +1 -0
  95. package/theme-chalk/staffs-selector.css +1 -0
  96. package/theme-chalk/timeline.css +1 -0
  97. package/theme-chalk/upload.css +1 -0
  98. package/types/components/button/index.d.ts +9 -9
  99. package/types/components/button/src/button.vue.d.ts +9 -9
  100. package/types/components/float-table/index.d.ts +5 -0
  101. package/types/components/float-table/src/float-table.vue.d.ts +500 -0
  102. package/types/components/index.d.ts +7 -0
  103. package/types/components/multi-cascader-compose/index.d.ts +135 -0
  104. package/types/components/multi-cascader-compose/src/multi-cascader-compose.vue.d.ts +135 -0
  105. package/types/components/multi-cascader-compose/src/props.d.ts +32 -0
  106. package/types/components/multi-cascader-compose/types.d.ts +10 -0
  107. package/types/components/over-tooltips/index.d.ts +35 -0
  108. package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +34 -0
  109. package/types/components/search-filter/index.d.ts +1 -1
  110. package/types/components/search-filter/src/search-filter.vue.d.ts +1 -1
  111. package/types/components/shops-filter/index.d.ts +99 -0
  112. package/types/components/shops-filter/src/shops-filter.d.ts +25 -0
  113. package/types/components/shops-filter/src/shops-filter.vue.d.ts +98 -0
  114. package/types/components/staffs-selector/index.d.ts +82 -0
  115. package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +79 -0
  116. package/types/components/staffs-selector/src/radioCmp.vue.d.ts +31 -0
  117. package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +81 -0
  118. package/types/components/staffs-selector/src/variedCmp.vue.d.ts +62 -0
  119. package/types/components/timeline/index.d.ts +93 -0
  120. package/types/components/timeline/src/props.d.ts +20 -0
  121. package/types/components/timeline/src/timeline-item.vue.d.ts +51 -0
  122. package/types/components/timeline/src/timeline.vue.d.ts +42 -0
  123. package/types/components/upload/index.d.ts +126 -0
  124. package/types/components/upload/src/icons.d.ts +13 -0
  125. package/types/components/upload/src/upload.vue.d.ts +125 -0
  126. package/types/components/upload/utils/index.d.ts +7 -0
@@ -0,0 +1,1614 @@
1
+ import { withInstall } from 'bm-admin-ui/es/utils/with-install';
2
+ import { h, nextTick, createVNode, defineComponent, reactive, watch, onMounted, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeStyle, toDisplayString, normalizeClass, Fragment, createBlock, withCtx, renderList, createCommentVNode, withDirectives, vShow, createTextVNode } from 'vue';
3
+ import { InputSearch } from 'ant-design-vue/lib/input';
4
+ import Checkbox from 'ant-design-vue/lib/checkbox';
5
+ import Button from 'ant-design-vue/lib/button';
6
+ import Popover from 'ant-design-vue/lib/popover';
7
+ import Empty from 'ant-design-vue/lib/empty';
8
+
9
+ /**
10
+ * Take input from [0, n] and return it as [0, 1]
11
+ * @hidden
12
+ */
13
+ function bound01(n, max) {
14
+ if (isOnePointZero(n)) {
15
+ n = '100%';
16
+ }
17
+ var isPercent = isPercentage(n);
18
+ n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
19
+ // Automatically convert percentage into number
20
+ if (isPercent) {
21
+ n = parseInt(String(n * max), 10) / 100;
22
+ }
23
+ // Handle floating point rounding errors
24
+ if (Math.abs(n - max) < 0.000001) {
25
+ return 1;
26
+ }
27
+ // Convert into [0, 1] range if it isn't already
28
+ if (max === 360) {
29
+ // If n is a hue given in degrees,
30
+ // wrap around out-of-range values into [0, 360] range
31
+ // then convert into [0, 1].
32
+ n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
33
+ }
34
+ else {
35
+ // If n not a hue given in degrees
36
+ // Convert into [0, 1] range if it isn't already.
37
+ n = (n % max) / parseFloat(String(max));
38
+ }
39
+ return n;
40
+ }
41
+ /**
42
+ * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
43
+ * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
44
+ * @hidden
45
+ */
46
+ function isOnePointZero(n) {
47
+ return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
48
+ }
49
+ /**
50
+ * Check to see if string passed in is a percentage
51
+ * @hidden
52
+ */
53
+ function isPercentage(n) {
54
+ return typeof n === 'string' && n.indexOf('%') !== -1;
55
+ }
56
+ /**
57
+ * Return a valid alpha value [0,1] with all invalid values being set to 1
58
+ * @hidden
59
+ */
60
+ function boundAlpha(a) {
61
+ a = parseFloat(a);
62
+ if (isNaN(a) || a < 0 || a > 1) {
63
+ a = 1;
64
+ }
65
+ return a;
66
+ }
67
+ /**
68
+ * Replace a decimal with it's percentage value
69
+ * @hidden
70
+ */
71
+ function convertToPercentage(n) {
72
+ if (n <= 1) {
73
+ return Number(n) * 100 + "%";
74
+ }
75
+ return n;
76
+ }
77
+ /**
78
+ * Force a hex value to have 2 characters
79
+ * @hidden
80
+ */
81
+ function pad2(c) {
82
+ return c.length === 1 ? '0' + c : String(c);
83
+ }
84
+
85
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
86
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
87
+ /**
88
+ * Handle bounds / percentage checking to conform to CSS color spec
89
+ * <http://www.w3.org/TR/css3-color/>
90
+ * *Assumes:* r, g, b in [0, 255] or [0, 1]
91
+ * *Returns:* { r, g, b } in [0, 255]
92
+ */
93
+ function rgbToRgb(r, g, b) {
94
+ return {
95
+ r: bound01(r, 255) * 255,
96
+ g: bound01(g, 255) * 255,
97
+ b: bound01(b, 255) * 255,
98
+ };
99
+ }
100
+ function hue2rgb(p, q, t) {
101
+ if (t < 0) {
102
+ t += 1;
103
+ }
104
+ if (t > 1) {
105
+ t -= 1;
106
+ }
107
+ if (t < 1 / 6) {
108
+ return p + (q - p) * (6 * t);
109
+ }
110
+ if (t < 1 / 2) {
111
+ return q;
112
+ }
113
+ if (t < 2 / 3) {
114
+ return p + (q - p) * (2 / 3 - t) * 6;
115
+ }
116
+ return p;
117
+ }
118
+ /**
119
+ * Converts an HSL color value to RGB.
120
+ *
121
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
122
+ * *Returns:* { r, g, b } in the set [0, 255]
123
+ */
124
+ function hslToRgb(h, s, l) {
125
+ var r;
126
+ var g;
127
+ var b;
128
+ h = bound01(h, 360);
129
+ s = bound01(s, 100);
130
+ l = bound01(l, 100);
131
+ if (s === 0) {
132
+ // achromatic
133
+ g = l;
134
+ b = l;
135
+ r = l;
136
+ }
137
+ else {
138
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
139
+ var p = 2 * l - q;
140
+ r = hue2rgb(p, q, h + 1 / 3);
141
+ g = hue2rgb(p, q, h);
142
+ b = hue2rgb(p, q, h - 1 / 3);
143
+ }
144
+ return { r: r * 255, g: g * 255, b: b * 255 };
145
+ }
146
+ /**
147
+ * Converts an RGB color value to HSV
148
+ *
149
+ * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
150
+ * *Returns:* { h, s, v } in [0,1]
151
+ */
152
+ function rgbToHsv(r, g, b) {
153
+ r = bound01(r, 255);
154
+ g = bound01(g, 255);
155
+ b = bound01(b, 255);
156
+ var max = Math.max(r, g, b);
157
+ var min = Math.min(r, g, b);
158
+ var h = 0;
159
+ var v = max;
160
+ var d = max - min;
161
+ var s = max === 0 ? 0 : d / max;
162
+ if (max === min) {
163
+ h = 0; // achromatic
164
+ }
165
+ else {
166
+ switch (max) {
167
+ case r:
168
+ h = (g - b) / d + (g < b ? 6 : 0);
169
+ break;
170
+ case g:
171
+ h = (b - r) / d + 2;
172
+ break;
173
+ case b:
174
+ h = (r - g) / d + 4;
175
+ break;
176
+ }
177
+ h /= 6;
178
+ }
179
+ return { h: h, s: s, v: v };
180
+ }
181
+ /**
182
+ * Converts an HSV color value to RGB.
183
+ *
184
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
185
+ * *Returns:* { r, g, b } in the set [0, 255]
186
+ */
187
+ function hsvToRgb(h, s, v) {
188
+ h = bound01(h, 360) * 6;
189
+ s = bound01(s, 100);
190
+ v = bound01(v, 100);
191
+ var i = Math.floor(h);
192
+ var f = h - i;
193
+ var p = v * (1 - s);
194
+ var q = v * (1 - f * s);
195
+ var t = v * (1 - (1 - f) * s);
196
+ var mod = i % 6;
197
+ var r = [v, q, p, p, t, v][mod];
198
+ var g = [t, v, v, q, p, p][mod];
199
+ var b = [p, p, t, v, v, q][mod];
200
+ return { r: r * 255, g: g * 255, b: b * 255 };
201
+ }
202
+ /**
203
+ * Converts an RGB color to hex
204
+ *
205
+ * Assumes r, g, and b are contained in the set [0, 255]
206
+ * Returns a 3 or 6 character hex
207
+ */
208
+ function rgbToHex(r, g, b, allow3Char) {
209
+ var hex = [
210
+ pad2(Math.round(r).toString(16)),
211
+ pad2(Math.round(g).toString(16)),
212
+ pad2(Math.round(b).toString(16)),
213
+ ];
214
+ // Return a 3 character hex if possible
215
+ if (allow3Char &&
216
+ hex[0].startsWith(hex[0].charAt(1)) &&
217
+ hex[1].startsWith(hex[1].charAt(1)) &&
218
+ hex[2].startsWith(hex[2].charAt(1))) {
219
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
220
+ }
221
+ return hex.join('');
222
+ }
223
+ /** Converts a hex value to a decimal */
224
+ function convertHexToDecimal(h) {
225
+ return parseIntFromHex(h) / 255;
226
+ }
227
+ /** Parse a base-16 hex value into a base-10 integer */
228
+ function parseIntFromHex(val) {
229
+ return parseInt(val, 16);
230
+ }
231
+
232
+ // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
233
+ /**
234
+ * @hidden
235
+ */
236
+ var names = {
237
+ aliceblue: '#f0f8ff',
238
+ antiquewhite: '#faebd7',
239
+ aqua: '#00ffff',
240
+ aquamarine: '#7fffd4',
241
+ azure: '#f0ffff',
242
+ beige: '#f5f5dc',
243
+ bisque: '#ffe4c4',
244
+ black: '#000000',
245
+ blanchedalmond: '#ffebcd',
246
+ blue: '#0000ff',
247
+ blueviolet: '#8a2be2',
248
+ brown: '#a52a2a',
249
+ burlywood: '#deb887',
250
+ cadetblue: '#5f9ea0',
251
+ chartreuse: '#7fff00',
252
+ chocolate: '#d2691e',
253
+ coral: '#ff7f50',
254
+ cornflowerblue: '#6495ed',
255
+ cornsilk: '#fff8dc',
256
+ crimson: '#dc143c',
257
+ cyan: '#00ffff',
258
+ darkblue: '#00008b',
259
+ darkcyan: '#008b8b',
260
+ darkgoldenrod: '#b8860b',
261
+ darkgray: '#a9a9a9',
262
+ darkgreen: '#006400',
263
+ darkgrey: '#a9a9a9',
264
+ darkkhaki: '#bdb76b',
265
+ darkmagenta: '#8b008b',
266
+ darkolivegreen: '#556b2f',
267
+ darkorange: '#ff8c00',
268
+ darkorchid: '#9932cc',
269
+ darkred: '#8b0000',
270
+ darksalmon: '#e9967a',
271
+ darkseagreen: '#8fbc8f',
272
+ darkslateblue: '#483d8b',
273
+ darkslategray: '#2f4f4f',
274
+ darkslategrey: '#2f4f4f',
275
+ darkturquoise: '#00ced1',
276
+ darkviolet: '#9400d3',
277
+ deeppink: '#ff1493',
278
+ deepskyblue: '#00bfff',
279
+ dimgray: '#696969',
280
+ dimgrey: '#696969',
281
+ dodgerblue: '#1e90ff',
282
+ firebrick: '#b22222',
283
+ floralwhite: '#fffaf0',
284
+ forestgreen: '#228b22',
285
+ fuchsia: '#ff00ff',
286
+ gainsboro: '#dcdcdc',
287
+ ghostwhite: '#f8f8ff',
288
+ goldenrod: '#daa520',
289
+ gold: '#ffd700',
290
+ gray: '#808080',
291
+ green: '#008000',
292
+ greenyellow: '#adff2f',
293
+ grey: '#808080',
294
+ honeydew: '#f0fff0',
295
+ hotpink: '#ff69b4',
296
+ indianred: '#cd5c5c',
297
+ indigo: '#4b0082',
298
+ ivory: '#fffff0',
299
+ khaki: '#f0e68c',
300
+ lavenderblush: '#fff0f5',
301
+ lavender: '#e6e6fa',
302
+ lawngreen: '#7cfc00',
303
+ lemonchiffon: '#fffacd',
304
+ lightblue: '#add8e6',
305
+ lightcoral: '#f08080',
306
+ lightcyan: '#e0ffff',
307
+ lightgoldenrodyellow: '#fafad2',
308
+ lightgray: '#d3d3d3',
309
+ lightgreen: '#90ee90',
310
+ lightgrey: '#d3d3d3',
311
+ lightpink: '#ffb6c1',
312
+ lightsalmon: '#ffa07a',
313
+ lightseagreen: '#20b2aa',
314
+ lightskyblue: '#87cefa',
315
+ lightslategray: '#778899',
316
+ lightslategrey: '#778899',
317
+ lightsteelblue: '#b0c4de',
318
+ lightyellow: '#ffffe0',
319
+ lime: '#00ff00',
320
+ limegreen: '#32cd32',
321
+ linen: '#faf0e6',
322
+ magenta: '#ff00ff',
323
+ maroon: '#800000',
324
+ mediumaquamarine: '#66cdaa',
325
+ mediumblue: '#0000cd',
326
+ mediumorchid: '#ba55d3',
327
+ mediumpurple: '#9370db',
328
+ mediumseagreen: '#3cb371',
329
+ mediumslateblue: '#7b68ee',
330
+ mediumspringgreen: '#00fa9a',
331
+ mediumturquoise: '#48d1cc',
332
+ mediumvioletred: '#c71585',
333
+ midnightblue: '#191970',
334
+ mintcream: '#f5fffa',
335
+ mistyrose: '#ffe4e1',
336
+ moccasin: '#ffe4b5',
337
+ navajowhite: '#ffdead',
338
+ navy: '#000080',
339
+ oldlace: '#fdf5e6',
340
+ olive: '#808000',
341
+ olivedrab: '#6b8e23',
342
+ orange: '#ffa500',
343
+ orangered: '#ff4500',
344
+ orchid: '#da70d6',
345
+ palegoldenrod: '#eee8aa',
346
+ palegreen: '#98fb98',
347
+ paleturquoise: '#afeeee',
348
+ palevioletred: '#db7093',
349
+ papayawhip: '#ffefd5',
350
+ peachpuff: '#ffdab9',
351
+ peru: '#cd853f',
352
+ pink: '#ffc0cb',
353
+ plum: '#dda0dd',
354
+ powderblue: '#b0e0e6',
355
+ purple: '#800080',
356
+ rebeccapurple: '#663399',
357
+ red: '#ff0000',
358
+ rosybrown: '#bc8f8f',
359
+ royalblue: '#4169e1',
360
+ saddlebrown: '#8b4513',
361
+ salmon: '#fa8072',
362
+ sandybrown: '#f4a460',
363
+ seagreen: '#2e8b57',
364
+ seashell: '#fff5ee',
365
+ sienna: '#a0522d',
366
+ silver: '#c0c0c0',
367
+ skyblue: '#87ceeb',
368
+ slateblue: '#6a5acd',
369
+ slategray: '#708090',
370
+ slategrey: '#708090',
371
+ snow: '#fffafa',
372
+ springgreen: '#00ff7f',
373
+ steelblue: '#4682b4',
374
+ tan: '#d2b48c',
375
+ teal: '#008080',
376
+ thistle: '#d8bfd8',
377
+ tomato: '#ff6347',
378
+ turquoise: '#40e0d0',
379
+ violet: '#ee82ee',
380
+ wheat: '#f5deb3',
381
+ white: '#ffffff',
382
+ whitesmoke: '#f5f5f5',
383
+ yellow: '#ffff00',
384
+ yellowgreen: '#9acd32',
385
+ };
386
+
387
+ /**
388
+ * Given a string or object, convert that input to RGB
389
+ *
390
+ * Possible string inputs:
391
+ * ```
392
+ * "red"
393
+ * "#f00" or "f00"
394
+ * "#ff0000" or "ff0000"
395
+ * "#ff000000" or "ff000000"
396
+ * "rgb 255 0 0" or "rgb (255, 0, 0)"
397
+ * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
398
+ * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
399
+ * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
400
+ * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
401
+ * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
402
+ * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
403
+ * ```
404
+ */
405
+ function inputToRGB(color) {
406
+ var rgb = { r: 0, g: 0, b: 0 };
407
+ var a = 1;
408
+ var s = null;
409
+ var v = null;
410
+ var l = null;
411
+ var ok = false;
412
+ var format = false;
413
+ if (typeof color === 'string') {
414
+ color = stringInputToObject(color);
415
+ }
416
+ if (typeof color === 'object') {
417
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
418
+ rgb = rgbToRgb(color.r, color.g, color.b);
419
+ ok = true;
420
+ format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
421
+ }
422
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
423
+ s = convertToPercentage(color.s);
424
+ v = convertToPercentage(color.v);
425
+ rgb = hsvToRgb(color.h, s, v);
426
+ ok = true;
427
+ format = 'hsv';
428
+ }
429
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
430
+ s = convertToPercentage(color.s);
431
+ l = convertToPercentage(color.l);
432
+ rgb = hslToRgb(color.h, s, l);
433
+ ok = true;
434
+ format = 'hsl';
435
+ }
436
+ if (Object.prototype.hasOwnProperty.call(color, 'a')) {
437
+ a = color.a;
438
+ }
439
+ }
440
+ a = boundAlpha(a);
441
+ return {
442
+ ok: ok,
443
+ format: color.format || format,
444
+ r: Math.min(255, Math.max(rgb.r, 0)),
445
+ g: Math.min(255, Math.max(rgb.g, 0)),
446
+ b: Math.min(255, Math.max(rgb.b, 0)),
447
+ a: a,
448
+ };
449
+ }
450
+ // <http://www.w3.org/TR/css3-values/#integers>
451
+ var CSS_INTEGER = '[-\\+]?\\d+%?';
452
+ // <http://www.w3.org/TR/css3-values/#number-value>
453
+ var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
454
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
455
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
456
+ // Actual matching.
457
+ // Parentheses and commas are optional, but not required.
458
+ // Whitespace can take the place of commas or opening paren
459
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
460
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
461
+ var matchers = {
462
+ CSS_UNIT: new RegExp(CSS_UNIT),
463
+ rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
464
+ rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
465
+ hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
466
+ hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
467
+ hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
468
+ hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
469
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
470
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
471
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
472
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
473
+ };
474
+ /**
475
+ * Permissive string parsing. Take in a number of formats, and output an object
476
+ * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
477
+ */
478
+ function stringInputToObject(color) {
479
+ color = color.trim().toLowerCase();
480
+ if (color.length === 0) {
481
+ return false;
482
+ }
483
+ var named = false;
484
+ if (names[color]) {
485
+ color = names[color];
486
+ named = true;
487
+ }
488
+ else if (color === 'transparent') {
489
+ return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
490
+ }
491
+ // Try to match string input using regular expressions.
492
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
493
+ // Just return an object and let the conversion functions handle that.
494
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
495
+ var match = matchers.rgb.exec(color);
496
+ if (match) {
497
+ return { r: match[1], g: match[2], b: match[3] };
498
+ }
499
+ match = matchers.rgba.exec(color);
500
+ if (match) {
501
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
502
+ }
503
+ match = matchers.hsl.exec(color);
504
+ if (match) {
505
+ return { h: match[1], s: match[2], l: match[3] };
506
+ }
507
+ match = matchers.hsla.exec(color);
508
+ if (match) {
509
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
510
+ }
511
+ match = matchers.hsv.exec(color);
512
+ if (match) {
513
+ return { h: match[1], s: match[2], v: match[3] };
514
+ }
515
+ match = matchers.hsva.exec(color);
516
+ if (match) {
517
+ return { h: match[1], s: match[2], v: match[3], a: match[4] };
518
+ }
519
+ match = matchers.hex8.exec(color);
520
+ if (match) {
521
+ return {
522
+ r: parseIntFromHex(match[1]),
523
+ g: parseIntFromHex(match[2]),
524
+ b: parseIntFromHex(match[3]),
525
+ a: convertHexToDecimal(match[4]),
526
+ format: named ? 'name' : 'hex8',
527
+ };
528
+ }
529
+ match = matchers.hex6.exec(color);
530
+ if (match) {
531
+ return {
532
+ r: parseIntFromHex(match[1]),
533
+ g: parseIntFromHex(match[2]),
534
+ b: parseIntFromHex(match[3]),
535
+ format: named ? 'name' : 'hex',
536
+ };
537
+ }
538
+ match = matchers.hex4.exec(color);
539
+ if (match) {
540
+ return {
541
+ r: parseIntFromHex(match[1] + match[1]),
542
+ g: parseIntFromHex(match[2] + match[2]),
543
+ b: parseIntFromHex(match[3] + match[3]),
544
+ a: convertHexToDecimal(match[4] + match[4]),
545
+ format: named ? 'name' : 'hex8',
546
+ };
547
+ }
548
+ match = matchers.hex3.exec(color);
549
+ if (match) {
550
+ return {
551
+ r: parseIntFromHex(match[1] + match[1]),
552
+ g: parseIntFromHex(match[2] + match[2]),
553
+ b: parseIntFromHex(match[3] + match[3]),
554
+ format: named ? 'name' : 'hex',
555
+ };
556
+ }
557
+ return false;
558
+ }
559
+ /**
560
+ * Check to see if it looks like a CSS unit
561
+ * (see `matchers` above for definition).
562
+ */
563
+ function isValidCSSUnit(color) {
564
+ return Boolean(matchers.CSS_UNIT.exec(String(color)));
565
+ }
566
+
567
+ var hueStep = 2; // 色相阶梯
568
+
569
+ var saturationStep = 0.16; // 饱和度阶梯,浅色部分
570
+
571
+ var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
572
+
573
+ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
574
+
575
+ var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
576
+
577
+ var lightColorCount = 5; // 浅色数量,主色上
578
+
579
+ var darkColorCount = 4; // 深色数量,主色下
580
+ // 暗色主题颜色映射关系表
581
+
582
+ var darkColorMap = [{
583
+ index: 7,
584
+ opacity: 0.15
585
+ }, {
586
+ index: 6,
587
+ opacity: 0.25
588
+ }, {
589
+ index: 5,
590
+ opacity: 0.3
591
+ }, {
592
+ index: 5,
593
+ opacity: 0.45
594
+ }, {
595
+ index: 5,
596
+ opacity: 0.65
597
+ }, {
598
+ index: 5,
599
+ opacity: 0.85
600
+ }, {
601
+ index: 4,
602
+ opacity: 0.9
603
+ }, {
604
+ index: 3,
605
+ opacity: 0.95
606
+ }, {
607
+ index: 2,
608
+ opacity: 0.97
609
+ }, {
610
+ index: 1,
611
+ opacity: 0.98
612
+ }]; // Wrapper function ported from TinyColor.prototype.toHsv
613
+ // Keep it here because of `hsv.h * 360`
614
+
615
+ function toHsv(_ref) {
616
+ var r = _ref.r,
617
+ g = _ref.g,
618
+ b = _ref.b;
619
+ var hsv = rgbToHsv(r, g, b);
620
+ return {
621
+ h: hsv.h * 360,
622
+ s: hsv.s,
623
+ v: hsv.v
624
+ };
625
+ } // Wrapper function ported from TinyColor.prototype.toHexString
626
+ // Keep it here because of the prefix `#`
627
+
628
+
629
+ function toHex(_ref2) {
630
+ var r = _ref2.r,
631
+ g = _ref2.g,
632
+ b = _ref2.b;
633
+ return "#".concat(rgbToHex(r, g, b, false));
634
+ } // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
635
+ // Amount in range [0, 1]
636
+ // Assume color1 & color2 has no alpha, since the following src code did so.
637
+
638
+
639
+ function mix(rgb1, rgb2, amount) {
640
+ var p = amount / 100;
641
+ var rgb = {
642
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
643
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
644
+ b: (rgb2.b - rgb1.b) * p + rgb1.b
645
+ };
646
+ return rgb;
647
+ }
648
+
649
+ function getHue(hsv, i, light) {
650
+ var hue; // 根据色相不同,色相转向不同
651
+
652
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
653
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
654
+ } else {
655
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
656
+ }
657
+
658
+ if (hue < 0) {
659
+ hue += 360;
660
+ } else if (hue >= 360) {
661
+ hue -= 360;
662
+ }
663
+
664
+ return hue;
665
+ }
666
+
667
+ function getSaturation(hsv, i, light) {
668
+ // grey color don't change saturation
669
+ if (hsv.h === 0 && hsv.s === 0) {
670
+ return hsv.s;
671
+ }
672
+
673
+ var saturation;
674
+
675
+ if (light) {
676
+ saturation = hsv.s - saturationStep * i;
677
+ } else if (i === darkColorCount) {
678
+ saturation = hsv.s + saturationStep;
679
+ } else {
680
+ saturation = hsv.s + saturationStep2 * i;
681
+ } // 边界值修正
682
+
683
+
684
+ if (saturation > 1) {
685
+ saturation = 1;
686
+ } // 第一格的 s 限制在 0.06-0.1 之间
687
+
688
+
689
+ if (light && i === lightColorCount && saturation > 0.1) {
690
+ saturation = 0.1;
691
+ }
692
+
693
+ if (saturation < 0.06) {
694
+ saturation = 0.06;
695
+ }
696
+
697
+ return Number(saturation.toFixed(2));
698
+ }
699
+
700
+ function getValue(hsv, i, light) {
701
+ var value;
702
+
703
+ if (light) {
704
+ value = hsv.v + brightnessStep1 * i;
705
+ } else {
706
+ value = hsv.v - brightnessStep2 * i;
707
+ }
708
+
709
+ if (value > 1) {
710
+ value = 1;
711
+ }
712
+
713
+ return Number(value.toFixed(2));
714
+ }
715
+
716
+ function generate$1(color) {
717
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
718
+ var patterns = [];
719
+ var pColor = inputToRGB(color);
720
+
721
+ for (var i = lightColorCount; i > 0; i -= 1) {
722
+ var hsv = toHsv(pColor);
723
+ var colorString = toHex(inputToRGB({
724
+ h: getHue(hsv, i, true),
725
+ s: getSaturation(hsv, i, true),
726
+ v: getValue(hsv, i, true)
727
+ }));
728
+ patterns.push(colorString);
729
+ }
730
+
731
+ patterns.push(toHex(pColor));
732
+
733
+ for (var _i = 1; _i <= darkColorCount; _i += 1) {
734
+ var _hsv = toHsv(pColor);
735
+
736
+ var _colorString = toHex(inputToRGB({
737
+ h: getHue(_hsv, _i),
738
+ s: getSaturation(_hsv, _i),
739
+ v: getValue(_hsv, _i)
740
+ }));
741
+
742
+ patterns.push(_colorString);
743
+ } // dark theme patterns
744
+
745
+
746
+ if (opts.theme === 'dark') {
747
+ return darkColorMap.map(function (_ref3) {
748
+ var index = _ref3.index,
749
+ opacity = _ref3.opacity;
750
+ var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
751
+ return darkColorString;
752
+ });
753
+ }
754
+
755
+ return patterns;
756
+ }
757
+
758
+ var presetPrimaryColors = {
759
+ red: '#F5222D',
760
+ volcano: '#FA541C',
761
+ orange: '#FA8C16',
762
+ gold: '#FAAD14',
763
+ yellow: '#FADB14',
764
+ lime: '#A0D911',
765
+ green: '#52C41A',
766
+ cyan: '#13C2C2',
767
+ blue: '#1890FF',
768
+ geekblue: '#2F54EB',
769
+ purple: '#722ED1',
770
+ magenta: '#EB2F96',
771
+ grey: '#666666'
772
+ };
773
+ var presetPalettes = {};
774
+ var presetDarkPalettes = {};
775
+ Object.keys(presetPrimaryColors).forEach(function (key) {
776
+ presetPalettes[key] = generate$1(presetPrimaryColors[key]);
777
+ presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
778
+
779
+ presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
780
+ theme: 'dark',
781
+ backgroundColor: '#141414'
782
+ });
783
+ presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
784
+ });
785
+ presetPalettes.red;
786
+ presetPalettes.volcano;
787
+ presetPalettes.gold;
788
+ presetPalettes.orange;
789
+ presetPalettes.yellow;
790
+ presetPalettes.lime;
791
+ presetPalettes.green;
792
+ presetPalettes.cyan;
793
+ presetPalettes.blue;
794
+ presetPalettes.geekblue;
795
+ presetPalettes.purple;
796
+ presetPalettes.magenta;
797
+ presetPalettes.grey;
798
+
799
+ // https://github.com/substack/insert-css
800
+ var containers = []; // will store container HTMLElement references
801
+
802
+ var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
803
+
804
+ var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
805
+
806
+ function createStyleElement() {
807
+ var styleElement = document.createElement('style');
808
+ styleElement.setAttribute('type', 'text/css');
809
+ return styleElement;
810
+ } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
811
+
812
+
813
+ function insertCss(css, options) {
814
+ options = options || {};
815
+
816
+ if (css === undefined) {
817
+ throw new Error(usage);
818
+ }
819
+
820
+ var position = options.prepend === true ? 'prepend' : 'append';
821
+ var container = options.container !== undefined ? options.container : document.querySelector('head');
822
+ var containerId = containers.indexOf(container); // first time we see this container, create the necessary entries
823
+
824
+ if (containerId === -1) {
825
+ containerId = containers.push(container) - 1;
826
+ styleElements[containerId] = {};
827
+ } // try to get the correponding container + position styleElement, create it otherwise
828
+
829
+
830
+ var styleElement;
831
+
832
+ if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
833
+ styleElement = styleElements[containerId][position];
834
+ } else {
835
+ styleElement = styleElements[containerId][position] = createStyleElement();
836
+
837
+ if (position === 'prepend') {
838
+ container.insertBefore(styleElement, container.childNodes[0]);
839
+ } else {
840
+ container.appendChild(styleElement);
841
+ }
842
+ } // strip potential UTF-8 BOM if css was read from a file
843
+
844
+
845
+ if (css.charCodeAt(0) === 0xfeff) {
846
+ css = css.substr(1, css.length);
847
+ } // actually add the stylesheet
848
+
849
+
850
+ if (styleElement.styleSheet) {
851
+ styleElement.styleSheet.cssText += css;
852
+ } else {
853
+ styleElement.textContent += css;
854
+ }
855
+
856
+ return styleElement;
857
+ }
858
+
859
+ 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; }
860
+
861
+ 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; }
862
+ function warn(valid, message) {
863
+ // Support uglify
864
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
865
+ console.error("Warning: ".concat(message));
866
+ }
867
+ }
868
+ function warning(valid, message) {
869
+ warn(valid, "[@ant-design/icons-vue] ".concat(message));
870
+ } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
871
+
872
+ function isIconDefinition(target) {
873
+ return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
874
+ }
875
+ function generate(node, key, rootProps) {
876
+ if (!rootProps) {
877
+ return h(node.tag, _objectSpread$5({
878
+ key: key
879
+ }, node.attrs), (node.children || []).map(function (child, index) {
880
+ return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
881
+ }));
882
+ }
883
+
884
+ return h(node.tag, _objectSpread$5({
885
+ key: key
886
+ }, rootProps, node.attrs), (node.children || []).map(function (child, index) {
887
+ return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
888
+ }));
889
+ }
890
+ function getSecondaryColor(primaryColor) {
891
+ // choose the second color
892
+ return generate$1(primaryColor)[0];
893
+ }
894
+ function normalizeTwoToneColors(twoToneColor) {
895
+ if (!twoToneColor) {
896
+ return [];
897
+ }
898
+
899
+ return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
900
+ } // These props make sure that the SVG behaviours like general text.
901
+ 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";
902
+ var cssInjectedFlag = false;
903
+ var useInsertStyles = function useInsertStyles() {
904
+ var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
905
+ nextTick(function () {
906
+ if (!cssInjectedFlag) {
907
+ if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
908
+ insertCss(styleStr, {
909
+ prepend: true
910
+ });
911
+ }
912
+
913
+ cssInjectedFlag = true;
914
+ }
915
+ });
916
+ };
917
+
918
+ var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
919
+
920
+ 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; }
921
+
922
+ 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; }
923
+
924
+ 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; }
925
+
926
+ 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; }
927
+ var twoToneColorPalette = {
928
+ primaryColor: '#333',
929
+ secondaryColor: '#E6E6E6',
930
+ calculated: false
931
+ };
932
+
933
+ function setTwoToneColors(_ref) {
934
+ var primaryColor = _ref.primaryColor,
935
+ secondaryColor = _ref.secondaryColor;
936
+ twoToneColorPalette.primaryColor = primaryColor;
937
+ twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
938
+ twoToneColorPalette.calculated = !!secondaryColor;
939
+ }
940
+
941
+ function getTwoToneColors() {
942
+ return _objectSpread$4({}, twoToneColorPalette);
943
+ }
944
+
945
+ var IconBase = function IconBase(props, context) {
946
+ var _props$context$attrs = _objectSpread$4({}, props, context.attrs),
947
+ icon = _props$context$attrs.icon,
948
+ primaryColor = _props$context$attrs.primaryColor,
949
+ secondaryColor = _props$context$attrs.secondaryColor,
950
+ restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
951
+
952
+ var colors = twoToneColorPalette;
953
+
954
+ if (primaryColor) {
955
+ colors = {
956
+ primaryColor: primaryColor,
957
+ secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
958
+ };
959
+ }
960
+
961
+ useInsertStyles();
962
+ warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
963
+
964
+ if (!isIconDefinition(icon)) {
965
+ return null;
966
+ }
967
+
968
+ var target = icon;
969
+
970
+ if (target && typeof target.icon === 'function') {
971
+ target = _objectSpread$4({}, target, {
972
+ icon: target.icon(colors.primaryColor, colors.secondaryColor)
973
+ });
974
+ }
975
+
976
+ return generate(target.icon, "svg-".concat(target.name), _objectSpread$4({}, restProps, {
977
+ 'data-icon': target.name,
978
+ width: '1em',
979
+ height: '1em',
980
+ fill: 'currentColor',
981
+ 'aria-hidden': 'true'
982
+ })); // },
983
+ };
984
+
985
+ IconBase.props = {
986
+ icon: Object,
987
+ primaryColor: String,
988
+ secondaryColor: String,
989
+ focusable: String
990
+ };
991
+ IconBase.inheritAttrs = false;
992
+ IconBase.displayName = 'IconBase';
993
+ IconBase.getTwoToneColors = getTwoToneColors;
994
+ IconBase.setTwoToneColors = setTwoToneColors;
995
+ var VueIcon = IconBase;
996
+
997
+ function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
998
+
999
+ 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."); }
1000
+
1001
+ 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); }
1002
+
1003
+ 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; }
1004
+
1005
+ 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; }
1006
+
1007
+ function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
1008
+ function setTwoToneColor(twoToneColor) {
1009
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1010
+ _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2),
1011
+ primaryColor = _normalizeTwoToneColo2[0],
1012
+ secondaryColor = _normalizeTwoToneColo2[1];
1013
+
1014
+ return VueIcon.setTwoToneColors({
1015
+ primaryColor: primaryColor,
1016
+ secondaryColor: secondaryColor
1017
+ });
1018
+ }
1019
+ function getTwoToneColor() {
1020
+ var colors = VueIcon.getTwoToneColors();
1021
+
1022
+ if (!colors.calculated) {
1023
+ return colors.primaryColor;
1024
+ }
1025
+
1026
+ return [colors.primaryColor, colors.secondaryColor];
1027
+ }
1028
+
1029
+ var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
1030
+
1031
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1032
+
1033
+ 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."); }
1034
+
1035
+ 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); }
1036
+
1037
+ 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; }
1038
+
1039
+ 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; }
1040
+
1041
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1042
+
1043
+ 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; }
1044
+
1045
+ 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; }
1046
+
1047
+ 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; }
1048
+
1049
+ 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; }
1050
+
1051
+ setTwoToneColor('#1890ff');
1052
+
1053
+ var Icon = function Icon(props, context) {
1054
+ var _classObj;
1055
+
1056
+ var _props$context$attrs = _objectSpread$3({}, props, context.attrs),
1057
+ cls = _props$context$attrs["class"],
1058
+ icon = _props$context$attrs.icon,
1059
+ spin = _props$context$attrs.spin,
1060
+ rotate = _props$context$attrs.rotate,
1061
+ tabindex = _props$context$attrs.tabindex,
1062
+ twoToneColor = _props$context$attrs.twoToneColor,
1063
+ onClick = _props$context$attrs.onClick,
1064
+ restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
1065
+
1066
+ var classObj = (_classObj = {
1067
+ anticon: true
1068
+ }, _defineProperty$3(_classObj, "anticon-".concat(icon.name), Boolean(icon.name)), _defineProperty$3(_classObj, cls, cls), _classObj);
1069
+ var svgClassString = spin === '' || !!spin || icon.name === 'loading' ? 'anticon-spin' : '';
1070
+ var iconTabIndex = tabindex;
1071
+
1072
+ if (iconTabIndex === undefined && onClick) {
1073
+ iconTabIndex = -1;
1074
+ restProps.tabindex = iconTabIndex;
1075
+ }
1076
+
1077
+ var svgStyle = rotate ? {
1078
+ msTransform: "rotate(".concat(rotate, "deg)"),
1079
+ transform: "rotate(".concat(rotate, "deg)")
1080
+ } : undefined;
1081
+
1082
+ var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
1083
+ _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
1084
+ primaryColor = _normalizeTwoToneColo2[0],
1085
+ secondaryColor = _normalizeTwoToneColo2[1];
1086
+
1087
+ return createVNode("span", _objectSpread$3({
1088
+ "role": "img",
1089
+ "aria-label": icon.name
1090
+ }, restProps, {
1091
+ "onClick": onClick,
1092
+ "class": classObj
1093
+ }), [createVNode(VueIcon, {
1094
+ "class": svgClassString,
1095
+ "icon": icon,
1096
+ "primaryColor": primaryColor,
1097
+ "secondaryColor": secondaryColor,
1098
+ "style": svgStyle
1099
+ }, null)]);
1100
+ };
1101
+
1102
+ Icon.props = {
1103
+ spin: Boolean,
1104
+ rotate: Number,
1105
+ icon: Object,
1106
+ twoToneColor: String
1107
+ };
1108
+ Icon.displayName = 'AntdIcon';
1109
+ Icon.inheritAttrs = false;
1110
+ Icon.getTwoToneColor = getTwoToneColor;
1111
+ Icon.setTwoToneColor = setTwoToneColor;
1112
+ var AntdIcon = Icon;
1113
+
1114
+ // This icon file is generated automatically.
1115
+ 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" };
1116
+ var CloseCircleFilledSvg = CloseCircleFilled$2;
1117
+
1118
+ 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; }
1119
+
1120
+ 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; }
1121
+
1122
+ var CloseCircleFilled = function CloseCircleFilled(props, context) {
1123
+ var p = _objectSpread$2({}, props, context.attrs);
1124
+
1125
+ return createVNode(AntdIcon, _objectSpread$2({}, p, {
1126
+ "icon": CloseCircleFilledSvg
1127
+ }), null);
1128
+ };
1129
+
1130
+ CloseCircleFilled.displayName = 'CloseCircleFilled';
1131
+ CloseCircleFilled.inheritAttrs = false;
1132
+ var CloseCircleFilled$1 = CloseCircleFilled;
1133
+
1134
+ // This icon file is generated automatically.
1135
+ var DeleteOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
1136
+ var DeleteOutlinedSvg = DeleteOutlined$2;
1137
+
1138
+ 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; }
1139
+
1140
+ 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; }
1141
+
1142
+ var DeleteOutlined = function DeleteOutlined(props, context) {
1143
+ var p = _objectSpread$1({}, props, context.attrs);
1144
+
1145
+ return createVNode(AntdIcon, _objectSpread$1({}, p, {
1146
+ "icon": DeleteOutlinedSvg
1147
+ }), null);
1148
+ };
1149
+
1150
+ DeleteOutlined.displayName = 'DeleteOutlined';
1151
+ DeleteOutlined.inheritAttrs = false;
1152
+ var DeleteOutlined$1 = DeleteOutlined;
1153
+
1154
+ // This icon file is generated automatically.
1155
+ 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" };
1156
+ var DownOutlinedSvg = DownOutlined$2;
1157
+
1158
+ 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; }
1159
+
1160
+ 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; }
1161
+
1162
+ var DownOutlined = function DownOutlined(props, context) {
1163
+ var p = _objectSpread({}, props, context.attrs);
1164
+
1165
+ return createVNode(AntdIcon, _objectSpread({}, p, {
1166
+ "icon": DownOutlinedSvg
1167
+ }), null);
1168
+ };
1169
+
1170
+ DownOutlined.displayName = 'DownOutlined';
1171
+ DownOutlined.inheritAttrs = false;
1172
+ var DownOutlined$1 = DownOutlined;
1173
+
1174
+ var _export_sfc = (sfc, props) => {
1175
+ const target = sfc.__vccOpts || sfc;
1176
+ for (const [key, val] of props) {
1177
+ target[key] = val;
1178
+ }
1179
+ return target;
1180
+ };
1181
+
1182
+ const _sfc_main = defineComponent({
1183
+ name: "BmShopsFilter",
1184
+ components: {
1185
+ DownOutlined: DownOutlined$1,
1186
+ DeleteOutlined: DeleteOutlined$1,
1187
+ CloseCircleFilled: CloseCircleFilled$1,
1188
+ InputSearch,
1189
+ Checkbox,
1190
+ Button,
1191
+ Popover,
1192
+ Empty
1193
+ },
1194
+ props: {
1195
+ labelTitle: {
1196
+ type: String,
1197
+ default: "\u5E97\u94FA"
1198
+ },
1199
+ showAlways: {
1200
+ type: Boolean,
1201
+ default: false
1202
+ },
1203
+ displayParams: {
1204
+ type: Object,
1205
+ default: () => {
1206
+ return {
1207
+ width: "436px",
1208
+ labelOffset: "0px",
1209
+ labelWidth: "98px",
1210
+ searchWidth: "240px",
1211
+ listMaxHeight: "366px"
1212
+ };
1213
+ }
1214
+ },
1215
+ loadFilter: {
1216
+ type: Function,
1217
+ default: () => {
1218
+ return Promise.resolve([]);
1219
+ }
1220
+ },
1221
+ loadData: {
1222
+ type: Function,
1223
+ default: () => {
1224
+ return Promise.reject("\u672A\u58F0\u660E\u5E97\u94FA\u6570\u636E\u8BF7\u6C42\u51FD\u6570");
1225
+ }
1226
+ }
1227
+ },
1228
+ emits: ["update:selected", "change"],
1229
+ setup(props, { emit }) {
1230
+ const state = reactive({
1231
+ isActive: false,
1232
+ searchVal: "",
1233
+ selected: [],
1234
+ shopList: [],
1235
+ shopListByCode: {},
1236
+ checkAll: false,
1237
+ hasCheck: false,
1238
+ inverSelect: false,
1239
+ shopCheck: {},
1240
+ filterSelects: [],
1241
+ filterArr: []
1242
+ });
1243
+ const methods = {
1244
+ triggleActive() {
1245
+ if (!props.showAlways)
1246
+ state.isActive = !state.isActive;
1247
+ if (state.shopList && !state.shopList.length)
1248
+ methods.fetchData();
1249
+ },
1250
+ outSideClick() {
1251
+ state.isActive = false;
1252
+ },
1253
+ changeFilterSelect(index, code) {
1254
+ let filter = state.filterArr[index];
1255
+ if (filter.multiple) {
1256
+ if (!code) {
1257
+ state.filterSelects[index] = [];
1258
+ } else {
1259
+ let list = state.filterSelects[index];
1260
+ list.indexOf(code) > -1 ? list.splice(list.indexOf(code), 1) : list.push(code);
1261
+ }
1262
+ } else {
1263
+ state.filterSelects[index] = code;
1264
+ }
1265
+ methods.fetchData();
1266
+ },
1267
+ onCheckAllChange(e) {
1268
+ state.inverSelect = false;
1269
+ let checked = e.target.checked;
1270
+ state.shopList.forEach((item) => {
1271
+ state.shopCheck[item.shopCode] = checked;
1272
+ });
1273
+ },
1274
+ checkboxChange() {
1275
+ let hasCheck = false;
1276
+ let checkAll = true;
1277
+ state.shopList.some((item) => {
1278
+ if (state.shopCheck[item.shopCode]) {
1279
+ hasCheck = true;
1280
+ return true;
1281
+ }
1282
+ });
1283
+ state.shopList.every((item) => {
1284
+ if (!state.shopCheck[item.shopCode]) {
1285
+ checkAll = false;
1286
+ return false;
1287
+ }
1288
+ return true;
1289
+ });
1290
+ state.checkAll = checkAll;
1291
+ state.hasCheck = state.checkAll ? false : hasCheck;
1292
+ },
1293
+ invertChange() {
1294
+ state.checkAll = false;
1295
+ state.shopList.forEach((item) => {
1296
+ state.shopCheck[item.shopCode] = !state.shopCheck[item.shopCode];
1297
+ });
1298
+ },
1299
+ clearAll() {
1300
+ state.inverSelect = false;
1301
+ state.checkAll = false;
1302
+ state.hasCheck = false;
1303
+ state.shopList.forEach((item) => {
1304
+ state.shopCheck[item.shopCode] = false;
1305
+ });
1306
+ },
1307
+ fetchData() {
1308
+ let params = {};
1309
+ let filters = state.filterArr;
1310
+ filters.forEach((item, index) => {
1311
+ params[String(item.paramsStr)] = state.filterSelects[index] || "";
1312
+ });
1313
+ params["search"] = state.searchVal;
1314
+ props.loadData(params).then((data) => {
1315
+ state.shopList = data;
1316
+ data.forEach((item) => {
1317
+ return state.shopListByCode[item.shopCode] = item.shopName;
1318
+ });
1319
+ methods.checkboxChange();
1320
+ });
1321
+ },
1322
+ clearAllSelected(e) {
1323
+ e && e.stopPropagation();
1324
+ state.searchVal = "";
1325
+ state.shopCheck = {};
1326
+ state.inverSelect = false;
1327
+ state.checkAll = false;
1328
+ },
1329
+ filterIsActive(filterIndex, code) {
1330
+ let select = state.filterSelects[filterIndex];
1331
+ let filter = state.filterArr[filterIndex];
1332
+ let isMultiple = filter && filter.multiple;
1333
+ if (!isMultiple) {
1334
+ return select === code;
1335
+ } else {
1336
+ return select.indexOf(code) > -1;
1337
+ }
1338
+ }
1339
+ };
1340
+ props.loadFilter().then((data) => {
1341
+ state.filterArr = data;
1342
+ state.filterSelects = state.filterArr.map((item) => {
1343
+ return item.multiple ? [] : "";
1344
+ });
1345
+ }).finally(() => {
1346
+ methods.fetchData();
1347
+ });
1348
+ watch(() => state.shopCheck, () => {
1349
+ let list = [];
1350
+ for (let [key, value] of Object.entries(state.shopCheck)) {
1351
+ value && list.push(key);
1352
+ }
1353
+ state.selected = list;
1354
+ emit("update:selected", list);
1355
+ emit("change", list);
1356
+ methods.checkboxChange();
1357
+ }, { deep: true });
1358
+ if (props.showAlways) {
1359
+ state.isActive = true;
1360
+ }
1361
+ onMounted(() => {
1362
+ if (!props.showAlways)
1363
+ document.addEventListener("click", methods.outSideClick);
1364
+ });
1365
+ onUnmounted(() => {
1366
+ if (!props.showAlways)
1367
+ document.removeEventListener("click", methods.outSideClick);
1368
+ });
1369
+ return {
1370
+ ...toRefs(state),
1371
+ ...methods
1372
+ };
1373
+ }
1374
+ });
1375
+ const _hoisted_1 = /* @__PURE__ */ createElementVNode("span", null, "\u8BF7\u9009\u62E9", -1);
1376
+ const _hoisted_2 = { class: "input-icon active-icon" };
1377
+ const _hoisted_3 = { class: "pop-seleted-title" };
1378
+ const _hoisted_4 = /* @__PURE__ */ createTextVNode(" \u5DF2\u9009\u62E9");
1379
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u9879 ");
1380
+ const _hoisted_6 = { class: "__shops-filter-list" };
1381
+ const _hoisted_7 = {
1382
+ key: 0,
1383
+ class: "__shops-filter-tabs"
1384
+ };
1385
+ const _hoisted_8 = { class: "label" };
1386
+ const _hoisted_9 = { class: "__shops-filter-areas" };
1387
+ const _hoisted_10 = ["onClick"];
1388
+ const _hoisted_11 = ["onClick"];
1389
+ const _hoisted_12 = { class: "__shops-filter-selecting" };
1390
+ const _hoisted_13 = /* @__PURE__ */ createTextVNode(" \u5DF2\u9009\u62E9");
1391
+ const _hoisted_14 = /* @__PURE__ */ createTextVNode("\u9879 ");
1392
+ const _hoisted_15 = { class: "__checkbox-operate-box" };
1393
+ const _hoisted_16 = /* @__PURE__ */ createTextVNode("\u5168\u9009");
1394
+ const _hoisted_17 = /* @__PURE__ */ createTextVNode("\u53CD\u9009");
1395
+ const _hoisted_18 = /* @__PURE__ */ createTextVNode("\u6E05\u7A7A");
1396
+ const _hoisted_19 = {
1397
+ key: 0,
1398
+ class: "__shops-filter-selecting"
1399
+ };
1400
+ const _hoisted_20 = /* @__PURE__ */ createTextVNode(" \u5DF2\u9009\u62E9");
1401
+ const _hoisted_21 = /* @__PURE__ */ createTextVNode("\u9879 ");
1402
+ const _hoisted_22 = /* @__PURE__ */ createElementVNode("span", { style: { "color": "#9393a3" } }, "\u6682\u65E0\u6570\u636E", -1);
1403
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1404
+ const _component_down_outlined = resolveComponent("down-outlined");
1405
+ const _component_close_circle_filled = resolveComponent("close-circle-filled");
1406
+ const _component_Popover = resolveComponent("Popover");
1407
+ const _component_input_search = resolveComponent("input-search");
1408
+ const _component_Checkbox = resolveComponent("Checkbox");
1409
+ const _component_delete_outlined = resolveComponent("delete-outlined");
1410
+ const _component_Button = resolveComponent("Button");
1411
+ const _component_Empty = resolveComponent("Empty");
1412
+ return openBlock(), createElementBlock("div", {
1413
+ class: "__shops-filter-component",
1414
+ onClick: _cache[8] || (_cache[8] = withModifiers(() => {
1415
+ }, ["stop"]))
1416
+ }, [
1417
+ createElementVNode("span", {
1418
+ class: "__shops-filter-label",
1419
+ style: normalizeStyle({
1420
+ width: _ctx.displayParams?.labelWidth || "",
1421
+ marginRight: _ctx.displayParams?.labelOffset || "0"
1422
+ })
1423
+ }, toDisplayString(_ctx.labelTitle) + ":", 5),
1424
+ createElementVNode("div", {
1425
+ class: normalizeClass(["__shops-filter-input-box", { "active-box": !_ctx.showAlways && _ctx.isActive }]),
1426
+ style: normalizeStyle({ width: _ctx.displayParams?.width || "436px" }),
1427
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.triggleActive && _ctx.triggleActive(...args))
1428
+ }, [
1429
+ _ctx.selected && !_ctx.selected.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1430
+ _hoisted_1,
1431
+ createElementVNode("span", _hoisted_2, [
1432
+ createVNode(_component_down_outlined)
1433
+ ])
1434
+ ], 64)) : _ctx.selected && _ctx.selected.length ? (openBlock(), createBlock(_component_Popover, {
1435
+ key: 1,
1436
+ title: "",
1437
+ "overlay-class-name": "__shops-filter-popover"
1438
+ }, {
1439
+ content: withCtx(() => [
1440
+ createElementVNode("div", {
1441
+ class: "pop-seleted",
1442
+ style: normalizeStyle({ "min-width": _ctx.displayParams?.width || "436px" })
1443
+ }, [
1444
+ createElementVNode("div", _hoisted_3, [
1445
+ _hoisted_4,
1446
+ createElementVNode("span", null, toDisplayString(_ctx.selected.length), 1),
1447
+ _hoisted_5
1448
+ ]),
1449
+ createElementVNode("div", {
1450
+ class: "pop-seleted-shops",
1451
+ onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
1452
+ }, ["stop"]))
1453
+ }, [
1454
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selected, (item) => {
1455
+ return openBlock(), createElementBlock("div", {
1456
+ key: item,
1457
+ class: "pop-seleted-item"
1458
+ }, toDisplayString(_ctx.shopListByCode[item]), 1);
1459
+ }), 128))
1460
+ ], 32)
1461
+ ], 4)
1462
+ ]),
1463
+ default: withCtx(() => [
1464
+ createElementVNode("div", _hoisted_6, [
1465
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selected, (item) => {
1466
+ return openBlock(), createElementBlock("div", {
1467
+ key: item,
1468
+ class: "selected-tag"
1469
+ }, toDisplayString(_ctx.shopListByCode[item]), 1);
1470
+ }), 128)),
1471
+ createElementVNode("div", {
1472
+ class: "delete-icon",
1473
+ onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.clearAllSelected && _ctx.clearAllSelected(...args), ["stop"])),
1474
+ onMouseover: _cache[2] || (_cache[2] = withModifiers(() => {
1475
+ }, ["stop"]))
1476
+ }, [
1477
+ createVNode(_component_close_circle_filled, { style: { "color": "#9393a3" } })
1478
+ ], 32)
1479
+ ])
1480
+ ]),
1481
+ _: 1
1482
+ })) : createCommentVNode("v-if", true)
1483
+ ], 6),
1484
+ withDirectives(createElementVNode("div", {
1485
+ class: "__shops-filter-search-input",
1486
+ style: normalizeStyle({ width: _ctx.displayParams?.searchWidth || "240px" })
1487
+ }, [
1488
+ createVNode(_component_input_search, {
1489
+ modelValue: _ctx.searchVal,
1490
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.searchVal = $event),
1491
+ placeholder: "\u641C\u7D22\u5E97\u94FA\u540D\u79F0",
1492
+ "allow-clear": true,
1493
+ onSearch: _ctx.fetchData
1494
+ }, null, 8, ["modelValue", "onSearch"])
1495
+ ], 4), [
1496
+ [vShow, _ctx.isActive]
1497
+ ]),
1498
+ withDirectives(createElementVNode("div", {
1499
+ class: normalizeClass(["__shops-filter-content", { "__shops-filter-no-absolute": _ctx.showAlways }])
1500
+ }, [
1501
+ _ctx.filterArr && _ctx.filterArr.length ? (openBlock(), createElementBlock("div", _hoisted_7, [
1502
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filterArr, (item, index) => {
1503
+ return openBlock(), createElementBlock("div", {
1504
+ key: item.paramsStr,
1505
+ class: "__shops-filter-area-tabs"
1506
+ }, [
1507
+ createElementVNode("div", _hoisted_8, toDisplayString(item.label) + ":", 1),
1508
+ createElementVNode("div", _hoisted_9, [
1509
+ createElementVNode("span", {
1510
+ class: normalizeClass({
1511
+ active: !(item.multiple ? _ctx.filterSelects[index].length : !!_ctx.filterSelects[index])
1512
+ }),
1513
+ onClick: withModifiers(($event) => _ctx.changeFilterSelect(index, ""), ["self"])
1514
+ }, "\u5168\u90E8", 10, _hoisted_10),
1515
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element) => {
1516
+ return openBlock(), createElementBlock("span", {
1517
+ key: element.code,
1518
+ class: normalizeClass({ active: _ctx.filterIsActive(index, element.code) }),
1519
+ onClick: withModifiers(($event) => _ctx.changeFilterSelect(index, element.code), ["self"])
1520
+ }, toDisplayString(element.label), 11, _hoisted_11);
1521
+ }), 128))
1522
+ ])
1523
+ ]);
1524
+ }), 128)),
1525
+ createElementVNode("div", _hoisted_12, [
1526
+ _hoisted_13,
1527
+ createElementVNode("span", null, toDisplayString(_ctx.selected.length), 1),
1528
+ _hoisted_14
1529
+ ])
1530
+ ])) : createCommentVNode("v-if", true),
1531
+ _ctx.shopList && _ctx.shopList.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1532
+ createElementVNode("div", _hoisted_15, [
1533
+ createVNode(_component_Checkbox, {
1534
+ checked: _ctx.checkAll,
1535
+ "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => _ctx.checkAll = $event),
1536
+ indeterminate: _ctx.hasCheck,
1537
+ onChange: _ctx.onCheckAllChange
1538
+ }, {
1539
+ default: withCtx(() => [
1540
+ _hoisted_16
1541
+ ]),
1542
+ _: 1
1543
+ }, 8, ["checked", "indeterminate", "onChange"]),
1544
+ createVNode(_component_Checkbox, {
1545
+ checked: _ctx.inverSelect,
1546
+ "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => _ctx.inverSelect = $event),
1547
+ onChange: _ctx.invertChange
1548
+ }, {
1549
+ default: withCtx(() => [
1550
+ _hoisted_17
1551
+ ]),
1552
+ _: 1
1553
+ }, 8, ["checked", "onChange"]),
1554
+ createVNode(_component_Button, {
1555
+ type: "text",
1556
+ onClick: _ctx.clearAll
1557
+ }, {
1558
+ icon: withCtx(() => [
1559
+ createVNode(_component_delete_outlined)
1560
+ ]),
1561
+ default: withCtx(() => [
1562
+ _hoisted_18
1563
+ ]),
1564
+ _: 1
1565
+ }, 8, ["onClick"]),
1566
+ _ctx.filterArr && !_ctx.filterArr.length ? (openBlock(), createElementBlock("div", _hoisted_19, [
1567
+ _hoisted_20,
1568
+ createElementVNode("span", null, toDisplayString(_ctx.selected.length), 1),
1569
+ _hoisted_21
1570
+ ])) : createCommentVNode("v-if", true)
1571
+ ]),
1572
+ createElementVNode("div", {
1573
+ class: "__shops-checkbox-box",
1574
+ style: normalizeStyle({ maxHeight: _ctx.displayParams.listMaxHeight || "366px" })
1575
+ }, [
1576
+ createElementVNode("div", {
1577
+ class: "__shops-checkbox-grid",
1578
+ onWheel: _cache[7] || (_cache[7] = withModifiers(() => {
1579
+ }, ["stop"]))
1580
+ }, [
1581
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.shopList, (item) => {
1582
+ return openBlock(), createElementBlock("div", {
1583
+ key: item.shopCode
1584
+ }, [
1585
+ createVNode(_component_Checkbox, {
1586
+ checked: _ctx.shopCheck[item.shopCode],
1587
+ "onUpdate:checked": ($event) => _ctx.shopCheck[item.shopCode] = $event
1588
+ }, {
1589
+ default: withCtx(() => [
1590
+ createTextVNode(toDisplayString(item.shopName), 1)
1591
+ ]),
1592
+ _: 2
1593
+ }, 1032, ["checked", "onUpdate:checked"])
1594
+ ]);
1595
+ }), 128))
1596
+ ], 32)
1597
+ ], 4)
1598
+ ], 64)) : createCommentVNode("v-if", true),
1599
+ _ctx.shopList && !_ctx.shopList.length ? (openBlock(), createBlock(_component_Empty, { key: 2 }, {
1600
+ description: withCtx(() => [
1601
+ _hoisted_22
1602
+ ]),
1603
+ _: 1
1604
+ })) : createCommentVNode("v-if", true)
1605
+ ], 2), [
1606
+ [vShow, _ctx.isActive]
1607
+ ])
1608
+ ]);
1609
+ }
1610
+ var shopsFilter = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "shops-filter.vue"]]);
1611
+
1612
+ const BmShopsFilter = withInstall(shopsFilter);
1613
+
1614
+ export { BmShopsFilter, BmShopsFilter as default };