vxe-pc-ui 4.16.20 → 4.16.22
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/dist/all.esm.js +317 -67
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/cascader/style.css +2 -0
- package/es/cascader/style.min.css +1 -1
- package/es/checkbox/style.css +1 -0
- package/es/checkbox/style.min.css +1 -1
- package/es/checkbox-button/style.css +1 -0
- package/es/checkbox-button/style.min.css +1 -1
- 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/icon/style.css +1 -1
- package/es/list/style.css +3 -0
- package/es/list/style.min.css +1 -1
- package/es/print/src/util.js +1 -1
- package/es/radio/style.css +1 -0
- package/es/radio/style.min.css +1 -1
- package/es/radio-button/style.css +1 -0
- package/es/radio-button/style.min.css +1 -1
- package/es/select/src/select.js +2 -1
- package/es/select/style.css +2 -0
- package/es/select/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/style.css +2 -0
- package/es/tree/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-cascader/style.css +2 -0
- package/es/vxe-cascader/style.min.css +1 -1
- package/es/vxe-checkbox/style.css +1 -0
- package/es/vxe-checkbox/style.min.css +1 -1
- package/es/vxe-checkbox-button/style.css +1 -0
- package/es/vxe-checkbox-button/style.min.css +1 -1
- package/es/vxe-list/style.css +3 -0
- package/es/vxe-list/style.min.css +1 -1
- package/es/vxe-radio/style.css +1 -0
- package/es/vxe-radio/style.min.css +1 -1
- package/es/vxe-radio-button/style.css +1 -0
- package/es/vxe-radio-button/style.min.css +1 -1
- package/es/vxe-select/style.css +2 -0
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-tree/style.css +2 -0
- package/es/vxe-tree/style.min.css +1 -1
- package/lib/cascader/style/style.css +2 -0
- package/lib/cascader/style/style.min.css +1 -1
- package/lib/checkbox/style/style.css +1 -0
- package/lib/checkbox/style/style.min.css +1 -1
- package/lib/checkbox-button/style/style.css +1 -0
- package/lib/checkbox-button/style/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 +272 -49
- 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/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +325 -81
- package/lib/index.umd.min.js +1 -1
- package/lib/list/style/style.css +3 -0
- package/lib/list/style/style.min.css +1 -1
- package/lib/print/src/util.js +1 -1
- package/lib/print/src/util.min.js +1 -1
- package/lib/radio/style/style.css +1 -0
- package/lib/radio/style/style.min.css +1 -1
- package/lib/radio-button/style/style.css +1 -0
- package/lib/radio-button/style/style.min.css +1 -1
- package/lib/select/src/select.js +2 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +2 -0
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tree/style/style.css +2 -0
- package/lib/tree/style/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-cascader/style/style.css +2 -0
- package/lib/vxe-cascader/style/style.min.css +1 -1
- package/lib/vxe-checkbox/style/style.css +1 -0
- package/lib/vxe-checkbox/style/style.min.css +1 -1
- package/lib/vxe-checkbox-button/style/style.css +1 -0
- package/lib/vxe-checkbox-button/style/style.min.css +1 -1
- package/lib/vxe-list/style/style.css +3 -0
- package/lib/vxe-list/style/style.min.css +1 -1
- package/lib/vxe-radio/style/style.css +1 -0
- package/lib/vxe-radio/style/style.min.css +1 -1
- package/lib/vxe-radio-button/style/style.css +1 -0
- package/lib/vxe-radio-button/style/style.min.css +1 -1
- package/lib/vxe-select/style/style.css +2 -0
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-tree/style/style.css +2 -0
- package/lib/vxe-tree/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 +40 -29
- package/packages/color-picker/src/util.ts +267 -42
- package/packages/date-picker/src/date-picker.ts +3 -2
- package/packages/date-range-picker/src/date-range-picker.ts +3 -2
- package/packages/print/src/util.ts +1 -1
- package/packages/select/src/select.ts +3 -2
- package/styles/components/checkbox-button.scss +1 -0
- package/styles/components/radio-button.scss +1 -0
- package/styles/helpers/baseMixin.scss +2 -0
- package/styles/print/default.css +1 -0
- 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.1784793421071.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/es/icon/{iconfont.1784793421071.woff → iconfont.1784893283450.woff} +0 -0
- /package/es/icon/{iconfont.1784793421071.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/es/{iconfont.1784793421071.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/es/{iconfont.1784793421071.woff → iconfont.1784893283450.woff} +0 -0
- /package/es/{iconfont.1784793421071.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1784793421071.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1784793421071.woff → iconfont.1784893283450.woff} +0 -0
- /package/lib/icon/style/{iconfont.1784793421071.woff2 → iconfont.1784893283450.woff2} +0 -0
- /package/lib/{iconfont.1784793421071.ttf → iconfont.1784893283450.ttf} +0 -0
- /package/lib/{iconfont.1784793421071.woff → iconfont.1784893283450.woff} +0 -0
- /package/lib/{iconfont.1784793421071.woff2 → iconfont.1784893283450.woff2} +0 -0
|
@@ -2,6 +2,7 @@ import { App } from 'vue'
|
|
|
2
2
|
import { VxeUI } from '@vxe-ui/core'
|
|
3
3
|
import VxeColorPickerComponent from './src/color-picker'
|
|
4
4
|
import { dynamicApp } from '../dynamics'
|
|
5
|
+
import { parseColor, hasRgb, hasHex, toRgb, toHex, toHsl, toHsv, toRgbString, toHexString, lighten, darken } from './src/util'
|
|
5
6
|
|
|
6
7
|
export const VxeColorPicker = Object.assign({}, VxeColorPickerComponent, {
|
|
7
8
|
install (app: App) {
|
|
@@ -12,5 +13,19 @@ export const VxeColorPicker = Object.assign({}, VxeColorPickerComponent, {
|
|
|
12
13
|
dynamicApp.use(VxeColorPicker)
|
|
13
14
|
VxeUI.component(VxeColorPickerComponent)
|
|
14
15
|
|
|
16
|
+
VxeUI.color = {
|
|
17
|
+
parseColor,
|
|
18
|
+
hasRgb,
|
|
19
|
+
hasHex,
|
|
20
|
+
toRgb,
|
|
21
|
+
toRgbString,
|
|
22
|
+
toHex,
|
|
23
|
+
toHexString,
|
|
24
|
+
toHsl,
|
|
25
|
+
toHsv,
|
|
26
|
+
lighten,
|
|
27
|
+
darken
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
export const ColorPicker = VxeColorPicker
|
|
16
31
|
export default VxeColorPicker
|
|
@@ -4,12 +4,12 @@ import XEUtils from 'xe-utils'
|
|
|
4
4
|
import { VxeUI, getIcon, getConfig, getI18n, globalEvents, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
5
5
|
import { getEventTargetNode, getPopupContainer, toCssUnit, updatePanelPlacement } from '../../ui/src/dom'
|
|
6
6
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
7
|
-
import {
|
|
7
|
+
import { parseValColor, updateColorAlpha, hexToHsv, rgbToHsv, rgbToHexVal, hexToRgb, hsvToRgb, toValRgb } from './util'
|
|
8
8
|
import VxeButtonComponent from '../../button'
|
|
9
9
|
import VxeInputComponent from '../../input'
|
|
10
10
|
import VxeNumberInputComponent from '../../number-input'
|
|
11
11
|
|
|
12
|
-
import type { ColorPickerReactData, VxeColorPickerPropTypes, VxeColorPickerEmits, ColorPickerInternalData, ColorPickerMethods, ColorPickerPrivateMethods, ValueOf, ColorPickerPrivateRef, VxeColorPickerPrivateComputed, VxeColorPickerConstructor, VxeColorPickerPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods } from '../../../types'
|
|
12
|
+
import type { ColorPickerReactData, VxeColorPickerPropTypes, VxeColorPickerEmits, ColorPickerInternalData, ColorPickerMethods, ColorPickerPrivateMethods, ValueOf, ColorPickerPrivateRef, VxeColorPickerPrivateComputed, VxeColorPickerConstructor, VxeColorPickerPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
13
13
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
14
14
|
|
|
15
15
|
export default defineVxeComponent({
|
|
@@ -82,6 +82,7 @@ export default defineVxeComponent({
|
|
|
82
82
|
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods) | null>('$xeModal', null)
|
|
83
83
|
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
84
84
|
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
85
|
+
const $xeCard = inject<(VxeCardConstructor & VxeCardPrivateMethods) | null>('$xeCard', null)
|
|
85
86
|
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods) | null>('$xeForm', null)
|
|
86
87
|
const formItemInfo = inject<VxeFormDefines.ProvideItemInfo | null>('xeFormItemInfo', null)
|
|
87
88
|
|
|
@@ -158,7 +159,7 @@ export default defineVxeComponent({
|
|
|
158
159
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
159
160
|
return globalTransfer
|
|
160
161
|
}
|
|
161
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
162
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
162
163
|
return true
|
|
163
164
|
}
|
|
164
165
|
}
|
|
@@ -240,31 +241,41 @@ export default defineVxeComponent({
|
|
|
240
241
|
const isRgb = computeIsRgb.value
|
|
241
242
|
const hueSliderEl = refHueSliderElem.value
|
|
242
243
|
const alphaSliderEl = refAlphaSliderElem.value
|
|
243
|
-
const colorRest =
|
|
244
|
-
reactData.hexValue =
|
|
245
|
-
reactData.rValue =
|
|
246
|
-
reactData.gValue =
|
|
247
|
-
reactData.bValue =
|
|
248
|
-
reactData.aValue =
|
|
249
|
-
if (colorRest
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
const rgbRest = hexToRgb(colorRest.hex)
|
|
253
|
-
if (rgbRest) {
|
|
254
|
-
reactData.rValue = rgbRest.r
|
|
255
|
-
reactData.gValue = rgbRest.g
|
|
256
|
-
reactData.bValue = rgbRest.b
|
|
257
|
-
reactData.aValue = rgbRest.a
|
|
258
|
-
}
|
|
259
|
-
}
|
|
244
|
+
const colorRest = parseValColor(selectColor)
|
|
245
|
+
reactData.hexValue = ''
|
|
246
|
+
reactData.rValue = 0
|
|
247
|
+
reactData.gValue = 0
|
|
248
|
+
reactData.bValue = 0
|
|
249
|
+
reactData.aValue = 1
|
|
250
|
+
if (colorRest) {
|
|
251
|
+
if (colorRest.type === 'hex') {
|
|
252
|
+
reactData.hexValue = colorRest.hex
|
|
260
253
|
} else {
|
|
261
|
-
|
|
262
|
-
|
|
254
|
+
reactData.rValue = colorRest.r
|
|
255
|
+
reactData.gValue = colorRest.g
|
|
256
|
+
reactData.bValue = colorRest.b
|
|
257
|
+
reactData.aValue = colorRest.a
|
|
258
|
+
}
|
|
259
|
+
if (colorRest.value) {
|
|
260
|
+
if (isRgb) {
|
|
261
|
+
if (colorRest.type === 'hex') {
|
|
262
|
+
const rgbRest = hexToRgb(colorRest.hex)
|
|
263
|
+
if (rgbRest) {
|
|
264
|
+
reactData.rValue = rgbRest.r
|
|
265
|
+
reactData.gValue = rgbRest.g
|
|
266
|
+
reactData.bValue = rgbRest.b
|
|
267
|
+
reactData.aValue = rgbRest.a
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
271
|
+
if (colorRest.type !== 'hex') {
|
|
272
|
+
reactData.hexValue = rgbToHexVal(colorRest.r, colorRest.g, colorRest.b, colorRest.a)
|
|
273
|
+
}
|
|
263
274
|
}
|
|
264
275
|
}
|
|
265
276
|
}
|
|
266
277
|
if (isAniVisible) {
|
|
267
|
-
const hsvRest = colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest)
|
|
278
|
+
const hsvRest = colorRest ? (colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest)) : null
|
|
268
279
|
const colorPanelEl = refColorPanelElem.value
|
|
269
280
|
if (hsvRest) {
|
|
270
281
|
if (colorPanelEl) {
|
|
@@ -277,7 +288,7 @@ export default defineVxeComponent({
|
|
|
277
288
|
}
|
|
278
289
|
}
|
|
279
290
|
if (alphaSliderEl) {
|
|
280
|
-
handleAlphaColor(alphaSliderEl.clientWidth *
|
|
291
|
+
handleAlphaColor(alphaSliderEl.clientWidth * reactData.aValue)
|
|
281
292
|
}
|
|
282
293
|
}
|
|
283
294
|
}
|
|
@@ -455,7 +466,7 @@ export default defineVxeComponent({
|
|
|
455
466
|
gNum = itemNum - offsetNum
|
|
456
467
|
break
|
|
457
468
|
}
|
|
458
|
-
reactData.panelColor =
|
|
469
|
+
reactData.panelColor = toValRgb(rNum, gNum, bNum)
|
|
459
470
|
hueSliderBtnEl.style.left = toCssUnit(offsetLeft)
|
|
460
471
|
}
|
|
461
472
|
}
|
|
@@ -531,7 +542,7 @@ export default defineVxeComponent({
|
|
|
531
542
|
|
|
532
543
|
const handleInputRgbEvent = () => {
|
|
533
544
|
const { rValue, gValue, bValue, aValue } = reactData
|
|
534
|
-
reactData.selectColor =
|
|
545
|
+
reactData.selectColor = toValRgb(rValue, gValue, bValue, aValue)
|
|
535
546
|
updateModelColor()
|
|
536
547
|
}
|
|
537
548
|
|
|
@@ -586,12 +597,12 @@ export default defineVxeComponent({
|
|
|
586
597
|
const colorPanelRect = colorPanelEl.getBoundingClientRect()
|
|
587
598
|
const offsetTop = Math.min(clientHeight, Math.max(0, clientY - colorPanelRect.y))
|
|
588
599
|
const offsetLeft = Math.min(clientWidth, Math.max(0, clientX - colorPanelRect.x))
|
|
589
|
-
const colorRest =
|
|
600
|
+
const colorRest = parseValColor(panelColor)
|
|
590
601
|
if (colorRest) {
|
|
591
602
|
const hsvRest = colorRest.type === 'hex' ? hexToHsv(colorRest.hex) : rgbToHsv(colorRest)
|
|
592
603
|
if (hsvRest) {
|
|
593
604
|
const ragRest = hsvToRgb(hsvRest.h, offsetLeft / clientWidth, (1 - offsetTop / clientHeight))
|
|
594
|
-
reactData.selectColor =
|
|
605
|
+
reactData.selectColor = toValRgb(ragRest.r, ragRest.g, ragRest.b, showAlpha ? aValue : null)
|
|
595
606
|
updateModelColor()
|
|
596
607
|
}
|
|
597
608
|
}
|
|
@@ -938,7 +949,7 @@ export default defineVxeComponent({
|
|
|
938
949
|
reactData.hexValue = val
|
|
939
950
|
},
|
|
940
951
|
onChange () {
|
|
941
|
-
const colorRest =
|
|
952
|
+
const colorRest = parseValColor(reactData.hexValue)
|
|
942
953
|
if (colorRest) {
|
|
943
954
|
if (colorRest.value) {
|
|
944
955
|
reactData.selectColor = colorRest.value
|
|
@@ -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/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 { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData, DatePickerMethods, VxeDatePanelDefines, VxeDatePickerPropTypes, DatePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePickerDefines, VxeButtonGroupEvents, VxeDatePanelConstructor } from '../../../types'
|
|
14
|
+
import type { VxeDatePickerConstructor, VxeDatePickerEmits, DatePickerInternalData, DatePickerReactData, DatePickerMethods, VxeDatePanelDefines, VxeDatePickerPropTypes, DatePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePickerDefines, VxeButtonGroupEvents, 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')
|
|
@@ -181,6 +181,7 @@ export default defineVxeComponent({
|
|
|
181
181
|
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods) | null>('$xeModal', null)
|
|
182
182
|
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
183
183
|
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
184
|
+
const $xeCard = inject<(VxeCardConstructor & VxeCardPrivateMethods) | null>('$xeCard', null)
|
|
184
185
|
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods) | null>('$xeForm', null)
|
|
185
186
|
const formItemInfo = inject<VxeFormDefines.ProvideItemInfo | null>('xeFormItemInfo', null)
|
|
186
187
|
|
|
@@ -223,7 +224,7 @@ export default defineVxeComponent({
|
|
|
223
224
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
224
225
|
return globalTransfer
|
|
225
226
|
}
|
|
226
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
227
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
227
228
|
return true
|
|
228
229
|
}
|
|
229
230
|
}
|
|
@@ -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 { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerInternalData, DateRangePickerReactData, DateRangePickerMethods, VxeDateRangePickerPropTypes, DateRangePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDatePanelPropTypes, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePanelEvents, VxeDateRangePickerDefines, VxeButtonGroupEvents, VxeDatePanelConstructor } from '../../../types'
|
|
14
|
+
import type { VxeDateRangePickerConstructor, VxeDateRangePickerEmits, DateRangePickerInternalData, DateRangePickerReactData, DateRangePickerMethods, VxeDateRangePickerPropTypes, DateRangePickerPrivateRef, VxeFormConstructor, VxeFormPrivateMethods, VxeFormDefines, ValueOf, VxeModalConstructor, VxeDatePanelPropTypes, VxeDrawerConstructor, VxeModalMethods, VxeDrawerMethods, VxeDatePanelEvents, VxeDateRangePickerDefines, VxeButtonGroupEvents, 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')
|
|
@@ -176,6 +176,7 @@ export default defineVxeComponent({
|
|
|
176
176
|
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods) | null>('$xeModal', null)
|
|
177
177
|
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
178
178
|
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
179
|
+
const $xeCard = inject<(VxeCardConstructor & VxeCardPrivateMethods) | null>('$xeCard', null)
|
|
179
180
|
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods) | null>('$xeForm', null)
|
|
180
181
|
const formItemInfo = inject<VxeFormDefines.ProvideItemInfo | null>('xeFormItemInfo', null)
|
|
181
182
|
|
|
@@ -222,7 +223,7 @@ export default defineVxeComponent({
|
|
|
222
223
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
223
224
|
return globalTransfer
|
|
224
225
|
}
|
|
225
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
226
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
226
227
|
return true
|
|
227
228
|
}
|
|
228
229
|
}
|
|
@@ -8,7 +8,7 @@ import type { VxePrintProps, VxePrintPropTypes, VxePrintDefines, VxePrintConstru
|
|
|
8
8
|
let printFrame: any
|
|
9
9
|
|
|
10
10
|
// 默认导出或打印的 HTML 样式
|
|
11
|
-
const defaultHtmlStyle = 'body{padding:0;color:rgba(0,0,0,0.7);font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu
|
|
11
|
+
const defaultHtmlStyle = 'body{padding:0;color:rgba(0,0,0,0.7);font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu}body *{-webkit-box-sizing:border-box;box-sizing:border-box}.vxe-table{border-collapse:collapse;text-align:left;border-spacing:0}.vxe-table.is--default-width,.vxe-table.is--auto-width{width:100%}.vxe-table.is--scale-width{table-layout:fixed}.vxe-table,.vxe-table th,.vxe-table td,.vxe-table td{white-space:pre-line;word-break:break-all;border-color:#D0D0D0;border-style:solid;border-width:0}.border--default,.border--full,.border--outer{border-top-width:1px}.border--default,.border--full,.border--outer{border-left-width:1px}.border--outer,.border--default th,.border--default td,.border--full th,.border--full td,.border--outer th,.border--inner th,.border--inner td{border-bottom-width:1px}.border--default,.border--outer,.border--full th,.border--full td{border-right-width:1px}.border--default th,.border--full th,.border--outer th{background-color:#f8f8f9}.vxe-table td>div,.vxe-table th>div{padding:0.5em 0.4em}.col--center{text-align:center}.col--right{text-align:right}.vxe-table .col--ellipsis>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.vxe-table--tree-node{text-align:left}.vxe-table--tree-node-wrapper{position:relative}.vxe-table--tree-icon-wrapper{position:absolute;top:50%;width:1em;height:1em;text-align:center;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.vxe-table--tree-unfold-icon,.vxe-table--tree-fold-icon{position:absolute;width:0;height:0;border-style:solid;border-width:0.5em;border-right-color:transparent;border-bottom-color:transparent}.vxe-table--tree-unfold-icon{left:.3em;top:0;border-left-color:#939599;border-top-color:transparent}.vxe-table--tree-fold-icon{left:0;top:.3em;border-left-color:transparent;border-top-color:#939599}.vxe-table--tree-cell{display:block;padding-left:1.5em}.vxe-table input[type="checkbox"]{margin:0}.vxe-table input[type="checkbox"],.vxe-table input[type="radio"],.vxe-table input[type="checkbox"]+span,.vxe-table input[type="radio"]+span{vertical-align:middle;padding-left:0.4em}'
|
|
12
12
|
|
|
13
13
|
export function trimHtml (html: string) {
|
|
14
14
|
return `${html}`.replace(/(<!---->)/, '')
|
|
@@ -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, VxeSelectConstructor, SelectInternalData, SelectReactData, VxeSelectDefines, VxeButtonEvents, ValueOf, VxeSelectEmits, VxeComponentSlotType, VxeInputConstructor, SelectMethods, SelectPrivateRef, VxeSelectMethods, VxeOptionProps, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeInputEvents, VxeComponentStyleType } from '../../../types'
|
|
12
|
+
import type { VxeSelectPropTypes, VxeSelectConstructor, SelectInternalData, SelectReactData, VxeSelectDefines, VxeButtonEvents, ValueOf, VxeSelectEmits, VxeComponentSlotType, VxeInputConstructor, SelectMethods, SelectPrivateRef, VxeSelectMethods, VxeOptionProps, VxeDrawerConstructor, VxeDrawerMethods, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeModalConstructor, VxeModalMethods, VxeInputEvents, VxeComponentStyleType, VxeCardConstructor, VxeCardPrivateMethods } from '../../../types'
|
|
13
13
|
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types/components/table'
|
|
14
14
|
|
|
15
15
|
const { errLog } = createComponentLog('select')
|
|
@@ -216,6 +216,7 @@ export default defineVxeComponent({
|
|
|
216
216
|
const $xeModal = inject<(VxeModalConstructor & VxeModalMethods)| null>('$xeModal', null)
|
|
217
217
|
const $xeDrawer = inject<(VxeDrawerConstructor & VxeDrawerMethods) | null>('$xeDrawer', null)
|
|
218
218
|
const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
|
|
219
|
+
const $xeCard = inject<(VxeCardConstructor & VxeCardPrivateMethods) | null>('$xeCard', null)
|
|
219
220
|
const $xeForm = inject<(VxeFormConstructor & VxeFormPrivateMethods)| null>('$xeForm', null)
|
|
220
221
|
const formItemInfo = inject<VxeFormDefines.ProvideItemInfo | null>('xeFormItemInfo', null)
|
|
221
222
|
|
|
@@ -280,7 +281,7 @@ export default defineVxeComponent({
|
|
|
280
281
|
if (XEUtils.isBoolean(globalTransfer)) {
|
|
281
282
|
return globalTransfer
|
|
282
283
|
}
|
|
283
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
284
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
|
|
284
285
|
return true
|
|
285
286
|
}
|
|
286
287
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
.vxe-checkbox--icon {
|
|
10
10
|
font-size: 1.22em;
|
|
11
|
+
@include createAnimationTransition(all, 0.2s);
|
|
11
12
|
}
|
|
12
13
|
.vxe-checkbox--icon {
|
|
13
14
|
color: var(--vxe-ui-input-border-color);
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
}
|
|
55
56
|
.vxe-radio--icon {
|
|
56
57
|
font-size: 1.26em;
|
|
58
|
+
@include createAnimationTransition(all, 0.2s);
|
|
57
59
|
}
|
|
58
60
|
.vxe-radio--icon {
|
|
59
61
|
color: var(--vxe-ui-input-border-color);
|