cosey 0.5.14 → 0.5.16
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ElInputNumber } from 'element-plus';
|
|
2
|
-
import { defineComponent, h, mergeProps } from 'vue';
|
|
3
|
-
import { isNullish } from '../../../../utils/is.js';
|
|
2
|
+
import { defineComponent, computed, h, mergeProps } from 'vue';
|
|
4
3
|
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
5
4
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
5
|
+
import { isString } from '../../../../utils/is.js';
|
|
6
6
|
|
|
7
7
|
var stdin_default = defineComponent((props, {
|
|
8
8
|
slots
|
|
@@ -10,9 +10,23 @@ var stdin_default = defineComponent((props, {
|
|
|
10
10
|
const {
|
|
11
11
|
t
|
|
12
12
|
} = useLocale();
|
|
13
|
+
const value = computed(() => {
|
|
14
|
+
let value2 = props.componentProps?.modelValue;
|
|
15
|
+
if (isString(value2)) {
|
|
16
|
+
if (value2 === "") {
|
|
17
|
+
value2 = null;
|
|
18
|
+
} else {
|
|
19
|
+
value2 = +value2;
|
|
20
|
+
if (isNaN(value2)) {
|
|
21
|
+
value2 = null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return value2;
|
|
26
|
+
});
|
|
13
27
|
return () => {
|
|
14
28
|
if (props.readonly) {
|
|
15
|
-
return addNullablePlaceholder(
|
|
29
|
+
return addNullablePlaceholder(value.value);
|
|
16
30
|
}
|
|
17
31
|
return h(ElInputNumber, mergeProps({
|
|
18
32
|
placeholder: t("co.common.pleaseInput"),
|
|
@@ -22,7 +36,7 @@ var stdin_default = defineComponent((props, {
|
|
|
22
36
|
}
|
|
23
37
|
}, {
|
|
24
38
|
...props.componentProps,
|
|
25
|
-
modelValue:
|
|
39
|
+
modelValue: value.value
|
|
26
40
|
}), slots);
|
|
27
41
|
};
|
|
28
42
|
}, {
|
|
@@ -3,8 +3,8 @@ import { defaultInputNumberRangeProps } from './input-number-range.js';
|
|
|
3
3
|
import stdin_default$1 from './style/index.js';
|
|
4
4
|
import { useFormItem, CHANGE_EVENT, ElInputNumber } from 'element-plus';
|
|
5
5
|
import { debugWarn } from 'element-plus/es/utils/error.mjs';
|
|
6
|
-
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
7
6
|
import { isNullish } from '../../utils/is.js';
|
|
7
|
+
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
8
8
|
|
|
9
9
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
10
10
|
...{
|