@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
|
@@ -16,6 +16,7 @@ const floatingUiAutoUpdate = require("../../controllers/floating-ui-auto-update.
|
|
|
16
16
|
const focusTrap = require("../../controllers/focus-trap.cjs");
|
|
17
17
|
const tailwind = require("../../tailwind.css.cjs");
|
|
18
18
|
const calendarCommon = require("../../utils/calendar-common.cjs");
|
|
19
|
+
const extractHalfWidthDigits = require("../../utils/extract-half-width-digits.cjs");
|
|
19
20
|
const reDispatch = require("../../utils/re-dispatch.cjs");
|
|
20
21
|
require("../calendar/daikin-calendar.cjs");
|
|
21
22
|
require("../icon-button/daikin-icon-button.cjs");
|
|
@@ -30,18 +31,18 @@ var __decorateClass = (decorators2, target, key, kind) => {
|
|
|
30
31
|
return result;
|
|
31
32
|
};
|
|
32
33
|
const dateTimeFormatPartsCache = /* @__PURE__ */ new Map();
|
|
33
|
-
function getSafeDateTimeFormatParts(
|
|
34
|
+
function getSafeDateTimeFormatParts(inputLocale) {
|
|
34
35
|
const options = {
|
|
35
36
|
year: "numeric",
|
|
36
37
|
month: "numeric",
|
|
37
38
|
day: "numeric"
|
|
38
39
|
};
|
|
39
|
-
const key =
|
|
40
|
+
const key = inputLocale ?? "__DEFAULT__";
|
|
40
41
|
const cached = dateTimeFormatPartsCache.get(key);
|
|
41
42
|
if (cached) return cached;
|
|
42
43
|
try {
|
|
43
44
|
const parts = new Intl.DateTimeFormat(
|
|
44
|
-
|
|
45
|
+
inputLocale ?? void 0,
|
|
45
46
|
options
|
|
46
47
|
).formatToParts(0);
|
|
47
48
|
dateTimeFormatPartsCache.set(key, parts);
|
|
@@ -52,8 +53,8 @@ function getSafeDateTimeFormatParts(locale) {
|
|
|
52
53
|
return parts;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
function getDateOrderAndSeparator(
|
|
56
|
-
const parts = getSafeDateTimeFormatParts(
|
|
56
|
+
function getDateOrderAndSeparator(inputLocale) {
|
|
57
|
+
const parts = getSafeDateTimeFormatParts(inputLocale ?? void 0);
|
|
57
58
|
const order = parts.filter(
|
|
58
59
|
(p) => ["year", "month", "day"].includes(p.type)
|
|
59
60
|
).map((p) => p.type);
|
|
@@ -70,8 +71,8 @@ function getDateOrderAndSeparator(locale) {
|
|
|
70
71
|
}
|
|
71
72
|
return { order, sep };
|
|
72
73
|
}
|
|
73
|
-
function getDateItems(
|
|
74
|
-
const { order, sep } = getDateOrderAndSeparator(
|
|
74
|
+
function getDateItems(inputLocale) {
|
|
75
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
75
76
|
const lengths = { year: 4, month: 2, day: 2 };
|
|
76
77
|
const items = order.map((key, i) => {
|
|
77
78
|
const type = key;
|
|
@@ -90,9 +91,10 @@ const cvaField = classVarianceAuthority.cva(
|
|
|
90
91
|
"flex",
|
|
91
92
|
"items-center",
|
|
92
93
|
"size-full",
|
|
94
|
+
"min-h-(--dds-input-height)",
|
|
93
95
|
"bg-ddt-color-common-background-default",
|
|
94
|
-
"pl-
|
|
95
|
-
"pr-10",
|
|
96
|
+
"pl-[calc(var(--dds-padding-30)+0.25rem)]",
|
|
97
|
+
"pr-[calc((var(--dds-gap-10))+var(--dds-icon-button)+0.5rem)]",
|
|
96
98
|
"rounded-sm",
|
|
97
99
|
"truncate",
|
|
98
100
|
"outline-solid",
|
|
@@ -128,25 +130,25 @@ const cvaField = classVarianceAuthority.cva(
|
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
);
|
|
131
|
-
function parsePartsFromUIValue(value,
|
|
132
|
-
const { order, sep } = getDateOrderAndSeparator(
|
|
133
|
+
function parsePartsFromUIValue(value, inputLocale) {
|
|
134
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
133
135
|
const parts = value.split(sep);
|
|
134
136
|
return Object.fromEntries(
|
|
135
137
|
order.map((key, i) => [key, parts[i] ?? ""])
|
|
136
138
|
);
|
|
137
139
|
}
|
|
138
|
-
function formatPartsForUI(parts,
|
|
139
|
-
const { order, sep } = getDateOrderAndSeparator(
|
|
140
|
+
function formatPartsForUI(parts, inputLocale) {
|
|
141
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
140
142
|
return order.map((k) => parts[k]).join(sep);
|
|
141
143
|
}
|
|
142
|
-
function getPlaceholderAll(
|
|
144
|
+
function getPlaceholderAll(inputLocale) {
|
|
143
145
|
return formatPartsForUI(
|
|
144
146
|
{ year: PLACEHOLDER_YEAR, month: PLACEHOLDER_MONTH, day: PLACEHOLDER_DAY },
|
|
145
|
-
|
|
147
|
+
inputLocale
|
|
146
148
|
);
|
|
147
149
|
}
|
|
148
|
-
function tryParseDateFromUIValue(value,
|
|
149
|
-
const { year, month, day } = parsePartsFromUIValue(value,
|
|
150
|
+
function tryParseDateFromUIValue(value, inputLocale) {
|
|
151
|
+
const { year, month, day } = parsePartsFromUIValue(value, inputLocale);
|
|
150
152
|
if (
|
|
151
153
|
// Prevent treating incomplete year entries (such as 0202) as valid.
|
|
152
154
|
// This also means that dates less than 1000 years ago cannot be handled.
|
|
@@ -160,18 +162,18 @@ function tryParseDateFromUIValue(value, locale) {
|
|
|
160
162
|
}
|
|
161
163
|
return date;
|
|
162
164
|
}
|
|
163
|
-
function formatDateForUI(date,
|
|
165
|
+
function formatDateForUI(date, inputLocale) {
|
|
164
166
|
return formatPartsForUI(
|
|
165
167
|
{
|
|
166
168
|
year: String(date.getUTCFullYear()).padStart(4, "0"),
|
|
167
169
|
month: String(date.getUTCMonth() + 1).padStart(2, "0"),
|
|
168
170
|
day: String(date.getUTCDate()).padStart(2, "0")
|
|
169
171
|
},
|
|
170
|
-
|
|
172
|
+
inputLocale
|
|
171
173
|
);
|
|
172
174
|
}
|
|
173
|
-
function getDateItemInSelection(selectionStart, selectionEnd,
|
|
174
|
-
for (const { type, range } of getDateItems(
|
|
175
|
+
function getDateItemInSelection(selectionStart, selectionEnd, inputLocale) {
|
|
176
|
+
for (const { type, range } of getDateItems(inputLocale)) {
|
|
175
177
|
if (range[0] <= selectionStart && selectionStart <= range[1] && range[0] <= selectionEnd && selectionEnd <= range[1]) {
|
|
176
178
|
return type;
|
|
177
179
|
}
|
|
@@ -287,13 +289,19 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
287
289
|
this.open = false;
|
|
288
290
|
this.defaultValue = null;
|
|
289
291
|
this.locale = null;
|
|
292
|
+
this.inputLocale = null;
|
|
290
293
|
this._label = null;
|
|
291
294
|
this._currentSelection = "month";
|
|
295
|
+
this._preCompositionValue = "";
|
|
296
|
+
this._inputValue = "";
|
|
297
|
+
this._monthDigitIndex = 0;
|
|
298
|
+
this._dayDigitIndex = 0;
|
|
299
|
+
this._yearDigitIndex = 0;
|
|
292
300
|
this._autoUpdateController = new floatingUiAutoUpdate.FloatingUIAutoUpdateController(this);
|
|
293
301
|
this._dateInputElement = ref_js.createRef();
|
|
294
302
|
this._calendarElement = ref_js.createRef();
|
|
295
303
|
this._calendarButtonElement = ref_js.createRef();
|
|
296
|
-
this._getLocale = () => this.
|
|
304
|
+
this._getLocale = () => this.inputLocale ?? null;
|
|
297
305
|
this._getDateItems = () => getDateItems(this._getLocale());
|
|
298
306
|
this._parsePartsFromUIValue = (v) => parsePartsFromUIValue(v, this._getLocale());
|
|
299
307
|
this._formatPartsForUI = (p) => formatPartsForUI(p, this._getLocale());
|
|
@@ -317,9 +325,29 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
317
325
|
static getDefaultPlaceholder(element) {
|
|
318
326
|
return getPlaceholderAll(element._getLocale());
|
|
319
327
|
}
|
|
320
|
-
get
|
|
328
|
+
get _dateValue() {
|
|
321
329
|
return calendarCommon.tryParseDateFromProperty(this.value);
|
|
322
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Returns the string to bind to the <input> element's .value property.
|
|
333
|
+
*
|
|
334
|
+
* - When this.value holds a valid date, show the locale-formatted date.
|
|
335
|
+
* - When _inputValue contains partial or invalid content (placeholders / impossible
|
|
336
|
+
* dates like 02/31), return it so the user's in-progress entry is preserved
|
|
337
|
+
* across Lit re-renders.
|
|
338
|
+
* - Otherwise (e.g. this.value was cleared externally while _inputValue still
|
|
339
|
+
* holds a now-stale complete valid date string) return "" so the CSS placeholder
|
|
340
|
+
* text is visible instead.
|
|
341
|
+
*/
|
|
342
|
+
get _displayValue() {
|
|
343
|
+
if (this._dateValue) {
|
|
344
|
+
return this._formatDateForUI(this._dateValue);
|
|
345
|
+
}
|
|
346
|
+
if (this._inputValue && !this._tryParseDateFromUIValue(this._inputValue)) {
|
|
347
|
+
return this._inputValue;
|
|
348
|
+
}
|
|
349
|
+
return "";
|
|
350
|
+
}
|
|
323
351
|
get _min() {
|
|
324
352
|
return calendarCommon.tryParseDateFromProperty(this.min) ?? calendarCommon.parseDateFromProperty(calendarCommon.DEFAULT_MIN_DATE);
|
|
325
353
|
}
|
|
@@ -349,10 +377,11 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
349
377
|
const target = event.target;
|
|
350
378
|
if (target.value === this._getPlaceholderAll()) {
|
|
351
379
|
target.value = "";
|
|
380
|
+
this._inputValue = "";
|
|
352
381
|
}
|
|
353
382
|
}
|
|
354
383
|
_handleChange(event) {
|
|
355
|
-
this._updateValue(event);
|
|
384
|
+
this._updateValue(event.target);
|
|
356
385
|
}
|
|
357
386
|
_handleMouseUp(event) {
|
|
358
387
|
var _a, _b;
|
|
@@ -371,14 +400,104 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
371
400
|
this._updateSelection(dateItemInSelection);
|
|
372
401
|
}
|
|
373
402
|
}
|
|
403
|
+
// Saves the input's display value when IME composition starts so that
|
|
404
|
+
// `_handleCompositionEnd` can restore it if the browser inserted raw IME text.
|
|
405
|
+
_handleCompositionStart(event) {
|
|
406
|
+
this._preCompositionValue = event.target.value;
|
|
407
|
+
}
|
|
408
|
+
// Handle compositionend to support full-width and half-width digit input via IME.
|
|
409
|
+
// Full-width digits are converted to half-width, then each digit is applied as if
|
|
410
|
+
// the user had typed them one by one using the existing handleDigitInput logic.
|
|
411
|
+
_handleCompositionEnd(event) {
|
|
412
|
+
const target = event.target;
|
|
413
|
+
const composedText = event.data;
|
|
414
|
+
target.value = this._preCompositionValue || this._getPlaceholderAll();
|
|
415
|
+
const digits = extractHalfWidthDigits.extractHalfWidthDigits(composedText);
|
|
416
|
+
if (digits.length === 0) {
|
|
417
|
+
this._updateInputSelection(target);
|
|
418
|
+
this._updateValue(target);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
this._applyDigits(target, digits);
|
|
422
|
+
}
|
|
423
|
+
// Applies a single digit to the given date part, incorporating fresh-entry
|
|
424
|
+
// tracking for month and day. Extracted from _applyDigits to keep complexity low.
|
|
425
|
+
_applyDigitToPart(parts, item, digit) {
|
|
426
|
+
if (item === "month") {
|
|
427
|
+
const monthDigitIndex = this._monthDigitIndex;
|
|
428
|
+
if (monthDigitIndex === 0) {
|
|
429
|
+
this._monthDigitIndex = 1;
|
|
430
|
+
if (digit === "0") {
|
|
431
|
+
return { parts: { ...parts, month: "00" }, done: false };
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
parts: { ...parts, month: `0${digit}` },
|
|
435
|
+
done: digit !== "1"
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
this._monthDigitIndex = 0;
|
|
439
|
+
if (parts.month === "00") {
|
|
440
|
+
if (digit === "0") return null;
|
|
441
|
+
return { parts: { ...parts, month: `0${digit}` }, done: true };
|
|
442
|
+
}
|
|
443
|
+
} else if (item === "day") {
|
|
444
|
+
const dayDigitIndex = this._dayDigitIndex;
|
|
445
|
+
if (dayDigitIndex === 0) {
|
|
446
|
+
this._dayDigitIndex = 1;
|
|
447
|
+
if (digit === "0") {
|
|
448
|
+
return { parts: { ...parts, day: "00" }, done: false };
|
|
449
|
+
}
|
|
450
|
+
return {
|
|
451
|
+
parts: { ...parts, day: `0${digit}` },
|
|
452
|
+
done: !["1", "2", "3"].includes(digit)
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
this._dayDigitIndex = 0;
|
|
456
|
+
if (parts.day === "00") {
|
|
457
|
+
if (digit === "0") return null;
|
|
458
|
+
return { parts: { ...parts, day: `0${digit}` }, done: true };
|
|
459
|
+
}
|
|
460
|
+
} else if (this._yearDigitIndex === 0) {
|
|
461
|
+
this._yearDigitIndex = 1;
|
|
462
|
+
return { parts: { ...parts, year: `000${digit}` }, done: false };
|
|
463
|
+
}
|
|
464
|
+
return handleDigitInput(parts, item, digit);
|
|
465
|
+
}
|
|
466
|
+
// Applies a sequence of digit characters to the input starting from the currently
|
|
467
|
+
// selected date item, then commits the result to this.value.
|
|
468
|
+
// Shared by _handleKeyDown (single digit) and _handleCompositionEnd (multiple digits).
|
|
469
|
+
_applyDigits(target, digits) {
|
|
470
|
+
const items = this._getDateItems();
|
|
471
|
+
let parts = this._parsePartsFromUIValue(target.value);
|
|
472
|
+
let currentItem = this._currentSelection;
|
|
473
|
+
for (const digit of digits) {
|
|
474
|
+
const currentIndex = items.findIndex(({ type }) => type === currentItem);
|
|
475
|
+
if (currentIndex < 0) break;
|
|
476
|
+
const newState = this._applyDigitToPart(parts, currentItem, digit);
|
|
477
|
+
if (!newState) continue;
|
|
478
|
+
parts = newState.parts;
|
|
479
|
+
if (!newState.done) continue;
|
|
480
|
+
const nextIndex = Math.min(currentIndex + 1, items.length - 1);
|
|
481
|
+
currentItem = items[nextIndex].type;
|
|
482
|
+
this._monthDigitIndex = 0;
|
|
483
|
+
this._dayDigitIndex = 0;
|
|
484
|
+
this._yearDigitIndex = 0;
|
|
485
|
+
}
|
|
486
|
+
target.value = this._formatPartsForUI(parts);
|
|
487
|
+
this._updateSelection(currentItem);
|
|
488
|
+
this._updateValue(target);
|
|
489
|
+
}
|
|
374
490
|
_handleKeyDown(event) {
|
|
375
491
|
if (this.readonly) {
|
|
376
492
|
return;
|
|
377
493
|
}
|
|
494
|
+
if (event.isComposing || event.key === "Process" || event.keyCode === 229) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
378
497
|
const target = event.target;
|
|
379
498
|
const key = event.key;
|
|
380
499
|
const parts = this._parsePartsFromUIValue(target.value);
|
|
381
|
-
if (key === "Backspace") {
|
|
500
|
+
if (key === "Backspace" || key === "Delete") {
|
|
382
501
|
event.preventDefault();
|
|
383
502
|
const itemToRemove = this._currentSelection;
|
|
384
503
|
const placeholder = {
|
|
@@ -393,24 +512,12 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
393
512
|
});
|
|
394
513
|
this._updateSelection(itemToRemove);
|
|
395
514
|
}
|
|
396
|
-
this._updateValue(
|
|
515
|
+
this._updateValue(target);
|
|
397
516
|
return;
|
|
398
517
|
}
|
|
399
518
|
if (/^\d$/.test(key)) {
|
|
400
519
|
event.preventDefault();
|
|
401
|
-
|
|
402
|
-
if (newState) {
|
|
403
|
-
target.value = this._formatPartsForUI(newState.parts);
|
|
404
|
-
const items = this._getDateItems();
|
|
405
|
-
const currentIndex = items.findIndex(
|
|
406
|
-
({ type }) => type === this._currentSelection
|
|
407
|
-
);
|
|
408
|
-
const nextIndex = currentIndex >= 0 ? Math.min(currentIndex + 1, items.length - 1) : -1;
|
|
409
|
-
this._updateSelection(
|
|
410
|
-
newState.done && nextIndex >= 0 ? items[nextIndex].type : this._currentSelection
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
this._updateValue(event);
|
|
520
|
+
this._applyDigits(target, [key]);
|
|
414
521
|
return;
|
|
415
522
|
}
|
|
416
523
|
const moveOffset = {
|
|
@@ -445,7 +552,7 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
445
552
|
target.value = this._formatPartsForUI(newParts);
|
|
446
553
|
this._updateSelection(this._currentSelection);
|
|
447
554
|
}
|
|
448
|
-
this._updateValue(
|
|
555
|
+
this._updateValue(target);
|
|
449
556
|
return;
|
|
450
557
|
}
|
|
451
558
|
if (key.length <= 1) {
|
|
@@ -454,10 +561,15 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
454
561
|
}
|
|
455
562
|
}
|
|
456
563
|
// Depending on the PC settings, a period may be entered when the space key is pressed repeatedly, so this is stopped.
|
|
457
|
-
// When this happens, the selection range changes, so this is also reset.
|
|
564
|
+
// When this happens, the selection range changes, so this is also reset to the current item.
|
|
565
|
+
// Note: _updateInputSelection is intentionally NOT used here because it always moves focus to the
|
|
566
|
+
// first item, which would break IME input on non-first fields (e.g. compositionend would always
|
|
567
|
+
// edit the first date part instead of the one the user is on).
|
|
458
568
|
_handleBeforeInput(event) {
|
|
459
569
|
event.preventDefault();
|
|
460
|
-
|
|
570
|
+
if (!event.isComposing) {
|
|
571
|
+
this._updateSelection(this._currentSelection);
|
|
572
|
+
}
|
|
461
573
|
}
|
|
462
574
|
_handleSelect(event) {
|
|
463
575
|
event.stopPropagation();
|
|
@@ -467,8 +579,10 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
467
579
|
}
|
|
468
580
|
const target = this._dateInputElement.value;
|
|
469
581
|
const value = calendarCommon.parseDateFromProperty(calendar.value);
|
|
582
|
+
const formattedForUI = this._formatDateForUI(value);
|
|
470
583
|
this.value = calendarCommon.formatDateForProperty(value);
|
|
471
|
-
target.value =
|
|
584
|
+
target.value = formattedForUI;
|
|
585
|
+
this._inputValue = formattedForUI;
|
|
472
586
|
this.error = false;
|
|
473
587
|
if (event.type === "select") {
|
|
474
588
|
this.open = false;
|
|
@@ -504,19 +618,46 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
504
618
|
}
|
|
505
619
|
}
|
|
506
620
|
}
|
|
507
|
-
|
|
508
|
-
|
|
621
|
+
/**
|
|
622
|
+
* Returns true if all date parts (year/month/day) in the input are filled with
|
|
623
|
+
* digits and no placeholder text (YYYY, MM, DD) remains.
|
|
624
|
+
*/
|
|
625
|
+
_isInputComplete(value) {
|
|
626
|
+
const parts = this._parsePartsFromUIValue(value);
|
|
627
|
+
return /^\d{4}$/.test(parts.year) && /^\d{2}$/.test(parts.month) && /^\d{2}$/.test(parts.day);
|
|
628
|
+
}
|
|
629
|
+
_updateValue(target) {
|
|
630
|
+
this._inputValue = target.value;
|
|
509
631
|
if (target.value === this._getPlaceholderAll()) {
|
|
510
632
|
this.error = false;
|
|
633
|
+
this.value = "";
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
if (!this._isInputComplete(target.value)) {
|
|
637
|
+
this.error = true;
|
|
638
|
+
this.value = "";
|
|
511
639
|
return;
|
|
512
640
|
}
|
|
513
641
|
const newDate = this._tryParseDateFromUIValue(target.value);
|
|
514
|
-
if (!newDate
|
|
642
|
+
if (!newDate) {
|
|
643
|
+
this.error = true;
|
|
644
|
+
this.value = "";
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const newValue = calendarCommon.formatDateForProperty(newDate);
|
|
648
|
+
if (calendarCommon.isDateOutOfRange(newDate, this._min, this._max)) {
|
|
515
649
|
this.error = true;
|
|
650
|
+
if (this.value !== newValue) {
|
|
651
|
+
this.value = newValue;
|
|
652
|
+
this._emitSelect();
|
|
653
|
+
}
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
if (!this.error && !this.open && this.value === newValue) {
|
|
516
657
|
return;
|
|
517
658
|
}
|
|
518
659
|
this.error = false;
|
|
519
|
-
this.value =
|
|
660
|
+
this.value = newValue;
|
|
520
661
|
this.open = false;
|
|
521
662
|
this._emitSelect();
|
|
522
663
|
}
|
|
@@ -528,12 +669,16 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
528
669
|
}
|
|
529
670
|
if (target.value === "") {
|
|
530
671
|
target.value = this._getPlaceholderAll();
|
|
672
|
+
this._inputValue = this._getPlaceholderAll();
|
|
531
673
|
}
|
|
532
674
|
const itemInfo = this._getDateItems()[0];
|
|
533
675
|
(_a = this._dateInputElement.value) == null ? void 0 : _a.setSelectionRange(
|
|
534
676
|
itemInfo.range[0],
|
|
535
677
|
itemInfo.range[1]
|
|
536
678
|
);
|
|
679
|
+
this._monthDigitIndex = 0;
|
|
680
|
+
this._dayDigitIndex = 0;
|
|
681
|
+
this._yearDigitIndex = 0;
|
|
537
682
|
this._currentSelection = itemInfo.type;
|
|
538
683
|
}
|
|
539
684
|
_updateSelection(dateItem) {
|
|
@@ -544,6 +689,11 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
544
689
|
}
|
|
545
690
|
const itemInfo = this._getDateItems().find(({ type }) => type === dateItem);
|
|
546
691
|
if (itemInfo) {
|
|
692
|
+
if (dateItem !== this._currentSelection) {
|
|
693
|
+
if (dateItem === "month") this._monthDigitIndex = 0;
|
|
694
|
+
if (dateItem === "day") this._dayDigitIndex = 0;
|
|
695
|
+
if (dateItem === "year") this._yearDigitIndex = 0;
|
|
696
|
+
}
|
|
547
697
|
(_a = this._dateInputElement.value) == null ? void 0 : _a.setSelectionRange(
|
|
548
698
|
itemInfo.range[0],
|
|
549
699
|
itemInfo.range[1]
|
|
@@ -576,28 +726,30 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
576
726
|
?disabled=${this.disabled}
|
|
577
727
|
?readonly=${this.readonly}
|
|
578
728
|
?required=${this.required}
|
|
579
|
-
.value=${this.
|
|
729
|
+
.value=${this._displayValue}
|
|
580
730
|
@change=${this._handleChange}
|
|
731
|
+
@compositionstart=${this._handleCompositionStart}
|
|
732
|
+
@compositionend=${this._handleCompositionEnd}
|
|
581
733
|
@focusin=${this._handleFocusIn}
|
|
582
734
|
@focusout=${this._handleFocusOut}
|
|
583
735
|
@keydown=${this._handleKeyDown}
|
|
584
736
|
@beforeinput=${this._handleBeforeInput}
|
|
585
737
|
@mouseup=${this._handleMouseUp}
|
|
586
738
|
/>
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
739
|
+
${this.readonly && !this.disabled ? lit.nothing : lit.html`<daikin-icon-button
|
|
740
|
+
${ref_js.ref(this._calendarButtonElement)}
|
|
741
|
+
class="absolute size-(--dds-icon-button) top-0 bottom-0 right-2 m-auto"
|
|
742
|
+
type="button"
|
|
743
|
+
color="neutral"
|
|
744
|
+
variant="ghost"
|
|
745
|
+
button-aria-label="Open the date picker"
|
|
746
|
+
?disabled=${this.disabled}
|
|
747
|
+
@pointerdown=${this._handlePointerDown}
|
|
748
|
+
@pointerup=${this._handlePointerUp}
|
|
749
|
+
@keydown=${this._handleCalendarKeyDown}
|
|
750
|
+
>
|
|
751
|
+
<span class=${calendarCommon.cvaIconButton({ intent: "calender" })}></span>
|
|
752
|
+
</daikin-icon-button>`}
|
|
601
753
|
<span class="sr-only" aria-live="polite"
|
|
602
754
|
>${this.value ? `${this._label ?? ""} Selected: ${this.value}` : ""}
|
|
603
755
|
</span>
|
|
@@ -606,11 +758,12 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
606
758
|
${ref_js.ref(this._calendarElement)}
|
|
607
759
|
${this._focusTrapController.refContainer()}
|
|
608
760
|
id="calendar"
|
|
609
|
-
value=${this.
|
|
761
|
+
value=${this._dateValue ? calendarCommon.formatDateForProperty(this._dateValue) : lit.nothing}
|
|
610
762
|
min=${calendarCommon.formatDateForProperty(min)}
|
|
611
763
|
max=${calendarCommon.formatDateForProperty(max)}
|
|
612
764
|
default-value=${ifDefined_js.ifDefined(this.defaultValue)}
|
|
613
|
-
|
|
765
|
+
locale=${ifDefined_js.ifDefined(this.locale)}
|
|
766
|
+
.popover=${"manual"}
|
|
614
767
|
class="absolute left-(--floating-x,0) top-(--floating-y,0)"
|
|
615
768
|
@toggle=${this._handleToggle}
|
|
616
769
|
@select=${this._handleSelect}
|
|
@@ -673,6 +826,7 @@ exports.DaikinDatePicker = class DaikinDatePicker extends ddsFormElement.DDSForm
|
|
|
673
826
|
reflectInputGroup(inputGroup) {
|
|
674
827
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
675
828
|
this.disabled = !!inputGroup.disabled;
|
|
829
|
+
this.readonly = !!inputGroup.readonly;
|
|
676
830
|
this.required = !!inputGroup.required;
|
|
677
831
|
this.error = isError;
|
|
678
832
|
this._label = inputGroup.label;
|
|
@@ -684,7 +838,28 @@ exports.DaikinDatePicker.styles = lit.css`
|
|
|
684
838
|
:host {
|
|
685
839
|
display: flex;
|
|
686
840
|
align-items: center;
|
|
687
|
-
height: 3rem;
|
|
841
|
+
height: var(--dds-input-height, 3rem);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
:host([readonly]:not([disabled])) input {
|
|
845
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
846
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
:host([readonly]:not([disabled])) input:hover,
|
|
850
|
+
:host([readonly]:not([disabled])) input:active {
|
|
851
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
852
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
:host([readonly]:not([disabled])) input:focus-visible {
|
|
856
|
+
--color-base: var(--dds-color-common-border-focus);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
:host([readonly][error]:not([disabled])) input,
|
|
860
|
+
:host([readonly][error]:not([disabled])) input:hover,
|
|
861
|
+
:host([readonly][error]:not([disabled])) input:active {
|
|
862
|
+
--color-base: var(--dds-color-common-danger-default);
|
|
688
863
|
}
|
|
689
864
|
|
|
690
865
|
daikin-calendar[popover] {
|
|
@@ -729,6 +904,9 @@ __decorateClass([
|
|
|
729
904
|
__decorateClass([
|
|
730
905
|
ddsProperty.property({ type: String, reflect: true })
|
|
731
906
|
], exports.DaikinDatePicker.prototype, "locale", 2);
|
|
907
|
+
__decorateClass([
|
|
908
|
+
ddsProperty.property({ type: String, reflect: true, attribute: "input-locale" })
|
|
909
|
+
], exports.DaikinDatePicker.prototype, "inputLocale", 2);
|
|
732
910
|
__decorateClass([
|
|
733
911
|
decorators_js.state()
|
|
734
912
|
], exports.DaikinDatePicker.prototype, "_label", 2);
|
|
@@ -73,19 +73,33 @@ export declare class DaikinDatePicker extends DDSFormElement {
|
|
|
73
73
|
* If there is a `value` attribute, this is ignored.
|
|
74
74
|
*/
|
|
75
75
|
defaultValue: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* The locale used for date picker.
|
|
78
|
+
* If not provided, the browser's default locale will be used.
|
|
79
|
+
* Currently, only English and Japanese are supported.
|
|
80
|
+
* The locale determined by this property controls the language of the text inside the calendar popup.
|
|
81
|
+
*
|
|
82
|
+
* **Note**: The pre-filled input format (such as YYYY/MM/DD) is independent of this property and is dynamically configured according to the user's current device locale.
|
|
83
|
+
*/
|
|
84
|
+
locale: "en" | "ja" | null;
|
|
76
85
|
/**
|
|
77
86
|
* The locale used for date formatting.
|
|
78
87
|
* If not provided, the browser's default locale will be used. It is usually not necessary to specify it explicitly.
|
|
79
88
|
*
|
|
80
89
|
* @private
|
|
81
90
|
*/
|
|
82
|
-
|
|
91
|
+
inputLocale: string | null;
|
|
83
92
|
/**
|
|
84
93
|
* The label text used as the value of aria-label.
|
|
85
94
|
* Set automatically by `reflectInputGroup` method.
|
|
86
95
|
*/
|
|
87
96
|
private _label;
|
|
88
97
|
private _currentSelection;
|
|
98
|
+
private _preCompositionValue;
|
|
99
|
+
private _inputValue;
|
|
100
|
+
private _monthDigitIndex;
|
|
101
|
+
private _dayDigitIndex;
|
|
102
|
+
private _yearDigitIndex;
|
|
89
103
|
private _autoUpdateController;
|
|
90
104
|
private _dateInputElement;
|
|
91
105
|
private _calendarElement;
|
|
@@ -98,7 +112,19 @@ export declare class DaikinDatePicker extends DDSFormElement {
|
|
|
98
112
|
private _formatDateForUI;
|
|
99
113
|
private _getPlaceholderAll;
|
|
100
114
|
private _getDateItemInSelection;
|
|
101
|
-
private get
|
|
115
|
+
private get _dateValue();
|
|
116
|
+
/**
|
|
117
|
+
* Returns the string to bind to the <input> element's .value property.
|
|
118
|
+
*
|
|
119
|
+
* - When this.value holds a valid date, show the locale-formatted date.
|
|
120
|
+
* - When _inputValue contains partial or invalid content (placeholders / impossible
|
|
121
|
+
* dates like 02/31), return it so the user's in-progress entry is preserved
|
|
122
|
+
* across Lit re-renders.
|
|
123
|
+
* - Otherwise (e.g. this.value was cleared externally while _inputValue still
|
|
124
|
+
* holds a now-stale complete valid date string) return "" so the CSS placeholder
|
|
125
|
+
* text is visible instead.
|
|
126
|
+
*/
|
|
127
|
+
private get _displayValue();
|
|
102
128
|
private get _min();
|
|
103
129
|
private get _max();
|
|
104
130
|
private get _viewDate();
|
|
@@ -111,6 +137,10 @@ export declare class DaikinDatePicker extends DDSFormElement {
|
|
|
111
137
|
private _handleFocusOut;
|
|
112
138
|
private _handleChange;
|
|
113
139
|
private _handleMouseUp;
|
|
140
|
+
private _handleCompositionStart;
|
|
141
|
+
private _handleCompositionEnd;
|
|
142
|
+
private _applyDigitToPart;
|
|
143
|
+
private _applyDigits;
|
|
114
144
|
private _handleKeyDown;
|
|
115
145
|
private _handleBeforeInput;
|
|
116
146
|
private _handleSelect;
|
|
@@ -118,6 +148,11 @@ export declare class DaikinDatePicker extends DDSFormElement {
|
|
|
118
148
|
private _handlePointerUp;
|
|
119
149
|
private _handleCalendarKeyDown;
|
|
120
150
|
private _handleToggle;
|
|
151
|
+
/**
|
|
152
|
+
* Returns true if all date parts (year/month/day) in the input are filled with
|
|
153
|
+
* digits and no placeholder text (YYYY, MM, DD) remains.
|
|
154
|
+
*/
|
|
155
|
+
private _isInputComplete;
|
|
121
156
|
private _updateValue;
|
|
122
157
|
private _updateInputSelection;
|
|
123
158
|
private _updateSelection;
|
|
@@ -144,7 +144,7 @@ exports.DaikinDrawer = class DaikinDrawer extends ddsElement.DDSElement {
|
|
|
144
144
|
render() {
|
|
145
145
|
return lit.html`<div
|
|
146
146
|
class=${cvaBackDrop({ open: this.open, placement: this.placement })}
|
|
147
|
-
|
|
147
|
+
.inert=${!this.open}
|
|
148
148
|
aria-hidden=${ifDefined_js.ifDefined(!this.open ? "true" : void 0)}
|
|
149
149
|
@click=${this._handleBackdropClick}
|
|
150
150
|
>
|