@silver-formily/element-plus 4.0.3 → 5.0.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/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +7 -5
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/array-base-inner.mjs.map +1 -1
- package/esm/array-base/array-base-move-down.mjs +1 -1
- package/esm/array-base/array-base-move-down.mjs.map +1 -1
- package/esm/array-base/array-base-move-up.mjs +1 -1
- package/esm/array-base/array-base-move-up.mjs.map +1 -1
- package/esm/array-base/array-base-remove.mjs +1 -1
- package/esm/array-base/array-base-remove.mjs.map +1 -1
- package/esm/array-base/types.d.ts +2 -2
- package/esm/array-base/utils.d.ts +1 -1
- package/esm/array-base/utils.mjs +1 -1
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/array-cards.mjs +1 -1
- package/esm/array-cards/array-cards.mjs.map +1 -1
- package/esm/array-collapse/array-collapse-item.mjs +1 -1
- package/esm/array-collapse/array-collapse-item.mjs.map +1 -1
- package/esm/array-collapse/array-collapse.mjs +3 -4
- package/esm/array-collapse/array-collapse.mjs.map +1 -1
- package/esm/array-items/array-items.mjs +3 -8
- package/esm/array-items/array-items.mjs.map +1 -1
- package/esm/array-list-tabs/array-list-tabs.mjs +57 -51
- package/esm/array-list-tabs/array-list-tabs.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/array-table.mjs +4 -18
- package/esm/array-table/array-table.mjs.map +1 -1
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/array-tabs.mjs +1 -1
- package/esm/array-tabs/array-tabs.mjs.map +1 -1
- package/esm/autocomplete/autocomplete.mjs.map +1 -1
- package/esm/autocomplete/index.d.ts +1 -41
- package/esm/cascader/index.d.ts +1 -31
- package/esm/checkbox/checkbox-group.mjs +1 -1
- package/esm/checkbox/checkbox-group.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +1 -819
- package/esm/color-picker/index.d.ts +1 -210
- package/esm/color-picker-panel/index.d.ts +1 -130
- package/esm/date-picker/index.d.ts +1 -447
- package/esm/date-picker-panel/index.d.ts +1 -147
- package/esm/editable/editable-popover.mjs +1 -1
- package/esm/editable/editable-popover.mjs.map +1 -1
- package/esm/editable/editable.mjs +1 -1
- package/esm/editable/editable.mjs.map +1 -1
- package/esm/editable/index.d.ts +1 -60
- package/esm/form/form.mjs.map +1 -1
- package/esm/form/form.vue.d.ts +1 -1
- package/esm/form-collapse/form-collapse.mjs +1 -1
- package/esm/form-collapse/form-collapse.mjs.map +1 -1
- package/esm/form-collapse/index.d.ts +3 -3
- package/esm/form-collapse/utils.d.ts +2 -2
- package/esm/form-collapse/utils.mjs +2 -2
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.mjs +1 -1
- package/esm/form-dialog/dialog-content.mjs.map +1 -1
- package/esm/form-dialog/index.mjs +3 -3
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +2 -2
- package/esm/form-drawer/drawer-content.mjs +1 -1
- package/esm/form-drawer/drawer-content.mjs.map +1 -1
- package/esm/form-drawer/index.mjs +3 -3
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +2 -2
- package/esm/form-item/form-item.mjs +1 -1
- package/esm/form-item/form-item.mjs.map +1 -1
- package/esm/form-item/index.d.ts +1 -83
- package/esm/form-item/index.mjs +1 -1
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/utils.mjs +1 -1
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +1 -1
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/form-layout.vue.d.ts +1 -1
- package/esm/form-layout/utils.mjs +1 -1
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/form-step.mjs +1 -1
- package/esm/form-step/form-step.mjs.map +1 -1
- package/esm/form-step/types.d.ts +1 -1
- package/esm/form-step/utils.d.ts +1 -1
- package/esm/form-step/utils.mjs +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/utils.mjs +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/input/index.d.ts +1 -43
- package/esm/input-number/index.d.ts +1 -328
- package/esm/input-tag/index.d.ts +1 -26
- package/esm/input-tag/input-tag.mjs.map +1 -1
- package/esm/mention/index.d.ts +1 -36
- package/esm/mention/mention.mjs.map +1 -1
- package/esm/pagination/components/pager2.mjs.map +1 -1
- package/esm/pagination/components/sizes2.mjs +1 -1
- package/esm/pagination/components/sizes2.mjs.map +1 -1
- package/esm/password/index.d.ts +1 -42
- package/esm/picker-select/index.d.ts +1 -41
- package/esm/picker-select/picker-select.mjs +1 -1
- package/esm/picker-select/picker-select.mjs.map +1 -1
- package/esm/picker-select/types.d.ts +1 -1
- package/esm/preview-text/cascader.mjs.map +1 -1
- package/esm/preview-text/color-picker.mjs +1 -1
- package/esm/preview-text/color-picker.mjs.map +1 -1
- package/esm/preview-text/input.mjs +1 -1
- package/esm/preview-text/input.mjs.map +1 -1
- package/esm/preview-text/rate.mjs +1 -1
- package/esm/preview-text/rate.mjs.map +1 -1
- package/esm/preview-text/select.mjs +1 -1
- package/esm/preview-text/select.mjs.map +1 -1
- package/esm/preview-text/time-picker.mjs +1 -1
- package/esm/preview-text/time-picker.mjs.map +1 -1
- package/esm/preview-text/tree.mjs.map +1 -1
- package/esm/query-form/hooks.mjs +1 -1
- package/esm/query-form/hooks.mjs.map +1 -1
- package/esm/query-form/index.d.ts +5 -5
- package/esm/query-form/query-form-light.mjs +1 -1
- package/esm/query-form/query-form-light.mjs.map +1 -1
- package/esm/query-form/query-form.mjs +1 -1
- package/esm/query-form/query-form.mjs.map +1 -1
- package/esm/query-form/types.d.ts +2 -2
- package/esm/query-form-item/index.d.ts +1 -152
- package/esm/query-form-item/query-form-item.mjs +2 -2
- package/esm/query-form-item/query-form-item.mjs.map +1 -1
- package/esm/query-form-item/types.d.ts +2 -2
- package/esm/radio/index.d.ts +67 -121
- package/esm/radio/radio-group.mjs +1 -1
- package/esm/radio/radio-group.mjs.map +1 -1
- package/esm/rate/index.d.ts +1 -186
- package/esm/segmented/index.d.ts +1 -28
- package/esm/select/index.d.ts +1 -112
- package/esm/select-table/index.d.ts +1 -61
- package/esm/select-table/select-table.mjs +1 -1
- package/esm/select-table/select-table.mjs.map +1 -1
- package/esm/slider/index.d.ts +1 -178
- package/esm/submit/submit.mjs.map +1 -1
- package/esm/switch/index.d.ts +1 -298
- package/esm/time-picker/index.d.ts +1 -446
- package/esm/time-select/index.d.ts +1 -188
- package/esm/transfer/index.d.ts +1 -268
- package/esm/tree/index.d.ts +1 -45
- package/esm/tree/tree.mjs +1 -1
- package/esm/tree/tree.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +1 -19
- package/esm/tree-select/tree-select.mjs.map +1 -1
- package/esm/upload/index.d.ts +1 -129
- package/esm/upload/upload.mjs +1 -1
- package/esm/upload/upload.mjs.map +1 -1
- package/package.json +18 -14
- package/esm/select-table/types.d.ts +0 -22
- package/esm/tree/types.d.ts +0 -18
package/esm/segmented/index.d.ts
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
import * as _$element_plus_es_components_segmented_src_types_mjs0 from "element-plus/es/components/segmented/src/types.mjs";
|
|
3
|
-
|
|
4
1
|
//#region src/segmented/index.d.ts
|
|
5
|
-
declare const Segmented:
|
|
6
|
-
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
7
|
-
options?: _$element_plus_es_components_segmented_src_types_mjs0.Option[];
|
|
8
|
-
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
9
|
-
P: {};
|
|
10
|
-
B: {};
|
|
11
|
-
D: {};
|
|
12
|
-
C: {};
|
|
13
|
-
M: {};
|
|
14
|
-
Defaults: {};
|
|
15
|
-
}, Readonly<{
|
|
16
|
-
options?: _$element_plus_es_components_segmented_src_types_mjs0.Option[];
|
|
17
|
-
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
18
|
-
__isFragment?: never;
|
|
19
|
-
__isTeleport?: never;
|
|
20
|
-
__isSuspense?: never;
|
|
21
|
-
} & _$vue.ComponentOptionsBase<Readonly<{
|
|
22
|
-
options?: _$element_plus_es_components_segmented_src_types_mjs0.Option[];
|
|
23
|
-
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
24
|
-
$slots: {
|
|
25
|
-
default?: (props: {
|
|
26
|
-
item: any;
|
|
27
|
-
}) => any;
|
|
28
|
-
};
|
|
29
|
-
});
|
|
2
|
+
declare const Segmented: any;
|
|
30
3
|
//#endregion
|
|
31
4
|
export { Segmented };
|
|
32
5
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/select/index.d.ts
CHANGED
|
@@ -1,116 +1,5 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
import * as _$element_plus_es_utils_index_mjs0 from "element-plus/es/utils/index.mjs";
|
|
3
|
-
|
|
4
1
|
//#region src/select/index.d.ts
|
|
5
|
-
declare const Select:
|
|
6
|
-
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
7
|
-
options?: Array<(Partial<{
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
created: boolean;
|
|
10
|
-
}> & Omit<{
|
|
11
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
12
|
-
readonly disabled: boolean;
|
|
13
|
-
readonly created: boolean;
|
|
14
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
15
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
16
|
-
disabled: boolean;
|
|
17
|
-
}> & Omit<{
|
|
18
|
-
readonly disabled: boolean;
|
|
19
|
-
readonly label?: string;
|
|
20
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled"> & {
|
|
21
|
-
options: (Partial<{
|
|
22
|
-
disabled: boolean;
|
|
23
|
-
created: boolean;
|
|
24
|
-
}> & Omit<{
|
|
25
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
26
|
-
readonly disabled: boolean;
|
|
27
|
-
readonly created: boolean;
|
|
28
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
29
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
30
|
-
})>;
|
|
31
|
-
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
32
|
-
P: {};
|
|
33
|
-
B: {};
|
|
34
|
-
D: {};
|
|
35
|
-
C: {};
|
|
36
|
-
M: {};
|
|
37
|
-
Defaults: {};
|
|
38
|
-
}, Readonly<{
|
|
39
|
-
options?: Array<(Partial<{
|
|
40
|
-
disabled: boolean;
|
|
41
|
-
created: boolean;
|
|
42
|
-
}> & Omit<{
|
|
43
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
44
|
-
readonly disabled: boolean;
|
|
45
|
-
readonly created: boolean;
|
|
46
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
47
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
48
|
-
disabled: boolean;
|
|
49
|
-
}> & Omit<{
|
|
50
|
-
readonly disabled: boolean;
|
|
51
|
-
readonly label?: string;
|
|
52
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled"> & {
|
|
53
|
-
options: (Partial<{
|
|
54
|
-
disabled: boolean;
|
|
55
|
-
created: boolean;
|
|
56
|
-
}> & Omit<{
|
|
57
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
58
|
-
readonly disabled: boolean;
|
|
59
|
-
readonly created: boolean;
|
|
60
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
61
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
62
|
-
})>;
|
|
63
|
-
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
64
|
-
__isFragment?: never;
|
|
65
|
-
__isTeleport?: never;
|
|
66
|
-
__isSuspense?: never;
|
|
67
|
-
} & _$vue.ComponentOptionsBase<Readonly<{
|
|
68
|
-
options?: Array<(Partial<{
|
|
69
|
-
disabled: boolean;
|
|
70
|
-
created: boolean;
|
|
71
|
-
}> & Omit<{
|
|
72
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
73
|
-
readonly disabled: boolean;
|
|
74
|
-
readonly created: boolean;
|
|
75
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
76
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
77
|
-
disabled: boolean;
|
|
78
|
-
}> & Omit<{
|
|
79
|
-
readonly disabled: boolean;
|
|
80
|
-
readonly label?: string;
|
|
81
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled"> & {
|
|
82
|
-
options: (Partial<{
|
|
83
|
-
disabled: boolean;
|
|
84
|
-
created: boolean;
|
|
85
|
-
}> & Omit<{
|
|
86
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
87
|
-
readonly disabled: boolean;
|
|
88
|
-
readonly created: boolean;
|
|
89
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
90
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
91
|
-
})>;
|
|
92
|
-
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
93
|
-
$slots: {
|
|
94
|
-
option?: (props: {
|
|
95
|
-
option: Partial<{
|
|
96
|
-
disabled: boolean;
|
|
97
|
-
created: boolean;
|
|
98
|
-
}> & Omit<{
|
|
99
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
100
|
-
readonly disabled: boolean;
|
|
101
|
-
readonly created: boolean;
|
|
102
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
103
|
-
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">;
|
|
104
|
-
}) => any;
|
|
105
|
-
header?: () => any;
|
|
106
|
-
footer?: () => any;
|
|
107
|
-
prefix?: () => any;
|
|
108
|
-
empty?: () => any;
|
|
109
|
-
tag?: () => any;
|
|
110
|
-
loading?: () => any;
|
|
111
|
-
label?: () => any;
|
|
112
|
-
};
|
|
113
|
-
});
|
|
2
|
+
declare const Select: any;
|
|
114
3
|
//#endregion
|
|
115
4
|
export { Select };
|
|
116
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,65 +1,5 @@
|
|
|
1
|
-
import { ISelectTableProps } from "./types.js";
|
|
2
|
-
import * as _$element_plus0 from "element-plus";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
|
-
|
|
5
1
|
//#region src/select-table/index.d.ts
|
|
6
|
-
declare const SelectTable:
|
|
7
|
-
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<ISelectTableProps> & Readonly<{
|
|
8
|
-
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
9
|
-
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
10
|
-
"update:modelValue": (...args: any[]) => void;
|
|
11
|
-
}, _$vue.PublicProps, {
|
|
12
|
-
loading: boolean;
|
|
13
|
-
dataSource: any[];
|
|
14
|
-
valueType: "all" | "parent" | "child" | "path";
|
|
15
|
-
mode: "multiple" | "single";
|
|
16
|
-
columns: _$element_plus0.Column<any>[];
|
|
17
|
-
optionAsValue: boolean;
|
|
18
|
-
clickRowToSelect: boolean;
|
|
19
|
-
showAlertToolbar: boolean;
|
|
20
|
-
ignoreSelectable: boolean;
|
|
21
|
-
}, false, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
22
|
-
P: {};
|
|
23
|
-
B: {};
|
|
24
|
-
D: {};
|
|
25
|
-
C: {};
|
|
26
|
-
M: {};
|
|
27
|
-
Defaults: {};
|
|
28
|
-
}, Readonly<ISelectTableProps> & Readonly<{
|
|
29
|
-
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
30
|
-
}>, {}, {}, {}, {}, {
|
|
31
|
-
loading: boolean;
|
|
32
|
-
dataSource: any[];
|
|
33
|
-
valueType: "all" | "parent" | "child" | "path";
|
|
34
|
-
mode: "multiple" | "single";
|
|
35
|
-
columns: _$element_plus0.Column<any>[];
|
|
36
|
-
optionAsValue: boolean;
|
|
37
|
-
clickRowToSelect: boolean;
|
|
38
|
-
showAlertToolbar: boolean;
|
|
39
|
-
ignoreSelectable: boolean;
|
|
40
|
-
}>;
|
|
41
|
-
__isFragment?: never;
|
|
42
|
-
__isTeleport?: never;
|
|
43
|
-
__isSuspense?: never;
|
|
44
|
-
} & _$vue.ComponentOptionsBase<Readonly<ISelectTableProps> & Readonly<{
|
|
45
|
-
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
46
|
-
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
47
|
-
"update:modelValue": (...args: any[]) => void;
|
|
48
|
-
}, string, {
|
|
49
|
-
loading: boolean;
|
|
50
|
-
dataSource: any[];
|
|
51
|
-
valueType: "all" | "parent" | "child" | "path";
|
|
52
|
-
mode: "multiple" | "single";
|
|
53
|
-
columns: _$element_plus0.Column<any>[];
|
|
54
|
-
optionAsValue: boolean;
|
|
55
|
-
clickRowToSelect: boolean;
|
|
56
|
-
showAlertToolbar: boolean;
|
|
57
|
-
ignoreSelectable: boolean;
|
|
58
|
-
}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
59
|
-
$slots: {
|
|
60
|
-
default?: (props: {}) => any;
|
|
61
|
-
};
|
|
62
|
-
});
|
|
2
|
+
declare const SelectTable: any;
|
|
63
3
|
//#endregion
|
|
64
4
|
export { SelectTable };
|
|
65
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
|
3
3
|
import { ElLink, ElRadio, ElRadioGroup, ElTable, ElTableColumn, useAttrs, vLoading, version } from "element-plus";
|
|
4
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx, withDirectives } from "vue";
|
|
5
5
|
import { useField } from "@silver-formily/vue";
|
|
6
|
-
import { isEqual, isFn, isValid } from "@formily/shared";
|
|
6
|
+
import { isEqual, isFn, isValid } from "@silver-formily/shared";
|
|
7
7
|
import { differenceWith, remove, uniq, uniqWith, xor } from "lodash-es";
|
|
8
8
|
//#region src/select-table/select-table.vue
|
|
9
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-table.mjs","names":[],"sources":["../../src/select-table/select-table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TableInstance } from 'element-plus'\nimport type { ISelectTableProps } from './types'\nimport { isEqual, isFn, isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport {\n ElLink,\n ElRadio,\n ElRadioGroup,\n ElTable,\n ElTableColumn,\n useAttrs,\n version,\n vLoading,\n} from 'element-plus'\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { lt, stylePrefix } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelectTable',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<ISelectTableProps>(), {\n columns: () => [],\n mode: 'multiple',\n dataSource: () => [],\n optionAsValue: false,\n valueType: 'all',\n loading: false,\n clickRowToSelect: true,\n showAlertToolbar: true,\n ignoreSelectable: true,\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst elTableProps = useAttrs()\nconst field = useField()\nconst elTableRef = ref<TableInstance>()\nconst radioSelectedKey = ref()\n\nfunction requireRowKey() {\n if (!props.rowKey) {\n throw new Error('rowKey is required')\n }\n return props.rowKey\n}\n\nfunction getRowValue(item?: Record<string, any> | null) {\n if (!props.rowKey || !item) {\n return undefined\n }\n return item[props.rowKey]\n}\n\nfunction getSingleSelectedKey(value: any) {\n if (!isValid(value)) {\n return null\n }\n return props.optionAsValue ? getRowValue(value) ?? null : value\n}\n\nfunction getMultipleSelectedKeys(value: any) {\n if (!Array.isArray(value)) {\n return []\n }\n return value\n .map(item => props.optionAsValue ? getRowValue(item) : item)\n .filter(isValid)\n}\n\nfunction syncRadioSelection(item?: Record<string, any> | null) {\n radioSelectedKey.value = getRowValue(item) ?? null\n elTableRef.value?.setCurrentRow(item)\n}\n\nfunction compatibleRadioValue(key: string) {\n return lt(version, '2.6.0') ? { label: key } : { value: key }\n}\n\nfunction getInitialSelectedList() {\n if (!isValid(props.modelValue)) {\n return []\n }\n\n if (props.mode === 'multiple') {\n if (!Array.isArray(props.modelValue)) {\n return []\n }\n\n return props.modelValue.map((item) => {\n if (!props.optionAsValue) {\n if (!props.rowKey) {\n return null\n }\n return {\n [props.rowKey]: item,\n }\n }\n return item\n }).filter(isValid)\n }\n else {\n if (props.optionAsValue) {\n return [props.modelValue]\n }\n if (!props.rowKey) {\n return []\n }\n return [{ [props.rowKey]: props.modelValue }]\n }\n}\nconst initialSelectedList = getInitialSelectedList()\nconst selectedFlatDataSource = ref(initialSelectedList)\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\nlet prevSelection = []\n\nconst currentSelectLength = computed(() => {\n if (props.mode === 'multiple') {\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\n }\n else {\n return isValid(radioSelectedKey.value) ? 1 : 0\n }\n})\n\nwatch(\n () => props.dataSource,\n async () => {\n const selectedKeys = uniq(\n selectedFlatDataSource.value.map(item => getRowValue(item)).filter(isValid),\n )\n await nextTick()\n for (const item of props.dataSource) {\n const itemKey = getRowValue(item)\n if (isValid(itemKey) && selectedKeys.includes(itemKey)) {\n if (props.mode === 'multiple') {\n elTableRef.value?.toggleRowSelection(item, true, props.ignoreSelectable)\n }\n else {\n syncRadioSelection(item)\n }\n }\n await nextTick()\n prevSelection = elTableRef.value?.getSelectionRows() ?? []\n }\n },\n { immediate: true },\n)\n\nwatch(\n () => [props.modelValue, props.loading],\n async ([value, loading]) => {\n if (loading) {\n return\n }\n if (props.mode === 'single') {\n const selectedKey = getSingleSelectedKey(value)\n radioSelectedKey.value = selectedKey\n const selectedItem = props.dataSource.find(item => getRowValue(item) === selectedKey)\n elTableRef.value?.setCurrentRow(selectedItem)\n }\n else {\n await nextTick()\n const currentDisplayDataKeys = elTableRef.value\n ?.getSelectionRows()\n .map(item => getRowValue(item))\n .filter(isValid) ?? []\n const valueKeys = getMultipleSelectedKeys(value)\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\n item => valueKeys.includes(getRowValue(item)),\n )\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\n return\n }\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\n for (const tableItem of props.dataSource) {\n const itemKey = getRowValue(tableItem)\n if (isValid(itemKey) && diffItems.includes(itemKey)) {\n const shouldSelect = valueKeys.includes(itemKey)\n elTableRef.value?.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\n }\n }\n }\n },\n {\n immediate: true,\n },\n)\n\nfunction onSelect(newSelection: Record<string, any>[]) {\n const rowKey = requireRowKey()\n\n const removedItemList\n = prevSelection.length > newSelection.length\n ? differenceWith(\n prevSelection,\n newSelection,\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n : []\n prevSelection = [...newSelection]\n selectedFlatDataSource.value = uniqWith(\n [...selectedFlatDataSource.value, ...newSelection],\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n if (removedItemList.length > 0) {\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\n remove(selectedFlatDataSource.value, item =>\n removedKeys.includes(item[rowKey]))\n }\n\n if (props.optionAsValue) {\n emit('update:modelValue', selectedFlatDataSource.value)\n }\n else {\n const selectedKeys = selectedFlatDataSource.value.map(\n item => item[rowKey],\n )\n emit('update:modelValue', selectedKeys)\n }\n}\n\nfunction onRadioClick(item) {\n const rowKey = requireRowKey()\n syncRadioSelection(item)\n if (props.optionAsValue) {\n emit('update:modelValue', item)\n }\n else {\n emit('update:modelValue', item[rowKey])\n }\n}\n\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\n if (!props.clickRowToSelect)\n return\n\n if (props.mode === 'multiple') {\n const checkboxDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"checkbox\"]')\n if (checkboxDOM instanceof HTMLElement) {\n checkboxDOM.click()\n }\n }\n else {\n const radioDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"radio\"]')\n if (radioDOM instanceof HTMLElement) {\n radioDOM.click()\n }\n }\n}\n\nfunction onClearSelectionClick() {\n if (props.mode === 'multiple') {\n emit('update:modelValue', [])\n selectedFlatDataSource.value = []\n }\n else {\n syncRadioSelection(null)\n emit('update:modelValue', null)\n }\n}\n\nfunction selectable(row: Record<string, any>, index: number) {\n if (props.selectable && isFn(props.selectable)) {\n return props.selectable(row, index, field.value)\n }\n return true\n}\n</script>\n\n<template>\n <div :class=\"`${stylePrefix}-select-table`\">\n <div\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\n :class=\"`${stylePrefix}-select-table-alert-container`\"\n >\n <span>已选择 {{ currentSelectLength }} 项</span>\n <ElLink\n type=\"primary\"\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\n style=\"margin-left: 8px;\"\n @click=\"onClearSelectionClick\"\n >\n 取消选择\n </ElLink>\n </div>\n <ElTable\n ref=\"elTableRef\"\n v-loading=\"props.loading\"\n v-bind=\"elTableProps\"\n :row-key=\"rowKey\"\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\n :data=\"props.dataSource\"\n :highlight-current-row=\"props.mode === 'single'\"\n @select=\"onSelect\"\n @select-all=\"onSelect\"\n @row-click=\"onRowClick\"\n >\n <ElTableColumn\n v-if=\"props.mode === 'multiple'\"\n type=\"selection\"\n :selectable=\"selectable\"\n />\n <ElTableColumn\n v-else\n width=\"46\"\n >\n <template #default=\"{ row }\">\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\n <ElRadio\n v-bind=\"compatibleRadioValue(row[rowKey])\"\n @change=\"() => onRadioClick(row)\"\n >\n \n </ElRadio>\n </ElRadioGroup>\n </template>\n </ElTableColumn>\n <template v-if=\"props.columns.length === 0\">\n <slot />\n </template>\n <template v-else>\n <ElTableColumn\n v-for=\"colItem of props.columns\"\n v-bind=\"colItem\"\n :key=\"colItem.prop || colItem.type\"\n />\n </template>\n </ElTable>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAYd,MAAM,OAAO;EAEb,MAAM,eAAe,UAAS;EAC9B,MAAM,Q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A,WAAA,EADlB,YAIE,MAAA,cAAA,EAAA;;KAFA,MAAK;KACQ;wBAEf,YAcgB,MAAA,cAAA,EAAA;;KAZd,OAAM;;KAEK,SAAO,SAQD,EARK,UAAG,CACvB,YAOe,MAAA,aAAA,EAAA;kBAPQ,iBAAA;mEAAA,iBAAgB,QAAA;MAAE,OAAA,EAAA,SAAA,QAAoB;;6BAMjD,CALV,YAKU,MAAA,QAAA,EALV,WACU,qBAAqB,IAAI,QAAA,QAAM,EAAA,EACtC,gBAAc,aAAa,IAAG,EAAA,CAAA,EAAA;8BAGjC,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFC,UAED,GAAA,CAAA,EAAA,CAAA;;;;;;SAIU,MAAM,QAAQ,WAAM,IAClC,WAAQ,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,IAAA,UAAA,KAAA,EAGR,mBAIE,UAAA,EAAA,KAAA,GAAA,EAAA,WAHkB,MAAM,UAAjB,YAAO;yBADhB,YAIE,MAAA,cAAA,EAJF,WAIE,EAAA,SAAA,MAAA,EAFQ,SAAO,EACd,KAAK,QAAQ,QAAQ,QAAQ,MAAA,CAAA,EAAA,MAAA,GAAA;;;;;;;;2BArCvB,MAAM,QAAO,CAAA,CAAA,CAAA,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"select-table.mjs","names":[],"sources":["../../src/select-table/select-table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TableInstance } from 'element-plus'\nimport type { ISelectTableProps } from './types'\nimport { isEqual, isFn, isValid } from '@silver-formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport {\n ElLink,\n ElRadio,\n ElRadioGroup,\n ElTable,\n ElTableColumn,\n useAttrs,\n version,\n vLoading,\n} from 'element-plus'\nimport { differenceWith, remove, uniq, uniqWith, xor } from 'lodash-es'\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { lt, stylePrefix } from '../__builtins__'\n\ndefineOptions({\n name: 'FSelectTable',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<ISelectTableProps>(), {\n columns: () => [],\n mode: 'multiple',\n dataSource: () => [],\n optionAsValue: false,\n valueType: 'all',\n loading: false,\n clickRowToSelect: true,\n showAlertToolbar: true,\n ignoreSelectable: true,\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst elTableProps = useAttrs()\nconst field = useField()\nconst elTableRef = ref<TableInstance>()\nconst radioSelectedKey = ref()\n\nfunction requireRowKey() {\n if (!props.rowKey) {\n throw new Error('rowKey is required')\n }\n return props.rowKey\n}\n\nfunction getRowValue(item?: Record<string, any> | null) {\n if (!props.rowKey || !item) {\n return undefined\n }\n return item[props.rowKey]\n}\n\nfunction getSingleSelectedKey(value: any) {\n if (!isValid(value)) {\n return null\n }\n return props.optionAsValue ? getRowValue(value) ?? null : value\n}\n\nfunction getMultipleSelectedKeys(value: any) {\n if (!Array.isArray(value)) {\n return []\n }\n return value\n .map(item => props.optionAsValue ? getRowValue(item) : item)\n .filter(isValid)\n}\n\nfunction syncRadioSelection(item?: Record<string, any> | null) {\n radioSelectedKey.value = getRowValue(item) ?? null\n elTableRef.value?.setCurrentRow(item)\n}\n\nfunction compatibleRadioValue(key: string) {\n return lt(version, '2.6.0') ? { label: key } : { value: key }\n}\n\nfunction getInitialSelectedList() {\n if (!isValid(props.modelValue)) {\n return []\n }\n\n if (props.mode === 'multiple') {\n if (!Array.isArray(props.modelValue)) {\n return []\n }\n\n return props.modelValue.map((item) => {\n if (!props.optionAsValue) {\n if (!props.rowKey) {\n return null\n }\n return {\n [props.rowKey]: item,\n }\n }\n return item\n }).filter(isValid)\n }\n else {\n if (props.optionAsValue) {\n return [props.modelValue]\n }\n if (!props.rowKey) {\n return []\n }\n return [{ [props.rowKey]: props.modelValue }]\n }\n}\nconst initialSelectedList = getInitialSelectedList()\nconst selectedFlatDataSource = ref(initialSelectedList)\n// 为了获取移除的项而缓存的当前页面的前一次选择。由于element-plus没有获取移除项的方法,需要通过这种方式移除field中移除的项\nlet prevSelection = []\n\nconst currentSelectLength = computed(() => {\n if (props.mode === 'multiple') {\n return Array.isArray(props.modelValue) ? props.modelValue.length : 0\n }\n else {\n return isValid(radioSelectedKey.value) ? 1 : 0\n }\n})\n\nwatch(\n () => props.dataSource,\n async () => {\n const selectedKeys = uniq(\n selectedFlatDataSource.value.map(item => getRowValue(item)).filter(isValid),\n )\n await nextTick()\n for (const item of props.dataSource) {\n const itemKey = getRowValue(item)\n if (isValid(itemKey) && selectedKeys.includes(itemKey)) {\n if (props.mode === 'multiple') {\n elTableRef.value?.toggleRowSelection(item, true, props.ignoreSelectable)\n }\n else {\n syncRadioSelection(item)\n }\n }\n await nextTick()\n prevSelection = elTableRef.value?.getSelectionRows() ?? []\n }\n },\n { immediate: true },\n)\n\nwatch(\n () => [props.modelValue, props.loading],\n async ([value, loading]) => {\n if (loading) {\n return\n }\n if (props.mode === 'single') {\n const selectedKey = getSingleSelectedKey(value)\n radioSelectedKey.value = selectedKey\n const selectedItem = props.dataSource.find(item => getRowValue(item) === selectedKey)\n elTableRef.value?.setCurrentRow(selectedItem)\n }\n else {\n await nextTick()\n const currentDisplayDataKeys = elTableRef.value\n ?.getSelectionRows()\n .map(item => getRowValue(item))\n .filter(isValid) ?? []\n const valueKeys = getMultipleSelectedKeys(value)\n selectedFlatDataSource.value = selectedFlatDataSource.value.filter(\n item => valueKeys.includes(getRowValue(item)),\n )\n if (isEqual(valueKeys, currentDisplayDataKeys)) {\n return\n }\n const diffItems = xor(valueKeys, currentDisplayDataKeys)\n for (const tableItem of props.dataSource) {\n const itemKey = getRowValue(tableItem)\n if (isValid(itemKey) && diffItems.includes(itemKey)) {\n const shouldSelect = valueKeys.includes(itemKey)\n elTableRef.value?.toggleRowSelection(tableItem, shouldSelect, props.ignoreSelectable)\n }\n }\n }\n },\n {\n immediate: true,\n },\n)\n\nfunction onSelect(newSelection: Record<string, any>[]) {\n const rowKey = requireRowKey()\n\n const removedItemList\n = prevSelection.length > newSelection.length\n ? differenceWith(\n prevSelection,\n newSelection,\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n : []\n prevSelection = [...newSelection]\n selectedFlatDataSource.value = uniqWith(\n [...selectedFlatDataSource.value, ...newSelection],\n (itemPrev, itemNext) => {\n return itemPrev[rowKey] === itemNext[rowKey]\n },\n )\n if (removedItemList.length > 0) {\n const removedKeys = uniq(removedItemList.map(item => item[rowKey]))\n remove(selectedFlatDataSource.value, item =>\n removedKeys.includes(item[rowKey]))\n }\n\n if (props.optionAsValue) {\n emit('update:modelValue', selectedFlatDataSource.value)\n }\n else {\n const selectedKeys = selectedFlatDataSource.value.map(\n item => item[rowKey],\n )\n emit('update:modelValue', selectedKeys)\n }\n}\n\nfunction onRadioClick(item) {\n const rowKey = requireRowKey()\n syncRadioSelection(item)\n if (props.optionAsValue) {\n emit('update:modelValue', item)\n }\n else {\n emit('update:modelValue', item[rowKey])\n }\n}\n\nfunction onRowClick(row: Record<string, any>, _, event: Event) {\n if (!props.clickRowToSelect)\n return\n\n if (props.mode === 'multiple') {\n const checkboxDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"checkbox\"]')\n if (checkboxDOM instanceof HTMLElement) {\n checkboxDOM.click()\n }\n }\n else {\n const radioDOM = (event.target as Element)\n .closest('tr')\n .querySelector('input[type=\"radio\"]')\n if (radioDOM instanceof HTMLElement) {\n radioDOM.click()\n }\n }\n}\n\nfunction onClearSelectionClick() {\n if (props.mode === 'multiple') {\n emit('update:modelValue', [])\n selectedFlatDataSource.value = []\n }\n else {\n syncRadioSelection(null)\n emit('update:modelValue', null)\n }\n}\n\nfunction selectable(row: Record<string, any>, index: number) {\n if (props.selectable && isFn(props.selectable)) {\n return props.selectable(row, index, field.value)\n }\n return true\n}\n</script>\n\n<template>\n <div :class=\"`${stylePrefix}-select-table`\">\n <div\n v-if=\"currentSelectLength > 0 && props.showAlertToolbar\"\n :class=\"`${stylePrefix}-select-table-alert-container`\"\n >\n <span>已选择 {{ currentSelectLength }} 项</span>\n <ElLink\n type=\"primary\"\n :underline=\"lt(version, '2.9.9') ? false : 'never'\"\n style=\"margin-left: 8px;\"\n @click=\"onClearSelectionClick\"\n >\n 取消选择\n </ElLink>\n </div>\n <ElTable\n ref=\"elTableRef\"\n v-loading=\"props.loading\"\n v-bind=\"elTableProps\"\n :row-key=\"rowKey\"\n :row-class-name=\"props.clickRowToSelect ? `--click-row-select` : ''\"\n :data=\"props.dataSource\"\n :highlight-current-row=\"props.mode === 'single'\"\n @select=\"onSelect\"\n @select-all=\"onSelect\"\n @row-click=\"onRowClick\"\n >\n <ElTableColumn\n v-if=\"props.mode === 'multiple'\"\n type=\"selection\"\n :selectable=\"selectable\"\n />\n <ElTableColumn\n v-else\n width=\"46\"\n >\n <template #default=\"{ row }\">\n <ElRadioGroup v-model=\"radioSelectedKey\" style=\"width: 100%;\">\n <ElRadio\n v-bind=\"compatibleRadioValue(row[rowKey])\"\n @change=\"() => onRadioClick(row)\"\n >\n \n </ElRadio>\n </ElRadioGroup>\n </template>\n </ElTableColumn>\n <template v-if=\"props.columns.length === 0\">\n <slot />\n </template>\n <template v-else>\n <ElTableColumn\n v-for=\"colItem of props.columns\"\n v-bind=\"colItem\"\n :key=\"colItem.prop || colItem.type\"\n />\n </template>\n </ElTable>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAYd,MAAM,OAAO;EAEb,MAAM,eAAe,UAAS;EAC9B,MAAM,QAAQ,UAAS;EACvB,MAAM,aAAa,KAAmB;EACtC,MAAM,mBAAmB,KAAI;EAE7B,SAAS,gBAAgB;AACvB,OAAI,CAAC,MAAM,OACT,OAAM,IAAI,MAAM,qBAAoB;AAEtC,UAAO,MAAM;;EAGf,SAAS,YAAY,MAAmC;AACtD,OAAI,CAAC,MAAM,UAAU,CAAC,KACpB;AAEF,UAAO,KAAK,MAAM;;EAGpB,SAAS,qBAAqB,O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AAqB,IAAI,QAAA,QAAM,EAAA,EACtC,gBAAc,aAAa,IAAG,EAAA,CAAA,EAAA;8BAGjC,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAFC,UAED,GAAA,CAAA,EAAA,CAAA;;;;;;SAIU,MAAM,QAAQ,WAAM,IAClC,WAAQ,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,IAAA,UAAA,KAAA,EAGR,mBAIE,UAAA,EAAA,KAAA,GAAA,EAAA,WAHkB,MAAM,UAAjB,YAAO;yBADhB,YAIE,MAAA,cAAA,EAJF,WAIE,EAAA,SAAA,MAAA,EAFQ,SAAO,EACd,KAAK,QAAQ,QAAQ,QAAQ,MAAA,CAAA,EAAA,MAAA,GAAA;;;;;;;;2BArCvB,MAAM,QAAO,CAAA,CAAA,CAAA,EAAA,EAAA"}
|
package/esm/slider/index.d.ts
CHANGED
|
@@ -1,185 +1,8 @@
|
|
|
1
|
-
import * as _$element_plus0 from "element-plus";
|
|
2
1
|
import { ElSlider } from "element-plus";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
|
-
import * as _$element_plus_es_utils_index_mjs0 from "element-plus/es/utils/index.mjs";
|
|
5
|
-
import * as _$element_plus_es_utils_typescript_mjs0 from "element-plus/es/utils/typescript.mjs";
|
|
6
2
|
|
|
7
3
|
//#region src/slider/index.d.ts
|
|
8
4
|
type SliderProps = typeof ElSlider;
|
|
9
|
-
declare const Slider:
|
|
10
|
-
readonly ariaLabel: StringConstructor;
|
|
11
|
-
readonly modelValue: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) | ((new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>))[], unknown, unknown, 0, boolean>;
|
|
12
|
-
readonly id: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
13
|
-
readonly min: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
14
|
-
readonly max: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
|
|
15
|
-
readonly step: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
16
|
-
readonly showInput: BooleanConstructor;
|
|
17
|
-
readonly showInputControls: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
18
|
-
readonly size: {
|
|
19
|
-
readonly type: _$vue.PropType<_$element_plus_es_utils_index_mjs0.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
20
|
-
readonly required: false;
|
|
21
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
22
|
-
__epPropKey: true;
|
|
23
|
-
};
|
|
24
|
-
readonly inputSize: {
|
|
25
|
-
readonly type: _$vue.PropType<_$element_plus_es_utils_index_mjs0.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
26
|
-
readonly required: false;
|
|
27
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
28
|
-
__epPropKey: true;
|
|
29
|
-
};
|
|
30
|
-
readonly showStops: BooleanConstructor;
|
|
31
|
-
readonly showTooltip: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
32
|
-
readonly formatTooltip: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => (val: number) => number | string) | (() => (val: number) => number | string) | {
|
|
33
|
-
(): (val: number) => number | string;
|
|
34
|
-
new (): any;
|
|
35
|
-
readonly prototype: any;
|
|
36
|
-
} | ((new (...args: any[]) => (val: number) => number | string) | (() => (val: number) => number | string) | {
|
|
37
|
-
(): (val: number) => number | string;
|
|
38
|
-
new (): any;
|
|
39
|
-
readonly prototype: any;
|
|
40
|
-
})[], unknown, unknown, undefined, boolean>;
|
|
41
|
-
readonly disabled: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
42
|
-
readonly range: BooleanConstructor;
|
|
43
|
-
readonly vertical: BooleanConstructor;
|
|
44
|
-
readonly height: StringConstructor;
|
|
45
|
-
readonly rangeStartLabel: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
46
|
-
readonly rangeEndLabel: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
47
|
-
readonly formatValueText: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => (val: number) => string) | (() => (val: number) => string) | {
|
|
48
|
-
(): (val: number) => string;
|
|
49
|
-
new (): any;
|
|
50
|
-
readonly prototype: any;
|
|
51
|
-
} | ((new (...args: any[]) => (val: number) => string) | (() => (val: number) => string) | {
|
|
52
|
-
(): (val: number) => string;
|
|
53
|
-
new (): any;
|
|
54
|
-
readonly prototype: any;
|
|
55
|
-
})[], unknown, unknown, undefined, boolean>;
|
|
56
|
-
readonly tooltipClass: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
57
|
-
readonly placement: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, _$element_plus0.Placement, unknown, "top", boolean>;
|
|
58
|
-
readonly marks: {
|
|
59
|
-
readonly type: _$vue.PropType<{
|
|
60
|
-
[x: number]: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(new (...args: any[]) => string | {
|
|
61
|
-
style: _$vue.CSSProperties;
|
|
62
|
-
label: any;
|
|
63
|
-
}) | (() => string | {
|
|
64
|
-
style: _$vue.CSSProperties;
|
|
65
|
-
label: any;
|
|
66
|
-
}) | ((new (...args: any[]) => string | {
|
|
67
|
-
style: _$vue.CSSProperties;
|
|
68
|
-
label: any;
|
|
69
|
-
}) | (() => string | {
|
|
70
|
-
style: _$vue.CSSProperties;
|
|
71
|
-
label: any;
|
|
72
|
-
}))[], unknown, unknown> | undefined;
|
|
73
|
-
}>;
|
|
74
|
-
readonly required: false;
|
|
75
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
76
|
-
__epPropKey: true;
|
|
77
|
-
};
|
|
78
|
-
readonly validateEvent: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
79
|
-
readonly persistent: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
80
|
-
}, {
|
|
81
|
-
onSliderClick: (event: MouseEvent | TouchEvent) => void;
|
|
82
|
-
}, unknown, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
83
|
-
"update:modelValue": (value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => void;
|
|
84
|
-
change: (value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => void;
|
|
85
|
-
input: (value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => void;
|
|
86
|
-
}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
87
|
-
readonly ariaLabel: StringConstructor;
|
|
88
|
-
readonly modelValue: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) | ((new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>))[], unknown, unknown, 0, boolean>;
|
|
89
|
-
readonly id: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
90
|
-
readonly min: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
91
|
-
readonly max: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
|
|
92
|
-
readonly step: _$element_plus_es_utils_index_mjs0.EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
93
|
-
readonly showInput: BooleanConstructor;
|
|
94
|
-
readonly showInputControls: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
95
|
-
readonly size: {
|
|
96
|
-
readonly type: _$vue.PropType<_$element_plus_es_utils_index_mjs0.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
97
|
-
readonly required: false;
|
|
98
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
99
|
-
__epPropKey: true;
|
|
100
|
-
};
|
|
101
|
-
readonly inputSize: {
|
|
102
|
-
readonly type: _$vue.PropType<_$element_plus_es_utils_index_mjs0.EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
103
|
-
readonly required: false;
|
|
104
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
105
|
-
__epPropKey: true;
|
|
106
|
-
};
|
|
107
|
-
readonly showStops: BooleanConstructor;
|
|
108
|
-
readonly showTooltip: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
109
|
-
readonly formatTooltip: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => (val: number) => number | string) | (() => (val: number) => number | string) | {
|
|
110
|
-
(): (val: number) => number | string;
|
|
111
|
-
new (): any;
|
|
112
|
-
readonly prototype: any;
|
|
113
|
-
} | ((new (...args: any[]) => (val: number) => number | string) | (() => (val: number) => number | string) | {
|
|
114
|
-
(): (val: number) => number | string;
|
|
115
|
-
new (): any;
|
|
116
|
-
readonly prototype: any;
|
|
117
|
-
})[], unknown, unknown, undefined, boolean>;
|
|
118
|
-
readonly disabled: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
119
|
-
readonly range: BooleanConstructor;
|
|
120
|
-
readonly vertical: BooleanConstructor;
|
|
121
|
-
readonly height: StringConstructor;
|
|
122
|
-
readonly rangeStartLabel: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
123
|
-
readonly rangeEndLabel: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
124
|
-
readonly formatValueText: _$element_plus_es_utils_index_mjs0.EpPropFinalized<(new (...args: any[]) => (val: number) => string) | (() => (val: number) => string) | {
|
|
125
|
-
(): (val: number) => string;
|
|
126
|
-
new (): any;
|
|
127
|
-
readonly prototype: any;
|
|
128
|
-
} | ((new (...args: any[]) => (val: number) => string) | (() => (val: number) => string) | {
|
|
129
|
-
(): (val: number) => string;
|
|
130
|
-
new (): any;
|
|
131
|
-
readonly prototype: any;
|
|
132
|
-
})[], unknown, unknown, undefined, boolean>;
|
|
133
|
-
readonly tooltipClass: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
134
|
-
readonly placement: _$element_plus_es_utils_index_mjs0.EpPropFinalized<StringConstructor, _$element_plus0.Placement, unknown, "top", boolean>;
|
|
135
|
-
readonly marks: {
|
|
136
|
-
readonly type: _$vue.PropType<{
|
|
137
|
-
[x: number]: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(new (...args: any[]) => string | {
|
|
138
|
-
style: _$vue.CSSProperties;
|
|
139
|
-
label: any;
|
|
140
|
-
}) | (() => string | {
|
|
141
|
-
style: _$vue.CSSProperties;
|
|
142
|
-
label: any;
|
|
143
|
-
}) | ((new (...args: any[]) => string | {
|
|
144
|
-
style: _$vue.CSSProperties;
|
|
145
|
-
label: any;
|
|
146
|
-
}) | (() => string | {
|
|
147
|
-
style: _$vue.CSSProperties;
|
|
148
|
-
label: any;
|
|
149
|
-
}))[], unknown, unknown> | undefined;
|
|
150
|
-
}>;
|
|
151
|
-
readonly required: false;
|
|
152
|
-
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
153
|
-
__epPropKey: true;
|
|
154
|
-
};
|
|
155
|
-
readonly validateEvent: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
156
|
-
readonly persistent: _$element_plus_es_utils_index_mjs0.EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
157
|
-
}>> & {
|
|
158
|
-
"onUpdate:modelValue"?: ((value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => any) | undefined;
|
|
159
|
-
onInput?: ((value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => any) | undefined;
|
|
160
|
-
onChange?: ((value: _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) => any) | undefined;
|
|
161
|
-
}, {
|
|
162
|
-
readonly disabled: _$element_plus_es_utils_index_mjs0.EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
163
|
-
readonly vertical: boolean;
|
|
164
|
-
readonly range: boolean;
|
|
165
|
-
readonly id: string;
|
|
166
|
-
readonly modelValue: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>) | ((new (...args: any[]) => number | number[]) | (() => _$element_plus_es_utils_typescript_mjs0.Arrayable<number>))[], unknown, unknown>;
|
|
167
|
-
readonly placement: _$element_plus_es_utils_index_mjs0.EpPropMergeType<StringConstructor, _$element_plus0.Placement, unknown>;
|
|
168
|
-
readonly min: number;
|
|
169
|
-
readonly max: number;
|
|
170
|
-
readonly validateEvent: _$element_plus_es_utils_index_mjs0.EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
171
|
-
readonly persistent: _$element_plus_es_utils_index_mjs0.EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
172
|
-
readonly step: number;
|
|
173
|
-
readonly showInputControls: _$element_plus_es_utils_index_mjs0.EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
174
|
-
readonly showTooltip: _$element_plus_es_utils_index_mjs0.EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
175
|
-
readonly formatTooltip: (val: number) => number | string;
|
|
176
|
-
readonly rangeStartLabel: string;
|
|
177
|
-
readonly rangeEndLabel: string;
|
|
178
|
-
readonly formatValueText: (val: number) => string;
|
|
179
|
-
readonly tooltipClass: string;
|
|
180
|
-
readonly showInput: boolean;
|
|
181
|
-
readonly showStops: boolean;
|
|
182
|
-
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>>;
|
|
5
|
+
declare const Slider: any;
|
|
183
6
|
//#endregion
|
|
184
7
|
export { Slider, SliderProps };
|
|
185
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit.mjs","names":["$attrs"],"sources":["../../src/submit/submit.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { IFormFeedback } from '@formily/core'\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@silver-formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FSubmit',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => any>,\n onSubmit: Function as PropType<(values: any) => Promise<any>>,\n onSubmitSuccess: Function as PropType<(payload: any) => void>,\n onSubmitFailed: Function as PropType<(feedbacks: IFormFeedback[]) => void>,\n submit: Boolean,\n loading: Boolean,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick?.(e) === false)\n return\n if (props.onSubmit) {\n const form = formRef?.value\n form?.submit(props.onSubmit)\n .then(props.onSubmitSuccess)\n .catch(props.onSubmitFailed ?? console.error)\n }\n}\n</script>\n\n<template>\n <ElButton\n :native-type=\"props.submit ? 'button' : 'submit'\"\n type=\"primary\"\n v-bind=\"$attrs\"\n :loading=\"formRef?.submitting ?? props.loading\"\n @click=\"handleClick\"\n >\n <template #default>\n <slot />\n </template>\n </ElButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EASd,MAAM,UAAU,eAAc;EAE9B,SAAS,YAAY,GAAe;AAClC,OAAI,MAAM,UAAU,EAAE,KAAK,MACzB;AACF,OAAI,MAAM,SAER,EADa,SAAS,QAChB,OAAO,MAAM,SAAQ,CACxB,KAAK,MAAM,gBAAe,CAC1B,MAAM,MAAM,kBAAkB,QAAQ,MAAK;;;uBAMhD,YAUW,MAAA,SAAA,EAVX,WAUW;IATR,eAAa,MAAM,SAAM,WAAA;IAC1B,MAAK;MACGA,KAAAA,QAAM;IACb,SAAS,MAAA,QAAO,EAAE,cAAc,MAAM;IACtC,SAAO;;IAEG,SAAO,cACR,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"submit.mjs","names":["$attrs"],"sources":["../../src/submit/submit.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { IFormFeedback } from '@silver-formily/core'\nimport type { PropType } from 'vue'\nimport { useParentForm } from '@silver-formily/vue'\nimport { ElButton } from 'element-plus'\n\ndefineOptions({\n name: 'FSubmit',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n onClick: Function as PropType<(e: MouseEvent) => any>,\n onSubmit: Function as PropType<(values: any) => Promise<any>>,\n onSubmitSuccess: Function as PropType<(payload: any) => void>,\n onSubmitFailed: Function as PropType<(feedbacks: IFormFeedback[]) => void>,\n submit: Boolean,\n loading: Boolean,\n})\n\nconst formRef = useParentForm()\n\nfunction handleClick(e: MouseEvent) {\n if (props.onClick?.(e) === false)\n return\n if (props.onSubmit) {\n const form = formRef?.value\n form?.submit(props.onSubmit)\n .then(props.onSubmitSuccess)\n .catch(props.onSubmitFailed ?? console.error)\n }\n}\n</script>\n\n<template>\n <ElButton\n :native-type=\"props.submit ? 'button' : 'submit'\"\n type=\"primary\"\n v-bind=\"$attrs\"\n :loading=\"formRef?.submitting ?? props.loading\"\n @click=\"handleClick\"\n >\n <template #default>\n <slot />\n </template>\n </ElButton>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EASd,MAAM,UAAU,eAAc;EAE9B,SAAS,YAAY,GAAe;AAClC,OAAI,MAAM,UAAU,EAAE,KAAK,MACzB;AACF,OAAI,MAAM,SAER,EADa,SAAS,QAChB,OAAO,MAAM,SAAQ,CACxB,KAAK,MAAM,gBAAe,CAC1B,MAAM,MAAM,kBAAkB,QAAQ,MAAK;;;uBAMhD,YAUW,MAAA,SAAA,EAVX,WAUW;IATR,eAAa,MAAM,SAAM,WAAA;IAC1B,MAAK;MACGA,KAAAA,QAAM;IACb,SAAS,MAAA,QAAO,EAAE,cAAc,MAAM;IACtC,SAAO;;IAEG,SAAO,cACR,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
|