@type-dom/ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -45
- package/package.json +4 -3
- package/src/aria.d.ts +15 -0
- package/src/components/basic/td-button/td-button.abstract.d.ts +19 -0
- package/src/components/basic/td-button/td-button.abstract.js +175 -0
- package/src/components/basic/td-button/td-button.class.d.ts +3 -14
- package/src/components/basic/td-button/td-button.class.js +4 -172
- package/src/components/basic/td-button/td-button.const.d.ts +7 -0
- package/src/components/basic/td-button/td-button.const.js +4 -0
- package/src/components/basic/td-button/td-button.interface.d.ts +16 -6
- package/src/components/basic/td-button/td-button.interface.js +4 -0
- package/src/components/basic/td-button/td-button.style.d.ts +8 -3
- package/src/components/basic/td-button/td-button.style.js +28 -10
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +2 -2
- package/src/components/basic/td-button-group/td-button-group.class.js +28 -25
- package/src/components/basic/td-container/td-aside/td-aside.class.d.ts +3 -2
- package/src/components/basic/td-container/td-aside/td-aside.class.js +7 -16
- package/src/components/basic/td-container/td-container.class.d.ts +4 -3
- package/src/components/basic/td-container/td-container.class.js +9 -8
- package/src/components/basic/td-container/td-container.interface.d.ts +2 -2
- package/src/components/basic/td-container/td-container.js +3 -2
- package/src/components/basic/td-container/td-footer/td-footer.class.d.ts +2 -3
- package/src/components/basic/td-container/td-footer/td-footer.class.js +9 -11
- package/src/components/basic/td-container/td-header/td-header.class.d.ts +2 -2
- package/src/components/basic/td-container/td-header/td-header.class.js +10 -10
- package/src/components/basic/td-container/td-main/td-main.class.d.ts +2 -1
- package/src/components/basic/td-container/td-main/td-main.class.js +6 -4
- package/src/components/basic/td-icon/td-icon.class.d.ts +30 -6
- package/src/components/basic/td-icon/td-icon.class.js +111 -47
- package/src/components/basic/td-icon/td-icon.interface.d.ts +36 -6
- package/src/components/basic/td-icon/td-icon.style.d.ts +5 -14
- package/src/components/basic/td-icon/td-icon.style.js +5 -6
- package/src/components/basic/td-layout/td-col/td-col.class.d.ts +4 -4
- package/src/components/basic/td-layout/td-col/td-col.class.js +48 -45
- package/src/components/basic/td-layout/td-col/td-col.interface.d.ts +0 -4
- package/src/components/basic/td-layout/td-row/td-row.class.d.ts +4 -3
- package/src/components/basic/td-layout/td-row/td-row.class.js +31 -30
- package/src/components/basic/td-layout/td-row/td-row.interface.d.ts +0 -1
- package/src/components/basic/td-link/td-link.class.d.ts +5 -5
- package/src/components/basic/td-link/td-link.class.js +53 -55
- package/src/components/basic/td-link/td-link.interface.d.ts +14 -6
- package/src/components/basic/td-link/td-link.style.d.ts +14 -3
- package/src/components/basic/td-link/td-link.style.js +40 -10
- package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +2 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.js +8 -7
- package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +3 -3
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +18 -20
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +3 -2
- package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +2 -1
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +12 -12
- package/src/components/basic/td-space/td-space.class.d.ts +5 -5
- package/src/components/basic/td-space/td-space.class.js +32 -30
- package/src/components/basic/td-space/td-space.interface.d.ts +1 -0
- package/src/components/basic/td-text/td-text.class.d.ts +3 -3
- package/src/components/basic/td-text/td-text.class.js +22 -19
- package/src/components/basic/td-text/td-text.interface.d.ts +4 -2
- package/src/components/basic/td-text/td-text.style.d.ts +1 -1
- package/src/components/basic/td-text/td-text.style.js +13 -4
- package/src/components/data/index.d.ts +30 -0
- package/src/components/data/index.js +34 -0
- package/src/components/data/td-avatar/td-avatar.class.d.ts +12 -0
- package/src/components/data/td-avatar/td-avatar.class.js +120 -0
- package/src/components/data/td-avatar/td-avatar.interface.d.ts +41 -0
- package/src/components/data/td-avatar/td-avatar.style.d.ts +13 -0
- package/src/components/data/td-avatar/td-avatar.style.js +20 -0
- package/src/components/data/td-badge/td-badge.class.d.ts +9 -0
- package/src/components/data/td-badge/td-badge.class.js +104 -0
- package/src/components/data/td-badge/td-badge.interface.d.ts +52 -0
- package/src/components/data/td-badge/td-badge.style.d.ts +7 -0
- package/src/components/data/td-badge/td-badge.style.js +12 -0
- package/src/components/data/td-card/td-card.class.d.ts +14 -0
- package/src/components/data/td-card/td-card.class.js +102 -0
- package/src/components/data/td-card/td-card.interface.d.ts +26 -0
- package/src/components/data/td-card/td-card.interface.js +2 -0
- package/src/components/data/td-card/td-card.style.d.ts +9 -0
- package/src/components/data/td-card/td-card.style.js +29 -0
- package/src/components/data/td-carousel/td-carousel.class.d.ts +0 -0
- package/src/components/data/td-carousel/td-carousel.class.js +1 -0
- package/src/components/data/td-carousel/td-carousel.interface.d.ts +0 -0
- package/src/components/data/td-carousel/td-carousel.interface.js +1 -0
- package/src/components/data/td-check-tag/td-check-tag.class.d.ts +12 -0
- package/src/components/data/td-check-tag/td-check-tag.class.js +75 -0
- package/src/components/data/td-check-tag/td-check-tag.interface.d.ts +22 -0
- package/src/components/data/td-check-tag/td-check-tag.interface.js +3 -0
- package/src/components/data/td-check-tag/td-check-tag.style.d.ts +7 -0
- package/src/components/data/td-check-tag/td-check-tag.style.js +39 -0
- package/src/components/data/td-collapse/td-collapse.class.d.ts +13 -0
- package/src/components/data/td-collapse/td-collapse.class.js +85 -0
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +18 -0
- package/src/components/data/td-collapse/td-collapse.interface.js +2 -0
- package/src/components/data/td-collapse/td-collapse.style.d.ts +11 -0
- package/src/components/data/td-collapse/td-collapse.style.js +22 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.d.ts +25 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +222 -0
- package/src/components/data/td-collapse-item/td-collapse-item.interface.d.ts +20 -0
- package/src/components/data/td-collapse-item/td-collapse-item.interface.js +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.class.d.ts +6 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.class.js +12 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.interface.d.ts +4 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.interface.js +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.util.d.ts +2 -0
- package/src/components/data/td-collapse-transition/td-collapse-transition.util.js +147 -0
- package/src/components/data/td-count-down/td-count-down.class.d.ts +13 -0
- package/src/components/data/td-count-down/td-count-down.class.js +57 -0
- package/src/components/data/td-count-down/td-count-down.function.d.ts +0 -0
- package/src/components/data/td-count-down/td-count-down.function.js +1 -0
- package/src/components/data/td-count-down/td-count-down.interface.d.ts +11 -0
- package/src/components/data/td-count-down/td-count-down.interface.js +2 -0
- package/src/components/data/td-count-down/utils.d.ts +3 -0
- package/src/components/data/td-count-down/utils.js +32 -0
- package/src/components/data/td-descriptions/td-descriptions-row.d.ts +21 -0
- package/src/components/data/td-descriptions/td-descriptions-row.js +80 -0
- package/src/components/data/td-descriptions/td-descriptions.class.d.ts +18 -0
- package/src/components/data/td-descriptions/td-descriptions.class.js +156 -0
- package/src/components/data/td-descriptions/td-descriptions.interface.d.ts +43 -0
- package/src/components/data/td-descriptions/td-descriptions.interface.js +2 -0
- package/src/components/data/td-descriptions/td-descriptions.style.d.ts +51 -0
- package/src/components/data/td-descriptions/td-descriptions.style.js +142 -0
- package/src/components/data/td-descriptions/td-descritions-cell.d.ts +15 -0
- package/src/components/data/td-descriptions/td-descritions-cell.js +110 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.d.ts +10 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +20 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.interface.d.ts +51 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.interface.js +2 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.style.d.ts +10 -0
- package/src/components/data/td-descriptions-item/td-descriptions-item.style.js +13 -0
- package/src/components/data/td-empty/img-empty.class.d.ts +5 -0
- package/src/components/data/td-empty/img-empty.class.js +204 -0
- package/src/components/data/td-empty/td-empty.class.d.ts +13 -0
- package/src/components/data/td-empty/td-empty.class.js +77 -0
- package/src/components/data/td-empty/td-empty.interface.d.ts +25 -0
- package/src/components/data/td-empty/td-empty.interface.js +2 -0
- package/src/components/data/td-empty/td-empty.style.d.ts +24 -0
- package/src/components/data/td-empty/td-empty.style.js +65 -0
- package/src/components/data/td-image/td-image.class.d.ts +16 -0
- package/src/components/data/td-image/td-image.class.js +95 -0
- package/src/components/data/td-image/td-image.interface.d.ts +78 -0
- package/src/components/data/td-image/td-image.interface.js +2 -0
- package/src/components/data/td-image/td-image.style.d.ts +11 -0
- package/src/components/data/td-image/td-image.style.js +18 -0
- package/src/components/data/td-image/util.d.ts +1 -0
- package/src/components/data/td-image/util.js +18 -0
- package/src/components/data/td-image-viewer/td-image-viewer.class.d.ts +20 -0
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +261 -0
- package/src/components/data/td-image-viewer/td-image-viewer.interface.d.ts +63 -0
- package/src/components/data/td-image-viewer/td-image-viewer.interface.js +2 -0
- package/src/components/data/td-image-viewer/td-image-viewer.style.d.ts +9 -0
- package/src/components/data/td-image-viewer/td-image-viewer.style.js +67 -0
- package/src/components/data/td-pagination/td-pagination.class.d.ts +0 -0
- package/src/components/data/td-pagination/td-pagination.class.js +1 -0
- package/src/components/data/td-pagination/td-pagination.interface.d.ts +0 -0
- package/src/components/data/td-pagination/td-pagination.interface.js +1 -0
- package/src/components/data/td-progress/td-progress.class.d.ts +0 -0
- package/src/components/data/td-progress/td-progress.class.js +1 -0
- package/src/components/data/td-progress/td-progress.interface.d.ts +0 -0
- package/src/components/data/td-progress/td-progress.interface.js +1 -0
- package/src/components/data/td-result/td-result.class.d.ts +8 -0
- package/src/components/data/td-result/td-result.class.js +87 -0
- package/src/components/data/td-result/td-result.constant.d.ts +8 -0
- package/src/components/data/td-result/td-result.constant.js +41 -0
- package/src/components/data/td-result/td-result.interface.d.ts +28 -0
- package/src/components/data/td-result/td-result.interface.js +2 -0
- package/src/components/data/td-result/td-result.style.d.ts +16 -0
- package/src/components/data/td-result/td-result.style.js +46 -0
- package/src/components/data/td-segmented/td-segmented.class.d.ts +22 -0
- package/src/components/data/td-segmented/td-segmented.class.js +172 -0
- package/src/components/data/td-segmented/td-segmented.interface.d.ts +51 -0
- package/src/components/data/td-segmented/td-segmented.interface.js +2 -0
- package/src/components/data/td-segmented/td-segmented.style.d.ts +37 -0
- package/src/components/data/td-segmented/td-segmented.style.js +142 -0
- package/src/components/data/td-statistic/td-statistic.abstract.d.ts +15 -0
- package/src/components/data/td-statistic/td-statistic.abstract.js +113 -0
- package/src/components/data/td-statistic/td-statistic.class.d.ts +6 -0
- package/src/components/data/td-statistic/td-statistic.class.js +11 -0
- package/src/components/data/td-statistic/td-statistic.interface.d.ts +58 -0
- package/src/components/data/td-statistic/td-statistic.interface.js +2 -0
- package/src/components/data/td-statistic/td-statistic.style.d.ts +9 -0
- package/src/components/data/td-statistic/td-statistic.style.js +16 -0
- package/src/components/data/td-table/td-table.class.d.ts +0 -0
- package/src/components/data/td-table/td-table.class.js +1 -0
- package/src/components/data/td-table/td-table.interface.d.ts +0 -0
- package/src/components/data/td-table/td-table.interface.js +1 -0
- package/src/components/data/td-tag/td-tag.class.d.ts +12 -0
- package/src/components/data/td-tag/td-tag.class.js +144 -0
- package/src/components/data/td-tag/td-tag.interface.d.ts +42 -0
- package/src/components/data/td-tag/td-tag.interface.js +2 -0
- package/src/components/data/td-tag/td-tag.style.d.ts +45 -0
- package/src/components/data/td-tag/td-tag.style.js +80 -0
- package/src/components/data/td-timeline/td-timeline.class.d.ts +0 -0
- package/src/components/data/td-timeline/td-timeline.class.js +1 -0
- package/src/components/data/td-timeline/td-timeline.interface.d.ts +0 -0
- package/src/components/data/td-timeline/td-timeline.interface.js +1 -0
- package/src/components/data/td-tree/td-tree.class.d.ts +0 -0
- package/src/components/data/td-tree/td-tree.class.js +1 -0
- package/src/components/data/td-tree/td-tree.interface.d.ts +0 -0
- package/src/components/data/td-tree/td-tree.interface.js +1 -0
- package/src/components/feedback/dialog/dialog.class.d.ts +2 -1
- package/src/components/feedback/dialog/dialog.class.js +5 -5
- package/src/components/feedback/dialog/dialog.interface.d.ts +2 -3
- package/src/components/feedback/index.d.ts +11 -0
- package/src/components/feedback/index.js +15 -1
- package/src/components/feedback/message-box/message-box.d.ts +2 -1
- package/src/components/feedback/message-box/message-box.interface.d.ts +2 -2
- package/src/components/feedback/message-box/message-box.js +6 -6
- package/src/components/feedback/overlay/container/body/body.js +3 -5
- package/src/components/feedback/overlay/container/container.js +4 -6
- package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.js +3 -3
- package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.js +4 -6
- package/src/components/feedback/overlay/container/footer/footer.d.ts +1 -2
- package/src/components/feedback/overlay/container/footer/footer.js +24 -26
- package/src/components/feedback/overlay/container/header/close-button/close-button.js +6 -8
- package/src/components/feedback/overlay/container/header/header.js +2 -2
- package/src/components/feedback/overlay/container/header/title/title.js +3 -5
- package/src/components/feedback/overlay/overlay.abstract.js +6 -8
- package/src/components/feedback/td-alert/td-alert.class.d.ts +15 -0
- package/src/components/feedback/td-alert/td-alert.class.js +111 -0
- package/src/components/feedback/td-alert/td-alert.interface.d.ts +41 -0
- package/src/components/feedback/td-alert/td-alert.interface.js +2 -0
- package/src/components/feedback/td-alert/td-alert.style.d.ts +21 -0
- package/src/components/feedback/td-alert/td-alert.style.js +102 -0
- package/src/components/feedback/td-dialog/td-dialog.class.d.ts +12 -0
- package/src/components/feedback/td-dialog/td-dialog.class.js +70 -0
- package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +79 -0
- package/src/components/feedback/td-dialog/td-dialog.interface.js +2 -0
- package/src/components/feedback/td-dialog/td-dialog.style.d.ts +20 -0
- package/src/components/feedback/td-dialog/td-dialog.style.js +89 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.d.ts +12 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +79 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.d.ts +51 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.js +2 -0
- package/src/components/feedback/td-drawer/td-drawer.class.d.ts +8 -0
- package/src/components/feedback/td-drawer/td-drawer.class.js +39 -0
- package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +12 -0
- package/src/components/feedback/td-drawer/td-drawer.interface.js +2 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +4 -3
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +11 -11
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +9 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.js +1 -0
- package/src/components/feedback/td-focus-trap/tokens.d.ts +5 -0
- package/src/components/feedback/td-focus-trap/tokens.js +4 -10
- package/src/components/feedback/td-focus-trap/utils.d.ts +2 -2
- package/src/components/feedback/td-focus-trap/utils.js +3 -3
- package/src/components/feedback/td-loading/td-loading.class.d.ts +12 -0
- package/src/components/feedback/td-loading/td-loading.class.js +65 -0
- package/src/components/feedback/td-loading/td-loading.interface.d.ts +37 -0
- package/src/components/feedback/td-loading/td-loading.interface.js +2 -0
- package/src/components/feedback/td-message/td-message.class.d.ts +24 -0
- package/src/components/feedback/td-message/td-message.class.js +239 -0
- package/src/components/feedback/td-message/td-message.interface.d.ts +105 -0
- package/src/components/feedback/td-message/td-message.interface.js +22 -0
- package/src/components/feedback/td-message/td-message.style.d.ts +17 -0
- package/src/components/feedback/td-message/td-message.style.js +104 -0
- package/src/components/feedback/td-message-box/td-message-box.class.d.ts +42 -0
- package/src/components/feedback/td-message-box/td-message-box.class.js +531 -0
- package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +142 -0
- package/src/components/feedback/td-message-box/td-message-box.interface.js +2 -0
- package/src/components/feedback/td-message-box/td-message-box.style.d.ts +36 -0
- package/src/components/feedback/td-message-box/td-message-box.style.js +182 -0
- package/src/components/feedback/td-notification/td-notification.class.d.ts +30 -0
- package/src/components/feedback/td-notification/td-notification.class.js +234 -0
- package/src/components/feedback/td-notification/td-notification.interface.d.ts +76 -0
- package/src/components/feedback/td-notification/td-notification.interface.js +2 -0
- package/src/components/feedback/td-notification/td-notification.style.d.ts +28 -0
- package/src/components/feedback/td-notification/td-notification.style.js +138 -0
- package/src/components/feedback/td-overlay/td-overlay.class.d.ts +10 -0
- package/src/components/feedback/td-overlay/td-overlay.class.js +35 -0
- package/src/components/feedback/td-overlay/td-overlay.interface.d.ts +13 -0
- package/src/components/feedback/td-overlay/td-overlay.interface.js +2 -0
- package/src/components/feedback/td-overlay/td-overlay.style.d.ts +2 -0
- package/src/components/feedback/td-overlay/td-overlay.style.js +16 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.d.ts +0 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.js +1 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.d.ts +0 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.js +1 -0
- package/src/components/feedback/td-popover/td-popover.class.d.ts +0 -0
- package/src/components/feedback/td-popover/td-popover.class.js +1 -0
- package/src/components/feedback/td-popover/td-popover.interface.d.ts +0 -0
- package/src/components/feedback/td-popover/td-popover.interface.js +1 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +2 -1
- package/src/components/feedback/td-popper/arrow/arrow.class.js +6 -6
- package/src/components/feedback/td-popper/content/content.class.d.ts +2 -1
- package/src/components/feedback/td-popper/content/content.class.js +7 -7
- package/src/components/feedback/td-popper/td-popper.class.d.ts +3 -2
- package/src/components/feedback/td-popper/td-popper.class.js +3 -3
- package/src/components/feedback/td-popper/td-popper.interface.d.ts +2 -3
- package/src/components/feedback/td-popper/td-popper.interface.js +0 -11
- package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +2 -1
- package/src/components/feedback/td-popper/trigger/trigger.class.js +3 -2
- package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +10 -0
- package/src/components/feedback/td-tooltip/content/content.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/content/content.class.js +3 -3
- package/src/components/feedback/td-tooltip/td-tooltip.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +7 -13
- package/src/components/feedback/td-tooltip/trigger/trigger.class.d.ts +2 -1
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +3 -3
- package/src/components/feedback/td-tooltip/utils.d.ts +4 -0
- package/src/components/feedback/td-tooltip/utils.js +23 -0
- package/src/components/form/checkbox-group/checkbox-group.class.js +9 -8
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +3 -3
- package/src/components/form/field-item/cascade/field-cascade.abstract.js +25 -17
- package/src/components/form/field-item/field-item.abstract.d.ts +7 -3
- package/src/components/form/field-item/field-item.abstract.js +14 -9
- package/src/components/form/field-item/field-item.style.d.ts +1 -1
- package/src/components/form/field-item/field-item.style.js +1 -2
- package/src/components/form/field-item/input/field-input.abstract.d.ts +1 -2
- package/src/components/form/field-item/input/field-input.abstract.js +6 -6
- package/src/components/form/field-item/options/field-options.abstract.js +31 -27
- package/src/components/form/field-item/radio/field-radio.abstract.d.ts +2 -2
- package/src/components/form/field-item/radio/field-radio.abstract.js +30 -21
- package/src/components/form/field-item/select/field-select.abstract.d.ts +1 -2
- package/src/components/form/field-item/select/field-select.abstract.js +3 -3
- package/src/components/form/field-item/span/field-span.abstract.js +4 -4
- package/src/components/form/field-item/textarea/field-textarea.abstract.d.ts +1 -2
- package/src/components/form/field-item/textarea/field-textarea.abstract.js +6 -6
- package/src/components/form/field-select/field-select.class.js +10 -9
- package/src/components/form/field-select/option/option.class.js +1 -1
- package/src/components/form/index.d.ts +10 -0
- package/src/components/form/index.js +11 -1
- package/src/components/form/radio-group/radio-group.class.d.ts +3 -2
- package/src/components/form/radio-group/radio-group.class.js +13 -12
- package/src/components/form/radio-group/radio-option/radio-option.class.d.ts +3 -2
- package/src/components/form/radio-group/radio-option/radio-option.class.js +8 -9
- package/src/components/form/select/select.class.js +4 -4
- package/src/components/form/td-autocomplete/td-autocomplete.class.d.ts +0 -0
- package/src/components/form/td-autocomplete/td-autocomplete.class.js +1 -0
- package/src/components/form/td-autocomplete/td-autocomplete.interface.d.ts +0 -0
- package/src/components/form/td-autocomplete/td-autocomplete.interface.js +1 -0
- package/src/components/form/td-cascader/td-cascader.class.d.ts +0 -0
- package/src/components/form/td-cascader/td-cascader.class.js +1 -0
- package/src/components/form/td-cascader/td-cascader.interface.d.ts +0 -0
- package/src/components/form/td-cascader/td-cascader.interface.js +1 -0
- package/src/components/form/td-checkbox/composables/use-checkbox-status.d.ts +6 -0
- package/src/components/form/td-checkbox/composables/use-checkbox-status.js +52 -0
- package/src/components/form/td-checkbox/composables/use-checkbox.d.ts +6 -0
- package/src/components/form/td-checkbox/composables/use-checkbox.js +85 -0
- package/src/components/form/td-checkbox/td-checkbox.class.d.ts +8 -2
- package/src/components/form/td-checkbox/td-checkbox.class.js +54 -75
- package/src/components/form/td-checkbox/td-checkbox.interface.d.ts +2 -1
- package/src/components/form/td-checkbox/td-checkbox.style.d.ts +46 -0
- package/src/components/form/td-checkbox/td-checkbox.style.js +144 -10
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.d.ts +9 -2
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +56 -6
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.d.ts +9 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.style.js +55 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.d.ts +2 -2
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +10 -10
- package/src/components/form/td-checkbox-group/td-checkbox-group.interface.d.ts +1 -1
- package/src/components/form/td-color-picker/td-color-picker.class.d.ts +0 -0
- package/src/components/form/td-color-picker/td-color-picker.class.js +1 -0
- package/src/components/form/td-color-picker/td-color-picker.interface.d.ts +0 -0
- package/src/components/form/td-color-picker/td-color-picker.interface.js +1 -0
- package/src/components/form/td-date-picker/td-date-picker.class.d.ts +0 -0
- package/src/components/form/td-date-picker/td-date-picker.class.js +1 -0
- package/src/components/form/td-date-picker/td-date-picker.interface.d.ts +0 -0
- package/src/components/form/td-date-picker/td-date-picker.interface.js +1 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.class.d.ts +0 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.class.js +1 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.interface.d.ts +0 -0
- package/src/components/form/td-date-time-picker/td-date-time-picker.interface.js +1 -0
- package/src/components/form/td-form/hooks/use-form-item.d.ts +5 -0
- package/src/components/form/td-form/hooks/use-form-item.js +65 -0
- package/src/components/form/td-form/td-form.class.d.ts +3 -8
- package/src/components/form/td-form/td-form.class.js +10 -34
- package/src/components/form/td-form/td-form.const.d.ts +5 -0
- package/src/components/form/td-form/td-form.const.js +5 -0
- package/src/components/form/td-form/td-form.interface.js +33 -0
- package/src/components/form/td-form-item/td-form-item.class.d.ts +7 -4
- package/src/components/form/td-form-item/td-form-item.class.js +83 -60
- package/src/components/form/td-form-item/td-form-item.interface.d.ts +1 -3
- package/src/components/form/td-form-item/td-form-item.style.js +15 -15
- package/src/components/form/td-input/td-input-field.class.d.ts +1 -1
- package/src/components/form/td-input/td-input-field.class.js +13 -13
- package/src/components/form/td-input/td-input-field.interface.d.ts +2 -2
- package/src/components/form/td-input/td-input.class.d.ts +4 -3
- package/src/components/form/td-input/td-input.class.js +83 -49
- package/src/components/form/td-input/td-input.interface.d.ts +13 -0
- package/src/components/form/td-input/widget/prefix.js +2 -2
- package/src/components/form/td-input/widget/suffix.d.ts +1 -1
- package/src/components/form/td-input/widget/suffix.js +10 -10
- package/src/components/form/td-input/widget/td-input-wrapper.class.d.ts +3 -3
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +64 -67
- package/src/components/form/td-input/widget/td-textarea-wrapper.d.ts +2 -2
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +8 -9
- package/src/components/form/td-input/widget/utils.js +9 -10
- package/src/components/form/td-input-number/td-input-number.class.d.ts +0 -0
- package/src/components/form/td-input-number/td-input-number.class.js +1 -0
- package/src/components/form/td-input-number/td-input-number.interface.d.ts +0 -0
- package/src/components/form/td-input-number/td-input-number.interface.js +1 -0
- package/src/components/form/td-option/td-option.class.d.ts +7 -0
- package/src/components/form/{td-select/option/option.class.js → td-option/td-option.class.js} +9 -10
- package/src/components/form/{td-select/option/option.interface.d.ts → td-option/td-option.interface.d.ts} +1 -1
- package/src/components/form/td-option/td-option.interface.js +2 -0
- package/src/components/form/td-option-group/td-option-group.class.d.ts +7 -0
- package/src/components/form/{td-select/option-group/option-group.class.js → td-option-group/td-option-group.class.js} +11 -11
- package/src/components/form/{td-select/option-group/option-group.interface.d.ts → td-option-group/td-option-group.interface.d.ts} +1 -1
- package/src/components/form/td-option-group/td-option-group.interface.js +2 -0
- package/src/components/form/td-radio/td-radio.class.d.ts +3 -3
- package/src/components/form/td-radio/td-radio.class.js +58 -55
- package/src/components/form/td-radio-button/td-radio-button.class.d.ts +3 -3
- package/src/components/form/td-radio-button/td-radio-button.class.js +47 -45
- package/src/components/form/td-radio-group/td-radio-group.class.d.ts +3 -3
- package/src/components/form/td-radio-group/td-radio-group.class.js +21 -19
- package/src/components/form/td-rate/td-rate.class.d.ts +0 -0
- package/src/components/form/td-rate/td-rate.class.js +1 -0
- package/src/components/form/td-rate/td-rate.interface.d.ts +0 -0
- package/src/components/form/td-rate/td-rate.interface.js +1 -0
- package/src/components/form/td-select/dropdown/dropdown.class.d.ts +3 -2
- package/src/components/form/td-select/dropdown/dropdown.class.js +15 -15
- package/src/components/form/td-select/td-select.class.d.ts +3 -1
- package/src/components/form/td-select/td-select.class.js +6 -6
- package/src/components/form/td-select/td-select.style.js +8 -8
- package/src/components/form/td-slider/td-slider.class.d.ts +0 -0
- package/src/components/form/td-slider/td-slider.class.js +1 -0
- package/src/components/form/td-slider/td-slider.interface.d.ts +0 -0
- package/src/components/form/td-slider/td-slider.interface.js +1 -0
- package/src/components/form/td-switch/td-switch.class.d.ts +8 -4
- package/src/components/form/td-switch/td-switch.class.js +92 -63
- package/src/components/form/td-switch/td-switch.interface.d.ts +7 -1
- package/src/components/form/td-switch/td-switch.interface.js +1 -0
- package/src/components/form/td-switch/td-switch.style.d.ts +1 -2
- package/src/components/form/td-switch/td-switch.style.js +1 -2
- package/src/components/form/td-switch/widget/td-switch-core.d.ts +2 -2
- package/src/components/form/td-switch/widget/td-switch-core.js +73 -71
- package/src/components/form/td-switch/widget/td-switch-left.d.ts +2 -2
- package/src/components/form/td-switch/widget/td-switch-left.js +8 -8
- package/src/components/form/td-switch/widget/td-switch-right.d.ts +3 -3
- package/src/components/form/td-switch/widget/td-switch-right.js +9 -9
- package/src/components/form/td-time-picker/td-time-picker.class.d.ts +0 -0
- package/src/components/form/td-time-picker/td-time-picker.class.js +1 -0
- package/src/components/form/td-time-picker/td-time-picker.interface.d.ts +0 -0
- package/src/components/form/td-time-picker/td-time-picker.interface.js +1 -0
- package/src/components/form/td-time-select/td-time-select.class.d.ts +0 -0
- package/src/components/form/td-time-select/td-time-select.class.js +1 -0
- package/src/components/form/td-time-select/td-time-select.interface.d.ts +0 -0
- package/src/components/form/td-time-select/td-time-select.interface.js +1 -0
- package/src/components/form/td-transfer/td-transfer.class.d.ts +0 -0
- package/src/components/form/td-transfer/td-transfer.class.js +1 -0
- package/src/components/form/td-transfer/td-transfer.interface.d.ts +0 -0
- package/src/components/form/td-transfer/td-transfer.interface.js +1 -0
- package/src/components/form/td-upload/td-upload.class.d.ts +0 -0
- package/src/components/form/td-upload/td-upload.class.js +1 -0
- package/src/components/form/td-upload/td-upload.interface.d.ts +0 -0
- package/src/components/form/td-upload/td-upload.interface.js +1 -0
- package/src/components/navigation/index.d.ts +16 -0
- package/src/components/navigation/index.js +17 -1
- package/src/components/navigation/td-affix/td-affix.class.d.ts +25 -0
- package/src/components/navigation/td-affix/td-affix.class.js +134 -0
- package/src/components/navigation/td-affix/td-affix.interface.d.ts +27 -0
- package/src/components/navigation/td-affix/td-affix.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.d.ts +8 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +30 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.d.ts +16 -0
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor.class.d.ts +10 -0
- package/src/components/navigation/td-anchor/td-anchor.class.js +118 -0
- package/src/components/navigation/td-anchor/td-anchor.function.d.ts +2 -0
- package/src/components/navigation/td-anchor/td-anchor.function.js +91 -0
- package/src/components/navigation/td-anchor/td-anchor.interface.d.ts +44 -0
- package/src/components/navigation/td-anchor/td-anchor.interface.js +2 -0
- package/src/components/navigation/td-anchor/td-anchor.style.d.ts +14 -0
- package/src/components/navigation/td-anchor/td-anchor.style.js +17 -0
- package/src/components/navigation/td-backtop/td-backtop.class.d.ts +17 -0
- package/src/components/navigation/td-backtop/td-backtop.class.js +145 -0
- package/src/components/navigation/td-backtop/td-backtop.interface.d.ts +26 -0
- package/src/components/navigation/td-backtop/td-backtop.interface.js +2 -0
- package/src/components/navigation/td-backtop/td-backtop.style.d.ts +5 -0
- package/src/components/navigation/td-backtop/td-backtop.style.js +13 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.d.ts +11 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +37 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.d.ts +16 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.js +2 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.d.ts +8 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +71 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.d.ts +18 -0
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.js +2 -0
- package/src/components/navigation/td-dropdown/td-dropdown.class.d.ts +0 -0
- package/src/components/navigation/td-dropdown/td-dropdown.class.js +1 -0
- package/src/components/navigation/td-dropdown/td-dropdown.interface.d.ts +0 -0
- package/src/components/navigation/td-dropdown/td-dropdown.interface.js +1 -0
- package/src/components/navigation/td-menu/td-menu.class.d.ts +3 -2
- package/src/components/navigation/td-menu/td-menu.class.js +11 -10
- package/src/components/navigation/td-page-header/td-page-header.class.d.ts +0 -0
- package/src/components/navigation/td-page-header/td-page-header.class.js +1 -0
- package/src/components/navigation/td-page-header/td-page-header.interface.d.ts +0 -0
- package/src/components/navigation/td-page-header/td-page-header.interface.js +1 -0
- package/src/components/navigation/td-steps/td-steps.class.d.ts +0 -0
- package/src/components/navigation/td-steps/td-steps.class.js +1 -0
- package/src/components/navigation/td-steps/td-steps.interface.d.ts +0 -0
- package/src/components/navigation/td-steps/td-steps.interface.js +1 -0
- package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +12 -0
- package/src/components/navigation/td-tabs/td-tab-bar.class.js +62 -0
- package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +10 -0
- package/src/components/navigation/td-tabs/td-tab-bar.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +31 -0
- package/src/components/navigation/td-tabs/td-tab-nav.class.js +355 -0
- package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +23 -0
- package/src/components/navigation/td-tabs/td-tab-nav.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tab-pane.class.d.ts +13 -0
- package/src/components/navigation/td-tabs/td-tab-pane.class.js +41 -0
- package/src/components/navigation/td-tabs/td-tab-pane.interface.d.ts +31 -0
- package/src/components/navigation/td-tabs/td-tab-pane.interface.js +2 -0
- package/src/components/navigation/td-tabs/td-tabs.class.d.ts +18 -0
- package/src/components/navigation/td-tabs/td-tabs.class.js +159 -0
- package/src/components/navigation/td-tabs/td-tabs.interface.d.ts +74 -0
- package/src/components/navigation/td-tabs/td-tabs.interface.js +5 -0
- package/src/components/navigation/td-tabs/td-tabs.style.d.ts +19 -0
- package/src/components/navigation/td-tabs/td-tabs.style.js +128 -0
- package/src/components/others/collapsible-box/collapsible-box.d.ts +2 -3
- package/src/components/others/collapsible-box/collapsible-box.js +5 -7
- package/src/components/others/collapsible-box/contents/contents.d.ts +2 -2
- package/src/components/others/collapsible-box/contents/contents.js +6 -8
- package/src/components/others/collapsible-box/heading/expand-heading.d.ts +2 -3
- package/src/components/others/collapsible-box/heading/expand-heading.js +13 -15
- package/src/components/others/td-divider/td-divider.class.d.ts +2 -2
- package/src/components/others/td-divider/td-divider.class.js +16 -15
- package/src/components/others/td-watermark/td-watermark.class.d.ts +0 -0
- package/src/components/others/td-watermark/td-watermark.class.js +1 -0
- package/src/components/others/td-watermark/td-watermark.interface.d.ts +0 -0
- package/src/components/others/td-watermark/td-watermark.interface.js +1 -0
- package/src/constants/event.d.ts +3 -0
- package/src/constants/event.js +6 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/styles/color-scheme.js +19 -19
- package/src/styles/function.js +13 -14
- package/src/styles/index.d.ts +1 -0
- package/src/styles/size.d.ts +0 -5
- package/src/styles/size.js +3 -3
- package/src/styles/transition.d.ts +32 -0
- package/src/styles/transition.js +222 -0
- package/src/styles/var.d.ts +10 -1
- package/src/styles/var.js +17 -3
- package/src/ui/ui.abstract.d.ts +16 -6
- package/src/ui/ui.abstract.js +39 -11
- package/src/ui/ui.interface.d.ts +7 -3
- package/src/utils/types.d.ts +8 -0
- package/src/utils/types.js +35 -0
- package/src/components/basic/td-layout/td-row/td-row.style.d.ts +0 -1
- package/src/components/basic/td-layout/td-row/td-row.style.js +0 -8
- package/src/components/form/td-select/option/option.class.d.ts +0 -6
- package/src/components/form/td-select/option-group/option-group.class.d.ts +0 -6
- /package/src/components/{form/td-select/option-group/option-group.interface.js → data/td-avatar/td-avatar.interface.js} +0 -0
- /package/src/components/{form/td-select/option/option.interface.js → data/td-badge/td-badge.interface.js} +0 -0
|
@@ -9,12 +9,15 @@ const td_input_wrapper_class_1 = require("./widget/td-input-wrapper.class");
|
|
|
9
9
|
const td_input_style_1 = require("./td-input.style");
|
|
10
10
|
const td_textarea_wrapper_1 = require("./widget/td-textarea-wrapper");
|
|
11
11
|
class TdInput extends ui_abstract_1.UI {
|
|
12
|
-
constructor(
|
|
13
|
-
super();
|
|
12
|
+
constructor(params) {
|
|
13
|
+
super(params);
|
|
14
14
|
console.log('TdInput constructor . ');
|
|
15
15
|
this.className = 'TdInput';
|
|
16
|
-
this.addAttrName('td-input');
|
|
17
|
-
this.
|
|
16
|
+
this.ctrl.addAttrName('td-input');
|
|
17
|
+
this.ctrl.addAttrObj({
|
|
18
|
+
tabIndex: 0
|
|
19
|
+
});
|
|
20
|
+
this.ctrl.addStyleObj({
|
|
18
21
|
position: 'relative',
|
|
19
22
|
display: 'inline-flex',
|
|
20
23
|
width: '100%',
|
|
@@ -23,47 +26,49 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
23
26
|
// fontSize: var(--el-font-size-base),
|
|
24
27
|
fontSize: var_1.$fontSizes.base,
|
|
25
28
|
// lineHeight: var(--el-input-height),
|
|
26
|
-
lineHeight: td_input_style_1.$inputHeight[(
|
|
27
|
-
userSelect: 'none'
|
|
29
|
+
lineHeight: td_input_style_1.$inputHeight[(params === null || params === void 0 ? void 0 : params.size) || 'default'],
|
|
30
|
+
userSelect: 'none'
|
|
28
31
|
});
|
|
29
|
-
console.log('
|
|
30
|
-
if (
|
|
31
|
-
this.modelValue =
|
|
32
|
+
console.log('params.modelValue is ', params === null || params === void 0 ? void 0 : params.modelValue);
|
|
33
|
+
if (params === null || params === void 0 ? void 0 : params.modelValue) {
|
|
34
|
+
this.modelValue = params.modelValue;
|
|
32
35
|
}
|
|
33
|
-
this.
|
|
36
|
+
this.props = this.setParams(params);
|
|
37
|
+
}
|
|
38
|
+
get value() {
|
|
39
|
+
return this.panel.inner.value;
|
|
34
40
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
this.addWidth(
|
|
41
|
+
setup() {
|
|
42
|
+
const props = this.props;
|
|
43
|
+
if (props === null || props === void 0 ? void 0 : props.width) {
|
|
44
|
+
this.ctrl.addWidth(props.width);
|
|
39
45
|
}
|
|
40
46
|
// todo
|
|
41
|
-
if ((
|
|
42
|
-
|
|
43
|
-
this.panel = new td_textarea_wrapper_1.TdTextareaWrapper(
|
|
44
|
-
// this.textareaWrapper = new TdTextareaWrapper(
|
|
47
|
+
if ((props === null || props === void 0 ? void 0 : props.type) === 'textarea') {
|
|
48
|
+
props.parent = this;
|
|
49
|
+
this.panel = new td_textarea_wrapper_1.TdTextareaWrapper(props);
|
|
50
|
+
// this.textareaWrapper = new TdTextareaWrapper(props);
|
|
45
51
|
}
|
|
46
52
|
else {
|
|
47
|
-
this.panel = new td_input_wrapper_class_1.TdInputWrapper(
|
|
53
|
+
this.panel = new td_input_wrapper_class_1.TdInputWrapper(props);
|
|
48
54
|
}
|
|
49
|
-
if (
|
|
50
|
-
this.placeholder =
|
|
55
|
+
if (props === null || props === void 0 ? void 0 : props.placeholder) {
|
|
56
|
+
this.placeholder = props.placeholder;
|
|
51
57
|
}
|
|
52
58
|
this.panel.setParent(this);
|
|
53
59
|
this.addChild(this.panel);
|
|
54
|
-
if (!(
|
|
60
|
+
if (!(props === null || props === void 0 ? void 0 : props.formatter) && (props === null || props === void 0 ? void 0 : props.parser)) {
|
|
55
61
|
throw new Error('If you set the parser, you also need to set the formatter');
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
initEvents() {
|
|
59
|
-
|
|
60
|
-
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
65
|
+
if (this.props.disabled) {
|
|
61
66
|
return;
|
|
62
67
|
}
|
|
63
68
|
this.addEvents({
|
|
64
69
|
mouseleave: (evt) => {
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
if (this.props.disabled) {
|
|
71
|
+
// 会动态设置的。所以要在监听中判断拦截;
|
|
67
72
|
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
68
73
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
69
74
|
return;
|
|
@@ -71,8 +76,8 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
71
76
|
this.setHovering(false);
|
|
72
77
|
},
|
|
73
78
|
mouseenter: (evt, element) => {
|
|
74
|
-
var _a, _b, _c, _d, _e
|
|
75
|
-
if (
|
|
79
|
+
var _a, _b, _c, _d, _e;
|
|
80
|
+
if (this.props.disabled) {
|
|
76
81
|
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
77
82
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
78
83
|
return;
|
|
@@ -80,19 +85,31 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
80
85
|
this.setHovering(true);
|
|
81
86
|
console.log('mouseenter then showClear . ');
|
|
82
87
|
if (this.panel instanceof td_input_wrapper_class_1.TdInputWrapper) {
|
|
83
|
-
if (
|
|
84
|
-
console.log('this.panel?.showClear is ', (
|
|
85
|
-
(
|
|
88
|
+
if (this.props.clearable) {
|
|
89
|
+
console.log('this.panel?.showClear is ', (_a = this.panel) === null || _a === void 0 ? void 0 : _a.showClear);
|
|
90
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.setShowClear((_c = this.panel) === null || _c === void 0 ? void 0 : _c.showClear);
|
|
86
91
|
}
|
|
87
|
-
if (
|
|
88
|
-
(
|
|
92
|
+
if (this.props.showPassword) {
|
|
93
|
+
(_d = this.panel) === null || _d === void 0 ? void 0 : _d.setShowPassword((_e = this.panel) === null || _e === void 0 ? void 0 : _e.showPwdVisible);
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
});
|
|
98
|
+
// 传递组件的监听事件到input框上;
|
|
93
99
|
this.panel.inner.addEvents({
|
|
100
|
+
focus: (evt, element) => {
|
|
101
|
+
console.log('td-input focus . ');
|
|
102
|
+
// if (this.props.emits?.focus) {
|
|
103
|
+
// this.props.emits?.focus?.(evt, element);
|
|
104
|
+
// }
|
|
105
|
+
this.emit('focus', evt, element);
|
|
106
|
+
},
|
|
94
107
|
change: (evt, element) => {
|
|
95
108
|
console.log('td-input change', evt, element);
|
|
109
|
+
// if (this.props.emits?.change) {
|
|
110
|
+
// this.props.emits.change(evt, element);
|
|
111
|
+
// }
|
|
112
|
+
this.emit('change', evt, element);
|
|
96
113
|
},
|
|
97
114
|
input: (evt, element) => {
|
|
98
115
|
var _a, _b, _c;
|
|
@@ -103,23 +120,41 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
103
120
|
else {
|
|
104
121
|
this.modelValue = (_c = element === null || element === void 0 ? void 0 : element.dom) === null || _c === void 0 ? void 0 : _c.value;
|
|
105
122
|
}
|
|
123
|
+
// if (this.props.emits?.input) {
|
|
124
|
+
// this.props.emits.input(evt, element);
|
|
125
|
+
// }
|
|
126
|
+
this.emit('input', evt, element);
|
|
127
|
+
},
|
|
128
|
+
blur: (evt, element) => {
|
|
129
|
+
console.log('td-input blur . ');
|
|
130
|
+
// if (this.props.emits?.blur) {
|
|
131
|
+
// this.props.emits?.blur?.(evt, element);
|
|
132
|
+
// }
|
|
133
|
+
this.emit('blur', evt, element);
|
|
134
|
+
},
|
|
135
|
+
keydown: (evt, element) => {
|
|
136
|
+
console.log('td-input keydown', evt, element);
|
|
137
|
+
// if (this.props.emits?.keydown) {
|
|
138
|
+
// this.props.emits.keydown(evt, element);
|
|
139
|
+
// }
|
|
140
|
+
this.emit('keydown', evt, element);
|
|
106
141
|
}
|
|
107
142
|
});
|
|
108
|
-
if (
|
|
143
|
+
if (this.props.type === 'textarea') {
|
|
109
144
|
return; // ????
|
|
110
145
|
}
|
|
111
146
|
}
|
|
112
147
|
setModelValue(value) {
|
|
113
148
|
console.log('setModelValue . value is ', value);
|
|
149
|
+
this.modelValue = value;
|
|
114
150
|
if ((0, utils_1.isString)(value)) {
|
|
115
151
|
if ((0, utils_1.isMustache)(value)) {
|
|
116
|
-
if (this.itemData) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
152
|
+
// if (this.itemData) {
|
|
153
|
+
// const originalValue = mustache(value, this.itemData);
|
|
154
|
+
// this.panel.inner.setValue(originalValue);
|
|
155
|
+
// } else {
|
|
156
|
+
this.panel.inner.setValue(value);
|
|
157
|
+
// }
|
|
123
158
|
}
|
|
124
159
|
else {
|
|
125
160
|
this.panel.inner.setValue(value);
|
|
@@ -137,14 +172,14 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
137
172
|
this.hovering = hovering;
|
|
138
173
|
if (hovering) {
|
|
139
174
|
if (!this.isFocused) {
|
|
140
|
-
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.setStyleObj({
|
|
175
|
+
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.ctrl.setStyleObj({
|
|
141
176
|
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.hoverBorderColor + ' inset'
|
|
142
177
|
});
|
|
143
178
|
}
|
|
144
179
|
}
|
|
145
180
|
else {
|
|
146
181
|
if (!this.isFocused) {
|
|
147
|
-
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.setStyleObj({
|
|
182
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.ctrl.setStyleObj({
|
|
148
183
|
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
149
184
|
});
|
|
150
185
|
}
|
|
@@ -154,23 +189,22 @@ class TdInput extends ui_abstract_1.UI {
|
|
|
154
189
|
var _a, _b;
|
|
155
190
|
this.isFocused = isFocused;
|
|
156
191
|
if (isFocused) {
|
|
157
|
-
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.setStyleObj({
|
|
192
|
+
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.ctrl.setStyleObj({
|
|
158
193
|
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.focusBorderColor + ' inset'
|
|
159
194
|
});
|
|
160
195
|
}
|
|
161
196
|
else {
|
|
162
|
-
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.setStyleObj({
|
|
197
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.ctrl.setStyleObj({
|
|
163
198
|
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
164
199
|
});
|
|
165
200
|
}
|
|
166
201
|
}
|
|
167
202
|
created() {
|
|
168
|
-
var _a;
|
|
169
203
|
// 注: 绑定变量要渲染前处理,而不是创建对象时处理
|
|
170
|
-
if (
|
|
204
|
+
if (this.props.modelValue) {
|
|
171
205
|
console.log('td-input created . ');
|
|
172
|
-
console.log('setModelValue ', this.
|
|
173
|
-
this.setModelValue(this.
|
|
206
|
+
console.log('setModelValue ', this.props.modelValue);
|
|
207
|
+
this.setModelValue(this.props.modelValue);
|
|
174
208
|
}
|
|
175
209
|
}
|
|
176
210
|
}
|
|
@@ -129,5 +129,18 @@ export interface ITdInputConfig extends IUIConfig {
|
|
|
129
129
|
passwordVisible?: boolean;
|
|
130
130
|
width?: number;
|
|
131
131
|
suffix?: Span;
|
|
132
|
+
emits?: {
|
|
133
|
+
input?: (value: string) => void;
|
|
134
|
+
change?: (value: string) => void;
|
|
135
|
+
focus?: (evt: FocusEvent) => void;
|
|
136
|
+
blur?: (evt: FocusEvent) => void;
|
|
137
|
+
clear?: () => true;
|
|
138
|
+
mouseleave?: (evt: MouseEvent) => void;
|
|
139
|
+
mouseenter?: (evt: MouseEvent) => void;
|
|
140
|
+
keydown?: (evt: KeyboardEvent | Event) => void;
|
|
141
|
+
compositionstart?: (evt: CompositionEvent) => void;
|
|
142
|
+
compositionupdate?: (evt: CompositionEvent) => void;
|
|
143
|
+
compositionend?: (evt: CompositionEvent) => void;
|
|
144
|
+
};
|
|
132
145
|
}
|
|
133
146
|
export type TargetElement = HTMLInputElement | HTMLTextAreaElement;
|
|
@@ -9,7 +9,7 @@ class TdInputPrefix extends framework_1.TypeSpan {
|
|
|
9
9
|
super();
|
|
10
10
|
this.parent = parent;
|
|
11
11
|
this.className = 'TdInputPrefix';
|
|
12
|
-
this.addStyleObj({
|
|
12
|
+
this.ctrl.addStyleObj({
|
|
13
13
|
display: (config === null || config === void 0 ? void 0 : config.prefixIcon) ? 'inline-flex' : 'none',
|
|
14
14
|
whiteSpace: 'nowrap',
|
|
15
15
|
flexShrink: 0,
|
|
@@ -47,7 +47,7 @@ class TdInputPrefix extends framework_1.TypeSpan {
|
|
|
47
47
|
styleObj: {
|
|
48
48
|
display: 'inline-flex',
|
|
49
49
|
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default']
|
|
50
|
-
// cursor:
|
|
50
|
+
// cursor: 'pointer',
|
|
51
51
|
},
|
|
52
52
|
events: {
|
|
53
53
|
click: (evt, icon) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeSpan } from '@type-dom/framework';
|
|
2
|
+
import { TdIcon } from '../../../basic/td-icon/td-icon.class';
|
|
2
3
|
import { ITdInputConfig } from '../td-input.interface';
|
|
3
|
-
import { TdIcon } from '@type-dom/ui';
|
|
4
4
|
import { TdInputWrapper } from './td-input-wrapper.class';
|
|
5
5
|
export declare class TdInputSuffix extends TypeSpan {
|
|
6
6
|
className: 'TdInputSuffix';
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdInputSuffix = void 0;
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
|
-
const ui_1 = require("@type-dom/ui");
|
|
6
5
|
const svgs_1 = require("@type-dom/svgs");
|
|
6
|
+
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
7
7
|
const td_input_style_1 = require("../td-input.style");
|
|
8
8
|
class TdInputSuffix extends framework_1.TypeSpan {
|
|
9
9
|
constructor(parent, config) {
|
|
10
10
|
super();
|
|
11
11
|
this.parent = parent;
|
|
12
12
|
this.className = 'TdInputSuffix';
|
|
13
|
-
this.addStyleObj({
|
|
13
|
+
this.ctrl.addStyleObj({
|
|
14
14
|
display: this.parent.suffixVisible ? 'inline-flex' : 'none',
|
|
15
15
|
whiteSpace: 'nowrap',
|
|
16
16
|
flexShrink: 0,
|
|
@@ -40,7 +40,7 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
40
40
|
});
|
|
41
41
|
this.addChild(this.suffixInner);
|
|
42
42
|
if (config === null || config === void 0 ? void 0 : config.clearable) {
|
|
43
|
-
this.clearIcon = new
|
|
43
|
+
this.clearIcon = new td_icon_class_1.TdIcon({
|
|
44
44
|
svgObj: new svgs_1.ElCircleCloseSvg(),
|
|
45
45
|
attrObj: {
|
|
46
46
|
name: 'suffix-icon'
|
|
@@ -48,7 +48,7 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
48
48
|
styleObj: {
|
|
49
49
|
display: 'none',
|
|
50
50
|
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
51
|
-
cursor:
|
|
51
|
+
cursor: 'pointer'
|
|
52
52
|
},
|
|
53
53
|
events: {
|
|
54
54
|
click: (evt, icon) => {
|
|
@@ -66,12 +66,12 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
66
66
|
this.suffixInner.addChild(this.clearIcon);
|
|
67
67
|
}
|
|
68
68
|
if (config === null || config === void 0 ? void 0 : config.showPassword) {
|
|
69
|
-
this.passwordIcon = new
|
|
69
|
+
this.passwordIcon = new td_icon_class_1.TdIcon({
|
|
70
70
|
svgObj: new svgs_1.ElHideSvg(),
|
|
71
71
|
styleObj: {
|
|
72
72
|
display: this.parent.showPwdVisible ? 'inline-flex' : 'none',
|
|
73
73
|
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
74
|
-
cursor:
|
|
74
|
+
cursor: 'pointer'
|
|
75
75
|
},
|
|
76
76
|
events: {
|
|
77
77
|
click: () => {
|
|
@@ -80,12 +80,12 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
80
80
|
this.parent.passwordVisible = !this.parent.passwordVisible;
|
|
81
81
|
(_a = this.passwordIcon) === null || _a === void 0 ? void 0 : _a.replaceSvg(this.parent.passwordVisible ? new svgs_1.ElViewSvg() : new svgs_1.ElHideSvg());
|
|
82
82
|
if (this.parent.passwordVisible) {
|
|
83
|
-
this.parent.inner.setAttrObj({
|
|
83
|
+
this.parent.inner.ctrl.setAttrObj({
|
|
84
84
|
type: 'text'
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
this.parent.inner.setAttrObj({
|
|
88
|
+
this.parent.inner.ctrl.setAttrObj({
|
|
89
89
|
type: 'password'
|
|
90
90
|
});
|
|
91
91
|
}
|
|
@@ -96,7 +96,7 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
96
96
|
this.suffixInner.addChild(this.passwordIcon);
|
|
97
97
|
}
|
|
98
98
|
if (config === null || config === void 0 ? void 0 : config.suffixIcon) {
|
|
99
|
-
this.suffixIcon = new
|
|
99
|
+
this.suffixIcon = new td_icon_class_1.TdIcon({
|
|
100
100
|
svgObj: config.suffixIcon,
|
|
101
101
|
attrObj: {
|
|
102
102
|
name: 'suffix-icon'
|
|
@@ -104,7 +104,7 @@ class TdInputSuffix extends framework_1.TypeSpan {
|
|
|
104
104
|
styleObj: {
|
|
105
105
|
display: 'inline-flex',
|
|
106
106
|
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default']
|
|
107
|
-
// cursor:
|
|
107
|
+
// cursor: 'pointer',
|
|
108
108
|
},
|
|
109
109
|
events: {
|
|
110
110
|
click: (evt, icon) => {
|
|
@@ -6,8 +6,8 @@ import { TdInputSuffix } from './suffix';
|
|
|
6
6
|
import { TdInputPrefix } from './prefix';
|
|
7
7
|
export declare class TdInputWrapper extends TypeDiv implements ITdInputWrapper {
|
|
8
8
|
className: 'TdInputWrapper';
|
|
9
|
+
props: ITdInputConfig;
|
|
9
10
|
parent?: TdInput;
|
|
10
|
-
config?: ITdInputConfig;
|
|
11
11
|
prepend?: Div;
|
|
12
12
|
append?: Div;
|
|
13
13
|
prefix?: TdInputPrefix;
|
|
@@ -18,8 +18,8 @@ export declare class TdInputWrapper extends TypeDiv implements ITdInputWrapper {
|
|
|
18
18
|
private isWordLimitVisible?;
|
|
19
19
|
private validateState?;
|
|
20
20
|
private needStatusIcon?;
|
|
21
|
-
constructor(
|
|
22
|
-
|
|
21
|
+
constructor(params?: ITdInputConfig);
|
|
22
|
+
setup(): void;
|
|
23
23
|
get suffixVisible(): boolean;
|
|
24
24
|
get showClear(): boolean | undefined;
|
|
25
25
|
get showPwdVisible(): boolean | undefined;
|
|
@@ -7,21 +7,20 @@ const td_input_style_1 = require("../td-input.style");
|
|
|
7
7
|
const suffix_1 = require("./suffix");
|
|
8
8
|
const prefix_1 = require("./prefix");
|
|
9
9
|
class TdInputWrapper extends framework_1.TypeDiv {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(params) {
|
|
11
11
|
super();
|
|
12
12
|
this.className = 'TdInputWrapper';
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.addStyleObj({
|
|
13
|
+
this.parent = params === null || params === void 0 ? void 0 : params.parent;
|
|
14
|
+
this.ctrl.addStyleObj({
|
|
16
15
|
display: 'inline-flex',
|
|
17
16
|
flexGrow: 1,
|
|
18
17
|
alignItems: 'center',
|
|
19
18
|
justifyContent: 'center',
|
|
20
|
-
cursor:
|
|
19
|
+
cursor: 'text',
|
|
21
20
|
transform: 'translate3d(0, 0, 0)',
|
|
22
21
|
// transform: 'translateZ(0)',
|
|
23
22
|
// padding: $border-width map.get($input-padding-horizontal, 'default')-$border-width,
|
|
24
|
-
padding: td_input_style_1.$wrapperPadding[(
|
|
23
|
+
padding: td_input_style_1.$wrapperPadding[(params === null || params === void 0 ? void 0 : params.size) || 'default'],
|
|
25
24
|
// background-color: var(
|
|
26
25
|
// #{getCssVarName('input-bg-color')},
|
|
27
26
|
// map.get($input, 'bg-color')
|
|
@@ -37,23 +36,23 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
37
36
|
// transition: var(--el-transition-box-shadow),
|
|
38
37
|
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
39
38
|
});
|
|
40
|
-
this.prefix = new prefix_1.TdInputPrefix(this,
|
|
39
|
+
this.prefix = new prefix_1.TdInputPrefix(this, params);
|
|
41
40
|
this.unshiftChild(this.prefix);
|
|
42
41
|
let placeholder = '';
|
|
43
|
-
if ((
|
|
44
|
-
placeholder =
|
|
42
|
+
if ((params === null || params === void 0 ? void 0 : params.placeholder) instanceof framework_1.XProxy) {
|
|
43
|
+
placeholder = params.placeholder.value;
|
|
45
44
|
}
|
|
46
|
-
else if (
|
|
47
|
-
placeholder =
|
|
45
|
+
else if (params === null || params === void 0 ? void 0 : params.placeholder) {
|
|
46
|
+
placeholder = params.placeholder;
|
|
48
47
|
}
|
|
49
48
|
this.inner = new framework_1.Input({
|
|
50
49
|
attrObj: {
|
|
51
|
-
type: (
|
|
52
|
-
? (
|
|
50
|
+
type: (params === null || params === void 0 ? void 0 : params.showPassword)
|
|
51
|
+
? (params === null || params === void 0 ? void 0 : params.passwordVisible)
|
|
53
52
|
? 'text'
|
|
54
53
|
: 'password'
|
|
55
|
-
:
|
|
56
|
-
placeholder: placeholder
|
|
54
|
+
: params === null || params === void 0 ? void 0 : params.type,
|
|
55
|
+
placeholder: placeholder
|
|
57
56
|
},
|
|
58
57
|
styleObj: {
|
|
59
58
|
width: '100%',
|
|
@@ -64,7 +63,7 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
64
63
|
border: 'none',
|
|
65
64
|
background: 'none',
|
|
66
65
|
boxSizing: 'border-box',
|
|
67
|
-
|
|
66
|
+
WebkitAppearance: 'none',
|
|
68
67
|
// color: var(
|
|
69
68
|
// #{getCssVarName('input-text-color')},
|
|
70
69
|
// map.get($input, 'text-color')
|
|
@@ -98,13 +97,13 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
98
97
|
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(true);
|
|
99
98
|
},
|
|
100
99
|
blur: () => {
|
|
101
|
-
var _a
|
|
100
|
+
var _a;
|
|
102
101
|
console.log('blur . ');
|
|
103
102
|
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(false);
|
|
104
|
-
if (
|
|
103
|
+
if (this.props.clearable) {
|
|
105
104
|
this.setShowClear(this.showClear);
|
|
106
105
|
}
|
|
107
|
-
if (
|
|
106
|
+
if (this.props.showPassword) {
|
|
108
107
|
this.setShowPassword(this.showPwdVisible);
|
|
109
108
|
}
|
|
110
109
|
},
|
|
@@ -117,56 +116,56 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
117
116
|
}
|
|
118
117
|
});
|
|
119
118
|
this.addChild(this.inner);
|
|
120
|
-
this.suffix = new suffix_1.TdInputSuffix(this,
|
|
119
|
+
this.suffix = new suffix_1.TdInputSuffix(this, params);
|
|
121
120
|
this.addChild(this.suffix);
|
|
122
|
-
this.
|
|
121
|
+
this.props = this.setParams(params);
|
|
123
122
|
}
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
setup() {
|
|
124
|
+
const props = this.props;
|
|
125
|
+
if (props === null || props === void 0 ? void 0 : props.prefix) {
|
|
126
126
|
// todo
|
|
127
127
|
}
|
|
128
|
-
if (
|
|
129
|
-
this.addStyleObj({
|
|
130
|
-
padding: td_input_style_1.$wrapperPadding[
|
|
131
|
-
fontSize: td_input_style_1.$inputFontSize[
|
|
132
|
-
height: td_input_style_1.$inputHeight[
|
|
128
|
+
if (props === null || props === void 0 ? void 0 : props.size) {
|
|
129
|
+
this.ctrl.addStyleObj({
|
|
130
|
+
padding: td_input_style_1.$wrapperPadding[props.size || 'default'],
|
|
131
|
+
fontSize: td_input_style_1.$inputFontSize[props.size || 'default'],
|
|
132
|
+
height: td_input_style_1.$inputHeight[props.size || 'default']
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
if (
|
|
136
|
-
this.setDisabled(
|
|
135
|
+
if (props === null || props === void 0 ? void 0 : props.disabled) {
|
|
136
|
+
this.setDisabled(props.disabled);
|
|
137
137
|
}
|
|
138
138
|
this.setNativeInputValue();
|
|
139
139
|
}
|
|
140
140
|
get suffixVisible() {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
!!((_a = this.config) === null || _a === void 0 ? void 0 : _a.suffixIcon) ||
|
|
141
|
+
return (!!this.suffix ||
|
|
142
|
+
!!this.props.suffixIcon ||
|
|
144
143
|
this.showClear ||
|
|
145
|
-
|
|
144
|
+
this.props.showPassword ||
|
|
146
145
|
this.isWordLimitVisible ||
|
|
147
|
-
(!!this.validateState && this.needStatusIcon);
|
|
146
|
+
(!!this.validateState && this.needStatusIcon));
|
|
148
147
|
}
|
|
149
148
|
get showClear() {
|
|
150
|
-
var _a, _b
|
|
151
|
-
// console.error('compute showClear . this.
|
|
152
|
-
// console.log('!this.
|
|
153
|
-
// console.log('!this.
|
|
149
|
+
var _a, _b;
|
|
150
|
+
// console.error('compute showClear . this.props is ', this.props);
|
|
151
|
+
// console.log('!this.props.disabled is ', !this.props.disabled);
|
|
152
|
+
// console.log('!this.props.readonly is ', !this.props.readonly);
|
|
154
153
|
// console.log('this.nativeInputValue is ', this.nativeInputValue);
|
|
155
154
|
// console.log('this.parent?.isFocused is ', this.parent?.isFocused);
|
|
156
155
|
// console.log('this.parent?.hovering is ', this.parent?.hovering);
|
|
157
|
-
return (
|
|
158
|
-
!
|
|
159
|
-
!
|
|
156
|
+
return (this.props.clearable &&
|
|
157
|
+
!this.props.disabled &&
|
|
158
|
+
!this.props.readonly &&
|
|
160
159
|
!!this.nativeInputValue &&
|
|
161
|
-
(((
|
|
160
|
+
(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isFocused) || ((_b = this.parent) === null || _b === void 0 ? void 0 : _b.hovering)));
|
|
162
161
|
}
|
|
163
162
|
get showPwdVisible() {
|
|
164
|
-
var _a
|
|
165
|
-
return (
|
|
166
|
-
!
|
|
167
|
-
!
|
|
163
|
+
var _a;
|
|
164
|
+
return (this.props.showPassword &&
|
|
165
|
+
!this.props.disabled &&
|
|
166
|
+
!this.props.readonly &&
|
|
168
167
|
!!this.nativeInputValue &&
|
|
169
|
-
(!!this.nativeInputValue || ((
|
|
168
|
+
(!!this.nativeInputValue || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isFocused)));
|
|
170
169
|
}
|
|
171
170
|
get nativeInputValue() {
|
|
172
171
|
return this.inner.dom.value || '';
|
|
@@ -176,23 +175,23 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
176
175
|
}
|
|
177
176
|
setDisabled(disabled) {
|
|
178
177
|
if (disabled) {
|
|
179
|
-
this.inner.setAttrObj({ disabled: 'disabled' });
|
|
180
|
-
this.inner.setStyleObj({
|
|
178
|
+
this.inner.ctrl.setAttrObj({ disabled: 'disabled' });
|
|
179
|
+
this.inner.ctrl.setStyleObj({
|
|
181
180
|
// color: var(--el-disabled-text-color),
|
|
182
181
|
color: var_1.$textColor.disabled,
|
|
183
182
|
// -webkit-text-fill-color: var(--el-disabled-text-color),
|
|
184
|
-
|
|
185
|
-
cursor:
|
|
183
|
+
WebkitTextFillColor: var_1.$textColor.disabled,
|
|
184
|
+
cursor: 'notAllowed'
|
|
186
185
|
});
|
|
187
186
|
}
|
|
188
187
|
else {
|
|
189
|
-
this.inner.removeAttribute('disabled');
|
|
190
|
-
this.inner.setStyleObj({
|
|
188
|
+
this.inner.ctrl.removeAttribute('disabled');
|
|
189
|
+
this.inner.ctrl.setStyleObj({
|
|
191
190
|
// color: var(--el-text-color),
|
|
192
191
|
color: var_1.$textColor.regular,
|
|
193
192
|
// -webkit-text-fill-color: var(--el-text-color),
|
|
194
|
-
|
|
195
|
-
cursor:
|
|
193
|
+
WebkitTextFillColor: var_1.$textColor.regular,
|
|
194
|
+
cursor: 'text'
|
|
196
195
|
});
|
|
197
196
|
}
|
|
198
197
|
}
|
|
@@ -228,32 +227,30 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
228
227
|
setShowClear(showClear) {
|
|
229
228
|
var _a;
|
|
230
229
|
console.log('setShowClear . showClear is ', showClear);
|
|
231
|
-
this.suffix.show(this.suffixVisible ?
|
|
232
|
-
(_a = this.suffix.clearIcon) === null || _a === void 0 ? void 0 : _a.show(showClear ?
|
|
230
|
+
this.suffix.ctrl.show(this.suffixVisible ? 'inline-flex' : 'none');
|
|
231
|
+
(_a = this.suffix.clearIcon) === null || _a === void 0 ? void 0 : _a.ctrl.show(showClear ? 'inline-flex' : 'none');
|
|
233
232
|
}
|
|
234
233
|
setShowPassword(showPassword) {
|
|
235
234
|
var _a;
|
|
236
|
-
(_a = this.suffix.passwordIcon) === null || _a === void 0 ? void 0 : _a.show(showPassword ?
|
|
235
|
+
(_a = this.suffix.passwordIcon) === null || _a === void 0 ? void 0 : _a.ctrl.show(showPassword ? 'inline-flex' : 'none');
|
|
237
236
|
}
|
|
238
237
|
setNativeInputValue() {
|
|
239
|
-
var _a;
|
|
240
238
|
console.log('setNativeInputValue . ');
|
|
241
239
|
const input = this.inner;
|
|
242
|
-
const formatterValue =
|
|
243
|
-
? this.
|
|
240
|
+
const formatterValue = this.props.formatter
|
|
241
|
+
? this.props.formatter(this.nativeInputValue)
|
|
244
242
|
: this.nativeInputValue;
|
|
245
243
|
if (!input || input.value === formatterValue)
|
|
246
244
|
return;
|
|
247
245
|
input.setValue(formatterValue);
|
|
248
246
|
}
|
|
249
247
|
handleInput(event, element) {
|
|
250
|
-
var _a, _b, _c, _d;
|
|
251
248
|
console.log('input . this is ', this);
|
|
252
249
|
const [recordCursor, setCursor] = (0, framework_1.useCursor)(element === null || element === void 0 ? void 0 : element.dom);
|
|
253
250
|
recordCursor();
|
|
254
251
|
let { value } = event === null || event === void 0 ? void 0 : event.target;
|
|
255
|
-
if (
|
|
256
|
-
value =
|
|
252
|
+
if (this.props.formatter) {
|
|
253
|
+
value = this.props.parser ? this.props.parser(value) : value;
|
|
257
254
|
console.log('parser value is ', value);
|
|
258
255
|
}
|
|
259
256
|
// should not emit input during composition
|
|
@@ -275,10 +272,10 @@ class TdInputWrapper extends framework_1.TypeDiv {
|
|
|
275
272
|
this.setNativeInputValue();
|
|
276
273
|
setCursor();
|
|
277
274
|
console.log('handleInput then setShowClear . ');
|
|
278
|
-
if (
|
|
275
|
+
if (this.props.clearable) {
|
|
279
276
|
this.setShowClear(this.showClear);
|
|
280
277
|
}
|
|
281
|
-
if (
|
|
278
|
+
if (this.props.showPassword) {
|
|
282
279
|
this.setShowPassword(this.showPwdVisible);
|
|
283
280
|
}
|
|
284
281
|
}
|