@silver-formily/element-plus 3.0.1 → 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 +77 -24
- 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 -209
- 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 -61
- 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 -119
- 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 -175
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/style.css +20 -0
- package/esm/array-collapse/utils.mjs +7 -13
- 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 -108
- 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 -187
- 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 -16
- 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 -224
- 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 -23
- 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 -87
- 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 -114
- 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 -51
- 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 -70
- 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 -220
- 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 -97
- 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 -13
- 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 -87
- 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 -110
- 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 -333
- 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 -84
- 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 -94
- 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 -77
- 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 -69
- 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 -50
- 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 -97
- 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 -364
- 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 -334
- 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 -184
- 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 -69
- 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 -41
- 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 -128
- 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 -205
- 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 -105
- 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 -41
- 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 -176
- 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 +25 -26
- 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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.formily-element-plus-array-base-addition {
|
|
2
|
+
transition: var(--el-transition-duration);
|
|
3
|
+
user-select: none;
|
|
4
|
+
width: 100%;
|
|
5
|
+
border: 1px dashed var(--el-border-color);
|
|
6
|
+
border-radius: var(--el-border-radius-small);
|
|
7
|
+
line-height: 32px;
|
|
8
|
+
}
|
|
9
|
+
.formily-element-plus-array-base-addition:hover {
|
|
10
|
+
background-color: var(--el-button-hover-text-color);
|
|
11
|
+
border-color: var(--el-primary-color);
|
|
12
|
+
}
|
|
13
|
+
.formily-element-plus-array-base-addition:active {
|
|
14
|
+
background-color: var(--el-button-active-bg-color);
|
|
15
|
+
border-color: var(--el-color-primary);
|
|
16
|
+
}
|
|
17
|
+
.formily-element-plus-array-base-addition .el-icon + .el-link__inner {
|
|
18
|
+
margin-left: 8px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.formily-element-plus-array-base-remove i {
|
|
22
|
+
font-size: var(--el-font-size-base);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.formily-element-plus-array-base-move-down i {
|
|
26
|
+
font-size: var(--el-font-size-base);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.formily-element-plus-array-base-move-up i {
|
|
30
|
+
font-size: var(--el-font-size-base);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.formily-element-plus-array-base-sort-handle i {
|
|
34
|
+
font-size: var(--el-font-size-base);
|
|
35
|
+
cursor: move;
|
|
36
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
1
|
+
//#region src/array-base/symbols.ts
|
|
2
|
+
const ArrayBaseSymbol = Symbol("ArrayBaseContext");
|
|
3
|
+
const ItemSymbol = Symbol("ItemContext");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { ArrayBaseSymbol, ItemSymbol };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=symbols.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.mjs","sources":["../../src/array-base/symbols.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { IArrayBaseContext, IArrayBaseItemProps } from './types'\n\nexport const ArrayBaseSymbol: InjectionKey<IArrayBaseContext> = Symbol('ArrayBaseContext')\nexport const ItemSymbol: InjectionKey<IArrayBaseItemProps> = Symbol('ItemContext')\n"],"
|
|
1
|
+
{"version":3,"file":"symbols.mjs","names":[],"sources":["../../src/array-base/symbols.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { IArrayBaseContext, IArrayBaseItemProps } from './types'\n\nexport const ArrayBaseSymbol: InjectionKey<IArrayBaseContext> = Symbol('ArrayBaseContext')\nexport const ItemSymbol: InjectionKey<IArrayBaseItemProps> = Symbol('ItemContext')\n"],"mappings":";AAGA,MAAa,kBAAmD,OAAO,mBAAmB;AAC1F,MAAa,aAAgD,OAAO,cAAc"}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Ref } from "vue";
|
|
2
|
+
import { ArrayField } from "@formily/core";
|
|
3
|
+
import { Schema } from "@formily/json-schema";
|
|
4
|
+
|
|
5
|
+
//#region src/array-base/types.d.ts
|
|
6
|
+
interface IArrayBaseAdditionProps {
|
|
7
|
+
method?: 'push' | 'unshift';
|
|
8
|
+
defaultValue?: any;
|
|
9
|
+
title?: string;
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
interface IArrayBaseOperationProps {
|
|
12
|
+
title?: string;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
interface IArrayBaseProps {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
keyMap?: WeakMap<Record<string, unknown>, string> | string[];
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
schema: Ref<Schema>;
|
|
23
|
-
props: IArrayBaseProps;
|
|
24
|
-
attrs: {
|
|
25
|
-
[key in string]?: any;
|
|
26
|
-
};
|
|
27
|
-
keyMap?: WeakMap<Record<string, unknown>, string> | string[] | null;
|
|
18
|
+
interface IArrayBaseContext {
|
|
19
|
+
field: Ref<ArrayField>;
|
|
20
|
+
schema: Ref<Schema>;
|
|
21
|
+
props: IArrayBaseProps;
|
|
22
|
+
attrs: { [key in string]?: any };
|
|
23
|
+
keyMap?: WeakMap<Record<string, unknown>, string> | string[] | null;
|
|
28
24
|
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { IArrayBaseAdditionProps, IArrayBaseContext, IArrayBaseOperationProps };
|
|
27
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
export declare function isAdditionComponent(schema: ISchema): boolean;
|
|
13
|
-
export declare function isIndexComponent(schema: ISchema): boolean;
|
|
14
|
-
export declare function isRemoveComponent(schema: ISchema): boolean;
|
|
15
|
-
export declare function isMoveUpComponent(schema: ISchema): boolean;
|
|
16
|
-
export declare function isMoveDownComponent(schema: ISchema): boolean;
|
|
17
|
-
export declare function isOperationComponent(schema: ISchema): boolean;
|
|
1
|
+
import { IArrayBaseContext } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { ISchema, Schema } from "@formily/json-schema";
|
|
4
|
+
|
|
5
|
+
//#region src/array-base/utils.d.ts
|
|
6
|
+
declare function useArray(): IArrayBaseContext;
|
|
7
|
+
declare function useIndex(): _$vue.Ref<number, number>;
|
|
8
|
+
declare function useRecord(): _$vue.Ref<any, any>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useArray, useIndex, useRecord };
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/esm/array-base/utils.mjs
CHANGED
|
@@ -1,73 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "@silver-formily/vue";
|
|
10
|
-
import { ItemSymbol as m, ArrayBaseSymbol as d } from "./symbols.mjs";
|
|
11
|
-
const S = `${x}-array-base`;
|
|
12
|
-
function $() {
|
|
13
|
-
return i(d, null);
|
|
1
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
import { ArrayBaseSymbol, ItemSymbol } from "./symbols.mjs";
|
|
3
|
+
import { inject, toRefs } from "vue";
|
|
4
|
+
import { clone, isArr, isValid, uid } from "@formily/shared";
|
|
5
|
+
//#region src/array-base/utils.ts
|
|
6
|
+
const prefixCls = `${stylePrefix}-array-base`;
|
|
7
|
+
function useArray() {
|
|
8
|
+
return inject(ArrayBaseSymbol, null);
|
|
14
9
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
function useIndex() {
|
|
11
|
+
const { index: indexRef } = toRefs(inject(ItemSymbol));
|
|
12
|
+
return indexRef;
|
|
18
13
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return n;
|
|
14
|
+
/* istanbul ignore next -- @preserve */
|
|
15
|
+
function useRecord() {
|
|
16
|
+
const { record: recordRef } = toRefs(inject(ItemSymbol));
|
|
17
|
+
return recordRef;
|
|
24
18
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
const isObjectValue = (schema) => {
|
|
20
|
+
if (Array.isArray(schema?.items)) return isObjectValue(schema.items[0]);
|
|
21
|
+
if (schema?.items?.type === "array" || schema?.items?.type === "object") return true;
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
function useKey(schema) {
|
|
25
|
+
const isObject = isObjectValue(schema);
|
|
26
|
+
let keyMap = null;
|
|
27
|
+
keyMap = isObject ? /* @__PURE__ */ new WeakMap() : [];
|
|
28
|
+
return {
|
|
29
|
+
keyMap,
|
|
30
|
+
getKey: (record, index) => {
|
|
31
|
+
if (keyMap instanceof WeakMap) {
|
|
32
|
+
if (!keyMap.has(record)) keyMap.set(record, uid());
|
|
33
|
+
return `${keyMap.get(record)}`;
|
|
34
|
+
}
|
|
35
|
+
if (keyMap && !keyMap[index]) keyMap[index] = uid();
|
|
36
|
+
return `${keyMap[index]}`;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
33
39
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
40
|
+
function getDefaultValue(defaultValue, schema) {
|
|
41
|
+
if (isValid(defaultValue)) return clone(defaultValue);
|
|
42
|
+
if (Array.isArray(schema?.items)) return getDefaultValue(defaultValue, schema.items[0]);
|
|
43
|
+
if (schema?.items?.type === "object") return {};
|
|
44
|
+
return null;
|
|
36
45
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
46
|
+
function getArrayItemSchema(schema, index) {
|
|
47
|
+
return isArr(schema.items) ? schema.items[index] ?? schema.items[0] : schema.items;
|
|
39
48
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
49
|
+
function isAdditionComponent(schema) {
|
|
50
|
+
return schema["x-component"]?.indexOf("Addition") > -1;
|
|
42
51
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
52
|
+
function isIndexComponent(schema) {
|
|
53
|
+
return schema["x-component"]?.indexOf("Index") > -1;
|
|
45
54
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
55
|
+
function isRemoveComponent(schema) {
|
|
56
|
+
return schema["x-component"]?.indexOf("Remove") > -1;
|
|
48
57
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
58
|
+
function isMoveUpComponent(schema) {
|
|
59
|
+
return schema["x-component"]?.indexOf("MoveUp") > -1;
|
|
51
60
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
61
|
+
function isMoveDownComponent(schema) {
|
|
62
|
+
return schema["x-component"]?.indexOf("MoveDown") > -1;
|
|
54
63
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
64
|
+
function isOperationComponent(schema) {
|
|
65
|
+
return isAdditionComponent(schema) || isRemoveComponent(schema) || isMoveDownComponent(schema) || isMoveUpComponent(schema);
|
|
57
66
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
P as isIndexComponent,
|
|
63
|
-
b as isMoveDownComponent,
|
|
64
|
-
O as isMoveUpComponent,
|
|
65
|
-
V as isOperationComponent,
|
|
66
|
-
A as isRemoveComponent,
|
|
67
|
-
S as prefixCls,
|
|
68
|
-
$ as useArray,
|
|
69
|
-
K as useIndex,
|
|
70
|
-
W as useKey,
|
|
71
|
-
U as useRecord
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=utils.mjs.map
|
|
67
|
+
//#endregion
|
|
68
|
+
export { getArrayItemSchema, getDefaultValue, isAdditionComponent, isIndexComponent, isOperationComponent, isRemoveComponent, prefixCls, useArray, useIndex, useKey, useRecord };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/array-base/utils.ts"],"sourcesContent":["import type { ISchema, Schema } from '@formily/json-schema'\nimport type { IArrayBaseItemProps } from './types'\nimport { clone, isArr, isValid, uid } from '@formily/shared'\nimport { inject, toRefs } from 'vue'\nimport { stylePrefix } from '../__builtins__'\nimport { ArrayBaseSymbol, ItemSymbol } from './symbols'\n\nexport const prefixCls = `${stylePrefix}-array-base`\n\nexport function useArray() {\n return inject(ArrayBaseSymbol, null)\n}\n\nexport function useIndex() {\n const { index: indexRef } = toRefs(inject(ItemSymbol) as IArrayBaseItemProps)\n return indexRef\n}\n\n/* istanbul ignore next -- @preserve */\nexport function useRecord() {\n const { record: recordRef } = toRefs(\n inject(ItemSymbol) as IArrayBaseItemProps,\n )\n return recordRef\n}\n\nconst isObjectValue: (schema: Schema) => boolean = (schema: Schema) => {\n if (Array.isArray(schema?.items))\n return isObjectValue(schema.items[0])\n\n if (schema?.items?.type === 'array' || schema?.items?.type === 'object') {\n return true\n }\n return false\n}\n\nexport function useKey(schema: Schema) {\n const isObject = isObjectValue(schema)\n let keyMap: WeakMap<Record<string, unknown>, string> | string[] | null = null\n\n keyMap = isObject ? new WeakMap() : []\n\n return {\n keyMap,\n getKey: (record: any, index?: number) => {\n if (keyMap instanceof WeakMap) {\n if (!keyMap.has(record)) {\n keyMap.set(record, uid())\n }\n return `${keyMap.get(record)}`\n }\n\n if (keyMap && !keyMap[index]) {\n keyMap[index] = uid()\n }\n return `${keyMap[index]}`\n },\n }\n}\n\nexport function getDefaultValue(defaultValue: any, schema: Schema): any {\n if (isValid(defaultValue))\n return clone(defaultValue)\n if (Array.isArray(schema?.items))\n return getDefaultValue(defaultValue, schema.items[0])\n if (schema?.items?.type === 'object')\n return {}\n return null\n}\n\nexport function getArrayItemSchema(schema: ISchema, index: number): ISchema {\n return isArr(schema.items) ? schema.items[index] ?? schema.items[0] : schema.items\n}\n\nexport function isAdditionComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Addition') > -1\n}\n\nexport function isIndexComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Index') > -1\n}\n\nexport function isRemoveComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Remove') > -1\n}\n\nexport function isMoveUpComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('MoveUp') > -1\n}\n\nexport function isMoveDownComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('MoveDown') > -1\n}\n\nexport function isOperationComponent(schema: ISchema) {\n return (\n isAdditionComponent(schema)\n || isRemoveComponent(schema)\n || isMoveDownComponent(schema)\n || isMoveUpComponent(schema)\n )\n}\n"],"
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/array-base/utils.ts"],"sourcesContent":["import type { ISchema, Schema } from '@formily/json-schema'\nimport type { IArrayBaseItemProps } from './types'\nimport { clone, isArr, isValid, uid } from '@formily/shared'\nimport { inject, toRefs } from 'vue'\nimport { stylePrefix } from '../__builtins__'\nimport { ArrayBaseSymbol, ItemSymbol } from './symbols'\n\nexport const prefixCls = `${stylePrefix}-array-base`\n\nexport function useArray() {\n return inject(ArrayBaseSymbol, null)\n}\n\nexport function useIndex() {\n const { index: indexRef } = toRefs(inject(ItemSymbol) as IArrayBaseItemProps)\n return indexRef\n}\n\n/* istanbul ignore next -- @preserve */\nexport function useRecord() {\n const { record: recordRef } = toRefs(\n inject(ItemSymbol) as IArrayBaseItemProps,\n )\n return recordRef\n}\n\nconst isObjectValue: (schema: Schema) => boolean = (schema: Schema) => {\n if (Array.isArray(schema?.items))\n return isObjectValue(schema.items[0])\n\n if (schema?.items?.type === 'array' || schema?.items?.type === 'object') {\n return true\n }\n return false\n}\n\nexport function useKey(schema: Schema) {\n const isObject = isObjectValue(schema)\n let keyMap: WeakMap<Record<string, unknown>, string> | string[] | null = null\n\n keyMap = isObject ? new WeakMap() : []\n\n return {\n keyMap,\n getKey: (record: any, index?: number) => {\n if (keyMap instanceof WeakMap) {\n if (!keyMap.has(record)) {\n keyMap.set(record, uid())\n }\n return `${keyMap.get(record)}`\n }\n\n if (keyMap && !keyMap[index]) {\n keyMap[index] = uid()\n }\n return `${keyMap[index]}`\n },\n }\n}\n\nexport function getDefaultValue(defaultValue: any, schema: Schema): any {\n if (isValid(defaultValue))\n return clone(defaultValue)\n if (Array.isArray(schema?.items))\n return getDefaultValue(defaultValue, schema.items[0])\n if (schema?.items?.type === 'object')\n return {}\n return null\n}\n\nexport function getArrayItemSchema(schema: ISchema, index: number): ISchema {\n return isArr(schema.items) ? schema.items[index] ?? schema.items[0] : schema.items\n}\n\nexport function isAdditionComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Addition') > -1\n}\n\nexport function isIndexComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Index') > -1\n}\n\nexport function isRemoveComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('Remove') > -1\n}\n\nexport function isMoveUpComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('MoveUp') > -1\n}\n\nexport function isMoveDownComponent(schema: ISchema) {\n return schema['x-component']?.indexOf('MoveDown') > -1\n}\n\nexport function isOperationComponent(schema: ISchema) {\n return (\n isAdditionComponent(schema)\n || isRemoveComponent(schema)\n || isMoveDownComponent(schema)\n || isMoveUpComponent(schema)\n )\n}\n"],"mappings":";;;;;AAOA,MAAa,YAAY,GAAG,YAAY;AAExC,SAAgB,WAAW;AACzB,QAAO,OAAO,iBAAiB,KAAK;;AAGtC,SAAgB,WAAW;CACzB,MAAM,EAAE,OAAO,aAAa,OAAO,OAAO,WAAW,CAAwB;AAC7E,QAAO;;;AAIT,SAAgB,YAAY;CAC1B,MAAM,EAAE,QAAQ,cAAc,OAC5B,OAAO,WAAW,CACnB;AACD,QAAO;;AAGT,MAAM,iBAA8C,WAAmB;AACrE,KAAI,MAAM,QAAQ,QAAQ,MAAM,CAC9B,QAAO,cAAc,OAAO,MAAM,GAAG;AAEvC,KAAI,QAAQ,OAAO,SAAS,WAAW,QAAQ,OAAO,SAAS,SAC7D,QAAO;AAET,QAAO;;AAGT,SAAgB,OAAO,QAAgB;CACrC,MAAM,WAAW,cAAc,OAAO;CACtC,IAAI,SAAqE;AAEzE,UAAS,2BAAW,IAAI,SAAS,GAAG,EAAE;AAEtC,QAAO;EACL;EACA,SAAS,QAAa,UAAmB;AACvC,OAAI,kBAAkB,SAAS;AAC7B,QAAI,CAAC,OAAO,IAAI,OAAO,CACrB,QAAO,IAAI,QAAQ,KAAK,CAAC;AAE3B,WAAO,GAAG,OAAO,IAAI,OAAO;;AAG9B,OAAI,UAAU,CAAC,OAAO,OACpB,QAAO,SAAS,KAAK;AAEvB,UAAO,GAAG,OAAO;;EAEpB;;AAGH,SAAgB,gBAAgB,cAAmB,QAAqB;AACtE,KAAI,QAAQ,aAAa,CACvB,QAAO,MAAM,aAAa;AAC5B,KAAI,MAAM,QAAQ,QAAQ,MAAM,CAC9B,QAAO,gBAAgB,cAAc,OAAO,MAAM,GAAG;AACvD,KAAI,QAAQ,OAAO,SAAS,SAC1B,QAAO,EAAE;AACX,QAAO;;AAGT,SAAgB,mBAAmB,QAAiB,OAAwB;AAC1E,QAAO,MAAM,OAAO,MAAM,GAAG,OAAO,MAAM,UAAU,OAAO,MAAM,KAAK,OAAO;;AAG/E,SAAgB,oBAAoB,QAAiB;AACnD,QAAO,OAAO,gBAAgB,QAAQ,WAAW,GAAG;;AAGtD,SAAgB,iBAAiB,QAAiB;AAChD,QAAO,OAAO,gBAAgB,QAAQ,QAAQ,GAAG;;AAGnD,SAAgB,kBAAkB,QAAiB;AACjD,QAAO,OAAO,gBAAgB,QAAQ,SAAS,GAAG;;AAGpD,SAAgB,kBAAkB,QAAiB;AACjD,QAAO,OAAO,gBAAgB,QAAQ,SAAS,GAAG;;AAGpD,SAAgB,oBAAoB,QAAiB;AACnD,QAAO,OAAO,gBAAgB,QAAQ,WAAW,GAAG;;AAGtD,SAAgB,qBAAqB,QAAiB;AACpD,QACE,oBAAoB,OAAO,IACxB,kBAAkB,OAAO,IACzB,oBAAoB,OAAO,IAC3B,kBAAkB,OAAO"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
import { getArrayItemSchema, isAdditionComponent, isIndexComponent, isOperationComponent } from "../array-base/utils.mjs";
|
|
3
|
+
import { ArrayBase } from "../array-base/index.mjs";
|
|
4
|
+
import { ElCard, ElEmpty, ElRow } from "element-plus";
|
|
5
|
+
import { autorunEffect } from "@silver-formily/reactive-vue";
|
|
6
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
7
|
+
import { RecursionField, useField, useFieldSchema } from "@silver-formily/vue";
|
|
8
|
+
import { isArr } from "@formily/shared";
|
|
9
|
+
//#region src/array-cards/array-cards.vue
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "FArrayCards",
|
|
12
|
+
__name: "array-cards",
|
|
13
|
+
props: {
|
|
14
|
+
title: {},
|
|
15
|
+
header: {},
|
|
16
|
+
footer: {},
|
|
17
|
+
bodyStyle: {},
|
|
18
|
+
bodyClass: {},
|
|
19
|
+
shadow: { default: "never" },
|
|
20
|
+
modelValue: {}
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const fieldRef = useField();
|
|
25
|
+
const schemaRef = useFieldSchema();
|
|
26
|
+
const field = fieldRef.value;
|
|
27
|
+
const schema = schemaRef.value;
|
|
28
|
+
const prefixCls = `${stylePrefix}-array-cards`;
|
|
29
|
+
const { getKey, keyMap } = ArrayBase.useKey(schemaRef.value);
|
|
30
|
+
const dataSource = ref(isArr(field.value) ? field.value : []);
|
|
31
|
+
autorunEffect(() => {
|
|
32
|
+
dataSource.value = isArr(field.value) ? [...field.value] : [];
|
|
33
|
+
});
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(prefixCls) }, [createVNode(unref(ArrayBase), { "key-map": unref(keyMap) }, {
|
|
36
|
+
default: withCtx(() => [
|
|
37
|
+
createCommentVNode(" 空状态渲染 "),
|
|
38
|
+
!(unref(isArr)(unref(field).value) && unref(field).value.length > 0) ? (openBlock(), createBlock(unref(ElCard), mergeProps({
|
|
39
|
+
key: 0,
|
|
40
|
+
class: `${prefixCls}-item`
|
|
41
|
+
}, props), {
|
|
42
|
+
default: withCtx(() => [createVNode(unref(ElEmpty))]),
|
|
43
|
+
_: 1
|
|
44
|
+
}, 16, ["class"])) : createCommentVNode("v-if", true),
|
|
45
|
+
createCommentVNode(" 数据项渲染 "),
|
|
46
|
+
unref(isArr)(props.modelValue) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(dataSource.value, (item, index) => {
|
|
47
|
+
return openBlock(), createBlock(unref(ArrayBase).Item, {
|
|
48
|
+
key: unref(getKey)(item, index),
|
|
49
|
+
index,
|
|
50
|
+
record: item
|
|
51
|
+
}, {
|
|
52
|
+
default: withCtx(() => [createVNode(unref(ElCard), mergeProps({ ref_for: true }, props, { class: `${prefixCls}-item` }), {
|
|
53
|
+
header: withCtx(() => [createVNode(unref(ElRow), {
|
|
54
|
+
type: "flex",
|
|
55
|
+
justify: "space-between"
|
|
56
|
+
}, {
|
|
57
|
+
default: withCtx(() => [createElementVNode("span", null, [createVNode(unref(RecursionField), {
|
|
58
|
+
schema: unref(getArrayItemSchema)(unref(schema), index),
|
|
59
|
+
name: index,
|
|
60
|
+
"filter-properties": (schema) => unref(isIndexComponent)(schema),
|
|
61
|
+
"only-render-properties": true
|
|
62
|
+
}, null, 8, [
|
|
63
|
+
"schema",
|
|
64
|
+
"name",
|
|
65
|
+
"filter-properties"
|
|
66
|
+
]), createTextVNode(" " + toDisplayString(unref(getArrayItemSchema)(unref(schema), index).title ?? props.title ?? unref(field).title), 1)]), createElementVNode("span", { class: normalizeClass(`${prefixCls}-extra-container`) }, [createVNode(unref(RecursionField), {
|
|
67
|
+
schema: unref(getArrayItemSchema)(unref(schema), index),
|
|
68
|
+
name: index,
|
|
69
|
+
"filter-properties": (schema) => unref(isOperationComponent)(schema),
|
|
70
|
+
"only-render-properties": true
|
|
71
|
+
}, null, 8, [
|
|
72
|
+
"schema",
|
|
73
|
+
"name",
|
|
74
|
+
"filter-properties"
|
|
75
|
+
])], 2)]),
|
|
76
|
+
_: 2
|
|
77
|
+
}, 1024)]),
|
|
78
|
+
default: withCtx(() => [createVNode(unref(RecursionField), {
|
|
79
|
+
schema: unref(getArrayItemSchema)(unref(schema), index),
|
|
80
|
+
name: index,
|
|
81
|
+
"filter-properties": (schema) => !unref(isIndexComponent)(schema) && !unref(isOperationComponent)(schema)
|
|
82
|
+
}, null, 8, [
|
|
83
|
+
"schema",
|
|
84
|
+
"name",
|
|
85
|
+
"filter-properties"
|
|
86
|
+
])]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, 1040, ["class"])]),
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1032, ["index", "record"]);
|
|
91
|
+
}), 128)) : createCommentVNode("v-if", true),
|
|
92
|
+
createCommentVNode(" 添加按钮渲染 "),
|
|
93
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(schema).properties, (itemSchema, key) => {
|
|
94
|
+
return openBlock(), createElementBlock(Fragment, { key }, [unref(isAdditionComponent)(itemSchema) ? (openBlock(), createBlock(unref(RecursionField), {
|
|
95
|
+
key: 0,
|
|
96
|
+
schema: itemSchema,
|
|
97
|
+
name: "addition"
|
|
98
|
+
}, null, 8, ["schema"])) : createCommentVNode("v-if", true)], 64);
|
|
99
|
+
}), 128))
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["key-map"])]);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
export { _sfc_main as default };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=array-cards.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-cards.mjs","names":[],"sources":["../../src/array-cards/array-cards.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { ISchema } from '@formily/json-schema'\nimport { isArr } from '@formily/shared'\nimport { autorunEffect } from '@silver-formily/reactive-vue'\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\nimport { ElCard, ElEmpty, ElRow } from 'element-plus'\nimport { ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { ArrayBase } from '../array-base'\nimport { getArrayItemSchema, isAdditionComponent, isIndexComponent, isOperationComponent } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayCards',\n})\n\nconst props = withDefaults(defineProps<{\n title?: string\n header?: string\n footer?: string\n bodyStyle?: Record<string, string>\n bodyClass?: string\n shadow?: 'always' | 'hover' | 'never'\n modelValue: any\n}>(), {\n shadow: 'never',\n})\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\nconst field = fieldRef.value\nconst schema = schemaRef.value\n\nconst prefixCls = `${stylePrefix}-array-cards`\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\n\nconst dataSource = ref(isArr(field.value) ? field.value : [])\n\nautorunEffect(() => {\n dataSource.value = isArr(field.value) ? [...field.value] : []\n})\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ArrayBase :key-map=\"keyMap\">\n <!-- 空状态渲染 -->\n <ElCard\n v-if=\"!(isArr(field.value) && field.value.length > 0)\"\n :class=\"`${prefixCls}-item`\"\n v-bind=\"props\"\n >\n <ElEmpty />\n </ElCard>\n\n <!-- 数据项渲染 -->\n <template v-if=\"isArr(props.modelValue)\">\n <ArrayBase.Item\n v-for=\"(item, index) of dataSource\"\n :key=\"getKey(item, index)\"\n :index=\"index\"\n :record=\"item\"\n >\n <ElCard\n v-bind=\"props\"\n :class=\"`${prefixCls}-item`\"\n >\n <template #header>\n <ElRow type=\"flex\" justify=\"space-between\">\n <span>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isIndexComponent(schema)\"\n :only-render-properties=\"true\"\n />\n {{ getArrayItemSchema(schema, index).title ?? props.title ?? field.title }}\n </span>\n <span :class=\"`${prefixCls}-extra-container`\">\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => isOperationComponent(schema)\"\n :only-render-properties=\"true\"\n />\n </span>\n </ElRow>\n </template>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n :filter-properties=\"(schema: ISchema) => !isIndexComponent(schema) && !isOperationComponent(schema)\"\n />\n </ElCard>\n </ArrayBase.Item>\n </template>\n\n <!-- 添加按钮渲染 -->\n <template v-for=\"(itemSchema, key) in schema.properties\" :key=\"key\">\n <RecursionField\n v-if=\"isAdditionComponent(itemSchema)\"\n :schema=\"itemSchema\"\n name=\"addition\"\n />\n </template>\n </ArrayBase>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAWd,MAAM,WAAW,UAAqB;EACtC,MAAM,YAAY,gBAAe;EACjC,MAAM,QAAQ,SAAS;EACvB,MAAM,SAAS,UAAU;EAEzB,MAAM,YAAY,GAAG,YAAY;EACjC,MAAM,EAAE,QAAQ,WAAW,UAAU,OAAO,UAAU,MAAK;EAE3D,MAAM,aAAa,IAAI,MAAM,MAAM,MAAM,GAAG,MAAM,QAAQ,EAAE,CAAA;AAE5D,sBAAoB;AAClB,cAAW,QAAQ,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,MAAM,GAAG,EAAC;IAC7D;;uBAIC,mBA8DM,OAAA,EA9DA,OAAK,eAAE,UAAS,EAAA,EAAA,CACpB,YA4DY,MAAA,UAAA,EAAA,EA5DA,WAAS,MAAA,OAAM,EAAA,EAAA;2BACX;KAAd,mBAAA,UAAc;OAEJ,MAAA,MAAK,CAAC,MAAA,MAAK,CAAC,MAAK,IAAK,MAAA,MAAK,CAAC,MAAM,SAAM,MAAA,WAAA,EADlD,YAMS,MAAA,OAAA,EANT,WAMS;;MAJN,OAAK,GAAK,UAAS;QACZ,MAAK,EAAA;6BAEF,CAAX,YAAW,MAAA,QAAA,CAAA,CAAA,CAAA;;;KAGb,mBAAA,UAAc;KACE,MAAA,MAAK,CAAC,MAAM,WAAU,IAAA,UAAA,KAAA,EACpC,mBAqCiB,UAAA,EAAA,KAAA,GAAA,EAAA,WApCS,WAAA,QAAhB,MAAM,UAAK;0BADrB,YAqCiB,MAAA,UAAA,CAAA,MAAA;OAnCd,KAAK,MAAA,OAAM,CAAC,MAAM,MAAK;OAChB;OACP,QAAQ;;8BAgCA,CA9BT,YA8BS,MAAA,OAAA,EA9BT,WA8BS,EAAA,SAAA,MAAA,EA7BC,OAAK,EACZ,OAAK,GAAK,UAAS,QAAA,CAAA,EAAA;QAET,QAAM,cAmBP,CAlBR,YAkBQ,MAAA,MAAA,EAAA;SAlBD,MAAK;SAAO,SAAQ;;gCASlB,CARP,mBAQO,QAAA,MAAA,CAPL,YAKE,MAAA,eAAA,EAAA;UAJC,QAAQ,MAAA,mBAAkB,CAAC,MAAA,OAAM,EAAE,MAAK;UACxC,MAAM;UACN,sBAAoB,WAAoB,MAAA,iBAAgB,CAAC,OAAM;UAC/D,0BAAwB;;;;;6BACzB,MACF,gBAAG,MAAA,mBAAkB,CAAC,MAAA,OAAM,EAAE,MAAK,CAAE,SAAS,MAAM,SAAS,MAAA,MAAK,CAAC,MAAK,EAAA,EAAA,CAAA,CAAA,EAE1E,mBAOO,QAAA,EAPA,OAAK,eAAA,GAAK,UAAS,kBAAA,EAAA,EAAA,CACxB,YAKE,MAAA,eAAA,EAAA;UAJC,QAAQ,MAAA,mBAAkB,CAAC,MAAA,OAAM,EAAE,MAAK;UACxC,MAAM;UACN,sBAAoB,WAAoB,MAAA,qBAAoB,CAAC,OAAM;UACnE,0BAAwB;;;;;;;;+BAS/B,CAJF,YAIE,MAAA,eAAA,EAAA;SAHC,QAAQ,MAAA,mBAAkB,CAAC,MAAA,OAAM,EAAE,MAAK;SACxC,MAAM;SACN,sBAAoB,WAAe,CAAM,MAAA,iBAAgB,CAAC,OAAM,IAAA,CAAM,MAAA,qBAAoB,CAAC,OAAM;;;;;;;;;;;KAM1G,mBAAA,WAAe;uBACf,mBAMW,UAAA,MAAA,WAN2B,MAAA,OAAM,CAAC,aAA3B,YAAY,QAAG;yDAA8B,KAAG,EAAA,CAExD,MAAA,oBAAmB,CAAC,WAAU,IAAA,WAAA,EADtC,YAIE,MAAA,eAAA,EAAA;;OAFC,QAAQ;OACT,MAAK"}
|