element-pe 2.2.56 → 2.2.57
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.css +1 -1
- package/dist/index.full.js +111 -38
- package/dist/index.full.min.js +21 -21
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +22 -22
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +111 -38
- package/dist/locale/fa.js +20 -20
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.js.map +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.min.mjs.map +1 -1
- package/dist/locale/fa.mjs +20 -20
- 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/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +362 -82
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +82 -362
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/avatar/src/avatar.mjs +1 -1
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/carousel/index.d.ts +10 -0
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.vue.d.ts +1 -0
- package/es/components/carousel/src/carousel-item2.mjs +7 -1
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/carousel/src/carousel.mjs +169 -56
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +8 -0
- package/es/components/carousel/src/carousel2.mjs +56 -164
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/carousel/src/constants.d.ts +1 -0
- package/es/components/carousel/src/constants.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel-item.d.ts +1 -0
- package/es/components/carousel/src/use-carousel-item.mjs +7 -5
- package/es/components/carousel/src/use-carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/use-carousel.d.ts +8 -0
- package/es/components/carousel/src/use-carousel.mjs +21 -1
- package/es/components/carousel/src/use-carousel.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +16 -16
- package/es/components/cascader/src/cascader.vue.d.ts +8 -8
- package/es/components/check-tag/index.d.ts +1 -0
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag.vue.d.ts +1 -0
- package/es/components/check-tag/src/check-tag2.mjs +3 -2
- 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/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +14 -96
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +96 -14
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +120 -27
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +27 -120
- package/es/components/descriptions/src/description2.mjs.map +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/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +2 -2
- package/es/components/dropdown/src/dropdown.mjs +105 -310
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +310 -105
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/empty/src/empty.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/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +65 -226
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +226 -65
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +26 -26
- package/es/components/input-number/index.mjs +2 -2
- package/es/components/input-number/src/input-number.mjs +318 -58
- package/es/components/input-number/src/input-number.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +58 -315
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/loading/src/service.mjs +2 -2
- package/es/components/loading/src/service.mjs.map +1 -1
- package/es/components/menu/index.mjs +4 -4
- package/es/components/menu/src/menu-item-group.mjs +4 -35
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +35 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- 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/menu/src/menu.mjs +1 -1
- package/es/components/menu/src/menu.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +149 -69
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +69 -149
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +38 -19
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +19 -38
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +17 -216
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +216 -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/popover/src/popover.mjs +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/progress/src/progress.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +36 -70
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +70 -36
- package/es/components/radio/src/radio-group2.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/index.mjs +3 -3
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/scrollbar.mjs +46 -176
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +176 -46
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -134
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +134 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +4 -0
- package/es/components/select/src/useSelect.mjs.map +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/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton-item.mjs +23 -18
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +18 -23
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +1 -1
- 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 +1 -1
- package/es/components/statistic/index.mjs +2 -2
- package/es/components/statistic/src/statistic.mjs +70 -25
- package/es/components/statistic/src/statistic.mjs.map +1 -1
- package/es/components/statistic/src/statistic2.mjs +25 -70
- package/es/components/statistic/src/statistic2.mjs.map +1 -1
- package/es/components/steps/index.d.ts +2 -0
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/item.mjs +193 -19
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -0
- package/es/components/steps/src/item2.mjs +19 -190
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +6 -2
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs +1 -1
- package/es/components/table-v2/src/renderers/cell.mjs.map +1 -1
- package/es/components/tag/index.d.ts +8 -8
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.mjs +2 -2
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag.vue.d.ts +8 -8
- package/es/components/tag/src/tag2.mjs +3 -3
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/text/index.mjs +2 -2
- package/es/components/text/src/text.mjs +22 -35
- package/es/components/text/src/text.mjs.map +1 -1
- package/es/components/text/src/text2.mjs +35 -22
- package/es/components/text/src/text2.mjs.map +1 -1
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/timeline/index.d.ts +38 -0
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +19 -0
- package/es/components/timeline/src/timeline-item2.mjs +9 -7
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +4 -4
- package/es/components/tooltip-v2/src/arrow.mjs +22 -37
- package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
- package/es/components/tooltip-v2/src/arrow2.mjs +37 -22
- package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -82
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +82 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +78 -21
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +21 -78
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +1 -1
- package/es/components/transfer/src/transfer.mjs +69 -162
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +162 -69
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/components/tree/index.d.ts +2 -2
- package/es/components/tree/src/model/useDragNode.mjs +2 -2
- package/es/components/tree/src/model/useDragNode.mjs.map +1 -1
- package/es/components/tree/src/tree.type.d.ts +1 -1
- package/es/components/tree/src/tree.vue.d.ts +1 -1
- package/es/components/tree-select/src/tree-select.mjs.map +1 -1
- package/es/components/tree-select/src/tree.mjs +20 -3
- package/es/components/tree-select/src/tree.mjs.map +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +182 -33
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +33 -178
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +26 -177
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +177 -26
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +2 -2
- package/es/components/visual-hidden/index.mjs +3 -3
- package/es/components/visual-hidden/src/visual-hidden.mjs +7 -35
- package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
- package/es/components/visual-hidden/src/visual-hidden2.mjs +35 -7
- package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
- package/es/index.mjs +26 -26
- package/es/locale/lang/fa.mjs +20 -20
- package/es/locale/lang/fa.mjs.map +1 -1
- package/es/utils/types.mjs +1 -1
- package/es/utils/types.mjs.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/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +361 -82
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +82 -361
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/avatar/src/avatar.js +1 -1
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/carousel/index.d.ts +10 -0
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -0
- package/lib/components/carousel/src/carousel-item2.js +7 -1
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/carousel/src/carousel.js +169 -57
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +8 -0
- package/lib/components/carousel/src/carousel2.js +57 -164
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/carousel/src/constants.d.ts +1 -0
- package/lib/components/carousel/src/constants.js.map +1 -1
- package/lib/components/carousel/src/use-carousel-item.d.ts +1 -0
- package/lib/components/carousel/src/use-carousel-item.js +7 -5
- package/lib/components/carousel/src/use-carousel-item.js.map +1 -1
- package/lib/components/carousel/src/use-carousel.d.ts +8 -0
- package/lib/components/carousel/src/use-carousel.js +21 -1
- package/lib/components/carousel/src/use-carousel.js.map +1 -1
- package/lib/components/cascader/index.d.ts +16 -16
- package/lib/components/cascader/src/cascader.vue.d.ts +8 -8
- package/lib/components/check-tag/index.d.ts +1 -0
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag.vue.d.ts +1 -0
- package/lib/components/check-tag/src/check-tag2.js +2 -1
- 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/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +14 -96
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +96 -14
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +120 -27
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +27 -120
- package/lib/components/descriptions/src/description2.js.map +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/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +2 -2
- package/lib/components/dropdown/src/dropdown.js +114 -310
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +310 -114
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/empty/src/empty.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/image/index.js +2 -2
- package/lib/components/image/src/image.js +65 -225
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +225 -65
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +26 -26
- package/lib/components/input-number/index.js +2 -2
- package/lib/components/input-number/src/input-number.js +316 -57
- package/lib/components/input-number/src/input-number.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +57 -313
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/loading/src/service.js +2 -2
- package/lib/components/loading/src/service.js.map +1 -1
- package/lib/components/menu/index.js +4 -4
- package/lib/components/menu/src/menu-item-group.js +4 -35
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +35 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- 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/menu/src/menu.js +1 -1
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +148 -70
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +70 -148
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +38 -19
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +19 -38
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +17 -216
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +216 -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/popover/src/popover.js +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/progress/src/progress.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +37 -70
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +70 -37
- package/lib/components/radio/src/radio-group2.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/index.js +3 -3
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/scrollbar.js +47 -176
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +176 -47
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -134
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +134 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/select/src/useSelect.js +4 -0
- package/lib/components/select/src/useSelect.js.map +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/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton-item.js +23 -18
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +18 -23
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +1 -1
- 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 +1 -1
- package/lib/components/statistic/index.js +2 -2
- package/lib/components/statistic/src/statistic.js +70 -25
- package/lib/components/statistic/src/statistic.js.map +1 -1
- package/lib/components/statistic/src/statistic2.js +25 -70
- package/lib/components/statistic/src/statistic2.js.map +1 -1
- package/lib/components/steps/index.d.ts +2 -0
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/item.js +193 -19
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -0
- package/lib/components/steps/src/item2.js +19 -190
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +6 -2
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table-v2/src/renderers/cell.js +1 -1
- package/lib/components/table-v2/src/renderers/cell.js.map +1 -1
- package/lib/components/tag/index.d.ts +8 -8
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.js +2 -2
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +8 -8
- package/lib/components/tag/src/tag2.js +3 -3
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/text/index.js +2 -2
- package/lib/components/text/src/text.js +22 -35
- package/lib/components/text/src/text.js.map +1 -1
- package/lib/components/text/src/text2.js +35 -22
- package/lib/components/text/src/text2.js.map +1 -1
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/timeline/index.d.ts +38 -0
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +19 -0
- package/lib/components/timeline/src/timeline-item2.js +8 -6
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/index.js +4 -4
- package/lib/components/tooltip-v2/src/arrow.js +23 -37
- package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
- package/lib/components/tooltip-v2/src/arrow2.js +37 -23
- package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -82
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +82 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +78 -21
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +21 -78
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +1 -1
- package/lib/components/transfer/src/transfer.js +73 -162
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +162 -73
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/components/tree/index.d.ts +2 -2
- package/lib/components/tree/src/model/useDragNode.js +2 -2
- package/lib/components/tree/src/model/useDragNode.js.map +1 -1
- package/lib/components/tree/src/tree.type.d.ts +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +1 -1
- package/lib/components/tree-select/src/tree-select.js.map +1 -1
- package/lib/components/tree-select/src/tree.js +20 -3
- package/lib/components/tree-select/src/tree.js.map +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +180 -31
- package/lib/components/upload/src/upload-content.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +31 -176
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +27 -177
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +177 -27
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +2 -2
- package/lib/components/visual-hidden/index.js +2 -2
- package/lib/components/visual-hidden/src/visual-hidden.js +7 -35
- package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
- package/lib/components/visual-hidden/src/visual-hidden2.js +35 -7
- package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
- package/lib/index.js +26 -26
- package/lib/locale/lang/fa.js +20 -20
- package/lib/locale/lang/fa.js.map +1 -1
- package/lib/utils/types.js +1 -1
- package/lib/utils/types.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/el-carousel-item.css +1 -1
- package/theme-chalk/el-carousel.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/carousel-item.scss +8 -0
- package/theme-chalk/src/carousel.scss +9 -2
- package/theme-chalk/src/image.scss +6 -6
- package/theme-chalk/src/progress.scss +10 -1
- package/theme-chalk/src/text.scss +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.js","sources":["../../../../../../packages/components/transfer/src/transfer.
|
|
1
|
+
{"version":3,"file":"transfer.js","sources":["../../../../../../packages/components/transfer/src/transfer.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, h as H, VNode } from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n filterPlaceholder: String,\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n filterable: Boolean,\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer>\n"],"names":["buildProps","definePropType","mutable","isArray","isNil","CHANGE_EVENT","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;;;;AAQY,MAAC,uBAAuB,GAAG,oBAAoB;AAC/C,MAAC,wBAAwB,GAAG,qBAAqB;AACjD,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,iBAAiB,EAAE,MAAM;AAC3B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,kBAAkB,EAAE;A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AC,KAAK,CAAC,IAAIC,mBAAK,CAAC,SAAS,EAAE;AACzH,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACF,cAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC7H,EAAE,CAACG,wBAAkB,GAAG,CAAC,KAAK,KAAKH,cAAO,CAAC,KAAK,CAAC;AACjD,EAAE,CAAC,uBAAuB,GAAG,uBAAuB;AACpD,EAAE,CAAC,wBAAwB,GAAG,uBAAuB;AACrD;;;;;;;;"}
|
|
@@ -2,82 +2,171 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../config-provider/index.js');
|
|
6
7
|
require('../../../utils/index.js');
|
|
7
|
-
require('../../../
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var index$2 = require('../../button/index.js');
|
|
10
|
+
var index$3 = require('../../icon/index.js');
|
|
11
|
+
require('../../form/index.js');
|
|
12
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
13
|
+
var transfer = require('./transfer.js');
|
|
14
|
+
require('./composables/index.js');
|
|
15
|
+
var transferPanel = require('./transfer-panel2.js');
|
|
16
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
17
|
+
var index = require('../../../hooks/use-locale/index.js');
|
|
18
|
+
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
19
|
+
var useFormItem = require('../../form/src/hooks/use-form-item.js');
|
|
20
|
+
var usePropsAlias = require('./composables/use-props-alias.js');
|
|
21
|
+
var useComputedData = require('./composables/use-computed-data.js');
|
|
22
|
+
var useCheckedChange = require('./composables/use-checked-change.js');
|
|
23
|
+
var useMove = require('./composables/use-move.js');
|
|
24
|
+
var forEditor = require('../../config-provider/src/for-editor.js');
|
|
25
|
+
var error = require('../../../utils/error.js');
|
|
26
|
+
var types = require('../../../utils/types.js');
|
|
12
27
|
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
28
|
+
const _hoisted_1 = { key: 0 };
|
|
29
|
+
const _hoisted_2 = { key: 0 };
|
|
30
|
+
const __default__ = vue.defineComponent({
|
|
31
|
+
name: "ElTransfer"
|
|
32
|
+
});
|
|
33
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
34
|
+
...__default__,
|
|
35
|
+
props: transfer.transferProps,
|
|
36
|
+
emits: transfer.transferEmits,
|
|
37
|
+
setup(__props, { expose, emit }) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const slots = vue.useSlots();
|
|
40
|
+
const { t } = index.useLocale();
|
|
41
|
+
const ns = index$1.useNamespace("transfer");
|
|
42
|
+
const { formItem } = useFormItem.useFormItem();
|
|
43
|
+
const checkedState = vue.reactive({
|
|
44
|
+
leftChecked: [],
|
|
45
|
+
rightChecked: []
|
|
46
|
+
});
|
|
47
|
+
const propsAlias = usePropsAlias.usePropsAlias(props);
|
|
48
|
+
const { sourceData, targetData } = useComputedData.useComputedData(props);
|
|
49
|
+
const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange.useCheckedChange(checkedState, emit);
|
|
50
|
+
const { addToLeft, addToRight } = useMove.useMove(props, checkedState, emit);
|
|
51
|
+
const leftPanel = vue.ref();
|
|
52
|
+
const rightPanel = vue.ref();
|
|
53
|
+
const clearQuery = (which) => {
|
|
54
|
+
switch (which) {
|
|
55
|
+
case "left":
|
|
56
|
+
leftPanel.value.query = "";
|
|
57
|
+
break;
|
|
58
|
+
case "right":
|
|
59
|
+
rightPanel.value.query = "";
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const hasButtonTexts = vue.computed(() => props.buttonTexts.length === 2);
|
|
64
|
+
const leftPanelTitle = vue.computed(() => props.titles[0] || t("el.transfer.titles.0"));
|
|
65
|
+
const rightPanelTitle = vue.computed(() => props.titles[1] || t("el.transfer.titles.1"));
|
|
66
|
+
const panelFilterPlaceholder = vue.computed(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
|
|
67
|
+
forEditor.watch(() => props.modelValue, () => {
|
|
68
|
+
var _a;
|
|
69
|
+
if (props.validateEvent) {
|
|
70
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => error.debugWarn(err));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const optionRender = vue.computed(() => (option) => {
|
|
74
|
+
if (props.renderContent)
|
|
75
|
+
return props.renderContent(vue.h, option);
|
|
76
|
+
if (slots.default)
|
|
77
|
+
return slots.default({ option });
|
|
78
|
+
return vue.h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
|
|
79
|
+
});
|
|
80
|
+
expose({
|
|
81
|
+
clearQuery,
|
|
82
|
+
leftPanel,
|
|
83
|
+
rightPanel
|
|
84
|
+
});
|
|
85
|
+
return (_ctx, _cache) => {
|
|
86
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
87
|
+
class: vue.normalizeClass(vue.unref(ns).b())
|
|
88
|
+
}, [
|
|
89
|
+
vue.createVNode(transferPanel["default"], {
|
|
90
|
+
ref_key: "leftPanel",
|
|
91
|
+
ref: leftPanel,
|
|
92
|
+
data: vue.unref(sourceData),
|
|
93
|
+
"option-render": vue.unref(optionRender),
|
|
94
|
+
placeholder: vue.unref(panelFilterPlaceholder),
|
|
95
|
+
title: vue.unref(leftPanelTitle),
|
|
96
|
+
filterable: _ctx.filterable,
|
|
97
|
+
format: _ctx.format,
|
|
98
|
+
"filter-method": _ctx.filterMethod,
|
|
99
|
+
"default-checked": _ctx.leftDefaultChecked,
|
|
100
|
+
props: props.props,
|
|
101
|
+
onCheckedChange: vue.unref(onSourceCheckedChange)
|
|
102
|
+
}, {
|
|
103
|
+
default: vue.withCtx(() => [
|
|
104
|
+
vue.renderSlot(_ctx.$slots, "left-footer")
|
|
105
|
+
]),
|
|
106
|
+
_: 3
|
|
107
|
+
}, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
|
|
108
|
+
vue.createElementVNode("div", {
|
|
109
|
+
class: vue.normalizeClass(vue.unref(ns).e("buttons"))
|
|
110
|
+
}, [
|
|
111
|
+
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
112
|
+
type: "primary",
|
|
113
|
+
class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
|
|
114
|
+
disabled: vue.unref(types.isEmpty)(checkedState.rightChecked),
|
|
115
|
+
onClick: vue.unref(addToLeft)
|
|
116
|
+
}, {
|
|
117
|
+
default: vue.withCtx(() => [
|
|
118
|
+
vue.createVNode(vue.unref(index$3.ElIcon), null, {
|
|
119
|
+
default: vue.withCtx(() => [
|
|
120
|
+
vue.createVNode(vue.unref(iconsVue.ArrowLeft))
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}),
|
|
124
|
+
!vue.unref(types.isUndefined)(_ctx.buttonTexts[0]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(_ctx.buttonTexts[0]), 1)) : vue.createCommentVNode("v-if", true)
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
}, 8, ["class", "disabled", "onClick"]),
|
|
128
|
+
vue.createVNode(vue.unref(index$2.ElButton), {
|
|
129
|
+
type: "primary",
|
|
130
|
+
class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
|
|
131
|
+
disabled: vue.unref(types.isEmpty)(checkedState.leftChecked),
|
|
132
|
+
onClick: vue.unref(addToRight)
|
|
133
|
+
}, {
|
|
134
|
+
default: vue.withCtx(() => [
|
|
135
|
+
!vue.unref(types.isUndefined)(_ctx.buttonTexts[1]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(_ctx.buttonTexts[1]), 1)) : vue.createCommentVNode("v-if", true),
|
|
136
|
+
vue.createVNode(vue.unref(index$3.ElIcon), null, {
|
|
137
|
+
default: vue.withCtx(() => [
|
|
138
|
+
vue.createVNode(vue.unref(iconsVue.ArrowRight))
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
})
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["class", "disabled", "onClick"])
|
|
145
|
+
], 2),
|
|
146
|
+
vue.createVNode(transferPanel["default"], {
|
|
147
|
+
ref_key: "rightPanel",
|
|
148
|
+
ref: rightPanel,
|
|
149
|
+
data: vue.unref(targetData),
|
|
150
|
+
"option-render": vue.unref(optionRender),
|
|
151
|
+
placeholder: vue.unref(panelFilterPlaceholder),
|
|
152
|
+
filterable: _ctx.filterable,
|
|
153
|
+
format: _ctx.format,
|
|
154
|
+
"filter-method": _ctx.filterMethod,
|
|
155
|
+
title: vue.unref(rightPanelTitle),
|
|
156
|
+
"default-checked": _ctx.rightDefaultChecked,
|
|
157
|
+
props: props.props,
|
|
158
|
+
onCheckedChange: vue.unref(onTargetCheckedChange)
|
|
159
|
+
}, {
|
|
160
|
+
default: vue.withCtx(() => [
|
|
161
|
+
vue.renderSlot(_ctx.$slots, "right-footer")
|
|
162
|
+
]),
|
|
163
|
+
_: 3
|
|
164
|
+
}, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
|
|
165
|
+
], 2);
|
|
166
|
+
};
|
|
68
167
|
}
|
|
69
168
|
});
|
|
70
|
-
|
|
71
|
-
const transferEmits = {
|
|
72
|
-
[event.CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(shared.isArray) && ["left", "right"].includes(direction),
|
|
73
|
-
[event.UPDATE_MODEL_EVENT]: (value) => shared.isArray(value),
|
|
74
|
-
[LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
|
|
75
|
-
[RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
|
|
76
|
-
};
|
|
169
|
+
var Transfer = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\transfer\\src\\transfer.vue"]]);
|
|
77
170
|
|
|
78
|
-
exports
|
|
79
|
-
exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
|
|
80
|
-
exports.transferCheckedChangeFn = transferCheckedChangeFn;
|
|
81
|
-
exports.transferEmits = transferEmits;
|
|
82
|
-
exports.transferProps = transferProps;
|
|
171
|
+
exports["default"] = Transfer;
|
|
83
172
|
//# sourceMappingURL=transfer2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.
|
|
1
|
+
{"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, h, reactive, ref, useSlots } from 'vue'\nimport { watch } from '../../config-provider'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n if (slots.default) return slots.default({ option })\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description left panel ref */\n rightPanel,\n})\n</script>\n"],"names":["useSlots","useLocale","useNamespace","useFormItem","reactive","usePropsAlias","useComputedData","useCheckedChange","useMove","ref","computed","watch","debugWarn","h"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAgFc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,EAAE,MAAMC,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,UAAU,CAAA,CAAA;AAClC,IAAM,MAAA,EAAE,aAAaC,uBAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,eAAeC,YAA+B,CAAA;AAAA,MAClD,aAAa,EAAC;AAAA,MACd,cAAc,EAAC;AAAA,KAChB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAaC,4BAAc,KAAK,CAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,UAAA,EAAY,UAAe,EAAA,GAAAC,+BAAA,CAAgB,KAAK,CAAA,CAAA;AAExD,IAAA,MAAM,EAAE,qBAAA,EAAuB,qBAA0B,EAAA,GAAAC,iCAAA,CACvD,cACA,IACF,CAAA,CAAA;AAEA,IAAA,MAAM,EAAE,SAAW,EAAA,UAAA,EAAA,GAAeC,eAAQ,CAAA,KAAA,EAAO,cAAc,IAAI,CAAA,CAAA;AAEnE,IAAA,MAAM,YAAYC,OAA2B,EAAA,CAAA;AAC7C,IAAA,MAAM,aAAaA,OAA2B,EAAA,CAAA;AAE9C,IAAM,MAAA,UAAA,GAAa,CAAC,KAA6B,KAAA;AAC/C,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A,EAAA,MAAA,CAAA,CAAA;AAAS,MAAA,IAAA,KAAO,CAAM,OAAA;AAEhC,QAAO,OACL,aACO,CAAA,EAAA,MAAA,EAAA,CAAA,CAAW;AACpB,MACD,OAAAA,KAAA,CAAA,MAAA,EAAA,MAAA,CAAA,UAAA,CAAA,KAAA,CAAA,KAAA,CAAA,IAAA,MAAA,CAAA,UAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAEX,MAAA,CAAA;AAAA,MAEA,UAAA;AAAA,MAEA,SAAA;AAAA,MACD,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -190,7 +190,7 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
190
190
|
props: {
|
|
191
191
|
children?: string | undefined;
|
|
192
192
|
label?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string) | undefined;
|
|
193
|
-
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) =>
|
|
193
|
+
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
194
194
|
isLeaf?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
195
195
|
class?: ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string | {
|
|
196
196
|
[key: string]: boolean;
|
|
@@ -637,7 +637,7 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
637
637
|
props: {
|
|
638
638
|
children?: string | undefined;
|
|
639
639
|
label?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string) | undefined;
|
|
640
|
-
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) =>
|
|
640
|
+
disabled?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
641
641
|
isLeaf?: string | ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => boolean) | undefined;
|
|
642
642
|
class?: ((data: import("./src/tree.type").TreeNodeData, node: import("./src/model/node").default) => string | {
|
|
643
643
|
[key: string]: boolean;
|
|
@@ -34,7 +34,7 @@ function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
|
|
|
34
34
|
const treeNodeDragOver = ({ event, treeNode }) => {
|
|
35
35
|
const dropNode = treeNode;
|
|
36
36
|
const oldDropNode = dragState.value.dropNode;
|
|
37
|
-
if (oldDropNode && oldDropNode !== dropNode) {
|
|
37
|
+
if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {
|
|
38
38
|
style.removeClass(oldDropNode.$el, ns.is("drop-inner"));
|
|
39
39
|
}
|
|
40
40
|
const draggingNode = dragState.value.draggingNode;
|
|
@@ -50,7 +50,7 @@ function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
|
|
|
50
50
|
dropNext = props.allowDrop(draggingNode.node, dropNode.node, "next");
|
|
51
51
|
}
|
|
52
52
|
event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
|
|
53
|
-
if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
|
|
53
|
+
if ((dropPrev || dropInner || dropNext) && (oldDropNode == null ? void 0 : oldDropNode.node.id) !== dropNode.node.id) {
|
|
54
54
|
if (oldDropNode) {
|
|
55
55
|
ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDragNode.js","sources":["../../../../../../../packages/components/tree/src/model/useDragNode.ts"],"sourcesContent":["// @ts-nocheck\nimport { provide, ref } from 'vue'\nimport { addClass, removeClass } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { InjectionKey } from 'vue'\nimport type Node from './node'\nimport type { NodeDropType } from '../tree.type'\n\ninterface TreeNode {\n node: Node\n $el?: HTMLElement\n}\n\ninterface DragOptions {\n event: DragEvent\n treeNode: TreeNode\n}\n\nexport interface DragEvents {\n treeNodeDragStart: (options: DragOptions) => void\n treeNodeDragOver: (options: DragOptions) => void\n treeNodeDragEnd: (event: DragEvent) => void\n}\n\nexport const dragEventsKey: InjectionKey<DragEvents> = Symbol('dragEvents')\n\nexport function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {\n const ns = useNamespace('tree')\n const dragState = ref({\n showDropIndicator: false,\n draggingNode: null,\n dropNode: null,\n allowDrop: true,\n dropType: null,\n })\n\n const treeNodeDragStart = ({ event, treeNode }: DragOptions) => {\n if (\n typeof props.allowDrag === 'function' &&\n !props.allowDrag(treeNode.node)\n ) {\n event.preventDefault()\n return false\n }\n event.dataTransfer.effectAllowed = 'move'\n\n // wrap in try catch to address IE's error when first param is 'text/plain'\n try {\n // setData is required for draggable to work in FireFox\n // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox\n event.dataTransfer.setData('text/plain', '')\n } catch {}\n dragState.value.draggingNode = treeNode\n ctx.emit('node-drag-start', treeNode.node, event)\n }\n\n const treeNodeDragOver = ({ event, treeNode }: DragOptions) => {\n const dropNode = treeNode\n const oldDropNode = dragState.value.dropNode\n if (oldDropNode && oldDropNode !== dropNode) {\n removeClass(oldDropNode.$el, ns.is('drop-inner'))\n }\n const draggingNode = dragState.value.draggingNode\n if (!draggingNode || !dropNode) return\n\n let dropPrev = true\n let dropInner = true\n let dropNext = true\n let userAllowDropInner = true\n if (typeof props.allowDrop === 'function') {\n dropPrev = props.allowDrop(draggingNode.node, dropNode.node, 'prev')\n userAllowDropInner = dropInner = props.allowDrop(\n draggingNode.node,\n dropNode.node,\n 'inner'\n )\n dropNext = props.allowDrop(draggingNode.node, dropNode.node, 'next')\n }\n event.dataTransfer.dropEffect =\n dropInner || dropPrev || dropNext ? 'move' : 'none'\n if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {\n if (oldDropNode) {\n ctx.emit('node-drag-leave', draggingNode.node, oldDropNode.node, event)\n }\n ctx.emit('node-drag-enter', draggingNode.node, dropNode.node, event)\n }\n\n if (dropPrev || dropInner || dropNext) {\n dragState.value.dropNode = dropNode\n }\n\n if (dropNode.node.nextSibling === draggingNode.node) {\n dropNext = false\n }\n if (dropNode.node.previousSibling === draggingNode.node) {\n dropPrev = false\n }\n if (dropNode.node.contains(draggingNode.node, false)) {\n dropInner = false\n }\n if (\n draggingNode.node === dropNode.node ||\n draggingNode.node.contains(dropNode.node)\n ) {\n dropPrev = false\n dropInner = false\n dropNext = false\n }\n\n const targetPosition = dropNode.$el.getBoundingClientRect()\n const treePosition = el$.value.getBoundingClientRect()\n\n let dropType: NodeDropType\n const prevPercent = dropPrev ? (dropInner ? 0.25 : dropNext ? 0.45 : 1) : -1\n const nextPercent = dropNext ? (dropInner ? 0.75 : dropPrev ? 0.55 : 0) : 1\n\n let indicatorTop = -9999\n const distance = event.clientY - targetPosition.top\n if (distance < targetPosition.height * prevPercent) {\n dropType = 'before'\n } else if (distance > targetPosition.height * nextPercent) {\n dropType = 'after'\n } else if (dropInner) {\n dropType = 'inner'\n } else {\n dropType = 'none'\n }\n\n const iconPosition = dropNode.$el\n .querySelector(`.${ns.be('node', 'expand-icon')}`)\n .getBoundingClientRect()\n const dropIndicator = dropIndicator$.value\n if (dropType === 'before') {\n indicatorTop = iconPosition.top - treePosition.top\n } else if (dropType === 'after') {\n indicatorTop = iconPosition.bottom - treePosition.top\n }\n dropIndicator.style.top = `${indicatorTop}px`\n dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`\n\n if (dropType === 'inner') {\n addClass(dropNode.$el, ns.is('drop-inner'))\n } else {\n removeClass(dropNode.$el, ns.is('drop-inner'))\n }\n\n dragState.value.showDropIndicator =\n dropType === 'before' || dropType === 'after'\n dragState.value.allowDrop =\n dragState.value.showDropIndicator || userAllowDropInner\n dragState.value.dropType = dropType\n ctx.emit('node-drag-over', draggingNode.node, dropNode.node, event)\n }\n\n const treeNodeDragEnd = (event: DragEvent) => {\n const { draggingNode, dropType, dropNode } = dragState.value\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n\n if (draggingNode && dropNode) {\n const draggingNodeCopy = { data: draggingNode.node.data }\n if (dropType !== 'none') {\n draggingNode.node.remove()\n }\n if (dropType === 'before') {\n dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'after') {\n dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'inner') {\n dropNode.node.insertChild(draggingNodeCopy)\n }\n if (dropType !== 'none') {\n store.value.registerNode(draggingNodeCopy)\n }\n\n removeClass(dropNode.$el, ns.is('drop-inner'))\n\n ctx.emit(\n 'node-drag-end',\n draggingNode.node,\n dropNode.node,\n dropType,\n event\n )\n if (dropType !== 'none') {\n ctx.emit('node-drop', draggingNode.node, dropNode.node, dropType, event)\n }\n }\n if (draggingNode && !dropNode) {\n ctx.emit('node-drag-end', draggingNode.node, null, dropType, event)\n }\n\n dragState.value.showDropIndicator = false\n dragState.value.draggingNode = null\n dragState.value.dropNode = null\n dragState.value.allowDrop = true\n }\n\n provide(dragEventsKey, {\n treeNodeDragStart,\n treeNodeDragOver,\n treeNodeDragEnd,\n })\n\n return {\n dragState,\n }\n}\n"],"names":["useNamespace","ref","removeClass","addClass","provide"],"mappings":";;;;;;;;;;AAGY,MAAC,aAAa,GAAG,MAAM,CAAC,YAAY,EAAE;AAC3C,SAAS,kBAAkB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE;AAC/E,EAAE,MAAM,EAAE,GAAGA,kBAAY,CAAC,MAAM,CAAC,CAAC;AAClC,EAAE,MAAM,SAAS,GAAGC,OAAG,CAAC;AACxB,IAAI,iBAAiB,EAAE,KAAK;AAC5B,IAAI,YAAY,EAAE,IAAI;AACtB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a,EAAE;AACzB,IAAI,iBAAiB;AACrB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,SAAS;AACb,GAAG,CAAC;AACJ;;;;;"}
|
|
1
|
+
{"version":3,"file":"useDragNode.js","sources":["../../../../../../../packages/components/tree/src/model/useDragNode.ts"],"sourcesContent":["// @ts-nocheck\nimport { provide, ref } from 'vue'\nimport { addClass, removeClass } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { InjectionKey } from 'vue'\nimport type Node from './node'\nimport type { NodeDropType } from '../tree.type'\n\ninterface TreeNode {\n node: Node\n $el?: HTMLElement\n}\n\ninterface DragOptions {\n event: DragEvent\n treeNode: TreeNode\n}\n\nexport interface DragEvents {\n treeNodeDragStart: (options: DragOptions) => void\n treeNodeDragOver: (options: DragOptions) => void\n treeNodeDragEnd: (event: DragEvent) => void\n}\n\nexport const dragEventsKey: InjectionKey<DragEvents> = Symbol('dragEvents')\n\nexport function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {\n const ns = useNamespace('tree')\n const dragState = ref({\n showDropIndicator: false,\n draggingNode: null,\n dropNode: null,\n allowDrop: true,\n dropType: null,\n })\n\n const treeNodeDragStart = ({ event, treeNode }: DragOptions) => {\n if (\n typeof props.allowDrag === 'function' &&\n !props.allowDrag(treeNode.node)\n ) {\n event.preventDefault()\n return false\n }\n event.dataTransfer.effectAllowed = 'move'\n\n // wrap in try catch to address IE's error when first param is 'text/plain'\n try {\n // setData is required for draggable to work in FireFox\n // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox\n event.dataTransfer.setData('text/plain', '')\n } catch {}\n dragState.value.draggingNode = treeNode\n ctx.emit('node-drag-start', treeNode.node, event)\n }\n\n const treeNodeDragOver = ({ event, treeNode }: DragOptions) => {\n const dropNode = treeNode\n const oldDropNode = dragState.value.dropNode\n if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {\n removeClass(oldDropNode.$el, ns.is('drop-inner'))\n }\n const draggingNode = dragState.value.draggingNode\n if (!draggingNode || !dropNode) return\n\n let dropPrev = true\n let dropInner = true\n let dropNext = true\n let userAllowDropInner = true\n if (typeof props.allowDrop === 'function') {\n dropPrev = props.allowDrop(draggingNode.node, dropNode.node, 'prev')\n userAllowDropInner = dropInner = props.allowDrop(\n draggingNode.node,\n dropNode.node,\n 'inner'\n )\n dropNext = props.allowDrop(draggingNode.node, dropNode.node, 'next')\n }\n event.dataTransfer.dropEffect =\n dropInner || dropPrev || dropNext ? 'move' : 'none'\n if (\n (dropPrev || dropInner || dropNext) &&\n oldDropNode?.node.id !== dropNode.node.id\n ) {\n if (oldDropNode) {\n ctx.emit('node-drag-leave', draggingNode.node, oldDropNode.node, event)\n }\n ctx.emit('node-drag-enter', draggingNode.node, dropNode.node, event)\n }\n\n if (dropPrev || dropInner || dropNext) {\n dragState.value.dropNode = dropNode\n }\n\n if (dropNode.node.nextSibling === draggingNode.node) {\n dropNext = false\n }\n if (dropNode.node.previousSibling === draggingNode.node) {\n dropPrev = false\n }\n if (dropNode.node.contains(draggingNode.node, false)) {\n dropInner = false\n }\n if (\n draggingNode.node === dropNode.node ||\n draggingNode.node.contains(dropNode.node)\n ) {\n dropPrev = false\n dropInner = false\n dropNext = false\n }\n\n const targetPosition = dropNode.$el.getBoundingClientRect()\n const treePosition = el$.value.getBoundingClientRect()\n\n let dropType: NodeDropType\n const prevPercent = dropPrev ? (dropInner ? 0.25 : dropNext ? 0.45 : 1) : -1\n const nextPercent = dropNext ? (dropInner ? 0.75 : dropPrev ? 0.55 : 0) : 1\n\n let indicatorTop = -9999\n const distance = event.clientY - targetPosition.top\n if (distance < targetPosition.height * prevPercent) {\n dropType = 'before'\n } else if (distance > targetPosition.height * nextPercent) {\n dropType = 'after'\n } else if (dropInner) {\n dropType = 'inner'\n } else {\n dropType = 'none'\n }\n\n const iconPosition = dropNode.$el\n .querySelector(`.${ns.be('node', 'expand-icon')}`)\n .getBoundingClientRect()\n const dropIndicator = dropIndicator$.value\n if (dropType === 'before') {\n indicatorTop = iconPosition.top - treePosition.top\n } else if (dropType === 'after') {\n indicatorTop = iconPosition.bottom - treePosition.top\n }\n dropIndicator.style.top = `${indicatorTop}px`\n dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`\n\n if (dropType === 'inner') {\n addClass(dropNode.$el, ns.is('drop-inner'))\n } else {\n removeClass(dropNode.$el, ns.is('drop-inner'))\n }\n\n dragState.value.showDropIndicator =\n dropType === 'before' || dropType === 'after'\n dragState.value.allowDrop =\n dragState.value.showDropIndicator || userAllowDropInner\n dragState.value.dropType = dropType\n ctx.emit('node-drag-over', draggingNode.node, dropNode.node, event)\n }\n\n const treeNodeDragEnd = (event: DragEvent) => {\n const { draggingNode, dropType, dropNode } = dragState.value\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n\n if (draggingNode && dropNode) {\n const draggingNodeCopy = { data: draggingNode.node.data }\n if (dropType !== 'none') {\n draggingNode.node.remove()\n }\n if (dropType === 'before') {\n dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'after') {\n dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node)\n } else if (dropType === 'inner') {\n dropNode.node.insertChild(draggingNodeCopy)\n }\n if (dropType !== 'none') {\n store.value.registerNode(draggingNodeCopy)\n }\n\n removeClass(dropNode.$el, ns.is('drop-inner'))\n\n ctx.emit(\n 'node-drag-end',\n draggingNode.node,\n dropNode.node,\n dropType,\n event\n )\n if (dropType !== 'none') {\n ctx.emit('node-drop', draggingNode.node, dropNode.node, dropType, event)\n }\n }\n if (draggingNode && !dropNode) {\n ctx.emit('node-drag-end', draggingNode.node, null, dropType, event)\n }\n\n dragState.value.showDropIndicator = false\n dragState.value.draggingNode = null\n dragState.value.dropNode = null\n dragState.value.allowDrop = true\n }\n\n provide(dragEventsKey, {\n treeNodeDragStart,\n treeNodeDragOver,\n treeNodeDragEnd,\n })\n\n return {\n dragState,\n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EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACjF,OAAO;AACP,KAAK;AACL,IAAI,IAAI,YAAY,IAAI,CAAC,QAAQ,EAAE;AACnC,MAAM,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC1E,KAAK;AACL,IAAI,SAAS,CAAC,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC;AAC9C,IAAI,SAAS,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AACxC,IAAI,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AACpC,IAAI,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;AACrC,GAAG,CAAC;AACJ,EAAEE,WAAO,CAAC,aAAa,EAAE;AACzB,IAAI,iBAAiB;AACrB,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,SAAS;AACb,GAAG,CAAC;AACJ;;;;;"}
|
|
@@ -53,7 +53,7 @@ export declare interface TreeStoreOptions {
|
|
|
53
53
|
export declare interface TreeOptionProps {
|
|
54
54
|
children?: string;
|
|
55
55
|
label?: string | ((data: TreeNodeData, node: Node) => string);
|
|
56
|
-
disabled?: string | ((data: TreeNodeData, node: Node) =>
|
|
56
|
+
disabled?: string | ((data: TreeNodeData, node: Node) => boolean);
|
|
57
57
|
isLeaf?: string | ((data: TreeNodeData, node: Node) => boolean);
|
|
58
58
|
class?: (data: TreeNodeData, node: Node) => string | {
|
|
59
59
|
[key: string]: boolean;
|
|
@@ -193,7 +193,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
193
193
|
props: {
|
|
194
194
|
children?: string | undefined;
|
|
195
195
|
label?: string | ((data: TreeNodeData, node: Node) => string) | undefined;
|
|
196
|
-
disabled?: string | ((data: TreeNodeData, node: Node) =>
|
|
196
|
+
disabled?: string | ((data: TreeNodeData, node: Node) => boolean) | undefined;
|
|
197
197
|
isLeaf?: string | ((data: TreeNodeData, node: Node) => boolean) | undefined;
|
|
198
198
|
class?: ((data: TreeNodeData, node: Node) => string | {
|
|
199
199
|
[key: string]: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-select.js","sources":["../../../../../../packages/components/tree-select/src/tree-select.vue"],"sourcesContent":["<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, h, onMounted, reactive, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport ElSelect from '@element-plus/components/select'\nimport ElTree from '@element-plus/components/tree'\nimport { useSelect } from './select'\nimport { useTree } from './tree'\nimport CacheOptions from './cache-options'\n\nexport default defineComponent({\n name: 'ElTreeSelect',\n // disable `ElSelect` inherit current attrs\n inheritAttrs: false,\n props: {\n ...ElSelect.props,\n ...ElTree.props,\n cacheData: {\n type: Array,\n default: () => [],\n },\n },\n setup(props, context) {\n const { slots, expose } = context\n\n const select = ref<InstanceType<typeof ElSelect>>()\n const tree = ref<InstanceType<typeof ElTree>>()\n\n const key = computed(() => props.nodeKey || props.valueKey || 'value')\n\n const selectProps = useSelect(props, context, { select, tree, key })\n const { cacheOptions, ...treeProps } = useTree(props, context, {\n select,\n tree,\n key,\n })\n\n // expose ElTree/ElSelect methods\n const methods = reactive({})\n expose(methods)\n onMounted(() => {\n Object.assign(methods, {\n ...pick(tree.value, [\n 'filter',\n 'updateKeyChildren',\n 'getCheckedNodes',\n 'setCheckedNodes',\n 'getCheckedKeys',\n 'setCheckedKeys',\n 'setChecked',\n 'getHalfCheckedNodes',\n 'getHalfCheckedKeys',\n 'getCurrentKey',\n 'getCurrentNode',\n 'setCurrentKey',\n 'setCurrentNode',\n 'getNode',\n 'remove',\n 'append',\n 'insertBefore',\n 'insertAfter',\n ]),\n ...pick(select.value, ['focus', 'blur']),\n })\n })\n\n return () =>\n h(\n ElSelect,\n /**\n * 1. The `props` is processed into `Refs`, but `v-bind` and\n * render function props cannot read `Refs`, so use `reactive`\n * unwrap the `Refs` and keep reactive.\n * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,\n * so use function.\n */\n reactive({\n ...selectProps,\n ref: (ref) => (select.value = ref),\n }),\n {\n ...slots,\n default: () => [\n h(CacheOptions, { data: cacheOptions.value }),\n h(\n ElTree,\n reactive({\n ...treeProps,\n ref: (ref) => (tree.value = ref),\n })\n ),\n ],\n }\n )\n },\n})\n</script>\n"],"names":["defineComponent","ElSelect","ElTree","select","ref","tree","computed","useSelect","cacheOptions","useTree","reactive","onMounted","pick","h","CacheOptions"],"mappings":";;;;;;;;;;;;;AAUA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EAEN,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA;AAAA,IACL,GAAGC,cAAS,CAAA,KAAA;AAAA,IACZ,GAAGC,kBAAO,CAAA,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"tree-select.js","sources":["../../../../../../packages/components/tree-select/src/tree-select.vue"],"sourcesContent":["<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, h, onMounted, reactive, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport ElSelect from '@element-plus/components/select'\nimport ElTree from '@element-plus/components/tree'\nimport { useSelect } from './select'\nimport { useTree } from './tree'\nimport CacheOptions from './cache-options'\n\nexport default defineComponent({\n name: 'ElTreeSelect',\n // disable `ElSelect` inherit current attrs\n inheritAttrs: false,\n props: {\n ...ElSelect.props,\n ...ElTree.props,\n /**\n * @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data\n */\n cacheData: {\n type: Array,\n default: () => [],\n },\n },\n setup(props, context) {\n const { slots, expose } = context\n\n const select = ref<InstanceType<typeof ElSelect>>()\n const tree = ref<InstanceType<typeof ElTree>>()\n\n const key = computed(() => props.nodeKey || props.valueKey || 'value')\n\n const selectProps = useSelect(props, context, { select, tree, key })\n const { cacheOptions, ...treeProps } = useTree(props, context, {\n select,\n tree,\n key,\n })\n\n // expose ElTree/ElSelect methods\n const methods = reactive({})\n expose(methods)\n onMounted(() => {\n Object.assign(methods, {\n ...pick(tree.value, [\n 'filter',\n 'updateKeyChildren',\n 'getCheckedNodes',\n 'setCheckedNodes',\n 'getCheckedKeys',\n 'setCheckedKeys',\n 'setChecked',\n 'getHalfCheckedNodes',\n 'getHalfCheckedKeys',\n 'getCurrentKey',\n 'getCurrentNode',\n 'setCurrentKey',\n 'setCurrentNode',\n 'getNode',\n 'remove',\n 'append',\n 'insertBefore',\n 'insertAfter',\n ]),\n ...pick(select.value, ['focus', 'blur']),\n })\n })\n\n return () =>\n h(\n ElSelect,\n /**\n * 1. The `props` is processed into `Refs`, but `v-bind` and\n * render function props cannot read `Refs`, so use `reactive`\n * unwrap the `Refs` and keep reactive.\n * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,\n * so use function.\n */\n reactive({\n ...selectProps,\n ref: (ref) => (select.value = ref),\n }),\n {\n ...slots,\n default: () => [\n h(CacheOptions, { data: cacheOptions.value }),\n h(\n ElTree,\n reactive({\n ...treeProps,\n ref: (ref) => (tree.value = ref),\n })\n ),\n ],\n }\n )\n },\n})\n</script>\n"],"names":["defineComponent","ElSelect","ElTree","select","ref","tree","computed","useSelect","cacheOptions","useTree","reactive","onMounted","pick","h","CacheOptions"],"mappings":";;;;;;;;;;;;;AAUA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EAEN,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA;AAAA,IACL,GAAGC,cAAS,CAAA,KAAA;AAAA,IACZ,GAAGC,kBAAO,CAAA,KAAA;AAAA,IAIV,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,KAAA;AAAA,MACN,OAAA,EAAS,MAAM,EAAC;AAAA,KAClB;AAAA,GACF;AAAA,EACA,KAAA,CAAM,OAAO,OAAS,EAAA;AACpB,IA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ED,IAAO,OAAA,MACLU,KACE,CAAAZ,cAAA,EAQAS,YAAS,CAAA;AAAA,MACP,GAAG,WAAA;AAAA,MACH,GAAK,EAAA,CAAC,IAAS,KAAAP,QAAA,CAAO,KAAQ,GAAA,IAAA;AAAA,KAC/B,CACD,EAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACH,SAAS,MAAM;AAAA,QACbU,MAAEC,uBAAc,EAAA,EAAE,IAAM,EAAAN,cAAA,CAAa,OAAO,CAAA;AAAA,QAC5CK,KAAA,CACEX,oBACAQ,YAAS,CAAA;AAAA,UACP,GAAG,SAAA;AAAA,UACH,GAAK,EAAA,CAAC,IAAS,KAAAL,MAAA,CAAK,KAAQ,GAAA,IAAA;AAAA,SAC7B,CACH,CAAA;AAAA,OACF;AAAA,KAEJ,CAAA,CAAA;AAAA,GACJ;AACF,CAAC,CAAA,CAAA;;;;;"}
|
|
@@ -66,6 +66,9 @@ const useTree = (props, { attrs, slots, emit }, {
|
|
|
66
66
|
}, (data) => getNodeValByProp("children", data));
|
|
67
67
|
return options;
|
|
68
68
|
});
|
|
69
|
+
const cacheOptionsMap = vue.computed(() => {
|
|
70
|
+
return cacheOptions.value.reduce((prev, next) => ({ ...prev, [next.value]: next }), {});
|
|
71
|
+
});
|
|
69
72
|
return {
|
|
70
73
|
...lodashUnified.pick(vue.toRefs(props), Object.keys(index["default"].props)),
|
|
71
74
|
...attrs,
|
|
@@ -106,11 +109,14 @@ const useTree = (props, { attrs, slots, emit }, {
|
|
|
106
109
|
}
|
|
107
110
|
},
|
|
108
111
|
onCheck: (data, params) => {
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
if (!props.showCheckbox)
|
|
113
|
+
return;
|
|
111
114
|
const dataValue = getNodeValByProp("value", data);
|
|
115
|
+
const uncachedCheckedKeys = params.checkedKeys;
|
|
116
|
+
const cachedKeys = props.multiple ? utils.toValidArray(props.modelValue).filter((item) => item in cacheOptionsMap.value && !tree.value.getNode(item) && !uncachedCheckedKeys.includes(item)) : [];
|
|
117
|
+
const checkedKeys = uncachedCheckedKeys.concat(cachedKeys);
|
|
112
118
|
if (props.checkStrictly) {
|
|
113
|
-
emit(event.UPDATE_MODEL_EVENT, props.multiple ?
|
|
119
|
+
emit(event.UPDATE_MODEL_EVENT, props.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0);
|
|
114
120
|
} else {
|
|
115
121
|
if (props.multiple) {
|
|
116
122
|
emit(event.UPDATE_MODEL_EVENT, tree.value.getCheckedKeys(true));
|
|
@@ -121,6 +127,17 @@ const useTree = (props, { attrs, slots, emit }, {
|
|
|
121
127
|
emit(event.UPDATE_MODEL_EVENT, firstLeafKey === props.modelValue || hasCheckedChild ? void 0 : firstLeafKey);
|
|
122
128
|
}
|
|
123
129
|
}
|
|
130
|
+
vue.nextTick(() => {
|
|
131
|
+
var _a;
|
|
132
|
+
const checkedKeys2 = utils.toValidArray(props.modelValue);
|
|
133
|
+
tree.value.setCheckedKeys(checkedKeys2);
|
|
134
|
+
(_a = attrs.onCheck) == null ? void 0 : _a.call(attrs, data, {
|
|
135
|
+
checkedKeys: tree.value.getCheckedKeys(),
|
|
136
|
+
checkedNodes: tree.value.getCheckedNodes(),
|
|
137
|
+
halfCheckedKeys: tree.value.getHalfCheckedKeys(),
|
|
138
|
+
halfCheckedNodes: tree.value.getHalfCheckedNodes()
|
|
139
|
+
});
|
|
140
|
+
});
|
|
124
141
|
},
|
|
125
142
|
cacheOptions
|
|
126
143
|
};
|