tanxin-ui 1.3.4 → 1.3.6
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/tanxin-ui.es.js +64 -42
- package/dist/tanxin-ui.umd.js +13 -13
- package/es/cascader/index.d.ts +18 -0
- package/es/cascader/src/cascader.d.ts +17 -0
- package/es/cascader/src/cascader.js +5 -4
- package/es/checkbox/index.d.ts +36 -0
- package/es/checkbox/src/checkbox-group.d.ts +17 -0
- package/es/checkbox/src/checkbox-group.js +5 -4
- package/es/checkbox/src/checkbox.d.ts +17 -0
- package/es/checkbox/src/checkbox.js +4 -3
- package/es/color-picker/index.d.ts +18 -0
- package/es/color-picker/src/color-picker.d.ts +17 -0
- package/es/color-picker/src/color-picker.js +5 -4
- package/es/date-picker/index.d.ts +18 -0
- package/es/date-picker/src/date-picker.d.ts +17 -0
- package/es/date-picker/src/date-picker.js +4 -3
- package/es/input/index.d.ts +18 -0
- package/es/input/src/input.d.ts +17 -0
- package/es/input/src/input.js +5 -4
- package/es/input-number/index.d.ts +18 -0
- package/es/input-number/src/input-number.d.ts +17 -0
- package/es/input-number/src/input-number.js +5 -4
- package/es/radio/index.d.ts +36 -0
- package/es/radio/src/radio-group.d.ts +17 -0
- package/es/radio/src/radio-group.js +5 -4
- package/es/radio/src/radio.d.ts +17 -0
- package/es/radio/src/radio.js +4 -3
- package/es/select/index.d.ts +18 -0
- package/es/select/src/select.d.ts +11 -0
- package/es/select/src/select.js +5 -4
- package/es/slider/index.d.ts +18 -0
- package/es/slider/src/slider.d.ts +17 -0
- package/es/slider/src/slider.js +4 -3
- package/es/switch/index.d.ts +18 -0
- package/es/switch/src/switch.d.ts +17 -0
- package/es/switch/src/switch.js +4 -3
- package/es/textarea/index.d.ts +18 -0
- package/es/textarea/src/textarea.d.ts +17 -0
- package/es/textarea/src/textarea.js +5 -4
- package/es/tree-select/index.d.ts +18 -0
- package/es/tree-select/src/tree-select.d.ts +17 -0
- package/es/tree-select/src/tree-select.js +5 -4
- package/es/upload/index.d.ts +18 -0
- package/es/upload/src/upload.d.ts +17 -0
- package/es/upload/src/upload.js +5 -4
- package/es/utils/common.d.ts +8 -1
- package/es/utils/common.js +11 -3
- package/lib/cascader/index.d.ts +18 -0
- package/lib/cascader/src/cascader.d.ts +17 -0
- package/lib/cascader/src/cascader.js +4 -3
- package/lib/checkbox/index.d.ts +36 -0
- package/lib/checkbox/src/checkbox-group.d.ts +17 -0
- package/lib/checkbox/src/checkbox-group.js +4 -3
- package/lib/checkbox/src/checkbox.d.ts +17 -0
- package/lib/checkbox/src/checkbox.js +3 -2
- package/lib/color-picker/index.d.ts +18 -0
- package/lib/color-picker/src/color-picker.d.ts +17 -0
- package/lib/color-picker/src/color-picker.js +4 -3
- package/lib/date-picker/index.d.ts +18 -0
- package/lib/date-picker/src/date-picker.d.ts +17 -0
- package/lib/date-picker/src/date-picker.js +3 -2
- package/lib/input/index.d.ts +18 -0
- package/lib/input/src/input.d.ts +17 -0
- package/lib/input/src/input.js +4 -3
- package/lib/input-number/index.d.ts +18 -0
- package/lib/input-number/src/input-number.d.ts +17 -0
- package/lib/input-number/src/input-number.js +4 -3
- package/lib/radio/index.d.ts +36 -0
- package/lib/radio/src/radio-group.d.ts +17 -0
- package/lib/radio/src/radio-group.js +4 -3
- package/lib/radio/src/radio.d.ts +17 -0
- package/lib/radio/src/radio.js +3 -2
- package/lib/select/index.d.ts +18 -0
- package/lib/select/src/select.d.ts +11 -0
- package/lib/select/src/select.js +4 -3
- package/lib/slider/index.d.ts +18 -0
- package/lib/slider/src/slider.d.ts +17 -0
- package/lib/slider/src/slider.js +3 -2
- package/lib/switch/index.d.ts +18 -0
- package/lib/switch/src/switch.d.ts +17 -0
- package/lib/switch/src/switch.js +3 -2
- package/lib/textarea/index.d.ts +18 -0
- package/lib/textarea/src/textarea.d.ts +17 -0
- package/lib/textarea/src/textarea.js +4 -3
- package/lib/tree-select/index.d.ts +18 -0
- package/lib/tree-select/src/tree-select.d.ts +17 -0
- package/lib/tree-select/src/tree-select.js +4 -3
- package/lib/upload/index.d.ts +18 -0
- package/lib/upload/src/upload.d.ts +17 -0
- package/lib/upload/src/upload.js +4 -3
- package/lib/utils/common.d.ts +8 -1
- package/lib/utils/common.js +11 -2
- package/package.json +1 -1
package/dist/tanxin-ui.es.js
CHANGED
|
@@ -1821,7 +1821,14 @@ async function downloadFile(url2, name = "download") {
|
|
|
1821
1821
|
return Promise.reject(e);
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
|
-
function
|
|
1824
|
+
function checkValue(value, zeroAsNull) {
|
|
1825
|
+
if (value instanceof N) {
|
|
1826
|
+
if (zeroAsNull && value === 0)
|
|
1827
|
+
return void 0;
|
|
1828
|
+
}
|
|
1829
|
+
return value;
|
|
1830
|
+
}
|
|
1831
|
+
function getProperty(formData, valuePath, zeroAsNull) {
|
|
1825
1832
|
var _a;
|
|
1826
1833
|
const path = valuePath.replace(/\[(\w+)\]/g, ".$1");
|
|
1827
1834
|
const arr = path.split(".");
|
|
@@ -1829,7 +1836,7 @@ function getProperty(formData, valuePath) {
|
|
|
1829
1836
|
for (const i2 in arr) {
|
|
1830
1837
|
obj = (_a = obj[arr[i2]]) != null ? _a : void 0;
|
|
1831
1838
|
}
|
|
1832
|
-
return obj;
|
|
1839
|
+
return checkValue(obj, zeroAsNull);
|
|
1833
1840
|
}
|
|
1834
1841
|
function setProperty(formData, valuePath, value) {
|
|
1835
1842
|
const path = valuePath.replace(/\[(\w+)\]/g, ".$1");
|
|
@@ -5699,7 +5706,8 @@ const inputProps = {
|
|
|
5699
5706
|
shadow: PropTypes.bool.def(true),
|
|
5700
5707
|
emitByEnter: PropTypes.bool.def(false),
|
|
5701
5708
|
formData: PropTypes.any,
|
|
5702
|
-
valuePath: PropTypes.string
|
|
5709
|
+
valuePath: PropTypes.string,
|
|
5710
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
5703
5711
|
};
|
|
5704
5712
|
var Input = defineComponent({
|
|
5705
5713
|
name: "TInput",
|
|
@@ -5724,7 +5732,7 @@ var Input = defineComponent({
|
|
|
5724
5732
|
const showClear = ref(false);
|
|
5725
5733
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
5726
5734
|
const maxlength = computed(() => getNumber(props.maxlength));
|
|
5727
|
-
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value);
|
|
5735
|
+
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull));
|
|
5728
5736
|
const isComposing = ref(false);
|
|
5729
5737
|
const validateEnable = ref(true);
|
|
5730
5738
|
const showWordCount = computed(() => {
|
|
@@ -5857,7 +5865,7 @@ var Input = defineComponent({
|
|
|
5857
5865
|
};
|
|
5858
5866
|
if (dynamicForm.value) {
|
|
5859
5867
|
watch(() => props.formData, () => {
|
|
5860
|
-
currentValue.value = getProperty(props.formData, props.valuePath);
|
|
5868
|
+
currentValue.value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
5861
5869
|
}, {
|
|
5862
5870
|
deep: true
|
|
5863
5871
|
});
|
|
@@ -6452,7 +6460,8 @@ const inputNumberProps = {
|
|
|
6452
6460
|
formatter: PropTypes.func,
|
|
6453
6461
|
parser: PropTypes.func,
|
|
6454
6462
|
formData: PropTypes.any,
|
|
6455
|
-
valuePath: PropTypes.string
|
|
6463
|
+
valuePath: PropTypes.string,
|
|
6464
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
6456
6465
|
};
|
|
6457
6466
|
var InputNumber = defineComponent({
|
|
6458
6467
|
name: "TInputNumber",
|
|
@@ -6477,7 +6486,7 @@ var InputNumber = defineComponent({
|
|
|
6477
6486
|
const currentValue = ref();
|
|
6478
6487
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
6479
6488
|
onMounted(() => {
|
|
6480
|
-
currentValue.value = dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
6489
|
+
currentValue.value = dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
6481
6490
|
inputFinished.value = true;
|
|
6482
6491
|
checkInvalid();
|
|
6483
6492
|
if (props.autoFocus && !props.disabled) {
|
|
@@ -6677,7 +6686,7 @@ var InputNumber = defineComponent({
|
|
|
6677
6686
|
});
|
|
6678
6687
|
if (dynamicForm.value) {
|
|
6679
6688
|
watch(() => props.formData, () => {
|
|
6680
|
-
const value = getProperty(props.formData, props.valuePath);
|
|
6689
|
+
const value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
6681
6690
|
if (equals(value, currentValue.value))
|
|
6682
6691
|
return;
|
|
6683
6692
|
currentValue.value = value;
|
|
@@ -7339,7 +7348,8 @@ const textareaProps = {
|
|
|
7339
7348
|
maxRows: PropTypes.number.def(10),
|
|
7340
7349
|
autoHeight: PropTypes.bool.def(false),
|
|
7341
7350
|
formData: PropTypes.any,
|
|
7342
|
-
valuePath: PropTypes.string
|
|
7351
|
+
valuePath: PropTypes.string,
|
|
7352
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
7343
7353
|
};
|
|
7344
7354
|
var Textarea = defineComponent({
|
|
7345
7355
|
name: "TTextarea",
|
|
@@ -7359,7 +7369,7 @@ var Textarea = defineComponent({
|
|
|
7359
7369
|
} = useConfig("textarea", props);
|
|
7360
7370
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
7361
7371
|
const showClear = ref(false);
|
|
7362
|
-
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value);
|
|
7372
|
+
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull));
|
|
7363
7373
|
const isComposing = ref(false);
|
|
7364
7374
|
const validateEnable = ref(true);
|
|
7365
7375
|
const showWordCount = computed(() => {
|
|
@@ -7399,7 +7409,7 @@ var Textarea = defineComponent({
|
|
|
7399
7409
|
});
|
|
7400
7410
|
if (dynamicForm.value) {
|
|
7401
7411
|
watch(() => props.formData, () => {
|
|
7402
|
-
currentValue.value = getProperty(props.formData, props.valuePath);
|
|
7412
|
+
currentValue.value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
7403
7413
|
}, {
|
|
7404
7414
|
deep: true
|
|
7405
7415
|
});
|
|
@@ -7601,7 +7611,8 @@ const radioProps = {
|
|
|
7601
7611
|
itemValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
7602
7612
|
itemLabel: PropTypes.string,
|
|
7603
7613
|
formData: PropTypes.any,
|
|
7604
|
-
valuePath: PropTypes.string
|
|
7614
|
+
valuePath: PropTypes.string,
|
|
7615
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
7605
7616
|
};
|
|
7606
7617
|
var Radio = defineComponent({
|
|
7607
7618
|
name: "TRadio",
|
|
@@ -7616,7 +7627,7 @@ var Radio = defineComponent({
|
|
|
7616
7627
|
} = useConfig("radio", props);
|
|
7617
7628
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
7618
7629
|
const getValue2 = computed(() => {
|
|
7619
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
7630
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
7620
7631
|
});
|
|
7621
7632
|
const groupContext = injectRadioGroup();
|
|
7622
7633
|
const isChecked = ref();
|
|
@@ -7772,7 +7783,8 @@ const radioGroupProps = {
|
|
|
7772
7783
|
direction: PropTypes.oneOf(["horizontal", "vertical", "x", "y"]).def("horizontal"),
|
|
7773
7784
|
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
7774
7785
|
formData: PropTypes.any,
|
|
7775
|
-
valuePath: PropTypes.string
|
|
7786
|
+
valuePath: PropTypes.string,
|
|
7787
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
7776
7788
|
};
|
|
7777
7789
|
var RadioGroup = defineComponent({
|
|
7778
7790
|
name: "TRadioGroup",
|
|
@@ -7787,7 +7799,7 @@ var RadioGroup = defineComponent({
|
|
|
7787
7799
|
} = useConfig("radio-group", props);
|
|
7788
7800
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
7789
7801
|
const getValue2 = computed(() => {
|
|
7790
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
7802
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
7791
7803
|
});
|
|
7792
7804
|
const groupValue = ref(getValue2.value);
|
|
7793
7805
|
const isVertical = computed(() => props.direction === "vertical" || props.direction === "y");
|
|
@@ -7800,7 +7812,7 @@ var RadioGroup = defineComponent({
|
|
|
7800
7812
|
});
|
|
7801
7813
|
if (dynamicForm.value) {
|
|
7802
7814
|
watch(() => props.formData, () => {
|
|
7803
|
-
groupValue.value = getProperty(props.formData, props.valuePath);
|
|
7815
|
+
groupValue.value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
7804
7816
|
}, {
|
|
7805
7817
|
deep: true
|
|
7806
7818
|
});
|
|
@@ -7879,7 +7891,8 @@ const checkboxProps$1 = {
|
|
|
7879
7891
|
switch: PropTypes.bool.def(false),
|
|
7880
7892
|
indeterminate: PropTypes.bool.def(false),
|
|
7881
7893
|
formData: PropTypes.any,
|
|
7882
|
-
valuePath: PropTypes.string
|
|
7894
|
+
valuePath: PropTypes.string,
|
|
7895
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
7883
7896
|
};
|
|
7884
7897
|
var Checkbox = defineComponent({
|
|
7885
7898
|
name: "TCheckbox",
|
|
@@ -7894,7 +7907,7 @@ var Checkbox = defineComponent({
|
|
|
7894
7907
|
} = useConfig("checkbox", props);
|
|
7895
7908
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
7896
7909
|
const getValue2 = computed(() => {
|
|
7897
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
7910
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
7898
7911
|
});
|
|
7899
7912
|
const groupContext = injectCheckboxGroup();
|
|
7900
7913
|
const isChecked = ref();
|
|
@@ -8110,7 +8123,8 @@ const checkboxProps = {
|
|
|
8110
8123
|
direction: PropTypes.oneOf(["horizontal", "vertical", "x", "y"]).def("horizontal"),
|
|
8111
8124
|
gutter: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
8112
8125
|
formData: PropTypes.any,
|
|
8113
|
-
valuePath: PropTypes.string
|
|
8126
|
+
valuePath: PropTypes.string,
|
|
8127
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
8114
8128
|
};
|
|
8115
8129
|
var CheckboxGroup = defineComponent({
|
|
8116
8130
|
name: "TCheckboxGroup",
|
|
@@ -8124,7 +8138,7 @@ var CheckboxGroup = defineComponent({
|
|
|
8124
8138
|
} = useConfig("checkbox-group", props);
|
|
8125
8139
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
8126
8140
|
const getValue2 = computed(() => {
|
|
8127
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
8141
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
8128
8142
|
});
|
|
8129
8143
|
const groupValue = ref(getValue2.value);
|
|
8130
8144
|
const isVertical = computed(() => props.direction === "vertical" || props.direction === "y");
|
|
@@ -8137,7 +8151,7 @@ var CheckboxGroup = defineComponent({
|
|
|
8137
8151
|
});
|
|
8138
8152
|
if (dynamicForm.value) {
|
|
8139
8153
|
watch(() => props.formData, () => {
|
|
8140
|
-
groupValue.value = getProperty(props.formData, props.valuePath);
|
|
8154
|
+
groupValue.value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
8141
8155
|
}, {
|
|
8142
8156
|
deep: true
|
|
8143
8157
|
});
|
|
@@ -8207,7 +8221,8 @@ const switchProps = {
|
|
|
8207
8221
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
8208
8222
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
8209
8223
|
formData: PropTypes.any,
|
|
8210
|
-
valuePath: PropTypes.string
|
|
8224
|
+
valuePath: PropTypes.string,
|
|
8225
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
8211
8226
|
};
|
|
8212
8227
|
const switchWidth = {
|
|
8213
8228
|
xs: 26,
|
|
@@ -8240,7 +8255,7 @@ var Switch = defineComponent({
|
|
|
8240
8255
|
} = useConfig("switch", props);
|
|
8241
8256
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
8242
8257
|
const getValue2 = computed(() => {
|
|
8243
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
8258
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
8244
8259
|
});
|
|
8245
8260
|
const isChecked = ref(getValue2.value === props.trueValue);
|
|
8246
8261
|
const refCheckbox = ref();
|
|
@@ -9946,7 +9961,8 @@ const selectProps = {
|
|
|
9946
9961
|
labelKey: PropTypes.string.def("label"),
|
|
9947
9962
|
valueType: PropTypes.string,
|
|
9948
9963
|
formData: PropTypes.any,
|
|
9949
|
-
valuePath: PropTypes.string
|
|
9964
|
+
valuePath: PropTypes.string,
|
|
9965
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
9950
9966
|
};
|
|
9951
9967
|
var Select = defineComponent({
|
|
9952
9968
|
name: "TSelect",
|
|
@@ -9968,7 +9984,7 @@ var Select = defineComponent({
|
|
|
9968
9984
|
}) {
|
|
9969
9985
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
9970
9986
|
const getValue2 = computed(() => {
|
|
9971
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
9987
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
9972
9988
|
});
|
|
9973
9989
|
const currentValue = ref(isArray$2(getValue2.value) ? getValue2.value : getValue2.value ? [getValue2.value] : []);
|
|
9974
9990
|
const optionDataList = ref([]);
|
|
@@ -10112,7 +10128,7 @@ var Select = defineComponent({
|
|
|
10112
10128
|
};
|
|
10113
10129
|
if (dynamicForm.value) {
|
|
10114
10130
|
watch(() => props.formData, () => {
|
|
10115
|
-
const tempValue = getProperty(props.formData, props.valuePath);
|
|
10131
|
+
const tempValue = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
10116
10132
|
currentValue.value = isArray$2(tempValue) ? tempValue : tempValue !== null && tempValue !== void 0 ? [tempValue] : [];
|
|
10117
10133
|
handleValueChange();
|
|
10118
10134
|
}, {
|
|
@@ -10906,7 +10922,8 @@ const cascaderProps = {
|
|
|
10906
10922
|
prefix: PropTypes.string,
|
|
10907
10923
|
suffix: PropTypes.string,
|
|
10908
10924
|
formData: PropTypes.any,
|
|
10909
|
-
valuePath: PropTypes.string
|
|
10925
|
+
valuePath: PropTypes.string,
|
|
10926
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
10910
10927
|
};
|
|
10911
10928
|
var Cascader = defineComponent({
|
|
10912
10929
|
name: "TCascader",
|
|
@@ -10953,7 +10970,7 @@ var Cascader = defineComponent({
|
|
|
10953
10970
|
};
|
|
10954
10971
|
});
|
|
10955
10972
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
10956
|
-
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value);
|
|
10973
|
+
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull));
|
|
10957
10974
|
const cascaderValue = ref([]);
|
|
10958
10975
|
const visible = ref(false);
|
|
10959
10976
|
const handleCheckedChange = (item) => {
|
|
@@ -11042,7 +11059,7 @@ var Cascader = defineComponent({
|
|
|
11042
11059
|
});
|
|
11043
11060
|
if (dynamicForm.value) {
|
|
11044
11061
|
watch(() => props.formData, () => {
|
|
11045
|
-
const value = getProperty(props.formData, props.valuePath);
|
|
11062
|
+
const value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
11046
11063
|
if (value == currentValue.value)
|
|
11047
11064
|
return;
|
|
11048
11065
|
initCascaderValue();
|
|
@@ -11217,7 +11234,8 @@ const treeSelectProps = {
|
|
|
11217
11234
|
prefix: PropTypes.string,
|
|
11218
11235
|
suffix: PropTypes.string,
|
|
11219
11236
|
formData: PropTypes.any,
|
|
11220
|
-
valuePath: PropTypes.string
|
|
11237
|
+
valuePath: PropTypes.string,
|
|
11238
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
11221
11239
|
};
|
|
11222
11240
|
var TreeSelect = defineComponent({
|
|
11223
11241
|
name: "TTreeSelect",
|
|
@@ -11253,7 +11271,7 @@ var TreeSelect = defineComponent({
|
|
|
11253
11271
|
else
|
|
11254
11272
|
treeValue.value = currentValue.value;
|
|
11255
11273
|
};
|
|
11256
|
-
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value);
|
|
11274
|
+
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull));
|
|
11257
11275
|
const treeValue = ref([]);
|
|
11258
11276
|
const visible = ref(false);
|
|
11259
11277
|
const handleCheckedChange = () => {
|
|
@@ -11321,7 +11339,7 @@ var TreeSelect = defineComponent({
|
|
|
11321
11339
|
});
|
|
11322
11340
|
if (dynamicForm.value) {
|
|
11323
11341
|
watch(() => props.formData, () => {
|
|
11324
|
-
const value = getProperty(props.formData, props.valuePath);
|
|
11342
|
+
const value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
11325
11343
|
if (equals(value, currentValue.value))
|
|
11326
11344
|
return;
|
|
11327
11345
|
currentValue.value = value;
|
|
@@ -13612,7 +13630,8 @@ const datePickerProps = {
|
|
|
13612
13630
|
default: () => [1900, 2100]
|
|
13613
13631
|
},
|
|
13614
13632
|
formData: PropTypes.any,
|
|
13615
|
-
valuePath: PropTypes.string
|
|
13633
|
+
valuePath: PropTypes.string,
|
|
13634
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
13616
13635
|
};
|
|
13617
13636
|
var DatePicker = defineComponent({
|
|
13618
13637
|
name: "TDatePicker",
|
|
@@ -13644,7 +13663,7 @@ var DatePicker = defineComponent({
|
|
|
13644
13663
|
prefixCls
|
|
13645
13664
|
} = useConfig("date-picker", props);
|
|
13646
13665
|
const getValue2 = computed(() => {
|
|
13647
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
13666
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
13648
13667
|
});
|
|
13649
13668
|
const currentIndex = ref(0);
|
|
13650
13669
|
const refPanel = [ref(), ref(), ref(), ref()];
|
|
@@ -15026,7 +15045,8 @@ const colorPickerProps = {
|
|
|
15026
15045
|
default: () => []
|
|
15027
15046
|
},
|
|
15028
15047
|
formData: PropTypes.any,
|
|
15029
|
-
valuePath: PropTypes.string
|
|
15048
|
+
valuePath: PropTypes.string,
|
|
15049
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
15030
15050
|
};
|
|
15031
15051
|
var ColorPicker = defineComponent({
|
|
15032
15052
|
name: "TColorPicker",
|
|
@@ -15046,7 +15066,7 @@ var ColorPicker = defineComponent({
|
|
|
15046
15066
|
emit
|
|
15047
15067
|
}) {
|
|
15048
15068
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
15049
|
-
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value);
|
|
15069
|
+
const currentValue = ref(dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull));
|
|
15050
15070
|
const showClear = ref(false);
|
|
15051
15071
|
const {
|
|
15052
15072
|
prefixCls
|
|
@@ -15075,7 +15095,7 @@ var ColorPicker = defineComponent({
|
|
|
15075
15095
|
};
|
|
15076
15096
|
if (dynamicForm.value) {
|
|
15077
15097
|
watch(() => props.formData, () => {
|
|
15078
|
-
currentValue.value = getProperty(props.formData, props.valuePath);
|
|
15098
|
+
currentValue.value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
15079
15099
|
handleValueChange();
|
|
15080
15100
|
}, {
|
|
15081
15101
|
deep: true
|
|
@@ -15686,7 +15706,8 @@ const sliderProps = {
|
|
|
15686
15706
|
max: PropTypes.number.def(100),
|
|
15687
15707
|
range: PropTypes.bool.def(false),
|
|
15688
15708
|
formData: PropTypes.any,
|
|
15689
|
-
valuePath: PropTypes.string
|
|
15709
|
+
valuePath: PropTypes.string,
|
|
15710
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
15690
15711
|
};
|
|
15691
15712
|
var Slider = defineComponent({
|
|
15692
15713
|
name: "TSlider",
|
|
@@ -15706,7 +15727,7 @@ var Slider = defineComponent({
|
|
|
15706
15727
|
} = useConfig("slider", props);
|
|
15707
15728
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
15708
15729
|
const getValue2 = computed(() => {
|
|
15709
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
15730
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
15710
15731
|
});
|
|
15711
15732
|
const left = props.vertical ? "top" : "left";
|
|
15712
15733
|
const width = props.vertical ? "height" : "width";
|
|
@@ -16902,7 +16923,8 @@ const uploadProps = {
|
|
|
16902
16923
|
type: Function
|
|
16903
16924
|
},
|
|
16904
16925
|
formData: PropTypes.any,
|
|
16905
|
-
valuePath: PropTypes.string
|
|
16926
|
+
valuePath: PropTypes.string,
|
|
16927
|
+
zeroAsNull: PropTypes.bool.def(true)
|
|
16906
16928
|
};
|
|
16907
16929
|
var Upload = defineComponent({
|
|
16908
16930
|
name: "TUpload",
|
|
@@ -16921,7 +16943,7 @@ var Upload = defineComponent({
|
|
|
16921
16943
|
const reqs = ref({});
|
|
16922
16944
|
const dynamicForm = computed(() => props.valuePath && props.valuePath.includes("."));
|
|
16923
16945
|
const getValue2 = computed(() => {
|
|
16924
|
-
return dynamicForm.value ? getProperty(props.formData, props.valuePath) : props.value;
|
|
16946
|
+
return dynamicForm.value ? getProperty(props.formData, props.valuePath, props.zeroAsNull) : checkValue(props.value, props.zeroAsNull);
|
|
16925
16947
|
});
|
|
16926
16948
|
const pictureHeight = computed(() => {
|
|
16927
16949
|
if (props.pictureHeight)
|
|
@@ -17015,7 +17037,7 @@ var Upload = defineComponent({
|
|
|
17015
17037
|
if (props.forForm) {
|
|
17016
17038
|
if (dynamicForm.value) {
|
|
17017
17039
|
watch(() => props.formData, () => {
|
|
17018
|
-
const value = getProperty(props.formData, props.valuePath);
|
|
17040
|
+
const value = getProperty(props.formData, props.valuePath, props.zeroAsNull);
|
|
17019
17041
|
if (!equals(value, modelValue.value)) {
|
|
17020
17042
|
modelValue.value = value;
|
|
17021
17043
|
initFileList();
|