@silver-formily/element-plus 3.0.2 → 3.0.3
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 +1 -1
- package/README.md +1 -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 +5 -639
- 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 +5 -28
- 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 +5 -817
- package/esm/checkbox/index.mjs +16 -69
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +8 -210
- 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 +8 -129
- 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 +5 -443
- 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 +5 -143
- 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 +10 -150
- 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 +9 -77
- 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 +53 -48
- package/esm/index.mjs +50 -103
- package/esm/input/index.d.ts +5 -52
- 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 +8 -329
- package/esm/input-number/index.mjs +12 -24
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +5 -32
- 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 +5 -50
- 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 +8 -54
- package/esm/password/index.mjs +11 -14
- package/esm/password/index.mjs.map +1 -1
- 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 +7 -151
- 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 +429 -473
- 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 +8 -187
- 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 +5 -26
- 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 +5 -129
- 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 +4 -1557
- 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/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 +8 -177
- 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 +8 -299
- package/esm/switch/index.mjs +8 -13
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +8 -445
- package/esm/time-picker/index.mjs +10 -17
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +5 -185
- package/esm/time-select/index.mjs +13 -17
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.d.ts +8 -267
- package/esm/transfer/index.mjs +8 -11
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +4 -41
- 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/utils.mjs +157 -149
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +5 -16
- 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 +5 -712
- 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 +23 -24
- 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.d.ts +0 -17
- 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.d.ts +0 -13
- 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
|
@@ -1,224 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
modelValue: { default: () => [] },
|
|
22
|
-
pagination: { type: Boolean, default: !0 },
|
|
23
|
-
paginationProps: {},
|
|
24
|
-
height: {}
|
|
25
|
-
},
|
|
26
|
-
setup(V) {
|
|
27
|
-
const c = V, { props: B } = ve(), N = y(() => Se(c.paginationProps, ["pageSize", "currentPage"])), x = me(), l = x.value, C = fe(), U = y(() => C.value?.properties ?? {}), { getKey: P, keyMap: $ } = o.useKey(C.value), D = g();
|
|
28
|
-
function I(a) {
|
|
29
|
-
return Ce(a) ? H(a) : a.properties ? Object.values(a.properties).flatMap((r) => I(r)) : [];
|
|
30
|
-
}
|
|
31
|
-
function H(a) {
|
|
32
|
-
const r = a["x-component-props"]?.prop || a.name;
|
|
33
|
-
if (!r)
|
|
34
|
-
return [];
|
|
35
|
-
const e = x.value.query(x.value.address.concat(r)).take();
|
|
36
|
-
return [{
|
|
37
|
-
name: r,
|
|
38
|
-
display: e?.display || a["x-display"],
|
|
39
|
-
required: Pe(a),
|
|
40
|
-
field: e,
|
|
41
|
-
fieldProps: e?.props || a.toFieldProps(),
|
|
42
|
-
schema: a,
|
|
43
|
-
columnProps: e?.component?.[1] || a["x-component-props"] || {}
|
|
44
|
-
}];
|
|
45
|
-
}
|
|
46
|
-
const S = g(0);
|
|
47
|
-
re(() => {
|
|
48
|
-
const a = l.path.entire;
|
|
49
|
-
return l.query(`${a}.*`).map((r) => ({
|
|
50
|
-
name: r.component[0],
|
|
51
|
-
visible: r.visible
|
|
52
|
-
})).filter((r) => r.name.includes("Column"));
|
|
53
|
-
}, async () => {
|
|
54
|
-
S.value++;
|
|
55
|
-
}, { equals: ge });
|
|
56
|
-
const v = g([]), d = g(c.paginationProps?.pageSize ?? 10), p = g(c.paginationProps?.currentPage ?? 1);
|
|
57
|
-
function M() {
|
|
58
|
-
if (!R(l.value)) {
|
|
59
|
-
v.value = [];
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (c.pagination === !1) {
|
|
63
|
-
v.value = [...l.value];
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
v.value = l.value.slice((p.value - 1) * d.value, p.value * d.value);
|
|
67
|
-
}
|
|
68
|
-
oe([d, p], M), ae(M);
|
|
69
|
-
const T = te(() => {
|
|
70
|
-
const a = C.value.items;
|
|
71
|
-
return (R(a) ? a : [a]).reduce((e, u) => {
|
|
72
|
-
const s = I(u);
|
|
73
|
-
return e.concat(s);
|
|
74
|
-
}, []).filter((e) => e.display !== "none");
|
|
75
|
-
}), K = y(() => (T.value ?? []).map((r, e) => ({ source: r, index: e })).filter(({ source: r }) => r.display === "visible" && F(r.schema)).map(({ source: r, index: e }) => {
|
|
76
|
-
const { name: u, columnProps: s, required: b, field: j } = r, { title: G, asterisk: J, ...Q } = s, X = {
|
|
77
|
-
label: G,
|
|
78
|
-
...Q,
|
|
79
|
-
prop: u
|
|
80
|
-
};
|
|
81
|
-
return {
|
|
82
|
-
key: e,
|
|
83
|
-
props: X,
|
|
84
|
-
field: j,
|
|
85
|
-
asterisk: J ?? b
|
|
86
|
-
};
|
|
87
|
-
})), L = y(() => (T.value ?? []).filter((r) => r.display !== "none" && F(r.schema))), q = y(() => (p.value - 1) * d.value);
|
|
88
|
-
async function O() {
|
|
89
|
-
if (c.pagination === !1) {
|
|
90
|
-
await de();
|
|
91
|
-
const a = D.value?.$el.querySelector(".el-scrollbar__wrap");
|
|
92
|
-
a?.scrollTo({
|
|
93
|
-
top: a.scrollHeight,
|
|
94
|
-
behavior: "smooth"
|
|
95
|
-
});
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (!R(l.value)) {
|
|
99
|
-
p.value = 1;
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
p.value = Math.ceil(l.value.length / d.value);
|
|
103
|
-
}
|
|
104
|
-
async function W(a) {
|
|
105
|
-
const { oldIndex: r, newIndex: e } = a;
|
|
106
|
-
await l.move(r, e), S.value++;
|
|
107
|
-
}
|
|
108
|
-
return (a, r) => (n(), m("div", {
|
|
109
|
-
class: z(t(w))
|
|
110
|
-
}, [
|
|
111
|
-
(n(), i(t(o), {
|
|
112
|
-
key: S.value,
|
|
113
|
-
"key-map": t($),
|
|
114
|
-
add: O
|
|
115
|
-
}, {
|
|
116
|
-
default: f(() => [
|
|
117
|
-
le(t(be), {
|
|
118
|
-
"model-value": v.value,
|
|
119
|
-
target: "tbody",
|
|
120
|
-
handle: `.${t(ke)}-array-base-sort-handle`,
|
|
121
|
-
animation: 150,
|
|
122
|
-
onEnd: W
|
|
123
|
-
}, {
|
|
124
|
-
default: f(() => [
|
|
125
|
-
se((n(), i(t(Y), k({
|
|
126
|
-
ref_key: "elTableRef",
|
|
127
|
-
ref: D,
|
|
128
|
-
"row-key": t(P),
|
|
129
|
-
data: v.value
|
|
130
|
-
}, t(B)), {
|
|
131
|
-
default: f(() => [
|
|
132
|
-
(n(!0), m(h, null, A(K.value, (e, u) => (n(), i(t(Z), k({
|
|
133
|
-
key: e.key,
|
|
134
|
-
ref_for: !0
|
|
135
|
-
}, e.props), {
|
|
136
|
-
default: f(({ row: s, $index: b }) => [
|
|
137
|
-
(n(), i(t(o).Item, {
|
|
138
|
-
key: t(P)(s),
|
|
139
|
-
index: b + q.value,
|
|
140
|
-
record: s
|
|
141
|
-
}, {
|
|
142
|
-
default: f(() => [
|
|
143
|
-
(n(), i(t(E), {
|
|
144
|
-
key: `${t(P)(s)}`,
|
|
145
|
-
schema: t(T)[u].schema,
|
|
146
|
-
name: b + q.value,
|
|
147
|
-
"only-render-properties": ""
|
|
148
|
-
}, null, 8, ["schema", "name"]))
|
|
149
|
-
]),
|
|
150
|
-
_: 2
|
|
151
|
-
}, 1032, ["index", "record"]))
|
|
152
|
-
]),
|
|
153
|
-
header: f(({ column: s }) => [
|
|
154
|
-
e.field.content?.header ? (n(), i(ue(e.field.content.header), k({
|
|
155
|
-
key: 0,
|
|
156
|
-
ref_for: !0
|
|
157
|
-
}, { ...s, field: t(l) }), null, 16)) : e.asterisk ? (n(), m("span", Te, [
|
|
158
|
-
ie("span", {
|
|
159
|
-
class: z(`${t(w)}-asterisk`)
|
|
160
|
-
}, "*", 2),
|
|
161
|
-
pe(" " + ce(s.label), 1)
|
|
162
|
-
])) : _("", !0)
|
|
163
|
-
]),
|
|
164
|
-
_: 2
|
|
165
|
-
}, 1040))), 128))
|
|
166
|
-
]),
|
|
167
|
-
_: 1
|
|
168
|
-
}, 16, ["row-key", "data"])), [
|
|
169
|
-
[t(ee), t(l).loading]
|
|
170
|
-
])
|
|
171
|
-
]),
|
|
172
|
-
_: 1
|
|
173
|
-
}, 8, ["model-value", "handle"]),
|
|
174
|
-
(n(!0), m(h, null, A(L.value, (e, u) => (n(), i(t(E), {
|
|
175
|
-
key: u,
|
|
176
|
-
name: e.name,
|
|
177
|
-
schema: e.schema,
|
|
178
|
-
"only-render-self": !0
|
|
179
|
-
}, null, 8, ["name", "schema"]))), 128)),
|
|
180
|
-
c.pagination ? (n(), i(t(xe), k({
|
|
181
|
-
key: 0,
|
|
182
|
-
"current-page": p.value,
|
|
183
|
-
"onUpdate:currentPage": r[0] || (r[0] = (e) => p.value = e),
|
|
184
|
-
"page-size": d.value,
|
|
185
|
-
"onUpdate:pageSize": r[1] || (r[1] = (e) => d.value = e),
|
|
186
|
-
class: `${t(w)}-pagination`,
|
|
187
|
-
background: "",
|
|
188
|
-
layout: "total, sizes, prev, pager, next",
|
|
189
|
-
total: c.modelValue.length
|
|
190
|
-
}, N.value), null, 16, ["current-page", "page-size", "class", "total"])) : _("", !0),
|
|
191
|
-
(n(!0), m(h, null, A(U.value, (e, u) => (n(), m(h, { key: u }, [
|
|
192
|
-
t(he)(e) ? (n(), i(t(E), {
|
|
193
|
-
key: 0,
|
|
194
|
-
schema: e,
|
|
195
|
-
name: "addition"
|
|
196
|
-
}, null, 8, ["schema"])) : _("", !0)
|
|
197
|
-
], 64))), 128))
|
|
198
|
-
]),
|
|
199
|
-
_: 1
|
|
200
|
-
}, 8, ["key-map"]))
|
|
201
|
-
], 2));
|
|
202
|
-
}
|
|
203
|
-
}), _e = {
|
|
204
|
-
name: "FArrayTableColumn",
|
|
205
|
-
render() {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
}, Ke = ye(Ae, {
|
|
209
|
-
Column: _e,
|
|
210
|
-
Index: o.Index,
|
|
211
|
-
SortHandle: o.SortHandle,
|
|
212
|
-
Addition: o.Addition,
|
|
213
|
-
Remove: o.Remove,
|
|
214
|
-
MoveDown: o.MoveDown,
|
|
215
|
-
MoveUp: o.MoveUp,
|
|
216
|
-
useArray: o.useArray,
|
|
217
|
-
useIndex: o.useIndex,
|
|
218
|
-
useRecord: o.useRecord
|
|
1
|
+
import { composeExport } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { ArrayBase } from "../array-base/index.mjs";
|
|
3
|
+
import _sfc_main from "./array-table.mjs";
|
|
4
|
+
import "./style.css";
|
|
5
|
+
const ArrayTable = composeExport(_sfc_main, {
|
|
6
|
+
Column: {
|
|
7
|
+
name: "FArrayTableColumn",
|
|
8
|
+
render() {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
Index: ArrayBase.Index,
|
|
13
|
+
SortHandle: ArrayBase.SortHandle,
|
|
14
|
+
Addition: ArrayBase.Addition,
|
|
15
|
+
Remove: ArrayBase.Remove,
|
|
16
|
+
MoveDown: ArrayBase.MoveDown,
|
|
17
|
+
MoveUp: ArrayBase.MoveUp,
|
|
18
|
+
useArray: ArrayBase.useArray,
|
|
19
|
+
useIndex: ArrayBase.useIndex,
|
|
20
|
+
useRecord: ArrayBase.useRecord
|
|
219
21
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
//# sourceMappingURL=index.mjs.map
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ArrayTable as default };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/array-table/array-table.vue","../../src/array-table/index.ts"],"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","import type { Component } from 'vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { ArrayBase } from '../array-base'\nimport ArrayTableInner from './array-table.vue'\nimport './style.scss'\n\nconst ArrayTableColumn: Component = {\n name: 'FArrayTableColumn',\n render() {\n return null\n },\n}\n\nexport const ArrayTable = composeExport(ArrayTableInner, {\n Column: ArrayTableColumn,\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 ArrayTable\n"],"names":["props","__props","elTableProps","useCleanAttrs","paginationProps","computed","omit","fieldRef","useField","field","schemaRef","useFieldSchema","additionSchemas","getKey","keyMap","ArrayBase","elTableRef","ref","extractTableSources","schema","isTableComponent","createTableSource","element","propName","hasRequiredProperty","triggerUpdateKey","reactionWatch","path","item","isEqual","dataSource","pageSize","currentPage","updateDataSource","isArr","watch","autorunEffect","sources","formilyComputed","columns","source","index","isColumnComponent","key","name","columnProps","required","title","asterisk","restProps","stateManagerColumns","column","baseIndex","onAddItemClick","nextTick","scrollWarpDOM","handleDragEnd","evt","oldIndex","newIndex","_createElementBlock","_unref","prefixCls","_createBlock","_createVNode","VueDraggable","stylePrefix","_withDirectives","_openBlock","_mergeProps","_Fragment","_renderList","colIndex","_withCtx","row","$index","RecursionField","col","_resolveDynamicComponent","_hoisted_1","_createElementVNode","_toDisplayString","vLoading","$event","itemSchema","isAdditionComponent","ArrayTableColumn","ArrayTable","composeExport","ArrayTableInner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAiBC,GAAA,GAC1BC,IAAkBC,EAAS,MAAMC,GAAKN,EAAM,iBAAiB,CAAC,YAAY,aAAa,CAAC,CAAC,GACzFO,IAAWC,GAAA,GACXC,IAAQF,EAAS,OACjBG,IAAYC,GAAA,GACZC,IAAkBP,EAAiC,MAAMK,EAAU,OAAO,cAAc,EAAE,GAC1F,EAAE,QAAAG,GAAQ,QAAAC,EAAA,IAAWC,EAAU,OAAOL,EAAU,KAAK,GAErDM,IAAaC,EAAA;AAEnB,aAASC,EAAoBC,GAAuB;AAClD,aAAIC,GAAiBD,CAAM,IAClBE,EAAkBF,CAAM,IAE1BA,EAAO,aACV,OAAO,OAAOA,EAAO,UAAU,EAAE,QAAQ,CAAAG,MAAWJ,EAAoBI,CAAO,CAAC,IAChF,CAAA;AAAA,IACN;AAEA,aAASD,EAAkBF,GAAuB;AAChD,YAAMI,IAAWJ,EAAO,mBAAmB,GAAG,QAAQA,EAAO;AAE7D,UAAI,CAACI;AACH,eAAO,CAAA;AAET,YAAMd,IAAQF,EAAS,MAAM,MAAMA,EAAS,MAAM,QAAQ,OAAOgB,CAAQ,CAAC,EAAE,KAAA;AAE5E,aAAO,CAAC;AAAA,QACN,MAAMA;AAAA,QACN,SAASd,GAAO,WAAWU,EAAO,WAAW;AAAA,QAC7C,UAAUK,GAAoBL,CAAM;AAAA,QACpC,OAAAV;AAAAA,QACA,YAAYA,GAAO,SAASU,EAAO,aAAA;AAAA,QACnC,QAAAA;AAAA,QACA,aAAcV,GAAO,YAAsB,CAAC,KAAKU,EAAO,mBAAmB,KAAK,CAAA;AAAA,MAAC,CAClF;AAAA,IACH;AAEA,UAAMM,IAAmBR,EAAI,CAAC;AAC9B,IAAAS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A,KAAe,GAAA,MAAA,IAAA,CAAA,gBAAA,aAAA,SAAA,OAAA,CAAA;WAE1DgE,EAAA,EAAA,GAAAR,EAEWU,GAAA,MAAAC,EAF2B3D,EAAA,OAAe,CAAnCwE,GAAYzC,6BAAkC;AAAA,YACxCkB,EAAAwB,EAAA,EAAoBD,CAAU,UAApDrB,EAA8FF,EAAAe,CAAA,GAAA;AAAA;cAAtC,QAAQQ;AAAA,cAAY,MAAK;AAAA,YAAA;;;;;;;ICxMnFE,KAA8B;AAAA,EAClC,MAAM;AAAA,EACN,SAAS;AACP,WAAO;AAAA,EACT;AACF,GAEaC,KAAaC,GAAcC,IAAiB;AAAA,EACvD,QAAQH;AAAA,EACR,OAAOvE,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;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ArrayTableInner"],"sources":["../../src/array-table/index.ts"],"sourcesContent":["import type { Component } from 'vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { ArrayBase } from '../array-base'\nimport ArrayTableInner from './array-table.vue'\nimport './style.scss'\n\nconst ArrayTableColumn: Component = {\n name: 'FArrayTableColumn',\n render() {\n return null\n },\n}\n\nexport const ArrayTable = composeExport(ArrayTableInner, {\n Column: ArrayTableColumn,\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 ArrayTable\n"],"mappings":";;;;AAaA,MAAa,aAAa,cAAcA,WAAiB;CACvD,QARkC;EAClC,MAAM;EACN,SAAS;AACP,UAAO;;EAEV;CAIC,OAAO,UAAU;CACjB,YAAY,UAAU;CACtB,UAAU,UAAU;CACpB,QAAQ,UAAU;CAClB,UAAU,UAAU;CACpB,QAAQ,UAAU;CAClB,UAAU,UAAU;CACpB,UAAU,UAAU;CACpB,WAAW,UAAU;CACtB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.formily-element-plus-array-table {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
.formily-element-plus-array-table .formily-element-plus-form-item:not(.formily-element-plus-form-item-feedback-layout-popover) {
|
|
5
|
+
margin-bottom: 0 !important;
|
|
6
|
+
}
|
|
7
|
+
.formily-element-plus-array-table .el-table .cell {
|
|
8
|
+
overflow: visible;
|
|
9
|
+
}
|
|
10
|
+
.formily-element-plus-array-table .el-table .cell.el-tooltip {
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.formily-element-plus-array-table .formily-element-plus-array-base-addition {
|
|
14
|
+
margin-top: 8px;
|
|
15
|
+
}
|
|
16
|
+
.formily-element-plus-array-table .el-pagination {
|
|
17
|
+
margin-top: 16px;
|
|
18
|
+
text-align: right;
|
|
19
|
+
}
|
|
20
|
+
.formily-element-plus-array-table .el-pagination .el-pagination__total {
|
|
21
|
+
flex: 1;
|
|
22
|
+
text-align: left;
|
|
23
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { PaginationProps } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { PaginationProps } from "element-plus";
|
|
2
|
+
|
|
3
|
+
//#region src/array-table/types.d.ts
|
|
4
|
+
interface IArrayTableProps {
|
|
5
|
+
modelValue?: any[];
|
|
6
|
+
pagination?: boolean;
|
|
7
|
+
paginationProps?: Partial<PaginationProps>;
|
|
8
|
+
height?: string | number;
|
|
7
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { IArrayTableProps };
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { stylePrefix
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "@silver-formily/vue";
|
|
8
|
-
import { isOperationComponent as e, isAdditionComponent as i } from "../array-base/utils.mjs";
|
|
9
|
-
const x = `${n}-array-table`;
|
|
10
|
-
function p(o) {
|
|
11
|
-
return o["x-component"]?.indexOf("Column") > -1;
|
|
1
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
import { isAdditionComponent, isOperationComponent } from "../array-base/utils.mjs";
|
|
3
|
+
//#region src/array-table/utils.ts
|
|
4
|
+
const prefixCls = `${stylePrefix}-array-table`;
|
|
5
|
+
function isColumnComponent(schema) {
|
|
6
|
+
return schema["x-component"]?.indexOf("Column") > -1;
|
|
12
7
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
8
|
+
function isTableComponent(schema) {
|
|
9
|
+
return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema);
|
|
15
10
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
11
|
+
function hasRequiredProperty(schema) {
|
|
12
|
+
return schema.reduceProperties((hasRequired, property) => hasRequired || !!property.required, false);
|
|
18
13
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
x as prefixCls
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=utils.mjs.map
|
|
14
|
+
//#endregion
|
|
15
|
+
export { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\n\nexport const prefixCls = `${stylePrefix}-array-table`\n\nexport function isColumnComponent(schema: Schema) {\n return schema['x-component']?.indexOf('Column') > -1\n}\n\nexport function isTableComponent(schema: Schema): boolean {\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\n}\n\nexport function hasRequiredProperty(schema: Schema): boolean {\n return schema.reduceProperties((hasRequired, property) =>\n hasRequired || !!property.required, false)\n}\n"],"
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\n\nexport const prefixCls = `${stylePrefix}-array-table`\n\nexport function isColumnComponent(schema: Schema) {\n return schema['x-component']?.indexOf('Column') > -1\n}\n\nexport function isTableComponent(schema: Schema): boolean {\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\n}\n\nexport function hasRequiredProperty(schema: Schema): boolean {\n return schema.reduceProperties((hasRequired, property) =>\n hasRequired || !!property.required, false)\n}\n"],"mappings":";;;AAIA,MAAa,YAAY,GAAG,YAAY;AAExC,SAAgB,kBAAkB,QAAgB;AAChD,QAAO,OAAO,gBAAgB,QAAQ,SAAS,GAAG;;AAGpD,SAAgB,iBAAiB,QAAyB;AACxD,QAAO,kBAAkB,OAAO,IAAI,qBAAqB,OAAO,IAAI,oBAAoB,OAAO;;AAGjG,SAAgB,oBAAoB,QAAyB;AAC3D,QAAO,OAAO,kBAAkB,aAAa,aAC3C,eAAe,CAAC,CAAC,SAAS,UAAU,MAAM"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useCleanAttrs } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
3
|
+
import { getArrayItemSchema } from "../array-base/utils.mjs";
|
|
4
|
+
import { ElBadge, ElTabPane, ElTabs } from "element-plus";
|
|
5
|
+
import { reactionWatch } from "@silver-formily/reactive-vue";
|
|
6
|
+
import { Fragment, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
7
|
+
import { RecursionField, useField, useFieldSchema } from "@silver-formily/vue";
|
|
8
|
+
import { isEqual, isFn } from "@formily/shared";
|
|
9
|
+
//#region src/array-tabs/array-tabs.vue
|
|
10
|
+
const _hoisted_1 = { key: 0 };
|
|
11
|
+
const _hoisted_2 = { key: 1 };
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
name: "FArrayTabs",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
__name: "array-tabs",
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const fieldRef = useField();
|
|
18
|
+
const schemaRef = useFieldSchema();
|
|
19
|
+
const prefixCls = `${stylePrefix}-array-tabs`;
|
|
20
|
+
const activeKey = ref("tab-0");
|
|
21
|
+
const field = fieldRef.value;
|
|
22
|
+
/* istanbul ignore else -- @preserve */
|
|
23
|
+
if (field.value.length === 0) field.value.push(null);
|
|
24
|
+
const schema = schemaRef.value;
|
|
25
|
+
function getTabTitle(index) {
|
|
26
|
+
return `${field.title || "Untitled"} ${index + 1}`;
|
|
27
|
+
}
|
|
28
|
+
const errorCountList = ref([]);
|
|
29
|
+
reactionWatch(() => {
|
|
30
|
+
return field.value.map((item, index) => {
|
|
31
|
+
return field.form.queryFeedbacks({
|
|
32
|
+
type: "error",
|
|
33
|
+
address: `${field.address.concat(index)}.**`
|
|
34
|
+
}).length;
|
|
35
|
+
});
|
|
36
|
+
}, (newVal) => {
|
|
37
|
+
errorCountList.value = newVal;
|
|
38
|
+
}, { equals: isEqual });
|
|
39
|
+
const { props: elTabProps } = useCleanAttrs([
|
|
40
|
+
"value",
|
|
41
|
+
"modelValue",
|
|
42
|
+
"onUpdate:modelValue"
|
|
43
|
+
]);
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createBlock(unref(ElTabs), mergeProps(unref(elTabProps), {
|
|
46
|
+
"model-value": activeKey.value,
|
|
47
|
+
class: prefixCls,
|
|
48
|
+
type: "card",
|
|
49
|
+
addable: true,
|
|
50
|
+
onTabRemove: _cache[0] || (_cache[0] = (target) => {
|
|
51
|
+
const index = target.toString().match(/tab-(\d+)/)?.[1];
|
|
52
|
+
unref(field).remove(Number(index));
|
|
53
|
+
if (activeKey.value === target) activeKey.value = `tab-${Number(index) - 1}`;
|
|
54
|
+
if (unref(isFn)(_ctx.$attrs["tab-remove"])) _ctx.$attrs["tab-remove"](target);
|
|
55
|
+
}),
|
|
56
|
+
onTabAdd: _cache[1] || (_cache[1] = () => {
|
|
57
|
+
const id = unref(field).value.length;
|
|
58
|
+
unref(field).value.push(null);
|
|
59
|
+
activeKey.value = `tab-${id}`;
|
|
60
|
+
if (unref(isFn)(_ctx.$attrs["tab-add"])) _ctx.$attrs["tab-add"]();
|
|
61
|
+
}),
|
|
62
|
+
onChange: () => {}
|
|
63
|
+
}), {
|
|
64
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(field).value, (item, index) => {
|
|
65
|
+
return openBlock(), createBlock(unref(ElTabPane), {
|
|
66
|
+
key: `tab-${index}`,
|
|
67
|
+
closable: index !== 0,
|
|
68
|
+
name: `tab-${index}`
|
|
69
|
+
}, {
|
|
70
|
+
default: withCtx(() => [createVNode(unref(RecursionField), {
|
|
71
|
+
schema: unref(getArrayItemSchema)(unref(schema), index),
|
|
72
|
+
name: index
|
|
73
|
+
}, null, 8, ["schema", "name"])]),
|
|
74
|
+
label: withCtx(() => [errorCountList.value[index] > 0 ? (openBlock(), createElementBlock("span", _hoisted_1, [createVNode(unref(ElBadge), {
|
|
75
|
+
class: normalizeClass([`${prefixCls}-errors-badge`]),
|
|
76
|
+
value: errorCountList.value[index]
|
|
77
|
+
}, {
|
|
78
|
+
default: withCtx(() => [createTextVNode(toDisplayString(getTabTitle(index)), 1)]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, 1032, ["class", "value"])])) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(getTabTitle(index)), 1))]),
|
|
81
|
+
_: 2
|
|
82
|
+
}, 1032, ["closable", "name"]);
|
|
83
|
+
}), 128))]),
|
|
84
|
+
_: 1
|
|
85
|
+
}, 16, ["model-value"]);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
//#endregion
|
|
90
|
+
export { _sfc_main as default };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=array-tabs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-tabs.mjs","names":["$attrs"],"sources":["../../src/array-tabs/array-tabs.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { TabPaneName } from 'element-plus'\nimport { isEqual, isFn } from '@formily/shared'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { getArrayItemSchema } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayTabs',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\n\nconst prefixCls = `${stylePrefix}-array-tabs`\nconst activeKey = ref<TabPaneName>('tab-0')\n\nconst field = fieldRef.value\n/* istanbul ignore else -- @preserve */\nif (field.value.length === 0) {\n field.value.push(null)\n}\nconst schema = schemaRef.value\nfunction getTabTitle(index: number) {\n return `${field.title || 'Untitled'} ${index + 1}`\n}\n\nconst errorCountList = ref([])\nreactionWatch(() => {\n return field.value.map((item, index) => {\n const panelErrors = field.form.queryFeedbacks({\n type: 'error',\n address: `${field.address.concat(index)}.**`,\n })\n return panelErrors.length\n })\n}, (newVal) => {\n errorCountList.value = newVal\n}, {\n equals: isEqual,\n})\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\n</script>\n\n<template>\n <ElTabs\n v-bind=\"elTabProps\"\n :model-value=\"activeKey\"\n :class=\"prefixCls\"\n type=\"card\"\n :addable=\"true\"\n @tab-remove=\"(target) => {\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\n field.remove(Number(index))\n if (activeKey === target) {\n activeKey = `tab-${Number(index) - 1}`\n }\n\n if (isFn($attrs['tab-remove'])) {\n $attrs['tab-remove'](target)\n }\n }\"\n @tab-add=\"() => {\n const id = field.value.length\n field.value.push(null)\n activeKey = `tab-${id}`\n if (isFn($attrs['tab-add'])) {\n $attrs['tab-add']()\n }\n }\"\n @change=\"() => {}\"\n >\n <ElTabPane\n v-for=\"(item, index) of field.value\"\n :key=\"`tab-${index}`\"\n :closable=\"index !== 0\"\n :name=\"`tab-${index}`\"\n >\n <template #default>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n />\n </template>\n <template #label>\n <span v-if=\"errorCountList[index] > 0\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCountList[index]\"\n >\n {{ getTabTitle(index) }}\n </ElBadge>\n </span>\n <span v-else>\n {{ getTabTitle(index) }}\n </span>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAiBA,MAAM,WAAW,UAAqB;EACtC,MAAM,YAAY,gBAAe;EAEjC,MAAM,YAAY,GAAG,YAAY;EACjC,MAAM,YAAY,IAAiB,QAAO;EAE1C,MAAM,QAAQ,SAAS;;AAEvB,MAAI,MAAM,MAAM,WAAW,EACzB,OAAM,MAAM,KAAK,KAAI;EAEvB,MAAM,SAAS,UAAU;EACzB,SAAS,YAAY,OAAe;AAClC,UAAO,GAAG,MAAM,SAA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MAAA,mBAAkB,CAAC,MAAA,OAAM,EAAE,MAAK;OACxC,MAAM;;MAGA,OAAK,cAQP,CAPK,eAAA,MAAe,SAAK,KAAA,WAAA,EAAhC,mBAOO,QAAA,YAAA,CANL,YAKU,MAAA,QAAA,EAAA;OAJP,OAAK,eAAA,CAAA,GAAM,UAAS,eAAA,CAAA;OACpB,OAAO,eAAA,MAAe;;8BAEC,CAAA,gBAAA,gBAArB,YAAY,MAAK,CAAA,EAAA,EAAA,CAAA,CAAA;;sDAGxB,mBAEO,QAAA,YAAA,gBADF,YAAY,MAAK,CAAA,EAAA,EAAA,EAAA,CAAA"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/array-tabs/index.d.ts
|
|
4
|
+
declare const ArrayTabs: _$vue.DefineComponent<{}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ArrayTabs };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
package/esm/array-tabs/index.mjs
CHANGED
|
@@ -1,84 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { useCleanAttrs as w } from "../__builtins__/shared/utils.mjs";
|
|
10
|
-
import { getArrayItemSchema as z } from "../array-base/utils.mjs";
|
|
11
|
-
import '../styles/array-tabs/index.css';const D = { key: 0 }, I = { key: 1 }, K = /* @__PURE__ */ k({
|
|
12
|
-
name: "FArrayTabs",
|
|
13
|
-
inheritAttrs: !1,
|
|
14
|
-
__name: "array-tabs",
|
|
15
|
-
setup(W) {
|
|
16
|
-
const y = P(), $ = R(), c = `${U}-array-tabs`, n = p("tab-0"), t = y.value;
|
|
17
|
-
t.value.length === 0 && t.value.push(null);
|
|
18
|
-
const g = $.value;
|
|
19
|
-
function d(r) {
|
|
20
|
-
return `${t.title || "Untitled"} ${r + 1}`;
|
|
21
|
-
}
|
|
22
|
-
const m = p([]);
|
|
23
|
-
N(() => t.value.map((r, o) => t.form.queryFeedbacks({
|
|
24
|
-
type: "error",
|
|
25
|
-
address: `${t.address.concat(o)}.**`
|
|
26
|
-
}).length), (r) => {
|
|
27
|
-
m.value = r;
|
|
28
|
-
}, {
|
|
29
|
-
equals: B
|
|
30
|
-
});
|
|
31
|
-
const { props: T } = w(["value", "modelValue", "onUpdate:modelValue"]);
|
|
32
|
-
return (r, o) => (s(), f(e(V), C(e(T), {
|
|
33
|
-
"model-value": n.value,
|
|
34
|
-
class: c,
|
|
35
|
-
type: "card",
|
|
36
|
-
addable: !0,
|
|
37
|
-
onTabRemove: o[0] || (o[0] = (l) => {
|
|
38
|
-
const a = l.toString().match(/tab-(\d+)/)?.[1];
|
|
39
|
-
e(t).remove(Number(a)), n.value === l && (n.value = `tab-${Number(a) - 1}`), e(h)(r.$attrs["tab-remove"]) && r.$attrs["tab-remove"](l);
|
|
40
|
-
}),
|
|
41
|
-
onTabAdd: o[1] || (o[1] = () => {
|
|
42
|
-
const l = e(t).value.length;
|
|
43
|
-
e(t).value.push(null), n.value = `tab-${l}`, e(h)(r.$attrs["tab-add"]) && r.$attrs["tab-add"]();
|
|
44
|
-
}),
|
|
45
|
-
onChange: () => {
|
|
46
|
-
}
|
|
47
|
-
}), {
|
|
48
|
-
default: u(() => [
|
|
49
|
-
(s(!0), i(E, null, F(e(t).value, (l, a) => (s(), f(e(q), {
|
|
50
|
-
key: `tab-${a}`,
|
|
51
|
-
closable: a !== 0,
|
|
52
|
-
name: `tab-${a}`
|
|
53
|
-
}, {
|
|
54
|
-
default: u(() => [
|
|
55
|
-
b(e(S), {
|
|
56
|
-
schema: e(z)(e(g), a),
|
|
57
|
-
name: a
|
|
58
|
-
}, null, 8, ["schema", "name"])
|
|
59
|
-
]),
|
|
60
|
-
label: u(() => [
|
|
61
|
-
m.value[a] > 0 ? (s(), i("span", D, [
|
|
62
|
-
b(e(L), {
|
|
63
|
-
class: _([`${c}-errors-badge`]),
|
|
64
|
-
value: m.value[a]
|
|
65
|
-
}, {
|
|
66
|
-
default: u(() => [
|
|
67
|
-
A(v(d(a)), 1)
|
|
68
|
-
]),
|
|
69
|
-
_: 2
|
|
70
|
-
}, 1032, ["class", "value"])
|
|
71
|
-
])) : (s(), i("span", I, v(d(a)), 1))
|
|
72
|
-
]),
|
|
73
|
-
_: 2
|
|
74
|
-
}, 1032, ["closable", "name"]))), 128))
|
|
75
|
-
]),
|
|
76
|
-
_: 1
|
|
77
|
-
}, 16, ["model-value"]));
|
|
78
|
-
}
|
|
79
|
-
}), x = K;
|
|
80
|
-
export {
|
|
81
|
-
x as ArrayTabs,
|
|
82
|
-
x as default
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import _sfc_main from "./array-tabs.mjs";
|
|
2
|
+
import "./style.css";
|
|
3
|
+
//#region src/array-tabs/index.ts
|
|
4
|
+
const ArrayTabs = _sfc_main;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ArrayTabs as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["FArrayTabs"],"sources":["../../src/array-tabs/index.ts"],"sourcesContent":["import FArrayTabs from './array-tabs.vue'\nimport './style.scss'\n\nexport const ArrayTabs = FArrayTabs\n\nexport default ArrayTabs\n"],"mappings":";;;AAGA,MAAa,YAAYA"}
|