vxe-pc-ui 3.16.21 → 3.16.23
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/color-picker/index.js +14 -0
- package/es/color-picker/src/color-picker.js +40 -28
- package/es/color-picker/src/util.js +252 -36
- package/es/date-picker/src/date-picker.js +2 -1
- package/es/date-range-picker/src/date-range-picker.js +2 -1
- package/es/form/style.css +2 -2
- package/es/form/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/select/src/select.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-form/style.css +2 -2
- package/es/vxe-form/style.min.css +1 -1
- package/lib/color-picker/index.js +14 -0
- package/lib/color-picker/index.min.js +1 -1
- package/lib/color-picker/src/color-picker.js +38 -27
- package/lib/color-picker/src/color-picker.min.js +1 -1
- package/lib/color-picker/src/util.js +266 -46
- package/lib/color-picker/src/util.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +2 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +2 -1
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/form/style/style.css +2 -2
- package/lib/form/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +318 -77
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +2 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-form/style/style.css +2 -2
- package/lib/vxe-form/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/color-picker/index.ts +15 -0
- package/packages/color-picker/src/color-picker.ts +41 -29
- package/packages/color-picker/src/util.ts +267 -42
- package/packages/date-picker/src/date-picker.ts +4 -2
- package/packages/date-range-picker/src/date-range-picker.ts +4 -2
- package/packages/select/src/select.ts +4 -2
- package/styles/components/form.scss +2 -2
- package/types/components/color-picker.d.ts +93 -0
- package/types/components/grid.d.ts +6 -0
- package/types/components/table.d.ts +2 -2
- package/types/ui/index.d.ts +2 -0
- /package/es/icon/{iconfont.1784868314197.ttf → iconfont.1785242763644.ttf} +0 -0
- /package/es/icon/{iconfont.1784868314197.woff → iconfont.1785242763644.woff} +0 -0
- /package/es/icon/{iconfont.1784868314197.woff2 → iconfont.1785242763644.woff2} +0 -0
- /package/es/{iconfont.1784868314197.ttf → iconfont.1785242763644.ttf} +0 -0
- /package/es/{iconfont.1784868314197.woff → iconfont.1785242763644.woff} +0 -0
- /package/es/{iconfont.1784868314197.woff2 → iconfont.1785242763644.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1784868314197.ttf → iconfont.1785242763644.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1784868314197.woff → iconfont.1785242763644.woff} +0 -0
- /package/lib/icon/style/{iconfont.1784868314197.woff2 → iconfont.1785242763644.woff2} +0 -0
- /package/lib/{iconfont.1784868314197.ttf → iconfont.1785242763644.ttf} +0 -0
- /package/lib/{iconfont.1784868314197.woff → iconfont.1785242763644.woff} +0 -0
- /package/lib/{iconfont.1784868314197.woff2 → iconfont.1785242763644.woff2} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
|
|
3
|
+
import type { VxeColorPickerDefines } from '../../../types'
|
|
4
|
+
|
|
3
5
|
const hexAlphaKeyMaps: Record<string, number> = {}
|
|
4
6
|
const hexAlphaNumMaps: Record<string, string> = {}
|
|
5
7
|
'FF,FC,FA,F7,F5,F2,F0,ED,EB,E8,E6,E3,E0,DE,DB,D9,D6,D4,D1,CF,CC,C9,C7,C4,C2,BF,BD,BA,B8,B5,B3,B0,AD,AB,A8,A6,A3,A1,9E,9C,99,96,94,91,8F,8C,8A,87,85,82,80,7D,7A,78,75,73,70,6E,6B,69,66,63,61,5E,5C,59,57,54,52,4F,4D,4A,47,45,42,40,3D,3B,38,36,33,30,2E,2B,29,26,24,21,1F,1C,1A,17,14,12,0F,0D,0A,08,05,03,00'.split(',').forEach((key, i) => {
|
|
@@ -10,15 +12,156 @@ const hexAlphaNumMaps: Record<string, string> = {}
|
|
|
10
12
|
|
|
11
13
|
const rgbRE = /^rgb(a?)\((\d{1,3})[,\s]+(\d{1,3})[,\s]+(\d{1,3})([,//\s]+([0-9.]{1,4})(%?))?\)$/
|
|
12
14
|
export function hasRgb (value: string) {
|
|
13
|
-
return value && rgbRE.test(value)
|
|
15
|
+
return !!(value && rgbRE.test(value))
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const hexRE = /^(#?)([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/
|
|
17
19
|
export function hasHex (value: string) {
|
|
18
|
-
return value && hexRE.test(value)
|
|
20
|
+
return !!(value && hexRE.test(value))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function toRgb (value: string) {
|
|
24
|
+
if (value) {
|
|
25
|
+
if (hexRE.test(value)) {
|
|
26
|
+
return hexToRgb(value)
|
|
27
|
+
}
|
|
28
|
+
return parseRgbVal(value)
|
|
29
|
+
}
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function toRgbString (value: string) {
|
|
34
|
+
const rgbRest = toRgb(value)
|
|
35
|
+
if (rgbRest) {
|
|
36
|
+
return rgbRest.label
|
|
37
|
+
}
|
|
38
|
+
return ''
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function toHex (value: string) {
|
|
42
|
+
if (value) {
|
|
43
|
+
if (rgbRE.test(value)) {
|
|
44
|
+
return rgbValToHex(value)
|
|
45
|
+
}
|
|
46
|
+
return parseHexVal(value)
|
|
47
|
+
}
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function toHexString (value: string) {
|
|
52
|
+
const hexRest = toHex(value)
|
|
53
|
+
if (hexRest) {
|
|
54
|
+
return hexRest.label
|
|
55
|
+
}
|
|
56
|
+
return ''
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function toHsl (value: string) {
|
|
60
|
+
const rgbRest = toRgb(value)
|
|
61
|
+
if (rgbRest) {
|
|
62
|
+
const hslRest = rgbToHsl(rgbRest)
|
|
63
|
+
if (hslRest) {
|
|
64
|
+
const rest: VxeColorPickerDefines.HslObj = { value, type: 'hsl', ...hslRest }
|
|
65
|
+
return rest
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function toHsv (value: string) {
|
|
72
|
+
const rgbRest = toRgb(value)
|
|
73
|
+
if (rgbRest) {
|
|
74
|
+
const hslRest = rgbToHsv(rgbRest)
|
|
75
|
+
if (hslRest) {
|
|
76
|
+
const rest: VxeColorPickerDefines.HsvObj = { value, type: 'hsv', ...hslRest }
|
|
77
|
+
return rest
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return null
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function parseColor<T extends keyof VxeColorPickerDefines.ParseResultMap> (val: string, format?: T): VxeColorPickerDefines.ParseResultMap[T] | null {
|
|
84
|
+
if (val) {
|
|
85
|
+
if (format === 'hex') {
|
|
86
|
+
return toHex(val) as any
|
|
87
|
+
}
|
|
88
|
+
if (format === 'hsl') {
|
|
89
|
+
return toHsl(val) as any
|
|
90
|
+
}
|
|
91
|
+
if (format === 'hsv') {
|
|
92
|
+
return toHsv(val) as any
|
|
93
|
+
}
|
|
94
|
+
return toRgb(val) as any
|
|
95
|
+
}
|
|
96
|
+
return null
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function handleNumClamp (val: number) {
|
|
100
|
+
return Math.min(1, Math.max(0, val))
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function createLightenDarken (isAdd: number) {
|
|
104
|
+
return function (val: string, ratio?: number) {
|
|
105
|
+
const colorRest = parseColor(val)
|
|
106
|
+
const hslRest = toHsl(val)
|
|
107
|
+
if (colorRest && hslRest) {
|
|
108
|
+
ratio = ratio === 0 ? 0 : ratio || 10
|
|
109
|
+
hslRest.l += (isAdd ? ratio : -ratio) / 100
|
|
110
|
+
hslRest.l = handleNumClamp(hslRest.l)
|
|
111
|
+
const rgbRest = hslToRgb(hslRest)
|
|
112
|
+
if (rgbRest) {
|
|
113
|
+
if (colorRest?.type === 'hex') {
|
|
114
|
+
return rgbToHexVal(rgbRest.r, rgbRest.g, rgbRest.b, hslRest.a)
|
|
115
|
+
}
|
|
116
|
+
return toValRgb(rgbRest.r, rgbRest.g, rgbRest.b, hslRest.a)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return val
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const lighten = createLightenDarken(1)
|
|
124
|
+
export const darken = createLightenDarken(0)
|
|
125
|
+
|
|
126
|
+
function parseHexVal (value: string) {
|
|
127
|
+
if (value) {
|
|
128
|
+
const hexRest = value.match(hexRE)
|
|
129
|
+
if (hexRest) {
|
|
130
|
+
const rest:VxeColorPickerDefines.HexObj = {
|
|
131
|
+
value,
|
|
132
|
+
label: value,
|
|
133
|
+
type: 'hex',
|
|
134
|
+
hex: value,
|
|
135
|
+
hexV: hexRest[2],
|
|
136
|
+
hexA: hexRest[3] || '',
|
|
137
|
+
a: (hexRest[3] ? hexAlphaKeyMaps[hexRest[3].toUpperCase()] : 1) || 1
|
|
138
|
+
}
|
|
139
|
+
return rest
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return null
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function parseRgbVal (value: string) {
|
|
146
|
+
if (value) {
|
|
147
|
+
const rgbRest = value.match(rgbRE)
|
|
148
|
+
if (rgbRest) {
|
|
149
|
+
const rest: VxeColorPickerDefines.RgbObj = {
|
|
150
|
+
value,
|
|
151
|
+
label: value,
|
|
152
|
+
type: (rgbRest[6] ? 'rgba' : 'rgb') as 'rgba' | 'rgb',
|
|
153
|
+
r: parseInt(rgbRest[2]),
|
|
154
|
+
g: parseInt(rgbRest[3]),
|
|
155
|
+
b: parseInt(rgbRest[4]),
|
|
156
|
+
a: rgbRest[7] ? parseInt(rgbRest[6]) / 100 : (rgbRest[6] ? parseFloat(rgbRest[6]) : 1)
|
|
157
|
+
}
|
|
158
|
+
return rest
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return null
|
|
19
162
|
}
|
|
20
163
|
|
|
21
|
-
export function
|
|
164
|
+
export function parseValColor (value: string) {
|
|
22
165
|
const rest = {
|
|
23
166
|
value: '',
|
|
24
167
|
type: '',
|
|
@@ -31,57 +174,47 @@ export function parseColor (value: string) {
|
|
|
31
174
|
a: 1
|
|
32
175
|
}
|
|
33
176
|
if (value) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
rest
|
|
38
|
-
rest.hex = value
|
|
39
|
-
rest.hexV = hexRest[2]
|
|
40
|
-
rest.hexA = hexRest[3] || ''
|
|
41
|
-
rest.a = (hexRest[3] ? hexAlphaKeyMaps[hexRest[3].toUpperCase()] : 1) || 1
|
|
42
|
-
}
|
|
43
|
-
const rgbRest = value.match(rgbRE)
|
|
44
|
-
if (rgbRest) {
|
|
45
|
-
rest.value = value
|
|
46
|
-
rest.type = rgbRest[6] ? 'rgba' : 'rgb'
|
|
47
|
-
rest.r = parseInt(rgbRest[2])
|
|
48
|
-
rest.g = parseInt(rgbRest[3])
|
|
49
|
-
rest.b = parseInt(rgbRest[4])
|
|
50
|
-
rest.a = rgbRest[7] ? parseInt(rgbRest[6]) / 100 : (rgbRest[6] ? parseFloat(rgbRest[6]) : 1)
|
|
177
|
+
if (hexRE.test(value)) {
|
|
178
|
+
return Object.assign(rest, parseHexVal(value))
|
|
179
|
+
} else if (rgbRE.test(value)) {
|
|
180
|
+
return Object.assign(rest, parseRgbVal(value))
|
|
51
181
|
}
|
|
52
182
|
}
|
|
53
183
|
return rest
|
|
54
184
|
}
|
|
55
185
|
|
|
56
186
|
export function updateColorAlpha (value: string, alpha: number = 1) {
|
|
57
|
-
const colorRest =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return
|
|
187
|
+
const colorRest = parseValColor(value)
|
|
188
|
+
if (colorRest) {
|
|
189
|
+
const { type } = colorRest
|
|
190
|
+
if (type === 'hex') {
|
|
191
|
+
return `#${colorRest.hexV}${alpha === 1 ? '' : (hexAlphaNumMaps[alpha] || '')}`
|
|
192
|
+
}
|
|
193
|
+
return toValRgb(colorRest.r, colorRest.g, colorRest.b, alpha)
|
|
64
194
|
}
|
|
65
195
|
return ''
|
|
66
196
|
}
|
|
67
197
|
|
|
68
|
-
export function
|
|
69
|
-
if (XEUtils.eqNull(a)) {
|
|
198
|
+
export function toValRgb (r: number, g: number, b: number, a?: number | null) {
|
|
199
|
+
if (XEUtils.eqNull(a) || a === 1) {
|
|
70
200
|
return `rgb(${r},${g},${b})`
|
|
71
201
|
}
|
|
72
202
|
return `rgba(${r},${g},${b},${a})`
|
|
73
203
|
}
|
|
74
204
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return ''
|
|
205
|
+
function rgbValToHex (value: string) {
|
|
206
|
+
const rgbRest = parseRgbVal(value)
|
|
207
|
+
if (rgbRest) {
|
|
208
|
+
const hexVal = rgbToHexVal(rgbRest.r, rgbRest.g, rgbRest.b, rgbRest.a)
|
|
209
|
+
if (hexVal) {
|
|
210
|
+
return parseHexVal(hexVal)
|
|
211
|
+
}
|
|
83
212
|
}
|
|
84
|
-
|
|
213
|
+
return null
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function rgbToHexVal (r: number, g: number, b: number, a?: number) {
|
|
217
|
+
a = XEUtils.isNumber(a) ? a : 1
|
|
85
218
|
const hexR = r.toString(16).padStart(2, '0')
|
|
86
219
|
const hexG = g.toString(16).padStart(2, '0')
|
|
87
220
|
const hexB = b.toString(16).padStart(2, '0')
|
|
@@ -136,6 +269,91 @@ export function rgbToHsv (rgbRest: {
|
|
|
136
269
|
}
|
|
137
270
|
}
|
|
138
271
|
|
|
272
|
+
function rgbToHsl (rgbRest: {
|
|
273
|
+
r: number
|
|
274
|
+
g: number
|
|
275
|
+
b: number
|
|
276
|
+
a?: number
|
|
277
|
+
}) {
|
|
278
|
+
if (!rgbRest) {
|
|
279
|
+
return null
|
|
280
|
+
}
|
|
281
|
+
const { r, g, b, a } = rgbRest
|
|
282
|
+
const rNorm = r / 255
|
|
283
|
+
const gNorm = g / 255
|
|
284
|
+
const bNorm = b / 255
|
|
285
|
+
|
|
286
|
+
const max = Math.max(rNorm, gNorm, bNorm)
|
|
287
|
+
const min = Math.min(rNorm, gNorm, bNorm)
|
|
288
|
+
const delta = max - min
|
|
289
|
+
|
|
290
|
+
let h = 0
|
|
291
|
+
let s = 0
|
|
292
|
+
const l = (max + min) / 2
|
|
293
|
+
|
|
294
|
+
if (delta !== 0) {
|
|
295
|
+
s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min)
|
|
296
|
+
if (max === rNorm) {
|
|
297
|
+
h = ((gNorm - bNorm) / delta) % 6
|
|
298
|
+
} else if (max === gNorm) {
|
|
299
|
+
h = (bNorm - rNorm) / delta + 2
|
|
300
|
+
} else {
|
|
301
|
+
h = (rNorm - gNorm) / delta + 4
|
|
302
|
+
}
|
|
303
|
+
h *= 60
|
|
304
|
+
if (h < 0) {
|
|
305
|
+
h += 360
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return {
|
|
310
|
+
h,
|
|
311
|
+
s,
|
|
312
|
+
l,
|
|
313
|
+
a: XEUtils.isNumber(a) ? a : 1
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function hslToRgb (slRest: {
|
|
318
|
+
h: number
|
|
319
|
+
s: number
|
|
320
|
+
l: number
|
|
321
|
+
}) {
|
|
322
|
+
if (!slRest) {
|
|
323
|
+
return null
|
|
324
|
+
}
|
|
325
|
+
let { h, s, l } = slRest
|
|
326
|
+
const sNorm = s
|
|
327
|
+
const lNorm = l
|
|
328
|
+
|
|
329
|
+
h = ((h % 360) + 360) % 360
|
|
330
|
+
|
|
331
|
+
const c = (1 - Math.abs(2 * lNorm - 1)) * sNorm
|
|
332
|
+
const x = c * (1 - Math.abs((h / 60) % 2 - 1))
|
|
333
|
+
const m = lNorm - c / 2
|
|
334
|
+
|
|
335
|
+
let r: number, g: number, b: number
|
|
336
|
+
if (h >= 0 && h < 60) {
|
|
337
|
+
r = c; g = x; b = 0
|
|
338
|
+
} else if (h >= 60 && h < 120) {
|
|
339
|
+
r = x; g = c; b = 0
|
|
340
|
+
} else if (h >= 120 && h < 180) {
|
|
341
|
+
r = 0; g = c; b = x
|
|
342
|
+
} else if (h >= 180 && h < 240) {
|
|
343
|
+
r = 0; g = x; b = c
|
|
344
|
+
} else if (h >= 240 && h < 300) {
|
|
345
|
+
r = x; g = 0; b = c
|
|
346
|
+
} else {
|
|
347
|
+
r = c; g = 0; b = x
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return {
|
|
351
|
+
r: Math.round((r + m) * 255),
|
|
352
|
+
g: Math.round((g + m) * 255),
|
|
353
|
+
b: Math.round((b + m) * 255)
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
139
357
|
export function hsvToRgb (h: number, s: number, v: number) {
|
|
140
358
|
let r = 0
|
|
141
359
|
let g = 0
|
|
@@ -186,11 +404,18 @@ export function hexToRgb (str: string) {
|
|
|
186
404
|
if (str) {
|
|
187
405
|
const rests = str.match(/^(#?)([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})?$/)
|
|
188
406
|
if (rests) {
|
|
407
|
+
const r = parseInt(rests[2], 16)
|
|
408
|
+
const g = parseInt(rests[3], 16)
|
|
409
|
+
const b = parseInt(rests[4], 16)
|
|
410
|
+
const a = (rests[5] ? hexAlphaKeyMaps[rests[5].toUpperCase()] : 1) || 1
|
|
189
411
|
return {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
412
|
+
value: str,
|
|
413
|
+
label: toValRgb(r, g, b, rests[5] ? a : null),
|
|
414
|
+
type: (rests[5] ? 'rgba' : 'rgb') as 'rgba' | 'rgb',
|
|
415
|
+
r,
|
|
416
|
+
g,
|
|
417
|
+
b,
|
|
418
|
+
a
|
|
194
419
|
}
|
|
195
420
|
}
|
|
196
421
|
}
|
|
@@ -11,7 +11,7 @@ import VxeDatePanelComponent from '../../date-panel'
|
|
|
11
11
|
import VxeButtonComponent from '../../button'
|
|
12
12
|
import VxeButtonGroupComponent from '../../button-group'
|
|
13
13
|
|
|
14
|
-
import type { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData, VxeButtonGroupDefines, VxeComponentSizeType, VxeDatePanelDefines, VxeDatePickerPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePickerDefines, VxeDatePanelConstructor } from '../../../types'
|
|
14
|
+
import type { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData, VxeButtonGroupDefines, VxeComponentSizeType, VxeDatePanelDefines, VxeDatePickerPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePickerDefines, VxeDatePanelConstructor, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
15
15
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
16
16
|
|
|
17
17
|
const { warnLog, errLog } = createComponentLog('date-picker')
|
|
@@ -206,6 +206,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
206
206
|
$xeModal(): (VxeModalConstructor & VxeModalMethods) | null
|
|
207
207
|
$xeDrawer(): (VxeDrawerConstructor & VxeDrawerMethods) | null
|
|
208
208
|
$xeTable(): (VxeTableConstructor & VxeTablePrivateMethods) | null
|
|
209
|
+
$xeCard(): (VxeCardConstructor & VxeCardPrivateMethods) | null
|
|
209
210
|
$xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
|
|
210
211
|
formItemInfo(): VxeFormDefines.ProvideItemInfo | null
|
|
211
212
|
}),
|
|
@@ -215,6 +216,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
215
216
|
const $xeTable = $xeDatePicker.$xeTable
|
|
216
217
|
const $xeModal = $xeDatePicker.$xeModal
|
|
217
218
|
const $xeDrawer = $xeDatePicker.$xeDrawer
|
|
219
|
+
const $xeCard = $xeDatePicker.$xeCard
|
|
218
220
|
const $xeForm = $xeDatePicker.$xeForm
|
|
219
221
|
|
|
220
222
|
const { transfer } = props
|
|
@@ -227,7 +229,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
227
229
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
228
230
|
return globalTransfer
|
|
229
231
|
}
|
|
230
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
232
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
231
233
|
return true
|
|
232
234
|
}
|
|
233
235
|
}
|
|
@@ -11,7 +11,7 @@ import VxeDatePanelComponent from '../../date-panel/src/date-panel'
|
|
|
11
11
|
import VxeButtonComponent from '../../button/src/button'
|
|
12
12
|
import VxeButtonGroupComponent from '../../button/src/button-group'
|
|
13
13
|
|
|
14
|
-
import type { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerReactData, DateRangePickerInternalData, VxeButtonGroupDefines, VxeComponentSizeType, VxeDateRangePickerPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDateRangePickerDefines, VxeDatePanelConstructor } from '../../../types'
|
|
14
|
+
import type { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerReactData, DateRangePickerInternalData, VxeButtonGroupDefines, VxeComponentSizeType, VxeDateRangePickerPropTypes, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDateRangePickerDefines, VxeDatePanelConstructor, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
15
15
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
16
16
|
|
|
17
17
|
const { errLog } = createComponentLog('date-range-picker')
|
|
@@ -199,6 +199,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
199
199
|
$xeModal(): (VxeModalConstructor & VxeModalMethods) | null
|
|
200
200
|
$xeDrawer(): (VxeDrawerConstructor & VxeDrawerMethods) | null
|
|
201
201
|
$xeTable(): (VxeTableConstructor & VxeTablePrivateMethods) | null
|
|
202
|
+
$xeCard(): (VxeCardConstructor & VxeCardPrivateMethods) | null
|
|
202
203
|
$xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
|
|
203
204
|
formItemInfo(): VxeFormDefines.ProvideItemInfo | null
|
|
204
205
|
}),
|
|
@@ -208,6 +209,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
208
209
|
const $xeTable = $xeDateRangePicker.$xeTable
|
|
209
210
|
const $xeModal = $xeDateRangePicker.$xeModal
|
|
210
211
|
const $xeDrawer = $xeDateRangePicker.$xeDrawer
|
|
212
|
+
const $xeCard = $xeDateRangePicker.$xeCard
|
|
211
213
|
const $xeForm = $xeDateRangePicker.$xeForm
|
|
212
214
|
|
|
213
215
|
const { transfer } = props
|
|
@@ -220,7 +222,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
220
222
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
221
223
|
return globalTransfer
|
|
222
224
|
}
|
|
223
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
225
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
224
226
|
return true
|
|
225
227
|
}
|
|
226
228
|
}
|
|
@@ -9,7 +9,7 @@ import { createComponentLog } from '../../ui/src/log'
|
|
|
9
9
|
import VxeInputComponent from '../../input/src/input'
|
|
10
10
|
import VxeButtonComponent from '../../button/src/button'
|
|
11
11
|
|
|
12
|
-
import type { VxeSelectPropTypes, SelectInternalData, ValueOf, VxeComponentSizeType, SelectReactData, VxeSelectEmits, VxeButtonDefines, VxeInputDefines, VxeSelectDefines, VxeOptionProps, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeInputConstructor, VxeComponentSlotType, VxeComponentStyleType } from '../../../types'
|
|
12
|
+
import type { VxeSelectPropTypes, SelectInternalData, ValueOf, VxeComponentSizeType, SelectReactData, VxeSelectEmits, VxeButtonDefines, VxeInputDefines, VxeSelectDefines, VxeOptionProps, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeInputConstructor, VxeComponentSlotType, VxeComponentStyleType, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
13
13
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
14
14
|
|
|
15
15
|
const { errLog } = createComponentLog('select')
|
|
@@ -247,6 +247,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
247
247
|
$xeModal(): (VxeModalConstructor & VxeModalMethods) | null
|
|
248
248
|
$xeDrawer(): (VxeDrawerConstructor & VxeDrawerMethods) | null
|
|
249
249
|
$xeTable(): (VxeTableConstructor & VxeTablePrivateMethods) | null
|
|
250
|
+
$xeCard(): (VxeCardConstructor & VxeCardPrivateMethods) | null
|
|
250
251
|
$xeForm(): (VxeFormConstructor & VxeFormPrivateMethods) | null
|
|
251
252
|
formItemInfo(): VxeFormDefines.ProvideItemInfo | null
|
|
252
253
|
}),
|
|
@@ -284,6 +285,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
284
285
|
const $xeTable = $xeSelect.$xeTable
|
|
285
286
|
const $xeModal = $xeSelect.$xeModal
|
|
286
287
|
const $xeDrawer = $xeSelect.$xeDrawer
|
|
288
|
+
const $xeCard = $xeSelect.$xeCard
|
|
287
289
|
const $xeForm = $xeSelect.$xeForm
|
|
288
290
|
|
|
289
291
|
const { transfer } = props
|
|
@@ -296,7 +298,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
296
298
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
297
299
|
return globalTransfer
|
|
298
300
|
}
|
|
299
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
301
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
300
302
|
return true
|
|
301
303
|
}
|
|
302
304
|
}
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
.vxe-form-item--valid-error-tip {
|
|
162
162
|
position: absolute;
|
|
163
163
|
width: 100%;
|
|
164
|
-
font-size:
|
|
164
|
+
font-size: var(--vxe-ui-form-validate-error-font-size, var(--vxe-ui-form-current-font-size));
|
|
165
165
|
line-height: 1em;
|
|
166
166
|
color: var(--vxe-ui-form-validate-error-color);
|
|
167
167
|
background-color: var(--vxe-ui-form-validate-error-background-color);
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
pointer-events: auto;
|
|
177
177
|
}
|
|
178
178
|
.vxe-form-item--valid-error-theme-beautify {
|
|
179
|
-
padding:
|
|
179
|
+
padding: var(--vxe-ui-form-validate-error-padding, 0.2em 0.6em);
|
|
180
180
|
color: #fff;
|
|
181
181
|
background-color: var(--vxe-ui-status-error-color);
|
|
182
182
|
.vxe-form-item--valid-error-msg {
|
|
@@ -139,6 +139,53 @@ export interface VxeColorPickerMethods extends ColorPickerMethods { }
|
|
|
139
139
|
export interface ColorPickerPrivateMethods { }
|
|
140
140
|
export interface VxeColorPickerPrivateMethods extends ColorPickerPrivateMethods { }
|
|
141
141
|
|
|
142
|
+
export interface ColorController {
|
|
143
|
+
/**
|
|
144
|
+
* 解析颜色
|
|
145
|
+
*/
|
|
146
|
+
parseColor<T extends keyof VxeColorPickerDefines.ParseResultMap>(color: string, format?: T): VxeColorPickerDefines.ParseResultMap[T] | null
|
|
147
|
+
/**
|
|
148
|
+
* 判断颜色是否 RGB 格式
|
|
149
|
+
*/
|
|
150
|
+
hasRgb(color: string): boolean
|
|
151
|
+
/**
|
|
152
|
+
* 判断颜色是否 HEX 格式
|
|
153
|
+
*/
|
|
154
|
+
hasHex(color: string): boolean
|
|
155
|
+
/**
|
|
156
|
+
* 转成 RGB 格式
|
|
157
|
+
*/
|
|
158
|
+
toRgb(color: string): VxeColorPickerDefines.RgbObj | null
|
|
159
|
+
/**
|
|
160
|
+
* 转成 RGB 字符串格式
|
|
161
|
+
*/
|
|
162
|
+
toRgbString(color: string): string
|
|
163
|
+
/**
|
|
164
|
+
* 转成 HEX 格式
|
|
165
|
+
*/
|
|
166
|
+
toHex(color: string): VxeColorPickerDefines.HexObj | null
|
|
167
|
+
/**
|
|
168
|
+
* 转成 HEX 字符串格式
|
|
169
|
+
*/
|
|
170
|
+
toHexString(color: string): string
|
|
171
|
+
/**
|
|
172
|
+
* 转成 HSL 格式
|
|
173
|
+
*/
|
|
174
|
+
toHsl(color: string): VxeColorPickerDefines.HslObj | null
|
|
175
|
+
/**
|
|
176
|
+
* 转成 HSV 格式
|
|
177
|
+
*/
|
|
178
|
+
toHsv(color: string): VxeColorPickerDefines.HsvObj | null
|
|
179
|
+
/**
|
|
180
|
+
* 对颜色进行高亮
|
|
181
|
+
*/
|
|
182
|
+
lighten(color: string, ratio: number): string
|
|
183
|
+
/**
|
|
184
|
+
* 对颜色进行加深
|
|
185
|
+
*/
|
|
186
|
+
darken(color: string, ratio: number): string
|
|
187
|
+
}
|
|
188
|
+
|
|
142
189
|
export type VxeColorPickerEmits = [
|
|
143
190
|
'model-value',
|
|
144
191
|
'modelValue',
|
|
@@ -151,6 +198,52 @@ export namespace VxeColorPickerDefines {
|
|
|
151
198
|
export interface ColorPickerEventParams extends VxeComponentEventParams {
|
|
152
199
|
$colorPicker: VxeColorPickerConstructor
|
|
153
200
|
}
|
|
201
|
+
|
|
202
|
+
export type ParseResultMap = {
|
|
203
|
+
'': VxeColorPickerDefines.RgbObj
|
|
204
|
+
'rgb': VxeColorPickerDefines.RgbObj
|
|
205
|
+
'rgba': VxeColorPickerDefines.RgbObj
|
|
206
|
+
'hex': VxeColorPickerDefines.HexObj
|
|
207
|
+
'hsl': VxeColorPickerDefines.HslObj
|
|
208
|
+
'hsv': VxeColorPickerDefines.HsvObj
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface RgbObj {
|
|
212
|
+
type: 'rgba' | 'rgb'
|
|
213
|
+
value: string
|
|
214
|
+
label: string
|
|
215
|
+
r: number
|
|
216
|
+
g: number
|
|
217
|
+
b: number
|
|
218
|
+
a: number
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface HexObj {
|
|
222
|
+
type: 'hex'
|
|
223
|
+
value: string
|
|
224
|
+
label: string
|
|
225
|
+
hex: string
|
|
226
|
+
hexV: string
|
|
227
|
+
hexA: string
|
|
228
|
+
a: number
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface HslObj {
|
|
232
|
+
type: 'hsl'
|
|
233
|
+
value: string
|
|
234
|
+
h: number
|
|
235
|
+
s: number
|
|
236
|
+
l: number
|
|
237
|
+
a: number
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface HsvObj {
|
|
241
|
+
type: 'hsv'
|
|
242
|
+
value: string
|
|
243
|
+
h: number
|
|
244
|
+
s: number
|
|
245
|
+
v: number
|
|
246
|
+
}
|
|
154
247
|
}
|
|
155
248
|
|
|
156
249
|
export type VxeColorPickerEventProps = {}
|
|
@@ -7089,8 +7089,8 @@ export namespace VxeTableDefines {
|
|
|
7089
7089
|
export type CustomEventType = 'reset' | 'confirm' | 'update:width' | 'update:fixed' | 'update:sort' | 'update:visible' | 'update:align' | 'update:headerAlign' | 'update:footerAlign' | 'update:aggGroup' | 'update:aggFunc'
|
|
7090
7090
|
|
|
7091
7091
|
export interface CustomStoreData {
|
|
7092
|
-
|
|
7093
|
-
|
|
7092
|
+
pagerData?: {
|
|
7093
|
+
pSize?: number
|
|
7094
7094
|
}
|
|
7095
7095
|
alignData?: Record<string, VxeColumnPropTypes.Align>
|
|
7096
7096
|
headerAlignData?: Record<string, VxeColumnPropTypes.HeaderAlign>
|
package/types/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VxeUI, getI18n, setConfig } from '@vxe-ui/core'
|
|
2
2
|
import { LoadingController } from '../components/loading'
|
|
3
|
+
import { ColorController } from '../components/color-picker'
|
|
3
4
|
import { ModalController } from '../components/modal'
|
|
4
5
|
import { DrawerController } from '../components/drawer'
|
|
5
6
|
import { WatermarkController } from '../components/watermark'
|
|
@@ -44,6 +45,7 @@ export const readFile: VxeUploadDefines.ReadFileFunction
|
|
|
44
45
|
declare module '@vxe-ui/core' {
|
|
45
46
|
export interface VxeUIExport {
|
|
46
47
|
loading: LoadingController
|
|
48
|
+
color: ColorController
|
|
47
49
|
modal: ModalController
|
|
48
50
|
drawer: DrawerController
|
|
49
51
|
watermark: WatermarkController
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|