@type-dom/ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -45
- package/package.json +4 -3
- package/src/aria.d.ts +15 -0
- package/src/components/basic/td-button/td-button.abstract.d.ts +19 -0
- package/src/components/basic/td-button/td-button.abstract.js +175 -0
- package/src/components/basic/td-button/td-button.class.d.ts +3 -14
- package/src/components/basic/td-button/td-button.class.js +4 -172
- package/src/components/basic/td-button/td-button.const.d.ts +7 -0
- package/src/components/basic/td-button/td-button.const.js +4 -0
- package/src/components/basic/td-button/td-button.interface.d.ts +16 -6
- package/src/components/basic/td-button/td-button.interface.js +4 -0
- package/src/components/basic/td-button/td-button.style.d.ts +8 -3
- package/src/components/basic/td-button/td-button.style.js +28 -10
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +2 -2
- package/src/components/basic/td-button-group/td-button-group.class.js +28 -25
- package/src/components/basic/td-container/td-aside/td-aside.class.d.ts +3 -2
- package/src/components/basic/td-container/td-aside/td-aside.class.js +7 -16
- package/src/components/basic/td-container/td-container.class.d.ts +4 -3
- package/src/components/basic/td-container/td-container.class.js +9 -8
- package/src/components/basic/td-container/td-container.interface.d.ts +2 -2
- package/src/components/basic/td-container/td-container.js +3 -2
- package/src/components/basic/td-container/td-footer/td-footer.class.d.ts +2 -3
- package/src/components/basic/td-container/td-footer/td-footer.class.js +9 -11
- package/src/components/basic/td-container/td-header/td-header.class.d.ts +2 -2
- package/src/components/basic/td-container/td-header/td-header.class.js +10 -10
- package/src/components/basic/td-container/td-main/td-main.class.d.ts +2 -1
- package/src/components/basic/td-container/td-main/td-main.class.js +6 -4
- package/src/components/basic/td-icon/td-icon.class.d.ts +30 -6
- package/src/components/basic/td-icon/td-icon.class.js +111 -47
- package/src/components/basic/td-icon/td-icon.interface.d.ts +36 -6
- package/src/components/basic/td-icon/td-icon.style.d.ts +5 -14
- package/src/components/basic/td-icon/td-icon.style.js +5 -6
- package/src/components/basic/td-layout/td-col/td-col.class.d.ts +4 -4
- package/src/components/basic/td-layout/td-col/td-col.class.js +48 -45
- package/src/components/basic/td-layout/td-col/td-col.interface.d.ts +0 -4
- package/src/components/basic/td-layout/td-row/td-row.class.d.ts +4 -3
- package/src/components/basic/td-layout/td-row/td-row.class.js +31 -30
- package/src/components/basic/td-layout/td-row/td-row.interface.d.ts +0 -1
- package/src/components/basic/td-link/td-link.class.d.ts +5 -5
- package/src/components/basic/td-link/td-link.class.js +53 -55
- package/src/components/basic/td-link/td-link.interface.d.ts +14 -6
- package/src/components/basic/td-link/td-link.style.d.ts +14 -3
- package/src/components/basic/td-link/td-link.style.js +40 -10
- package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +2 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.js +8 -7
- package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +3 -3
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +18 -20
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +3 -2
- package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +2 -1
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +12 -12
- package/src/components/basic/td-space/td-space.class.d.ts +5 -5
- package/src/components/basic/td-space/td-space.class.js +32 -30
- package/src/components/basic/td-space/td-space.interface.d.ts +1 -0
- package/src/components/basic/td-text/td-text.class.d.ts +3 -3
- package/src/components/basic/td-text/td-text.class.js +22 -19
- package/src/components/basic/td-text/td-text.interface.d.ts +4 -2
- package/src/components/basic/td-text/td-text.style.d.ts +1 -1
- package/src/components/basic/td-text/td-text.style.js +13 -4
- package/src/components/data/index.d.ts +30 -0
- package/src/components/data/index.js +34 -0
- package/src/components/data/td-avatar/td-avatar.class.d.ts +12 -0
- package/src/components/data/td-avatar/td-avatar.class.js +120 -0
- package/src/components/data/td-avatar/td-avatar.interface.d.ts +41 -0
- package/src/components/data/td-avatar/td-avatar.style.d.ts +13 -0
- package/src/components/data/td-avatar/td-avatar.style.js +20 -0
- package/src/components/data/td-badge/td-badge.class.d.ts +9 -0
- package/src/components/data/td-badge/td-badge.class.js +104 -0
- package/src/components/data/td-badge/td-badge.interface.d.ts +52 -0
- package/src/components/data/td-badge/td-badge.style.d.ts +7 -0
- package/src/components/data/td-badge/td-badge.style.js +12 -0
- package/src/components/data/td-card/td-card.class.d.ts +14 -0
- package/src/components/data/td-card/td-card.class.js +102 -0
- package/src/components/data/td-card/td-card.interface.d.ts +26 -0
- package/src/components/data/td-card/td-card.interface.js +2 -0
- package/src/components/data/td-card/td-card.style.d.ts +9 -0
- package/src/components/data/td-card/td-card.style.js +29 -0
- package/src/components/data/td-carousel/td-carousel.class.d.ts +0 -0
- package/src/components/data/td-carousel/td-carousel.class.js +1 -0
- package/src/components/data/td-carousel/td-carousel.interface.d.ts +0 -0
- package/src/components/data/td-carousel/td-carousel.interface.js +1 -0
- package/src/components/data/td-check-tag/td-check-tag.class.d.ts +12 -0
- package/src/components/data/td-check-tag/td-check-tag.class.js +75 -0
- package/src/components/data/td-check-tag/td-check-tag.interface.d.ts +22 -0
- package/src/components/data/td-check-tag/td-check-tag.interface.js +3 -0
- package/src/components/data/td-check-tag/td-check-tag.style.d.ts +7 -0
- package/src/components/data/td-check-tag/td-check-tag.style.js +39 -0
- package/src/components/data/td-collapse/td-collapse.class.d.ts +13 -0
- package/src/components/data/td-collapse/td-collapse.class.js +85 -0
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +18 -0
- package/src/components/data/td-collapse/td-collapse.interface.js +2 -0
- package/src/components/data/td-collapse/td-collapse.style.d.ts +11 -0
- package/src/components/data/td-collapse/td-collapse.style.js +22 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.d.ts +25 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +222 -0
- package/src/components/data/td-collapse-item/td-collapse-item.interface.d.ts +20 -0
- package/src/components/data/td-collapse-item/td-collapse-item.interface.js +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.class.d.ts +6 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.class.js +12 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.interface.d.ts +4 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.interface.js +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.util.d.ts +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.util.js +147 -0
- package/src/components/data/td-count-down/td-count-down.class.d.ts +13 -0
- package/src/components/data/td-count-down/td-count-down.class.js +57 -0
- package/src/components/data/td-count-down/td-count-down.function.d.ts +0 -0
- package/src/components/data/td-count-down/td-count-down.function.js +1 -0
- package/src/components/data/td-count-down/td-count-down.interface.d.ts +11 -0
- package/src/components/data/td-count-down/td-count-down.interface.js +2 -0
- package/src/components/data/td-count-down/utils.d.ts +3 -0
- package/src/components/data/td-count-down/utils.js +32 -0
- package/src/components/data/td-descriptions/td-descriptions-row.d.ts +21 -0
- package/src/components/data/td-descriptions/td-descriptions-row.js +80 -0
- package/src/components/data/td-descriptions/td-descriptions.class.d.ts +18 -0
- package/src/components/data/td-descriptions/td-descriptions.class.js +156 -0
- package/src/components/data/td-descriptions/td-descriptions.interface.d.ts +43 -0
- package/src/components/data/td-descriptions/td-descriptions.interface.js +2 -0
- package/src/components/data/td-descriptions/td-descriptions.style.d.ts +51 -0
- package/src/components/data/td-descriptions/td-descriptions.style.js +142 -0
- package/src/components/data/td-descriptions/td-descritions-cell.d.ts +15 -0
- package/src/components/data/td-descriptions/td-descritions-cell.js +110 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.d.ts +10 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +20 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.interface.d.ts +51 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.interface.js +2 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.style.d.ts +10 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.style.js +13 -0
- package/src/components/data/td-empty/img-empty.class.d.ts +5 -0
- package/src/components/data/td-empty/img-empty.class.js +204 -0
- package/src/components/data/td-empty/td-empty.class.d.ts +13 -0
- package/src/components/data/td-empty/td-empty.class.js +77 -0
- package/src/components/data/td-empty/td-empty.interface.d.ts +25 -0
- package/src/components/data/td-empty/td-empty.interface.js +2 -0
- package/src/components/data/td-empty/td-empty.style.d.ts +24 -0
- package/src/components/data/td-empty/td-empty.style.js +65 -0
- package/src/components/data/td-image/td-image.class.d.ts +16 -0
- package/src/components/data/td-image/td-image.class.js +95 -0
- package/src/components/data/td-image/td-image.interface.d.ts +78 -0
- package/src/components/data/td-image/td-image.interface.js +2 -0
- package/src/components/data/td-image/td-image.style.d.ts +11 -0
- package/src/components/data/td-image/td-image.style.js +18 -0
- package/src/components/data/td-image/util.d.ts +1 -0
- package/src/components/data/td-image/util.js +18 -0
- package/src/components/data/td-image-viewer/td-image-viewer.class.d.ts +20 -0
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +261 -0
- package/src/components/data/td-image-viewer/td-image-viewer.interface.d.ts +63 -0
- package/src/components/data/td-image-viewer/td-image-viewer.interface.js +2 -0
- package/src/components/data/td-image-viewer/td-image-viewer.style.d.ts +9 -0
- package/src/components/data/td-image-viewer/td-image-viewer.style.js +67 -0
- package/src/components/data/td-pagination/td-pagination.class.d.ts +0 -0
- package/src/components/data/td-pagination/td-pagination.class.js +1 -0
- package/src/components/data/td-pagination/td-pagination.interface.d.ts +0 -0
- package/src/components/data/td-pagination/td-pagination.interface.js +1 -0
- package/src/components/data/td-progress/td-progress.class.d.ts +0 -0
- package/src/components/data/td-progress/td-progress.class.js +1 -0
- package/src/components/data/td-progress/td-progress.interface.d.ts +0 -0
- package/src/components/data/td-progress/td-progress.interface.js +1 -0
- package/src/components/data/td-result/td-result.class.d.ts +8 -0
- package/src/components/data/td-result/td-result.class.js +87 -0
- package/src/components/data/td-result/td-result.constant.d.ts +8 -0
- package/src/components/data/td-result/td-result.constant.js +41 -0
- package/src/components/data/td-result/td-result.interface.d.ts +28 -0
- package/src/components/data/td-result/td-result.interface.js +2 -0
- package/src/components/data/td-result/td-result.style.d.ts +16 -0
- package/src/components/data/td-result/td-result.style.js +46 -0
- package/src/components/data/td-segmented/td-segmented.class.d.ts +22 -0
- package/src/components/data/td-segmented/td-segmented.class.js +172 -0
- package/src/components/data/td-segmented/td-segmented.interface.d.ts +51 -0
- package/src/components/data/td-segmented/td-segmented.interface.js +2 -0
- package/src/components/data/td-segmented/td-segmented.style.d.ts +37 -0
- package/src/components/data/td-segmented/td-segmented.style.js +142 -0
- package/src/components/data/td-statistic/td-statistic.abstract.d.ts +15 -0
- package/src/components/data/td-statistic/td-statistic.abstract.js +113 -0
- package/src/components/data/td-statistic/td-statistic.class.d.ts +6 -0
- package/src/components/data/td-statistic/td-statistic.class.js +11 -0
- package/src/components/data/td-statistic/td-statistic.interface.d.ts +58 -0
- package/src/components/data/td-statistic/td-statistic.interface.js +2 -0
- package/src/components/data/td-statistic/td-statistic.style.d.ts +9 -0
- package/src/components/data/td-statistic/td-statistic.style.js +16 -0
- package/src/components/data/td-table/td-table.class.d.ts +0 -0
- package/src/components/data/td-table/td-table.class.js +1 -0
- package/src/components/data/td-table/td-table.interface.d.ts +0 -0
- package/src/components/data/td-table/td-table.interface.js +1 -0
- package/src/components/data/td-tag/td-tag.class.d.ts +12 -0
- package/src/components/data/td-tag/td-tag.class.js +144 -0
- package/src/components/data/td-tag/td-tag.interface.d.ts +42 -0
- package/src/components/data/td-tag/td-tag.interface.js +2 -0
- package/src/components/data/td-tag/td-tag.style.d.ts +45 -0
- package/src/components/data/td-tag/td-tag.style.js +80 -0
- package/src/components/data/td-timeline/td-timeline.class.d.ts +0 -0
- package/src/components/data/td-timeline/td-timeline.class.js +1 -0
- package/src/components/data/td-timeline/td-timeline.interface.d.ts +0 -0
- package/src/components/data/td-timeline/td-timeline.interface.js +1 -0
- package/src/components/data/td-tree/td-tree.class.d.ts +0 -0
- package/src/components/data/td-tree/td-tree.class.js +1 -0
- package/src/components/data/td-tree/td-tree.interface.d.ts +0 -0
- package/src/components/data/td-tree/td-tree.interface.js +1 -0
- package/src/components/feedback/dialog/dialog.class.d.ts +2 -1
- package/src/components/feedback/dialog/dialog.class.js +5 -5
- package/src/components/feedback/dialog/dialog.interface.d.ts +2 -3
- package/src/components/feedback/index.d.ts +11 -0
- package/src/components/feedback/index.js +15 -1
- package/src/components/feedback/message-box/message-box.d.ts +2 -1
- package/src/components/feedback/message-box/message-box.interface.d.ts +2 -2
- package/src/components/feedback/message-box/message-box.js +6 -6
- package/src/components/feedback/overlay/container/body/body.js +3 -5
- package/src/components/feedback/overlay/container/container.js +4 -6
- package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.js +3 -3
- package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.js +4 -6
- package/src/components/feedback/overlay/container/footer/footer.d.ts +1 -2
- package/src/components/feedback/overlay/container/footer/footer.js +24 -26
- package/src/components/feedback/overlay/container/header/close-button/close-button.js +6 -8
- package/src/components/feedback/overlay/container/header/header.js +2 -2
- package/src/components/feedback/overlay/container/header/title/title.js +3 -5
- package/src/components/feedback/overlay/overlay.abstract.js +6 -8
- package/src/components/feedback/td-alert/td-alert.class.d.ts +15 -0
- package/src/components/feedback/td-alert/td-alert.class.js +111 -0
- package/src/components/feedback/td-alert/td-alert.interface.d.ts +41 -0
- package/src/components/feedback/td-alert/td-alert.interface.js +2 -0
- package/src/components/feedback/td-alert/td-alert.style.d.ts +21 -0
- package/src/components/feedback/td-alert/td-alert.style.js +102 -0
- package/src/components/feedback/td-dialog/td-dialog.class.d.ts +12 -0
- package/src/components/feedback/td-dialog/td-dialog.class.js +70 -0
- package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +79 -0
- package/src/components/feedback/td-dialog/td-dialog.interface.js +2 -0
- package/src/components/feedback/td-dialog/td-dialog.style.d.ts +20 -0
- package/src/components/feedback/td-dialog/td-dialog.style.js +89 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.d.ts +12 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +79 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.d.ts +51 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.js +2 -0
- package/src/components/feedback/td-drawer/td-drawer.class.d.ts +8 -0
- package/src/components/feedback/td-drawer/td-drawer.class.js +39 -0
- package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +12 -0
- package/src/components/feedback/td-drawer/td-drawer.interface.js +2 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +4 -3
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +11 -11
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +9 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.js +1 -0
- package/src/components/feedback/td-focus-trap/tokens.d.ts +5 -0
- package/src/components/feedback/td-focus-trap/tokens.js +4 -10
- package/src/components/feedback/td-focus-trap/utils.d.ts +2 -2
- package/src/components/feedback/td-focus-trap/utils.js +3 -3
- package/src/components/feedback/td-loading/td-loading.class.d.ts +12 -0
- package/src/components/feedback/td-loading/td-loading.class.js +65 -0
- package/src/components/feedback/td-loading/td-loading.interface.d.ts +37 -0
- package/src/components/feedback/td-loading/td-loading.interface.js +2 -0
- package/src/components/feedback/td-message/td-message.class.d.ts +24 -0
- package/src/components/feedback/td-message/td-message.class.js +239 -0
- package/src/components/feedback/td-message/td-message.interface.d.ts +105 -0
- package/src/components/feedback/td-message/td-message.interface.js +22 -0
- package/src/components/feedback/td-message/td-message.style.d.ts +17 -0
- package/src/components/feedback/td-message/td-message.style.js +104 -0
- package/src/components/feedback/td-message-box/td-message-box.class.d.ts +42 -0
- package/src/components/feedback/td-message-box/td-message-box.class.js +531 -0
- package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +142 -0
- package/src/components/feedback/td-message-box/td-message-box.interface.js +2 -0
- package/src/components/feedback/td-message-box/td-message-box.style.d.ts +36 -0
- package/src/components/feedback/td-message-box/td-message-box.style.js +182 -0
- package/src/components/feedback/td-notification/td-notification.class.d.ts +30 -0
- package/src/components/feedback/td-notification/td-notification.class.js +234 -0
- package/src/components/feedback/td-notification/td-notification.interface.d.ts +76 -0
- package/src/components/feedback/td-notification/td-notification.interface.js +2 -0
- package/src/components/feedback/td-notification/td-notification.style.d.ts +28 -0
- package/src/components/feedback/td-notification/td-notification.style.js +138 -0
- package/src/components/feedback/td-overlay/td-overlay.class.d.ts +10 -0
- package/src/components/feedback/td-overlay/td-overlay.class.js +35 -0
- package/src/components/feedback/td-overlay/td-overlay.interface.d.ts +13 -0
- package/src/components/feedback/td-overlay/td-overlay.interface.js +2 -0
- package/src/components/feedback/td-overlay/td-overlay.style.d.ts +2 -0
- package/src/components/feedback/td-overlay/td-overlay.style.js +16 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.d.ts +0 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.js +1 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.d.ts +0 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.js +1 -0
- package/src/components/feedback/td-popover/td-popover.class.d.ts +0 -0
- package/src/components/feedback/td-popover/td-popover.class.js +1 -0
- package/src/components/feedback/td-popover/td-popover.interface.d.ts +0 -0
- package/src/components/feedback/td-popover/td-popover.interface.js +1 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +2 -1
- package/src/components/feedback/td-popper/arrow/arrow.class.js +6 -6
- package/src/components/feedback/td-popper/content/content.class.d.ts +2 -1
- package/src/components/feedback/td-popper/content/content.class.js +7 -7
- package/src/components/feedback/td-popper/td-popper.class.d.ts +3 -2
- package/src/components/feedback/td-popper/td-popper.class.js +3 -3
- package/src/components/feedback/td-popper/td-popper.interface.d.ts +2 -3
- package/src/components/feedback/td-popper/td-popper.interface.js +0 -11
- package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +2 -1
- package/src/components/feedback/td-popper/trigger/trigger.class.js +3 -2
- package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +10 -0
- package/src/components/feedback/td-tooltip/content/content.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/content/content.class.js +3 -3
- package/src/components/feedback/td-tooltip/td-tooltip.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +7 -13
- package/src/components/feedback/td-tooltip/trigger/trigger.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +3 -3
- package/src/components/feedback/td-tooltip/utils.d.ts +4 -0
- package/src/components/feedback/td-tooltip/utils.js +23 -0
- package/src/components/form/checkbox-group/checkbox-group.class.js +9 -8
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +3 -3
- package/src/components/form/field-item/cascade/field-cascade.abstract.js +25 -17
- package/src/components/form/field-item/field-item.abstract.d.ts +7 -3
- package/src/components/form/field-item/field-item.abstract.js +14 -9
- package/src/components/form/field-item/field-item.style.d.ts +1 -1
- package/src/components/form/field-item/field-item.style.js +1 -2
- package/src/components/form/field-item/input/field-input.abstract.d.ts +1 -2
- package/src/components/form/field-item/input/field-input.abstract.js +6 -6
- package/src/components/form/field-item/options/field-options.abstract.js +31 -27
- package/src/components/form/field-item/radio/field-radio.abstract.d.ts +2 -2
- package/src/components/form/field-item/radio/field-radio.abstract.js +30 -21
- package/src/components/form/field-item/select/field-select.abstract.d.ts +1 -2
- package/src/components/form/field-item/select/field-select.abstract.js +3 -3
- package/src/components/form/field-item/span/field-span.abstract.js +4 -4
- package/src/components/form/field-item/textarea/field-textarea.abstract.d.ts +1 -2
- package/src/components/form/field-item/textarea/field-textarea.abstract.js +6 -6
- package/src/components/form/field-select/field-select.class.js +10 -9
- package/src/components/form/field-select/option/option.class.js +1 -1
- package/src/components/form/index.d.ts +10 -0
- package/src/components/form/index.js +11 -1
- package/src/components/form/radio-group/radio-group.class.d.ts +3 -2
- package/src/components/form/radio-group/radio-group.class.js +13 -12
- package/src/components/form/radio-group/radio-option/radio-option.class.d.ts +3 -2
- package/src/components/form/radio-group/radio-option/radio-option.class.js +8 -9
- package/src/components/form/select/select.class.js +4 -4
- package/src/components/form/td-autocomplete/td-autocomplete.class.d.ts +0 -0
- package/src/components/form/td-autocomplete/td-autocomplete.class.js +1 -0
- package/src/components/form/td-autocomplete/td-autocomplete.interface.d.ts +0 -0
- package/src/components/form/td-autocomplete/td-autocomplete.interface.js +1 -0
- package/src/components/form/td-cascader/td-cascader.class.d.ts +0 -0
- package/src/components/form/td-cascader/td-cascader.class.js +1 -0
- package/src/components/form/td-cascader/td-cascader.interface.d.ts +0 -0
- package/src/components/form/td-cascader/td-cascader.interface.js +1 -0
- package/src/components/form/td-checkbox/composables/use-checkbox-status.d.ts +6 -0
- package/src/components/form/td-checkbox/composables/use-checkbox-status.js +52 -0
- package/src/components/form/td-checkbox/composables/use-checkbox.d.ts +6 -0
- package/src/components/form/td-checkbox/composables/use-checkbox.js +85 -0
- package/src/components/form/td-checkbox/td-checkbox.class.d.ts +8 -2
- package/src/components/form/td-checkbox/td-checkbox.class.js +54 -75
- package/src/components/form/td-checkbox/td-checkbox.interface.d.ts +2 -1
- package/src/components/form/td-checkbox/td-checkbox.style.d.ts +46 -0
- package/src/components/form/td-checkbox/td-checkbox.style.js +144 -10
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.d.ts +9 -2
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +56 -6
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.d.ts +9 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.js +55 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.d.ts +2 -2
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +10 -10
- package/src/components/form/td-checkbox-group/td-checkbox-group.interface.d.ts +1 -1
- package/src/components/form/td-color-picker/td-color-picker.class.d.ts +0 -0
- package/src/components/form/td-color-picker/td-color-picker.class.js +1 -0
- package/src/components/form/td-color-picker/td-color-picker.interface.d.ts +0 -0
- package/src/components/form/td-color-picker/td-color-picker.interface.js +1 -0
- package/src/components/form/td-date-picker/td-date-picker.class.d.ts +0 -0
- package/src/components/form/td-date-picker/td-date-picker.class.js +1 -0
- package/src/components/form/td-date-picker/td-date-picker.interface.d.ts +0 -0
- package/src/components/form/td-date-picker/td-date-picker.interface.js +1 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.class.d.ts +0 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.class.js +1 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.interface.d.ts +0 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.interface.js +1 -0
- package/src/components/form/td-form/hooks/use-form-item.d.ts +5 -0
- package/src/components/form/td-form/hooks/use-form-item.js +65 -0
- package/src/components/form/td-form/td-form.class.d.ts +3 -8
- package/src/components/form/td-form/td-form.class.js +10 -34
- package/src/components/form/td-form/td-form.const.d.ts +5 -0
- package/src/components/form/td-form/td-form.const.js +5 -0
- package/src/components/form/td-form/td-form.interface.js +33 -0
- package/src/components/form/td-form-item/td-form-item.class.d.ts +7 -4
- package/src/components/form/td-form-item/td-form-item.class.js +83 -60
- package/src/components/form/td-form-item/td-form-item.interface.d.ts +1 -3
- package/src/components/form/td-form-item/td-form-item.style.js +15 -15
- package/src/components/form/td-input/td-input-field.class.d.ts +1 -1
- package/src/components/form/td-input/td-input-field.class.js +13 -13
- package/src/components/form/td-input/td-input-field.interface.d.ts +2 -2
- package/src/components/form/td-input/td-input.class.d.ts +4 -3
- package/src/components/form/td-input/td-input.class.js +83 -49
- package/src/components/form/td-input/td-input.interface.d.ts +13 -0
- package/src/components/form/td-input/widget/prefix.js +2 -2
- package/src/components/form/td-input/widget/suffix.d.ts +1 -1
- package/src/components/form/td-input/widget/suffix.js +10 -10
- package/src/components/form/td-input/widget/td-input-wrapper.class.d.ts +3 -3
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +64 -67
- package/src/components/form/td-input/widget/td-textarea-wrapper.d.ts +2 -2
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +8 -9
- package/src/components/form/td-input/widget/utils.js +9 -10
- package/src/components/form/td-input-number/td-input-number.class.d.ts +0 -0
- package/src/components/form/td-input-number/td-input-number.class.js +1 -0
- package/src/components/form/td-input-number/td-input-number.interface.d.ts +0 -0
- package/src/components/form/td-input-number/td-input-number.interface.js +1 -0
- package/src/components/form/td-option/td-option.class.d.ts +7 -0
- package/src/components/form/{td-select/option/option.class.js → td-option/td-option.class.js} +9 -10
- package/src/components/form/{td-select/option/option.interface.d.ts → td-option/td-option.interface.d.ts} +1 -1
- package/src/components/form/td-option/td-option.interface.js +2 -0
- package/src/components/form/td-option-group/td-option-group.class.d.ts +7 -0
- package/src/components/form/{td-select/option-group/option-group.class.js → td-option-group/td-option-group.class.js} +11 -11
- package/src/components/form/{td-select/option-group/option-group.interface.d.ts → td-option-group/td-option-group.interface.d.ts} +1 -1
- package/src/components/form/td-option-group/td-option-group.interface.js +2 -0
- package/src/components/form/td-radio/td-radio.class.d.ts +3 -3
- package/src/components/form/td-radio/td-radio.class.js +58 -55
- package/src/components/form/td-radio-button/td-radio-button.class.d.ts +3 -3
- package/src/components/form/td-radio-button/td-radio-button.class.js +47 -45
- package/src/components/form/td-radio-group/td-radio-group.class.d.ts +3 -3
- package/src/components/form/td-radio-group/td-radio-group.class.js +21 -19
- package/src/components/form/td-rate/td-rate.class.d.ts +0 -0
- package/src/components/form/td-rate/td-rate.class.js +1 -0
- package/src/components/form/td-rate/td-rate.interface.d.ts +0 -0
- package/src/components/form/td-rate/td-rate.interface.js +1 -0
- package/src/components/form/td-select/dropdown/dropdown.class.d.ts +3 -2
- package/src/components/form/td-select/dropdown/dropdown.class.js +15 -15
- package/src/components/form/td-select/td-select.class.d.ts +3 -1
- package/src/components/form/td-select/td-select.class.js +6 -6
- package/src/components/form/td-select/td-select.style.js +8 -8
- package/src/components/form/td-slider/td-slider.class.d.ts +0 -0
- package/src/components/form/td-slider/td-slider.class.js +1 -0
- package/src/components/form/td-slider/td-slider.interface.d.ts +0 -0
- package/src/components/form/td-slider/td-slider.interface.js +1 -0
- package/src/components/form/td-switch/td-switch.class.d.ts +8 -4
- package/src/components/form/td-switch/td-switch.class.js +92 -63
- package/src/components/form/td-switch/td-switch.interface.d.ts +7 -1
- package/src/components/form/td-switch/td-switch.interface.js +1 -0
- package/src/components/form/td-switch/td-switch.style.d.ts +1 -2
- package/src/components/form/td-switch/td-switch.style.js +1 -2
- package/src/components/form/td-switch/widget/td-switch-core.d.ts +2 -2
- package/src/components/form/td-switch/widget/td-switch-core.js +73 -71
- package/src/components/form/td-switch/widget/td-switch-left.d.ts +2 -2
- package/src/components/form/td-switch/widget/td-switch-left.js +8 -8
- package/src/components/form/td-switch/widget/td-switch-right.d.ts +3 -3
- package/src/components/form/td-switch/widget/td-switch-right.js +9 -9
- package/src/components/form/td-time-picker/td-time-picker.class.d.ts +0 -0
- package/src/components/form/td-time-picker/td-time-picker.class.js +1 -0
- package/src/components/form/td-time-picker/td-time-picker.interface.d.ts +0 -0
- package/src/components/form/td-time-picker/td-time-picker.interface.js +1 -0
- package/src/components/form/td-time-select/td-time-select.class.d.ts +0 -0
- package/src/components/form/td-time-select/td-time-select.class.js +1 -0
- package/src/components/form/td-time-select/td-time-select.interface.d.ts +0 -0
- package/src/components/form/td-time-select/td-time-select.interface.js +1 -0
- package/src/components/form/td-transfer/td-transfer.class.d.ts +0 -0
- package/src/components/form/td-transfer/td-transfer.class.js +1 -0
- package/src/components/form/td-transfer/td-transfer.interface.d.ts +0 -0
- package/src/components/form/td-transfer/td-transfer.interface.js +1 -0
- package/src/components/form/td-upload/td-upload.class.d.ts +0 -0
- package/src/components/form/td-upload/td-upload.class.js +1 -0
- package/src/components/form/td-upload/td-upload.interface.d.ts +0 -0
- package/src/components/form/td-upload/td-upload.interface.js +1 -0
- package/src/components/navigation/index.d.ts +16 -0
- package/src/components/navigation/index.js +17 -1
- package/src/components/navigation/td-affix/td-affix.class.d.ts +25 -0
- package/src/components/navigation/td-affix/td-affix.class.js +134 -0
- package/src/components/navigation/td-affix/td-affix.interface.d.ts +27 -0
- package/src/components/navigation/td-affix/td-affix.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.d.ts +8 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +30 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.d.ts +16 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor.class.d.ts +10 -0
- package/src/components/navigation/td-anchor/td-anchor.class.js +118 -0
- package/src/components/navigation/td-anchor/td-anchor.function.d.ts +2 -0
- package/src/components/navigation/td-anchor/td-anchor.function.js +91 -0
- package/src/components/navigation/td-anchor/td-anchor.interface.d.ts +44 -0
- package/src/components/navigation/td-anchor/td-anchor.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor.style.d.ts +14 -0
- package/src/components/navigation/td-anchor/td-anchor.style.js +17 -0
- package/src/components/navigation/td-backtop/td-backtop.class.d.ts +17 -0
- package/src/components/navigation/td-backtop/td-backtop.class.js +145 -0
- package/src/components/navigation/td-backtop/td-backtop.interface.d.ts +26 -0
- package/src/components/navigation/td-backtop/td-backtop.interface.js +2 -0
- package/src/components/navigation/td-backtop/td-backtop.style.d.ts +5 -0
- package/src/components/navigation/td-backtop/td-backtop.style.js +13 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.d.ts +11 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +37 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.d.ts +16 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.js +2 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.d.ts +8 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +71 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.d.ts +18 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.js +2 -0
- package/src/components/navigation/td-dropdown/td-dropdown.class.d.ts +0 -0
- package/src/components/navigation/td-dropdown/td-dropdown.class.js +1 -0
- package/src/components/navigation/td-dropdown/td-dropdown.interface.d.ts +0 -0
- package/src/components/navigation/td-dropdown/td-dropdown.interface.js +1 -0
- package/src/components/navigation/td-menu/td-menu.class.d.ts +3 -2
- package/src/components/navigation/td-menu/td-menu.class.js +11 -10
- package/src/components/navigation/td-page-header/td-page-header.class.d.ts +0 -0
- package/src/components/navigation/td-page-header/td-page-header.class.js +1 -0
- package/src/components/navigation/td-page-header/td-page-header.interface.d.ts +0 -0
- package/src/components/navigation/td-page-header/td-page-header.interface.js +1 -0
- package/src/components/navigation/td-steps/td-steps.class.d.ts +0 -0
- package/src/components/navigation/td-steps/td-steps.class.js +1 -0
- package/src/components/navigation/td-steps/td-steps.interface.d.ts +0 -0
- package/src/components/navigation/td-steps/td-steps.interface.js +1 -0
- package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +12 -0
- package/src/components/navigation/td-tabs/td-tab-bar.class.js +62 -0
- package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +10 -0
- package/src/components/navigation/td-tabs/td-tab-bar.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +31 -0
- package/src/components/navigation/td-tabs/td-tab-nav.class.js +355 -0
- package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +23 -0
- package/src/components/navigation/td-tabs/td-tab-nav.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tab-pane.class.d.ts +13 -0
- package/src/components/navigation/td-tabs/td-tab-pane.class.js +41 -0
- package/src/components/navigation/td-tabs/td-tab-pane.interface.d.ts +31 -0
- package/src/components/navigation/td-tabs/td-tab-pane.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tabs.class.d.ts +18 -0
- package/src/components/navigation/td-tabs/td-tabs.class.js +159 -0
- package/src/components/navigation/td-tabs/td-tabs.interface.d.ts +74 -0
- package/src/components/navigation/td-tabs/td-tabs.interface.js +5 -0
- package/src/components/navigation/td-tabs/td-tabs.style.d.ts +19 -0
- package/src/components/navigation/td-tabs/td-tabs.style.js +128 -0
- package/src/components/others/collapsible-box/collapsible-box.d.ts +2 -3
- package/src/components/others/collapsible-box/collapsible-box.js +5 -7
- package/src/components/others/collapsible-box/contents/contents.d.ts +2 -2
- package/src/components/others/collapsible-box/contents/contents.js +6 -8
- package/src/components/others/collapsible-box/heading/expand-heading.d.ts +2 -3
- package/src/components/others/collapsible-box/heading/expand-heading.js +13 -15
- package/src/components/others/td-divider/td-divider.class.d.ts +2 -2
- package/src/components/others/td-divider/td-divider.class.js +16 -15
- package/src/components/others/td-watermark/td-watermark.class.d.ts +0 -0
- package/src/components/others/td-watermark/td-watermark.class.js +1 -0
- package/src/components/others/td-watermark/td-watermark.interface.d.ts +0 -0
- package/src/components/others/td-watermark/td-watermark.interface.js +1 -0
- package/src/constants/event.d.ts +3 -0
- package/src/constants/event.js +6 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/styles/color-scheme.js +19 -19
- package/src/styles/function.js +13 -14
- package/src/styles/index.d.ts +1 -0
- package/src/styles/size.d.ts +0 -5
- package/src/styles/size.js +3 -3
- package/src/styles/transition.d.ts +32 -0
- package/src/styles/transition.js +222 -0
- package/src/styles/var.d.ts +10 -1
- package/src/styles/var.js +17 -3
- package/src/ui/ui.abstract.d.ts +16 -6
- package/src/ui/ui.abstract.js +39 -11
- package/src/ui/ui.interface.d.ts +7 -3
- package/src/utils/types.d.ts +8 -0
- package/src/utils/types.js +35 -0
- package/src/components/basic/td-layout/td-row/td-row.style.d.ts +0 -1
- package/src/components/basic/td-layout/td-row/td-row.style.js +0 -8
- package/src/components/form/td-select/option/option.class.d.ts +0 -6
- package/src/components/form/td-select/option-group/option-group.class.d.ts +0 -6
- /package/src/components/{form/td-select/option-group/option-group.interface.js → data/td-avatar/td-avatar.interface.js} +0 -0
- /package/src/components/{form/td-select/option/option.interface.js → data/td-badge/td-badge.interface.js} +0 -0
|
@@ -5,22 +5,22 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
6
6
|
const td_switch_style_1 = require("../td-switch.style");
|
|
7
7
|
class TdSwitchLeft extends framework_1.TypeSpan {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(params) {
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'TdSwitchLeft';
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
if (config === null || config === void 0 ? void 0 : config.inactiveIcon) {
|
|
11
|
+
this.ctrl.addAttrName('switch-label');
|
|
12
|
+
this.ctrl.addStyleObj(Object.assign(Object.assign({}, td_switch_style_1.$switchLabel), { marginRight: '10px' }));
|
|
13
|
+
if (params === null || params === void 0 ? void 0 : params.inactiveIcon) {
|
|
15
14
|
this.addChild(new td_icon_class_1.TdIcon({
|
|
16
|
-
svgObj:
|
|
15
|
+
svgObj: params.inactiveIcon
|
|
17
16
|
}));
|
|
18
17
|
}
|
|
19
|
-
if (!(
|
|
18
|
+
if (!(params === null || params === void 0 ? void 0 : params.inactiveIcon) && (params === null || params === void 0 ? void 0 : params.inactiveText)) {
|
|
20
19
|
this.addChild(new framework_1.Span({
|
|
21
|
-
text:
|
|
20
|
+
text: params.inactiveText
|
|
22
21
|
}));
|
|
23
22
|
}
|
|
23
|
+
this.props = this.setParams(params);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.TdSwitchLeft = TdSwitchLeft;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeSpan } from '@type-dom/framework';
|
|
2
|
-
import { ITdSwitchConfig } from '
|
|
2
|
+
import { ITdSwitchConfig } from '../td-switch.interface';
|
|
3
3
|
export declare class TdSwitchRight extends TypeSpan {
|
|
4
4
|
className: 'TdSwitchRight';
|
|
5
|
-
|
|
6
|
-
constructor(
|
|
5
|
+
props: ITdSwitchConfig;
|
|
6
|
+
constructor(params?: ITdSwitchConfig);
|
|
7
7
|
}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdSwitchRight = void 0;
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
|
-
const ui_1 = require("@type-dom/ui");
|
|
6
5
|
const td_switch_style_1 = require("../td-switch.style");
|
|
6
|
+
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
7
7
|
class TdSwitchRight extends framework_1.TypeSpan {
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(params) {
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'TdSwitchRight';
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
svgObj: config.activeIcon
|
|
11
|
+
this.ctrl.addStyleObj(Object.assign(Object.assign({}, td_switch_style_1.$switchLabel), { marginLeft: '10px' }));
|
|
12
|
+
if (params === null || params === void 0 ? void 0 : params.activeIcon) {
|
|
13
|
+
this.addChild(new td_icon_class_1.TdIcon({
|
|
14
|
+
svgObj: params.activeIcon
|
|
16
15
|
}));
|
|
17
16
|
}
|
|
18
|
-
if (!(
|
|
17
|
+
if (!(params === null || params === void 0 ? void 0 : params.activeIcon) && (params === null || params === void 0 ? void 0 : params.activeText)) {
|
|
19
18
|
this.addChild(new framework_1.Span({
|
|
20
|
-
text:
|
|
19
|
+
text: params.activeText
|
|
21
20
|
}));
|
|
22
21
|
}
|
|
22
|
+
this.props = this.setParams(params);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.TdSwitchRight = TdSwitchRight;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
export { TdMenu } from './td-menu/td-menu.class';
|
|
2
2
|
export type { ITdMenu } from './td-menu/td-menu.interface';
|
|
3
|
+
export { TdAffix } from './td-affix/td-affix.class';
|
|
4
|
+
export type { ITdAffix } from './td-affix/td-affix.interface';
|
|
5
|
+
export { TdAnchor } from './td-anchor/td-anchor.class';
|
|
6
|
+
export type { ITdAnchor } from './td-anchor/td-anchor.interface';
|
|
7
|
+
export { TdAnchorLink } from './td-anchor/td-anchor-link/td-anchor-link.class';
|
|
8
|
+
export type { ITdAnchorLink } from './td-anchor/td-anchor-link/td-anchor-link.interface';
|
|
9
|
+
export { TdBackTop } from './td-backtop/td-backtop.class';
|
|
10
|
+
export type { ITdBackTop } from './td-backtop/td-backtop.interface';
|
|
11
|
+
export { TdBreadcrumb } from './td-breadcrumb/td-breadcrumb.class';
|
|
12
|
+
export type { ITdBreadcrumb } from './td-breadcrumb/td-breadcrumb.interface';
|
|
13
|
+
export { TdBreadcrumbItem } from './td-breadcrumb-item/td-breadcrumb-item.class';
|
|
14
|
+
export type { ITdBreadcrumbItem } from './td-breadcrumb-item/td-breadcrumb-item.interface';
|
|
15
|
+
export { TdTabs } from './td-tabs/td-tabs.class';
|
|
16
|
+
export type * from './td-tabs/td-tabs.interface';
|
|
17
|
+
export { TdTabPane } from './td-tabs/td-tab-pane.class';
|
|
18
|
+
export type * from './td-tabs/td-tab-pane.interface';
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TdMenu = void 0;
|
|
3
|
+
exports.TdTabPane = exports.TdTabs = exports.TdBreadcrumbItem = exports.TdBreadcrumb = exports.TdBackTop = exports.TdAnchorLink = exports.TdAnchor = exports.TdAffix = exports.TdMenu = void 0;
|
|
4
4
|
var td_menu_class_1 = require("./td-menu/td-menu.class");
|
|
5
5
|
Object.defineProperty(exports, "TdMenu", { enumerable: true, get: function () { return td_menu_class_1.TdMenu; } });
|
|
6
|
+
var td_affix_class_1 = require("./td-affix/td-affix.class");
|
|
7
|
+
Object.defineProperty(exports, "TdAffix", { enumerable: true, get: function () { return td_affix_class_1.TdAffix; } });
|
|
8
|
+
var td_anchor_class_1 = require("./td-anchor/td-anchor.class");
|
|
9
|
+
Object.defineProperty(exports, "TdAnchor", { enumerable: true, get: function () { return td_anchor_class_1.TdAnchor; } });
|
|
10
|
+
var td_anchor_link_class_1 = require("./td-anchor/td-anchor-link/td-anchor-link.class");
|
|
11
|
+
Object.defineProperty(exports, "TdAnchorLink", { enumerable: true, get: function () { return td_anchor_link_class_1.TdAnchorLink; } });
|
|
12
|
+
var td_backtop_class_1 = require("./td-backtop/td-backtop.class");
|
|
13
|
+
Object.defineProperty(exports, "TdBackTop", { enumerable: true, get: function () { return td_backtop_class_1.TdBackTop; } });
|
|
14
|
+
var td_breadcrumb_class_1 = require("./td-breadcrumb/td-breadcrumb.class");
|
|
15
|
+
Object.defineProperty(exports, "TdBreadcrumb", { enumerable: true, get: function () { return td_breadcrumb_class_1.TdBreadcrumb; } });
|
|
16
|
+
var td_breadcrumb_item_class_1 = require("./td-breadcrumb-item/td-breadcrumb-item.class");
|
|
17
|
+
Object.defineProperty(exports, "TdBreadcrumbItem", { enumerable: true, get: function () { return td_breadcrumb_item_class_1.TdBreadcrumbItem; } });
|
|
18
|
+
var td_tabs_class_1 = require("./td-tabs/td-tabs.class");
|
|
19
|
+
Object.defineProperty(exports, "TdTabs", { enumerable: true, get: function () { return td_tabs_class_1.TdTabs; } });
|
|
20
|
+
var td_tab_pane_class_1 = require("./td-tabs/td-tab-pane.class");
|
|
21
|
+
Object.defineProperty(exports, "TdTabPane", { enumerable: true, get: function () { return td_tab_pane_class_1.TdTabPane; } });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
2
|
+
import { ITdAffix, ITdAffixConfig } from './td-affix.interface';
|
|
3
|
+
import { IStyle } from '@type-dom/css-type';
|
|
4
|
+
export declare class TdAffix extends UI implements ITdAffix {
|
|
5
|
+
className: 'TdAffix';
|
|
6
|
+
props: ITdAffixConfig;
|
|
7
|
+
private affix;
|
|
8
|
+
private target?;
|
|
9
|
+
private rootHeight;
|
|
10
|
+
private rootWidth;
|
|
11
|
+
private rootTop;
|
|
12
|
+
private rootBottom;
|
|
13
|
+
private updateRoot;
|
|
14
|
+
private transform;
|
|
15
|
+
private targetRect?;
|
|
16
|
+
private fixed;
|
|
17
|
+
private scrollTop;
|
|
18
|
+
private scrollContainer?;
|
|
19
|
+
private windowHeight?;
|
|
20
|
+
constructor(params?: ITdAffixConfig);
|
|
21
|
+
get rootStyle(): IStyle;
|
|
22
|
+
get affixStyle(): IStyle;
|
|
23
|
+
mounted(): void;
|
|
24
|
+
change(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdAffix = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const utils_1 = require("@type-dom/utils");
|
|
6
|
+
const framework_1 = require("@type-dom/framework");
|
|
7
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
8
|
+
class TdAffix extends ui_abstract_1.UI {
|
|
9
|
+
constructor(params) {
|
|
10
|
+
super(params);
|
|
11
|
+
console.log('TdAffix constructor . ');
|
|
12
|
+
this.className = 'TdAffix';
|
|
13
|
+
this.ctrl.addAttrName('td-affix');
|
|
14
|
+
this.windowHeight = (0, framework_1.useWindowSize)().height;
|
|
15
|
+
const { height, width, top, bottom, update } = (0, framework_1.useElementBounding)(this, {
|
|
16
|
+
windowScroll: false
|
|
17
|
+
});
|
|
18
|
+
this.rootHeight = height;
|
|
19
|
+
this.rootWidth = width;
|
|
20
|
+
this.rootTop = top;
|
|
21
|
+
this.rootBottom = bottom;
|
|
22
|
+
this.updateRoot = update;
|
|
23
|
+
// const rect = this.dom.getBoundingClientRect();
|
|
24
|
+
// console.log('rect is ', rect);
|
|
25
|
+
this.targetRect = (params === null || params === void 0 ? void 0 : params.target)
|
|
26
|
+
? (0, framework_1.useElementBounding)(params.target.value)
|
|
27
|
+
: undefined;
|
|
28
|
+
this.fixed = false;
|
|
29
|
+
this.scrollTop = 0;
|
|
30
|
+
this.transform = 0;
|
|
31
|
+
// todo rootStyle
|
|
32
|
+
this.ctrl.addStyleObj(this.rootStyle);
|
|
33
|
+
this.affix = new framework_1.Div({
|
|
34
|
+
name: 'fix',
|
|
35
|
+
styleObj: this.affixStyle
|
|
36
|
+
});
|
|
37
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
38
|
+
this.affix.slotChild(params.slot);
|
|
39
|
+
}
|
|
40
|
+
this.addChild(this.affix);
|
|
41
|
+
this.props = this.setParams(params);
|
|
42
|
+
}
|
|
43
|
+
get rootStyle() {
|
|
44
|
+
return {
|
|
45
|
+
height: this.fixed ? this.rootHeight : '',
|
|
46
|
+
width: this.fixed ? this.rootWidth : ''
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
get affixStyle() {
|
|
50
|
+
const props = this.props;
|
|
51
|
+
const offset = (props === null || props === void 0 ? void 0 : props.offset) ? (0, utils_1.addUnit)(props.offset) : 0;
|
|
52
|
+
const position = (props === null || props === void 0 ? void 0 : props.position) || 'top';
|
|
53
|
+
return {
|
|
54
|
+
position: this.fixed ? 'fixed' : '',
|
|
55
|
+
// height: this.rootHeight + 'px',
|
|
56
|
+
// width: this.rootWidth + 'px',
|
|
57
|
+
top: position === 'top' ? offset : '',
|
|
58
|
+
bottom: position === 'bottom' ? offset : '',
|
|
59
|
+
transform: this.transform ? `translateY(${this.transform}px)` : '',
|
|
60
|
+
zIndex: (props === null || props === void 0 ? void 0 : props.zIndex) || 100
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
mounted() {
|
|
64
|
+
var _a, _b, _c;
|
|
65
|
+
console.log('TdAffix mounted . ');
|
|
66
|
+
if ((_a = this.props) === null || _a === void 0 ? void 0 : _a.target) {
|
|
67
|
+
if (!((_b = this.props) === null || _b === void 0 ? void 0 : _b.target.value)) {
|
|
68
|
+
throw Error(`Target is not existed: ${(_c = this.props) === null || _c === void 0 ? void 0 : _c.target}`);
|
|
69
|
+
}
|
|
70
|
+
this.target = this.props.target.value;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.target = document.documentElement;
|
|
74
|
+
}
|
|
75
|
+
(0, framework_1.nextTick)(() => {
|
|
76
|
+
var _a;
|
|
77
|
+
console.log('nextTick . ');
|
|
78
|
+
this.scrollContainer = (0, utils_1.getScrollContainer)(this.dom, true);
|
|
79
|
+
console.log('this.scrollContainer is ', this.scrollContainer);
|
|
80
|
+
this.updateRoot();
|
|
81
|
+
this.scrollContainer &&
|
|
82
|
+
(0, rxjs_1.fromEvent)(this.scrollContainer, 'scroll').subscribe(() => {
|
|
83
|
+
console.log('this.scrollContainer scroll . ');
|
|
84
|
+
// if (this.fixed) {
|
|
85
|
+
this.ctrl.setStyleObj(this.rootStyle);
|
|
86
|
+
this.affix.ctrl.setStyleObj(this.affixStyle);
|
|
87
|
+
// }
|
|
88
|
+
this.updateRoot();
|
|
89
|
+
});
|
|
90
|
+
(_a = this.scrollContainer) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', () => {
|
|
91
|
+
console.log('this.scrollContent scroll . listener . ');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
change() {
|
|
96
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
97
|
+
if (!this.scrollContainer)
|
|
98
|
+
return;
|
|
99
|
+
this.scrollTop =
|
|
100
|
+
this.scrollContainer instanceof Window
|
|
101
|
+
? document.documentElement.scrollTop
|
|
102
|
+
: this.scrollContainer.scrollTop || 0;
|
|
103
|
+
if (((_a = this.props) === null || _a === void 0 ? void 0 : _a.position) === 'top') {
|
|
104
|
+
if ((_b = this.props) === null || _b === void 0 ? void 0 : _b.target) {
|
|
105
|
+
const difference = ((_d = (_c = this.targetRect) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 0) -
|
|
106
|
+
((_f = (_e = this.props) === null || _e === void 0 ? void 0 : _e.offset) !== null && _f !== void 0 ? _f : 0) -
|
|
107
|
+
this.rootHeight;
|
|
108
|
+
this.fixed =
|
|
109
|
+
((_h = (_g = this.props) === null || _g === void 0 ? void 0 : _g.offset) !== null && _h !== void 0 ? _h : 0) > this.rootTop &&
|
|
110
|
+
((_k = (_j = this.targetRect) === null || _j === void 0 ? void 0 : _j.bottom) !== null && _k !== void 0 ? _k : 0) > 0;
|
|
111
|
+
this.transform = difference < 0 ? difference : 0;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.fixed = ((_m = (_l = this.props) === null || _l === void 0 ? void 0 : _l.offset) !== null && _m !== void 0 ? _m : 0) > this.rootTop;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if ((_o = this.props) === null || _o === void 0 ? void 0 : _o.target) {
|
|
118
|
+
const difference = ((_p = this.windowHeight) !== null && _p !== void 0 ? _p : 0) -
|
|
119
|
+
((_r = (_q = this.targetRect) === null || _q === void 0 ? void 0 : _q.top) !== null && _r !== void 0 ? _r : 0) -
|
|
120
|
+
((_t = (_s = this.props) === null || _s === void 0 ? void 0 : _s.offset) !== null && _t !== void 0 ? _t : 0) -
|
|
121
|
+
this.rootHeight;
|
|
122
|
+
this.fixed =
|
|
123
|
+
((_u = this.windowHeight) !== null && _u !== void 0 ? _u : 0) - ((_w = (_v = this.props) === null || _v === void 0 ? void 0 : _v.offset) !== null && _w !== void 0 ? _w : 0) <
|
|
124
|
+
this.rootBottom &&
|
|
125
|
+
((_x = this.windowHeight) !== null && _x !== void 0 ? _x : 0) > ((_z = (_y = this.targetRect) === null || _y === void 0 ? void 0 : _y.top) !== null && _z !== void 0 ? _z : 0);
|
|
126
|
+
this.transform = difference < 0 ? -difference : 0;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
this.fixed =
|
|
130
|
+
((_0 = this.windowHeight) !== null && _0 !== void 0 ? _0 : 0) - ((_2 = (_1 = this.props) === null || _1 === void 0 ? void 0 : _1.offset) !== null && _2 !== void 0 ? _2 : 0) < this.rootBottom;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.TdAffix = TdAffix;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
2
|
+
import { IJsonData, XProxy } from '@type-dom/framework';
|
|
3
|
+
export interface ITdAffix extends IUI {
|
|
4
|
+
className: 'TdAffix';
|
|
5
|
+
}
|
|
6
|
+
export interface ITdAffixConfig extends IUIConfig {
|
|
7
|
+
/**
|
|
8
|
+
* @description affix element zIndex value
|
|
9
|
+
* default: 100,
|
|
10
|
+
* */
|
|
11
|
+
zIndex?: number | string;
|
|
12
|
+
/**
|
|
13
|
+
* @description target container. (CSS selector)
|
|
14
|
+
* default: '',
|
|
15
|
+
*/
|
|
16
|
+
target?: XProxy<IJsonData>;
|
|
17
|
+
/**
|
|
18
|
+
* @description offset distance
|
|
19
|
+
* default: 0,
|
|
20
|
+
* */
|
|
21
|
+
offset?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @description position of affix
|
|
24
|
+
* default: 'top',
|
|
25
|
+
* */
|
|
26
|
+
position?: 'top' | 'bottom';
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UI } from '../../../../ui/ui.abstract';
|
|
2
|
+
import { ITdAnchorLink, ITdAnchorLinkConfig } from './td-anchor-link.interface';
|
|
3
|
+
export declare class TdAnchorLink extends UI implements ITdAnchorLink {
|
|
4
|
+
className: 'TdAnchorLink';
|
|
5
|
+
private href;
|
|
6
|
+
private list?;
|
|
7
|
+
constructor(params?: ITdAnchorLinkConfig);
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdAnchorLink = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
6
|
+
class TdAnchorLink extends ui_abstract_1.UI {
|
|
7
|
+
constructor(params) {
|
|
8
|
+
super(params);
|
|
9
|
+
this.className = 'TdAnchorLink';
|
|
10
|
+
this.href = new framework_1.A({
|
|
11
|
+
text: (params === null || params === void 0 ? void 0 : params.title) || '',
|
|
12
|
+
attrObj: {
|
|
13
|
+
href: (params === null || params === void 0 ? void 0 : params.href) || ''
|
|
14
|
+
},
|
|
15
|
+
events: {
|
|
16
|
+
click: () => {
|
|
17
|
+
console.log('click . ');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
this.addChild(this.href);
|
|
22
|
+
if (params === null || params === void 0 ? void 0 : params.contents) {
|
|
23
|
+
this.list = new framework_1.Div({});
|
|
24
|
+
this.list.addChildren(...params.contents);
|
|
25
|
+
this.addChild(this.list);
|
|
26
|
+
}
|
|
27
|
+
this.setParams(params);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TdAnchorLink = TdAnchorLink;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IUI, IUIConfig } from '../../../../ui/ui.interface';
|
|
2
|
+
import { TypeElement } from '@type-dom/framework';
|
|
3
|
+
export interface ITdAnchorLink extends IUI {
|
|
4
|
+
className: 'TdAnchorLink';
|
|
5
|
+
}
|
|
6
|
+
export interface ITdAnchorLinkConfig extends IUIConfig {
|
|
7
|
+
/**
|
|
8
|
+
* @description the text content of the anchor link
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description The address of the anchor link
|
|
13
|
+
*/
|
|
14
|
+
href?: string;
|
|
15
|
+
contents?: TypeElement[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
2
|
+
import { ITdAnchor, ITdAnchorConfig } from './td-anchor.interface';
|
|
3
|
+
export declare class TdAnchor extends UI implements ITdAnchor {
|
|
4
|
+
className: 'TdAnchor';
|
|
5
|
+
props: ITdAnchorConfig;
|
|
6
|
+
private marker?;
|
|
7
|
+
private list?;
|
|
8
|
+
constructor(params: ITdAnchorConfig);
|
|
9
|
+
handleClick(e: MouseEvent, href?: string): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdAnchor = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
|
+
const td_anchor_style_1 = require("./td-anchor.style");
|
|
7
|
+
const td_anchor_function_1 = require("./td-anchor.function");
|
|
8
|
+
class TdAnchor extends ui_abstract_1.UI {
|
|
9
|
+
constructor(params) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
super(params);
|
|
12
|
+
this.className = 'TdAnchor';
|
|
13
|
+
this.ctrl.addStyleObj({
|
|
14
|
+
position: 'relative',
|
|
15
|
+
// background-color: getCssVar('anchor-bg-color')
|
|
16
|
+
backgroundColor: td_anchor_style_1.$anchor.bgColor.default
|
|
17
|
+
});
|
|
18
|
+
if (params === null || params === void 0 ? void 0 : params.marker) {
|
|
19
|
+
this.marker = new framework_1.Div({
|
|
20
|
+
styleObj: {
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
// background-color: getCssVar('anchor-marker-bg-color'),
|
|
23
|
+
backgroundColor: td_anchor_style_1.$anchor.markerBgColor,
|
|
24
|
+
borderRadius: '4px',
|
|
25
|
+
opacity: 0,
|
|
26
|
+
zIndex: 0
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
this.addChild(this.marker);
|
|
30
|
+
}
|
|
31
|
+
this.list = new framework_1.Div({
|
|
32
|
+
name: 'list'
|
|
33
|
+
});
|
|
34
|
+
this.addChild(this.list);
|
|
35
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
36
|
+
this.list.slotChild(params.slot);
|
|
37
|
+
}
|
|
38
|
+
const type = (params === null || params === void 0 ? void 0 : params.type) || 'default';
|
|
39
|
+
const direction = (params === null || params === void 0 ? void 0 : params.direction) || 'vertical';
|
|
40
|
+
if (direction === 'vertical') {
|
|
41
|
+
(_a = this.marker) === null || _a === void 0 ? void 0 : _a.ctrl.addStyleObj({
|
|
42
|
+
width: '4px',
|
|
43
|
+
height: '14px',
|
|
44
|
+
top: '8px',
|
|
45
|
+
left: '0',
|
|
46
|
+
transition: 'top 0.25s ease-in-out, opacity 0.25s'
|
|
47
|
+
});
|
|
48
|
+
this.list.ctrl.addStyleObj({
|
|
49
|
+
// paddingLeft: getCssVar('anchor-padding-indent'),
|
|
50
|
+
paddingLeft: td_anchor_style_1.$anchor.paddingIndent
|
|
51
|
+
});
|
|
52
|
+
if (type === 'underline') {
|
|
53
|
+
this.unshiftChild(new framework_1.I({
|
|
54
|
+
styleObj: {
|
|
55
|
+
position: 'absolute',
|
|
56
|
+
left: '0',
|
|
57
|
+
width: '2px',
|
|
58
|
+
height: '100%',
|
|
59
|
+
backgroundColor: 'rgba(5, 5, 5, 0.06)',
|
|
60
|
+
content: ''
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
(_b = this.marker) === null || _b === void 0 ? void 0 : _b.ctrl.addStyleObj({
|
|
64
|
+
width: '2px',
|
|
65
|
+
borderRadius: 'unset'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
(_c = this.marker) === null || _c === void 0 ? void 0 : _c.ctrl.addStyleObj({
|
|
71
|
+
height: '2px',
|
|
72
|
+
width: '20px',
|
|
73
|
+
bottom: '0',
|
|
74
|
+
transition: 'left 0.25s ease-in-out, opacity 0.25s, width 0.25s'
|
|
75
|
+
});
|
|
76
|
+
this.list.ctrl.addStyleObj({
|
|
77
|
+
display: 'flex',
|
|
78
|
+
paddingBottom: '4px'
|
|
79
|
+
});
|
|
80
|
+
this.list.childNodes.forEach((item, index) => {
|
|
81
|
+
if (item instanceof framework_1.TypeHtml) {
|
|
82
|
+
if (index === 0) {
|
|
83
|
+
item.ctrl.addStyleObj({
|
|
84
|
+
paddingLeft: '0'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
item.ctrl.addStyleObj({
|
|
89
|
+
paddingLeft: '16px'
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (type === 'underline') {
|
|
95
|
+
this.unshiftChild(new framework_1.I({
|
|
96
|
+
styleObj: {
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
bottom: '0',
|
|
99
|
+
width: '100%',
|
|
100
|
+
height: '2px',
|
|
101
|
+
backgroundColor: 'rgba(5, 5, 5, 0.06)',
|
|
102
|
+
content: ''
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
(_d = this.marker) === null || _d === void 0 ? void 0 : _d.ctrl.addStyleObj({
|
|
106
|
+
height: '2px',
|
|
107
|
+
borderRadius: 'unset'
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
this.props = this.setParams(params);
|
|
112
|
+
}
|
|
113
|
+
handleClick(e, href) {
|
|
114
|
+
// emit('click', e, href)
|
|
115
|
+
(0, td_anchor_function_1.scrollTo)(href, this.props);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.TdAnchor = TdAnchor;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scrollTo = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const utils_1 = require("@type-dom/utils");
|
|
6
|
+
const currentAnchor = (0, framework_1.createProxy)(null);
|
|
7
|
+
const containerEl = (0, framework_1.createProxy)(null); // ref<HTMLElement | Window>()
|
|
8
|
+
const links = {};
|
|
9
|
+
let isScrolling = false;
|
|
10
|
+
let currentScrollTop = 0;
|
|
11
|
+
const addLink = (state) => {
|
|
12
|
+
links[state.href] = state.el;
|
|
13
|
+
};
|
|
14
|
+
const removeLink = (href) => {
|
|
15
|
+
delete links[href];
|
|
16
|
+
};
|
|
17
|
+
const setCurrentAnchor = (href) => {
|
|
18
|
+
const activeHref = currentAnchor.value;
|
|
19
|
+
if (activeHref !== href) {
|
|
20
|
+
currentAnchor.value = href;
|
|
21
|
+
// emit('change', href)
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
let clearAnimate = null;
|
|
25
|
+
const scrollToAnchor = (href, props) => {
|
|
26
|
+
if (!containerEl.value)
|
|
27
|
+
return;
|
|
28
|
+
const target = (0, utils_1.getElement)(href);
|
|
29
|
+
if (!target)
|
|
30
|
+
return;
|
|
31
|
+
if (clearAnimate)
|
|
32
|
+
clearAnimate();
|
|
33
|
+
isScrolling = true;
|
|
34
|
+
const scrollEle = (0, utils_1.getScrollElement)(target, containerEl.value);
|
|
35
|
+
const distance = (0, utils_1.getOffsetTopDistance)(target, scrollEle);
|
|
36
|
+
const max = scrollEle.scrollHeight - scrollEle.clientHeight;
|
|
37
|
+
const to = Math.min(distance - ((props === null || props === void 0 ? void 0 : props.offset) || 0), max);
|
|
38
|
+
clearAnimate = (0, utils_1.animateScrollTo)(containerEl.value, currentScrollTop, to, (props === null || props === void 0 ? void 0 : props.duration) || 300, () => {
|
|
39
|
+
// make sure it is executed after throttleByRaf's handleScroll
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
isScrolling = false;
|
|
42
|
+
}, 20);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const scrollTo = (href, config) => {
|
|
46
|
+
if (href) {
|
|
47
|
+
setCurrentAnchor(href);
|
|
48
|
+
scrollToAnchor(href, config);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.scrollTo = scrollTo;
|
|
52
|
+
//
|
|
53
|
+
// const handleScroll = throttleByRaf(() => {
|
|
54
|
+
// if (containerEl.value) {
|
|
55
|
+
// currentScrollTop = getScrollTop(containerEl.value);
|
|
56
|
+
// }
|
|
57
|
+
// const currentHref = getCurrentHref();
|
|
58
|
+
// if (isScrolling || isUndefined(currentHref)) return;
|
|
59
|
+
// setCurrentAnchor(currentHref);
|
|
60
|
+
// });
|
|
61
|
+
//
|
|
62
|
+
//
|
|
63
|
+
// const getCurrentHref = (props?: ITdAnchorConfig) => {
|
|
64
|
+
// if (!containerEl.value) return;
|
|
65
|
+
// const scrollTop = getScrollTop(containerEl.value);
|
|
66
|
+
// const anchorTopList: { top: number; href: string }[] = [];
|
|
67
|
+
//
|
|
68
|
+
// for (const href of Object.keys(links)) {
|
|
69
|
+
// const target = getElement(href);
|
|
70
|
+
// if (!target) continue;
|
|
71
|
+
// const scrollEle = getScrollElement(target, containerEl.value);
|
|
72
|
+
// const distance = getOffsetTopDistance(target, scrollEle);
|
|
73
|
+
// anchorTopList.push({
|
|
74
|
+
// top: distance - (props?.offset || 0) - (props?.bound || 15),
|
|
75
|
+
// href
|
|
76
|
+
// });
|
|
77
|
+
// }
|
|
78
|
+
// anchorTopList.sort((prev, next) => prev.top - next.top);
|
|
79
|
+
//
|
|
80
|
+
// for (let i = 0; i < anchorTopList.length; i++) {
|
|
81
|
+
// const item = anchorTopList[i];
|
|
82
|
+
// const next = anchorTopList[i + 1];
|
|
83
|
+
//
|
|
84
|
+
// if (i === 0 && scrollTop === 0) {
|
|
85
|
+
// return '';
|
|
86
|
+
// }
|
|
87
|
+
// if (item.top <= scrollTop && (!next || next.top > scrollTop)) {
|
|
88
|
+
// return item.href;
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// };
|