@silver-formily/element-plus 3.0.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +3 -1
- package/README.md +3 -1
- package/esm/__builtins__/configs/index.mjs +6 -5
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/shared/load-config-provider.mjs +19 -11
- package/esm/__builtins__/shared/load-config-provider.mjs.map +1 -1
- package/esm/__builtins__/shared/loading.mjs +50 -46
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs +16 -15
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs +30 -31
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.mjs +74 -62
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +44 -32
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/_virtual/_/plugin-vue/export-helper.mjs +8 -0
- package/esm/array-base/array-base-addition.mjs +53 -0
- package/esm/array-base/array-base-addition.mjs.map +1 -0
- package/esm/array-base/array-base-index.mjs +17 -0
- package/esm/array-base/array-base-index.mjs.map +1 -0
- package/esm/array-base/array-base-inner.mjs +30 -0
- package/esm/array-base/array-base-inner.mjs.map +1 -0
- package/esm/array-base/array-base-item.mjs +21 -0
- package/esm/array-base/array-base-item.mjs.map +1 -0
- package/esm/array-base/array-base-move-down.mjs +45 -0
- package/esm/array-base/array-base-move-down.mjs.map +1 -0
- package/esm/array-base/array-base-move-up.mjs +45 -0
- package/esm/array-base/array-base-move-up.mjs.map +1 -0
- package/esm/array-base/array-base-remove.mjs +45 -0
- package/esm/array-base/array-base-remove.mjs.map +1 -0
- package/esm/array-base/array-base-sort-handle.mjs +33 -0
- package/esm/array-base/array-base-sort-handle.mjs.map +1 -0
- package/esm/array-base/index.mjs +28 -208
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/style.css +36 -0
- package/esm/array-base/symbols.mjs +7 -6
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/types.d.ts +23 -24
- package/esm/array-base/utils.d.ts +11 -17
- package/esm/array-base/utils.mjs +58 -60
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/array-cards.mjs +109 -0
- package/esm/array-cards/array-cards.mjs.map +1 -0
- package/esm/array-cards/index.d.ts +120 -113
- package/esm/array-cards/index.mjs +19 -118
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-cards/style.css +20 -0
- package/esm/array-collapse/array-collapse-item.mjs +74 -0
- package/esm/array-collapse/array-collapse-item.mjs.map +1 -0
- package/esm/array-collapse/array-collapse.mjs +117 -0
- package/esm/array-collapse/array-collapse.mjs.map +1 -0
- package/esm/array-collapse/index.d.ts +137 -129
- package/esm/array-collapse/index.mjs +21 -174
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/style.css +20 -0
- package/esm/array-collapse/utils.mjs +7 -12
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/array-items-item.mjs +22 -0
- package/esm/array-items/array-items-item.mjs.map +1 -0
- package/esm/array-items/array-items.mjs +88 -0
- package/esm/array-items/array-items.mjs.map +1 -0
- package/esm/array-items/index.d.ts +132 -125
- package/esm/array-items/index.mjs +21 -107
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-items/style.css +22 -0
- package/esm/array-list-tabs/array-list-tabs.mjs +191 -0
- package/esm/array-list-tabs/array-list-tabs.mjs.map +1 -0
- package/esm/array-list-tabs/index.d.ts +80 -74
- package/esm/array-list-tabs/index.mjs +12 -186
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/style.css +90 -0
- package/esm/array-list-tabs/utils.mjs +11 -15
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/array-table.mjs +236 -0
- package/esm/array-table/array-table.mjs.map +1 -0
- package/esm/array-table/index.d.ts +106 -1597
- package/esm/array-table/index.mjs +24 -223
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/style.css +23 -0
- package/esm/array-table/types.d.ts +11 -6
- package/esm/array-table/utils.mjs +14 -22
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/array-tabs.mjs +92 -0
- package/esm/array-tabs/array-tabs.mjs.map +1 -0
- package/esm/array-tabs/index.d.ts +7 -2
- package/esm/array-tabs/index.mjs +8 -84
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/array-tabs/style.css +7 -0
- package/esm/autocomplete/autocomplete.mjs +99 -0
- package/esm/autocomplete/autocomplete.mjs.map +1 -0
- package/esm/autocomplete/index.d.ts +44 -638
- package/esm/autocomplete/index.mjs +14 -113
- package/esm/autocomplete/index.mjs.map +1 -1
- package/esm/cascader/cascader.mjs +32 -0
- package/esm/cascader/cascader.mjs.map +1 -0
- package/esm/cascader/index.d.ts +34 -27
- package/esm/cascader/index.mjs +13 -50
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.mjs +64 -0
- package/esm/checkbox/checkbox-group.mjs.map +1 -0
- package/esm/checkbox/index.d.ts +772 -766
- package/esm/checkbox/index.mjs +16 -69
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.d.ts +214 -207
- package/esm/color-picker/index.mjs +13 -17
- package/esm/color-picker/index.mjs.map +1 -1
- package/esm/color-picker-panel/index.d.ts +118 -110
- package/esm/color-picker-panel/index.mjs +16 -25
- package/esm/color-picker-panel/index.mjs.map +1 -1
- package/esm/date-picker/index.d.ts +449 -441
- package/esm/date-picker/index.mjs +21 -29
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.mjs +21 -26
- package/esm/date-picker/utils.mjs.map +1 -1
- package/esm/date-picker-panel/index.d.ts +149 -141
- package/esm/date-picker-panel/index.mjs +23 -30
- package/esm/date-picker-panel/index.mjs.map +1 -1
- package/esm/editable/editable-popover.mjs +95 -0
- package/esm/editable/editable-popover.mjs.map +1 -0
- package/esm/editable/editable.mjs +113 -0
- package/esm/editable/editable.mjs.map +1 -0
- package/esm/editable/index.d.ts +60 -141
- package/esm/editable/index.mjs +17 -219
- package/esm/editable/index.mjs.map +1 -1
- package/esm/editable/style.css +29 -0
- package/esm/form/form.mjs +50 -70
- package/esm/form/form.mjs.map +1 -1
- package/esm/form/form.vue.d.ts +48 -0
- package/esm/form/index.d.ts +1 -1
- package/esm/form-button-group/form-button-group-sticky.mjs +37 -0
- package/esm/form-button-group/form-button-group-sticky.mjs.map +1 -0
- package/esm/form-button-group/form-button-group.mjs +71 -0
- package/esm/form-button-group/form-button-group.mjs.map +1 -0
- package/esm/form-button-group/index.d.ts +94 -87
- package/esm/form-button-group/index.mjs +10 -96
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/style.css +281 -0
- package/esm/form-button-group/utils.mjs +7 -12
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/form-collapse.mjs +74 -0
- package/esm/form-collapse/form-collapse.mjs.map +1 -0
- package/esm/form-collapse/index.d.ts +43 -39
- package/esm/form-collapse/index.mjs +20 -86
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/style.css +7 -0
- package/esm/form-collapse/utils.d.ts +21 -27
- package/esm/form-collapse/utils.mjs +48 -46
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/dialog-content.mjs +118 -0
- package/esm/form-dialog/dialog-content.mjs.map +1 -0
- package/esm/form-dialog/index.d.ts +8 -4
- package/esm/form-dialog/index.mjs +142 -211
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +38 -32
- package/esm/form-drawer/drawer-content.mjs +118 -0
- package/esm/form-drawer/drawer-content.mjs.map +1 -0
- package/esm/form-drawer/index.d.ts +8 -4
- package/esm/form-drawer/index.mjs +142 -204
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +38 -32
- package/esm/form-grid/form-grid-column.mjs +28 -0
- package/esm/form-grid/form-grid-column.mjs.map +1 -0
- package/esm/form-grid/form-grid.mjs +69 -0
- package/esm/form-grid/form-grid.mjs.map +1 -0
- package/esm/form-grid/hooks.mjs +7 -7
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.d.ts +5 -2
- package/esm/form-grid/index.mjs +10 -109
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-grid/style.css +128 -0
- package/esm/form-item/form-item.mjs +308 -0
- package/esm/form-item/form-item.mjs.map +1 -0
- package/esm/form-item/form-item.vue.d.ts +29 -0
- package/esm/form-item/index.d.ts +81 -67
- package/esm/form-item/index.mjs +28 -332
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/style.css +263 -0
- package/esm/form-item/types.d.ts +34 -29
- package/esm/form-item/utils.mjs +15 -15
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +103 -83
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/form-layout.vue.d.ts +28 -0
- package/esm/form-layout/index.d.ts +1 -1
- package/esm/form-layout/types.d.ts +24 -40
- package/esm/form-layout/utils.mjs +73 -99
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/form-step-pane.mjs +15 -0
- package/esm/form-step/form-step-pane.mjs.map +1 -0
- package/esm/form-step/form-step.mjs +63 -0
- package/esm/form-step/form-step.mjs.map +1 -0
- package/esm/form-step/index.d.ts +29 -23
- package/esm/form-step/index.mjs +12 -93
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/types.d.ts +19 -19
- package/esm/form-step/utils.d.ts +14 -10
- package/esm/form-step/utils.mjs +75 -59
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/form-tab.mjs +79 -0
- package/esm/form-tab/form-tab.mjs.map +1 -0
- package/esm/form-tab/hooks.mjs +18 -16
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +5 -3
- package/esm/form-tab/index.mjs +10 -76
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/style.css +4 -0
- package/esm/form-tab/utils.mjs +14 -13
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.d.ts +55 -48
- package/esm/index.mjs +51 -103
- package/esm/input/index.d.ts +41 -46
- package/esm/input/index.mjs +16 -68
- package/esm/input/index.mjs.map +1 -1
- package/esm/input/input.mjs +41 -0
- package/esm/input/input.mjs.map +1 -0
- package/esm/input-number/index.d.ts +281 -275
- package/esm/input-number/index.mjs +12 -24
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.d.ts +29 -31
- package/esm/input-tag/index.mjs +13 -49
- package/esm/input-tag/index.mjs.map +1 -1
- package/esm/input-tag/input-tag.mjs +41 -0
- package/esm/input-tag/input-tag.mjs.map +1 -0
- package/esm/mention/index.d.ts +39 -49
- package/esm/mention/index.mjs +15 -96
- package/esm/mention/index.mjs.map +1 -1
- package/esm/mention/mention.mjs +77 -0
- package/esm/mention/mention.mjs.map +1 -0
- package/esm/pagination/components/jumper.mjs +11 -12
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/jumper2.mjs +59 -0
- package/esm/pagination/components/jumper2.mjs.map +1 -0
- package/esm/pagination/components/next.mjs +18 -22
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/next2.mjs +38 -0
- package/esm/pagination/components/next2.mjs.map +1 -0
- package/esm/pagination/components/pager.mjs +21 -22
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/pager2.mjs +229 -0
- package/esm/pagination/components/pager2.mjs.map +1 -0
- package/esm/pagination/components/prev.mjs +16 -22
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/prev2.mjs +38 -0
- package/esm/pagination/components/prev2.mjs.map +1 -0
- package/esm/pagination/components/sizes.mjs +32 -7
- package/esm/pagination/components/sizes.mjs.map +1 -1
- package/esm/pagination/components/sizes2.mjs +66 -0
- package/esm/pagination/components/sizes2.mjs.map +1 -0
- package/esm/pagination/components/total.mjs +10 -11
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/components/total2.mjs +26 -0
- package/esm/pagination/components/total2.mjs.map +1 -0
- package/esm/pagination/pagination.mjs +271 -626
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.d.ts +43 -48
- package/esm/password/index.mjs +11 -14
- package/esm/password/index.mjs.map +1 -1
- package/esm/picker-select/index.d.ts +47 -0
- package/esm/picker-select/index.mjs +14 -0
- package/esm/picker-select/index.mjs.map +1 -0
- package/esm/picker-select/picker-select.mjs +186 -0
- package/esm/picker-select/picker-select.mjs.map +1 -0
- package/esm/picker-select/types.d.ts +23 -0
- package/esm/preview-text/cascader.mjs +51 -0
- package/esm/preview-text/cascader.mjs.map +1 -0
- package/esm/preview-text/color-picker.mjs +37 -0
- package/esm/preview-text/color-picker.mjs.map +1 -0
- package/esm/preview-text/date-picker.mjs +61 -0
- package/esm/preview-text/date-picker.mjs.map +1 -0
- package/esm/preview-text/index.d.ts +107 -106
- package/esm/preview-text/index.mjs +25 -363
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/input.mjs +39 -0
- package/esm/preview-text/input.mjs.map +1 -0
- package/esm/preview-text/preview.mjs +30 -0
- package/esm/preview-text/preview.mjs.map +1 -0
- package/esm/preview-text/rate.mjs +32 -0
- package/esm/preview-text/rate.mjs.map +1 -0
- package/esm/preview-text/select.mjs +42 -0
- package/esm/preview-text/select.mjs.map +1 -0
- package/esm/preview-text/style.css +16 -0
- package/esm/preview-text/time-picker.mjs +39 -0
- package/esm/preview-text/time-picker.mjs.map +1 -0
- package/esm/preview-text/tree.mjs +73 -0
- package/esm/preview-text/tree.mjs.map +1 -0
- package/esm/preview-text/utils.d.ts +10 -13
- package/esm/preview-text/utils.mjs +15 -15
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.mjs +45 -45
- package/esm/query-form/default-components.mjs.map +1 -1
- package/esm/query-form/hooks.mjs +31 -26
- package/esm/query-form/hooks.mjs.map +1 -1
- package/esm/query-form/index.d.ts +115 -105
- package/esm/query-form/index.mjs +10 -333
- package/esm/query-form/index.mjs.map +1 -1
- package/esm/query-form/query-form-light.mjs +86 -0
- package/esm/query-form/query-form-light.mjs.map +1 -0
- package/esm/query-form/query-form.mjs +263 -0
- package/esm/query-form/query-form.mjs.map +1 -0
- package/esm/query-form/style.css +27 -0
- package/esm/query-form/types.d.ts +42 -41
- package/esm/query-form-item/index.d.ts +138 -131
- package/esm/query-form-item/index.mjs +15 -183
- package/esm/query-form-item/index.mjs.map +1 -1
- package/esm/query-form-item/query-form-item.mjs +195 -0
- package/esm/query-form-item/query-form-item.mjs.map +1 -0
- package/esm/query-form-item/style.css +12 -0
- package/esm/query-form-item/types.d.ts +42 -38
- package/esm/radio/index.d.ts +482 -472
- package/esm/radio/index.mjs +15 -68
- package/esm/radio/index.mjs.map +1 -1
- package/esm/radio/radio-group.mjs +70 -0
- package/esm/radio/radio-group.mjs.map +1 -0
- package/esm/{styles/radio/index.css → radio/style.css} +3 -1
- package/esm/rate/index.d.ts +190 -184
- package/esm/rate/index.mjs +13 -17
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.d.ts +5 -2
- package/esm/reset/index.mjs +8 -44
- package/esm/reset/index.mjs.map +1 -1
- package/esm/reset/reset.mjs +42 -0
- package/esm/reset/reset.mjs.map +1 -0
- package/esm/segmented/index.d.ts +31 -25
- package/esm/segmented/index.mjs +13 -40
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/segmented/segmented.mjs +26 -0
- package/esm/segmented/segmented.mjs.map +1 -0
- package/esm/select/index.d.ts +108 -121
- package/esm/select/index.mjs +14 -127
- package/esm/select/index.mjs.map +1 -1
- package/esm/select/select.mjs +95 -0
- package/esm/select/select.mjs.map +1 -0
- package/esm/select-table/index.d.ts +53 -1546
- package/esm/select-table/index.mjs +12 -204
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.mjs +202 -0
- package/esm/select-table/select-table.mjs.map +1 -0
- package/esm/select-table/style.css +14 -0
- package/esm/select-table/types.d.ts +21 -16
- package/esm/shared/overlay-elements.mjs +15 -16
- package/esm/shared/overlay-elements.mjs.map +1 -1
- package/esm/shared/url-change-listener.mjs +50 -0
- package/esm/shared/url-change-listener.mjs.map +1 -0
- package/esm/slider/index.d.ts +182 -174
- package/esm/slider/index.mjs +13 -17
- package/esm/slider/index.mjs.map +1 -1
- package/esm/space/index.d.ts +2 -1
- package/esm/space/index.mjs +2 -6
- package/esm/submit/index.d.ts +5 -2
- package/esm/submit/index.mjs +8 -40
- package/esm/submit/index.mjs.map +1 -1
- package/esm/submit/submit.mjs +41 -0
- package/esm/submit/submit.mjs.map +1 -0
- package/esm/switch/index.d.ts +255 -249
- package/esm/switch/index.mjs +8 -13
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +451 -443
- package/esm/time-picker/index.mjs +10 -17
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +189 -182
- package/esm/time-select/index.mjs +13 -17
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.d.ts +246 -238
- package/esm/transfer/index.mjs +8 -11
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +40 -33
- package/esm/tree/index.mjs +14 -104
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/tree.mjs +127 -0
- package/esm/tree/tree.mjs.map +1 -0
- package/esm/tree/types.d.ts +17 -12
- package/esm/tree/utils.mjs +157 -149
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +22 -15
- package/esm/tree-select/index.mjs +13 -40
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/tree-select/tree-select.mjs +38 -0
- package/esm/tree-select/tree-select.mjs.map +1 -0
- package/esm/upload/index.d.ts +117 -696
- package/esm/upload/index.mjs +11 -172
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.mjs +176 -0
- package/esm/upload/upload.mjs.map +1 -0
- package/package.json +24 -25
- package/esm/__builtins__/configs/index.d.ts +0 -1
- package/esm/__builtins__/index.d.ts +0 -2
- package/esm/__builtins__/index.mjs +0 -23
- package/esm/__builtins__/index.mjs.map +0 -1
- package/esm/__builtins__/shared/index.d.ts +0 -6
- package/esm/__builtins__/shared/index.mjs +0 -21
- package/esm/__builtins__/shared/index.mjs.map +0 -1
- package/esm/__builtins__/shared/load-config-provider.d.ts +0 -2
- package/esm/__builtins__/shared/loading.d.ts +0 -12
- package/esm/__builtins__/shared/simple-version-compare.d.ts +0 -2
- package/esm/__builtins__/shared/transform-component.d.ts +0 -3
- package/esm/__builtins__/shared/types.d.ts +0 -2
- package/esm/__builtins__/shared/types.mjs +0 -2
- package/esm/__builtins__/shared/types.mjs.map +0 -1
- package/esm/__builtins__/shared/use-enter-submit.d.ts +0 -9
- package/esm/__builtins__/shared/utils.d.ts +0 -9
- package/esm/array-base/array-base-addition.d.ts +0 -5
- package/esm/array-base/array-base-index.d.ts +0 -19
- package/esm/array-base/array-base-inner.d.ts +0 -18
- package/esm/array-base/array-base-item.d.ts +0 -18
- package/esm/array-base/array-base-move-down.d.ts +0 -18
- package/esm/array-base/array-base-move-up.d.ts +0 -18
- package/esm/array-base/array-base-remove.d.ts +0 -18
- package/esm/array-base/array-base-sort-handle.d.ts +0 -2
- package/esm/array-base/index.d.ts +0 -114
- package/esm/array-base/symbols.d.ts +0 -4
- package/esm/array-base/types.mjs +0 -2
- package/esm/array-base/types.mjs.map +0 -1
- package/esm/array-cards/array-cards.d.ts +0 -13
- package/esm/array-collapse/array-collapse-item.d.ts +0 -18
- package/esm/array-collapse/array-collapse.d.ts +0 -16
- package/esm/array-collapse/utils.d.ts +0 -1
- package/esm/array-items/array-items-item.d.ts +0 -30
- package/esm/array-items/array-items.d.ts +0 -2
- package/esm/array-list-tabs/array-list-tabs.d.ts +0 -31
- package/esm/array-list-tabs/utils.d.ts +0 -3
- package/esm/array-table/array-table.d.ts +0 -1505
- package/esm/array-table/types.mjs +0 -2
- package/esm/array-table/types.mjs.map +0 -1
- package/esm/array-table/utils.d.ts +0 -5
- package/esm/array-tabs/array-tabs.d.ts +0 -2
- package/esm/autocomplete/autocomplete.d.ts +0 -1222
- package/esm/cascader/cascader.d.ts +0 -25
- package/esm/checkbox/checkbox-group.d.ts +0 -42
- package/esm/date-picker/utils.d.ts +0 -4
- package/esm/editable/editable-popover.d.ts +0 -25
- package/esm/editable/editable.d.ts +0 -193
- package/esm/env.d.d.ts +0 -1
- package/esm/env.d.mjs +0 -2
- package/esm/env.d.mjs.map +0 -1
- package/esm/form/form.d.ts +0 -46
- package/esm/form/index.mjs +0 -6
- package/esm/form/index.mjs.map +0 -1
- package/esm/form-button-group/form-button-group-sticky.d.ts +0 -17
- package/esm/form-button-group/form-button-group.d.ts +0 -57
- package/esm/form-button-group/utils.d.ts +0 -1
- package/esm/form-collapse/form-collapse.d.ts +0 -18
- package/esm/form-dialog/dialog-content.d.ts +0 -846
- package/esm/form-dialog/types.mjs +0 -2
- package/esm/form-dialog/types.mjs.map +0 -1
- package/esm/form-drawer/drawer-content.d.ts +0 -976
- package/esm/form-drawer/types.mjs +0 -2
- package/esm/form-drawer/types.mjs.map +0 -1
- package/esm/form-grid/form-grid-column.d.ts +0 -29
- package/esm/form-grid/form-grid.d.ts +0 -101
- package/esm/form-grid/hooks.d.ts +0 -4
- package/esm/form-item/form-item.d.ts +0 -19
- package/esm/form-item/types.mjs +0 -2
- package/esm/form-item/types.mjs.map +0 -1
- package/esm/form-item/utils.d.ts +0 -3
- package/esm/form-layout/form-layout.d.ts +0 -31
- package/esm/form-layout/index.mjs +0 -6
- package/esm/form-layout/index.mjs.map +0 -1
- package/esm/form-layout/types.mjs +0 -2
- package/esm/form-layout/types.mjs.map +0 -1
- package/esm/form-layout/utils.d.ts +0 -57
- package/esm/form-step/form-step-pane.d.ts +0 -2
- package/esm/form-step/form-step.d.ts +0 -5
- package/esm/form-step/types.mjs +0 -2
- package/esm/form-step/types.mjs.map +0 -1
- package/esm/form-tab/form-tab.d.ts +0 -7
- package/esm/form-tab/hooks.d.ts +0 -8
- package/esm/form-tab/types.d.ts +0 -12
- package/esm/form-tab/types.mjs +0 -2
- package/esm/form-tab/types.mjs.map +0 -1
- package/esm/form-tab/utils.d.ts +0 -4
- package/esm/index.mjs.map +0 -1
- package/esm/input/input.d.ts +0 -25
- package/esm/input-tag/input-tag.d.ts +0 -32
- package/esm/mention/mention.d.ts +0 -51
- package/esm/pagination/components/jumper.d.ts +0 -16
- package/esm/pagination/components/next.d.ts +0 -42
- package/esm/pagination/components/pager.d.ts +0 -42
- package/esm/pagination/components/prev.d.ts +0 -39
- package/esm/pagination/components/sizes.d.ts +0 -56
- package/esm/pagination/components/total.d.ts +0 -8
- package/esm/pagination/pagination.d.ts +0 -128
- package/esm/preview-text/cascader.d.ts +0 -5
- package/esm/preview-text/color-picker.d.ts +0 -5
- package/esm/preview-text/date-picker.d.ts +0 -5
- package/esm/preview-text/input.d.ts +0 -28
- package/esm/preview-text/preview.d.ts +0 -18
- package/esm/preview-text/rate.d.ts +0 -5
- package/esm/preview-text/select.d.ts +0 -5
- package/esm/preview-text/time-picker.d.ts +0 -5
- package/esm/preview-text/tree.d.ts +0 -22
- package/esm/query-form/default-components.d.ts +0 -5
- package/esm/query-form/hooks.d.ts +0 -25
- package/esm/query-form/query-form-light.d.ts +0 -27
- package/esm/query-form/query-form.d.ts +0 -52
- package/esm/query-form/types.mjs +0 -2
- package/esm/query-form/types.mjs.map +0 -1
- package/esm/query-form-item/query-form-item.d.ts +0 -96
- package/esm/query-form-item/types.mjs +0 -2
- package/esm/query-form-item/types.mjs.map +0 -1
- package/esm/radio/radio-group.d.ts +0 -33
- package/esm/reset/reset.d.ts +0 -45
- package/esm/segmented/segmented.d.ts +0 -25
- package/esm/select/select.d.ts +0 -45
- package/esm/select-table/select-table.d.ts +0 -3030
- package/esm/select-table/types.mjs +0 -2
- package/esm/select-table/types.mjs.map +0 -1
- package/esm/shared/overlay-elements.d.ts +0 -6
- package/esm/space/index.mjs.map +0 -1
- package/esm/styles/array-base/index.css +0 -1
- package/esm/styles/array-cards/index.css +0 -1
- package/esm/styles/array-collapse/index.css +0 -1
- package/esm/styles/array-items/index.css +0 -1
- package/esm/styles/array-list-tabs/index.css +0 -1
- package/esm/styles/array-table/index.css +0 -1
- package/esm/styles/array-tabs/index.css +0 -1
- package/esm/styles/editable/index.css +0 -1
- package/esm/styles/form-button-group/index.css +0 -1
- package/esm/styles/form-collapse/index.css +0 -1
- package/esm/styles/form-grid/index.css +0 -1
- package/esm/styles/form-item/index.css +0 -1
- package/esm/styles/form-tab/index.css +0 -1
- package/esm/styles/preview-text/index.css +0 -1
- package/esm/styles/query-form/index.css +0 -1
- package/esm/styles/query-form-item/index.css +0 -1
- package/esm/styles/select-table/index.css +0 -1
- package/esm/submit/submit.d.ts +0 -36
- package/esm/tree/tree.d.ts +0 -20
- package/esm/tree/types.mjs +0 -2
- package/esm/tree/types.mjs.map +0 -1
- package/esm/tree/utils.d.ts +0 -45
- package/esm/tree-select/tree-select.d.ts +0 -10
- package/esm/upload/upload.d.ts +0 -1259
- package/esm/vendor/icon.mjs +0 -11
- package/esm/vendor/icon.mjs.map +0 -1
- package/esm/vendor/lodash.mjs +0 -1506
- package/esm/vendor/lodash.mjs.map +0 -1
- package/esm/vendor/runtime.mjs +0 -34
- package/esm/vendor/runtime.mjs.map +0 -1
- package/esm/vendor/shared.esm-bundler.mjs +0 -9
- package/esm/vendor/shared.esm-bundler.mjs.map +0 -1
- package/esm/vendor/sizes.mjs +0 -27
- package/esm/vendor/sizes.mjs.map +0 -1
- package/esm/vendor/types.mjs +0 -19
- package/esm/vendor/types.mjs.map +0 -1
package/esm/tree/index.mjs
CHANGED
|
@@ -1,104 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
import "@
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
__name: "tree",
|
|
16
|
-
props: {
|
|
17
|
-
nodeKey: {},
|
|
18
|
-
data: {},
|
|
19
|
-
modelValue: {},
|
|
20
|
-
valueType: { default: "all" },
|
|
21
|
-
includeHalfChecked: { type: Boolean, default: !1 },
|
|
22
|
-
optionAsValue: { type: Boolean, default: !1 },
|
|
23
|
-
props: { default: {
|
|
24
|
-
children: "children",
|
|
25
|
-
label: "label",
|
|
26
|
-
disabled: "disabled"
|
|
27
|
-
} },
|
|
28
|
-
optionFormatter: {},
|
|
29
|
-
height: {},
|
|
30
|
-
maxHeight: {}
|
|
31
|
-
},
|
|
32
|
-
emits: ["update:modelValue"],
|
|
33
|
-
setup(K, { emit: V }) {
|
|
34
|
-
const e = K, s = V, b = F(), { props: l } = G(), o = h(), d = h([]), n = y(() => J(e.data ?? [], l.value.disabled, e.props)), p = y(() => M(n.value ?? [], [], e.props.children));
|
|
35
|
-
async function c() {
|
|
36
|
-
await k();
|
|
37
|
-
const t = o.value.getCheckedKeys(), f = o.value.getHalfCheckedKeys() || [];
|
|
38
|
-
d.value = t;
|
|
39
|
-
const { value: m, nodes: r } = U(t, f, {
|
|
40
|
-
flatData: p.value,
|
|
41
|
-
nodeKey: e.nodeKey,
|
|
42
|
-
propsConfig: e.props,
|
|
43
|
-
data: e.data ?? [],
|
|
44
|
-
valueType: e.valueType,
|
|
45
|
-
includeHalfChecked: e.includeHalfChecked,
|
|
46
|
-
checkStrictly: l.value.checkStrictly
|
|
47
|
-
});
|
|
48
|
-
e.optionAsValue ? q(e.optionFormatter) ? s("update:modelValue", r.map((i, x, S) => e.optionFormatter(i, x, S))) : s("update:modelValue", r) : s("update:modelValue", m);
|
|
49
|
-
}
|
|
50
|
-
v(() => e.modelValue, (t) => {
|
|
51
|
-
t !== void 0 && (d.value = Q(t, {
|
|
52
|
-
optionAsValue: e.optionAsValue,
|
|
53
|
-
nodeKey: e.nodeKey,
|
|
54
|
-
flatData: p.value,
|
|
55
|
-
propsConfig: e.props,
|
|
56
|
-
data: e.data ?? [],
|
|
57
|
-
valueType: e.valueType,
|
|
58
|
-
checkStrictly: l.value.checkStrictly
|
|
59
|
-
}), k(() => {
|
|
60
|
-
o.value && o.value.setCheckedKeys(d.value);
|
|
61
|
-
}));
|
|
62
|
-
}, { immediate: !0 }), v(() => [e.valueType, e.optionAsValue, e.includeHalfChecked], () => {
|
|
63
|
-
c();
|
|
64
|
-
}, { immediate: !1 });
|
|
65
|
-
const u = _();
|
|
66
|
-
return u.value?.inject({
|
|
67
|
-
getTreeRef: () => o
|
|
68
|
-
}), (t, f) => (g(), C(a(H), {
|
|
69
|
-
height: e.height,
|
|
70
|
-
"max-height": e.maxHeight
|
|
71
|
-
}, {
|
|
72
|
-
default: T(() => [
|
|
73
|
-
B((g(), C(a(P), E({
|
|
74
|
-
ref_key: "treeRef",
|
|
75
|
-
ref: o,
|
|
76
|
-
data: n.value,
|
|
77
|
-
props: e.props,
|
|
78
|
-
"node-key": e.nodeKey,
|
|
79
|
-
"default-checked-keys": d.value,
|
|
80
|
-
"show-checkbox": !0
|
|
81
|
-
}, a(l), { onCheck: c }), L({ _: 2 }, [
|
|
82
|
-
j(a(b), (m, r) => ({
|
|
83
|
-
name: r,
|
|
84
|
-
fn: T((i) => [
|
|
85
|
-
z(t.$slots, r, I(N({ field: a(u), ...i })))
|
|
86
|
-
])
|
|
87
|
-
}))
|
|
88
|
-
]), 1040, ["data", "props", "node-key", "default-checked-keys"])), [
|
|
89
|
-
[a(R), a(l).loading]
|
|
90
|
-
])
|
|
91
|
-
]),
|
|
92
|
-
_: 3
|
|
93
|
-
}, 8, ["height", "max-height"]));
|
|
94
|
-
}
|
|
95
|
-
}), ie = A(
|
|
96
|
-
W,
|
|
97
|
-
D({ dataSource: "data", loading: "loading", disabled: !0 }),
|
|
98
|
-
O($.Tree)
|
|
99
|
-
);
|
|
100
|
-
export {
|
|
101
|
-
ie as Tree,
|
|
102
|
-
ie as default
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import { mapReadPretty } from "../__builtins__/shared/transform-component.mjs";
|
|
2
|
+
import PreviewText from "../preview-text/index.mjs";
|
|
3
|
+
import _sfc_main from "./tree.mjs";
|
|
4
|
+
import { connect, mapProps } from "@silver-formily/vue";
|
|
5
|
+
//#region src/tree/index.ts
|
|
6
|
+
const Tree = connect(_sfc_main, mapProps({
|
|
7
|
+
dataSource: "data",
|
|
8
|
+
loading: "loading",
|
|
9
|
+
disabled: true
|
|
10
|
+
}), mapReadPretty(PreviewText.Tree));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Tree as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
package/esm/tree/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["InnerTree"],"sources":["../../src/tree/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport InnerTree from './tree.vue'\n\nconst Tree = connect<typeof InnerTree>(\n InnerTree,\n mapProps({ dataSource: 'data', loading: 'loading', disabled: true }),\n mapReadPretty(PreviewText.Tree),\n)\n\nexport { Tree }\n\nexport default Tree\n"],"mappings":";;;;;AAKA,MAAM,OAAO,QACXA,WACA,SAAS;CAAE,YAAY;CAAQ,SAAS;CAAW,UAAU;CAAM,CAAC,EACpE,cAAc,YAAY,KAAK,CAChC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { useCleanAttrs } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { addDisabledToNodes, flattenTree, getInputKeys, getOutputData } from "./utils.mjs";
|
|
3
|
+
import { ElScrollbar, ElTree, vLoading } from "element-plus";
|
|
4
|
+
import { computed, createBlock, createSlots, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeProps, openBlock, ref, renderList, renderSlot, unref, useSlots, watch, withCtx, withDirectives } from "vue";
|
|
5
|
+
import { useField } from "@silver-formily/vue";
|
|
6
|
+
import { isFn } from "@formily/shared";
|
|
7
|
+
//#region src/tree/tree.vue
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "Tree",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "tree",
|
|
12
|
+
props: {
|
|
13
|
+
nodeKey: {},
|
|
14
|
+
data: {},
|
|
15
|
+
modelValue: {},
|
|
16
|
+
valueType: { default: "all" },
|
|
17
|
+
includeHalfChecked: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
optionAsValue: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
props: { default: {
|
|
26
|
+
children: "children",
|
|
27
|
+
label: "label",
|
|
28
|
+
disabled: "disabled"
|
|
29
|
+
} },
|
|
30
|
+
optionFormatter: {},
|
|
31
|
+
height: {},
|
|
32
|
+
maxHeight: {}
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue"],
|
|
35
|
+
setup(__props, { emit: __emit }) {
|
|
36
|
+
const props = __props;
|
|
37
|
+
const emit = __emit;
|
|
38
|
+
const slots = useSlots();
|
|
39
|
+
const { props: attrs } = useCleanAttrs();
|
|
40
|
+
const treeRef = ref();
|
|
41
|
+
const checkedKeys = ref([]);
|
|
42
|
+
const processedData = computed(() => {
|
|
43
|
+
return addDisabledToNodes(props.data ?? [], attrs.value.disabled, props.props);
|
|
44
|
+
});
|
|
45
|
+
const flatData = computed(() => flattenTree(processedData.value ?? [], [], props.props.children));
|
|
46
|
+
async function handleCheck() {
|
|
47
|
+
await nextTick();
|
|
48
|
+
const keys = treeRef.value.getCheckedKeys();
|
|
49
|
+
const halfCheckedKeys = treeRef.value.getHalfCheckedKeys() || [];
|
|
50
|
+
checkedKeys.value = keys;
|
|
51
|
+
const { value, nodes } = getOutputData(keys, halfCheckedKeys, {
|
|
52
|
+
flatData: flatData.value,
|
|
53
|
+
nodeKey: props.nodeKey,
|
|
54
|
+
propsConfig: props.props,
|
|
55
|
+
data: props.data ?? [],
|
|
56
|
+
valueType: props.valueType,
|
|
57
|
+
includeHalfChecked: props.includeHalfChecked,
|
|
58
|
+
checkStrictly: attrs.value.checkStrictly
|
|
59
|
+
});
|
|
60
|
+
if (props.optionAsValue) isFn(props.optionFormatter) ? emit("update:modelValue", nodes.map((element, index, array) => {
|
|
61
|
+
return props.optionFormatter(element, index, array);
|
|
62
|
+
})) : emit("update:modelValue", nodes);
|
|
63
|
+
else emit("update:modelValue", value);
|
|
64
|
+
}
|
|
65
|
+
watch(() => props.modelValue, (newValue) => {
|
|
66
|
+
if (newValue !== void 0) {
|
|
67
|
+
checkedKeys.value = getInputKeys(newValue, {
|
|
68
|
+
optionAsValue: props.optionAsValue,
|
|
69
|
+
nodeKey: props.nodeKey,
|
|
70
|
+
flatData: flatData.value,
|
|
71
|
+
propsConfig: props.props,
|
|
72
|
+
data: props.data ?? [],
|
|
73
|
+
valueType: props.valueType,
|
|
74
|
+
checkStrictly: attrs.value.checkStrictly
|
|
75
|
+
});
|
|
76
|
+
nextTick(() => {
|
|
77
|
+
if (treeRef.value) treeRef.value.setCheckedKeys(checkedKeys.value);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, { immediate: true });
|
|
81
|
+
watch(() => [
|
|
82
|
+
props.valueType,
|
|
83
|
+
props.optionAsValue,
|
|
84
|
+
props.includeHalfChecked
|
|
85
|
+
], () => {
|
|
86
|
+
handleCheck();
|
|
87
|
+
}, { immediate: false });
|
|
88
|
+
const fieldRef = useField();
|
|
89
|
+
fieldRef.value?.inject({ getTreeRef: () => {
|
|
90
|
+
return treeRef;
|
|
91
|
+
} });
|
|
92
|
+
return (_ctx, _cache) => {
|
|
93
|
+
return openBlock(), createBlock(unref(ElScrollbar), {
|
|
94
|
+
height: props.height,
|
|
95
|
+
"max-height": props.maxHeight
|
|
96
|
+
}, {
|
|
97
|
+
default: withCtx(() => [withDirectives((openBlock(), createBlock(unref(ElTree), mergeProps({
|
|
98
|
+
ref_key: "treeRef",
|
|
99
|
+
ref: treeRef,
|
|
100
|
+
data: processedData.value,
|
|
101
|
+
props: props.props,
|
|
102
|
+
"node-key": props.nodeKey,
|
|
103
|
+
"default-checked-keys": checkedKeys.value,
|
|
104
|
+
"show-checkbox": true
|
|
105
|
+
}, unref(attrs), { onCheck: handleCheck }), createSlots({ _: 2 }, [renderList(unref(slots), (_, name) => {
|
|
106
|
+
return {
|
|
107
|
+
name,
|
|
108
|
+
fn: withCtx((slotData) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps({
|
|
109
|
+
field: unref(fieldRef),
|
|
110
|
+
...slotData
|
|
111
|
+
})))])
|
|
112
|
+
};
|
|
113
|
+
})]), 1040, [
|
|
114
|
+
"data",
|
|
115
|
+
"props",
|
|
116
|
+
"node-key",
|
|
117
|
+
"default-checked-keys"
|
|
118
|
+
])), [[unref(vLoading), unref(attrs).loading]])]),
|
|
119
|
+
_: 3
|
|
120
|
+
}, 8, ["height", "max-height"]);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
export { _sfc_main as default };
|
|
126
|
+
|
|
127
|
+
//# sourceMappingURL=tree.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.mjs","names":[],"sources":["../../src/tree/tree.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { TreeValueTypeProps } from './types'\nimport { isFn } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElScrollbar, ElTree, vLoading } from 'element-plus'\nimport { computed, nextTick, ref, useSlots, watch } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { addDisabledToNodes, flattenTree, getInputKeys, getOutputData } from './utils'\n\ndefineOptions({\n name: 'Tree',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TreeValueTypeProps>(), {\n valueType: 'all',\n optionAsValue: false,\n includeHalfChecked: false,\n props: {\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n },\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: any]\n}>()\n\nconst slots = useSlots()\n\nconst { props: attrs } = useCleanAttrs()\nconst treeRef = ref<InstanceType<typeof ElTree>>()\nconst checkedKeys = ref<any[]>([])\n\nconst processedData = computed(() => {\n return addDisabledToNodes(props.data ?? [], attrs.value.disabled, props.props)\n})\n\nconst flatData = computed(() => flattenTree(processedData.value ?? [], [], props.props.children))\n\nasync function handleCheck() {\n await nextTick()\n const keys = treeRef.value.getCheckedKeys()\n const halfCheckedKeys = treeRef.value.getHalfCheckedKeys() || []\n checkedKeys.value = keys\n\n const { value, nodes } = getOutputData(keys, halfCheckedKeys, {\n flatData: flatData.value,\n nodeKey: props.nodeKey,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n includeHalfChecked: props.includeHalfChecked,\n checkStrictly: attrs.value.checkStrictly,\n })\n\n if (props.optionAsValue) {\n isFn(props.optionFormatter)\n ? emit('update:modelValue', nodes.map((element, index, array) => {\n return props.optionFormatter(element, index, array)\n }))\n : emit('update:modelValue', nodes)\n }\n else {\n emit('update:modelValue', value)\n }\n}\n\nwatch(() => props.modelValue, (newValue) => {\n if (newValue !== undefined) {\n checkedKeys.value = getInputKeys(newValue, {\n optionAsValue: props.optionAsValue,\n nodeKey: props.nodeKey,\n flatData: flatData.value,\n propsConfig: props.props,\n data: props.data ?? [],\n valueType: props.valueType,\n checkStrictly: attrs.value.checkStrictly,\n })\n nextTick(() => {\n if (treeRef.value) {\n treeRef.value.setCheckedKeys(checkedKeys.value)\n }\n })\n }\n}, { immediate: true })\n\nwatch(() => [props.valueType, props.optionAsValue, props.includeHalfChecked], () => {\n handleCheck()\n}, { immediate: false })\n\nconst fieldRef = useField<Field>()\nfieldRef.value?.inject({\n getTreeRef: () => {\n return treeRef\n },\n})\n</script>\n\n<template>\n <ElScrollbar :height=\"props.height\" :max-height=\"props.maxHeight\">\n <ElTree\n ref=\"treeRef\"\n v-loading=\"attrs.loading\"\n :data=\"processedData\"\n :props=\"props.props\"\n :node-key=\"props.nodeKey\"\n :default-checked-keys=\"checkedKeys\"\n :show-checkbox=\"true\"\n v-bind=\"attrs\"\n @check=\"handleCheck\"\n >\n <template v-for=\"(_, name) of slots\" #[name]=\"slotData\">\n <slot :name=\"name\" v-bind=\"{ field: fieldRef, ...slotData }\" />\n </template>\n </ElTree>\n </ElScrollbar>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAS;EAEvB,MAAM,EAAE,OAAO,UAAU,eAAc;EACvC,MAAM,UAAU,KAAiC;EACjD,MAAM,cAAc,IAAW,EAAE,CAAA;EAEjC,MAAM,gBAAgB,eAAe;AACnC,UAAO,mBAAmB,MAAM,QAAQ,EAAE,EAAE,MAAM,MAAM,UAAU,MAAM,MAAK;IAC9E;EAED,MAAM,WAAW,eAAe,YAAY,cAAc,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,MAAM,SAAS,CAAA;EAEhG,eAAe,cAAc;AAC3B,SAAM,UAAS;GACf,MAAM,OAAO,QAAQ,MAAM,gBAAe;GAC1C,MAAM,kBAAkB,QAAQ,MAAM,oBAAoB,IAAI,EAAC;AAC/D,eAAY,QAAQ;GAEpB,MAAM,EAAE,OAAO,UAAU,cAAc,MAAM,iBAAiB;IAC5D,UAAU,SAAS;IACnB,SAAS,MAAM;IACf,aAAa,MAAM;IACnB,MAAM,MAAM,QAAQ,EAAE;IACtB,WAAW,MAAM;IACjB,oBAAoB,MAAM;IAC1B,eAAe,MAAM,MAAM;IAC5B,CAAA;AAED,OAAI,MAAM,cACR,MAAK,MAAM,gBAAe,GACtB,KAAK,qBAAqB,MAAM,KAAK,SAAS,OAAO,UAAU;AAC7D,WAAO,MAAM,gBAAgB,SAAS,OAAO,MAAK;KAClD,CAAA,GACF,KAAK,qBAAqB,MAAK;OAGnC,MAAK,qBAAqB,MAAK;;AAInC,cAAY,MAAM,aAAa,aAAa;AAC1C,OAAI,aAAa,KAAA,GAAW;AAC1B,gBAAY,QAAQ,aAAa,UAAU;KACzC,eAAe,MAAM;KACrB,SAAS,MAAM;KACf,UAAU,SAAS;KACnB,aAAa,MAAM;KACnB,MAAM,MAAM,QAAQ,EAAE;KACtB,WAAW,MAAM;KACjB,eAAe,MAAM,MAAM;KAC5B,CAAA;AACD,mBAAe;AACb,SAAI,QAAQ,MACV,SAAQ,MAAM,eAAe,YAAY,MAAK;MAEjD;;KAEF,EAAE,WAAW,MAAM,CAAA;AAEtB,cAAY;GAAC,MAAM;GAAW,MAAM;GAAe,MAAM;GAAmB,QAAQ;AAClF,gBAAY;KACX,EAAE,WAAW,OAAO,CAAA;EAEvB,MAAM,WAAW,UAAgB;AACjC,WAAS,OAAO,OAAO,EACrB,kBAAkB;AAChB,UAAO;KAEV,CAAA;;uBAIC,YAgBc,MAAA,YAAA,EAAA;IAhBA,QAAQ,MAAM;IAAS,cAAY,MAAM;;2BAe5C,CAAA,gBAAA,WAAA,EAdT,YAcS,MAAA,OAAA,EAdT,WAcS;cAbH;KAAJ,KAAI;KAEH,MAAM,cAAA;KACN,OAAO,MAAM;KACb,YAAU,MAAM;KAChB,wBAAsB,YAAA;KACtB,iBAAe;OACR,MAAA,MAAK,EAAA,EACZ,SAAO,aAAW,CAAA,EAAA,YAAA,EAAA,GAAA,GAAA,EAAA,CAAA,WAEW,MAAA,MAAK,GAAjB,GAAG,SAAI;;MAAa;mBAAQ,aAAQ,CACpD,WAA+D,KAAA,QAAlD,MAAI,eAAA,mBAAA;OAAA,OAAmB,MAAA,SAAQ;OAAA,GAAK;OAAQ,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;4BAVhD,MAAA,MAAK,CAAC,QAAO,CAAA,CAAA,CAAA,CAAA"}
|
package/esm/tree/types.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { TreeNodeData } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { TreeNodeData } from "element-plus";
|
|
2
|
+
|
|
3
|
+
//#region src/tree/types.d.ts
|
|
4
|
+
interface TreeValueTypeProps {
|
|
5
|
+
nodeKey: string;
|
|
6
|
+
data?: TreeNodeData[];
|
|
7
|
+
modelValue?: any;
|
|
8
|
+
valueType?: 'all' | 'parent' | 'child' | 'path';
|
|
9
|
+
includeHalfChecked?: boolean;
|
|
10
|
+
optionAsValue?: boolean;
|
|
11
|
+
props?: any;
|
|
12
|
+
optionFormatter?: (node: TreeNodeData, index: number, array: TreeNodeData[]) => TreeNodeData;
|
|
13
|
+
height?: number;
|
|
14
|
+
maxHeight?: number;
|
|
13
15
|
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TreeValueTypeProps };
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
package/esm/tree/utils.mjs
CHANGED
|
@@ -1,159 +1,167 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/tree/utils.ts
|
|
2
|
+
function flattenTree(nodes, result = [], childrenKey = "children") {
|
|
3
|
+
for (const node of nodes) {
|
|
4
|
+
result.push(node);
|
|
5
|
+
if (node[childrenKey] && node[childrenKey].length > 0) flattenTree(node[childrenKey], result, childrenKey);
|
|
6
|
+
}
|
|
7
|
+
return result;
|
|
5
8
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
function addDisabledToNodes(nodes, disabled, propsConfig) {
|
|
10
|
+
if (!disabled) return nodes;
|
|
11
|
+
return nodes.map((node) => {
|
|
12
|
+
const newNode = { ...node };
|
|
13
|
+
newNode[propsConfig.disabled] = true;
|
|
14
|
+
if (node[propsConfig.children] && node[propsConfig.children].length > 0) newNode[propsConfig.children] = addDisabledToNodes(node[propsConfig.children], disabled, propsConfig);
|
|
15
|
+
return newNode;
|
|
16
|
+
});
|
|
11
17
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
function traverseTree(nodes, callback, options = {}) {
|
|
19
|
+
const { leafOnly = false, childrenKey = "children" } = options;
|
|
20
|
+
for (const node of nodes) {
|
|
21
|
+
const children = node[childrenKey] || [];
|
|
22
|
+
const isLeaf = children.length === 0;
|
|
23
|
+
if (!leafOnly || isLeaf) callback(node);
|
|
24
|
+
if (children.length > 0) traverseTree(children, callback, options);
|
|
25
|
+
}
|
|
18
26
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
function getChildrenKeys(node, nodeKey, propsConfig) {
|
|
28
|
+
const children = node[propsConfig.children] || [];
|
|
29
|
+
if (children.length === 0) return [];
|
|
30
|
+
const keys = [];
|
|
31
|
+
traverseTree(children, (child) => {
|
|
32
|
+
keys.push(child[nodeKey]);
|
|
33
|
+
}, { childrenKey: propsConfig.children });
|
|
34
|
+
return keys;
|
|
27
35
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
function extractKeysFromPath(pathNodes, nodeKey, propsConfig) {
|
|
37
|
+
const keys = [];
|
|
38
|
+
traverseTree(pathNodes, (node) => {
|
|
39
|
+
keys.push(node[nodeKey]);
|
|
40
|
+
}, {
|
|
41
|
+
leafOnly: true,
|
|
42
|
+
childrenKey: propsConfig.children
|
|
43
|
+
});
|
|
44
|
+
return keys;
|
|
33
45
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
function getSelectedPath(nodes, selectedKeys, nodeKey, propsConfig) {
|
|
47
|
+
const result = [];
|
|
48
|
+
for (const node of nodes) {
|
|
49
|
+
const children = node[propsConfig.children] || [];
|
|
50
|
+
const hasSelectedChild = children.length > 0 ? getSelectedPath(children, selectedKeys, nodeKey, propsConfig).length > 0 : false;
|
|
51
|
+
if (selectedKeys.includes(node[nodeKey]) || hasSelectedChild) {
|
|
52
|
+
const newNode = { ...node };
|
|
53
|
+
if (hasSelectedChild && children.length > 0) newNode[propsConfig.children] = getSelectedPath(children, selectedKeys, nodeKey, propsConfig);
|
|
54
|
+
result.push(newNode);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
44
58
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
/**
|
|
60
|
+
* 查找节点的所有父节点路径
|
|
61
|
+
*/
|
|
62
|
+
function findParents(nodes, targetKey, nodeKey, propsConfig, parents = []) {
|
|
63
|
+
for (const node of nodes) {
|
|
64
|
+
const currentPath = [...parents, node[nodeKey]];
|
|
65
|
+
if (node[nodeKey] === targetKey) return currentPath;
|
|
66
|
+
const children = node[propsConfig.children] || [];
|
|
67
|
+
if (children.length > 0) {
|
|
68
|
+
const found = findParents(children, targetKey, nodeKey, propsConfig, currentPath);
|
|
69
|
+
if (found.length > 0) return found;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/* istanbul ignore next -- @preserve */
|
|
73
|
+
return [];
|
|
58
74
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
/**
|
|
76
|
+
* 过滤叶子节点
|
|
77
|
+
*/
|
|
78
|
+
function filterLeafNodes(keys, flatData, nodeKey, propsConfig) {
|
|
79
|
+
return keys.filter((key) => {
|
|
80
|
+
const node = flatData.find((n) => n[nodeKey] === key);
|
|
81
|
+
if (!node) return false;
|
|
82
|
+
return (node[propsConfig.children] || []).length === 0;
|
|
83
|
+
});
|
|
64
84
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
value: h,
|
|
111
|
-
nodes: f
|
|
112
|
-
};
|
|
85
|
+
/**
|
|
86
|
+
* 获取输出数据
|
|
87
|
+
*/
|
|
88
|
+
function getOutputData(keys, halfCheckedKeys = [], options) {
|
|
89
|
+
const { flatData, nodeKey, propsConfig, data, valueType, includeHalfChecked, checkStrictly } = options;
|
|
90
|
+
const selectedNodes = flatData.filter((node) => keys.includes(node[nodeKey]));
|
|
91
|
+
let outputKeys = [...keys];
|
|
92
|
+
let outputNodes = [...selectedNodes];
|
|
93
|
+
if (checkStrictly) return {
|
|
94
|
+
value: outputKeys,
|
|
95
|
+
nodes: outputNodes
|
|
96
|
+
};
|
|
97
|
+
switch (valueType) {
|
|
98
|
+
case "parent": {
|
|
99
|
+
const allChildKeys = [];
|
|
100
|
+
for (const node of selectedNodes) allChildKeys.push(...getChildrenKeys(node, nodeKey, propsConfig));
|
|
101
|
+
outputKeys = keys.filter((key) => !allChildKeys.includes(key));
|
|
102
|
+
outputNodes = selectedNodes.filter((node) => outputKeys.includes(node[nodeKey]));
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
case "child":
|
|
106
|
+
for (const node of selectedNodes) if (getChildrenKeys(node, nodeKey, propsConfig).some((key) => keys.includes(key))) {
|
|
107
|
+
outputKeys = outputKeys.filter((key) => key !== node[nodeKey]);
|
|
108
|
+
outputNodes = outputNodes.filter((n) => n[nodeKey] !== node[nodeKey]);
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
case "path": {
|
|
112
|
+
const selectedPath = getSelectedPath(data, keys, nodeKey, propsConfig);
|
|
113
|
+
return {
|
|
114
|
+
value: selectedPath,
|
|
115
|
+
nodes: selectedPath
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
default:
|
|
119
|
+
if (includeHalfChecked && halfCheckedKeys.length > 0) {
|
|
120
|
+
const halfCheckedNodes = flatData.filter((node) => halfCheckedKeys.includes(node[nodeKey]));
|
|
121
|
+
outputKeys = [...outputKeys, ...halfCheckedKeys];
|
|
122
|
+
outputNodes = [...outputNodes, ...halfCheckedNodes];
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
value: outputKeys,
|
|
128
|
+
nodes: outputNodes
|
|
129
|
+
};
|
|
113
130
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
131
|
+
/**
|
|
132
|
+
* 根据valueType将输入值转换为checkedKeys
|
|
133
|
+
*/
|
|
134
|
+
function getInputKeys(inputValue, options) {
|
|
135
|
+
const { optionAsValue, nodeKey, flatData, propsConfig, data, valueType, checkStrictly } = options;
|
|
136
|
+
/* istanbul ignore if -- @preserve */
|
|
137
|
+
if (!inputValue || !Array.isArray(inputValue)) return [];
|
|
138
|
+
const valueArray = optionAsValue ? inputValue.map((item) => item[nodeKey]) : inputValue;
|
|
139
|
+
if (checkStrictly) return valueArray;
|
|
140
|
+
switch (valueType) {
|
|
141
|
+
case "parent": {
|
|
142
|
+
const allKeys = [...valueArray];
|
|
143
|
+
for (const key of valueArray) {
|
|
144
|
+
const node = flatData.find((n) => n[nodeKey] === key);
|
|
145
|
+
if (node) {
|
|
146
|
+
const childKeys = getChildrenKeys(node, nodeKey, propsConfig);
|
|
147
|
+
allKeys.push(...childKeys);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return filterLeafNodes(allKeys, flatData, nodeKey, propsConfig);
|
|
151
|
+
}
|
|
152
|
+
case "child": {
|
|
153
|
+
const allKeys = [...valueArray];
|
|
154
|
+
for (const key of valueArray) {
|
|
155
|
+
const parentPath = findParents(data, key, nodeKey, propsConfig);
|
|
156
|
+
allKeys.push(...parentPath);
|
|
157
|
+
}
|
|
158
|
+
return filterLeafNodes(allKeys, flatData, nodeKey, propsConfig);
|
|
159
|
+
}
|
|
160
|
+
case "path": return extractKeysFromPath(valueArray, nodeKey, propsConfig);
|
|
161
|
+
default: return filterLeafNodes(valueArray, flatData, nodeKey, propsConfig);
|
|
162
|
+
}
|
|
146
163
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
T as findParents,
|
|
152
|
-
k as flattenTree,
|
|
153
|
-
N as getChildrenKeys,
|
|
154
|
-
b as getInputKeys,
|
|
155
|
-
D as getOutputData,
|
|
156
|
-
P as getSelectedPath,
|
|
157
|
-
S as traverseTree
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=utils.mjs.map
|
|
164
|
+
//#endregion
|
|
165
|
+
export { addDisabledToNodes, flattenTree, getInputKeys, getOutputData, getSelectedPath };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=utils.mjs.map
|