@silver-formily/element-plus 3.0.2 → 4.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/README.en-US.md +3 -1
- package/README.md +3 -1
- package/esm/__builtins__/configs/index.mjs +6 -5
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/shared/load-config-provider.mjs +19 -11
- package/esm/__builtins__/shared/load-config-provider.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +50 -46
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs +16 -15
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs +30 -31
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.mjs +74 -62
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +44 -32
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/_virtual/_/plugin-vue/export-helper.mjs +8 -0
- package/esm/array-base/array-base-addition.mjs +53 -0
- package/esm/array-base/array-base-addition.mjs.map +1 -0
- package/esm/array-base/array-base-index.mjs +17 -0
- package/esm/array-base/array-base-index.mjs.map +1 -0
- package/esm/array-base/array-base-inner.mjs +30 -0
- package/esm/array-base/array-base-inner.mjs.map +1 -0
- package/esm/array-base/array-base-item.mjs +21 -0
- package/esm/array-base/array-base-item.mjs.map +1 -0
- package/esm/array-base/array-base-move-down.mjs +45 -0
- package/esm/array-base/array-base-move-down.mjs.map +1 -0
- package/esm/array-base/array-base-move-up.mjs +45 -0
- package/esm/array-base/array-base-move-up.mjs.map +1 -0
- package/esm/array-base/array-base-remove.mjs +45 -0
- package/esm/array-base/array-base-remove.mjs.map +1 -0
- package/esm/array-base/array-base-sort-handle.mjs +33 -0
- package/esm/array-base/array-base-sort-handle.mjs.map +1 -0
- package/esm/array-base/index.mjs +28 -208
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/style.css +36 -0
- package/esm/array-base/symbols.mjs +7 -6
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/types.d.ts +23 -24
- package/esm/array-base/utils.d.ts +11 -17
- package/esm/array-base/utils.mjs +58 -60
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/array-cards.mjs +109 -0
- package/esm/array-cards/array-cards.mjs.map +1 -0
- package/esm/array-cards/index.d.ts +120 -113
- package/esm/array-cards/index.mjs +19 -118
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-cards/style.css +20 -0
- package/esm/array-collapse/array-collapse-item.mjs +74 -0
- package/esm/array-collapse/array-collapse-item.mjs.map +1 -0
- package/esm/array-collapse/array-collapse.mjs +117 -0
- package/esm/array-collapse/array-collapse.mjs.map +1 -0
- package/esm/array-collapse/index.d.ts +137 -129
- package/esm/array-collapse/index.mjs +21 -174
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/style.css +20 -0
- package/esm/array-collapse/utils.mjs +7 -12
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/array-items-item.mjs +22 -0
- package/esm/array-items/array-items-item.mjs.map +1 -0
- package/esm/array-items/array-items.mjs +88 -0
- package/esm/array-items/array-items.mjs.map +1 -0
- package/esm/array-items/index.d.ts +132 -125
- package/esm/array-items/index.mjs +21 -107
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-items/style.css +22 -0
- package/esm/array-list-tabs/array-list-tabs.mjs +191 -0
- package/esm/array-list-tabs/array-list-tabs.mjs.map +1 -0
- package/esm/array-list-tabs/index.d.ts +80 -74
- package/esm/array-list-tabs/index.mjs +12 -186
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/style.css +90 -0
- package/esm/array-list-tabs/utils.mjs +11 -15
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/array-table.mjs +236 -0
- package/esm/array-table/array-table.mjs.map +1 -0
- package/esm/array-table/index.d.ts +106 -1597
- package/esm/array-table/index.mjs +24 -223
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/style.css +23 -0
- package/esm/array-table/types.d.ts +11 -6
- package/esm/array-table/utils.mjs +14 -22
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/array-tabs.mjs +92 -0
- package/esm/array-tabs/array-tabs.mjs.map +1 -0
- package/esm/array-tabs/index.d.ts +7 -2
- package/esm/array-tabs/index.mjs +8 -84
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/array-tabs/style.css +7 -0
- package/esm/autocomplete/autocomplete.mjs +99 -0
- package/esm/autocomplete/autocomplete.mjs.map +1 -0
- package/esm/autocomplete/index.d.ts +44 -638
- package/esm/autocomplete/index.mjs +14 -113
- package/esm/autocomplete/index.mjs.map +1 -1
- package/esm/cascader/cascader.mjs +32 -0
- package/esm/cascader/cascader.mjs.map +1 -0
- package/esm/cascader/index.d.ts +34 -27
- package/esm/cascader/index.mjs +13 -50
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.mjs +64 -0
- package/esm/checkbox/checkbox-group.mjs.map +1 -0
- package/esm/checkbox/index.d.ts +772 -766
- package/esm/checkbox/index.mjs +16 -69
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +214 -207
- package/esm/color-picker/index.mjs +13 -17
- package/esm/color-picker/index.mjs.map +1 -1
- package/esm/color-picker-panel/index.d.ts +118 -110
- package/esm/color-picker-panel/index.mjs +16 -25
- package/esm/color-picker-panel/index.mjs.map +1 -1
- package/esm/date-picker/index.d.ts +449 -441
- package/esm/date-picker/index.mjs +21 -29
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.mjs +21 -26
- package/esm/date-picker/utils.mjs.map +1 -1
- package/esm/date-picker-panel/index.d.ts +149 -141
- package/esm/date-picker-panel/index.mjs +23 -30
- package/esm/date-picker-panel/index.mjs.map +1 -1
- package/esm/editable/editable-popover.mjs +95 -0
- package/esm/editable/editable-popover.mjs.map +1 -0
- package/esm/editable/editable.mjs +113 -0
- package/esm/editable/editable.mjs.map +1 -0
- package/esm/editable/index.d.ts +60 -141
- package/esm/editable/index.mjs +17 -219
- package/esm/editable/index.mjs.map +1 -1
- package/esm/editable/style.css +29 -0
- package/esm/form/form.mjs +50 -70
- package/esm/form/form.mjs.map +1 -1
- package/esm/form/form.vue.d.ts +48 -0
- package/esm/form/index.d.ts +1 -1
- package/esm/form-button-group/form-button-group-sticky.mjs +37 -0
- package/esm/form-button-group/form-button-group-sticky.mjs.map +1 -0
- package/esm/form-button-group/form-button-group.mjs +71 -0
- package/esm/form-button-group/form-button-group.mjs.map +1 -0
- package/esm/form-button-group/index.d.ts +94 -87
- package/esm/form-button-group/index.mjs +10 -96
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/style.css +281 -0
- package/esm/form-button-group/utils.mjs +7 -12
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/form-collapse.mjs +74 -0
- package/esm/form-collapse/form-collapse.mjs.map +1 -0
- package/esm/form-collapse/index.d.ts +43 -39
- package/esm/form-collapse/index.mjs +20 -86
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/style.css +7 -0
- package/esm/form-collapse/utils.d.ts +21 -27
- package/esm/form-collapse/utils.mjs +48 -46
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.mjs +118 -0
- package/esm/form-dialog/dialog-content.mjs.map +1 -0
- package/esm/form-dialog/index.d.ts +8 -4
- package/esm/form-dialog/index.mjs +142 -211
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +38 -32
- package/esm/form-drawer/drawer-content.mjs +118 -0
- package/esm/form-drawer/drawer-content.mjs.map +1 -0
- package/esm/form-drawer/index.d.ts +8 -4
- package/esm/form-drawer/index.mjs +142 -204
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +38 -32
- package/esm/form-grid/form-grid-column.mjs +28 -0
- package/esm/form-grid/form-grid-column.mjs.map +1 -0
- package/esm/form-grid/form-grid.mjs +69 -0
- package/esm/form-grid/form-grid.mjs.map +1 -0
- package/esm/form-grid/hooks.mjs +7 -7
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.d.ts +5 -2
- package/esm/form-grid/index.mjs +10 -109
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-grid/style.css +128 -0
- package/esm/form-item/form-item.mjs +308 -0
- package/esm/form-item/form-item.mjs.map +1 -0
- package/esm/form-item/form-item.vue.d.ts +29 -0
- package/esm/form-item/index.d.ts +81 -67
- package/esm/form-item/index.mjs +28 -332
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/style.css +263 -0
- package/esm/form-item/types.d.ts +34 -29
- package/esm/form-item/utils.mjs +15 -15
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +103 -83
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/form-layout.vue.d.ts +28 -0
- package/esm/form-layout/index.d.ts +1 -1
- package/esm/form-layout/types.d.ts +24 -40
- package/esm/form-layout/utils.mjs +73 -99
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/form-step-pane.mjs +15 -0
- package/esm/form-step/form-step-pane.mjs.map +1 -0
- package/esm/form-step/form-step.mjs +63 -0
- package/esm/form-step/form-step.mjs.map +1 -0
- package/esm/form-step/index.d.ts +29 -23
- package/esm/form-step/index.mjs +12 -93
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/types.d.ts +19 -19
- package/esm/form-step/utils.d.ts +14 -10
- package/esm/form-step/utils.mjs +75 -59
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/form-tab.mjs +79 -0
- package/esm/form-tab/form-tab.mjs.map +1 -0
- package/esm/form-tab/hooks.mjs +18 -16
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +5 -3
- package/esm/form-tab/index.mjs +10 -76
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/style.css +4 -0
- package/esm/form-tab/utils.mjs +14 -13
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +55 -48
- package/esm/index.mjs +51 -103
- package/esm/input/index.d.ts +41 -46
- package/esm/input/index.mjs +16 -68
- package/esm/input/index.mjs.map +1 -1
- package/esm/input/input.mjs +41 -0
- package/esm/input/input.mjs.map +1 -0
- package/esm/input-number/index.d.ts +281 -275
- package/esm/input-number/index.mjs +12 -24
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +29 -31
- package/esm/input-tag/index.mjs +13 -49
- package/esm/input-tag/index.mjs.map +1 -1
- package/esm/input-tag/input-tag.mjs +41 -0
- package/esm/input-tag/input-tag.mjs.map +1 -0
- package/esm/mention/index.d.ts +39 -49
- package/esm/mention/index.mjs +15 -96
- package/esm/mention/index.mjs.map +1 -1
- package/esm/mention/mention.mjs +77 -0
- package/esm/mention/mention.mjs.map +1 -0
- package/esm/pagination/components/jumper.mjs +11 -12
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/jumper2.mjs +59 -0
- package/esm/pagination/components/jumper2.mjs.map +1 -0
- package/esm/pagination/components/next.mjs +18 -22
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/next2.mjs +38 -0
- package/esm/pagination/components/next2.mjs.map +1 -0
- package/esm/pagination/components/pager.mjs +21 -22
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/pager2.mjs +229 -0
- package/esm/pagination/components/pager2.mjs.map +1 -0
- package/esm/pagination/components/prev.mjs +16 -22
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/prev2.mjs +38 -0
- package/esm/pagination/components/prev2.mjs.map +1 -0
- package/esm/pagination/components/sizes.mjs +32 -7
- package/esm/pagination/components/sizes.mjs.map +1 -1
- package/esm/pagination/components/sizes2.mjs +66 -0
- package/esm/pagination/components/sizes2.mjs.map +1 -0
- package/esm/pagination/components/total.mjs +10 -11
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/components/total2.mjs +26 -0
- package/esm/pagination/components/total2.mjs.map +1 -0
- package/esm/pagination/pagination.mjs +271 -626
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.d.ts +43 -48
- package/esm/password/index.mjs +11 -14
- package/esm/password/index.mjs.map +1 -1
- package/esm/picker-select/index.d.ts +47 -0
- package/esm/picker-select/index.mjs +14 -0
- package/esm/picker-select/index.mjs.map +1 -0
- package/esm/picker-select/picker-select.mjs +186 -0
- package/esm/picker-select/picker-select.mjs.map +1 -0
- package/esm/picker-select/types.d.ts +23 -0
- package/esm/preview-text/cascader.mjs +51 -0
- package/esm/preview-text/cascader.mjs.map +1 -0
- package/esm/preview-text/color-picker.mjs +37 -0
- package/esm/preview-text/color-picker.mjs.map +1 -0
- package/esm/preview-text/date-picker.mjs +61 -0
- package/esm/preview-text/date-picker.mjs.map +1 -0
- package/esm/preview-text/index.d.ts +107 -106
- package/esm/preview-text/index.mjs +25 -363
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/input.mjs +39 -0
- package/esm/preview-text/input.mjs.map +1 -0
- package/esm/preview-text/preview.mjs +30 -0
- package/esm/preview-text/preview.mjs.map +1 -0
- package/esm/preview-text/rate.mjs +32 -0
- package/esm/preview-text/rate.mjs.map +1 -0
- package/esm/preview-text/select.mjs +42 -0
- package/esm/preview-text/select.mjs.map +1 -0
- package/esm/preview-text/style.css +16 -0
- package/esm/preview-text/time-picker.mjs +39 -0
- package/esm/preview-text/time-picker.mjs.map +1 -0
- package/esm/preview-text/tree.mjs +73 -0
- package/esm/preview-text/tree.mjs.map +1 -0
- package/esm/preview-text/utils.d.ts +10 -13
- package/esm/preview-text/utils.mjs +15 -15
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.mjs +45 -45
- package/esm/query-form/default-components.mjs.map +1 -1
- package/esm/query-form/hooks.mjs +31 -26
- package/esm/query-form/hooks.mjs.map +1 -1
- package/esm/query-form/index.d.ts +115 -105
- package/esm/query-form/index.mjs +10 -333
- package/esm/query-form/index.mjs.map +1 -1
- package/esm/query-form/query-form-light.mjs +86 -0
- package/esm/query-form/query-form-light.mjs.map +1 -0
- package/esm/query-form/query-form.mjs +263 -0
- package/esm/query-form/query-form.mjs.map +1 -0
- package/esm/query-form/style.css +27 -0
- package/esm/query-form/types.d.ts +42 -41
- package/esm/query-form-item/index.d.ts +138 -131
- package/esm/query-form-item/index.mjs +15 -183
- package/esm/query-form-item/index.mjs.map +1 -1
- package/esm/query-form-item/query-form-item.mjs +195 -0
- package/esm/query-form-item/query-form-item.mjs.map +1 -0
- package/esm/query-form-item/style.css +12 -0
- package/esm/query-form-item/types.d.ts +42 -38
- package/esm/radio/index.d.ts +482 -472
- package/esm/radio/index.mjs +15 -68
- package/esm/radio/index.mjs.map +1 -1
- package/esm/radio/radio-group.mjs +70 -0
- package/esm/radio/radio-group.mjs.map +1 -0
- package/esm/{styles/radio/index.css → radio/style.css} +3 -1
- package/esm/rate/index.d.ts +190 -184
- package/esm/rate/index.mjs +13 -17
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.d.ts +5 -2
- package/esm/reset/index.mjs +8 -44
- package/esm/reset/index.mjs.map +1 -1
- package/esm/reset/reset.mjs +42 -0
- package/esm/reset/reset.mjs.map +1 -0
- package/esm/segmented/index.d.ts +31 -25
- package/esm/segmented/index.mjs +13 -40
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/segmented/segmented.mjs +26 -0
- package/esm/segmented/segmented.mjs.map +1 -0
- package/esm/select/index.d.ts +108 -121
- package/esm/select/index.mjs +14 -127
- package/esm/select/index.mjs.map +1 -1
- package/esm/select/select.mjs +95 -0
- package/esm/select/select.mjs.map +1 -0
- package/esm/select-table/index.d.ts +53 -1546
- package/esm/select-table/index.mjs +12 -204
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.mjs +202 -0
- package/esm/select-table/select-table.mjs.map +1 -0
- package/esm/select-table/style.css +14 -0
- package/esm/select-table/types.d.ts +21 -16
- package/esm/shared/overlay-elements.mjs +15 -16
- package/esm/shared/overlay-elements.mjs.map +1 -1
- package/esm/shared/url-change-listener.mjs +50 -0
- package/esm/shared/url-change-listener.mjs.map +1 -0
- package/esm/slider/index.d.ts +182 -174
- package/esm/slider/index.mjs +13 -17
- package/esm/slider/index.mjs.map +1 -1
- package/esm/space/index.d.ts +2 -1
- package/esm/space/index.mjs +2 -6
- package/esm/submit/index.d.ts +5 -2
- package/esm/submit/index.mjs +8 -40
- package/esm/submit/index.mjs.map +1 -1
- package/esm/submit/submit.mjs +41 -0
- package/esm/submit/submit.mjs.map +1 -0
- package/esm/switch/index.d.ts +255 -249
- package/esm/switch/index.mjs +8 -13
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +451 -443
- package/esm/time-picker/index.mjs +10 -17
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +189 -182
- package/esm/time-select/index.mjs +13 -17
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.d.ts +246 -238
- package/esm/transfer/index.mjs +8 -11
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +40 -33
- package/esm/tree/index.mjs +14 -104
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/tree.mjs +127 -0
- package/esm/tree/tree.mjs.map +1 -0
- package/esm/tree/types.d.ts +17 -12
- package/esm/tree/utils.mjs +157 -149
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +22 -15
- package/esm/tree-select/index.mjs +13 -40
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/tree-select/tree-select.mjs +38 -0
- package/esm/tree-select/tree-select.mjs.map +1 -0
- package/esm/upload/index.d.ts +117 -696
- package/esm/upload/index.mjs +11 -172
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.mjs +176 -0
- package/esm/upload/upload.mjs.map +1 -0
- package/package.json +24 -25
- package/esm/__builtins__/configs/index.d.ts +0 -1
- package/esm/__builtins__/index.d.ts +0 -2
- package/esm/__builtins__/index.mjs +0 -23
- package/esm/__builtins__/index.mjs.map +0 -1
- package/esm/__builtins__/shared/index.d.ts +0 -6
- package/esm/__builtins__/shared/index.mjs +0 -21
- package/esm/__builtins__/shared/index.mjs.map +0 -1
- package/esm/__builtins__/shared/load-config-provider.d.ts +0 -2
- package/esm/__builtins__/shared/loading.d.ts +0 -12
- package/esm/__builtins__/shared/simple-version-compare.d.ts +0 -2
- package/esm/__builtins__/shared/transform-component.d.ts +0 -3
- package/esm/__builtins__/shared/types.d.ts +0 -2
- package/esm/__builtins__/shared/types.mjs +0 -2
- package/esm/__builtins__/shared/types.mjs.map +0 -1
- package/esm/__builtins__/shared/use-enter-submit.d.ts +0 -9
- package/esm/__builtins__/shared/utils.d.ts +0 -9
- package/esm/array-base/array-base-addition.d.ts +0 -5
- package/esm/array-base/array-base-index.d.ts +0 -19
- package/esm/array-base/array-base-inner.d.ts +0 -18
- package/esm/array-base/array-base-item.d.ts +0 -18
- package/esm/array-base/array-base-move-down.d.ts +0 -18
- package/esm/array-base/array-base-move-up.d.ts +0 -18
- package/esm/array-base/array-base-remove.d.ts +0 -18
- package/esm/array-base/array-base-sort-handle.d.ts +0 -2
- package/esm/array-base/index.d.ts +0 -114
- package/esm/array-base/symbols.d.ts +0 -4
- package/esm/array-base/types.mjs +0 -2
- package/esm/array-base/types.mjs.map +0 -1
- package/esm/array-cards/array-cards.d.ts +0 -13
- package/esm/array-collapse/array-collapse-item.d.ts +0 -18
- package/esm/array-collapse/array-collapse.d.ts +0 -16
- package/esm/array-collapse/utils.d.ts +0 -1
- package/esm/array-items/array-items-item.d.ts +0 -30
- package/esm/array-items/array-items.d.ts +0 -2
- package/esm/array-list-tabs/array-list-tabs.d.ts +0 -31
- package/esm/array-list-tabs/utils.d.ts +0 -3
- package/esm/array-table/array-table.d.ts +0 -1505
- package/esm/array-table/types.mjs +0 -2
- package/esm/array-table/types.mjs.map +0 -1
- package/esm/array-table/utils.d.ts +0 -5
- package/esm/array-tabs/array-tabs.d.ts +0 -2
- package/esm/autocomplete/autocomplete.d.ts +0 -1222
- package/esm/cascader/cascader.d.ts +0 -25
- package/esm/checkbox/checkbox-group.d.ts +0 -42
- package/esm/date-picker/utils.d.ts +0 -4
- package/esm/editable/editable-popover.d.ts +0 -25
- package/esm/editable/editable.d.ts +0 -193
- package/esm/env.d.d.ts +0 -1
- package/esm/env.d.mjs +0 -2
- package/esm/env.d.mjs.map +0 -1
- package/esm/form/form.d.ts +0 -46
- package/esm/form/index.mjs +0 -6
- package/esm/form/index.mjs.map +0 -1
- package/esm/form-button-group/form-button-group-sticky.d.ts +0 -17
- package/esm/form-button-group/form-button-group.d.ts +0 -57
- package/esm/form-button-group/utils.d.ts +0 -1
- package/esm/form-collapse/form-collapse.d.ts +0 -18
- package/esm/form-dialog/dialog-content.d.ts +0 -846
- package/esm/form-dialog/types.mjs +0 -2
- package/esm/form-dialog/types.mjs.map +0 -1
- package/esm/form-drawer/drawer-content.d.ts +0 -976
- package/esm/form-drawer/types.mjs +0 -2
- package/esm/form-drawer/types.mjs.map +0 -1
- package/esm/form-grid/form-grid-column.d.ts +0 -29
- package/esm/form-grid/form-grid.d.ts +0 -101
- package/esm/form-grid/hooks.d.ts +0 -4
- package/esm/form-item/form-item.d.ts +0 -19
- package/esm/form-item/types.mjs +0 -2
- package/esm/form-item/types.mjs.map +0 -1
- package/esm/form-item/utils.d.ts +0 -3
- package/esm/form-layout/form-layout.d.ts +0 -31
- package/esm/form-layout/index.mjs +0 -6
- package/esm/form-layout/index.mjs.map +0 -1
- package/esm/form-layout/types.mjs +0 -2
- package/esm/form-layout/types.mjs.map +0 -1
- package/esm/form-layout/utils.d.ts +0 -57
- package/esm/form-step/form-step-pane.d.ts +0 -2
- package/esm/form-step/form-step.d.ts +0 -5
- package/esm/form-step/types.mjs +0 -2
- package/esm/form-step/types.mjs.map +0 -1
- package/esm/form-tab/form-tab.d.ts +0 -7
- package/esm/form-tab/hooks.d.ts +0 -8
- package/esm/form-tab/types.d.ts +0 -12
- package/esm/form-tab/types.mjs +0 -2
- package/esm/form-tab/types.mjs.map +0 -1
- package/esm/form-tab/utils.d.ts +0 -4
- package/esm/index.mjs.map +0 -1
- package/esm/input/input.d.ts +0 -25
- package/esm/input-tag/input-tag.d.ts +0 -32
- package/esm/mention/mention.d.ts +0 -51
- package/esm/pagination/components/jumper.d.ts +0 -16
- package/esm/pagination/components/next.d.ts +0 -42
- package/esm/pagination/components/pager.d.ts +0 -42
- package/esm/pagination/components/prev.d.ts +0 -39
- package/esm/pagination/components/sizes.d.ts +0 -56
- package/esm/pagination/components/total.d.ts +0 -8
- package/esm/pagination/pagination.d.ts +0 -128
- package/esm/preview-text/cascader.d.ts +0 -5
- package/esm/preview-text/color-picker.d.ts +0 -5
- package/esm/preview-text/date-picker.d.ts +0 -5
- package/esm/preview-text/input.d.ts +0 -28
- package/esm/preview-text/preview.d.ts +0 -18
- package/esm/preview-text/rate.d.ts +0 -5
- package/esm/preview-text/select.d.ts +0 -5
- package/esm/preview-text/time-picker.d.ts +0 -5
- package/esm/preview-text/tree.d.ts +0 -22
- package/esm/query-form/default-components.d.ts +0 -5
- package/esm/query-form/hooks.d.ts +0 -25
- package/esm/query-form/query-form-light.d.ts +0 -27
- package/esm/query-form/query-form.d.ts +0 -52
- package/esm/query-form/types.mjs +0 -2
- package/esm/query-form/types.mjs.map +0 -1
- package/esm/query-form-item/query-form-item.d.ts +0 -96
- package/esm/query-form-item/types.mjs +0 -2
- package/esm/query-form-item/types.mjs.map +0 -1
- package/esm/radio/radio-group.d.ts +0 -33
- package/esm/reset/reset.d.ts +0 -45
- package/esm/segmented/segmented.d.ts +0 -25
- package/esm/select/select.d.ts +0 -45
- package/esm/select-table/select-table.d.ts +0 -3030
- package/esm/select-table/types.mjs +0 -2
- package/esm/select-table/types.mjs.map +0 -1
- package/esm/shared/overlay-elements.d.ts +0 -6
- package/esm/space/index.mjs.map +0 -1
- package/esm/styles/array-base/index.css +0 -1
- package/esm/styles/array-cards/index.css +0 -1
- package/esm/styles/array-collapse/index.css +0 -1
- package/esm/styles/array-items/index.css +0 -1
- package/esm/styles/array-list-tabs/index.css +0 -1
- package/esm/styles/array-table/index.css +0 -1
- package/esm/styles/array-tabs/index.css +0 -1
- package/esm/styles/editable/index.css +0 -1
- package/esm/styles/form-button-group/index.css +0 -1
- package/esm/styles/form-collapse/index.css +0 -1
- package/esm/styles/form-grid/index.css +0 -1
- package/esm/styles/form-item/index.css +0 -1
- package/esm/styles/form-tab/index.css +0 -1
- package/esm/styles/preview-text/index.css +0 -1
- package/esm/styles/query-form/index.css +0 -1
- package/esm/styles/query-form-item/index.css +0 -1
- package/esm/styles/select-table/index.css +0 -1
- package/esm/submit/submit.d.ts +0 -36
- package/esm/tree/tree.d.ts +0 -20
- package/esm/tree/types.mjs +0 -2
- package/esm/tree/types.mjs.map +0 -1
- package/esm/tree/utils.d.ts +0 -45
- package/esm/tree-select/tree-select.d.ts +0 -10
- package/esm/upload/upload.d.ts +0 -1259
- package/esm/vendor/icon.mjs +0 -11
- package/esm/vendor/icon.mjs.map +0 -1
- package/esm/vendor/lodash.mjs +0 -1506
- package/esm/vendor/lodash.mjs.map +0 -1
- package/esm/vendor/runtime.mjs +0 -34
- package/esm/vendor/runtime.mjs.map +0 -1
- package/esm/vendor/shared.esm-bundler.mjs +0 -9
- package/esm/vendor/shared.esm-bundler.mjs.map +0 -1
- package/esm/vendor/sizes.mjs +0 -27
- package/esm/vendor/sizes.mjs.map +0 -1
- package/esm/vendor/types.mjs +0 -19
- package/esm/vendor/types.mjs.map +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
.formily-element-plus-array-list-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
border: 1px solid var(--el-border-color);
|
|
4
|
+
border-radius: var(--el-border-radius-base);
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
.formily-element-plus-array-list-tabs .el-empty {
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list {
|
|
11
|
+
width: 220px;
|
|
12
|
+
border-right: 1px solid var(--el-border-color);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
list-style-type: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
}
|
|
19
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list--scroll-wrapper {
|
|
20
|
+
padding: 12px;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item {
|
|
26
|
+
padding: 0 12px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
line-height: 40px;
|
|
29
|
+
border-radius: var(--el-border-radius-base);
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
list-style: none;
|
|
35
|
+
font-size: var(--el-font-size-base);
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
color: var(--el-text-color-regular);
|
|
38
|
+
transition: all 0.3s;
|
|
39
|
+
}
|
|
40
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item--content {
|
|
41
|
+
height: 100%;
|
|
42
|
+
flex: 1;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
}
|
|
47
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item--title {
|
|
48
|
+
display: block;
|
|
49
|
+
width: 100%;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
user-select: none;
|
|
54
|
+
}
|
|
55
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item--close {
|
|
56
|
+
visibility: hidden;
|
|
57
|
+
border-radius: 2px;
|
|
58
|
+
}
|
|
59
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item--close:hover {
|
|
60
|
+
background-color: var(--el-fill-color-dark);
|
|
61
|
+
}
|
|
62
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item:hover {
|
|
63
|
+
color: var(--el-color-primary);
|
|
64
|
+
background-color: var(--el-fill-color-light);
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item:hover .formily-element-plus-array-list-tabs_list-item--close {
|
|
68
|
+
visibility: visible;
|
|
69
|
+
}
|
|
70
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item.is-active {
|
|
71
|
+
color: var(--el-color-primary);
|
|
72
|
+
background-color: var(--el-fill-color-light);
|
|
73
|
+
}
|
|
74
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs_list-item.is-active .formily-element-plus-array-list-tabs_list-item--title {
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
}
|
|
77
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs-tabpane {
|
|
78
|
+
flex: 1;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
padding: 15px;
|
|
81
|
+
}
|
|
82
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-list-tabs-errors-badge {
|
|
83
|
+
line-height: 1;
|
|
84
|
+
vertical-align: initial;
|
|
85
|
+
max-width: 90%;
|
|
86
|
+
}
|
|
87
|
+
.formily-element-plus-array-list-tabs .formily-element-plus-array-base-addition {
|
|
88
|
+
width: auto;
|
|
89
|
+
margin: 6px;
|
|
90
|
+
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { stylePrefix
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const u = `${i}-array-list-tabs`;
|
|
9
|
-
function l(r, t) {
|
|
10
|
-
return r.type !== "void" ? r.name === t : r.properties ? t in r.properties : !1;
|
|
1
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
//#region src/array-list-tabs/utils.ts
|
|
3
|
+
const prefixCls = `${stylePrefix}-array-list-tabs`;
|
|
4
|
+
function isTabTitleComponent(schema, tabTitleField) {
|
|
5
|
+
if (schema.type !== "void") return schema.name === tabTitleField;
|
|
6
|
+
if (schema.properties) return tabTitleField in schema.properties;
|
|
7
|
+
return false;
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=utils.mjs.map
|
|
9
|
+
//#endregion
|
|
10
|
+
export { isTabTitleComponent, prefixCls };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/array-list-tabs/utils.ts"],"sourcesContent":["import type { ISchema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\n\nexport const prefixCls = `${stylePrefix}-array-list-tabs`\n\nexport function isTabTitleComponent(schema: ISchema, tabTitleField: string) {\n if (schema.type !== 'void') {\n return schema.name === tabTitleField\n }\n if (schema.properties) {\n return tabTitleField in schema.properties\n }\n return false\n}\n"],"
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/array-list-tabs/utils.ts"],"sourcesContent":["import type { ISchema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\n\nexport const prefixCls = `${stylePrefix}-array-list-tabs`\n\nexport function isTabTitleComponent(schema: ISchema, tabTitleField: string) {\n if (schema.type !== 'void') {\n return schema.name === tabTitleField\n }\n if (schema.properties) {\n return tabTitleField in schema.properties\n }\n return false\n}\n"],"mappings":";;AAGA,MAAa,YAAY,GAAG,YAAY;AAExC,SAAgB,oBAAoB,QAAiB,eAAuB;AAC1E,KAAI,OAAO,SAAS,OAClB,QAAO,OAAO,SAAS;AAEzB,KAAI,OAAO,WACT,QAAO,iBAAiB,OAAO;AAEjC,QAAO"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { useCleanAttrs } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
3
|
+
import { isAdditionComponent } from "../array-base/utils.mjs";
|
|
4
|
+
import { ArrayBase } from "../array-base/index.mjs";
|
|
5
|
+
import pagination_default from "../pagination/pagination.mjs";
|
|
6
|
+
import { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls } from "./utils.mjs";
|
|
7
|
+
import { ElTable, ElTableColumn, vLoading } from "element-plus";
|
|
8
|
+
import { autorunEffect, formilyComputed, reactionWatch } from "@silver-formily/reactive-vue";
|
|
9
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withDirectives } from "vue";
|
|
10
|
+
import { RecursionField, useField, useFieldSchema } from "@silver-formily/vue";
|
|
11
|
+
import { isArr, isEqual } from "@formily/shared";
|
|
12
|
+
import { omit } from "lodash-es";
|
|
13
|
+
import { VueDraggable } from "vue-draggable-plus";
|
|
14
|
+
//#region src/array-table/array-table.vue
|
|
15
|
+
const _hoisted_1 = { key: 1 };
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
name: "FArrayTable",
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
__name: "array-table",
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: { default: () => [] },
|
|
22
|
+
pagination: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
paginationProps: {},
|
|
27
|
+
height: {}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const { props: elTableProps } = useCleanAttrs();
|
|
32
|
+
const paginationProps = computed(() => omit(props.paginationProps, ["pageSize", "currentPage"]));
|
|
33
|
+
const fieldRef = useField();
|
|
34
|
+
const field = fieldRef.value;
|
|
35
|
+
const schemaRef = useFieldSchema();
|
|
36
|
+
const additionSchemas = computed(() => schemaRef.value?.properties ?? {});
|
|
37
|
+
const { getKey, keyMap } = ArrayBase.useKey(schemaRef.value);
|
|
38
|
+
const elTableRef = ref();
|
|
39
|
+
function extractTableSources(schema) {
|
|
40
|
+
if (isTableComponent(schema)) return createTableSource(schema);
|
|
41
|
+
return schema.properties ? Object.values(schema.properties).flatMap((element) => extractTableSources(element)) : [];
|
|
42
|
+
}
|
|
43
|
+
function createTableSource(schema) {
|
|
44
|
+
const propName = schema["x-component-props"]?.prop || schema.name;
|
|
45
|
+
/* istanbul ignore if -- @preserve */
|
|
46
|
+
if (!propName) return [];
|
|
47
|
+
const field = fieldRef.value.query(fieldRef.value.address.concat(propName)).take();
|
|
48
|
+
return [{
|
|
49
|
+
name: propName,
|
|
50
|
+
display: field?.display || schema["x-display"],
|
|
51
|
+
required: hasRequiredProperty(schema),
|
|
52
|
+
field,
|
|
53
|
+
fieldProps: field?.props || schema.toFieldProps(),
|
|
54
|
+
schema,
|
|
55
|
+
columnProps: (field?.component)?.[1] || schema["x-component-props"] || {}
|
|
56
|
+
}];
|
|
57
|
+
}
|
|
58
|
+
const triggerUpdateKey = ref(0);
|
|
59
|
+
reactionWatch(() => {
|
|
60
|
+
const path = field.path.entire;
|
|
61
|
+
return field.query(`${path}.*`).map((item) => {
|
|
62
|
+
return {
|
|
63
|
+
name: item.component[0],
|
|
64
|
+
visible: item.visible
|
|
65
|
+
};
|
|
66
|
+
}).filter((item) => item.name.includes("Column"));
|
|
67
|
+
}, async () => {
|
|
68
|
+
triggerUpdateKey.value++;
|
|
69
|
+
}, { equals: isEqual });
|
|
70
|
+
const dataSource = ref([]);
|
|
71
|
+
const pageSize = ref(props.paginationProps?.pageSize ?? 10);
|
|
72
|
+
const currentPage = ref(props.paginationProps?.currentPage ?? 1);
|
|
73
|
+
function updateDataSource() {
|
|
74
|
+
/* istanbul ignore if -- @preserve */
|
|
75
|
+
if (!isArr(field.value)) {
|
|
76
|
+
dataSource.value = [];
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (props.pagination === false) {
|
|
80
|
+
dataSource.value = [...field.value];
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
dataSource.value = field.value.slice((currentPage.value - 1) * pageSize.value, currentPage.value * pageSize.value);
|
|
84
|
+
}
|
|
85
|
+
watch([pageSize, currentPage], updateDataSource);
|
|
86
|
+
autorunEffect(updateDataSource);
|
|
87
|
+
const sources = formilyComputed(() => {
|
|
88
|
+
const schema = schemaRef.value.items;
|
|
89
|
+
return (isArr(schema) ? schema : [schema]).reduce((columns, schema) => {
|
|
90
|
+
const item = extractTableSources(schema);
|
|
91
|
+
return columns.concat(item);
|
|
92
|
+
}, []).filter((item) => item.display !== "none");
|
|
93
|
+
});
|
|
94
|
+
const columns = computed(() => {
|
|
95
|
+
return (sources.value ?? []).map((source, index) => ({
|
|
96
|
+
source,
|
|
97
|
+
index
|
|
98
|
+
})).filter(({ source }) => source.display === "visible" && isColumnComponent(source.schema)).map(({ source, index: key }) => {
|
|
99
|
+
const { name, columnProps, required, field } = source;
|
|
100
|
+
const { title, asterisk, ...restProps } = columnProps;
|
|
101
|
+
return {
|
|
102
|
+
key,
|
|
103
|
+
props: {
|
|
104
|
+
label: title,
|
|
105
|
+
...restProps,
|
|
106
|
+
prop: name
|
|
107
|
+
},
|
|
108
|
+
field,
|
|
109
|
+
asterisk: asterisk ?? required
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const stateManagerColumns = computed(() => {
|
|
114
|
+
return (sources.value ?? []).filter((column) => {
|
|
115
|
+
return column.display !== "none" && isColumnComponent(column.schema);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
const baseIndex = computed(() => {
|
|
119
|
+
return (currentPage.value - 1) * pageSize.value;
|
|
120
|
+
});
|
|
121
|
+
async function onAddItemClick() {
|
|
122
|
+
if (props.pagination === false) {
|
|
123
|
+
await nextTick();
|
|
124
|
+
const scrollWarpDOM = elTableRef.value?.$el.querySelector(".el-scrollbar__wrap");
|
|
125
|
+
scrollWarpDOM?.scrollTo({
|
|
126
|
+
top: scrollWarpDOM.scrollHeight,
|
|
127
|
+
behavior: "smooth"
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
/* istanbul ignore if -- @preserve */
|
|
132
|
+
if (!isArr(field.value)) {
|
|
133
|
+
currentPage.value = 1;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
currentPage.value = Math.ceil(field.value.length / pageSize.value);
|
|
137
|
+
}
|
|
138
|
+
async function handleDragEnd(evt) {
|
|
139
|
+
const { oldIndex, newIndex } = evt;
|
|
140
|
+
await field.move(oldIndex, newIndex);
|
|
141
|
+
triggerUpdateKey.value++;
|
|
142
|
+
}
|
|
143
|
+
return (_ctx, _cache) => {
|
|
144
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(prefixCls)) }, [(openBlock(), createBlock(unref(ArrayBase), {
|
|
145
|
+
key: triggerUpdateKey.value,
|
|
146
|
+
"key-map": unref(keyMap),
|
|
147
|
+
add: onAddItemClick
|
|
148
|
+
}, {
|
|
149
|
+
default: withCtx(() => [
|
|
150
|
+
createVNode(unref(VueDraggable), {
|
|
151
|
+
"model-value": dataSource.value,
|
|
152
|
+
target: "tbody",
|
|
153
|
+
handle: `.${unref(stylePrefix)}-array-base-sort-handle`,
|
|
154
|
+
animation: 150,
|
|
155
|
+
onEnd: handleDragEnd
|
|
156
|
+
}, {
|
|
157
|
+
default: withCtx(() => [withDirectives((openBlock(), createBlock(unref(ElTable), mergeProps({
|
|
158
|
+
ref_key: "elTableRef",
|
|
159
|
+
ref: elTableRef,
|
|
160
|
+
"row-key": unref(getKey),
|
|
161
|
+
data: dataSource.value
|
|
162
|
+
}, unref(elTableProps)), {
|
|
163
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(columns.value, (column, colIndex) => {
|
|
164
|
+
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
165
|
+
key: column.key,
|
|
166
|
+
ref_for: true
|
|
167
|
+
}, column.props), {
|
|
168
|
+
default: withCtx(({ row, $index }) => [(openBlock(), createBlock(unref(ArrayBase).Item, {
|
|
169
|
+
key: unref(getKey)(row),
|
|
170
|
+
index: $index + baseIndex.value,
|
|
171
|
+
record: row
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [(openBlock(), createBlock(unref(RecursionField), {
|
|
174
|
+
key: `${unref(getKey)(row)}`,
|
|
175
|
+
schema: unref(sources)[colIndex].schema,
|
|
176
|
+
name: $index + baseIndex.value,
|
|
177
|
+
"only-render-properties": ""
|
|
178
|
+
}, null, 8, ["schema", "name"]))]),
|
|
179
|
+
_: 2
|
|
180
|
+
}, 1032, ["index", "record"]))]),
|
|
181
|
+
header: withCtx(({ column: col }) => [column.field.content?.header ? (openBlock(), createBlock(resolveDynamicComponent(column.field.content.header), mergeProps({
|
|
182
|
+
key: 0,
|
|
183
|
+
ref_for: true
|
|
184
|
+
}, {
|
|
185
|
+
...col,
|
|
186
|
+
field: unref(field)
|
|
187
|
+
}), null, 16)) : column.asterisk ? (openBlock(), createElementBlock("span", _hoisted_1, [createElementVNode("span", { class: normalizeClass(`${unref(prefixCls)}-asterisk`) }, "*", 2), createTextVNode(" " + toDisplayString(col.label), 1)])) : createCommentVNode("v-if", true)]),
|
|
188
|
+
_: 2
|
|
189
|
+
}, 1040);
|
|
190
|
+
}), 128))]),
|
|
191
|
+
_: 1
|
|
192
|
+
}, 16, ["row-key", "data"])), [[unref(vLoading), unref(field).loading]])]),
|
|
193
|
+
_: 1
|
|
194
|
+
}, 8, ["model-value", "handle"]),
|
|
195
|
+
createCommentVNode(" 状态管理器 "),
|
|
196
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(stateManagerColumns.value, (column, key) => {
|
|
197
|
+
return openBlock(), createBlock(unref(RecursionField), {
|
|
198
|
+
key,
|
|
199
|
+
name: column.name,
|
|
200
|
+
schema: column.schema,
|
|
201
|
+
"only-render-self": true
|
|
202
|
+
}, null, 8, ["name", "schema"]);
|
|
203
|
+
}), 128)),
|
|
204
|
+
props.pagination ? (openBlock(), createBlock(unref(pagination_default), mergeProps({
|
|
205
|
+
key: 0,
|
|
206
|
+
"current-page": currentPage.value,
|
|
207
|
+
"onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
|
|
208
|
+
"page-size": pageSize.value,
|
|
209
|
+
"onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pageSize.value = $event),
|
|
210
|
+
class: `${unref(prefixCls)}-pagination`,
|
|
211
|
+
background: "",
|
|
212
|
+
layout: "total, sizes, prev, pager, next",
|
|
213
|
+
total: props.modelValue.length
|
|
214
|
+
}, paginationProps.value), null, 16, [
|
|
215
|
+
"current-page",
|
|
216
|
+
"page-size",
|
|
217
|
+
"class",
|
|
218
|
+
"total"
|
|
219
|
+
])) : createCommentVNode("v-if", true),
|
|
220
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(additionSchemas.value, (itemSchema, key) => {
|
|
221
|
+
return openBlock(), createElementBlock(Fragment, { key }, [unref(isAdditionComponent)(itemSchema) ? (openBlock(), createBlock(unref(RecursionField), {
|
|
222
|
+
key: 0,
|
|
223
|
+
schema: itemSchema,
|
|
224
|
+
name: "addition"
|
|
225
|
+
}, null, 8, ["schema"])) : createCommentVNode("v-if", true)], 64);
|
|
226
|
+
}), 128))
|
|
227
|
+
]),
|
|
228
|
+
_: 1
|
|
229
|
+
}, 8, ["key-map"]))], 2);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
//#endregion
|
|
234
|
+
export { _sfc_main as default };
|
|
235
|
+
|
|
236
|
+
//# sourceMappingURL=array-table.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-table.mjs","names":[],"sources":["../../src/array-table/array-table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ArrayField } from '@formily/core'\nimport type { Schema } from '@formily/json-schema'\nimport type { TableInstance } from 'element-plus'\nimport type { IArrayTableProps } from './types'\nimport { isArr, isEqual } from '@formily/shared'\nimport { autorunEffect, formilyComputed, reactionWatch } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElTable, ElTableColumn, vLoading } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { VueDraggable } from 'vue-draggable-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { ArrayBase } from '../array-base'\nimport { isAdditionComponent } from '../array-base/utils'\nimport ElPagination from '../pagination/pagination'\nimport { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls } from './utils'\n\ndefineOptions({\n name: 'FArrayTable',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IArrayTableProps>(), {\n modelValue: () => [],\n pagination: true,\n})\nconst { props: elTableProps } = useCleanAttrs()\nconst paginationProps = computed(() => omit(props.paginationProps, ['pageSize', 'currentPage']))\nconst fieldRef = useField<ArrayField>()\nconst field = fieldRef.value\nconst schemaRef = useFieldSchema()\nconst additionSchemas = computed<Record<string, Schema>>(() => schemaRef.value?.properties ?? {})\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\n\nconst elTableRef = ref<TableInstance>()\n\nfunction extractTableSources(schema: Schema): any[] {\n if (isTableComponent(schema)) {\n return createTableSource(schema)\n }\n return schema.properties\n ? Object.values(schema.properties).flatMap(element => extractTableSources(element))\n : []\n}\n\nfunction createTableSource(schema: Schema): any[] {\n const propName = schema['x-component-props']?.prop || schema.name\n /* istanbul ignore if -- @preserve */\n if (!propName)\n return []\n\n const field = fieldRef.value.query(fieldRef.value.address.concat(propName)).take()\n\n return [{\n name: propName,\n display: field?.display || schema['x-display'],\n required: hasRequiredProperty(schema),\n field,\n fieldProps: field?.props || schema.toFieldProps(),\n schema,\n columnProps: (field?.component as any[])?.[1] || schema['x-component-props'] || {},\n }]\n}\n\nconst triggerUpdateKey = ref(0)\nreactionWatch(() => {\n const path = field.path.entire\n return field.query(`${path}.*`).map((item) => {\n return {\n name: item.component[0],\n visible: item.visible,\n }\n }).filter(item => item.name.includes('Column'))\n}, async () => {\n triggerUpdateKey.value++\n}, { equals: isEqual })\n\nconst dataSource = ref([])\nconst pageSize = ref(props.paginationProps?.pageSize ?? 10)\nconst currentPage = ref(props.paginationProps?.currentPage ?? 1)\n\nfunction updateDataSource() {\n /* istanbul ignore if -- @preserve */\n if (!isArr(field.value)) {\n dataSource.value = []\n return\n }\n if (props.pagination === false) {\n dataSource.value = [...field.value]\n return\n }\n dataSource.value = field.value.slice((currentPage.value - 1) * pageSize.value, (currentPage.value) * pageSize.value)\n}\nwatch([pageSize, currentPage], updateDataSource)\nautorunEffect(updateDataSource)\n\nconst sources = formilyComputed(() => {\n const schema = schemaRef.value.items\n const items = isArr(schema) ? schema : [schema]\n return items.reduce((columns, schema) => {\n const item = extractTableSources(schema)\n return columns.concat(item)\n }, []).filter(item => item.display !== 'none')\n})\n\nconst columns = computed(() => {\n const currentSources = sources.value ?? []\n return currentSources\n .map((source, index) => ({ source, index }))\n .filter(({ source }) => source.display === 'visible' && isColumnComponent(source.schema))\n .map(({ source, index: key }) => {\n const { name, columnProps, required, field } = source\n const { title, asterisk, ...restProps } = columnProps\n const props = {\n label: title,\n ...restProps,\n prop: name,\n }\n return {\n key,\n props,\n field,\n asterisk: asterisk ?? required,\n }\n })\n})\n\nconst stateManagerColumns = computed(() => {\n const currentSources = sources.value ?? []\n return currentSources.filter((column) => {\n return column.display !== 'none' && isColumnComponent(column.schema)\n })\n})\n\nconst baseIndex = computed(() => {\n return (currentPage.value - 1) * pageSize.value\n})\n\nasync function onAddItemClick() {\n if (props.pagination === false) {\n await nextTick()\n const scrollWarpDOM = elTableRef.value?.$el.querySelector('.el-scrollbar__wrap')\n scrollWarpDOM?.scrollTo({\n top: scrollWarpDOM.scrollHeight,\n behavior: 'smooth',\n })\n return\n }\n /* istanbul ignore if -- @preserve */\n if (!isArr(field.value)) {\n currentPage.value = 1\n return\n }\n currentPage.value = Math.ceil(field.value.length / pageSize.value)\n}\n\nasync function handleDragEnd(evt: { oldIndex: number, newIndex: number }) {\n const { oldIndex, newIndex } = evt\n await field.move(oldIndex, newIndex)\n triggerUpdateKey.value++\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ArrayBase :key=\"triggerUpdateKey\" :key-map=\"keyMap\" :add=\"onAddItemClick\">\n <VueDraggable\n :model-value=\"dataSource\" target=\"tbody\" :handle=\"`.${stylePrefix}-array-base-sort-handle`\"\n :animation=\"150\" @end=\"handleDragEnd\"\n >\n <ElTable ref=\"elTableRef\" v-loading=\"field.loading\" :row-key=\"getKey\" :data=\"dataSource\" v-bind=\"elTableProps\">\n <template v-for=\"(column, colIndex) of columns\" :key=\"column.key\">\n <ElTableColumn v-bind=\"column.props\">\n <template #default=\"{ row, $index }\">\n <ArrayBase.Item :key=\"getKey(row)\" :index=\"$index + baseIndex\" :record=\"row\">\n <RecursionField\n :key=\"`${getKey(row)}`\" :schema=\"sources[colIndex].schema\"\n :name=\"$index + baseIndex\" only-render-properties\n />\n </ArrayBase.Item>\n </template>\n <template #header=\"{ column: col }\">\n <template v-if=\"column.field.content?.header\">\n <component :is=\"column.field.content.header\" v-bind=\"{ ...col, field }\" />\n </template>\n <span v-else-if=\"column.asterisk\">\n <span :class=\"`${prefixCls}-asterisk`\">*</span>\n {{ col.label }}\n </span>\n </template>\n </ElTableColumn>\n </template>\n </ElTable>\n </VueDraggable>\n\n <!-- 状态管理器 -->\n <template v-for=\"(column, key) of stateManagerColumns\" :key=\"key\">\n <RecursionField :name=\"column.name\" :schema=\"column.schema\" :only-render-self=\"true\" />\n </template>\n <ElPagination\n v-if=\"props.pagination\" v-model:current-page=\"currentPage\" v-model:page-size=\"pageSize\"\n :class=\"`${prefixCls}-pagination`\" background layout=\"total, sizes, prev, pager, next\"\n :total=\"props.modelValue.length\" v-bind=\"paginationProps\"\n />\n <template v-for=\"(itemSchema, key) of additionSchemas\" :key=\"key\">\n <RecursionField v-if=\"isAdditionComponent(itemSchema)\" :schema=\"itemSchema\" name=\"addition\" />\n </template>\n </ArrayBase>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAAQ;EAId,MAAM,EAAE,OAAO,iBAAiB,eAAc;EAC9C,MAAM,kBAAkB,eAAe,KAAK,MAAM,iBAAiB,CAAC,YAAY,cAAc,CAAC,CAAA;EAC/F,MAAM,WAAW,UAAqB;EACtC,MAAM,QAAQ,SAAS;EACvB,MAAM,YAAY,gBAAe;EACjC,MAAM,kBAAkB,eAAuC,UAAU,OAAO,cAAc,EAAE,CAAA;EAChG,MAAM,EAAE,QAAQ,WAAW,UAAU,OAAO,UAAU,MAAK;EAE3D,MAAM,aAAa,KAAmB;EAEtC,SAAS,oBAAoB,QAAuB;AAClD,OAAI,iBAAiB,OAAO,CAC1B,QAAO,kBAAkB,OAAM;AAEjC,UAAO,OAAO,aACV,OAAO,OAAO,OAAO,WAAW,CAAC,SAAQ,YAAW,oBAAoB,QAAQ,CAAA,GAChF,EAAC;;EAGP,SAAS,kBAAkB,QAAuB;GAChD,MAAM,WAAW,OAAO,sBAAsB,QAAQ,OAAO;;AAE7D,OAAI,CAAC,SACH,QA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