@type-dom/ui 0.0.4 → 0.0.5
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 +1 -1
- 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 +26 -8
- 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 +39 -9
- 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 +11 -2
- 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 +19 -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 +1 -1
- 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 +8 -8
- 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 +3 -3
- 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 +16 -2
- 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
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdCollapseItem = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const svgs_1 = require("@type-dom/svgs");
|
|
6
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
|
+
const var_1 = require("../../../styles/var");
|
|
8
|
+
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
9
|
+
// import { $collapseTransition, $collapseTransitionActive, $transition } from '../../../styles/transition';
|
|
10
|
+
const td_collapse_style_1 = require("../td-collapse/td-collapse.style");
|
|
11
|
+
const td_collapse_transition_class_1 = require("../td-collapse-transition/td-collapse-transition.class");
|
|
12
|
+
class TdCollapseItem extends ui_abstract_1.UI {
|
|
13
|
+
constructor(params) {
|
|
14
|
+
var _a;
|
|
15
|
+
super(params, 'fragment');
|
|
16
|
+
this.className = 'TdCollapseItem';
|
|
17
|
+
this.headerBtn = new framework_1.Button({
|
|
18
|
+
name: 'collapse-item-header',
|
|
19
|
+
attrObj: {
|
|
20
|
+
type: 'button',
|
|
21
|
+
// ariaControls: scopedHeadId,
|
|
22
|
+
// ariaExpanded: 'isActive',
|
|
23
|
+
tabIndex: this.disabled ? -1 : 0
|
|
24
|
+
},
|
|
25
|
+
styleObj: {
|
|
26
|
+
width: '100%',
|
|
27
|
+
padding: 0,
|
|
28
|
+
border: 'none',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
// height: getCssVar('collapse-header-height'),
|
|
32
|
+
height: td_collapse_style_1.$collapse.headerHeight,
|
|
33
|
+
// line-height: getCssVar('collapse-header-height'),
|
|
34
|
+
lineHeight: td_collapse_style_1.$collapse.headerHeight,
|
|
35
|
+
// background-color: getCssVar('collapse-header-bg-color'),
|
|
36
|
+
backgroundColor: td_collapse_style_1.$collapse.headerBgColor,
|
|
37
|
+
// color: getCssVar('collapse-header-text-color'),
|
|
38
|
+
color: td_collapse_style_1.$collapse.headerTextColor,
|
|
39
|
+
cursor: 'pointer',
|
|
40
|
+
// border-bottom: 1px solid getCssVar('collapse-border-color'),
|
|
41
|
+
borderBottom: '1px solid ' + td_collapse_style_1.$collapse.borderColor,
|
|
42
|
+
// font-size: getCssVar('collapse-header-font-size'),
|
|
43
|
+
fontSize: td_collapse_style_1.$collapse.headerFontSize,
|
|
44
|
+
fontWeight: 500,
|
|
45
|
+
// transition: border-bottom-color getCssVar('transition-duration'),
|
|
46
|
+
transition: 'border-bottom-color ' + var_1.$transitionDuration,
|
|
47
|
+
outline: 'none'
|
|
48
|
+
},
|
|
49
|
+
events: {
|
|
50
|
+
click: () => {
|
|
51
|
+
const nameId = (params === null || params === void 0 ? void 0 : params.nameId) || '';
|
|
52
|
+
this.handleHeaderClick(nameId);
|
|
53
|
+
},
|
|
54
|
+
// keydown.space.enter.stop.prevent: () => {
|
|
55
|
+
// },
|
|
56
|
+
keydown: (event) => {
|
|
57
|
+
if (event.key === 'Enter' ||
|
|
58
|
+
event.key === ' ') {
|
|
59
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
60
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
61
|
+
this.handleEnterClick();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
focus: () => {
|
|
65
|
+
this.handleFocus();
|
|
66
|
+
},
|
|
67
|
+
blur: (evt, element) => {
|
|
68
|
+
this.focusing = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
this.addChild(this.headerBtn);
|
|
73
|
+
if ((_a = params === null || params === void 0 ? void 0 : params.slots) === null || _a === void 0 ? void 0 : _a.title) {
|
|
74
|
+
this.headerBtn.slotChild(params.slots.title);
|
|
75
|
+
}
|
|
76
|
+
else if (params === null || params === void 0 ? void 0 : params.title) {
|
|
77
|
+
this.headerBtn.setTitle(params.title);
|
|
78
|
+
}
|
|
79
|
+
this.arrowIcon = new td_icon_class_1.TdIcon({
|
|
80
|
+
svgObj: new svgs_1.ElArrowRightSvg(),
|
|
81
|
+
styleObj: {
|
|
82
|
+
margin: '0 8px 0 auto',
|
|
83
|
+
// transition: transform getCssVar('transition-duration'),
|
|
84
|
+
transition: 'transform ' + var_1.$transitionDuration,
|
|
85
|
+
fontWeight: 300
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.headerBtn.addChild(this.arrowIcon);
|
|
89
|
+
this.wrapper = new framework_1.Div({
|
|
90
|
+
name: 'wrapper',
|
|
91
|
+
attrObj: {
|
|
92
|
+
ariaHidden: 'true',
|
|
93
|
+
role: 'region'
|
|
94
|
+
// ariaLabelledby: scopedHeadId,
|
|
95
|
+
},
|
|
96
|
+
styleObj: {
|
|
97
|
+
// display: 'none',
|
|
98
|
+
willChange: 'height',
|
|
99
|
+
// maxHeight: 0,
|
|
100
|
+
// background-color: getCssVar('collapse-content-bg-color'),
|
|
101
|
+
backgroundColor: td_collapse_style_1.$collapse.contentBgColor,
|
|
102
|
+
overflow: 'hidden',
|
|
103
|
+
boxSizing: 'border-box',
|
|
104
|
+
// border-bottom: 1px solid getCssVar('collapse-border-color'),
|
|
105
|
+
borderBottom: '1px solid ' + td_collapse_style_1.$collapse.borderColor
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
this.content = new framework_1.Div({
|
|
109
|
+
name: 'collapse-item-content',
|
|
110
|
+
styleObj: {
|
|
111
|
+
paddingBottom: '25px',
|
|
112
|
+
// font-size: getCssVar('collapse-content-font-size'),
|
|
113
|
+
fontSize: td_collapse_style_1.$collapse.contentFontSize,
|
|
114
|
+
// color: getCssVar('collapse-content-text-color'),
|
|
115
|
+
color: td_collapse_style_1.$collapse.contentTextColor,
|
|
116
|
+
lineHeight: 1.769230769230769
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
120
|
+
this.content.slotChild(params.slot);
|
|
121
|
+
}
|
|
122
|
+
this.wrapper.addChild(this.content);
|
|
123
|
+
this.transition = new td_collapse_transition_class_1.TdCollapseTransition({
|
|
124
|
+
parent: this,
|
|
125
|
+
slot: this.wrapper
|
|
126
|
+
});
|
|
127
|
+
this.addChild(this.transition);
|
|
128
|
+
this.props = this.setParams(params);
|
|
129
|
+
}
|
|
130
|
+
setActive(active) {
|
|
131
|
+
if (active) {
|
|
132
|
+
// todo transition
|
|
133
|
+
// this.wrapper.addStyleObj($collapseTransitionActive);
|
|
134
|
+
// collapseTransitionConfig.beforeEnter && collapseTransitionConfig.beforeEnter(this.wrapper);
|
|
135
|
+
// collapseTransitionConfig.enter && collapseTransitionConfig.enter(this.wrapper);
|
|
136
|
+
// collapseTransitionConfig.afterEnter && collapseTransitionConfig.afterEnter(this.wrapper);
|
|
137
|
+
// collapseTransitionConfig.enterCancelled(this.wrapper);
|
|
138
|
+
// nextFrame(() => {
|
|
139
|
+
// // 计算内容的高度
|
|
140
|
+
// const contentHeight = this.wrapper.dom.scrollHeight + 'px';
|
|
141
|
+
// console.log('contentHeight is ', contentHeight);
|
|
142
|
+
// this.wrapper.setStyleObj({
|
|
143
|
+
// maxHeight: contentHeight,
|
|
144
|
+
// // height: '50px',
|
|
145
|
+
// // opacity: 1,
|
|
146
|
+
// // display: undefined,
|
|
147
|
+
// });
|
|
148
|
+
// });
|
|
149
|
+
this.transition.showSlot(true);
|
|
150
|
+
this.headerBtn.ctrl.setStyleObj({
|
|
151
|
+
borderBottomColor: 'transparent'
|
|
152
|
+
});
|
|
153
|
+
this.arrowIcon.ctrl.setStyleObj({
|
|
154
|
+
transform: 'rotate(90deg)'
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// todo transition
|
|
159
|
+
// this.wrapper.addStyleObj($collapseTransition);
|
|
160
|
+
// nextFrame(() => {
|
|
161
|
+
// this.wrapper.setStyleObj({
|
|
162
|
+
// maxHeight: 0,
|
|
163
|
+
// // height: '0px',
|
|
164
|
+
// // opacity: 0,
|
|
165
|
+
// // display: 'none',
|
|
166
|
+
// // transition: 'transform 1s', // + $transitionDuration,
|
|
167
|
+
// });
|
|
168
|
+
// });
|
|
169
|
+
this.transition.showSlot(false);
|
|
170
|
+
this.headerBtn.ctrl.setStyleObj({
|
|
171
|
+
transition: 'transform ' + var_1.$transitionDuration
|
|
172
|
+
});
|
|
173
|
+
this.arrowIcon.ctrl.setStyleObj({
|
|
174
|
+
transform: 'rotate(0deg)'
|
|
175
|
+
});
|
|
176
|
+
// todo transition
|
|
177
|
+
// this.wrapper.addStyleObj($collapseTransition);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
setDisable(disabled) {
|
|
181
|
+
if (disabled) {
|
|
182
|
+
this.headerBtn.ctrl.setStyleObj({
|
|
183
|
+
// color: getCssVar('text-color-disabled'),
|
|
184
|
+
color: var_1.$textColor.disabled,
|
|
185
|
+
cursor: 'not-allowed'
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this.headerBtn.ctrl.setStyleObj({
|
|
190
|
+
// color: getCssVar('collapse-header-text-color'),
|
|
191
|
+
color: td_collapse_style_1.$collapse.headerTextColor,
|
|
192
|
+
cursor: 'pointer'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
handleFocus() {
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
if (!this.isClick) {
|
|
199
|
+
this.focusing = true;
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
this.isClick = false;
|
|
203
|
+
}
|
|
204
|
+
}, 50);
|
|
205
|
+
}
|
|
206
|
+
handleHeaderClick(name) {
|
|
207
|
+
var _a;
|
|
208
|
+
console.log('handleHeaderClick, name is ', name);
|
|
209
|
+
if (this.props.disabled) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.handleItemClick(name);
|
|
213
|
+
this.focusing = false;
|
|
214
|
+
this.isClick = true;
|
|
215
|
+
}
|
|
216
|
+
handleEnterClick() {
|
|
217
|
+
var _a;
|
|
218
|
+
// name todo
|
|
219
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.handleItemClick('name');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
exports.TdCollapseItem = TdCollapseItem;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
2
|
+
export interface ITdCollapseItem extends IUI {
|
|
3
|
+
className: 'TdCollapseItem';
|
|
4
|
+
}
|
|
5
|
+
export interface ITdCollapseItemConfig extends IUIConfig {
|
|
6
|
+
/**
|
|
7
|
+
* @description title of the panel
|
|
8
|
+
* default: '',
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description unique identification of the panel
|
|
13
|
+
* default: undefined,
|
|
14
|
+
*/
|
|
15
|
+
nameId?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* @description disable the collapse item
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ITransitionConfig, TypeTransition } from '@type-dom/framework';
|
|
2
|
+
import { ITdCollapseTransition } from './td-collapse-transition.interface';
|
|
3
|
+
export declare class TdCollapseTransition extends TypeTransition implements ITdCollapseTransition {
|
|
4
|
+
className: 'TdCollapseTransition';
|
|
5
|
+
constructor(params?: ITransitionConfig);
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdCollapseTransition = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const td_collapse_transition_util_1 = require("./td-collapse-transition.util");
|
|
6
|
+
class TdCollapseTransition extends framework_1.TypeTransition {
|
|
7
|
+
constructor(params) {
|
|
8
|
+
super(Object.assign(td_collapse_transition_util_1.collapseTransitionConfig, params));
|
|
9
|
+
this.className = 'TdCollapseTransition';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.TdCollapseTransition = TdCollapseTransition;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collapseTransitionConfig = void 0;
|
|
4
|
+
const reset = (element) => {
|
|
5
|
+
const el = element === null || element === void 0 ? void 0 : element.dom;
|
|
6
|
+
if (!el) {
|
|
7
|
+
throw Error('element is not exist . ');
|
|
8
|
+
}
|
|
9
|
+
// el.style.maxHeight = '';
|
|
10
|
+
// el.style.overflow = el.dataset.oldOverflow
|
|
11
|
+
// el.style.paddingTop = el.dataset.oldPaddingTop
|
|
12
|
+
// el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
13
|
+
element === null || element === void 0 ? void 0 : element.ctrl.setStyleObj({
|
|
14
|
+
maxHeight: '',
|
|
15
|
+
overflow: el.dataset.oldOverflow,
|
|
16
|
+
paddingTop: el.dataset.oldPaddingTop,
|
|
17
|
+
paddingBottom: el.dataset.oldPaddingBottom
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.collapseTransitionConfig = {
|
|
21
|
+
onBeforeEnter(element) {
|
|
22
|
+
console.log('beforeEnter . ');
|
|
23
|
+
const el = element === null || element === void 0 ? void 0 : element.dom;
|
|
24
|
+
if (!el) {
|
|
25
|
+
throw Error('element is not exist . ');
|
|
26
|
+
}
|
|
27
|
+
if (!el.dataset) {
|
|
28
|
+
// el.dataset = {};
|
|
29
|
+
element.ctrl.setAttribute('dataset', false);
|
|
30
|
+
}
|
|
31
|
+
element.ctrl.setAttrObj({
|
|
32
|
+
dataOldPaddingTop: el.style.paddingTop,
|
|
33
|
+
dataOldPaddingBottom: el.style.paddingBottom
|
|
34
|
+
});
|
|
35
|
+
// el.dataset.oldPaddingTop = el.style.paddingTop
|
|
36
|
+
// el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
37
|
+
if (el.style.height) {
|
|
38
|
+
// el.dataset.existsHeight = el.style.height
|
|
39
|
+
element.ctrl.setAttrObj({
|
|
40
|
+
dataExistsHeight: el.style.height
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// el.style.maxHeight = 0
|
|
44
|
+
// el.style.paddingTop = 0
|
|
45
|
+
// el.style.paddingBottom = 0
|
|
46
|
+
element.ctrl.setStyleObj({
|
|
47
|
+
maxHeight: 0,
|
|
48
|
+
paddingTop: 0,
|
|
49
|
+
paddingBottom: 0,
|
|
50
|
+
transition: 'max-height .3s ease-in-out'
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onEnter(element) {
|
|
54
|
+
console.log('enter . ');
|
|
55
|
+
const el = element === null || element === void 0 ? void 0 : element.dom;
|
|
56
|
+
if (!el) {
|
|
57
|
+
throw Error('element is not exist . ');
|
|
58
|
+
}
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
element.ctrl.setAttrObj({
|
|
61
|
+
dataOldOverflow: el.style.overflow
|
|
62
|
+
});
|
|
63
|
+
// el.dataset.oldOverflow = el.style.overflow
|
|
64
|
+
if (el.dataset.existsHeight) {
|
|
65
|
+
// el.style.maxHeight = el.dataset.existsHeight
|
|
66
|
+
element.ctrl.setStyleObj({
|
|
67
|
+
maxHeight: el.dataset.existsHeight
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else if (el.scrollHeight !== 0) {
|
|
71
|
+
// el.style.maxHeight = `${el.scrollHeight}px`
|
|
72
|
+
element.ctrl.setStyleObj({
|
|
73
|
+
maxHeight: `${el.scrollHeight}px`
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// el.style.maxHeight = 0
|
|
78
|
+
element.ctrl.setStyleObj({
|
|
79
|
+
maxHeight: 0
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// el.style.paddingTop = el.dataset.oldPaddingTop
|
|
83
|
+
// el.style.paddingBottom = el.dataset.oldPaddingBottom
|
|
84
|
+
// el.style.overflow = 'hidden'
|
|
85
|
+
element.ctrl.setStyleObj({
|
|
86
|
+
paddingTop: el.dataset.oldPaddingTop,
|
|
87
|
+
paddingBottom: el.dataset.oldPaddingBottom,
|
|
88
|
+
overflow: 'hidden'
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
onAfterEnter(element) {
|
|
93
|
+
var _a;
|
|
94
|
+
// el.style.maxHeight = ''
|
|
95
|
+
// el.style.overflow = el.dataset.oldOverflow
|
|
96
|
+
element === null || element === void 0 ? void 0 : element.ctrl.setStyleObj({
|
|
97
|
+
maxHeight: '',
|
|
98
|
+
overflow: (_a = element === null || element === void 0 ? void 0 : element.dom) === null || _a === void 0 ? void 0 : _a.dataset.oldOverflow
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
onEnterCancelled(element) {
|
|
102
|
+
reset(element);
|
|
103
|
+
},
|
|
104
|
+
onBeforeLeave(element) {
|
|
105
|
+
const el = element === null || element === void 0 ? void 0 : element.dom;
|
|
106
|
+
if (!el) {
|
|
107
|
+
throw Error('element is not exist . ');
|
|
108
|
+
}
|
|
109
|
+
// if (!el.dataset) el.dataset = {}
|
|
110
|
+
// el.dataset.oldPaddingTop = el.style.paddingTop
|
|
111
|
+
// el.dataset.oldPaddingBottom = el.style.paddingBottom
|
|
112
|
+
// el.dataset.oldOverflow = el.style.overflow
|
|
113
|
+
element.ctrl.setAttrObj({
|
|
114
|
+
dataOldPaddingTop: el.style.paddingTop,
|
|
115
|
+
dataOldPaddingBottom: el.style.paddingBottom,
|
|
116
|
+
dataOldOverflow: el.style.overflow
|
|
117
|
+
});
|
|
118
|
+
// el.style.maxHeight = `${el.scrollHeight}px`
|
|
119
|
+
// el.style.overflow = 'hidden'
|
|
120
|
+
element.ctrl.setStyleObj({
|
|
121
|
+
maxHeight: `${el.scrollHeight}px`,
|
|
122
|
+
overflow: 'hidden'
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
onLeave(element) {
|
|
126
|
+
const el = element === null || element === void 0 ? void 0 : element.dom;
|
|
127
|
+
if (!el) {
|
|
128
|
+
throw Error('element is not exist . ');
|
|
129
|
+
}
|
|
130
|
+
if (el.scrollHeight !== 0) {
|
|
131
|
+
// el.style.maxHeight = 0
|
|
132
|
+
// el.style.paddingTop = 0
|
|
133
|
+
// el.style.paddingBottom = 0
|
|
134
|
+
element.ctrl.setStyleObj({
|
|
135
|
+
maxHeight: 0,
|
|
136
|
+
paddingTop: 0,
|
|
137
|
+
paddingBottom: 0
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
onAfterLeave(element) {
|
|
142
|
+
reset(element);
|
|
143
|
+
},
|
|
144
|
+
onLeaveCancelled(element) {
|
|
145
|
+
reset(element);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TdStatisticAbstract } from '../td-statistic/td-statistic.abstract';
|
|
2
|
+
import { ITdCountDown, ITdCountDownConfig } from './td-count-down.interface';
|
|
3
|
+
export declare class TdCountDown extends TdStatisticAbstract implements ITdCountDown {
|
|
4
|
+
className: 'TdCountDown';
|
|
5
|
+
private rawValue;
|
|
6
|
+
private timer?;
|
|
7
|
+
props: ITdCountDownConfig;
|
|
8
|
+
constructor(params?: ITdCountDownConfig);
|
|
9
|
+
mounted(): void;
|
|
10
|
+
stopTimer(): void;
|
|
11
|
+
startTimer(): void;
|
|
12
|
+
setNumber(value: number): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdCountDown = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
const td_statistic_abstract_1 = require("../td-statistic/td-statistic.abstract");
|
|
6
|
+
const utils_2 = require("./utils");
|
|
7
|
+
class TdCountDown extends td_statistic_abstract_1.TdStatisticAbstract {
|
|
8
|
+
constructor(params = {}) {
|
|
9
|
+
const format = (params === null || params === void 0 ? void 0 : params.format) || 'HH:mm:ss';
|
|
10
|
+
params.formatter = (val) => (0, utils_2.formatTime)(val, format);
|
|
11
|
+
// title,prefix,suffix 可以是 TypeElement元素;
|
|
12
|
+
super(params);
|
|
13
|
+
this.className = 'TdCountDown';
|
|
14
|
+
this.rawValue = (0, utils_2.getTime)((params === null || params === void 0 ? void 0 : params.value) || 0) - Date.now();
|
|
15
|
+
this.setNumber(this.rawValue);
|
|
16
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
17
|
+
this.slotChild(params.slot);
|
|
18
|
+
}
|
|
19
|
+
this.props = this.setParams(params);
|
|
20
|
+
}
|
|
21
|
+
mounted() {
|
|
22
|
+
this.stopTimer();
|
|
23
|
+
this.startTimer();
|
|
24
|
+
}
|
|
25
|
+
stopTimer() {
|
|
26
|
+
if (this.timer) {
|
|
27
|
+
(0, utils_1.cAF)(this.timer);
|
|
28
|
+
this.timer = undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
startTimer() {
|
|
32
|
+
var _a;
|
|
33
|
+
console.log('this.props.value is ', this.props.value);
|
|
34
|
+
const timestamp = (0, utils_2.getTime)(((_a = this.props) === null || _a === void 0 ? void 0 : _a.value) || 0);
|
|
35
|
+
const frameFunc = () => {
|
|
36
|
+
let diff = timestamp - Date.now();
|
|
37
|
+
// console.log('diff is ', diff);
|
|
38
|
+
// emit('change', diff)
|
|
39
|
+
this.setNumber(diff);
|
|
40
|
+
if (diff <= 0) {
|
|
41
|
+
diff = 0;
|
|
42
|
+
this.stopTimer();
|
|
43
|
+
// emit('finish')
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.timer = (0, utils_1.rAF)(frameFunc);
|
|
47
|
+
}
|
|
48
|
+
this.rawValue = diff;
|
|
49
|
+
};
|
|
50
|
+
this.timer = (0, utils_1.rAF)(frameFunc);
|
|
51
|
+
}
|
|
52
|
+
setNumber(value) {
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = this.number.textNode) === null || _a === void 0 ? void 0 : _a.setText(this.formatValue(value));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.TdCountDown = TdCountDown;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ITdStatisticAbstract, ITdStatisticConfig } from '../td-statistic/td-statistic.interface';
|
|
2
|
+
export interface ITdCountDown extends ITdStatisticAbstract {
|
|
3
|
+
className: 'TdCountDown';
|
|
4
|
+
}
|
|
5
|
+
export interface ITdCountDownConfig extends ITdStatisticConfig {
|
|
6
|
+
/**
|
|
7
|
+
* @description Formatting the countdown display
|
|
8
|
+
* default: 'HH:mm:ss',
|
|
9
|
+
*/
|
|
10
|
+
format?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTime = exports.getTime = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
const timeUnits = [
|
|
6
|
+
['Y', 1000 * 60 * 60 * 24 * 365], // years
|
|
7
|
+
['M', 1000 * 60 * 60 * 24 * 30], // months
|
|
8
|
+
['D', 1000 * 60 * 60 * 24], // days
|
|
9
|
+
['H', 1000 * 60 * 60], // hours
|
|
10
|
+
['m', 1000 * 60], // minutes
|
|
11
|
+
['s', 1000], // seconds
|
|
12
|
+
['S', 1] // million seconds
|
|
13
|
+
];
|
|
14
|
+
const getTime = (value) => {
|
|
15
|
+
return (0, utils_1.isNumber)(value) ? new Date(value).getTime() : value.valueOf();
|
|
16
|
+
};
|
|
17
|
+
exports.getTime = getTime;
|
|
18
|
+
const formatTime = (timestamp, format) => {
|
|
19
|
+
let timeLeft = timestamp;
|
|
20
|
+
const escapeRegex = /\[([^\]]*)]/g;
|
|
21
|
+
const replacedText = timeUnits.reduce((current, [name, unit]) => {
|
|
22
|
+
const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, 'g');
|
|
23
|
+
if (replaceRegex.test(current)) {
|
|
24
|
+
const value = Math.floor(timeLeft / unit);
|
|
25
|
+
timeLeft -= value * unit;
|
|
26
|
+
return current.replace(replaceRegex, (match) => String(value).padStart(match.length, '0'));
|
|
27
|
+
}
|
|
28
|
+
return current;
|
|
29
|
+
}, format);
|
|
30
|
+
return replacedText.replace(escapeRegex, '$1');
|
|
31
|
+
};
|
|
32
|
+
exports.formatTime = formatTime;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TableRow, TypeFragment } from '@type-dom/framework';
|
|
2
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
3
|
+
import { TdDescriptionsItem } from '../td-descriptions-item/td-descriptions-item.class';
|
|
4
|
+
export interface ITdDescriptionsRow extends IUI {
|
|
5
|
+
className: 'TdDescriptionsRow';
|
|
6
|
+
}
|
|
7
|
+
export interface ITdDescriptionsRowConfig extends IUIConfig {
|
|
8
|
+
row: TdDescriptionsItem[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @name TdDescriptionsRow
|
|
12
|
+
* @description
|
|
13
|
+
* @author darcrand
|
|
14
|
+
*/
|
|
15
|
+
export declare class TdDescriptionsRow extends TypeFragment implements ITdDescriptionsRow {
|
|
16
|
+
className: 'TdDescriptionsRow';
|
|
17
|
+
props: ITdDescriptionsRowConfig;
|
|
18
|
+
childNodes: TableRow[];
|
|
19
|
+
constructor(params?: ITdDescriptionsRowConfig);
|
|
20
|
+
created(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdDescriptionsRow = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const td_descritions_cell_1 = require("./td-descritions-cell");
|
|
6
|
+
/**
|
|
7
|
+
* @name TdDescriptionsRow
|
|
8
|
+
* @description
|
|
9
|
+
* @author darcrand
|
|
10
|
+
*/
|
|
11
|
+
class TdDescriptionsRow extends framework_1.TypeFragment {
|
|
12
|
+
constructor(params) {
|
|
13
|
+
super();
|
|
14
|
+
this.className = 'TdDescriptionsRow';
|
|
15
|
+
this.childNodes = [];
|
|
16
|
+
this.props = this.setParams(params);
|
|
17
|
+
}
|
|
18
|
+
created() {
|
|
19
|
+
var _a;
|
|
20
|
+
// todo descriptions.direction === 'vertical'
|
|
21
|
+
// descriptions.border 根据这两个条件判断,创建cell.
|
|
22
|
+
const descriptions = this.up('TdDescriptions');
|
|
23
|
+
console.log('descriptions is ', descriptions);
|
|
24
|
+
if (!descriptions) {
|
|
25
|
+
throw Error('TdDescriptionsRow need TdDescriptions as parent. ');
|
|
26
|
+
}
|
|
27
|
+
const descriptionsConfig = descriptions.props;
|
|
28
|
+
// useSize(descriptionsConfig);
|
|
29
|
+
// useBordered(descriptionsConfig);
|
|
30
|
+
if ((descriptionsConfig === null || descriptionsConfig === void 0 ? void 0 : descriptionsConfig.direction) === 'vertical') {
|
|
31
|
+
// todo 要加 两个 tr , 这样就不是 一个 tr 的组件了。
|
|
32
|
+
console.log('vertical . ');
|
|
33
|
+
const labelTr = new framework_1.TableRow();
|
|
34
|
+
const contentTr = new framework_1.TableRow();
|
|
35
|
+
const row = ((_a = this.props) === null || _a === void 0 ? void 0 : _a.row) || [];
|
|
36
|
+
row.forEach((item, index) => {
|
|
37
|
+
labelTr.addChild(new td_descritions_cell_1.TdDescriptionsCell({
|
|
38
|
+
cell: item.props,
|
|
39
|
+
tag: 'th',
|
|
40
|
+
type: 'label'
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
row.forEach((item, index) => {
|
|
44
|
+
contentTr.addChild(new td_descritions_cell_1.TdDescriptionsCell({
|
|
45
|
+
cell: item.props,
|
|
46
|
+
tag: 'td',
|
|
47
|
+
type: 'content'
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
this.addChildren(labelTr, contentTr);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const tr = new framework_1.TableRow();
|
|
54
|
+
const row = this.props.row || [];
|
|
55
|
+
row.forEach((item, index) => {
|
|
56
|
+
if (descriptionsConfig.border) {
|
|
57
|
+
tr.addChildren(new td_descritions_cell_1.TdDescriptionsCell({
|
|
58
|
+
cell: item.props,
|
|
59
|
+
tag: 'td',
|
|
60
|
+
type: 'label'
|
|
61
|
+
}), new td_descritions_cell_1.TdDescriptionsCell({
|
|
62
|
+
cell: item.props,
|
|
63
|
+
tag: 'td',
|
|
64
|
+
type: 'content'
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
tr.addChild(new td_descritions_cell_1.TdDescriptionsCell({
|
|
69
|
+
cell: item.props,
|
|
70
|
+
tag: 'td',
|
|
71
|
+
type: 'both'
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
this.addChild(tr);
|
|
76
|
+
}
|
|
77
|
+
// this.setParams(this.config);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.TdDescriptionsRow = TdDescriptionsRow;
|