3h1-ui 1.0.13 → 1.0.14
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.
- package/es/index.js +1361 -1
- package/es/lib/index.d.ts +7 -0
- package/es/lib/lib/index.d.ts +7 -0
- package/es/lib/lib/lib/index.d.ts +7 -0
- package/es/lib/lib/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/es/lib/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/es/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/es/lib/src/ShyTable/ButtonGroup.vue.d.ts +25 -0
- package/es/lib/src/ShyTable/IndexView.vue.d.ts +2 -0
- package/es/src/ShyTable/ButtonGroup.vue.d.ts +25 -0
- package/es/src/ShyTable/IndexView.vue.d.ts +2 -0
- package/es/style.css +31 -0
- package/lib/index.js +1360 -0
- package/lib/lib/index.d.ts +7 -0
- package/lib/lib/lib/index.d.ts +7 -0
- package/lib/lib/lib/lib/index.d.ts +7 -0
- package/lib/lib/lib/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/lib/lib/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/lib/lib/src/ShyPage/IndexView.vue.d.ts +34 -0
- package/lib/lib/src/ShyTable/ButtonGroup.vue.d.ts +25 -0
- package/lib/lib/src/ShyTable/IndexView.vue.d.ts +2 -0
- package/lib/src/ShyTable/ButtonGroup.vue.d.ts +25 -0
- package/lib/src/ShyTable/IndexView.vue.d.ts +2 -0
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -1,4 +1,1363 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
1
|
+
import { h, nextTick, createVNode, defineComponent, ref, watchEffect, resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withCtx, normalizeStyle, toDisplayString, createBlock, unref, createCommentVNode, withModifiers, createTextVNode, pushScopeId, popScopeId, createSlots, renderSlot, normalizeProps, guardReactiveProps, watch } from "vue";
|
|
2
|
+
import "xe-utils";
|
|
3
|
+
import { VxeTable, VxeColumn } from "vxe-table";
|
|
4
|
+
const style = "";
|
|
5
|
+
function bound01(n, max) {
|
|
6
|
+
if (isOnePointZero(n)) {
|
|
7
|
+
n = "100%";
|
|
8
|
+
}
|
|
9
|
+
var isPercent = isPercentage(n);
|
|
10
|
+
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
|
|
11
|
+
if (isPercent) {
|
|
12
|
+
n = parseInt(String(n * max), 10) / 100;
|
|
13
|
+
}
|
|
14
|
+
if (Math.abs(n - max) < 1e-6) {
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
if (max === 360) {
|
|
18
|
+
n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
|
|
19
|
+
} else {
|
|
20
|
+
n = n % max / parseFloat(String(max));
|
|
21
|
+
}
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
function isOnePointZero(n) {
|
|
25
|
+
return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
|
|
26
|
+
}
|
|
27
|
+
function isPercentage(n) {
|
|
28
|
+
return typeof n === "string" && n.indexOf("%") !== -1;
|
|
29
|
+
}
|
|
30
|
+
function boundAlpha(a) {
|
|
31
|
+
a = parseFloat(a);
|
|
32
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
33
|
+
a = 1;
|
|
34
|
+
}
|
|
35
|
+
return a;
|
|
36
|
+
}
|
|
37
|
+
function convertToPercentage(n) {
|
|
38
|
+
if (n <= 1) {
|
|
39
|
+
return "".concat(Number(n) * 100, "%");
|
|
40
|
+
}
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
function pad2(c) {
|
|
44
|
+
return c.length === 1 ? "0" + c : String(c);
|
|
45
|
+
}
|
|
46
|
+
function rgbToRgb(r, g, b) {
|
|
47
|
+
return {
|
|
48
|
+
r: bound01(r, 255) * 255,
|
|
49
|
+
g: bound01(g, 255) * 255,
|
|
50
|
+
b: bound01(b, 255) * 255
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function hue2rgb(p, q, t) {
|
|
54
|
+
if (t < 0) {
|
|
55
|
+
t += 1;
|
|
56
|
+
}
|
|
57
|
+
if (t > 1) {
|
|
58
|
+
t -= 1;
|
|
59
|
+
}
|
|
60
|
+
if (t < 1 / 6) {
|
|
61
|
+
return p + (q - p) * (6 * t);
|
|
62
|
+
}
|
|
63
|
+
if (t < 1 / 2) {
|
|
64
|
+
return q;
|
|
65
|
+
}
|
|
66
|
+
if (t < 2 / 3) {
|
|
67
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
68
|
+
}
|
|
69
|
+
return p;
|
|
70
|
+
}
|
|
71
|
+
function hslToRgb(h2, s, l) {
|
|
72
|
+
var r;
|
|
73
|
+
var g;
|
|
74
|
+
var b;
|
|
75
|
+
h2 = bound01(h2, 360);
|
|
76
|
+
s = bound01(s, 100);
|
|
77
|
+
l = bound01(l, 100);
|
|
78
|
+
if (s === 0) {
|
|
79
|
+
g = l;
|
|
80
|
+
b = l;
|
|
81
|
+
r = l;
|
|
82
|
+
} else {
|
|
83
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
84
|
+
var p = 2 * l - q;
|
|
85
|
+
r = hue2rgb(p, q, h2 + 1 / 3);
|
|
86
|
+
g = hue2rgb(p, q, h2);
|
|
87
|
+
b = hue2rgb(p, q, h2 - 1 / 3);
|
|
88
|
+
}
|
|
89
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
90
|
+
}
|
|
91
|
+
function rgbToHsv(r, g, b) {
|
|
92
|
+
r = bound01(r, 255);
|
|
93
|
+
g = bound01(g, 255);
|
|
94
|
+
b = bound01(b, 255);
|
|
95
|
+
var max = Math.max(r, g, b);
|
|
96
|
+
var min = Math.min(r, g, b);
|
|
97
|
+
var h2 = 0;
|
|
98
|
+
var v = max;
|
|
99
|
+
var d = max - min;
|
|
100
|
+
var s = max === 0 ? 0 : d / max;
|
|
101
|
+
if (max === min) {
|
|
102
|
+
h2 = 0;
|
|
103
|
+
} else {
|
|
104
|
+
switch (max) {
|
|
105
|
+
case r:
|
|
106
|
+
h2 = (g - b) / d + (g < b ? 6 : 0);
|
|
107
|
+
break;
|
|
108
|
+
case g:
|
|
109
|
+
h2 = (b - r) / d + 2;
|
|
110
|
+
break;
|
|
111
|
+
case b:
|
|
112
|
+
h2 = (r - g) / d + 4;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
h2 /= 6;
|
|
116
|
+
}
|
|
117
|
+
return { h: h2, s, v };
|
|
118
|
+
}
|
|
119
|
+
function hsvToRgb(h2, s, v) {
|
|
120
|
+
h2 = bound01(h2, 360) * 6;
|
|
121
|
+
s = bound01(s, 100);
|
|
122
|
+
v = bound01(v, 100);
|
|
123
|
+
var i = Math.floor(h2);
|
|
124
|
+
var f = h2 - i;
|
|
125
|
+
var p = v * (1 - s);
|
|
126
|
+
var q = v * (1 - f * s);
|
|
127
|
+
var t = v * (1 - (1 - f) * s);
|
|
128
|
+
var mod = i % 6;
|
|
129
|
+
var r = [v, q, p, p, t, v][mod];
|
|
130
|
+
var g = [t, v, v, q, p, p][mod];
|
|
131
|
+
var b = [p, p, t, v, v, q][mod];
|
|
132
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
133
|
+
}
|
|
134
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
135
|
+
var hex = [
|
|
136
|
+
pad2(Math.round(r).toString(16)),
|
|
137
|
+
pad2(Math.round(g).toString(16)),
|
|
138
|
+
pad2(Math.round(b).toString(16))
|
|
139
|
+
];
|
|
140
|
+
if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
|
|
141
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
142
|
+
}
|
|
143
|
+
return hex.join("");
|
|
144
|
+
}
|
|
145
|
+
function convertHexToDecimal(h2) {
|
|
146
|
+
return parseIntFromHex(h2) / 255;
|
|
147
|
+
}
|
|
148
|
+
function parseIntFromHex(val) {
|
|
149
|
+
return parseInt(val, 16);
|
|
150
|
+
}
|
|
151
|
+
var names = {
|
|
152
|
+
aliceblue: "#f0f8ff",
|
|
153
|
+
antiquewhite: "#faebd7",
|
|
154
|
+
aqua: "#00ffff",
|
|
155
|
+
aquamarine: "#7fffd4",
|
|
156
|
+
azure: "#f0ffff",
|
|
157
|
+
beige: "#f5f5dc",
|
|
158
|
+
bisque: "#ffe4c4",
|
|
159
|
+
black: "#000000",
|
|
160
|
+
blanchedalmond: "#ffebcd",
|
|
161
|
+
blue: "#0000ff",
|
|
162
|
+
blueviolet: "#8a2be2",
|
|
163
|
+
brown: "#a52a2a",
|
|
164
|
+
burlywood: "#deb887",
|
|
165
|
+
cadetblue: "#5f9ea0",
|
|
166
|
+
chartreuse: "#7fff00",
|
|
167
|
+
chocolate: "#d2691e",
|
|
168
|
+
coral: "#ff7f50",
|
|
169
|
+
cornflowerblue: "#6495ed",
|
|
170
|
+
cornsilk: "#fff8dc",
|
|
171
|
+
crimson: "#dc143c",
|
|
172
|
+
cyan: "#00ffff",
|
|
173
|
+
darkblue: "#00008b",
|
|
174
|
+
darkcyan: "#008b8b",
|
|
175
|
+
darkgoldenrod: "#b8860b",
|
|
176
|
+
darkgray: "#a9a9a9",
|
|
177
|
+
darkgreen: "#006400",
|
|
178
|
+
darkgrey: "#a9a9a9",
|
|
179
|
+
darkkhaki: "#bdb76b",
|
|
180
|
+
darkmagenta: "#8b008b",
|
|
181
|
+
darkolivegreen: "#556b2f",
|
|
182
|
+
darkorange: "#ff8c00",
|
|
183
|
+
darkorchid: "#9932cc",
|
|
184
|
+
darkred: "#8b0000",
|
|
185
|
+
darksalmon: "#e9967a",
|
|
186
|
+
darkseagreen: "#8fbc8f",
|
|
187
|
+
darkslateblue: "#483d8b",
|
|
188
|
+
darkslategray: "#2f4f4f",
|
|
189
|
+
darkslategrey: "#2f4f4f",
|
|
190
|
+
darkturquoise: "#00ced1",
|
|
191
|
+
darkviolet: "#9400d3",
|
|
192
|
+
deeppink: "#ff1493",
|
|
193
|
+
deepskyblue: "#00bfff",
|
|
194
|
+
dimgray: "#696969",
|
|
195
|
+
dimgrey: "#696969",
|
|
196
|
+
dodgerblue: "#1e90ff",
|
|
197
|
+
firebrick: "#b22222",
|
|
198
|
+
floralwhite: "#fffaf0",
|
|
199
|
+
forestgreen: "#228b22",
|
|
200
|
+
fuchsia: "#ff00ff",
|
|
201
|
+
gainsboro: "#dcdcdc",
|
|
202
|
+
ghostwhite: "#f8f8ff",
|
|
203
|
+
goldenrod: "#daa520",
|
|
204
|
+
gold: "#ffd700",
|
|
205
|
+
gray: "#808080",
|
|
206
|
+
green: "#008000",
|
|
207
|
+
greenyellow: "#adff2f",
|
|
208
|
+
grey: "#808080",
|
|
209
|
+
honeydew: "#f0fff0",
|
|
210
|
+
hotpink: "#ff69b4",
|
|
211
|
+
indianred: "#cd5c5c",
|
|
212
|
+
indigo: "#4b0082",
|
|
213
|
+
ivory: "#fffff0",
|
|
214
|
+
khaki: "#f0e68c",
|
|
215
|
+
lavenderblush: "#fff0f5",
|
|
216
|
+
lavender: "#e6e6fa",
|
|
217
|
+
lawngreen: "#7cfc00",
|
|
218
|
+
lemonchiffon: "#fffacd",
|
|
219
|
+
lightblue: "#add8e6",
|
|
220
|
+
lightcoral: "#f08080",
|
|
221
|
+
lightcyan: "#e0ffff",
|
|
222
|
+
lightgoldenrodyellow: "#fafad2",
|
|
223
|
+
lightgray: "#d3d3d3",
|
|
224
|
+
lightgreen: "#90ee90",
|
|
225
|
+
lightgrey: "#d3d3d3",
|
|
226
|
+
lightpink: "#ffb6c1",
|
|
227
|
+
lightsalmon: "#ffa07a",
|
|
228
|
+
lightseagreen: "#20b2aa",
|
|
229
|
+
lightskyblue: "#87cefa",
|
|
230
|
+
lightslategray: "#778899",
|
|
231
|
+
lightslategrey: "#778899",
|
|
232
|
+
lightsteelblue: "#b0c4de",
|
|
233
|
+
lightyellow: "#ffffe0",
|
|
234
|
+
lime: "#00ff00",
|
|
235
|
+
limegreen: "#32cd32",
|
|
236
|
+
linen: "#faf0e6",
|
|
237
|
+
magenta: "#ff00ff",
|
|
238
|
+
maroon: "#800000",
|
|
239
|
+
mediumaquamarine: "#66cdaa",
|
|
240
|
+
mediumblue: "#0000cd",
|
|
241
|
+
mediumorchid: "#ba55d3",
|
|
242
|
+
mediumpurple: "#9370db",
|
|
243
|
+
mediumseagreen: "#3cb371",
|
|
244
|
+
mediumslateblue: "#7b68ee",
|
|
245
|
+
mediumspringgreen: "#00fa9a",
|
|
246
|
+
mediumturquoise: "#48d1cc",
|
|
247
|
+
mediumvioletred: "#c71585",
|
|
248
|
+
midnightblue: "#191970",
|
|
249
|
+
mintcream: "#f5fffa",
|
|
250
|
+
mistyrose: "#ffe4e1",
|
|
251
|
+
moccasin: "#ffe4b5",
|
|
252
|
+
navajowhite: "#ffdead",
|
|
253
|
+
navy: "#000080",
|
|
254
|
+
oldlace: "#fdf5e6",
|
|
255
|
+
olive: "#808000",
|
|
256
|
+
olivedrab: "#6b8e23",
|
|
257
|
+
orange: "#ffa500",
|
|
258
|
+
orangered: "#ff4500",
|
|
259
|
+
orchid: "#da70d6",
|
|
260
|
+
palegoldenrod: "#eee8aa",
|
|
261
|
+
palegreen: "#98fb98",
|
|
262
|
+
paleturquoise: "#afeeee",
|
|
263
|
+
palevioletred: "#db7093",
|
|
264
|
+
papayawhip: "#ffefd5",
|
|
265
|
+
peachpuff: "#ffdab9",
|
|
266
|
+
peru: "#cd853f",
|
|
267
|
+
pink: "#ffc0cb",
|
|
268
|
+
plum: "#dda0dd",
|
|
269
|
+
powderblue: "#b0e0e6",
|
|
270
|
+
purple: "#800080",
|
|
271
|
+
rebeccapurple: "#663399",
|
|
272
|
+
red: "#ff0000",
|
|
273
|
+
rosybrown: "#bc8f8f",
|
|
274
|
+
royalblue: "#4169e1",
|
|
275
|
+
saddlebrown: "#8b4513",
|
|
276
|
+
salmon: "#fa8072",
|
|
277
|
+
sandybrown: "#f4a460",
|
|
278
|
+
seagreen: "#2e8b57",
|
|
279
|
+
seashell: "#fff5ee",
|
|
280
|
+
sienna: "#a0522d",
|
|
281
|
+
silver: "#c0c0c0",
|
|
282
|
+
skyblue: "#87ceeb",
|
|
283
|
+
slateblue: "#6a5acd",
|
|
284
|
+
slategray: "#708090",
|
|
285
|
+
slategrey: "#708090",
|
|
286
|
+
snow: "#fffafa",
|
|
287
|
+
springgreen: "#00ff7f",
|
|
288
|
+
steelblue: "#4682b4",
|
|
289
|
+
tan: "#d2b48c",
|
|
290
|
+
teal: "#008080",
|
|
291
|
+
thistle: "#d8bfd8",
|
|
292
|
+
tomato: "#ff6347",
|
|
293
|
+
turquoise: "#40e0d0",
|
|
294
|
+
violet: "#ee82ee",
|
|
295
|
+
wheat: "#f5deb3",
|
|
296
|
+
white: "#ffffff",
|
|
297
|
+
whitesmoke: "#f5f5f5",
|
|
298
|
+
yellow: "#ffff00",
|
|
299
|
+
yellowgreen: "#9acd32"
|
|
300
|
+
};
|
|
301
|
+
function inputToRGB(color) {
|
|
302
|
+
var rgb = { r: 0, g: 0, b: 0 };
|
|
303
|
+
var a = 1;
|
|
304
|
+
var s = null;
|
|
305
|
+
var v = null;
|
|
306
|
+
var l = null;
|
|
307
|
+
var ok = false;
|
|
308
|
+
var format = false;
|
|
309
|
+
if (typeof color === "string") {
|
|
310
|
+
color = stringInputToObject(color);
|
|
311
|
+
}
|
|
312
|
+
if (typeof color === "object") {
|
|
313
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
314
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
315
|
+
ok = true;
|
|
316
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
317
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
318
|
+
s = convertToPercentage(color.s);
|
|
319
|
+
v = convertToPercentage(color.v);
|
|
320
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
321
|
+
ok = true;
|
|
322
|
+
format = "hsv";
|
|
323
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
324
|
+
s = convertToPercentage(color.s);
|
|
325
|
+
l = convertToPercentage(color.l);
|
|
326
|
+
rgb = hslToRgb(color.h, s, l);
|
|
327
|
+
ok = true;
|
|
328
|
+
format = "hsl";
|
|
329
|
+
}
|
|
330
|
+
if (Object.prototype.hasOwnProperty.call(color, "a")) {
|
|
331
|
+
a = color.a;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
a = boundAlpha(a);
|
|
335
|
+
return {
|
|
336
|
+
ok,
|
|
337
|
+
format: color.format || format,
|
|
338
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
339
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
340
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
341
|
+
a
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
345
|
+
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
346
|
+
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
|
|
347
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
348
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
|
|
349
|
+
var matchers = {
|
|
350
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
351
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
352
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
353
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
354
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
355
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
356
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
357
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
358
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
359
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
360
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
361
|
+
};
|
|
362
|
+
function stringInputToObject(color) {
|
|
363
|
+
color = color.trim().toLowerCase();
|
|
364
|
+
if (color.length === 0) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
var named = false;
|
|
368
|
+
if (names[color]) {
|
|
369
|
+
color = names[color];
|
|
370
|
+
named = true;
|
|
371
|
+
} else if (color === "transparent") {
|
|
372
|
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
373
|
+
}
|
|
374
|
+
var match = matchers.rgb.exec(color);
|
|
375
|
+
if (match) {
|
|
376
|
+
return { r: match[1], g: match[2], b: match[3] };
|
|
377
|
+
}
|
|
378
|
+
match = matchers.rgba.exec(color);
|
|
379
|
+
if (match) {
|
|
380
|
+
return { r: match[1], g: match[2], b: match[3], a: match[4] };
|
|
381
|
+
}
|
|
382
|
+
match = matchers.hsl.exec(color);
|
|
383
|
+
if (match) {
|
|
384
|
+
return { h: match[1], s: match[2], l: match[3] };
|
|
385
|
+
}
|
|
386
|
+
match = matchers.hsla.exec(color);
|
|
387
|
+
if (match) {
|
|
388
|
+
return { h: match[1], s: match[2], l: match[3], a: match[4] };
|
|
389
|
+
}
|
|
390
|
+
match = matchers.hsv.exec(color);
|
|
391
|
+
if (match) {
|
|
392
|
+
return { h: match[1], s: match[2], v: match[3] };
|
|
393
|
+
}
|
|
394
|
+
match = matchers.hsva.exec(color);
|
|
395
|
+
if (match) {
|
|
396
|
+
return { h: match[1], s: match[2], v: match[3], a: match[4] };
|
|
397
|
+
}
|
|
398
|
+
match = matchers.hex8.exec(color);
|
|
399
|
+
if (match) {
|
|
400
|
+
return {
|
|
401
|
+
r: parseIntFromHex(match[1]),
|
|
402
|
+
g: parseIntFromHex(match[2]),
|
|
403
|
+
b: parseIntFromHex(match[3]),
|
|
404
|
+
a: convertHexToDecimal(match[4]),
|
|
405
|
+
format: named ? "name" : "hex8"
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
match = matchers.hex6.exec(color);
|
|
409
|
+
if (match) {
|
|
410
|
+
return {
|
|
411
|
+
r: parseIntFromHex(match[1]),
|
|
412
|
+
g: parseIntFromHex(match[2]),
|
|
413
|
+
b: parseIntFromHex(match[3]),
|
|
414
|
+
format: named ? "name" : "hex"
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
match = matchers.hex4.exec(color);
|
|
418
|
+
if (match) {
|
|
419
|
+
return {
|
|
420
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
421
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
422
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
423
|
+
a: convertHexToDecimal(match[4] + match[4]),
|
|
424
|
+
format: named ? "name" : "hex8"
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
match = matchers.hex3.exec(color);
|
|
428
|
+
if (match) {
|
|
429
|
+
return {
|
|
430
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
431
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
432
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
433
|
+
format: named ? "name" : "hex"
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
function isValidCSSUnit(color) {
|
|
439
|
+
return Boolean(matchers.CSS_UNIT.exec(String(color)));
|
|
440
|
+
}
|
|
441
|
+
var hueStep = 2;
|
|
442
|
+
var saturationStep = 0.16;
|
|
443
|
+
var saturationStep2 = 0.05;
|
|
444
|
+
var brightnessStep1 = 0.05;
|
|
445
|
+
var brightnessStep2 = 0.15;
|
|
446
|
+
var lightColorCount = 5;
|
|
447
|
+
var darkColorCount = 4;
|
|
448
|
+
var darkColorMap = [{
|
|
449
|
+
index: 7,
|
|
450
|
+
opacity: 0.15
|
|
451
|
+
}, {
|
|
452
|
+
index: 6,
|
|
453
|
+
opacity: 0.25
|
|
454
|
+
}, {
|
|
455
|
+
index: 5,
|
|
456
|
+
opacity: 0.3
|
|
457
|
+
}, {
|
|
458
|
+
index: 5,
|
|
459
|
+
opacity: 0.45
|
|
460
|
+
}, {
|
|
461
|
+
index: 5,
|
|
462
|
+
opacity: 0.65
|
|
463
|
+
}, {
|
|
464
|
+
index: 5,
|
|
465
|
+
opacity: 0.85
|
|
466
|
+
}, {
|
|
467
|
+
index: 4,
|
|
468
|
+
opacity: 0.9
|
|
469
|
+
}, {
|
|
470
|
+
index: 3,
|
|
471
|
+
opacity: 0.95
|
|
472
|
+
}, {
|
|
473
|
+
index: 2,
|
|
474
|
+
opacity: 0.97
|
|
475
|
+
}, {
|
|
476
|
+
index: 1,
|
|
477
|
+
opacity: 0.98
|
|
478
|
+
}];
|
|
479
|
+
function toHsv(_ref) {
|
|
480
|
+
var r = _ref.r, g = _ref.g, b = _ref.b;
|
|
481
|
+
var hsv = rgbToHsv(r, g, b);
|
|
482
|
+
return {
|
|
483
|
+
h: hsv.h * 360,
|
|
484
|
+
s: hsv.s,
|
|
485
|
+
v: hsv.v
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function toHex(_ref2) {
|
|
489
|
+
var r = _ref2.r, g = _ref2.g, b = _ref2.b;
|
|
490
|
+
return "#".concat(rgbToHex(r, g, b, false));
|
|
491
|
+
}
|
|
492
|
+
function mix(rgb1, rgb2, amount) {
|
|
493
|
+
var p = amount / 100;
|
|
494
|
+
var rgb = {
|
|
495
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
496
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
497
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b
|
|
498
|
+
};
|
|
499
|
+
return rgb;
|
|
500
|
+
}
|
|
501
|
+
function getHue(hsv, i, light) {
|
|
502
|
+
var hue;
|
|
503
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
504
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
505
|
+
} else {
|
|
506
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
507
|
+
}
|
|
508
|
+
if (hue < 0) {
|
|
509
|
+
hue += 360;
|
|
510
|
+
} else if (hue >= 360) {
|
|
511
|
+
hue -= 360;
|
|
512
|
+
}
|
|
513
|
+
return hue;
|
|
514
|
+
}
|
|
515
|
+
function getSaturation(hsv, i, light) {
|
|
516
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
517
|
+
return hsv.s;
|
|
518
|
+
}
|
|
519
|
+
var saturation;
|
|
520
|
+
if (light) {
|
|
521
|
+
saturation = hsv.s - saturationStep * i;
|
|
522
|
+
} else if (i === darkColorCount) {
|
|
523
|
+
saturation = hsv.s + saturationStep;
|
|
524
|
+
} else {
|
|
525
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
526
|
+
}
|
|
527
|
+
if (saturation > 1) {
|
|
528
|
+
saturation = 1;
|
|
529
|
+
}
|
|
530
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
531
|
+
saturation = 0.1;
|
|
532
|
+
}
|
|
533
|
+
if (saturation < 0.06) {
|
|
534
|
+
saturation = 0.06;
|
|
535
|
+
}
|
|
536
|
+
return Number(saturation.toFixed(2));
|
|
537
|
+
}
|
|
538
|
+
function getValue(hsv, i, light) {
|
|
539
|
+
var value;
|
|
540
|
+
if (light) {
|
|
541
|
+
value = hsv.v + brightnessStep1 * i;
|
|
542
|
+
} else {
|
|
543
|
+
value = hsv.v - brightnessStep2 * i;
|
|
544
|
+
}
|
|
545
|
+
if (value > 1) {
|
|
546
|
+
value = 1;
|
|
547
|
+
}
|
|
548
|
+
return Number(value.toFixed(2));
|
|
549
|
+
}
|
|
550
|
+
function generate$1(color) {
|
|
551
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
552
|
+
var patterns = [];
|
|
553
|
+
var pColor = inputToRGB(color);
|
|
554
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
555
|
+
var hsv = toHsv(pColor);
|
|
556
|
+
var colorString = toHex(inputToRGB({
|
|
557
|
+
h: getHue(hsv, i, true),
|
|
558
|
+
s: getSaturation(hsv, i, true),
|
|
559
|
+
v: getValue(hsv, i, true)
|
|
560
|
+
}));
|
|
561
|
+
patterns.push(colorString);
|
|
562
|
+
}
|
|
563
|
+
patterns.push(toHex(pColor));
|
|
564
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
565
|
+
var _hsv = toHsv(pColor);
|
|
566
|
+
var _colorString = toHex(inputToRGB({
|
|
567
|
+
h: getHue(_hsv, _i),
|
|
568
|
+
s: getSaturation(_hsv, _i),
|
|
569
|
+
v: getValue(_hsv, _i)
|
|
570
|
+
}));
|
|
571
|
+
patterns.push(_colorString);
|
|
572
|
+
}
|
|
573
|
+
if (opts.theme === "dark") {
|
|
574
|
+
return darkColorMap.map(function(_ref3) {
|
|
575
|
+
var index2 = _ref3.index, opacity = _ref3.opacity;
|
|
576
|
+
var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index2]), opacity * 100));
|
|
577
|
+
return darkColorString;
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
return patterns;
|
|
581
|
+
}
|
|
582
|
+
var presetPrimaryColors = {
|
|
583
|
+
red: "#F5222D",
|
|
584
|
+
volcano: "#FA541C",
|
|
585
|
+
orange: "#FA8C16",
|
|
586
|
+
gold: "#FAAD14",
|
|
587
|
+
yellow: "#FADB14",
|
|
588
|
+
lime: "#A0D911",
|
|
589
|
+
green: "#52C41A",
|
|
590
|
+
cyan: "#13C2C2",
|
|
591
|
+
blue: "#1890FF",
|
|
592
|
+
geekblue: "#2F54EB",
|
|
593
|
+
purple: "#722ED1",
|
|
594
|
+
magenta: "#EB2F96",
|
|
595
|
+
grey: "#666666"
|
|
596
|
+
};
|
|
597
|
+
var presetPalettes = {};
|
|
598
|
+
var presetDarkPalettes = {};
|
|
599
|
+
Object.keys(presetPrimaryColors).forEach(function(key) {
|
|
600
|
+
presetPalettes[key] = generate$1(presetPrimaryColors[key]);
|
|
601
|
+
presetPalettes[key].primary = presetPalettes[key][5];
|
|
602
|
+
presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
|
|
603
|
+
theme: "dark",
|
|
604
|
+
backgroundColor: "#141414"
|
|
605
|
+
});
|
|
606
|
+
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
|
|
607
|
+
});
|
|
608
|
+
var containers = [];
|
|
609
|
+
var styleElements = [];
|
|
610
|
+
var usage = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
|
|
611
|
+
function createStyleElement() {
|
|
612
|
+
var styleElement = document.createElement("style");
|
|
613
|
+
styleElement.setAttribute("type", "text/css");
|
|
614
|
+
return styleElement;
|
|
615
|
+
}
|
|
616
|
+
function insertCss(css, options) {
|
|
617
|
+
options = options || {};
|
|
618
|
+
if (css === void 0) {
|
|
619
|
+
throw new Error(usage);
|
|
620
|
+
}
|
|
621
|
+
var position = options.prepend === true ? "prepend" : "append";
|
|
622
|
+
var container = options.container !== void 0 ? options.container : document.querySelector("head");
|
|
623
|
+
var containerId = containers.indexOf(container);
|
|
624
|
+
if (containerId === -1) {
|
|
625
|
+
containerId = containers.push(container) - 1;
|
|
626
|
+
styleElements[containerId] = {};
|
|
627
|
+
}
|
|
628
|
+
var styleElement;
|
|
629
|
+
if (styleElements[containerId] !== void 0 && styleElements[containerId][position] !== void 0) {
|
|
630
|
+
styleElement = styleElements[containerId][position];
|
|
631
|
+
} else {
|
|
632
|
+
styleElement = styleElements[containerId][position] = createStyleElement();
|
|
633
|
+
if (position === "prepend") {
|
|
634
|
+
container.insertBefore(styleElement, container.childNodes[0]);
|
|
635
|
+
} else {
|
|
636
|
+
container.appendChild(styleElement);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
if (css.charCodeAt(0) === 65279) {
|
|
640
|
+
css = css.substr(1, css.length);
|
|
641
|
+
}
|
|
642
|
+
if (styleElement.styleSheet) {
|
|
643
|
+
styleElement.styleSheet.cssText += css;
|
|
644
|
+
} else {
|
|
645
|
+
styleElement.textContent += css;
|
|
646
|
+
}
|
|
647
|
+
return styleElement;
|
|
648
|
+
}
|
|
649
|
+
function _objectSpread$4(target) {
|
|
650
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
651
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
652
|
+
var ownKeys2 = Object.keys(source);
|
|
653
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
654
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
655
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
656
|
+
}));
|
|
657
|
+
}
|
|
658
|
+
ownKeys2.forEach(function(key) {
|
|
659
|
+
_defineProperty$5(target, key, source[key]);
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return target;
|
|
663
|
+
}
|
|
664
|
+
function _defineProperty$5(obj, key, value) {
|
|
665
|
+
if (key in obj) {
|
|
666
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
667
|
+
} else {
|
|
668
|
+
obj[key] = value;
|
|
669
|
+
}
|
|
670
|
+
return obj;
|
|
671
|
+
}
|
|
672
|
+
function warn(valid, message) {
|
|
673
|
+
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
|
|
674
|
+
console.error("Warning: ".concat(message));
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function warning(valid, message) {
|
|
678
|
+
warn(valid, "[@ant-design/icons-vue] ".concat(message));
|
|
679
|
+
}
|
|
680
|
+
function isIconDefinition(target) {
|
|
681
|
+
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
|
|
682
|
+
}
|
|
683
|
+
function generate(node, key, rootProps) {
|
|
684
|
+
if (!rootProps) {
|
|
685
|
+
return h(node.tag, _objectSpread$4({
|
|
686
|
+
key
|
|
687
|
+
}, node.attrs), (node.children || []).map(function(child, index2) {
|
|
688
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index2));
|
|
689
|
+
}));
|
|
690
|
+
}
|
|
691
|
+
return h(node.tag, _objectSpread$4({
|
|
692
|
+
key
|
|
693
|
+
}, rootProps, node.attrs), (node.children || []).map(function(child, index2) {
|
|
694
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index2));
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
function getSecondaryColor(primaryColor) {
|
|
698
|
+
return generate$1(primaryColor)[0];
|
|
699
|
+
}
|
|
700
|
+
function normalizeTwoToneColors(twoToneColor) {
|
|
701
|
+
if (!twoToneColor) {
|
|
702
|
+
return [];
|
|
703
|
+
}
|
|
704
|
+
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
705
|
+
}
|
|
706
|
+
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";
|
|
707
|
+
var cssInjectedFlag = false;
|
|
708
|
+
var useInsertStyles = function useInsertStyles2() {
|
|
709
|
+
var styleStr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : iconStyles;
|
|
710
|
+
nextTick(function() {
|
|
711
|
+
if (!cssInjectedFlag) {
|
|
712
|
+
if (typeof window !== "undefined" && window.document && window.document.documentElement) {
|
|
713
|
+
insertCss(styleStr, {
|
|
714
|
+
prepend: true
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
cssInjectedFlag = true;
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
};
|
|
721
|
+
var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
|
|
722
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
723
|
+
if (source == null)
|
|
724
|
+
return {};
|
|
725
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
726
|
+
var key, i;
|
|
727
|
+
if (Object.getOwnPropertySymbols) {
|
|
728
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
729
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
730
|
+
key = sourceSymbolKeys[i];
|
|
731
|
+
if (excluded.indexOf(key) >= 0)
|
|
732
|
+
continue;
|
|
733
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
734
|
+
continue;
|
|
735
|
+
target[key] = source[key];
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return target;
|
|
739
|
+
}
|
|
740
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
741
|
+
if (source == null)
|
|
742
|
+
return {};
|
|
743
|
+
var target = {};
|
|
744
|
+
var sourceKeys = Object.keys(source);
|
|
745
|
+
var key, i;
|
|
746
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
747
|
+
key = sourceKeys[i];
|
|
748
|
+
if (excluded.indexOf(key) >= 0)
|
|
749
|
+
continue;
|
|
750
|
+
target[key] = source[key];
|
|
751
|
+
}
|
|
752
|
+
return target;
|
|
753
|
+
}
|
|
754
|
+
function _objectSpread$3(target) {
|
|
755
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
756
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
757
|
+
var ownKeys2 = Object.keys(source);
|
|
758
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
759
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
760
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
761
|
+
}));
|
|
762
|
+
}
|
|
763
|
+
ownKeys2.forEach(function(key) {
|
|
764
|
+
_defineProperty$4(target, key, source[key]);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
return target;
|
|
768
|
+
}
|
|
769
|
+
function _defineProperty$4(obj, key, value) {
|
|
770
|
+
if (key in obj) {
|
|
771
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
772
|
+
} else {
|
|
773
|
+
obj[key] = value;
|
|
774
|
+
}
|
|
775
|
+
return obj;
|
|
776
|
+
}
|
|
777
|
+
var twoToneColorPalette = {
|
|
778
|
+
primaryColor: "#333",
|
|
779
|
+
secondaryColor: "#E6E6E6",
|
|
780
|
+
calculated: false
|
|
781
|
+
};
|
|
782
|
+
function setTwoToneColors(_ref) {
|
|
783
|
+
var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor;
|
|
784
|
+
twoToneColorPalette.primaryColor = primaryColor;
|
|
785
|
+
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
786
|
+
twoToneColorPalette.calculated = !!secondaryColor;
|
|
787
|
+
}
|
|
788
|
+
function getTwoToneColors() {
|
|
789
|
+
return _objectSpread$3({}, twoToneColorPalette);
|
|
790
|
+
}
|
|
791
|
+
var IconBase = function IconBase2(props, context) {
|
|
792
|
+
var _props$context$attrs = _objectSpread$3({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
|
|
793
|
+
var colors = twoToneColorPalette;
|
|
794
|
+
if (primaryColor) {
|
|
795
|
+
colors = {
|
|
796
|
+
primaryColor,
|
|
797
|
+
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
useInsertStyles();
|
|
801
|
+
warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
802
|
+
if (!isIconDefinition(icon)) {
|
|
803
|
+
return null;
|
|
804
|
+
}
|
|
805
|
+
var target = icon;
|
|
806
|
+
if (target && typeof target.icon === "function") {
|
|
807
|
+
target = _objectSpread$3({}, target, {
|
|
808
|
+
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
return generate(target.icon, "svg-".concat(target.name), _objectSpread$3({}, restProps, {
|
|
812
|
+
"data-icon": target.name,
|
|
813
|
+
width: "1em",
|
|
814
|
+
height: "1em",
|
|
815
|
+
fill: "currentColor",
|
|
816
|
+
"aria-hidden": "true"
|
|
817
|
+
}));
|
|
818
|
+
};
|
|
819
|
+
IconBase.props = {
|
|
820
|
+
icon: Object,
|
|
821
|
+
primaryColor: String,
|
|
822
|
+
secondaryColor: String,
|
|
823
|
+
focusable: String
|
|
824
|
+
};
|
|
825
|
+
IconBase.inheritAttrs = false;
|
|
826
|
+
IconBase.displayName = "IconBase";
|
|
827
|
+
IconBase.getTwoToneColors = getTwoToneColors;
|
|
828
|
+
IconBase.setTwoToneColors = setTwoToneColors;
|
|
829
|
+
const VueIcon = IconBase;
|
|
830
|
+
function _slicedToArray$1(arr, i) {
|
|
831
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
|
|
832
|
+
}
|
|
833
|
+
function _nonIterableRest$1() {
|
|
834
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
835
|
+
}
|
|
836
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
|
837
|
+
if (!o)
|
|
838
|
+
return;
|
|
839
|
+
if (typeof o === "string")
|
|
840
|
+
return _arrayLikeToArray$1(o, minLen);
|
|
841
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
842
|
+
if (n === "Object" && o.constructor)
|
|
843
|
+
n = o.constructor.name;
|
|
844
|
+
if (n === "Map" || n === "Set")
|
|
845
|
+
return Array.from(o);
|
|
846
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
847
|
+
return _arrayLikeToArray$1(o, minLen);
|
|
848
|
+
}
|
|
849
|
+
function _arrayLikeToArray$1(arr, len) {
|
|
850
|
+
if (len == null || len > arr.length)
|
|
851
|
+
len = arr.length;
|
|
852
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
853
|
+
arr2[i] = arr[i];
|
|
854
|
+
}
|
|
855
|
+
return arr2;
|
|
856
|
+
}
|
|
857
|
+
function _iterableToArrayLimit$1(arr, i) {
|
|
858
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
859
|
+
if (_i == null)
|
|
860
|
+
return;
|
|
861
|
+
var _arr = [];
|
|
862
|
+
var _n = true;
|
|
863
|
+
var _d = false;
|
|
864
|
+
var _s, _e;
|
|
865
|
+
try {
|
|
866
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
867
|
+
_arr.push(_s.value);
|
|
868
|
+
if (i && _arr.length === i)
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
} catch (err) {
|
|
872
|
+
_d = true;
|
|
873
|
+
_e = err;
|
|
874
|
+
} finally {
|
|
875
|
+
try {
|
|
876
|
+
if (!_n && _i["return"] != null)
|
|
877
|
+
_i["return"]();
|
|
878
|
+
} finally {
|
|
879
|
+
if (_d)
|
|
880
|
+
throw _e;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return _arr;
|
|
884
|
+
}
|
|
885
|
+
function _arrayWithHoles$1(arr) {
|
|
886
|
+
if (Array.isArray(arr))
|
|
887
|
+
return arr;
|
|
888
|
+
}
|
|
889
|
+
function setTwoToneColor(twoToneColor) {
|
|
890
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
891
|
+
return VueIcon.setTwoToneColors({
|
|
892
|
+
primaryColor,
|
|
893
|
+
secondaryColor
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
function getTwoToneColor() {
|
|
897
|
+
var colors = VueIcon.getTwoToneColors();
|
|
898
|
+
if (!colors.calculated) {
|
|
899
|
+
return colors.primaryColor;
|
|
900
|
+
}
|
|
901
|
+
return [colors.primaryColor, colors.secondaryColor];
|
|
902
|
+
}
|
|
903
|
+
var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
|
|
904
|
+
function _slicedToArray(arr, i) {
|
|
905
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
906
|
+
}
|
|
907
|
+
function _nonIterableRest() {
|
|
908
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
909
|
+
}
|
|
910
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
911
|
+
if (!o)
|
|
912
|
+
return;
|
|
913
|
+
if (typeof o === "string")
|
|
914
|
+
return _arrayLikeToArray(o, minLen);
|
|
915
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
916
|
+
if (n === "Object" && o.constructor)
|
|
917
|
+
n = o.constructor.name;
|
|
918
|
+
if (n === "Map" || n === "Set")
|
|
919
|
+
return Array.from(o);
|
|
920
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
921
|
+
return _arrayLikeToArray(o, minLen);
|
|
922
|
+
}
|
|
923
|
+
function _arrayLikeToArray(arr, len) {
|
|
924
|
+
if (len == null || len > arr.length)
|
|
925
|
+
len = arr.length;
|
|
926
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
927
|
+
arr2[i] = arr[i];
|
|
928
|
+
}
|
|
929
|
+
return arr2;
|
|
930
|
+
}
|
|
931
|
+
function _iterableToArrayLimit(arr, i) {
|
|
932
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
933
|
+
if (_i == null)
|
|
934
|
+
return;
|
|
935
|
+
var _arr = [];
|
|
936
|
+
var _n = true;
|
|
937
|
+
var _d = false;
|
|
938
|
+
var _s, _e;
|
|
939
|
+
try {
|
|
940
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
941
|
+
_arr.push(_s.value);
|
|
942
|
+
if (i && _arr.length === i)
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
} catch (err) {
|
|
946
|
+
_d = true;
|
|
947
|
+
_e = err;
|
|
948
|
+
} finally {
|
|
949
|
+
try {
|
|
950
|
+
if (!_n && _i["return"] != null)
|
|
951
|
+
_i["return"]();
|
|
952
|
+
} finally {
|
|
953
|
+
if (_d)
|
|
954
|
+
throw _e;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
return _arr;
|
|
958
|
+
}
|
|
959
|
+
function _arrayWithHoles(arr) {
|
|
960
|
+
if (Array.isArray(arr))
|
|
961
|
+
return arr;
|
|
962
|
+
}
|
|
963
|
+
function _objectSpread$2(target) {
|
|
964
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
965
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
966
|
+
var ownKeys2 = Object.keys(source);
|
|
967
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
968
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
969
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
970
|
+
}));
|
|
971
|
+
}
|
|
972
|
+
ownKeys2.forEach(function(key) {
|
|
973
|
+
_defineProperty$3(target, key, source[key]);
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
return target;
|
|
977
|
+
}
|
|
978
|
+
function _defineProperty$3(obj, key, value) {
|
|
979
|
+
if (key in obj) {
|
|
980
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
981
|
+
} else {
|
|
982
|
+
obj[key] = value;
|
|
983
|
+
}
|
|
984
|
+
return obj;
|
|
985
|
+
}
|
|
986
|
+
function _objectWithoutProperties(source, excluded) {
|
|
987
|
+
if (source == null)
|
|
988
|
+
return {};
|
|
989
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
990
|
+
var key, i;
|
|
991
|
+
if (Object.getOwnPropertySymbols) {
|
|
992
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
993
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
994
|
+
key = sourceSymbolKeys[i];
|
|
995
|
+
if (excluded.indexOf(key) >= 0)
|
|
996
|
+
continue;
|
|
997
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
998
|
+
continue;
|
|
999
|
+
target[key] = source[key];
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return target;
|
|
1003
|
+
}
|
|
1004
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1005
|
+
if (source == null)
|
|
1006
|
+
return {};
|
|
1007
|
+
var target = {};
|
|
1008
|
+
var sourceKeys = Object.keys(source);
|
|
1009
|
+
var key, i;
|
|
1010
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1011
|
+
key = sourceKeys[i];
|
|
1012
|
+
if (excluded.indexOf(key) >= 0)
|
|
1013
|
+
continue;
|
|
1014
|
+
target[key] = source[key];
|
|
1015
|
+
}
|
|
1016
|
+
return target;
|
|
1017
|
+
}
|
|
1018
|
+
setTwoToneColor("#1890ff");
|
|
1019
|
+
var Icon = function Icon2(props, context) {
|
|
1020
|
+
var _classObj;
|
|
1021
|
+
var _props$context$attrs = _objectSpread$2({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
|
|
1022
|
+
var classObj = (_classObj = {
|
|
1023
|
+
anticon: true
|
|
1024
|
+
}, _defineProperty$3(_classObj, "anticon-".concat(icon.name), Boolean(icon.name)), _defineProperty$3(_classObj, cls, cls), _classObj);
|
|
1025
|
+
var svgClassString = spin === "" || !!spin || icon.name === "loading" ? "anticon-spin" : "";
|
|
1026
|
+
var iconTabIndex = tabindex;
|
|
1027
|
+
if (iconTabIndex === void 0 && onClick) {
|
|
1028
|
+
iconTabIndex = -1;
|
|
1029
|
+
restProps.tabindex = iconTabIndex;
|
|
1030
|
+
}
|
|
1031
|
+
var svgStyle = rotate ? {
|
|
1032
|
+
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
1033
|
+
transform: "rotate(".concat(rotate, "deg)")
|
|
1034
|
+
} : void 0;
|
|
1035
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
|
|
1036
|
+
return createVNode("span", _objectSpread$2({
|
|
1037
|
+
"role": "img",
|
|
1038
|
+
"aria-label": icon.name
|
|
1039
|
+
}, restProps, {
|
|
1040
|
+
"onClick": onClick,
|
|
1041
|
+
"class": classObj
|
|
1042
|
+
}), [createVNode(VueIcon, {
|
|
1043
|
+
"class": svgClassString,
|
|
1044
|
+
"icon": icon,
|
|
1045
|
+
"primaryColor": primaryColor,
|
|
1046
|
+
"secondaryColor": secondaryColor,
|
|
1047
|
+
"style": svgStyle
|
|
1048
|
+
}, null)]);
|
|
1049
|
+
};
|
|
1050
|
+
Icon.props = {
|
|
1051
|
+
spin: Boolean,
|
|
1052
|
+
rotate: Number,
|
|
1053
|
+
icon: Object,
|
|
1054
|
+
twoToneColor: String
|
|
1055
|
+
};
|
|
1056
|
+
Icon.displayName = "AntdIcon";
|
|
1057
|
+
Icon.inheritAttrs = false;
|
|
1058
|
+
Icon.getTwoToneColor = getTwoToneColor;
|
|
1059
|
+
Icon.setTwoToneColor = setTwoToneColor;
|
|
1060
|
+
const AntdIcon = Icon;
|
|
1061
|
+
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" };
|
|
1062
|
+
const DownOutlinedSvg = DownOutlined$2;
|
|
1063
|
+
function _objectSpread$1(target) {
|
|
1064
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1065
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
1066
|
+
var ownKeys2 = Object.keys(source);
|
|
1067
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1068
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1069
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1070
|
+
}));
|
|
1071
|
+
}
|
|
1072
|
+
ownKeys2.forEach(function(key) {
|
|
1073
|
+
_defineProperty$2(target, key, source[key]);
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
return target;
|
|
1077
|
+
}
|
|
1078
|
+
function _defineProperty$2(obj, key, value) {
|
|
1079
|
+
if (key in obj) {
|
|
1080
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1081
|
+
} else {
|
|
1082
|
+
obj[key] = value;
|
|
1083
|
+
}
|
|
1084
|
+
return obj;
|
|
1085
|
+
}
|
|
1086
|
+
var DownOutlined = function DownOutlined2(props, context) {
|
|
1087
|
+
var p = _objectSpread$1({}, props, context.attrs);
|
|
1088
|
+
return createVNode(AntdIcon, _objectSpread$1({}, p, {
|
|
1089
|
+
"icon": DownOutlinedSvg
|
|
1090
|
+
}), null);
|
|
1091
|
+
};
|
|
1092
|
+
DownOutlined.displayName = "DownOutlined";
|
|
1093
|
+
DownOutlined.inheritAttrs = false;
|
|
1094
|
+
const DownOutlined$1 = DownOutlined;
|
|
1095
|
+
var MinusOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "minus", "theme": "outlined" };
|
|
1096
|
+
const MinusOutlinedSvg = MinusOutlined$2;
|
|
1097
|
+
function _objectSpread(target) {
|
|
1098
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1099
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
1100
|
+
var ownKeys2 = Object.keys(source);
|
|
1101
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1102
|
+
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1103
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1104
|
+
}));
|
|
1105
|
+
}
|
|
1106
|
+
ownKeys2.forEach(function(key) {
|
|
1107
|
+
_defineProperty$1(target, key, source[key]);
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
return target;
|
|
1111
|
+
}
|
|
1112
|
+
function _defineProperty$1(obj, key, value) {
|
|
1113
|
+
if (key in obj) {
|
|
1114
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
1115
|
+
} else {
|
|
1116
|
+
obj[key] = value;
|
|
1117
|
+
}
|
|
1118
|
+
return obj;
|
|
1119
|
+
}
|
|
1120
|
+
var MinusOutlined = function MinusOutlined2(props, context) {
|
|
1121
|
+
var p = _objectSpread({}, props, context.attrs);
|
|
1122
|
+
return createVNode(AntdIcon, _objectSpread({}, p, {
|
|
1123
|
+
"icon": MinusOutlinedSvg
|
|
1124
|
+
}), null);
|
|
1125
|
+
};
|
|
1126
|
+
MinusOutlined.displayName = "MinusOutlined";
|
|
1127
|
+
MinusOutlined.inheritAttrs = false;
|
|
1128
|
+
const MinusOutlined$1 = MinusOutlined;
|
|
1129
|
+
const _withScopeId = (n) => (pushScopeId("data-v-68169e62"), n = n(), popScopeId(), n);
|
|
1130
|
+
const _hoisted_1 = { class: "button-group" };
|
|
1131
|
+
const _hoisted_2 = { class: "flex-button" };
|
|
1132
|
+
const _hoisted_3 = ["onClick"];
|
|
1133
|
+
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("a", { href: "javascript:;" }, "1st menu item", -1));
|
|
1134
|
+
const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("a", { href: "javascript:;" }, "2nd menu item", -1));
|
|
1135
|
+
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("a", { href: "javascript:;" }, "3rd menu item", -1));
|
|
1136
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1137
|
+
__name: "ButtonGroup",
|
|
1138
|
+
props: {
|
|
1139
|
+
data: null
|
|
1140
|
+
},
|
|
1141
|
+
emits: ["click-event"],
|
|
1142
|
+
setup(__props, { emit }) {
|
|
1143
|
+
const props = __props;
|
|
1144
|
+
const baseButtonList = ref();
|
|
1145
|
+
const hideButtonList = ref();
|
|
1146
|
+
watchEffect(() => {
|
|
1147
|
+
baseButtonList.value = props.data.length > 2 ? props.data.slice(0, 3) : props.data;
|
|
1148
|
+
hideButtonList.value = props.data.slice(4);
|
|
1149
|
+
});
|
|
1150
|
+
const setStyle = (dataIndex) => {
|
|
1151
|
+
if (dataIndex === "del") {
|
|
1152
|
+
return {
|
|
1153
|
+
color: "red"
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
const clickEvent = (dataIndex) => {
|
|
1158
|
+
emit("click-event", dataIndex);
|
|
1159
|
+
};
|
|
1160
|
+
return (_ctx, _cache) => {
|
|
1161
|
+
const _component_a_popconfirm = resolveComponent("a-popconfirm");
|
|
1162
|
+
const _component_a_menu_item = resolveComponent("a-menu-item");
|
|
1163
|
+
const _component_a_menu = resolveComponent("a-menu");
|
|
1164
|
+
const _component_a_dropdown = resolveComponent("a-dropdown");
|
|
1165
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1166
|
+
createElementVNode("div", _hoisted_2, [
|
|
1167
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(baseButtonList.value, (button, index2) => {
|
|
1168
|
+
return openBlock(), createElementBlock(Fragment, { key: index2 }, [
|
|
1169
|
+
createVNode(_component_a_popconfirm, {
|
|
1170
|
+
title: "\u786E\u8BA4\u5220\u9664",
|
|
1171
|
+
"ok-text": "\u786E\u8BA4",
|
|
1172
|
+
"cancel-text": "\u53D6\u6D88"
|
|
1173
|
+
}, {
|
|
1174
|
+
default: withCtx(() => [
|
|
1175
|
+
createElementVNode("div", {
|
|
1176
|
+
class: "button-item",
|
|
1177
|
+
onClick: ($event) => clickEvent(button.dataIndex)
|
|
1178
|
+
}, [
|
|
1179
|
+
createElementVNode("span", {
|
|
1180
|
+
style: normalizeStyle(setStyle(button.dataIndex))
|
|
1181
|
+
}, toDisplayString(button.title), 5)
|
|
1182
|
+
], 8, _hoisted_3)
|
|
1183
|
+
]),
|
|
1184
|
+
_: 2
|
|
1185
|
+
}, 1024),
|
|
1186
|
+
index2 < 2 ? (openBlock(), createBlock(unref(MinusOutlined$1), {
|
|
1187
|
+
key: 0,
|
|
1188
|
+
class: "split-line"
|
|
1189
|
+
})) : createCommentVNode("", true)
|
|
1190
|
+
], 64);
|
|
1191
|
+
}), 128)),
|
|
1192
|
+
props.data.length > 3 ? (openBlock(), createBlock(_component_a_dropdown, { key: 0 }, {
|
|
1193
|
+
overlay: withCtx(() => [
|
|
1194
|
+
createVNode(_component_a_menu, null, {
|
|
1195
|
+
default: withCtx(() => [
|
|
1196
|
+
createVNode(_component_a_menu_item, null, {
|
|
1197
|
+
default: withCtx(() => [
|
|
1198
|
+
_hoisted_4
|
|
1199
|
+
]),
|
|
1200
|
+
_: 1
|
|
1201
|
+
}),
|
|
1202
|
+
createVNode(_component_a_menu_item, null, {
|
|
1203
|
+
default: withCtx(() => [
|
|
1204
|
+
_hoisted_5
|
|
1205
|
+
]),
|
|
1206
|
+
_: 1
|
|
1207
|
+
}),
|
|
1208
|
+
createVNode(_component_a_menu_item, null, {
|
|
1209
|
+
default: withCtx(() => [
|
|
1210
|
+
_hoisted_6
|
|
1211
|
+
]),
|
|
1212
|
+
_: 1
|
|
1213
|
+
})
|
|
1214
|
+
]),
|
|
1215
|
+
_: 1
|
|
1216
|
+
})
|
|
1217
|
+
]),
|
|
1218
|
+
default: withCtx(() => [
|
|
1219
|
+
createElementVNode("a", {
|
|
1220
|
+
class: "ant-dropdown-link",
|
|
1221
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
1222
|
+
}, ["prevent"]))
|
|
1223
|
+
}, [
|
|
1224
|
+
createTextVNode(" \u66F4\u591A "),
|
|
1225
|
+
createVNode(unref(DownOutlined$1))
|
|
1226
|
+
])
|
|
1227
|
+
]),
|
|
1228
|
+
_: 1
|
|
1229
|
+
})) : createCommentVNode("", true)
|
|
1230
|
+
])
|
|
1231
|
+
]);
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
const ButtonGroup_vue_vue_type_style_index_0_scoped_68169e62_lang = "";
|
|
1236
|
+
const _export_sfc = (sfc, props) => {
|
|
1237
|
+
const target = sfc.__vccOpts || sfc;
|
|
1238
|
+
for (const [key, val] of props) {
|
|
1239
|
+
target[key] = val;
|
|
1240
|
+
}
|
|
1241
|
+
return target;
|
|
1242
|
+
};
|
|
1243
|
+
const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-68169e62"]]);
|
|
1244
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1245
|
+
__name: "IndexView",
|
|
1246
|
+
props: {
|
|
1247
|
+
isCheckbox: { type: Boolean, default: true },
|
|
1248
|
+
column: null,
|
|
1249
|
+
data: { default: () => [] },
|
|
1250
|
+
rowHeight: { default: 40 },
|
|
1251
|
+
height: { default: void 0 },
|
|
1252
|
+
menuWidth: { default: 160 },
|
|
1253
|
+
isMenu: { type: Boolean, default: false }
|
|
1254
|
+
},
|
|
1255
|
+
emits: [
|
|
1256
|
+
"page-change",
|
|
1257
|
+
"search-change",
|
|
1258
|
+
"checkbox-change",
|
|
1259
|
+
"add",
|
|
1260
|
+
"edit",
|
|
1261
|
+
"remove",
|
|
1262
|
+
"view"
|
|
1263
|
+
],
|
|
1264
|
+
setup(__props, { emit: emits }) {
|
|
1265
|
+
const props = __props;
|
|
1266
|
+
const buttonList = [
|
|
1267
|
+
{
|
|
1268
|
+
title: "\u67E5\u770B",
|
|
1269
|
+
dataIndex: "view"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
title: "\u4FEE\u6539",
|
|
1273
|
+
dataIndex: "edit"
|
|
1274
|
+
},
|
|
1275
|
+
{
|
|
1276
|
+
title: "\u5220\u9664",
|
|
1277
|
+
dataIndex: "del"
|
|
1278
|
+
}
|
|
1279
|
+
];
|
|
1280
|
+
const buttonClickEvent = (key, row) => {
|
|
1281
|
+
console.log("key", key);
|
|
1282
|
+
console.log("row", row);
|
|
1283
|
+
emits("add-event", 1);
|
|
1284
|
+
};
|
|
1285
|
+
const tableRef = ref();
|
|
1286
|
+
const checkboxChangeEvent = () => {
|
|
1287
|
+
const table = tableRef.value;
|
|
1288
|
+
const list = table.getCheckboxRecords();
|
|
1289
|
+
console.log("list", list);
|
|
1290
|
+
emits("checkbox-change", list);
|
|
1291
|
+
};
|
|
1292
|
+
return (_ctx, _cache) => {
|
|
1293
|
+
return openBlock(), createBlock(unref(VxeTable), {
|
|
1294
|
+
class: "shy-table",
|
|
1295
|
+
ref_key: "tableRef",
|
|
1296
|
+
ref: tableRef,
|
|
1297
|
+
align: "center",
|
|
1298
|
+
height: props.height || void 0,
|
|
1299
|
+
data: __props.data,
|
|
1300
|
+
border: "",
|
|
1301
|
+
"show-overflow": "tooltip",
|
|
1302
|
+
"column-config": { resizable: true },
|
|
1303
|
+
"row-config": { height: props.rowHeight },
|
|
1304
|
+
onCheckboxAll: checkboxChangeEvent,
|
|
1305
|
+
onCheckboxChange: checkboxChangeEvent,
|
|
1306
|
+
size: "small"
|
|
1307
|
+
}, {
|
|
1308
|
+
default: withCtx(() => [
|
|
1309
|
+
__props.isCheckbox ? (openBlock(), createBlock(unref(VxeColumn), {
|
|
1310
|
+
key: 0,
|
|
1311
|
+
type: "checkbox",
|
|
1312
|
+
width: "60"
|
|
1313
|
+
})) : createCommentVNode("", true),
|
|
1314
|
+
createVNode(unref(VxeColumn), {
|
|
1315
|
+
type: "seq",
|
|
1316
|
+
width: "60",
|
|
1317
|
+
title: "\u5E8F\u53F7",
|
|
1318
|
+
align: "center"
|
|
1319
|
+
}),
|
|
1320
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.column, (column, index2) => {
|
|
1321
|
+
return openBlock(), createBlock(unref(VxeColumn), {
|
|
1322
|
+
key: index2,
|
|
1323
|
+
field: column.dataIndex,
|
|
1324
|
+
title: column.title,
|
|
1325
|
+
width: (column == null ? void 0 : column.width) || void 0,
|
|
1326
|
+
align: "center"
|
|
1327
|
+
}, createSlots({ _: 2 }, [
|
|
1328
|
+
(column == null ? void 0 : column.slot) === true ? {
|
|
1329
|
+
name: "default",
|
|
1330
|
+
fn: withCtx(({ row }) => [
|
|
1331
|
+
renderSlot(_ctx.$slots, column.dataIndex, normalizeProps(guardReactiveProps({ row })), () => [
|
|
1332
|
+
createTextVNode("\u63D2\u69FD\u5DF2\u5F00\u542F")
|
|
1333
|
+
], true)
|
|
1334
|
+
]),
|
|
1335
|
+
key: "0"
|
|
1336
|
+
} : void 0
|
|
1337
|
+
]), 1032, ["field", "title", "width"]);
|
|
1338
|
+
}), 128)),
|
|
1339
|
+
props.isMenu ? (openBlock(), createBlock(unref(VxeColumn), {
|
|
1340
|
+
key: 1,
|
|
1341
|
+
align: "center",
|
|
1342
|
+
title: "\u64CD\u4F5C",
|
|
1343
|
+
width: props.menuWidth
|
|
1344
|
+
}, {
|
|
1345
|
+
default: withCtx(({ row }) => [
|
|
1346
|
+
createVNode(ButtonGroup, {
|
|
1347
|
+
data: buttonList,
|
|
1348
|
+
onClickEvent: ($event) => buttonClickEvent($event, row)
|
|
1349
|
+
}, null, 8, ["onClickEvent"])
|
|
1350
|
+
]),
|
|
1351
|
+
_: 1
|
|
1352
|
+
}, 8, ["width"])) : createCommentVNode("", true)
|
|
1353
|
+
]),
|
|
1354
|
+
_: 3
|
|
1355
|
+
}, 8, ["height", "data", "row-config"]);
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
const IndexView_vue_vue_type_style_index_0_scoped_9dac58ff_lang = "";
|
|
1360
|
+
const ShyTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9dac58ff"]]);
|
|
2
1361
|
const Pagination = {
|
|
3
1362
|
items_per_page: "\u6761/\u9875",
|
|
4
1363
|
jump_to: "\u8DF3\u81F3",
|
|
@@ -278,6 +1637,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
278
1637
|
});
|
|
279
1638
|
const index = {
|
|
280
1639
|
install(app) {
|
|
1640
|
+
app.component("s-table", ShyTable);
|
|
281
1641
|
app.component("s-page", _sfc_main);
|
|
282
1642
|
}
|
|
283
1643
|
};
|