vxe-table 4.2.4-beta.2 → 4.2.4
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/all.js +0 -2
- package/es/button/style.css +0 -5
- package/es/checkbox/src/checkbox.js +6 -0
- package/es/checkbox/src/group.js +7 -1
- package/es/edit/src/hook.js +35 -4
- package/es/form/src/form-config-item.js +152 -0
- package/es/form/src/form-gather.js +12 -3
- package/es/form/src/form-item.js +22 -3
- package/es/form/src/form.js +28 -119
- package/es/form/src/itemInfo.js +2 -0
- package/es/form/style.css +6 -6
- package/es/icon/style.css +10 -9
- package/es/input/src/input.js +50 -5
- package/es/input/style.css +5 -0
- package/es/radio/src/button.js +6 -0
- package/es/radio/src/group.js +8 -2
- package/es/radio/src/radio.js +6 -0
- package/es/select/src/select.js +7 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/src/switch.js +7 -1
- package/es/table/src/table.js +3 -2
- package/es/textarea/src/textarea.js +7 -1
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/es/validator/src/hook.js +1 -1
- package/lib/all.js +15 -15
- package/lib/all.min.js +1 -1
- package/lib/button/style/style.css +0 -5
- package/lib/button/style/style.min.css +1 -1
- package/lib/checkbox/src/checkbox.js +7 -1
- package/lib/checkbox/src/checkbox.min.js +1 -1
- package/lib/checkbox/src/group.js +7 -1
- package/lib/checkbox/src/group.min.js +1 -1
- package/lib/edit/src/hook.js +35 -4
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/form/src/form-config-item.js +212 -0
- package/lib/form/src/form-config-item.min.js +1 -0
- package/lib/form/src/form-gather.js +14 -3
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +25 -2
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +30 -149
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/itemInfo.js +2 -0
- package/lib/form/src/itemInfo.min.js +1 -1
- package/lib/form/style/style.css +6 -6
- package/lib/form/style/style.min.css +1 -1
- package/lib/icon/style/style.css +10 -9
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +2072 -1839
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +54 -5
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +5 -0
- package/lib/input/style/style.min.css +1 -1
- package/lib/radio/src/button.js +7 -1
- package/lib/radio/src/button.min.js +1 -1
- package/lib/radio/src/group.js +8 -2
- package/lib/radio/src/group.min.js +1 -1
- package/lib/radio/src/radio.js +7 -1
- package/lib/radio/src/radio.min.js +1 -1
- package/lib/select/src/select.js +7 -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/switch/src/switch.js +8 -1
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/table/src/table.js +4 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/textarea/src/textarea.js +7 -1
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/validator/src/hook.js +1 -1
- package/lib/validator/src/hook.min.js +1 -1
- package/package.json +2 -2
- package/packages/all.ts +0 -2
- package/packages/checkbox/src/checkbox.ts +7 -1
- package/packages/checkbox/src/group.ts +8 -2
- package/packages/edit/src/hook.ts +35 -4
- package/packages/form/src/form-config-item.ts +156 -0
- package/packages/form/src/form-gather.ts +13 -3
- package/packages/form/src/form-item.ts +24 -3
- package/packages/form/src/form.ts +28 -126
- package/packages/form/src/itemInfo.ts +2 -0
- package/packages/input/src/input.ts +54 -6
- package/packages/radio/src/button.ts +7 -1
- package/packages/radio/src/group.ts +9 -3
- package/packages/radio/src/radio.ts +7 -1
- package/packages/select/src/select.ts +8 -2
- package/packages/switch/src/switch.ts +8 -2
- package/packages/table/src/table.ts +3 -2
- package/packages/textarea/src/textarea.ts +8 -2
- package/packages/validator/src/hook.ts +1 -1
- package/styles/button.scss +0 -5
- package/styles/form.scss +17 -19
- package/styles/icon.scss +10 -9
- package/styles/input.scss +4 -0
- package/styles/variable.scss +1 -0
- package/types/all.d.ts +0 -1
- package/types/edit.d.ts +38 -5
- package/types/form-item.d.ts +10 -0
- package/types/form.d.ts +14 -2
package/es/icon/style.css
CHANGED
|
@@ -241,10 +241,10 @@
|
|
|
241
241
|
|
|
242
242
|
.vxe-icon--plus:before {
|
|
243
243
|
content: "+";
|
|
244
|
-
left: -0.
|
|
245
|
-
bottom: 0;
|
|
246
|
-
line-height:
|
|
247
|
-
font-size: 1.
|
|
244
|
+
left: -0.12em;
|
|
245
|
+
bottom: -0.1em;
|
|
246
|
+
line-height: 1em;
|
|
247
|
+
font-size: 1.6em; }
|
|
248
248
|
|
|
249
249
|
.vxe-icon--check:before {
|
|
250
250
|
left: 0.25em;
|
|
@@ -261,11 +261,12 @@
|
|
|
261
261
|
transform: rotate(45deg); }
|
|
262
262
|
|
|
263
263
|
.vxe-icon--close:before {
|
|
264
|
-
content: "
|
|
265
|
-
left: -0.
|
|
266
|
-
bottom: 0;
|
|
267
|
-
line-height:
|
|
268
|
-
font-size: 1.
|
|
264
|
+
content: "+";
|
|
265
|
+
left: -0.1em;
|
|
266
|
+
bottom: -0.16em;
|
|
267
|
+
line-height: 1em;
|
|
268
|
+
font-size: 1.8em;
|
|
269
|
+
transform: rotate(45deg); }
|
|
269
270
|
|
|
270
271
|
.vxe-icon--minus:before {
|
|
271
272
|
content: "\2500";
|
package/es/input/src/input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, Teleport, ref, computed, reactive, nextTick, watch, onUnmounted } from 'vue';
|
|
1
|
+
import { defineComponent, h, Teleport, ref, computed, reactive, inject, nextTick, watch, onUnmounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
4
4
|
import { useSize } from '../../hooks/size';
|
|
@@ -78,6 +78,8 @@ export default defineComponent({
|
|
|
78
78
|
],
|
|
79
79
|
setup: function (props, context) {
|
|
80
80
|
var slots = context.slots, emit = context.emit;
|
|
81
|
+
var $xeform = inject('$xeform', null);
|
|
82
|
+
var $xeformiteminfo = inject('$xeformiteminfo', null);
|
|
81
83
|
var xID = XEUtils.uniqueId();
|
|
82
84
|
var computeSize = useSize(props);
|
|
83
85
|
var reactData = reactive({
|
|
@@ -510,6 +512,37 @@ export default defineComponent({
|
|
|
510
512
|
var type = props.type, immediate = props.immediate;
|
|
511
513
|
return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float');
|
|
512
514
|
});
|
|
515
|
+
var computeNumValue = computed(function () {
|
|
516
|
+
var type = props.type;
|
|
517
|
+
var inputValue = reactData.inputValue;
|
|
518
|
+
var isNumType = computeIsNumType.value;
|
|
519
|
+
if (isNumType) {
|
|
520
|
+
return type === 'integer' ? XEUtils.toInteger(handleNumber(inputValue)) : XEUtils.toNumber(handleNumber(inputValue));
|
|
521
|
+
}
|
|
522
|
+
return 0;
|
|
523
|
+
});
|
|
524
|
+
var computeIsDisabledSubtractNumber = computed(function () {
|
|
525
|
+
var min = props.min;
|
|
526
|
+
var inputValue = reactData.inputValue;
|
|
527
|
+
var isNumType = computeIsNumType.value;
|
|
528
|
+
var numValue = computeNumValue.value;
|
|
529
|
+
// 当有值时再进行判断
|
|
530
|
+
if ((inputValue || inputValue === 0) && isNumType && min !== null) {
|
|
531
|
+
return numValue <= XEUtils.toNumber(min);
|
|
532
|
+
}
|
|
533
|
+
return false;
|
|
534
|
+
});
|
|
535
|
+
var computeIsDisabledAddNumber = computed(function () {
|
|
536
|
+
var max = props.max;
|
|
537
|
+
var inputValue = reactData.inputValue;
|
|
538
|
+
var isNumType = computeIsNumType.value;
|
|
539
|
+
var numValue = computeNumValue.value;
|
|
540
|
+
// 当有值时再进行判断
|
|
541
|
+
if ((inputValue || inputValue === 0) && isNumType && max !== null) {
|
|
542
|
+
return numValue >= XEUtils.toNumber(max);
|
|
543
|
+
}
|
|
544
|
+
return false;
|
|
545
|
+
});
|
|
513
546
|
var getNumberValue = function (val) {
|
|
514
547
|
var type = props.type, exponential = props.exponential;
|
|
515
548
|
var inpMaxlength = computeInpMaxlength.value;
|
|
@@ -530,6 +563,10 @@ export default defineComponent({
|
|
|
530
563
|
inputMethods.dispatchEvent('input', { value: value }, evnt);
|
|
531
564
|
if (XEUtils.toValueString(props.modelValue) !== value) {
|
|
532
565
|
inputMethods.dispatchEvent('change', { value: value }, evnt);
|
|
566
|
+
// 自动更新校验状态
|
|
567
|
+
if ($xeform && $xeformiteminfo) {
|
|
568
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, value);
|
|
569
|
+
}
|
|
533
570
|
}
|
|
534
571
|
};
|
|
535
572
|
var emitInputEvent = function (value, evnt) {
|
|
@@ -849,8 +886,9 @@ export default defineComponent({
|
|
|
849
886
|
var downbumTimeout;
|
|
850
887
|
var numberNextEvent = function (evnt) {
|
|
851
888
|
var readonly = props.readonly, disabled = props.disabled;
|
|
889
|
+
var isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
|
|
852
890
|
clearTimeout(downbumTimeout);
|
|
853
|
-
if (!disabled && !readonly) {
|
|
891
|
+
if (!disabled && !readonly && !isDisabledSubtractNumber) {
|
|
854
892
|
numberChange(false, evnt);
|
|
855
893
|
}
|
|
856
894
|
inputMethods.dispatchEvent('next-number', {}, evnt);
|
|
@@ -863,8 +901,9 @@ export default defineComponent({
|
|
|
863
901
|
};
|
|
864
902
|
var numberPrevEvent = function (evnt) {
|
|
865
903
|
var readonly = props.readonly, disabled = props.disabled;
|
|
904
|
+
var isDisabledAddNumber = computeIsDisabledAddNumber.value;
|
|
866
905
|
clearTimeout(downbumTimeout);
|
|
867
|
-
if (!disabled && !readonly) {
|
|
906
|
+
if (!disabled && !readonly && !isDisabledAddNumber) {
|
|
868
907
|
numberChange(true, evnt);
|
|
869
908
|
}
|
|
870
909
|
inputMethods.dispatchEvent('prev-number', {}, evnt);
|
|
@@ -1942,11 +1981,15 @@ export default defineComponent({
|
|
|
1942
1981
|
return null;
|
|
1943
1982
|
};
|
|
1944
1983
|
var renderNumberIcon = function () {
|
|
1984
|
+
var isDisabledAddNumber = computeIsDisabledAddNumber.value;
|
|
1985
|
+
var isDisabledSubtractNumber = computeIsDisabledSubtractNumber.value;
|
|
1945
1986
|
return h('span', {
|
|
1946
1987
|
class: 'vxe-input--number-suffix'
|
|
1947
1988
|
}, [
|
|
1948
1989
|
h('span', {
|
|
1949
|
-
class: 'vxe-input--number-prev is--prev',
|
|
1990
|
+
class: ['vxe-input--number-prev is--prev', {
|
|
1991
|
+
'is--disabled': isDisabledAddNumber
|
|
1992
|
+
}],
|
|
1950
1993
|
onMousedown: numberMousedownEvent,
|
|
1951
1994
|
onMouseup: numberStopDown,
|
|
1952
1995
|
onMouseleave: numberStopDown
|
|
@@ -1956,7 +1999,9 @@ export default defineComponent({
|
|
|
1956
1999
|
})
|
|
1957
2000
|
]),
|
|
1958
2001
|
h('span', {
|
|
1959
|
-
class: 'vxe-input--number-next is--next',
|
|
2002
|
+
class: ['vxe-input--number-next is--next', {
|
|
2003
|
+
'is--disabled': isDisabledSubtractNumber
|
|
2004
|
+
}],
|
|
1960
2005
|
onMousedown: numberMousedownEvent,
|
|
1961
2006
|
onMouseup: numberStopDown,
|
|
1962
2007
|
onMouseleave: numberStopDown
|
package/es/input/style.css
CHANGED
|
@@ -152,6 +152,11 @@
|
|
|
152
152
|
.vxe-input:not(.is--disabled) .vxe-input--number-next:active {
|
|
153
153
|
color: #409eff; }
|
|
154
154
|
|
|
155
|
+
.vxe-input:not(.is--disabled) .vxe-input--number-prev.is--disabled,
|
|
156
|
+
.vxe-input:not(.is--disabled) .vxe-input--number-next.is--disabled {
|
|
157
|
+
cursor: no-drop;
|
|
158
|
+
color: #e4e7ed; }
|
|
159
|
+
|
|
155
160
|
.vxe-input .vxe-input--password-suffix,
|
|
156
161
|
.vxe-input .vxe-input--number-suffix,
|
|
157
162
|
.vxe-input .vxe-input--date-picker-suffix,
|
package/es/radio/src/button.js
CHANGED
|
@@ -20,6 +20,8 @@ export default defineComponent({
|
|
|
20
20
|
],
|
|
21
21
|
setup: function (props, context) {
|
|
22
22
|
var slots = context.slots, emit = context.emit;
|
|
23
|
+
var $xeform = inject('$xeform', null);
|
|
24
|
+
var $xeformiteminfo = inject('$xeformiteminfo', null);
|
|
23
25
|
var xID = XEUtils.uniqueId();
|
|
24
26
|
var computeSize = useSize(props);
|
|
25
27
|
var $xeradiobutton = {
|
|
@@ -55,6 +57,10 @@ export default defineComponent({
|
|
|
55
57
|
else {
|
|
56
58
|
emit('update:modelValue', label);
|
|
57
59
|
radioButtonMethods.dispatchEvent('change', { label: label }, evnt);
|
|
60
|
+
// 自动更新校验状态
|
|
61
|
+
if ($xeform && $xeformiteminfo) {
|
|
62
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, label);
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
};
|
|
60
66
|
var changeEvent = function (evnt) {
|
package/es/radio/src/group.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, provide } from 'vue';
|
|
1
|
+
import { defineComponent, h, provide, inject } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
4
4
|
import { useSize } from '../../hooks/size';
|
|
@@ -16,6 +16,8 @@ export default defineComponent({
|
|
|
16
16
|
],
|
|
17
17
|
setup: function (props, context) {
|
|
18
18
|
var slots = context.slots, emit = context.emit;
|
|
19
|
+
var $xeform = inject('$xeform', null);
|
|
20
|
+
var $xeformiteminfo = inject('$xeformiteminfo', null);
|
|
19
21
|
var xID = XEUtils.uniqueId();
|
|
20
22
|
var $xeradiogroup = {
|
|
21
23
|
xID: xID,
|
|
@@ -26,9 +28,13 @@ export default defineComponent({
|
|
|
26
28
|
var radioGroupMethods = {};
|
|
27
29
|
useSize(props);
|
|
28
30
|
var radioGroupPrivateMethods = {
|
|
29
|
-
handleChecked: function (params) {
|
|
31
|
+
handleChecked: function (params, evnt) {
|
|
30
32
|
emit('update:modelValue', params.label);
|
|
31
33
|
radioGroupMethods.dispatchEvent('change', params);
|
|
34
|
+
// 自动更新校验状态
|
|
35
|
+
if ($xeform && $xeformiteminfo) {
|
|
36
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, params.label);
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
};
|
|
34
40
|
radioGroupMethods = {
|
package/es/radio/src/radio.js
CHANGED
|
@@ -21,6 +21,8 @@ export default defineComponent({
|
|
|
21
21
|
],
|
|
22
22
|
setup: function (props, context) {
|
|
23
23
|
var slots = context.slots, emit = context.emit;
|
|
24
|
+
var $xeform = inject('$xeform', null);
|
|
25
|
+
var $xeformiteminfo = inject('$xeformiteminfo', null);
|
|
24
26
|
var xID = XEUtils.uniqueId();
|
|
25
27
|
var $xeradio = {
|
|
26
28
|
xID: xID,
|
|
@@ -50,6 +52,10 @@ export default defineComponent({
|
|
|
50
52
|
else {
|
|
51
53
|
emit('update:modelValue', label);
|
|
52
54
|
radioMethods.dispatchEvent('change', { label: label }, evnt);
|
|
55
|
+
// 自动更新校验状态
|
|
56
|
+
if ($xeform && $xeformiteminfo) {
|
|
57
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, label);
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
60
|
};
|
|
55
61
|
var changeEvent = function (evnt) {
|
package/es/select/src/select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, Teleport, ref, resolveComponent, computed, provide, onUnmounted, reactive, nextTick, watch, onMounted } from 'vue';
|
|
1
|
+
import { defineComponent, h, Teleport, ref, inject, resolveComponent, computed, provide, onUnmounted, reactive, nextTick, watch, onMounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
4
4
|
import { useSize } from '../../hooks/size';
|
|
@@ -44,6 +44,8 @@ export default defineComponent({
|
|
|
44
44
|
],
|
|
45
45
|
setup: function (props, context) {
|
|
46
46
|
var slots = context.slots, emit = context.emit;
|
|
47
|
+
var $xeform = inject('$xeform', null);
|
|
48
|
+
var $xeformiteminfo = inject('$xeformiteminfo', null);
|
|
47
49
|
var xID = XEUtils.uniqueId();
|
|
48
50
|
var computeSize = useSize(props);
|
|
49
51
|
var reactData = reactive({
|
|
@@ -339,6 +341,10 @@ export default defineComponent({
|
|
|
339
341
|
if (selectValue !== props.modelValue) {
|
|
340
342
|
emit('update:modelValue', selectValue);
|
|
341
343
|
selectMethods.dispatchEvent('change', { value: selectValue }, evnt);
|
|
344
|
+
// 自动更新校验状态
|
|
345
|
+
if ($xeform && $xeformiteminfo) {
|
|
346
|
+
$xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, selectValue);
|
|
347
|
+
}
|
|
342
348
|
}
|
|
343
349
|
};
|
|
344
350
|
var clearValueEvent = function (evnt, selectValue) {
|