@daikin-oss/design-system-web-components 1.1.0 → 1.3.0-next.2
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/CHANGELOG.md +145 -0
- package/LICENSE +1 -1
- package/dist/cjs/base/dds-element.cjs +1 -1
- package/dist/cjs/base/dds-form-element.cjs +139 -0
- package/dist/cjs/base/dds-form-element.d.cts +100 -0
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +7 -3
- package/dist/cjs/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs/components/avatar/daikin-avatar.d.cts +3 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs/components/button/daikin-button.cjs +35 -13
- package/dist/cjs/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs/components/calendar/daikin-calendar.cjs +549 -0
- package/dist/cjs/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs/components/calendar/index.cjs +7 -0
- package/dist/cjs/components/calendar/index.d.cts +1 -0
- package/dist/cjs/components/card/daikin-card.cjs +1 -1
- package/dist/cjs/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +9 -12
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs/components/chip/index.cjs +7 -0
- package/dist/cjs/components/chip/index.d.cts +1 -0
- package/dist/cjs/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs/components/combobox/index.cjs +8 -0
- package/dist/cjs/components/combobox/index.d.cts +1 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +626 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +106 -0
- package/dist/cjs/components/date-picker/index.cjs +7 -0
- package/dist/cjs/components/date-picker/index.d.cts +1 -0
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +91 -57
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs/components/icon/daikin-icon.cjs +117 -12
- package/dist/cjs/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs/components/icon/icons.json.cjs +6 -2
- package/dist/cjs/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs/components/index.cjs +81 -0
- package/dist/cjs/components/index.d.cts +14 -0
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +50 -1
- package/dist/cjs/components/list/daikin-list.cjs +75 -3
- package/dist/cjs/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +27 -7
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs/components/loading/daikin-loading.d.cts +1 -0
- package/dist/cjs/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs/components/logo/index.cjs +7 -0
- package/dist/cjs/components/logo/index.d.cts +1 -0
- package/dist/cjs/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs/components/menu/index.cjs +7 -0
- package/dist/cjs/components/menu/index.d.cts +1 -0
- package/dist/cjs/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs/components/modal/index.cjs +7 -0
- package/dist/cjs/components/modal/index.d.cts +1 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs/components/modal-footer/index.cjs +7 -0
- package/dist/cjs/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs/components/modal-header/index.cjs +7 -0
- package/dist/cjs/components/modal-header/index.d.cts +1 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +5 -5
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs/components/select/daikin-select.cjs +6 -1
- package/dist/cjs/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs/components/slider/index.cjs +7 -0
- package/dist/cjs/components/slider/index.d.cts +1 -0
- package/dist/cjs/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs/components/table/daikin-table.cjs +74 -15
- package/dist/cjs/components/table/daikin-table.d.cts +72 -34
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +8 -1
- package/dist/cjs/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs/components/text-field/daikin-text-field.cjs +289 -57
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs/components/text-field/number-utils.cjs +61 -0
- package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs/components/time-picker/index.cjs +17 -0
- package/dist/cjs/components/time-picker/index.d.cts +1 -0
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +24 -8
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +11 -3
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs/controllers/click-outside.cjs +3 -1
- package/dist/cjs/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs/controllers/focus-trap.cjs +42 -0
- package/dist/cjs/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs/icon-registry.cjs +170 -0
- package/dist/cjs/icon-registry.d.cts +120 -0
- package/dist/cjs/index.cjs +84 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/calendar-common.cjs +151 -0
- package/dist/cjs/utils/calendar-common.d.cts +64 -0
- package/dist/cjs/utils/notification-common.cjs +19 -15
- package/dist/cjs/utils/notification-common.d.cts +2 -2
- package/dist/cjs/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/cjs-dev/base/dds-element.cjs +1 -1
- package/dist/cjs-dev/base/dds-form-element.cjs +139 -0
- package/dist/cjs-dev/base/dds-form-element.d.cts +100 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +7 -3
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.d.cts +3 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs-dev/components/button/daikin-button.cjs +35 -13
- package/dist/cjs-dev/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +560 -0
- package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs-dev/components/calendar/index.cjs +7 -0
- package/dist/cjs-dev/components/calendar/index.d.cts +1 -0
- package/dist/cjs-dev/components/card/daikin-card.cjs +1 -1
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +9 -12
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs-dev/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs-dev/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs-dev/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs-dev/components/chip/index.cjs +7 -0
- package/dist/cjs-dev/components/chip/index.d.cts +1 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs-dev/components/combobox/index.cjs +8 -0
- package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +637 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +106 -0
- package/dist/cjs-dev/components/date-picker/index.cjs +7 -0
- package/dist/cjs-dev/components/date-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +91 -57
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs-dev/components/icon/icons.json.cjs +6 -2
- package/dist/cjs-dev/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs-dev/components/index.cjs +81 -0
- package/dist/cjs-dev/components/index.d.cts +14 -0
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +50 -1
- package/dist/cjs-dev/components/list/daikin-list.cjs +75 -3
- package/dist/cjs-dev/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +27 -7
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs-dev/components/loading/daikin-loading.d.cts +1 -0
- package/dist/cjs-dev/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs-dev/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs-dev/components/logo/index.cjs +7 -0
- package/dist/cjs-dev/components/logo/index.d.cts +1 -0
- package/dist/cjs-dev/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs-dev/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs-dev/components/menu/index.cjs +7 -0
- package/dist/cjs-dev/components/menu/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs-dev/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs-dev/components/modal/index.cjs +7 -0
- package/dist/cjs-dev/components/modal/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs-dev/components/modal-footer/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs-dev/components/modal-header/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-header/index.d.cts +1 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +5 -5
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs-dev/components/select/daikin-select.cjs +6 -1
- package/dist/cjs-dev/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs-dev/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs-dev/components/slider/index.cjs +7 -0
- package/dist/cjs-dev/components/slider/index.d.cts +1 -0
- package/dist/cjs-dev/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs-dev/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +77 -18
- package/dist/cjs-dev/components/table/daikin-table.d.cts +72 -34
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +8 -1
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +289 -57
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
- package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
- package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +24 -8
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +11 -3
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs-dev/controllers/click-outside.cjs +3 -1
- package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs-dev/controllers/focus-trap.cjs +42 -0
- package/dist/cjs-dev/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs-dev/icon-registry.cjs +170 -0
- package/dist/cjs-dev/icon-registry.d.cts +120 -0
- package/dist/cjs-dev/index.cjs +84 -0
- package/dist/cjs-dev/index.d.cts +1 -0
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/calendar-common.cjs +151 -0
- package/dist/cjs-dev/utils/calendar-common.d.cts +64 -0
- package/dist/cjs-dev/utils/notification-common.cjs +19 -15
- package/dist/cjs-dev/utils/notification-common.d.cts +2 -2
- package/dist/cjs-dev/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs-dev/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/es/base/dds-element.js +1 -1
- package/dist/es/base/dds-form-element.d.ts +100 -0
- package/dist/es/base/dds-form-element.js +139 -0
- package/dist/es/components/accordion/daikin-accordion.js +1 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.js +8 -4
- package/dist/es/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es/components/avatar/daikin-avatar.js +2 -1
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es/components/button/daikin-button.d.ts +20 -10
- package/dist/es/components/button/daikin-button.js +36 -14
- package/dist/es/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es/components/calendar/daikin-calendar.js +550 -0
- package/dist/es/components/calendar/index.d.ts +1 -0
- package/dist/es/components/calendar/index.js +4 -0
- package/dist/es/components/card/daikin-card.js +2 -2
- package/dist/es/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es/components/card-header/daikin-card-header.js +2 -2
- package/dist/es/components/carousel/daikin-carousel.js +8 -4
- package/dist/es/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es/components/checkbox/daikin-checkbox.js +13 -17
- package/dist/es/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es/components/checkbox-group/index.d.ts +1 -0
- package/dist/es/components/checkbox-group/index.js +4 -0
- package/dist/es/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es/components/chip/daikin-chip.js +107 -0
- package/dist/es/components/chip/index.d.ts +1 -0
- package/dist/es/components/chip/index.js +4 -0
- package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es/components/combobox/daikin-combobox.js +605 -0
- package/dist/es/components/combobox/index.d.ts +1 -0
- package/dist/es/components/combobox/index.js +5 -0
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es/components/date-picker/daikin-date-picker.js +627 -0
- package/dist/es/components/date-picker/index.d.ts +1 -0
- package/dist/es/components/date-picker/index.js +4 -0
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +7 -15
- package/dist/es/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es/components/icon/daikin-icon.js +119 -14
- package/dist/es/components/icon/icons.json.d.ts +16 -16
- package/dist/es/components/icon/icons.json.js +5 -1
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es/components/index.d.ts +14 -0
- package/dist/es/components/index.js +40 -1
- package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es/components/input-group/daikin-input-group.d.ts +50 -1
- package/dist/es/components/input-group/daikin-input-group.js +5 -5
- package/dist/es/components/link/daikin-link.js +1 -1
- package/dist/es/components/list/daikin-list.d.ts +16 -0
- package/dist/es/components/list/daikin-list.js +76 -4
- package/dist/es/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es/components/list-item/daikin-list-item.js +28 -8
- package/dist/es/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es/components/loading/daikin-loading.js +2 -2
- package/dist/es/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es/components/logo/daikin-logo.js +106 -0
- package/dist/es/components/logo/index.d.ts +1 -0
- package/dist/es/components/logo/index.js +4 -0
- package/dist/es/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es/components/menu/daikin-menu.js +206 -0
- package/dist/es/components/menu/index.d.ts +1 -0
- package/dist/es/components/menu/index.js +4 -0
- package/dist/es/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es/components/modal/daikin-modal.js +116 -0
- package/dist/es/components/modal/index.d.ts +1 -0
- package/dist/es/components/modal/index.js +4 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es/components/modal-footer/index.d.ts +1 -0
- package/dist/es/components/modal-footer/index.js +4 -0
- package/dist/es/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es/components/modal-header/index.d.ts +1 -0
- package/dist/es/components/modal-header/index.js +4 -0
- package/dist/es/components/pagination/daikin-pagination.js +1 -1
- package/dist/es/components/progress-bar/daikin-progress-bar.js +6 -6
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es/components/radio/daikin-radio.js +5 -14
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es/components/select/daikin-select.js +7 -2
- package/dist/es/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es/components/slider/daikin-slider.js +264 -0
- package/dist/es/components/slider/index.d.ts +1 -0
- package/dist/es/components/slider/index.js +4 -0
- package/dist/es/components/slider/slider-utils.d.ts +37 -0
- package/dist/es/components/slider/slider-utils.js +57 -0
- package/dist/es/components/tab/daikin-tab.js +2 -1
- package/dist/es/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es/components/table/daikin-table.d.ts +72 -34
- package/dist/es/components/table/daikin-table.js +75 -16
- package/dist/es/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +8 -1
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +32 -7
- package/dist/es/components/tabs/daikin-tabs.js +3 -3
- package/dist/es/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es/components/text-area/daikin-text-area.js +5 -14
- package/dist/es/components/text-field/daikin-text-field.d.ts +57 -18
- package/dist/es/components/text-field/daikin-text-field.js +290 -58
- package/dist/es/components/text-field/number-utils.d.ts +26 -0
- package/dist/es/components/text-field/number-utils.js +61 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es/components/text-masked-field/index.d.ts +1 -0
- package/dist/es/components/text-masked-field/index.js +4 -0
- package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
- package/dist/es/components/time-picker/index.d.ts +1 -0
- package/dist/es/components/time-picker/index.js +14 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es/components/toggle/daikin-toggle.js +5 -14
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +11 -3
- package/dist/es/components/tooltip/daikin-tooltip.js +25 -9
- package/dist/es/components/tree/daikin-tree.js +1 -1
- package/dist/es/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es/controllers/click-outside.js +3 -1
- package/dist/es/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es/controllers/focus-trap.d.ts +10 -0
- package/dist/es/controllers/focus-trap.js +42 -0
- package/dist/es/icon-registry.d.ts +120 -0
- package/dist/es/icon-registry.js +170 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +43 -1
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/calendar-common.d.ts +64 -0
- package/dist/es/utils/calendar-common.js +151 -0
- package/dist/es/utils/notification-common.d.ts +2 -2
- package/dist/es/utils/notification-common.js +19 -15
- package/dist/es/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es/{components/tabs → utils}/scroller.js +20 -12
- package/dist/es-dev/base/dds-element.js +1 -1
- package/dist/es-dev/base/dds-form-element.d.ts +100 -0
- package/dist/es-dev/base/dds-form-element.js +139 -0
- package/dist/es-dev/components/accordion/daikin-accordion.js +1 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +8 -4
- package/dist/es-dev/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es-dev/components/avatar/daikin-avatar.js +2 -1
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es-dev/components/button/daikin-button.d.ts +20 -10
- package/dist/es-dev/components/button/daikin-button.js +36 -14
- package/dist/es-dev/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es-dev/components/calendar/daikin-calendar.js +561 -0
- package/dist/es-dev/components/calendar/index.d.ts +1 -0
- package/dist/es-dev/components/calendar/index.js +4 -0
- package/dist/es-dev/components/card/daikin-card.js +2 -2
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es-dev/components/card-header/daikin-card-header.js +2 -2
- package/dist/es-dev/components/carousel/daikin-carousel.js +8 -4
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +13 -17
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es-dev/components/checkbox-group/index.d.ts +1 -0
- package/dist/es-dev/components/checkbox-group/index.js +4 -0
- package/dist/es-dev/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es-dev/components/chip/daikin-chip.js +107 -0
- package/dist/es-dev/components/chip/index.d.ts +1 -0
- package/dist/es-dev/components/chip/index.js +4 -0
- package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
- package/dist/es-dev/components/combobox/index.d.ts +1 -0
- package/dist/es-dev/components/combobox/index.js +5 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +638 -0
- package/dist/es-dev/components/date-picker/index.d.ts +1 -0
- package/dist/es-dev/components/date-picker/index.js +4 -0
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +7 -15
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es-dev/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es-dev/components/icon/daikin-icon.js +143 -18
- package/dist/es-dev/components/icon/icons.json.d.ts +16 -16
- package/dist/es-dev/components/icon/icons.json.js +5 -1
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es-dev/components/index.d.ts +14 -0
- package/dist/es-dev/components/index.js +40 -1
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +50 -1
- package/dist/es-dev/components/input-group/daikin-input-group.js +5 -5
- package/dist/es-dev/components/link/daikin-link.js +1 -1
- package/dist/es-dev/components/list/daikin-list.d.ts +16 -0
- package/dist/es-dev/components/list/daikin-list.js +76 -4
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es-dev/components/list-item/daikin-list-item.js +28 -8
- package/dist/es-dev/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es-dev/components/loading/daikin-loading.js +2 -2
- package/dist/es-dev/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es-dev/components/logo/daikin-logo.js +106 -0
- package/dist/es-dev/components/logo/index.d.ts +1 -0
- package/dist/es-dev/components/logo/index.js +4 -0
- package/dist/es-dev/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es-dev/components/menu/daikin-menu.js +206 -0
- package/dist/es-dev/components/menu/index.d.ts +1 -0
- package/dist/es-dev/components/menu/index.js +4 -0
- package/dist/es-dev/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es-dev/components/modal/daikin-modal.js +116 -0
- package/dist/es-dev/components/modal/index.d.ts +1 -0
- package/dist/es-dev/components/modal/index.js +4 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es-dev/components/modal-footer/index.d.ts +1 -0
- package/dist/es-dev/components/modal-footer/index.js +4 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es-dev/components/modal-header/index.d.ts +1 -0
- package/dist/es-dev/components/modal-header/index.js +4 -0
- package/dist/es-dev/components/pagination/daikin-pagination.js +1 -1
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +6 -6
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es-dev/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es-dev/components/radio/daikin-radio.js +5 -14
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es-dev/components/select/daikin-select.js +7 -2
- package/dist/es-dev/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es-dev/components/slider/daikin-slider.js +264 -0
- package/dist/es-dev/components/slider/index.d.ts +1 -0
- package/dist/es-dev/components/slider/index.js +4 -0
- package/dist/es-dev/components/slider/slider-utils.d.ts +37 -0
- package/dist/es-dev/components/slider/slider-utils.js +57 -0
- package/dist/es-dev/components/tab/daikin-tab.js +2 -1
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es-dev/components/table/daikin-table.d.ts +72 -34
- package/dist/es-dev/components/table/daikin-table.js +78 -19
- package/dist/es-dev/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +8 -1
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +32 -7
- package/dist/es-dev/components/tabs/daikin-tabs.js +3 -3
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es-dev/components/text-area/daikin-text-area.js +5 -14
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +57 -18
- package/dist/es-dev/components/text-field/daikin-text-field.js +290 -58
- package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
- package/dist/es-dev/components/text-field/number-utils.js +64 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
- package/dist/es-dev/components/text-masked-field/index.js +4 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
- package/dist/es-dev/components/time-picker/index.d.ts +1 -0
- package/dist/es-dev/components/time-picker/index.js +14 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es-dev/components/toggle/daikin-toggle.js +5 -14
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +11 -3
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +25 -9
- package/dist/es-dev/components/tree/daikin-tree.js +1 -1
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es-dev/controllers/click-outside.js +3 -1
- package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es-dev/controllers/focus-trap.d.ts +10 -0
- package/dist/es-dev/controllers/focus-trap.js +42 -0
- package/dist/es-dev/icon-registry.d.ts +120 -0
- package/dist/es-dev/icon-registry.js +170 -0
- package/dist/es-dev/index.d.ts +1 -0
- package/dist/es-dev/index.js +43 -1
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/calendar-common.d.ts +64 -0
- package/dist/es-dev/utils/calendar-common.js +151 -0
- package/dist/es-dev/utils/notification-common.d.ts +2 -2
- package/dist/es-dev/utils/notification-common.js +19 -15
- package/dist/es-dev/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es-dev/{components/tabs → utils}/scroller.js +20 -12
- package/icons/alarm.svg +3 -0
- package/icons/calendar.svg +3 -0
- package/icons/chevron-down.svg +3 -3
- package/icons/chevron-left.svg +2 -2
- package/icons/chevron-right.svg +2 -2
- package/icons/chevron-up.svg +2 -2
- package/icons/close.svg +3 -0
- package/icons/error.svg +3 -0
- package/icons/information.svg +3 -0
- package/icons/logo-negative.svg +10 -0
- package/icons/logo-positive.svg +10 -0
- package/icons/{dropdown-chevron-down.svg → number-minus.svg} +3 -1
- package/icons/number-plus.svg +5 -0
- package/icons/password-hidden.svg +3 -0
- package/icons/password-visible.svg +3 -0
- package/icons/pulldown-down.svg +3 -0
- package/icons/search.svg +3 -0
- package/icons/success.svg +3 -0
- package/icons/warning.svg +3 -0
- package/package.json +20 -6
- package/icons/cross.svg +0 -3
- package/icons/notification-close.svg +0 -5
- package/icons/status-alarm.svg +0 -5
- package/icons/status-error.svg +0 -3
- package/icons/status-information.svg +0 -5
- package/icons/status-negative.svg +0 -5
- package/icons/status-positive.svg +0 -5
- package/icons/status-warning.svg +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
2
|
-
import {
|
|
1
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
3
3
|
import { DaikinInputGroup } from "../input-group/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* The text field component is a UI element that allows users to input single-line text data.
|
|
@@ -12,9 +12,21 @@ import { DaikinInputGroup } from "../input-group/index.js";
|
|
|
12
12
|
*
|
|
13
13
|
* @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input>` element.
|
|
14
14
|
* @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event).
|
|
15
|
+
* @fires toggle - Emitted when the user toggles the password mask.
|
|
15
16
|
*
|
|
16
17
|
* @slot left-icon - Specify the icon you want to use on the left. You can also use something other than `daikin-icon`.
|
|
18
|
+
* Available only if the type is one of:
|
|
19
|
+
* - `"text"`
|
|
20
|
+
* - `"number"`
|
|
21
|
+
* - `"password"`
|
|
22
|
+
* - `"email"`
|
|
23
|
+
* - `"tel"`
|
|
24
|
+
*
|
|
17
25
|
* @slot right-icon - Specify the icon you want to use on the right. You can also use something other than `daikin-icon`.
|
|
26
|
+
* Available only if the type is one of:
|
|
27
|
+
* - `"text"`
|
|
28
|
+
* - `"email"`
|
|
29
|
+
* - `"tel"`
|
|
18
30
|
*
|
|
19
31
|
* @example
|
|
20
32
|
*
|
|
@@ -27,22 +39,19 @@ import { DaikinInputGroup } from "../input-group/index.js";
|
|
|
27
39
|
* <daikin-text-field name="name"></daikin-text-field>
|
|
28
40
|
* ```
|
|
29
41
|
*/
|
|
30
|
-
export declare class DaikinTextField extends
|
|
42
|
+
export declare class DaikinTextField extends DDSFormElement {
|
|
31
43
|
static readonly styles: import('lit').CSSResult;
|
|
32
|
-
static readonly formAssociated = true;
|
|
33
|
-
private _internals;
|
|
34
44
|
/**
|
|
35
45
|
* Type of field.
|
|
46
|
+
*
|
|
47
|
+
* - `"text"`: Basic text input with optional left and right icon slots.
|
|
48
|
+
* - `"number"`: Numeric input with increment/decrement buttons, arrow key support, and optional left icon slot.
|
|
49
|
+
* - `"password"`: Password input with show/hide toggle button to control mask of password and optional left icon slot.
|
|
50
|
+
* - `"email"`: Email input with optional left and right icon slots.
|
|
51
|
+
* - `"tel"`: Telephone input with optional left and right icon slots.
|
|
52
|
+
* - `"search"`: Search input with built-in search icon and clear button when value is present.
|
|
36
53
|
*/
|
|
37
|
-
type: "text" | "email" | "tel" | "search";
|
|
38
|
-
/**
|
|
39
|
-
* The current value of the input, submitted as a name/value pair with form data.
|
|
40
|
-
*/
|
|
41
|
-
value: string;
|
|
42
|
-
/**
|
|
43
|
-
* The name of the input, submitted as a name/value pair with form data.
|
|
44
|
-
*/
|
|
45
|
-
name: string;
|
|
54
|
+
type: "text" | "number" | "password" | "email" | "tel" | "search";
|
|
46
55
|
/**
|
|
47
56
|
* Placeholder text.
|
|
48
57
|
*/
|
|
@@ -67,24 +76,54 @@ export declare class DaikinTextField extends DDSElement {
|
|
|
67
76
|
* Controlled by `daikin-input-group` when used within `daikin-input-group`.
|
|
68
77
|
*/
|
|
69
78
|
error: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Minimum length of value.
|
|
81
|
+
*/
|
|
82
|
+
minlength: number | null;
|
|
70
83
|
/**
|
|
71
84
|
* Maximum length of value.
|
|
72
85
|
*/
|
|
73
|
-
maxlength
|
|
86
|
+
maxlength: number | null;
|
|
87
|
+
/**
|
|
88
|
+
* Interval between values. This is valid when `type="number"`.
|
|
89
|
+
*/
|
|
90
|
+
step: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* The minimum value. This is valid when `type="number"`.
|
|
93
|
+
*/
|
|
94
|
+
min: string | null;
|
|
95
|
+
/**
|
|
96
|
+
* The maximum value. This is valid when `type="number"`.
|
|
97
|
+
*/
|
|
98
|
+
max: string | null;
|
|
99
|
+
/**
|
|
100
|
+
* The pattern of value.
|
|
101
|
+
*/
|
|
102
|
+
pattern: string | null;
|
|
74
103
|
/**
|
|
75
104
|
* Value of `autocomplete` attribute of the internal `<input>`.
|
|
76
105
|
*/
|
|
77
106
|
autocomplete?: HTMLInputElement["autocomplete"];
|
|
107
|
+
/**
|
|
108
|
+
* When `type="password"`, whether to display the password with a black dot or as text.
|
|
109
|
+
*/
|
|
110
|
+
showPassword: boolean;
|
|
78
111
|
/**
|
|
79
112
|
* The label text used as the value of aria-label.
|
|
80
113
|
* Set automatically by `reflectInputGroup` method.
|
|
81
114
|
*/
|
|
82
115
|
private _label;
|
|
83
|
-
private
|
|
84
|
-
private
|
|
116
|
+
private _hasLeftSlot;
|
|
117
|
+
private _hasRightSlot;
|
|
118
|
+
private _handleChange;
|
|
85
119
|
private _handleSlotChange;
|
|
86
120
|
private _handleInput;
|
|
87
|
-
|
|
121
|
+
private _handleClearClick;
|
|
122
|
+
private _handleKeyDown;
|
|
123
|
+
private _updateNumberValue;
|
|
124
|
+
private _createIcon;
|
|
125
|
+
private _handleShowPasswordClick;
|
|
126
|
+
render(): TemplateResult<1>;
|
|
88
127
|
updated(changedProperties: PropertyValues<this>): void;
|
|
89
128
|
/**
|
|
90
129
|
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html, nothing } from "lit";
|
|
3
3
|
import { property, state } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
|
-
import
|
|
5
|
+
import "../../base/dds-element.js";
|
|
6
6
|
import { ddsElement } from "../../base/decorators.js";
|
|
7
7
|
import "../../base/define.js";
|
|
8
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
8
9
|
import tailwindStyles from "../../tailwind.css.js";
|
|
10
|
+
import { isSimpleKeyEvent } from "../../utils/is-simple-key.js";
|
|
11
|
+
import "../icon-button/daikin-icon-button.js";
|
|
12
|
+
import { updateNumberValue } from "./number-utils.js";
|
|
9
13
|
var __defProp = Object.defineProperty;
|
|
10
14
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
15
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -22,9 +26,10 @@ const cvaInput = cva(
|
|
|
22
26
|
"items-center",
|
|
23
27
|
"w-full",
|
|
24
28
|
"h-full",
|
|
29
|
+
"pl-[--pl,1rem]",
|
|
30
|
+
"pr-[--pr,1rem]",
|
|
25
31
|
"bg-ddt-color-common-background-default",
|
|
26
32
|
"relative",
|
|
27
|
-
"px-2",
|
|
28
33
|
"rounded",
|
|
29
34
|
"overflow-hidden",
|
|
30
35
|
"font-daikinSerif",
|
|
@@ -38,12 +43,12 @@ const cvaInput = cva(
|
|
|
38
43
|
"define-[--color-state-focus,--color-base]/color-border",
|
|
39
44
|
"border",
|
|
40
45
|
"border-[--color-border]",
|
|
46
|
+
// Update `--color-base` depending on the state.
|
|
47
|
+
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
41
48
|
"enabled:text-ddt-color-common-text-primary",
|
|
42
49
|
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
43
50
|
"enabled:active:bg-ddt-color-common-surface-press",
|
|
44
51
|
"focus-visible:outline-2",
|
|
45
|
-
// Update `--color-base` depending on the state.
|
|
46
|
-
// The default `--color-base` and `--color-state-focus` values are defined in `variants.error` because they differ depending on whether or not the input has an error state.
|
|
47
52
|
"disabled:var-color-ddt-color-common-disabled/color-base",
|
|
48
53
|
"disabled:text-ddt-color-common-disabled",
|
|
49
54
|
"disabled:bg-ddt-color-common-background-default",
|
|
@@ -61,14 +66,38 @@ const cvaInput = cva(
|
|
|
61
66
|
true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
|
|
62
67
|
},
|
|
63
68
|
leftIcon: {
|
|
64
|
-
false: [
|
|
65
|
-
true: [
|
|
69
|
+
false: [],
|
|
70
|
+
true: []
|
|
66
71
|
},
|
|
67
72
|
rightIcon: {
|
|
68
|
-
false: [
|
|
69
|
-
true: [
|
|
73
|
+
false: [],
|
|
74
|
+
true: []
|
|
75
|
+
},
|
|
76
|
+
type: {
|
|
77
|
+
text: [],
|
|
78
|
+
number: ["[--pr:5.5rem]"],
|
|
79
|
+
password: ["[--pr:2.75rem]"],
|
|
80
|
+
email: [],
|
|
81
|
+
tel: [],
|
|
82
|
+
search: [
|
|
83
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
84
|
+
"[--pl:2.75rem]",
|
|
85
|
+
"[--pr:2.75rem]"
|
|
86
|
+
]
|
|
70
87
|
}
|
|
71
|
-
}
|
|
88
|
+
},
|
|
89
|
+
compoundVariants: [
|
|
90
|
+
{
|
|
91
|
+
type: ["text", "email", "tel", "number", "password"],
|
|
92
|
+
leftIcon: true,
|
|
93
|
+
class: ["[--pl:2.75rem]"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
type: ["text", "email", "tel"],
|
|
97
|
+
rightIcon: true,
|
|
98
|
+
class: ["[--pr:2.75rem]"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
72
101
|
}
|
|
73
102
|
);
|
|
74
103
|
const cvaIcon = cva(
|
|
@@ -76,8 +105,8 @@ const cvaIcon = cva(
|
|
|
76
105
|
{
|
|
77
106
|
variants: {
|
|
78
107
|
icon: {
|
|
79
|
-
left: "left-3",
|
|
80
|
-
right: "right-3"
|
|
108
|
+
left: ["left-3"],
|
|
109
|
+
right: ["right-3"]
|
|
81
110
|
},
|
|
82
111
|
disabled: {
|
|
83
112
|
false: ["text-ddt-color-common-text-primary"],
|
|
@@ -86,21 +115,36 @@ const cvaIcon = cva(
|
|
|
86
115
|
}
|
|
87
116
|
}
|
|
88
117
|
);
|
|
89
|
-
|
|
118
|
+
const cvaShowPasswordIcon = cva(["icon-size-6"], {
|
|
119
|
+
variants: {
|
|
120
|
+
showPassword: {
|
|
121
|
+
false: ["i-daikin-password-hidden"],
|
|
122
|
+
true: ["i-daikin-password-visible"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
let DaikinTextField = class extends DDSFormElement {
|
|
90
127
|
constructor() {
|
|
91
128
|
super(...arguments);
|
|
92
|
-
this._internals = this.attachInternals();
|
|
93
129
|
this.type = "text";
|
|
94
|
-
this.value = "";
|
|
95
|
-
this.name = "";
|
|
96
130
|
this.placeholder = null;
|
|
97
131
|
this.readonly = false;
|
|
98
132
|
this.disabled = false;
|
|
99
133
|
this.required = false;
|
|
100
134
|
this.error = false;
|
|
135
|
+
this.minlength = null;
|
|
136
|
+
this.maxlength = null;
|
|
137
|
+
this.step = null;
|
|
138
|
+
this.min = null;
|
|
139
|
+
this.max = null;
|
|
140
|
+
this.pattern = null;
|
|
141
|
+
this.showPassword = false;
|
|
101
142
|
this._label = null;
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
143
|
+
this._hasLeftSlot = false;
|
|
144
|
+
this._hasRightSlot = false;
|
|
145
|
+
}
|
|
146
|
+
_handleChange(event) {
|
|
147
|
+
this.dispatchEvent(new Event("change", event));
|
|
104
148
|
}
|
|
105
149
|
_handleSlotChange(event) {
|
|
106
150
|
const target = event.target;
|
|
@@ -108,60 +152,229 @@ let DaikinTextField = class extends DDSElement {
|
|
|
108
152
|
const hasIcon = !!target.assignedNodes().length;
|
|
109
153
|
switch (name) {
|
|
110
154
|
case "left-icon":
|
|
111
|
-
this.
|
|
155
|
+
this._hasLeftSlot = hasIcon;
|
|
112
156
|
break;
|
|
113
157
|
case "right-icon":
|
|
114
|
-
this.
|
|
158
|
+
this._hasRightSlot = hasIcon;
|
|
115
159
|
break;
|
|
116
160
|
}
|
|
117
161
|
}
|
|
118
|
-
_handleInput(
|
|
119
|
-
this.value =
|
|
120
|
-
|
|
162
|
+
_handleInput(event) {
|
|
163
|
+
this.value = event.target.value;
|
|
164
|
+
}
|
|
165
|
+
_handleClearClick() {
|
|
166
|
+
this.value = "";
|
|
167
|
+
this.dispatchEvent(
|
|
168
|
+
new Event("input", {
|
|
169
|
+
bubbles: true,
|
|
170
|
+
composed: true
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
this.dispatchEvent(
|
|
174
|
+
new Event("change", {
|
|
175
|
+
bubbles: true
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
_handleKeyDown(event) {
|
|
180
|
+
if (this.type === "number") {
|
|
181
|
+
if (isSimpleKeyEvent(event) && event.key.length === 1) {
|
|
182
|
+
const { value, selectionStart, selectionEnd } = event.target;
|
|
183
|
+
const selectionText = value.substring(
|
|
184
|
+
selectionStart ?? 0,
|
|
185
|
+
selectionEnd ?? 0
|
|
186
|
+
);
|
|
187
|
+
if (/^[0-9]$/.test(event.key)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (event.key === "-") {
|
|
191
|
+
if ((!value.includes("-") || selectionText.includes("-")) && selectionStart === 0) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (event.key === ".") {
|
|
196
|
+
if (!value.includes(".") || selectionText.includes(".")) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const direction = {
|
|
204
|
+
ArrowUp: 1,
|
|
205
|
+
ArrowDown: -1
|
|
206
|
+
}[event.key];
|
|
207
|
+
if (direction != null) {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
this._updateNumberValue(direction);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
_updateNumberValue(sign) {
|
|
214
|
+
const newValue = updateNumberValue(this.value || "0", sign, {
|
|
215
|
+
step: this.step,
|
|
216
|
+
min: this.min,
|
|
217
|
+
max: this.max
|
|
218
|
+
});
|
|
219
|
+
if (newValue === this.value) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
this.value = newValue;
|
|
223
|
+
this.dispatchEvent(
|
|
224
|
+
new Event("input", {
|
|
225
|
+
bubbles: true,
|
|
226
|
+
composed: true
|
|
227
|
+
})
|
|
228
|
+
);
|
|
229
|
+
this.dispatchEvent(
|
|
230
|
+
new Event("change", {
|
|
231
|
+
bubbles: true
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
_createIcon() {
|
|
236
|
+
const leftIconSlot = html`<span
|
|
237
|
+
class=${cvaIcon({
|
|
238
|
+
icon: "left",
|
|
239
|
+
disabled: this.disabled
|
|
240
|
+
})}
|
|
241
|
+
>
|
|
242
|
+
<slot
|
|
243
|
+
name="left-icon"
|
|
244
|
+
class="icon-size-6"
|
|
245
|
+
@slotchange=${this._handleSlotChange}
|
|
246
|
+
></slot>
|
|
247
|
+
</span>`;
|
|
248
|
+
const rightIconSlot = html`<span
|
|
249
|
+
class=${cvaIcon({
|
|
250
|
+
icon: "right",
|
|
251
|
+
disabled: this.disabled
|
|
252
|
+
})}
|
|
253
|
+
>
|
|
254
|
+
<slot
|
|
255
|
+
name="right-icon"
|
|
256
|
+
class="icon-size-6"
|
|
257
|
+
@slotchange=${this._handleSlotChange}
|
|
258
|
+
></slot>
|
|
259
|
+
</span>`;
|
|
260
|
+
switch (this.type) {
|
|
261
|
+
case "number":
|
|
262
|
+
return html`${leftIconSlot}
|
|
263
|
+
<span class="inline-flex items-center gap-1 absolute right-2">
|
|
264
|
+
<daikin-icon-button
|
|
265
|
+
color="neutral"
|
|
266
|
+
variant="ghost"
|
|
267
|
+
?disabled=${this.disabled}
|
|
268
|
+
button-aria-label="Decrease"
|
|
269
|
+
tabindex="-1"
|
|
270
|
+
@click=${() => this._updateNumberValue(-1)}
|
|
271
|
+
>
|
|
272
|
+
<span class="i-daikin-number-minus icon-size-6"></span>
|
|
273
|
+
</daikin-icon-button>
|
|
274
|
+
<daikin-icon-button
|
|
275
|
+
color="neutral"
|
|
276
|
+
variant="ghost"
|
|
277
|
+
?disabled=${this.disabled}
|
|
278
|
+
button-aria-label="Increase"
|
|
279
|
+
tabindex="-1"
|
|
280
|
+
@click=${() => this._updateNumberValue(1)}
|
|
281
|
+
>
|
|
282
|
+
<span class="i-daikin-number-plus icon-size-6"></span>
|
|
283
|
+
</daikin-icon-button>
|
|
284
|
+
</span>`;
|
|
285
|
+
case "password":
|
|
286
|
+
return html`${leftIconSlot}<daikin-icon-button
|
|
287
|
+
color="neutral"
|
|
288
|
+
variant="ghost"
|
|
289
|
+
?disabled=${this.disabled}
|
|
290
|
+
button-aria-label=${this.showPassword ? "Hide password" : "Show password"}
|
|
291
|
+
class="absolute right-3"
|
|
292
|
+
@click=${this._handleShowPasswordClick}
|
|
293
|
+
>
|
|
294
|
+
<span
|
|
295
|
+
class=${cvaShowPasswordIcon({ showPassword: this.showPassword })}
|
|
296
|
+
></span>
|
|
297
|
+
</daikin-icon-button>`;
|
|
298
|
+
case "search":
|
|
299
|
+
return html`<span
|
|
300
|
+
class=${cvaIcon({
|
|
301
|
+
icon: "left",
|
|
302
|
+
disabled: this.disabled
|
|
303
|
+
})}
|
|
304
|
+
>
|
|
305
|
+
<span class="i-daikin-search size-6"></span>
|
|
306
|
+
</span>
|
|
307
|
+
${!!this.value && !!this.value.length ? html`<daikin-icon-button
|
|
308
|
+
color="neutral"
|
|
309
|
+
variant="ghost"
|
|
310
|
+
?disabled=${this.disabled}
|
|
311
|
+
button-aria-label="Clear"
|
|
312
|
+
class="absolute right-3 size-6"
|
|
313
|
+
@click=${this._handleClearClick}
|
|
314
|
+
>
|
|
315
|
+
<span class="i-daikin-close"></span>
|
|
316
|
+
</daikin-icon-button>` : nothing}`;
|
|
317
|
+
default:
|
|
318
|
+
return html`${leftIconSlot}${rightIconSlot}`;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
_handleShowPasswordClick() {
|
|
322
|
+
this.showPassword = !this.showPassword;
|
|
323
|
+
this.dispatchEvent(new Event("toggle"));
|
|
121
324
|
}
|
|
122
325
|
render() {
|
|
123
|
-
const
|
|
326
|
+
const error = !this.disabled && this.error;
|
|
327
|
+
const type = this.type === "password" && this.showPassword ? "text" : this.type === "number" ? "text" : this.type;
|
|
328
|
+
const role = this.type === "number" ? "spinbutton" : void 0;
|
|
329
|
+
const inputMode = this.type === "number" ? "numeric" : void 0;
|
|
124
330
|
return html`<input
|
|
125
331
|
class=${cvaInput({
|
|
126
|
-
error
|
|
127
|
-
leftIcon: this.
|
|
128
|
-
rightIcon: this.
|
|
332
|
+
error,
|
|
333
|
+
leftIcon: this._hasLeftSlot,
|
|
334
|
+
rightIcon: this._hasRightSlot,
|
|
335
|
+
type: this.type
|
|
129
336
|
})}
|
|
130
|
-
|
|
337
|
+
role=${ifDefined(role)}
|
|
338
|
+
type=${type}
|
|
339
|
+
inputmode=${ifDefined(inputMode)}
|
|
131
340
|
placeholder=${ifDefined(this.placeholder ?? void 0)}
|
|
132
341
|
name=${ifDefined(this.name)}
|
|
133
|
-
|
|
342
|
+
minlength=${ifDefined(this.minlength ?? void 0)}
|
|
343
|
+
maxlength=${ifDefined(this.maxlength ?? void 0)}
|
|
344
|
+
step=${ifDefined(
|
|
345
|
+
this.type === "number" && this.step != null ? (
|
|
346
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
347
|
+
this.step
|
|
348
|
+
) : void 0
|
|
349
|
+
)}
|
|
350
|
+
pattern=${ifDefined(this.pattern ?? void 0)}
|
|
134
351
|
autocomplete=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
|
|
135
352
|
ifDefined(this.autocomplete)}
|
|
136
|
-
aria-label=${
|
|
137
|
-
|
|
353
|
+
aria-label=${ifDefined(this._label ?? void 0)}
|
|
354
|
+
aria-valuemin=${ifDefined(
|
|
355
|
+
this.type === "number" && this.min != null ? this.min : void 0
|
|
356
|
+
)}
|
|
357
|
+
aria-valuemax=${ifDefined(
|
|
358
|
+
this.type === "number" && this.max != null ? this.max : void 0
|
|
359
|
+
)}
|
|
360
|
+
aria-valuenow=${ifDefined(
|
|
361
|
+
this.type === "number" ? this.value : void 0
|
|
362
|
+
)}
|
|
138
363
|
.value=${this.value}
|
|
139
364
|
?disabled=${this.disabled}
|
|
140
365
|
?readonly=${this.readonly}
|
|
141
366
|
?required=${this.required}
|
|
142
|
-
@change=${
|
|
367
|
+
@change=${this._handleChange}
|
|
143
368
|
@input=${this._handleInput}
|
|
369
|
+
@keydown=${this._handleKeyDown}
|
|
144
370
|
/>
|
|
145
|
-
|
|
146
|
-
<slot
|
|
147
|
-
name="left-icon"
|
|
148
|
-
class="icon-size-6"
|
|
149
|
-
@slotchange=${this._handleSlotChange}
|
|
150
|
-
></slot>
|
|
151
|
-
</div>
|
|
152
|
-
<div class=${cvaIcon({ icon: "right", disabled: this.disabled })}>
|
|
153
|
-
<slot
|
|
154
|
-
name="right-icon"
|
|
155
|
-
class="icon-size-6"
|
|
156
|
-
@slotchange=${this._handleSlotChange}
|
|
157
|
-
></slot>
|
|
158
|
-
</div>`;
|
|
371
|
+
${this._createIcon()}`;
|
|
159
372
|
}
|
|
160
373
|
updated(changedProperties) {
|
|
161
374
|
if (!changedProperties.has("value")) {
|
|
162
375
|
return;
|
|
163
376
|
}
|
|
164
|
-
this.
|
|
377
|
+
this.setFormValue(this.value);
|
|
165
378
|
}
|
|
166
379
|
/**
|
|
167
380
|
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
@@ -184,17 +397,18 @@ DaikinTextField.styles = css`
|
|
|
184
397
|
height: 3rem;
|
|
185
398
|
position: relative;
|
|
186
399
|
}
|
|
400
|
+
|
|
401
|
+
input::-ms-reveal {
|
|
402
|
+
display: none !important;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
input::-ms-clear {
|
|
406
|
+
display: none !important;
|
|
407
|
+
}
|
|
187
408
|
`;
|
|
188
|
-
DaikinTextField.formAssociated = true;
|
|
189
409
|
__decorateClass([
|
|
190
410
|
property({ type: String })
|
|
191
411
|
], DaikinTextField.prototype, "type", 2);
|
|
192
|
-
__decorateClass([
|
|
193
|
-
property({ type: String })
|
|
194
|
-
], DaikinTextField.prototype, "value", 2);
|
|
195
|
-
__decorateClass([
|
|
196
|
-
property({ type: String, reflect: true })
|
|
197
|
-
], DaikinTextField.prototype, "name", 2);
|
|
198
412
|
__decorateClass([
|
|
199
413
|
property({ type: String })
|
|
200
414
|
], DaikinTextField.prototype, "placeholder", 2);
|
|
@@ -211,20 +425,38 @@ __decorateClass([
|
|
|
211
425
|
property({ type: Boolean, reflect: true })
|
|
212
426
|
], DaikinTextField.prototype, "error", 2);
|
|
213
427
|
__decorateClass([
|
|
214
|
-
property({ type: Number })
|
|
428
|
+
property({ type: Number, reflect: true })
|
|
429
|
+
], DaikinTextField.prototype, "minlength", 2);
|
|
430
|
+
__decorateClass([
|
|
431
|
+
property({ type: Number, reflect: true })
|
|
215
432
|
], DaikinTextField.prototype, "maxlength", 2);
|
|
216
433
|
__decorateClass([
|
|
217
|
-
property({ type: String })
|
|
434
|
+
property({ type: String, reflect: true })
|
|
435
|
+
], DaikinTextField.prototype, "step", 2);
|
|
436
|
+
__decorateClass([
|
|
437
|
+
property({ type: String, reflect: true })
|
|
438
|
+
], DaikinTextField.prototype, "min", 2);
|
|
439
|
+
__decorateClass([
|
|
440
|
+
property({ type: String, reflect: true })
|
|
441
|
+
], DaikinTextField.prototype, "max", 2);
|
|
442
|
+
__decorateClass([
|
|
443
|
+
property({ type: String, reflect: true })
|
|
444
|
+
], DaikinTextField.prototype, "pattern", 2);
|
|
445
|
+
__decorateClass([
|
|
446
|
+
property({ type: String, reflect: true })
|
|
218
447
|
], DaikinTextField.prototype, "autocomplete", 2);
|
|
448
|
+
__decorateClass([
|
|
449
|
+
property({ type: Boolean, reflect: true, attribute: "show-password" })
|
|
450
|
+
], DaikinTextField.prototype, "showPassword", 2);
|
|
219
451
|
__decorateClass([
|
|
220
452
|
state()
|
|
221
453
|
], DaikinTextField.prototype, "_label", 2);
|
|
222
454
|
__decorateClass([
|
|
223
455
|
state()
|
|
224
|
-
], DaikinTextField.prototype, "
|
|
456
|
+
], DaikinTextField.prototype, "_hasLeftSlot", 2);
|
|
225
457
|
__decorateClass([
|
|
226
458
|
state()
|
|
227
|
-
], DaikinTextField.prototype, "
|
|
459
|
+
], DaikinTextField.prototype, "_hasRightSlot", 2);
|
|
228
460
|
DaikinTextField = __decorateClass([
|
|
229
461
|
ddsElement("daikin-text-field")
|
|
230
462
|
], DaikinTextField);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for updating number values with step constraints.
|
|
3
|
+
*/
|
|
4
|
+
export interface NumberUpdateOptions {
|
|
5
|
+
/** Step increment/decrement amount */
|
|
6
|
+
step?: string | null;
|
|
7
|
+
/** Minimum allowed value */
|
|
8
|
+
min?: string | null;
|
|
9
|
+
/** Maximum allowed value */
|
|
10
|
+
max?: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Updates a number value according to step constraints and min/max bounds.
|
|
14
|
+
*
|
|
15
|
+
* Logic (compliant with Google Chrome behavior):
|
|
16
|
+
* 0. Valid output range: min <= value <= max, and (value - min) is a multiple of step, or value equals min/max
|
|
17
|
+
* 1. If max < min, direction up goes to min (max value), direction down goes to max (min value)
|
|
18
|
+
* 2. If value is out of range or not on step boundary, round to nearest step in the direction and finish
|
|
19
|
+
* 3. Otherwise, increment/decrement by step
|
|
20
|
+
*
|
|
21
|
+
* @param currentValue Current value as string
|
|
22
|
+
* @param direction Direction: 1 for increment, -1 for decrement
|
|
23
|
+
* @param options The update options
|
|
24
|
+
* @returns The new value as string
|
|
25
|
+
*/
|
|
26
|
+
export declare function updateNumberValue(currentValue: string, direction: 1 | -1, options: NumberUpdateOptions): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Big from "big.js";
|
|
2
|
+
function updateNumberValue(currentValue, direction, options) {
|
|
3
|
+
const { step, min, max } = options;
|
|
4
|
+
try {
|
|
5
|
+
const current = new Big(currentValue || "0");
|
|
6
|
+
const stepBig = new Big(step || "1");
|
|
7
|
+
const minBig = min != null && min !== "" ? new Big(min) : null;
|
|
8
|
+
const maxBig = max != null && max !== "" ? new Big(max) : null;
|
|
9
|
+
if (minBig && maxBig && maxBig.lt(minBig)) {
|
|
10
|
+
return direction === 1 ? minBig.toString() : maxBig.toString();
|
|
11
|
+
}
|
|
12
|
+
const isOnStepBoundary = (value) => {
|
|
13
|
+
const diff = value.sub(minBig ?? 0);
|
|
14
|
+
return diff.mod(stepBig).eq(0);
|
|
15
|
+
};
|
|
16
|
+
const findNearestStepInDirection = (value, dir) => {
|
|
17
|
+
const base = minBig || new Big(0);
|
|
18
|
+
const offset = value.sub(base);
|
|
19
|
+
const steps = offset.div(stepBig);
|
|
20
|
+
let targetSteps;
|
|
21
|
+
if (dir === 1) {
|
|
22
|
+
targetSteps = steps.round(0, Big.roundUp);
|
|
23
|
+
} else {
|
|
24
|
+
targetSteps = steps.round(0, Big.roundDown);
|
|
25
|
+
}
|
|
26
|
+
return base.add(targetSteps.mul(stepBig));
|
|
27
|
+
};
|
|
28
|
+
const isInRange = (!minBig || current.gte(minBig)) && (!maxBig || current.lte(maxBig));
|
|
29
|
+
if (!isInRange || !isOnStepBoundary(current)) {
|
|
30
|
+
if (!isInRange) {
|
|
31
|
+
const isBelowMin = minBig && current.lt(minBig);
|
|
32
|
+
const isAboveMax = maxBig && current.gt(maxBig);
|
|
33
|
+
if (isBelowMin && direction === -1 || isAboveMax && direction === 1) {
|
|
34
|
+
return currentValue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
let nearestStep = findNearestStepInDirection(current, direction);
|
|
38
|
+
if (minBig && nearestStep.lt(minBig)) {
|
|
39
|
+
nearestStep = minBig;
|
|
40
|
+
}
|
|
41
|
+
if (maxBig && nearestStep.gt(maxBig)) {
|
|
42
|
+
nearestStep = maxBig;
|
|
43
|
+
}
|
|
44
|
+
return nearestStep.toString();
|
|
45
|
+
}
|
|
46
|
+
const newValue = direction === 1 ? current.add(stepBig) : current.sub(stepBig);
|
|
47
|
+
let result = newValue;
|
|
48
|
+
if (minBig && result.lt(minBig)) {
|
|
49
|
+
result = minBig;
|
|
50
|
+
}
|
|
51
|
+
if (maxBig && result.gt(maxBig)) {
|
|
52
|
+
result = maxBig;
|
|
53
|
+
}
|
|
54
|
+
return result.toString();
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return currentValue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
updateNumberValue
|
|
61
|
+
};
|