@daikin-oss/design-system-web-components 1.6.0 → 2.0.0
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 +184 -0
- package/custom-elements.json +2639 -1328
- package/dist/cjs/base/dds-element.cjs +1 -1
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +25 -8
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.cts +1 -0
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.cts +1 -1
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +9 -6
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +1 -0
- package/dist/cjs/components/calendar/daikin-calendar.cjs +73 -26
- package/dist/cjs/components/calendar/daikin-calendar.d.cts +13 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +190 -52
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +18 -0
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +7 -1
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.d.cts +5 -0
- package/dist/cjs/components/chip/daikin-chip.cjs +195 -93
- package/dist/cjs/components/chip/daikin-chip.d.cts +20 -0
- package/dist/cjs/components/combobox/daikin-combobox.cjs +111 -33
- package/dist/cjs/components/combobox/daikin-combobox.d.cts +10 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +243 -65
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +37 -2
- package/dist/cjs/components/drawer/daikin-drawer.cjs +1 -1
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +164 -32
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +13 -0
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +13 -6
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +2 -0
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +2 -0
- package/dist/cjs/components/index.cjs +2 -2
- package/dist/cjs/components/input-group/daikin-input-group.cjs +88 -30
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +10 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +21 -10
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -0
- package/dist/cjs/components/logo/daikin-logo.cjs +1 -1
- package/dist/cjs/components/logo/daikin-logo.d.cts +2 -2
- package/dist/cjs/components/menu/daikin-menu.cjs +2 -2
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +10 -4
- package/dist/cjs/components/modal-header/daikin-modal-header.d.cts +1 -0
- package/dist/cjs/components/navigation/daikin-navigation.cjs +21 -0
- package/dist/cjs/components/navigation/daikin-navigation.d.cts +9 -0
- package/dist/cjs/components/navigation-item/daikin-navigation-item.cjs +18 -14
- package/dist/cjs/components/pagination/daikin-pagination.cjs +60 -19
- package/dist/cjs/components/pagination/daikin-pagination.d.cts +11 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +27 -19
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.cts +1 -0
- package/dist/cjs/components/radio/daikin-radio.cjs +160 -35
- package/dist/cjs/components/radio/daikin-radio.d.cts +26 -0
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +10 -1
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +4 -0
- package/dist/cjs/components/select/daikin-select.cjs +128 -21
- package/dist/cjs/components/select/daikin-select.d.cts +11 -0
- package/dist/cjs/components/slider/daikin-slider.cjs +61 -16
- package/dist/cjs/components/slider/daikin-slider.d.cts +4 -0
- package/dist/cjs/components/status-message/daikin-status-message.cjs +1 -0
- package/dist/cjs/components/status-message/daikin-status-message.d.cts +2 -0
- package/dist/cjs/components/table/daikin-table.cjs +108 -16
- package/dist/cjs/components/table/daikin-table.d.cts +58 -1
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +3 -4
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +21 -15
- package/dist/cjs/components/tag/daikin-tag.cjs +99 -20
- package/dist/cjs/components/tag/daikin-tag.d.cts +14 -0
- package/dist/cjs/components/text-area/daikin-text-area.cjs +22 -2
- package/dist/cjs/components/text-field/daikin-text-field.cjs +96 -50
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +9 -0
- package/dist/cjs/components/text-field/number-utils.cjs +51 -19
- package/dist/cjs/components/text-field/number-utils.d.cts +7 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +31 -7
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +325 -108
- package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +57 -14
- package/dist/cjs/components/time-picker/index.cjs +2 -2
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs/components/toggle/daikin-toggle.cjs +110 -35
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +5 -0
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +1 -1
- package/dist/cjs/components/tree-item/daikin-tree-item.cjs +24 -8
- package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +1 -0
- package/dist/cjs/components/tree-section/daikin-tree-section.cjs +7 -1
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +1 -0
- package/dist/cjs/components/vertical-navigation/daikin-vertical-navigation.cjs +1 -1
- package/dist/cjs/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +248 -38
- package/dist/cjs/components/vertical-navigation-item/daikin-vertical-navigation-item.d.cts +17 -7
- package/dist/cjs/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +103 -33
- package/dist/cjs/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.cts +6 -1
- package/dist/cjs/controllers/custom-readonly.cjs +59 -0
- package/dist/cjs/controllers/custom-readonly.d.cts +28 -0
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/calendar-common.cjs +6 -2
- package/dist/cjs/utils/calendar-common.d.cts +1 -1
- package/dist/cjs/utils/extract-half-width-digits.cjs +11 -0
- package/dist/cjs/utils/extract-half-width-digits.d.cts +15 -0
- package/dist/cjs-dev/base/dds-element.cjs +1 -1
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +25 -8
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.cts +1 -0
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.cts +1 -1
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +9 -6
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +1 -0
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +73 -26
- package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +13 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +190 -52
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +18 -0
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +7 -1
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.d.cts +5 -0
- package/dist/cjs-dev/components/chip/daikin-chip.cjs +195 -93
- package/dist/cjs-dev/components/chip/daikin-chip.d.cts +20 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +111 -33
- package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +10 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +243 -65
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +37 -2
- package/dist/cjs-dev/components/drawer/daikin-drawer.cjs +1 -1
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +164 -32
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +13 -0
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +13 -6
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +2 -0
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +2 -0
- package/dist/cjs-dev/components/index.cjs +2 -2
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +88 -30
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +10 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +21 -10
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -0
- package/dist/cjs-dev/components/logo/daikin-logo.cjs +1 -1
- package/dist/cjs-dev/components/logo/daikin-logo.d.cts +2 -2
- package/dist/cjs-dev/components/menu/daikin-menu.cjs +2 -2
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +10 -4
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.d.cts +1 -0
- package/dist/cjs-dev/components/navigation/daikin-navigation.cjs +21 -0
- package/dist/cjs-dev/components/navigation/daikin-navigation.d.cts +9 -0
- package/dist/cjs-dev/components/navigation-item/daikin-navigation-item.cjs +18 -14
- package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +60 -19
- package/dist/cjs-dev/components/pagination/daikin-pagination.d.cts +11 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +27 -19
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.cts +1 -0
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +160 -35
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +26 -0
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +10 -1
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +4 -0
- package/dist/cjs-dev/components/select/daikin-select.cjs +128 -21
- package/dist/cjs-dev/components/select/daikin-select.d.cts +11 -0
- package/dist/cjs-dev/components/slider/daikin-slider.cjs +61 -16
- package/dist/cjs-dev/components/slider/daikin-slider.d.cts +4 -0
- package/dist/cjs-dev/components/status-message/daikin-status-message.cjs +1 -0
- package/dist/cjs-dev/components/status-message/daikin-status-message.d.cts +2 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +108 -16
- package/dist/cjs-dev/components/table/daikin-table.d.cts +58 -1
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +3 -4
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +21 -15
- package/dist/cjs-dev/components/tag/daikin-tag.cjs +99 -20
- package/dist/cjs-dev/components/tag/daikin-tag.d.cts +14 -0
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +22 -2
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +96 -50
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +9 -0
- package/dist/cjs-dev/components/text-field/number-utils.cjs +51 -19
- package/dist/cjs-dev/components/text-field/number-utils.d.cts +7 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +31 -7
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +325 -108
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +57 -14
- package/dist/cjs-dev/components/time-picker/index.cjs +2 -2
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +110 -35
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +5 -0
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +1 -1
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +24 -8
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +1 -0
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +7 -1
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +1 -0
- package/dist/cjs-dev/components/vertical-navigation/daikin-vertical-navigation.cjs +1 -1
- package/dist/cjs-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +248 -38
- package/dist/cjs-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.d.cts +17 -7
- package/dist/cjs-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +103 -33
- package/dist/cjs-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.cts +6 -1
- package/dist/cjs-dev/controllers/custom-readonly.cjs +59 -0
- package/dist/cjs-dev/controllers/custom-readonly.d.cts +28 -0
- package/dist/cjs-dev/index.cjs +2 -2
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/calendar-common.cjs +6 -2
- package/dist/cjs-dev/utils/calendar-common.d.cts +1 -1
- package/dist/cjs-dev/utils/extract-half-width-digits.cjs +11 -0
- package/dist/cjs-dev/utils/extract-half-width-digits.d.cts +15 -0
- package/dist/es/base/dds-element.js +1 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +1 -0
- package/dist/es/components/accordion-item/daikin-accordion-item.js +25 -8
- package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +1 -1
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +1 -0
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +9 -6
- package/dist/es/components/calendar/daikin-calendar.d.ts +13 -0
- package/dist/es/components/calendar/daikin-calendar.js +73 -26
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +18 -0
- package/dist/es/components/checkbox/daikin-checkbox.js +190 -52
- package/dist/es/components/checkbox-group/daikin-checkbox-group.d.ts +5 -0
- package/dist/es/components/checkbox-group/daikin-checkbox-group.js +7 -1
- package/dist/es/components/chip/daikin-chip.d.ts +20 -0
- package/dist/es/components/chip/daikin-chip.js +195 -93
- package/dist/es/components/combobox/daikin-combobox.d.ts +10 -0
- package/dist/es/components/combobox/daikin-combobox.js +111 -33
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +37 -2
- package/dist/es/components/date-picker/daikin-date-picker.js +243 -65
- package/dist/es/components/drawer/daikin-drawer.js +1 -1
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +13 -0
- package/dist/es/components/dropdown/daikin-dropdown.js +164 -32
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +13 -6
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +2 -0
- package/dist/es/components/icon-button/daikin-icon-button.js +2 -0
- package/dist/es/components/index.js +4 -4
- package/dist/es/components/input-group/daikin-input-group.d.ts +10 -0
- package/dist/es/components/input-group/daikin-input-group.js +89 -31
- package/dist/es/components/list-item/daikin-list-item.d.ts +9 -0
- package/dist/es/components/list-item/daikin-list-item.js +21 -10
- package/dist/es/components/logo/daikin-logo.d.ts +2 -2
- package/dist/es/components/logo/daikin-logo.js +1 -1
- package/dist/es/components/menu/daikin-menu.js +2 -2
- package/dist/es/components/modal-header/daikin-modal-header.d.ts +1 -0
- package/dist/es/components/modal-header/daikin-modal-header.js +10 -4
- package/dist/es/components/navigation/daikin-navigation.d.ts +9 -0
- package/dist/es/components/navigation/daikin-navigation.js +22 -1
- package/dist/es/components/navigation-item/daikin-navigation-item.js +18 -14
- package/dist/es/components/pagination/daikin-pagination.d.ts +11 -0
- package/dist/es/components/pagination/daikin-pagination.js +61 -20
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +1 -0
- package/dist/es/components/progress-bar/daikin-progress-bar.js +27 -19
- package/dist/es/components/radio/daikin-radio.d.ts +26 -0
- package/dist/es/components/radio/daikin-radio.js +160 -35
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +4 -0
- package/dist/es/components/radio-group/daikin-radio-group.js +10 -1
- package/dist/es/components/select/daikin-select.d.ts +11 -0
- package/dist/es/components/select/daikin-select.js +128 -21
- package/dist/es/components/slider/daikin-slider.d.ts +4 -0
- package/dist/es/components/slider/daikin-slider.js +61 -16
- package/dist/es/components/status-message/daikin-status-message.d.ts +2 -0
- package/dist/es/components/status-message/daikin-status-message.js +1 -0
- package/dist/es/components/table/daikin-table.d.ts +58 -1
- package/dist/es/components/table/daikin-table.js +109 -17
- package/dist/es/components/table-cell/daikin-table-cell.js +3 -4
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +21 -15
- package/dist/es/components/tag/daikin-tag.d.ts +14 -0
- package/dist/es/components/tag/daikin-tag.js +100 -21
- package/dist/es/components/text-area/daikin-text-area.js +22 -2
- package/dist/es/components/text-field/daikin-text-field.d.ts +9 -0
- package/dist/es/components/text-field/daikin-text-field.js +97 -51
- package/dist/es/components/text-field/number-utils.d.ts +7 -0
- package/dist/es/components/text-field/number-utils.js +51 -19
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +31 -7
- package/dist/es/components/time-picker/daikin-time-picker.d.ts +57 -14
- package/dist/es/components/time-picker/daikin-time-picker.js +327 -110
- package/dist/es/components/time-picker/index.js +4 -4
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +1 -1
- package/dist/es/components/toggle/daikin-toggle.d.ts +5 -0
- package/dist/es/components/toggle/daikin-toggle.js +110 -35
- package/dist/es/components/tooltip/daikin-tooltip.js +1 -1
- package/dist/es/components/tree-item/daikin-tree-item.d.ts +1 -0
- package/dist/es/components/tree-item/daikin-tree-item.js +24 -8
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +1 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +7 -1
- package/dist/es/components/vertical-navigation/daikin-vertical-navigation.js +1 -1
- package/dist/es/components/vertical-navigation-item/daikin-vertical-navigation-item.d.ts +17 -7
- package/dist/es/components/vertical-navigation-item/daikin-vertical-navigation-item.js +248 -38
- package/dist/es/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.ts +6 -1
- package/dist/es/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +104 -34
- package/dist/es/controllers/custom-readonly.d.ts +28 -0
- package/dist/es/controllers/custom-readonly.js +59 -0
- package/dist/es/index.js +4 -4
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/calendar-common.d.ts +1 -1
- package/dist/es/utils/calendar-common.js +6 -2
- package/dist/es/utils/extract-half-width-digits.d.ts +15 -0
- package/dist/es/utils/extract-half-width-digits.js +11 -0
- package/dist/es-dev/base/dds-element.js +1 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +1 -0
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +25 -8
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +1 -1
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +1 -0
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +9 -6
- package/dist/es-dev/components/calendar/daikin-calendar.d.ts +13 -0
- package/dist/es-dev/components/calendar/daikin-calendar.js +73 -26
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +18 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +190 -52
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.d.ts +5 -0
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +7 -1
- package/dist/es-dev/components/chip/daikin-chip.d.ts +20 -0
- package/dist/es-dev/components/chip/daikin-chip.js +195 -93
- package/dist/es-dev/components/combobox/daikin-combobox.d.ts +10 -0
- package/dist/es-dev/components/combobox/daikin-combobox.js +111 -33
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +37 -2
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +243 -65
- package/dist/es-dev/components/drawer/daikin-drawer.js +1 -1
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +13 -0
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +164 -32
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +13 -6
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +2 -0
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +2 -0
- package/dist/es-dev/components/index.js +4 -4
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +10 -0
- package/dist/es-dev/components/input-group/daikin-input-group.js +89 -31
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +9 -0
- package/dist/es-dev/components/list-item/daikin-list-item.js +21 -10
- package/dist/es-dev/components/logo/daikin-logo.d.ts +2 -2
- package/dist/es-dev/components/logo/daikin-logo.js +1 -1
- package/dist/es-dev/components/menu/daikin-menu.js +2 -2
- package/dist/es-dev/components/modal-header/daikin-modal-header.d.ts +1 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +10 -4
- package/dist/es-dev/components/navigation/daikin-navigation.d.ts +9 -0
- package/dist/es-dev/components/navigation/daikin-navigation.js +22 -1
- package/dist/es-dev/components/navigation-item/daikin-navigation-item.js +18 -14
- package/dist/es-dev/components/pagination/daikin-pagination.d.ts +11 -0
- package/dist/es-dev/components/pagination/daikin-pagination.js +61 -20
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +1 -0
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +27 -19
- package/dist/es-dev/components/radio/daikin-radio.d.ts +26 -0
- package/dist/es-dev/components/radio/daikin-radio.js +160 -35
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +4 -0
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +10 -1
- package/dist/es-dev/components/select/daikin-select.d.ts +11 -0
- package/dist/es-dev/components/select/daikin-select.js +128 -21
- package/dist/es-dev/components/slider/daikin-slider.d.ts +4 -0
- package/dist/es-dev/components/slider/daikin-slider.js +61 -16
- package/dist/es-dev/components/status-message/daikin-status-message.d.ts +2 -0
- package/dist/es-dev/components/status-message/daikin-status-message.js +1 -0
- package/dist/es-dev/components/table/daikin-table.d.ts +58 -1
- package/dist/es-dev/components/table/daikin-table.js +109 -17
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +3 -4
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +21 -15
- package/dist/es-dev/components/tag/daikin-tag.d.ts +14 -0
- package/dist/es-dev/components/tag/daikin-tag.js +100 -21
- package/dist/es-dev/components/text-area/daikin-text-area.js +22 -2
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +9 -0
- package/dist/es-dev/components/text-field/daikin-text-field.js +97 -51
- package/dist/es-dev/components/text-field/number-utils.d.ts +7 -0
- package/dist/es-dev/components/text-field/number-utils.js +51 -19
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +31 -7
- package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +57 -14
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +327 -110
- package/dist/es-dev/components/time-picker/index.js +4 -4
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +1 -1
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +5 -0
- package/dist/es-dev/components/toggle/daikin-toggle.js +110 -35
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +1 -1
- package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +1 -0
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +24 -8
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +1 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +7 -1
- package/dist/es-dev/components/vertical-navigation/daikin-vertical-navigation.js +1 -1
- package/dist/es-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.d.ts +17 -7
- package/dist/es-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.js +248 -38
- package/dist/es-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.ts +6 -1
- package/dist/es-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +104 -34
- package/dist/es-dev/controllers/custom-readonly.d.ts +28 -0
- package/dist/es-dev/controllers/custom-readonly.js +59 -0
- package/dist/es-dev/index.js +4 -4
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/calendar-common.d.ts +1 -1
- package/dist/es-dev/utils/calendar-common.js +6 -2
- package/dist/es-dev/utils/extract-half-width-digits.d.ts +15 -0
- package/dist/es-dev/utils/extract-half-width-digits.js +11 -0
- package/icons/logo-negative.svg +16 -9
- package/icons/logo-positive.svg +16 -9
- package/package.json +6 -5
|
@@ -5,7 +5,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import "../../base/dds-element.js";
|
|
7
7
|
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
8
|
-
import { property } from "../../base/dds-property.js";
|
|
8
|
+
import { property, oneOf } from "../../base/dds-property.js";
|
|
9
9
|
import { ddsElement } from "../../base/decorators.js";
|
|
10
10
|
import "../../base/define.js";
|
|
11
11
|
import tailwindStyles from "../../tailwind.css.js";
|
|
@@ -28,12 +28,13 @@ const cvaInput = cva(
|
|
|
28
28
|
"items-center",
|
|
29
29
|
"w-full",
|
|
30
30
|
"h-full",
|
|
31
|
-
"pl-(--pl,
|
|
32
|
-
"pr-(--pr,
|
|
31
|
+
"pl-(--pl,calc(var(--dds-padding-30)+0.25rem))",
|
|
32
|
+
"pr-(--pr,calc(var(--dds-padding-30)+0.25rem))",
|
|
33
33
|
"bg-ddt-color-common-background-default",
|
|
34
34
|
"relative",
|
|
35
35
|
"rounded-sm",
|
|
36
36
|
"overflow-hidden",
|
|
37
|
+
"text-(length:--dds-font-size-400)",
|
|
37
38
|
"outline-solid",
|
|
38
39
|
"outline-(--color-border)",
|
|
39
40
|
"outline-0",
|
|
@@ -68,22 +69,30 @@ const cvaInput = cva(
|
|
|
68
69
|
},
|
|
69
70
|
leftIcon: {
|
|
70
71
|
false: [],
|
|
71
|
-
true: [
|
|
72
|
+
true: [
|
|
73
|
+
"[--pl:calc(var(--dds-padding-30)+var(--dds-icon)+var(--dds-gap-10)+var(--dds-space-100))]"
|
|
74
|
+
]
|
|
72
75
|
},
|
|
73
76
|
rightIcon: {
|
|
74
77
|
false: [],
|
|
75
|
-
true: [
|
|
78
|
+
true: [
|
|
79
|
+
"[--pr:calc(var(--dds-padding-30)+var(--dds-icon)+var(--dds-gap-10))]"
|
|
80
|
+
]
|
|
76
81
|
},
|
|
77
82
|
type: {
|
|
78
83
|
text: [],
|
|
79
|
-
number: [
|
|
80
|
-
|
|
84
|
+
number: [
|
|
85
|
+
"[--pr:calc(var(--dds-icon-button)*2+0.25rem+var(--dds-padding-20))]"
|
|
86
|
+
],
|
|
87
|
+
password: [
|
|
88
|
+
"[--pr:calc(var(--dds-gap-20)+var(--dds-icon-button)+var(--dds-padding-20))]"
|
|
89
|
+
],
|
|
81
90
|
email: [],
|
|
82
91
|
tel: [],
|
|
83
92
|
search: [
|
|
84
93
|
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
85
|
-
"[--pl:
|
|
86
|
-
"[--pr:
|
|
94
|
+
"[--pl:calc(var(--dds-padding-30)+var(--dds-icon)+var(--dds-gap-10)+0.25rem)]",
|
|
95
|
+
"[--pr:calc(0.25rem+var(--dds-padding-30)+1.5rem)]"
|
|
87
96
|
]
|
|
88
97
|
}
|
|
89
98
|
},
|
|
@@ -106,8 +115,8 @@ const cvaIcon = cva(
|
|
|
106
115
|
{
|
|
107
116
|
variants: {
|
|
108
117
|
icon: {
|
|
109
|
-
left: ["left-
|
|
110
|
-
right: ["right-
|
|
118
|
+
left: ["left-(--dds-padding-30)"],
|
|
119
|
+
right: ["right-(--dds-padding-30)"]
|
|
111
120
|
},
|
|
112
121
|
disabled: {
|
|
113
122
|
false: ["text-ddt-color-common-text-primary"],
|
|
@@ -116,7 +125,7 @@ const cvaIcon = cva(
|
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
);
|
|
119
|
-
const cvaShowPasswordIcon = cva(["size-
|
|
128
|
+
const cvaShowPasswordIcon = cva(["size-(--dds-icon)"], {
|
|
120
129
|
variants: {
|
|
121
130
|
showPassword: {
|
|
122
131
|
false: ["icon-[daikin--password-hidden]"],
|
|
@@ -134,6 +143,7 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
134
143
|
this.minlength = null;
|
|
135
144
|
this.maxlength = null;
|
|
136
145
|
this.step = null;
|
|
146
|
+
this.stepMode = "free";
|
|
137
147
|
this.min = null;
|
|
138
148
|
this.max = null;
|
|
139
149
|
this.pattern = null;
|
|
@@ -219,8 +229,9 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
219
229
|
}
|
|
220
230
|
}
|
|
221
231
|
_updateNumberValue(sign) {
|
|
222
|
-
const newValue = updateNumberValue(this.value
|
|
232
|
+
const newValue = updateNumberValue(this.value, sign, {
|
|
223
233
|
step: this.step,
|
|
234
|
+
stepMode: this.stepMode,
|
|
224
235
|
min: this.min,
|
|
225
236
|
max: this.max
|
|
226
237
|
});
|
|
@@ -249,7 +260,7 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
249
260
|
>
|
|
250
261
|
<slot
|
|
251
262
|
name="left-icon"
|
|
252
|
-
class="icon-size-
|
|
263
|
+
class="icon-size-token"
|
|
253
264
|
@slotchange=${this._handleSlotChange}
|
|
254
265
|
></slot>
|
|
255
266
|
</span>`;
|
|
@@ -261,48 +272,56 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
261
272
|
>
|
|
262
273
|
<slot
|
|
263
274
|
name="right-icon"
|
|
264
|
-
class="icon-size-
|
|
275
|
+
class="icon-size-token"
|
|
265
276
|
@slotchange=${this._handleSlotChange}
|
|
266
277
|
></slot>
|
|
267
278
|
</span>`;
|
|
268
279
|
switch (this.type) {
|
|
269
280
|
case "number":
|
|
270
281
|
return html`${leftIconSlot}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
${this.readonly && !this.disabled ? nothing : html`<span class="inline-flex items-center gap-1 absolute right-2">
|
|
283
|
+
<daikin-icon-button
|
|
284
|
+
class="size-(--dds-icon-button)"
|
|
285
|
+
color="neutral"
|
|
286
|
+
variant="ghost"
|
|
287
|
+
?disabled=${this.disabled}
|
|
288
|
+
button-aria-label="Decrease"
|
|
289
|
+
tabindex="-1"
|
|
290
|
+
@click=${() => this._updateNumberValue(-1)}
|
|
291
|
+
>
|
|
292
|
+
<span
|
|
293
|
+
class="icon-[daikin--number-minus] size-(--dds-icon)"
|
|
294
|
+
></span>
|
|
295
|
+
</daikin-icon-button>
|
|
296
|
+
<daikin-icon-button
|
|
297
|
+
class="size-(--dds-icon-button)"
|
|
298
|
+
color="neutral"
|
|
299
|
+
variant="ghost"
|
|
300
|
+
?disabled=${this.disabled}
|
|
301
|
+
button-aria-label="Increase"
|
|
302
|
+
tabindex="-1"
|
|
303
|
+
@click=${() => this._updateNumberValue(1)}
|
|
304
|
+
>
|
|
305
|
+
<span
|
|
306
|
+
class="icon-[daikin--number-plus] size-(--dds-icon)"
|
|
307
|
+
></span>
|
|
308
|
+
</daikin-icon-button>
|
|
309
|
+
</span>`}`;
|
|
310
|
+
case "password":
|
|
311
|
+
return html`${leftIconSlot}${this.readonly && !this.disabled ? nothing : html`<daikin-icon-button
|
|
283
312
|
color="neutral"
|
|
284
313
|
variant="ghost"
|
|
285
314
|
?disabled=${this.disabled}
|
|
286
|
-
button-aria-label
|
|
287
|
-
|
|
288
|
-
@click=${
|
|
315
|
+
button-aria-label=${this.showPassword ? "Hide password" : "Show password"}
|
|
316
|
+
class="absolute right-(--dds-padding-20) size-(--dds-icon-button)"
|
|
317
|
+
@click=${this._handleShowPasswordClick}
|
|
289
318
|
>
|
|
290
|
-
<span
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
variant="ghost"
|
|
297
|
-
?disabled=${this.disabled}
|
|
298
|
-
button-aria-label=${this.showPassword ? "Hide password" : "Show password"}
|
|
299
|
-
class="absolute right-3"
|
|
300
|
-
@click=${this._handleShowPasswordClick}
|
|
301
|
-
>
|
|
302
|
-
<span
|
|
303
|
-
class=${cvaShowPasswordIcon({ showPassword: this.showPassword })}
|
|
304
|
-
></span>
|
|
305
|
-
</daikin-icon-button>`;
|
|
319
|
+
<span
|
|
320
|
+
class=${cvaShowPasswordIcon({
|
|
321
|
+
showPassword: this.showPassword
|
|
322
|
+
})}
|
|
323
|
+
></span>
|
|
324
|
+
</daikin-icon-button>`}`;
|
|
306
325
|
case "search":
|
|
307
326
|
return html`<span
|
|
308
327
|
class=${cvaIcon({
|
|
@@ -310,17 +329,17 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
310
329
|
disabled: this.disabled
|
|
311
330
|
})}
|
|
312
331
|
>
|
|
313
|
-
<span class="icon-[daikin--search] size-
|
|
332
|
+
<span class="icon-[daikin--search] size-(--dds-icon)"></span>
|
|
314
333
|
</span>
|
|
315
|
-
${!!this.value && !!this.value.length ? html`<daikin-icon-button
|
|
334
|
+
${!!this.value && !!this.value.length && !this.readonly ? html`<daikin-icon-button
|
|
316
335
|
color="neutral"
|
|
317
336
|
variant="ghost"
|
|
318
337
|
?disabled=${this.disabled}
|
|
319
338
|
button-aria-label="Clear"
|
|
320
|
-
class="absolute right-
|
|
339
|
+
class="absolute right-(--dds-padding-30) size-6"
|
|
321
340
|
@click=${this._handleClearClick}
|
|
322
341
|
>
|
|
323
|
-
<span class="icon-[daikin--close] size-
|
|
342
|
+
<span class="icon-[daikin--close] size-(--dds-icon)"></span>
|
|
324
343
|
</daikin-icon-button>` : nothing}`;
|
|
325
344
|
default:
|
|
326
345
|
return html`${leftIconSlot}${rightIconSlot}`;
|
|
@@ -386,6 +405,7 @@ let DaikinTextField = class extends DDSFormElement {
|
|
|
386
405
|
reflectInputGroup(inputGroup) {
|
|
387
406
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
388
407
|
this.disabled = !!inputGroup.disabled;
|
|
408
|
+
this.readonly = !!inputGroup.readonly;
|
|
389
409
|
this.required = !!inputGroup.required;
|
|
390
410
|
this.error = isError;
|
|
391
411
|
this._label = inputGroup.label;
|
|
@@ -397,7 +417,7 @@ DaikinTextField.styles = css`
|
|
|
397
417
|
:host {
|
|
398
418
|
display: flex;
|
|
399
419
|
align-items: center;
|
|
400
|
-
height: 3rem;
|
|
420
|
+
height: var(--dds-input-height, 3rem);
|
|
401
421
|
position: relative;
|
|
402
422
|
}
|
|
403
423
|
|
|
@@ -408,6 +428,23 @@ DaikinTextField.styles = css`
|
|
|
408
428
|
input::-ms-clear {
|
|
409
429
|
display: none !important;
|
|
410
430
|
}
|
|
431
|
+
|
|
432
|
+
:host([readonly]:not([disabled])) input {
|
|
433
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
434
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
:host([readonly]:not([disabled])) input:hover,
|
|
438
|
+
:host([readonly]:not([disabled])) input:active {
|
|
439
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
440
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
:host([readonly][error]:not([disabled])) input,
|
|
444
|
+
:host([readonly][error]:not([disabled])) input:hover,
|
|
445
|
+
:host([readonly][error]:not([disabled])) input:active {
|
|
446
|
+
--color-base: var(--dds-color-common-danger-default);
|
|
447
|
+
}
|
|
411
448
|
`;
|
|
412
449
|
__decorateClass([
|
|
413
450
|
property({ type: String, reflect: true, fallbackValue: "text" })
|
|
@@ -436,6 +473,15 @@ __decorateClass([
|
|
|
436
473
|
__decorateClass([
|
|
437
474
|
property({ type: String, reflect: true })
|
|
438
475
|
], DaikinTextField.prototype, "step", 2);
|
|
476
|
+
__decorateClass([
|
|
477
|
+
property({
|
|
478
|
+
type: String,
|
|
479
|
+
reflect: true,
|
|
480
|
+
fallbackValue: "free",
|
|
481
|
+
isAllowedValue: oneOf(["free", "snap"]),
|
|
482
|
+
attribute: "step-mode"
|
|
483
|
+
})
|
|
484
|
+
], DaikinTextField.prototype, "stepMode", 2);
|
|
439
485
|
__decorateClass([
|
|
440
486
|
property({ type: String, reflect: true })
|
|
441
487
|
], DaikinTextField.prototype, "min", 2);
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
export interface NumberUpdateOptions {
|
|
5
5
|
/** Step increment/decrement amount */
|
|
6
6
|
step?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Step mode determines how the value is adjusted when it is not on a step boundary.
|
|
9
|
+
* - "free": Do not snap to step boundaries; increment/decrement relative to the current value.
|
|
10
|
+
* - "snap": If the current value is off a step boundary, snap to the next/previous step boundary in the given direction (and finish without applying an extra step).
|
|
11
|
+
* Defaults to "free".
|
|
12
|
+
*/
|
|
13
|
+
stepMode?: "free" | "snap";
|
|
7
14
|
/** Minimum allowed value */
|
|
8
15
|
min?: string | null;
|
|
9
16
|
/** Maximum allowed value */
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
import Big from "big.js";
|
|
2
2
|
function updateNumberValue(currentValue, direction, options) {
|
|
3
|
-
const { step, min, max } = options;
|
|
3
|
+
const { step, stepMode = "free", min, max } = options;
|
|
4
|
+
const getDecimalPlaces = (value) => {
|
|
5
|
+
if (value == null || value === "") {
|
|
6
|
+
return 0;
|
|
7
|
+
}
|
|
8
|
+
const stringValue = typeof value === "number" ? `${value}` : value;
|
|
9
|
+
const decimalPart = stringValue.split(".")[1];
|
|
10
|
+
return decimalPart ? decimalPart.length : 0;
|
|
11
|
+
};
|
|
12
|
+
const currentDecimalPlaces = getDecimalPlaces(currentValue);
|
|
13
|
+
const stepDecimalPlaces = getDecimalPlaces(step);
|
|
14
|
+
const minDecimalPlaces = getDecimalPlaces(min);
|
|
15
|
+
const maxDecimalPlaces = getDecimalPlaces(max);
|
|
16
|
+
const outputDecimalPlaces = Math.max(currentDecimalPlaces, stepDecimalPlaces);
|
|
4
17
|
try {
|
|
5
18
|
const current = new Big(currentValue || "0");
|
|
6
19
|
const stepBig = new Big(step || "1");
|
|
7
20
|
const minBig = min != null && min !== "" ? new Big(min) : null;
|
|
8
21
|
const maxBig = max != null && max !== "" ? new Big(max) : null;
|
|
22
|
+
const isEmptyCurrentValue = currentValue.trim() === "";
|
|
23
|
+
const formatResult = (value) => {
|
|
24
|
+
if (minBig !== null && value.eq(minBig)) {
|
|
25
|
+
return value.toFixed(minDecimalPlaces);
|
|
26
|
+
}
|
|
27
|
+
if (maxBig !== null && value.eq(maxBig)) {
|
|
28
|
+
return value.toFixed(maxDecimalPlaces);
|
|
29
|
+
}
|
|
30
|
+
return value.toFixed(outputDecimalPlaces);
|
|
31
|
+
};
|
|
32
|
+
if (isEmptyCurrentValue && direction === -1 && minBig) {
|
|
33
|
+
return formatResult(minBig);
|
|
34
|
+
}
|
|
9
35
|
if (minBig && maxBig && maxBig.lt(minBig)) {
|
|
10
|
-
return direction === 1 ? minBig
|
|
36
|
+
return direction === 1 ? formatResult(minBig) : formatResult(maxBig);
|
|
11
37
|
}
|
|
12
38
|
const isOnStepBoundary = (value) => {
|
|
13
39
|
const diff = value.sub(minBig ?? 0);
|
|
@@ -17,22 +43,21 @@ function updateNumberValue(currentValue, direction, options) {
|
|
|
17
43
|
const base = minBig || new Big(0);
|
|
18
44
|
const offset = value.sub(base);
|
|
19
45
|
const steps = offset.div(stepBig);
|
|
46
|
+
const truncated = steps.round(0, Big.roundDown);
|
|
20
47
|
let targetSteps;
|
|
21
48
|
if (dir === 1) {
|
|
22
|
-
targetSteps =
|
|
49
|
+
targetSteps = truncated.lt(steps) ? truncated.add(1) : truncated;
|
|
23
50
|
} else {
|
|
24
|
-
targetSteps =
|
|
51
|
+
targetSteps = truncated.gt(steps) ? truncated.sub(1) : truncated;
|
|
25
52
|
}
|
|
26
53
|
return base.add(targetSteps.mul(stepBig));
|
|
27
54
|
};
|
|
28
55
|
const isInRange = (!minBig || current.gte(minBig)) && (!maxBig || current.lte(maxBig));
|
|
29
|
-
if (!isInRange
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return currentValue;
|
|
35
|
-
}
|
|
56
|
+
if (!isInRange) {
|
|
57
|
+
const isBelowMin = minBig && current.lt(minBig);
|
|
58
|
+
const isAboveMax = maxBig && current.gt(maxBig);
|
|
59
|
+
if (isBelowMin && direction === -1 || isAboveMax && direction === 1) {
|
|
60
|
+
return currentValue;
|
|
36
61
|
}
|
|
37
62
|
let nearestStep = findNearestStepInDirection(current, direction);
|
|
38
63
|
if (minBig && nearestStep.lt(minBig)) {
|
|
@@ -41,17 +66,24 @@ function updateNumberValue(currentValue, direction, options) {
|
|
|
41
66
|
if (maxBig && nearestStep.gt(maxBig)) {
|
|
42
67
|
nearestStep = maxBig;
|
|
43
68
|
}
|
|
44
|
-
return nearestStep
|
|
69
|
+
return formatResult(nearestStep);
|
|
45
70
|
}
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
const steppedValue = direction === 1 ? current.add(stepBig) : current.sub(stepBig);
|
|
72
|
+
if (minBig && steppedValue.lt(minBig) || maxBig && steppedValue.gt(maxBig)) {
|
|
73
|
+
return currentValue;
|
|
74
|
+
}
|
|
75
|
+
if (!isOnStepBoundary(current) && stepMode === "snap") {
|
|
76
|
+
const nearestStep = findNearestStepInDirection(current, direction);
|
|
77
|
+
if (minBig && nearestStep.lt(minBig) || maxBig && nearestStep.gt(maxBig)) {
|
|
78
|
+
return currentValue;
|
|
79
|
+
}
|
|
80
|
+
return formatResult(nearestStep);
|
|
50
81
|
}
|
|
51
|
-
|
|
52
|
-
|
|
82
|
+
const newValue = direction === 1 ? current.add(stepBig) : current.sub(stepBig);
|
|
83
|
+
if (minBig && newValue.lt(minBig) || maxBig && newValue.gt(maxBig)) {
|
|
84
|
+
return currentValue;
|
|
53
85
|
}
|
|
54
|
-
return
|
|
86
|
+
return formatResult(newValue);
|
|
55
87
|
} catch (error) {
|
|
56
88
|
return currentValue;
|
|
57
89
|
}
|
|
@@ -30,6 +30,7 @@ const cvaInput = cva(
|
|
|
30
30
|
"relative",
|
|
31
31
|
"rounded-sm",
|
|
32
32
|
"overflow-hidden",
|
|
33
|
+
"text-(length:--dds-font-size-400)",
|
|
33
34
|
"outline-solid",
|
|
34
35
|
"outline-(--color-border)",
|
|
35
36
|
"outline-0",
|
|
@@ -62,12 +63,12 @@ const cvaInput = cva(
|
|
|
62
63
|
true: ["enabled:[--color-base:var(--dds-color-common-danger-default)]"]
|
|
63
64
|
},
|
|
64
65
|
leftIcon: {
|
|
65
|
-
false: ["pl-
|
|
66
|
-
true: ["pl-
|
|
66
|
+
false: ["pl-(--dds-padding-40)"],
|
|
67
|
+
true: ["pl-[calc((var(--dds-padding-40)*2)+var(--dds-padding-30))]"]
|
|
67
68
|
},
|
|
68
69
|
rightIcon: {
|
|
69
|
-
false: ["pr-
|
|
70
|
-
true: ["pr-
|
|
70
|
+
false: ["pr-(--dds-padding-40)"],
|
|
71
|
+
true: ["pr-[calc((var(--dds-padding-40)*2)+var(--dds-padding-30))]"]
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -181,7 +182,7 @@ let DaikinTextMaskedField = class extends DDSFormElement {
|
|
|
181
182
|
>
|
|
182
183
|
<slot
|
|
183
184
|
name="left-icon"
|
|
184
|
-
class="icon-size-
|
|
185
|
+
class="icon-size-token"
|
|
185
186
|
@slotchange=${this._handleSlotChange}
|
|
186
187
|
></slot>
|
|
187
188
|
</span>
|
|
@@ -193,7 +194,7 @@ let DaikinTextMaskedField = class extends DDSFormElement {
|
|
|
193
194
|
>
|
|
194
195
|
<slot
|
|
195
196
|
name="right-icon"
|
|
196
|
-
class="icon-size-
|
|
197
|
+
class="icon-size-token"
|
|
197
198
|
@slotchange=${this._handleSlotChange}
|
|
198
199
|
></slot>
|
|
199
200
|
</span>`;
|
|
@@ -246,6 +247,7 @@ let DaikinTextMaskedField = class extends DDSFormElement {
|
|
|
246
247
|
reflectInputGroup(inputGroup) {
|
|
247
248
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
248
249
|
this.disabled = !!inputGroup.disabled;
|
|
250
|
+
this.readonly = !!inputGroup.readonly;
|
|
249
251
|
this.required = !!inputGroup.required;
|
|
250
252
|
this.error = isError;
|
|
251
253
|
this._label = inputGroup.label;
|
|
@@ -257,10 +259,32 @@ DaikinTextMaskedField.styles = css`
|
|
|
257
259
|
:host {
|
|
258
260
|
display: flex;
|
|
259
261
|
align-items: center;
|
|
260
|
-
height: 3rem;
|
|
262
|
+
height: var(--dds-input-height, 3rem);
|
|
261
263
|
position: relative;
|
|
262
264
|
}
|
|
263
265
|
|
|
266
|
+
::slotted(daikin-icon[slot="left-icon"]),
|
|
267
|
+
::slotted(daikin-icon[slot="right-icon"]) {
|
|
268
|
+
--ddc-icon-size: var(--dds-icon, 20px);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:host([readonly]:not([disabled])) input {
|
|
272
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
273
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
:host([readonly]:not([disabled])) input:hover,
|
|
277
|
+
:host([readonly]:not([disabled])) input:active {
|
|
278
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
279
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host([readonly][error]:not([disabled])) input,
|
|
283
|
+
:host([readonly][error]:not([disabled])) input:hover,
|
|
284
|
+
:host([readonly][error]:not([disabled])) input:active {
|
|
285
|
+
--color-base: var(--dds-color-common-danger-default);
|
|
286
|
+
}
|
|
287
|
+
|
|
264
288
|
input::-ms-reveal {
|
|
265
289
|
display: none !important;
|
|
266
290
|
}
|
|
@@ -14,16 +14,24 @@ type TimeParts = {
|
|
|
14
14
|
*/
|
|
15
15
|
type TimeItem = "hour" | "minute";
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Hour cycle for time input UI.
|
|
18
|
+
* - h12: 12-hour UI (01:00〜12:59) + AM/PM dropdown.
|
|
19
|
+
* - h23: 24-hour UI (00:00〜23:59) without AM/PM dropdown.
|
|
18
20
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
time: string;
|
|
21
|
+
type HourCycle = "h12" | "h23";
|
|
22
|
+
type UiTimeObject = {
|
|
23
|
+
hourCycle: "h12";
|
|
24
|
+
hour: string;
|
|
25
|
+
minute: string;
|
|
25
26
|
meridiem: "AM" | "PM";
|
|
27
|
+
} | {
|
|
28
|
+
hourCycle: "h23";
|
|
29
|
+
hour: string;
|
|
30
|
+
minute: string;
|
|
31
|
+
meridiem: null;
|
|
26
32
|
};
|
|
33
|
+
export declare function uiToTimeValue(object: UiTimeObject): string;
|
|
34
|
+
export declare function timeValueToUI(time: string, hourCycle: HourCycle): UiTimeObject;
|
|
27
35
|
/**
|
|
28
36
|
* Validates if a time string matches the 24-hour format.
|
|
29
37
|
*/
|
|
@@ -60,13 +68,16 @@ export declare function getTimeItemInSelection(selectionStart: number, selection
|
|
|
60
68
|
* Calculate digit key input, returns new time parts and whether input is complete.
|
|
61
69
|
* @returns { parts, done } or null
|
|
62
70
|
*/
|
|
63
|
-
export declare function calcDigitInput(parts: Readonly<TimeParts>, item: TimeItem, digit: string, hourDigitIndex: number): {
|
|
71
|
+
export declare function calcDigitInput(parts: Readonly<TimeParts>, item: TimeItem, digit: string, hourDigitIndex: number, hourCycle: HourCycle): {
|
|
64
72
|
parts: TimeParts;
|
|
65
73
|
done: boolean;
|
|
66
74
|
} | null;
|
|
67
75
|
/**
|
|
68
|
-
* The time picker provides a time input field and
|
|
69
|
-
*
|
|
76
|
+
* The time picker provides a time input field and supports two hour cycles via `hourCycle`.
|
|
77
|
+
* - h12: input in 12-hour format with AM/PM dropdown.
|
|
78
|
+
* - h23: input in 24-hour format without AM/PM dropdown.
|
|
79
|
+
*
|
|
80
|
+
* Please note that the component's `value` is always stored in 24-hour format.
|
|
70
81
|
*
|
|
71
82
|
* @attr form - The form the component belongs to.
|
|
72
83
|
* @attr name - The form name, submitted as a name/value pair when submitting the form.
|
|
@@ -98,14 +109,16 @@ export declare class DaikinTimePicker extends DDSFormElement {
|
|
|
98
109
|
placeholder: string;
|
|
99
110
|
/**
|
|
100
111
|
* Minimum time (00:00 - 23:59). If the user's input value is less than this value, the component will display an error state.
|
|
101
|
-
* Please note that
|
|
112
|
+
* Please note that regardless of the selected UI hour cycle, the component value is stored in 24-hour format.
|
|
113
|
+
* The `min` property must be provided in 24-hour format.
|
|
102
114
|
*
|
|
103
115
|
* @default "00:00"
|
|
104
116
|
*/
|
|
105
117
|
min: string;
|
|
106
118
|
/**
|
|
107
119
|
* Maximum time (00:00 - 23:59). If the user's input value is more than this value, the component will display an error state.
|
|
108
|
-
* Please note that
|
|
120
|
+
* Please note that regardless of the selected UI hour cycle, the component value is stored in 24-hour format.
|
|
121
|
+
* The `max` property must be provided in 24-hour format.
|
|
109
122
|
*
|
|
110
123
|
* @default "23:59"
|
|
111
124
|
*/
|
|
@@ -114,6 +127,11 @@ export declare class DaikinTimePicker extends DDSFormElement {
|
|
|
114
127
|
* Whether the field is disabled. Controlled by daikin-input-group.
|
|
115
128
|
*/
|
|
116
129
|
disabled: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the field is readonly.
|
|
132
|
+
* When readonly, the user cannot change the value.
|
|
133
|
+
*/
|
|
134
|
+
readonly: boolean;
|
|
117
135
|
/**
|
|
118
136
|
* Whether the field is required. Controlled by daikin-input-group.
|
|
119
137
|
*/
|
|
@@ -122,28 +140,48 @@ export declare class DaikinTimePicker extends DDSFormElement {
|
|
|
122
140
|
* Whether to show error state. Controlled by daikin-input-group. Ignored if disabled.
|
|
123
141
|
*/
|
|
124
142
|
error: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Hour cycle for the UI.
|
|
145
|
+
* - h12: input uses 12-hour UI + AM/PM dropdown.
|
|
146
|
+
* - h23: input uses 24-hour UI and hides AM/PM dropdown.
|
|
147
|
+
*
|
|
148
|
+
* @default "h12"
|
|
149
|
+
*/
|
|
150
|
+
hourCycle: HourCycle;
|
|
125
151
|
/**
|
|
126
152
|
* Minutes step. Specify the step size for the minutes when using the up and down arrow keys.
|
|
127
153
|
*
|
|
128
154
|
* @default "1"
|
|
129
155
|
*/
|
|
130
156
|
minutesStep: string;
|
|
157
|
+
/**
|
|
158
|
+
* Whether AM/PM dropdown should be single-open across sibling time pickers in the same root.
|
|
159
|
+
*/
|
|
160
|
+
meridiemSingleOpen: boolean;
|
|
131
161
|
private _label;
|
|
132
162
|
private _inputValue;
|
|
133
163
|
private _currentSelection;
|
|
134
164
|
private _meridiem;
|
|
135
165
|
/**
|
|
136
166
|
* Returns the value to be displayed in the input field.
|
|
137
|
-
* - If the main value is a valid 24-hour time, returns
|
|
167
|
+
* - If the main value is a valid 24-hour time, returns a display string based on the selected hour cycle.
|
|
138
168
|
* - If the current input value is not valid or meridiem is empty, returns the raw input value.
|
|
139
169
|
* - Otherwise, returns null.
|
|
140
170
|
*/
|
|
141
171
|
private get _value();
|
|
142
172
|
private _timeInputElement;
|
|
173
|
+
private _meridiemDropdown;
|
|
143
174
|
/**
|
|
144
175
|
* Tracks the current digit index for hour input (0: first digit, 1: second digit).
|
|
145
176
|
*/
|
|
146
177
|
private _hourDigitIndex;
|
|
178
|
+
private _preCompositionValue;
|
|
179
|
+
/**
|
|
180
|
+
* Tracks the current digit index for minute input (0: first digit, 1: second digit).
|
|
181
|
+
* When 0 (fresh entry), always starts with "0X" regardless of the existing value,
|
|
182
|
+
* preventing pre-existing values like "04" from being mistaken as a first-digit state.
|
|
183
|
+
*/
|
|
184
|
+
private _minuteDigitIndex;
|
|
147
185
|
/**
|
|
148
186
|
* Returns the value to display in the input field (from _inputValue state).
|
|
149
187
|
*/
|
|
@@ -160,16 +198,21 @@ export declare class DaikinTimePicker extends DDSFormElement {
|
|
|
160
198
|
private _handleChange;
|
|
161
199
|
private _handleMouseUp;
|
|
162
200
|
private _handleDigitInput;
|
|
201
|
+
private _handleCompositionStart;
|
|
202
|
+
private _handleCompositionEnd;
|
|
203
|
+
private _applyDigits;
|
|
163
204
|
private _handleKeyDown;
|
|
164
205
|
private _updateTimeByOffset;
|
|
165
206
|
private _handleBeforeInput;
|
|
166
207
|
/**
|
|
167
|
-
* Updates the value in 24-hour format if the input is valid,
|
|
208
|
+
* Updates the value in 24-hour format if the input is valid, while preserving the selected UI hour cycle.
|
|
168
209
|
*/
|
|
169
210
|
private _updateValue;
|
|
170
211
|
private _updateInputSelection;
|
|
171
212
|
private _updateSelection;
|
|
172
213
|
private _handleDropdownChange;
|
|
214
|
+
private _closeMeridiemDropdown;
|
|
215
|
+
private _handleMeridiemDropdownToggle;
|
|
173
216
|
/**
|
|
174
217
|
* Focuses on the inner time input.
|
|
175
218
|
* @param options focus options
|