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