tanxin-ui 1.3.6 → 1.3.8

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.
@@ -1822,7 +1822,7 @@ async function downloadFile(url2, name = "download") {
1822
1822
  }
1823
1823
  }
1824
1824
  function checkValue(value, zeroAsNull) {
1825
- if (value instanceof N) {
1825
+ if (isNumeric(value)) {
1826
1826
  if (zeroAsNull && value === 0)
1827
1827
  return void 0;
1828
1828
  }
@@ -5871,7 +5871,7 @@ var Input = defineComponent({
5871
5871
  });
5872
5872
  } else {
5873
5873
  watch(() => props.value, () => {
5874
- currentValue.value = props.value;
5874
+ currentValue.value = checkValue(props.value, props.zeroAsNull);
5875
5875
  });
5876
5876
  }
5877
5877
  const render = () => {
@@ -6696,9 +6696,10 @@ var InputNumber = defineComponent({
6696
6696
  });
6697
6697
  } else {
6698
6698
  watch(() => props.value, () => {
6699
- if (equals(props.value, currentValue.value))
6699
+ const tempValue = checkValue(props.value, props.zeroAsNull);
6700
+ if (equals(tempValue, currentValue.value))
6700
6701
  return;
6701
- currentValue.value = props.value;
6702
+ currentValue.value = tempValue;
6702
6703
  checkInvalid();
6703
6704
  });
6704
6705
  }
@@ -7415,7 +7416,7 @@ var Textarea = defineComponent({
7415
7416
  });
7416
7417
  } else {
7417
7418
  watch(() => props.value, () => {
7418
- currentValue.value = props.value;
7419
+ currentValue.value = checkValue(props.value, props.zeroAsNull);
7419
7420
  });
7420
7421
  }
7421
7422
  const focus = () => {
@@ -7710,9 +7711,10 @@ var Radio = defineComponent({
7710
7711
  });
7711
7712
  } else {
7712
7713
  watch(() => props.value, () => {
7713
- if (equals(props.value, currentValue.value))
7714
+ const tempValue = checkValue(props.value, props.zeroAsNull);
7715
+ if (equals(tempValue, currentValue.value))
7714
7716
  return;
7715
- currentValue.value = props.value;
7717
+ currentValue.value = tempValue;
7716
7718
  setCheckStatus();
7717
7719
  });
7718
7720
  }
@@ -7818,7 +7820,7 @@ var RadioGroup = defineComponent({
7818
7820
  });
7819
7821
  } else {
7820
7822
  watch(() => props.value, () => {
7821
- groupValue.value = props.value;
7823
+ groupValue.value = checkValue(props.value, props.zeroAsNull);
7822
7824
  });
7823
7825
  }
7824
7826
  const styles = computed(() => {
@@ -8157,7 +8159,7 @@ var CheckboxGroup = defineComponent({
8157
8159
  });
8158
8160
  } else {
8159
8161
  watch(() => props.value, () => {
8160
- groupValue.value = props.value;
8162
+ groupValue.value = checkValue(props.value, props.zeroAsNull);
8161
8163
  });
8162
8164
  }
8163
8165
  const styles = computed(() => {
@@ -8344,7 +8346,7 @@ var Switch = defineComponent({
8344
8346
  });
8345
8347
  } else {
8346
8348
  watch(() => props.value, () => {
8347
- isChecked.value = props.value === props.trueValue;
8349
+ isChecked.value = checkValue(props.value, props.zeroAsNull) === props.trueValue;
8348
8350
  });
8349
8351
  }
8350
8352
  const render = () => {
@@ -10138,7 +10140,8 @@ var Select = defineComponent({
10138
10140
  watch(
10139
10141
  () => props.value,
10140
10142
  () => {
10141
- currentValue.value = isArray$2(props.value) ? props.value : props.value !== null && props.value !== void 0 ? [props.value] : [];
10143
+ const tempValue = checkValue(props.value, props.zeroAsNull);
10144
+ currentValue.value = isArray$2(tempValue) ? tempValue : tempValue !== null && tempValue !== void 0 ? [tempValue] : [];
10142
10145
  handleValueChange();
10143
10146
  },
10144
10147
  {
@@ -11068,9 +11071,10 @@ var Cascader = defineComponent({
11068
11071
  });
11069
11072
  } else {
11070
11073
  watch(() => props.value, () => {
11071
- if (props.value == currentValue.value)
11074
+ const tempValue = checkValue(props.value, props.zeroAsNull);
11075
+ if (tempValue == currentValue.value)
11072
11076
  return;
11073
- currentValue.value = props.value;
11077
+ currentValue.value = tempValue;
11074
11078
  initCascaderValue();
11075
11079
  });
11076
11080
  }
@@ -11349,10 +11353,10 @@ var TreeSelect = defineComponent({
11349
11353
  });
11350
11354
  } else {
11351
11355
  watch(() => props.value, () => {
11352
- const value = props.value;
11356
+ const value = checkValue(props.value, props.zeroAsNull);
11353
11357
  if (equals(value, currentValue.value))
11354
11358
  return;
11355
- currentValue.value = props.value;
11359
+ currentValue.value = value;
11356
11360
  initTreeValue();
11357
11361
  });
11358
11362
  }
@@ -15104,7 +15108,7 @@ var ColorPicker = defineComponent({
15104
15108
  watch(
15105
15109
  () => props.value,
15106
15110
  () => {
15107
- currentValue.value = props.value;
15111
+ currentValue.value = checkValue(props.value, props.zeroAsNull);
15108
15112
  handleValueChange();
15109
15113
  },
15110
15114
  {
@@ -16017,7 +16021,8 @@ var Slider = defineComponent({
16017
16021
  });
16018
16022
  } else {
16019
16023
  watch(() => props.value, () => {
16020
- currentValue.value = props.range ? props.value : [props.value, void 0];
16024
+ const tempValue = checkValue(props.value, props.zeroAsNull);
16025
+ currentValue.value = props.range ? tempValue : [tempValue, void 0];
16021
16026
  initPosition();
16022
16027
  }, {
16023
16028
  deep: true
@@ -17047,8 +17052,9 @@ var Upload = defineComponent({
17047
17052
  });
17048
17053
  } else {
17049
17054
  watch(() => props.value, () => {
17050
- if (!equals(props.value, modelValue.value)) {
17051
- modelValue.value = props.value;
17055
+ const value = checkValue(props.value, props.zeroAsNull);
17056
+ if (!equals(value, modelValue.value)) {
17057
+ modelValue.value = value;
17052
17058
  initFileList();
17053
17059
  }
17054
17060
  }, {