@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
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
1
|
import { unsafeCSS, css, html } from "lit";
|
|
3
2
|
import { state } from "lit/decorators.js";
|
|
4
3
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
5
|
import "../../base/dds-element.js";
|
|
7
6
|
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
8
|
-
import { property } from "../../base/dds-property.js";
|
|
7
|
+
import { property, oneOf } from "../../base/dds-property.js";
|
|
9
8
|
import { ddsElement } from "../../base/decorators.js";
|
|
10
9
|
import "../../base/define.js";
|
|
11
10
|
import tailwindStyles from "../../tailwind.css.js";
|
|
11
|
+
import { extractHalfWidthDigits } from "../../utils/extract-half-width-digits.js";
|
|
12
12
|
import "../dropdown-item/daikin-dropdown-item.js";
|
|
13
13
|
import "../dropdown/daikin-dropdown.js";
|
|
14
14
|
var __defProp = Object.defineProperty;
|
|
@@ -24,23 +24,31 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
24
24
|
const VALUE_TIME_REGEX = /^(?:[01][0-9]|2[0-3]):[0-5][0-9]$/;
|
|
25
25
|
const DEFAULT_MIN_TIME = "00:00";
|
|
26
26
|
const DEFAULT_MAX_TIME = "23:59";
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (meridiem === "AM") {
|
|
31
|
-
if (hour === 12) hour = 0;
|
|
32
|
-
} else {
|
|
33
|
-
if (hour !== 12) hour += 12;
|
|
27
|
+
function uiToTimeValue(object) {
|
|
28
|
+
if (object.hourCycle === "h23") {
|
|
29
|
+
return formatTimeForUI(formatPartsForUI(object));
|
|
34
30
|
}
|
|
31
|
+
const [hour12, minute] = formatPartsForUI(object).split(":").map(Number);
|
|
32
|
+
const hour = hour12 % 12 + (object.meridiem === "PM" ? 12 : 0);
|
|
35
33
|
return `${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}`;
|
|
36
34
|
}
|
|
37
|
-
function
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
function timeValueToUI(time, hourCycle) {
|
|
36
|
+
const [hour24, minute] = time.split(":").map(Number);
|
|
37
|
+
if (hourCycle === "h23") {
|
|
38
|
+
return {
|
|
39
|
+
hourCycle: "h23",
|
|
40
|
+
hour: hour24.toString().padStart(2, "0"),
|
|
41
|
+
minute: minute.toString().padStart(2, "0"),
|
|
42
|
+
meridiem: null
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const meridiem = hour24 >= 12 ? "PM" : "AM";
|
|
46
|
+
let hour12 = hour24 % 12;
|
|
41
47
|
if (hour12 === 0) hour12 = 12;
|
|
42
48
|
return {
|
|
43
|
-
|
|
49
|
+
hourCycle: "h12",
|
|
50
|
+
hour: hour12.toString().padStart(2, "0"),
|
|
51
|
+
minute: minute.toString().padStart(2, "0"),
|
|
44
52
|
meridiem
|
|
45
53
|
};
|
|
46
54
|
}
|
|
@@ -110,12 +118,39 @@ function getTimeItemInSelection(selectionStart, selectionEnd) {
|
|
|
110
118
|
}
|
|
111
119
|
return null;
|
|
112
120
|
}
|
|
113
|
-
function calcDigitInput(parts, item, digit, hourDigitIndex) {
|
|
121
|
+
function calcDigitInput(parts, item, digit, hourDigitIndex, hourCycle) {
|
|
114
122
|
if (!/^\d$/.test(digit)) {
|
|
115
123
|
return null;
|
|
116
124
|
}
|
|
117
125
|
switch (item) {
|
|
118
126
|
case "hour": {
|
|
127
|
+
if (hourCycle === "h23") {
|
|
128
|
+
if (hourDigitIndex === 1) {
|
|
129
|
+
const firstDigit = parts.hour[1];
|
|
130
|
+
if (firstDigit === "2") {
|
|
131
|
+
if (["0", "1", "2", "3"].includes(digit)) {
|
|
132
|
+
return {
|
|
133
|
+
parts: { ...parts, hour: `2${digit}` },
|
|
134
|
+
done: true
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
parts: { ...parts, hour: `0${digit}` },
|
|
139
|
+
done: true
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (firstDigit === "0" || firstDigit === "1") {
|
|
143
|
+
return {
|
|
144
|
+
parts: { ...parts, hour: `${firstDigit}${digit}` },
|
|
145
|
+
done: true
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
parts: { ...parts, hour: `0${digit}` },
|
|
151
|
+
done: digit > "2"
|
|
152
|
+
};
|
|
153
|
+
}
|
|
119
154
|
if (parts.hour === "01" && ["0", "1", "2"].includes(digit)) {
|
|
120
155
|
return {
|
|
121
156
|
parts: { ...parts, hour: `1${digit}` },
|
|
@@ -147,70 +182,74 @@ function calcDigitInput(parts, item, digit, hourDigitIndex) {
|
|
|
147
182
|
}
|
|
148
183
|
}
|
|
149
184
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
"focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"
|
|
183
|
-
],
|
|
184
|
-
true: ["enabled:[--color-base:var(--dds-color-common-danger-default)]"]
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
);
|
|
185
|
+
const fieldBaseClass = [
|
|
186
|
+
"flex",
|
|
187
|
+
"items-center",
|
|
188
|
+
"size-full",
|
|
189
|
+
"w-[calc(var(--dds-space-1600)+var(--dds-space-600)+var(--dds-space-100)+var(--dds-space-050))]",
|
|
190
|
+
"bg-ddt-color-common-background-default",
|
|
191
|
+
"px-[calc(var(--dds-padding-30)+0.25rem)]",
|
|
192
|
+
"rounded-sm",
|
|
193
|
+
"truncate",
|
|
194
|
+
"outline-solid",
|
|
195
|
+
"outline-(--color-border)",
|
|
196
|
+
"outline-0",
|
|
197
|
+
"-outline-offset-2",
|
|
198
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
199
|
+
"[--color-border:var(--color-state-focus,var(--color-base))]",
|
|
200
|
+
"border",
|
|
201
|
+
"border-(--color-border)",
|
|
202
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
203
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
204
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
205
|
+
"focus-visible:outline-2",
|
|
206
|
+
"disabled:[--color-border:var(--dds-color-common-disabled)]",
|
|
207
|
+
"disabled:text-ddt-color-common-disabled",
|
|
208
|
+
"disabled:bg-ddt-color-common-background-default",
|
|
209
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
210
|
+
].join(" ");
|
|
211
|
+
function getFieldClass(error) {
|
|
212
|
+
return [
|
|
213
|
+
fieldBaseClass,
|
|
214
|
+
error ? "enabled:[--color-base:var(--dds-color-common-danger-default)]" : "enabled:[--color-base:var(--dds-color-common-neutral-default)] focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"
|
|
215
|
+
].join(" ");
|
|
216
|
+
}
|
|
189
217
|
let DaikinTimePicker = class extends DDSFormElement {
|
|
190
218
|
constructor() {
|
|
191
219
|
super(...arguments);
|
|
192
220
|
this.disabled = false;
|
|
221
|
+
this.readonly = false;
|
|
193
222
|
this.required = false;
|
|
194
223
|
this.error = false;
|
|
224
|
+
this.hourCycle = "h12";
|
|
225
|
+
this.meridiemSingleOpen = true;
|
|
195
226
|
this._label = null;
|
|
196
227
|
this._inputValue = "";
|
|
197
228
|
this._currentSelection = "hour";
|
|
198
229
|
this._meridiem = "";
|
|
199
230
|
this._timeInputElement = createRef();
|
|
231
|
+
this._meridiemDropdown = createRef();
|
|
200
232
|
this._hourDigitIndex = 0;
|
|
233
|
+
this._preCompositionValue = "";
|
|
234
|
+
this._minuteDigitIndex = 0;
|
|
201
235
|
}
|
|
202
236
|
/**
|
|
203
237
|
* Returns the value to be displayed in the input field.
|
|
204
|
-
* - If the main value is a valid 24-hour time, returns
|
|
238
|
+
* - If the main value is a valid 24-hour time, returns a display string based on the selected hour cycle.
|
|
205
239
|
* - If the current input value is not valid or meridiem is empty, returns the raw input value.
|
|
206
240
|
* - Otherwise, returns null.
|
|
207
241
|
*/
|
|
208
242
|
get _value() {
|
|
209
243
|
if (isValidValueTime(this.value)) {
|
|
210
|
-
const
|
|
211
|
-
return
|
|
244
|
+
const ui = timeValueToUI(this.value, this.hourCycle);
|
|
245
|
+
return formatPartsForUI({ hour: ui.hour, minute: ui.minute });
|
|
212
246
|
}
|
|
213
|
-
|
|
247
|
+
const needsMeridiem = this.hourCycle === "h12";
|
|
248
|
+
if (this._timeValue && // Show the raw input value when it is not a valid 24h time OR when the
|
|
249
|
+
// UI hour is "00" (intermediate 12h entry state). Without the "00" check,
|
|
250
|
+
// "00:xx" would be treated as valid 24h and the getter would return null,
|
|
251
|
+
// causing Lit to clear the input field.
|
|
252
|
+
(!isValidValueTime(this._timeValue) || parsePartsFromUIValue(this._timeValue).hour === "00") || needsMeridiem && this._meridiem === "") {
|
|
214
253
|
return this._timeValue;
|
|
215
254
|
}
|
|
216
255
|
return null;
|
|
@@ -226,8 +265,8 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
226
265
|
*/
|
|
227
266
|
_syncMeridiemWithValue() {
|
|
228
267
|
if (this.value) {
|
|
229
|
-
const
|
|
230
|
-
this._meridiem = meridiem;
|
|
268
|
+
const ui = timeValueToUI(this.value, this.hourCycle);
|
|
269
|
+
this._meridiem = ui.meridiem ? ui.meridiem : "";
|
|
231
270
|
}
|
|
232
271
|
}
|
|
233
272
|
get _min() {
|
|
@@ -256,10 +295,13 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
256
295
|
this._inputValue = "";
|
|
257
296
|
target.value = "";
|
|
258
297
|
}
|
|
259
|
-
|
|
298
|
+
const allowZeroHour = this.hourCycle === "h23";
|
|
299
|
+
if (!allowZeroHour && target.value.startsWith("00")) {
|
|
260
300
|
this._convertZeroHourToTwelve();
|
|
301
|
+
this._updateValue();
|
|
261
302
|
}
|
|
262
303
|
this._hourDigitIndex = 0;
|
|
304
|
+
this._minuteDigitIndex = 0;
|
|
263
305
|
}
|
|
264
306
|
_handleChange(event) {
|
|
265
307
|
const target = event.target;
|
|
@@ -283,21 +325,103 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
283
325
|
this._updateSelection(timeItemInSelection);
|
|
284
326
|
}
|
|
285
327
|
}
|
|
286
|
-
_handleDigitInput(parts, item, digit, hourDigitIndex) {
|
|
287
|
-
if (
|
|
328
|
+
_handleDigitInput(parts, item, digit, hourDigitIndex, hourCycle) {
|
|
329
|
+
if (item === "hour") {
|
|
288
330
|
if (hourDigitIndex === 1) {
|
|
289
331
|
this._hourDigitIndex = 0;
|
|
290
332
|
} else {
|
|
291
333
|
this._hourDigitIndex = 1;
|
|
292
334
|
}
|
|
335
|
+
if (hourDigitIndex === 0) {
|
|
336
|
+
return {
|
|
337
|
+
parts: { ...parts, hour: `0${digit}` },
|
|
338
|
+
done: hourCycle === "h12" ? digit > "1" : digit > "2"
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (item === "minute") {
|
|
343
|
+
const minuteDigitIndex = this._minuteDigitIndex;
|
|
344
|
+
if (minuteDigitIndex === 1) {
|
|
345
|
+
this._minuteDigitIndex = 0;
|
|
346
|
+
} else {
|
|
347
|
+
this._minuteDigitIndex = 1;
|
|
348
|
+
}
|
|
349
|
+
if (minuteDigitIndex === 0) {
|
|
350
|
+
return {
|
|
351
|
+
parts: { ...parts, minute: `0${digit}` },
|
|
352
|
+
done: digit > "5"
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return calcDigitInput(parts, item, digit, hourDigitIndex, this.hourCycle);
|
|
357
|
+
}
|
|
358
|
+
// Saves the input's display value when IME composition starts so that
|
|
359
|
+
// _handleCompositionEnd can restore it if the browser inserted raw IME text.
|
|
360
|
+
_handleCompositionStart(event) {
|
|
361
|
+
this._preCompositionValue = event.target.value;
|
|
362
|
+
}
|
|
363
|
+
// Handles compositionend to support full-width and half-width digit input via IME.
|
|
364
|
+
// Full-width digits are converted to half-width, then each digit is applied as if
|
|
365
|
+
// the user had typed them one by one using the existing calcDigitInput logic.
|
|
366
|
+
_handleCompositionEnd(event) {
|
|
367
|
+
if (this.readonly) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const target = event.target;
|
|
371
|
+
const composedText = event.data;
|
|
372
|
+
target.value = this._preCompositionValue || PLACEHOLDER_ALL;
|
|
373
|
+
this._inputValue = target.value;
|
|
374
|
+
const digits = extractHalfWidthDigits(composedText);
|
|
375
|
+
if (digits.length === 0) {
|
|
376
|
+
this._updateInputSelection(target);
|
|
377
|
+
this._updateValue();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
this._applyDigits(target, digits);
|
|
381
|
+
}
|
|
382
|
+
// Applies a sequence of digit characters to the input starting from the currently
|
|
383
|
+
// selected time item, then commits the result to this.value.
|
|
384
|
+
// Shared by _handleKeyDown (single digit) and _handleCompositionEnd (multiple digits).
|
|
385
|
+
_applyDigits(target, digits) {
|
|
386
|
+
let parts = parsePartsFromUIValue(target.value);
|
|
387
|
+
let currentItem = this._currentSelection;
|
|
388
|
+
for (const digit of digits) {
|
|
389
|
+
const currentIndex = TIME_ITEMS.findIndex(
|
|
390
|
+
({ type }) => type === currentItem
|
|
391
|
+
);
|
|
392
|
+
if (currentIndex < 0) break;
|
|
393
|
+
const newState = this._handleDigitInput(
|
|
394
|
+
parts,
|
|
395
|
+
currentItem,
|
|
396
|
+
digit,
|
|
397
|
+
this._hourDigitIndex,
|
|
398
|
+
this.hourCycle
|
|
399
|
+
);
|
|
400
|
+
if (newState) {
|
|
401
|
+
parts = newState.parts;
|
|
402
|
+
if (newState.done) {
|
|
403
|
+
const nextIndex = Math.min(currentIndex + 1, TIME_ITEMS.length - 1);
|
|
404
|
+
currentItem = TIME_ITEMS[nextIndex].type;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
293
407
|
}
|
|
294
|
-
|
|
408
|
+
const newVal = formatPartsForUI(parts);
|
|
409
|
+
this._inputValue = newVal;
|
|
410
|
+
target.value = newVal;
|
|
411
|
+
this._updateSelection(currentItem);
|
|
412
|
+
this._updateValue();
|
|
295
413
|
}
|
|
296
414
|
_handleKeyDown(event) {
|
|
415
|
+
if (this.readonly) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
if (event.isComposing || event.key === "Process" || event.keyCode === 229) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
297
421
|
const target = event.target;
|
|
298
422
|
const key = event.key;
|
|
299
423
|
const parts = parsePartsFromUIValue(target.value);
|
|
300
|
-
if (key === "Backspace") {
|
|
424
|
+
if (key === "Backspace" || key === "Delete") {
|
|
301
425
|
event.preventDefault();
|
|
302
426
|
const itemToRemove = this._currentSelection;
|
|
303
427
|
const placeholder = {
|
|
@@ -313,30 +437,12 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
313
437
|
target.value = newVal;
|
|
314
438
|
this._updateSelection(itemToRemove);
|
|
315
439
|
}
|
|
316
|
-
this._updateValue(
|
|
440
|
+
this._updateValue();
|
|
317
441
|
return;
|
|
318
442
|
}
|
|
319
443
|
if (/^\d$/.test(key)) {
|
|
320
444
|
event.preventDefault();
|
|
321
|
-
|
|
322
|
-
parts,
|
|
323
|
-
this._currentSelection,
|
|
324
|
-
key,
|
|
325
|
-
this._hourDigitIndex
|
|
326
|
-
);
|
|
327
|
-
if (newState) {
|
|
328
|
-
const newVal = formatPartsForUI(newState.parts);
|
|
329
|
-
this._inputValue = newVal;
|
|
330
|
-
target.value = newVal;
|
|
331
|
-
const currentIndex = TIME_ITEMS.findIndex(
|
|
332
|
-
({ type }) => type === this._currentSelection
|
|
333
|
-
);
|
|
334
|
-
const nextIndex = currentIndex >= 0 ? Math.min(currentIndex + 1, TIME_ITEMS.length - 1) : -1;
|
|
335
|
-
this._updateSelection(
|
|
336
|
-
newState.done && nextIndex >= 0 ? TIME_ITEMS[nextIndex].type : this._currentSelection
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
this._updateValue(event);
|
|
445
|
+
this._applyDigits(target, [key]);
|
|
340
446
|
return;
|
|
341
447
|
}
|
|
342
448
|
const moveOffset = {
|
|
@@ -380,7 +486,11 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
380
486
|
let minute = parseInt(minuteStr, 10);
|
|
381
487
|
if (this._currentSelection === "hour") {
|
|
382
488
|
if (isNaN(hour)) hour = 0;
|
|
383
|
-
|
|
489
|
+
if (this.hourCycle === "h23") {
|
|
490
|
+
hour = (hour + offset + 24) % 24;
|
|
491
|
+
} else {
|
|
492
|
+
hour = (hour + offset + 11) % 12 + 1;
|
|
493
|
+
}
|
|
384
494
|
} else {
|
|
385
495
|
if (isNaN(minute)) minute = 0;
|
|
386
496
|
minute = (minute + offset * Number(this.minutesStep) + 60) % 60;
|
|
@@ -393,25 +503,47 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
393
503
|
}
|
|
394
504
|
_handleBeforeInput(event) {
|
|
395
505
|
event.preventDefault();
|
|
396
|
-
|
|
506
|
+
if (!event.isComposing) {
|
|
507
|
+
this._updateSelection(this._currentSelection);
|
|
508
|
+
}
|
|
397
509
|
}
|
|
398
510
|
/**
|
|
399
|
-
* Updates the value in 24-hour format if the input is valid,
|
|
511
|
+
* Updates the value in 24-hour format if the input is valid, while preserving the selected UI hour cycle.
|
|
400
512
|
*/
|
|
401
513
|
_updateValue(event) {
|
|
402
514
|
const target = (event == null ? void 0 : event.target) || this._timeInputElement.value;
|
|
403
515
|
if (!target) return;
|
|
516
|
+
const allowZeroHour = this.hourCycle === "h23";
|
|
517
|
+
const needsMeridiem = this.hourCycle === "h12";
|
|
404
518
|
this._inputValue = target.value;
|
|
405
519
|
if (target.value === PLACEHOLDER_ALL) {
|
|
406
520
|
this.error = false;
|
|
521
|
+
this.value = "";
|
|
407
522
|
return;
|
|
408
523
|
}
|
|
409
|
-
if (this._meridiem === "") {
|
|
524
|
+
if (needsMeridiem && this._meridiem === "") {
|
|
410
525
|
this.error = true;
|
|
526
|
+
this.value = "";
|
|
411
527
|
return;
|
|
412
528
|
}
|
|
413
529
|
const newTime = tryParseTimeFromUIValue(target.value);
|
|
414
|
-
const
|
|
530
|
+
const { hour: uiHour } = parsePartsFromUIValue(target.value);
|
|
531
|
+
if (!allowZeroHour && uiHour === "00") {
|
|
532
|
+
this.error = true;
|
|
533
|
+
this.value = "";
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const newValue = newTime != null ? uiToTimeValue(
|
|
537
|
+
this.hourCycle === "h23" ? {
|
|
538
|
+
hourCycle: "h23",
|
|
539
|
+
...parsePartsFromUIValue(newTime),
|
|
540
|
+
meridiem: null
|
|
541
|
+
} : {
|
|
542
|
+
hourCycle: "h12",
|
|
543
|
+
...parsePartsFromUIValue(newTime),
|
|
544
|
+
meridiem: this._meridiem
|
|
545
|
+
}
|
|
546
|
+
) : "";
|
|
415
547
|
this.error = !newValue || isTimeOutOfRange(newValue, this._min, this._max);
|
|
416
548
|
const changed = newValue !== this.value;
|
|
417
549
|
this.value = newValue;
|
|
@@ -450,13 +582,17 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
450
582
|
if (!selection) {
|
|
451
583
|
return;
|
|
452
584
|
}
|
|
585
|
+
const allowZeroHour = this.hourCycle === "h23";
|
|
453
586
|
const itemInfo = TIME_ITEMS.find(({ type }) => type === timeItem);
|
|
454
587
|
if (itemInfo) {
|
|
455
588
|
if (itemInfo.type === "minute") {
|
|
456
|
-
if (this._inputValue.startsWith("00")) {
|
|
589
|
+
if (!allowZeroHour && this._inputValue.startsWith("00")) {
|
|
457
590
|
this._convertZeroHourToTwelve();
|
|
458
591
|
}
|
|
459
592
|
this._hourDigitIndex = 0;
|
|
593
|
+
if (this._currentSelection !== "minute") {
|
|
594
|
+
this._minuteDigitIndex = 0;
|
|
595
|
+
}
|
|
460
596
|
}
|
|
461
597
|
(_a = this._timeInputElement.value) == null ? void 0 : _a.setSelectionRange(
|
|
462
598
|
itemInfo.range[0],
|
|
@@ -466,6 +602,9 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
466
602
|
}
|
|
467
603
|
}
|
|
468
604
|
_handleDropdownChange(event) {
|
|
605
|
+
if (this.readonly) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
469
608
|
const target = event.target;
|
|
470
609
|
this._meridiem = target.value;
|
|
471
610
|
const input = this._timeInputElement.value;
|
|
@@ -473,6 +612,33 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
473
612
|
this._updateValue();
|
|
474
613
|
}
|
|
475
614
|
}
|
|
615
|
+
_closeMeridiemDropdown() {
|
|
616
|
+
const dropdown = this._meridiemDropdown.value;
|
|
617
|
+
if (!dropdown || !dropdown.open) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
dropdown.open = false;
|
|
621
|
+
}
|
|
622
|
+
_handleMeridiemDropdownToggle(event) {
|
|
623
|
+
if (!this.meridiemSingleOpen) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const toggleEvent = event;
|
|
627
|
+
if (toggleEvent.newState !== "open") {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const root = this.getRootNode();
|
|
631
|
+
if (!(root instanceof Document || root instanceof ShadowRoot)) {
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const peerTimePickers = root.querySelectorAll("daikin-time-picker");
|
|
635
|
+
for (const peerElement of peerTimePickers) {
|
|
636
|
+
if (peerElement === this) {
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
peerElement._closeMeridiemDropdown();
|
|
640
|
+
}
|
|
641
|
+
}
|
|
476
642
|
/**
|
|
477
643
|
* Focuses on the inner time input.
|
|
478
644
|
* @param options focus options
|
|
@@ -482,44 +648,61 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
482
648
|
(_a = this._timeInputElement.value) == null ? void 0 : _a.focus(options);
|
|
483
649
|
}
|
|
484
650
|
render() {
|
|
651
|
+
const needsMeridiem = this.hourCycle === "h12";
|
|
485
652
|
return html`<div
|
|
486
653
|
role="group"
|
|
487
654
|
aria-label=${ifDefined(this._label ?? void 0)}
|
|
488
|
-
class="flex flex-row h-full gap-2"
|
|
655
|
+
class="flex flex-row h-full gap-2 w-fit"
|
|
489
656
|
>
|
|
490
657
|
<input
|
|
491
658
|
${ref(this._timeInputElement)}
|
|
492
|
-
class=${
|
|
659
|
+
class=${getFieldClass(this.error)}
|
|
493
660
|
type="text"
|
|
494
661
|
name=${ifDefined(this.getBackingProperty("name"))}
|
|
495
662
|
placeholder=${this.placeholder}
|
|
496
663
|
.value=${this._value ?? ""}
|
|
497
664
|
?disabled=${this.disabled}
|
|
665
|
+
?readonly=${this.readonly}
|
|
498
666
|
?required=${this.required}
|
|
499
667
|
@change=${this._handleChange}
|
|
668
|
+
@compositionstart=${this._handleCompositionStart}
|
|
669
|
+
@compositionend=${this._handleCompositionEnd}
|
|
500
670
|
@focusin=${this._handleFocusIn}
|
|
501
671
|
@focusout=${this._handleFocusOut}
|
|
502
672
|
@keydown=${this._handleKeyDown}
|
|
503
673
|
@beforeinput=${this._handleBeforeInput}
|
|
504
674
|
@mouseup=${this._handleMouseUp}
|
|
505
675
|
/>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
676
|
+
${needsMeridiem ? html`<daikin-dropdown
|
|
677
|
+
${ref(this._meridiemDropdown)}
|
|
678
|
+
class="w-[calc(var(--dds-space-1600)+var(--dds-space-600))]"
|
|
679
|
+
placeholder="--"
|
|
680
|
+
.error=${this.error}
|
|
681
|
+
.value=${this._meridiem}
|
|
682
|
+
?disabled=${this.disabled}
|
|
683
|
+
?readonly=${this.readonly}
|
|
684
|
+
@change=${this._handleDropdownChange}
|
|
685
|
+
@toggle=${this._handleMeridiemDropdownToggle}
|
|
686
|
+
>
|
|
687
|
+
<daikin-dropdown-item value="AM">AM</daikin-dropdown-item>
|
|
688
|
+
<daikin-dropdown-item value="PM">PM</daikin-dropdown-item>
|
|
689
|
+
</daikin-dropdown>` : null}
|
|
517
690
|
</div>`;
|
|
518
691
|
}
|
|
519
692
|
willUpdate(changedProperties) {
|
|
520
|
-
if (changedProperties.has("
|
|
693
|
+
if (changedProperties.has("hourCycle")) {
|
|
521
694
|
if (isValidValueTime(this.value)) {
|
|
522
695
|
this._syncMeridiemWithValue();
|
|
696
|
+
}
|
|
697
|
+
if (isValidValueTime(this.value)) {
|
|
698
|
+
this.error = isTimeOutOfRange(this.value, this.min, this.max);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
if (changedProperties.has("value")) {
|
|
702
|
+
if (isValidValueTime(this.value)) {
|
|
703
|
+
if (this.hourCycle !== "h23") {
|
|
704
|
+
this._syncMeridiemWithValue();
|
|
705
|
+
}
|
|
523
706
|
if (isTimeOutOfRange(this.value, this.min, this.max)) {
|
|
524
707
|
this.error = true;
|
|
525
708
|
} else {
|
|
@@ -540,6 +723,7 @@ let DaikinTimePicker = class extends DDSFormElement {
|
|
|
540
723
|
reflectInputGroup(inputGroup) {
|
|
541
724
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
542
725
|
this.disabled = !!inputGroup.disabled;
|
|
726
|
+
this.readonly = !!inputGroup.readonly;
|
|
543
727
|
this.required = !!inputGroup.required;
|
|
544
728
|
this.error = isError;
|
|
545
729
|
this._label = inputGroup.label ?? null;
|
|
@@ -549,9 +733,27 @@ DaikinTimePicker.styles = css`
|
|
|
549
733
|
${unsafeCSS(tailwindStyles)}
|
|
550
734
|
|
|
551
735
|
:host {
|
|
552
|
-
display: flex;
|
|
736
|
+
display: inline-flex;
|
|
553
737
|
align-items: center;
|
|
554
|
-
height: 3rem;
|
|
738
|
+
height: var(--dds-input-height, 3rem);
|
|
739
|
+
width: fit-content;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
:host([readonly]:not([disabled])) input {
|
|
743
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
744
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
:host([readonly]:not([disabled])) input:hover,
|
|
748
|
+
:host([readonly]:not([disabled])) input:active {
|
|
749
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
750
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
:host([readonly][error]:not([disabled])) input,
|
|
754
|
+
:host([readonly][error]:not([disabled])) input:hover,
|
|
755
|
+
:host([readonly][error]:not([disabled])) input:active {
|
|
756
|
+
--color-base: var(--dds-color-common-danger-default);
|
|
555
757
|
}
|
|
556
758
|
`;
|
|
557
759
|
__decorateClass([
|
|
@@ -566,12 +768,24 @@ __decorateClass([
|
|
|
566
768
|
__decorateClass([
|
|
567
769
|
property({ type: Boolean, reflect: true })
|
|
568
770
|
], DaikinTimePicker.prototype, "disabled", 2);
|
|
771
|
+
__decorateClass([
|
|
772
|
+
property({ type: Boolean, reflect: true })
|
|
773
|
+
], DaikinTimePicker.prototype, "readonly", 2);
|
|
569
774
|
__decorateClass([
|
|
570
775
|
property({ type: Boolean, reflect: true })
|
|
571
776
|
], DaikinTimePicker.prototype, "required", 2);
|
|
572
777
|
__decorateClass([
|
|
573
778
|
property({ type: Boolean, reflect: true })
|
|
574
779
|
], DaikinTimePicker.prototype, "error", 2);
|
|
780
|
+
__decorateClass([
|
|
781
|
+
property({
|
|
782
|
+
type: String,
|
|
783
|
+
reflect: true,
|
|
784
|
+
attribute: "hour-cycle",
|
|
785
|
+
fallbackValue: "h12",
|
|
786
|
+
isAllowedValue: oneOf(["h12", "h23"])
|
|
787
|
+
})
|
|
788
|
+
], DaikinTimePicker.prototype, "hourCycle", 2);
|
|
575
789
|
__decorateClass([
|
|
576
790
|
property({
|
|
577
791
|
type: String,
|
|
@@ -580,6 +794,9 @@ __decorateClass([
|
|
|
580
794
|
fallbackValue: "1"
|
|
581
795
|
})
|
|
582
796
|
], DaikinTimePicker.prototype, "minutesStep", 2);
|
|
797
|
+
__decorateClass([
|
|
798
|
+
property({ type: Boolean, reflect: true, attribute: "meridiem-single-open" })
|
|
799
|
+
], DaikinTimePicker.prototype, "meridiemSingleOpen", 2);
|
|
583
800
|
__decorateClass([
|
|
584
801
|
state()
|
|
585
802
|
], DaikinTimePicker.prototype, "_label", 2);
|
|
@@ -600,11 +817,11 @@ export {
|
|
|
600
817
|
calcDigitInput,
|
|
601
818
|
formatPartsForUI,
|
|
602
819
|
formatTimeForUI,
|
|
603
|
-
from24HourFormat,
|
|
604
820
|
getTimeItemInSelection,
|
|
605
821
|
isTimeOutOfRange,
|
|
606
822
|
isValidValueTime,
|
|
607
823
|
parsePartsFromUIValue,
|
|
608
|
-
|
|
609
|
-
tryParseTimeFromUIValue
|
|
824
|
+
timeValueToUI,
|
|
825
|
+
tryParseTimeFromUIValue,
|
|
826
|
+
uiToTimeValue
|
|
610
827
|
};
|