@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,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdRadio = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
|
+
const var_1 = require("../../../styles/var");
|
|
7
|
+
const td_radio_group_class_1 = require("../td-radio-group/td-radio-group.class");
|
|
8
|
+
class TdRadio extends ui_abstract_1.UI {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super({ tag: 'label' });
|
|
11
|
+
this.className = 'TdRadio';
|
|
12
|
+
this.addStyleObj({
|
|
13
|
+
color: var_1.$textColor.regular,
|
|
14
|
+
fontWeight: var_1.$fontWeightPrimary,
|
|
15
|
+
position: 'relative',
|
|
16
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
whiteSpace: 'nowrap',
|
|
20
|
+
outline: 'none',
|
|
21
|
+
fontSize: var_1.$fontSizes.base,
|
|
22
|
+
userSelect: 'none',
|
|
23
|
+
marginRight: '32px',
|
|
24
|
+
height: var_1.$commonComponentSize.default
|
|
25
|
+
});
|
|
26
|
+
this.inputOriginal = new framework_1.Input({
|
|
27
|
+
attrObj: {
|
|
28
|
+
type: 'radio',
|
|
29
|
+
name: 'radio-name',
|
|
30
|
+
value: 'radio-value'
|
|
31
|
+
},
|
|
32
|
+
styleObj: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
outline: 'none',
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
zIndex: -1,
|
|
37
|
+
top: '0',
|
|
38
|
+
left: '0',
|
|
39
|
+
right: '0',
|
|
40
|
+
bottom: '0',
|
|
41
|
+
margin: '0'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.inputInner = new framework_1.Span({
|
|
45
|
+
styleObj: {
|
|
46
|
+
// radio-inner 样式
|
|
47
|
+
position: 'relative',
|
|
48
|
+
borderWidth: '1px',
|
|
49
|
+
// borderWidth: '5px',
|
|
50
|
+
borderStyle: 'solid',
|
|
51
|
+
borderColor: var_1.$borderColor.base,
|
|
52
|
+
// borderColor: $colors.primary.base,
|
|
53
|
+
borderRadius: '100%',
|
|
54
|
+
// width: var(--el-radio-input-width),
|
|
55
|
+
width: '14px',
|
|
56
|
+
// height: var(--el-radio-input-height),
|
|
57
|
+
height: '14px',
|
|
58
|
+
// background-color: var(--el-radio-input-bg-color),
|
|
59
|
+
backgroundColor: '#ffffff',
|
|
60
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
61
|
+
display: 'inline-block',
|
|
62
|
+
boxSizing: 'border-box',
|
|
63
|
+
transition: 'transform .15s ease-in'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this.radioInput = new framework_1.Span({
|
|
67
|
+
styleObj: {
|
|
68
|
+
whiteSpace: 'nowrap',
|
|
69
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
70
|
+
outline: 'none',
|
|
71
|
+
display: 'inline-flex',
|
|
72
|
+
position: 'relative',
|
|
73
|
+
verticalAlign: 'middle'
|
|
74
|
+
},
|
|
75
|
+
childNodes: [this.inputOriginal, this.inputInner]
|
|
76
|
+
});
|
|
77
|
+
this.radioLabel = new framework_1.Span({
|
|
78
|
+
name: 'radio-label',
|
|
79
|
+
text: (config === null || config === void 0 ? void 0 : config.label) || 'option',
|
|
80
|
+
styleObj: {
|
|
81
|
+
// 下面这些是变量,要动态复制的。
|
|
82
|
+
// font-size: var(--el-radio-font-size),
|
|
83
|
+
color: var_1.$colors.default.base,
|
|
84
|
+
fontSize: var_1.$fontSizes[(config === null || config === void 0 ? void 0 : config.size) || 'base'],
|
|
85
|
+
paddingLeft: '8px'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.addChildren(this.radioInput, this.radioLabel);
|
|
89
|
+
this.setConfig(config);
|
|
90
|
+
}
|
|
91
|
+
setConfig(config) {
|
|
92
|
+
var _a;
|
|
93
|
+
super.setConfig(config);
|
|
94
|
+
if (config === null || config === void 0 ? void 0 : config.name) {
|
|
95
|
+
console.log('setConfig config?.name', config === null || config === void 0 ? void 0 : config.name);
|
|
96
|
+
this.inputOriginal.addAttrName(config.name);
|
|
97
|
+
}
|
|
98
|
+
if (config === null || config === void 0 ? void 0 : config.value) {
|
|
99
|
+
this.inputOriginal.addAttrObj({ value: config.value });
|
|
100
|
+
}
|
|
101
|
+
if (config === null || config === void 0 ? void 0 : config.checked) {
|
|
102
|
+
this.inputOriginal.addAttrObj({ checked: config.checked || false });
|
|
103
|
+
}
|
|
104
|
+
if (config === null || config === void 0 ? void 0 : config.label) {
|
|
105
|
+
(_a = this.radioLabel.textNode) === null || _a === void 0 ? void 0 : _a.setText(config.label);
|
|
106
|
+
}
|
|
107
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
108
|
+
this.inputOriginal.addAttrObj({ disabled: config.disabled });
|
|
109
|
+
// todo 样式
|
|
110
|
+
}
|
|
111
|
+
if (config === null || config === void 0 ? void 0 : config.size) {
|
|
112
|
+
this.addStyleObj({
|
|
113
|
+
height: var_1.$commonComponentSize[config.size],
|
|
114
|
+
fontSize: var_1.$fontSizes[config.size]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (config === null || config === void 0 ? void 0 : config.border) {
|
|
118
|
+
this.addStyleObj({
|
|
119
|
+
borderWidth: var_1.$borderWidth,
|
|
120
|
+
borderStyle: var_1.$borderStyle,
|
|
121
|
+
borderColor: var_1.$borderColor.base,
|
|
122
|
+
borderRadius: var_1.$borderRadius.base,
|
|
123
|
+
padding: '0 19px 0 11px'
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (config === null || config === void 0 ? void 0 : config.checked) {
|
|
127
|
+
this.setChecked(config === null || config === void 0 ? void 0 : config.checked);
|
|
128
|
+
}
|
|
129
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
130
|
+
this.setDisabled(config === null || config === void 0 ? void 0 : config.disabled);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
setDisabled(disabled) {
|
|
134
|
+
this.disabled = disabled;
|
|
135
|
+
if (disabled) {
|
|
136
|
+
this.setStyleObj({
|
|
137
|
+
cursor: framework_1.StyleCursor.notAllowed,
|
|
138
|
+
opacity: 0.5
|
|
139
|
+
// 禁用事件
|
|
140
|
+
// pointerEvents: 'none',
|
|
141
|
+
});
|
|
142
|
+
this.radioLabel.setStyleObj({
|
|
143
|
+
color: var_1.$colors.default.base
|
|
144
|
+
});
|
|
145
|
+
this.inputOriginal.setAttrObj({ disabled: true });
|
|
146
|
+
this.inputInner.setStyleObj({
|
|
147
|
+
cursor: framework_1.StyleCursor.notAllowed,
|
|
148
|
+
// color: $colors.default.base,
|
|
149
|
+
// borderWidth: '1px',
|
|
150
|
+
// borderStyle: 'solid',
|
|
151
|
+
borderColor: var_1.$textColor.placeholder // $borderColors.base,
|
|
152
|
+
// backgroundColor: $textColors.placeholder,
|
|
153
|
+
// transform: 'translate(-50%, -50%) scale(1)'
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.setStyleObj({
|
|
158
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
159
|
+
opacity: 1,
|
|
160
|
+
pointerEvents: 'auto'
|
|
161
|
+
});
|
|
162
|
+
this.inputOriginal.removeAttribute('disabled');
|
|
163
|
+
this.inputInner.setStyleObj({
|
|
164
|
+
cursor: framework_1.StyleCursor.auto
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
setChecked(checked) {
|
|
169
|
+
if (checked) {
|
|
170
|
+
this.setStyleObj({
|
|
171
|
+
borderColor: var_1.$colors.primary.base
|
|
172
|
+
});
|
|
173
|
+
this.inputOriginal.setAttrObj({
|
|
174
|
+
checked: true
|
|
175
|
+
});
|
|
176
|
+
// 设置选中样式
|
|
177
|
+
this.radioLabel.setStyleObj({
|
|
178
|
+
color: var_1.$colors.primary.base
|
|
179
|
+
});
|
|
180
|
+
this.inputInner.setStyleObj({
|
|
181
|
+
color: var_1.$colors.primary.base,
|
|
182
|
+
borderWidth: '5px',
|
|
183
|
+
borderStyle: 'solid',
|
|
184
|
+
borderColor: var_1.$colors.primary.base
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
// 设置非选中样式
|
|
189
|
+
this.setStyleObj({
|
|
190
|
+
borderColor: var_1.$borderColor.base
|
|
191
|
+
});
|
|
192
|
+
this.inputOriginal.removeAttribute('checked');
|
|
193
|
+
this.radioLabel.setStyleObj({
|
|
194
|
+
color: var_1.$colors.default.base
|
|
195
|
+
});
|
|
196
|
+
this.inputInner.setStyleObj({
|
|
197
|
+
color: var_1.$colors.default.base,
|
|
198
|
+
borderWidth: '1px',
|
|
199
|
+
borderStyle: 'solid',
|
|
200
|
+
borderColor: var_1.$borderColor.base
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
initEvents() {
|
|
205
|
+
// 点击事件 todo 会触发两次,先不管。
|
|
206
|
+
this.addEvents({
|
|
207
|
+
click: (evt) => {
|
|
208
|
+
var _a;
|
|
209
|
+
console.log('this.subscriptions is ', this.subscriptions);
|
|
210
|
+
console.log('this.inputOriginal.dom click . ');
|
|
211
|
+
console.log('this.inputOriginal.dom.value is ', this.inputOriginal.dom.value);
|
|
212
|
+
if (this.disabled) {
|
|
213
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
// this.inputOriginal.dom.click();
|
|
217
|
+
if (this.parent instanceof td_radio_group_class_1.TdRadioGroup) {
|
|
218
|
+
this.parent.setModelValue(this.inputOriginal.value); // 触发父级的事件,重置整个组。
|
|
219
|
+
}
|
|
220
|
+
this.setChecked(true);
|
|
221
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.childNodes.forEach((node) => {
|
|
222
|
+
if (node instanceof TdRadio &&
|
|
223
|
+
node.inputOriginal.attrObj.name === this.inputOriginal.attrObj.name &&
|
|
224
|
+
node !== this) {
|
|
225
|
+
node.setChecked(false);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
exports.TdRadio = TdRadio;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ISize } from '../../../styles/size';
|
|
2
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
3
|
+
export interface ITdRadio extends IUI {
|
|
4
|
+
className: 'TdRadio';
|
|
5
|
+
}
|
|
6
|
+
export interface ITdRadioConfig extends IUIConfig {
|
|
7
|
+
/**
|
|
8
|
+
* @description binding value
|
|
9
|
+
*/
|
|
10
|
+
modelValue?: string | number | boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @description size of the Radio
|
|
13
|
+
*/
|
|
14
|
+
size?: ISize;
|
|
15
|
+
/**
|
|
16
|
+
* @description whether Radio is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description the label of Radio
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description the value of Radio
|
|
25
|
+
*/
|
|
26
|
+
value?: string | number | boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description native `name` attribute
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description whether to add a border around Radio
|
|
33
|
+
*/
|
|
34
|
+
border?: boolean;
|
|
35
|
+
checked?: boolean;
|
|
36
|
+
isFirst?: boolean;
|
|
37
|
+
isLast?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Input, Span } from '@type-dom/framework';
|
|
2
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
3
|
+
import { ITdRadioButton, ITdRadioButtonConfig } from './td-radio-button.interface';
|
|
4
|
+
export declare class TdRadioButton extends UI implements ITdRadioButton {
|
|
5
|
+
className: 'TdRadioButton';
|
|
6
|
+
inputOriginal: Input;
|
|
7
|
+
radioLabel: Span;
|
|
8
|
+
config?: ITdRadioButtonConfig;
|
|
9
|
+
private disabled?;
|
|
10
|
+
constructor(config?: ITdRadioButtonConfig);
|
|
11
|
+
setConfig(config?: ITdRadioButtonConfig): void;
|
|
12
|
+
setDisabled(disabled?: boolean): void;
|
|
13
|
+
setChecked(checked: boolean): void;
|
|
14
|
+
initEvents(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdRadioButton = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const var_1 = require("../../../styles/var");
|
|
6
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
|
+
const td_radio_group_class_1 = require("../td-radio-group/td-radio-group.class");
|
|
8
|
+
class TdRadioButton extends ui_abstract_1.UI {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super({ tag: 'label' });
|
|
11
|
+
this.className = 'TdRadioButton';
|
|
12
|
+
this.addAttrName('radio-button');
|
|
13
|
+
this.addStyleObj({
|
|
14
|
+
position: 'relative',
|
|
15
|
+
display: 'inline-block',
|
|
16
|
+
outline: 'none'
|
|
17
|
+
});
|
|
18
|
+
this.inputOriginal = new framework_1.Input({
|
|
19
|
+
attrObj: {
|
|
20
|
+
type: 'radio',
|
|
21
|
+
name: 'radio-button-name',
|
|
22
|
+
value: 'radio-value'
|
|
23
|
+
},
|
|
24
|
+
styleObj: {
|
|
25
|
+
opacity: 0,
|
|
26
|
+
outline: 'none',
|
|
27
|
+
margin: '0',
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
zIndex: -1
|
|
30
|
+
// top: '0',
|
|
31
|
+
// left: '0',
|
|
32
|
+
// right: '0',
|
|
33
|
+
// bottom: '0',
|
|
34
|
+
// margin: '0',
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
this.radioLabel = new framework_1.Span({
|
|
38
|
+
name: 'radio-label',
|
|
39
|
+
text: (config === null || config === void 0 ? void 0 : config.label) || 'option',
|
|
40
|
+
styleObj: {
|
|
41
|
+
display: 'inline-block',
|
|
42
|
+
lineHeight: '1',
|
|
43
|
+
whiteSpace: 'nowrap',
|
|
44
|
+
verticalAlign: 'middle',
|
|
45
|
+
// borderLeft: '0',
|
|
46
|
+
'-webkit-appearance': 'none',
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
boxSizing: 'border-box',
|
|
49
|
+
outline: 'none',
|
|
50
|
+
margin: '0',
|
|
51
|
+
position: 'relative',
|
|
52
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
53
|
+
userSelect: 'none',
|
|
54
|
+
// 下面是会变化的样式;
|
|
55
|
+
color: var_1.$textColor.regular,
|
|
56
|
+
background: var_1.$fillColor.blank,
|
|
57
|
+
borderWidth: var_1.$borderWidth,
|
|
58
|
+
borderStyle: var_1.$borderStyle,
|
|
59
|
+
borderColor: var_1.$borderColor.base,
|
|
60
|
+
fontWeight: var_1.$fontWeightPrimary,
|
|
61
|
+
// color: $buttonTextColor.default,
|
|
62
|
+
// transition: getCssVar('transition-all'),
|
|
63
|
+
fontSize: var_1.$fontSizes.base,
|
|
64
|
+
padding: var_1.$paddingVerticalMap.default + ' ' + var_1.$paddingHorizontalMap.default
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
this.addChildren(this.inputOriginal, this.radioLabel);
|
|
68
|
+
this.setConfig(config);
|
|
69
|
+
}
|
|
70
|
+
setConfig(config) {
|
|
71
|
+
var _a;
|
|
72
|
+
super.setConfig(config);
|
|
73
|
+
if (config === null || config === void 0 ? void 0 : config.name) {
|
|
74
|
+
console.log('setConfig config?.name', config === null || config === void 0 ? void 0 : config.name);
|
|
75
|
+
this.inputOriginal.addAttrName(config.name);
|
|
76
|
+
}
|
|
77
|
+
if (config === null || config === void 0 ? void 0 : config.value) {
|
|
78
|
+
this.inputOriginal.addAttrObj({ value: config.value });
|
|
79
|
+
}
|
|
80
|
+
if (config === null || config === void 0 ? void 0 : config.checked) {
|
|
81
|
+
this.inputOriginal.addAttrObj({ checked: config.checked || false });
|
|
82
|
+
}
|
|
83
|
+
if (config === null || config === void 0 ? void 0 : config.label) {
|
|
84
|
+
(_a = this.radioLabel.textNode) === null || _a === void 0 ? void 0 : _a.setText(config.label);
|
|
85
|
+
}
|
|
86
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
87
|
+
this.inputOriginal.addAttrObj({ disabled: config.disabled });
|
|
88
|
+
// todo 样式
|
|
89
|
+
}
|
|
90
|
+
// size 默认值是 default
|
|
91
|
+
const size = (config === null || config === void 0 ? void 0 : config.size) || 'default';
|
|
92
|
+
this.addStyleObj({
|
|
93
|
+
height: var_1.$commonComponentSize[size]
|
|
94
|
+
});
|
|
95
|
+
this.radioLabel.addStyleObj({
|
|
96
|
+
padding: var_1.$paddingVerticalMap[size] + ' ' + var_1.$paddingHorizontalMap[size],
|
|
97
|
+
fontSize: var_1.$fontSizes[size]
|
|
98
|
+
});
|
|
99
|
+
if (config === null || config === void 0 ? void 0 : config.isFirst) {
|
|
100
|
+
const radius = var_1.$borderRadiusMap[size];
|
|
101
|
+
this.radioLabel.addStyleObj({
|
|
102
|
+
borderRadius: radius + ' 0 0 ' + radius
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.radioLabel.addStyleObj({
|
|
107
|
+
borderLeft: '0'
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (config === null || config === void 0 ? void 0 : config.isLast) {
|
|
111
|
+
const radius = var_1.$borderRadiusMap[size];
|
|
112
|
+
this.radioLabel.addStyleObj({
|
|
113
|
+
borderRadius: '0 ' + radius + ' ' + radius + ' 0'
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (config === null || config === void 0 ? void 0 : config.checked) {
|
|
117
|
+
this.setChecked(config === null || config === void 0 ? void 0 : config.checked);
|
|
118
|
+
}
|
|
119
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
120
|
+
this.setDisabled(config === null || config === void 0 ? void 0 : config.disabled);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
setDisabled(disabled) {
|
|
124
|
+
this.disabled = disabled;
|
|
125
|
+
if (disabled) {
|
|
126
|
+
this.setStyleObj({
|
|
127
|
+
cursor: framework_1.StyleCursor.notAllowed,
|
|
128
|
+
opacity: 0.5
|
|
129
|
+
// 禁用事件
|
|
130
|
+
// pointerEvents: 'none',
|
|
131
|
+
});
|
|
132
|
+
this.radioLabel.setStyleObj({
|
|
133
|
+
color: var_1.$colors.default.base
|
|
134
|
+
});
|
|
135
|
+
this.inputOriginal.setAttrObj({ disabled: true });
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.setStyleObj({
|
|
139
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
140
|
+
opacity: 1,
|
|
141
|
+
pointerEvents: 'auto'
|
|
142
|
+
});
|
|
143
|
+
this.inputOriginal.removeAttribute('disabled');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
setChecked(checked) {
|
|
147
|
+
if (checked) {
|
|
148
|
+
this.inputOriginal.setAttrObj({
|
|
149
|
+
checked: true
|
|
150
|
+
});
|
|
151
|
+
// 设置选中样式
|
|
152
|
+
this.radioLabel.setStyleObj({
|
|
153
|
+
color: var_1.$colorWhite,
|
|
154
|
+
backgroundColor: var_1.$colors.primary.base
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this.inputOriginal.removeAttribute('checked');
|
|
159
|
+
// 设置非选中样式
|
|
160
|
+
this.radioLabel.setStyleObj({
|
|
161
|
+
borderColor: var_1.$borderColor.base,
|
|
162
|
+
background: var_1.$fillColor.blank,
|
|
163
|
+
color: var_1.$colors.default.base
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
initEvents() {
|
|
168
|
+
this.addEvents({
|
|
169
|
+
// 点击事件 todo 会触发两次,先不管。
|
|
170
|
+
click: (evt) => {
|
|
171
|
+
var _a;
|
|
172
|
+
console.log('radio-button this.subscriptions is ', this.subscriptions);
|
|
173
|
+
console.log('radio-button this.inputOriginal.dom click . ');
|
|
174
|
+
console.log('radio-button this.inputOriginal.dom.value is ', this.inputOriginal.dom.value);
|
|
175
|
+
if (this.disabled) {
|
|
176
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
// this.inputOriginal.dom.click();
|
|
180
|
+
if (this.parent instanceof td_radio_group_class_1.TdRadioGroup) {
|
|
181
|
+
this.parent.setModelValue(this.inputOriginal.value); // 触发父级的事件,重置整个组。
|
|
182
|
+
}
|
|
183
|
+
this.setChecked(true);
|
|
184
|
+
(_a = this.parent) === null || _a === void 0 ? void 0 : _a.childNodes.forEach((node) => {
|
|
185
|
+
if (node instanceof TdRadioButton &&
|
|
186
|
+
node.inputOriginal.attrObj.name === this.inputOriginal.attrObj.name &&
|
|
187
|
+
node !== this) {
|
|
188
|
+
node.setChecked(false);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.TdRadioButton = TdRadioButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ISize } from '../../../styles/size';
|
|
2
|
+
import { IUI, IUIConfig } from '../../../ui/ui.interface';
|
|
3
|
+
export interface ITdRadioButton extends IUI {
|
|
4
|
+
className: 'TdRadioButton';
|
|
5
|
+
}
|
|
6
|
+
export interface ITdRadioButtonConfig extends IUIConfig {
|
|
7
|
+
/**
|
|
8
|
+
* @description binding value
|
|
9
|
+
*/
|
|
10
|
+
modelValue?: string | number | boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @description size of the Radio
|
|
13
|
+
*/
|
|
14
|
+
size?: ISize;
|
|
15
|
+
/**
|
|
16
|
+
* @description whether Radio is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description the label of Radio
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description the value of Radio
|
|
25
|
+
*/
|
|
26
|
+
value?: string | number | boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description native `name` attribute
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
checked?: boolean;
|
|
32
|
+
isFirst?: boolean;
|
|
33
|
+
isLast?: boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const $tdRadioButtonActive: {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.$tdRadioButtonActive = void 0;
|
|
4
|
+
exports.$tdRadioButtonActive = {
|
|
5
|
+
// backgroundColor: radioGroup?.fill || '',
|
|
6
|
+
// borderColor: radioGroup?.fill || '',
|
|
7
|
+
// boxShadow: radioGroup?.fill ? `-1px 0 0 0 ${radioGroup.fill}` : '',
|
|
8
|
+
// color: radioGroup?.textColor || '',
|
|
9
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IJsonData, IJsonDataProp, IPrimitive } from '@type-dom/framework';
|
|
2
|
+
import { UI } from '../../../ui/ui.abstract';
|
|
3
|
+
import { TdRadio } from '../td-radio/td-radio.class';
|
|
4
|
+
import { ITdRadioConfig } from '../td-radio/td-radio.interface';
|
|
5
|
+
import { ITdRadioGroup, ITdRadioGroupConfig } from './td-radio-group.interface';
|
|
6
|
+
export declare class TdRadioGroup extends UI implements ITdRadioGroup {
|
|
7
|
+
className: 'TdRadioGroup';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
childNodes: TdRadio[];
|
|
10
|
+
config?: ITdRadioGroupConfig;
|
|
11
|
+
constructor(config?: ITdRadioGroupConfig);
|
|
12
|
+
get resultValue(): IPrimitive | IJsonData | IJsonDataProp[];
|
|
13
|
+
setConfig(config?: ITdRadioGroupConfig): void;
|
|
14
|
+
setRadios(options: ITdRadioConfig[]): void;
|
|
15
|
+
setModelValue(value: IPrimitive): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdRadioGroup = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
|
+
const td_radio_class_1 = require("../td-radio/td-radio.class");
|
|
7
|
+
const td_radio_button_class_1 = require("../td-radio-button/td-radio-button.class");
|
|
8
|
+
class TdRadioGroup extends ui_abstract_1.UI {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super();
|
|
11
|
+
this.className = 'TdRadioGroup';
|
|
12
|
+
this.addStyleObj({
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
flexWrap: 'wrap',
|
|
16
|
+
fontSize: '0',
|
|
17
|
+
marginRight: '12px'
|
|
18
|
+
});
|
|
19
|
+
this.childNodes = [];
|
|
20
|
+
this.setConfig(config);
|
|
21
|
+
}
|
|
22
|
+
get resultValue() {
|
|
23
|
+
if (this.modelValue instanceof framework_1.XProxy) {
|
|
24
|
+
return this.modelValue.value;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return this.modelValue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
setConfig(config) {
|
|
31
|
+
super.setConfig(config);
|
|
32
|
+
this.config = config;
|
|
33
|
+
if (config === null || config === void 0 ? void 0 : config.modelValue) {
|
|
34
|
+
this.modelValue = config.modelValue;
|
|
35
|
+
console.log('this.modelValue is is ', this.modelValue);
|
|
36
|
+
}
|
|
37
|
+
if (config === null || config === void 0 ? void 0 : config.options) {
|
|
38
|
+
this.setRadios(config.options);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
setRadios(options) {
|
|
42
|
+
this.clearChildren();
|
|
43
|
+
const random = Math.random();
|
|
44
|
+
options.forEach((opt, index) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
opt.parent = this; // 父级
|
|
47
|
+
if (index === 0) {
|
|
48
|
+
opt.isFirst = true;
|
|
49
|
+
}
|
|
50
|
+
else if (index === options.length - 1) {
|
|
51
|
+
opt.isLast = true;
|
|
52
|
+
}
|
|
53
|
+
if (opt.name) { /* empty */
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
opt.name = 'radio-name' + random;
|
|
57
|
+
}
|
|
58
|
+
// 当存在 resultValue 时,清理options中设置的checked
|
|
59
|
+
if (this.resultValue !== undefined) {
|
|
60
|
+
delete opt.checked;
|
|
61
|
+
}
|
|
62
|
+
let radioObj;
|
|
63
|
+
if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.isButton) {
|
|
64
|
+
radioObj = new td_radio_button_class_1.TdRadioButton(opt);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
radioObj = new td_radio_class_1.TdRadio(opt);
|
|
68
|
+
}
|
|
69
|
+
if (this.resultValue === opt.value) { // 反显
|
|
70
|
+
radioObj.setChecked(true);
|
|
71
|
+
}
|
|
72
|
+
else if (opt.checked) {
|
|
73
|
+
// this.modelValue = opt.value;
|
|
74
|
+
this.setModelValue(opt.value);
|
|
75
|
+
// 设置选中样式
|
|
76
|
+
radioObj.setChecked(true);
|
|
77
|
+
}
|
|
78
|
+
if ((_b = this.config) === null || _b === void 0 ? void 0 : _b.disabled) {
|
|
79
|
+
radioObj.setDisabled(this.config.disabled);
|
|
80
|
+
}
|
|
81
|
+
this.addChild(radioObj);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
setModelValue(value) {
|
|
85
|
+
console.error('setModelValue value is ', value);
|
|
86
|
+
if ((this === null || this === void 0 ? void 0 : this.modelValue) instanceof framework_1.XProxy) {
|
|
87
|
+
this.modelValue.setValue(value);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.modelValue = value;
|
|
91
|
+
}
|
|
92
|
+
// console.error('value is ', value);
|
|
93
|
+
this.childNodes.forEach((opt) => {
|
|
94
|
+
if (String(opt.inputOriginal.attrObj.value) === String(value)) {
|
|
95
|
+
// 设置选中样式
|
|
96
|
+
opt.setChecked(true);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// 设置非选中样式
|
|
100
|
+
opt.setChecked(false);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.TdRadioGroup = TdRadioGroup;
|