element-pe 2.2.99 → 2.2.101
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/dist/index.full.js +73 -44
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +73 -44
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +26 -119
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +119 -26
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +103 -38
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +38 -103
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +61 -23
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +23 -61
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/badge/index.mjs +2 -2
- package/es/components/badge/src/badge.mjs +17 -59
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +59 -17
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +8 -69
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +69 -8
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +647 -86
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +86 -647
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +116 -209
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +209 -116
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +66 -10
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +10 -66
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.mjs +1 -1
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +7 -64
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +64 -7
- package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
- package/es/components/dialog/index.mjs +2 -2
- package/es/components/dialog/src/dialog.mjs +175 -72
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog2.mjs +72 -175
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +35 -17
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +17 -35
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +29 -187
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +187 -29
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +3 -3
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form-item.mjs +46 -328
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +328 -46
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +8 -36
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +36 -8
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/index.mjs +33 -33
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +50 -21
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +21 -50
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +14 -97
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +97 -14
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/message/index.mjs +1 -1
- package/es/components/message/src/message.mjs +86 -151
- package/es/components/message/src/message.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +151 -86
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/message/src/method.mjs +2 -2
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +67 -151
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +151 -67
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +17 -218
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +218 -17
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +71 -23
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes2.mjs +23 -71
- package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
- package/es/components/pagination/src/components/total.mjs +7 -28
- package/es/components/pagination/src/components/total.mjs.map +1 -1
- package/es/components/pagination/src/components/total2.mjs +28 -7
- package/es/components/pagination/src/components/total2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +3 -3
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +110 -47
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +47 -110
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/src/popover.mjs +2 -2
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/arrow.mjs +8 -39
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +39 -8
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +31 -121
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +121 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +205 -59
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +59 -205
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/resizable-columns/index.mjs +2 -2
- package/es/components/resizable-columns/src/resizable-columns.mjs +264 -21
- package/es/components/resizable-columns/src/resizable-columns.mjs.map +1 -1
- package/es/components/resizable-columns/src/resizable-columns2.mjs +21 -264
- package/es/components/resizable-columns/src/resizable-columns2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +45 -29
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +29 -45
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.mjs +17 -42
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +42 -17
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/select-v2/src/useSelect.mjs +1 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/steps.mjs +36 -39
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +39 -36
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +268 -103
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +103 -268
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +42 -15
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table-body/defaults.d.ts +2 -1
- package/es/components/table/src/table-body/defaults.mjs +2 -1
- package/es/components/table/src/table-body/defaults.mjs.map +1 -1
- package/es/components/table/src/table-body/render-helper.mjs +6 -4
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/text/index.mjs +2 -2
- package/es/components/text/src/text.mjs +38 -24
- package/es/components/text/src/text.mjs.map +1 -1
- package/es/components/text/src/text2.mjs +24 -38
- package/es/components/text/src/text2.mjs.map +1 -1
- package/es/components/timeline/index.mjs +2 -2
- package/es/components/timeline/src/timeline-item.mjs +72 -42
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item2.mjs +42 -72
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +4 -4
- package/es/components/tooltip/src/content.mjs +31 -179
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +179 -31
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +31 -175
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +175 -31
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +16 -73
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +73 -16
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +1 -1
- package/es/components/upload/index.mjs +3 -3
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +2 -2
- package/es/components/upload/src/upload-dragger.mjs +11 -72
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +72 -11
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +102 -116
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +116 -102
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/components/visual-hidden/index.mjs +3 -3
- package/es/components/visual-hidden/src/visual-hidden.mjs +35 -7
- package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
- package/es/components/visual-hidden/src/visual-hidden2.mjs +7 -35
- package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
- package/es/index.mjs +33 -33
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +27 -119
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +119 -27
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +102 -39
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +39 -102
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +61 -24
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +24 -61
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/badge/index.js +2 -2
- package/lib/components/badge/src/badge.js +17 -59
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +59 -17
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +8 -69
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +69 -8
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +647 -87
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +87 -647
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +116 -209
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +209 -116
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +66 -9
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +9 -66
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.js +1 -1
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +7 -64
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +64 -7
- package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
- package/lib/components/dialog/index.js +2 -2
- package/lib/components/dialog/src/dialog.js +175 -73
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog2.js +73 -175
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +35 -17
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +17 -35
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +30 -187
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +187 -30
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +3 -3
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form-item.js +47 -332
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +332 -47
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +8 -36
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +36 -8
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/index.js +33 -33
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +50 -22
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +22 -50
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +15 -97
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +97 -15
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/message/index.js +1 -1
- package/lib/components/message/src/message.js +88 -150
- package/lib/components/message/src/message.js.map +1 -1
- package/lib/components/message/src/message2.js +150 -88
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/message/src/method.js +2 -2
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +68 -150
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +150 -68
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/pagination/src/components/pager.js +17 -218
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +218 -17
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +71 -23
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes2.js +23 -71
- package/lib/components/pagination/src/components/sizes2.js.map +1 -1
- package/lib/components/pagination/src/components/total.js +7 -28
- package/lib/components/pagination/src/components/total.js.map +1 -1
- package/lib/components/pagination/src/components/total2.js +28 -7
- package/lib/components/pagination/src/components/total2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +3 -3
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +110 -48
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +48 -110
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/src/popover.js +2 -2
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/arrow.js +9 -39
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +39 -9
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/popper/src/trigger.js +32 -121
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +121 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +205 -59
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +59 -205
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/resizable-columns/index.js +2 -2
- package/lib/components/resizable-columns/src/resizable-columns.js +264 -21
- package/lib/components/resizable-columns/src/resizable-columns.js.map +1 -1
- package/lib/components/resizable-columns/src/resizable-columns2.js +21 -264
- package/lib/components/resizable-columns/src/resizable-columns2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +45 -31
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +31 -45
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/scrollbar/src/bar.js +17 -42
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +42 -17
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/select-v2/src/useSelect.js +1 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/steps.js +37 -39
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +39 -37
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +267 -103
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +103 -267
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +42 -15
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table-body/defaults.d.ts +2 -1
- package/lib/components/table/src/table-body/defaults.js +2 -0
- package/lib/components/table/src/table-body/defaults.js.map +1 -1
- package/lib/components/table/src/table-body/render-helper.js +6 -4
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/text/index.js +2 -2
- package/lib/components/text/src/text.js +38 -24
- package/lib/components/text/src/text.js.map +1 -1
- package/lib/components/text/src/text2.js +24 -38
- package/lib/components/text/src/text2.js.map +1 -1
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/timeline-item.js +72 -42
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item2.js +42 -72
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/index.js +4 -4
- package/lib/components/tooltip/src/content.js +31 -179
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +179 -31
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +33 -173
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +173 -33
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +16 -73
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +73 -16
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +1 -1
- package/lib/components/upload/index.js +3 -3
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +2 -2
- package/lib/components/upload/src/upload-dragger.js +12 -72
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +72 -12
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +105 -116
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +116 -105
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/components/visual-hidden/index.js +2 -2
- package/lib/components/visual-hidden/src/visual-hidden.js +35 -7
- package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
- package/lib/components/visual-hidden/src/visual-hidden2.js +7 -35
- package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
- package/lib/index.js +33 -33
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,276 +1,111 @@
|
|
|
1
|
-
import { defineComponent, getCurrentInstance, computed, ref, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, createVNode } from 'vue';
|
|
2
|
-
import '../../config-provider/index.mjs';
|
|
3
|
-
import { isPromise } from '@vue/shared';
|
|
4
1
|
import '../../../utils/index.mjs';
|
|
5
|
-
import { ElIcon } from '../../icon/index.mjs';
|
|
6
|
-
import '../../form/index.mjs';
|
|
7
|
-
import { Loading } from '@element-plus/icons-vue';
|
|
8
2
|
import '../../../constants/index.mjs';
|
|
9
|
-
import '../../../
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import { useFormSize, useFormDisabled, useFormViewMode } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
14
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
15
|
-
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
16
|
-
import { addUnit } from '../../../utils/dom/style.mjs';
|
|
17
|
-
import { watch } from '../../config-provider/src/for-editor.mjs';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
4
|
+
import { viewModes } from '../../../constants/size.mjs';
|
|
5
|
+
import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
|
|
6
|
+
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
18
7
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
8
|
+
import { isBoolean, isNumber } from '../../../utils/types.mjs';
|
|
9
|
+
import { isString } from '@vue/shared';
|
|
21
10
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const val = checked.value ? props.inactiveValue : props.activeValue;
|
|
114
|
-
emit(UPDATE_MODEL_EVENT, val);
|
|
115
|
-
emit(CHANGE_EVENT, val);
|
|
116
|
-
emit(INPUT_EVENT, val);
|
|
117
|
-
nextTick(() => {
|
|
118
|
-
input.value.checked = checked.value;
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
const switchValue = () => {
|
|
122
|
-
if (switchDisabled.value || switchViewMode.value)
|
|
123
|
-
return;
|
|
124
|
-
const { beforeChange } = props;
|
|
125
|
-
if (!beforeChange) {
|
|
126
|
-
handleChange();
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const shouldChange = beforeChange();
|
|
130
|
-
const isPromiseOrBool = [
|
|
131
|
-
isPromise(shouldChange),
|
|
132
|
-
isBoolean(shouldChange)
|
|
133
|
-
].includes(true);
|
|
134
|
-
if (!isPromiseOrBool) {
|
|
135
|
-
throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
|
|
136
|
-
}
|
|
137
|
-
if (isPromise(shouldChange)) {
|
|
138
|
-
shouldChange.then((result) => {
|
|
139
|
-
if (result) {
|
|
140
|
-
handleChange();
|
|
141
|
-
}
|
|
142
|
-
}).catch((e) => {
|
|
143
|
-
debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
|
|
144
|
-
});
|
|
145
|
-
} else if (shouldChange) {
|
|
146
|
-
handleChange();
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const styles = computed(() => {
|
|
150
|
-
return ns.cssVarBlock({
|
|
151
|
-
...props.activeColor ? { "on-color": props.activeColor } : null,
|
|
152
|
-
...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
|
|
153
|
-
...props.borderColor ? { "border-color": props.borderColor } : null
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
const focus = () => {
|
|
157
|
-
var _a, _b;
|
|
158
|
-
(_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
159
|
-
};
|
|
160
|
-
onMounted(() => {
|
|
161
|
-
input.value.checked = checked.value;
|
|
162
|
-
});
|
|
163
|
-
expose({
|
|
164
|
-
focus,
|
|
165
|
-
checked
|
|
166
|
-
});
|
|
167
|
-
return (_ctx, _cache) => {
|
|
168
|
-
return openBlock(), createElementBlock("div", {
|
|
169
|
-
class: normalizeClass(unref(switchKls)),
|
|
170
|
-
style: normalizeStyle(unref(styles)),
|
|
171
|
-
onClick: withModifiers(switchValue, ["prevent"])
|
|
172
|
-
}, [
|
|
173
|
-
createElementVNode("input", {
|
|
174
|
-
id: unref(inputId),
|
|
175
|
-
ref_key: "input",
|
|
176
|
-
ref: input,
|
|
177
|
-
class: normalizeClass(unref(ns).e("input")),
|
|
178
|
-
type: "checkbox",
|
|
179
|
-
role: "switch",
|
|
180
|
-
"aria-checked": unref(checked),
|
|
181
|
-
"aria-disabled": unref(switchDisabled),
|
|
182
|
-
"aria-label": _ctx.label,
|
|
183
|
-
name: _ctx.name,
|
|
184
|
-
"true-value": _ctx.activeValue,
|
|
185
|
-
"false-value": _ctx.inactiveValue,
|
|
186
|
-
disabled: unref(switchDisabled) || unref(switchViewMode),
|
|
187
|
-
tabindex: _ctx.tabindex,
|
|
188
|
-
onChange: handleChange,
|
|
189
|
-
onKeydown: withKeys(switchValue, ["enter"])
|
|
190
|
-
}, null, 42, _hoisted_2),
|
|
191
|
-
!_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
|
|
192
|
-
key: 0,
|
|
193
|
-
class: normalizeClass(unref(labelLeftKls))
|
|
194
|
-
}, [
|
|
195
|
-
_ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
196
|
-
default: withCtx(() => [
|
|
197
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
|
|
198
|
-
]),
|
|
199
|
-
_: 1
|
|
200
|
-
})) : createCommentVNode("v-if", true),
|
|
201
|
-
!_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
|
202
|
-
key: 1,
|
|
203
|
-
"aria-hidden": unref(checked)
|
|
204
|
-
}, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode("v-if", true)
|
|
205
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
206
|
-
createElementVNode("span", {
|
|
207
|
-
ref_key: "core",
|
|
208
|
-
ref: core,
|
|
209
|
-
class: normalizeClass(unref(ns).e("core")),
|
|
210
|
-
style: normalizeStyle(unref(coreStyle))
|
|
211
|
-
}, [
|
|
212
|
-
_ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
|
|
213
|
-
key: 0,
|
|
214
|
-
class: normalizeClass(unref(ns).e("inner"))
|
|
215
|
-
}, [
|
|
216
|
-
_ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: normalizeClass(unref(ns).is("icon"))
|
|
219
|
-
}, {
|
|
220
|
-
default: withCtx(() => [
|
|
221
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
|
|
222
|
-
]),
|
|
223
|
-
_: 1
|
|
224
|
-
}, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
|
|
225
|
-
key: 1,
|
|
226
|
-
class: normalizeClass(unref(ns).is("text")),
|
|
227
|
-
"aria-hidden": !unref(checked)
|
|
228
|
-
}, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
229
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
230
|
-
createElementVNode("div", {
|
|
231
|
-
class: normalizeClass(unref(ns).e("action"))
|
|
232
|
-
}, [
|
|
233
|
-
_ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
|
|
234
|
-
key: 0,
|
|
235
|
-
class: normalizeClass(unref(ns).is("loading"))
|
|
236
|
-
}, {
|
|
237
|
-
default: withCtx(() => [
|
|
238
|
-
createVNode(unref(Loading))
|
|
239
|
-
]),
|
|
240
|
-
_: 1
|
|
241
|
-
}, 8, ["class"])) : _ctx.activeActionIcon && unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
242
|
-
default: withCtx(() => [
|
|
243
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
|
|
244
|
-
]),
|
|
245
|
-
_: 1
|
|
246
|
-
})) : _ctx.inactiveActionIcon && !unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 2 }, {
|
|
247
|
-
default: withCtx(() => [
|
|
248
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
|
|
249
|
-
]),
|
|
250
|
-
_: 1
|
|
251
|
-
})) : createCommentVNode("v-if", true)
|
|
252
|
-
], 2)
|
|
253
|
-
], 6),
|
|
254
|
-
!_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
|
|
255
|
-
key: 1,
|
|
256
|
-
class: normalizeClass(unref(labelRightKls))
|
|
257
|
-
}, [
|
|
258
|
-
_ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
259
|
-
default: withCtx(() => [
|
|
260
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
|
|
261
|
-
]),
|
|
262
|
-
_: 1
|
|
263
|
-
})) : createCommentVNode("v-if", true),
|
|
264
|
-
!_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
|
|
265
|
-
key: 1,
|
|
266
|
-
"aria-hidden": !unref(checked)
|
|
267
|
-
}, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode("v-if", true)
|
|
268
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
269
|
-
], 14, _hoisted_1);
|
|
270
|
-
};
|
|
11
|
+
const switchProps = buildProps({
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: [Boolean, String, Number],
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
viewMode: {
|
|
21
|
+
type: String,
|
|
22
|
+
values: viewModes
|
|
23
|
+
},
|
|
24
|
+
loading: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
validator: isValidComponentSize
|
|
31
|
+
},
|
|
32
|
+
width: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
default: ""
|
|
35
|
+
},
|
|
36
|
+
inlinePrompt: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
inactiveActionIcon: {
|
|
41
|
+
type: iconPropType
|
|
42
|
+
},
|
|
43
|
+
activeActionIcon: {
|
|
44
|
+
type: iconPropType
|
|
45
|
+
},
|
|
46
|
+
activeIcon: {
|
|
47
|
+
type: iconPropType
|
|
48
|
+
},
|
|
49
|
+
inactiveIcon: {
|
|
50
|
+
type: iconPropType
|
|
51
|
+
},
|
|
52
|
+
activeText: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
},
|
|
56
|
+
inactiveText: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
activeValue: {
|
|
61
|
+
type: [Boolean, String, Number],
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
inactiveValue: {
|
|
65
|
+
type: [Boolean, String, Number],
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
activeColor: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ""
|
|
71
|
+
},
|
|
72
|
+
inactiveColor: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
},
|
|
76
|
+
borderColor: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: ""
|
|
79
|
+
},
|
|
80
|
+
name: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: ""
|
|
83
|
+
},
|
|
84
|
+
validateEvent: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: true
|
|
87
|
+
},
|
|
88
|
+
beforeChange: {
|
|
89
|
+
type: definePropType(Function)
|
|
90
|
+
},
|
|
91
|
+
id: String,
|
|
92
|
+
tabindex: {
|
|
93
|
+
type: [String, Number]
|
|
94
|
+
},
|
|
95
|
+
value: {
|
|
96
|
+
type: [Boolean, String, Number],
|
|
97
|
+
default: false
|
|
98
|
+
},
|
|
99
|
+
label: {
|
|
100
|
+
type: String,
|
|
101
|
+
default: void 0
|
|
271
102
|
}
|
|
272
103
|
});
|
|
273
|
-
|
|
104
|
+
const switchEmits = {
|
|
105
|
+
[UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
106
|
+
[CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
|
|
107
|
+
[INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
|
|
108
|
+
};
|
|
274
109
|
|
|
275
|
-
export {
|
|
110
|
+
export { switchEmits, switchProps };
|
|
276
111
|
//# sourceMappingURL=switch2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.vue"],"sourcesContent":["<template>\n <div :class=\"switchKls\" :style=\"styles\" @click.prevent=\"switchValue\">\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"ns.e('input')\"\n type=\"checkbox\"\n role=\"switch\"\n :aria-checked=\"checked\"\n :aria-disabled=\"switchDisabled\"\n :aria-label=\"label\"\n :name=\"name\"\n :true-value=\"activeValue\"\n :false-value=\"inactiveValue\"\n :disabled=\"switchDisabled || switchViewMode\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @keydown.enter=\"switchValue\"\n />\n <span\n v-if=\"!inlinePrompt && (inactiveIcon || inactiveText)\"\n :class=\"labelLeftKls\"\n >\n <el-icon v-if=\"inactiveIcon\">\n <component :is=\"inactiveIcon\" />\n </el-icon>\n <span v-if=\"!inactiveIcon && inactiveText\" :aria-hidden=\"checked\">{{\n inactiveText\n }}</span>\n </span>\n <span ref=\"core\" :class=\"ns.e('core')\" :style=\"coreStyle\">\n <div v-if=\"inlinePrompt\" :class=\"ns.e('inner')\">\n <template v-if=\"activeIcon || inactiveIcon\">\n <el-icon :class=\"ns.is('icon')\">\n <component :is=\"checked ? activeIcon : inactiveIcon\" />\n </el-icon>\n </template>\n <template v-else-if=\"activeText || inactiveText\">\n <span :class=\"ns.is('text')\" :aria-hidden=\"!checked\">\n {{ checked ? activeText : inactiveText }}\n </span>\n </template>\n </div>\n <div :class=\"ns.e('action')\">\n <el-icon v-if=\"loading\" :class=\"ns.is('loading')\">\n <loading />\n </el-icon>\n <el-icon v-else-if=\"activeActionIcon && checked\">\n <component :is=\"activeActionIcon\" />\n </el-icon>\n <el-icon v-else-if=\"inactiveActionIcon && !checked\">\n <component :is=\"inactiveActionIcon\" />\n </el-icon>\n </div>\n </span>\n <span\n v-if=\"!inlinePrompt && (activeIcon || activeText)\"\n :class=\"labelRightKls\"\n >\n <el-icon v-if=\"activeIcon\">\n <component :is=\"activeIcon\" />\n </el-icon>\n <span v-if=\"!activeIcon && activeText\" :aria-hidden=\"!checked\">{{\n activeText\n }}</span>\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n ref,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport { isPromise } from '@vue/shared'\nimport { addUnit, debugWarn, isBoolean, throwError } from '@element-plus/utils'\nimport ElIcon from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize, useFormViewMode\n} from '@element-plus/components/form'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { switchEmits, switchProps } from './switch'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElSwitch'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(switchProps)\nconst emit = defineEmits(switchEmits)\n\nconst vm = getCurrentInstance()!\nconst { formItem } = useFormItem()\nconst switchSize = useFormSize()\nconst ns = useNamespace('switch')\n\nconst useBatchDeprecated = (list: string[][]) => {\n list.forEach((param) => {\n useDeprecated(\n {\n from: param[0],\n replacement: param[1],\n scope: COMPONENT_NAME,\n version: '2.3.0',\n ref: 'https://element-plus.org/en-US/component/switch.html#attributes',\n type: 'Attribute',\n },\n computed(() => !!vm.vnode.props?.[param[2]])\n )\n })\n}\nuseBatchDeprecated([\n ['\"value\"', '\"model-value\" or \"v-model\"', 'value'],\n ['\"active-color\"', 'CSS var `--el-switch-on-color`', 'activeColor'],\n ['\"inactive-color\"', 'CSS var `--el-switch-off-color`', 'inactiveColor'],\n ['\"border-color\"', 'CSS var `--el-switch-border-color`', 'borderColor'],\n])\n\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst switchDisabled = useFormDisabled(computed(() => props.loading))\nconst switchViewMode = useFormViewMode()\nconst isControlled = ref(props.modelValue !== false)\nconst input = ref<HTMLInputElement>()\nconst core = ref<HTMLSpanElement>()\n\nconst switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is('disabled', switchDisabled.value),\n ns.is('view-mode', !!switchViewMode.value),\n ns.is('checked', checked.value),\n])\n\nconst labelLeftKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'left'),\n ns.is('active', !checked.value),\n])\n\nconst labelRightKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'right'),\n ns.is('active', checked.value),\n])\n\nconst coreStyle = computed<CSSProperties>(() => ({\n width: addUnit(props.width),\n}))\n\nwatch(\n () => props.modelValue,\n () => {\n isControlled.value = true\n }\n)\n\nwatch(\n () => props.value,\n () => {\n isControlled.value = false\n }\n)\n\nconst actualValue = computed(() => {\n return isControlled.value ? props.modelValue : props.value\n})\n\nconst checked = computed(() => actualValue.value === props.activeValue)\n\nif (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue)\n emit(CHANGE_EVENT, props.inactiveValue)\n emit(INPUT_EVENT, props.inactiveValue)\n}\n\nwatch(checked, (val) => {\n input.value!.checked = val\n\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n})\n\nconst handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n emit(INPUT_EVENT, val)\n nextTick(() => {\n input.value!.checked = checked.value\n })\n}\n\nconst switchValue = () => {\n if (switchDisabled.value || switchViewMode.value) return\n\n const { beforeChange } = props\n if (!beforeChange) {\n handleChange()\n return\n }\n\n const shouldChange = beforeChange()\n\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange),\n ].includes(true)\n if (!isPromiseOrBool) {\n throwError(\n COMPONENT_NAME,\n 'beforeChange must return type `Promise<boolean>` or `boolean`'\n )\n }\n\n if (isPromise(shouldChange)) {\n shouldChange\n .then((result) => {\n if (result) {\n handleChange()\n }\n })\n .catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`)\n })\n } else if (shouldChange) {\n handleChange()\n }\n}\n\nconst styles = computed(() => {\n return ns.cssVarBlock({\n ...(props.activeColor ? { 'on-color': props.activeColor } : null),\n ...(props.inactiveColor ? { 'off-color': props.inactiveColor } : null),\n ...(props.borderColor ? { 'border-color': props.borderColor } : null),\n })\n})\n\nconst focus = (): void => {\n input.value?.focus?.()\n}\n\nonMounted(() => {\n input.value!.checked = checked.value\n})\n\ndefineExpose({\n /**\n * @description manual focus to the switch component\n **/\n focus,\n /**\n * @description whether Switch is checked\n */\n checked,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;mCAkGc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAA,MAAM,KAAK,kBAAmB,EAAA,CAAA;AAC9B,IAAM,MAAA,EAAE,aAAa,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,aAAa,WAAY,EAAA,CAAA;AAC/B,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,kBAAA,GAAqB,CAAC,IAAqB,KAAA;AAC/C,MAAK,IAAA,CAAA,OAAA,CAAQ,CAAC,KAAU,KAAA;AACtB,QACE,aAAA,CAAA;AAAA,UACE,MAAM,KAAM,CAAA,CAAA,CAAA;AAAA,UACZ,aAAa,KAAM,CAAA,CAAA,CAAA;AAAA,UACnB,KAAO,EAAA,cAAA;AAAA,UACP,OAAS,EAAA,OAAA;AAAA,UACT,GAAK,EAAA,iEAAA;AAAA,UACL,IAAM,EAAA,WAAA;AAAA,SACR,EACA,QAAS,CAAA,MAAM;AACjB,UACD,IAAA,EAAA,CAAA;AAAA,UACH,OAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,SAAmB,CAAA,CAAA,CAAA;AAAA,OAChB,CAAW,CAAA;AAAqC,KACjD,CAAA;AAAkE,IAClE,kBAAqB,CAAA;AAAkD,MACvE,CAAC,SAAkB,EAAA,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AAA,IAIA,SAAA,CAAA,MAAA;AAAA,MACD,KAAA,CAAA,KAAA,CAAA,OAAA,GAAA,OAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT, viewModes\n} from '@element-plus/constants'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type Switch from './switch.vue'\nimport type { ExtractPropTypes, PropType } from 'vue'\n\nexport const switchProps = buildProps({\n /**\n * @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type\n */\n modelValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description whether Switch is disabled\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * @description 浏览模式\n */\n viewMode: {\n type: String,\n values: viewModes\n },\n /**\n * @description whether Switch is in loading state\n */\n loading: {\n type: Boolean,\n default: false,\n },\n /**\n * @description size of Switch\n */\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n /**\n * @description width of Switch\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether icon or text is displayed inside dot, only the first character will be rendered for text\n */\n inlinePrompt: {\n type: Boolean,\n default: false,\n },\n /**\n * @description component of the icon displayed in action when in `off` state\n */\n inactiveActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed in action when in `on` state\n */\n activeActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `on` state, overrides `active-text`\n */\n activeIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `off` state, overrides `inactive-text`\n */\n inactiveIcon: {\n type: iconPropType,\n },\n /**\n * @description text displayed when in `on` state\n */\n activeText: {\n type: String,\n default: '',\n },\n /**\n * @description text displayed when in `off` state\n */\n inactiveText: {\n type: String,\n default: '',\n },\n /**\n * @description switch value when in `on` state\n */\n activeValue: {\n type: [Boolean, String, Number],\n default: true,\n },\n /**\n * @description switch value when in `off` state\n */\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @deprecated background color when in `on` state ( deprecated, use CSS var `--el-switch-on-color` instead )\n */\n activeColor: {\n type: String,\n default: '',\n },\n /**\n * @deprecated background color when in `off` state ( deprecated, use CSS var `--el-switch-off-color` instead )\n */\n inactiveColor: {\n type: String,\n default: '',\n },\n /**\n * @deprecated border color of the switch ( deprecated, use CSS var `--el-switch-border-color` instead )\n */\n borderColor: {\n type: String,\n default: '',\n },\n /**\n * @description input name of Switch\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching\n */\n beforeChange: {\n type: definePropType<() => Promise<boolean> | boolean>(Function),\n },\n /**\n * @description id for input\n */\n id: String,\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n },\n /**\n * @deprecated binding value ( deprecated, use `model-value / v-model` instead )\n */\n value: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description native input aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n} as const)\n\nexport type SwitchProps = ExtractPropTypes<typeof switchProps>\n\nexport const switchEmits = {\n [UPDATE_MODEL_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n}\nexport type SwitchEmits = typeof switchEmits\n\nexport type SwitchInstance = InstanceType<typeof Switch>\n"],"names":[],"mappings":";;;;;;;;;;AAeY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,SAAS;AACrB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,E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,CAAC;AACnB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC1E;;;;"}
|
|
@@ -5,6 +5,7 @@ import { orderBy, getKeysMap, toggleRowStatus, getRowIdentity, getColumnById, ge
|
|
|
5
5
|
import useExpand from './expand.mjs';
|
|
6
6
|
import useCurrent from './current.mjs';
|
|
7
7
|
import useTree from './tree.mjs';
|
|
8
|
+
import { RenderLen } from '../table-body/defaults.mjs';
|
|
8
9
|
import { watch } from '../../../config-provider/src/for-editor.mjs';
|
|
9
10
|
import { hasOwn } from '@vue/shared';
|
|
10
11
|
|
|
@@ -382,7 +383,6 @@ function useWatcher() {
|
|
|
382
383
|
const rows = instance.setupState.scrollBarRef.wrapRef.querySelectorAll(".el-table .el-table__body tbody>tr");
|
|
383
384
|
if (rows.length > 0) {
|
|
384
385
|
const wrapRect = instance.setupState.scrollBarRef.wrapRef.getBoundingClientRect();
|
|
385
|
-
const wrapStart = wrapRect.y;
|
|
386
386
|
const wrapEnd = wrapRect.y + wrapRect.height;
|
|
387
387
|
let firstIndex = -1;
|
|
388
388
|
let lastIndex = -1;
|
|
@@ -390,23 +390,50 @@ function useWatcher() {
|
|
|
390
390
|
if (lastRect.y + lastRect.height < wrapEnd) {
|
|
391
391
|
lastIndex = rows.length - 1;
|
|
392
392
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
393
|
+
let firstRow = null;
|
|
394
|
+
let lastRow = null;
|
|
395
|
+
const firstCell = document.elementFromPoint(wrapRect.x + 5, wrapRect.y + 5);
|
|
396
|
+
if (firstCell.nodeName === "TD") {
|
|
397
|
+
firstRow = firstCell.parentElement;
|
|
398
|
+
} else if (firstCell.nodeName === "TR") {
|
|
399
|
+
firstRow = firstCell;
|
|
400
|
+
}
|
|
401
|
+
const lastCell = document.elementFromPoint(wrapRect.x + 5, wrapRect.y + wrapRect.height - 5);
|
|
402
|
+
if (lastCell.nodeName === "TD") {
|
|
403
|
+
lastRow = lastCell.parentElement;
|
|
404
|
+
} else if (lastCell.nodeName === "TR") {
|
|
405
|
+
lastRow = lastCell;
|
|
406
|
+
}
|
|
407
|
+
if (firstRow && lastRow) {
|
|
408
|
+
firstIndex = parseInt(firstRow.getAttribute("row-index"));
|
|
409
|
+
lastIndex = parseInt(lastRow.getAttribute("row-index"));
|
|
404
410
|
}
|
|
405
411
|
if (firstIndex !== -1 && lastIndex !== -1) {
|
|
406
412
|
if (firstIndex !== oldRenderRange.value[0] || lastIndex !== oldRenderRange.value[1]) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
413
|
+
let startIndex = firstIndex;
|
|
414
|
+
let beforeCount = 0;
|
|
415
|
+
while (startIndex > 0 && beforeCount < RenderLen) {
|
|
416
|
+
const beforeRow = rows[startIndex - 1];
|
|
417
|
+
if (beforeRow.style.display !== "none") {
|
|
418
|
+
startIndex -= 1;
|
|
419
|
+
beforeCount += 1;
|
|
420
|
+
} else {
|
|
421
|
+
startIndex -= 1;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
let endIndex = lastIndex;
|
|
425
|
+
let afterCount = 0;
|
|
426
|
+
while (endIndex < rows.length - 1 && afterCount < RenderLen) {
|
|
427
|
+
const afterRow = rows[endIndex + 1];
|
|
428
|
+
if (afterRow.style.display !== "none") {
|
|
429
|
+
endIndex += 1;
|
|
430
|
+
afterCount += 1;
|
|
431
|
+
} else {
|
|
432
|
+
endIndex += 1;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
renderRange.value[0] = startIndex;
|
|
436
|
+
renderRange.value[1] = endIndex;
|
|
410
437
|
renderRange.value[2] = (rows[firstIndex].getBoundingClientRect().height + rows[lastIndex].getBoundingClientRect().height) / 2;
|
|
411
438
|
oldRenderRange.value[0] = firstIndex;
|
|
412
439
|
oldRenderRange.value[1] = lastIndex;
|