beyond-webui 1.1.36 → 1.1.38
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +26 -117
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +117 -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 +96 -36
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +36 -96
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +32 -67
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +67 -32
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/button/index.mjs +3 -3
- package/es/components/button/src/button-group.mjs +6 -30
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +30 -6
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/button/src/button.mjs +76 -57
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +57 -76
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/src/calendar.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +87 -33
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +33 -87
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +35 -16
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +16 -35
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +8 -63
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +63 -8
- package/es/components/carousel/src/carousel-item2.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/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +30 -12
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +12 -30
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox.mjs +117 -49
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +49 -117
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +62 -10
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +10 -62
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +38 -321
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +321 -38
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +64 -7
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +7 -64
- package/es/components/descriptions/src/descriptions-row2.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/dropdown/src/dropdown-item-impl.mjs +2 -2
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +1 -1
- package/es/components/form/index.mjs +4 -4
- package/es/components/form/src/form-item.mjs +317 -43
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +43 -317
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/form/src/form.mjs +55 -152
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +152 -55
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +36 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -36
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +396 -39
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +39 -396
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +28 -28
- package/es/components/input-number/index.mjs +2 -2
- package/es/components/input-number/src/input-number.mjs +311 -58
- package/es/components/input-number/src/input-number.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +58 -311
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +103 -17
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +17 -103
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +19 -58
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +58 -19
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +17 -214
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +214 -17
- package/es/components/pagination/src/components/pager2.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/index.mjs +2 -2
- package/es/components/popover/src/popover.mjs +111 -66
- package/es/components/popover/src/popover.mjs.map +1 -1
- package/es/components/popover/src/popover2.mjs +66 -111
- package/es/components/popover/src/popover2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/popper.mjs +32 -25
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +25 -32
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +64 -9
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +9 -64
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +29 -63
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +63 -29
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/roving-focus-group/index.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +29 -27
- package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -29
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +30 -45
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +45 -30
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +4 -4
- package/es/components/skeleton/src/skeleton-item.mjs +18 -23
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs +49 -22
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +22 -49
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/index.mjs +2 -2
- package/es/components/slider/src/button.mjs +21 -93
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +93 -21
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider.mjs +233 -91
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +91 -233
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/item.mjs +188 -19
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/steps/src/item2.mjs +19 -188
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +1 -1
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +75 -7
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +7 -75
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +3 -3
- package/es/components/tooltip-v2/src/root.mjs +17 -80
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +80 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +73 -20
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +20 -73
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +128 -19
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +19 -128
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +105 -119
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +119 -105
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +28 -28
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +27 -117
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +117 -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 +95 -37
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +37 -95
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +33 -67
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +67 -33
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/button/index.js +3 -3
- package/lib/components/button/src/button-group.js +6 -30
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +30 -6
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/button/src/button.js +76 -60
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +60 -76
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/src/calendar.js +1 -1
- package/lib/components/calendar/src/date-table.js +87 -37
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +37 -87
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +35 -16
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +16 -35
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +8 -63
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +63 -8
- package/lib/components/carousel/src/carousel-item2.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/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +30 -13
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +13 -30
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox.js +117 -50
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +50 -117
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +62 -9
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +9 -62
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +38 -319
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +319 -38
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +64 -7
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +7 -64
- package/lib/components/descriptions/src/descriptions-row2.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/dropdown/src/dropdown-item-impl.js +2 -2
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/dropdown/src/dropdown2.js +1 -1
- package/lib/components/form/index.js +4 -4
- package/lib/components/form/src/form-item.js +321 -44
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +44 -321
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/form/src/form.js +55 -151
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +151 -55
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +36 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -36
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +396 -40
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +40 -396
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +28 -28
- package/lib/components/input-number/index.js +2 -2
- package/lib/components/input-number/src/input-number.js +309 -57
- package/lib/components/input-number/src/input-number.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +57 -309
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +103 -18
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +18 -103
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +19 -58
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +58 -19
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +17 -214
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +214 -17
- package/lib/components/pagination/src/components/pager2.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/index.js +2 -2
- package/lib/components/popover/src/popover.js +111 -67
- package/lib/components/popover/src/popover.js.map +1 -1
- package/lib/components/popover/src/popover2.js +67 -111
- package/lib/components/popover/src/popover2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/popper.js +32 -28
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +28 -32
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +64 -9
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +9 -64
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +31 -63
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +63 -31
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/roving-focus-group/index.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +33 -27
- package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group2.js +27 -33
- package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +32 -45
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +45 -32
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb.js +1 -1
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/skeleton/index.js +4 -4
- package/lib/components/skeleton/src/skeleton-item.js +18 -23
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +23 -18
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js +49 -22
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +22 -49
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/index.js +2 -2
- package/lib/components/slider/src/button.js +22 -93
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +93 -22
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider.js +233 -92
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider2.js +92 -233
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/item.js +188 -19
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/steps/src/item2.js +19 -188
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +1 -1
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +75 -7
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +7 -75
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/index.js +3 -3
- package/lib/components/tooltip-v2/src/root.js +17 -80
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +80 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +73 -20
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +20 -73
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +128 -21
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +21 -128
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +108 -119
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +119 -108
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +28 -28
- package/package.json +1 -1
|
@@ -2,197 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
require('../../../hooks/index.js');
|
|
7
|
-
var index$1 = require('../../icon/index.js');
|
|
8
|
-
var iconsVue = require('@element-plus/icons-vue');
|
|
9
5
|
require('../../../utils/index.js');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
|
-
var types = require('../../../utils/types.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var icon = require('../../../utils/vue/icon.js');
|
|
14
8
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
() => parent.props.active,
|
|
32
|
-
() => parent.props.processStatus,
|
|
33
|
-
() => parent.props.finishStatus
|
|
34
|
-
], ([active]) => {
|
|
35
|
-
updateStatus(active);
|
|
36
|
-
}, { immediate: true });
|
|
37
|
-
});
|
|
38
|
-
vue.onBeforeUnmount(() => {
|
|
39
|
-
parent.steps.value = parent.steps.value.filter((instance) => instance.uid !== (currentInstance == null ? void 0 : currentInstance.uid));
|
|
40
|
-
});
|
|
41
|
-
const currentStatus = vue.computed(() => {
|
|
42
|
-
return props.status || internalStatus.value;
|
|
43
|
-
});
|
|
44
|
-
const prevStatus = vue.computed(() => {
|
|
45
|
-
const prevStep = parent.steps.value[index$2.value - 1];
|
|
46
|
-
return prevStep ? prevStep.currentStatus : "wait";
|
|
47
|
-
});
|
|
48
|
-
const isCenter = vue.computed(() => {
|
|
49
|
-
return parent.props.alignCenter;
|
|
50
|
-
});
|
|
51
|
-
const isVertical = vue.computed(() => {
|
|
52
|
-
return parent.props.direction === "vertical";
|
|
53
|
-
});
|
|
54
|
-
const isSimple = vue.computed(() => {
|
|
55
|
-
return parent.props.simple;
|
|
56
|
-
});
|
|
57
|
-
const stepsCount = vue.computed(() => {
|
|
58
|
-
return parent.steps.value.length;
|
|
59
|
-
});
|
|
60
|
-
const isLast = vue.computed(() => {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = parent.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.uid) === (currentInstance == null ? void 0 : currentInstance.uid);
|
|
63
|
-
});
|
|
64
|
-
const space = vue.computed(() => {
|
|
65
|
-
return isSimple.value ? "" : parent.props.space;
|
|
66
|
-
});
|
|
67
|
-
const style = vue.computed(() => {
|
|
68
|
-
const style2 = {
|
|
69
|
-
flexBasis: types.isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%`
|
|
70
|
-
};
|
|
71
|
-
if (isVertical.value)
|
|
72
|
-
return style2;
|
|
73
|
-
if (isLast.value) {
|
|
74
|
-
style2.maxWidth = `${100 / stepsCount.value}%`;
|
|
75
|
-
}
|
|
76
|
-
return style2;
|
|
77
|
-
});
|
|
78
|
-
const setIndex = (val) => {
|
|
79
|
-
index$2.value = val;
|
|
80
|
-
};
|
|
81
|
-
const calcProgress = (status) => {
|
|
82
|
-
const isWait = status === "wait";
|
|
83
|
-
const style2 = {
|
|
84
|
-
transitionDelay: `${isWait ? "-" : ""}${150 * index$2.value}ms`
|
|
85
|
-
};
|
|
86
|
-
const step = status === parent.props.processStatus || isWait ? 0 : 100;
|
|
87
|
-
style2.borderWidth = step && !isSimple.value ? "1px" : 0;
|
|
88
|
-
style2[parent.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
|
|
89
|
-
lineStyle.value = style2;
|
|
90
|
-
};
|
|
91
|
-
const updateStatus = (activeIndex) => {
|
|
92
|
-
if (activeIndex > index$2.value) {
|
|
93
|
-
internalStatus.value = parent.props.finishStatus;
|
|
94
|
-
} else if (activeIndex === index$2.value && prevStatus.value !== "error") {
|
|
95
|
-
internalStatus.value = parent.props.processStatus;
|
|
96
|
-
} else {
|
|
97
|
-
internalStatus.value = "wait";
|
|
98
|
-
}
|
|
99
|
-
const prevChild = parent.steps.value[index$2.value - 1];
|
|
100
|
-
if (prevChild)
|
|
101
|
-
prevChild.calcProgress(internalStatus.value);
|
|
102
|
-
};
|
|
103
|
-
const stepItemState = vue.reactive({
|
|
104
|
-
uid: vue.computed(() => currentInstance == null ? void 0 : currentInstance.uid),
|
|
105
|
-
currentStatus,
|
|
106
|
-
setIndex,
|
|
107
|
-
calcProgress
|
|
108
|
-
});
|
|
109
|
-
parent.steps.value = [...parent.steps.value, stepItemState];
|
|
110
|
-
return (_ctx, _cache) => {
|
|
111
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
112
|
-
style: vue.normalizeStyle(vue.unref(style)),
|
|
113
|
-
class: vue.normalizeClass([
|
|
114
|
-
vue.unref(ns).b(),
|
|
115
|
-
vue.unref(ns).is(vue.unref(isSimple) ? "simple" : vue.unref(parent).props.direction),
|
|
116
|
-
vue.unref(ns).is("flex", vue.unref(isLast) && !vue.unref(space) && !vue.unref(isCenter)),
|
|
117
|
-
vue.unref(ns).is("center", vue.unref(isCenter) && !vue.unref(isVertical) && !vue.unref(isSimple))
|
|
118
|
-
])
|
|
119
|
-
}, [
|
|
120
|
-
vue.createCommentVNode(" icon & line "),
|
|
121
|
-
vue.createElementVNode("div", {
|
|
122
|
-
class: vue.normalizeClass([vue.unref(ns).e("head"), vue.unref(ns).is(vue.unref(currentStatus))])
|
|
123
|
-
}, [
|
|
124
|
-
!vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
125
|
-
key: 0,
|
|
126
|
-
class: vue.normalizeClass(vue.unref(ns).e("line"))
|
|
127
|
-
}, [
|
|
128
|
-
vue.createElementVNode("i", {
|
|
129
|
-
class: vue.normalizeClass(vue.unref(ns).e("line-inner")),
|
|
130
|
-
style: vue.normalizeStyle(lineStyle.value)
|
|
131
|
-
}, null, 6)
|
|
132
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
133
|
-
vue.createElementVNode("div", {
|
|
134
|
-
class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(ns).is(_ctx.icon || _ctx.$slots.icon ? "icon" : "text")])
|
|
135
|
-
}, [
|
|
136
|
-
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
137
|
-
_ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
138
|
-
key: 0,
|
|
139
|
-
class: vue.normalizeClass(vue.unref(ns).e("icon-inner"))
|
|
140
|
-
}, {
|
|
141
|
-
default: vue.withCtx(() => [
|
|
142
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
143
|
-
]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["class"])) : vue.unref(currentStatus) === "success" ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
146
|
-
key: 1,
|
|
147
|
-
class: vue.normalizeClass([vue.unref(ns).e("icon-inner"), vue.unref(ns).is("status")])
|
|
148
|
-
}, {
|
|
149
|
-
default: vue.withCtx(() => [
|
|
150
|
-
vue.createVNode(vue.unref(iconsVue.Check))
|
|
151
|
-
]),
|
|
152
|
-
_: 1
|
|
153
|
-
}, 8, ["class"])) : vue.unref(currentStatus) === "error" ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
154
|
-
key: 2,
|
|
155
|
-
class: vue.normalizeClass([vue.unref(ns).e("icon-inner"), vue.unref(ns).is("status")])
|
|
156
|
-
}, {
|
|
157
|
-
default: vue.withCtx(() => [
|
|
158
|
-
vue.createVNode(vue.unref(iconsVue.Close))
|
|
159
|
-
]),
|
|
160
|
-
_: 1
|
|
161
|
-
}, 8, ["class"])) : !vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
162
|
-
key: 3,
|
|
163
|
-
class: vue.normalizeClass(vue.unref(ns).e("icon-inner"))
|
|
164
|
-
}, vue.toDisplayString(index$2.value + 1), 3)) : vue.createCommentVNode("v-if", true)
|
|
165
|
-
])
|
|
166
|
-
], 2)
|
|
167
|
-
], 2),
|
|
168
|
-
vue.createCommentVNode(" title & description "),
|
|
169
|
-
vue.createElementVNode("div", {
|
|
170
|
-
class: vue.normalizeClass(vue.unref(ns).e("main"))
|
|
171
|
-
}, [
|
|
172
|
-
vue.createElementVNode("div", {
|
|
173
|
-
class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(ns).is(vue.unref(currentStatus))])
|
|
174
|
-
}, [
|
|
175
|
-
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
176
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
177
|
-
])
|
|
178
|
-
], 2),
|
|
179
|
-
vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
180
|
-
key: 0,
|
|
181
|
-
class: vue.normalizeClass(vue.unref(ns).e("arrow"))
|
|
182
|
-
}, null, 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
183
|
-
key: 1,
|
|
184
|
-
class: vue.normalizeClass([vue.unref(ns).e("description"), vue.unref(ns).is(vue.unref(currentStatus))])
|
|
185
|
-
}, [
|
|
186
|
-
vue.renderSlot(_ctx.$slots, "description", {}, () => [
|
|
187
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
|
|
188
|
-
])
|
|
189
|
-
], 2))
|
|
190
|
-
], 2)
|
|
191
|
-
], 6);
|
|
192
|
-
};
|
|
9
|
+
const stepProps = runtime.buildProps({
|
|
10
|
+
title: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
icon: {
|
|
15
|
+
type: icon.iconPropType
|
|
16
|
+
},
|
|
17
|
+
description: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
type: String,
|
|
23
|
+
values: ["", "wait", "process", "finish", "error", "success"],
|
|
24
|
+
default: ""
|
|
193
25
|
}
|
|
194
26
|
});
|
|
195
|
-
var Step = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\beyondtrucks\\beyond-ui\\packages\\components\\steps\\src\\item.vue"]]);
|
|
196
27
|
|
|
197
|
-
exports
|
|
28
|
+
exports.stepProps = stepProps;
|
|
198
29
|
//# sourceMappingURL=item2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item2.js","sources":["../../../../../../packages/components/steps/src/item.
|
|
1
|
+
{"version":3,"file":"item2.js","sources":["../../../../../../packages/components/steps/src/item.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\nimport type Step from './item.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const stepProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n icon: {\n type: iconPropType,\n },\n description: {\n type: String,\n default: '',\n },\n status: {\n type: String,\n values: ['', 'wait', 'process', 'finish', 'error', 'success'],\n default: '',\n },\n} as const)\n\nexport type StepProps = ExtractPropTypes<typeof stepProps>\n\nexport type StepInstance = InstanceType<typeof Step>\n"],"names":["buildProps","iconPropType"],"mappings":";;;;;;;;AACY,MAAC,SAAS,GAAGA,kBAAU,CAAC;AACpC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AACjE,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}
|
|
@@ -44,7 +44,7 @@ function useEvent(props, emit) {
|
|
|
44
44
|
const tableLeft = tableEl.getBoundingClientRect().left;
|
|
45
45
|
const columnEl = instance.vnode.el.querySelector(`th.${column.id}`);
|
|
46
46
|
const columnRect = columnEl.getBoundingClientRect();
|
|
47
|
-
const minLeft = columnRect.left - tableLeft + Math.max(Math.ceil(size.measureStringPixelSize(column.label)) +
|
|
47
|
+
const minLeft = columnRect.left - tableLeft + Math.max(Math.ceil(size.measureStringPixelSize(column.label)) + 55, 30);
|
|
48
48
|
style.addClass(columnEl, "noclick");
|
|
49
49
|
dragState.value = {
|
|
50
50
|
startMouseLeft: event.clientX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement, measureStringPixelSize,\n removeClass\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useEvent<T>(props: TableHeaderProps<T>, emit) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (event: Event, column: TableColumnCtx<T>) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (event: Event, column: TableColumnCtx<T>) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref(null)\n const dragging = ref(false)\n const dragState = ref({})\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (draggingColumn.value && props.border) {\n dragging.value = true\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl.getBoundingClientRect().left\n const columnEl = instance.vnode.el.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft =\n columnRect.left -\n tableLeft +\n Math.max(Math.ceil(measureStringPixelSize(column.label)) + 30, 30)\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function() {\n return false\n }\n document.ondragstart = function() {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = {}\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (column.children && column.children.length > 0) return\n const el = event.target as HTMLElement\n if (!isElement(el)) {\n return\n }\n const target = el?.closest('th')\n\n if (!column || !column.resizable) return\n\n if (!dragging.value && props.border) {\n const rect = target.getBoundingClientRect()\n\n const bodyStyle = document.body.style\n if (rect.width > 12 && rect.right - event.pageX < 8) {\n bodyStyle.cursor = 'col-resize'\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'col-resize'\n }\n draggingColumn.value = column\n } else if (!dragging.value) {\n bodyStyle.cursor = ''\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'pointer'\n }\n draggingColumn.value = null\n }\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }) => {\n if (order === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder: string | boolean\n ) => {\n event.stopPropagation()\n const order =\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && sortingColumn.order === null)\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick\n }\n}\n\nexport default useEvent\n"],"names":["getCurrentInstance","inject","TABLE_INJECTION_KEY","ref","isClient","measureStringPixelSize","addClass","removeClass","isElement","hasClass"],"mappings":";;;;;;;;;;;;AAUA,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;AAC/B,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK;AACvC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB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C,KAAK,KAAK,IAAI,EAAE;AAC9F,MAAM,IAAI,aAAa,EAAE;AACzB,QAAQ,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC;AACnC,OAAO;AACP,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,GAAG,MAAM,CAAC;AAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACjC,KAAK;AACL,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;AACtC,KAAK,MAAM;AACX,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;AACrC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC;AACvC,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"event-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement,\n measureStringPixelSize,\n removeClass,\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useEvent<T>(props: TableHeaderProps<T>, emit) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (event: Event, column: TableColumnCtx<T>) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (event: Event, column: TableColumnCtx<T>) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref(null)\n const dragging = ref(false)\n const dragState = ref({})\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (draggingColumn.value && props.border) {\n dragging.value = true\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl.getBoundingClientRect().left\n const columnEl = instance.vnode.el.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft =\n columnRect.left -\n tableLeft +\n Math.max(Math.ceil(measureStringPixelSize(column.label)) + 55, 30)\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft,\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function () {\n return false\n }\n document.ondragstart = function () {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = {}\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (column.children && column.children.length > 0) return\n const el = event.target as HTMLElement\n if (!isElement(el)) {\n return\n }\n const target = el?.closest('th')\n\n if (!column || !column.resizable) return\n\n if (!dragging.value && props.border) {\n const rect = target.getBoundingClientRect()\n\n const bodyStyle = document.body.style\n if (rect.width > 12 && rect.right - event.pageX < 8) {\n bodyStyle.cursor = 'col-resize'\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'col-resize'\n }\n draggingColumn.value = column\n } else if (!dragging.value) {\n bodyStyle.cursor = ''\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'pointer'\n }\n draggingColumn.value = null\n }\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }) => {\n if (order === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder: string | boolean\n ) => {\n event.stopPropagation()\n const order =\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && sortingColumn.order === null)\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n }\n}\n\nexport default useEvent\n"],"names":["getCurrentInstance","inject","TABLE_INJECTION_KEY","ref","isClient","measureStringPixelSize","addClass","removeClass","isElement","hasClass"],"mappings":";;;;;;;;;;;;AAUA,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;AAC/B,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK;AACvC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AAC/C,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE;AAC5C,MAAM,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;AACtD,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK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K;AACL,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;AACrC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC;AACvC,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var tabs = require('./src/tabs.js');
|
|
7
7
|
var tabPane$1 = require('./src/tab-pane2.js');
|
|
8
|
-
var tabBar = require('./src/tab-
|
|
8
|
+
var tabBar = require('./src/tab-bar2.js');
|
|
9
9
|
var tabNav = require('./src/tab-nav.js');
|
|
10
10
|
var tabPane = require('./src/tab-pane.js');
|
|
11
11
|
var constants = require('./src/constants.js');
|
|
@@ -2,16 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var constants = require('./constants.js');
|
|
10
|
+
var tabBar = require('./tab-bar2.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var error = require('../../../utils/error.js');
|
|
13
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
+
var strings = require('../../../utils/strings.js');
|
|
8
15
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
const COMPONENT_NAME = "ElTabBar";
|
|
17
|
+
const __default__ = vue.defineComponent({
|
|
18
|
+
name: COMPONENT_NAME
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: tabBar.tabBarProps,
|
|
23
|
+
setup(__props, { expose }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const instance = vue.getCurrentInstance();
|
|
26
|
+
const rootTabs = vue.inject(constants.tabsRootContextKey);
|
|
27
|
+
if (!rootTabs)
|
|
28
|
+
error.throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
|
|
29
|
+
const ns = index.useNamespace("tabs");
|
|
30
|
+
const barRef = vue.ref();
|
|
31
|
+
const barStyle = vue.ref();
|
|
32
|
+
const getBarStyle = () => {
|
|
33
|
+
let offset = 0;
|
|
34
|
+
let tabSize = 0;
|
|
35
|
+
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
|
|
36
|
+
const sizeDir = sizeName === "width" ? "x" : "y";
|
|
37
|
+
const position = sizeDir === "x" ? "left" : "top";
|
|
38
|
+
props.tabs.every((tab) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
|
|
41
|
+
if (!$el)
|
|
42
|
+
return false;
|
|
43
|
+
if (!tab.active) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
offset = $el[`offset${strings.capitalize(position)}`];
|
|
47
|
+
tabSize = $el[`client${strings.capitalize(sizeName)}`];
|
|
48
|
+
const tabStyles = window.getComputedStyle($el);
|
|
49
|
+
if (sizeName === "width") {
|
|
50
|
+
if (props.tabs.length > 1) {
|
|
51
|
+
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
|
52
|
+
}
|
|
53
|
+
offset += Number.parseFloat(tabStyles.paddingLeft);
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
[sizeName]: `${tabSize}px`,
|
|
59
|
+
transform: `translate${strings.capitalize(sizeDir)}(${offset}px)`
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const update = () => barStyle.value = getBarStyle();
|
|
63
|
+
vue.watch(() => props.tabs, async () => {
|
|
64
|
+
await vue.nextTick();
|
|
65
|
+
update();
|
|
66
|
+
}, { immediate: true });
|
|
67
|
+
core.useResizeObserver(barRef, () => update());
|
|
68
|
+
expose({
|
|
69
|
+
ref: barRef,
|
|
70
|
+
update
|
|
71
|
+
});
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
74
|
+
ref_key: "barRef",
|
|
75
|
+
ref: barRef,
|
|
76
|
+
class: vue.normalizeClass([vue.unref(ns).e("active-bar"), vue.unref(ns).is(vue.unref(rootTabs).props.tabPosition)]),
|
|
77
|
+
style: vue.normalizeStyle(barStyle.value)
|
|
78
|
+
}, null, 6);
|
|
79
|
+
};
|
|
13
80
|
}
|
|
14
81
|
});
|
|
82
|
+
var TabBar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\beyondtrucks\\beyond-ui\\packages\\components\\tabs\\src\\tab-bar.vue"]]);
|
|
15
83
|
|
|
16
|
-
exports
|
|
84
|
+
exports["default"] = TabBar;
|
|
17
85
|
//# sourceMappingURL=tab-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.vue"],"sourcesContent":["<template>\n <div\n ref=\"barRef\"\n :class=\"[ns.e('active-bar'), ns.is(rootTabs.props.tabPosition)]\"\n :style=\"barStyle\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, nextTick, ref, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { capitalize, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { tabsRootContextKey } from './constants'\nimport { tabBarProps } from './tab-bar'\n\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElTabBar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(tabBarProps)\n\nconst instance = getCurrentInstance()!\nconst rootTabs = inject(tabsRootContextKey)\nif (!rootTabs) throwError(COMPONENT_NAME, '<el-tabs><el-tab-bar /></el-tabs>')\n\nconst ns = useNamespace('tabs')\n\nconst barRef = ref<HTMLDivElement>()\nconst barStyle = ref<CSSProperties>()\n\nconst getBarStyle = (): CSSProperties => {\n let offset = 0\n let tabSize = 0\n\n const sizeName = ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ? 'width'\n : 'height'\n const sizeDir = sizeName === 'width' ? 'x' : 'y'\n const position = sizeDir === 'x' ? 'left' : 'top'\n\n props.tabs.every((tab) => {\n const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement\n if (!$el) return false\n\n if (!tab.active) {\n return true\n }\n\n offset = $el[`offset${capitalize(position)}`]\n tabSize = $el[`client${capitalize(sizeName)}`]\n\n const tabStyles = window.getComputedStyle($el)\n\n if (sizeName === 'width') {\n if (props.tabs.length > 1) {\n tabSize -=\n Number.parseFloat(tabStyles.paddingLeft) +\n Number.parseFloat(tabStyles.paddingRight)\n }\n offset += Number.parseFloat(tabStyles.paddingLeft)\n }\n return false\n })\n\n return {\n [sizeName]: `${tabSize}px`,\n transform: `translate${capitalize(sizeDir)}(${offset}px)`,\n }\n}\n\nconst update = () => (barStyle.value = getBarStyle())\n\nwatch(\n () => props.tabs,\n async () => {\n await nextTick()\n update()\n },\n { immediate: true }\n)\nuseResizeObserver(barRef, () => update())\n\ndefineExpose({\n /** @description tab root html element */\n ref: barRef,\n /** @description method to manually update tab bar style */\n update,\n})\n</script>\n"],"names":["getCurrentInstance","inject","tabsRootContextKey","throwError","useNamespace","ref","capitalize","watch","nextTick","useResizeObserver"],"mappings":";;;;;;;;;;;;;;;;uCAmBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAGA,IAAA,MAAM,WAAWA,sBAAmB,EAAA,CAAA;AACpC,IAAM,MAAA,QAAA,GAAWC,WAAOC,4BAAkB,CAAA,CAAA;AAC1C,IAAA,IAAI,CAAC,QAAA;AAAU,MAAAC,gBAAA,CAAW,gBAAgB,mCAAmC,CAAA,CAAA;AAE7E,IAAM,MAAA,EAAA,GAAKC,mBAAa,MAAM,CAAA,CAAA;AAE9B,IAAA,MAAM,SAASC,OAAoB,EAAA,CAAA;AACnC,IAAA,MAAM,WAAWA,OAAmB,EAAA,CAAA;AAEpC,IAAA,MAAM,cAAc,MAAqB;AACvC,MAAA,IAAI,MAAS,GAAA,CAAA,CAAA;AACb,MAAA,IAAI,OAAU,GAAA,CAAA,CAAA;AAEd,MAAM,MAAA,QAAA,GAAW,CAAC,KAAA,EAAO,QAAQ,CAAA,CAAE,SAAS,QAAS,CAAA,KAAA,CAAM,WAAW,CAAA,GAClE,OACA,GAAA,QAAA,CAAA;AACJ,MAAM,MAAA,OAAA,GAAU,QAAa,KAAA,OAAA,GAAU,GAAM,GAAA,GAAA,CAAA;AAC7C,MAAM,MAAA,QAAA,GAAW,OAAY,KAAA,GAAA,GAAM,MAAS,GAAA,KAAA,CAAA;AAE5C,MAAM,KAAA,CAAA,IAAA,CAAK,KAAM,CAAA,CAAC,GAAQ,KAAA;AACxB,QAAA,IAAA,EAAM,EAAM,EAAA,CAAA;AACZ,QAAA,MAAK,GAAA,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,QAAA,CAAA,MAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,C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CAAA,MAAe,KAAA,CAAA,IAAA,EAAA,YAAA;AACf,MAAO,MAAAC,YAAA,EAAA,CAAA;AAAA,MAET,MAAa,EAAA,CAAA;AAEf,KAAkB,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AAElB,IAAaC,sBAAA,CAAA,MAAA,EAAA,MAAA,MAAA,EAAA,CAAA,CAAA;AAAA,IAAA,MAEN,CAAA;AAAA,MAEL,GAAA,EAAA,MAAA;AAAA,MACD,MAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -2,84 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
10
|
-
var tabBar = require('./tab-bar.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var error = require('../../../utils/error.js');
|
|
13
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
-
var strings = require('../../../utils/strings.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var typescript = require('../../../utils/typescript.js');
|
|
15
8
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
-
...__default__,
|
|
22
|
-
props: tabBar.tabBarProps,
|
|
23
|
-
setup(__props, { expose }) {
|
|
24
|
-
const props = __props;
|
|
25
|
-
const instance = vue.getCurrentInstance();
|
|
26
|
-
const rootTabs = vue.inject(constants.tabsRootContextKey);
|
|
27
|
-
if (!rootTabs)
|
|
28
|
-
error.throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
|
|
29
|
-
const ns = index.useNamespace("tabs");
|
|
30
|
-
const barRef = vue.ref();
|
|
31
|
-
const barStyle = vue.ref();
|
|
32
|
-
const getBarStyle = () => {
|
|
33
|
-
let offset = 0;
|
|
34
|
-
let tabSize = 0;
|
|
35
|
-
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
|
|
36
|
-
const sizeDir = sizeName === "width" ? "x" : "y";
|
|
37
|
-
const position = sizeDir === "x" ? "left" : "top";
|
|
38
|
-
props.tabs.every((tab) => {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
|
|
41
|
-
if (!$el)
|
|
42
|
-
return false;
|
|
43
|
-
if (!tab.active) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
offset = $el[`offset${strings.capitalize(position)}`];
|
|
47
|
-
tabSize = $el[`client${strings.capitalize(sizeName)}`];
|
|
48
|
-
const tabStyles = window.getComputedStyle($el);
|
|
49
|
-
if (sizeName === "width") {
|
|
50
|
-
if (props.tabs.length > 1) {
|
|
51
|
-
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
|
52
|
-
}
|
|
53
|
-
offset += Number.parseFloat(tabStyles.paddingLeft);
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
[sizeName]: `${tabSize}px`,
|
|
59
|
-
transform: `translate${strings.capitalize(sizeDir)}(${offset}px)`
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
const update = () => barStyle.value = getBarStyle();
|
|
63
|
-
vue.watch(() => props.tabs, async () => {
|
|
64
|
-
await vue.nextTick();
|
|
65
|
-
update();
|
|
66
|
-
}, { immediate: true });
|
|
67
|
-
core.useResizeObserver(barRef, () => update());
|
|
68
|
-
expose({
|
|
69
|
-
ref: barRef,
|
|
70
|
-
update
|
|
71
|
-
});
|
|
72
|
-
return (_ctx, _cache) => {
|
|
73
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
74
|
-
ref_key: "barRef",
|
|
75
|
-
ref: barRef,
|
|
76
|
-
class: vue.normalizeClass([vue.unref(ns).e("active-bar"), vue.unref(ns).is(vue.unref(rootTabs).props.tabPosition)]),
|
|
77
|
-
style: vue.normalizeStyle(barStyle.value)
|
|
78
|
-
}, null, 6);
|
|
79
|
-
};
|
|
9
|
+
const tabBarProps = runtime.buildProps({
|
|
10
|
+
tabs: {
|
|
11
|
+
type: runtime.definePropType(Array),
|
|
12
|
+
default: () => typescript.mutable([])
|
|
80
13
|
}
|
|
81
14
|
});
|
|
82
|
-
var TabBar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\beyondtrucks\\beyond-ui\\packages\\components\\tabs\\src\\tab-bar.vue"]]);
|
|
83
15
|
|
|
84
|
-
exports
|
|
16
|
+
exports.tabBarProps = tabBarProps;
|
|
85
17
|
//# sourceMappingURL=tab-bar2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar2.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar2.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { TabsPaneContext } from './constants'\nimport type TabBar from './tab-bar.vue'\n\nexport const tabBarProps = buildProps({\n tabs: {\n type: definePropType<TabsPaneContext[]>(Array),\n default: () => mutable([] as const),\n },\n} as const)\n\nexport type TabBarProps = ExtractPropTypes<typeof tabBarProps>\nexport type TabBarInstance = InstanceType<typeof TabBar>\n"],"names":["buildProps","definePropType","mutable"],"mappings":";;;;;;;;AACY,MAAC,WAAW,GAAGA,kBAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -9,7 +9,7 @@ require('../../../constants/index.js');
|
|
|
9
9
|
var index$1 = require('../../icon/index.js');
|
|
10
10
|
var iconsVue = require('@element-plus/icons-vue');
|
|
11
11
|
require('../../../hooks/index.js');
|
|
12
|
-
var tabBar = require('./tab-
|
|
12
|
+
var tabBar = require('./tab-bar.js');
|
|
13
13
|
var constants = require('./constants.js');
|
|
14
14
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
15
15
|
var typescript = require('../../../utils/typescript.js');
|
|
@@ -9,7 +9,7 @@ var content = require('./content2.js');
|
|
|
9
9
|
var trigger = require('./trigger2.js');
|
|
10
10
|
var index = require('../../../hooks/use-model-toggle/index.js');
|
|
11
11
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
12
|
-
var popper = require('../../popper/src/
|
|
12
|
+
var popper = require('../../popper/src/popper2.js');
|
|
13
13
|
var arrow = require('../../popper/src/arrow.js');
|
|
14
14
|
|
|
15
15
|
const {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var tooltip$1 = require('./src/
|
|
6
|
+
var tooltip$1 = require('./src/tooltip.js');
|
|
7
7
|
var arrow = require('./src/arrow2.js');
|
|
8
8
|
var content = require('./src/content.js');
|
|
9
|
-
var root = require('./src/
|
|
10
|
-
var tooltip = require('./src/
|
|
9
|
+
var root = require('./src/root.js');
|
|
10
|
+
var tooltip = require('./src/tooltip2.js');
|
|
11
11
|
var trigger = require('./src/trigger.js');
|
|
12
12
|
var constants = require('./src/constants.js');
|
|
13
13
|
var install = require('../../utils/vue/install.js');
|