@type-dom/ui 0.0.1 → 0.0.3
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 +12 -0
- package/src/components/basic/index.js +48 -0
- package/src/{basic → components/basic}/td-button/td-button.class.d.ts +7 -6
- 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 -20
- 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 +40 -36
- 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/components/basic/td-container/td-aside/td-aside.class.js +29 -0
- 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 +7 -6
- 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/{basic → components/basic}/td-container/td-header/td-header.class.d.ts +4 -3
- 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/components/basic/td-container/td-main/td-main.class.d.ts +6 -0
- package/src/{basic → components/basic}/td-container/td-main/td-main.class.js +7 -6
- package/src/components/basic/td-container/td-main/td-main.interface.d.ts +7 -0
- package/src/components/basic/td-icon/td-icon.class.d.ts +15 -0
- package/src/{basic → components/basic}/td-icon/td-icon.class.js +44 -13
- 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 +5 -4
- 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 +15 -19
- 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 +3 -4
- 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 +8 -8
- 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 +7 -12
- 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 +7 -9
- 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 +58 -60
- 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 +11 -11
- 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 +9 -9
- 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} +8 -9
- 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 +12 -6
- 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 +7 -8
- 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 +62 -31
- 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 -140
- package/src/basic/td-container/td-aside/td-aside.class.d.ts +0 -6
- package/src/basic/td-container/td-aside/td-aside.class.js +0 -17
- package/src/basic/td-container/td-aside/td-aside.interface.d.ts +0 -7
- package/src/basic/td-container/td-container.class.d.ts +0 -7
- package/src/basic/td-container/td-container.interface.d.ts +0 -8
- 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 -18
- package/src/basic/td-container/td-footer/td-footer.interface.d.ts +0 -7
- package/src/basic/td-container/td-header/td-header.class.js +0 -18
- package/src/basic/td-container/td-header/td-header.interface.d.ts +0 -7
- package/src/basic/td-container/td-main/td-main.class.d.ts +0 -6
- package/src/basic/td-container/td-main/td-main.interface.d.ts +0 -6
- package/src/basic/td-icon/td-icon.class.d.ts +0 -11
- package/src/basic/td-icon/td-icon.interface.d.ts +0 -11
- 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,21 @@
|
|
|
1
|
+
import { IJsonDataProp } from '@type-dom/framework';
|
|
2
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
3
|
+
import { TdInputWrapper } from './widget/td-input-wrapper.class';
|
|
4
|
+
import { TdTextareaWrapper } from './widget/td-textarea-wrapper';
|
|
5
|
+
import { ITdInput, ITdInputConfig } from './td-input.interface';
|
|
6
|
+
export declare class TdInput extends UI implements ITdInput {
|
|
7
|
+
className: 'TdInput';
|
|
8
|
+
config?: ITdInputConfig;
|
|
9
|
+
private isWordLimitVisible?;
|
|
10
|
+
hovering?: boolean;
|
|
11
|
+
isFocused?: boolean;
|
|
12
|
+
panel: TdInputWrapper | TdTextareaWrapper;
|
|
13
|
+
private placeholder?;
|
|
14
|
+
constructor(config?: ITdInputConfig);
|
|
15
|
+
setConfig(config?: ITdInputConfig): void;
|
|
16
|
+
initEvents(): void;
|
|
17
|
+
setModelValue(value: IJsonDataProp): void;
|
|
18
|
+
setHovering(hovering: boolean): void;
|
|
19
|
+
setFocus(isFocused: boolean): void;
|
|
20
|
+
created(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdInput = void 0;
|
|
4
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
|
+
const framework_1 = require("@type-dom/framework");
|
|
6
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
|
+
const var_1 = require("../../../styles/var");
|
|
8
|
+
const td_input_wrapper_class_1 = require("./widget/td-input-wrapper.class");
|
|
9
|
+
const td_input_style_1 = require("./td-input.style");
|
|
10
|
+
const td_textarea_wrapper_1 = require("./widget/td-textarea-wrapper");
|
|
11
|
+
class TdInput extends ui_abstract_1.UI {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super();
|
|
14
|
+
console.log('TdInput constructor . ');
|
|
15
|
+
this.className = 'TdInput';
|
|
16
|
+
this.addAttrName('td-input');
|
|
17
|
+
this.addStyleObj({
|
|
18
|
+
position: 'relative',
|
|
19
|
+
display: 'inline-flex',
|
|
20
|
+
width: '100%',
|
|
21
|
+
boxSizing: 'border-box',
|
|
22
|
+
verticalAlign: 'middle',
|
|
23
|
+
// fontSize: var(--el-font-size-base),
|
|
24
|
+
fontSize: var_1.$fontSizes.base,
|
|
25
|
+
// lineHeight: var(--el-input-height),
|
|
26
|
+
lineHeight: td_input_style_1.$inputHeight[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
27
|
+
userSelect: 'none',
|
|
28
|
+
});
|
|
29
|
+
console.log('config.modelValue is ', config === null || config === void 0 ? void 0 : config.modelValue);
|
|
30
|
+
if (config === null || config === void 0 ? void 0 : config.modelValue) {
|
|
31
|
+
this.modelValue = config.modelValue;
|
|
32
|
+
}
|
|
33
|
+
this.setConfig(config);
|
|
34
|
+
}
|
|
35
|
+
setConfig(config) {
|
|
36
|
+
super.setConfig(config);
|
|
37
|
+
if (config === null || config === void 0 ? void 0 : config.width) {
|
|
38
|
+
this.addWidth(config.width);
|
|
39
|
+
}
|
|
40
|
+
// todo
|
|
41
|
+
if ((config === null || config === void 0 ? void 0 : config.type) === 'textarea') {
|
|
42
|
+
config.parent = this;
|
|
43
|
+
this.panel = new td_textarea_wrapper_1.TdTextareaWrapper(config);
|
|
44
|
+
// this.textareaWrapper = new TdTextareaWrapper(config);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.panel = new td_input_wrapper_class_1.TdInputWrapper(config);
|
|
48
|
+
}
|
|
49
|
+
if (config === null || config === void 0 ? void 0 : config.placeholder) {
|
|
50
|
+
this.placeholder = config.placeholder;
|
|
51
|
+
}
|
|
52
|
+
this.panel.setParent(this);
|
|
53
|
+
this.addChild(this.panel);
|
|
54
|
+
if (!(config === null || config === void 0 ? void 0 : config.formatter) && (config === null || config === void 0 ? void 0 : config.parser)) {
|
|
55
|
+
throw new Error('If you set the parser, you also need to set the formatter');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
initEvents() {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.addEvents({
|
|
64
|
+
mouseleave: (evt) => {
|
|
65
|
+
var _a;
|
|
66
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.disabled) { // 会动态设置的。所以要在监听中判断拦截;
|
|
67
|
+
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
68
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.setHovering(false);
|
|
72
|
+
},
|
|
73
|
+
mouseenter: (evt, element) => {
|
|
74
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
75
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
76
|
+
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
77
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.setHovering(true);
|
|
81
|
+
console.log('mouseenter then showClear . ');
|
|
82
|
+
if (this.panel instanceof td_input_wrapper_class_1.TdInputWrapper) {
|
|
83
|
+
if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.clearable) {
|
|
84
|
+
console.log('this.panel?.showClear is ', (_c = this.panel) === null || _c === void 0 ? void 0 : _c.showClear);
|
|
85
|
+
(_d = this.panel) === null || _d === void 0 ? void 0 : _d.setShowClear((_e = this.panel) === null || _e === void 0 ? void 0 : _e.showClear);
|
|
86
|
+
}
|
|
87
|
+
if ((_f = this.config) === null || _f === void 0 ? void 0 : _f.showPassword) {
|
|
88
|
+
(_g = this.panel) === null || _g === void 0 ? void 0 : _g.setShowPassword((_h = this.panel) === null || _h === void 0 ? void 0 : _h.showPwdVisible);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
this.panel.inner.addEvents({
|
|
94
|
+
change: (evt, element) => {
|
|
95
|
+
console.log('td-input change', evt, element);
|
|
96
|
+
},
|
|
97
|
+
input: (evt, element) => {
|
|
98
|
+
var _a, _b, _c;
|
|
99
|
+
console.log('td-input input', evt, element);
|
|
100
|
+
if (this.modelValue instanceof framework_1.XProxy) {
|
|
101
|
+
(_a = this.modelValue) === null || _a === void 0 ? void 0 : _a.setValue((_b = element === null || element === void 0 ? void 0 : element.dom) === null || _b === void 0 ? void 0 : _b.value);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.modelValue = (_c = element === null || element === void 0 ? void 0 : element.dom) === null || _c === void 0 ? void 0 : _c.value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
if (((_b = this.config) === null || _b === void 0 ? void 0 : _b.type) === 'textarea') {
|
|
109
|
+
return; // ????
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
setModelValue(value) {
|
|
113
|
+
console.log('setModelValue . value is ', value);
|
|
114
|
+
if ((0, utils_1.isString)(value)) {
|
|
115
|
+
if ((0, utils_1.isMustache)(value)) {
|
|
116
|
+
if (this.itemData) {
|
|
117
|
+
const originalValue = (0, utils_1.mustache)(value, this.itemData);
|
|
118
|
+
this.panel.inner.setValue(originalValue);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.panel.inner.setValue(value);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.panel.inner.setValue(value);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else if (value instanceof framework_1.XProxy) {
|
|
129
|
+
this.panel.inner.setValue(value.value);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// todo
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
setHovering(hovering) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
this.hovering = hovering;
|
|
138
|
+
if (hovering) {
|
|
139
|
+
if (!this.isFocused) {
|
|
140
|
+
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.setStyleObj({
|
|
141
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.hoverBorderColor + ' inset'
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
if (!this.isFocused) {
|
|
147
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.setStyleObj({
|
|
148
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
setFocus(isFocused) {
|
|
154
|
+
var _a, _b;
|
|
155
|
+
this.isFocused = isFocused;
|
|
156
|
+
if (isFocused) {
|
|
157
|
+
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.setStyleObj({
|
|
158
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.focusBorderColor + ' inset'
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.setStyleObj({
|
|
163
|
+
boxShadow: '0 0 0 1px ' + td_input_style_1.$input.borderColor + ' inset'
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
created() {
|
|
168
|
+
var _a;
|
|
169
|
+
// 注: 绑定变量要渲染前处理,而不是创建对象时处理
|
|
170
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.modelValue) {
|
|
171
|
+
console.log('td-input created . ');
|
|
172
|
+
console.log('setModelValue ', this.config.modelValue);
|
|
173
|
+
this.setModelValue(this.config.modelValue);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.TdInput = TdInput;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { IJsonDataProp, InputEnum, IObDataProp, Span, TypeSvgSvg } from '@type-dom/framework';
|
|
2
|
+
import { ISize } from '../../../styles/size';
|
|
3
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
4
|
+
import { TdInput } from './td-input.class';
|
|
5
|
+
export interface ITdInput extends IUI {
|
|
6
|
+
className: 'TdInput';
|
|
7
|
+
}
|
|
8
|
+
export interface ITdInputConfig extends IUIConfig {
|
|
9
|
+
parent?: TdInput;
|
|
10
|
+
/**
|
|
11
|
+
* @description native input id
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description input box size
|
|
16
|
+
*/
|
|
17
|
+
size?: ISize;
|
|
18
|
+
/**
|
|
19
|
+
* @description whether to disable
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @description binding value
|
|
24
|
+
*/
|
|
25
|
+
modelValue?: IJsonDataProp;
|
|
26
|
+
/**
|
|
27
|
+
* @description same as `maxlength` in native input
|
|
28
|
+
*/
|
|
29
|
+
maxlength?: string | number;
|
|
30
|
+
/**
|
|
31
|
+
* @description same as `minlength` in native input
|
|
32
|
+
*/
|
|
33
|
+
minlength?: string | number;
|
|
34
|
+
/**
|
|
35
|
+
* @description type of input
|
|
36
|
+
* default text
|
|
37
|
+
*/
|
|
38
|
+
type?: keyof typeof InputEnum | 'textarea';
|
|
39
|
+
/**
|
|
40
|
+
* @description control the resizability
|
|
41
|
+
*/
|
|
42
|
+
resize?: 'none' | 'both' | 'horizontal' | 'vertical';
|
|
43
|
+
/**
|
|
44
|
+
* @description whether textarea has an adaptive height
|
|
45
|
+
* default: false,
|
|
46
|
+
*/
|
|
47
|
+
autosize?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @description native input autocomplete
|
|
50
|
+
* default: 'off',
|
|
51
|
+
*/
|
|
52
|
+
autocomplete?: string;
|
|
53
|
+
/**
|
|
54
|
+
* @description format content
|
|
55
|
+
*/
|
|
56
|
+
formatter?: (value: string) => string;
|
|
57
|
+
/**
|
|
58
|
+
* @description parse content
|
|
59
|
+
*/
|
|
60
|
+
parser?: (value: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* @description placeholder
|
|
63
|
+
*/
|
|
64
|
+
placeholder?: IObDataProp;
|
|
65
|
+
/**
|
|
66
|
+
* @description native input form
|
|
67
|
+
*/
|
|
68
|
+
form?: string;
|
|
69
|
+
/**
|
|
70
|
+
* @description native input readonly
|
|
71
|
+
* default: false,
|
|
72
|
+
*/
|
|
73
|
+
readonly?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @description native input readonly
|
|
76
|
+
* default: false,
|
|
77
|
+
*/
|
|
78
|
+
clearable?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* @description toggleable password input
|
|
81
|
+
* default: false,
|
|
82
|
+
*/
|
|
83
|
+
showPassword?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @description word count
|
|
86
|
+
* default: false,
|
|
87
|
+
*/
|
|
88
|
+
showWordLimit?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* @description suffix icon
|
|
91
|
+
*/
|
|
92
|
+
suffixIcon?: TypeSvgSvg;
|
|
93
|
+
/**
|
|
94
|
+
* @description prefix icon
|
|
95
|
+
*/
|
|
96
|
+
prefixIcon?: TypeSvgSvg;
|
|
97
|
+
/**
|
|
98
|
+
* @description container role, internal properties provided for use by the picker component
|
|
99
|
+
* default: undefined,
|
|
100
|
+
*/
|
|
101
|
+
containerRole?: string;
|
|
102
|
+
/**
|
|
103
|
+
* @description native input aria-label
|
|
104
|
+
* default: undefined,
|
|
105
|
+
*/
|
|
106
|
+
label?: string;
|
|
107
|
+
/**
|
|
108
|
+
* @description input tabindex
|
|
109
|
+
* default: 0,
|
|
110
|
+
*/
|
|
111
|
+
tabindex?: string | number;
|
|
112
|
+
/**
|
|
113
|
+
* @description whether to trigger form validation
|
|
114
|
+
* default: true,
|
|
115
|
+
*/
|
|
116
|
+
validateEvent?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* @description input or textarea element style
|
|
119
|
+
*/
|
|
120
|
+
/**
|
|
121
|
+
* @description native input autofocus
|
|
122
|
+
* default: false,
|
|
123
|
+
*/
|
|
124
|
+
autofocus?: boolean;
|
|
125
|
+
prepend?: boolean;
|
|
126
|
+
append?: boolean;
|
|
127
|
+
prefix?: Span;
|
|
128
|
+
suffixVisible?: boolean;
|
|
129
|
+
passwordVisible?: boolean;
|
|
130
|
+
width?: number;
|
|
131
|
+
suffix?: Span;
|
|
132
|
+
}
|
|
133
|
+
export type TargetElement = HTMLInputElement | HTMLTextAreaElement;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const $input: {
|
|
2
|
+
textColor: string;
|
|
3
|
+
hoverBorder: string;
|
|
4
|
+
focusBorder: string;
|
|
5
|
+
transparentBorder: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
borderRadius: string;
|
|
8
|
+
bgColor: string;
|
|
9
|
+
iconColor: string;
|
|
10
|
+
placeholderColor: string;
|
|
11
|
+
hoverBorderColor: string;
|
|
12
|
+
clearHoverColor: string;
|
|
13
|
+
focusBorderColor: string;
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const $inputDisabled: {
|
|
17
|
+
fill: string;
|
|
18
|
+
border: string;
|
|
19
|
+
textColor: string;
|
|
20
|
+
placeholderColor: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const $inputFontSize: {
|
|
23
|
+
large: string;
|
|
24
|
+
default: string;
|
|
25
|
+
small: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const $inputHeight: {
|
|
28
|
+
large: string;
|
|
29
|
+
default: string;
|
|
30
|
+
small: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const $inputLineHeight: {
|
|
33
|
+
large: string;
|
|
34
|
+
default: string;
|
|
35
|
+
small: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const $inputNumberWidth: {
|
|
38
|
+
large: string;
|
|
39
|
+
default: string;
|
|
40
|
+
small: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const $inputPaddingHorizontal: {
|
|
43
|
+
large: string;
|
|
44
|
+
default: string;
|
|
45
|
+
small: string;
|
|
46
|
+
};
|
|
47
|
+
export declare const $wrapperPadding: {
|
|
48
|
+
large: string;
|
|
49
|
+
default: string;
|
|
50
|
+
small: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const $inputTextColor: string;
|
|
53
|
+
export declare const $inputInnerHeight: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.$inputInnerHeight = exports.$inputTextColor = exports.$wrapperPadding = exports.$inputPaddingHorizontal = exports.$inputNumberWidth = exports.$inputLineHeight = exports.$inputHeight = exports.$inputFontSize = exports.$inputDisabled = exports.$input = void 0;
|
|
4
|
+
const var_1 = require("../../../styles/var");
|
|
5
|
+
// Input
|
|
6
|
+
// css3 var in packages/theme-chalk/src/input.scss
|
|
7
|
+
exports.$input = {
|
|
8
|
+
textColor: var_1.$textColor.regular,
|
|
9
|
+
// 'border': $border, // getCssVar('border'),
|
|
10
|
+
hoverBorder: var_1.$borderColorHover, // getCssVar('border-color-hover'),
|
|
11
|
+
focusBorder: var_1.$colors.primary.base, // getCssVar('color-primary'),
|
|
12
|
+
transparentBorder: '0 0 0 1px transparent inset',
|
|
13
|
+
borderColor: var_1.$borderColor.base, // getCssVar('border-color'),
|
|
14
|
+
borderRadius: var_1.$borderRadius.base, // getCssVar('border-radius-base'),
|
|
15
|
+
bgColor: var_1.$fillColor.blank, // getCssVar('fill-color', 'blank'),
|
|
16
|
+
iconColor: var_1.$textColor.placeholder, // getCssVar('text-color-placeholder'),
|
|
17
|
+
placeholderColor: var_1.$textColor.placeholder, // getCssVar('text-color-placeholder'),
|
|
18
|
+
hoverBorderColor: var_1.$borderColorHover, // getCssVar('border-color-hover'),
|
|
19
|
+
clearHoverColor: var_1.$textColor.secondary, // getCssVar('text-color-secondary'),
|
|
20
|
+
focusBorderColor: var_1.$colors.primary.base, // getCssVar('color-primary'),
|
|
21
|
+
width: '100%'
|
|
22
|
+
};
|
|
23
|
+
exports.$inputDisabled = {
|
|
24
|
+
fill: var_1.$disabled.bgColor,
|
|
25
|
+
border: var_1.$disabled.borderColor,
|
|
26
|
+
textColor: var_1.$disabled.textColor,
|
|
27
|
+
placeholderColor: var_1.$textColor.placeholder
|
|
28
|
+
};
|
|
29
|
+
exports.$inputFontSize = {
|
|
30
|
+
large: '14px',
|
|
31
|
+
default: '14px',
|
|
32
|
+
small: '12px'
|
|
33
|
+
};
|
|
34
|
+
exports.$inputHeight = var_1.$commonComponentSize;
|
|
35
|
+
exports.$inputLineHeight = var_1.$commonComponentSize;
|
|
36
|
+
exports.$inputNumberWidth = {
|
|
37
|
+
large: '180px',
|
|
38
|
+
default: '150px',
|
|
39
|
+
small: '120px'
|
|
40
|
+
};
|
|
41
|
+
exports.$inputPaddingHorizontal = {
|
|
42
|
+
large: '16px',
|
|
43
|
+
default: '12px',
|
|
44
|
+
small: '8px'
|
|
45
|
+
};
|
|
46
|
+
exports.$wrapperPadding = {
|
|
47
|
+
large: var_1.$borderWidth +
|
|
48
|
+
' ' +
|
|
49
|
+
(parseFloat(exports.$inputPaddingHorizontal.large.slice(0, -2)) -
|
|
50
|
+
parseFloat(var_1.$borderWidth.slice(0, -2))) +
|
|
51
|
+
'px',
|
|
52
|
+
default: var_1.$borderWidth +
|
|
53
|
+
' ' +
|
|
54
|
+
(parseFloat(exports.$inputPaddingHorizontal.default.slice(0, -2)) -
|
|
55
|
+
parseFloat(var_1.$borderWidth.slice(0, -2))) +
|
|
56
|
+
'px',
|
|
57
|
+
small: var_1.$borderWidth +
|
|
58
|
+
' ' +
|
|
59
|
+
(parseFloat(exports.$inputPaddingHorizontal.small.slice(0, -2)) -
|
|
60
|
+
parseFloat(var_1.$borderWidth.slice(0, -2))) +
|
|
61
|
+
'px'
|
|
62
|
+
};
|
|
63
|
+
exports.$inputTextColor = var_1.$textColor.primary;
|
|
64
|
+
exports.$inputInnerHeight = parseFloat(var_1.$commonComponentSize.default.slice(0, -2)) -
|
|
65
|
+
parseFloat(var_1.$borderWidth.slice(0, -2)) * 2 +
|
|
66
|
+
'px';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TypeSpan } from '@type-dom/framework';
|
|
2
|
+
import { ITdInputConfig } from '../td-input.interface';
|
|
3
|
+
import { TdInputWrapper } from './td-input-wrapper.class';
|
|
4
|
+
export declare class TdInputPrefix extends TypeSpan {
|
|
5
|
+
className: 'TdInputPrefix';
|
|
6
|
+
parent: TdInputWrapper;
|
|
7
|
+
private prefixInner;
|
|
8
|
+
private prefixIcon?;
|
|
9
|
+
constructor(parent: TdInputWrapper, config?: ITdInputConfig);
|
|
10
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdInputPrefix = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
6
|
+
const td_input_style_1 = require("../td-input.style");
|
|
7
|
+
class TdInputPrefix extends framework_1.TypeSpan {
|
|
8
|
+
constructor(parent, config) {
|
|
9
|
+
super();
|
|
10
|
+
this.parent = parent;
|
|
11
|
+
this.className = 'TdInputPrefix';
|
|
12
|
+
this.addStyleObj({
|
|
13
|
+
display: (config === null || config === void 0 ? void 0 : config.prefixIcon) ? 'inline-flex' : 'none',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
flexShrink: 0,
|
|
16
|
+
flexWrap: 'nowrap',
|
|
17
|
+
height: '100%',
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
// color: var,
|
|
20
|
+
// #{getCssVarName('input-icon-color')},
|
|
21
|
+
// map.get($input, 'icon-color',
|
|
22
|
+
// ),
|
|
23
|
+
color: td_input_style_1.$input.iconColor,
|
|
24
|
+
// transition: all getCssVar('transition-duration'),
|
|
25
|
+
transition: 'all 0.3s',
|
|
26
|
+
pointerEvents: 'none'
|
|
27
|
+
});
|
|
28
|
+
this.prefixInner = new framework_1.Span({
|
|
29
|
+
attrObj: {
|
|
30
|
+
name: 'prefix-inner'
|
|
31
|
+
},
|
|
32
|
+
styleObj: {
|
|
33
|
+
pointerEvents: 'all',
|
|
34
|
+
display: 'inline-flex',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
marginRight: '8px'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
this.addChild(this.prefixInner);
|
|
41
|
+
if (config === null || config === void 0 ? void 0 : config.prefixIcon) {
|
|
42
|
+
this.prefixIcon = new td_icon_class_1.TdIcon({
|
|
43
|
+
svgObj: config.prefixIcon,
|
|
44
|
+
attrObj: {
|
|
45
|
+
name: 'prefix-icon'
|
|
46
|
+
},
|
|
47
|
+
styleObj: {
|
|
48
|
+
display: 'inline-flex',
|
|
49
|
+
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default']
|
|
50
|
+
// cursor: StyleCursor.pointer,
|
|
51
|
+
},
|
|
52
|
+
events: {
|
|
53
|
+
click: (evt, icon) => {
|
|
54
|
+
console.log('prefixIcon click . ');
|
|
55
|
+
this.parent.inner.focus();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
this.prefixInner.addChild(this.prefixIcon);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.TdInputPrefix = TdInputPrefix;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypeSpan } from '@type-dom/framework';
|
|
2
|
+
import { ITdInputConfig } from '../td-input.interface';
|
|
3
|
+
import { TdIcon } from '@type-dom/ui';
|
|
4
|
+
import { TdInputWrapper } from './td-input-wrapper.class';
|
|
5
|
+
export declare class TdInputSuffix extends TypeSpan {
|
|
6
|
+
className: 'TdInputSuffix';
|
|
7
|
+
parent: TdInputWrapper;
|
|
8
|
+
private suffixInner;
|
|
9
|
+
private suffixIcon?;
|
|
10
|
+
clearIcon?: TdIcon;
|
|
11
|
+
passwordIcon?: TdIcon;
|
|
12
|
+
constructor(parent: TdInputWrapper, config?: ITdInputConfig);
|
|
13
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdInputSuffix = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const ui_1 = require("@type-dom/ui");
|
|
6
|
+
const svgs_1 = require("@type-dom/svgs");
|
|
7
|
+
const td_input_style_1 = require("../td-input.style");
|
|
8
|
+
class TdInputSuffix extends framework_1.TypeSpan {
|
|
9
|
+
constructor(parent, config) {
|
|
10
|
+
super();
|
|
11
|
+
this.parent = parent;
|
|
12
|
+
this.className = 'TdInputSuffix';
|
|
13
|
+
this.addStyleObj({
|
|
14
|
+
display: this.parent.suffixVisible ? 'inline-flex' : 'none',
|
|
15
|
+
whiteSpace: 'nowrap',
|
|
16
|
+
flexShrink: 0,
|
|
17
|
+
flexWrap: 'nowrap',
|
|
18
|
+
height: '100%',
|
|
19
|
+
textAlign: 'center',
|
|
20
|
+
// color: var,
|
|
21
|
+
// #{getCssVarName('input-icon-color')},
|
|
22
|
+
// map.get($input, 'icon-color',
|
|
23
|
+
// ),
|
|
24
|
+
color: td_input_style_1.$input.iconColor,
|
|
25
|
+
// transition: all getCssVar('transition-duration'),
|
|
26
|
+
transition: 'all 0.3s',
|
|
27
|
+
pointerEvents: 'none'
|
|
28
|
+
});
|
|
29
|
+
this.suffixInner = new framework_1.Span({
|
|
30
|
+
attrObj: {
|
|
31
|
+
name: 'suffix-inner'
|
|
32
|
+
},
|
|
33
|
+
styleObj: {
|
|
34
|
+
pointerEvents: 'all',
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
marginLeft: '8px'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
this.addChild(this.suffixInner);
|
|
42
|
+
if (config === null || config === void 0 ? void 0 : config.clearable) {
|
|
43
|
+
this.clearIcon = new ui_1.TdIcon({
|
|
44
|
+
svgObj: new svgs_1.ElCircleCloseSvg(),
|
|
45
|
+
attrObj: {
|
|
46
|
+
name: 'suffix-icon'
|
|
47
|
+
},
|
|
48
|
+
styleObj: {
|
|
49
|
+
display: 'none',
|
|
50
|
+
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
51
|
+
cursor: framework_1.StyleCursor.pointer
|
|
52
|
+
},
|
|
53
|
+
events: {
|
|
54
|
+
click: (evt, icon) => {
|
|
55
|
+
console.log('click icon is ', icon);
|
|
56
|
+
this.parent.inner.setValue('');
|
|
57
|
+
this.parent.setShowClear(false);
|
|
58
|
+
this.parent.inner.focus();
|
|
59
|
+
},
|
|
60
|
+
mousedown: (evt, icon) => {
|
|
61
|
+
console.log('mousedown, icon is ', icon);
|
|
62
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.suffixInner.addChild(this.clearIcon);
|
|
67
|
+
}
|
|
68
|
+
if (config === null || config === void 0 ? void 0 : config.showPassword) {
|
|
69
|
+
this.passwordIcon = new ui_1.TdIcon({
|
|
70
|
+
svgObj: new svgs_1.ElHideSvg(),
|
|
71
|
+
styleObj: {
|
|
72
|
+
display: this.parent.showPwdVisible ? 'inline-flex' : 'none',
|
|
73
|
+
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default'],
|
|
74
|
+
cursor: framework_1.StyleCursor.pointer
|
|
75
|
+
},
|
|
76
|
+
events: {
|
|
77
|
+
click: () => {
|
|
78
|
+
var _a;
|
|
79
|
+
console.log('click showPassword ');
|
|
80
|
+
this.parent.passwordVisible = !this.parent.passwordVisible;
|
|
81
|
+
(_a = this.passwordIcon) === null || _a === void 0 ? void 0 : _a.replaceSvg(this.parent.passwordVisible ? new svgs_1.ElViewSvg() : new svgs_1.ElHideSvg());
|
|
82
|
+
if (this.parent.passwordVisible) {
|
|
83
|
+
this.parent.inner.setAttrObj({
|
|
84
|
+
type: 'text'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.parent.inner.setAttrObj({
|
|
89
|
+
type: 'password'
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
this.parent.inner.focus();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
this.suffixInner.addChild(this.passwordIcon);
|
|
97
|
+
}
|
|
98
|
+
if (config === null || config === void 0 ? void 0 : config.suffixIcon) {
|
|
99
|
+
this.suffixIcon = new ui_1.TdIcon({
|
|
100
|
+
svgObj: config.suffixIcon,
|
|
101
|
+
attrObj: {
|
|
102
|
+
name: 'suffix-icon'
|
|
103
|
+
},
|
|
104
|
+
styleObj: {
|
|
105
|
+
display: 'inline-flex',
|
|
106
|
+
fontSize: td_input_style_1.$inputFontSize[(config === null || config === void 0 ? void 0 : config.size) || 'default']
|
|
107
|
+
// cursor: StyleCursor.pointer,
|
|
108
|
+
},
|
|
109
|
+
events: {
|
|
110
|
+
click: (evt, icon) => {
|
|
111
|
+
console.log('suffixIcon click . ');
|
|
112
|
+
this.parent.inner.focus();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
this.suffixInner.addChild(this.suffixIcon);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.TdInputSuffix = TdInputSuffix;
|