@type-dom/ui 0.0.2 → 0.0.4
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 +45 -11
- package/package.json +7 -1
- package/src/aria.d.ts +17 -0
- package/src/aria.js +20 -0
- package/src/{basic → components/basic}/index.d.ts +14 -0
- package/src/components/basic/index.js +55 -0
- package/src/{basic → components/basic}/td-button/td-button.class.d.ts +7 -5
- package/src/components/basic/td-button/td-button.class.js +179 -0
- package/src/{basic → components/basic}/td-button/td-button.interface.d.ts +21 -21
- package/src/{basic → components/basic}/td-button/td-button.style.d.ts +2 -1
- package/src/{basic → components/basic}/td-button/td-button.style.js +34 -30
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +11 -0
- package/src/components/basic/td-button-group/td-button-group.class.js +105 -0
- package/src/components/basic/td-button-group/td-button-group.interface.d.ts +16 -0
- package/src/components/basic/td-container/td-aside/td-aside.class.d.ts +6 -0
- package/src/{basic → components/basic}/td-container/td-aside/td-aside.class.js +4 -4
- package/src/components/basic/td-container/td-aside/td-aside.interface.d.ts +7 -0
- package/src/components/basic/td-container/td-container.class.d.ts +11 -0
- package/src/{basic → components/basic}/td-container/td-container.class.js +4 -4
- package/src/components/basic/td-container/td-container.interface.d.ts +15 -0
- package/src/components/basic/td-container/td-footer/td-footer.class.d.ts +8 -0
- package/src/components/basic/td-container/td-footer/td-footer.class.js +24 -0
- package/src/components/basic/td-container/td-footer/td-footer.interface.d.ts +8 -0
- package/src/components/basic/td-container/td-header/td-header.class.d.ts +9 -0
- package/src/components/basic/td-container/td-header/td-header.class.js +25 -0
- package/src/components/basic/td-container/td-header/td-header.interface.d.ts +8 -0
- package/src/{basic → components/basic}/td-container/td-main/td-main.class.d.ts +2 -2
- package/src/{basic → components/basic}/td-container/td-main/td-main.class.js +5 -8
- package/src/components/basic/td-container/td-main/td-main.interface.d.ts +7 -0
- package/src/{basic → components/basic}/td-icon/td-icon.class.d.ts +7 -3
- package/src/{basic → components/basic}/td-icon/td-icon.class.js +37 -11
- package/src/components/basic/td-icon/td-icon.interface.d.ts +13 -0
- package/src/{basic → components/basic}/td-icon/td-icon.style.d.ts +1 -0
- package/src/{basic → components/basic}/td-icon/td-icon.style.js +4 -3
- package/src/components/basic/td-layout/td-col/td-col.class.d.ts +13 -0
- package/src/components/basic/td-layout/td-col/td-col.class.js +128 -0
- package/src/components/basic/td-layout/td-col/td-col.interface.d.ts +46 -0
- package/src/components/basic/td-layout/td-row/td-row.class.d.ts +10 -0
- package/src/components/basic/td-layout/td-row/td-row.class.js +101 -0
- package/src/components/basic/td-layout/td-row/td-row.interface.d.ts +18 -0
- package/src/components/basic/td-layout/td-row/td-row.interface.js +12 -0
- package/src/components/basic/td-layout/td-row/td-row.style.d.ts +1 -0
- package/src/components/basic/td-layout/td-row/td-row.style.js +8 -0
- package/src/components/basic/td-link/td-link.class.d.ts +11 -0
- package/src/components/basic/td-link/td-link.class.js +105 -0
- package/src/components/basic/td-link/td-link.interface.d.ts +33 -0
- package/src/components/basic/td-link/td-link.style.d.ts +5 -0
- package/src/components/basic/td-link/td-link.style.js +45 -0
- package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +8 -0
- package/src/components/basic/td-scrollbar/bar/bar.class.js +31 -0
- package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +8 -0
- package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +9 -0
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +51 -0
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +63 -0
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.js +5 -0
- package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +7 -0
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +45 -0
- package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +11 -0
- package/src/components/basic/td-space/td-space.class.d.ts +12 -0
- package/src/components/basic/td-space/td-space.class.js +92 -0
- package/src/components/basic/td-space/td-space.const.d.ts +3 -0
- package/src/components/basic/td-space/td-space.const.js +8 -0
- package/src/components/basic/td-space/td-space.interface.d.ts +39 -0
- package/src/components/basic/td-text/td-text.class.d.ts +10 -0
- package/src/components/basic/td-text/td-text.class.js +47 -0
- package/src/components/basic/td-text/td-text.interface.d.ts +21 -0
- package/src/components/basic/td-text/td-text.style.d.ts +6 -0
- package/src/components/basic/td-text/td-text.style.js +59 -0
- package/src/{feedback/dialog/dialog.d.ts → components/feedback/dialog/dialog.class.d.ts} +2 -3
- package/src/{feedback/dialog/dialog.js → components/feedback/dialog/dialog.class.js} +9 -2
- package/src/components/feedback/dialog/dialog.interface.d.ts +5 -0
- package/src/{feedback → components/feedback}/index.d.ts +1 -1
- package/src/{feedback → components/feedback}/index.js +2 -2
- package/src/{feedback → components/feedback}/message-box/message-box.d.ts +2 -3
- package/src/components/feedback/message-box/message-box.interface.d.ts +4 -0
- package/src/{feedback → components/feedback}/message-box/message-box.js +11 -2
- package/src/{feedback → components/feedback}/overlay/container/body/body.js +7 -9
- package/src/{feedback → components/feedback}/overlay/container/container.js +12 -14
- package/src/{feedback → components/feedback}/overlay/container/footer/cancel-button/cancel-button.js +2 -2
- package/src/{feedback → components/feedback}/overlay/container/footer/confirm-button/confirm-button.js +9 -11
- package/src/{feedback → components/feedback}/overlay/container/footer/footer.js +4 -4
- package/src/{feedback → components/feedback}/overlay/container/header/close-button/close-button.js +15 -17
- package/src/{feedback → components/feedback}/overlay/container/header/header.js +2 -2
- package/src/{feedback → components/feedback}/overlay/container/header/title/title.d.ts +1 -1
- package/src/{feedback → components/feedback}/overlay/container/header/title/title.js +9 -11
- package/src/{feedback → components/feedback}/overlay/overlay.abstract.d.ts +0 -3
- package/src/{feedback → components/feedback}/overlay/overlay.abstract.js +5 -11
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +8 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +81 -0
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +10 -0
- package/src/components/feedback/td-focus-trap/tokens.d.ts +7 -0
- package/src/components/feedback/td-focus-trap/tokens.js +23 -0
- package/src/components/feedback/td-focus-trap/utils.d.ts +25 -0
- package/src/components/feedback/td-focus-trap/utils.js +153 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +6 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.js +32 -0
- package/src/components/feedback/td-popper/arrow/arrow.interface.d.ts +11 -0
- package/src/components/feedback/td-popper/arrow/arrow.interface.js +2 -0
- package/src/components/feedback/td-popper/content/content.class.d.ts +7 -0
- package/src/components/feedback/td-popper/content/content.class.js +25 -0
- package/src/components/feedback/td-popper/content/content.interface.d.ts +37 -0
- package/src/components/feedback/td-popper/content/content.interface.js +2 -0
- package/src/components/feedback/td-popper/td-popper.class.d.ts +6 -0
- package/src/components/feedback/td-popper/td-popper.class.js +12 -0
- package/src/components/feedback/td-popper/td-popper.interface.d.ts +12 -0
- package/src/components/feedback/td-popper/td-popper.interface.js +13 -0
- package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +6 -0
- package/src/components/feedback/td-popper/trigger/trigger.class.js +11 -0
- package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +8 -0
- package/src/components/feedback/td-popper/trigger/trigger.interface.js +2 -0
- package/src/components/feedback/td-tooltip/content/content.class.d.ts +6 -0
- package/src/components/feedback/td-tooltip/content/content.class.js +12 -0
- package/src/components/feedback/td-tooltip/content/content.interface.d.ts +42 -0
- package/src/components/feedback/td-tooltip/content/content.interface.js +2 -0
- package/src/components/feedback/td-tooltip/td-tooltip.class.d.ts +8 -0
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +30 -0
- package/src/components/feedback/td-tooltip/td-tooltip.interface.d.ts +10 -0
- package/src/components/feedback/td-tooltip/td-tooltip.interface.js +2 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.class.d.ts +6 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +12 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.interface.d.ts +16 -0
- package/src/components/feedback/td-tooltip/trigger/trigger.interface.js +2 -0
- package/src/{form → components/form}/checkbox-group/checkbox-group.class.d.ts +2 -3
- package/src/{form → components/form}/checkbox-group/checkbox-group.class.js +2 -2
- package/src/components/form/checkbox-group/checkbox-group.interface.js +2 -0
- package/src/{form → components/form}/checkbox-group/checkbox-option/checkbox-option.class.d.ts +2 -2
- package/src/{form → components/form}/checkbox-group/checkbox-option/checkbox-option.class.js +7 -7
- package/src/{form → components/form}/checkbox-group/checkbox-option/checkbox-option.interface.d.ts +0 -5
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.interface.js +2 -0
- package/src/components/form/field-item/cascade/field-cascade.abstract.d.ts +22 -0
- package/src/{form → components/form}/field-item/cascade/field-cascade.abstract.js +38 -42
- package/src/components/form/field-item/field-item.abstract.d.ts +10 -0
- package/src/{form → components/form}/field-item/field-item.abstract.js +5 -10
- package/src/components/form/field-item/field-item.interface.d.ts +5 -0
- package/src/components/form/field-item/field-item.interface.js +2 -0
- package/src/{form → components/form}/field-item/field-item.style.d.ts +1 -1
- package/src/{form → components/form}/field-item/field-item.style.js +2 -2
- package/src/{form → components/form}/field-item/input/field-input.abstract.js +6 -8
- package/src/components/form/field-item/options/field-options.abstract.d.ts +21 -0
- package/src/{form → components/form}/field-item/options/field-options.abstract.js +55 -55
- package/src/{form → components/form}/field-item/radio/field-radio.abstract.d.ts +6 -7
- package/src/{form → components/form}/field-item/radio/field-radio.abstract.js +10 -10
- package/src/{form → components/form}/field-item/select/field-select.abstract.js +7 -9
- package/src/{form → components/form}/field-item/span/field-span.abstract.d.ts +1 -1
- package/src/components/form/field-item/span/field-span.abstract.js +52 -0
- package/src/{form → components/form}/field-item/textarea/field-textarea.abstract.js +8 -8
- package/src/components/form/field-select/field-select.class.d.ts +12 -0
- package/src/{basic/td-select/td-select.class.js → components/form/field-select/field-select.class.js} +7 -7
- package/src/{basic/td-select/td-select.interface.d.ts → components/form/field-select/field-select.interface.d.ts} +2 -2
- package/src/components/form/field-select/field-select.interface.js +2 -0
- package/src/{basic/td-select → components/form/field-select}/option/option.class.d.ts +3 -5
- package/src/{basic/td-select → components/form/field-select}/option/option.class.js +3 -5
- package/src/components/form/field-select/option/option.interface.js +2 -0
- package/src/components/form/index.d.ts +26 -0
- package/src/{form → components/form}/index.js +17 -1
- package/src/{form → components/form}/radio-group/radio-group.class.d.ts +5 -6
- package/src/{form → components/form}/radio-group/radio-group.class.js +11 -4
- package/src/components/form/radio-group/radio-group.interface.d.ts +11 -0
- package/src/components/form/radio-group/radio-group.interface.js +2 -0
- package/src/{form → components/form}/radio-group/radio-option/radio-option.class.d.ts +5 -4
- package/src/components/form/radio-group/radio-option/radio-option.class.js +46 -0
- package/src/components/form/radio-group/radio-option/radio-option.interface.d.ts +10 -0
- package/src/components/form/radio-group/radio-option/radio-option.interface.js +2 -0
- package/src/{form → components/form}/select/select.class.d.ts +4 -5
- package/src/{form → components/form}/select/select.class.js +5 -5
- package/src/components/form/select/select.interface.d.ts +4 -0
- package/src/components/form/select/select.interface.js +2 -0
- package/src/components/form/td-checkbox/td-checkbox.class.d.ts +7 -0
- package/src/components/form/td-checkbox/td-checkbox.class.js +104 -0
- package/src/components/form/td-checkbox/td-checkbox.interface.d.ts +78 -0
- package/src/components/form/td-checkbox/td-checkbox.interface.js +2 -0
- package/src/components/form/td-checkbox/td-checkbox.style.d.ts +14 -0
- package/src/components/form/td-checkbox/td-checkbox.style.js +18 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.d.ts +7 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +15 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.interface.d.ts +6 -0
- package/src/components/form/td-checkbox-button/td-checkbox-button.interface.js +2 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.d.ts +7 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +20 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.interface.d.ts +50 -0
- package/src/components/form/td-checkbox-group/td-checkbox-group.interface.js +2 -0
- package/src/components/form/td-form/td-form.class.d.ts +22 -0
- package/src/components/form/td-form/td-form.class.js +52 -0
- package/src/components/form/td-form/td-form.interface.d.ts +92 -0
- package/src/components/form/td-form/td-form.interface.js +2 -0
- package/src/components/form/td-form/td-form.style.d.ts +4 -0
- package/src/components/form/td-form/td-form.style.js +8 -0
- package/src/components/form/td-form-item/td-form-item.class.d.ts +17 -0
- package/src/components/form/td-form-item/td-form-item.class.js +145 -0
- package/src/components/form/td-form-item/td-form-item.interface.d.ts +57 -0
- package/src/components/form/td-form-item/td-form-item.interface.js +9 -0
- package/src/components/form/td-form-item/td-form-item.style.d.ts +29 -0
- package/src/components/form/td-form-item/td-form-item.style.js +34 -0
- package/src/components/form/td-input/td-input-field.class.d.ts +7 -0
- package/src/{form/td-input/td-input.class.js → components/form/td-input/td-input-field.class.js} +8 -8
- package/src/{form/td-input/td-input.interface.d.ts → components/form/td-input/td-input-field.interface.d.ts} +3 -3
- package/src/components/form/td-input/td-input-field.interface.js +2 -0
- package/src/components/form/td-input/td-input.class.d.ts +21 -0
- package/src/components/form/td-input/td-input.class.js +177 -0
- package/src/components/form/td-input/td-input.interface.d.ts +133 -0
- package/src/components/form/td-input/td-input.interface.js +2 -0
- package/src/components/form/td-input/td-input.style.d.ts +53 -0
- package/src/components/form/td-input/td-input.style.js +66 -0
- package/src/components/form/td-input/widget/prefix.d.ts +10 -0
- package/src/components/form/td-input/widget/prefix.js +63 -0
- package/src/components/form/td-input/widget/suffix.d.ts +13 -0
- package/src/components/form/td-input/widget/suffix.js +120 -0
- package/src/components/form/td-input/widget/td-input-wrapper.class.d.ts +33 -0
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +286 -0
- package/src/components/form/td-input/widget/td-input-wrapper.interface.d.ts +4 -0
- package/src/components/form/td-input/widget/td-input-wrapper.interface.js +2 -0
- package/src/components/form/td-input/widget/td-textarea-wrapper.d.ts +13 -0
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +123 -0
- package/src/components/form/td-input/widget/utils.d.ts +6 -0
- package/src/components/form/td-input/widget/utils.js +81 -0
- package/src/components/form/td-radio/td-radio.class.d.ts +17 -0
- package/src/components/form/td-radio/td-radio.class.js +232 -0
- package/src/components/form/td-radio/td-radio.interface.d.ts +38 -0
- package/src/components/form/td-radio/td-radio.interface.js +2 -0
- package/src/components/form/td-radio-button/td-radio-button.class.d.ts +15 -0
- package/src/components/form/td-radio-button/td-radio-button.class.js +195 -0
- package/src/components/form/td-radio-button/td-radio-button.interface.d.ts +34 -0
- package/src/components/form/td-radio-button/td-radio-button.interface.js +2 -0
- package/src/components/form/td-radio-button/td-radio-button.style.d.ts +1 -0
- package/src/components/form/td-radio-button/td-radio-button.style.js +9 -0
- package/src/components/form/td-radio-group/td-radio-group.class.d.ts +16 -0
- package/src/components/form/td-radio-group/td-radio-group.class.js +105 -0
- package/src/components/form/td-radio-group/td-radio-group.interface.d.ts +47 -0
- package/src/components/form/td-radio-group/td-radio-group.interface.js +2 -0
- package/src/components/form/td-select/dropdown/dropdown.class.d.ts +9 -0
- package/src/components/form/td-select/dropdown/dropdown.class.js +48 -0
- package/src/components/form/td-select/dropdown/dropdown.interface.d.ts +9 -0
- package/src/components/form/td-select/dropdown/dropdown.interface.js +2 -0
- package/src/components/form/td-select/option/option.class.d.ts +6 -0
- package/src/components/form/td-select/option/option.class.js +36 -0
- package/src/components/form/td-select/option/option.interface.d.ts +20 -0
- package/src/components/form/td-select/option/option.interface.js +2 -0
- package/src/components/form/td-select/option-group/option-group.class.d.ts +6 -0
- package/src/components/form/td-select/option-group/option-group.class.js +50 -0
- package/src/components/form/td-select/option-group/option-group.interface.d.ts +14 -0
- package/src/components/form/td-select/option-group/option-group.interface.js +2 -0
- package/src/components/form/td-select/td-select.class.d.ts +6 -0
- package/src/components/form/td-select/td-select.class.js +32 -0
- package/src/components/form/td-select/td-select.interface.d.ts +172 -0
- package/src/components/form/td-select/td-select.interface.js +2 -0
- package/src/components/form/td-select/td-select.style.d.ts +53 -0
- package/src/components/form/td-select/td-select.style.js +76 -0
- package/src/components/form/td-switch/td-switch.class.d.ts +20 -0
- package/src/components/form/td-switch/td-switch.class.js +225 -0
- package/src/components/form/td-switch/td-switch.interface.d.ts +97 -0
- package/src/components/form/td-switch/td-switch.interface.js +2 -0
- package/src/components/form/td-switch/td-switch.style.d.ts +47 -0
- package/src/components/form/td-switch/td-switch.style.js +57 -0
- package/src/components/form/td-switch/widget/td-switch-core.d.ts +17 -0
- package/src/components/form/td-switch/widget/td-switch-core.js +212 -0
- package/src/components/form/td-switch/widget/td-switch-left.d.ts +7 -0
- package/src/components/form/td-switch/widget/td-switch-left.js +26 -0
- package/src/components/form/td-switch/widget/td-switch-right.d.ts +7 -0
- package/src/components/form/td-switch/widget/td-switch-right.js +25 -0
- package/src/components/navigation/index.d.ts +2 -0
- package/src/components/navigation/index.js +5 -0
- package/src/components/navigation/td-menu/td-menu.class.d.ts +7 -0
- package/src/components/navigation/td-menu/td-menu.class.js +42 -0
- package/src/components/navigation/td-menu/td-menu.interface.d.ts +23 -0
- package/src/components/navigation/td-menu/td-menu.interface.js +2 -0
- package/src/{others → components/others}/collapsible-box/collapsible-box.js +10 -11
- package/src/{others → components/others}/collapsible-box/contents/contents.js +9 -11
- package/src/{others → components/others}/collapsible-box/heading/expand-heading.js +28 -26
- package/src/{others → components/others}/index.d.ts +2 -0
- package/src/{others → components/others}/index.js +3 -1
- package/src/components/others/td-divider/td-divider.class.d.ts +6 -0
- package/src/components/others/td-divider/td-divider.class.js +80 -0
- package/src/components/others/td-divider/td-divider.interface.d.ts +18 -0
- package/src/components/others/td-divider/td-divider.interface.js +2 -0
- package/src/index.d.ts +6 -4
- package/src/index.js +7 -5
- package/src/styles/color-scheme.js +12 -12
- package/src/styles/index.d.ts +1 -0
- package/src/styles/index.js +4 -0
- package/src/styles/size.d.ts +7 -0
- package/src/styles/size.js +9 -0
- package/src/styles/var.d.ts +28 -10
- package/src/styles/var.js +59 -28
- package/src/ui/ui.abstract.d.ts +8 -0
- package/src/ui/ui.abstract.js +22 -0
- package/src/ui/ui.interface.d.ts +8 -0
- package/src/ui/ui.interface.js +2 -0
- package/src/basic/index.js +0 -19
- package/src/basic/td-button/td-button.class.js +0 -149
- package/src/basic/td-container/td-aside/td-aside.class.d.ts +0 -6
- package/src/basic/td-container/td-aside/td-aside.interface.d.ts +0 -8
- package/src/basic/td-container/td-container.class.d.ts +0 -10
- package/src/basic/td-container/td-container.interface.d.ts +0 -14
- package/src/basic/td-container/td-footer/td-footer.class.d.ts +0 -6
- package/src/basic/td-container/td-footer/td-footer.class.js +0 -30
- package/src/basic/td-container/td-footer/td-footer.interface.d.ts +0 -11
- package/src/basic/td-container/td-header/td-header.class.d.ts +0 -9
- package/src/basic/td-container/td-header/td-header.class.js +0 -23
- package/src/basic/td-container/td-header/td-header.interface.d.ts +0 -10
- package/src/basic/td-container/td-main/td-main.interface.d.ts +0 -7
- package/src/basic/td-icon/td-icon.interface.d.ts +0 -12
- package/src/basic/td-select/td-select.class.d.ts +0 -14
- package/src/form/field-item/cascade/field-cascade.abstract.d.ts +0 -22
- package/src/form/field-item/field-item.abstract.d.ts +0 -11
- package/src/form/field-item/field-item.interface.d.ts +0 -12
- package/src/form/field-item/options/field-options.abstract.d.ts +0 -22
- package/src/form/field-item/span/field-span.abstract.js +0 -54
- package/src/form/index.d.ts +0 -11
- package/src/form/input-number/td-input-number.class.d.ts +0 -9
- package/src/form/input-number/td-input-number.class.js +0 -55
- package/src/form/input-number/td-input-number.interface.d.ts +0 -9
- package/src/form/radio-group/radio-group.interface.d.ts +0 -6
- package/src/form/radio-group/radio-option/radio-option.class.js +0 -33
- package/src/form/radio-group/radio-option/radio-option.interface.d.ts +0 -5
- package/src/form/select/select.interface.d.ts +0 -10
- package/src/form/td-input/td-input.class.d.ts +0 -9
- /package/src/{basic/td-container/td-aside/td-aside.interface.js → components/basic/td-button/td-button.interface.js} +0 -0
- /package/src/{basic/td-button/td-button.interface.js → components/basic/td-button-group/td-button-group.interface.js} +0 -0
- /package/src/{basic/td-container/td-container.interface.js → components/basic/td-container/td-aside/td-aside.interface.js} +0 -0
- /package/src/{basic → components/basic}/td-container/td-container.d.ts +0 -0
- /package/src/{basic/td-container/td-footer/td-footer.interface.js → components/basic/td-container/td-container.interface.js} +0 -0
- /package/src/{basic → components/basic}/td-container/td-container.js +0 -0
- /package/src/{basic/td-container/td-header/td-header.interface.js → components/basic/td-container/td-footer/td-footer.interface.js} +0 -0
- /package/src/{basic/td-container/td-main/td-main.interface.js → components/basic/td-container/td-header/td-header.interface.js} +0 -0
- /package/src/{basic/td-icon/td-icon.interface.js → components/basic/td-container/td-main/td-main.interface.js} +0 -0
- /package/src/{basic/td-select/option/option.interface.js → components/basic/td-icon/td-icon.interface.js} +0 -0
- /package/src/{basic/td-select/td-select.interface.js → components/basic/td-layout/td-col/td-col.interface.js} +0 -0
- /package/src/{form/checkbox-group/checkbox-group.interface.js → components/basic/td-link/td-link.interface.js} +0 -0
- /package/src/{form/checkbox-group/checkbox-option/checkbox-option.interface.js → components/basic/td-scrollbar/bar/bar.interface.js} +0 -0
- /package/src/{form/field-item/field-item.interface.js → components/basic/td-scrollbar/thumb/thumb.interface.js} +0 -0
- /package/src/{form/input-number/td-input-number.interface.js → components/basic/td-space/td-space.interface.js} +0 -0
- /package/src/{form/radio-group/radio-group.interface.js → components/basic/td-text/td-text.interface.js} +0 -0
- /package/src/{data → components/data}/index.d.ts +0 -0
- /package/src/{data → components/data}/index.js +0 -0
- /package/src/{form/radio-group/radio-option/radio-option.interface.js → components/feedback/dialog/dialog.interface.js} +0 -0
- /package/src/{form/select/select.interface.js → components/feedback/message-box/message-box.interface.js} +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/body/body.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/container.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/footer/cancel-button/cancel-button.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/footer/confirm-button/confirm-button.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/footer/footer.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/header/close-button/close-button.d.ts +0 -0
- /package/src/{feedback → components/feedback}/overlay/container/header/header.d.ts +0 -0
- /package/src/{form/td-input/td-input.interface.js → components/feedback/td-focus-trap/td-focus-trap.interface.js} +0 -0
- /package/src/{form → components/form}/checkbox-group/checkbox-group.interface.d.ts +0 -0
- /package/src/{form → components/form}/field-item/input/field-input.abstract.d.ts +0 -0
- /package/src/{form → components/form}/field-item/select/field-select.abstract.d.ts +0 -0
- /package/src/{form → components/form}/field-item/textarea/field-textarea.abstract.d.ts +0 -0
- /package/src/{basic/td-select → components/form/field-select}/option/option.interface.d.ts +0 -0
- /package/src/{navigation/index.d.ts → components/navigation/td-menu/td-menu.style.d.ts} +0 -0
- /package/src/{navigation/index.js → components/navigation/td-menu/td-menu.style.js} +0 -0
- /package/src/{others → components/others}/collapsible-box/collapsible-box.d.ts +0 -0
- /package/src/{others → components/others}/collapsible-box/contents/contents.d.ts +0 -0
- /package/src/{others → components/others}/collapsible-box/heading/expand-heading.d.ts +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdInputWrapper = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const var_1 = require("../../../../styles/var");
|
|
6
|
+
const td_input_style_1 = require("../td-input.style");
|
|
7
|
+
const suffix_1 = require("./suffix");
|
|
8
|
+
const prefix_1 = require("./prefix");
|
|
9
|
+
class TdInputWrapper extends framework_1.TypeDiv {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super();
|
|
12
|
+
this.className = 'TdInputWrapper';
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.parent = config === null || config === void 0 ? void 0 : config.parent;
|
|
15
|
+
this.addStyleObj({
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
flexGrow: 1,
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
cursor: framework_1.StyleCursor.text,
|
|
21
|
+
transform: 'translate3d(0, 0, 0)',
|
|
22
|
+
// transform: 'translateZ(0)',
|
|
23
|
+
// padding: $border-width map.get($input-padding-horizontal, 'default')-$border-width,
|
|
24
|
+
padding: td_input_style_1.$wrapperPadding[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
25
|
+
// background-color: var(
|
|
26
|
+
// #{getCssVarName('input-bg-color')},
|
|
27
|
+
// map.get($input, 'bg-color')
|
|
28
|
+
// ),
|
|
29
|
+
backgroundColor: td_input_style_1.$input.bgColor,
|
|
30
|
+
backgroundImage: 'none',
|
|
31
|
+
// border-radius: getCssVarWithDefault(
|
|
32
|
+
// 'input-border-radius',
|
|
33
|
+
// map.get($input, 'border-radius')
|
|
34
|
+
// ),
|
|
35
|
+
borderRadius: td_input_style_1.$input.borderRadius,
|
|
36
|
+
// transition: getCssVar('transition-box-shadow'),
|
|
37
|
+
// transition: var(--el-transition-box-shadow),
|
|
38
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
39
|
+
});
|
|
40
|
+
this.prefix = new prefix_1.TdInputPrefix(this, config);
|
|
41
|
+
this.unshiftChild(this.prefix);
|
|
42
|
+
let placeholder = '';
|
|
43
|
+
if ((config === null || config === void 0 ? void 0 : config.placeholder) instanceof framework_1.XProxy) {
|
|
44
|
+
placeholder = config.placeholder.value;
|
|
45
|
+
}
|
|
46
|
+
else if (config === null || config === void 0 ? void 0 : config.placeholder) {
|
|
47
|
+
placeholder = config.placeholder;
|
|
48
|
+
}
|
|
49
|
+
this.inner = new framework_1.Input({
|
|
50
|
+
attrObj: {
|
|
51
|
+
type: (config === null || config === void 0 ? void 0 : config.showPassword)
|
|
52
|
+
? (config === null || config === void 0 ? void 0 : config.passwordVisible)
|
|
53
|
+
? 'text'
|
|
54
|
+
: 'password'
|
|
55
|
+
: config === null || config === void 0 ? void 0 : config.type,
|
|
56
|
+
placeholder: placeholder ? placeholder : 'Please input'
|
|
57
|
+
},
|
|
58
|
+
styleObj: {
|
|
59
|
+
width: '100%',
|
|
60
|
+
flexGrow: 1,
|
|
61
|
+
fontSize: 'inherit',
|
|
62
|
+
padding: '0',
|
|
63
|
+
outline: 'none',
|
|
64
|
+
border: 'none',
|
|
65
|
+
background: 'none',
|
|
66
|
+
boxSizing: 'border-box',
|
|
67
|
+
'-webkit-appearance': 'none',
|
|
68
|
+
// color: var(
|
|
69
|
+
// #{getCssVarName('input-text-color')},
|
|
70
|
+
// map.get($input, 'text-color')
|
|
71
|
+
// );
|
|
72
|
+
color: td_input_style_1.$inputTextColor,
|
|
73
|
+
// height: getCssVar('input-inner-height');
|
|
74
|
+
height: td_input_style_1.$inputInnerHeight,
|
|
75
|
+
// line-height: getCssVar('input-inner-height');
|
|
76
|
+
lineHeight: td_input_style_1.$inputInnerHeight
|
|
77
|
+
},
|
|
78
|
+
events: {
|
|
79
|
+
compositionstart: () => {
|
|
80
|
+
console.log('compositionstart . ');
|
|
81
|
+
this.isComposing = true;
|
|
82
|
+
},
|
|
83
|
+
compositionupdate: () => {
|
|
84
|
+
console.log('compositionupdate . ');
|
|
85
|
+
},
|
|
86
|
+
compositionend: (event) => {
|
|
87
|
+
console.log('compositionend . ');
|
|
88
|
+
this.isComposing = false;
|
|
89
|
+
if (this.isComposing) {
|
|
90
|
+
this.isComposing = false;
|
|
91
|
+
this.handleInput(event);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
input: (event, element) => this.handleInput(event, element),
|
|
95
|
+
focus: (i) => {
|
|
96
|
+
var _a;
|
|
97
|
+
console.log('td-input focus . this.parent is ', this.parent);
|
|
98
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(true);
|
|
99
|
+
},
|
|
100
|
+
blur: () => {
|
|
101
|
+
var _a, _b, _c;
|
|
102
|
+
console.log('blur . ');
|
|
103
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(false);
|
|
104
|
+
if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.clearable) {
|
|
105
|
+
this.setShowClear(this.showClear);
|
|
106
|
+
}
|
|
107
|
+
if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.showPassword) {
|
|
108
|
+
this.setShowPassword(this.showPwdVisible);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
change: () => {
|
|
112
|
+
console.log('change . ');
|
|
113
|
+
},
|
|
114
|
+
keydown: () => {
|
|
115
|
+
console.log('keydown . ');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
this.addChild(this.inner);
|
|
120
|
+
this.suffix = new suffix_1.TdInputSuffix(this, config);
|
|
121
|
+
this.addChild(this.suffix);
|
|
122
|
+
this.setConfig(config);
|
|
123
|
+
}
|
|
124
|
+
setConfig(config) {
|
|
125
|
+
if (config === null || config === void 0 ? void 0 : config.prefix) {
|
|
126
|
+
// todo
|
|
127
|
+
}
|
|
128
|
+
if (config === null || config === void 0 ? void 0 : config.size) {
|
|
129
|
+
this.addStyleObj({
|
|
130
|
+
padding: td_input_style_1.$wrapperPadding[config.size || 'default'],
|
|
131
|
+
fontSize: td_input_style_1.$inputFontSize[config.size || 'default'],
|
|
132
|
+
height: td_input_style_1.$inputHeight[config.size || 'default']
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
136
|
+
this.setDisabled(config.disabled);
|
|
137
|
+
}
|
|
138
|
+
this.setNativeInputValue();
|
|
139
|
+
}
|
|
140
|
+
get suffixVisible() {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
return !!this.suffix ||
|
|
143
|
+
!!((_a = this.config) === null || _a === void 0 ? void 0 : _a.suffixIcon) ||
|
|
144
|
+
this.showClear ||
|
|
145
|
+
((_b = this.config) === null || _b === void 0 ? void 0 : _b.showPassword) ||
|
|
146
|
+
this.isWordLimitVisible ||
|
|
147
|
+
(!!this.validateState && this.needStatusIcon);
|
|
148
|
+
}
|
|
149
|
+
get showClear() {
|
|
150
|
+
var _a, _b, _c, _d, _e;
|
|
151
|
+
// console.error('compute showClear . this.config is ', this.config);
|
|
152
|
+
// console.log('!this.config?.disabled is ', !this.config?.disabled);
|
|
153
|
+
// console.log('!this.config?.readonly is ', !this.config?.readonly);
|
|
154
|
+
// console.log('this.nativeInputValue is ', this.nativeInputValue);
|
|
155
|
+
// console.log('this.parent?.isFocused is ', this.parent?.isFocused);
|
|
156
|
+
// console.log('this.parent?.hovering is ', this.parent?.hovering);
|
|
157
|
+
return (((_a = this.config) === null || _a === void 0 ? void 0 : _a.clearable) &&
|
|
158
|
+
!((_b = this.config) === null || _b === void 0 ? void 0 : _b.disabled) &&
|
|
159
|
+
!((_c = this.config) === null || _c === void 0 ? void 0 : _c.readonly) &&
|
|
160
|
+
!!this.nativeInputValue &&
|
|
161
|
+
(((_d = this.parent) === null || _d === void 0 ? void 0 : _d.isFocused) || ((_e = this.parent) === null || _e === void 0 ? void 0 : _e.hovering)));
|
|
162
|
+
}
|
|
163
|
+
get showPwdVisible() {
|
|
164
|
+
var _a, _b, _c, _d;
|
|
165
|
+
return (((_a = this.config) === null || _a === void 0 ? void 0 : _a.showPassword) &&
|
|
166
|
+
!((_b = this.config) === null || _b === void 0 ? void 0 : _b.disabled) &&
|
|
167
|
+
!((_c = this.config) === null || _c === void 0 ? void 0 : _c.readonly) &&
|
|
168
|
+
!!this.nativeInputValue &&
|
|
169
|
+
(!!this.nativeInputValue || ((_d = this.parent) === null || _d === void 0 ? void 0 : _d.isFocused)));
|
|
170
|
+
}
|
|
171
|
+
get nativeInputValue() {
|
|
172
|
+
return this.inner.dom.value || '';
|
|
173
|
+
}
|
|
174
|
+
set nativeInputValue(value) {
|
|
175
|
+
this.inner.dom.value = value;
|
|
176
|
+
}
|
|
177
|
+
setDisabled(disabled) {
|
|
178
|
+
if (disabled) {
|
|
179
|
+
this.inner.setAttrObj({ disabled: 'disabled' });
|
|
180
|
+
this.inner.setStyleObj({
|
|
181
|
+
// color: var(--el-disabled-text-color),
|
|
182
|
+
color: var_1.$textColor.disabled,
|
|
183
|
+
// -webkit-text-fill-color: var(--el-disabled-text-color),
|
|
184
|
+
'-webkit-text-fill-color': var_1.$textColor.disabled,
|
|
185
|
+
cursor: framework_1.StyleCursor.notAllowed
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this.inner.removeAttribute('disabled');
|
|
190
|
+
this.inner.setStyleObj({
|
|
191
|
+
// color: var(--el-text-color),
|
|
192
|
+
color: var_1.$textColor.regular,
|
|
193
|
+
// -webkit-text-fill-color: var(--el-text-color),
|
|
194
|
+
'-webkit-text-fill-color': var_1.$textColor.regular,
|
|
195
|
+
cursor: framework_1.StyleCursor.text
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// setFocus(isFocused: boolean) {
|
|
200
|
+
// this.isFocused = isFocused;
|
|
201
|
+
// if (isFocused) {
|
|
202
|
+
// this.setStyleObj({
|
|
203
|
+
// boxShadow: '0 0 0 1px ' + $input.focusBorderColor + ' inset',
|
|
204
|
+
// });
|
|
205
|
+
// } else {
|
|
206
|
+
// this.setStyleObj({
|
|
207
|
+
// boxShadow: '0 0 0 1px ' + $input.borderColor + ' inset',
|
|
208
|
+
// });
|
|
209
|
+
// }
|
|
210
|
+
// }
|
|
211
|
+
//
|
|
212
|
+
// setHovering(hovering: boolean) {
|
|
213
|
+
// this.hovering = hovering;
|
|
214
|
+
// if (hovering) {
|
|
215
|
+
// if (!this.isFocused) {
|
|
216
|
+
// this.setStyleObj({
|
|
217
|
+
// boxShadow: '0 0 0 1px ' + $input.hoverBorderColor + ' inset',
|
|
218
|
+
// });
|
|
219
|
+
// }
|
|
220
|
+
// } else {
|
|
221
|
+
// if (!this.isFocused) {
|
|
222
|
+
// this.setStyleObj({
|
|
223
|
+
// boxShadow: '0 0 0 1px ' + $input.borderColor + ' inset',
|
|
224
|
+
// });
|
|
225
|
+
// }
|
|
226
|
+
// }
|
|
227
|
+
// }
|
|
228
|
+
setShowClear(showClear) {
|
|
229
|
+
var _a;
|
|
230
|
+
console.log('setShowClear . showClear is ', showClear);
|
|
231
|
+
this.suffix.show(this.suffixVisible ? framework_1.StyleDisplay.inlineFlex : framework_1.StyleDisplay.none);
|
|
232
|
+
(_a = this.suffix.clearIcon) === null || _a === void 0 ? void 0 : _a.show(showClear ? framework_1.StyleDisplay.inlineFlex : framework_1.StyleDisplay.none);
|
|
233
|
+
}
|
|
234
|
+
setShowPassword(showPassword) {
|
|
235
|
+
var _a;
|
|
236
|
+
(_a = this.suffix.passwordIcon) === null || _a === void 0 ? void 0 : _a.show(showPassword ? framework_1.StyleDisplay.inlineFlex : framework_1.StyleDisplay.none);
|
|
237
|
+
}
|
|
238
|
+
setNativeInputValue() {
|
|
239
|
+
var _a;
|
|
240
|
+
console.log('setNativeInputValue . ');
|
|
241
|
+
const input = this.inner;
|
|
242
|
+
const formatterValue = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.formatter)
|
|
243
|
+
? this.config.formatter(this.nativeInputValue)
|
|
244
|
+
: this.nativeInputValue;
|
|
245
|
+
if (!input || input.value === formatterValue)
|
|
246
|
+
return;
|
|
247
|
+
input.setValue(formatterValue);
|
|
248
|
+
}
|
|
249
|
+
handleInput(event, element) {
|
|
250
|
+
var _a, _b, _c, _d;
|
|
251
|
+
console.log('input . this is ', this);
|
|
252
|
+
const [recordCursor, setCursor] = (0, framework_1.useCursor)(element === null || element === void 0 ? void 0 : element.dom);
|
|
253
|
+
recordCursor();
|
|
254
|
+
let { value } = event === null || event === void 0 ? void 0 : event.target;
|
|
255
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.formatter) {
|
|
256
|
+
value = ((_b = this.config) === null || _b === void 0 ? void 0 : _b.parser) ? this.config.parser(value) : value;
|
|
257
|
+
console.log('parser value is ', value);
|
|
258
|
+
}
|
|
259
|
+
// should not emit input during composition
|
|
260
|
+
// see: https://github.com/ElemeFE/element/issues/10516
|
|
261
|
+
if (this.isComposing)
|
|
262
|
+
return;
|
|
263
|
+
// hack for https://github.com/ElemeFE/element/issues/8548
|
|
264
|
+
// should remove the following line when we don't support IE
|
|
265
|
+
// if (value === this.nativeInputValue) {
|
|
266
|
+
// this.setNativeInputValue();
|
|
267
|
+
// return;
|
|
268
|
+
// }
|
|
269
|
+
// emit(UPDATE_MODEL_EVENT, value)
|
|
270
|
+
// emit('input', value)
|
|
271
|
+
// ensure native input value is controlled
|
|
272
|
+
// see: https://github.com/ElemeFE/element/issues/12850
|
|
273
|
+
// await nextTick()
|
|
274
|
+
this.nativeInputValue = value;
|
|
275
|
+
this.setNativeInputValue();
|
|
276
|
+
setCursor();
|
|
277
|
+
console.log('handleInput then setShowClear . ');
|
|
278
|
+
if ((_c = this.config) === null || _c === void 0 ? void 0 : _c.clearable) {
|
|
279
|
+
this.setShowClear(this.showClear);
|
|
280
|
+
}
|
|
281
|
+
if ((_d = this.config) === null || _d === void 0 ? void 0 : _d.showPassword) {
|
|
282
|
+
this.setShowPassword(this.showPwdVisible);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.TdInputWrapper = TdInputWrapper;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Span, Textarea, TypeDiv, TypeElement } from '@type-dom/framework';
|
|
2
|
+
import { ITdInputConfig } from '../td-input.interface';
|
|
3
|
+
import { TdInput } from '../td-input.class';
|
|
4
|
+
export declare class TdTextareaWrapper extends TypeDiv {
|
|
5
|
+
className: 'TextareaWrapper';
|
|
6
|
+
inner: Textarea;
|
|
7
|
+
countSpan: Span;
|
|
8
|
+
config?: ITdInputConfig;
|
|
9
|
+
parent?: TdInput;
|
|
10
|
+
private isComposing?;
|
|
11
|
+
constructor(config?: ITdInputConfig);
|
|
12
|
+
handleInput(event?: Event, element?: TypeElement): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdTextareaWrapper = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const var_1 = require("../../../../styles/var");
|
|
6
|
+
const td_input_style_1 = require("../td-input.style");
|
|
7
|
+
class TdTextareaWrapper extends framework_1.TypeDiv {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super();
|
|
10
|
+
this.className = 'TextareaWrapper';
|
|
11
|
+
this.addStyleObj({
|
|
12
|
+
position: 'relative',
|
|
13
|
+
display: 'inline-block',
|
|
14
|
+
width: '100%',
|
|
15
|
+
verticalAlign: 'bottom',
|
|
16
|
+
// font-size: getCssVar('font-size', 'base'),
|
|
17
|
+
fontSize: var_1.$fontSizes.base,
|
|
18
|
+
borderRadius: td_input_style_1.$input.borderRadius
|
|
19
|
+
});
|
|
20
|
+
this.inner = new framework_1.Textarea({
|
|
21
|
+
attrObj: {
|
|
22
|
+
type: (config === null || config === void 0 ? void 0 : config.type) || 'text'
|
|
23
|
+
},
|
|
24
|
+
styleObj: {
|
|
25
|
+
position: 'relative',
|
|
26
|
+
display: 'block',
|
|
27
|
+
resize: 'vertical',
|
|
28
|
+
// padding: 5px map.get($input-padding-horizontal, 'default')-$border-width,
|
|
29
|
+
padding: '5px ' + td_input_style_1.$inputPaddingHorizontal[(config === null || config === void 0 ? void 0 : config.size) || 'default'] + 'px',
|
|
30
|
+
lineHeight: '1.5',
|
|
31
|
+
boxSizing: 'border-box',
|
|
32
|
+
width: '100%',
|
|
33
|
+
fontSize: 'inherit',
|
|
34
|
+
fontFamily: 'inherit',
|
|
35
|
+
// color: var(
|
|
36
|
+
// #{getCssVarName('input-text-color')},
|
|
37
|
+
// map.get($input, 'text-color')
|
|
38
|
+
// );
|
|
39
|
+
color: td_input_style_1.$inputTextColor,
|
|
40
|
+
// background-color: var(
|
|
41
|
+
// #{getCssVarName('input-bg-color')},
|
|
42
|
+
// map.get($input, 'bg-color')
|
|
43
|
+
// );
|
|
44
|
+
backgroundColor: td_input_style_1.$input.bgColor,
|
|
45
|
+
backgroundImage: 'none',
|
|
46
|
+
'-webkit-appearance': 'none',
|
|
47
|
+
// @include inset-input-border(
|
|
48
|
+
// var(
|
|
49
|
+
// #{getCssVarName('input-border-color')},
|
|
50
|
+
// map.get($input, 'border-color')
|
|
51
|
+
// )
|
|
52
|
+
// )
|
|
53
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset',
|
|
54
|
+
// border-radius: getCssVarWithDefault(
|
|
55
|
+
// 'input-border-radius',
|
|
56
|
+
// map.get($input, 'border-radius')
|
|
57
|
+
// );
|
|
58
|
+
borderRadius: td_input_style_1.$input.borderRadius,
|
|
59
|
+
// transition: getCssVar('transition-box-shadow')
|
|
60
|
+
border: 'none',
|
|
61
|
+
outline: 'none' // add by me 2024-4-6
|
|
62
|
+
},
|
|
63
|
+
events: {
|
|
64
|
+
compositionstart: () => {
|
|
65
|
+
console.log('compositionstart . ');
|
|
66
|
+
this.isComposing = true;
|
|
67
|
+
},
|
|
68
|
+
compositionupdate: () => {
|
|
69
|
+
console.log('compositionupdate . ');
|
|
70
|
+
},
|
|
71
|
+
compositionend: (event) => {
|
|
72
|
+
console.log('compositionend . ');
|
|
73
|
+
this.isComposing = false;
|
|
74
|
+
if (this.isComposing) {
|
|
75
|
+
this.isComposing = false;
|
|
76
|
+
this.handleInput(event);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
input: (event, element) => this.handleInput(event, element),
|
|
80
|
+
focus: (i) => {
|
|
81
|
+
var _a;
|
|
82
|
+
console.log('td-input focus . this.parent is ', this.parent);
|
|
83
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(true);
|
|
84
|
+
},
|
|
85
|
+
blur: () => {
|
|
86
|
+
var _a;
|
|
87
|
+
console.log('blur . ');
|
|
88
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.setFocus(false);
|
|
89
|
+
},
|
|
90
|
+
change: () => {
|
|
91
|
+
console.log('change . ');
|
|
92
|
+
},
|
|
93
|
+
keydown: () => {
|
|
94
|
+
console.log('keydown . ');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
this.countSpan = new framework_1.Span({
|
|
99
|
+
styleObj: {}
|
|
100
|
+
});
|
|
101
|
+
this.addChildren(this.inner, this.countSpan);
|
|
102
|
+
// this.childNodes = [this.inner, this.countSpan];
|
|
103
|
+
this.setConfig(config);
|
|
104
|
+
}
|
|
105
|
+
// todo
|
|
106
|
+
handleInput(event, element) {
|
|
107
|
+
var _a;
|
|
108
|
+
console.log('input . this is ', this);
|
|
109
|
+
// should not emit input during composition
|
|
110
|
+
// see: https://github.com/ElemeFE/element/issues/10516
|
|
111
|
+
if (this.isComposing)
|
|
112
|
+
return;
|
|
113
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.autosize) {
|
|
114
|
+
this.inner.setStyleObj({
|
|
115
|
+
// height: 'auto',
|
|
116
|
+
height: this.inner.dom.scrollHeight + 'px'
|
|
117
|
+
});
|
|
118
|
+
// this.style.height = "auto";
|
|
119
|
+
// this.style.height = this.scrollHeight + "px"; // 自动调整高度至内容所需的最小高度
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.TdTextareaWrapper = TdTextareaWrapper;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calcTextareaHeight = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
let hiddenTextarea = undefined;
|
|
6
|
+
const HIDDEN_STYLE = `
|
|
7
|
+
height:0 !important;
|
|
8
|
+
visibility:hidden !important;
|
|
9
|
+
${utils_1.isFireFox ? '' : 'overflow:hidden !important;'}
|
|
10
|
+
position:absolute !important;
|
|
11
|
+
z-index:-1000 !important;
|
|
12
|
+
top:0 !important;
|
|
13
|
+
right:0 !important;
|
|
14
|
+
`;
|
|
15
|
+
const CONTEXT_STYLE = [
|
|
16
|
+
'letter-spacing',
|
|
17
|
+
'line-height',
|
|
18
|
+
'padding-top',
|
|
19
|
+
'padding-bottom',
|
|
20
|
+
'font-family',
|
|
21
|
+
'font-weight',
|
|
22
|
+
'font-size',
|
|
23
|
+
'text-rendering',
|
|
24
|
+
'text-transform',
|
|
25
|
+
'width',
|
|
26
|
+
'text-indent',
|
|
27
|
+
'padding-left',
|
|
28
|
+
'padding-right',
|
|
29
|
+
'border-width',
|
|
30
|
+
'box-sizing'
|
|
31
|
+
];
|
|
32
|
+
function calculateNodeStyling(targetElement) {
|
|
33
|
+
const style = window.getComputedStyle(targetElement);
|
|
34
|
+
const boxSizing = style.getPropertyValue('box-sizing');
|
|
35
|
+
const paddingSize = Number.parseFloat(style.getPropertyValue('padding-bottom')) +
|
|
36
|
+
Number.parseFloat(style.getPropertyValue('padding-top'));
|
|
37
|
+
const borderSize = Number.parseFloat(style.getPropertyValue('border-bottom-width')) +
|
|
38
|
+
Number.parseFloat(style.getPropertyValue('border-top-width'));
|
|
39
|
+
const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(';');
|
|
40
|
+
return { contextStyle, paddingSize, borderSize, boxSizing };
|
|
41
|
+
}
|
|
42
|
+
function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
|
|
43
|
+
var _a;
|
|
44
|
+
if (!hiddenTextarea) {
|
|
45
|
+
hiddenTextarea = document.createElement('textarea');
|
|
46
|
+
document.body.appendChild(hiddenTextarea);
|
|
47
|
+
}
|
|
48
|
+
const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
|
|
49
|
+
hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
|
|
50
|
+
hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
|
|
51
|
+
let height = hiddenTextarea.scrollHeight;
|
|
52
|
+
const result = {};
|
|
53
|
+
if (boxSizing === 'border-box') {
|
|
54
|
+
height = height + borderSize;
|
|
55
|
+
}
|
|
56
|
+
else if (boxSizing === 'content-box') {
|
|
57
|
+
height = height - paddingSize;
|
|
58
|
+
}
|
|
59
|
+
hiddenTextarea.value = '';
|
|
60
|
+
const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
|
|
61
|
+
if ((0, utils_1.isNumber)(minRows)) {
|
|
62
|
+
let minHeight = singleRowHeight * minRows;
|
|
63
|
+
if (boxSizing === 'border-box') {
|
|
64
|
+
minHeight = minHeight + paddingSize + borderSize;
|
|
65
|
+
}
|
|
66
|
+
height = Math.max(minHeight, height);
|
|
67
|
+
result.minHeight = `${minHeight}px`;
|
|
68
|
+
}
|
|
69
|
+
if ((0, utils_1.isNumber)(maxRows)) {
|
|
70
|
+
let maxHeight = singleRowHeight * maxRows;
|
|
71
|
+
if (boxSizing === 'border-box') {
|
|
72
|
+
maxHeight = maxHeight + paddingSize + borderSize;
|
|
73
|
+
}
|
|
74
|
+
height = Math.min(maxHeight, height);
|
|
75
|
+
}
|
|
76
|
+
result.height = `${height}px`;
|
|
77
|
+
(_a = hiddenTextarea.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(hiddenTextarea);
|
|
78
|
+
hiddenTextarea = undefined;
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
exports.calcTextareaHeight = calcTextareaHeight;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Input, Span } from '@type-dom/framework';
|
|
2
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
3
|
+
import { ITdRadio, ITdRadioConfig } from './td-radio.interface';
|
|
4
|
+
export declare class TdRadio extends UI implements ITdRadio {
|
|
5
|
+
className: 'TdRadio';
|
|
6
|
+
inputOriginal: Input;
|
|
7
|
+
inputInner: Span;
|
|
8
|
+
radioInput: Span;
|
|
9
|
+
radioLabel: Span;
|
|
10
|
+
config?: ITdRadioConfig;
|
|
11
|
+
private disabled?;
|
|
12
|
+
constructor(config?: ITdRadioConfig);
|
|
13
|
+
setConfig(config?: ITdRadioConfig): void;
|
|
14
|
+
setDisabled(disabled?: boolean): void;
|
|
15
|
+
setChecked(checked: boolean): void;
|
|
16
|
+
initEvents(): void;
|
|
17
|
+
}
|