@type-dom/ui 0.0.9 → 0.1.0
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 -44
- package/package.json +4 -10
- package/src/aria.d.ts +2 -2
- package/src/components/basic/td-button/td-button.abstract.d.ts +5 -5
- package/src/components/basic/td-button/td-button.abstract.js +46 -42
- package/src/components/basic/td-button/td-button.interface.d.ts +3 -6
- package/src/components/basic/td-button/td-button.style.d.ts +16 -5
- package/src/components/basic/td-button/td-button.style.js +43 -17
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +3 -2
- package/src/components/basic/td-button-group/td-button-group.class.js +34 -37
- package/src/components/basic/td-button-group/td-button-group.interface.d.ts +3 -3
- package/src/components/basic/td-container/td-aside/td-aside.class.d.ts +2 -2
- package/src/components/basic/td-container/td-aside/td-aside.class.js +6 -5
- package/src/components/basic/td-container/td-aside/td-aside.interface.d.ts +3 -3
- package/src/components/basic/td-container/td-container.class.d.ts +2 -3
- package/src/components/basic/td-container/td-container.class.js +9 -7
- package/src/components/basic/td-container/td-container.interface.d.ts +3 -4
- 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 -2
- package/src/components/basic/td-container/td-footer/td-footer.class.js +4 -3
- package/src/components/basic/td-container/td-footer/td-footer.interface.d.ts +3 -3
- 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 +3 -3
- package/src/components/basic/td-container/td-header/td-header.interface.d.ts +3 -3
- package/src/components/basic/td-container/td-main/td-main.class.d.ts +4 -2
- package/src/components/basic/td-container/td-main/td-main.class.js +8 -5
- package/src/components/basic/td-container/td-main/td-main.interface.d.ts +3 -3
- package/src/components/basic/td-icon/td-icon.class.d.ts +4 -6
- package/src/components/basic/td-icon/td-icon.class.js +32 -29
- package/src/components/basic/td-icon/td-icon.interface.d.ts +3 -4
- package/src/components/basic/td-layout/td-col/td-col.class.d.ts +2 -3
- package/src/components/basic/td-layout/td-col/td-col.class.js +4 -4
- package/src/components/basic/td-layout/td-col/td-col.interface.d.ts +3 -3
- package/src/components/basic/td-layout/td-row/td-row.class.d.ts +2 -2
- package/src/components/basic/td-layout/td-row/td-row.class.js +5 -4
- package/src/components/basic/td-layout/td-row/td-row.interface.d.ts +3 -3
- package/src/components/basic/td-link/td-link.class.d.ts +2 -2
- package/src/components/basic/td-link/td-link.class.js +6 -10
- package/src/components/basic/td-link/td-link.interface.d.ts +3 -3
- package/src/components/basic/td-link/td-link.style.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +2 -2
- package/src/components/basic/td-scrollbar/bar/bar.class.js +4 -4
- package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +3 -3
- package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +4 -2
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +4 -3
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +3 -4
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.js +1 -1
- package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +2 -2
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +2 -3
- package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +3 -3
- package/src/components/basic/td-space/td-space.class.d.ts +2 -2
- package/src/components/basic/td-space/td-space.class.js +11 -5
- package/src/components/basic/td-space/td-space.interface.d.ts +3 -4
- package/src/components/basic/td-text/td-text.class.d.ts +4 -2
- package/src/components/basic/td-text/td-text.class.js +6 -4
- package/src/components/basic/td-text/td-text.interface.d.ts +3 -3
- package/src/components/data/td-avatar/td-avatar.class.d.ts +2 -2
- package/src/components/data/td-avatar/td-avatar.class.js +19 -25
- package/src/components/data/td-avatar/td-avatar.interface.d.ts +3 -3
- package/src/components/data/td-avatar/td-avatar.style.d.ts +2 -0
- package/src/components/data/td-avatar/td-avatar.style.js +19 -1
- package/src/components/data/td-badge/td-badge.class.d.ts +2 -2
- package/src/components/data/td-badge/td-badge.class.js +4 -4
- package/src/components/data/td-badge/td-badge.interface.d.ts +3 -3
- package/src/components/data/td-card/td-card.class.d.ts +4 -5
- package/src/components/data/td-card/td-card.class.js +16 -30
- package/src/components/data/td-card/td-card.interface.d.ts +3 -3
- package/src/components/data/td-card/td-card.style.d.ts +3 -2
- package/src/components/data/td-card/td-card.style.js +17 -3
- package/src/components/data/td-check-tag/td-check-tag.class.d.ts +2 -2
- package/src/components/data/td-check-tag/td-check-tag.class.js +5 -5
- package/src/components/data/td-check-tag/td-check-tag.interface.d.ts +3 -3
- package/src/components/data/td-check-tag/td-check-tag.style.d.ts +2 -2
- package/src/components/data/td-check-tag/td-check-tag.style.js +3 -3
- package/src/components/data/td-collapse/td-collapse.class.d.ts +2 -2
- package/src/components/data/td-collapse/td-collapse.class.js +20 -20
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +3 -3
- package/src/components/data/td-collapse/td-collapse.style.d.ts +2 -0
- package/src/components/data/td-collapse/td-collapse.style.js +9 -1
- package/src/components/data/td-collapse-item/td-collapse-item.class.d.ts +4 -5
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +16 -16
- package/src/components/data/td-collapse-item/td-collapse-item.interface.d.ts +3 -3
- package/src/components/data/td-count-down/td-count-down.class.d.ts +1 -1
- package/src/components/data/td-count-down/td-count-down.class.js +1 -1
- package/src/components/data/td-descriptions/td-descriptions-row.d.ts +4 -5
- package/src/components/data/td-descriptions/td-descriptions-row.js +1 -1
- package/src/components/data/td-descriptions/td-descriptions.class.d.ts +3 -3
- package/src/components/data/td-descriptions/td-descriptions.class.js +2 -3
- package/src/components/data/td-descriptions/td-descriptions.interface.d.ts +3 -4
- package/src/components/data/td-descriptions/td-descritions-cell.d.ts +6 -5
- package/src/components/data/td-descriptions/td-descritions-cell.js +5 -4
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.d.ts +2 -3
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +5 -4
- package/src/components/data/td-descriptions-item/td-descriptions-item.interface.d.ts +3 -4
- package/src/components/data/td-empty/td-empty.class.d.ts +2 -2
- package/src/components/data/td-empty/td-empty.class.js +2 -3
- package/src/components/data/td-empty/td-empty.interface.d.ts +3 -4
- package/src/components/data/td-image/td-image.class.d.ts +2 -3
- package/src/components/data/td-image/td-image.class.js +4 -22
- package/src/components/data/td-image/td-image.interface.d.ts +3 -3
- package/src/components/data/td-image/td-image.style.d.ts +2 -0
- package/src/components/data/td-image/td-image.style.js +19 -1
- package/src/components/data/td-image-viewer/td-image-viewer.class.d.ts +3 -5
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +20 -17
- package/src/components/data/td-image-viewer/td-image-viewer.interface.d.ts +3 -3
- package/src/components/data/td-result/td-result.class.d.ts +2 -2
- package/src/components/data/td-result/td-result.class.js +4 -3
- package/src/components/data/td-result/td-result.interface.d.ts +3 -4
- package/src/components/data/td-segmented/td-segmented.class.d.ts +2 -3
- package/src/components/data/td-segmented/td-segmented.class.js +7 -8
- package/src/components/data/td-segmented/td-segmented.interface.d.ts +2 -3
- package/src/components/data/td-statistic/td-statistic.abstract.d.ts +3 -4
- package/src/components/data/td-statistic/td-statistic.abstract.js +15 -14
- package/src/components/data/td-statistic/td-statistic.class.js +1 -0
- package/src/components/data/td-statistic/td-statistic.interface.d.ts +3 -4
- package/src/components/data/td-tag/td-tag.class.d.ts +3 -4
- package/src/components/data/td-tag/td-tag.class.js +13 -13
- package/src/components/data/td-tag/td-tag.interface.d.ts +3 -3
- package/src/components/feedback/index.d.ts +4 -0
- package/src/components/feedback/index.js +5 -2
- package/src/components/feedback/td-alert/td-alert.class.d.ts +2 -3
- package/src/components/feedback/td-alert/td-alert.class.js +19 -17
- package/src/components/feedback/td-alert/td-alert.interface.d.ts +3 -3
- package/src/components/feedback/td-dialog/td-dialog.class.d.ts +3 -3
- package/src/components/feedback/td-dialog/td-dialog.class.js +25 -29
- package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +3 -3
- package/src/components/feedback/td-dialog/td-dialog.interface.js +1 -1
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.d.ts +2 -3
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +10 -7
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.d.ts +3 -4
- package/src/components/feedback/td-drawer/td-drawer.class.d.ts +3 -3
- package/src/components/feedback/td-drawer/td-drawer.class.js +5 -5
- package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +2 -2
- package/src/components/feedback/td-focus-trap/focus-trap.d.ts +15 -0
- package/src/components/feedback/td-focus-trap/focus-trap.js +71 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +8 -7
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +129 -129
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +3 -3
- package/src/components/feedback/td-loading/td-loading.class.d.ts +4 -3
- package/src/components/feedback/td-loading/td-loading.class.js +27 -17
- package/src/components/feedback/td-loading/td-loading.interface.d.ts +3 -4
- package/src/components/feedback/td-message/td-message.class.d.ts +4 -4
- package/src/components/feedback/td-message/td-message.class.js +31 -31
- package/src/components/feedback/td-message/td-message.interface.d.ts +3 -4
- package/src/components/feedback/td-message-box/td-message-box.class.d.ts +10 -12
- package/src/components/feedback/td-message-box/td-message-box.class.js +30 -52
- package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +4 -5
- package/src/components/feedback/td-notification/td-notification.class.d.ts +4 -5
- package/src/components/feedback/td-notification/td-notification.class.js +17 -18
- package/src/components/feedback/td-notification/td-notification.interface.d.ts +3 -4
- package/src/components/feedback/td-notification/td-notification.style.js +6 -6
- package/src/components/feedback/td-only-child/td-only-child.class.d.ts +3 -3
- package/src/components/feedback/td-only-child/td-only-child.class.js +3 -3
- package/src/components/feedback/td-overlay/td-overlay.class.d.ts +2 -3
- package/src/components/feedback/td-overlay/td-overlay.class.js +6 -5
- package/src/components/feedback/td-overlay/td-overlay.interface.d.ts +3 -3
- package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +2 -2
- package/src/components/feedback/td-popper/arrow/arrow.class.js +7 -6
- package/src/components/feedback/td-popper/arrow/arrow.const.d.ts +3 -0
- package/src/components/feedback/td-popper/arrow/arrow.const.js +6 -0
- package/src/components/feedback/td-popper/arrow/arrow.interface.d.ts +3 -4
- package/src/components/feedback/td-popper/constants.d.ts +25 -0
- package/src/components/feedback/td-popper/constants.js +5 -0
- package/src/components/feedback/td-popper/content/content.class.d.ts +2 -2
- package/src/components/feedback/td-popper/content/content.class.js +7 -13
- package/src/components/feedback/td-popper/content/content.const.d.ts +2 -2
- package/src/components/feedback/td-popper/content/content.const.js +3 -4
- package/src/components/feedback/td-popper/content/content.interface.d.ts +24 -11
- package/src/components/feedback/td-popper/content/content.interface.js +4 -0
- package/src/components/feedback/td-popper/td-popper.class.d.ts +3 -2
- package/src/components/feedback/td-popper/td-popper.class.js +9 -7
- package/src/components/feedback/td-popper/td-popper.const.d.ts +5 -20
- package/src/components/feedback/td-popper/td-popper.const.js +8 -3
- package/src/components/feedback/td-popper/td-popper.interface.d.ts +6 -4
- package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +2 -2
- package/src/components/feedback/td-popper/trigger/trigger.class.js +6 -6
- package/src/components/feedback/td-popper/trigger/trigger.const.d.ts +1 -0
- package/src/components/feedback/td-popper/trigger/trigger.const.js +4 -1
- package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +3 -3
- package/src/components/feedback/td-tooltip/content/content.class.d.ts +2 -2
- package/src/components/feedback/td-tooltip/content/content.class.js +4 -3
- package/src/components/feedback/td-tooltip/content/content.const.d.ts +55 -0
- package/src/components/feedback/td-tooltip/content/content.const.js +6 -0
- package/src/components/feedback/td-tooltip/content/content.interface.d.ts +19 -3
- package/src/components/feedback/td-tooltip/td-tooltip.class.d.ts +5 -3
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +84 -9
- package/src/components/feedback/td-tooltip/td-tooltip.const.d.ts +77 -0
- package/src/components/feedback/td-tooltip/td-tooltip.const.js +9 -0
- package/src/components/feedback/td-tooltip/td-tooltip.interface.d.ts +6 -3
- package/src/components/feedback/td-tooltip/trigger/trigger.class.d.ts +3 -2
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +56 -3
- package/src/components/feedback/td-tooltip/trigger/trigger.const.d.ts +4 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.const.js +6 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.interface.d.ts +7 -2
- package/src/components/form/index.d.ts +17 -16
- package/src/components/form/index.js +19 -17
- package/src/components/form/td-checkbox/composables/use-checkbox-status.js +1 -1
- package/src/components/form/td-checkbox/composables/use-checkbox.js +1 -1
- package/src/components/form/td-checkbox/td-checkbox.class.d.ts +18 -3
- package/src/components/form/td-checkbox/td-checkbox.class.js +231 -9
- package/src/components/form/td-checkbox/td-checkbox.const.d.ts +63 -0
- package/src/components/form/td-checkbox/td-checkbox.const.js +88 -0
- package/src/components/form/td-checkbox/td-checkbox.interface.d.ts +5 -5
- package/src/components/form/td-checkbox/td-checkbox.style.d.ts +9 -0
- package/src/components/form/td-checkbox/td-checkbox.style.js +167 -14
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.d.ts +9 -3
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +114 -26
- package/src/components/form/td-checkbox-button/td-checkbox-button.interface.d.ts +2 -4
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.d.ts +8 -1
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.js +89 -12
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.d.ts +11 -3
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +118 -5
- package/src/components/form/td-checkbox-group/td-checkbox-group.interface.d.ts +8 -5
- package/src/components/form/td-form/td-form.class.d.ts +4 -2
- package/src/components/form/td-form/td-form.class.js +9 -5
- package/src/components/form/td-form/td-form.interface.d.ts +7 -4
- package/src/components/form/td-form-item/td-form-item.class.d.ts +4 -5
- package/src/components/form/td-form-item/td-form-item.class.js +34 -27
- package/src/components/form/td-form-item/td-form-item.interface.d.ts +3 -3
- package/src/components/form/td-input/td-input.class.d.ts +3 -4
- package/src/components/form/td-input/td-input.class.js +30 -26
- package/src/components/form/td-input/td-input.interface.d.ts +3 -4
- package/src/components/form/td-input/widget/suffix.d.ts +1 -0
- package/src/components/form/td-input/widget/suffix.js +6 -1
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +5 -5
- package/src/components/form/td-input/widget/utils.js +8 -8
- package/src/components/form/td-option/td-option.class.d.ts +2 -2
- package/src/components/form/td-option/td-option.class.js +3 -3
- package/src/components/form/td-option/td-option.interface.d.ts +3 -3
- package/src/components/form/td-option-group/td-option-group.class.d.ts +2 -2
- package/src/components/form/td-option-group/td-option-group.class.js +2 -3
- package/src/components/form/td-option-group/td-option-group.interface.d.ts +3 -3
- package/src/components/form/td-radio/td-radio.class.d.ts +2 -3
- package/src/components/form/td-radio/td-radio.class.js +8 -5
- package/src/components/form/td-radio/td-radio.interface.d.ts +3 -3
- package/src/components/form/td-radio-button/td-radio-button.class.d.ts +2 -3
- package/src/components/form/td-radio-button/td-radio-button.class.js +9 -9
- package/src/components/form/td-radio-button/td-radio-button.interface.d.ts +3 -3
- package/src/components/form/td-radio-group/td-radio-group.class.d.ts +2 -5
- package/src/components/form/td-radio-group/td-radio-group.class.js +14 -11
- package/src/components/form/td-radio-group/td-radio-group.interface.d.ts +3 -4
- package/src/components/form/td-select/dropdown/dropdown.class.d.ts +2 -2
- package/src/components/form/td-select/dropdown/dropdown.class.js +2 -3
- package/src/components/form/td-select/dropdown/dropdown.interface.d.ts +3 -4
- package/src/components/form/td-select/td-select.class.d.ts +4 -6
- package/src/components/form/td-select/td-select.class.js +4 -6
- package/src/components/form/td-select/td-select.interface.d.ts +13 -5
- package/src/components/form/td-select/td-select.style.d.ts +23 -0
- package/src/components/form/td-select/td-select.style.js +170 -1
- package/src/components/form/td-switch/td-switch.class.d.ts +2 -3
- package/src/components/form/td-switch/td-switch.class.js +2 -3
- package/src/components/form/td-switch/td-switch.interface.d.ts +3 -4
- package/src/components/form/td-switch/widget/td-switch-core.js +4 -4
- package/src/components/navigation/td-affix/td-affix.class.d.ts +2 -3
- package/src/components/navigation/td-affix/td-affix.class.js +2 -3
- package/src/components/navigation/td-affix/td-affix.interface.d.ts +3 -4
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.d.ts +2 -2
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +2 -3
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.d.ts +3 -4
- package/src/components/navigation/td-anchor/td-anchor.class.d.ts +2 -2
- package/src/components/navigation/td-anchor/td-anchor.class.js +6 -4
- package/src/components/navigation/td-anchor/td-anchor.function.js +1 -1
- package/src/components/navigation/td-anchor/td-anchor.interface.d.ts +3 -3
- package/src/components/navigation/td-backtop/td-backtop.class.d.ts +5 -6
- package/src/components/navigation/td-backtop/td-backtop.class.js +36 -59
- package/src/components/navigation/td-backtop/td-backtop.const.d.ts +18 -0
- package/src/components/navigation/td-backtop/td-backtop.const.js +21 -0
- package/src/components/navigation/td-backtop/td-backtop.interface.d.ts +3 -3
- package/src/components/navigation/td-backtop/td-backtop.style.d.ts +2 -0
- package/src/components/navigation/td-backtop/td-backtop.style.js +19 -1
- package/src/components/navigation/td-backtop/use-backtop.d.ts +2 -3
- package/src/components/navigation/td-backtop/use-backtop.js +2 -2
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.d.ts +3 -3
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +12 -8
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.d.ts +3 -4
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.d.ts +2 -2
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +2 -3
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.d.ts +3 -4
- package/src/components/navigation/td-menu/td-menu.class.d.ts +2 -2
- package/src/components/navigation/td-menu/td-menu.class.js +4 -3
- package/src/components/navigation/td-menu/td-menu.interface.d.ts +3 -4
- package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +2 -2
- package/src/components/navigation/td-tabs/td-tab-bar.class.js +3 -3
- package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +3 -3
- package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +2 -3
- package/src/components/navigation/td-tabs/td-tab-nav.class.js +3 -4
- package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +3 -3
- package/src/components/navigation/td-tabs/td-tab-pane.class.d.ts +2 -3
- package/src/components/navigation/td-tabs/td-tab-pane.class.js +12 -16
- package/src/components/navigation/td-tabs/td-tab-pane.interface.d.ts +3 -4
- package/src/components/navigation/td-tabs/td-tabs.class.d.ts +2 -2
- package/src/components/navigation/td-tabs/td-tabs.class.js +6 -4
- package/src/components/navigation/td-tabs/td-tabs.interface.d.ts +3 -3
- package/src/components/others/example/example-source-wrapper.js +2 -1
- package/src/components/others/td-divider/td-divider.class.d.ts +2 -2
- package/src/components/others/td-divider/td-divider.class.js +2 -3
- package/src/components/others/td-divider/td-divider.interface.d.ts +3 -3
- package/src/constants/aria.d.ts +17 -0
- package/src/constants/aria.js +20 -0
- package/src/hooks/index.d.ts +1 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/use-delayed-toggle.d.ts +23 -0
- package/src/hooks/use-delayed-toggle.js +52 -0
- package/src/styles/var.d.ts +2 -16
- package/src/styles/var.js +7 -17
- package/src/utils/dom/event.d.ts +6 -0
- package/src/utils/dom/event.js +17 -0
- package/src/ui/ui.abstract.d.ts +0 -18
- package/src/ui/ui.abstract.js +0 -50
- package/src/ui/ui.interface.d.ts +0 -12
- package/src/ui/ui.interface.js +0 -2
|
@@ -4,16 +4,21 @@ exports.TdMessageBox = void 0;
|
|
|
4
4
|
const utils_1 = require("@type-dom/utils");
|
|
5
5
|
const framework_1 = require("@type-dom/framework");
|
|
6
6
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
|
-
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
8
7
|
const td_button_class_1 = require("../../basic/td-button/td-button.class");
|
|
9
8
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
10
9
|
const td_input_class_1 = require("../../form/td-input/td-input.class");
|
|
11
10
|
const td_overlay_class_1 = require("../td-overlay/td-overlay.class");
|
|
12
11
|
const td_message_box_style_1 = require("./td-message-box.style");
|
|
13
|
-
class TdMessageBox extends
|
|
12
|
+
class TdMessageBox extends framework_1.TypeFragment {
|
|
14
13
|
constructor(params = {}) {
|
|
15
14
|
var _a, _b;
|
|
16
|
-
super(
|
|
15
|
+
super();
|
|
16
|
+
// 作为参数调用要用箭头函数
|
|
17
|
+
this.handleWrapperClick = () => {
|
|
18
|
+
if (this.props.closeOnClickModal) {
|
|
19
|
+
this.handleAction(this.state.distinguishCancelAndClose ? 'close' : 'cancel');
|
|
20
|
+
}
|
|
21
|
+
};
|
|
17
22
|
this.handleInputEnter = (e) => {
|
|
18
23
|
if (this.state.inputType !== 'textarea') {
|
|
19
24
|
e.preventDefault();
|
|
@@ -104,7 +109,7 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
104
109
|
slot: this.dialog,
|
|
105
110
|
});
|
|
106
111
|
this.overlayEvent = (0, framework_1.useSameTarget)(this.handleWrapperClick);
|
|
107
|
-
this.
|
|
112
|
+
this.content = new framework_1.Transition({
|
|
108
113
|
name: 'fade-in-linear',
|
|
109
114
|
emits: {
|
|
110
115
|
afterLeave: () => {
|
|
@@ -114,7 +119,7 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
114
119
|
},
|
|
115
120
|
slot: this.overlay,
|
|
116
121
|
});
|
|
117
|
-
this.addChild(this.
|
|
122
|
+
this.addChild(this.content);
|
|
118
123
|
let iconComponent;
|
|
119
124
|
if (params === null || params === void 0 ? void 0 : params.icon) {
|
|
120
125
|
iconComponent = params.icon;
|
|
@@ -169,11 +174,11 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
169
174
|
}));
|
|
170
175
|
}
|
|
171
176
|
}
|
|
172
|
-
this.
|
|
173
|
-
name: 'content',
|
|
177
|
+
this.msgContent = new framework_1.Div({
|
|
178
|
+
name: 'msg-content',
|
|
174
179
|
styleObj: td_message_box_style_1.$messageBoxContentStyle,
|
|
175
180
|
});
|
|
176
|
-
this.messageBox.addChild(this.
|
|
181
|
+
this.messageBox.addChild(this.msgContent);
|
|
177
182
|
this.container = new framework_1.Div({
|
|
178
183
|
name: 'message-box-container',
|
|
179
184
|
styleObj: td_message_box_style_1.$messageBoxContainerStyle,
|
|
@@ -255,7 +260,7 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
255
260
|
}
|
|
256
261
|
}
|
|
257
262
|
}
|
|
258
|
-
this.
|
|
263
|
+
this.msgContent.addChild(this.container);
|
|
259
264
|
if (params === null || params === void 0 ? void 0 : params.showInput) {
|
|
260
265
|
this.input = new td_input_class_1.TdInput({
|
|
261
266
|
// id: params.inputId,
|
|
@@ -281,7 +286,7 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
281
286
|
styleObj: td_message_box_style_1.$messageBoxInputStyle,
|
|
282
287
|
childNodes: [this.input, this.errorMsg],
|
|
283
288
|
});
|
|
284
|
-
this.
|
|
289
|
+
this.msgContent.addChild(this.inputDiv);
|
|
285
290
|
}
|
|
286
291
|
this.btns = new framework_1.Div({
|
|
287
292
|
name: 'btns',
|
|
@@ -301,11 +306,13 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
301
306
|
click: () => {
|
|
302
307
|
console.log('this.cancelBtn click . ');
|
|
303
308
|
this.handleAction('cancel');
|
|
309
|
+
this.resolve({ action: 'cancel' });
|
|
304
310
|
},
|
|
305
311
|
keydown: (evt) => {
|
|
306
312
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
307
|
-
if (evt.key === 'Enter') {
|
|
313
|
+
if ((evt === null || evt === void 0 ? void 0 : evt.key) === 'Enter') {
|
|
308
314
|
this.handleAction('cancel');
|
|
315
|
+
this.resolve({ action: 'cancel' });
|
|
309
316
|
}
|
|
310
317
|
}
|
|
311
318
|
},
|
|
@@ -326,11 +333,15 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
326
333
|
events: {
|
|
327
334
|
click: () => {
|
|
328
335
|
this.handleAction('confirm');
|
|
336
|
+
const input = this.input;
|
|
337
|
+
this.resolve({ action: 'confirm', input });
|
|
329
338
|
},
|
|
330
|
-
keydown: (evt) => {
|
|
339
|
+
keydown: (evt, element) => {
|
|
331
340
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
332
|
-
if (evt.key === 'Enter') {
|
|
341
|
+
if ((evt === null || evt === void 0 ? void 0 : evt.key) === 'Enter') {
|
|
333
342
|
this.handleAction('confirm');
|
|
343
|
+
const input = this.input;
|
|
344
|
+
this.resolve({ action: 'confirm', input });
|
|
334
345
|
}
|
|
335
346
|
},
|
|
336
347
|
},
|
|
@@ -370,10 +381,9 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
370
381
|
// offDraggable()
|
|
371
382
|
// })
|
|
372
383
|
// 普通显示
|
|
373
|
-
static
|
|
384
|
+
static info(params) {
|
|
374
385
|
console.log('TdMessageBox show params is ', params);
|
|
375
|
-
|
|
376
|
-
return msgBox.promise();
|
|
386
|
+
return new TdMessageBox(params);
|
|
377
387
|
}
|
|
378
388
|
// 用 callback
|
|
379
389
|
static alert(message, title, params) {
|
|
@@ -381,46 +391,19 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
381
391
|
title }, params));
|
|
382
392
|
}
|
|
383
393
|
static confirm(message, title, params) {
|
|
384
|
-
|
|
394
|
+
return new TdMessageBox(Object.assign({ boxType: 'confirm', message,
|
|
385
395
|
title, showCancelButton: true }, params));
|
|
386
|
-
return msgBox.promise();
|
|
387
396
|
}
|
|
388
397
|
// todo 多次提交时,不触发返回操作。
|
|
389
398
|
static prompt(message, title, params) {
|
|
390
|
-
|
|
399
|
+
return new TdMessageBox(Object.assign({ boxType: 'prompt', message,
|
|
391
400
|
title, showCancelButton: true, showInput: true }, params));
|
|
392
|
-
const input = msgBox.input;
|
|
393
|
-
return msgBox.promise(input);
|
|
394
|
-
}
|
|
395
|
-
promise(input) {
|
|
396
|
-
return new Promise((resolve, reject) => {
|
|
397
|
-
var _a;
|
|
398
|
-
this.confirmBtn.setEvent('click', () => {
|
|
399
|
-
console.log('confirm click . then resolve . ');
|
|
400
|
-
resolve({ action: 'confirm', input });
|
|
401
|
-
});
|
|
402
|
-
// this.cancelBtn.removeEvent('click', this.cancelBtn.dom);
|
|
403
|
-
(_a = this.cancelBtn) === null || _a === void 0 ? void 0 : _a.setEvents({
|
|
404
|
-
click: () => {
|
|
405
|
-
// todo
|
|
406
|
-
console.log('this.cancelBtn click . ');
|
|
407
|
-
// this.handleAction('cancel');
|
|
408
|
-
resolve({ action: 'cancel' }); // todo why must add catch(...) .otherwise it will not be resolved
|
|
409
|
-
},
|
|
410
|
-
keydown: (evt) => {
|
|
411
|
-
// evt?.preventDefault();
|
|
412
|
-
if ((evt === null || evt === void 0 ? void 0 : evt.key) === 'Enter') {
|
|
413
|
-
// this.handleAction('cancel');
|
|
414
|
-
resolve({ action: 'cancel' });
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
});
|
|
418
|
-
});
|
|
419
401
|
}
|
|
420
402
|
doClose() {
|
|
421
403
|
console.log('doClose . ');
|
|
422
|
-
if (!this.visible)
|
|
404
|
+
if (!this.visible) {
|
|
423
405
|
return;
|
|
406
|
+
}
|
|
424
407
|
this.visible = false;
|
|
425
408
|
this.messageBox.style.hide();
|
|
426
409
|
(0, framework_1.nextTick)(() => {
|
|
@@ -431,11 +414,6 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
431
414
|
}
|
|
432
415
|
});
|
|
433
416
|
}
|
|
434
|
-
handleWrapperClick() {
|
|
435
|
-
if (this.props.closeOnClickModal) {
|
|
436
|
-
this.handleAction(this.state.distinguishCancelAndClose ? 'close' : 'cancel');
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
417
|
handleAction(action) {
|
|
440
418
|
var _a, _b, _c;
|
|
441
419
|
console.log('handleAction', action);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { InputEnum, TypeElement, TypeSvgSvg } from '@type-dom/framework';
|
|
1
|
+
import { InputEnum, ITypeConfig, ITypeElement, TypeElement, TypeSvgSvg } from '@type-dom/framework';
|
|
2
2
|
import { IStyle } from '@type-dom/css-type';
|
|
3
|
-
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
4
3
|
import { ISize } from '../../../styles/size';
|
|
5
4
|
import { TdInput } from '../../form';
|
|
6
|
-
export interface ITdMessageBox extends
|
|
5
|
+
export interface ITdMessageBox extends ITypeElement {
|
|
7
6
|
className: 'TdMessageBox';
|
|
8
7
|
}
|
|
9
8
|
type MessageType = '' | 'success' | 'warning' | 'info' | 'error';
|
|
@@ -55,8 +54,8 @@ export declare interface IMessageBoxState {
|
|
|
55
54
|
validateError?: boolean;
|
|
56
55
|
zIndex?: number;
|
|
57
56
|
}
|
|
58
|
-
export type Callback = (
|
|
59
|
-
export interface ITdMessageBoxConfig extends
|
|
57
|
+
export type Callback = (action: IAction) => void;
|
|
58
|
+
export interface ITdMessageBoxConfig extends ITypeConfig {
|
|
60
59
|
/**
|
|
61
60
|
* auto focus when open message-box
|
|
62
61
|
*/
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { TypeNode } from '@type-dom/framework';
|
|
2
|
-
import { UI } from '../../../ui/ui.abstract';
|
|
1
|
+
import { Transition, TypeFragment, TypeNode } from '@type-dom/framework';
|
|
3
2
|
import { INotificationPosition, ITdNotification, ITdNotificationConfig } from './td-notification.interface';
|
|
4
|
-
export declare class TdNotification extends
|
|
3
|
+
export declare class TdNotification extends TypeFragment implements ITdNotification {
|
|
5
4
|
className: 'TdNotification';
|
|
5
|
+
content: Transition;
|
|
6
6
|
props: ITdNotificationConfig;
|
|
7
7
|
visible: boolean;
|
|
8
|
-
private transition;
|
|
9
8
|
private notification;
|
|
10
9
|
private group;
|
|
11
10
|
private title;
|
|
12
|
-
private
|
|
11
|
+
private groupContent;
|
|
13
12
|
private closeBtn?;
|
|
14
13
|
static notifyId: number;
|
|
15
14
|
static notifications: Record<INotificationPosition, TdNotification[]>;
|
|
@@ -4,19 +4,11 @@ exports.TdNotification = void 0;
|
|
|
4
4
|
const utils_1 = require("@type-dom/utils");
|
|
5
5
|
const framework_1 = require("@type-dom/framework");
|
|
6
6
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
|
-
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
8
7
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
9
8
|
const td_notification_style_1 = require("./td-notification.style");
|
|
10
|
-
class TdNotification extends
|
|
9
|
+
class TdNotification extends framework_1.TypeFragment {
|
|
11
10
|
constructor(option) {
|
|
12
|
-
|
|
13
|
-
if (typeof option === 'string') {
|
|
14
|
-
params = { message: option };
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
params = option;
|
|
18
|
-
}
|
|
19
|
-
super(params, 'fragment');
|
|
11
|
+
super();
|
|
20
12
|
this.visible = false;
|
|
21
13
|
// the gap size between each notification
|
|
22
14
|
this.GAP_SIZE = 16;
|
|
@@ -37,10 +29,17 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
37
29
|
this.startTimer(); // resume timer
|
|
38
30
|
}
|
|
39
31
|
};
|
|
32
|
+
let params;
|
|
33
|
+
if (typeof option === 'string') {
|
|
34
|
+
params = { message: option };
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
params = option;
|
|
38
|
+
}
|
|
40
39
|
this.className = 'TdNotification';
|
|
41
40
|
(0, td_notification_style_1.useStyle)(params);
|
|
42
41
|
this.to = document.body;
|
|
43
|
-
this.
|
|
42
|
+
this.content = new framework_1.Transition({
|
|
44
43
|
name: 'fade',
|
|
45
44
|
emits: {
|
|
46
45
|
beforeLeave: (el, done) => {
|
|
@@ -54,7 +53,7 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
54
53
|
},
|
|
55
54
|
},
|
|
56
55
|
});
|
|
57
|
-
this.addChild(this.
|
|
56
|
+
this.addChild(this.content);
|
|
58
57
|
this.notification = new framework_1.Div({
|
|
59
58
|
attrObj: {
|
|
60
59
|
role: 'alert',
|
|
@@ -72,7 +71,7 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
72
71
|
},
|
|
73
72
|
},
|
|
74
73
|
});
|
|
75
|
-
this.
|
|
74
|
+
this.content.addChild(this.notification);
|
|
76
75
|
let iconComponent;
|
|
77
76
|
if ((params === null || params === void 0 ? void 0 : params.type) && svgs_1.TypeComponentsMap[params.type]) {
|
|
78
77
|
console.log('params.type is ', params.type);
|
|
@@ -101,19 +100,19 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
101
100
|
styleObj: td_notification_style_1.$notificationTitleStyle,
|
|
102
101
|
});
|
|
103
102
|
this.group.addChild(this.title);
|
|
104
|
-
this.
|
|
103
|
+
this.groupContent = new framework_1.Div({
|
|
105
104
|
name: 'content',
|
|
106
105
|
styleObj: td_notification_style_1.$notificationContentStyle,
|
|
107
106
|
});
|
|
108
107
|
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
109
|
-
this.
|
|
108
|
+
this.groupContent.slotChild(params.slot);
|
|
110
109
|
}
|
|
111
110
|
else {
|
|
112
111
|
if (params === null || params === void 0 ? void 0 : params.dangerouslyUseHTMLString) {
|
|
113
112
|
if (typeof params.message === 'string') {
|
|
114
113
|
const parser = new framework_1.Parser();
|
|
115
114
|
const el = parser.parseFromString(params.message);
|
|
116
|
-
this.
|
|
115
|
+
this.groupContent.addChild(new framework_1.P({
|
|
117
116
|
childNodes: [el],
|
|
118
117
|
}));
|
|
119
118
|
}
|
|
@@ -129,10 +128,10 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
129
128
|
else {
|
|
130
129
|
p.addChild(new framework_1.TextNode(params === null || params === void 0 ? void 0 : params.message));
|
|
131
130
|
}
|
|
132
|
-
this.
|
|
131
|
+
this.groupContent.addChild(p);
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
|
-
this.group.addChild(this.
|
|
134
|
+
this.group.addChild(this.groupContent);
|
|
136
135
|
if ((params === null || params === void 0 ? void 0 : params.showClose) !== false) {
|
|
137
136
|
this.closeBtn = new td_icon_class_1.TdIcon({
|
|
138
137
|
name: 'close-btn',
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { TypeElement, TypeSvgSvg } from '@type-dom/framework';
|
|
2
|
-
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
1
|
+
import { ITypeConfig, ITypeElement, TypeElement, TypeSvgSvg } from '@type-dom/framework';
|
|
3
2
|
export type INotificationPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
4
3
|
export type INotificationType = 'success' | 'info' | 'warning' | 'error';
|
|
5
|
-
export interface ITdNotification extends
|
|
4
|
+
export interface ITdNotification extends ITypeElement {
|
|
6
5
|
className: 'TdNotification';
|
|
7
6
|
}
|
|
8
|
-
export interface ITdNotificationConfig extends
|
|
7
|
+
export interface ITdNotificationConfig extends ITypeConfig {
|
|
9
8
|
/**
|
|
10
9
|
* @description custom class name for Notification
|
|
11
10
|
* default: ''
|
|
@@ -52,27 +52,27 @@ exports.$notificationStyle = {
|
|
|
52
52
|
boxShadow: exports.$notification.shadow,
|
|
53
53
|
// transition: opacity getCssVar('transition-duration'),
|
|
54
54
|
transition: 'opacity ' +
|
|
55
|
-
var_1.$
|
|
55
|
+
var_1.$transitionDurationDefault +
|
|
56
56
|
', ' +
|
|
57
57
|
// transform getCssVar('transition-duration'),
|
|
58
58
|
'transform ' +
|
|
59
|
-
var_1.$
|
|
59
|
+
var_1.$transitionDurationDefault +
|
|
60
60
|
', ' +
|
|
61
61
|
// top getCssVar('transition-duration'),
|
|
62
62
|
'top ' +
|
|
63
|
-
var_1.$
|
|
63
|
+
var_1.$transitionDurationDefault +
|
|
64
64
|
', ' +
|
|
65
65
|
// left getCssVar('transition-duration'),
|
|
66
66
|
'left ' +
|
|
67
|
-
var_1.$
|
|
67
|
+
var_1.$transitionDurationDefault +
|
|
68
68
|
', ' +
|
|
69
69
|
// right getCssVar('transition-duration'), top 0.4s,
|
|
70
70
|
'right ' +
|
|
71
|
-
var_1.$
|
|
71
|
+
var_1.$transitionDurationDefault +
|
|
72
72
|
', ' +
|
|
73
73
|
// bottom getCssVar('transition-duration'),
|
|
74
74
|
'bottom ' +
|
|
75
|
-
var_1.$
|
|
75
|
+
var_1.$transitionDurationDefault +
|
|
76
76
|
', ',
|
|
77
77
|
overflowWrap: 'break-word',
|
|
78
78
|
overflow: 'hidden',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ITypeConfig } from '@type-dom/framework';
|
|
2
|
-
|
|
3
|
-
export declare class TdOnlyChild extends UI {
|
|
1
|
+
import { ITypeConfig, SlotNode, TypeFragment } from '@type-dom/framework';
|
|
2
|
+
export declare class TdOnlyChild extends TypeFragment {
|
|
4
3
|
className: 'TdOnlyChild';
|
|
4
|
+
content: SlotNode;
|
|
5
5
|
constructor(params?: ITypeConfig);
|
|
6
6
|
setup(): null;
|
|
7
7
|
}
|
|
@@ -4,11 +4,11 @@ exports.TdOnlyChild = void 0;
|
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const utils_1 = require("@type-dom/utils");
|
|
6
6
|
const use_forward_ref_1 = require("../../../hooks/use-forward-ref");
|
|
7
|
-
|
|
8
|
-
class TdOnlyChild extends ui_abstract_1.UI {
|
|
7
|
+
class TdOnlyChild extends framework_1.TypeFragment {
|
|
9
8
|
constructor(params = {}) {
|
|
10
|
-
super(
|
|
9
|
+
super();
|
|
11
10
|
this.className = 'TdOnlyChild';
|
|
11
|
+
this.content = new framework_1.SlotNode();
|
|
12
12
|
this.props = this.useParams(params);
|
|
13
13
|
}
|
|
14
14
|
setup() {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TypeElement } from '@type-dom/framework';
|
|
2
|
-
import { UI } from '../../../ui/ui.abstract';
|
|
1
|
+
import { TypeDiv, TypeElement } from '@type-dom/framework';
|
|
3
2
|
import { ITdOverlay, ITdOverlayConfig } from './td-overlay.interface';
|
|
4
3
|
export declare let overlayZIndex: number;
|
|
5
|
-
export declare class TdOverlay extends
|
|
4
|
+
export declare class TdOverlay extends TypeDiv implements ITdOverlay {
|
|
6
5
|
className: 'TdOverlay';
|
|
7
6
|
props: ITdOverlayConfig;
|
|
8
7
|
constructor(params?: ITdOverlayConfig);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdOverlay = exports.overlayZIndex = void 0;
|
|
4
|
-
const
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const td_overlay_style_1 = require("./td-overlay.style");
|
|
6
6
|
exports.overlayZIndex = 2000;
|
|
7
|
-
class TdOverlay extends
|
|
7
|
+
class TdOverlay extends framework_1.TypeDiv {
|
|
8
8
|
constructor(params = {}) {
|
|
9
|
-
super(
|
|
9
|
+
super();
|
|
10
10
|
exports.overlayZIndex = exports.overlayZIndex + 1;
|
|
11
11
|
this.className = 'TdOverlay';
|
|
12
12
|
this.style.addObj(td_overlay_style_1.$tdOverlayStyle);
|
|
@@ -25,11 +25,12 @@ class TdOverlay extends ui_abstract_1.UI {
|
|
|
25
25
|
left: '0px',
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
this.addChild(this.getSlotNode());
|
|
28
|
+
// this.addChild(this.getSlotNode());
|
|
29
|
+
this.slotChild(params.slot);
|
|
29
30
|
this.props = this.useParams(params);
|
|
30
31
|
}
|
|
31
32
|
addSlot(slot) {
|
|
32
|
-
this.getSlotNode().resetSlot(slot);
|
|
33
|
+
// this.getSlotNode().resetSlot(slot);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.TdOverlay = TdOverlay;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Property } from '@type-dom/css-type';
|
|
2
|
-
import {
|
|
3
|
-
export interface ITdOverlay extends
|
|
2
|
+
import { ITypeConfig, ITypeDiv } from '@type-dom/framework';
|
|
3
|
+
export interface ITdOverlay extends ITypeDiv {
|
|
4
4
|
className: 'TdOverlay';
|
|
5
5
|
}
|
|
6
|
-
export interface ITdOverlayConfig extends
|
|
6
|
+
export interface ITdOverlayConfig extends ITypeConfig {
|
|
7
7
|
mask?: boolean;
|
|
8
8
|
customMaskEvent?: boolean;
|
|
9
9
|
zIndex?: Property.ZIndex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeSpan } from '@type-dom/framework';
|
|
2
2
|
import { ITdPopperArrow, ITdPopperArrowConfig } from './arrow.interface';
|
|
3
|
-
export declare class TdPopperArrow extends
|
|
3
|
+
export declare class TdPopperArrow extends TypeSpan implements ITdPopperArrow {
|
|
4
4
|
className: 'TdPopperArrow';
|
|
5
5
|
props: ITdPopperArrowConfig;
|
|
6
6
|
private arrowOffset?;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdPopperArrow = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
4
5
|
const var_1 = require("../../../../styles/var");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
class TdPopperArrow extends ui_abstract_1.UI {
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
class TdPopperArrow extends framework_1.TypeSpan {
|
|
8
8
|
constructor(params = {}) {
|
|
9
|
-
super(
|
|
9
|
+
super();
|
|
10
|
+
// this.useTag('span');
|
|
10
11
|
this.className = 'TdPopperArrow';
|
|
11
12
|
this.attr.addName('td-popper-arrow');
|
|
12
13
|
this.style.addObj({
|
|
@@ -27,13 +28,13 @@ class TdPopperArrow extends ui_abstract_1.UI {
|
|
|
27
28
|
boxSizing: 'border-box'
|
|
28
29
|
// }
|
|
29
30
|
});
|
|
30
|
-
this.
|
|
31
|
+
this.assignProps({
|
|
31
32
|
arrowOffset: 5,
|
|
32
33
|
});
|
|
33
34
|
this.props = this.useParams(params);
|
|
34
35
|
}
|
|
35
36
|
setup() {
|
|
36
|
-
const { arrowOffset, arrowRef, arrowStyle } = this.inject(
|
|
37
|
+
const { arrowOffset, arrowRef, arrowStyle } = this.inject(constants_1.POPPER_CONTENT_INJECTION_KEY, undefined);
|
|
37
38
|
this.arrowOffset = arrowOffset;
|
|
38
39
|
this.arrowRef = arrowRef;
|
|
39
40
|
this.arrowStyle = arrowStyle;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ITdPopperArrow extends
|
|
1
|
+
import { ITypeConfig, ITypeSpan } from '@type-dom/framework';
|
|
2
|
+
export interface ITdPopperArrow extends ITypeSpan {
|
|
3
3
|
className: 'TdPopperArrow';
|
|
4
4
|
}
|
|
5
|
-
export interface ITdPopperArrowConfig extends
|
|
5
|
+
export interface ITdPopperArrowConfig extends ITypeConfig {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
7
|
* default: 5,
|
|
9
8
|
*/
|
|
10
9
|
arrowOffset?: number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IStyle } from '@type-dom/css-type';
|
|
2
|
+
import { InjectionKey } from '@type-dom/framework';
|
|
3
|
+
import { TdPopper } from './td-popper.class';
|
|
4
|
+
export type Measurable = {
|
|
5
|
+
getBoundingClientRect: () => DOMRect;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* triggerRef indicates the element that triggers popper
|
|
9
|
+
* contentRef indicates the element of popper content
|
|
10
|
+
* referenceRef indicates the element that popper content relative with
|
|
11
|
+
*/
|
|
12
|
+
export type TdPopperInjectionContext = {
|
|
13
|
+
triggerRef: Measurable | undefined;
|
|
14
|
+
contentRef: HTMLElement | undefined;
|
|
15
|
+
popperInstanceRef: TdPopper | undefined;
|
|
16
|
+
referenceRef: Measurable | undefined;
|
|
17
|
+
role: string;
|
|
18
|
+
};
|
|
19
|
+
export type TdPopperContentInjectionContext = {
|
|
20
|
+
arrowRef: HTMLElement | undefined;
|
|
21
|
+
arrowOffset: number | undefined;
|
|
22
|
+
arrowStyle: IStyle;
|
|
23
|
+
};
|
|
24
|
+
export declare const POPPER_INJECTION_KEY: InjectionKey<TdPopperInjectionContext>;
|
|
25
|
+
export declare const POPPER_CONTENT_INJECTION_KEY: InjectionKey<TdPopperContentInjectionContext>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POPPER_CONTENT_INJECTION_KEY = exports.POPPER_INJECTION_KEY = void 0;
|
|
4
|
+
exports.POPPER_INJECTION_KEY = Symbol('popper');
|
|
5
|
+
exports.POPPER_CONTENT_INJECTION_KEY = Symbol('popperContent');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeDiv } from '@type-dom/framework';
|
|
2
2
|
import { ITdPopperContent, ITdPopperContentConfig } from './content.interface';
|
|
3
|
-
export declare class TdPopperContent extends
|
|
3
|
+
export declare class TdPopperContent extends TypeDiv implements ITdPopperContent {
|
|
4
4
|
className: 'TdPopperContent';
|
|
5
5
|
props: ITdPopperContentConfig;
|
|
6
6
|
private focusTrap;
|
|
@@ -2,37 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdPopperContent = void 0;
|
|
4
4
|
const utils_1 = require("@type-dom/utils");
|
|
5
|
-
const
|
|
5
|
+
const framework_1 = require("@type-dom/framework");
|
|
6
|
+
const td_form_const_1 = require("../../../form/td-form/td-form.const");
|
|
6
7
|
const td_focus_trap_class_1 = require("../../td-focus-trap/td-focus-trap.class");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
7
9
|
const content_const_1 = require("./content.const");
|
|
8
|
-
|
|
9
|
-
const td_popper_const_1 = require("../td-popper.const");
|
|
10
|
-
class TdPopperContent extends ui_abstract_1.UI {
|
|
10
|
+
class TdPopperContent extends framework_1.TypeDiv {
|
|
11
11
|
constructor(params = {}) {
|
|
12
|
-
super(
|
|
12
|
+
super();
|
|
13
13
|
this.className = 'TdPopperContent';
|
|
14
14
|
this.attr.addName('td-popper-content');
|
|
15
15
|
this.attr.addObj({
|
|
16
16
|
tabindex: -1
|
|
17
17
|
});
|
|
18
|
-
this.style.addObj({
|
|
19
|
-
// padding: '10px',
|
|
20
|
-
// backgroundColor: $bgColors.default,
|
|
21
|
-
// borderRadius: $borderRadius.base,
|
|
22
|
-
// boxShadow: $boxShadow.base,
|
|
23
|
-
});
|
|
24
18
|
this.focusTrap = new td_focus_trap_class_1.TdFocusTrap();
|
|
25
19
|
this.addChild(this.focusTrap);
|
|
26
20
|
if (params.contentStyle) { // todo
|
|
27
21
|
this.style.addObj(params.contentStyle);
|
|
28
22
|
}
|
|
29
|
-
this.
|
|
23
|
+
this.assignProps(content_const_1.popperContentProps);
|
|
30
24
|
this.props = this.useParams(params);
|
|
31
25
|
}
|
|
32
26
|
setup() {
|
|
33
27
|
const formItemContext = this.inject(td_form_const_1.formItemContextKey, undefined);
|
|
34
28
|
const arrowOffset = 0;
|
|
35
|
-
this.provide(
|
|
29
|
+
this.provide(constants_1.POPPER_CONTENT_INJECTION_KEY, {
|
|
36
30
|
// arrowStyle,
|
|
37
31
|
// arrowRef,
|
|
38
32
|
arrowOffset,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
1
|
+
import { IPopperCoreConfig, ITdPopperContentConfig } from './content.interface';
|
|
2
|
+
export declare const popperCoreProps: IPopperCoreConfig;
|
|
3
3
|
export declare const popperContentProps: ITdPopperContentConfig;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.popperContentProps = exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.popperContentProps = exports.popperCoreProps = void 0;
|
|
4
|
+
exports.popperCoreProps = {
|
|
5
5
|
boundariesPadding: 0,
|
|
6
|
-
// fallbackPlacements: undefined,
|
|
7
6
|
gpuAcceleration: true,
|
|
8
7
|
/**
|
|
9
8
|
* @description offset of the Tooltip
|
|
@@ -19,7 +18,7 @@ exports.popperCoreConfigProps = {
|
|
|
19
18
|
// popperOptions: () => ({}),
|
|
20
19
|
strategy: 'absolute',
|
|
21
20
|
};
|
|
22
|
-
exports.popperContentProps = Object.assign(Object.assign({}, exports.
|
|
21
|
+
exports.popperContentProps = Object.assign(Object.assign({}, exports.popperCoreProps), {
|
|
23
22
|
// style: {
|
|
24
23
|
// type: definePropType<StyleValue>([String, Array, Object]),
|
|
25
24
|
// },
|