@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,531 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdMessageBox = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
const framework_1 = require("@type-dom/framework");
|
|
6
|
+
const svgs_1 = require("@type-dom/svgs");
|
|
7
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
8
|
+
const td_button_class_1 = require("../../basic/td-button/td-button.class");
|
|
9
|
+
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
10
|
+
const td_input_class_1 = require("../../form/td-input/td-input.class");
|
|
11
|
+
const td_overlay_class_1 = require("../td-overlay/td-overlay.class");
|
|
12
|
+
const td_message_box_style_1 = require("./td-message-box.style");
|
|
13
|
+
class TdMessageBox extends ui_abstract_1.UI {
|
|
14
|
+
constructor(params) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
super(params, 'fragment');
|
|
17
|
+
this.handleInputEnter = (e) => {
|
|
18
|
+
if (this.state.inputType !== 'textarea') {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
return this.handleAction('confirm');
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.className = 'TdMessageBox';
|
|
24
|
+
(0, td_message_box_style_1.useStyle)(params);
|
|
25
|
+
// const zIndex = useZIndex();
|
|
26
|
+
this.visible = true;
|
|
27
|
+
// s represents state
|
|
28
|
+
this.state = {
|
|
29
|
+
// autofocus element when open message-box
|
|
30
|
+
autofocus: true,
|
|
31
|
+
beforeClose: undefined,
|
|
32
|
+
callback: undefined,
|
|
33
|
+
cancelButtonText: '',
|
|
34
|
+
cancelButtonClass: '',
|
|
35
|
+
confirmButtonText: '',
|
|
36
|
+
confirmButtonClass: '',
|
|
37
|
+
customClass: '',
|
|
38
|
+
customStyle: {},
|
|
39
|
+
dangerouslyUseHTMLString: false,
|
|
40
|
+
distinguishCancelAndClose: false,
|
|
41
|
+
icon: undefined,
|
|
42
|
+
inputPattern: undefined,
|
|
43
|
+
inputPlaceholder: '',
|
|
44
|
+
inputType: 'text',
|
|
45
|
+
inputValue: undefined, // null
|
|
46
|
+
inputValidator: undefined,
|
|
47
|
+
inputErrorMessage: '',
|
|
48
|
+
message: undefined,
|
|
49
|
+
modalFade: true,
|
|
50
|
+
modalClass: '',
|
|
51
|
+
showCancelButton: false,
|
|
52
|
+
showConfirmButton: true,
|
|
53
|
+
type: '',
|
|
54
|
+
title: undefined,
|
|
55
|
+
showInput: false,
|
|
56
|
+
action: '',
|
|
57
|
+
confirmButtonLoading: false,
|
|
58
|
+
cancelButtonLoading: false,
|
|
59
|
+
// confirmButtonLoadingIcon: markRaw(Loading),
|
|
60
|
+
// cancelButtonLoadingIcon: markRaw(Loading),
|
|
61
|
+
confirmButtonDisabled: false,
|
|
62
|
+
editorErrorMessage: '',
|
|
63
|
+
// refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed
|
|
64
|
+
// seemed ok for now without this state.
|
|
65
|
+
isOnComposition: false, // temporary remove
|
|
66
|
+
validateError: false,
|
|
67
|
+
zIndex: 2000, // todo nextZIndex(),
|
|
68
|
+
};
|
|
69
|
+
// Object.assign(this.state, params); // todo this.state params 关系???
|
|
70
|
+
this.to = this.getAppendToElement(params);
|
|
71
|
+
this.transition = new framework_1.Transition({
|
|
72
|
+
name: 'fade-in-linear',
|
|
73
|
+
emits: {
|
|
74
|
+
afterLeave: () => {
|
|
75
|
+
// params?.emits?.vanish?.();
|
|
76
|
+
this.emit('vanish');
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
this.addChild(this.transition);
|
|
81
|
+
this.overlay = new td_overlay_class_1.TdOverlay({
|
|
82
|
+
name: 'overlay',
|
|
83
|
+
// styleObj: $messageBoxStyle,
|
|
84
|
+
});
|
|
85
|
+
this.overlayEvent = (0, framework_1.useSameTarget)(this.handleWrapperClick);
|
|
86
|
+
this.transition.slotNode.addSlot(this.overlay);
|
|
87
|
+
this.dialog = new framework_1.Div({
|
|
88
|
+
name: 'message-box-overlay',
|
|
89
|
+
attrObj: {
|
|
90
|
+
role: 'dialog',
|
|
91
|
+
'aria-modal': 'true',
|
|
92
|
+
'aria-label': 'dialog',
|
|
93
|
+
'aria-describedby': 'message-box-container',
|
|
94
|
+
'aria-labelledby': 'message-box-title',
|
|
95
|
+
},
|
|
96
|
+
styleObj: Object.assign(Object.assign({}, td_message_box_style_1.$messageBoxOverlayStyle), { display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column' }),
|
|
97
|
+
events: {
|
|
98
|
+
click: (evt) => this.overlayEvent.onClick(evt),
|
|
99
|
+
keydown: (evt) => this.overlayEvent.onMousedown(evt),
|
|
100
|
+
mouseup: (evt) => {
|
|
101
|
+
this.overlayEvent.onMouseup(evt);
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
this.overlay.addSlot(this.dialog);
|
|
106
|
+
this.messageBox = new framework_1.Div({
|
|
107
|
+
name: 'message-box',
|
|
108
|
+
attrObj: {
|
|
109
|
+
tabindex: '-1',
|
|
110
|
+
},
|
|
111
|
+
styleObj: td_message_box_style_1.$messageBoxStyle,
|
|
112
|
+
events: {
|
|
113
|
+
click: (evt) => {
|
|
114
|
+
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
this.dialog.addChild(this.messageBox);
|
|
119
|
+
let iconComponent;
|
|
120
|
+
if (params === null || params === void 0 ? void 0 : params.icon) {
|
|
121
|
+
iconComponent = params.icon;
|
|
122
|
+
}
|
|
123
|
+
else if ((params === null || params === void 0 ? void 0 : params.type) && svgs_1.TypeComponentsMap[params.type]) {
|
|
124
|
+
iconComponent = new svgs_1.TypeComponentsMap[params.type]();
|
|
125
|
+
}
|
|
126
|
+
if (params === null || params === void 0 ? void 0 : params.title) {
|
|
127
|
+
this.header = new framework_1.Div({
|
|
128
|
+
name: 'header',
|
|
129
|
+
styleObj: td_message_box_style_1.$messageBoxHeaderStyle,
|
|
130
|
+
});
|
|
131
|
+
this.messageBox.addChild(this.header);
|
|
132
|
+
this.title = new framework_1.Div({
|
|
133
|
+
name: 'title',
|
|
134
|
+
styleObj: td_message_box_style_1.$messageBoxTitleStyle,
|
|
135
|
+
});
|
|
136
|
+
this.header.addChild(this.title);
|
|
137
|
+
if (iconComponent && params.center) {
|
|
138
|
+
this.title.addChild(new td_icon_class_1.TdIcon({
|
|
139
|
+
name: 'icon',
|
|
140
|
+
styleObj: td_message_box_style_1.$messageBoxStatusStyle,
|
|
141
|
+
svgObj: iconComponent,
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
this.title.addChild(new framework_1.TextNode(params.title));
|
|
145
|
+
if (params.showClose !== false) {
|
|
146
|
+
(_a = this.header) === null || _a === void 0 ? void 0 : _a.addChild(new td_button_class_1.TdButton({
|
|
147
|
+
styleObj: td_message_box_style_1.$messageBoxHeaderBtnStyle,
|
|
148
|
+
svgObj: new svgs_1.ElCloseSvg(),
|
|
149
|
+
events: {
|
|
150
|
+
click: () => {
|
|
151
|
+
this.handleClose();
|
|
152
|
+
},
|
|
153
|
+
keydown: (evt) => {
|
|
154
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
155
|
+
if (evt.key === 'Enter') {
|
|
156
|
+
this.handleClose();
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
slots: {
|
|
161
|
+
icon: new svgs_1.ElCloseSvg(),
|
|
162
|
+
},
|
|
163
|
+
// childNodes: [
|
|
164
|
+
// new TdIcon({
|
|
165
|
+
// name: 'close',
|
|
166
|
+
// styleObj: $messageBoxHeaderCloseStyle,
|
|
167
|
+
// svgObj: new ElCloseSvg(),
|
|
168
|
+
// })
|
|
169
|
+
// ]
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
this.content = new framework_1.Div({
|
|
174
|
+
name: 'content',
|
|
175
|
+
styleObj: td_message_box_style_1.$messageBoxContentStyle,
|
|
176
|
+
});
|
|
177
|
+
this.messageBox.addChild(this.content);
|
|
178
|
+
this.container = new framework_1.Div({
|
|
179
|
+
name: 'message-box-container',
|
|
180
|
+
styleObj: td_message_box_style_1.$messageBoxContainerStyle,
|
|
181
|
+
});
|
|
182
|
+
const hasMessage = !!(params === null || params === void 0 ? void 0 : params.message);
|
|
183
|
+
if (iconComponent && !(params === null || params === void 0 ? void 0 : params.center) && hasMessage) {
|
|
184
|
+
this.container.addChild(new td_icon_class_1.TdIcon({
|
|
185
|
+
name: 'status',
|
|
186
|
+
styleObj: td_message_box_style_1.$messageBoxStatusStyle,
|
|
187
|
+
svgObj: iconComponent,
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
if (hasMessage) {
|
|
191
|
+
this.msgDiv = new framework_1.Div({
|
|
192
|
+
name: 'message',
|
|
193
|
+
});
|
|
194
|
+
this.container.addChild(this.msgDiv);
|
|
195
|
+
this.msgDiv.addChild(this.getSlotNode());
|
|
196
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
if (!(params === null || params === void 0 ? void 0 : params.dangerouslyUseHTMLString)) {
|
|
200
|
+
if (params === null || params === void 0 ? void 0 : params.showInput) {
|
|
201
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.message) === 'string') {
|
|
202
|
+
this.getSlotNode().resetSlot(new framework_1.Label({
|
|
203
|
+
name: 'label',
|
|
204
|
+
text: params.message || '',
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
else if (params.message instanceof framework_1.TypeElement) {
|
|
208
|
+
this.getSlotNode().resetSlot(new framework_1.Label({
|
|
209
|
+
name: 'label',
|
|
210
|
+
childNodes: [params.message],
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
console.warn('message must be a string or a TypeElement');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
if (typeof (params === null || params === void 0 ? void 0 : params.message) === 'string') {
|
|
219
|
+
this.getSlotNode().resetSlot(new framework_1.P({
|
|
220
|
+
name: 'paragraph',
|
|
221
|
+
text: params.message || '',
|
|
222
|
+
}));
|
|
223
|
+
}
|
|
224
|
+
else if ((params === null || params === void 0 ? void 0 : params.message) instanceof framework_1.TypeElement) {
|
|
225
|
+
this.getSlotNode().resetSlot(new framework_1.P({
|
|
226
|
+
name: 'paragraph',
|
|
227
|
+
childNodes: [params.message],
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
console.warn('message must be a string or a TypeElement');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
if (typeof params.message === 'string') {
|
|
237
|
+
const parser = new framework_1.Parser();
|
|
238
|
+
const element = parser.parseFromString(params.message);
|
|
239
|
+
if (params === null || params === void 0 ? void 0 : params.showInput) {
|
|
240
|
+
this.getSlotNode().resetSlot(new framework_1.Label({
|
|
241
|
+
name: 'label',
|
|
242
|
+
childNodes: [element],
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this.getSlotNode().resetSlot(new framework_1.P({
|
|
247
|
+
name: 'paragraph',
|
|
248
|
+
childNodes: [element],
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
console.warn('message must be a string');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.content.addChild(this.container);
|
|
259
|
+
if (params === null || params === void 0 ? void 0 : params.showInput) {
|
|
260
|
+
this.input = new td_input_class_1.TdInput({
|
|
261
|
+
// id: params.inputId,
|
|
262
|
+
type: params.inputType || 'text',
|
|
263
|
+
placeholder: params.inputPlaceholder,
|
|
264
|
+
// ariaInvalid: this.state.validateError,
|
|
265
|
+
events: {
|
|
266
|
+
keydown: (evt) => {
|
|
267
|
+
if (evt.key === 'Enter') {
|
|
268
|
+
this.handleInputEnter(evt);
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
this.errorMsg = new framework_1.Div({
|
|
274
|
+
name: 'error-message',
|
|
275
|
+
styleObj: Object.assign({}, td_message_box_style_1.$messageBoxErrorMsgStyle),
|
|
276
|
+
childNodes: [new framework_1.TextNode(this.state.editorErrorMessage)],
|
|
277
|
+
});
|
|
278
|
+
this.errorMsg.textNode = this.errorMsg.childNodes[0];
|
|
279
|
+
this.inputDiv = new framework_1.Div({
|
|
280
|
+
name: 'input-div',
|
|
281
|
+
styleObj: td_message_box_style_1.$messageBoxInputStyle,
|
|
282
|
+
childNodes: [this.input, this.errorMsg],
|
|
283
|
+
});
|
|
284
|
+
this.content.addChild(this.inputDiv);
|
|
285
|
+
}
|
|
286
|
+
this.btns = new framework_1.Div({
|
|
287
|
+
name: 'btns',
|
|
288
|
+
styleObj: td_message_box_style_1.$messageBoxBtnsStyle,
|
|
289
|
+
});
|
|
290
|
+
this.messageBox.addChild(this.btns);
|
|
291
|
+
if (params === null || params === void 0 ? void 0 : params.showCancelButton) {
|
|
292
|
+
this.cancelBtn = new td_button_class_1.TdButton({
|
|
293
|
+
name: 'cancel-btn',
|
|
294
|
+
// size: params.btnSize,
|
|
295
|
+
// loading: params.cancelButtonLoading,
|
|
296
|
+
loadingIcon: params.cancelButtonLoadingIcon,
|
|
297
|
+
slot: params.cancelButtonText || 'Cancel',
|
|
298
|
+
round: params.roundButton,
|
|
299
|
+
// styleObj: $messageBoxCancelBtnStyle,
|
|
300
|
+
events: {
|
|
301
|
+
// click: () => { // todo
|
|
302
|
+
// console.log('this.cancelBtn click . ');
|
|
303
|
+
// this.handleAction('cancel');
|
|
304
|
+
// },
|
|
305
|
+
// keydown: (evt) => {
|
|
306
|
+
// evt?.preventDefault();
|
|
307
|
+
// if ((evt as KeyboardEvent).key === 'Enter') {
|
|
308
|
+
// this.handleAction('cancel');
|
|
309
|
+
// }
|
|
310
|
+
// }
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
this.btns.addChild(this.cancelBtn);
|
|
314
|
+
}
|
|
315
|
+
this.confirmBtn = new td_button_class_1.TdButton({
|
|
316
|
+
name: 'confirm-btn',
|
|
317
|
+
type: 'primary',
|
|
318
|
+
// loading: params.confirmButtonLoading,
|
|
319
|
+
loadingIcon: params === null || params === void 0 ? void 0 : params.confirmButtonLoadingIcon,
|
|
320
|
+
slot: (params === null || params === void 0 ? void 0 : params.confirmButtonText) || 'OK',
|
|
321
|
+
round: params === null || params === void 0 ? void 0 : params.roundButton,
|
|
322
|
+
// styleObj: $messageBoxConfirmBtnStyle,
|
|
323
|
+
styleObj: {
|
|
324
|
+
marginLeft: '12px',
|
|
325
|
+
},
|
|
326
|
+
events: {
|
|
327
|
+
click: () => {
|
|
328
|
+
this.handleAction('confirm');
|
|
329
|
+
},
|
|
330
|
+
keydown: (evt) => {
|
|
331
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
332
|
+
if (evt.key === 'Enter') {
|
|
333
|
+
this.handleAction('confirm');
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
this.btns.addChild(this.confirmBtn);
|
|
339
|
+
this.props = this.setParams(params);
|
|
340
|
+
const draggable = params === null || params === void 0 ? void 0 : params.draggable;
|
|
341
|
+
const overflow = params === null || params === void 0 ? void 0 : params.overflow;
|
|
342
|
+
const { onDraggable, offDraggable } = (0, framework_1.useDraggable)(this.messageBox.dom, (_b = this.header) === null || _b === void 0 ? void 0 : _b.dom, draggable, overflow);
|
|
343
|
+
this.onDraggable = onDraggable;
|
|
344
|
+
this.offDraggable = offDraggable;
|
|
345
|
+
this.mount(this.to);
|
|
346
|
+
}
|
|
347
|
+
mounted() {
|
|
348
|
+
var _a;
|
|
349
|
+
if (this.props.draggable) {
|
|
350
|
+
(_a = this.onDraggable) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
this.offDraggable();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
beforeDestroy() {
|
|
357
|
+
this.offDraggable();
|
|
358
|
+
}
|
|
359
|
+
// onMounted(() => {
|
|
360
|
+
// watchEffect(() => {
|
|
361
|
+
// if (draggable.value) {
|
|
362
|
+
// onDraggable()
|
|
363
|
+
// } else {
|
|
364
|
+
// offDraggable()
|
|
365
|
+
// }
|
|
366
|
+
// })
|
|
367
|
+
// })
|
|
368
|
+
//
|
|
369
|
+
// onBeforeUnmount(() => {
|
|
370
|
+
// offDraggable()
|
|
371
|
+
// })
|
|
372
|
+
// 用 callback
|
|
373
|
+
static alert(message, title, params) {
|
|
374
|
+
new TdMessageBox(Object.assign({ boxType: 'alert', message,
|
|
375
|
+
title }, params));
|
|
376
|
+
}
|
|
377
|
+
static confirm(message, title, params) {
|
|
378
|
+
return new TdMessageBox(Object.assign({ boxType: 'confirm', message,
|
|
379
|
+
title, showCancelButton: true }, params)).promise();
|
|
380
|
+
}
|
|
381
|
+
static prompt(message, title, params) {
|
|
382
|
+
var _a;
|
|
383
|
+
const msg = new TdMessageBox(Object.assign({ boxType: 'prompt', message,
|
|
384
|
+
title, showCancelButton: true, showInput: true }, params));
|
|
385
|
+
const value = (_a = msg.input) === null || _a === void 0 ? void 0 : _a.value;
|
|
386
|
+
return msg.promise(value); // todo why not prompt
|
|
387
|
+
}
|
|
388
|
+
promise(value) {
|
|
389
|
+
return new Promise((resolve, reject) => {
|
|
390
|
+
var _a;
|
|
391
|
+
this.confirmBtn.addEvent('click', this.confirmBtn.dom, () => {
|
|
392
|
+
console.log('confirm . then resolve . ');
|
|
393
|
+
resolve({ action: 'confirm', value });
|
|
394
|
+
});
|
|
395
|
+
if ((_a = this.cancelBtn) === null || _a === void 0 ? void 0 : _a.dom) {
|
|
396
|
+
console.log('this.cancelBtn.subscriptions is ', this.cancelBtn.subscriptions);
|
|
397
|
+
// this.cancelBtn.removeEvent('click', this.cancelBtn.dom);
|
|
398
|
+
this.cancelBtn.addEvents({
|
|
399
|
+
click: () => {
|
|
400
|
+
// todo
|
|
401
|
+
console.log('this.cancelBtn click . ');
|
|
402
|
+
this.handleAction('cancel');
|
|
403
|
+
resolve({ action: 'cancel' }); // todo why must add catch(...) .otherwise it will not be resolved
|
|
404
|
+
},
|
|
405
|
+
keydown: (evt) => {
|
|
406
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
407
|
+
if (evt.key === 'Enter') {
|
|
408
|
+
this.handleAction('cancel');
|
|
409
|
+
resolve({ action: 'cancel' });
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
doClose() {
|
|
417
|
+
console.log('doClose . ');
|
|
418
|
+
if (!this.visible)
|
|
419
|
+
return;
|
|
420
|
+
this.visible = false;
|
|
421
|
+
this.messageBox.ctrl.hide();
|
|
422
|
+
(0, framework_1.nextTick)(() => {
|
|
423
|
+
if (this.state.action) {
|
|
424
|
+
this.emit('action', this.state.action);
|
|
425
|
+
// this.props.emits?.action?.(this.state.action);
|
|
426
|
+
this.destroy();
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
handleWrapperClick() {
|
|
431
|
+
if (this.props.closeOnClickModal) {
|
|
432
|
+
this.handleAction(this.state.distinguishCancelAndClose ? 'close' : 'cancel');
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
handleAction(action) {
|
|
436
|
+
var _a, _b, _c, _d;
|
|
437
|
+
console.log('handleAction', action);
|
|
438
|
+
if (this.props.boxType === 'prompt' &&
|
|
439
|
+
action === 'confirm' &&
|
|
440
|
+
!this.validate()) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
(_b = (_a = this.props).callback) === null || _b === void 0 ? void 0 : _b.call(_a, action);
|
|
444
|
+
this.state.action = action;
|
|
445
|
+
if (this.state.beforeClose) {
|
|
446
|
+
(_d = (_c = this.state).beforeClose) === null || _d === void 0 ? void 0 : _d.call(_c, action, this.state, this.doClose);
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
this.doClose();
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
validate() {
|
|
453
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
454
|
+
if (this.props.boxType === 'prompt') {
|
|
455
|
+
console.log('validate . ');
|
|
456
|
+
const inputPattern = this.props.inputPattern;
|
|
457
|
+
if (inputPattern && !inputPattern.test(((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) || '')) {
|
|
458
|
+
this.state.editorErrorMessage = this.props.inputErrorMessage; // || t('el.messagebox.error') todo t 是国际化翻译的全局方法
|
|
459
|
+
this.state.validateError = true;
|
|
460
|
+
(_b = this.errorMsg) === null || _b === void 0 ? void 0 : _b.ctrl.setStyleObj({
|
|
461
|
+
visibility: this.state.editorErrorMessage ? 'visible' : 'hidden',
|
|
462
|
+
});
|
|
463
|
+
(_d = (_c = this.errorMsg) === null || _c === void 0 ? void 0 : _c.textNode) === null || _d === void 0 ? void 0 : _d.setText(this.state.editorErrorMessage || '');
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
const inputValidator = this.state.inputValidator;
|
|
467
|
+
if (typeof inputValidator === 'function') {
|
|
468
|
+
const validateResult = inputValidator((_e = this.input) === null || _e === void 0 ? void 0 : _e.value);
|
|
469
|
+
if (validateResult === false) {
|
|
470
|
+
this.state.editorErrorMessage = this.props.inputErrorMessage; // || t('el.messagebox.error')
|
|
471
|
+
this.state.validateError = true;
|
|
472
|
+
(_f = this.errorMsg) === null || _f === void 0 ? void 0 : _f.ctrl.setStyleObj({
|
|
473
|
+
visibility: this.state.editorErrorMessage ? 'visible' : 'hidden',
|
|
474
|
+
});
|
|
475
|
+
(_h = (_g = this.errorMsg) === null || _g === void 0 ? void 0 : _g.textNode) === null || _h === void 0 ? void 0 : _h.setText(this.state.editorErrorMessage || '');
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
if (typeof validateResult === 'string') {
|
|
479
|
+
this.state.editorErrorMessage = validateResult;
|
|
480
|
+
this.state.validateError = true;
|
|
481
|
+
(_j = this.errorMsg) === null || _j === void 0 ? void 0 : _j.ctrl.setStyleObj({
|
|
482
|
+
visibility: this.state.editorErrorMessage ? 'visible' : 'hidden',
|
|
483
|
+
});
|
|
484
|
+
(_l = (_k = this.errorMsg) === null || _k === void 0 ? void 0 : _k.textNode) === null || _l === void 0 ? void 0 : _l.setText(this.state.editorErrorMessage || '');
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
this.state.editorErrorMessage = '';
|
|
490
|
+
this.state.validateError = false;
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
getInputElement() {
|
|
494
|
+
var _a;
|
|
495
|
+
// const inputRefs = this.input;
|
|
496
|
+
// return (inputRefs?.input || inputRefs?.textarea) as HTMLElement
|
|
497
|
+
return (_a = this.input) === null || _a === void 0 ? void 0 : _a.panel.inner.dom;
|
|
498
|
+
}
|
|
499
|
+
handleClose() {
|
|
500
|
+
this.handleAction('close');
|
|
501
|
+
}
|
|
502
|
+
// when close on press escape is disabled, pressing esc should not callout
|
|
503
|
+
// any other message box and close any other dialog-ish elements
|
|
504
|
+
// e.g. Dialog has a close on press esc feature, and when it closes, it calls
|
|
505
|
+
// props.beforeClose method to make a intermediate state by callout a message box
|
|
506
|
+
// for some verification or alerting. then if we allow global event liek this
|
|
507
|
+
// to dispatch, it could callout another message box.
|
|
508
|
+
onCloseRequested() {
|
|
509
|
+
if (this.props.closeOnPressEscape) {
|
|
510
|
+
this.handleClose();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
getAppendToElement(props) {
|
|
514
|
+
let appendTo = document.body;
|
|
515
|
+
if (props === null || props === void 0 ? void 0 : props.appendTo) {
|
|
516
|
+
if ((0, utils_1.isString)(props.appendTo)) {
|
|
517
|
+
appendTo = document.querySelector(props.appendTo);
|
|
518
|
+
}
|
|
519
|
+
if ((0, utils_1.isElement)(props.appendTo)) {
|
|
520
|
+
appendTo = props.appendTo;
|
|
521
|
+
}
|
|
522
|
+
// should fallback to default value with a warning
|
|
523
|
+
if (!(0, utils_1.isElement)(appendTo)) {
|
|
524
|
+
console.warn('MessageBox', 'the appendTo option is not an HTMLElement. Falling back to document.body.');
|
|
525
|
+
appendTo = document.body;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return appendTo;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
exports.TdMessageBox = TdMessageBox;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { InputEnum, TypeElement, TypeSvgSvg } from '@type-dom/framework';
|
|
2
|
+
import { IStyle } from '@type-dom/css-type';
|
|
3
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
4
|
+
import { ISize } from '../../../styles/size';
|
|
5
|
+
export interface ITdMessageBox extends IUI {
|
|
6
|
+
className: 'TdMessageBox';
|
|
7
|
+
}
|
|
8
|
+
type MessageType = '' | 'success' | 'warning' | 'info' | 'error';
|
|
9
|
+
export type IMessageBoxType = '' | 'prompt' | 'alert' | 'confirm';
|
|
10
|
+
export type MessageBoxData = IMessageBoxInputData & IAction;
|
|
11
|
+
export type IAction = 'confirm' | 'close' | 'cancel';
|
|
12
|
+
export interface IMessageBoxInputData {
|
|
13
|
+
value?: string;
|
|
14
|
+
action?: IAction;
|
|
15
|
+
}
|
|
16
|
+
export interface MessageBoxInputValidator {
|
|
17
|
+
(value?: string): boolean | string;
|
|
18
|
+
}
|
|
19
|
+
export declare interface IMessageBoxState {
|
|
20
|
+
autofocus?: boolean;
|
|
21
|
+
title?: string;
|
|
22
|
+
message?: string;
|
|
23
|
+
type?: MessageType;
|
|
24
|
+
icon?: TypeSvgSvg;
|
|
25
|
+
customClass?: string;
|
|
26
|
+
customStyle?: IStyle;
|
|
27
|
+
showInput?: boolean;
|
|
28
|
+
inputValue?: string;
|
|
29
|
+
inputPlaceholder?: string;
|
|
30
|
+
inputType?: string;
|
|
31
|
+
inputPattern?: RegExp;
|
|
32
|
+
inputValidator?: MessageBoxInputValidator;
|
|
33
|
+
inputErrorMessage?: string;
|
|
34
|
+
showConfirmButton?: boolean;
|
|
35
|
+
showCancelButton?: boolean;
|
|
36
|
+
action?: IAction;
|
|
37
|
+
dangerouslyUseHTMLString?: boolean;
|
|
38
|
+
confirmButtonText?: string;
|
|
39
|
+
cancelButtonText?: string;
|
|
40
|
+
confirmButtonLoading?: boolean;
|
|
41
|
+
cancelButtonLoading?: boolean;
|
|
42
|
+
confirmButtonLoadingIcon?: TypeSvgSvg;
|
|
43
|
+
cancelButtonLoadingIcon?: TypeSvgSvg;
|
|
44
|
+
confirmButtonClass?: string;
|
|
45
|
+
confirmButtonDisabled?: boolean;
|
|
46
|
+
cancelButtonClass?: string;
|
|
47
|
+
editorErrorMessage?: string;
|
|
48
|
+
beforeClose?: (action: IAction, instance: IMessageBoxState, done: () => void) => void;
|
|
49
|
+
callback?: Callback;
|
|
50
|
+
distinguishCancelAndClose?: boolean;
|
|
51
|
+
modalFade?: boolean;
|
|
52
|
+
modalClass?: string;
|
|
53
|
+
isOnComposition?: false;
|
|
54
|
+
validateError?: boolean;
|
|
55
|
+
zIndex?: number;
|
|
56
|
+
}
|
|
57
|
+
export type Callback = ((value: string, action?: IAction) => any) | ((action: IAction) => any);
|
|
58
|
+
export interface ITdMessageBoxConfig extends IUIConfig {
|
|
59
|
+
/**
|
|
60
|
+
* auto focus when open message-box
|
|
61
|
+
*/
|
|
62
|
+
autofocus?: boolean;
|
|
63
|
+
/** Callback before MessageBox closes, and it will prevent MessageBox from closing */
|
|
64
|
+
beforeClose?: (action: IAction, instance: IMessageBoxState, done: () => void) => void;
|
|
65
|
+
/** Custom class name for MessageBox */
|
|
66
|
+
customClass?: string;
|
|
67
|
+
/** Custom inline style for MessageBox */
|
|
68
|
+
customStyle?: IStyle;
|
|
69
|
+
/** MessageBox closing callback if you don't prefer Promise */
|
|
70
|
+
callback?: Callback;
|
|
71
|
+
/** Text content of cancel button */
|
|
72
|
+
cancelButtonText?: string;
|
|
73
|
+
/** Text content of confirm button */
|
|
74
|
+
confirmButtonText?: string;
|
|
75
|
+
/** Loading Icon content of cancel button */
|
|
76
|
+
cancelButtonLoadingIcon?: TypeSvgSvg;
|
|
77
|
+
/** Loading Icon content of confirm button */
|
|
78
|
+
confirmButtonLoadingIcon?: TypeSvgSvg;
|
|
79
|
+
/** Custom class name of cancel button */
|
|
80
|
+
cancelButtonClass?: string;
|
|
81
|
+
/** Custom class name of confirm button */
|
|
82
|
+
confirmButtonClass?: string;
|
|
83
|
+
/** Whether to align the content in center */
|
|
84
|
+
center?: boolean;
|
|
85
|
+
/** Whether MessageBox can be drag */
|
|
86
|
+
draggable?: boolean;
|
|
87
|
+
/** Draggable MessageBox can overflow the viewport */
|
|
88
|
+
overflow?: boolean;
|
|
89
|
+
/** Content of the MessageBox */
|
|
90
|
+
message?: string | TypeElement | (() => TypeElement);
|
|
91
|
+
/** Title of the MessageBox */
|
|
92
|
+
title?: string;
|
|
93
|
+
/** Message type, used for icon display */
|
|
94
|
+
type?: MessageType;
|
|
95
|
+
/** Message box type */
|
|
96
|
+
boxType?: IMessageBoxType;
|
|
97
|
+
/** Custom icon component */
|
|
98
|
+
icon?: TypeSvgSvg;
|
|
99
|
+
/** Whether message is treated as HTML string */
|
|
100
|
+
dangerouslyUseHTMLString?: boolean;
|
|
101
|
+
/** Whether to distinguish canceling and closing */
|
|
102
|
+
distinguishCancelAndClose?: boolean;
|
|
103
|
+
/** Whether to lock body scroll when MessageBox prompts */
|
|
104
|
+
lockScroll?: boolean;
|
|
105
|
+
/** Whether to show a cancel button */
|
|
106
|
+
showCancelButton?: boolean;
|
|
107
|
+
/** Whether to show a confirm button */
|
|
108
|
+
showConfirmButton?: boolean;
|
|
109
|
+
/** Whether to show a close button */
|
|
110
|
+
showClose?: boolean;
|
|
111
|
+
/** Whether to use round button */
|
|
112
|
+
roundButton?: boolean;
|
|
113
|
+
/** Whether MessageBox can be closed by clicking the mask */
|
|
114
|
+
closeOnClickModal?: boolean;
|
|
115
|
+
/** Whether MessageBox can be closed by pressing the ESC */
|
|
116
|
+
closeOnPressEscape?: boolean;
|
|
117
|
+
/** Whether to close MessageBox when hash changes */
|
|
118
|
+
closeOnHashChange?: boolean;
|
|
119
|
+
/** Whether to show an input */
|
|
120
|
+
showInput?: boolean;
|
|
121
|
+
/** Placeholder of input */
|
|
122
|
+
inputPlaceholder?: string;
|
|
123
|
+
/** Initial value of input */
|
|
124
|
+
inputValue?: string;
|
|
125
|
+
/** Regexp for the input */
|
|
126
|
+
inputPattern?: RegExp;
|
|
127
|
+
/** Input Type: text, textArea, password or number */
|
|
128
|
+
inputType?: keyof typeof InputEnum | 'textarea';
|
|
129
|
+
/** Validation function for the input. Should returns a boolean or string. If a string is returned, it will be assigned to inputErrorMessage */
|
|
130
|
+
inputValidator?: MessageBoxInputValidator;
|
|
131
|
+
/** Error message when validation fails */
|
|
132
|
+
inputErrorMessage?: string;
|
|
133
|
+
/** Custom size of confirm and cancel buttons */
|
|
134
|
+
buttonSize?: ISize;
|
|
135
|
+
/** Custom element to append the message box to */
|
|
136
|
+
appendTo?: HTMLElement | string;
|
|
137
|
+
emits?: {
|
|
138
|
+
vanish?: (action?: IAction, instance?: IMessageBoxState, done?: () => void) => void;
|
|
139
|
+
action?: (action?: IAction) => void;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export {};
|