vxe-pc-ui 4.17.0 → 4.17.2
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 +297 -152
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/date-picker/src/date-picker.js +6 -2
- package/es/date-range-picker/src/date-range-picker.js +6 -2
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +79 -51
- package/es/number-input/src/number-input.js +31 -23
- package/es/password-input/src/password-input.js +133 -62
- package/es/password-input/style.css +5 -0
- package/es/password-input/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/textarea/src/textarea.js +43 -13
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-password-input/style.css +5 -0
- package/es/vxe-password-input/style.min.css +1 -1
- package/lib/date-picker/src/date-picker.js +6 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +6 -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 +321 -168
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +83 -53
- package/lib/input/src/input.min.js +1 -1
- package/lib/number-input/src/number-input.js +35 -25
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/password-input/src/password-input.js +140 -71
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/password-input/style/style.css +5 -0
- package/lib/password-input/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +46 -13
- package/lib/textarea/src/textarea.min.js +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-password-input/style/style.css +5 -0
- package/lib/vxe-password-input/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/date-picker/src/date-picker.ts +6 -2
- package/packages/date-range-picker/src/date-range-picker.ts +6 -2
- package/packages/input/src/input.ts +85 -56
- package/packages/number-input/src/number-input.ts +32 -25
- package/packages/password-input/src/password-input.ts +145 -69
- package/packages/textarea/src/textarea.ts +49 -17
- package/styles/components/password-input.scss +4 -0
- package/types/components/date-picker.d.ts +2 -0
- package/types/components/date-range-picker.d.ts +2 -0
- package/types/components/input.d.ts +2 -0
- package/types/components/number-input.d.ts +2 -0
- package/types/components/password-input.d.ts +4 -0
- package/types/components/table-module/edit.d.ts +37 -4
- package/types/components/table.d.ts +9 -2
- package/types/components/textarea.d.ts +2 -0
- package/types/ui/renderer.d.ts +9 -3
- /package/es/icon/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/es/icon/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/es/icon/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/es/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/es/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/es/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/lib/icon/style/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
- /package/lib/{iconfont.1786782471977.ttf → iconfont.1786868252000.ttf} +0 -0
- /package/lib/{iconfont.1786782471977.woff → iconfont.1786868252000.woff} +0 -0
- /package/lib/{iconfont.1786782471977.woff2 → iconfont.1786868252000.woff2} +0 -0
|
@@ -59,6 +59,10 @@ export default defineVxeComponent({
|
|
|
59
59
|
align: String as PropType<VxeInputPropTypes.Align>,
|
|
60
60
|
form: String as PropType<VxeInputPropTypes.Form>,
|
|
61
61
|
className: String as PropType<VxeInputPropTypes.ClassName>,
|
|
62
|
+
inputClassName: {
|
|
63
|
+
type: String as PropType<VxeInputPropTypes.InputClassName>,
|
|
64
|
+
default: () => getConfig().input.inputClassName
|
|
65
|
+
},
|
|
62
66
|
size: {
|
|
63
67
|
type: String as PropType<VxeInputPropTypes.Size>,
|
|
64
68
|
default: () => getConfig().input.size || getConfig().size
|
|
@@ -237,8 +241,6 @@ export default defineVxeComponent({
|
|
|
237
241
|
getRefMaps: () => refMaps
|
|
238
242
|
} as unknown as VxeInputConstructor
|
|
239
243
|
|
|
240
|
-
let inputMethods = {} as InputMethods
|
|
241
|
-
|
|
242
244
|
const parseDate = (value: VxeInputPropTypes.ModelValue, format: string) => {
|
|
243
245
|
const { type } = props
|
|
244
246
|
if (type === 'time') {
|
|
@@ -744,8 +746,9 @@ export default defineVxeComponent({
|
|
|
744
746
|
})
|
|
745
747
|
|
|
746
748
|
const computeInputReadonly = computed(() => {
|
|
747
|
-
const { type, editable, multiple
|
|
748
|
-
|
|
749
|
+
const { type, editable, multiple } = props
|
|
750
|
+
const formReadonly = computeFormReadonly.value
|
|
751
|
+
return formReadonly || multiple || !editable || type === 'week' || type === 'quarter'
|
|
749
752
|
})
|
|
750
753
|
|
|
751
754
|
const computeInputType = computed(() => {
|
|
@@ -814,6 +817,11 @@ export default defineVxeComponent({
|
|
|
814
817
|
return false
|
|
815
818
|
})
|
|
816
819
|
|
|
820
|
+
const computeDomValue = computed(() => {
|
|
821
|
+
const { inputValue } = reactData
|
|
822
|
+
return inputValue
|
|
823
|
+
})
|
|
824
|
+
|
|
817
825
|
const getNumberValue = (val: any) => {
|
|
818
826
|
const { type, exponential } = props
|
|
819
827
|
const inpMaxLength = computeInpMaxLength.value
|
|
@@ -825,13 +833,25 @@ export default defineVxeComponent({
|
|
|
825
833
|
return restVal.slice(0, inpMaxLength)
|
|
826
834
|
}
|
|
827
835
|
|
|
836
|
+
const dispatchEvent = (type: ValueOf<VxeInputEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
837
|
+
emit(type, createEvent(evnt, { $input: $xeInput }, params))
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
const updateDomValue = () => {
|
|
841
|
+
const domValue = computeDomValue.value
|
|
842
|
+
const inputElem = refInputTarget.value
|
|
843
|
+
if (inputElem) {
|
|
844
|
+
inputElem.value = XEUtils.eqNull(domValue) ? '' : ('' + domValue)
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
828
848
|
const emitModel = (value: string) => {
|
|
829
849
|
emit('update:modelValue', value)
|
|
830
850
|
}
|
|
831
851
|
|
|
832
852
|
const triggerEvent = (evnt: Event & { type: 'input' | 'change' | 'keydown' | 'keyup' | 'wheel' | 'click' | 'focus' | 'blur' }) => {
|
|
833
853
|
const { inputValue } = reactData
|
|
834
|
-
|
|
854
|
+
dispatchEvent(evnt.type, { value: inputValue }, evnt)
|
|
835
855
|
}
|
|
836
856
|
|
|
837
857
|
const handleChange = (value: string, evnt: Event | { type: string }) => {
|
|
@@ -840,9 +860,9 @@ export default defineVxeComponent({
|
|
|
840
860
|
}
|
|
841
861
|
reactData.inputValue = value
|
|
842
862
|
emitModel(value)
|
|
843
|
-
|
|
863
|
+
dispatchEvent('input', { value }, evnt as any)
|
|
844
864
|
if (XEUtils.toValueString(props.modelValue) !== value) {
|
|
845
|
-
|
|
865
|
+
dispatchEvent('change', { value }, evnt as any)
|
|
846
866
|
if (!$xeSelect && !$xeTreeSelect) {
|
|
847
867
|
// 自动更新校验状态
|
|
848
868
|
if ($xeForm && formItemInfo) {
|
|
@@ -860,7 +880,7 @@ export default defineVxeComponent({
|
|
|
860
880
|
if (inpImmediate) {
|
|
861
881
|
handleChange(value, evnt)
|
|
862
882
|
} else {
|
|
863
|
-
|
|
883
|
+
dispatchEvent('input', { value }, evnt)
|
|
864
884
|
if (!$xeSelect && !$xeTreeSelect) {
|
|
865
885
|
// 自动更新校验状态
|
|
866
886
|
if ($xeForm && formItemInfo) {
|
|
@@ -882,7 +902,7 @@ export default defineVxeComponent({
|
|
|
882
902
|
if (!inpImmediate) {
|
|
883
903
|
triggerEvent(evnt)
|
|
884
904
|
}
|
|
885
|
-
|
|
905
|
+
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
|
|
886
906
|
}
|
|
887
907
|
|
|
888
908
|
const blurEvent = (evnt: Event & { type: 'blur' }) => {
|
|
@@ -896,7 +916,7 @@ export default defineVxeComponent({
|
|
|
896
916
|
if (!reactData.visiblePanel) {
|
|
897
917
|
reactData.isActivated = false
|
|
898
918
|
}
|
|
899
|
-
|
|
919
|
+
dispatchEvent('blur', { value }, evnt)
|
|
900
920
|
if (!$xeSelect && !$xeTreeSelect) {
|
|
901
921
|
// 自动更新校验状态
|
|
902
922
|
if ($xeForm && formItemInfo) {
|
|
@@ -922,7 +942,7 @@ export default defineVxeComponent({
|
|
|
922
942
|
const isDisabled = computeIsDisabled.value
|
|
923
943
|
if (!isDisabled) {
|
|
924
944
|
const { inputValue } = reactData
|
|
925
|
-
|
|
945
|
+
dispatchEvent('prefix-click', { value: inputValue }, evnt)
|
|
926
946
|
}
|
|
927
947
|
}
|
|
928
948
|
|
|
@@ -949,15 +969,15 @@ export default defineVxeComponent({
|
|
|
949
969
|
}
|
|
950
970
|
}
|
|
951
971
|
handleChange('', evnt)
|
|
952
|
-
|
|
953
|
-
|
|
972
|
+
dispatchEvent('clear', { value }, evnt)
|
|
973
|
+
dispatchEvent('lazy-change', { value }, evnt)
|
|
954
974
|
}
|
|
955
975
|
|
|
956
976
|
const clickSuffixEvent = (evnt: Event) => {
|
|
957
977
|
const isDisabled = computeIsDisabled.value
|
|
958
978
|
if (!isDisabled) {
|
|
959
979
|
const { inputValue } = reactData
|
|
960
|
-
|
|
980
|
+
dispatchEvent('suffix-click', { value: inputValue }, evnt)
|
|
961
981
|
}
|
|
962
982
|
}
|
|
963
983
|
|
|
@@ -1186,13 +1206,13 @@ export default defineVxeComponent({
|
|
|
1186
1206
|
if (!isDisabled && !inputReadonly) {
|
|
1187
1207
|
reactData.showPwd = !showPwd
|
|
1188
1208
|
}
|
|
1189
|
-
|
|
1209
|
+
dispatchEvent('toggle-visible', { visible: reactData.showPwd }, evnt)
|
|
1190
1210
|
}
|
|
1191
1211
|
// 密码
|
|
1192
1212
|
|
|
1193
1213
|
// 搜索
|
|
1194
1214
|
const searchEvent = (evnt: Event) => {
|
|
1195
|
-
|
|
1215
|
+
dispatchEvent('search-click', {}, evnt)
|
|
1196
1216
|
}
|
|
1197
1217
|
// 搜索
|
|
1198
1218
|
|
|
@@ -1222,7 +1242,7 @@ export default defineVxeComponent({
|
|
|
1222
1242
|
if (!isDisabled && !inputReadonly && !isDisabledSubtractNumber) {
|
|
1223
1243
|
numberChange(false, evnt)
|
|
1224
1244
|
}
|
|
1225
|
-
|
|
1245
|
+
dispatchEvent('next-number', { value: reactData.inputValue }, evnt)
|
|
1226
1246
|
}
|
|
1227
1247
|
|
|
1228
1248
|
const numberDownNextEvent = (evnt: Event) => {
|
|
@@ -1240,7 +1260,7 @@ export default defineVxeComponent({
|
|
|
1240
1260
|
if (!isDisabled && !inputReadonly && !isDisabledAddNumber) {
|
|
1241
1261
|
numberChange(true, evnt)
|
|
1242
1262
|
}
|
|
1243
|
-
|
|
1263
|
+
dispatchEvent('prev-number', { value: reactData.inputValue }, evnt)
|
|
1244
1264
|
}
|
|
1245
1265
|
|
|
1246
1266
|
const numberKeydownEvent = (evnt: KeyboardEvent) => {
|
|
@@ -1394,7 +1414,7 @@ export default defineVxeComponent({
|
|
|
1394
1414
|
}
|
|
1395
1415
|
}
|
|
1396
1416
|
reactData.selectMonth = viewDate
|
|
1397
|
-
|
|
1417
|
+
dispatchEvent('date-prev', { viewType: datePanelType, viewDate, value, type }, evnt)
|
|
1398
1418
|
}
|
|
1399
1419
|
}
|
|
1400
1420
|
|
|
@@ -1404,7 +1424,7 @@ export default defineVxeComponent({
|
|
|
1404
1424
|
dateChange(reactData.currentDate)
|
|
1405
1425
|
hidePanel()
|
|
1406
1426
|
}
|
|
1407
|
-
|
|
1427
|
+
dispatchEvent('date-today', { type: props.type }, evnt)
|
|
1408
1428
|
}
|
|
1409
1429
|
|
|
1410
1430
|
const dateNextEvent = (evnt: Event) => {
|
|
@@ -1433,7 +1453,7 @@ export default defineVxeComponent({
|
|
|
1433
1453
|
}
|
|
1434
1454
|
}
|
|
1435
1455
|
reactData.selectMonth = viewDate
|
|
1436
|
-
|
|
1456
|
+
dispatchEvent('date-next', { viewType: datePanelType, viewDate, value, type }, evnt)
|
|
1437
1457
|
}
|
|
1438
1458
|
}
|
|
1439
1459
|
|
|
@@ -1971,6 +1991,33 @@ export default defineVxeComponent({
|
|
|
1971
1991
|
}
|
|
1972
1992
|
}
|
|
1973
1993
|
|
|
1994
|
+
const inputMethods: InputMethods = {
|
|
1995
|
+
dispatchEvent,
|
|
1996
|
+
focus () {
|
|
1997
|
+
const inputElem = refInputTarget.value
|
|
1998
|
+
reactData.isActivated = true
|
|
1999
|
+
inputElem.focus()
|
|
2000
|
+
return nextTick()
|
|
2001
|
+
},
|
|
2002
|
+
blur () {
|
|
2003
|
+
const inputElem = refInputTarget.value
|
|
2004
|
+
inputElem.blur()
|
|
2005
|
+
reactData.isActivated = false
|
|
2006
|
+
return nextTick()
|
|
2007
|
+
},
|
|
2008
|
+
select () {
|
|
2009
|
+
const inputElem = refInputTarget.value
|
|
2010
|
+
inputElem.select()
|
|
2011
|
+
reactData.isActivated = false
|
|
2012
|
+
return nextTick()
|
|
2013
|
+
},
|
|
2014
|
+
showPanel,
|
|
2015
|
+
hidePanel,
|
|
2016
|
+
updatePlacement
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
Object.assign($xeInput, inputMethods)
|
|
2020
|
+
|
|
1974
2021
|
const renderDateLabel = (item: VxeDatePanelDefines.DateYearItem | VxeDatePanelDefines.DateQuarterItem | VxeDatePanelDefines.DateMonthItem | VxeDatePanelDefines.DateDayItem, label: string | number) => {
|
|
1975
2022
|
const { festivalMethod } = props
|
|
1976
2023
|
if (festivalMethod) {
|
|
@@ -2615,40 +2662,8 @@ export default defineVxeComponent({
|
|
|
2615
2662
|
return createCommentVNode()
|
|
2616
2663
|
}
|
|
2617
2664
|
|
|
2618
|
-
const dispatchEvent = (type: ValueOf<VxeInputEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
2619
|
-
emit(type, createEvent(evnt, { $input: $xeInput }, params))
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
|
-
inputMethods = {
|
|
2623
|
-
dispatchEvent,
|
|
2624
|
-
|
|
2625
|
-
focus () {
|
|
2626
|
-
const inputElem = refInputTarget.value
|
|
2627
|
-
reactData.isActivated = true
|
|
2628
|
-
inputElem.focus()
|
|
2629
|
-
return nextTick()
|
|
2630
|
-
},
|
|
2631
|
-
blur () {
|
|
2632
|
-
const inputElem = refInputTarget.value
|
|
2633
|
-
inputElem.blur()
|
|
2634
|
-
reactData.isActivated = false
|
|
2635
|
-
return nextTick()
|
|
2636
|
-
},
|
|
2637
|
-
select () {
|
|
2638
|
-
const inputElem = refInputTarget.value
|
|
2639
|
-
inputElem.select()
|
|
2640
|
-
reactData.isActivated = false
|
|
2641
|
-
return nextTick()
|
|
2642
|
-
},
|
|
2643
|
-
showPanel,
|
|
2644
|
-
hidePanel,
|
|
2645
|
-
updatePlacement
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
Object.assign($xeInput, inputMethods)
|
|
2649
|
-
|
|
2650
2665
|
const renderVN = () => {
|
|
2651
|
-
const { className, controls, type, title, align, showWordCount, countMethod, name, autoComplete, autocomplete } = props
|
|
2666
|
+
const { className, inputClassName, controls, type, title, align, showWordCount, countMethod, name, autoComplete, autocomplete } = props
|
|
2652
2667
|
const { inputValue, visiblePanel, isActivated } = reactData
|
|
2653
2668
|
const vSize = computeSize.value
|
|
2654
2669
|
const isDisabled = computeIsDisabled.value
|
|
@@ -2692,8 +2707,7 @@ export default defineVxeComponent({
|
|
|
2692
2707
|
}, [
|
|
2693
2708
|
h('input', {
|
|
2694
2709
|
ref: refInputTarget,
|
|
2695
|
-
class: 'vxe-input--inner',
|
|
2696
|
-
value: inputValue,
|
|
2710
|
+
class: 'vxe-input--inner' + (inputClassName ? (' ' + inputClassName) : ''),
|
|
2697
2711
|
name,
|
|
2698
2712
|
type: inputType,
|
|
2699
2713
|
placeholder: inpPlaceholder,
|
|
@@ -2751,6 +2765,20 @@ export default defineVxeComponent({
|
|
|
2751
2765
|
}
|
|
2752
2766
|
})
|
|
2753
2767
|
|
|
2768
|
+
const rDvFlag = ref(0)
|
|
2769
|
+
watch(computeFormReadonly, () => {
|
|
2770
|
+
rDvFlag.value++
|
|
2771
|
+
})
|
|
2772
|
+
watch(computeDomValue, () => {
|
|
2773
|
+
rDvFlag.value++
|
|
2774
|
+
})
|
|
2775
|
+
watch(rDvFlag, () => {
|
|
2776
|
+
updateDomValue()
|
|
2777
|
+
nextTick(() => {
|
|
2778
|
+
updateDomValue()
|
|
2779
|
+
})
|
|
2780
|
+
})
|
|
2781
|
+
|
|
2754
2782
|
onMounted(() => {
|
|
2755
2783
|
const { type } = props
|
|
2756
2784
|
if (['date', 'time', 'datetime', 'week', 'month', 'quarter', 'year'].includes(type)) {
|
|
@@ -2769,6 +2797,7 @@ export default defineVxeComponent({
|
|
|
2769
2797
|
globalEvents.on($xeInput, 'mousedown', handleGlobalMousedownEvent)
|
|
2770
2798
|
globalEvents.on($xeInput, 'keydown', handleGlobalKeydownEvent)
|
|
2771
2799
|
globalEvents.on($xeInput, 'blur', handleGlobalBlurEvent)
|
|
2800
|
+
updateDomValue()
|
|
2772
2801
|
})
|
|
2773
2802
|
|
|
2774
2803
|
onBeforeUnmount(() => {
|
|
@@ -46,6 +46,10 @@ export default defineVxeComponent({
|
|
|
46
46
|
align: String as PropType<VxeNumberInputPropTypes.Align>,
|
|
47
47
|
form: String as PropType<VxeNumberInputPropTypes.Form>,
|
|
48
48
|
className: String as PropType<VxeNumberInputPropTypes.ClassName>,
|
|
49
|
+
inputClassName: {
|
|
50
|
+
type: String as PropType<VxeNumberInputPropTypes.InputClassName>,
|
|
51
|
+
default: () => getConfig().numberInput.inputClassName
|
|
52
|
+
},
|
|
49
53
|
size: {
|
|
50
54
|
type: String as PropType<VxeNumberInputPropTypes.Size>,
|
|
51
55
|
default: () => getConfig().numberInput.size || getConfig().size
|
|
@@ -320,6 +324,11 @@ export default defineVxeComponent({
|
|
|
320
324
|
return false
|
|
321
325
|
})
|
|
322
326
|
|
|
327
|
+
const computeInpClassNamevalue = computed(() => {
|
|
328
|
+
const { inputClassName } = props
|
|
329
|
+
return 'vxe-number-input--input' + (inputClassName ? (' ' + inputClassName) : '')
|
|
330
|
+
})
|
|
331
|
+
|
|
323
332
|
const refMaps: InputPrivateRef = {
|
|
324
333
|
refElem,
|
|
325
334
|
refInput: refInputTarget
|
|
@@ -339,7 +348,9 @@ export default defineVxeComponent({
|
|
|
339
348
|
getComputeMaps: () => computeMaps
|
|
340
349
|
} as unknown as VxeNumberInputConstructor
|
|
341
350
|
|
|
342
|
-
|
|
351
|
+
const dispatchEvent = (type: ValueOf<VxeNumberInputEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
352
|
+
emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params))
|
|
353
|
+
}
|
|
343
354
|
|
|
344
355
|
const handleNumberString = (val: any) => {
|
|
345
356
|
if (XEUtils.eqNull(val)) {
|
|
@@ -370,7 +381,7 @@ export default defineVxeComponent({
|
|
|
370
381
|
|
|
371
382
|
const triggerEvent = (evnt: Event & { type: 'input' | 'change' | 'keydown' | 'keyup' | 'wheel' | 'click' | 'focus' | 'blur' }) => {
|
|
372
383
|
const { inputValue } = reactData
|
|
373
|
-
|
|
384
|
+
dispatchEvent(evnt.type, { value: inputValue }, evnt)
|
|
374
385
|
}
|
|
375
386
|
|
|
376
387
|
const handleChange = (val: number | null, inputValue: string, evnt: Event | { type: string }) => {
|
|
@@ -385,9 +396,9 @@ export default defineVxeComponent({
|
|
|
385
396
|
reactData.inputValue = inputValue || ''
|
|
386
397
|
})
|
|
387
398
|
}
|
|
388
|
-
|
|
399
|
+
dispatchEvent('input', { value }, evnt as Event)
|
|
389
400
|
if (isChange) {
|
|
390
|
-
|
|
401
|
+
dispatchEvent('change', { value }, evnt as Event)
|
|
391
402
|
// 自动更新校验状态
|
|
392
403
|
if ($xeForm && formItemInfo) {
|
|
393
404
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
|
|
@@ -402,7 +413,7 @@ export default defineVxeComponent({
|
|
|
402
413
|
if (inpImmediate) {
|
|
403
414
|
handleChange(value, inputValue, evnt)
|
|
404
415
|
} else {
|
|
405
|
-
|
|
416
|
+
dispatchEvent('input', { value }, evnt)
|
|
406
417
|
// 自动更新校验状态
|
|
407
418
|
if ($xeForm && formItemInfo) {
|
|
408
419
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
|
|
@@ -421,7 +432,7 @@ export default defineVxeComponent({
|
|
|
421
432
|
if (!inpImmediate) {
|
|
422
433
|
triggerEvent(evnt)
|
|
423
434
|
}
|
|
424
|
-
|
|
435
|
+
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
|
|
425
436
|
}
|
|
426
437
|
|
|
427
438
|
const focusEvent = (evnt: Event & { type: 'focus' }) => {
|
|
@@ -439,22 +450,22 @@ export default defineVxeComponent({
|
|
|
439
450
|
const isDisabled = computeIsDisabled.value
|
|
440
451
|
if (!isDisabled) {
|
|
441
452
|
const { inputValue } = reactData
|
|
442
|
-
|
|
453
|
+
dispatchEvent('prefix-click', { value: inputValue }, evnt)
|
|
443
454
|
}
|
|
444
455
|
}
|
|
445
456
|
|
|
446
457
|
const clearValueEvent = (evnt: Event, value: VxeNumberInputPropTypes.ModelValue) => {
|
|
447
458
|
focus()
|
|
448
459
|
handleChange(null, '', evnt)
|
|
449
|
-
|
|
450
|
-
|
|
460
|
+
dispatchEvent('clear', { value }, evnt)
|
|
461
|
+
dispatchEvent('lazy-change', { value }, evnt)
|
|
451
462
|
}
|
|
452
463
|
|
|
453
464
|
const clickSuffixEvent = (evnt: Event) => {
|
|
454
465
|
const isDisabled = computeIsDisabled.value
|
|
455
466
|
if (!isDisabled) {
|
|
456
467
|
const { inputValue } = reactData
|
|
457
|
-
|
|
468
|
+
dispatchEvent('suffix-click', { value: inputValue }, evnt)
|
|
458
469
|
}
|
|
459
470
|
}
|
|
460
471
|
|
|
@@ -559,7 +570,7 @@ export default defineVxeComponent({
|
|
|
559
570
|
afterCheckValue()
|
|
560
571
|
reactData.isFocus = false
|
|
561
572
|
reactData.isActivated = false
|
|
562
|
-
|
|
573
|
+
dispatchEvent('blur', { value }, evnt)
|
|
563
574
|
// 自动更新校验状态
|
|
564
575
|
if ($xeForm && formItemInfo) {
|
|
565
576
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value)
|
|
@@ -592,10 +603,10 @@ export default defineVxeComponent({
|
|
|
592
603
|
numberChange(true, evnt)
|
|
593
604
|
}
|
|
594
605
|
reactData.isActivated = true
|
|
595
|
-
|
|
596
|
-
|
|
606
|
+
dispatchEvent('plus-number', { value: reactData.inputValue }, evnt)
|
|
607
|
+
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
|
|
597
608
|
// 已废弃
|
|
598
|
-
|
|
609
|
+
dispatchEvent('next-number', { value: reactData.inputValue }, evnt)
|
|
599
610
|
}
|
|
600
611
|
|
|
601
612
|
const numberMinusEvent = (evnt: Event) => {
|
|
@@ -606,10 +617,10 @@ export default defineVxeComponent({
|
|
|
606
617
|
numberChange(false, evnt)
|
|
607
618
|
}
|
|
608
619
|
reactData.isActivated = true
|
|
609
|
-
|
|
610
|
-
|
|
620
|
+
dispatchEvent('minus-number', { value: reactData.inputValue }, evnt)
|
|
621
|
+
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt)
|
|
611
622
|
// 已废弃
|
|
612
|
-
|
|
623
|
+
dispatchEvent('prev-number', { value: reactData.inputValue }, evnt)
|
|
613
624
|
}
|
|
614
625
|
|
|
615
626
|
const numberKeydownEvent = (evnt: KeyboardEvent) => {
|
|
@@ -805,13 +816,8 @@ export default defineVxeComponent({
|
|
|
805
816
|
}
|
|
806
817
|
}
|
|
807
818
|
|
|
808
|
-
const
|
|
809
|
-
emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params))
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
numberInputMethods = {
|
|
819
|
+
const numberInputMethods: NumberInputMethods = {
|
|
813
820
|
dispatchEvent,
|
|
814
|
-
|
|
815
821
|
focus () {
|
|
816
822
|
const inputReadonly = computeInputReadonly.value
|
|
817
823
|
if (!inputReadonly) {
|
|
@@ -922,6 +928,7 @@ export default defineVxeComponent({
|
|
|
922
928
|
const inputReadonly = computeInputReadonly.value
|
|
923
929
|
const inpMaxLength = computeInpMaxLength.value
|
|
924
930
|
const inpPlaceholder = computeInpPlaceholder.value
|
|
931
|
+
const inpClassName = computeInpClassNamevalue.value
|
|
925
932
|
return h('div', {
|
|
926
933
|
key: 'ni',
|
|
927
934
|
class: 'vxe-number-input--input-wrapper'
|
|
@@ -932,10 +939,10 @@ export default defineVxeComponent({
|
|
|
932
939
|
}, [
|
|
933
940
|
h('input', {
|
|
934
941
|
ref: refInputTarget,
|
|
935
|
-
class:
|
|
936
|
-
value: !isFocus && type === 'amount' ? numLabel : inputValue,
|
|
942
|
+
class: inpClassName,
|
|
937
943
|
name,
|
|
938
944
|
type: 'text',
|
|
945
|
+
value: !isFocus && type === 'amount' ? numLabel : inputValue,
|
|
939
946
|
placeholder: inpPlaceholder,
|
|
940
947
|
maxlength: inpMaxLength,
|
|
941
948
|
readonly: inputReadonly,
|