@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.mjs","sources":["../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.28_typescript@5.9.2_/node_modules/element-plus/es/components/pagination/src/constants.mjs","../../../../node_modules/.pnpm/element-plus@2.13.2_vue@3.5.28_typescript@5.9.2_/node_modules/element-plus/es/components/pagination/src/usePagination.mjs","../../src/pagination/components/jumper.vue","../../src/pagination/components/next.vue","../../src/pagination/components/pager.vue","../../src/pagination/components/prev.vue","../../src/pagination/components/sizes.vue","../../src/pagination/components/total.vue","../../src/pagination/pagination.ts"],"sourcesContent":["const elPaginationKey = /* @__PURE__ */ Symbol(\"elPaginationKey\");\n\nexport { elPaginationKey };\n//# sourceMappingURL=constants.mjs.map\n","import { inject } from 'vue';\nimport { elPaginationKey } from './constants.mjs';\n\nconst usePagination = () => inject(elPaginationKey, {});\n\nexport { usePagination };\n//# sourceMappingURL=usePagination.mjs.map\n","<script lang=\"ts\" setup>\nimport { ElInput, useLocale, useNamespace } from 'element-plus'\nimport { usePagination } from 'element-plus/es/components/pagination/src/usePagination'\nimport { computed, ref } from 'vue'\nimport { paginationJumperProps } from './jumper'\n\ndefineOptions({\n name: 'ElPaginationJumper',\n})\n\ndefineProps(paginationJumperProps)\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { pageCount, disabled, currentPage, changeEvent } = usePagination()\nconst userInput = ref<number | string>()\nconst innerValue = computed(() => userInput.value ?? currentPage?.value)\n\nfunction handleInput(val: number | string) {\n userInput.value = val ? +val : ''\n}\n\nfunction handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(val)\n userInput.value = undefined\n}\n</script>\n\n<template>\n <span :class=\"ns.e('jump')\" :disabled=\"disabled\">\n <span :class=\"[ns.e('goto')]\">{{ t('el.pagination.goto') }}</span>\n <ElInput\n :size=\"size\"\n :class=\"[ns.e('editor'), ns.is('in-pagination')]\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n :validate-event=\"false\"\n :aria-label=\"t('el.pagination.page')\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n <span :class=\"[ns.e('classifier')]\">\n {{ t('el.pagination.pageClassifier') }}\n </span>\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport { ElIcon, useLocale } from 'element-plus'\nimport { computed } from 'vue'\nimport { paginationNextProps } from './next'\n\ndefineOptions({\n name: 'ElPaginationNext',\n})\n\nconst props = defineProps(paginationNextProps)\n\ndefineEmits(['click'])\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () =>\n props.disabled\n || props.currentPage === props.pageCount\n || props.pageCount === 0,\n)\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"btn-next\"\n :disabled=\"internalDisabled\"\n :aria-label=\"nextText || t('el.pagination.next')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"nextText\">{{ nextText }}</span>\n <ElIcon v-else>\n <component :is=\"nextIcon\" />\n </ElIcon>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport { DArrowLeft, DArrowRight, MoreFilled } from '@element-plus/icons-vue'\nimport { formilyComputed, useObserver } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { CHANGE_EVENT, ElBadge, useLocale, useNamespace } from 'element-plus'\nimport { computed, ref, watchEffect } from 'vue'\nimport { paginationPagerProps } from './pager'\n\ndefineOptions({\n name: 'ElPaginationPager',\n})\nconst props = defineProps(paginationPagerProps)\nconst emit = defineEmits([CHANGE_EVENT])\nconst nsPager = useNamespace('pager')\nconst nsIcon = useNamespace('icon')\nconst { t } = useLocale()\n\nconst showPrevMore = ref(false)\nconst showNextMore = ref(false)\nconst quickPrevHover = ref(false)\nconst quickNextHover = ref(false)\nconst quickPrevFocus = ref(false)\nconst quickNextFocus = ref(false)\nconst pagers = computed(() => {\n const pagerCount = props.pagerCount\n const halfPagerCount = (pagerCount - 1) / 2\n const currentPage = Number(props.currentPage)\n const pageCount = Number(props.pageCount)\n let showPrevMore = false\n let showNextMore = false\n if (pageCount > pagerCount) {\n if (currentPage > pagerCount - halfPagerCount) {\n showPrevMore = true\n }\n if (currentPage < pageCount - halfPagerCount) {\n showNextMore = true\n }\n }\n const array: number[] = []\n if (showPrevMore && !showNextMore) {\n const startPage = pageCount - (pagerCount - 2)\n for (let i = startPage; i < pageCount; i++) {\n array.push(i)\n }\n }\n else if (!showPrevMore && showNextMore) {\n for (let i = 2; i < pagerCount; i++) {\n array.push(i)\n }\n }\n else if (showPrevMore && showNextMore) {\n const offset = Math.floor(pagerCount / 2) - 1\n for (let i = currentPage - offset; i <= currentPage + offset; i++) {\n array.push(i)\n }\n }\n else {\n for (let i = 2; i < pageCount; i++) {\n array.push(i)\n }\n }\n return array\n})\n\nconst prevMoreKls = computed(() => [\n 'more',\n 'btn-quickprev',\n nsIcon.b(),\n nsPager.is('disabled', props.disabled),\n])\nconst nextMoreKls = computed(() => [\n 'more',\n 'btn-quicknext',\n nsIcon.b(),\n nsPager.is('disabled', props.disabled),\n])\n\nconst tabindex = computed(() => (props.disabled ? -1 : 0))\nwatchEffect(() => {\n const halfPagerCount = (props.pagerCount - 1) / 2\n showPrevMore.value = false\n showNextMore.value = false\n if (props.pageCount! > props.pagerCount) {\n if (props.currentPage > props.pagerCount - halfPagerCount) {\n showPrevMore.value = true\n }\n if (props.currentPage < props.pageCount! - halfPagerCount) {\n showNextMore.value = true\n }\n }\n})\nfunction onMouseEnter(forward = false) {\n if (props.disabled)\n return\n if (forward) {\n quickPrevHover.value = true\n }\n else {\n quickNextHover.value = true\n }\n}\nfunction onFocus(forward = false) {\n if (forward) {\n quickPrevFocus.value = true\n }\n else {\n quickNextFocus.value = true\n }\n}\nfunction onEnter(e: UIEvent) {\n const target = e.target as HTMLElement\n if (\n target.tagName.toLowerCase() === 'li'\n && Array.from(target.classList).includes('number')\n ) {\n const newPage = Number(target.textContent)\n if (newPage !== props.currentPage) {\n emit(CHANGE_EVENT, newPage)\n }\n }\n else if (\n target.tagName.toLowerCase() === 'li'\n && Array.from(target.classList).includes('more')\n ) {\n onPagerClick(e)\n }\n}\nfunction onPagerClick(event: UIEvent) {\n const target = event.target as HTMLElement\n if (target.tagName.toLowerCase() === 'ul' || props.disabled) {\n return\n }\n let newPage = Number(target.textContent)\n const pageCount = props.pageCount!\n const currentPage = props.currentPage\n const pagerCountOffset = props.pagerCount - 2\n if (target.className.includes('more')) {\n if (target.className.includes('quickprev')) {\n newPage = currentPage - pagerCountOffset\n }\n else if (target.className.includes('quicknext')) {\n newPage = currentPage + pagerCountOffset\n }\n }\n if (!Number.isNaN(+newPage)) {\n if (newPage < 1) {\n newPage = 1\n }\n if (newPage > pageCount) {\n newPage = pageCount\n }\n }\n if (newPage !== currentPage) {\n emit(CHANGE_EVENT, newPage)\n }\n}\n/* formily error count */\nuseObserver()\nconst fieldRef = useField<ArrayField>()\nconst field = fieldRef.value\nconst path = field.address.entire\nconst errorPageIndexList = formilyComputed(() => {\n const errorPageSet = field.form\n .queryFeedbacks({\n type: 'error',\n address: `${path}.**`,\n })\n .map(feedback => Number(feedback.path.split(`${path}.`)[1].split('.')[0]))\n .reduce((acc, cur) => {\n const pageIndex = Math.floor(cur / props.pageSize)\n acc.add(pageIndex)\n return acc\n }, new Set<number>())\n\n const errorPageList = Array.from(errorPageSet).sort((a, b) => a - b)\n return errorPageList\n})\n\nconst isPrevMoreError = formilyComputed(() => {\n return errorPageIndexList.value.some(pageIdx => (pageIdx < pagers.value[0] - 1) && pageIdx !== 0)\n})\nconst isNextMoreError = formilyComputed(() => {\n return errorPageIndexList.value.some(pageIdx => (pageIdx > pagers.value.at(-1) - 1) && pageIdx !== errorPageIndexList.value.length - 1)\n})\n</script>\n\n<template>\n <ul :class=\"nsPager.b()\" @click=\"onPagerClick\" @keyup.enter=\"onEnter\">\n <ElBadge v-if=\"pageCount > 1\" is-dot :value=\"1\" :hidden=\"errorPageIndexList[0] !== 0\">\n <li\n :class=\"[\n nsPager.is('active', currentPage === 1),\n nsPager.is('disabled', disabled),\n ]\" class=\"number\" :aria-current=\"currentPage === 1\" :aria-label=\"t('el.pagination.currentPage', { pager: 1 })\"\n :tabindex=\"tabindex\"\n >\n 1\n </li>\n </ElBadge>\n <ElBadge v-if=\"showPrevMore\" is-dot :value=\"1\" :hidden=\"!isPrevMoreError\">\n <li\n :class=\"prevMoreKls\" :tabindex=\"tabindex\"\n :aria-label=\"t('el.pagination.prevPages', { pager: pagerCount - 2 })\" @mouseenter=\"onMouseEnter(true)\"\n @mouseleave=\"quickPrevHover = false\" @focus=\"onFocus(true)\" @blur=\"quickPrevFocus = false\"\n >\n <DArrowLeft v-if=\"(quickPrevHover || quickPrevFocus) && !disabled\" />\n <MoreFilled v-else />\n </li>\n </ElBadge>\n <ElBadge\n v-for=\"pager in pagers\" :key=\"pager\" is-dot :value=\"1\"\n :hidden=\"!errorPageIndexList.includes(pager - 1)\"\n >\n <li\n :class=\"[\n nsPager.is('active', currentPage === pager),\n nsPager.is('disabled', disabled),\n ]\" class=\"number\" :aria-current=\"currentPage === pager\" :aria-label=\"t('el.pagination.currentPage', { pager })\"\n :tabindex=\"tabindex\"\n >\n {{ pager }}\n </li>\n </ElBadge>\n <ElBadge v-if=\"showNextMore\" is-dot :value=\"1\" :hidden=\"!isNextMoreError\">\n <li\n :class=\"nextMoreKls\" :tabindex=\"tabindex\"\n :aria-label=\"t('el.pagination.nextPages', { pager: pagerCount - 2 })\" @mouseenter=\"onMouseEnter()\"\n @mouseleave=\"quickNextHover = false\" @focus=\"onFocus()\" @blur=\"quickNextFocus = false\"\n >\n <DArrowRight v-if=\"(quickNextHover || quickNextFocus) && !disabled\" />\n <MoreFilled v-else />\n </li>\n </ElBadge>\n <ElBadge\n is-dot\n :value=\"1\"\n :hidden=\"errorPageIndexList[errorPageIndexList.length - 1] !== pageCount - 1\"\n >\n <li\n :class=\"[\n nsPager.is('active', currentPage === pageCount),\n nsPager.is('disabled', disabled),\n ]\" class=\"number\" :aria-current=\"currentPage === pageCount\"\n :aria-label=\"t('el.pagination.currentPage', { pager: pageCount })\" :tabindex=\"tabindex\"\n >\n {{ pageCount }}\n </li>\n </ElBadge>\n </ul>\n</template>\n","<script lang=\"ts\" setup>\nimport { ElIcon, useLocale } from 'element-plus'\nimport { computed } from 'vue'\nimport { paginationPrevEmits, paginationPrevProps } from './prev'\n\ndefineOptions({\n name: 'ElPaginationPrev',\n})\n\nconst props = defineProps(paginationPrevProps)\ndefineEmits(paginationPrevEmits)\n\nconst { t } = useLocale()\n\nconst internalDisabled = computed(\n () => props.disabled || props.currentPage <= 1,\n)\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"btn-prev\"\n :disabled=\"internalDisabled\"\n :aria-label=\"prevText || t('el.pagination.prev')\"\n :aria-disabled=\"internalDisabled\"\n @click=\"$emit('click', $event)\"\n >\n <span v-if=\"prevText\">{{ prevText }}</span>\n <ElIcon v-else>\n <component :is=\"prevIcon\" />\n </ElIcon>\n </button>\n</template>\n","<script lang=\"ts\" setup>\nimport { isArr, isEqual } from '@formily/shared'\nimport { ElOption, ElSelect, useLocale, useNamespace } from 'element-plus'\nimport { usePagination } from 'element-plus/es/components/pagination/src/usePagination'\nimport { computed, ref, watch } from 'vue'\nimport { paginationSizesProps } from './sizes'\n\ndefineOptions({\n name: 'ElPaginationSizes',\n})\n\nconst props = defineProps(paginationSizesProps)\nconst emit = defineEmits(['page-size-change'])\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst pagination = usePagination()\nconst innerPageSize = ref<number>(props.pageSize!)\n\nwatch(\n () => props.pageSizes,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal))\n return\n if (isArr(newVal)) {\n const pageSize = newVal.includes(props.pageSize!)\n ? props.pageSize\n : props.pageSizes[0]\n // eslint-disable-next-line vue/custom-event-name-casing\n emit('page-size-change', pageSize)\n }\n },\n)\n\nwatch(\n () => props.pageSize,\n (newVal) => {\n innerPageSize.value = newVal!\n },\n)\n\nconst innerPageSizes = computed(() => props.pageSizes)\nfunction handleChange(val: number) {\n if (val !== innerPageSize.value) {\n innerPageSize.value = val\n pagination.handleSizeChange?.(Number(val))\n }\n}\n</script>\n\n<template>\n <span :class=\"ns.e('sizes')\">\n <ElSelect\n :model-value=\"innerPageSize\"\n :disabled=\"disabled\"\n :popper-class=\"popperClass\"\n :size=\"size\"\n :teleported=\"teleported\"\n :validate-event=\"false\"\n :append-to=\"appendSizeTo\"\n @change=\"handleChange\"\n >\n <ElOption\n v-for=\"item in innerPageSizes\"\n :key=\"item\"\n :value=\"item\"\n :label=\"item + t('el.pagination.pagesize')\"\n />\n </ElSelect>\n </span>\n</template>\n","<script lang=\"ts\" setup>\nimport { useLocale, useNamespace } from 'element-plus'\nimport { usePagination } from 'element-plus/es/components/pagination/src/usePagination'\nimport { paginationTotalProps } from './total'\n\ndefineOptions({\n name: 'ElPaginationTotal',\n})\ndefineProps(paginationTotalProps)\nconst { t } = useLocale()\nconst ns = useNamespace('pagination')\nconst { disabled } = usePagination()\n</script>\n\n<template>\n <span :class=\"ns.e('total')\" :disabled=\"disabled\">\n {{\n t('el.pagination.total', {\n total,\n })\n }}\n </span>\n</template>\n","import type { ExtractPropTypes, VNode } from 'vue'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n elPaginationKey,\n useDeprecated,\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from 'element-plus'\nimport {\n buildProps,\n debugWarn,\n definePropType,\n iconPropType,\n isNumber,\n mutable,\n} from 'element-plus/es/utils/index'\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n provide,\n ref,\n watch,\n} from 'vue'\n\nimport Jumper from './components/jumper.vue'\nimport Next from './components/next.vue'\nimport Pager from './components/pager.vue'\nimport Prev from './components/prev.vue'\nimport Sizes from './components/sizes.vue'\nimport Total from './components/total.vue'\n\n/**\n * It it user's responsibility to guarantee that the value of props.total... is number\n * (same as pageSize, defaultPageSize, currentPage, defaultCurrentPage, pageCount)\n * Otherwise we can reasonable infer that the corresponding field is absent\n */\nconst isAbsent = (v: unknown): v is undefined => typeof v !== 'number'\n\ntype LayoutKey\n = | 'prev'\n | 'pager'\n | 'next'\n | 'jumper'\n | '->'\n | 'total'\n | 'sizes'\n | 'slot'\n\nexport const paginationProps = buildProps({\n /**\n * @description options of item count per page\n */\n pageSize: Number,\n /**\n * @description default initial value of page size, not setting is the same as setting 10\n */\n defaultPageSize: Number,\n /**\n * @description total item count\n */\n total: Number,\n /**\n * @description total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required\n */\n pageCount: Number,\n /**\n * @description number of pagers. Pagination collapses when the total page count exceeds this value\n */\n pagerCount: {\n type: Number,\n validator: (value: unknown) => {\n return (\n isNumber(value)\n && Math.trunc(value) === value\n && value > 4\n && value < 22\n && value % 2 === 1\n )\n },\n default: 7,\n },\n /**\n * @description current page number\n */\n currentPage: Number,\n /**\n * @description default initial value of current-page, not setting is the same as setting 1\n */\n defaultCurrentPage: Number,\n /**\n * @description layout of Pagination, elements separated with a comma\n */\n layout: {\n type: String,\n default: (\n ['prev', 'pager', 'next', 'jumper', '->', 'total'] as LayoutKey[]\n ).join(', '),\n },\n /**\n * @description item count of each page\n */\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n /**\n * @description custom class name for the page size Select's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description text for the prev button\n */\n prevText: {\n type: String,\n default: '',\n },\n /**\n * @description icon for the prev button, higher priority of `prev-text`\n */\n prevIcon: {\n type: iconPropType,\n default: () => ArrowLeft,\n },\n /**\n * @description text for the next button\n */\n nextText: {\n type: String,\n default: '',\n },\n /**\n * @description icon for the next button, higher priority of `next-text`\n */\n nextIcon: {\n type: iconPropType,\n default: () => ArrowRight,\n },\n /**\n * @description whether Pagination size is teleported to body\n */\n teleported: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to use small pagination\n */\n small: Boolean,\n /**\n * @description set page size\n */\n size: useSizeProp,\n /**\n * @description whether the buttons have a background color\n */\n background: Boolean,\n /**\n * @description whether Pagination is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to hide when there's only one page\n */\n hideOnSinglePage: Boolean,\n /**\n * @description which element the size dropdown appends to.\n */\n appendSizeTo: String,\n} as const)\nexport type PaginationProps = ExtractPropTypes<typeof paginationProps>\n\nexport const paginationEmits = {\n 'update:current-page': (val: number) => isNumber(val),\n 'update:page-size': (val: number) => isNumber(val),\n 'size-change': (val: number) => isNumber(val),\n 'change': (currentPage: number, pageSize: number) =>\n isNumber(currentPage) && isNumber(pageSize),\n 'current-change': (val: number) => isNumber(val),\n 'prev-click': (val: number) => isNumber(val),\n 'next-click': (val: number) => isNumber(val),\n}\nexport type PaginationEmits = typeof paginationEmits\n\nconst componentName = 'ElPagination'\nexport default defineComponent({\n name: componentName,\n\n props: paginationProps,\n emits: paginationEmits,\n\n setup(props, { emit, slots }) {\n const { t } = useLocale()\n const ns = useNamespace('pagination')\n const vnodeProps = getCurrentInstance()!.vnode.props || {}\n const _globalSize = useGlobalSize()\n const _size = computed(() =>\n props.small ? 'small' : props.size ?? _globalSize.value,\n )\n useDeprecated(\n {\n from: 'small',\n replacement: 'size',\n version: '3.0.0',\n scope: 'el-pagination',\n ref: 'https://element-plus.org/zh-CN/component/pagination.html',\n },\n computed(() => !!props.small),\n )\n // we can find @xxx=\"xxx\" props on `vnodeProps` to check if user bind corresponding events\n const hasCurrentPageListener\n = 'onUpdate:currentPage' in vnodeProps\n || 'onUpdate:current-page' in vnodeProps\n || 'onCurrentChange' in vnodeProps\n const hasPageSizeListener\n = 'onUpdate:pageSize' in vnodeProps\n || 'onUpdate:page-size' in vnodeProps\n || 'onSizeChange' in vnodeProps\n const assertValidUsage = computed(() => {\n // Users have to set either one, otherwise count of pages cannot be determined\n if (isAbsent(props.total) && isAbsent(props.pageCount))\n return false\n // <el-pagination ...otherProps :current-page=\"xxx\" /> without corresponding listener is forbidden now\n // Users have to use two way binding of `currentPage`\n // If users just want to provide a default value, `defaultCurrentPage` is here for you\n if (!isAbsent(props.currentPage) && !hasCurrentPageListener)\n return false\n // When you want to change sizes, things get more complex, detailed below\n // Basically the most important value we need is page count\n // either directly from props.pageCount\n // or calculated from props.total\n // we will take props.pageCount precedence over props.total\n if (props.layout.includes('sizes')) {\n if (!isAbsent(props.pageCount)) {\n // if props.pageCount is assign by user, then user have to watch pageSize change\n // and recalculate pageCount\n if (!hasPageSizeListener)\n return false\n }\n else if (!isAbsent(props.total)) {\n // Otherwise, we will see if user have props.pageSize defined\n // If so, meaning user want to have pageSize controlled himself/herself from component\n // Thus page size listener is required\n // users are account for page size change\n if (isAbsent(props.pageSize)) {\n // (else block just for explaination)\n // else page size is controlled by el-pagination internally\n }\n else {\n if (!hasPageSizeListener) {\n return false\n }\n }\n }\n }\n return true\n })\n\n const innerPageSize = ref(\n isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize,\n )\n const innerCurrentPage = ref(\n isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage,\n )\n\n const pageSizeBridge = computed({\n get() {\n return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize\n },\n set(v: number) {\n if (isAbsent(props.pageSize)) {\n innerPageSize.value = v\n }\n if (hasPageSizeListener) {\n emit('update:page-size', v)\n emit('size-change', v)\n }\n },\n })\n\n const pageCountBridge = computed<number>(() => {\n let pageCount = 0\n if (!isAbsent(props.pageCount)) {\n pageCount = props.pageCount\n }\n else if (!isAbsent(props.total)) {\n pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value))\n }\n return pageCount\n })\n\n const currentPageBridge = computed<number>({\n get() {\n return isAbsent(props.currentPage)\n ? innerCurrentPage.value\n : props.currentPage\n },\n set(v) {\n let newCurrentPage = v\n if (v < 1) {\n newCurrentPage = 1\n }\n else if (v > pageCountBridge.value) {\n newCurrentPage = pageCountBridge.value\n }\n if (isAbsent(props.currentPage)) {\n innerCurrentPage.value = newCurrentPage\n }\n if (hasCurrentPageListener) {\n emit('update:current-page', newCurrentPage)\n emit('current-change', newCurrentPage)\n }\n },\n })\n\n watch(pageCountBridge, (val) => {\n if (currentPageBridge.value > val)\n currentPageBridge.value = val\n })\n\n watch(\n [currentPageBridge, pageSizeBridge],\n (value) => {\n emit(CHANGE_EVENT, ...value)\n },\n { flush: 'post' },\n )\n\n function handleCurrentChange(val: number) {\n currentPageBridge.value = val\n }\n\n function handleSizeChange(val: number) {\n pageSizeBridge.value = val\n const newPageCount = pageCountBridge.value\n if (currentPageBridge.value > newPageCount) {\n currentPageBridge.value = newPageCount\n }\n }\n\n function prev() {\n if (props.disabled)\n return\n currentPageBridge.value -= 1\n emit('prev-click', currentPageBridge.value)\n }\n\n function next() {\n if (props.disabled)\n return\n currentPageBridge.value += 1\n emit('next-click', currentPageBridge.value)\n }\n\n function addClass(element: any, cls: string) {\n if (element) {\n if (!element.props) {\n element.props = {}\n }\n element.props.class = [element.props.class, cls].join(' ')\n }\n }\n\n provide(elPaginationKey, {\n pageCount: pageCountBridge,\n disabled: computed(() => props.disabled),\n currentPage: currentPageBridge,\n changeEvent: handleCurrentChange,\n handleSizeChange,\n })\n\n return () => {\n if (!assertValidUsage.value) {\n debugWarn(componentName, t('el.pagination.deprecationWarning'))\n return null\n }\n if (!props.layout)\n return null\n if (props.hideOnSinglePage && pageCountBridge.value <= 1)\n return null\n const rootChildren: Array<VNode | VNode[] | null> = []\n const rightWrapperChildren: Array<VNode | VNode[] | null> = []\n const rightWrapperRoot = h(\n 'div',\n { class: ns.e('rightwrapper') },\n rightWrapperChildren,\n )\n const TEMPLATE_MAP: Record<\n Exclude<LayoutKey, '->'>,\n VNode | VNode[] | null\n > = {\n prev: h(Prev, {\n disabled: props.disabled,\n currentPage: currentPageBridge.value,\n prevText: props.prevText,\n prevIcon: props.prevIcon,\n onClick: prev,\n }),\n jumper: h(Jumper, {\n size: _size.value,\n }),\n pager: h(Pager, {\n currentPage: currentPageBridge.value,\n pageCount: pageCountBridge.value,\n pagerCount: props.pagerCount,\n onChange: handleCurrentChange,\n disabled: props.disabled,\n pageSize: props.pageSize,\n }),\n next: h(Next, {\n disabled: props.disabled,\n currentPage: currentPageBridge.value,\n pageCount: pageCountBridge.value,\n nextText: props.nextText,\n nextIcon: props.nextIcon,\n onClick: next,\n }),\n sizes: h(Sizes, {\n pageSize: pageSizeBridge.value,\n pageSizes: props.pageSizes,\n popperClass: props.popperClass,\n disabled: props.disabled,\n teleported: props.teleported,\n size: _size.value,\n appendSizeTo: props.appendSizeTo,\n }),\n slot: slots?.default?.() ?? null,\n total: h(Total, { total: isAbsent(props.total) ? 0 : props.total }),\n }\n\n const components = props.layout\n .split(',')\n .map((item: string) => item.trim()) as LayoutKey[]\n\n let haveRightWrapper = false\n\n for (const c of components) {\n if (c === '->') {\n haveRightWrapper = true\n continue\n }\n if (haveRightWrapper) {\n rightWrapperChildren.push(TEMPLATE_MAP[c])\n }\n else {\n rootChildren.push(TEMPLATE_MAP[c])\n }\n }\n\n addClass(rootChildren[0], ns.is('first'))\n addClass(rootChildren.at(-1), ns.is('last'))\n\n if (haveRightWrapper && rightWrapperChildren.length > 0) {\n addClass(rightWrapperChildren[0], ns.is('first'))\n addClass(\n rightWrapperChildren.at(-1),\n ns.is('last'),\n )\n rootChildren.push(rightWrapperRoot)\n }\n return h(\n 'div',\n {\n class: [\n ns.b(),\n ns.is('background', props.background),\n ns.m(_size.value),\n ],\n },\n rootChildren,\n )\n }\n },\n})\n"],"names":["elPaginationKey","usePagination","inject","t","useLocale","ns","useNamespace","pageCount","disabled","currentPage","changeEvent","userInput","ref","innerValue","computed","handleInput","val","handleChange","_createElementBlock","_normalizeClass","_unref","_createElementVNode","_createVNode","ElInput","size","props","__props","internalDisabled","nextText","_cache","$event","$emit","_openBlock","_createBlock","ElIcon","_resolveDynamicComponent","nextIcon","emit","__emit","nsPager","nsIcon","showPrevMore","showNextMore","quickPrevHover","quickNextHover","quickPrevFocus","quickNextFocus","pagers","pagerCount","halfPagerCount","array","startPage","i","offset","prevMoreKls","nextMoreKls","tabindex","watchEffect","onMouseEnter","forward","onFocus","onEnter","e","target","newPage","CHANGE_EVENT","onPagerClick","event","pagerCountOffset","useObserver","field","useField","path","errorPageIndexList","formilyComputed","errorPageSet","feedback","acc","cur","pageIndex","a","b","isPrevMoreError","pageIdx","isNextMoreError","ElBadge","_hoisted_1","DArrowLeft","MoreFilled","_Fragment","_renderList","pager","_hoisted_3","DArrowRight","_hoisted_5","prevText","prevIcon","pagination","innerPageSize","watch","newVal","oldVal","isEqual","isArr","pageSize","innerPageSizes","ElSelect","popperClass","teleported","appendSizeTo","item","ElOption","total","isAbsent","v","paginationProps","buildProps","value","isNumber","definePropType","mutable","iconPropType","ArrowLeft","ArrowRight","useSizeProp","paginationEmits","componentName","ElPagination","defineComponent","slots","vnodeProps","getCurrentInstance","_globalSize","useGlobalSize","_size","useDeprecated","hasCurrentPageListener","hasPageSizeListener","assertValidUsage","innerCurrentPage","pageSizeBridge","pageCountBridge","currentPageBridge","newCurrentPage","handleCurrentChange","handleSizeChange","newPageCount","prev","next","addClass","element","cls","provide","debugWarn","rootChildren","rightWrapperChildren","rightWrapperRoot","h","TEMPLATE_MAP","Prev","Jumper","Pager","Next","Sizes","Total","components","haveRightWrapper","c"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAMA,KAAkC,uBAAO,iBAAiB,GCG1DC,KAAgB,MAAMC,GAAOF,IAAiB,EAAE;;;;;ACQtD,UAAM,EAAE,GAAAG,EAAA,IAAMC,EAAA,GACRC,IAAKC,EAAa,YAAY,GAC9B,EAAE,WAAAC,GAAW,UAAAC,GAAU,aAAAC,GAAa,aAAAC,EAAA,IAAgBT,GAAA,GACpDU,IAAYC,EAAA,GACZC,IAAaC,EAAS,MAAMH,EAAU,SAASF,GAAa,KAAK;AAEvE,aAASM,EAAYC,GAAsB;AACzC,MAAAL,EAAU,QAAQK,IAAM,CAACA,IAAM;AAAA,IACjC;AAEA,aAASC,EAAa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,CAAC;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"pagination.mjs","names":["Prev","Jumper","Pager","Next","Sizes","Total"],"sources":["../../src/pagination/pagination.ts"],"sourcesContent":["import type { ExtractPropTypes, VNode } from 'vue'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n elPaginationKey,\n useDeprecated,\n useGlobalSize,\n useLocale,\n useNamespace,\n useSizeProp,\n} from 'element-plus'\nimport {\n buildProps,\n debugWarn,\n definePropType,\n iconPropType,\n isNumber,\n mutable,\n} from 'element-plus/es/utils/index'\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n provide,\n ref,\n watch,\n} from 'vue'\n\nimport Jumper from './components/jumper.vue'\nimport Next from './components/next.vue'\nimport Pager from './components/pager.vue'\nimport Prev from './components/prev.vue'\nimport Sizes from './components/sizes.vue'\nimport Total from './components/total.vue'\n\n/**\n * It it user's responsibility to guarantee that the value of props.total... is number\n * (same as pageSize, defaultPageSize, currentPage, defaultCurrentPage, pageCount)\n * Otherwise we can reasonable infer that the corresponding field is absent\n */\nconst isAbsent = (v: unknown): v is undefined => typeof v !== 'number'\n\ntype LayoutKey\n = | 'prev'\n | 'pager'\n | 'next'\n | 'jumper'\n | '->'\n | 'total'\n | 'sizes'\n | 'slot'\n\nexport const paginationProps = buildProps({\n /**\n * @description options of item count per page\n */\n pageSize: Number,\n /**\n * @description default initial value of page size, not setting is the same as setting 10\n */\n defaultPageSize: Number,\n /**\n * @description total item count\n */\n total: Number,\n /**\n * @description total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required\n */\n pageCount: Number,\n /**\n * @description number of pagers. Pagination collapses when the total page count exceeds this value\n */\n pagerCount: {\n type: Number,\n validator: (value: unknown) => {\n return (\n isNumber(value)\n && Math.trunc(value) === value\n && value > 4\n && value < 22\n && value % 2 === 1\n )\n },\n default: 7,\n },\n /**\n * @description current page number\n */\n currentPage: Number,\n /**\n * @description default initial value of current-page, not setting is the same as setting 1\n */\n defaultCurrentPage: Number,\n /**\n * @description layout of Pagination, elements separated with a comma\n */\n layout: {\n type: String,\n default: (\n ['prev', 'pager', 'next', 'jumper', '->', 'total'] as LayoutKey[]\n ).join(', '),\n },\n /**\n * @description item count of each page\n */\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n /**\n * @description custom class name for the page size Select's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description text for the prev button\n */\n prevText: {\n type: String,\n default: '',\n },\n /**\n * @description icon for the prev button, higher priority of `prev-text`\n */\n prevIcon: {\n type: iconPropType,\n default: () => ArrowLeft,\n },\n /**\n * @description text for the next button\n */\n nextText: {\n type: String,\n default: '',\n },\n /**\n * @description icon for the next button, higher priority of `next-text`\n */\n nextIcon: {\n type: iconPropType,\n default: () => ArrowRight,\n },\n /**\n * @description whether Pagination size is teleported to body\n */\n teleported: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to use small pagination\n */\n small: Boolean,\n /**\n * @description set page size\n */\n size: useSizeProp,\n /**\n * @description whether the buttons have a background color\n */\n background: Boolean,\n /**\n * @description whether Pagination is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to hide when there's only one page\n */\n hideOnSinglePage: Boolean,\n /**\n * @description which element the size dropdown appends to.\n */\n appendSizeTo: String,\n} as const)\nexport type PaginationProps = ExtractPropTypes<typeof paginationProps>\n\nexport const paginationEmits = {\n 'update:current-page': (val: number) => isNumber(val),\n 'update:page-size': (val: number) => isNumber(val),\n 'size-change': (val: number) => isNumber(val),\n 'change': (currentPage: number, pageSize: number) =>\n isNumber(currentPage) && isNumber(pageSize),\n 'current-change': (val: number) => isNumber(val),\n 'prev-click': (val: number) => isNumber(val),\n 'next-click': (val: number) => isNumber(val),\n}\nexport type PaginationEmits = typeof paginationEmits\n\nconst componentName = 'ElPagination'\nexport default defineComponent({\n name: componentName,\n\n props: paginationProps,\n emits: paginationEmits,\n\n setup(props, { emit, slots }) {\n const { t } = useLocale()\n const ns = useNamespace('pagination')\n const vnodeProps = getCurrentInstance()!.vnode.props || {}\n const _globalSize = useGlobalSize()\n const _size = computed(() =>\n props.small ? 'small' : props.size ?? _globalSize.value,\n )\n useDeprecated(\n {\n from: 'small',\n replacement: 'size',\n version: '3.0.0',\n scope: 'el-pagination',\n ref: 'https://element-plus.org/zh-CN/component/pagination.html',\n },\n computed(() => !!props.small),\n )\n // we can find @xxx=\"xxx\" props on `vnodeProps` to check if user bind corresponding events\n const hasCurrentPageListener\n = 'onUpdate:currentPage' in vnodeProps\n || 'onUpdate:current-page' in vnodeProps\n || 'onCurrentChange' in vnodeProps\n const hasPageSizeListener\n = 'onUpdate:pageSize' in vnodeProps\n || 'onUpdate:page-size' in vnodeProps\n || 'onSizeChange' in vnodeProps\n const assertValidUsage = computed(() => {\n // Users have to set either one, otherwise count of pages cannot be determined\n if (isAbsent(props.total) && isAbsent(props.pageCount))\n return false\n // <el-pagination ...otherProps :current-page=\"xxx\" /> without corresponding listener is forbidden now\n // Users have to use two way binding of `currentPage`\n // If users just want to provide a default value, `defaultCurrentPage` is here for you\n if (!isAbsent(props.currentPage) && !hasCurrentPageListener)\n return false\n // When you want to change sizes, things get more complex, detailed below\n // Basically the most important value we need is page count\n // either directly from props.pageCount\n // or calculated from props.total\n // we will take props.pageCount precedence over props.total\n if (props.layout.includes('sizes')) {\n if (!isAbsent(props.pageCount)) {\n // if props.pageCount is assign by user, then user have to watch pageSize change\n // and recalculate pageCount\n if (!hasPageSizeListener)\n return false\n }\n else if (!isAbsent(props.total)) {\n // Otherwise, we will see if user have props.pageSize defined\n // If so, meaning user want to have pageSize controlled himself/herself from component\n // Thus page size listener is required\n // users are account for page size change\n if (isAbsent(props.pageSize)) {\n // (else block just for explaination)\n // else page size is controlled by el-pagination internally\n }\n else {\n if (!hasPageSizeListener) {\n return false\n }\n }\n }\n }\n return true\n })\n\n const innerPageSize = ref(\n isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize,\n )\n const innerCurrentPage = ref(\n isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage,\n )\n\n const pageSizeBridge = computed({\n get() {\n return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize\n },\n set(v: number) {\n if (isAbsent(props.pageSize)) {\n innerPageSize.value = v\n }\n if (hasPageSizeListener) {\n emit('update:page-size', v)\n emit('size-change', v)\n }\n },\n })\n\n const pageCountBridge = computed<number>(() => {\n let pageCount = 0\n if (!isAbsent(props.pageCount)) {\n pageCount = props.pageCount\n }\n else if (!isAbsent(props.total)) {\n pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value))\n }\n return pageCount\n })\n\n const currentPageBridge = computed<number>({\n get() {\n return isAbsent(props.currentPage)\n ? innerCurrentPage.value\n : props.currentPage\n },\n set(v) {\n let newCurrentPage = v\n if (v < 1) {\n newCurrentPage = 1\n }\n else if (v > pageCountBridge.value) {\n newCurrentPage = pageCountBridge.value\n }\n if (isAbsent(props.currentPage)) {\n innerCurrentPage.value = newCurrentPage\n }\n if (hasCurrentPageListener) {\n emit('update:current-page', newCurrentPage)\n emit('current-change', newCurrentPage)\n }\n },\n })\n\n watch(pageCountBridge, (val) => {\n if (currentPageBridge.value > val)\n currentPageBridge.value = val\n })\n\n watch(\n [currentPageBridge, pageSizeBridge],\n (value) => {\n emit(CHANGE_EVENT, ...value)\n },\n { flush: 'post' },\n )\n\n function handleCurrentChange(val: number) {\n currentPageBridge.value = val\n }\n\n function handleSizeChange(val: number) {\n pageSizeBridge.value = val\n const newPageCount = pageCountBridge.value\n if (currentPageBridge.value > newPageCount) {\n currentPageBridge.value = newPageCount\n }\n }\n\n function prev() {\n if (props.disabled)\n return\n currentPageBridge.value -= 1\n emit('prev-click', currentPageBridge.value)\n }\n\n function next() {\n if (props.disabled)\n return\n currentPageBridge.value += 1\n emit('next-click', currentPageBridge.value)\n }\n\n function addClass(element: any, cls: string) {\n if (element) {\n if (!element.props) {\n element.props = {}\n }\n element.props.class = [element.props.class, cls].join(' ')\n }\n }\n\n provide(elPaginationKey, {\n pageCount: pageCountBridge,\n disabled: computed(() => props.disabled),\n currentPage: currentPageBridge,\n changeEvent: handleCurrentChange,\n handleSizeChange,\n })\n\n return () => {\n if (!assertValidUsage.value) {\n debugWarn(componentName, t('el.pagination.deprecationWarning'))\n return null\n }\n if (!props.layout)\n return null\n if (props.hideOnSinglePage && pageCountBridge.value <= 1)\n return null\n const rootChildren: Array<VNode | VNode[] | null> = []\n const rightWrapperChildren: Array<VNode | VNode[] | null> = []\n const rightWrapperRoot = h(\n 'div',\n { class: ns.e('rightwrapper') },\n rightWrapperChildren,\n )\n const TEMPLATE_MAP: Record<\n Exclude<LayoutKey, '->'>,\n VNode | VNode[] | null\n > = {\n prev: h(Prev, {\n disabled: props.disabled,\n currentPage: currentPageBridge.value,\n prevText: props.prevText,\n prevIcon: props.prevIcon,\n onClick: prev,\n }),\n jumper: h(Jumper, {\n size: _size.value,\n }),\n pager: h(Pager, {\n currentPage: currentPageBridge.value,\n pageCount: pageCountBridge.value,\n pagerCount: props.pagerCount,\n onChange: handleCurrentChange,\n disabled: props.disabled,\n pageSize: props.pageSize,\n }),\n next: h(Next, {\n disabled: props.disabled,\n currentPage: currentPageBridge.value,\n pageCount: pageCountBridge.value,\n nextText: props.nextText,\n nextIcon: props.nextIcon,\n onClick: next,\n }),\n sizes: h(Sizes, {\n pageSize: pageSizeBridge.value,\n pageSizes: props.pageSizes,\n popperClass: props.popperClass,\n disabled: props.disabled,\n teleported: props.teleported,\n size: _size.value,\n appendSizeTo: props.appendSizeTo,\n }),\n slot: slots?.default?.() ?? null,\n total: h(Total, { total: isAbsent(props.total) ? 0 : props.total }),\n }\n\n const components = props.layout\n .split(',')\n .map((item: string) => item.trim()) as LayoutKey[]\n\n let haveRightWrapper = false\n\n for (const c of components) {\n if (c === '->') {\n haveRightWrapper = true\n continue\n }\n if (haveRightWrapper) {\n rightWrapperChildren.push(TEMPLATE_MAP[c])\n }\n else {\n rootChildren.push(TEMPLATE_MAP[c])\n }\n }\n\n addClass(rootChildren[0], ns.is('first'))\n addClass(rootChildren.at(-1), ns.is('last'))\n\n if (haveRightWrapper && rightWrapperChildren.length > 0) {\n addClass(rightWrapperChildren[0], ns.is('first'))\n addClass(\n rightWrapperChildren.at(-1),\n ns.is('last'),\n )\n rootChildren.push(rightWrapperRoot)\n }\n return h(\n 'div',\n {\n class: [\n ns.b(),\n ns.is('background', props.background),\n ns.m(_size.value),\n ],\n },\n rootChildren,\n )\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAM,YAAY,MAA+B,OAAO,MAAM;AAY9D,MAAa,kBAAkB,WAAW;CAIxC,UAAU;CAIV,iBAAiB;CAIjB,OAAO;CAIP,WAAW;CAIX,YAAY;EACV,MAAM;EACN,YAAY,UAAmB;AAC7B,UACE,SAAS,MAAM,IACZ,KAAK,MAAM,MAAM,KAAK,SACtB,QAAQ,KACR,QAAQ,MACR,QAAQ,MAAM;;EAGrB,SAAS;EACV;CAID,aAAa;CAIb,oBAAoB;CAIpB,QAAQ;EACN,MAAM;EACN,SACE;GAAC;GAAQ;GAAS;GAAQ;GAAU;GAAM;GAAQ,CAClD,KAAK,KAAK;EACb;CAID,WAAW;EACT,MAAM,eAAyB,MAAM;EACrC,eAAe,QAAQ;GAAC;GAAI;GAAI;GAAI;GAAI;GAAI;GAAI,CAAU;EAC3D;CAID,aAAa;EACX,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,eAAe;EAChB;CAID,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM;EACN,eAAe;EAChB;CAID,YAAY;EACV,MAAM;EACN,SAAS;EACV;CAID,OAAO;CAIP,MAAM;CAIN,YAAY;CAIZ,UAAU;CAIV,kBAAkB;CAIlB,cAAc;CACf,CAAU;AAGX,MAAa,kBAAkB;CA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
-
|
|
10
|
-
|
|
1
|
+
import { ElInput } from "element-plus";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/password/index.d.ts
|
|
5
|
+
type PasswordProps = typeof ElInput;
|
|
6
|
+
declare const Password: {
|
|
7
|
+
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
8
|
+
P: {};
|
|
9
|
+
B: {};
|
|
10
|
+
D: {};
|
|
11
|
+
C: {};
|
|
12
|
+
M: {};
|
|
13
|
+
Defaults: {};
|
|
14
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
15
|
+
__isFragment?: never;
|
|
16
|
+
__isTeleport?: never;
|
|
17
|
+
__isSuspense?: never;
|
|
18
|
+
} & _$vue.ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
19
|
+
$slots: {
|
|
20
|
+
prefix?: () => any;
|
|
21
|
+
suffix?: () => any;
|
|
22
|
+
prepend?: () => any;
|
|
23
|
+
append?: () => any;
|
|
24
|
+
};
|
|
25
|
+
}) & {
|
|
26
|
+
TextArea: {
|
|
27
|
+
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
28
|
+
P: {};
|
|
29
|
+
B: {};
|
|
30
|
+
D: {};
|
|
31
|
+
C: {};
|
|
32
|
+
M: {};
|
|
33
|
+
Defaults: {};
|
|
11
34
|
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
12
35
|
__isFragment?: never;
|
|
13
36
|
__isTeleport?: never;
|
|
14
37
|
__isSuspense?: never;
|
|
15
|
-
} &
|
|
16
|
-
$slots:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}> & {
|
|
22
|
-
prefix?: () => any;
|
|
23
|
-
suffix?: () => any;
|
|
24
|
-
prepend?: () => any;
|
|
25
|
-
append?: () => any;
|
|
38
|
+
} & _$vue.ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
39
|
+
$slots: {
|
|
40
|
+
prefix?: () => any;
|
|
41
|
+
suffix?: () => any;
|
|
42
|
+
prepend?: () => any;
|
|
43
|
+
append?: () => any;
|
|
26
44
|
};
|
|
27
|
-
})
|
|
28
|
-
TextArea: {
|
|
29
|
-
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
30
|
-
P: {};
|
|
31
|
-
B: {};
|
|
32
|
-
D: {};
|
|
33
|
-
C: {};
|
|
34
|
-
M: {};
|
|
35
|
-
Defaults: {};
|
|
36
|
-
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
37
|
-
__isFragment?: never;
|
|
38
|
-
__isTeleport?: never;
|
|
39
|
-
__isSuspense?: never;
|
|
40
|
-
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
41
|
-
$slots: Readonly<{
|
|
42
|
-
prefix?: () => any;
|
|
43
|
-
suffix?: () => any;
|
|
44
|
-
prepend?: () => any;
|
|
45
|
-
append?: () => any;
|
|
46
|
-
}> & {
|
|
47
|
-
prefix?: () => any;
|
|
48
|
-
suffix?: () => any;
|
|
49
|
-
prepend?: () => any;
|
|
50
|
-
append?: () => any;
|
|
51
|
-
};
|
|
52
|
-
});
|
|
45
|
+
});
|
|
53
46
|
};
|
|
54
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Password, PasswordProps };
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
package/esm/password/index.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
m as default
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import Input from "../input/index.mjs";
|
|
2
|
+
import { connect, mapProps } from "@silver-formily/vue";
|
|
3
|
+
//#region src/password/index.ts
|
|
4
|
+
const Password = connect(Input, mapProps((props) => ({
|
|
5
|
+
...props,
|
|
6
|
+
showPassword: true
|
|
7
|
+
})));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Password as default };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/password/index.ts"],"sourcesContent":["import type { ElInput } from 'element-plus'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { Input } from '../input'\n\nexport type PasswordProps = typeof ElInput\n\nexport const Password = connect<typeof Input>(\n Input,\n mapProps(props => ({\n ...props,\n showPassword: true,\n })),\n)\n\nexport default Password\n"],"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/password/index.ts"],"sourcesContent":["import type { ElInput } from 'element-plus'\nimport { connect, mapProps } from '@silver-formily/vue'\nimport { Input } from '../input'\n\nexport type PasswordProps = typeof ElInput\n\nexport const Password = connect<typeof Input>(\n Input,\n mapProps(props => ({\n ...props,\n showPassword: true,\n })),\n)\n\nexport default Password\n"],"mappings":";;;AAMA,MAAa,WAAW,QACtB,OACA,UAAS,WAAU;CACjB,GAAG;CACH,cAAc;CACf,EAAE,CACJ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PickerSelectOpenContext, PickerSelectOpenPicker, PickerSelectOption, PickerSelectProps } from "./types.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/picker-select/index.d.ts
|
|
5
|
+
declare const PickerSelect: {
|
|
6
|
+
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<PickerSelectProps> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
8
|
+
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
|
|
9
|
+
"update:modelValue": (value: any) => any;
|
|
10
|
+
}, _$vue.PublicProps, {
|
|
11
|
+
options: PickerSelectOption[];
|
|
12
|
+
cacheSelectedOptions: boolean;
|
|
13
|
+
}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
14
|
+
P: {};
|
|
15
|
+
B: {};
|
|
16
|
+
D: {};
|
|
17
|
+
C: {};
|
|
18
|
+
M: {};
|
|
19
|
+
Defaults: {};
|
|
20
|
+
}, Readonly<PickerSelectProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
22
|
+
}>, {}, {}, {}, {}, {
|
|
23
|
+
options: PickerSelectOption[];
|
|
24
|
+
cacheSelectedOptions: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
__isFragment?: never;
|
|
27
|
+
__isTeleport?: never;
|
|
28
|
+
__isSuspense?: never;
|
|
29
|
+
} & _$vue.ComponentOptionsBase<Readonly<PickerSelectProps> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
31
|
+
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {} & {
|
|
32
|
+
"update:modelValue": (value: any) => any;
|
|
33
|
+
}, string, {
|
|
34
|
+
options: PickerSelectOption[];
|
|
35
|
+
cacheSelectedOptions: boolean;
|
|
36
|
+
}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
37
|
+
$slots: {
|
|
38
|
+
empty?: () => any;
|
|
39
|
+
prefix?: () => any;
|
|
40
|
+
tag?: () => any;
|
|
41
|
+
loading?: () => any;
|
|
42
|
+
label?: () => any;
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { PickerSelect };
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { mapReadPretty } from "../__builtins__/shared/transform-component.mjs";
|
|
2
|
+
import PreviewText from "../preview-text/index.mjs";
|
|
3
|
+
import _sfc_main from "./picker-select.mjs";
|
|
4
|
+
import { connect, mapProps } from "@silver-formily/vue";
|
|
5
|
+
//#region src/picker-select/index.ts
|
|
6
|
+
const PickerSelect = connect(_sfc_main, mapProps({
|
|
7
|
+
dataSource: "options",
|
|
8
|
+
loading: true,
|
|
9
|
+
disabled: true
|
|
10
|
+
}), mapReadPretty(PreviewText.Select));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PickerSelect as default };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["PickerSelectInner"],"sources":["../../src/picker-select/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport PickerSelectInner from './picker-select.vue'\n\nexport type {\n PickerSelectOpenContext,\n PickerSelectOpenPicker,\n PickerSelectOption,\n PickerSelectProps,\n} from './types'\n\nexport const PickerSelect = connect<typeof PickerSelectInner>(\n PickerSelectInner,\n mapProps({ dataSource: 'options', loading: true, disabled: true }),\n mapReadPretty(PreviewText.Select),\n)\n\nexport default PickerSelect\n"],"mappings":";;;;;AAYA,MAAa,eAAe,QAC1BA,WACA,SAAS;CAAE,YAAY;CAAW,SAAS;CAAM,UAAU;CAAM,CAAC,EAClE,cAAc,YAAY,OAAO,CAClC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useCleanAttrs } from "../__builtins__/shared/utils.mjs";
|
|
2
|
+
import { ElOption, ElSelect } from "element-plus";
|
|
3
|
+
import { Fragment, computed, createBlock, createElementBlock, createSlots, defineComponent, mergeProps, openBlock, ref, renderList, renderSlot, unref, useSlots, withCtx } from "vue";
|
|
4
|
+
import { useField } from "@silver-formily/vue";
|
|
5
|
+
import { isArr, isEqual, isValid } from "@formily/shared";
|
|
6
|
+
//#region src/picker-select/picker-select.vue
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "FPickerSelect",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
__name: "picker-select",
|
|
11
|
+
props: {
|
|
12
|
+
options: { default: () => [] },
|
|
13
|
+
openPicker: {},
|
|
14
|
+
cacheSelectedOptions: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(__props, { emit: __emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const emit = __emit;
|
|
23
|
+
const slots = useSlots();
|
|
24
|
+
const ignoredOpenTriggerSelectors = [".el-select__clear", ".el-tag__close"];
|
|
25
|
+
const { props: selectProps } = useCleanAttrs();
|
|
26
|
+
const fieldRef = useField();
|
|
27
|
+
const selectRef = ref();
|
|
28
|
+
const openingPicker = ref(false);
|
|
29
|
+
const selectedOptionCache = ref([]);
|
|
30
|
+
const ignoreVisibleChangeUntil = ref(0);
|
|
31
|
+
const multiple = computed(() => Boolean(selectProps.value.multiple));
|
|
32
|
+
const currentValue = computed(() => selectProps.value.modelValue);
|
|
33
|
+
const baseOptions = computed(() => props.options ?? []);
|
|
34
|
+
function isSameValue(left, right) {
|
|
35
|
+
return isEqual(left, right);
|
|
36
|
+
}
|
|
37
|
+
function hasOption(optionList, option) {
|
|
38
|
+
return optionList.some((item) => isSameValue(item.value, option.value));
|
|
39
|
+
}
|
|
40
|
+
function createFallbackOption(value) {
|
|
41
|
+
return {
|
|
42
|
+
label: value,
|
|
43
|
+
value
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const normalizedValues = computed(() => {
|
|
47
|
+
const value = currentValue.value;
|
|
48
|
+
if (multiple.value) return isArr(value) ? value : [];
|
|
49
|
+
return isValid(value) ? [value] : [];
|
|
50
|
+
});
|
|
51
|
+
const displayOptions = computed(() => {
|
|
52
|
+
const merged = [...baseOptions.value];
|
|
53
|
+
for (const item of selectedOptionCache.value) if (!hasOption(merged, item)) merged.push(item);
|
|
54
|
+
for (const value of normalizedValues.value) if (!merged.some((item) => isSameValue(item.value, value))) merged.push(createFallbackOption(value));
|
|
55
|
+
return merged;
|
|
56
|
+
});
|
|
57
|
+
function setValue(value) {
|
|
58
|
+
fieldRef.value?.setValue?.(value);
|
|
59
|
+
if (!fieldRef.value) emit("update:modelValue", value);
|
|
60
|
+
}
|
|
61
|
+
function cacheOptions(optionList) {
|
|
62
|
+
if (props.cacheSelectedOptions === false) return;
|
|
63
|
+
const merged = [...selectedOptionCache.value];
|
|
64
|
+
for (const item of optionList) {
|
|
65
|
+
const index = merged.findIndex((cacheItem) => isSameValue(cacheItem.value, item.value));
|
|
66
|
+
if (index >= 0) merged[index] = item;
|
|
67
|
+
else merged.push(item);
|
|
68
|
+
}
|
|
69
|
+
selectedOptionCache.value = merged;
|
|
70
|
+
}
|
|
71
|
+
function clearValue() {
|
|
72
|
+
setValue(multiple.value ? [] : void 0);
|
|
73
|
+
}
|
|
74
|
+
function shouldIgnoreOpenTrigger(target) {
|
|
75
|
+
if (!(target instanceof HTMLElement)) return false;
|
|
76
|
+
return ignoredOpenTriggerSelectors.some((selector) => target.closest(selector));
|
|
77
|
+
}
|
|
78
|
+
function ignoreCurrentVisibleChange() {
|
|
79
|
+
ignoreVisibleChangeUntil.value = Date.now() + 200;
|
|
80
|
+
}
|
|
81
|
+
async function handleOpenPicker() {
|
|
82
|
+
if (openingPicker.value || typeof props.openPicker !== "function") return;
|
|
83
|
+
openingPicker.value = true;
|
|
84
|
+
try {
|
|
85
|
+
const result = await Promise.resolve(props.openPicker({
|
|
86
|
+
field: fieldRef.value,
|
|
87
|
+
dataSource: baseOptions.value,
|
|
88
|
+
multiple: multiple.value
|
|
89
|
+
})).catch(() => void 0);
|
|
90
|
+
if (multiple.value) {
|
|
91
|
+
if (!isValid(result)) return;
|
|
92
|
+
const normalizedResult = isArr(result) ? result : [result];
|
|
93
|
+
cacheOptions(normalizedResult);
|
|
94
|
+
setValue(normalizedResult.map((item) => item.value));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (!isValid(result)) return;
|
|
98
|
+
const normalizedResult = isArr(result) ? result[0] : result;
|
|
99
|
+
if (!normalizedResult) return;
|
|
100
|
+
cacheOptions([normalizedResult]);
|
|
101
|
+
setValue(normalizedResult.value);
|
|
102
|
+
} finally {
|
|
103
|
+
openingPicker.value = false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function handleVisibleChange(visible) {
|
|
107
|
+
if (!visible) return;
|
|
108
|
+
selectRef.value?.blur?.();
|
|
109
|
+
if (Date.now() < ignoreVisibleChangeUntil.value) {
|
|
110
|
+
ignoreVisibleChangeUntil.value = 0;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
handleOpenPicker();
|
|
114
|
+
}
|
|
115
|
+
function handleTriggerClick(event) {
|
|
116
|
+
if (typeof props.openPicker !== "function" || selectProps.value.disabled) return;
|
|
117
|
+
if (shouldIgnoreOpenTrigger(event.target)) {
|
|
118
|
+
ignoreCurrentVisibleChange();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
ignoreVisibleChangeUntil.value = 0;
|
|
122
|
+
}
|
|
123
|
+
function handleRemoveTag(value) {
|
|
124
|
+
if (!multiple.value) return;
|
|
125
|
+
setValue(normalizedValues.value.filter((item) => !isSameValue(item, value)));
|
|
126
|
+
}
|
|
127
|
+
return (_ctx, _cache) => {
|
|
128
|
+
return openBlock(), createBlock(unref(ElSelect), mergeProps({
|
|
129
|
+
ref_key: "selectRef",
|
|
130
|
+
ref: selectRef
|
|
131
|
+
}, unref(selectProps), {
|
|
132
|
+
onClick: handleTriggerClick,
|
|
133
|
+
onClear: clearValue,
|
|
134
|
+
onRemoveTag: handleRemoveTag,
|
|
135
|
+
onVisibleChange: handleVisibleChange
|
|
136
|
+
}), createSlots({
|
|
137
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(displayOptions.value, (option) => {
|
|
138
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
139
|
+
key: typeof option.value === "object" ? JSON.stringify(option.value) : String(option.value),
|
|
140
|
+
label: option.label,
|
|
141
|
+
value: option.value,
|
|
142
|
+
disabled: option.disabled
|
|
143
|
+
}, null, 8, [
|
|
144
|
+
"label",
|
|
145
|
+
"value",
|
|
146
|
+
"disabled"
|
|
147
|
+
]);
|
|
148
|
+
}), 128))]),
|
|
149
|
+
_: 2
|
|
150
|
+
}, [
|
|
151
|
+
slots.prefix ? {
|
|
152
|
+
name: "prefix",
|
|
153
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
|
|
154
|
+
key: "0"
|
|
155
|
+
} : void 0,
|
|
156
|
+
slots.empty ? {
|
|
157
|
+
name: "empty",
|
|
158
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
|
|
159
|
+
key: "1"
|
|
160
|
+
} : void 0,
|
|
161
|
+
slots.tag ? {
|
|
162
|
+
name: "tag",
|
|
163
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "tag")]),
|
|
164
|
+
key: "2"
|
|
165
|
+
} : void 0,
|
|
166
|
+
slots.loading ? {
|
|
167
|
+
name: "loading",
|
|
168
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
|
|
169
|
+
key: "3"
|
|
170
|
+
} : void 0,
|
|
171
|
+
slots.label ? {
|
|
172
|
+
name: "label",
|
|
173
|
+
fn: withCtx(({ label, value }) => [renderSlot(_ctx.$slots, "label", {
|
|
174
|
+
label,
|
|
175
|
+
value
|
|
176
|
+
})]),
|
|
177
|
+
key: "4"
|
|
178
|
+
} : void 0
|
|
179
|
+
]), 1040);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
//#endregion
|
|
184
|
+
export { _sfc_main as default };
|
|
185
|
+
|
|
186
|
+
//# sourceMappingURL=picker-select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-select.mjs","names":[],"sources":["../../src/picker-select/picker-select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport type { PickerSelectOpenPicker, PickerSelectOption, PickerSelectProps } from './types'\nimport { isArr, isEqual, isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElOption, ElSelect } from 'element-plus'\nimport { computed, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FPickerSelect',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<PickerSelectProps>(), {\n options: () => [],\n cacheSelectedOptions: true,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: any): void\n}>()\n\nconst slots = defineSlots<{\n empty?: () => any\n prefix?: () => any\n tag?: () => any\n loading?: () => any\n label?: () => any\n}>()\n\nconst ignoredOpenTriggerSelectors = ['.el-select__clear', '.el-tag__close']\n\nconst { props: selectProps } = useCleanAttrs()\nconst fieldRef = useField<Field>()\nconst selectRef = ref<InstanceType<typeof ElSelect>>()\nconst openingPicker = ref(false)\nconst selectedOptionCache = ref<PickerSelectOption[]>([])\nconst ignoreVisibleChangeUntil = ref(0)\n\nconst multiple = computed(() => Boolean(selectProps.value.multiple))\nconst currentValue = computed(() => selectProps.value.modelValue)\nconst baseOptions = computed<PickerSelectOption[]>(() => props.options ?? [])\n\nfunction isSameValue(left: any, right: any) {\n return isEqual(left, right)\n}\n\nfunction hasOption(optionList: PickerSelectOption[], option: PickerSelectOption) {\n return optionList.some(item => isSameValue(item.value, option.value))\n}\n\nfunction createFallbackOption(value: any): PickerSelectOption {\n return {\n label: value,\n value,\n }\n}\n\nconst normalizedValues = computed(() => {\n const value = currentValue.value\n if (multiple.value) {\n return isArr(value) ? value : []\n }\n return isValid(value) ? [value] : []\n})\n\nconst displayOptions = computed<PickerSelectOption[]>(() => {\n const merged = [...baseOptions.value]\n for (const item of selectedOptionCache.value) {\n if (!hasOption(merged, item)) {\n merged.push(item)\n }\n }\n for (const value of normalizedValues.value) {\n if (!merged.some(item => isSameValue(item.value, value))) {\n merged.push(createFallbackOption(value))\n }\n }\n return merged\n})\n\nfunction setValue(value: any) {\n fieldRef.value?.setValue?.(value)\n if (!fieldRef.value) {\n emit('update:modelValue', value)\n }\n}\n\nfunction cacheOptions(optionList: PickerSelectOption[]) {\n if (props.cacheSelectedOptions === false) {\n return\n }\n const merged = [...selectedOptionCache.value]\n for (const item of optionList) {\n const index = merged.findIndex(cacheItem => isSameValue(cacheItem.value, item.value))\n if (index >= 0) {\n merged[index] = item\n }\n else {\n merged.push(item)\n }\n }\n selectedOptionCache.value = merged\n}\n\nfunction clearValue() {\n setValue(multiple.value ? [] : undefined)\n}\n\nfunction shouldIgnoreOpenTrigger(target: EventTarget | null) {\n if (!(target instanceof HTMLElement)) {\n return false\n }\n return ignoredOpenTriggerSelectors.some(selector => target.closest(selector))\n}\n\nfunction ignoreCurrentVisibleChange() {\n ignoreVisibleChangeUntil.value = Date.now() + 200\n}\n\nasync function handleOpenPicker() {\n if (openingPicker.value || typeof props.openPicker !== 'function') {\n return\n }\n\n openingPicker.value = true\n\n try {\n const result = await Promise.resolve(\n (props.openPicker as PickerSelectOpenPicker)({\n field: fieldRef.value,\n dataSource: baseOptions.value,\n multiple: multiple.value,\n }),\n ).catch(() => undefined)\n\n if (multiple.value) {\n if (!isValid(result)) {\n return\n }\n const normalizedResult = isArr(result) ? result : [result]\n cacheOptions(normalizedResult)\n setValue(normalizedResult.map(item => item.value))\n return\n }\n\n if (!isValid(result)) {\n return\n }\n const normalizedResult = isArr(result) ? result[0] : result\n if (!normalizedResult) {\n return\n }\n cacheOptions([normalizedResult])\n setValue(normalizedResult.value)\n }\n finally {\n openingPicker.value = false\n }\n}\n\nfunction handleVisibleChange(visible: boolean) {\n if (!visible) {\n return\n }\n selectRef.value?.blur?.()\n if (Date.now() < ignoreVisibleChangeUntil.value) {\n ignoreVisibleChangeUntil.value = 0\n return\n }\n void handleOpenPicker()\n}\n\nfunction handleTriggerClick(event: MouseEvent) {\n if (typeof props.openPicker !== 'function' || selectProps.value.disabled) {\n return\n }\n if (shouldIgnoreOpenTrigger(event.target)) {\n ignoreCurrentVisibleChange()\n return\n }\n ignoreVisibleChangeUntil.value = 0\n}\n\nfunction handleRemoveTag(value: any) {\n if (!multiple.value) {\n return\n }\n setValue(normalizedValues.value.filter(item => !isSameValue(item, value)))\n}\n</script>\n\n<template>\n <ElSelect\n ref=\"selectRef\"\n v-bind=\"selectProps\"\n @click=\"handleTriggerClick\"\n @clear=\"clearValue\"\n @remove-tag=\"handleRemoveTag\"\n @visible-change=\"handleVisibleChange\"\n >\n <ElOption\n v-for=\"option of displayOptions\"\n :key=\"typeof option.value === 'object' ? JSON.stringify(option.value) : String(option.value)\"\n :label=\"option.label\"\n :value=\"option.value\"\n :disabled=\"option.disabled\"\n />\n <template v-if=\"slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n <template v-if=\"slots.tag\" #tag>\n <slot name=\"tag\" />\n </template>\n <template v-if=\"slots.loading\" #loading>\n <slot name=\"loading\" />\n </template>\n <template v-if=\"slots.label\" #label=\"{ label, value }\">\n <slot name=\"label\" :label=\"label\" :value=\"value\" />\n </template>\n </ElSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAIb,MAAM,QAAQ,UAAA;EAQd,MAAM,8BAA8B,CAAC,qBAAqB,iBAAgB;EAE1E,MAAM,EAAE,OAAO,gBAAgB,eAAc;EAC7C,MAAM,WAAW,UAAgB;EACjC,MAAM,YAAY,KAAmC;EACrD,MAAM,gBAAgB,IAAI,MAAK;EAC/B,MAAM,sBAAsB,IAA0B,EAAE,CAAA;EACxD,MAAM,2BAA2B,IAAI,EAAC;EAEtC,MAAM,WAAW,eAAe,QAAQ,YAAY,MAAM,SAAS,CAAA;EACnE,MAAM,eAAe,eAAe,YAAY,MAAM,WAAU;EAChE,MAAM,cAAc,eAAqC,MAAM,WAAW,EAAE,CAAA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M,QAAO,SAAQ,CAAC,YAAY,MAAM,MAAM,CAAC,CAAA;;;uBAKzE,YA8BW,MAAA,SAAA,EA9BX,WA8BW;aA7BL;IAAJ,KAAI;MACI,MAAA,YAAW,EAAA;IAClB,SAAO;IACP,SAAO;IACP,aAAY;IACZ,iBAAgB;;2BAGiB,EAAA,UAAA,KAAA,EADlC,mBAME,UAAA,MAAA,WALiB,eAAA,QAAV,WAAM;yBADf,YAME,MAAA,SAAA,EAAA;MAJC,KAAG,OAAS,OAAO,UAAK,WAAgB,KAAK,UAAU,OAAO,MAAK,GAAI,OAAO,OAAO,MAAK;MAC1F,OAAO,OAAO;MACd,OAAO,OAAO;MACd,UAAU,OAAO;;;;;;;;;IAEJ,MAAM,SAAA;WAAS;uBACP,CAAtB,WAAsB,KAAA,QAAA,SAAA,CAAA,CAAA;;;IAER,MAAM,QAAA;WAAQ;uBACP,CAArB,WAAqB,KAAA,QAAA,QAAA,CAAA,CAAA;;;IAEP,MAAM,MAAA;WAAM;uBACP,CAAnB,WAAmB,KAAA,QAAA,MAAA,CAAA,CAAA;;;IAEL,MAAM,UAAA;WAAU;uBACP,CAAvB,WAAuB,KAAA,QAAA,UAAA,CAAA,CAAA;;;IAET,MAAM,QAAA;WAAQ;kBACuB,EADd,OAAO,YAAK,CACjD,WAAmD,KAAA,QAAA,SAAA;MAAxB;MAAe"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Field } from "@formily/core";
|
|
2
|
+
|
|
3
|
+
//#region src/picker-select/types.d.ts
|
|
4
|
+
interface PickerSelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
raw?: any;
|
|
9
|
+
}
|
|
10
|
+
interface PickerSelectOpenContext {
|
|
11
|
+
field?: Field;
|
|
12
|
+
dataSource: PickerSelectOption[];
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
}
|
|
15
|
+
type PickerSelectOpenPicker = (ctx: PickerSelectOpenContext) => Promise<PickerSelectOption | PickerSelectOption[] | null | undefined> | PickerSelectOption | PickerSelectOption[] | null | undefined;
|
|
16
|
+
interface PickerSelectProps {
|
|
17
|
+
options?: PickerSelectOption[];
|
|
18
|
+
openPicker?: PickerSelectOpenPicker;
|
|
19
|
+
cacheSelectedOptions?: boolean;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { PickerSelectOpenContext, PickerSelectOpenPicker, PickerSelectOption, PickerSelectProps };
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|