@silver-formily/element-plus 0.0.1-beta.0 → 1.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__/configs/index.d.ts +1 -0
- package/esm/__builtins__/configs/index.mjs +5 -0
- package/esm/__builtins__/configs/index.mjs.map +1 -0
- package/esm/__builtins__/index.d.ts +2 -0
- package/esm/__builtins__/index.mjs +27 -0
- package/esm/__builtins__/index.mjs.map +1 -0
- package/esm/__builtins__/shared/hooks.d.ts +7 -0
- package/esm/__builtins__/shared/hooks.mjs +59 -0
- package/esm/__builtins__/shared/hooks.mjs.map +1 -0
- package/esm/__builtins__/shared/index.d.ts +7 -0
- package/esm/__builtins__/shared/index.mjs +25 -0
- package/esm/__builtins__/shared/index.mjs.map +1 -0
- package/esm/__builtins__/shared/load-config-provider.d.ts +2 -0
- package/esm/__builtins__/shared/load-config-provider.mjs +12 -0
- package/esm/__builtins__/shared/load-config-provider.mjs.map +1 -0
- package/esm/__builtins__/shared/loading.d.ts +12 -0
- package/esm/__builtins__/shared/loading.mjs +49 -0
- package/esm/__builtins__/shared/loading.mjs.map +1 -0
- package/esm/__builtins__/shared/simple-version-compare.d.ts +2 -0
- package/esm/__builtins__/shared/simple-version-compare.mjs +18 -0
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -0
- package/esm/__builtins__/shared/transform-component.d.ts +8 -0
- package/esm/__builtins__/shared/transform-component.mjs +49 -0
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -0
- package/esm/__builtins__/shared/types.d.ts +2 -0
- package/esm/__builtins__/shared/types.mjs +2 -0
- package/esm/__builtins__/shared/types.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +8 -0
- package/esm/__builtins__/shared/utils.mjs +34 -0
- package/esm/__builtins__/shared/utils.mjs.map +1 -0
- package/esm/array-base/array-base-addition.d.ts +5 -0
- package/esm/array-base/array-base-index.d.ts +19 -0
- package/esm/array-base/array-base-inner.d.ts +18 -0
- package/esm/array-base/array-base-item.d.ts +18 -0
- package/esm/array-base/array-base-move-down.d.ts +18 -0
- package/esm/array-base/array-base-move-up.d.ts +18 -0
- package/esm/array-base/array-base-remove.d.ts +18 -0
- package/esm/array-base/array-base-sort-handle.d.ts +2 -0
- package/esm/array-base/index.d.ts +114 -0
- package/esm/array-base/index.mjs +209 -0
- package/esm/array-base/index.mjs.map +1 -0
- package/esm/array-base/symbols.d.ts +4 -0
- package/esm/array-base/symbols.mjs +6 -0
- package/esm/array-base/symbols.mjs.map +1 -0
- package/esm/array-base/types.d.ts +28 -0
- package/esm/array-base/types.mjs +2 -0
- package/esm/array-base/types.mjs.map +1 -0
- package/esm/array-base/utils.d.ts +18 -0
- package/esm/array-base/utils.mjs +79 -0
- package/esm/array-base/utils.mjs.map +1 -0
- package/esm/array-cards/array-cards.d.ts +13 -0
- package/esm/array-cards/index.d.ts +122 -0
- package/esm/array-cards/index.mjs +119 -0
- package/esm/array-cards/index.mjs.map +1 -0
- package/esm/array-collapse/array-collapse-item.d.ts +18 -0
- package/esm/array-collapse/array-collapse.d.ts +16 -0
- package/esm/array-collapse/index.d.ts +134 -0
- package/esm/array-collapse/index.mjs +177 -0
- package/esm/array-collapse/index.mjs.map +1 -0
- package/esm/array-collapse/utils.d.ts +1 -0
- package/esm/array-collapse/utils.mjs +12 -0
- package/esm/array-collapse/utils.mjs.map +1 -0
- package/esm/array-items/array-items-item.d.ts +30 -0
- package/esm/array-items/array-items.d.ts +2 -0
- package/esm/array-items/index.d.ts +130 -0
- package/esm/array-items/index.mjs +105 -0
- package/esm/array-items/index.mjs.map +1 -0
- package/esm/array-list-tabs/array-list-tabs.d.ts +31 -0
- package/esm/array-list-tabs/index.d.ts +83 -0
- package/esm/array-list-tabs/index.mjs +183 -0
- package/esm/array-list-tabs/index.mjs.map +1 -0
- package/esm/array-list-tabs/utils.d.ts +3 -0
- package/esm/array-list-tabs/utils.mjs +16 -0
- package/esm/array-list-tabs/utils.mjs.map +1 -0
- package/esm/array-table/array-table.d.ts +1477 -0
- package/esm/array-table/index.d.ts +1573 -0
- package/esm/array-table/index.mjs +225 -0
- package/esm/array-table/index.mjs.map +1 -0
- package/esm/array-table/types.d.ts +6 -0
- package/esm/array-table/types.mjs +2 -0
- package/esm/array-table/types.mjs.map +1 -0
- package/esm/array-table/utils.d.ts +5 -0
- package/esm/array-table/utils.mjs +25 -0
- package/esm/array-table/utils.mjs.map +1 -0
- package/esm/array-tabs/array-tabs.d.ts +2 -0
- package/esm/array-tabs/index.d.ts +2 -0
- package/esm/array-tabs/index.mjs +87 -0
- package/esm/array-tabs/index.mjs.map +1 -0
- package/esm/cascader/cascader.d.ts +30 -0
- package/esm/cascader/index.d.ts +41 -0
- package/esm/cascader/index.mjs +54 -0
- package/esm/cascader/index.mjs.map +1 -0
- package/esm/checkbox/checkbox-group.d.ts +58 -0
- package/esm/checkbox/index.d.ts +779 -0
- package/esm/checkbox/index.mjs +83 -0
- package/esm/checkbox/index.mjs.map +1 -0
- package/esm/date-picker/index.d.ts +2 -0
- package/esm/date-picker/index.mjs +57 -0
- package/esm/date-picker/index.mjs.map +1 -0
- package/esm/editable/editable-popover.d.ts +25 -0
- package/esm/editable/editable.d.ts +187 -0
- package/esm/editable/index.d.ts +147 -0
- package/esm/editable/index.mjs +225 -0
- package/esm/editable/index.mjs.map +1 -0
- package/esm/form/form.d.ts +46 -0
- package/esm/form/form.mjs +71 -0
- package/esm/form/form.mjs.map +1 -0
- package/esm/form/index.d.ts +1 -0
- package/esm/form/index.mjs +6 -0
- package/esm/form/index.mjs.map +1 -0
- package/esm/form-button-group/form-button-group-sticky.d.ts +17 -0
- package/esm/form-button-group/form-button-group.d.ts +48 -0
- package/esm/form-button-group/index.d.ts +87 -0
- package/esm/form-button-group/index.mjs +87 -0
- package/esm/form-button-group/index.mjs.map +1 -0
- package/esm/form-button-group/utils.d.ts +1 -0
- package/esm/form-button-group/utils.mjs +12 -0
- package/esm/form-button-group/utils.mjs.map +1 -0
- package/esm/form-collapse/form-collapse.d.ts +18 -0
- package/esm/form-collapse/index.d.ts +45 -0
- package/esm/form-collapse/index.mjs +87 -0
- package/esm/form-collapse/index.mjs.map +1 -0
- package/esm/form-collapse/utils.d.ts +31 -0
- package/esm/form-collapse/utils.mjs +50 -0
- package/esm/form-collapse/utils.mjs.map +1 -0
- package/esm/form-dialog/dialog-content.d.ts +60 -0
- package/esm/form-dialog/index.d.ts +4 -0
- package/esm/form-dialog/index.mjs +208 -0
- package/esm/form-dialog/index.mjs.map +1 -0
- package/esm/form-dialog/types.d.ts +32 -0
- package/esm/form-dialog/types.mjs +2 -0
- package/esm/form-dialog/types.mjs.map +1 -0
- package/esm/form-drawer/drawer-content.d.ts +60 -0
- package/esm/form-drawer/index.d.ts +4 -0
- package/esm/form-drawer/index.mjs +202 -0
- package/esm/form-drawer/index.mjs.map +1 -0
- package/esm/form-drawer/types.d.ts +32 -0
- package/esm/form-drawer/types.mjs +2 -0
- package/esm/form-drawer/types.mjs.map +1 -0
- package/esm/form-grid/form-grid-column.d.ts +29 -0
- package/esm/form-grid/form-grid.d.ts +101 -0
- package/esm/form-grid/hooks.d.ts +5 -0
- package/esm/form-grid/hooks.mjs +14 -0
- package/esm/form-grid/hooks.mjs.map +1 -0
- package/esm/form-grid/index.d.ts +184 -0
- package/esm/form-grid/index.mjs +107 -0
- package/esm/form-grid/index.mjs.map +1 -0
- package/esm/form-item/form-item.d.ts +18 -0
- package/esm/form-item/index.d.ts +70 -0
- package/esm/form-item/index.mjs +331 -0
- package/esm/form-item/index.mjs.map +1 -0
- package/esm/form-item/types.d.ts +25 -0
- package/esm/form-item/types.mjs +2 -0
- package/esm/form-item/types.mjs.map +1 -0
- package/esm/form-item/utils.d.ts +3 -0
- package/esm/form-item/utils.mjs +17 -0
- package/esm/form-item/utils.mjs.map +1 -0
- package/esm/form-layout/form-layout.d.ts +32 -0
- package/esm/form-layout/form-layout.mjs +83 -0
- package/esm/form-layout/form-layout.mjs.map +1 -0
- package/esm/form-layout/index.d.ts +1 -0
- package/esm/form-layout/index.mjs +6 -0
- package/esm/form-layout/index.mjs.map +1 -0
- package/esm/form-layout/types.d.ts +43 -0
- package/esm/form-layout/types.mjs +2 -0
- package/esm/form-layout/types.mjs.map +1 -0
- package/esm/form-layout/utils.d.ts +57 -0
- package/esm/form-layout/utils.mjs +109 -0
- package/esm/form-layout/utils.mjs.map +1 -0
- package/esm/form-step/form-step-pane.d.ts +2 -0
- package/esm/form-step/form-step.d.ts +5 -0
- package/esm/form-step/index.d.ts +24 -0
- package/esm/form-step/index.mjs +92 -0
- package/esm/form-step/index.mjs.map +1 -0
- package/esm/form-step/types.d.ts +21 -0
- package/esm/form-step/types.mjs +2 -0
- package/esm/form-step/types.mjs.map +1 -0
- package/esm/form-step/utils.d.ts +11 -0
- package/esm/form-step/utils.mjs +64 -0
- package/esm/form-step/utils.mjs.map +1 -0
- package/esm/form-tab/form-tab.d.ts +7 -0
- package/esm/form-tab/hooks.d.ts +7 -0
- package/esm/form-tab/hooks.mjs +24 -0
- package/esm/form-tab/hooks.mjs.map +1 -0
- package/esm/form-tab/index.d.ts +28 -0
- package/esm/form-tab/index.mjs +77 -0
- package/esm/form-tab/index.mjs.map +1 -0
- package/esm/form-tab/types.d.ts +12 -0
- package/esm/form-tab/types.mjs +2 -0
- package/esm/form-tab/types.mjs.map +1 -0
- package/esm/form-tab/utils.d.ts +4 -0
- package/esm/form-tab/utils.mjs +14 -0
- package/esm/form-tab/utils.mjs.map +1 -0
- package/esm/index.d.ts +37 -0
- package/esm/index.mjs +81 -0
- package/esm/index.mjs.map +1 -0
- package/esm/input/index.d.ts +84 -0
- package/esm/input/index.mjs +77 -0
- package/esm/input/index.mjs.map +1 -0
- package/esm/input/input.d.ts +32 -0
- package/esm/input-number/index.d.ts +4 -0
- package/esm/input-number/index.mjs +30 -0
- package/esm/input-number/index.mjs.map +1 -0
- package/esm/pagination/components/jumper.d.ts +16 -0
- package/esm/pagination/components/jumper.mjs +12 -0
- package/esm/pagination/components/jumper.mjs.map +1 -0
- package/esm/pagination/components/next.d.ts +42 -0
- package/esm/pagination/components/next.mjs +23 -0
- package/esm/pagination/components/next.mjs.map +1 -0
- package/esm/pagination/components/pager.d.ts +42 -0
- package/esm/pagination/components/pager.mjs +23 -0
- package/esm/pagination/components/pager.mjs.map +1 -0
- package/esm/pagination/components/prev.d.ts +39 -0
- package/esm/pagination/components/prev.mjs +22 -0
- package/esm/pagination/components/prev.mjs.map +1 -0
- package/esm/pagination/components/sizes.d.ts +56 -0
- package/esm/pagination/components/sizes.mjs +7 -0
- package/esm/pagination/components/sizes.mjs.map +1 -0
- package/esm/pagination/components/total.d.ts +8 -0
- package/esm/pagination/components/total.mjs +11 -0
- package/esm/pagination/components/total.mjs.map +1 -0
- package/esm/pagination/pagination.d.ts +128 -0
- package/esm/pagination/pagination.mjs +629 -0
- package/esm/pagination/pagination.mjs.map +1 -0
- package/esm/password/index.d.ts +86 -0
- package/esm/password/index.mjs +14 -0
- package/esm/password/index.mjs.map +1 -0
- package/esm/preview-text/cascader.d.ts +5 -0
- package/esm/preview-text/date-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +102 -0
- package/esm/preview-text/index.mjs +314 -0
- package/esm/preview-text/index.mjs.map +1 -0
- package/esm/preview-text/input.d.ts +28 -0
- package/esm/preview-text/preview.d.ts +18 -0
- package/esm/preview-text/select.d.ts +5 -0
- package/esm/preview-text/time-picker.d.ts +5 -0
- package/esm/preview-text/tree.d.ts +22 -0
- package/esm/preview-text/utils.d.ts +14 -0
- package/esm/preview-text/utils.mjs +16 -0
- package/esm/preview-text/utils.mjs.map +1 -0
- package/esm/radio/index.d.ts +370 -0
- package/esm/radio/index.mjs +80 -0
- package/esm/radio/index.mjs.map +1 -0
- package/esm/radio/radio-group.d.ts +44 -0
- package/esm/reset/index.d.ts +63 -0
- package/esm/reset/index.mjs +44 -0
- package/esm/reset/index.mjs.map +1 -0
- package/esm/reset/reset.d.ts +45 -0
- package/esm/select/index.d.ts +142 -0
- package/esm/select/index.mjs +132 -0
- package/esm/select/index.mjs.map +1 -0
- package/esm/select/select.d.ts +50 -0
- package/esm/select-table/index.d.ts +1530 -0
- package/esm/select-table/index.mjs +205 -0
- package/esm/select-table/index.mjs.map +1 -0
- package/esm/select-table/select-table.d.ts +2974 -0
- package/esm/select-table/types.d.ts +17 -0
- package/esm/select-table/types.mjs +2 -0
- package/esm/select-table/types.mjs.map +1 -0
- package/esm/space/index.d.ts +1 -0
- package/esm/space/index.mjs +6 -0
- package/esm/space/index.mjs.map +1 -0
- package/esm/styles/array-base/index.css +1 -0
- package/esm/styles/array-cards/index.css +1 -0
- package/esm/styles/array-collapse/index.css +1 -0
- package/esm/styles/array-items/index.css +1 -0
- package/esm/styles/array-list-tabs/index.css +1 -0
- package/esm/styles/array-table/index.css +1 -0
- package/esm/styles/array-tabs/index.css +1 -0
- package/esm/styles/editable/index.css +1 -0
- package/esm/styles/form-button-group/index.css +1 -0
- package/esm/styles/form-collapse/index.css +1 -0
- package/esm/styles/form-grid/index.css +1 -0
- package/esm/styles/form-item/index.css +1 -0
- package/esm/styles/form-tab/index.css +1 -0
- package/esm/styles/preview-text/index.css +1 -0
- package/esm/styles/radio/index.css +1 -0
- package/esm/styles/select-table/index.css +1 -0
- package/esm/submit/index.d.ts +48 -0
- package/esm/submit/index.mjs +40 -0
- package/esm/submit/index.mjs.map +1 -0
- package/esm/submit/submit.d.ts +36 -0
- package/esm/switch/index.d.ts +4 -0
- package/esm/switch/index.mjs +19 -0
- package/esm/switch/index.mjs.map +1 -0
- package/esm/time-picker/index.d.ts +4 -0
- package/esm/time-picker/index.mjs +21 -0
- package/esm/time-picker/index.mjs.map +1 -0
- package/esm/time-select/index.d.ts +2 -0
- package/esm/time-select/index.mjs +21 -0
- package/esm/time-select/index.mjs.map +1 -0
- package/esm/transfer/index.d.ts +186 -0
- package/esm/transfer/index.mjs +11 -0
- package/esm/transfer/index.mjs.map +1 -0
- package/esm/tree/index.d.ts +42 -0
- package/esm/tree/index.mjs +104 -0
- package/esm/tree/index.mjs.map +1 -0
- package/esm/tree/tree.d.ts +20 -0
- package/esm/tree/types.d.ts +13 -0
- package/esm/tree/types.mjs +2 -0
- package/esm/tree/types.mjs.map +1 -0
- package/esm/tree/utils.d.ts +45 -0
- package/esm/tree/utils.mjs +161 -0
- package/esm/tree/utils.mjs.map +1 -0
- package/esm/tree-select/index.d.ts +32 -0
- package/esm/tree-select/index.mjs +47 -0
- package/esm/tree-select/index.mjs.map +1 -0
- package/esm/tree-select/tree-select.d.ts +17 -0
- package/esm/upload/index.d.ts +707 -0
- package/esm/upload/index.mjs +175 -0
- package/esm/upload/index.mjs.map +1 -0
- package/esm/upload/upload.d.ts +1249 -0
- package/esm/vendor/icon.mjs +11 -0
- package/esm/vendor/icon.mjs.map +1 -0
- package/esm/vendor/lodash.mjs +1400 -0
- package/esm/vendor/lodash.mjs.map +1 -0
- package/esm/vendor/runtime.mjs +35 -0
- package/esm/vendor/runtime.mjs.map +1 -0
- package/esm/vendor/shared.esm-bundler.mjs +14 -0
- package/esm/vendor/shared.esm-bundler.mjs.map +1 -0
- package/esm/vendor/sizes.mjs +27 -0
- package/esm/vendor/sizes.mjs.map +1 -0
- package/esm/vendor/types.mjs +19 -0
- package/esm/vendor/types.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const ArrayCards: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
+
title?: string;
|
|
4
|
+
header?: string;
|
|
5
|
+
footer?: string;
|
|
6
|
+
bodyStyle?: Record<string, string>;
|
|
7
|
+
bodyClass?: string;
|
|
8
|
+
shadow?: "always" | "hover" | "never";
|
|
9
|
+
value: any;
|
|
10
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
11
|
+
shadow: "always" | "hover" | "never";
|
|
12
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
13
|
+
P: {};
|
|
14
|
+
B: {};
|
|
15
|
+
D: {};
|
|
16
|
+
C: {};
|
|
17
|
+
M: {};
|
|
18
|
+
Defaults: {};
|
|
19
|
+
}, Readonly<{
|
|
20
|
+
title?: string;
|
|
21
|
+
header?: string;
|
|
22
|
+
footer?: string;
|
|
23
|
+
bodyStyle?: Record<string, string>;
|
|
24
|
+
bodyClass?: string;
|
|
25
|
+
shadow?: "always" | "hover" | "never";
|
|
26
|
+
value: any;
|
|
27
|
+
}> & Readonly<{}>, {}, {}, {}, {}, {
|
|
28
|
+
shadow: "always" | "hover" | "never";
|
|
29
|
+
}>;
|
|
30
|
+
__isFragment?: never;
|
|
31
|
+
__isTeleport?: never;
|
|
32
|
+
__isSuspense?: never;
|
|
33
|
+
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
34
|
+
title?: string;
|
|
35
|
+
header?: string;
|
|
36
|
+
footer?: string;
|
|
37
|
+
bodyStyle?: Record<string, string>;
|
|
38
|
+
bodyClass?: string;
|
|
39
|
+
shadow?: "always" | "hover" | "never";
|
|
40
|
+
value: any;
|
|
41
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
42
|
+
shadow: "always" | "hover" | "never";
|
|
43
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
44
|
+
Index: {
|
|
45
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLSpanElement, import('vue').ComponentProvideOptions, {
|
|
46
|
+
P: {};
|
|
47
|
+
B: {};
|
|
48
|
+
D: {};
|
|
49
|
+
C: {};
|
|
50
|
+
M: {};
|
|
51
|
+
Defaults: {};
|
|
52
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
53
|
+
__isFragment?: never;
|
|
54
|
+
__isTeleport?: never;
|
|
55
|
+
__isSuspense?: never;
|
|
56
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
57
|
+
$slots: {
|
|
58
|
+
default?(_: {
|
|
59
|
+
index: number;
|
|
60
|
+
}): any;
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
SortHandle: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
64
|
+
Addition: import('vue').DefineComponent<import('../array-base/types').IArrayBaseAdditionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('../array-base/types').IArrayBaseAdditionProps> & Readonly<{}>, {
|
|
65
|
+
method: "push" | "unshift";
|
|
66
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
67
|
+
Remove: {
|
|
68
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
69
|
+
P: {};
|
|
70
|
+
B: {};
|
|
71
|
+
D: {};
|
|
72
|
+
C: {};
|
|
73
|
+
M: {};
|
|
74
|
+
Defaults: {};
|
|
75
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
76
|
+
__isFragment?: never;
|
|
77
|
+
__isTeleport?: never;
|
|
78
|
+
__isSuspense?: never;
|
|
79
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
80
|
+
$slots: {
|
|
81
|
+
default?(_: {}): any;
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
MoveDown: {
|
|
85
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
86
|
+
P: {};
|
|
87
|
+
B: {};
|
|
88
|
+
D: {};
|
|
89
|
+
C: {};
|
|
90
|
+
M: {};
|
|
91
|
+
Defaults: {};
|
|
92
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
93
|
+
__isFragment?: never;
|
|
94
|
+
__isTeleport?: never;
|
|
95
|
+
__isSuspense?: never;
|
|
96
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
97
|
+
$slots: {
|
|
98
|
+
default?(_: {}): any;
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
MoveUp: {
|
|
102
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
103
|
+
P: {};
|
|
104
|
+
B: {};
|
|
105
|
+
D: {};
|
|
106
|
+
C: {};
|
|
107
|
+
M: {};
|
|
108
|
+
Defaults: {};
|
|
109
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
110
|
+
__isFragment?: never;
|
|
111
|
+
__isTeleport?: never;
|
|
112
|
+
__isSuspense?: never;
|
|
113
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
114
|
+
$slots: {
|
|
115
|
+
default?(_: {}): any;
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
useArray: typeof import('../array-base/utils').useArray;
|
|
119
|
+
useIndex: typeof import('../array-base/utils').useIndex;
|
|
120
|
+
useRecord: typeof import('../array-base/utils').useRecord;
|
|
121
|
+
};
|
|
122
|
+
export default ArrayCards;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { defineComponent as N, ref as V, createElementBlock as c, openBlock as o, normalizeClass as k, createVNode as a, unref as e, withCtx as s, createBlock as y, createCommentVNode as v, mergeProps as A, Fragment as h, renderList as R, createElementVNode as x, createTextVNode as $, toDisplayString as b } from "vue";
|
|
2
|
+
import { ElCard as E, ElEmpty as D, ElRow as H } from "element-plus";
|
|
3
|
+
import { autorun as K } from "@formily/reactive";
|
|
4
|
+
import "@formily/core";
|
|
5
|
+
import "@formily/reactive-vue";
|
|
6
|
+
import { useField as P, useFieldSchema as U, RecursionField as d } from "@formily/vue";
|
|
7
|
+
import { composeExport as j } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { ArrayBase as r } from "../array-base/index.mjs";
|
|
9
|
+
import { isArr as I } from "@formily/shared";
|
|
10
|
+
import { stylePrefix as z } from "../__builtins__/configs/index.mjs";
|
|
11
|
+
import { isIndexComponent as g, isOperationComponent as w, getArrayItemSchema as f, isAdditionComponent as L } from "../array-base/utils.mjs";
|
|
12
|
+
import '../styles/array-cards/index.css';const O = /* @__PURE__ */ N({
|
|
13
|
+
name: "FArrayCards",
|
|
14
|
+
__name: "array-cards",
|
|
15
|
+
props: {
|
|
16
|
+
title: null,
|
|
17
|
+
header: null,
|
|
18
|
+
footer: null,
|
|
19
|
+
bodyStyle: null,
|
|
20
|
+
bodyClass: null,
|
|
21
|
+
shadow: { default: "never" },
|
|
22
|
+
value: null
|
|
23
|
+
},
|
|
24
|
+
setup(S) {
|
|
25
|
+
const p = S, F = P(), C = U(), n = F.value, m = C.value, i = `${z}-array-cards`, { getKey: M, keyMap: B } = r.useKey(C.value), _ = V(n.value);
|
|
26
|
+
return K(() => {
|
|
27
|
+
_.value = [...n.value];
|
|
28
|
+
}), (T, q) => (o(), c("div", {
|
|
29
|
+
class: k(i)
|
|
30
|
+
}, [
|
|
31
|
+
a(e(r), { "key-map": e(B) }, {
|
|
32
|
+
default: s(() => [
|
|
33
|
+
e(I)(e(n).value) && e(n).value.length > 0 ? v("", !0) : (o(), y(e(E), A({
|
|
34
|
+
key: 0,
|
|
35
|
+
class: `${i}-item`
|
|
36
|
+
}, p), {
|
|
37
|
+
default: s(() => [
|
|
38
|
+
a(e(D))
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 16, ["class"])),
|
|
42
|
+
e(I)(p.value) ? (o(!0), c(h, { key: 1 }, R(_.value, (u, t) => (o(), y(e(r).Item, {
|
|
43
|
+
key: e(M)(u, t),
|
|
44
|
+
index: t,
|
|
45
|
+
record: u
|
|
46
|
+
}, {
|
|
47
|
+
default: s(() => [
|
|
48
|
+
a(e(E), A({ ref_for: !0 }, p, {
|
|
49
|
+
class: `${i}-item`
|
|
50
|
+
}), {
|
|
51
|
+
header: s(() => [
|
|
52
|
+
a(e(H), {
|
|
53
|
+
type: "flex",
|
|
54
|
+
justify: "space-between"
|
|
55
|
+
}, {
|
|
56
|
+
default: s(() => [
|
|
57
|
+
x("span", null, [
|
|
58
|
+
a(e(d), {
|
|
59
|
+
schema: e(f)(e(m), t),
|
|
60
|
+
name: t,
|
|
61
|
+
"filter-properties": (l) => e(g)(l),
|
|
62
|
+
"only-render-properties": !0
|
|
63
|
+
}, null, 8, ["schema", "name", "filter-properties"]),
|
|
64
|
+
$(" " + b(e(f)(e(m), t).title ?? p.title ?? e(n).title), 1)
|
|
65
|
+
]),
|
|
66
|
+
x("span", {
|
|
67
|
+
class: k(`${i}-extra-container`)
|
|
68
|
+
}, [
|
|
69
|
+
a(e(d), {
|
|
70
|
+
schema: e(f)(e(m), t),
|
|
71
|
+
name: t,
|
|
72
|
+
"filter-properties": (l) => e(w)(l),
|
|
73
|
+
"only-render-properties": !0
|
|
74
|
+
}, null, 8, ["schema", "name", "filter-properties"])
|
|
75
|
+
], 2)
|
|
76
|
+
]),
|
|
77
|
+
_: 2
|
|
78
|
+
}, 1024)
|
|
79
|
+
]),
|
|
80
|
+
default: s(() => [
|
|
81
|
+
a(e(d), {
|
|
82
|
+
schema: e(f)(e(m), t),
|
|
83
|
+
name: t,
|
|
84
|
+
"filter-properties": (l) => !e(g)(l) && !e(w)(l)
|
|
85
|
+
}, null, 8, ["schema", "name", "filter-properties"])
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, 1040, ["class"])
|
|
89
|
+
]),
|
|
90
|
+
_: 2
|
|
91
|
+
}, 1032, ["index", "record"]))), 128)) : v("", !0),
|
|
92
|
+
(o(!0), c(h, null, R(e(m).properties, (u, t) => (o(), c(h, { key: t }, [
|
|
93
|
+
e(L)(u) ? (o(), y(e(d), {
|
|
94
|
+
key: 0,
|
|
95
|
+
schema: u,
|
|
96
|
+
name: "addition"
|
|
97
|
+
}, null, 8, ["schema"])) : v("", !0)
|
|
98
|
+
], 64))), 128))
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["key-map"])
|
|
102
|
+
]));
|
|
103
|
+
}
|
|
104
|
+
}), ae = j(O, {
|
|
105
|
+
Index: r.Index,
|
|
106
|
+
SortHandle: r.SortHandle,
|
|
107
|
+
Addition: r.Addition,
|
|
108
|
+
Remove: r.Remove,
|
|
109
|
+
MoveDown: r.MoveDown,
|
|
110
|
+
MoveUp: r.MoveUp,
|
|
111
|
+
useArray: r.useArray,
|
|
112
|
+
useIndex: r.useIndex,
|
|
113
|
+
useRecord: r.useRecord
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
ae as ArrayCards,
|
|
117
|
+
ae as default
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-cards/array-cards.vue","../../src/array-cards/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { ISchema } from '@formily/json-schema'\nimport { autorun } from '@formily/reactive'\nimport { isArr } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport { ElCard, ElEmpty, ElRow } from 'element-plus'\nimport { ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { ArrayBase } from '../array-base'\nimport { getArrayItemSchema, isAdditionComponent, isIndexComponent, isOperationComponent } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayCards',\n})\n\nconst props = defineProps({\n title: null,\n header: null,\n footer: null,\n bodyStyle: null,\n bodyClass: null,\n shadow: { default: 'never' },\n value: null\n})\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\nconst field = fieldRef.value\nconst schema = schemaRef.value\n\nconst prefixCls = `${stylePrefix}-array-cards`\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\n\nconst dataSource = ref(field.value)\n\nautorun(() => {\n dataSource.value = [...field.value]\n})\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ArrayBase :key-map=\"keyMap\">\n <!-- 空状态渲染 -->\n <ElCard\n v-if=\"!(isArr(field.value) && field.value.length > 0)\"\n :class=\"`${prefixCls}-item`\"\n v-bind=\"props\"\n >\n <ElEmpty />\n </ElCard>\n\n <!-- 数据项渲染 -->\n <template v-if=\"isArr(props.value)\">\n <ArrayBase.Item\n v-for=\"(item, index) of dataSource\"\n :key=\"getKey(item, index)\"\n :index=\"index\"\n :record=\"item\"\n >\n <ElCard\n v-bind=\"props\"\n :class=\"`${prefixCls}-item`\"\n >\n <template #header>\n <ElRow type=\"flex\" justify=\"space-between\">\n <span>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isIndexComponent(schema)\"\n :only-render-properties=\"true\"\n />\n {{ getArrayItemSchema(schema, index).title ?? props.title ?? field.title }}\n </span>\n <span :class=\"`${prefixCls}-extra-container`\">\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isOperationComponent(schema)\"\n :only-render-properties=\"true\"\n />\n </span>\n </ElRow>\n </template>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => !isIndexComponent(schema) && !isOperationComponent(schema)\"\n />\n </ElCard>\n </ArrayBase.Item>\n </template>\n\n <!-- 添加按钮渲染 -->\n <template v-for=\"(itemSchema, key) in schema.properties\" :key=\"key\">\n <RecursionField\n v-if=\"isAdditionComponent(itemSchema)\"\n :schema=\"itemSchema\"\n name=\"addition\"\n />\n </template>\n </ArrayBase>\n </div>\n</template>\n","import { composeExport } from '../__builtins__/shared'\nimport { ArrayBase } from '../array-base'\nimport ArrayCardsInner from './array-cards.vue'\nimport './style.scss'\n\nexport const ArrayCards = composeExport(ArrayCardsInner, {\n Index: ArrayBase.Index,\n SortHandle: ArrayBase.SortHandle,\n Addition: ArrayBase.Addition,\n Remove: ArrayBase.Remove,\n MoveDown: ArrayBase.MoveDown,\n MoveUp: ArrayBase.MoveUp,\n useArray: ArrayBase.useArray,\n useIndex: ArrayBase.useIndex,\n useRecord: ArrayBase.useRecord,\n})\n\nexport default ArrayCards\n"],"names":["props","__props","fieldRef","useField","schemaRef","useFieldSchema","field","schema","prefixCls","stylePrefix","getKey","keyMap","ArrayBase","dataSource","ref","autorun","_createElementBlock","_createVNode","_unref","isArr","_openBlock","_createBlock","_mergeProps","ElEmpty","_Fragment","_renderList","item","index","ElCard","ElRow","_createElementVNode","RecursionField","getArrayItemSchema","isIndexComponent","_createTextVNode","_toDisplayString","isOperationComponent","itemSchema","key","isAdditionComponent","ArrayCards","composeExport","ArrayCardsInner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBA,UAAMA,IAAQC,GASRC,IAAWC,EAAA,GACXC,IAAYC,EAAA,GAC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;;;IC9FFG,KAAaC,EAAcC,GAAiB;AAAA,EACvD,OAAO9B,EAAU;AAAA,EACjB,YAAYA,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,WAAWA,EAAU;AACvB,CAAC;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
title?(_: {}): any;
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
value: {};
|
|
3
|
+
defaultOpenPanelCount: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
8
|
+
value: {};
|
|
9
|
+
defaultOpenPanelCount: {
|
|
10
|
+
type: NumberConstructor;
|
|
11
|
+
default: number;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {
|
|
14
|
+
defaultOpenPanelCount: number;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export declare const ArrayCollapse: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
value: {};
|
|
4
|
+
defaultOpenPanelCount: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
9
|
+
defaultOpenPanelCount: number;
|
|
10
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
11
|
+
P: {};
|
|
12
|
+
B: {};
|
|
13
|
+
D: {};
|
|
14
|
+
C: {};
|
|
15
|
+
M: {};
|
|
16
|
+
Defaults: {};
|
|
17
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
18
|
+
value: {};
|
|
19
|
+
defaultOpenPanelCount: {
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
default: number;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
24
|
+
defaultOpenPanelCount: number;
|
|
25
|
+
}>;
|
|
26
|
+
__isFragment?: never;
|
|
27
|
+
__isTeleport?: never;
|
|
28
|
+
__isSuspense?: never;
|
|
29
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
30
|
+
value: {};
|
|
31
|
+
defaultOpenPanelCount: {
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
36
|
+
defaultOpenPanelCount: number;
|
|
37
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
|
|
38
|
+
Item: {
|
|
39
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
40
|
+
P: {};
|
|
41
|
+
B: {};
|
|
42
|
+
D: {};
|
|
43
|
+
C: {};
|
|
44
|
+
M: {};
|
|
45
|
+
Defaults: {};
|
|
46
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
47
|
+
__isFragment?: never;
|
|
48
|
+
__isTeleport?: never;
|
|
49
|
+
__isSuspense?: never;
|
|
50
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
51
|
+
$slots: {
|
|
52
|
+
title?(_: {}): any;
|
|
53
|
+
default?(_: {}): any;
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
Index: {
|
|
57
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLSpanElement, import('vue').ComponentProvideOptions, {
|
|
58
|
+
P: {};
|
|
59
|
+
B: {};
|
|
60
|
+
D: {};
|
|
61
|
+
C: {};
|
|
62
|
+
M: {};
|
|
63
|
+
Defaults: {};
|
|
64
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
65
|
+
__isFragment?: never;
|
|
66
|
+
__isTeleport?: never;
|
|
67
|
+
__isSuspense?: never;
|
|
68
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
69
|
+
$slots: {
|
|
70
|
+
default?(_: {
|
|
71
|
+
index: number;
|
|
72
|
+
}): any;
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
SortHandle: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
Addition: import('vue').DefineComponent<import('../array-base/types').IArrayBaseAdditionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('../array-base/types').IArrayBaseAdditionProps> & Readonly<{}>, {
|
|
77
|
+
method: "push" | "unshift";
|
|
78
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
79
|
+
Remove: {
|
|
80
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
81
|
+
P: {};
|
|
82
|
+
B: {};
|
|
83
|
+
D: {};
|
|
84
|
+
C: {};
|
|
85
|
+
M: {};
|
|
86
|
+
Defaults: {};
|
|
87
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
88
|
+
__isFragment?: never;
|
|
89
|
+
__isTeleport?: never;
|
|
90
|
+
__isSuspense?: never;
|
|
91
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
92
|
+
$slots: {
|
|
93
|
+
default?(_: {}): any;
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
MoveDown: {
|
|
97
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
98
|
+
P: {};
|
|
99
|
+
B: {};
|
|
100
|
+
D: {};
|
|
101
|
+
C: {};
|
|
102
|
+
M: {};
|
|
103
|
+
Defaults: {};
|
|
104
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
105
|
+
__isFragment?: never;
|
|
106
|
+
__isTeleport?: never;
|
|
107
|
+
__isSuspense?: never;
|
|
108
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
109
|
+
$slots: {
|
|
110
|
+
default?(_: {}): any;
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
MoveUp: {
|
|
114
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
115
|
+
P: {};
|
|
116
|
+
B: {};
|
|
117
|
+
D: {};
|
|
118
|
+
C: {};
|
|
119
|
+
M: {};
|
|
120
|
+
Defaults: {};
|
|
121
|
+
}, Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
122
|
+
__isFragment?: never;
|
|
123
|
+
__isTeleport?: never;
|
|
124
|
+
__isSuspense?: never;
|
|
125
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('../array-base/types').IArrayBaseOperationProps> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
126
|
+
$slots: {
|
|
127
|
+
default?(_: {}): any;
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
useArray: typeof import('../array-base/utils').useArray;
|
|
131
|
+
useIndex: typeof import('../array-base/utils').useIndex;
|
|
132
|
+
useRecord: typeof import('../array-base/utils').useRecord;
|
|
133
|
+
};
|
|
134
|
+
export default ArrayCollapse;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { defineComponent as S, createBlock as v, openBlock as s, unref as e, mergeProps as k, withCtx as d, renderSlot as $, createElementVNode as w, createVNode as h, normalizeClass as b, createTextVNode as z, toDisplayString as T, ref as B, watchEffect as j, createElementBlock as _, Fragment as R, renderList as M, createCommentVNode as G } from "vue";
|
|
2
|
+
import { ElCollapseItem as J, ElBadge as L, ElCard as Q, ElEmpty as W, ElCollapse as X } from "element-plus";
|
|
3
|
+
import { observable as Y, autorun as Z } from "@formily/reactive";
|
|
4
|
+
import "@formily/core";
|
|
5
|
+
import "@formily/reactive-vue";
|
|
6
|
+
import { useField as D, useFieldSchema as P, RecursionField as g } from "@formily/vue";
|
|
7
|
+
import { useCleanAttrs as V, composeExport as ee } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { ArrayBase as o } from "../array-base/index.mjs";
|
|
9
|
+
import { useIndex as re, isIndexComponent as H, isOperationComponent as K, getArrayItemSchema as te, isAdditionComponent as ae } from "../array-base/utils.mjs";
|
|
10
|
+
import { prefixCls as C } from "./utils.mjs";
|
|
11
|
+
import { isArr as N } from "@formily/shared";
|
|
12
|
+
import '../styles/array-collapse/index.css';const oe = { style: { flex: "1", display: "flex", "align-items": "center" } }, le = /* @__PURE__ */ S({
|
|
13
|
+
name: "FArrayCollapseItem",
|
|
14
|
+
inheritAttrs: !1,
|
|
15
|
+
__name: "array-collapse-item",
|
|
16
|
+
setup(E) {
|
|
17
|
+
const A = D().value, t = P().value.parent, m = re(), u = Y.computed(() => {
|
|
18
|
+
const f = A.address.concat();
|
|
19
|
+
return A.form.queryFeedbacks({
|
|
20
|
+
type: "error",
|
|
21
|
+
address: `${f}.**`
|
|
22
|
+
}).length;
|
|
23
|
+
}), { props: c } = V();
|
|
24
|
+
return (f, x) => (s(), v(e(J), k({ name: e(m) }, e(c)), {
|
|
25
|
+
title: d(() => [
|
|
26
|
+
w("div", oe, [
|
|
27
|
+
h(e(g), {
|
|
28
|
+
schema: e(t).items,
|
|
29
|
+
name: e(m),
|
|
30
|
+
"filter-properties": (n) => e(H)(n),
|
|
31
|
+
"only-render-properties": !0
|
|
32
|
+
}, null, 8, ["schema", "name", "filter-properties"]),
|
|
33
|
+
$(f.$slots, "title", {}, () => [
|
|
34
|
+
h(e(L), {
|
|
35
|
+
class: b([`${e(C)}-errors-badge`]),
|
|
36
|
+
value: e(u).value,
|
|
37
|
+
offset: [5, -2],
|
|
38
|
+
hidden: e(u).value === 0
|
|
39
|
+
}, {
|
|
40
|
+
default: d(() => [
|
|
41
|
+
z(T(e(t).items?.["x-component-props"]?.title), 1)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
}, 8, ["class", "value", "hidden"])
|
|
45
|
+
])
|
|
46
|
+
]),
|
|
47
|
+
w("div", null, [
|
|
48
|
+
h(e(g), {
|
|
49
|
+
schema: Array.isArray(e(t).items) ? e(t).items[e(m)] || e(t).items[0] : e(t).items,
|
|
50
|
+
name: e(m),
|
|
51
|
+
"filter-properties": (n) => e(K)(n),
|
|
52
|
+
"only-render-properties": !0
|
|
53
|
+
}, null, 8, ["schema", "name", "filter-properties"])
|
|
54
|
+
])
|
|
55
|
+
]),
|
|
56
|
+
default: d(() => [
|
|
57
|
+
$(f.$slots, "default")
|
|
58
|
+
]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 16, ["name"]));
|
|
61
|
+
}
|
|
62
|
+
}), se = /* @__PURE__ */ S({
|
|
63
|
+
name: "FArrayCollapse",
|
|
64
|
+
inheritAttrs: !1,
|
|
65
|
+
__name: "array-collapse",
|
|
66
|
+
props: {
|
|
67
|
+
value: {},
|
|
68
|
+
defaultOpenPanelCount: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 5
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
setup(E) {
|
|
74
|
+
const y = E, A = D(), I = P(), t = A.value, m = I.value, { props: u } = V(), c = B([]), { getKey: f, keyMap: x } = o.useKey(I.value), n = B(t.value);
|
|
75
|
+
Z(() => {
|
|
76
|
+
N(t.value) && (n.value = [...t.value]);
|
|
77
|
+
});
|
|
78
|
+
function F(a) {
|
|
79
|
+
return Array.from({ length: a }).map((l, r) => r);
|
|
80
|
+
}
|
|
81
|
+
function O(a, l, r = !1) {
|
|
82
|
+
return r ? 0 : a < l ? F(a) : F(l);
|
|
83
|
+
}
|
|
84
|
+
function U(a, l, r = !1) {
|
|
85
|
+
if (r)
|
|
86
|
+
return l;
|
|
87
|
+
/* istanbul ignore if -- @preserve */
|
|
88
|
+
return N(a) ? a.length <= l ? a.concat(l) : a.reduce((i, p) => p === l ? [...i, p, p + 1] : i.concat(p + 1), []) : l;
|
|
89
|
+
}
|
|
90
|
+
j(() => {
|
|
91
|
+
!t.modified && n.value.length > 0 && (c.value = O(
|
|
92
|
+
n.value.length,
|
|
93
|
+
y.defaultOpenPanelCount,
|
|
94
|
+
u.value.accordion
|
|
95
|
+
));
|
|
96
|
+
});
|
|
97
|
+
function q(a) {
|
|
98
|
+
c.value = a;
|
|
99
|
+
}
|
|
100
|
+
return (a, l) => (s(), _("div", {
|
|
101
|
+
class: b(e(C))
|
|
102
|
+
}, [
|
|
103
|
+
(s(), v(e(o), {
|
|
104
|
+
key: n.value.length,
|
|
105
|
+
"key-map": e(x),
|
|
106
|
+
add: (r) => {
|
|
107
|
+
c.value = U(
|
|
108
|
+
c.value,
|
|
109
|
+
r,
|
|
110
|
+
e(u).accordion
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
default: d(() => [
|
|
115
|
+
!Array.isArray(y.value) || y.value.length === 0 ? (s(), v(e(Q), k({
|
|
116
|
+
key: 0,
|
|
117
|
+
class: [`${e(C)}-item`],
|
|
118
|
+
shadow: "never"
|
|
119
|
+
}, e(u), {
|
|
120
|
+
header: e(u).title || e(t).title
|
|
121
|
+
}), {
|
|
122
|
+
default: d(() => [
|
|
123
|
+
h(e(W))
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 16, ["class", "header"])) : (s(), v(e(X), k({
|
|
127
|
+
key: 1,
|
|
128
|
+
"model-value": c.value,
|
|
129
|
+
class: `${e(C)}-item`
|
|
130
|
+
}, e(u), { onChange: q }), {
|
|
131
|
+
default: d(() => [
|
|
132
|
+
(s(!0), _(R, null, M(n.value, (r, i) => (s(), v(e(o).Item, {
|
|
133
|
+
key: e(f)(r, i),
|
|
134
|
+
index: i,
|
|
135
|
+
record: r
|
|
136
|
+
}, {
|
|
137
|
+
default: d(() => [
|
|
138
|
+
h(e(g), {
|
|
139
|
+
schema: e(te)(e(m), i),
|
|
140
|
+
name: i,
|
|
141
|
+
"filter-properties": (p) => !e(H)(p) && !e(K)(p)
|
|
142
|
+
}, null, 8, ["schema", "name", "filter-properties"])
|
|
143
|
+
]),
|
|
144
|
+
_: 2
|
|
145
|
+
}, 1032, ["index", "record"]))), 128))
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 16, ["model-value", "class"])),
|
|
149
|
+
(s(!0), _(R, null, M(e(m).properties, (r, i) => (s(), _(R, { key: i }, [
|
|
150
|
+
e(ae)(r) ? (s(), v(e(g), {
|
|
151
|
+
key: 0,
|
|
152
|
+
schema: r,
|
|
153
|
+
name: "addition"
|
|
154
|
+
}, null, 8, ["schema"])) : G("", !0)
|
|
155
|
+
], 64))), 128))
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["key-map", "add"]))
|
|
159
|
+
], 2));
|
|
160
|
+
}
|
|
161
|
+
}), Ae = ee(se, {
|
|
162
|
+
Item: le,
|
|
163
|
+
Index: o.Index,
|
|
164
|
+
SortHandle: o.SortHandle,
|
|
165
|
+
Addition: o.Addition,
|
|
166
|
+
Remove: o.Remove,
|
|
167
|
+
MoveDown: o.MoveDown,
|
|
168
|
+
MoveUp: o.MoveUp,
|
|
169
|
+
useArray: o.useArray,
|
|
170
|
+
useIndex: o.useIndex,
|
|
171
|
+
useRecord: o.useRecord
|
|
172
|
+
});
|
|
173
|
+
export {
|
|
174
|
+
Ae as ArrayCollapse,
|
|
175
|
+
Ae as default
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-collapse/array-collapse-item.vue","../../src/array-collapse/array-collapse.vue","../../src/array-collapse/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { ISchema } from '@formily/vue'\nimport { observable } from '@formily/reactive'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport { ElBadge, ElCollapseItem } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__'\nimport { isIndexComponent, isOperationComponent, useIndex } from '../array-base/utils'\nimport { prefixCls } from './utils'\n\ndefineOptions({\n name: 'FArrayCollapseItem',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst field = fieldRef.value\nconst schemaRef = useFieldSchema()\nconst schema = schemaRef.value.parent\nconst index = useIndex()\nconst errorCount = observable.computed(() => {\n const path = field.address.concat()\n return field.form.queryFeedbacks({\n type: 'error',\n address: `${path}.**`,\n }).length\n})\n\nconst { props: collapseItemProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCollapseItem :name=\"index\" v-bind=\"collapseItemProps\">\n <template #title>\n <div style=\"flex: 1;display: flex;align-items: center;\">\n <RecursionField\n :schema=\"schema.items\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isIndexComponent(schema)\"\n :only-render-properties=\"true\"\n />\n <slot name=\"title\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCount.value\"\n :offset=\"[5, -2]\"\n :hidden=\"errorCount.value === 0\"\n >\n {{ schema.items?.['x-component-props']?.title }}\n </ElBadge>\n </slot>\n </div>\n <div>\n <RecursionField\n :schema=\"Array.isArray(schema.items) ? schema.items[index] || schema.items[0] : schema.items\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isOperationComponent(schema)\"\n :only-render-properties=\"true\"\n />\n </div>\n </template>\n <slot />\n </ElCollapseItem>\n</template>\n","<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { ISchema } from '@formily/json-schema'\nimport { autorun } from '@formily/reactive'\nimport { isArr } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport {\n ElCard,\n ElCollapse,\n ElEmpty,\n} from 'element-plus'\nimport { ref, watchEffect } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { ArrayBase } from '../array-base'\nimport { getArrayItemSchema, isAdditionComponent, isIndexComponent, isOperationComponent } from '../array-base/utils'\nimport { prefixCls } from './utils'\n\ndefineOptions({\n name: 'FArrayCollapse',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: {},\n defaultOpenPanelCount: {\n type: Number,\n default: 5,\n },\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\nconst field = fieldRef.value\nconst schema = schemaRef.value\n\nconst { props: collapseProps } = useCleanAttrs()\nconst activeKeys = ref<number[] | number>([])\n\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\n\nconst dataSource = ref(field.value)\n\nautorun(() => {\n isArr(field.value) && (dataSource.value = [...field.value])\n})\n\nfunction range(count: number) {\n return Array.from({ length: count }).map((_, i) => i)\n}\n\nfunction takeDefaultActiveKeys(dataSourceLength: number, defaultOpenPanelCount: number, accordion = false) {\n if (accordion) {\n return 0\n }\n if (dataSourceLength < defaultOpenPanelCount)\n return range(dataSourceLength)\n\n return range(defaultOpenPanelCount)\n}\n\nfunction insertActiveKeys(activeKeys: number[] | number, index: number, accordion = false) {\n if (accordion)\n return index\n /* istanbul ignore if -- @preserve */\n if (!isArr(activeKeys))\n return index\n if (activeKeys.length <= index)\n return (activeKeys).concat(index)\n return (activeKeys).reduce((buf, key) => {\n if (key === index)\n return [...buf, key, key + 1]\n return buf.concat(key + 1)\n }, [])\n}\n\nwatchEffect(() => {\n if (!field.modified && dataSource.value.length > 0) {\n activeKeys.value = takeDefaultActiveKeys(\n dataSource.value.length,\n props.defaultOpenPanelCount,\n collapseProps.value.accordion as boolean,\n )\n }\n})\n\nfunction handleCollapseChange(keys: number[] | number) {\n activeKeys.value = keys\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ArrayBase\n :key=\"dataSource.length\"\n :key-map=\"keyMap\"\n :add=\"(index: number) => {\n activeKeys = insertActiveKeys(\n activeKeys,\n index,\n collapseProps.accordion as boolean,\n )\n }\"\n >\n <template v-if=\"!Array.isArray(props.value) || props.value.length === 0\">\n <ElCard :class=\"[`${prefixCls}-item`]\" shadow=\"never\" v-bind=\"collapseProps\" :header=\"collapseProps.title || field.title\">\n <ElEmpty />\n </ElCard>\n </template>\n <template v-else>\n <ElCollapse\n :model-value=\"activeKeys\"\n :class=\"`${prefixCls}-item`\"\n v-bind=\"collapseProps\"\n @change=\"handleCollapseChange\"\n >\n <ArrayBase.Item v-for=\"(item, index) of dataSource\" :key=\"getKey(item, index)\" :index=\"index\" :record=\"item\">\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => !isIndexComponent(schema) && !isOperationComponent(schema)\"\n />\n </ArrayBase.Item>\n </ElCollapse>\n </template>\n <template v-for=\"(itemSchema, key) in schema.properties\" :key=\"key\">\n <RecursionField v-if=\"isAdditionComponent(itemSchema)\" :schema=\"itemSchema\" name=\"addition\" />\n </template>\n </ArrayBase>\n </div>\n</template>\n","import { composeExport } from '../__builtins__/shared'\nimport { ArrayBase } from '../array-base'\nimport ArrayCollapseItem from './array-collapse-item.vue'\nimport ArrayCollapseInner from './array-collapse.vue'\nimport './style.scss'\n\nexport const ArrayCollapse = composeExport(ArrayCollapseInner, {\n Item: ArrayCollapseItem,\n Index: ArrayBase.Index,\n SortHandle: ArrayBase.SortHandle,\n Addition: ArrayBase.Addition,\n Remove: ArrayBase.Remove,\n MoveDown: ArrayBase.MoveDown,\n MoveUp: ArrayBase.MoveUp,\n useArray: ArrayBase.useArray,\n useIndex: ArrayBase.useIndex,\n useRecord: ArrayBase.useRecord,\n})\n\nexport default ArrayCollapse\n"],"names":["field","useField","schema","useFieldSchema","index","useIndex","errorCount","observable","path","collapseItemProps","useCleanAttrs","_openBlock","_createBlock","_unref","_mergeProps","_createElementVNode","_hoisted_1","_createVNode","RecursionField","isIndexComponent","_renderSlot","_ctx","ElBadge","prefixCls","isOperationComponent","props","__props","fieldRef","schemaRef","collapseProps","activeKeys","ref","getKey","keyMap","ArrayBase","dataSource","autorun","isArr","range","count","_","i","takeDefaultActiveKeys","dataSourceLength","defaultOpenPanelCount","accordion","insertActiveKeys","buf","key","watchEffect","handleCollapseChange","keys","_createElementBlock","ElEmpty","_Fragment","_renderList","item","getArrayItemSchema","itemSchema","isAdditionComponent","ArrayCollapse","composeExport","ArrayCollapseInner","ArrayCollapseItem"],"mappings":";;;;;;;;;;;;;;;;AAgBA,UAAMA,IADWC,EAAA,EACM,OAEjBC,IADYC,EAAA,EACO,MAAM,QACzBC,IAAQC,GAAA,GACRC,IAAaC,EAAW,SAAS,MAAM;AAC3C,YAAMC,IAAOR,EAAM,QAAQ,OAAA;AAC3B,aAAOA,EAAM,KAAK,eAAe;AAAA,QAC/B,MAAM;AAAA,QACN,SAAS,GAAGQ,CAAI;AAAA,MAAA,CACjB,EAAE;AAAA,IACL,CAAC,GAEK,EAAE,OAAOC,EAAA,IAAsBC,EAAA;sBAInCC,KAA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