@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkboxProps = void 0;
|
|
4
|
+
exports.checkboxProps = {
|
|
5
|
+
/**
|
|
6
|
+
* @description binding value
|
|
7
|
+
* type: [Number, String, Boolean],
|
|
8
|
+
*/
|
|
9
|
+
// modelValue: undefined,
|
|
10
|
+
/**
|
|
11
|
+
* @description label of the Checkbox when used inside a `checkbox-group`
|
|
12
|
+
* type: [String, Boolean, Number, Object],
|
|
13
|
+
*/
|
|
14
|
+
// label: undefined,
|
|
15
|
+
/**
|
|
16
|
+
* @description value of the Checkbox when used inside a `checkbox-group`
|
|
17
|
+
* type: [String, Boolean, Number, Object],
|
|
18
|
+
*/
|
|
19
|
+
// value: undefined,
|
|
20
|
+
/**
|
|
21
|
+
* @description Set indeterminate state, only responsible for style control
|
|
22
|
+
*/
|
|
23
|
+
// indeterminate: Boolean,
|
|
24
|
+
/**
|
|
25
|
+
* @description whether the Checkbox is disabled
|
|
26
|
+
*/
|
|
27
|
+
// disabled: Boolean,
|
|
28
|
+
/**
|
|
29
|
+
* @description if the Checkbox is checked
|
|
30
|
+
*/
|
|
31
|
+
// checked: Boolean,
|
|
32
|
+
/**
|
|
33
|
+
* @description native 'name' attribute
|
|
34
|
+
* type: String,
|
|
35
|
+
*/
|
|
36
|
+
// name: undefined,
|
|
37
|
+
/**
|
|
38
|
+
* @description value of the Checkbox if it's checked
|
|
39
|
+
* type: [String, Number],
|
|
40
|
+
*/
|
|
41
|
+
// trueValue: undefined,
|
|
42
|
+
/**
|
|
43
|
+
* @description value of the Checkbox if it's not checked
|
|
44
|
+
* type: [String, Number],
|
|
45
|
+
*/
|
|
46
|
+
// falseValue: undefined,
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated use `trueValue` instead
|
|
49
|
+
* @description value of the Checkbox if it's checked
|
|
50
|
+
* type: [String, Number],
|
|
51
|
+
*/
|
|
52
|
+
// trueLabel: undefined,
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated use `falseValue` instead
|
|
55
|
+
* @description value of the Checkbox if it's not checked
|
|
56
|
+
* type: [String, Number],
|
|
57
|
+
*/
|
|
58
|
+
// falseLabel: undefined,
|
|
59
|
+
/**
|
|
60
|
+
* @description input id
|
|
61
|
+
* type: String,
|
|
62
|
+
*/
|
|
63
|
+
// id: undefined,
|
|
64
|
+
/**
|
|
65
|
+
* @description whether to add a border around Checkbox
|
|
66
|
+
*/
|
|
67
|
+
// border: Boolean,
|
|
68
|
+
/**
|
|
69
|
+
* @description size of the Checkbox
|
|
70
|
+
*/
|
|
71
|
+
// size: ISize,
|
|
72
|
+
/**
|
|
73
|
+
* @description input tabindex
|
|
74
|
+
*/
|
|
75
|
+
// tabindex: [String, Number],
|
|
76
|
+
/**
|
|
77
|
+
* @description whether to trigger form validation
|
|
78
|
+
* type: Boolean,
|
|
79
|
+
*/
|
|
80
|
+
validateEvent: true,
|
|
81
|
+
// ...useAriaProps(['ariaControls']),
|
|
82
|
+
};
|
|
83
|
+
// export const checkboxEmits = {
|
|
84
|
+
// [UPDATE_MODEL_EVENT]: (val: CheckboxValueType) =>
|
|
85
|
+
// isString(val) || isNumber(val) || isBoolean(val),
|
|
86
|
+
// change: (val: CheckboxValueType) =>
|
|
87
|
+
// isString(val) || isNumber(val) || isBoolean(val),
|
|
88
|
+
// }
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITypeConfig, ITypeHtml } from '@type-dom/framework';
|
|
2
2
|
import { ISize } from '../../../styles/size';
|
|
3
|
-
|
|
4
|
-
export interface ITdCheckbox extends IUI {
|
|
3
|
+
export interface ITdCheckbox extends ITypeHtml {
|
|
5
4
|
className: 'TdCheckbox';
|
|
6
5
|
}
|
|
7
|
-
export interface ITdCheckboxConfig extends
|
|
6
|
+
export interface ITdCheckboxConfig extends ITypeConfig {
|
|
8
7
|
/**
|
|
9
8
|
* @description binding value
|
|
10
9
|
*/
|
|
@@ -12,7 +11,7 @@ export interface ITdCheckboxConfig extends IUIConfig {
|
|
|
12
11
|
/**
|
|
13
12
|
* @description label of the Checkbox when used inside a `checkbox-group`
|
|
14
13
|
*/
|
|
15
|
-
label?: string | number
|
|
14
|
+
label?: string | number;
|
|
16
15
|
/**
|
|
17
16
|
* @description value of the Checkbox when used inside a `checkbox-group`
|
|
18
17
|
*/
|
|
@@ -77,3 +76,4 @@ export interface ITdCheckboxConfig extends IUIConfig {
|
|
|
77
76
|
*/
|
|
78
77
|
validateEvent?: boolean;
|
|
79
78
|
}
|
|
79
|
+
export type CheckboxValueType = string | number | boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IStyle } from '@type-dom/css-type';
|
|
2
|
+
import { ITdCheckboxConfig } from './td-checkbox.interface';
|
|
2
3
|
export declare const $checkbox: {
|
|
3
4
|
fontSize: string;
|
|
4
5
|
fontWeight: number;
|
|
@@ -42,6 +43,7 @@ export declare const $checkboxBorderedInputHeight: {
|
|
|
42
43
|
};
|
|
43
44
|
export declare const $checkboxFontSize: {
|
|
44
45
|
large: string;
|
|
46
|
+
default: string;
|
|
45
47
|
small: string;
|
|
46
48
|
};
|
|
47
49
|
export declare const $checkboxBorderedInputWidth: {
|
|
@@ -55,6 +57,13 @@ export declare const $checkboxStyle: IStyle;
|
|
|
55
57
|
export declare const $checkboxInputStyle: IStyle;
|
|
56
58
|
export declare const $checkboxInnerStyle: IStyle;
|
|
57
59
|
export declare const $checkboxInnerAfterStyle: IStyle;
|
|
60
|
+
export declare const $checkboxInnerBeforeStyle: IStyle;
|
|
58
61
|
export declare const $checkboxOriginalStyle: IStyle;
|
|
59
62
|
export declare const $checkboxLabelStyle: IStyle;
|
|
60
63
|
export declare const $checkboxGroupStyle: IStyle;
|
|
64
|
+
export declare function useCheckboxStyle(params: ITdCheckboxConfig): void;
|
|
65
|
+
export declare function useSize(params: ITdCheckboxConfig): void;
|
|
66
|
+
export declare function useBordered(params: ITdCheckboxConfig): void;
|
|
67
|
+
export declare function useDisabled(params: ITdCheckboxConfig): void;
|
|
68
|
+
export declare function useChecked(params: ITdCheckboxConfig): void;
|
|
69
|
+
export declare function useIndeterminate(params: ITdCheckboxConfig): void;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.$checkboxGroupStyle = exports.$checkboxLabelStyle = exports.$checkboxOriginalStyle = exports.$checkboxInnerAfterStyle = exports.$checkboxInnerStyle = exports.$checkboxInputStyle = exports.$checkboxStyle = exports.$checkboxBorderedInputWidth = exports.$checkboxFontSize = exports.$checkboxBorderedInputHeight = exports.$checkboxHeight = exports.$checkboxBorderedPaddingRight = exports.$checkboxBorderedPaddingLeft = exports.$checkbox = void 0;
|
|
3
|
+
exports.$checkboxGroupStyle = exports.$checkboxLabelStyle = exports.$checkboxOriginalStyle = exports.$checkboxInnerBeforeStyle = exports.$checkboxInnerAfterStyle = exports.$checkboxInnerStyle = exports.$checkboxInputStyle = exports.$checkboxStyle = exports.$checkboxBorderedInputWidth = exports.$checkboxFontSize = exports.$checkboxBorderedInputHeight = exports.$checkboxHeight = exports.$checkboxBorderedPaddingRight = exports.$checkboxBorderedPaddingLeft = exports.$checkbox = void 0;
|
|
4
|
+
exports.useCheckboxStyle = useCheckboxStyle;
|
|
5
|
+
exports.useSize = useSize;
|
|
6
|
+
exports.useBordered = useBordered;
|
|
7
|
+
exports.useDisabled = useDisabled;
|
|
8
|
+
exports.useChecked = useChecked;
|
|
9
|
+
exports.useIndeterminate = useIndeterminate;
|
|
4
10
|
const var_1 = require("../../../styles/var");
|
|
5
11
|
exports.$checkbox = {
|
|
6
12
|
fontSize: '14px',
|
|
@@ -57,6 +63,7 @@ exports.$checkboxBorderedInputHeight = {
|
|
|
57
63
|
};
|
|
58
64
|
exports.$checkboxFontSize = {
|
|
59
65
|
large: '14px',
|
|
66
|
+
default: '14px',
|
|
60
67
|
small: '12px'
|
|
61
68
|
};
|
|
62
69
|
exports.$checkboxBorderedInputWidth = {
|
|
@@ -96,18 +103,18 @@ exports.$checkboxInnerStyle = {
|
|
|
96
103
|
// border: getCssVar('checkbox-input-border'),
|
|
97
104
|
border: exports.$checkbox.inputBorder,
|
|
98
105
|
// borderRadius: getCssVar('checkbox-border-radius'),
|
|
99
|
-
borderRadius:
|
|
106
|
+
borderRadius: exports.$checkbox.borderRadius,
|
|
100
107
|
boxSizing: 'border-box',
|
|
101
108
|
// width: getCssVar('checkbox-input-width'),
|
|
102
|
-
|
|
109
|
+
width: exports.$checkbox.inputWidth,
|
|
103
110
|
// height: getCssVar('checkbox-input-height'),
|
|
104
|
-
height: exports.$
|
|
111
|
+
height: exports.$checkbox.inputHeight,
|
|
105
112
|
// background-color: getCssVar('checkbox-bg-color'),
|
|
106
|
-
backgroundColor:
|
|
113
|
+
backgroundColor: exports.$checkbox.bgColor,
|
|
107
114
|
// z-index: getCssVar('index-normal'),
|
|
108
115
|
zIndex: var_1.$zIndex.normal,
|
|
109
|
-
transition: `border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
110
|
-
background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
116
|
+
transition: `border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
117
|
+
background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
111
118
|
outline 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46)`
|
|
112
119
|
};
|
|
113
120
|
exports.$checkboxInnerAfterStyle = {
|
|
@@ -116,19 +123,28 @@ exports.$checkboxInnerAfterStyle = {
|
|
|
116
123
|
border: '1px solid transparent',
|
|
117
124
|
borderLeft: 0,
|
|
118
125
|
borderTop: 0,
|
|
119
|
-
|
|
126
|
+
height: '7px',
|
|
120
127
|
left: '4px',
|
|
121
128
|
position: 'absolute',
|
|
122
129
|
top: '1px',
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
transform: 'rotate(45deg) scaleY(0)', // scaleY(1)
|
|
131
|
+
width: '3px',
|
|
125
132
|
transition: 'transform 0.15s ease-in 0.05s',
|
|
126
133
|
transformOrigin: 'center',
|
|
127
|
-
transform: 'rotate(45deg) scaleY(1)',
|
|
128
134
|
// border-color: var(--el-checkbox-checked-icon-color),
|
|
129
|
-
borderColor:
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
// borderColor: $checkbox.checkedIconColor,
|
|
136
|
+
};
|
|
137
|
+
exports.$checkboxInnerBeforeStyle = {
|
|
138
|
+
// content: '',
|
|
139
|
+
position: 'absolute',
|
|
140
|
+
display: 'block',
|
|
141
|
+
// backgroundColor: getCssVar('checkbox-checked-icon-color'),
|
|
142
|
+
backgroundColor: exports.$checkbox.checkedIconColor,
|
|
143
|
+
height: '2px',
|
|
144
|
+
transform: 'scale(0.5)',
|
|
145
|
+
left: 0,
|
|
146
|
+
right: 0,
|
|
147
|
+
top: '5px',
|
|
132
148
|
};
|
|
133
149
|
exports.$checkboxOriginalStyle = {
|
|
134
150
|
opacity: 0,
|
|
@@ -150,3 +166,140 @@ exports.$checkboxGroupStyle = {
|
|
|
150
166
|
fontSize: 0,
|
|
151
167
|
lineHeight: 0,
|
|
152
168
|
};
|
|
169
|
+
function useCheckboxStyle(params) {
|
|
170
|
+
useSize(params);
|
|
171
|
+
useBordered(params);
|
|
172
|
+
useIndeterminate(params);
|
|
173
|
+
useDisabled(params);
|
|
174
|
+
useChecked(params);
|
|
175
|
+
}
|
|
176
|
+
function useSize(params) {
|
|
177
|
+
const size = params.size || 'default';
|
|
178
|
+
exports.$checkboxStyle.height = exports.$checkboxHeight[size];
|
|
179
|
+
exports.$checkboxLabelStyle.fontSize = exports.$checkboxFontSize[size];
|
|
180
|
+
exports.$checkboxInnerStyle.width = exports.$checkboxFontSize[size];
|
|
181
|
+
exports.$checkboxInnerStyle.height = exports.$checkboxFontSize[size];
|
|
182
|
+
if (size === 'small') {
|
|
183
|
+
exports.$checkboxInnerAfterStyle.width = '2px';
|
|
184
|
+
exports.$checkboxInnerAfterStyle.height = '6px';
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
exports.$checkboxInnerAfterStyle.width = '3px';
|
|
188
|
+
exports.$checkboxInnerAfterStyle.height = '7px';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function useBordered(params) {
|
|
192
|
+
const bordered = params.border || false;
|
|
193
|
+
const checked = params.checked || params.modelValue || false;
|
|
194
|
+
const disabled = params.disabled || false;
|
|
195
|
+
if (bordered) {
|
|
196
|
+
exports.$checkboxStyle.padding = '0 ' + (parseInt(exports.$checkboxBorderedPaddingRight.default) - parseInt(var_1.$borderWidth)) + 'px'
|
|
197
|
+
+ ' 0 ' + (parseInt(exports.$checkboxBorderedPaddingLeft.default) - parseInt(var_1.$borderWidth)) + 'px';
|
|
198
|
+
exports.$checkboxStyle.borderRadius = var_1.$borderRadius.base;
|
|
199
|
+
exports.$checkboxStyle.border = var_1.$border;
|
|
200
|
+
exports.$checkboxStyle.boxSizing = 'border-box';
|
|
201
|
+
if (checked) {
|
|
202
|
+
exports.$checkboxStyle.borderColor = var_1.$colorPrimary;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
exports.$checkboxStyle.border = var_1.$border;
|
|
206
|
+
}
|
|
207
|
+
if (disabled) {
|
|
208
|
+
exports.$checkboxStyle.borderColor = var_1.$borderColor.lighter;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
exports.$checkboxStyle.border = var_1.$border;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
exports.$checkboxStyle.border = undefined;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function useDisabled(params) {
|
|
219
|
+
const disabled = params.disabled || false;
|
|
220
|
+
const checked = params.checked || false;
|
|
221
|
+
const indeterminate = params.indeterminate || false;
|
|
222
|
+
if (disabled) {
|
|
223
|
+
exports.$checkboxStyle.cursor = 'not-allowed';
|
|
224
|
+
exports.$checkboxInnerStyle.cursor = 'not-allowed';
|
|
225
|
+
if (checked) {
|
|
226
|
+
exports.$checkboxInnerStyle.backgroundColor = exports.$checkbox.disabledCheckedInputFill;
|
|
227
|
+
exports.$checkboxInnerStyle.borderColor = exports.$checkbox.disabledCheckedInputBorderColor;
|
|
228
|
+
exports.$checkboxInnerAfterStyle.borderColor = exports.$checkbox.disabledCheckedIconColor;
|
|
229
|
+
}
|
|
230
|
+
if (indeterminate) {
|
|
231
|
+
exports.$checkboxInnerStyle.backgroundColor = exports.$checkbox.disabledCheckedInputFill;
|
|
232
|
+
exports.$checkboxInnerStyle.borderColor = exports.$checkbox.disabledCheckedInputBorderColor;
|
|
233
|
+
exports.$checkboxInnerAfterStyle.borderColor = exports.$checkbox.disabledCheckedIconColor;
|
|
234
|
+
}
|
|
235
|
+
exports.$checkboxLabelStyle.cursor = 'not-allowed';
|
|
236
|
+
exports.$checkboxLabelStyle.color = var_1.$disabled.textColor;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
exports.$checkboxStyle.cursor = 'pointer';
|
|
240
|
+
exports.$checkboxInnerStyle.cursor = 'pointer';
|
|
241
|
+
exports.$checkboxLabelStyle.cursor = 'pointer';
|
|
242
|
+
exports.$checkboxLabelStyle.color = exports.$checkbox.textColor;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function useChecked(params) {
|
|
246
|
+
let checked = params.checked || params.modelValue || false;
|
|
247
|
+
const indeterminate = params.indeterminate || false;
|
|
248
|
+
const bordered = params.border || false;
|
|
249
|
+
if (params.modelValue !== undefined) { // todo checkbox 的值没有选中
|
|
250
|
+
checked = !!params.modelValue;
|
|
251
|
+
}
|
|
252
|
+
if (checked) {
|
|
253
|
+
exports.$checkboxStyle.color = exports.$checkbox.checkedTextColor;
|
|
254
|
+
exports.$checkboxInnerStyle.backgroundColor = exports.$checkbox.checkedBgColor;
|
|
255
|
+
exports.$checkboxInnerStyle.borderColor = exports.$checkbox.checkedInputBorderColor;
|
|
256
|
+
exports.$checkboxInnerAfterStyle.transform = 'rotate(45deg) scaleY(1)';
|
|
257
|
+
exports.$checkboxInnerAfterStyle.borderColor = exports.$checkbox.checkedIconColor;
|
|
258
|
+
exports.$checkboxLabelStyle.color = exports.$checkbox.checkedTextColor;
|
|
259
|
+
if (indeterminate) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
exports.$checkboxInnerBeforeStyle.display = 'none';
|
|
264
|
+
}
|
|
265
|
+
if (bordered) {
|
|
266
|
+
exports.$checkboxStyle.borderColor = var_1.$colorPrimary;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
// $checkboxStyle.border = $border;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
exports.$checkboxInnerAfterStyle.transform = 'rotate(45deg) scaleY(0)';
|
|
274
|
+
exports.$checkboxStyle.color = exports.$checkbox.textColor;
|
|
275
|
+
if (indeterminate) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
exports.$checkboxInnerBeforeStyle.display = 'none';
|
|
280
|
+
}
|
|
281
|
+
if (bordered) {
|
|
282
|
+
exports.$checkboxStyle.borderColor = var_1.$borderColor.lighter;
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
exports.$checkboxStyle.border = undefined;
|
|
286
|
+
}
|
|
287
|
+
exports.$checkboxInnerStyle.backgroundColor = exports.$checkbox.bgColor;
|
|
288
|
+
exports.$checkboxInnerStyle.borderColor = var_1.$borderColor.base;
|
|
289
|
+
// $checkboxInnerAfterStyle.borderColor = $checkbox.iconColor;
|
|
290
|
+
// $checkboxLabelStyle.color = $checkbox.textColor;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function useIndeterminate(params) {
|
|
294
|
+
const indeterminate = params.indeterminate || false;
|
|
295
|
+
if (indeterminate) {
|
|
296
|
+
exports.$checkboxInnerStyle.backgroundColor = exports.$checkbox.checkedBgColor;
|
|
297
|
+
exports.$checkboxInnerStyle.borderColor = exports.$checkbox.checkedInputBorderColor;
|
|
298
|
+
exports.$checkboxInnerBeforeStyle.display = 'block';
|
|
299
|
+
exports.$checkboxInnerAfterStyle.display = 'none';
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
exports.$checkboxInnerBeforeStyle.display = 'none';
|
|
303
|
+
exports.$checkboxInnerAfterStyle.display = 'block';
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypeLabel } from '@type-dom/framework';
|
|
2
|
+
import { ISize } from '../../../styles';
|
|
2
3
|
import { ITdCheckboxConfig } from '../td-checkbox/td-checkbox.interface';
|
|
3
4
|
import { ITdCheckboxButton } from './td-checkbox-button.interface';
|
|
4
|
-
export declare class TdCheckboxButton extends
|
|
5
|
+
export declare class TdCheckboxButton extends TypeLabel implements ITdCheckboxButton {
|
|
5
6
|
className: 'TdCheckboxButton';
|
|
6
7
|
props: ITdCheckboxConfig;
|
|
7
8
|
private isFocused?;
|
|
8
9
|
private isLimitExceeded?;
|
|
9
10
|
private actualValue?;
|
|
10
11
|
private intermediate?;
|
|
11
|
-
private hasOwnLabel?;
|
|
12
12
|
constructor(params?: ITdCheckboxConfig);
|
|
13
|
+
get checkedValue(): boolean | undefined;
|
|
13
14
|
handleChange(ev?: Event): void;
|
|
15
|
+
setChecked(checked?: number | string | boolean): void;
|
|
16
|
+
setDisabled(disabled: boolean): void;
|
|
17
|
+
setSize(size: ISize): void;
|
|
18
|
+
setFirstStyle(): void;
|
|
19
|
+
setLastStyle(): void;
|
|
14
20
|
}
|
|
@@ -2,19 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdCheckboxButton = void 0;
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const td_checkbox_style_1 = require("../td-checkbox/td-checkbox.style");
|
|
5
|
+
const styles_1 = require("../../../styles");
|
|
6
|
+
const td_button_style_1 = require("../../basic/td-button/td-button.style");
|
|
8
7
|
const td_checkbox_button_style_1 = require("./td-checkbox-button.style");
|
|
9
|
-
class TdCheckboxButton extends
|
|
8
|
+
class TdCheckboxButton extends framework_1.TypeLabel {
|
|
10
9
|
constructor(params = {}) {
|
|
11
|
-
super(
|
|
10
|
+
super(); // label | span
|
|
12
11
|
this.className = 'TdCheckboxButton';
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
// this.useTag('label');
|
|
13
|
+
(0, td_checkbox_button_style_1.useCheckboxButtonStyle)(params);
|
|
14
|
+
this.attr.addName('td-checkbox-button');
|
|
16
15
|
this.style.addObj(td_checkbox_button_style_1.$checkboxButtonStyle);
|
|
17
|
-
const { hasOwnLabel } = (0, use_checkbox_1.useCheckbox)(params);
|
|
18
16
|
const original = new framework_1.Input({
|
|
19
17
|
name: 'original',
|
|
20
18
|
attrObj: {
|
|
@@ -23,7 +21,7 @@ class TdCheckboxButton extends ui_abstract_1.UI {
|
|
|
23
21
|
value: this.actualValue,
|
|
24
22
|
intermediate: this.intermediate,
|
|
25
23
|
},
|
|
26
|
-
styleObj:
|
|
24
|
+
styleObj: td_checkbox_button_style_1.$checkboxButtonOriginalStyle,
|
|
27
25
|
events: {
|
|
28
26
|
click: (ev) => {
|
|
29
27
|
ev === null || ev === void 0 ? void 0 : ev.stopPropagation();
|
|
@@ -31,35 +29,125 @@ class TdCheckboxButton extends ui_abstract_1.UI {
|
|
|
31
29
|
change: (ev) => {
|
|
32
30
|
this.handleChange(ev);
|
|
33
31
|
},
|
|
34
|
-
focus: evt => {
|
|
32
|
+
focus: (evt) => {
|
|
35
33
|
this.isFocused = true;
|
|
36
34
|
},
|
|
37
|
-
blur: evt => {
|
|
35
|
+
blur: (evt) => {
|
|
38
36
|
this.isFocused = false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
37
|
+
},
|
|
38
|
+
},
|
|
41
39
|
});
|
|
42
40
|
this.addChild(original);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
labelSpan.addChild(new framework_1.TextNode(params === null || params === void 0 ? void 0 : params.label));
|
|
53
|
-
}
|
|
54
|
-
this.addChild(labelSpan);
|
|
41
|
+
const labelSpan = new framework_1.Span({
|
|
42
|
+
name: 'inner',
|
|
43
|
+
styleObj: td_checkbox_button_style_1.$checkboxButtonInnerStyle,
|
|
44
|
+
});
|
|
45
|
+
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
46
|
+
labelSpan.slotChild(params.slot);
|
|
47
|
+
}
|
|
48
|
+
else if (params === null || params === void 0 ? void 0 : params.label) {
|
|
49
|
+
labelSpan.addChild(new framework_1.TextNode(params === null || params === void 0 ? void 0 : params.label));
|
|
55
50
|
}
|
|
51
|
+
this.addChild(labelSpan);
|
|
52
|
+
this.addEvents({
|
|
53
|
+
click: (evt) => {
|
|
54
|
+
// todo
|
|
55
|
+
console.log('click . ');
|
|
56
|
+
if (this.props.disabled) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// const input = this.down<Input>('name', 'original')!;
|
|
60
|
+
// const checked = (input.dom.checked = !input.dom.checked);
|
|
61
|
+
const checked = !this.props.checked;
|
|
62
|
+
this.setChecked(checked);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
56
65
|
this.props = this.useParams(params);
|
|
57
66
|
}
|
|
67
|
+
get checkedValue() {
|
|
68
|
+
var _a;
|
|
69
|
+
return (_a = this.down('name', 'original')) === null || _a === void 0 ? void 0 : _a.dom.checked;
|
|
70
|
+
}
|
|
58
71
|
handleChange(ev) {
|
|
59
72
|
if (this.isLimitExceeded)
|
|
60
73
|
return;
|
|
61
74
|
const target = ev === null || ev === void 0 ? void 0 : ev.target;
|
|
62
75
|
// emit('change', getLabeledValue(target.checked), e)
|
|
63
76
|
}
|
|
77
|
+
setChecked(checked) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
// todo 待实现 选中、不选中
|
|
80
|
+
console.log('setChecked . checked is ', checked);
|
|
81
|
+
const inner = this.down('name', 'inner');
|
|
82
|
+
const input = this.down('name', 'original');
|
|
83
|
+
input.dom.checked = !!checked;
|
|
84
|
+
this.props.checked = !!checked;
|
|
85
|
+
if (checked) {
|
|
86
|
+
(_a = inner === null || inner === void 0 ? void 0 : inner.style) === null || _a === void 0 ? void 0 : _a.setObj({
|
|
87
|
+
color: td_checkbox_button_style_1.$checkboxButton.checkedTextColor,
|
|
88
|
+
backgroundColor: td_checkbox_button_style_1.$checkboxButton.checkedBgColor,
|
|
89
|
+
borderColor: td_checkbox_button_style_1.$checkboxButton.checkedBorderColor,
|
|
90
|
+
boxShadow: '-1px 0 0 0 ' + styles_1.$colors.primary['light-7'],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
(_b = inner === null || inner === void 0 ? void 0 : inner.style) === null || _b === void 0 ? void 0 : _b.setObj({
|
|
95
|
+
color: styles_1.$button.textColor,
|
|
96
|
+
backgroundColor: styles_1.$button.bgColor,
|
|
97
|
+
borderColor: styles_1.$button.borderColor,
|
|
98
|
+
boxShadow: undefined,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
if (this.props.disabled) {
|
|
102
|
+
this.setDisabled(true);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
setDisabled(disabled) {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
const label = this.down('name', 'label');
|
|
108
|
+
const inner = this.down('name', 'inner');
|
|
109
|
+
this.props.disabled = disabled;
|
|
110
|
+
if (disabled) {
|
|
111
|
+
(_a = inner === null || inner === void 0 ? void 0 : inner.style) === null || _a === void 0 ? void 0 : _a.setObj({
|
|
112
|
+
color: styles_1.$disabled.textColor,
|
|
113
|
+
cursor: 'not-allowed',
|
|
114
|
+
backgroundColor: styles_1.$button.disabled.bgColor,
|
|
115
|
+
borderColor: styles_1.$button.disabled.borderColor,
|
|
116
|
+
boxShadow: 'none',
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
(_b = inner === null || inner === void 0 ? void 0 : inner.style) === null || _b === void 0 ? void 0 : _b.setObj({
|
|
121
|
+
color: styles_1.$button.textColor,
|
|
122
|
+
cursor: 'pointer',
|
|
123
|
+
background: styles_1.$button.bgColor,
|
|
124
|
+
border: styles_1.$border,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
setSize(size) {
|
|
129
|
+
const paddingVertical = td_button_style_1.$buttonPaddingVertical[size];
|
|
130
|
+
const paddingHorizontal = td_button_style_1.$buttonPaddingHorizontal[size];
|
|
131
|
+
const sizeStyle = (0, td_button_style_1.buttonSize)(paddingVertical, paddingHorizontal, styles_1.$fontSizes[size], 0);
|
|
132
|
+
const inner = this.down('name', 'inner');
|
|
133
|
+
inner === null || inner === void 0 ? void 0 : inner.style.setObj(sizeStyle);
|
|
134
|
+
}
|
|
135
|
+
// 在CheckboxGroup中位于首位时
|
|
136
|
+
setFirstStyle() {
|
|
137
|
+
const inner = this.down('name', 'inner');
|
|
138
|
+
inner === null || inner === void 0 ? void 0 : inner.style.setObj({
|
|
139
|
+
borderLeft: styles_1.$border,
|
|
140
|
+
borderTopLeftRadius: styles_1.$borderRadius.base,
|
|
141
|
+
borderBottomLeftRadius: styles_1.$borderRadius.base,
|
|
142
|
+
boxShadow: 'none !important'
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
setLastStyle() {
|
|
146
|
+
const inner = this.down('name', 'inner');
|
|
147
|
+
inner === null || inner === void 0 ? void 0 : inner.style.setObj({
|
|
148
|
+
borderTopRightRadius: styles_1.$borderRadius.base,
|
|
149
|
+
borderBottomRightRadius: styles_1.$borderRadius.base
|
|
150
|
+
});
|
|
151
|
+
}
|
|
64
152
|
}
|
|
65
153
|
exports.TdCheckboxButton = TdCheckboxButton;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ITdCheckboxButton extends
|
|
1
|
+
import { ITypeLabel } from '@type-dom/framework';
|
|
2
|
+
export interface ITdCheckboxButton extends ITypeLabel {
|
|
3
3
|
className: 'TdCheckboxButton';
|
|
4
4
|
}
|
|
5
|
-
export interface ITdCheckboxButtonConfig extends IUIConfig {
|
|
6
|
-
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { IStyle } from '@type-dom/css-type';
|
|
2
|
+
import { ITdCheckboxConfig } from '../td-checkbox/td-checkbox.interface';
|
|
2
3
|
export declare const $checkboxButton: {
|
|
3
4
|
checkedBgColor: string;
|
|
4
5
|
checkedTextColor: string;
|
|
5
6
|
checkedBorderColor: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const $checkboxButtonStyle: IStyle;
|
|
9
|
+
export declare let $checkboxButtonInnerStyle: IStyle;
|
|
10
|
+
export declare const $checkboxButtonInnerHoverStyle: IStyle;
|
|
8
11
|
export declare const $checkboxButtonOriginalStyle: IStyle;
|
|
9
|
-
export declare
|
|
12
|
+
export declare function useCheckboxButtonStyle(params: ITdCheckboxConfig): void;
|
|
13
|
+
export declare function useCheckedStyle(params: ITdCheckboxConfig): void;
|
|
14
|
+
export declare function useDisabledStyle(params: ITdCheckboxConfig): void;
|
|
15
|
+
export declare function useFocusStyle(params: ITdCheckboxConfig): void;
|
|
16
|
+
export declare function useSize(params: ITdCheckboxConfig): void;
|