@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
|
@@ -1,12 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdTooltipTrigger = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const event_1 = require("../../../../utils/dom/event");
|
|
6
|
+
const trigger_class_1 = require("../../td-popper/trigger/trigger.class");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const td_tooltip_const_1 = require("../td-tooltip.const");
|
|
9
|
+
class TdTooltipTrigger extends framework_1.TypeDiv {
|
|
6
10
|
constructor(params = {}) {
|
|
7
|
-
super(
|
|
11
|
+
super();
|
|
8
12
|
this.className = 'TdTooltipTrigger';
|
|
13
|
+
this.attr.addName('td-tooltip-trigger');
|
|
9
14
|
this.props = this.useParams(params);
|
|
10
15
|
}
|
|
16
|
+
setup() {
|
|
17
|
+
const { controlled, id, open, onOpen, onClose, onToggle } = this.inject(td_tooltip_const_1.TOOLTIP_INJECTION_KEY, undefined);
|
|
18
|
+
const stopWhenControlledOrDisabled = () => {
|
|
19
|
+
if (controlled || this.props.disabled) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return undefined; // add by me
|
|
23
|
+
};
|
|
24
|
+
const trigger = this.props.trigger;
|
|
25
|
+
const onMouseenter = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'hover', onOpen));
|
|
26
|
+
const onMouseleave = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'hover', onClose));
|
|
27
|
+
const onClick = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'click', (e) => {
|
|
28
|
+
// distinguish left click
|
|
29
|
+
if (e.button === 0) {
|
|
30
|
+
// onToggle(e);
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
const onFocus = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'focus', onOpen));
|
|
34
|
+
const onBlur = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'focus', onClose));
|
|
35
|
+
const onContextMenu = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (0, utils_1.whenTrigger)(trigger, 'contextmenu', (e) => {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
// onToggle(e);
|
|
38
|
+
}));
|
|
39
|
+
const onKeydown = (0, event_1.composeEventHandlers)(stopWhenControlledOrDisabled, (e) => {
|
|
40
|
+
var _a;
|
|
41
|
+
const { code } = e;
|
|
42
|
+
if ((_a = this.props.triggerKeys) === null || _a === void 0 ? void 0 : _a.includes(code)) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
// onToggle(e);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const popperTrigger = new trigger_class_1.TdPopperTrigger({
|
|
48
|
+
id,
|
|
49
|
+
virtualRef: this.props.virtualRef,
|
|
50
|
+
open,
|
|
51
|
+
virtualTriggering: this.props.virtualTriggering,
|
|
52
|
+
// class="ns.e('trigger')",
|
|
53
|
+
events: {
|
|
54
|
+
blur: onBlur,
|
|
55
|
+
click: onClick,
|
|
56
|
+
contextmenu: onContextMenu,
|
|
57
|
+
focus: onFocus,
|
|
58
|
+
mouseenter: onMouseenter,
|
|
59
|
+
mouseleave: onMouseleave,
|
|
60
|
+
keydown: onKeydown,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
11
64
|
}
|
|
12
65
|
exports.TdTooltipTrigger = TdTooltipTrigger;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tooltipTriggerProps = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
const trigger_const_1 = require("../../td-popper/trigger/trigger.const");
|
|
6
|
+
exports.tooltipTriggerProps = Object.assign(Object.assign({}, trigger_const_1.popperTriggerProps), { trigger: 'hover', triggerKeys: [utils_1.EVENT_CODE.enter, utils_1.EVENT_CODE.space] });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITypeDiv } from '@type-dom/framework';
|
|
2
2
|
import { ITdPopperTriggerConfig } from '../../td-popper/trigger/trigger.interface';
|
|
3
|
-
export interface ITdTooltipTrigger extends
|
|
3
|
+
export interface ITdTooltipTrigger extends ITypeDiv {
|
|
4
4
|
className: 'TdTooltipTrigger';
|
|
5
5
|
}
|
|
6
6
|
export type TooltipTriggerType = 'hover' | 'focus' | 'click' | 'contextmenu';
|
|
@@ -13,4 +13,9 @@ export interface ITdTooltipTriggerConfig extends ITdPopperTriggerConfig {
|
|
|
13
13
|
* @description How should the tooltip be triggered (to show)
|
|
14
14
|
*/
|
|
15
15
|
trigger?: TooltipTriggerType;
|
|
16
|
+
/**
|
|
17
|
+
* @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard
|
|
18
|
+
* default: () => [EVENT_CODE.enter, EVENT_CODE.space],
|
|
19
|
+
*/
|
|
20
|
+
triggerKeys?: string[];
|
|
16
21
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { RadioGroup } from './radio-group/radio-group.class';
|
|
2
|
-
export { RadioOption } from './radio-group/radio-option/radio-option.class';
|
|
3
1
|
export { CheckboxGroup } from './checkbox-group/checkbox-group.class';
|
|
4
2
|
export { CheckboxOption } from './checkbox-group/checkbox-option/checkbox-option.class';
|
|
5
3
|
export { FieldInput } from './field-item/input/field-input.abstract';
|
|
@@ -8,29 +6,32 @@ export { FieldSelect } from './field-item/select/field-select.abstract';
|
|
|
8
6
|
export { FieldSpan } from './field-item/span/field-span.abstract';
|
|
9
7
|
export { FieldTextarea } from './field-item/textarea/field-textarea.abstract';
|
|
10
8
|
export * from './field-item/field-item.interface';
|
|
9
|
+
export { TdInputField } from './td-input/td-input-field.class';
|
|
10
|
+
export type { ITdInputFieldConfig } from './td-input/td-input-field.interface';
|
|
11
|
+
export { RadioGroup } from './radio-group/radio-group.class';
|
|
12
|
+
export { RadioOption } from './radio-group/radio-option/radio-option.class';
|
|
11
13
|
export { TdCheckbox } from './td-checkbox/td-checkbox.class';
|
|
12
|
-
export type
|
|
14
|
+
export type * from './td-checkbox/td-checkbox.interface';
|
|
13
15
|
export { TdCheckboxGroup } from './td-checkbox-group/td-checkbox-group.class';
|
|
14
16
|
export type { ITdCheckboxGroupConfig } from './td-checkbox-group/td-checkbox-group.interface';
|
|
15
17
|
export { TdCheckboxButton } from './td-checkbox-button/td-checkbox-button.class';
|
|
16
|
-
export
|
|
17
|
-
export {
|
|
18
|
-
export
|
|
18
|
+
export { TdForm } from './td-form/td-form.class';
|
|
19
|
+
export type { ITdForm } from './td-form/td-form.interface';
|
|
20
|
+
export { TdFormItem } from './td-form-item/td-form-item.class';
|
|
21
|
+
export type { ITdFormItem, ILabelPosition } from './td-form-item/td-form-item.interface';
|
|
22
|
+
export { TdInput } from './td-input/td-input.class';
|
|
23
|
+
export type { ITdInputConfig } from './td-input/td-input.interface';
|
|
24
|
+
export { TdOption } from './td-option/td-option.class';
|
|
25
|
+
export type { ITdOptionConfig } from './td-option/td-option.interface';
|
|
26
|
+
export { TdOptionGroup } from './td-option-group/td-option-group.class';
|
|
27
|
+
export type { ITdOptionGroupConfig } from './td-option-group/td-option-group.interface';
|
|
19
28
|
export { TdRadio } from './td-radio/td-radio.class';
|
|
20
29
|
export type { ITdRadioConfig } from './td-radio/td-radio.interface';
|
|
21
30
|
export { TdRadioButton } from './td-radio-button/td-radio-button.class';
|
|
22
31
|
export type { ITdRadioButtonConfig } from './td-radio-button/td-radio-button.interface';
|
|
23
32
|
export { TdRadioGroup } from './td-radio-group/td-radio-group.class';
|
|
24
33
|
export type { ITdRadioGroupConfig } from './td-radio-group/td-radio-group.interface';
|
|
25
|
-
export { TdInput } from './td-input/td-input.class';
|
|
26
|
-
export type { ITdInputConfig } from './td-input/td-input.interface';
|
|
27
|
-
export { TdSwitch } from './td-switch/td-switch.class';
|
|
28
|
-
export type { ITdSwitchConfig } from './td-switch/td-switch.interface';
|
|
29
|
-
export { TdForm } from './td-form/td-form.class';
|
|
30
|
-
export type { ITdForm } from './td-form/td-form.interface';
|
|
31
|
-
export { TdFormItem } from './td-form-item/td-form-item.class';
|
|
32
|
-
export type { ITdFormItem, ILabelPosition } from './td-form-item/td-form-item.interface';
|
|
33
34
|
export { TdSelect } from './td-select/td-select.class';
|
|
34
35
|
export type { ITdSelectConfig } from './td-select/td-select.interface';
|
|
35
|
-
export {
|
|
36
|
-
export type {
|
|
36
|
+
export { TdSwitch } from './td-switch/td-switch.class';
|
|
37
|
+
export type { ITdSwitchConfig } from './td-switch/td-switch.interface';
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TdSwitch = exports.TdSelect = exports.TdRadioGroup = exports.TdRadioButton = exports.TdRadio = exports.TdOptionGroup = exports.TdOption = exports.TdInput = exports.TdFormItem = exports.TdForm = exports.TdCheckboxButton = exports.TdCheckboxGroup = exports.TdCheckbox = exports.RadioOption = exports.RadioGroup = exports.TdInputField = exports.FieldTextarea = exports.FieldSpan = exports.FieldSelect = exports.FieldRadio = exports.FieldInput = exports.CheckboxOption = exports.CheckboxGroup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
var radio_group_class_1 = require("./radio-group/radio-group.class");
|
|
6
|
-
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return radio_group_class_1.RadioGroup; } });
|
|
7
|
-
var radio_option_class_1 = require("./radio-group/radio-option/radio-option.class");
|
|
8
|
-
Object.defineProperty(exports, "RadioOption", { enumerable: true, get: function () { return radio_option_class_1.RadioOption; } });
|
|
9
5
|
var checkbox_group_class_1 = require("./checkbox-group/checkbox-group.class");
|
|
10
6
|
Object.defineProperty(exports, "CheckboxGroup", { enumerable: true, get: function () { return checkbox_group_class_1.CheckboxGroup; } });
|
|
11
7
|
var checkbox_option_class_1 = require("./checkbox-group/checkbox-option/checkbox-option.class");
|
|
@@ -21,29 +17,35 @@ Object.defineProperty(exports, "FieldSpan", { enumerable: true, get: function ()
|
|
|
21
17
|
var field_textarea_abstract_1 = require("./field-item/textarea/field-textarea.abstract");
|
|
22
18
|
Object.defineProperty(exports, "FieldTextarea", { enumerable: true, get: function () { return field_textarea_abstract_1.FieldTextarea; } });
|
|
23
19
|
tslib_1.__exportStar(require("./field-item/field-item.interface"), exports);
|
|
20
|
+
var td_input_field_class_1 = require("./td-input/td-input-field.class");
|
|
21
|
+
Object.defineProperty(exports, "TdInputField", { enumerable: true, get: function () { return td_input_field_class_1.TdInputField; } });
|
|
22
|
+
var radio_group_class_1 = require("./radio-group/radio-group.class");
|
|
23
|
+
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return radio_group_class_1.RadioGroup; } });
|
|
24
|
+
var radio_option_class_1 = require("./radio-group/radio-option/radio-option.class");
|
|
25
|
+
Object.defineProperty(exports, "RadioOption", { enumerable: true, get: function () { return radio_option_class_1.RadioOption; } });
|
|
24
26
|
var td_checkbox_class_1 = require("./td-checkbox/td-checkbox.class");
|
|
25
27
|
Object.defineProperty(exports, "TdCheckbox", { enumerable: true, get: function () { return td_checkbox_class_1.TdCheckbox; } });
|
|
26
28
|
var td_checkbox_group_class_1 = require("./td-checkbox-group/td-checkbox-group.class");
|
|
27
29
|
Object.defineProperty(exports, "TdCheckboxGroup", { enumerable: true, get: function () { return td_checkbox_group_class_1.TdCheckboxGroup; } });
|
|
28
30
|
var td_checkbox_button_class_1 = require("./td-checkbox-button/td-checkbox-button.class");
|
|
29
31
|
Object.defineProperty(exports, "TdCheckboxButton", { enumerable: true, get: function () { return td_checkbox_button_class_1.TdCheckboxButton; } });
|
|
30
|
-
var
|
|
31
|
-
Object.defineProperty(exports, "
|
|
32
|
+
var td_form_class_1 = require("./td-form/td-form.class");
|
|
33
|
+
Object.defineProperty(exports, "TdForm", { enumerable: true, get: function () { return td_form_class_1.TdForm; } });
|
|
34
|
+
var td_form_item_class_1 = require("./td-form-item/td-form-item.class");
|
|
35
|
+
Object.defineProperty(exports, "TdFormItem", { enumerable: true, get: function () { return td_form_item_class_1.TdFormItem; } });
|
|
36
|
+
var td_input_class_1 = require("./td-input/td-input.class");
|
|
37
|
+
Object.defineProperty(exports, "TdInput", { enumerable: true, get: function () { return td_input_class_1.TdInput; } });
|
|
38
|
+
var td_option_class_1 = require("./td-option/td-option.class");
|
|
39
|
+
Object.defineProperty(exports, "TdOption", { enumerable: true, get: function () { return td_option_class_1.TdOption; } });
|
|
40
|
+
var td_option_group_class_1 = require("./td-option-group/td-option-group.class");
|
|
41
|
+
Object.defineProperty(exports, "TdOptionGroup", { enumerable: true, get: function () { return td_option_group_class_1.TdOptionGroup; } });
|
|
32
42
|
var td_radio_class_1 = require("./td-radio/td-radio.class");
|
|
33
43
|
Object.defineProperty(exports, "TdRadio", { enumerable: true, get: function () { return td_radio_class_1.TdRadio; } });
|
|
34
44
|
var td_radio_button_class_1 = require("./td-radio-button/td-radio-button.class");
|
|
35
45
|
Object.defineProperty(exports, "TdRadioButton", { enumerable: true, get: function () { return td_radio_button_class_1.TdRadioButton; } });
|
|
36
46
|
var td_radio_group_class_1 = require("./td-radio-group/td-radio-group.class");
|
|
37
47
|
Object.defineProperty(exports, "TdRadioGroup", { enumerable: true, get: function () { return td_radio_group_class_1.TdRadioGroup; } });
|
|
38
|
-
var td_input_class_1 = require("./td-input/td-input.class");
|
|
39
|
-
Object.defineProperty(exports, "TdInput", { enumerable: true, get: function () { return td_input_class_1.TdInput; } });
|
|
40
|
-
var td_switch_class_1 = require("./td-switch/td-switch.class");
|
|
41
|
-
Object.defineProperty(exports, "TdSwitch", { enumerable: true, get: function () { return td_switch_class_1.TdSwitch; } });
|
|
42
|
-
var td_form_class_1 = require("./td-form/td-form.class");
|
|
43
|
-
Object.defineProperty(exports, "TdForm", { enumerable: true, get: function () { return td_form_class_1.TdForm; } });
|
|
44
|
-
var td_form_item_class_1 = require("./td-form-item/td-form-item.class");
|
|
45
|
-
Object.defineProperty(exports, "TdFormItem", { enumerable: true, get: function () { return td_form_item_class_1.TdFormItem; } });
|
|
46
48
|
var td_select_class_1 = require("./td-select/td-select.class");
|
|
47
49
|
Object.defineProperty(exports, "TdSelect", { enumerable: true, get: function () { return td_select_class_1.TdSelect; } });
|
|
48
|
-
var
|
|
49
|
-
Object.defineProperty(exports, "
|
|
50
|
+
var td_switch_class_1 = require("./td-switch/td-switch.class");
|
|
51
|
+
Object.defineProperty(exports, "TdSwitch", { enumerable: true, get: function () { return td_switch_class_1.TdSwitch; } });
|
|
@@ -9,7 +9,7 @@ const useCheckboxStatus = (props) => {
|
|
|
9
9
|
// In version 2.x, if there's no props.value, props.label will act as props.value
|
|
10
10
|
// In version 3.x, remove this computed value, use props.value instead.
|
|
11
11
|
if (!(0, utils_1.isPropAbsent)(props === null || props === void 0 ? void 0 : props.value)) {
|
|
12
|
-
return props.value;
|
|
12
|
+
return props === null || props === void 0 ? void 0 : props.value;
|
|
13
13
|
}
|
|
14
14
|
return props === null || props === void 0 ? void 0 : props.label;
|
|
15
15
|
})();
|
|
@@ -10,7 +10,7 @@ const useCheckbox = (props) => {
|
|
|
10
10
|
// checkboxButtonSize,
|
|
11
11
|
// checkboxSize,
|
|
12
12
|
hasOwnLabel, actualValue, } = (0, use_checkbox_status_1.useCheckboxStatus)(props);
|
|
13
|
-
// const { isDisabled } = useCheckboxDisabled({ model, isChecked })
|
|
13
|
+
// const { isDisabled } = useCheckboxDisabled({ model, isChecked });
|
|
14
14
|
// const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
|
|
15
15
|
// formItemContext: elFormItem,
|
|
16
16
|
// disableIdGeneration: hasOwnLabel,
|
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeHtml } from '@type-dom/framework';
|
|
2
2
|
import { ITdCheckbox, ITdCheckboxConfig } from './td-checkbox.interface';
|
|
3
|
-
|
|
3
|
+
import { ISize } from '../../../styles';
|
|
4
|
+
export declare class TdCheckbox extends TypeHtml implements ITdCheckbox {
|
|
4
5
|
className: 'TdCheckbox';
|
|
6
|
+
nodeName: string;
|
|
7
|
+
dom: HTMLElement;
|
|
5
8
|
props: ITdCheckboxConfig;
|
|
6
9
|
private isFocused?;
|
|
7
10
|
private isLimitExceeded?;
|
|
8
11
|
private actualValue?;
|
|
9
12
|
private intermediate?;
|
|
10
13
|
private hasOwnLabel?;
|
|
14
|
+
private isDisabled?;
|
|
15
|
+
private isLabeledByFormItem?;
|
|
16
|
+
private model?;
|
|
11
17
|
constructor(params?: ITdCheckboxConfig);
|
|
12
|
-
|
|
18
|
+
get checkedValue(): boolean | undefined;
|
|
19
|
+
mounted(): void;
|
|
20
|
+
handleChange(ev?: InputEvent): void;
|
|
21
|
+
onClickRoot(e: MouseEvent): Promise<void>;
|
|
22
|
+
getLabeledValue(value: string | number | boolean): string | number | boolean;
|
|
23
|
+
emitChangeEvent(checked: string | number | boolean, e: InputEvent | MouseEvent): void;
|
|
24
|
+
setChecked(checked?: number | string | boolean): void;
|
|
25
|
+
setDisabled(disabled: boolean): void;
|
|
26
|
+
setIndeterminate(indeterminate: boolean): void;
|
|
27
|
+
setSize(size: ISize): void;
|
|
13
28
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdCheckbox = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const framework_1 = require("@type-dom/framework");
|
|
5
|
-
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
|
-
const td_checkbox_style_1 = require("./td-checkbox.style");
|
|
7
6
|
const use_checkbox_1 = require("./composables/use-checkbox");
|
|
8
|
-
|
|
7
|
+
const td_checkbox_style_1 = require("./td-checkbox.style");
|
|
8
|
+
const styles_1 = require("../../../styles");
|
|
9
|
+
const event_1 = require("../../../constants/event");
|
|
10
|
+
const utils_1 = require("@type-dom/utils");
|
|
11
|
+
class TdCheckbox extends framework_1.TypeHtml {
|
|
9
12
|
constructor(params = {}) {
|
|
10
|
-
|
|
11
|
-
const tag = !hasOwnLabel ? 'span' : 'label';
|
|
12
|
-
super(params, tag); // label | span
|
|
13
|
+
super(); // label | span
|
|
13
14
|
this.className = 'TdCheckbox';
|
|
15
|
+
(0, td_checkbox_style_1.useCheckboxStyle)(params);
|
|
16
|
+
const { hasOwnLabel } = (0, use_checkbox_1.useCheckbox)(params);
|
|
17
|
+
console.log('hasOwnLabel is ', hasOwnLabel);
|
|
18
|
+
this.nodeName = !hasOwnLabel ? 'span' : 'label';
|
|
19
|
+
this.dom = document.createElement(this.nodeName);
|
|
14
20
|
this.attr.addObj({
|
|
15
21
|
name: 'td-checkbox'
|
|
16
22
|
});
|
|
@@ -49,6 +55,10 @@ class TdCheckbox extends ui_abstract_1.UI {
|
|
|
49
55
|
name: 'inner',
|
|
50
56
|
styleObj: td_checkbox_style_1.$checkboxInnerStyle,
|
|
51
57
|
childNodes: [
|
|
58
|
+
new framework_1.Span({
|
|
59
|
+
name: 'inner-before',
|
|
60
|
+
styleObj: td_checkbox_style_1.$checkboxInnerBeforeStyle,
|
|
61
|
+
}),
|
|
52
62
|
new framework_1.Span({
|
|
53
63
|
name: 'inner-after',
|
|
54
64
|
styleObj: td_checkbox_style_1.$checkboxInnerAfterStyle
|
|
@@ -67,17 +77,229 @@ class TdCheckbox extends ui_abstract_1.UI {
|
|
|
67
77
|
labelSpan.slotChild(params.slot);
|
|
68
78
|
}
|
|
69
79
|
else {
|
|
70
|
-
labelSpan.
|
|
80
|
+
labelSpan.slotChild(String(params.label || ''));
|
|
71
81
|
}
|
|
72
82
|
this.addChild(labelSpan);
|
|
73
83
|
}
|
|
84
|
+
this.addEvents({
|
|
85
|
+
click: (evt) => {
|
|
86
|
+
// todo
|
|
87
|
+
console.log('click . ');
|
|
88
|
+
if (this.props.disabled) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const input = this.down('name', 'original');
|
|
92
|
+
const checked = input.dom.checked = !input.dom.checked;
|
|
93
|
+
this.setChecked(checked);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
this.addEmits({
|
|
97
|
+
[event_1.UPDATE_MODEL_EVENT]: (val) => (0, utils_1.isString)(val) || (0, utils_1.isNumber)(val) || (0, utils_1.isBoolean)(val),
|
|
98
|
+
change: (val) => (0, utils_1.isString)(val) || (0, utils_1.isNumber)(val) || (0, utils_1.isBoolean)(val),
|
|
99
|
+
});
|
|
74
100
|
this.props = this.useParams(params);
|
|
75
101
|
}
|
|
102
|
+
get checkedValue() {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_a = this.down('name', 'original')) === null || _a === void 0 ? void 0 : _a.dom.checked;
|
|
105
|
+
}
|
|
106
|
+
mounted() {
|
|
107
|
+
const input = this.down('name', 'original');
|
|
108
|
+
if (this.props.modelValue) {
|
|
109
|
+
input.dom.checked = true;
|
|
110
|
+
this.props.checked = true;
|
|
111
|
+
}
|
|
112
|
+
if (this.props.indeterminate) {
|
|
113
|
+
this.setIndeterminate(true);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
76
116
|
handleChange(ev) {
|
|
77
|
-
|
|
117
|
+
console.log('handleChange . ');
|
|
118
|
+
if (this.isLimitExceeded) {
|
|
78
119
|
return;
|
|
120
|
+
}
|
|
79
121
|
const target = ev === null || ev === void 0 ? void 0 : ev.target;
|
|
80
|
-
|
|
122
|
+
target.checked = !target.checked;
|
|
123
|
+
this.props.checked = target.checked;
|
|
124
|
+
// this.emit('change', target.checked, ev)
|
|
125
|
+
}
|
|
126
|
+
onClickRoot(e) {
|
|
127
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
console.log('onClickRoot . ');
|
|
129
|
+
if (this.isLimitExceeded) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (!this.hasOwnLabel && !this.isDisabled && this.isLabeledByFormItem) {
|
|
133
|
+
// fix: https://github.com/element-plus/element-plus/issues/9981
|
|
134
|
+
const eventTargets = e.composedPath();
|
|
135
|
+
const hasLabel = eventTargets.some((item) => item.tagName === 'LABEL');
|
|
136
|
+
if (!hasLabel) {
|
|
137
|
+
this.model = this.getLabeledValue([false, this.props.falseValue, this.props.falseLabel].includes(this.model));
|
|
138
|
+
yield (0, framework_1.nextTick)();
|
|
139
|
+
this.emitChangeEvent(this.model, e);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
getLabeledValue(value) {
|
|
145
|
+
var _a, _b, _c, _d;
|
|
146
|
+
return [true, this.props.trueValue, this.props.trueLabel].includes(value)
|
|
147
|
+
? (_b = (_a = this.props.trueValue) !== null && _a !== void 0 ? _a : this.props.trueLabel) !== null && _b !== void 0 ? _b : true
|
|
148
|
+
: (_d = (_c = this.props.falseValue) !== null && _c !== void 0 ? _c : this.props.falseLabel) !== null && _d !== void 0 ? _d : false;
|
|
149
|
+
}
|
|
150
|
+
emitChangeEvent(checked, e) {
|
|
151
|
+
// this.emit('change', this.getLabeledValue(checked), e)
|
|
152
|
+
}
|
|
153
|
+
setChecked(checked) {
|
|
154
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
155
|
+
// todo 待实现 选中、不选中
|
|
156
|
+
console.log('setChecked . checked is ', checked);
|
|
157
|
+
const label = this.down('name', 'label');
|
|
158
|
+
const inner = this.down('name', 'inner');
|
|
159
|
+
const innerAfter = this.down('name', 'inner-after');
|
|
160
|
+
const innerBefore = this.down('name', 'inner-before');
|
|
161
|
+
const input = this.down('name', 'original');
|
|
162
|
+
input.dom.checked = !!checked;
|
|
163
|
+
this.props.checked = !!checked;
|
|
164
|
+
// this.props.modelValue = checked; // todo modelValue = checkbox.value
|
|
165
|
+
if (checked) {
|
|
166
|
+
(_a = label === null || label === void 0 ? void 0 : label.style) === null || _a === void 0 ? void 0 : _a.setObj({
|
|
167
|
+
color: td_checkbox_style_1.$checkbox.checkedTextColor,
|
|
168
|
+
});
|
|
169
|
+
(_b = inner === null || inner === void 0 ? void 0 : inner.style) === null || _b === void 0 ? void 0 : _b.setObj({
|
|
170
|
+
borderColor: td_checkbox_style_1.$checkbox.checkedInputBorderColor,
|
|
171
|
+
background: td_checkbox_style_1.$checkbox.checkedBgColor,
|
|
172
|
+
});
|
|
173
|
+
(_c = innerBefore === null || innerBefore === void 0 ? void 0 : innerBefore.style) === null || _c === void 0 ? void 0 : _c.setObj({
|
|
174
|
+
display: 'none',
|
|
175
|
+
});
|
|
176
|
+
(_d = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _d === void 0 ? void 0 : _d.setObj({
|
|
177
|
+
transform: 'rotate(45deg) scaleY(1)',
|
|
178
|
+
display: 'block',
|
|
179
|
+
borderColor: td_checkbox_style_1.$checkbox.checkedIconColor
|
|
180
|
+
});
|
|
181
|
+
if (this.props.border) {
|
|
182
|
+
(_e = this.style) === null || _e === void 0 ? void 0 : _e.setObj({
|
|
183
|
+
borderColor: styles_1.$colorPrimary
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
(_f = label === null || label === void 0 ? void 0 : label.style) === null || _f === void 0 ? void 0 : _f.setObj({
|
|
189
|
+
color: td_checkbox_style_1.$checkbox.textColor,
|
|
190
|
+
});
|
|
191
|
+
(_g = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _g === void 0 ? void 0 : _g.setObj({
|
|
192
|
+
transform: 'rotate(45deg) scaleY(0)',
|
|
193
|
+
});
|
|
194
|
+
(_h = innerBefore === null || innerBefore === void 0 ? void 0 : innerBefore.style) === null || _h === void 0 ? void 0 : _h.setObj({
|
|
195
|
+
display: 'none',
|
|
196
|
+
});
|
|
197
|
+
(_j = inner === null || inner === void 0 ? void 0 : inner.style) === null || _j === void 0 ? void 0 : _j.setObj({
|
|
198
|
+
borderColor: styles_1.$borderColor.base,
|
|
199
|
+
background: td_checkbox_style_1.$checkbox.bgColor,
|
|
200
|
+
});
|
|
201
|
+
if (this.props.border) {
|
|
202
|
+
if (this.props.disabled) {
|
|
203
|
+
(_k = this.style) === null || _k === void 0 ? void 0 : _k.setObj({
|
|
204
|
+
borderColor: styles_1.$borderColor.lighter
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
(_l = this.style) === null || _l === void 0 ? void 0 : _l.setObj({
|
|
209
|
+
border: styles_1.$border
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// if (this.props.indeterminate) {
|
|
215
|
+
// this.setIndeterminate(true);
|
|
216
|
+
// }
|
|
217
|
+
if (this.props.disabled) {
|
|
218
|
+
this.setDisabled(true);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
setDisabled(disabled) {
|
|
222
|
+
var _a, _b, _c, _d, _e, _f;
|
|
223
|
+
const label = this.down('name', 'label');
|
|
224
|
+
const inner = this.down('name', 'inner');
|
|
225
|
+
const innerAfter = this.down('name', 'inner-after');
|
|
226
|
+
this.props.disabled = disabled;
|
|
227
|
+
if (disabled) {
|
|
228
|
+
this.style.addObj({
|
|
229
|
+
cursor: 'not-allowed',
|
|
230
|
+
borderColor: styles_1.$borderColor.lighter,
|
|
231
|
+
// pointerEvents: 'none',
|
|
232
|
+
});
|
|
233
|
+
(_a = label === null || label === void 0 ? void 0 : label.style) === null || _a === void 0 ? void 0 : _a.setObj({
|
|
234
|
+
color: styles_1.$disabled.textColor,
|
|
235
|
+
cursor: 'not-allowed',
|
|
236
|
+
});
|
|
237
|
+
(_b = inner === null || inner === void 0 ? void 0 : inner.style) === null || _b === void 0 ? void 0 : _b.setObj({
|
|
238
|
+
background: td_checkbox_style_1.$checkbox.disabledInputFill,
|
|
239
|
+
borderColor: td_checkbox_style_1.$checkbox.disabledBorderColor,
|
|
240
|
+
cursor: 'not-allowed',
|
|
241
|
+
});
|
|
242
|
+
(_c = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _c === void 0 ? void 0 : _c.setObj({
|
|
243
|
+
cursor: 'not-allowed',
|
|
244
|
+
borderColor: td_checkbox_style_1.$checkbox.disabledIconColor
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
this.style.setObj({
|
|
249
|
+
cursor: 'pointer',
|
|
250
|
+
borderColor: styles_1.$borderColor.base,
|
|
251
|
+
});
|
|
252
|
+
(_d = label === null || label === void 0 ? void 0 : label.style) === null || _d === void 0 ? void 0 : _d.setObj({
|
|
253
|
+
color: '',
|
|
254
|
+
cursor: '',
|
|
255
|
+
});
|
|
256
|
+
(_e = inner === null || inner === void 0 ? void 0 : inner.style) === null || _e === void 0 ? void 0 : _e.setObj({
|
|
257
|
+
background: td_checkbox_style_1.$checkbox.bgColor,
|
|
258
|
+
borderColor: td_checkbox_style_1.$checkbox.inputBorder,
|
|
259
|
+
cursor: 'pointer',
|
|
260
|
+
});
|
|
261
|
+
(_f = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _f === void 0 ? void 0 : _f.setObj({
|
|
262
|
+
cursor: 'pointer',
|
|
263
|
+
borderColor: td_checkbox_style_1.$checkbox.checkedIconColor,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
setIndeterminate(indeterminate) {
|
|
268
|
+
var _a, _b, _c, _d, _e;
|
|
269
|
+
this.props.indeterminate = indeterminate;
|
|
270
|
+
const inner = this.down('name', 'inner');
|
|
271
|
+
const innerAfter = this.down('name', 'inner-after');
|
|
272
|
+
const innerBefore = this.down('name', 'inner-before');
|
|
273
|
+
if (indeterminate) { // todo 部分选中
|
|
274
|
+
(_a = innerBefore === null || innerBefore === void 0 ? void 0 : innerBefore.style) === null || _a === void 0 ? void 0 : _a.setObj({
|
|
275
|
+
display: 'block',
|
|
276
|
+
});
|
|
277
|
+
(_b = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _b === void 0 ? void 0 : _b.setObj({
|
|
278
|
+
transform: 'rotate(45deg) scaleY(0)',
|
|
279
|
+
display: 'none',
|
|
280
|
+
});
|
|
281
|
+
(_c = inner === null || inner === void 0 ? void 0 : inner.style) === null || _c === void 0 ? void 0 : _c.setObj({
|
|
282
|
+
borderColor: td_checkbox_style_1.$checkbox.checkedInputBorderColor,
|
|
283
|
+
background: td_checkbox_style_1.$checkbox.checkedBgColor,
|
|
284
|
+
});
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
(_d = innerBefore === null || innerBefore === void 0 ? void 0 : innerBefore.style) === null || _d === void 0 ? void 0 : _d.setObj({
|
|
289
|
+
display: 'none',
|
|
290
|
+
});
|
|
291
|
+
(_e = innerAfter === null || innerAfter === void 0 ? void 0 : innerAfter.style) === null || _e === void 0 ? void 0 : _e.setObj({
|
|
292
|
+
// transform: 'rotate(45deg) scaleY(1)',
|
|
293
|
+
display: 'block',
|
|
294
|
+
});
|
|
295
|
+
// inner?.style?.setObj({
|
|
296
|
+
// borderColor: $borderColor.base,
|
|
297
|
+
// background: $checkbox.bgColor,
|
|
298
|
+
// });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
setSize(size) {
|
|
302
|
+
// todo
|
|
81
303
|
}
|
|
82
304
|
}
|
|
83
305
|
exports.TdCheckbox = TdCheckbox;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const checkboxProps: {
|
|
2
|
+
/**
|
|
3
|
+
* @description binding value
|
|
4
|
+
* type: [Number, String, Boolean],
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @description label of the Checkbox when used inside a `checkbox-group`
|
|
8
|
+
* type: [String, Boolean, Number, Object],
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @description value of the Checkbox when used inside a `checkbox-group`
|
|
12
|
+
* type: [String, Boolean, Number, Object],
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @description Set indeterminate state, only responsible for style control
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @description whether the Checkbox is disabled
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* @description if the Checkbox is checked
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @description native 'name' attribute
|
|
25
|
+
* type: String,
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @description value of the Checkbox if it's checked
|
|
29
|
+
* type: [String, Number],
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @description value of the Checkbox if it's not checked
|
|
33
|
+
* type: [String, Number],
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use `trueValue` instead
|
|
37
|
+
* @description value of the Checkbox if it's checked
|
|
38
|
+
* type: [String, Number],
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated use `falseValue` instead
|
|
42
|
+
* @description value of the Checkbox if it's not checked
|
|
43
|
+
* type: [String, Number],
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @description input id
|
|
47
|
+
* type: String,
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* @description whether to add a border around Checkbox
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* @description size of the Checkbox
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* @description input tabindex
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* @description whether to trigger form validation
|
|
60
|
+
* type: Boolean,
|
|
61
|
+
*/
|
|
62
|
+
validateEvent: boolean;
|
|
63
|
+
};
|