cosey 0.5.12 → 0.5.14
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.
|
@@ -8,10 +8,10 @@ import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
|
8
8
|
var stdin_default = defineComponent((props, {
|
|
9
9
|
slots
|
|
10
10
|
}) => {
|
|
11
|
+
const {
|
|
12
|
+
t
|
|
13
|
+
} = useLocale();
|
|
11
14
|
return () => {
|
|
12
|
-
const {
|
|
13
|
-
t
|
|
14
|
-
} = useLocale();
|
|
15
15
|
if (props.readonly) {
|
|
16
16
|
const value = props.componentProps?.modelValue;
|
|
17
17
|
return addNullablePlaceholder(value, val => dayjs(val).format(DATE_TIME_FORMAT));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type InputNumberInstance, type InputNumberProps } from 'element-plus';
|
|
2
2
|
import { type FieldComponentCommonProps } from '../common';
|
|
3
3
|
export interface FieldNumberProps extends FieldComponentCommonProps {
|
|
4
|
-
componentProps?: Partial<InputNumberProps
|
|
4
|
+
componentProps?: Partial<Omit<InputNumberProps, 'modelValue'>> & {
|
|
5
|
+
modelValue?: number | null | string;
|
|
5
6
|
'onUpdate:modelValue'?: (value: number | undefined) => void;
|
|
6
7
|
onChange?: (currentValue: number | undefined, oldValue: number | undefined) => void;
|
|
7
8
|
onBlur?: (event: FocusEvent) => void;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { ElInputNumber } from 'element-plus';
|
|
2
2
|
import { defineComponent, h, mergeProps } from 'vue';
|
|
3
|
+
import { isNullish } from '../../../../utils/is.js';
|
|
4
|
+
import { useLocale } from '../../../../hooks/useLocale.js';
|
|
3
5
|
import { addNullablePlaceholder } from '../../../../utils/vue.js';
|
|
4
6
|
|
|
5
7
|
var stdin_default = defineComponent((props, {
|
|
6
8
|
slots
|
|
7
9
|
}) => {
|
|
10
|
+
const {
|
|
11
|
+
t
|
|
12
|
+
} = useLocale();
|
|
8
13
|
return () => {
|
|
9
14
|
if (props.readonly) {
|
|
10
15
|
return addNullablePlaceholder(props.componentProps?.modelValue);
|
|
11
16
|
}
|
|
12
17
|
return h(ElInputNumber, mergeProps({
|
|
18
|
+
placeholder: t("co.common.pleaseInput"),
|
|
13
19
|
style: {
|
|
14
|
-
verticalAlign: "top"
|
|
20
|
+
verticalAlign: "top",
|
|
21
|
+
width: "100%"
|
|
15
22
|
}
|
|
16
|
-
},
|
|
23
|
+
}, {
|
|
24
|
+
...props.componentProps,
|
|
25
|
+
modelValue: isNullish(props.componentProps?.modelValue) ? null : Number(props.componentProps?.modelValue) || null
|
|
26
|
+
}), slots);
|
|
17
27
|
};
|
|
18
28
|
}, {
|
|
19
29
|
name: "CoFieldNumber",
|
|
@@ -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 { isNullish } from '../../utils/is.js';
|
|
7
6
|
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
7
|
+
import { isNullish } from '../../utils/is.js';
|
|
8
8
|
|
|
9
9
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
10
10
|
...{
|