@veltra/desktop 1.2.0 → 1.2.1
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/action/action-group.vue.d.ts +1 -1
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/auto-complete/auto-complete.js +1 -1
- 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-group/checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
- package/dist/components/code-editor/code-editor.js +2 -2
- package/dist/components/date-panel/date-panel.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 +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
- package/dist/components/empty/empty.vue.d.ts +1 -1
- package/dist/components/expression-editor/expression-editor.js +1 -1
- package/dist/components/file-picker/file-picker.js +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_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 +3 -3
- 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-input/number-input.js +1 -1
- package/dist/components/number-range-input/number-range-input.js +1 -1
- package/dist/components/palette/palette.js +1 -1
- package/dist/components/password-input/password-input.js +1 -1
- 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 +2 -2
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/textarea/textarea.js +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-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
|
@@ -6,9 +6,9 @@ type __VLS_Slots = {
|
|
|
6
6
|
default?: () => VNode[];
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
|
|
9
|
-
size: "small" | "default" | "large";
|
|
10
9
|
type: import("@veltra/utils").ColorType;
|
|
11
10
|
text: boolean;
|
|
11
|
+
size: "small" | "default" | "large";
|
|
12
12
|
max: number;
|
|
13
13
|
circle: boolean;
|
|
14
14
|
loading: boolean;
|
|
@@ -12,9 +12,9 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
|
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<ActionProps> & Readonly<{
|
|
13
13
|
onRun?: (() => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
size: import("@veltra/utils").ComponentSize;
|
|
16
15
|
type: ButtonType;
|
|
17
16
|
text: boolean;
|
|
17
|
+
size: import("@veltra/utils").ComponentSize;
|
|
18
18
|
circle: boolean;
|
|
19
19
|
loading: boolean;
|
|
20
20
|
inDropdown: boolean;
|
|
@@ -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": {},
|
|
@@ -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,15 +9,15 @@ 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
|
-
readonly: boolean;
|
|
16
12
|
labelKey: string;
|
|
17
13
|
valueKey: string;
|
|
18
14
|
childrenKey: string;
|
|
19
15
|
data: Record<string, any>[];
|
|
16
|
+
placeholder: string;
|
|
17
|
+
clearable: boolean;
|
|
20
18
|
filterable: boolean;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
readonly: boolean;
|
|
21
21
|
separator: string;
|
|
22
22
|
visibilityLimit: number;
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -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,9 +17,9 @@ 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
|
+
type: import("@veltra/utils").ColorType;
|
|
20
21
|
disabled: boolean;
|
|
21
22
|
readonly: boolean;
|
|
22
|
-
type: import("@veltra/utils").ColorType;
|
|
23
23
|
round: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -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 },
|
|
@@ -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,10 +12,10 @@ 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
|
-
readonly: boolean;
|
|
17
15
|
labelKey: string;
|
|
18
16
|
valueKey: string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
readonly: boolean;
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const _default: typeof __VLS_export;
|
|
21
21
|
//#endregion
|
|
@@ -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": {}
|
|
@@ -7,8 +7,8 @@ declare const __VLS_export: import("vue").DefineComponent<DatePanelProps, {}, {}
|
|
|
7
7
|
"onSelect:range-date"?: ((rangeDate?: [import("@cat-kit/core").Dater, import("@cat-kit/core").Dater] | undefined) => any) | undefined;
|
|
8
8
|
"onSelect:date"?: ((date: import("@cat-kit/core").Dater) => any) | undefined;
|
|
9
9
|
}>, {
|
|
10
|
-
size: import("@veltra/utils").ComponentSize;
|
|
11
10
|
type: "date" | "month" | "year";
|
|
11
|
+
size: import("@veltra/utils").ComponentSize;
|
|
12
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
declare const _default: typeof __VLS_export;
|
|
14
14
|
//#endregion
|
|
@@ -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
|
+
type: "date" | "month" | "year";
|
|
8
9
|
placeholder: string;
|
|
9
10
|
clearable: boolean;
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
readonly: boolean;
|
|
12
|
-
type: "date" | "month" | "year";
|
|
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
|
+
type: "date" | "month" | "year";
|
|
8
9
|
placeholder: [string, string];
|
|
9
10
|
clearable: boolean;
|
|
10
11
|
disabled: boolean;
|
|
11
12
|
readonly: boolean;
|
|
12
|
-
type: "date" | "month" | "year";
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EmptyProps } from "../../types/empty.js";
|
|
2
2
|
//#region src/components/empty/empty.vue.d.ts
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<EmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EmptyProps> & Readonly<{}>, {
|
|
4
|
-
size: number;
|
|
5
4
|
text: string;
|
|
5
|
+
size: number;
|
|
6
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
7
|
declare const _default: typeof __VLS_export;
|
|
8
8
|
//#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"],
|
|
@@ -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":";;AAGA,MAAM,cAAyE;CAC7E,MAAM,GAAG;EAEP,IAAI,CAAC,iDAAG,KAAK,CAAC,GACZ,OAAO;CAEX;CACA,MAAM,GAAG;EAEP,IAAI,CAAC,WAAG,KAAK,CAAC,GACZ,OAAO;CAEX;CACA,IAAI,GAAG;EAEL,IA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C3B,IAAI,CAAC,UAAU;EAEf,MAAM,MAAM,SAAS,OAAO,YAAY,QAAQ;EAEhD,IAAI,KAAK,OAAO;CAClB;CAGA,IAAI,WAAW;EACb,MAAM,MAAM,MAAM,UAAU,OAAO,QAAQ;EAC3C,IAAI,KAAK,OAAO;CAClB;AAGF"}
|
|
@@ -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"],
|
|
@@ -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
|
+
labelKey: string;
|
|
30
|
+
valueKey: string;
|
|
29
31
|
placeholder: string;
|
|
30
32
|
clearable: boolean;
|
|
33
|
+
minWidth: string;
|
|
31
34
|
disabled: boolean;
|
|
32
35
|
readonly: boolean;
|
|
33
|
-
labelKey: string;
|
|
34
|
-
valueKey: string;
|
|
35
|
-
minWidth: string;
|
|
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
|
-
readonly: boolean;
|
|
28
24
|
expandAll: boolean;
|
|
29
25
|
labelKey: string;
|
|
30
26
|
valueKey: string;
|
|
27
|
+
placeholder: string;
|
|
28
|
+
clearable: boolean;
|
|
31
29
|
filterable: boolean;
|
|
32
30
|
minWidth: string;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
readonly: boolean;
|
|
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>;
|
|
@@ -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": {},
|
|
@@ -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] },
|
|
@@ -21,7 +21,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
nativeReadonly: { type: Boolean },
|
|
23
23
|
pattern: {},
|
|
24
|
-
rules: {},
|
|
25
24
|
tips: {},
|
|
26
25
|
span: {},
|
|
27
26
|
label: {},
|
|
@@ -34,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
33
|
type: Boolean,
|
|
35
34
|
default: void 0
|
|
36
35
|
},
|
|
36
|
+
rules: {},
|
|
37
37
|
size: {}
|
|
38
38
|
}, {
|
|
39
39
|
"modelValue": {},
|
|
@@ -17,7 +17,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
},
|
|
18
18
|
disabledItem: {},
|
|
19
19
|
block: { type: Boolean },
|
|
20
|
-
rules: {},
|
|
21
20
|
tips: {},
|
|
22
21
|
span: {},
|
|
23
22
|
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": {},
|
|
@@ -14,10 +14,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
14
14
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
15
15
|
onChange?: ((item: Record<string, any>) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
readonly: boolean;
|
|
19
17
|
labelKey: string;
|
|
20
18
|
valueKey: string;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
readonly: boolean;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
//#endregion
|
|
@@ -61,7 +61,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
format: { default: "html" },
|
|
62
62
|
toolbar: { default: () => DEFAULT_TOOLBAR },
|
|
63
63
|
placeholder: { default: "" },
|
|
64
|
-
rules: {},
|
|
65
64
|
tips: {},
|
|
66
65
|
span: {},
|
|
67
66
|
label: {},
|
|
@@ -74,6 +73,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
73
|
type: Boolean,
|
|
75
74
|
default: void 0
|
|
76
75
|
},
|
|
76
|
+
rules: {},
|
|
77
77
|
size: {}
|
|
78
78
|
}, {
|
|
79
79
|
"modelValue": {},
|
|
@@ -39,7 +39,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
width: {},
|
|
40
40
|
creatable: { type: Boolean },
|
|
41
41
|
grid: {},
|
|
42
|
-
rules: {},
|
|
43
42
|
tips: {},
|
|
44
43
|
span: {},
|
|
45
44
|
label: {},
|
|
@@ -52,6 +51,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
51
|
type: Boolean,
|
|
53
52
|
default: void 0
|
|
54
53
|
},
|
|
54
|
+
rules: {},
|
|
55
55
|
size: {}
|
|
56
56
|
}, {
|
|
57
57
|
"text": {},
|
|
@@ -24,12 +24,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
24
24
|
"onUpdate:text"?: ((value: any) => any) | undefined;
|
|
25
25
|
"onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
|
+
labelKey: string;
|
|
28
|
+
valueKey: string;
|
|
27
29
|
placeholder: string;
|
|
28
30
|
clearable: boolean;
|
|
29
31
|
disabled: boolean;
|
|
30
32
|
readonly: boolean;
|
|
31
|
-
labelKey: string;
|
|
32
|
-
valueKey: string;
|
|
33
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
35
35
|
declare const _default: typeof __VLS_export;
|
|
@@ -16,7 +16,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
step: {},
|
|
17
17
|
range: { type: Boolean },
|
|
18
18
|
vertical: { type: Boolean },
|
|
19
|
-
rules: {},
|
|
20
19
|
tips: {},
|
|
21
20
|
span: {},
|
|
22
21
|
label: {},
|
|
@@ -29,6 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
28
|
type: Boolean,
|
|
30
29
|
default: void 0
|
|
31
30
|
},
|
|
31
|
+
rules: {},
|
|
32
32
|
size: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:modelValue"],
|
|
@@ -10,7 +10,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
modelValue: { type: Boolean },
|
|
11
11
|
activeText: {},
|
|
12
12
|
inactiveText: {},
|
|
13
|
-
rules: {},
|
|
14
13
|
tips: {},
|
|
15
14
|
span: {},
|
|
16
15
|
label: {},
|
|
@@ -23,6 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
22
|
type: Boolean,
|
|
24
23
|
default: void 0
|
|
25
24
|
},
|
|
25
|
+
rules: {},
|
|
26
26
|
size: {}
|
|
27
27
|
}, {
|
|
28
28
|
"modelValue": { type: Boolean },
|