ll-plus 2.2.11 → 2.2.13
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/es/components/advanced-filtering/index.d.ts +504 -504
- package/es/components/advanced-filtering/src/advanced-filtering.vue.d.ts +255 -255
- package/es/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +245 -245
- package/es/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +4 -4
- package/es/components/api-component/index.d.ts +6 -6
- package/es/components/api-component/src/api-component.vue.d.ts +6 -6
- package/es/components/api-component/src/components/api-modal.vue.d.ts +2 -2
- package/es/components/api-component/src/components/click-input.vue.d.ts +2 -2
- package/es/components/api-component/src/components/params-table-row.vue.d.ts +4 -4
- package/es/components/api-component/src/components/params-table.vue.d.ts +6 -6
- package/es/components/avatar/index.d.ts +4 -4
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +4 -4
- package/es/components/button/index.d.ts +2 -2
- package/es/components/button/src/button.vue.d.ts +2 -2
- package/es/components/cascader/index.d.ts +8 -8
- package/es/components/cascader/src/cascader.vue.d.ts +8 -8
- package/es/components/checkbox/index.d.ts +317 -317
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +317 -317
- package/es/components/checkbox/src/checkbox.d.ts +96 -96
- package/es/components/code-editor/index.d.ts +4 -4
- package/es/components/code-editor/src/code-editor.vue.d.ts +4 -4
- package/es/components/drawer/index.d.ts +11 -11
- package/es/components/drawer/src/components/second-confirmation/index.d.ts +11 -11
- package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +11 -11
- package/es/components/drawer/src/drawer.vue.d.ts +11 -11
- package/es/components/easy-cron/index.d.ts +86 -86
- package/es/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +79 -79
- package/es/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +79 -79
- package/es/components/easy-cron/src/easy-cron.vue.d.ts +86 -86
- package/es/components/form/index.d.ts +242 -242
- package/es/components/form/src/config/form.d.ts +96 -96
- package/es/components/form/src/form.vue.d.ts +242 -242
- package/es/components/icon-base/index.d.ts +1 -1
- package/es/components/icon-base/src/icon-base.vue.d.ts +1 -1
- package/es/components/input/index.d.ts +31 -31
- package/es/components/input/src/input.vue.d.ts +31 -31
- package/es/components/key-value/index.d.ts +29 -14
- package/es/components/key-value/src/components/key-value-item.vue.d.ts +16 -4
- package/es/components/key-value/src/components/key-value-item.vue2.mjs +5 -5
- package/es/components/key-value/src/components/key-value-item.vue2.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value-item.d.ts +10 -4
- package/es/components/key-value/src/config/key-value-item.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value.d.ts +3 -2
- package/es/components/key-value/src/config/key-value.mjs +3 -2
- package/es/components/key-value/src/config/key-value.mjs.map +1 -1
- package/es/components/key-value/src/key-value.vue.d.ts +29 -14
- package/es/components/key-value/src/key-value.vue2.mjs +14 -6
- package/es/components/key-value/src/key-value.vue2.mjs.map +1 -1
- package/es/components/modal/index.d.ts +6 -6
- package/es/components/modal/src/modal.vue.d.ts +6 -6
- package/es/components/number-range/index.d.ts +2 -2
- package/es/components/number-range/src/number-range.vue.d.ts +2 -2
- package/es/components/operate-icon/index.d.ts +3 -3
- package/es/components/operate-icon/src/operate-icon.vue.d.ts +3 -3
- package/es/components/radio/index.d.ts +10 -10
- package/es/components/radio/src/radio-group.vue.d.ts +5 -5
- package/es/components/radio/src/radio.vue.d.ts +5 -5
- package/es/components/select/index.d.ts +16 -16
- package/es/components/select/src/select-option.vue.d.ts +1 -1
- package/es/components/select/src/select.vue.d.ts +15 -15
- package/es/components/select-group/index.d.ts +1 -1
- package/es/components/select-group/src/select-group.vue.d.ts +1 -1
- package/es/components/textarea/index.d.ts +5 -5
- package/es/components/textarea/src/textarea.vue.d.ts +5 -5
- package/es/components/tooltip/index.d.ts +4 -4
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +4 -4
- package/es/components/tree/index.d.ts +2 -2
- package/es/components/tree/src/tree.vue.d.ts +2 -2
- package/es/components/tree-search/index.d.ts +9 -9
- package/es/components/tree-search/src/config/tree-search.d.ts +2 -2
- package/es/components/tree-search/src/tree-search.vue.d.ts +9 -9
- package/es/components/upload-drag/index.d.ts +8 -8
- package/es/components/upload-drag/src/upload-drag.vue.d.ts +8 -8
- package/index.full.js +22 -13
- package/index.full.min.js +1 -1
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +1 -1
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +22 -13
- package/lib/components/advanced-filtering/index.d.ts +504 -504
- package/lib/components/advanced-filtering/src/advanced-filtering.vue.d.ts +255 -255
- package/lib/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +245 -245
- package/lib/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +4 -4
- package/lib/components/api-component/index.d.ts +6 -6
- package/lib/components/api-component/src/api-component.vue.d.ts +6 -6
- package/lib/components/api-component/src/components/api-modal.vue.d.ts +2 -2
- package/lib/components/api-component/src/components/click-input.vue.d.ts +2 -2
- package/lib/components/api-component/src/components/params-table-row.vue.d.ts +4 -4
- package/lib/components/api-component/src/components/params-table.vue.d.ts +6 -6
- package/lib/components/avatar/index.d.ts +4 -4
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +4 -4
- package/lib/components/button/index.d.ts +2 -2
- package/lib/components/button/src/button.vue.d.ts +2 -2
- package/lib/components/cascader/index.d.ts +8 -8
- package/lib/components/cascader/src/cascader.vue.d.ts +8 -8
- package/lib/components/checkbox/index.d.ts +317 -317
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +317 -317
- package/lib/components/checkbox/src/checkbox.d.ts +96 -96
- package/lib/components/code-editor/index.d.ts +4 -4
- package/lib/components/code-editor/src/code-editor.vue.d.ts +4 -4
- package/lib/components/drawer/index.d.ts +11 -11
- package/lib/components/drawer/src/components/second-confirmation/index.d.ts +11 -11
- package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +11 -11
- package/lib/components/drawer/src/drawer.vue.d.ts +11 -11
- package/lib/components/easy-cron/index.d.ts +86 -86
- package/lib/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +79 -79
- package/lib/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +79 -79
- package/lib/components/easy-cron/src/easy-cron.vue.d.ts +86 -86
- package/lib/components/form/index.d.ts +242 -242
- package/lib/components/form/src/config/form.d.ts +96 -96
- package/lib/components/form/src/form.vue.d.ts +242 -242
- package/lib/components/icon-base/index.d.ts +1 -1
- package/lib/components/icon-base/src/icon-base.vue.d.ts +1 -1
- package/lib/components/input/index.d.ts +31 -31
- package/lib/components/input/src/input.vue.d.ts +31 -31
- package/lib/components/key-value/index.d.ts +29 -14
- package/lib/components/key-value/src/components/key-value-item.vue.d.ts +16 -4
- package/lib/components/key-value/src/components/key-value-item.vue2.js +5 -5
- package/lib/components/key-value/src/components/key-value-item.vue2.js.map +1 -1
- package/lib/components/key-value/src/config/key-value-item.d.ts +10 -4
- package/lib/components/key-value/src/config/key-value-item.js.map +1 -1
- package/lib/components/key-value/src/config/key-value.d.ts +3 -2
- package/lib/components/key-value/src/config/key-value.js +3 -2
- package/lib/components/key-value/src/config/key-value.js.map +1 -1
- package/lib/components/key-value/src/key-value.vue.d.ts +29 -14
- package/lib/components/key-value/src/key-value.vue2.js +14 -6
- package/lib/components/key-value/src/key-value.vue2.js.map +1 -1
- package/lib/components/modal/index.d.ts +6 -6
- package/lib/components/modal/src/modal.vue.d.ts +6 -6
- package/lib/components/number-range/index.d.ts +2 -2
- package/lib/components/number-range/src/number-range.vue.d.ts +2 -2
- package/lib/components/operate-icon/index.d.ts +3 -3
- package/lib/components/operate-icon/src/operate-icon.vue.d.ts +3 -3
- package/lib/components/radio/index.d.ts +10 -10
- package/lib/components/radio/src/radio-group.vue.d.ts +5 -5
- package/lib/components/radio/src/radio.vue.d.ts +5 -5
- package/lib/components/select/index.d.ts +16 -16
- package/lib/components/select/src/select-option.vue.d.ts +1 -1
- package/lib/components/select/src/select.vue.d.ts +15 -15
- package/lib/components/select-group/index.d.ts +1 -1
- package/lib/components/select-group/src/select-group.vue.d.ts +1 -1
- package/lib/components/textarea/index.d.ts +5 -5
- package/lib/components/textarea/src/textarea.vue.d.ts +5 -5
- package/lib/components/tooltip/index.d.ts +4 -4
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +4 -4
- package/lib/components/tree/index.d.ts +2 -2
- package/lib/components/tree/src/tree.vue.d.ts +2 -2
- package/lib/components/tree-search/index.d.ts +9 -9
- package/lib/components/tree-search/src/config/tree-search.d.ts +2 -2
- package/lib/components/tree-search/src/tree-search.vue.d.ts +9 -9
- package/lib/components/upload-drag/index.d.ts +8 -8
- package/lib/components/upload-drag/src/upload-drag.vue.d.ts +8 -8
- package/package.json +1 -1
- package/types/packages/components/advanced-filtering/index.d.ts +504 -504
- package/types/packages/components/advanced-filtering/src/advanced-filtering.vue.d.ts +255 -255
- package/types/packages/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +245 -245
- package/types/packages/components/advanced-filtering/src/components/advanced-filtering-tags.vue.d.ts +4 -4
- package/types/packages/components/api-component/index.d.ts +6 -6
- package/types/packages/components/api-component/src/api-component.vue.d.ts +6 -6
- package/types/packages/components/api-component/src/components/api-modal.vue.d.ts +2 -2
- package/types/packages/components/api-component/src/components/click-input.vue.d.ts +2 -2
- package/types/packages/components/api-component/src/components/params-table-row.vue.d.ts +4 -4
- package/types/packages/components/api-component/src/components/params-table.vue.d.ts +6 -6
- package/types/packages/components/avatar/index.d.ts +4 -4
- package/types/packages/components/avatar/src/avatar.d.ts +1 -1
- package/types/packages/components/avatar/src/avatar.vue.d.ts +4 -4
- package/types/packages/components/button/index.d.ts +2 -2
- package/types/packages/components/button/src/button.vue.d.ts +2 -2
- package/types/packages/components/cascader/index.d.ts +8 -8
- package/types/packages/components/cascader/src/cascader.vue.d.ts +8 -8
- package/types/packages/components/checkbox/index.d.ts +317 -317
- package/types/packages/components/checkbox/src/checkbox-group.vue.d.ts +317 -317
- package/types/packages/components/checkbox/src/checkbox.d.ts +96 -96
- package/types/packages/components/code-editor/index.d.ts +4 -4
- package/types/packages/components/code-editor/src/code-editor.vue.d.ts +4 -4
- package/types/packages/components/drawer/index.d.ts +11 -11
- package/types/packages/components/drawer/src/components/second-confirmation/index.d.ts +11 -11
- package/types/packages/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +11 -11
- package/types/packages/components/drawer/src/drawer.vue.d.ts +11 -11
- package/types/packages/components/easy-cron/index.d.ts +86 -86
- package/types/packages/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +79 -79
- package/types/packages/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +79 -79
- package/types/packages/components/easy-cron/src/easy-cron.vue.d.ts +86 -86
- package/types/packages/components/form/index.d.ts +242 -242
- package/types/packages/components/form/src/config/form.d.ts +96 -96
- package/types/packages/components/form/src/form.vue.d.ts +242 -242
- package/types/packages/components/icon-base/index.d.ts +1 -1
- package/types/packages/components/icon-base/src/icon-base.vue.d.ts +1 -1
- package/types/packages/components/input/index.d.ts +31 -31
- package/types/packages/components/input/src/input.vue.d.ts +31 -31
- package/types/packages/components/key-value/index.d.ts +29 -14
- package/types/packages/components/key-value/src/components/key-value-item.vue.d.ts +16 -4
- package/types/packages/components/key-value/src/config/key-value-item.d.ts +10 -4
- package/types/packages/components/key-value/src/config/key-value.d.ts +3 -2
- package/types/packages/components/key-value/src/key-value.vue.d.ts +29 -14
- package/types/packages/components/modal/index.d.ts +6 -6
- package/types/packages/components/modal/src/modal.vue.d.ts +6 -6
- package/types/packages/components/number-range/index.d.ts +2 -2
- package/types/packages/components/number-range/src/number-range.vue.d.ts +2 -2
- package/types/packages/components/operate-icon/index.d.ts +3 -3
- package/types/packages/components/operate-icon/src/operate-icon.vue.d.ts +3 -3
- package/types/packages/components/radio/index.d.ts +10 -10
- package/types/packages/components/radio/src/radio-group.vue.d.ts +5 -5
- package/types/packages/components/radio/src/radio.vue.d.ts +5 -5
- package/types/packages/components/select/index.d.ts +16 -16
- package/types/packages/components/select/src/select-option.vue.d.ts +1 -1
- package/types/packages/components/select/src/select.vue.d.ts +15 -15
- package/types/packages/components/select-group/index.d.ts +1 -1
- package/types/packages/components/select-group/src/select-group.vue.d.ts +1 -1
- package/types/packages/components/textarea/index.d.ts +5 -5
- package/types/packages/components/textarea/src/textarea.vue.d.ts +5 -5
- package/types/packages/components/tooltip/index.d.ts +4 -4
- package/types/packages/components/tooltip/src/tooltip.d.ts +1 -1
- package/types/packages/components/tooltip/src/tooltip.vue.d.ts +4 -4
- package/types/packages/components/tree/index.d.ts +2 -2
- package/types/packages/components/tree/src/tree.vue.d.ts +2 -2
- package/types/packages/components/tree-search/index.d.ts +9 -9
- package/types/packages/components/tree-search/src/config/tree-search.d.ts +2 -2
- package/types/packages/components/tree-search/src/tree-search.vue.d.ts +9 -9
- package/types/packages/components/upload-drag/index.d.ts +8 -8
- package/types/packages/components/upload-drag/src/upload-drag.vue.d.ts +8 -8
|
@@ -9,7 +9,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
9
9
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
10
10
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
11
11
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
12
|
-
readonly
|
|
12
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
13
13
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
14
14
|
(): any;
|
|
15
15
|
new (): any;
|
|
@@ -37,20 +37,21 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
37
37
|
}, boolean>;
|
|
38
38
|
}, {
|
|
39
39
|
props: import("@vue/shared").LooseRequired<{
|
|
40
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
41
|
-
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
42
40
|
readonly value: import("./src/config").KeyValueItem[];
|
|
41
|
+
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
43
42
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
44
43
|
readonly keyLabel: string;
|
|
45
44
|
readonly valueLabel: string;
|
|
46
45
|
readonly addText: string;
|
|
46
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
47
47
|
readonly keyType: any;
|
|
48
48
|
readonly keyTypes: import("./src/config").KeyType[];
|
|
49
49
|
readonly valueType: any;
|
|
50
50
|
readonly onChange?: ((value: import("./src/config").KeyValueItem[]) => any) | undefined;
|
|
51
51
|
readonly "onUpdate:value"?: ((value: import("./src/config").KeyValueItem[]) => any) | undefined;
|
|
52
|
+
readonly onAdd?: (() => any) | undefined;
|
|
52
53
|
} & {}>;
|
|
53
|
-
emits: ((event: "change", value: import("./src/config").KeyValueItem[]) => void) & ((event: "update:value", value: import("./src/config").KeyValueItem[]) => void);
|
|
54
|
+
emits: ((event: "add") => void) & ((event: "change", value: import("./src/config").KeyValueItem[]) => void) & ((event: "update:value", value: import("./src/config").KeyValueItem[]) => void);
|
|
54
55
|
bem: {
|
|
55
56
|
b: (blockSuffix?: string) => string;
|
|
56
57
|
e: (element?: string) => string;
|
|
@@ -61,17 +62,23 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
61
62
|
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
62
63
|
is: (name?: string) => string;
|
|
63
64
|
};
|
|
64
|
-
innerValue: import("vue").Ref<{
|
|
65
|
+
innerValue: import("vue").Ref<(Record<string, any> | {
|
|
65
66
|
key: string | null;
|
|
66
|
-
value:
|
|
67
|
-
}[]>;
|
|
67
|
+
value: any;
|
|
68
|
+
})[]>;
|
|
68
69
|
keyValueItems: import("vue").Ref<any[]>;
|
|
69
70
|
keyValueTypeDict: import("vue").ComputedRef<{}>;
|
|
70
71
|
handleAddItem: () => void;
|
|
71
72
|
handleDelete: (idx: number) => void;
|
|
72
73
|
handleChange: () => void;
|
|
73
74
|
keyValueItem: import("vue").DefineComponent<{
|
|
74
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
75
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
76
|
+
key: string | null;
|
|
77
|
+
value: any;
|
|
78
|
+
}) | (() => import("./src/config").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
79
|
+
key: string | null;
|
|
80
|
+
value: any;
|
|
81
|
+
}) | (() => import("./src/config").KeyValueItem))[], unknown, unknown, () => {
|
|
75
82
|
key: string;
|
|
76
83
|
value: string;
|
|
77
84
|
}, boolean>;
|
|
@@ -100,9 +107,9 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
100
107
|
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
101
108
|
is: (name?: string) => string;
|
|
102
109
|
};
|
|
103
|
-
innerValue: import("vue").Ref<{
|
|
110
|
+
innerValue: import("vue").Ref<Record<string, any> | {
|
|
104
111
|
key: string | null;
|
|
105
|
-
value:
|
|
112
|
+
value: any;
|
|
106
113
|
}>;
|
|
107
114
|
getKeyType: import("vue").ComputedRef<any>;
|
|
108
115
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -353,7 +360,13 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
353
360
|
change: () => boolean;
|
|
354
361
|
'update:value': (value: import("./src/config").KeyValueItem) => boolean;
|
|
355
362
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
356
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
363
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
364
|
+
key: string | null;
|
|
365
|
+
value: any;
|
|
366
|
+
}) | (() => import("./src/config").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
367
|
+
key: string | null;
|
|
368
|
+
value: any;
|
|
369
|
+
}) | (() => import("./src/config").KeyValueItem))[], unknown, unknown, () => {
|
|
357
370
|
key: string;
|
|
358
371
|
value: string;
|
|
359
372
|
}, boolean>;
|
|
@@ -370,6 +383,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
370
383
|
}, {}>;
|
|
371
384
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
372
385
|
change: (value: import("./src/config").KeyValueItem[]) => boolean;
|
|
386
|
+
add: () => boolean;
|
|
373
387
|
'update:value': (value: import("./src/config").KeyValueItem[]) => boolean;
|
|
374
388
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
375
389
|
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("./src/config").KeyValueItem[]) | (() => import("./src/config").KeyValueItem[]) | ((new (...args: any[]) => import("./src/config").KeyValueItem[]) | (() => import("./src/config").KeyValueItem[]))[], unknown, unknown, () => {
|
|
@@ -381,7 +395,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
381
395
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
382
396
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
383
397
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
384
|
-
readonly
|
|
398
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
385
399
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
386
400
|
(): any;
|
|
387
401
|
new (): any;
|
|
@@ -410,14 +424,15 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
410
424
|
}>> & {
|
|
411
425
|
onChange?: ((value: import("./src/config").KeyValueItem[]) => any) | undefined;
|
|
412
426
|
"onUpdate:value"?: ((value: import("./src/config").KeyValueItem[]) => any) | undefined;
|
|
427
|
+
onAdd?: (() => any) | undefined;
|
|
413
428
|
}, {
|
|
414
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
415
|
-
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
416
429
|
readonly value: import("./src/config").KeyValueItem[];
|
|
430
|
+
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
417
431
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
418
432
|
readonly keyLabel: string;
|
|
419
433
|
readonly valueLabel: string;
|
|
420
434
|
readonly addText: string;
|
|
435
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
421
436
|
readonly keyType: any;
|
|
422
437
|
readonly keyTypes: import("./src/config").KeyType[];
|
|
423
438
|
readonly valueType: any;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
2
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
3
|
+
key: string | null;
|
|
4
|
+
value: any;
|
|
5
|
+
}) | (() => import("ll-plus/es/components").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
6
|
+
key: string | null;
|
|
7
|
+
value: any;
|
|
8
|
+
}) | (() => import("ll-plus/es/components").KeyValueItem))[], unknown, unknown, () => {
|
|
3
9
|
key: string;
|
|
4
10
|
value: string;
|
|
5
11
|
}, boolean>;
|
|
@@ -28,9 +34,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
34
|
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
29
35
|
is: (name?: string) => string;
|
|
30
36
|
};
|
|
31
|
-
innerValue: import("vue").Ref<{
|
|
37
|
+
innerValue: import("vue").Ref<Record<string, any> | {
|
|
32
38
|
key: string | null;
|
|
33
|
-
value:
|
|
39
|
+
value: any;
|
|
34
40
|
}>;
|
|
35
41
|
getKeyType: import("vue").ComputedRef<any>;
|
|
36
42
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -281,7 +287,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
281
287
|
change: () => boolean;
|
|
282
288
|
'update:value': (value: import("ll-plus/es/components").KeyValueItem) => boolean;
|
|
283
289
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
284
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
290
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
291
|
+
key: string | null;
|
|
292
|
+
value: any;
|
|
293
|
+
}) | (() => import("ll-plus/es/components").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
294
|
+
key: string | null;
|
|
295
|
+
value: any;
|
|
296
|
+
}) | (() => import("ll-plus/es/components").KeyValueItem))[], unknown, unknown, () => {
|
|
285
297
|
key: string;
|
|
286
298
|
value: string;
|
|
287
299
|
}, boolean>;
|
|
@@ -75,7 +75,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
75
|
class: normalizeClass(unref(bem).e("item"))
|
|
76
76
|
},
|
|
77
77
|
[
|
|
78
|
-
unref(attrs)
|
|
78
|
+
unref(attrs)["key-value-type"] !== "single" ? (openBlock(), createElementBlock(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
key: 0,
|
|
@@ -103,8 +103,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
103
|
onChange: handleChange
|
|
104
104
|
}, null, 8, ["value", "options", "disabled"])) : (openBlock(), createBlock(resolveDynamicComponent(`ll-${getKeyType.value.type}`), mergeProps({
|
|
105
105
|
key: 1,
|
|
106
|
-
value: innerValue.value["
|
|
107
|
-
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["
|
|
106
|
+
value: innerValue.value["key"],
|
|
107
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["key"] = $event),
|
|
108
108
|
disabled: unref(attrs).disabled
|
|
109
109
|
}, getKeyType.value, {
|
|
110
110
|
style: { "width": "100%" },
|
|
@@ -131,7 +131,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
131
131
|
2
|
|
132
132
|
/* CLASS */
|
|
133
133
|
)) : createCommentVNode("v-if", true),
|
|
134
|
-
unref(attrs)
|
|
134
|
+
unref(attrs)["key-value-type"] !== "single" ? (openBlock(), createElementBlock(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
137
137
|
key: 1,
|
|
@@ -211,7 +211,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
211
211
|
},
|
|
212
212
|
[
|
|
213
213
|
createVNode(_component_ll_button, {
|
|
214
|
-
type: "
|
|
214
|
+
type: "link",
|
|
215
215
|
disabled: unref(attrs).disabled
|
|
216
216
|
}, {
|
|
217
217
|
default: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"form\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div
|
|
1
|
+
{"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"form\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div\n v-if=\"attrs['key-value-type'] !== 'single'\"\n :class=\"bem.m('left')\"\n >\n <ll-form-item\n :label=\"attrs['key-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getKeyType.role\"\n name=\"key\"\n >\n <slot name=\"key\">\n <ll-select\n v-if=\"!isEmpty(attrs['key-types'])\"\n v-model:value=\"innerValue['key']\"\n :options=\"attrs['key-types']\"\n :disabled=\"attrs.disabled\"\n placeholder=\"请选择\"\n allow-clear\n @change=\"handleChange\"\n />\n <component\n :is=\"`ll-${getKeyType.type}`\"\n v-else\n v-model:value=\"innerValue['key']\"\n :disabled=\"attrs.disabled\"\n v-bind=\"getKeyType\"\n style=\"width: 100%\"\n @change=\"handleChange\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"key\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <div\n v-if=\"attrs['key-value-type'] !== 'single'\"\n :class=\"bem.m('separator')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <slot name=\"separator\">~</slot>\n </div>\n\n <div :class=\"bem.m('right')\">\n <ll-form-item\n :label=\"attrs['value-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rule=\"getValueType.rule || {}\"\n name=\"value\"\n >\n <slot name=\"value-warapper\" v-bind=\"getValueType\">\n <component\n :is=\"`ll-${getValueType.type}`\"\n v-model:value=\"innerValue['value']\"\n :disabled=\"attrs.disabled\"\n style=\"width: 100%\"\n v-bind=\"getValueType\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"value\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <a-popconfirm\n title=\"你确定要移除?\"\n ok-text=\"确认\"\n cancel-text=\"取消\"\n placement=\"topRight\"\n :overlay-class-name=\"bem.m('popconfirm')\"\n @confirm=\"handleDelete\"\n >\n <div\n v-if=\"props.showDelete\"\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label']\n ? '26px'\n : '0px'\n }\"\n >\n <ll-button type=\"link\" :disabled=\"attrs.disabled\">\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </a-popconfirm>\n </div>\n </template>\n </template>\n </ll-form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport {\n typeRules,\n keyValueItemProps,\n keyValueItemEmits,\n formColumns,\n formOptions\n} from '../config'\nimport { type FormColumn } from '@ll-plus/components'\n\ndefineOptions({\n name: 'LlKeyValueItem'\n})\n\nconst props = defineProps(keyValueItemProps)\nconst emits = defineEmits(keyValueItemEmits)\n\nconst attrs = useAttrs()\nconst bem = createNamespace('key-value')\nconst innerValue = ref(props.value)\n\nconst getKeyType = computed<FormColumn>(() => {\n const option = attrs['key-type'] || {\n type: 'input',\n placeholder: '请输入',\n rule: typeRules || []\n }\n return option\n})\nconst getValueType = computed<FormColumn>(() => {\n let option = attrs['value-type'] || {\n type: 'input',\n placeholder: '请输入',\n rule: []\n }\n if (innerValue.value['key'] && !isEmpty(props.keyValueTypeDict)) {\n option = props.keyValueTypeDict[innerValue.value['key']]\n }\n return option\n})\n\nconst handleDelete = () => {\n emits('delete')\n}\n\nconst handleChange = () => {\n innerValue.value['value'] = ''\n}\n\nwatch(\n innerValue,\n val => {\n emits('update:value', val)\n emits('change')\n },\n {\n deep: true\n }\n)\n</script>\n\n<style scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqJA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;AACvC,IAAM,MAAA,UAAA,GAAa,GAAI,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAElC,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -233,12 +233,18 @@ export declare const formColumns: {
|
|
|
233
233
|
span: number;
|
|
234
234
|
};
|
|
235
235
|
}[];
|
|
236
|
-
export
|
|
236
|
+
export type KeyValueItem = {
|
|
237
237
|
key: string | null;
|
|
238
|
-
value:
|
|
239
|
-
}
|
|
238
|
+
value: any | null;
|
|
239
|
+
} | Record<string, any>;
|
|
240
240
|
export declare const keyValueItemProps: {
|
|
241
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
241
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
242
|
+
key: string | null;
|
|
243
|
+
value: any | null;
|
|
244
|
+
}) | (() => KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
245
|
+
key: string | null;
|
|
246
|
+
value: any | null;
|
|
247
|
+
}) | (() => KeyValueItem))[], unknown, unknown, () => {
|
|
242
248
|
key: string;
|
|
243
249
|
value: string;
|
|
244
250
|
}, boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-item.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\n\nexport const typeRules = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any) => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\nexport const formOptions = {\n layout: 'horizontal',\n labelAlign: 'left'\n} as FormProps\n\nexport const formColumns = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\nexport
|
|
1
|
+
{"version":3,"file":"key-value-item.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\n\nexport const typeRules = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any) => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\nexport const formOptions = {\n layout: 'horizontal',\n labelAlign: 'left'\n} as FormProps\n\nexport const formColumns = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\nexport type KeyValueItem =\n | {\n key: string | null\n value: any | null\n }\n | Record<string, any>\nexport const keyValueItemProps = buildProps({\n value: {\n type: definePropType<KeyValueItem>(Object),\n default: () => ({\n key: '',\n value: ''\n })\n },\n keyValueTypeDict: {\n type: Object,\n default: () => ({})\n },\n showDelete: {\n type: Boolean,\n default: true\n }\n} as const)\n\nexport const keyValueItemEmits = {\n delete: () => true,\n change: () => true,\n 'update:value': (value: KeyValueItem) => !!value\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,SAAY,GAAA;AAAA,EACvB;AAAA,IACE,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,IAC1B,OAAS,EAAA,4CAAA;AAAA,IACT,SAAA,EAAW,OAAO,KAAA,EAAY,KAAe,KAAA;AAC3C,MAAA,IAAI,CAAC,KAAO,EAAA;AACV,QAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,4CAAS,CAAC,CAAA,CAAA;AAAA,OACrC,MAAA;AACL,QAAA,OAAO,QAAQ,OAAQ,EAAA,CAAA;AAAA,OACzB;AAAA,KACF;AAAA,GACF;AACF,EAAA;AACO,MAAM,WAAc,GAAA;AAAA,EACzB,MAAQ,EAAA,YAAA;AAAA,EACR,UAAY,EAAA,MAAA;AACd,EAAA;AAEO,MAAM,WAAc,GAAA;AAAA,EACzB;AAAA,IACE,GAAK,EAAA,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,EAAA;AAAA,KACR;AAAA,GACF;AACF,EAAA;AAQO,MAAM,oBAAoB,UAAW,CAAA;AAAA,EAC1C,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA6B,MAAM,CAAA;AAAA,IACzC,SAAS,OAAO;AAAA,MACd,GAAK,EAAA,EAAA;AAAA,MACL,KAAO,EAAA,EAAA;AAAA,KACT,CAAA;AAAA,GACF;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU,EAAA;AAEH,MAAM,iBAAoB,GAAA;AAAA,EAC/B,QAAQ,MAAM,IAAA;AAAA,EACd,QAAQ,MAAM,IAAA;AAAA,EACd,cAAgB,EAAA,CAAC,KAAwB,KAAA,CAAC,CAAC,KAAA;AAC7C;;;;"}
|
|
@@ -7,7 +7,7 @@ export interface KeyType {
|
|
|
7
7
|
value: string;
|
|
8
8
|
option: FormColumn;
|
|
9
9
|
}
|
|
10
|
-
type
|
|
10
|
+
type KeyValueType = 'single' | 'doubt';
|
|
11
11
|
export declare const getKeyValueItem: () => {
|
|
12
12
|
key: null;
|
|
13
13
|
value: null;
|
|
@@ -22,7 +22,7 @@ export declare const keyValueProps: {
|
|
|
22
22
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
23
23
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
24
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
25
|
-
readonly
|
|
25
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => KeyValueType) | ((new (...args: any[]) => "single" | "doubt") | (() => KeyValueType))[], unknown, unknown, "doubt", boolean>;
|
|
26
26
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
27
27
|
(): any;
|
|
28
28
|
new (): any;
|
|
@@ -51,6 +51,7 @@ export declare const keyValueProps: {
|
|
|
51
51
|
};
|
|
52
52
|
export declare const keyValueEmits: {
|
|
53
53
|
change: (value: KeyValueItem[]) => boolean;
|
|
54
|
+
add: () => boolean;
|
|
54
55
|
'update:value': (value: KeyValueItem[]) => boolean;
|
|
55
56
|
};
|
|
56
57
|
export type KeyValueProps = ExtractPropTypes<typeof keyValueProps>;
|
|
@@ -31,7 +31,7 @@ const keyValueProps = buildProps({
|
|
|
31
31
|
type: String,
|
|
32
32
|
default: "\u6DFB\u52A0"
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
keyValueType: {
|
|
35
35
|
type: definePropType(String),
|
|
36
36
|
default: "doubt"
|
|
37
37
|
},
|
|
@@ -39,7 +39,7 @@ const keyValueProps = buildProps({
|
|
|
39
39
|
type: definePropType(Object),
|
|
40
40
|
default: () => ({
|
|
41
41
|
type: "input",
|
|
42
|
-
placeholder: "\u8BF7\u8F93\
|
|
42
|
+
placeholder: "\u8BF7\u8F93\u5165value"
|
|
43
43
|
})
|
|
44
44
|
},
|
|
45
45
|
keyTypes: {
|
|
@@ -56,6 +56,7 @@ const keyValueProps = buildProps({
|
|
|
56
56
|
});
|
|
57
57
|
const keyValueEmits = {
|
|
58
58
|
change: (value) => !!value,
|
|
59
|
+
add: () => true,
|
|
59
60
|
"update:value": (value) => !!value
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { KeyValueItem } from './key-value-item'\nimport type KeyValue from '../key-value.vue'\n\nexport interface KeyType {\n label: string\n value: string\n option: FormColumn\n}\n\ntype
|
|
1
|
+
{"version":3,"file":"key-value.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { KeyValueItem } from './key-value-item'\nimport type KeyValue from '../key-value.vue'\n\nexport interface KeyType {\n label: string\n value: string\n option: FormColumn\n}\n\ntype KeyValueType = 'single' | 'doubt'\n\nexport const getKeyValueItem = () => ({\n key: null,\n value: null\n})\n\nexport const keyValueProps = buildProps({\n value: {\n type: definePropType<KeyValueItem[]>(Array),\n default: () => [{ key: '', value: '' }]\n },\n loading: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n keyLabel: {\n type: String,\n default: ''\n },\n valueLabel: {\n type: String,\n default: ''\n },\n addText: {\n type: String,\n default: '添加'\n },\n keyValueType: {\n type: definePropType<KeyValueType>(String),\n default: 'doubt'\n },\n keyType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入value'\n })\n },\n keyTypes: {\n type: definePropType<KeyType[]>(Array),\n default: () => []\n },\n valueType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入key'\n })\n }\n} as const)\n\nexport const keyValueEmits = {\n change: (value: KeyValueItem[]) => !!value,\n add: () => true,\n 'update:value': (value: KeyValueItem[]) => !!value\n}\n\n// props\nexport type KeyValueProps = ExtractPropTypes<typeof keyValueProps>\n// emits\nexport type KeyValueEmits = typeof keyValueEmits\n// instance\nexport type KeyValueInstance = InstanceType<typeof KeyValue>\n"],"names":[],"mappings":";;;;AAeO,MAAM,kBAA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d,IAAM,EAAA,OAAA;AAAA,MACN,WAAa,EAAA,uBAAA;AAAA,KACf,CAAA;AAAA,GACF;AACF,CAAU,EAAA;AAEH,MAAM,aAAgB,GAAA;AAAA,EAC3B,MAAQ,EAAA,CAAC,KAA0B,KAAA,CAAC,CAAC,KAAA;AAAA,EACrC,KAAK,MAAM,IAAA;AAAA,EACX,cAAgB,EAAA,CAAC,KAA0B,KAAA,CAAC,CAAC,KAAA;AAC/C;;;;"}
|
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
9
9
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
10
10
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
11
|
-
readonly
|
|
11
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
12
12
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
13
13
|
(): any;
|
|
14
14
|
new (): any;
|
|
@@ -36,20 +36,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
}, boolean>;
|
|
37
37
|
}, {
|
|
38
38
|
props: import("@vue/shared").LooseRequired<{
|
|
39
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
40
|
-
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
41
39
|
readonly value: import("./config").KeyValueItem[];
|
|
40
|
+
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
42
41
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
43
42
|
readonly keyLabel: string;
|
|
44
43
|
readonly valueLabel: string;
|
|
45
44
|
readonly addText: string;
|
|
45
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
46
46
|
readonly keyType: any;
|
|
47
47
|
readonly keyTypes: import("./config").KeyType[];
|
|
48
48
|
readonly valueType: any;
|
|
49
49
|
readonly onChange?: ((value: import("./config").KeyValueItem[]) => any) | undefined;
|
|
50
50
|
readonly "onUpdate:value"?: ((value: import("./config").KeyValueItem[]) => any) | undefined;
|
|
51
|
+
readonly onAdd?: (() => any) | undefined;
|
|
51
52
|
} & {}>;
|
|
52
|
-
emits: ((event: "change", value: import("./config").KeyValueItem[]) => void) & ((event: "update:value", value: import("./config").KeyValueItem[]) => void);
|
|
53
|
+
emits: ((event: "add") => void) & ((event: "change", value: import("./config").KeyValueItem[]) => void) & ((event: "update:value", value: import("./config").KeyValueItem[]) => void);
|
|
53
54
|
bem: {
|
|
54
55
|
b: (blockSuffix?: string) => string;
|
|
55
56
|
e: (element?: string) => string;
|
|
@@ -60,17 +61,23 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
60
61
|
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
61
62
|
is: (name?: string) => string;
|
|
62
63
|
};
|
|
63
|
-
innerValue: import("vue").Ref<{
|
|
64
|
+
innerValue: import("vue").Ref<(Record<string, any> | {
|
|
64
65
|
key: string | null;
|
|
65
|
-
value:
|
|
66
|
-
}[]>;
|
|
66
|
+
value: any;
|
|
67
|
+
})[]>;
|
|
67
68
|
keyValueItems: import("vue").Ref<any[]>;
|
|
68
69
|
keyValueTypeDict: import("vue").ComputedRef<{}>;
|
|
69
70
|
handleAddItem: () => void;
|
|
70
71
|
handleDelete: (idx: number) => void;
|
|
71
72
|
handleChange: () => void;
|
|
72
73
|
keyValueItem: import("vue").DefineComponent<{
|
|
73
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
74
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
75
|
+
key: string | null;
|
|
76
|
+
value: any;
|
|
77
|
+
}) | (() => import("./config").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
78
|
+
key: string | null;
|
|
79
|
+
value: any;
|
|
80
|
+
}) | (() => import("./config").KeyValueItem))[], unknown, unknown, () => {
|
|
74
81
|
key: string;
|
|
75
82
|
value: string;
|
|
76
83
|
}, boolean>;
|
|
@@ -99,9 +106,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
106
|
bem: (blockSuffix: string, element: string, modifier: string) => string;
|
|
100
107
|
is: (name?: string) => string;
|
|
101
108
|
};
|
|
102
|
-
innerValue: import("vue").Ref<{
|
|
109
|
+
innerValue: import("vue").Ref<Record<string, any> | {
|
|
103
110
|
key: string | null;
|
|
104
|
-
value:
|
|
111
|
+
value: any;
|
|
105
112
|
}>;
|
|
106
113
|
getKeyType: import("vue").ComputedRef<any>;
|
|
107
114
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -352,7 +359,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
352
359
|
change: () => boolean;
|
|
353
360
|
'update:value': (value: import("./config").KeyValueItem) => boolean;
|
|
354
361
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
355
|
-
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) =>
|
|
362
|
+
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => Record<string, any> | {
|
|
363
|
+
key: string | null;
|
|
364
|
+
value: any;
|
|
365
|
+
}) | (() => import("./config").KeyValueItem) | ((new (...args: any[]) => Record<string, any> | {
|
|
366
|
+
key: string | null;
|
|
367
|
+
value: any;
|
|
368
|
+
}) | (() => import("./config").KeyValueItem))[], unknown, unknown, () => {
|
|
356
369
|
key: string;
|
|
357
370
|
value: string;
|
|
358
371
|
}, boolean>;
|
|
@@ -369,6 +382,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
369
382
|
}, {}>;
|
|
370
383
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
371
384
|
change: (value: import("./config").KeyValueItem[]) => boolean;
|
|
385
|
+
add: () => boolean;
|
|
372
386
|
'update:value': (value: import("./config").KeyValueItem[]) => boolean;
|
|
373
387
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
374
388
|
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("./config").KeyValueItem[]) | (() => import("./config").KeyValueItem[]) | ((new (...args: any[]) => import("./config").KeyValueItem[]) | (() => import("./config").KeyValueItem[]))[], unknown, unknown, () => {
|
|
@@ -380,7 +394,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
380
394
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
381
395
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
382
396
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
383
|
-
readonly
|
|
397
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
384
398
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
385
399
|
(): any;
|
|
386
400
|
new (): any;
|
|
@@ -409,14 +423,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
409
423
|
}>> & {
|
|
410
424
|
onChange?: ((value: import("./config").KeyValueItem[]) => any) | undefined;
|
|
411
425
|
"onUpdate:value"?: ((value: import("./config").KeyValueItem[]) => any) | undefined;
|
|
426
|
+
onAdd?: (() => any) | undefined;
|
|
412
427
|
}, {
|
|
413
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
414
|
-
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
415
428
|
readonly value: import("./config").KeyValueItem[];
|
|
429
|
+
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
416
430
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
417
431
|
readonly keyLabel: string;
|
|
418
432
|
readonly valueLabel: string;
|
|
419
433
|
readonly addText: string;
|
|
434
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
420
435
|
readonly keyType: any;
|
|
421
436
|
readonly keyTypes: import("./config").KeyType[];
|
|
422
437
|
readonly valueType: any;
|
|
@@ -28,6 +28,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
});
|
|
29
29
|
const handleAddItem = () => {
|
|
30
30
|
innerValue.value.push(getKeyValueItem());
|
|
31
|
+
emits("add");
|
|
31
32
|
};
|
|
32
33
|
const handleDelete = (idx) => {
|
|
33
34
|
innerValue.value.splice(idx, 1);
|
|
@@ -36,9 +37,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
37
|
emits("change", innerValue.value);
|
|
37
38
|
emits("update:value", innerValue.value);
|
|
38
39
|
};
|
|
39
|
-
watch(
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
watch(
|
|
41
|
+
() => props.value,
|
|
42
|
+
(n) => {
|
|
43
|
+
innerValue.value = n && n.length > 0 ? n : [{ key: null, value: null }];
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
immediate: true
|
|
47
|
+
}
|
|
48
|
+
);
|
|
42
49
|
return (_ctx, _cache) => {
|
|
43
50
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
44
51
|
const _component_ll_button = resolveComponent("ll-button");
|
|
@@ -61,12 +68,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
68
|
key: idx,
|
|
62
69
|
ref_for: true,
|
|
63
70
|
ref: (el) => keyValueItems.value[idx] = el,
|
|
64
|
-
value:
|
|
71
|
+
value: innerValue.value[idx],
|
|
72
|
+
"onUpdate:value": ($event) => innerValue.value[idx] = $event,
|
|
65
73
|
"key-label": props.keyLabel,
|
|
66
74
|
"value-label": props.valueLabel,
|
|
67
75
|
"key-value-type-dict": keyValueTypeDict.value,
|
|
68
76
|
"show-delete": idx > 0,
|
|
69
|
-
type: props.
|
|
77
|
+
"key-value-type": props.keyValueType,
|
|
70
78
|
"key-type": props.keyType,
|
|
71
79
|
"key-types": props.keyTypes,
|
|
72
80
|
"value-type": props.valueType,
|
|
@@ -85,7 +93,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
85
93
|
])
|
|
86
94
|
};
|
|
87
95
|
})
|
|
88
|
-
]), 1032, ["value", "key-label", "value-label", "key-value-type-dict", "show-delete", "type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
96
|
+
]), 1032, ["value", "onUpdate:value", "key-label", "value-label", "key-value-type-dict", "show-delete", "key-value-type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
89
97
|
}),
|
|
90
98
|
128
|
|
91
99
|
/* KEYED_FRAGMENT */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value.vue2.mjs","sources":["../../../../../packages/components/key-value/src/key-value.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <key-value-item\n v-for=\"(_item, idx) in innerValue\"\n :key=\"idx\"\n :ref=\"el => (keyValueItems[idx] = el)\"\n :value=\"
|
|
1
|
+
{"version":3,"file":"key-value.vue2.mjs","sources":["../../../../../packages/components/key-value/src/key-value.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <key-value-item\n v-for=\"(_item, idx) in innerValue\"\n :key=\"idx\"\n :ref=\"el => (keyValueItems[idx] = el)\"\n v-model:value=\"innerValue[idx]\"\n :key-label=\"props.keyLabel\"\n :value-label=\"props.valueLabel\"\n :key-value-type-dict=\"keyValueTypeDict\"\n :show-delete=\"idx > 0\"\n :key-value-type=\"props.keyValueType\"\n :key-type=\"props.keyType\"\n :key-types=\"props.keyTypes\"\n :value-type=\"props.valueType\"\n :disabled=\"props.disabled\"\n @delete=\"handleDelete(idx)\"\n @change=\"handleChange\"\n >\n <template\n v-for=\"item in Object.keys($slots)\"\n :key=\"item\"\n #[item]=\"data\"\n >\n <slot :name=\"item\" v-bind=\"data || {}\" :index=\"idx\"></slot>\n </template>\n </key-value-item>\n <ll-button\n :class=\"bem.e('add')\"\n :loading=\"loading\"\n :disabled=\"props.disabled\"\n @click=\"handleAddItem\"\n >\n <div :class=\"bem.e('plus')\">\n <ll-icon\n v-if=\"!loading\"\n icon-name=\"icon-add\"\n :class=\"bem.e('icon-add')\"\n />\n {{ props.addText }}\n </div>\n </ll-button>\n </a-spin>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\n// import { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport {\n keyValueProps,\n keyValueEmits,\n getKeyValueItem\n // type KeyValueItem\n} from './config'\nimport keyValueItem from './components/key-value-item.vue'\ndefineOptions({ name: 'LlKeyValue' })\nconst props = defineProps(keyValueProps)\nconst emits = defineEmits(keyValueEmits)\nconst bem = createNamespace('key-value')\nconst innerValue = ref(\n props.value && props.value.length > 0\n ? props.value\n : [{ key: null, value: null }]\n)\nconst keyValueItems = ref<any[]>([])\n\nconst keyValueTypeDict = computed(() => {\n const obj = {}\n props.keyTypes.map(e => {\n obj[e.value] = e.option\n })\n return obj\n})\n\n// const getValueType = computed(() => {\n// let type = 'object'\n// if (!isEmpty(props.value)) {\n// if (Array.isArray(props.value)) {\n// type = `${type}-${\n// typeof props.value[0] === 'object' ? 'object' : 'string'\n// }`\n// }\n// }\n// return type\n// })\n\n// const getKeyValueType = computed(() => {\n// return props.keyValueType\n// ? props.keyValueType\n// : props.keyValueType === 'array-string'\n// ? 'single'\n// : 'doubt'\n// })\n\nconst handleAddItem = () => {\n innerValue.value.push(getKeyValueItem())\n emits('add')\n}\n\nconst handleDelete = (idx: number) => {\n innerValue.value.splice(idx, 1)\n}\n\nconst handleChange = () => {\n // let value: any = null\n // switch (getValueType.value) {\n // case 'object':\n // value = {}\n // innerValue.value.map(e => {\n // console.log({ e })\n // if (e.key) {\n // value[e.key] = e.value\n // } else {\n // value[`${new Date().getTime()}-empty-key`] = e.value\n // }\n // })\n\n // break\n // case 'array-string':\n // value = []\n // innerValue.value.map(e => {\n // if (e.value) {\n // value.push(e.value)\n // }\n // })\n // break\n // default:\n // value = innerValue.value\n // break\n // }\n\n emits('change', innerValue.value)\n emits('update:value', innerValue.value)\n}\n\nwatch(\n () => props.value,\n n => {\n // let arr = [] as KeyValueItem[]\n // console.log(getValueType.value)\n // switch (getValueType.value) {\n // case 'object':\n // for (const i in n) {\n // arr.push({ key: i, value: n[i] })\n // }\n // break\n // case 'array-string':\n // arr = n.map(e => {\n // return { key: null, value: e }\n // })\n // break\n // default:\n // arr = [...n]\n // break\n // }\n\n innerValue.value = n && n.length > 0 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