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