@veltra/desktop 1.2.0 → 1.2.2
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/components/auto-complete/auto-complete.js +1 -1
- package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
- package/dist/components/cascade/cascade.js +1 -1
- package/dist/components/cascade/cascade.vue.d.ts +4 -4
- package/dist/components/checkbox/checkbox-button.js +1 -1
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox/checkbox.vue.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
- package/dist/components/code-editor/code-editor.js +2 -2
- package/dist/components/code-editor/code-editor.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +3 -3
- package/dist/components/date-range-picker/date-range-picker.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +3 -3
- package/dist/components/expression-editor/expression-editor.js +1 -1
- package/dist/components/file-picker/file-picker.js +1 -1
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +13 -5
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/form-item/helper.js.map +1 -1
- package/dist/components/form-item/validate.js.map +1 -1
- package/dist/components/group-input/group-input.js +1 -1
- package/dist/components/input/input.vue.d.ts +2 -2
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/multi-select/multi-select.js +1 -1
- package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
- package/dist/components/multi-tree-select/multi-tree-select.js +1 -1
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
- package/dist/components/number/number.vue.d.ts +1 -1
- package/dist/components/number-input/number-input.js +1 -1
- package/dist/components/number-input/number-input.vue.d.ts +2 -2
- package/dist/components/number-range-input/number-range-input.js +1 -1
- package/dist/components/number-range-input/number-range-input.vue.d.ts +2 -2
- package/dist/components/palette/palette.js +1 -1
- package/dist/components/palette/palette.vue.d.ts +1 -1
- package/dist/components/password-input/password-input.js +1 -1
- package/dist/components/password-input/password-input.vue.d.ts +2 -2
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio-group/radio-group.js +1 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +2 -2
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.vue.d.ts +3 -3
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/steps/steps.vue.d.ts +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/switch/switch.vue.d.ts +1 -1
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textarea/textarea.vue.d.ts +2 -2
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree-select/tree-select.js +1 -1
- package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
- package/dist/index.d.ts +2 -4
- package/dist/types/auto-complete.d.ts +2 -3
- package/dist/types/cascade.d.ts +2 -3
- package/dist/types/checkbox-group.d.ts +2 -2
- package/dist/types/checkbox.d.ts +3 -4
- package/dist/types/code-editor.d.ts +2 -3
- package/dist/types/date-picker.d.ts +2 -3
- package/dist/types/date-range-picker.d.ts +2 -3
- package/dist/types/expression-editor.d.ts +2 -3
- package/dist/types/file-picker.d.ts +2 -3
- package/dist/types/form-item.d.ts +2 -2
- package/dist/types/group-input.d.ts +2 -3
- package/dist/types/index.d.ts +1 -3
- package/dist/types/input.d.ts +2 -3
- package/dist/types/multi-select.d.ts +2 -3
- package/dist/types/multi-tree-select.d.ts +2 -3
- package/dist/types/palette.d.ts +2 -3
- package/dist/types/radio-group.d.ts +2 -3
- package/dist/types/radio.d.ts +2 -3
- package/dist/types/rich-text-editor.d.ts +2 -3
- package/dist/types/select.d.ts +2 -3
- package/dist/types/slider.d.ts +2 -3
- package/dist/types/switch.d.ts +2 -3
- package/dist/types/text-editor.d.ts +2 -3
- package/dist/types/textarea.d.ts +2 -3
- package/dist/types/tree-select.d.ts +2 -3
- package/package.json +6 -6
- package/src/components/form/form.vue +24 -6
- package/src/components/form-item/helper.ts +4 -6
- package/src/components/form-item/validate.ts +1 -25
- package/src/types/auto-complete.ts +2 -4
- package/src/types/cascade.ts +2 -4
- package/src/types/checkbox-group.ts +2 -2
- package/src/types/checkbox.ts +3 -5
- package/src/types/code-editor.ts +2 -4
- package/src/types/date-picker.ts +2 -4
- package/src/types/date-range-picker.ts +2 -4
- package/src/types/expression-editor.ts +2 -4
- package/src/types/file-picker.ts +2 -4
- package/src/types/form-item.ts +2 -2
- package/src/types/group-input.ts +2 -4
- package/src/types/index.ts +0 -1
- package/src/types/input.ts +2 -4
- package/src/types/multi-select.ts +2 -4
- package/src/types/multi-tree-select.ts +2 -5
- package/src/types/palette.ts +2 -4
- package/src/types/radio-group.ts +2 -3
- package/src/types/radio.ts +2 -3
- package/src/types/rich-text-editor.ts +2 -4
- package/src/types/select.ts +2 -4
- package/src/types/slider.ts +2 -4
- package/src/types/switch.ts +2 -4
- package/src/types/text-editor.ts +2 -4
- package/src/types/textarea.ts +2 -4
- package/src/types/tree-select.ts +2 -5
- package/dist/components/form-item/validate.d.ts +0 -26
- package/dist/types/form-field.d.ts +0 -12
- package/src/types/form-field.ts +0 -11
|
@@ -22,7 +22,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: true
|
|
24
24
|
},
|
|
25
|
-
rules: {},
|
|
26
25
|
tips: {},
|
|
27
26
|
span: {},
|
|
28
27
|
label: {},
|
|
@@ -35,6 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
34
|
type: Boolean,
|
|
36
35
|
default: void 0
|
|
37
36
|
},
|
|
37
|
+
rules: {},
|
|
38
38
|
size: {}
|
|
39
39
|
}, {
|
|
40
40
|
"modelValue": {},
|
|
@@ -22,10 +22,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
22
22
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
23
23
|
onSelect?: ((value: string) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
+
readonly: boolean;
|
|
26
|
+
disabled: boolean;
|
|
25
27
|
placeholder: string;
|
|
26
28
|
clearable: boolean;
|
|
27
|
-
disabled: boolean;
|
|
28
|
-
readonly: boolean;
|
|
29
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
31
31
|
declare const _default: typeof __VLS_export;
|
|
@@ -38,7 +38,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
default: false
|
|
39
39
|
},
|
|
40
40
|
visibilityLimit: { default: 3 },
|
|
41
|
-
rules: {},
|
|
42
41
|
tips: {},
|
|
43
42
|
span: {},
|
|
44
43
|
label: {},
|
|
@@ -51,6 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
50
|
type: Boolean,
|
|
52
51
|
default: void 0
|
|
53
52
|
},
|
|
53
|
+
rules: {},
|
|
54
54
|
size: {}
|
|
55
55
|
},
|
|
56
56
|
emits: [
|
|
@@ -9,17 +9,17 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
|
|
|
9
9
|
onClear?: (() => any) | undefined;
|
|
10
10
|
onChange?: ((...args: [value?: string | undefined, label?: string | undefined, item?: Record<string, any> | undefined] | [value: string[], label: string[], data: Record<string, any>[]]) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
placeholder: string;
|
|
13
|
-
clearable: boolean;
|
|
14
|
-
disabled: boolean;
|
|
15
12
|
readonly: boolean;
|
|
13
|
+
disabled: boolean;
|
|
16
14
|
labelKey: string;
|
|
17
15
|
valueKey: string;
|
|
18
16
|
childrenKey: string;
|
|
19
17
|
data: Record<string, any>[];
|
|
18
|
+
placeholder: string;
|
|
19
|
+
clearable: boolean;
|
|
20
20
|
filterable: boolean;
|
|
21
|
-
separator: string;
|
|
22
21
|
visibilityLimit: number;
|
|
22
|
+
separator: string;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
25
25
|
//#endregion
|
|
@@ -13,7 +13,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
default: false
|
|
14
14
|
},
|
|
15
15
|
type: { default: "primary" },
|
|
16
|
-
rules: {},
|
|
17
16
|
tips: {},
|
|
18
17
|
span: {},
|
|
19
18
|
label: {},
|
|
@@ -26,6 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
25
|
type: Boolean,
|
|
27
26
|
default: void 0
|
|
28
27
|
},
|
|
28
|
+
rules: {},
|
|
29
29
|
size: {}
|
|
30
30
|
}, {
|
|
31
31
|
"modelValue": { type: Boolean },
|
|
@@ -17,8 +17,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
17
17
|
"onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
|
|
18
18
|
onChange?: ((checked: boolean) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
|
-
disabled: boolean;
|
|
21
20
|
readonly: boolean;
|
|
21
|
+
disabled: boolean;
|
|
22
22
|
type: import("@veltra/utils").ColorType;
|
|
23
23
|
round: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,7 +14,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
props: /* @__PURE__ */ mergeModels({
|
|
15
15
|
indeterminate: { type: Boolean },
|
|
16
16
|
modelValue: { type: Boolean },
|
|
17
|
-
rules: {},
|
|
18
17
|
tips: {},
|
|
19
18
|
span: {},
|
|
20
19
|
label: {},
|
|
@@ -27,6 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
27
26
|
type: Boolean,
|
|
28
27
|
default: void 0
|
|
29
28
|
},
|
|
29
|
+
rules: {},
|
|
30
30
|
size: {}
|
|
31
31
|
}, {
|
|
32
32
|
"modelValue": { type: Boolean },
|
|
@@ -18,8 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
18
18
|
"onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
|
|
19
19
|
onChange?: ((checked: boolean, e: MouseEvent) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
|
-
disabled: boolean;
|
|
22
21
|
readonly: boolean;
|
|
22
|
+
disabled: boolean;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
24
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
25
|
declare const _default: typeof __VLS_export;
|
|
@@ -13,7 +13,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
labelKey: { default: "label" },
|
|
14
14
|
valueKey: { default: "value" },
|
|
15
15
|
block: { type: Boolean },
|
|
16
|
-
rules: {},
|
|
17
16
|
tips: {},
|
|
18
17
|
span: {},
|
|
19
18
|
label: {},
|
|
@@ -26,6 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
25
|
type: Boolean,
|
|
27
26
|
default: void 0
|
|
28
27
|
},
|
|
28
|
+
rules: {},
|
|
29
29
|
size: {}
|
|
30
30
|
}, {
|
|
31
31
|
"modelValue": {},
|
|
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
13
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
disabled: boolean;
|
|
16
15
|
readonly: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
17
|
labelKey: string;
|
|
18
18
|
valueKey: string;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -19,7 +19,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
default: false
|
|
20
20
|
},
|
|
21
21
|
defaultLines: { default: 8 },
|
|
22
|
-
rules: {},
|
|
23
22
|
tips: {},
|
|
24
23
|
span: {},
|
|
25
24
|
label: {},
|
|
@@ -31,7 +30,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
30
|
readonly: {
|
|
32
31
|
type: Boolean,
|
|
33
32
|
default: void 0
|
|
34
|
-
}
|
|
33
|
+
},
|
|
34
|
+
rules: {}
|
|
35
35
|
}, {
|
|
36
36
|
"modelValue": {},
|
|
37
37
|
"modelModifiers": {}
|
|
@@ -10,8 +10,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
11
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
disabled: boolean;
|
|
14
13
|
readonly: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
15
|
dark: boolean;
|
|
16
16
|
defaultLines: number;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -22,7 +22,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: true
|
|
24
24
|
},
|
|
25
|
-
rules: {},
|
|
26
25
|
tips: {},
|
|
27
26
|
span: {},
|
|
28
27
|
label: {},
|
|
@@ -35,6 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
34
|
type: Boolean,
|
|
36
35
|
default: void 0
|
|
37
36
|
},
|
|
37
|
+
rules: {},
|
|
38
38
|
size: {}
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:modelValue"],
|
|
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
|
|
6
6
|
"onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
|
-
placeholder: string;
|
|
9
|
-
clearable: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
8
|
readonly: boolean;
|
|
9
|
+
disabled: boolean;
|
|
12
10
|
type: "date" | "month" | "year";
|
|
11
|
+
placeholder: string;
|
|
12
|
+
clearable: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -23,7 +23,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: true
|
|
25
25
|
},
|
|
26
|
-
rules: {},
|
|
27
26
|
tips: {},
|
|
28
27
|
span: {},
|
|
29
28
|
label: {},
|
|
@@ -36,6 +35,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
35
|
type: Boolean,
|
|
37
36
|
default: void 0
|
|
38
37
|
},
|
|
38
|
+
rules: {},
|
|
39
39
|
size: {}
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:modelValue"],
|
|
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<DateRangePickerProps> & Readonly<{
|
|
6
6
|
"onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
|
-
placeholder: [string, string];
|
|
9
|
-
clearable: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
8
|
readonly: boolean;
|
|
9
|
+
disabled: boolean;
|
|
12
10
|
type: "date" | "month" | "year";
|
|
11
|
+
placeholder: [string, string];
|
|
12
|
+
clearable: boolean;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -20,13 +20,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
placeholder: { default: "请输入表达式,输入 @ 可插入变量" },
|
|
21
21
|
variables: {},
|
|
22
22
|
selectableLevels: { default: "leaf" },
|
|
23
|
-
rules: {},
|
|
24
23
|
tips: {},
|
|
25
24
|
span: {},
|
|
26
25
|
label: {},
|
|
27
26
|
field: {},
|
|
28
27
|
disabled: { type: Boolean },
|
|
29
28
|
readonly: { type: Boolean },
|
|
29
|
+
rules: {},
|
|
30
30
|
size: {}
|
|
31
31
|
},
|
|
32
32
|
emits: ["update:modelValue"],
|
|
@@ -13,13 +13,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
type: Boolean,
|
|
14
14
|
default: false
|
|
15
15
|
},
|
|
16
|
-
rules: {},
|
|
17
16
|
tips: {},
|
|
18
17
|
span: {},
|
|
19
18
|
label: {},
|
|
20
19
|
field: {},
|
|
21
20
|
disabled: { type: Boolean },
|
|
22
21
|
readonly: { type: Boolean },
|
|
22
|
+
rules: {},
|
|
23
23
|
size: {}
|
|
24
24
|
},
|
|
25
25
|
emits: ["pick"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"
|
|
1
|
+
{"version":3,"file":"form.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, shallowRef, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, GridExposed, FormProps, _FormExposed } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'Form' })\n\nconst props = defineProps<FormProps>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import _sfc_main from "../grid/grid.js";
|
|
|
2
2
|
import form_item_default from "../form-item/form-item.js";
|
|
3
3
|
import { useFormFields } from "./use-form-fields.js";
|
|
4
4
|
import { useNodeInterceptor } from "./use-node-interceptor.js";
|
|
5
|
-
import { Fragment, createBlock, createElementBlock, defineComponent, mergeProps, normalizeClass, openBlock, renderList, resolveDynamicComponent,
|
|
5
|
+
import { Fragment, createBlock, createElementBlock, defineComponent, mergeProps, nextTick, normalizeClass, openBlock, renderList, resolveDynamicComponent, toRef, unref, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
6
6
|
import { bem, provideFormContext } from "@veltra/utils";
|
|
7
7
|
import { o } from "@cat-kit/core";
|
|
8
8
|
//#region src/components/form/form.vue?vue&type=script&setup=true&lang.tsx
|
|
@@ -21,6 +21,8 @@ var form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
21
21
|
setup(__props, { expose: __expose }) {
|
|
22
22
|
const props = __props;
|
|
23
23
|
const cls = bem("form");
|
|
24
|
+
const formItemCls = bem("form-item");
|
|
25
|
+
const gridRef = useTemplateRef("grid");
|
|
24
26
|
const breakpointCols = {
|
|
25
27
|
xs: 1,
|
|
26
28
|
md: 2,
|
|
@@ -28,7 +30,15 @@ var form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
28
30
|
xl: 4,
|
|
29
31
|
default: 4
|
|
30
32
|
};
|
|
31
|
-
const { validate, clearValidate, reset, registerField, unregisterField, shouldValidate } = useFormFields({ props });
|
|
33
|
+
const { validate: runValidate, clearValidate, reset, registerField, unregisterField, shouldValidate } = useFormFields({ props });
|
|
34
|
+
async function validate(keys) {
|
|
35
|
+
const valid = await runValidate(keys);
|
|
36
|
+
if (!valid) {
|
|
37
|
+
await nextTick();
|
|
38
|
+
gridRef.value?.el?.querySelector(`.${formItemCls.e("error-text")}`)?.scrollIntoView({ block: "center" });
|
|
39
|
+
}
|
|
40
|
+
return valid;
|
|
41
|
+
}
|
|
32
42
|
provideFormContext({
|
|
33
43
|
formProps: props,
|
|
34
44
|
registerField,
|
|
@@ -41,7 +51,6 @@ var form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
41
51
|
if (!props.model) return;
|
|
42
52
|
o(props.model).set(field, value);
|
|
43
53
|
}
|
|
44
|
-
const gridRef = shallowRef();
|
|
45
54
|
__expose({
|
|
46
55
|
el: toRef(() => gridRef.value?.el),
|
|
47
56
|
validate,
|
|
@@ -51,8 +60,7 @@ var form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
51
60
|
return (_ctx, _cache) => {
|
|
52
61
|
return openBlock(), createBlock(unref(_sfc_main), {
|
|
53
62
|
tag: "form",
|
|
54
|
-
|
|
55
|
-
ref: gridRef,
|
|
63
|
+
ref: "grid",
|
|
56
64
|
onSubmit: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
57
65
|
cols: __props.cols || breakpointCols,
|
|
58
66
|
class: normalizeClass([unref(cls).b, unref(bem).is("readonly", __props.readonly)])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"
|
|
1
|
+
{"version":3,"file":"form.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, shallowRef, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, GridExposed, FormProps, _FormExposed } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'Form' })\n\nconst props = defineProps<FormProps>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAuCA,MAAM,QAAQ;EAId,MAAM,MAAM,IAAI,MAAM;EACtB,MAAM,cAAc,IAAI,WAAW;EACnC,MAAM,UAAU,eAAe,MAAM;EAErC,MAAM,iBAA4B;GAAE,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,SAAS;EAAE;EAE3E,MAAM,EACJ,UAAU,aACV,eACA,OACA,eACA,iBACA,mBACE,cAAc,EAAE,MAAM,CAAC;EAE3B,eAAe,SAAS,MAAiB;GACvC,MAAM,QAAQ,MAAM,YAAY,IAAI;GACpC,IAAI,CAAC,OAAO;IACV,MAAM,SAAS;IAEf,QAAQ,OAAO,IACX,cAAc,IAAI,YAAY,EAAE,YAAY,GAAG,GAC/C,eAAe,EAAE,OAAO,SAAS,CAAC;GACxC;GACA,OAAO;EACT;EAEA,mBAAmB;GACjB,WAAW;GACX;GACA;GACA,gBAAgB;GAChB;EACF,CAAC;EAED,MAAM,EAAE,kBAAkB,mBAAmB;EAE7C,SAAS,kBAAkB,OAAe,OAAY;GACpD,IAAI,CAAC,MAAM,OAAO;GAClB,EAAE,MAAM,KAAK,EAAE,IAAI,OAAO,KAAK;EACjC;EAEA,SAA2B;GAAE,IAAI,YAAY,QAAQ,OAAO,EAAE;GAAG;GAAU;GAAe;EAAM,CAAC;;uBApF/F,YAqBS,MAAA,SAAA,GAAA;IApBP,KAAI;IACJ,KAAI;IACH,UAAM,OAAA,OAAA,OAAA,KAAA,oBAAP,CAAA,GAAe,CAAA,SAAA,CAAA;IACd,MAAM,QAAA,QAAQ;IACd,OAAK,eAAA,CAAG,MAAA,GAAA,EAAI,GAAG,MAAA,GAAA,EAAI,GAAE,YAAa,QAAA,QAAQ,CAAA,CAAA;;2BAGwC,EAAA,UAAA,IAAA,GADnF,mBAaW,UAAA,MAAA,WAZwD,MAAA,aAAA,EAAa,IAAA,EAArE,MAAM,YAAY,eAAe,OAAO,iBAAU;6DACrD,KAAK,IAAA,GAAA,CAAA,CAES,cAAc,SAAA,UAAA,GAAlC,YAMc,MAAA,iBAAA,GANd,WAMc;;;QANmC,aAAa,GAAA;6BAK1D,EAAA,UAAA,GAJF,YAIE,wBAHK,IAAI,GAAA;OACR,eAAa,cAAc,MAAA,CAAA,EAAE,QAAA,SAAK,CAAA,CAAA,EAAQ,IAAI,KAAK;OACnD,wBAAkB,WAAE,kBAAkB,OAAO,MAAM;;;+BAIxD,YAA+B,wBAAR,IAAI,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,GAAA,EAAA"}
|
|
@@ -12,7 +12,6 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
12
12
|
__name: "form-item",
|
|
13
13
|
props: {
|
|
14
14
|
labelWidth: {},
|
|
15
|
-
rules: {},
|
|
16
15
|
tips: {},
|
|
17
16
|
span: {},
|
|
18
17
|
label: {},
|
|
@@ -22,6 +21,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
22
21
|
type: Boolean,
|
|
23
22
|
default: void 0
|
|
24
23
|
},
|
|
24
|
+
rules: {},
|
|
25
25
|
size: {}
|
|
26
26
|
},
|
|
27
27
|
setup(__props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","names":[],"sources":["../../../src/components/form-item/helper.ts"],"sourcesContent":["import { o } from '@cat-kit/core'\nimport { bem, type BEM, type FormFieldItem } from '@veltra/utils'\n\
|
|
1
|
+
{"version":3,"file":"helper.js","names":[],"sources":["../../../src/components/form-item/helper.ts"],"sourcesContent":["import { o } from '@cat-kit/core'\nimport { bem, type BEM, type FormComponentProps, type FormFieldItem } from '@veltra/utils'\n\n/**\n * 获取表单项的属性\n * @param props 表单系列组件的属性\n * @returns\n */\nexport function getFormItemProps(\n props: FormComponentProps\n): Pick<FormComponentProps, 'label' | 'field' | 'readonly' | 'span' | 'tips'> {\n return o(props).pick(['label', 'field', 'readonly', 'span', 'tips']) as Pick<\n FormComponentProps,\n 'label' | 'field' | 'readonly' | 'span' | 'tips'\n >\n}\n\nexport const formItemCls: BEM<'form-item'> = bem('form-item')\n\nexport function defineField(field: FormFieldItem) {\n return field\n}\n"],"mappings":";;;AAiBA,MAAa,cAAgC,IAAI,WAAW;AAE5D,SAAgB,YAAY,OAAsB;CAChD,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","names":[],"sources":["../../../src/components/form-item/validate.ts"],"sourcesContent":["import { isEmpty, o } from '@cat-kit/core'\nimport type { Undef } from '@veltra/utils'\n\
|
|
1
|
+
{"version":3,"file":"validate.js","names":[],"sources":["../../../src/components/form-item/validate.ts"],"sourcesContent":["import { isEmpty, o } from '@cat-kit/core'\nimport type { PresetRule, Undef, ValidateRule } from '@veltra/utils'\n\nconst presetRules: Record<PresetRule, (value: string) => string | undefined> = {\n email(v) {\n const re = /^([\\w_-]+)@([\\w-]+[.]?)*[\\w]+\\.[a-zA-Z]{2,10}$/\n if (!re.test(v)) {\n return '邮箱格式不正确'\n }\n },\n phone(v) {\n const re = /^\\d{11}$/\n if (!re.test(v)) {\n return '手机号格式不正确'\n }\n },\n num(v) {\n const re = /^\\d+$/\n if (!re.test(v)) {\n return '数字格式不正确'\n }\n },\n url(v) {\n const re = /^(ftp|https?):\\/\\/([\\w_-]+)\\.([\\w-]+[.]?)*[\\w]+\\.[a-zA-Z]{2,10}(.*)/\n if (!re.test(v)) {\n return '链接格式不正确'\n }\n },\n\n idCard(v) {\n const re = /^(\\d{6})(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$/\n if (!re.test(v)) {\n return '身份证格式不正确'\n }\n }\n}\n\n/** 预设规则 */\nconst ruleTypes = {\n required(value: any, required: ValidateRule['required']): Undef<string> {\n if (required === false) return\n\n const errMsg = typeof required === 'string' ? required : '该项不能为空'\n if (isEmpty(value)) return errMsg\n\n if (Array.isArray(value) && !value.length) return errMsg\n if (typeof value === 'string' && !value) return errMsg\n },\n min(value: any, rule: ValidateRule['min']): Undef<string> {\n if (isEmpty(value)) return\n let _rule = Array.isArray(rule) ? rule[0] : rule!\n let errMsg = Array.isArray(rule) ? rule[1] : `该项必须大于等于${_rule}`\n if (typeof value !== 'number') return `${value}不是一个数字`\n if (value < _rule) return errMsg\n },\n max(value: any, rule: ValidateRule['max']): Undef<string> {\n if (isEmpty(value)) return\n let _rule = Array.isArray(rule) ? rule[0] : rule!\n let errMsg = Array.isArray(rule) ? rule[1] : `该项必须小于等于${_rule}`\n if (typeof value !== 'number') return `${value}不是一个数字`\n if (value > _rule) return errMsg\n },\n\n minLen(value: any, rule: ValidateRule['minLen']): Undef<string> {\n if (isEmpty(value)) return\n let _rule = Array.isArray(rule) ? rule[0] : rule!\n let errMsg = Array.isArray(rule) ? rule[1] : `该项长度必须大于等于${_rule}`\n if (!Array.isArray(value) && typeof value !== 'string') return `${value}不是一个字符串或数组`\n if (value.length < _rule) return errMsg\n },\n maxLen(value: any, rule: ValidateRule['maxLen']): Undef<string> {\n if (isEmpty(value)) return\n let _rule = Array.isArray(rule) ? rule[0] : rule!\n let errMsg = Array.isArray(rule) ? rule[1] : `该项长度必须小于等于:${_rule}`\n if (!Array.isArray(value) && typeof value !== 'string') return `${value}不是一个字符串或数组`\n if (value.length > _rule) return errMsg\n },\n match(value: any, rule: ValidateRule['match']): Undef<string> {\n if (isEmpty(value) || value === '') return\n if (typeof rule === 'string') {\n if (!rule) return\n rule = new RegExp(rule)\n }\n let _rule = Array.isArray(rule) ? rule[0] : rule!\n let errMsg = Array.isArray(rule) ? rule[1] : `该项不匹配正则:${_rule}`\n if (typeof value !== 'string') return `${value}不是一个字符串`\n if (!_rule.test(value)) return errMsg\n },\n preset(value: any, rule: ValidateRule['preset']): Undef<string> {\n if (isEmpty(value) || value === '' || !rule) return\n if (typeof value !== 'string') return `${value}不是一个字符串`\n const ruleValidator = presetRules[rule]\n return ruleValidator(value)\n }\n}\n\nexport async function validateField(\n formData: Record<string, any>,\n field: string,\n rules: ValidateRule\n): Promise<Undef<string>> {\n const value = o(formData).get(field)\n\n if (!rules) return\n\n const { validator, required, ...normalRules } = rules\n\n // 必填要先去校验\n if (required) {\n const err = ruleTypes.required(value, required)\n if (err) return err\n }\n\n // 校验规则\n for (const ruleKey in normalRules) {\n const validate = ruleTypes[ruleKey as keyof typeof ruleTypes]\n if (!validate) continue\n\n const err = validate(value, normalRules[ruleKey])\n\n if (err) return err\n }\n\n // 自定义校验最火校验\n if (validator) {\n const err = await validator(value, formData)\n if (err) return err\n }\n\n return\n}\n"],"mappings":"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"}
|
|
@@ -24,7 +24,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
Object,
|
|
25
25
|
Array
|
|
26
26
|
] },
|
|
27
|
-
rules: {},
|
|
28
27
|
tips: {},
|
|
29
28
|
span: {},
|
|
30
29
|
label: {},
|
|
@@ -37,6 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
36
|
type: Boolean,
|
|
38
37
|
default: void 0
|
|
39
38
|
},
|
|
39
|
+
rules: {},
|
|
40
40
|
size: {}
|
|
41
41
|
},
|
|
42
42
|
emits: ["update:modelValue"],
|
|
@@ -32,10 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
|
|
|
32
32
|
onBlur?: ((value?: string | undefined) => any) | undefined;
|
|
33
33
|
"onNative:input"?: ((ev: Event) => any) | undefined;
|
|
34
34
|
}>, {
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
disabled: boolean;
|
|
35
37
|
placeholder: string;
|
|
36
38
|
clearable: boolean;
|
|
37
|
-
disabled: boolean;
|
|
38
|
-
readonly: boolean;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -24,7 +24,6 @@ var input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
24
24
|
},
|
|
25
25
|
nativeReadonly: { type: Boolean },
|
|
26
26
|
pattern: {},
|
|
27
|
-
rules: {},
|
|
28
27
|
tips: {},
|
|
29
28
|
span: {},
|
|
30
29
|
label: {},
|
|
@@ -37,6 +36,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
37
36
|
type: Boolean,
|
|
38
37
|
default: void 0
|
|
39
38
|
},
|
|
39
|
+
rules: {},
|
|
40
40
|
size: {}
|
|
41
41
|
}, {
|
|
42
42
|
"modelValue": {},
|
|
@@ -35,7 +35,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
minWidth: { default: "220px" },
|
|
36
36
|
width: {},
|
|
37
37
|
creatable: { type: Boolean },
|
|
38
|
-
rules: {},
|
|
39
38
|
tips: {},
|
|
40
39
|
span: {},
|
|
41
40
|
label: {},
|
|
@@ -48,6 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
47
|
type: Boolean,
|
|
49
48
|
default: void 0
|
|
50
49
|
},
|
|
50
|
+
rules: {},
|
|
51
51
|
size: {}
|
|
52
52
|
}, {
|
|
53
53
|
"modelValue": {},
|
|
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
26
26
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
27
27
|
onChange?: ((options: Record<string, any>[]) => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
|
-
placeholder: string;
|
|
30
|
-
clearable: boolean;
|
|
31
|
-
disabled: boolean;
|
|
32
29
|
readonly: boolean;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
minWidth: string;
|
|
33
32
|
labelKey: string;
|
|
34
33
|
valueKey: string;
|
|
35
|
-
|
|
34
|
+
placeholder: string;
|
|
35
|
+
clearable: boolean;
|
|
36
36
|
visibilityLimit: number;
|
|
37
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -30,7 +30,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
width: {},
|
|
31
31
|
contentStyle: {},
|
|
32
32
|
contentClass: {},
|
|
33
|
-
rules: {},
|
|
34
33
|
tips: {},
|
|
35
34
|
span: {},
|
|
36
35
|
label: {},
|
|
@@ -43,6 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
42
|
type: Boolean,
|
|
44
43
|
default: void 0
|
|
45
44
|
},
|
|
45
|
+
rules: {},
|
|
46
46
|
size: {},
|
|
47
47
|
expandAll: {
|
|
48
48
|
type: Boolean,
|
|
@@ -21,15 +21,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
21
21
|
onClear?: (() => any) | undefined;
|
|
22
22
|
onChange?: ((checked: Record<string, any>[]) => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
placeholder: string;
|
|
25
|
-
clearable: boolean;
|
|
26
|
-
disabled: boolean;
|
|
27
24
|
readonly: boolean;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
minWidth: string;
|
|
28
27
|
expandAll: boolean;
|
|
29
28
|
labelKey: string;
|
|
30
29
|
valueKey: string;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
clearable: boolean;
|
|
31
32
|
filterable: boolean;
|
|
32
|
-
minWidth: string;
|
|
33
33
|
visibilityLimit: number;
|
|
34
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NumberProps } from "../../types/number.js";
|
|
2
2
|
//#region src/components/number/number.vue.d.ts
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<NumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberProps> & Readonly<{}>, {
|
|
4
|
-
format: "currency" | "percent" | "decimal";
|
|
5
4
|
duration: number;
|
|
5
|
+
format: "currency" | "percent" | "decimal";
|
|
6
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
declare const _default: typeof __VLS_export;
|
|
8
8
|
//#endregion
|
|
@@ -29,7 +29,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
},
|
|
30
30
|
nativeReadonly: { type: Boolean },
|
|
31
31
|
pattern: {},
|
|
32
|
-
rules: {},
|
|
33
32
|
tips: {},
|
|
34
33
|
span: {},
|
|
35
34
|
label: {},
|
|
@@ -42,6 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
41
|
type: Boolean,
|
|
43
42
|
default: void 0
|
|
44
43
|
},
|
|
44
|
+
rules: {},
|
|
45
45
|
size: {}
|
|
46
46
|
}, {
|
|
47
47
|
"modelValue": {},
|
|
@@ -20,10 +20,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
20
20
|
onClear?: (() => any) | undefined;
|
|
21
21
|
onChange?: ((value?: number | undefined) => any) | undefined;
|
|
22
22
|
}>, {
|
|
23
|
+
readonly: boolean;
|
|
24
|
+
disabled: boolean;
|
|
23
25
|
placeholder: string;
|
|
24
26
|
clearable: boolean;
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
readonly: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
29
|
declare const _default: typeof __VLS_export;
|
|
@@ -30,7 +30,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
},
|
|
31
31
|
nativeReadonly: { type: Boolean },
|
|
32
32
|
pattern: {},
|
|
33
|
-
rules: {},
|
|
34
33
|
tips: {},
|
|
35
34
|
span: {},
|
|
36
35
|
label: {},
|
|
@@ -43,6 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
42
|
type: Boolean,
|
|
44
43
|
default: void 0
|
|
45
44
|
},
|
|
45
|
+
rules: {},
|
|
46
46
|
size: {}
|
|
47
47
|
}, {
|
|
48
48
|
"modelValue": { default: () => [void 0, void 0] },
|
|
@@ -22,9 +22,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
22
22
|
"onUpdate:start"?: ((value: number | undefined) => any) | undefined;
|
|
23
23
|
"onUpdate:end"?: ((value: number | undefined) => any) | undefined;
|
|
24
24
|
}>, {
|
|
25
|
-
clearable: boolean;
|
|
26
|
-
disabled: boolean;
|
|
27
25
|
readonly: boolean;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
clearable: boolean;
|
|
28
28
|
startPlaceholder: string;
|
|
29
29
|
endPlaceholder: string;
|
|
30
30
|
separator: string;
|