@daikin-oss/design-system-web-components 2.0.0 → 2.0.1-next.1
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 +26 -0
- package/custom-elements.json +1173 -1174
- package/dist/cjs/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.cjs +9 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/base/dds-element.cjs +100 -86
- package/dist/cjs/base/dds-form-element.cjs +123 -144
- package/dist/cjs/base/dds-property.cjs +46 -5
- package/dist/cjs/base/dds-property.d.cts +1 -1
- package/dist/cjs/base/decorators.cjs +8 -11
- package/dist/cjs/base/define.cjs +11 -17
- package/dist/cjs/base/index.cjs +12 -13
- package/dist/cjs/components/accordion/daikin-accordion.cjs +77 -91
- package/dist/cjs/components/accordion/index.cjs +5 -4
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +148 -172
- package/dist/cjs/components/accordion-item/index.cjs +5 -4
- package/dist/cjs/components/avatar/daikin-avatar.cjs +149 -163
- package/dist/cjs/components/avatar/index.cjs +5 -4
- package/dist/cjs/components/badge/daikin-badge.cjs +179 -199
- package/dist/cjs/components/badge/index.cjs +5 -4
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.cjs +80 -88
- package/dist/cjs/components/breadcrumb/index.cjs +5 -4
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +120 -127
- package/dist/cjs/components/breadcrumb-item/index.cjs +5 -4
- package/dist/cjs/components/button/daikin-button.cjs +269 -294
- package/dist/cjs/components/button/index.cjs +5 -4
- package/dist/cjs/components/calendar/daikin-calendar.cjs +421 -528
- package/dist/cjs/components/calendar/index.cjs +5 -4
- package/dist/cjs/components/card/daikin-card.cjs +52 -61
- package/dist/cjs/components/card/index.cjs +5 -4
- package/dist/cjs/components/card-footer/daikin-card-footer.cjs +24 -27
- package/dist/cjs/components/card-footer/index.cjs +5 -4
- package/dist/cjs/components/card-header/daikin-card-header.cjs +46 -49
- package/dist/cjs/components/card-header/index.cjs +5 -4
- package/dist/cjs/components/carousel/daikin-carousel.cjs +131 -167
- package/dist/cjs/components/carousel/index.cjs +5 -4
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +51 -59
- package/dist/cjs/components/carousel-item/index.cjs +5 -4
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +324 -336
- package/dist/cjs/components/checkbox/index.cjs +5 -4
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +93 -107
- package/dist/cjs/components/checkbox-group/index.cjs +5 -4
- package/dist/cjs/components/chip/daikin-chip.cjs +312 -334
- package/dist/cjs/components/chip/index.cjs +5 -4
- package/dist/cjs/components/combobox/daikin-combobox.cjs +469 -592
- package/dist/cjs/components/combobox/index.cjs +6 -5
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +809 -842
- package/dist/cjs/components/date-picker/index.cjs +5 -4
- package/dist/cjs/components/divider/daikin-divider.cjs +32 -36
- package/dist/cjs/components/divider/index.cjs +5 -4
- package/dist/cjs/components/drawer/daikin-drawer.cjs +200 -213
- package/dist/cjs/components/drawer/index.cjs +5 -4
- package/dist/cjs/components/drawer-footer/daikin-drawer-footer.cjs +26 -29
- package/dist/cjs/components/drawer-footer/index.cjs +5 -4
- package/dist/cjs/components/drawer-header/daikin-drawer-header.cjs +62 -67
- package/dist/cjs/components/drawer-header/index.cjs +5 -4
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +479 -575
- package/dist/cjs/components/dropdown/index.cjs +5 -4
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +130 -151
- package/dist/cjs/components/dropdown-item/index.cjs +5 -4
- package/dist/cjs/components/empty-state/daikin-empty-state.cjs +28 -31
- package/dist/cjs/components/empty-state/index.cjs +5 -4
- package/dist/cjs/components/icon/daikin-icon.cjs +159 -179
- package/dist/cjs/components/icon/icons.json.cjs +97 -6
- package/dist/cjs/components/icon/index.cjs +6 -5
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +255 -274
- package/dist/cjs/components/icon-button/index.cjs +5 -4
- package/dist/cjs/components/index.cjs +435 -226
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +138 -162
- package/dist/cjs/components/inline-notification/index.cjs +5 -4
- package/dist/cjs/components/input-group/daikin-input-group.cjs +191 -235
- package/dist/cjs/components/input-group/index.cjs +5 -4
- package/dist/cjs/components/link/daikin-link.cjs +122 -132
- package/dist/cjs/components/link/index.cjs +5 -4
- package/dist/cjs/components/list/daikin-list.cjs +84 -101
- package/dist/cjs/components/list/index.cjs +5 -4
- package/dist/cjs/components/list-item/daikin-list-item.cjs +179 -196
- package/dist/cjs/components/list-item/index.cjs +5 -4
- package/dist/cjs/components/loading/daikin-loading.cjs +70 -84
- package/dist/cjs/components/loading/index.cjs +5 -4
- package/dist/cjs/components/logo/daikin-logo.cjs +115 -128
- package/dist/cjs/components/logo/index.cjs +5 -4
- package/dist/cjs/components/menu/daikin-menu.cjs +258 -322
- package/dist/cjs/components/menu/index.cjs +5 -4
- package/dist/cjs/components/modal/daikin-modal.cjs +107 -130
- package/dist/cjs/components/modal/index.cjs +5 -4
- package/dist/cjs/components/modal-footer/daikin-modal-footer.cjs +26 -29
- package/dist/cjs/components/modal-footer/index.cjs +5 -4
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +70 -75
- package/dist/cjs/components/modal-header/index.cjs +5 -4
- package/dist/cjs/components/navigation/daikin-navigation.cjs +50 -54
- package/dist/cjs/components/navigation/index.cjs +5 -4
- package/dist/cjs/components/navigation-item/daikin-navigation-item.cjs +165 -188
- package/dist/cjs/components/navigation-item/index.cjs +5 -4
- package/dist/cjs/components/pagination/daikin-pagination.cjs +191 -221
- package/dist/cjs/components/pagination/index.cjs +5 -4
- package/dist/cjs/components/pagination/pagination-utils.cjs +76 -41
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +136 -169
- package/dist/cjs/components/progress-bar/index.cjs +5 -4
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.cjs +55 -62
- package/dist/cjs/components/progress-indicator/index.cjs +5 -4
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +55 -70
- package/dist/cjs/components/progress-indicator-item/index.cjs +5 -4
- package/dist/cjs/components/radio/daikin-radio.cjs +273 -285
- package/dist/cjs/components/radio/index.cjs +5 -4
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +149 -171
- package/dist/cjs/components/radio-group/index.cjs +5 -4
- package/dist/cjs/components/select/daikin-select.cjs +231 -264
- package/dist/cjs/components/select/index.cjs +5 -4
- package/dist/cjs/components/slider/daikin-slider.cjs +250 -301
- package/dist/cjs/components/slider/index.cjs +5 -4
- package/dist/cjs/components/slider/slider-utils.cjs +61 -45
- package/dist/cjs/components/status-message/daikin-status-message.cjs +115 -113
- package/dist/cjs/components/status-message/index.cjs +5 -4
- package/dist/cjs/components/tab/daikin-tab.cjs +112 -132
- package/dist/cjs/components/tab/index.cjs +5 -4
- package/dist/cjs/components/tab-panels/daikin-tab-panels.cjs +43 -52
- package/dist/cjs/components/tab-panels/index.cjs +5 -4
- package/dist/cjs/components/table/daikin-table.cjs +265 -318
- package/dist/cjs/components/table/index.cjs +5 -4
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +55 -69
- package/dist/cjs/components/table-cell/index.cjs +5 -4
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +129 -139
- package/dist/cjs/components/table-header-cell/index.cjs +5 -4
- package/dist/cjs/components/tabs/daikin-tabs.cjs +178 -219
- package/dist/cjs/components/tabs/index.cjs +5 -4
- package/dist/cjs/components/tag/daikin-tag.cjs +148 -152
- package/dist/cjs/components/tag/index.cjs +5 -4
- package/dist/cjs/components/text-area/daikin-text-area.cjs +161 -175
- package/dist/cjs/components/text-area/index.cjs +5 -4
- package/dist/cjs/components/text-field/daikin-text-field.cjs +378 -428
- package/dist/cjs/components/text-field/index.cjs +5 -4
- package/dist/cjs/components/text-field/number-utils.cjs +77 -90
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +292 -308
- package/dist/cjs/components/text-masked-field/index.cjs +5 -4
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +689 -752
- package/dist/cjs/components/time-picker/index.cjs +15 -14
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +143 -170
- package/dist/cjs/components/toast-notification/index.cjs +5 -4
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +173 -195
- package/dist/cjs/components/toast-notification-manager/index.cjs +5 -4
- package/dist/cjs/components/toggle/daikin-toggle.cjs +169 -178
- package/dist/cjs/components/toggle/index.cjs +5 -4
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +165 -202
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +2 -2
- package/dist/cjs/components/tooltip/index.cjs +5 -4
- package/dist/cjs/components/tree/common.cjs +74 -70
- package/dist/cjs/components/tree/daikin-tree.cjs +89 -103
- package/dist/cjs/components/tree/index.cjs +5 -4
- package/dist/cjs/components/tree-item/daikin-tree-item.cjs +178 -198
- package/dist/cjs/components/tree-item/index.cjs +6 -5
- package/dist/cjs/components/tree-section/daikin-tree-section.cjs +169 -215
- package/dist/cjs/components/tree-section/index.cjs +5 -4
- package/dist/cjs/components/vertical-navigation/daikin-vertical-navigation.cjs +84 -104
- package/dist/cjs/components/vertical-navigation/index.cjs +5 -4
- package/dist/cjs/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +463 -482
- package/dist/cjs/components/vertical-navigation-item/index.cjs +5 -4
- package/dist/cjs/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +196 -214
- package/dist/cjs/components/vertical-navigation-menu-item/index.cjs +5 -4
- package/dist/cjs/controllers/block-scroll.cjs +75 -41
- package/dist/cjs/controllers/click-outside.cjs +62 -30
- package/dist/cjs/controllers/custom-readonly.cjs +52 -58
- package/dist/cjs/controllers/floating-ui-auto-update.cjs +76 -98
- package/dist/cjs/controllers/focus-trap.cjs +39 -57
- package/dist/cjs/controllers/helpers/controller-directive.cjs +46 -45
- package/dist/cjs/icon-registry.cjs +147 -161
- package/dist/cjs/index.cjs +374 -234
- package/dist/cjs/is-client.cjs +3 -4
- package/dist/cjs/navigation.cjs +66 -47
- package/dist/cjs/tailwind.css.cjs +4 -6
- package/dist/cjs/utils/calendar-common.cjs +156 -117
- package/dist/cjs/utils/extract-half-width-digits.cjs +17 -8
- package/dist/cjs/utils/is-similar-to-click.cjs +3 -3
- package/dist/cjs/utils/is-simple-key.cjs +9 -3
- package/dist/cjs/utils/notification-common.cjs +14 -27
- package/dist/cjs/utils/re-dispatch.cjs +6 -8
- package/dist/cjs/utils/scroller.cjs +44 -57
- package/dist/cjs-dev/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.cjs +9 -0
- package/dist/cjs-dev/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs-dev/base/dds-element.cjs +101 -96
- package/dist/cjs-dev/base/dds-form-element.cjs +123 -144
- package/dist/cjs-dev/base/dds-property.cjs +46 -5
- package/dist/cjs-dev/base/dds-property.d.cts +1 -1
- package/dist/cjs-dev/base/decorators.cjs +8 -11
- package/dist/cjs-dev/base/define.cjs +11 -17
- package/dist/cjs-dev/base/index.cjs +12 -13
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +78 -98
- package/dist/cjs-dev/components/accordion/index.cjs +5 -4
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +148 -172
- package/dist/cjs-dev/components/accordion-item/index.cjs +5 -4
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +149 -163
- package/dist/cjs-dev/components/avatar/index.cjs +5 -4
- package/dist/cjs-dev/components/badge/daikin-badge.cjs +179 -199
- package/dist/cjs-dev/components/badge/index.cjs +5 -4
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.cjs +80 -88
- package/dist/cjs-dev/components/breadcrumb/index.cjs +5 -4
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +120 -127
- package/dist/cjs-dev/components/breadcrumb-item/index.cjs +5 -4
- package/dist/cjs-dev/components/button/daikin-button.cjs +269 -294
- package/dist/cjs-dev/components/button/index.cjs +5 -4
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +429 -539
- package/dist/cjs-dev/components/calendar/index.cjs +5 -4
- package/dist/cjs-dev/components/card/daikin-card.cjs +52 -61
- package/dist/cjs-dev/components/card/index.cjs +5 -4
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.cjs +24 -27
- package/dist/cjs-dev/components/card-footer/index.cjs +5 -4
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +46 -49
- package/dist/cjs-dev/components/card-header/index.cjs +5 -4
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +137 -177
- package/dist/cjs-dev/components/carousel/index.cjs +5 -4
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +51 -59
- package/dist/cjs-dev/components/carousel-item/index.cjs +5 -4
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +324 -336
- package/dist/cjs-dev/components/checkbox/index.cjs +5 -4
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +93 -107
- package/dist/cjs-dev/components/checkbox-group/index.cjs +5 -4
- package/dist/cjs-dev/components/chip/daikin-chip.cjs +312 -334
- package/dist/cjs-dev/components/chip/index.cjs +5 -4
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +469 -592
- package/dist/cjs-dev/components/combobox/index.cjs +6 -5
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +817 -853
- package/dist/cjs-dev/components/date-picker/index.cjs +5 -4
- package/dist/cjs-dev/components/divider/daikin-divider.cjs +32 -36
- package/dist/cjs-dev/components/divider/index.cjs +5 -4
- package/dist/cjs-dev/components/drawer/daikin-drawer.cjs +200 -213
- package/dist/cjs-dev/components/drawer/index.cjs +5 -4
- package/dist/cjs-dev/components/drawer-footer/daikin-drawer-footer.cjs +26 -29
- package/dist/cjs-dev/components/drawer-footer/index.cjs +5 -4
- package/dist/cjs-dev/components/drawer-header/daikin-drawer-header.cjs +62 -67
- package/dist/cjs-dev/components/drawer-header/index.cjs +5 -4
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +479 -575
- package/dist/cjs-dev/components/dropdown/index.cjs +5 -4
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +130 -151
- package/dist/cjs-dev/components/dropdown-item/index.cjs +5 -4
- package/dist/cjs-dev/components/empty-state/daikin-empty-state.cjs +28 -31
- package/dist/cjs-dev/components/empty-state/index.cjs +5 -4
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +167 -208
- package/dist/cjs-dev/components/icon/icons.json.cjs +97 -6
- package/dist/cjs-dev/components/icon/index.cjs +6 -5
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +255 -274
- package/dist/cjs-dev/components/icon-button/index.cjs +5 -4
- package/dist/cjs-dev/components/index.cjs +435 -226
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +138 -162
- package/dist/cjs-dev/components/inline-notification/index.cjs +5 -4
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +191 -235
- package/dist/cjs-dev/components/input-group/index.cjs +5 -4
- package/dist/cjs-dev/components/link/daikin-link.cjs +122 -132
- package/dist/cjs-dev/components/link/index.cjs +5 -4
- package/dist/cjs-dev/components/list/daikin-list.cjs +84 -101
- package/dist/cjs-dev/components/list/index.cjs +5 -4
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +179 -196
- package/dist/cjs-dev/components/list-item/index.cjs +5 -4
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +70 -84
- package/dist/cjs-dev/components/loading/index.cjs +5 -4
- package/dist/cjs-dev/components/logo/daikin-logo.cjs +115 -128
- package/dist/cjs-dev/components/logo/index.cjs +5 -4
- package/dist/cjs-dev/components/menu/daikin-menu.cjs +258 -322
- package/dist/cjs-dev/components/menu/index.cjs +5 -4
- package/dist/cjs-dev/components/modal/daikin-modal.cjs +107 -130
- package/dist/cjs-dev/components/modal/index.cjs +5 -4
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.cjs +26 -29
- package/dist/cjs-dev/components/modal-footer/index.cjs +5 -4
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +70 -75
- package/dist/cjs-dev/components/modal-header/index.cjs +5 -4
- package/dist/cjs-dev/components/navigation/daikin-navigation.cjs +50 -54
- package/dist/cjs-dev/components/navigation/index.cjs +5 -4
- package/dist/cjs-dev/components/navigation-item/daikin-navigation-item.cjs +165 -188
- package/dist/cjs-dev/components/navigation-item/index.cjs +5 -4
- package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +191 -221
- package/dist/cjs-dev/components/pagination/index.cjs +5 -4
- package/dist/cjs-dev/components/pagination/pagination-utils.cjs +76 -41
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +145 -184
- package/dist/cjs-dev/components/progress-bar/index.cjs +5 -4
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.cjs +55 -62
- package/dist/cjs-dev/components/progress-indicator/index.cjs +5 -4
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +55 -70
- package/dist/cjs-dev/components/progress-indicator-item/index.cjs +5 -4
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +273 -285
- package/dist/cjs-dev/components/radio/index.cjs +5 -4
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +149 -171
- package/dist/cjs-dev/components/radio-group/index.cjs +5 -4
- package/dist/cjs-dev/components/select/daikin-select.cjs +231 -264
- package/dist/cjs-dev/components/select/index.cjs +5 -4
- package/dist/cjs-dev/components/slider/daikin-slider.cjs +250 -301
- package/dist/cjs-dev/components/slider/index.cjs +5 -4
- package/dist/cjs-dev/components/slider/slider-utils.cjs +61 -45
- package/dist/cjs-dev/components/status-message/daikin-status-message.cjs +115 -113
- package/dist/cjs-dev/components/status-message/index.cjs +5 -4
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +112 -132
- package/dist/cjs-dev/components/tab/index.cjs +5 -4
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.cjs +44 -59
- package/dist/cjs-dev/components/tab-panels/index.cjs +5 -4
- package/dist/cjs-dev/components/table/daikin-table.cjs +271 -330
- package/dist/cjs-dev/components/table/index.cjs +5 -4
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +55 -69
- package/dist/cjs-dev/components/table-cell/index.cjs +5 -4
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +129 -139
- package/dist/cjs-dev/components/table-header-cell/index.cjs +5 -4
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +184 -229
- package/dist/cjs-dev/components/tabs/index.cjs +5 -4
- package/dist/cjs-dev/components/tag/daikin-tag.cjs +148 -152
- package/dist/cjs-dev/components/tag/index.cjs +5 -4
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +161 -175
- package/dist/cjs-dev/components/text-area/index.cjs +5 -4
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +378 -428
- package/dist/cjs-dev/components/text-field/index.cjs +5 -4
- package/dist/cjs-dev/components/text-field/number-utils.cjs +78 -93
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +292 -308
- package/dist/cjs-dev/components/text-masked-field/index.cjs +5 -4
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +697 -764
- package/dist/cjs-dev/components/time-picker/index.cjs +15 -14
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +143 -170
- package/dist/cjs-dev/components/toast-notification/index.cjs +5 -4
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +173 -195
- package/dist/cjs-dev/components/toast-notification-manager/index.cjs +5 -4
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +169 -178
- package/dist/cjs-dev/components/toggle/index.cjs +5 -4
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +165 -202
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +2 -2
- package/dist/cjs-dev/components/tooltip/index.cjs +5 -4
- package/dist/cjs-dev/components/tree/common.cjs +74 -70
- package/dist/cjs-dev/components/tree/daikin-tree.cjs +89 -103
- package/dist/cjs-dev/components/tree/index.cjs +5 -4
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +178 -198
- package/dist/cjs-dev/components/tree-item/index.cjs +6 -5
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +169 -215
- package/dist/cjs-dev/components/tree-section/index.cjs +5 -4
- package/dist/cjs-dev/components/vertical-navigation/daikin-vertical-navigation.cjs +88 -116
- package/dist/cjs-dev/components/vertical-navigation/index.cjs +5 -4
- package/dist/cjs-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +463 -482
- package/dist/cjs-dev/components/vertical-navigation-item/index.cjs +5 -4
- package/dist/cjs-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +196 -214
- package/dist/cjs-dev/components/vertical-navigation-menu-item/index.cjs +5 -4
- package/dist/cjs-dev/controllers/block-scroll.cjs +75 -41
- package/dist/cjs-dev/controllers/click-outside.cjs +62 -30
- package/dist/cjs-dev/controllers/custom-readonly.cjs +52 -58
- package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +78 -105
- package/dist/cjs-dev/controllers/focus-trap.cjs +39 -57
- package/dist/cjs-dev/controllers/helpers/controller-directive.cjs +46 -45
- package/dist/cjs-dev/icon-registry.cjs +147 -161
- package/dist/cjs-dev/index.cjs +374 -234
- package/dist/cjs-dev/is-client.cjs +3 -4
- package/dist/cjs-dev/navigation.cjs +66 -47
- package/dist/cjs-dev/tailwind.css.cjs +4 -6
- package/dist/cjs-dev/utils/calendar-common.cjs +156 -117
- package/dist/cjs-dev/utils/extract-half-width-digits.cjs +17 -8
- package/dist/cjs-dev/utils/is-similar-to-click.cjs +3 -3
- package/dist/cjs-dev/utils/is-simple-key.cjs +9 -3
- package/dist/cjs-dev/utils/notification-common.cjs +17 -30
- package/dist/cjs-dev/utils/re-dispatch.cjs +6 -8
- package/dist/cjs-dev/utils/scroller.cjs +44 -57
- package/dist/es/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.js +9 -0
- package/dist/es/base/dds-element.js +100 -86
- package/dist/es/base/dds-form-element.js +122 -144
- package/dist/es/base/dds-property.d.ts +1 -1
- package/dist/es/base/dds-property.js +48 -8
- package/dist/es/base/decorators.js +8 -11
- package/dist/es/base/define.js +12 -17
- package/dist/es/base/index.js +3 -11
- package/dist/es/components/accordion/daikin-accordion.js +69 -89
- package/dist/es/components/accordion/index.js +1 -3
- package/dist/es/components/accordion-item/daikin-accordion-item.js +138 -168
- package/dist/es/components/accordion-item/index.js +1 -3
- package/dist/es/components/avatar/daikin-avatar.js +136 -156
- package/dist/es/components/avatar/index.js +1 -3
- package/dist/es/components/badge/daikin-badge.js +173 -198
- package/dist/es/components/badge/index.js +1 -3
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +73 -87
- package/dist/es/components/breadcrumb/index.js +1 -3
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +106 -119
- package/dist/es/components/breadcrumb-item/index.js +1 -3
- package/dist/es/components/button/daikin-button.js +255 -286
- package/dist/es/components/button/index.js +1 -3
- package/dist/es/components/calendar/daikin-calendar.js +407 -520
- package/dist/es/components/calendar/index.js +1 -3
- package/dist/es/components/card/daikin-card.js +44 -58
- package/dist/es/components/card/index.js +1 -3
- package/dist/es/components/card-footer/daikin-card-footer.js +16 -25
- package/dist/es/components/card-footer/index.js +1 -3
- package/dist/es/components/card-header/daikin-card-header.js +39 -48
- package/dist/es/components/card-header/index.js +1 -3
- package/dist/es/components/carousel/daikin-carousel.js +121 -163
- package/dist/es/components/carousel/index.js +1 -3
- package/dist/es/components/carousel-item/daikin-carousel-item.js +44 -58
- package/dist/es/components/carousel-item/index.js +1 -3
- package/dist/es/components/checkbox/daikin-checkbox.js +315 -333
- package/dist/es/components/checkbox/index.js +1 -3
- package/dist/es/components/checkbox-group/daikin-checkbox-group.js +86 -106
- package/dist/es/components/checkbox-group/index.js +1 -3
- package/dist/es/components/chip/daikin-chip.js +304 -332
- package/dist/es/components/chip/index.js +1 -3
- package/dist/es/components/combobox/daikin-combobox.js +454 -584
- package/dist/es/components/combobox/index.js +1 -4
- package/dist/es/components/date-picker/daikin-date-picker.js +787 -826
- package/dist/es/components/date-picker/index.js +1 -3
- package/dist/es/components/divider/daikin-divider.js +25 -34
- package/dist/es/components/divider/index.js +1 -3
- package/dist/es/components/drawer/daikin-drawer.js +189 -208
- package/dist/es/components/drawer/index.js +1 -3
- package/dist/es/components/drawer-footer/daikin-drawer-footer.js +18 -27
- package/dist/es/components/drawer-footer/index.js +1 -3
- package/dist/es/components/drawer-header/daikin-drawer-header.js +53 -64
- package/dist/es/components/drawer-header/index.js +1 -3
- package/dist/es/components/dropdown/daikin-dropdown.js +468 -570
- package/dist/es/components/dropdown/index.js +1 -3
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +124 -150
- package/dist/es/components/dropdown-item/index.js +1 -3
- package/dist/es/components/empty-state/daikin-empty-state.js +21 -30
- package/dist/es/components/empty-state/index.js +1 -3
- package/dist/es/components/icon/daikin-icon.js +150 -177
- package/dist/es/components/icon/icons.json.js +97 -7
- package/dist/es/components/icon/index.js +1 -4
- package/dist/es/components/icon-button/daikin-icon-button.js +242 -267
- package/dist/es/components/icon-button/index.js +1 -3
- package/dist/es/components/index.js +85 -99
- package/dist/es/components/inline-notification/daikin-inline-notification.js +130 -160
- package/dist/es/components/inline-notification/index.js +1 -3
- package/dist/es/components/input-group/daikin-input-group.js +184 -234
- package/dist/es/components/input-group/index.js +1 -3
- package/dist/es/components/link/daikin-link.js +111 -127
- package/dist/es/components/link/index.js +1 -3
- package/dist/es/components/list/daikin-list.js +77 -100
- package/dist/es/components/list/index.js +1 -3
- package/dist/es/components/list-item/daikin-list-item.js +168 -192
- package/dist/es/components/list-item/index.js +1 -3
- package/dist/es/components/loading/daikin-loading.js +62 -82
- package/dist/es/components/loading/index.js +1 -3
- package/dist/es/components/logo/daikin-logo.js +106 -125
- package/dist/es/components/logo/index.js +1 -3
- package/dist/es/components/menu/daikin-menu.js +246 -316
- package/dist/es/components/menu/index.js +1 -3
- package/dist/es/components/modal/daikin-modal.js +97 -126
- package/dist/es/components/modal/index.js +1 -3
- package/dist/es/components/modal-footer/daikin-modal-footer.js +18 -27
- package/dist/es/components/modal-footer/index.js +1 -3
- package/dist/es/components/modal-header/daikin-modal-header.js +61 -72
- package/dist/es/components/modal-header/index.js +1 -3
- package/dist/es/components/navigation/daikin-navigation.js +42 -52
- package/dist/es/components/navigation/index.js +1 -3
- package/dist/es/components/navigation-item/daikin-navigation-item.js +152 -181
- package/dist/es/components/navigation-item/index.js +1 -3
- package/dist/es/components/pagination/daikin-pagination.js +183 -219
- package/dist/es/components/pagination/index.js +1 -3
- package/dist/es/components/pagination/pagination-utils.js +77 -44
- package/dist/es/components/progress-bar/daikin-progress-bar.js +129 -168
- package/dist/es/components/progress-bar/index.js +1 -3
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +47 -60
- package/dist/es/components/progress-indicator/index.js +1 -3
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +48 -69
- package/dist/es/components/progress-indicator-item/index.js +1 -3
- package/dist/es/components/radio/daikin-radio.js +264 -282
- package/dist/es/components/radio/index.js +1 -3
- package/dist/es/components/radio-group/daikin-radio-group.js +142 -170
- package/dist/es/components/radio-group/index.js +1 -3
- package/dist/es/components/select/daikin-select.js +222 -261
- package/dist/es/components/select/index.js +1 -3
- package/dist/es/components/slider/daikin-slider.js +241 -298
- package/dist/es/components/slider/index.js +1 -3
- package/dist/es/components/slider/slider-utils.js +62 -49
- package/dist/es/components/status-message/daikin-status-message.js +107 -111
- package/dist/es/components/status-message/index.js +1 -3
- package/dist/es/components/tab/daikin-tab.js +105 -130
- package/dist/es/components/tab/index.js +1 -3
- package/dist/es/components/tab-panels/daikin-tab-panels.js +35 -50
- package/dist/es/components/tab-panels/index.js +1 -3
- package/dist/es/components/table/daikin-table.js +255 -314
- package/dist/es/components/table/index.js +1 -3
- package/dist/es/components/table-cell/daikin-table-cell.js +49 -68
- package/dist/es/components/table-cell/index.js +1 -3
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +121 -137
- package/dist/es/components/table-header-cell/index.js +1 -3
- package/dist/es/components/tabs/daikin-tabs.js +170 -217
- package/dist/es/components/tabs/index.js +1 -3
- package/dist/es/components/tag/daikin-tag.js +140 -150
- package/dist/es/components/tag/index.js +1 -3
- package/dist/es/components/text-area/daikin-text-area.js +153 -173
- package/dist/es/components/text-area/index.js +1 -3
- package/dist/es/components/text-field/daikin-text-field.js +361 -417
- package/dist/es/components/text-field/index.js +1 -3
- package/dist/es/components/text-field/number-utils.js +75 -90
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +279 -303
- package/dist/es/components/text-masked-field/index.js +1 -3
- package/dist/es/components/time-picker/daikin-time-picker.js +677 -756
- package/dist/es/components/time-picker/index.js +1 -13
- package/dist/es/components/toast-notification/daikin-toast-notification.js +134 -167
- package/dist/es/components/toast-notification/index.js +1 -3
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +165 -193
- package/dist/es/components/toast-notification-manager/index.js +1 -3
- package/dist/es/components/toggle/daikin-toggle.js +160 -175
- package/dist/es/components/toggle/index.js +1 -3
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +2 -2
- package/dist/es/components/tooltip/daikin-tooltip.js +156 -199
- package/dist/es/components/tooltip/index.js +1 -3
- package/dist/es/components/tree/common.js +75 -76
- package/dist/es/components/tree/daikin-tree.js +81 -101
- package/dist/es/components/tree/index.js +1 -3
- package/dist/es/components/tree-item/daikin-tree-item.js +166 -193
- package/dist/es/components/tree-item/index.js +1 -4
- package/dist/es/components/tree-section/daikin-tree-section.js +157 -209
- package/dist/es/components/tree-section/index.js +1 -3
- package/dist/es/components/vertical-navigation/daikin-vertical-navigation.js +76 -102
- package/dist/es/components/vertical-navigation/index.js +1 -3
- package/dist/es/components/vertical-navigation-item/daikin-vertical-navigation-item.js +443 -468
- package/dist/es/components/vertical-navigation-item/index.js +1 -3
- package/dist/es/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +185 -209
- package/dist/es/components/vertical-navigation-menu-item/index.js +1 -3
- package/dist/es/controllers/block-scroll.js +74 -41
- package/dist/es/controllers/click-outside.js +61 -29
- package/dist/es/controllers/custom-readonly.js +52 -58
- package/dist/es/controllers/floating-ui-auto-update.js +74 -96
- package/dist/es/controllers/focus-trap.js +37 -55
- package/dist/es/controllers/helpers/controller-directive.js +46 -45
- package/dist/es/icon-registry.js +148 -163
- package/dist/es/index.js +17 -106
- package/dist/es/is-client.js +4 -4
- package/dist/es/navigation.js +67 -51
- package/dist/es/tailwind.css.js +4 -6
- package/dist/es/utils/calendar-common.js +156 -134
- package/dist/es/utils/extract-half-width-digits.js +18 -9
- package/dist/es/utils/is-similar-to-click.js +4 -4
- package/dist/es/utils/is-simple-key.js +10 -4
- package/dist/es/utils/notification-common.js +14 -28
- package/dist/es/utils/re-dispatch.js +7 -9
- package/dist/es/utils/scroller.js +45 -61
- package/dist/es-dev/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.js +9 -0
- package/dist/es-dev/base/dds-element.js +101 -96
- package/dist/es-dev/base/dds-form-element.js +122 -144
- package/dist/es-dev/base/dds-property.d.ts +1 -1
- package/dist/es-dev/base/dds-property.js +48 -8
- package/dist/es-dev/base/decorators.js +8 -11
- package/dist/es-dev/base/define.js +12 -17
- package/dist/es-dev/base/index.js +3 -11
- package/dist/es-dev/components/accordion/daikin-accordion.js +70 -96
- package/dist/es-dev/components/accordion/index.js +1 -3
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +138 -168
- package/dist/es-dev/components/accordion-item/index.js +1 -3
- package/dist/es-dev/components/avatar/daikin-avatar.js +136 -156
- package/dist/es-dev/components/avatar/index.js +1 -3
- package/dist/es-dev/components/badge/daikin-badge.js +173 -198
- package/dist/es-dev/components/badge/index.js +1 -3
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +73 -87
- package/dist/es-dev/components/breadcrumb/index.js +1 -3
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +106 -119
- package/dist/es-dev/components/breadcrumb-item/index.js +1 -3
- package/dist/es-dev/components/button/daikin-button.js +255 -286
- package/dist/es-dev/components/button/index.js +1 -3
- package/dist/es-dev/components/calendar/daikin-calendar.js +415 -531
- package/dist/es-dev/components/calendar/index.js +1 -3
- package/dist/es-dev/components/card/daikin-card.js +44 -58
- package/dist/es-dev/components/card/index.js +1 -3
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +16 -25
- package/dist/es-dev/components/card-footer/index.js +1 -3
- package/dist/es-dev/components/card-header/daikin-card-header.js +39 -48
- package/dist/es-dev/components/card-header/index.js +1 -3
- package/dist/es-dev/components/carousel/daikin-carousel.js +127 -173
- package/dist/es-dev/components/carousel/index.js +1 -3
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +44 -58
- package/dist/es-dev/components/carousel-item/index.js +1 -3
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +315 -333
- package/dist/es-dev/components/checkbox/index.js +1 -3
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +86 -106
- package/dist/es-dev/components/checkbox-group/index.js +1 -3
- package/dist/es-dev/components/chip/daikin-chip.js +304 -332
- package/dist/es-dev/components/chip/index.js +1 -3
- package/dist/es-dev/components/combobox/daikin-combobox.js +454 -584
- package/dist/es-dev/components/combobox/index.js +1 -4
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +795 -837
- package/dist/es-dev/components/date-picker/index.js +1 -3
- package/dist/es-dev/components/divider/daikin-divider.js +25 -34
- package/dist/es-dev/components/divider/index.js +1 -3
- package/dist/es-dev/components/drawer/daikin-drawer.js +189 -208
- package/dist/es-dev/components/drawer/index.js +1 -3
- package/dist/es-dev/components/drawer-footer/daikin-drawer-footer.js +18 -27
- package/dist/es-dev/components/drawer-footer/index.js +1 -3
- package/dist/es-dev/components/drawer-header/daikin-drawer-header.js +53 -64
- package/dist/es-dev/components/drawer-header/index.js +1 -3
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +468 -570
- package/dist/es-dev/components/dropdown/index.js +1 -3
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +124 -150
- package/dist/es-dev/components/dropdown-item/index.js +1 -3
- package/dist/es-dev/components/empty-state/daikin-empty-state.js +21 -30
- package/dist/es-dev/components/empty-state/index.js +1 -3
- package/dist/es-dev/components/icon/daikin-icon.js +158 -206
- package/dist/es-dev/components/icon/icons.json.js +97 -7
- package/dist/es-dev/components/icon/index.js +1 -4
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +242 -267
- package/dist/es-dev/components/icon-button/index.js +1 -3
- package/dist/es-dev/components/index.js +85 -99
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +130 -160
- package/dist/es-dev/components/inline-notification/index.js +1 -3
- package/dist/es-dev/components/input-group/daikin-input-group.js +184 -234
- package/dist/es-dev/components/input-group/index.js +1 -3
- package/dist/es-dev/components/link/daikin-link.js +111 -127
- package/dist/es-dev/components/link/index.js +1 -3
- package/dist/es-dev/components/list/daikin-list.js +77 -100
- package/dist/es-dev/components/list/index.js +1 -3
- package/dist/es-dev/components/list-item/daikin-list-item.js +168 -192
- package/dist/es-dev/components/list-item/index.js +1 -3
- package/dist/es-dev/components/loading/daikin-loading.js +62 -82
- package/dist/es-dev/components/loading/index.js +1 -3
- package/dist/es-dev/components/logo/daikin-logo.js +106 -125
- package/dist/es-dev/components/logo/index.js +1 -3
- package/dist/es-dev/components/menu/daikin-menu.js +246 -316
- package/dist/es-dev/components/menu/index.js +1 -3
- package/dist/es-dev/components/modal/daikin-modal.js +97 -126
- package/dist/es-dev/components/modal/index.js +1 -3
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.js +18 -27
- package/dist/es-dev/components/modal-footer/index.js +1 -3
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +61 -72
- package/dist/es-dev/components/modal-header/index.js +1 -3
- package/dist/es-dev/components/navigation/daikin-navigation.js +42 -52
- package/dist/es-dev/components/navigation/index.js +1 -3
- package/dist/es-dev/components/navigation-item/daikin-navigation-item.js +152 -181
- package/dist/es-dev/components/navigation-item/index.js +1 -3
- package/dist/es-dev/components/pagination/daikin-pagination.js +183 -219
- package/dist/es-dev/components/pagination/index.js +1 -3
- package/dist/es-dev/components/pagination/pagination-utils.js +77 -44
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +138 -183
- package/dist/es-dev/components/progress-bar/index.js +1 -3
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +47 -60
- package/dist/es-dev/components/progress-indicator/index.js +1 -3
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +48 -69
- package/dist/es-dev/components/progress-indicator-item/index.js +1 -3
- package/dist/es-dev/components/radio/daikin-radio.js +264 -282
- package/dist/es-dev/components/radio/index.js +1 -3
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +142 -170
- package/dist/es-dev/components/radio-group/index.js +1 -3
- package/dist/es-dev/components/select/daikin-select.js +222 -261
- package/dist/es-dev/components/select/index.js +1 -3
- package/dist/es-dev/components/slider/daikin-slider.js +241 -298
- package/dist/es-dev/components/slider/index.js +1 -3
- package/dist/es-dev/components/slider/slider-utils.js +62 -49
- package/dist/es-dev/components/status-message/daikin-status-message.js +107 -111
- package/dist/es-dev/components/status-message/index.js +1 -3
- package/dist/es-dev/components/tab/daikin-tab.js +105 -130
- package/dist/es-dev/components/tab/index.js +1 -3
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +36 -57
- package/dist/es-dev/components/tab-panels/index.js +1 -3
- package/dist/es-dev/components/table/daikin-table.js +261 -326
- package/dist/es-dev/components/table/index.js +1 -3
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +49 -68
- package/dist/es-dev/components/table-cell/index.js +1 -3
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +121 -137
- package/dist/es-dev/components/table-header-cell/index.js +1 -3
- package/dist/es-dev/components/tabs/daikin-tabs.js +176 -227
- package/dist/es-dev/components/tabs/index.js +1 -3
- package/dist/es-dev/components/tag/daikin-tag.js +140 -150
- package/dist/es-dev/components/tag/index.js +1 -3
- package/dist/es-dev/components/text-area/daikin-text-area.js +153 -173
- package/dist/es-dev/components/text-area/index.js +1 -3
- package/dist/es-dev/components/text-field/daikin-text-field.js +361 -417
- package/dist/es-dev/components/text-field/index.js +1 -3
- package/dist/es-dev/components/text-field/number-utils.js +76 -93
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +279 -303
- package/dist/es-dev/components/text-masked-field/index.js +1 -3
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +685 -768
- package/dist/es-dev/components/time-picker/index.js +1 -13
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +134 -167
- package/dist/es-dev/components/toast-notification/index.js +1 -3
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +165 -193
- package/dist/es-dev/components/toast-notification-manager/index.js +1 -3
- package/dist/es-dev/components/toggle/daikin-toggle.js +160 -175
- package/dist/es-dev/components/toggle/index.js +1 -3
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +2 -2
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +156 -199
- package/dist/es-dev/components/tooltip/index.js +1 -3
- package/dist/es-dev/components/tree/common.js +75 -76
- package/dist/es-dev/components/tree/daikin-tree.js +81 -101
- package/dist/es-dev/components/tree/index.js +1 -3
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +166 -193
- package/dist/es-dev/components/tree-item/index.js +1 -4
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +157 -209
- package/dist/es-dev/components/tree-section/index.js +1 -3
- package/dist/es-dev/components/vertical-navigation/daikin-vertical-navigation.js +80 -114
- package/dist/es-dev/components/vertical-navigation/index.js +1 -3
- package/dist/es-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.js +443 -468
- package/dist/es-dev/components/vertical-navigation-item/index.js +1 -3
- package/dist/es-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +185 -209
- package/dist/es-dev/components/vertical-navigation-menu-item/index.js +1 -3
- package/dist/es-dev/controllers/block-scroll.js +74 -41
- package/dist/es-dev/controllers/click-outside.js +61 -29
- package/dist/es-dev/controllers/custom-readonly.js +52 -58
- package/dist/es-dev/controllers/floating-ui-auto-update.js +76 -103
- package/dist/es-dev/controllers/focus-trap.js +37 -55
- package/dist/es-dev/controllers/helpers/controller-directive.js +46 -45
- package/dist/es-dev/icon-registry.js +148 -163
- package/dist/es-dev/index.js +17 -106
- package/dist/es-dev/is-client.js +4 -4
- package/dist/es-dev/navigation.js +67 -51
- package/dist/es-dev/tailwind.css.js +4 -6
- package/dist/es-dev/utils/calendar-common.js +156 -134
- package/dist/es-dev/utils/extract-half-width-digits.js +18 -9
- package/dist/es-dev/utils/is-similar-to-click.js +4 -4
- package/dist/es-dev/utils/is-simple-key.js +10 -4
- package/dist/es-dev/utils/notification-common.js +17 -31
- package/dist/es-dev/utils/re-dispatch.js +7 -9
- package/dist/es-dev/utils/scroller.js +45 -61
- package/package.json +80 -78
|
@@ -1,716 +1,732 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { unsafeCSS, css, nothing, html } from "lit";
|
|
4
|
-
import { state } from "lit/decorators.js";
|
|
5
|
-
import { guard } from "lit/directives/guard.js";
|
|
6
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
|
-
import { createRef, ref } from "lit/directives/ref.js";
|
|
8
|
-
import "../../base/dds-element.js";
|
|
1
|
+
import { property as property$1 } from "../../base/dds-property.js";
|
|
2
|
+
import __decorate from "../../_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/decorate.js";
|
|
9
3
|
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
10
|
-
import { property } from "../../base/dds-property.js";
|
|
11
4
|
import { ddsElement } from "../../base/decorators.js";
|
|
12
|
-
import "../../base/
|
|
5
|
+
import "../../base/index.js";
|
|
6
|
+
import tailwind_default from "../../tailwind.css.js";
|
|
7
|
+
import { countDaysForYearMonth, cvaIconButton, formatDateForProperty, isDateOutOfRange, parseDateFromProperty, tryParseDateFromProperty } from "../../utils/calendar-common.js";
|
|
8
|
+
import "../icon-button/daikin-icon-button.js";
|
|
9
|
+
import "../calendar/daikin-calendar.js";
|
|
13
10
|
import { FloatingUIAutoUpdateController } from "../../controllers/floating-ui-auto-update.js";
|
|
14
11
|
import { FocusTrapController } from "../../controllers/focus-trap.js";
|
|
15
|
-
import tailwindStyles from "../../tailwind.css.js";
|
|
16
|
-
import { tryParseDateFromProperty, parseDateFromProperty, DEFAULT_MIN_DATE, DEFAULT_MAX_DATE, formatDateForProperty, isDateOutOfRange, cvaIconButton, countDaysForYearMonth } from "../../utils/calendar-common.js";
|
|
17
12
|
import { extractHalfWidthDigits } from "../../utils/extract-half-width-digits.js";
|
|
18
13
|
import { reDispatch } from "../../utils/re-dispatch.js";
|
|
19
|
-
import "
|
|
20
|
-
import "
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const dateTimeFormatPartsCache = /* @__PURE__ */ new Map();
|
|
14
|
+
import { css, html, nothing, unsafeCSS } from "lit";
|
|
15
|
+
import { state } from "lit/decorators.js";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
17
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
18
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
19
|
+
import { flip, offset, shift, size } from "@floating-ui/dom";
|
|
20
|
+
import { guard } from "lit/directives/guard.js";
|
|
21
|
+
//#region src/components/date-picker/daikin-date-picker.ts
|
|
22
|
+
var dateTimeFormatPartsCache = /* @__PURE__ */ new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Gets the date format parts for the given inputLocale, using cache to optimize performance. If the inputLocale is invalid, it falls back to the default locale and caches the result under the requested key to avoid throwing errors on subsequent calls with the same invalid inputLocale.
|
|
25
|
+
*/
|
|
32
26
|
function getSafeDateTimeFormatParts(inputLocale) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
dateTimeFormatPartsCache.set(key, parts);
|
|
51
|
-
return parts;
|
|
52
|
-
}
|
|
27
|
+
const options = {
|
|
28
|
+
year: "numeric",
|
|
29
|
+
month: "numeric",
|
|
30
|
+
day: "numeric"
|
|
31
|
+
};
|
|
32
|
+
const key = inputLocale ?? "__DEFAULT__";
|
|
33
|
+
const cached = dateTimeFormatPartsCache.get(key);
|
|
34
|
+
if (cached) return cached;
|
|
35
|
+
try {
|
|
36
|
+
const parts = new Intl.DateTimeFormat(inputLocale ?? void 0, options).formatToParts(0);
|
|
37
|
+
dateTimeFormatPartsCache.set(key, parts);
|
|
38
|
+
return parts;
|
|
39
|
+
} catch {
|
|
40
|
+
const parts = new Intl.DateTimeFormat(void 0, options).formatToParts(0);
|
|
41
|
+
dateTimeFormatPartsCache.set(key, parts);
|
|
42
|
+
return parts;
|
|
43
|
+
}
|
|
53
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Build date item metadata (type + selection ranges) based on the current inputLocale's
|
|
47
|
+
* date order (e.g. MDY, DMY, YMD) and the separator used by Intl.
|
|
48
|
+
*/
|
|
54
49
|
function getDateOrderAndSeparator(inputLocale) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
const parts = getSafeDateTimeFormatParts(inputLocale ?? void 0);
|
|
51
|
+
const order = parts.filter((p) => [
|
|
52
|
+
"year",
|
|
53
|
+
"month",
|
|
54
|
+
"day"
|
|
55
|
+
].includes(p.type)).map((p) => p.type);
|
|
56
|
+
const literals = parts.filter((p) => p.type === "literal");
|
|
57
|
+
const sep = literals.length >= 2 && literals[0].value === literals[1].value ? literals[0].value : "/";
|
|
58
|
+
const isValidOrder = order.length === 3 && [
|
|
59
|
+
"year",
|
|
60
|
+
"month",
|
|
61
|
+
"day"
|
|
62
|
+
].every((part) => order.includes(part));
|
|
63
|
+
const isValidSep = sep.length > 0 && /^\D+$/.test(sep);
|
|
64
|
+
if (!isValidOrder || !isValidSep) return {
|
|
65
|
+
order: [
|
|
66
|
+
"month",
|
|
67
|
+
"day",
|
|
68
|
+
"year"
|
|
69
|
+
],
|
|
70
|
+
sep: "/"
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
order,
|
|
74
|
+
sep
|
|
75
|
+
};
|
|
71
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* The year, month, and day that make up the date string in the input field, and the
|
|
79
|
+
* range (inclusive) that each item is included in, arranged in the order of the items.
|
|
80
|
+
*
|
|
81
|
+
* The order of the elements must be ascending in the range.
|
|
82
|
+
*/
|
|
72
83
|
function getDateItems(inputLocale) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
85
|
+
const lengths = {
|
|
86
|
+
year: 4,
|
|
87
|
+
month: 2,
|
|
88
|
+
day: 2
|
|
89
|
+
};
|
|
90
|
+
return order.map((key, i) => {
|
|
91
|
+
const type = key;
|
|
92
|
+
const len = lengths[type];
|
|
93
|
+
const start = order.slice(0, i).reduce((sum, k) => sum + lengths[k], 0) + i * sep.length;
|
|
94
|
+
return {
|
|
95
|
+
type,
|
|
96
|
+
range: [start, start + len]
|
|
97
|
+
};
|
|
98
|
+
});
|
|
83
99
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
error: {
|
|
122
|
-
false: [
|
|
123
|
-
"enabled:[--color-base:var(--dds-color-common-neutral-default)]",
|
|
124
|
-
"focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"
|
|
125
|
-
],
|
|
126
|
-
true: ["enabled:[--color-base:var(--dds-color-common-danger-default)]"]
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
);
|
|
100
|
+
var PLACEHOLDER_YEAR = "YYYY";
|
|
101
|
+
var PLACEHOLDER_MONTH = "MM";
|
|
102
|
+
var PLACEHOLDER_DAY = "DD";
|
|
103
|
+
var cvaField = cva([
|
|
104
|
+
"flex",
|
|
105
|
+
"items-center",
|
|
106
|
+
"size-full",
|
|
107
|
+
"min-h-(--dds-input-height)",
|
|
108
|
+
"bg-ddt-color-common-background-default",
|
|
109
|
+
"pl-[calc(var(--dds-padding-30)+0.25rem)]",
|
|
110
|
+
"pr-[calc((var(--dds-gap-10))+var(--dds-icon-button)+0.5rem)]",
|
|
111
|
+
"rounded-sm",
|
|
112
|
+
"truncate",
|
|
113
|
+
"outline-solid",
|
|
114
|
+
"outline-(--color-border)",
|
|
115
|
+
"outline-0",
|
|
116
|
+
"-outline-offset-2",
|
|
117
|
+
"placeholder:text-ddt-color-common-text-secondary",
|
|
118
|
+
"[--color-border:var(--color-state-focus,var(--color-base))]",
|
|
119
|
+
"border",
|
|
120
|
+
"border-(--color-border)",
|
|
121
|
+
"enabled:text-ddt-color-common-text-primary",
|
|
122
|
+
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
123
|
+
"enabled:active:bg-ddt-color-common-surface-press",
|
|
124
|
+
"focus-visible:outline-2",
|
|
125
|
+
"disabled:[--color-base:var(--dds-color-common-disabled)]",
|
|
126
|
+
"disabled:text-ddt-color-common-disabled",
|
|
127
|
+
"disabled:bg-ddt-color-common-background-default",
|
|
128
|
+
"disabled:placeholder:text-ddt-color-common-disabled"
|
|
129
|
+
], { variants: { error: {
|
|
130
|
+
false: ["enabled:[--color-base:var(--dds-color-common-neutral-default)]", "focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"],
|
|
131
|
+
true: ["enabled:[--color-base:var(--dds-color-common-danger-default)]"]
|
|
132
|
+
} } });
|
|
133
|
+
/**
|
|
134
|
+
* Decomposes the date string displayed on the UI and returns it as an object.
|
|
135
|
+
* The returned object may not necessarily be a valid date. It may contain strings such as YYYY or invalid dates such as 02/31.
|
|
136
|
+
*/
|
|
131
137
|
function parsePartsFromUIValue(value, inputLocale) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
order.map((key, i) => [key, parts[i] ?? ""])
|
|
136
|
-
);
|
|
138
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
139
|
+
const parts = value.split(sep);
|
|
140
|
+
return Object.fromEntries(order.map((key, i) => [key, parts[i] ?? ""]));
|
|
137
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Formats the date parts object into a string format for display in the UI.
|
|
144
|
+
* The object does not necessarily need to be a valid date. It can contain strings such as YYYY or invalid dates such as 02/31.
|
|
145
|
+
*/
|
|
138
146
|
function formatPartsForUI(parts, inputLocale) {
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
const { order, sep } = getDateOrderAndSeparator(inputLocale);
|
|
148
|
+
return order.map((k) => parts[k]).join(sep);
|
|
141
149
|
}
|
|
142
150
|
function getPlaceholderAll(inputLocale) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
return formatPartsForUI({
|
|
152
|
+
year: PLACEHOLDER_YEAR,
|
|
153
|
+
month: PLACEHOLDER_MONTH,
|
|
154
|
+
day: PLACEHOLDER_DAY
|
|
155
|
+
}, inputLocale);
|
|
147
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Parses the date string on the UI and returns it as a `Date` (in UTC).
|
|
159
|
+
* If the date string on the UI is not a valid date (contains a string such as YYYY or an invalid date such as 02/31), returns null.
|
|
160
|
+
*/
|
|
148
161
|
function tryParseDateFromUIValue(value, inputLocale) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
const date = parseDateFromProperty(`${year}-${month}-${day}`);
|
|
158
|
-
if (date.getUTCFullYear() !== Number(year) || date.getUTCMonth() + 1 !== Number(month) || date.getUTCDate() !== Number(day)) {
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
|
-
return date;
|
|
162
|
+
const { year, month, day } = parsePartsFromUIValue(value, inputLocale);
|
|
163
|
+
if (!/^[1-9]\d\d\d$/.test(year) || !/^\d\d$/.test(month) || !/^\d\d$/.test(day)) return null;
|
|
164
|
+
const date = parseDateFromProperty(`${year}-${month}-${day}`);
|
|
165
|
+
if (date.getUTCFullYear() !== Number(year) || date.getUTCMonth() + 1 !== Number(month) || date.getUTCDate() !== Number(day)) return null;
|
|
166
|
+
return date;
|
|
162
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Formats the UTC `Date` as a date string in the UI.
|
|
170
|
+
*/
|
|
163
171
|
function formatDateForUI(date, inputLocale) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
inputLocale
|
|
171
|
-
);
|
|
172
|
+
return formatPartsForUI({
|
|
173
|
+
year: String(date.getUTCFullYear()).padStart(4, "0"),
|
|
174
|
+
month: String(date.getUTCMonth() + 1).padStart(2, "0"),
|
|
175
|
+
day: String(date.getUTCDate()).padStart(2, "0")
|
|
176
|
+
}, inputLocale);
|
|
172
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Gets the type of date item (year, month, or day) that matches the selected range.
|
|
180
|
+
* If there are no matching items, returns null.
|
|
181
|
+
*/
|
|
173
182
|
function getDateItemInSelection(selectionStart, selectionEnd, inputLocale) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return type;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return null;
|
|
183
|
+
for (const { type, range } of getDateItems(inputLocale)) if (range[0] <= selectionStart && selectionStart <= range[1] && range[0] <= selectionEnd && selectionEnd <= range[1]) return type;
|
|
184
|
+
return null;
|
|
180
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Calculates state updates based on numeric key input.
|
|
188
|
+
* If the year, month, and day should be updated, an object containing `parts` and `done` is returned.
|
|
189
|
+
* `parts` stores the new year, month, and day objects.
|
|
190
|
+
* If the input in the input field is complete and the next item should be moved to, `done` is set to true.
|
|
191
|
+
* In the case of the last item (currently the year), even if done is true, there is no need to move to the next item.
|
|
192
|
+
* If there is no need to update the state, null is returned.
|
|
193
|
+
*/
|
|
181
194
|
function handleDigitInput(parts, item, digit) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
195
|
+
switch (item) {
|
|
196
|
+
case "year": {
|
|
197
|
+
if (!parts.year.startsWith("0")) return {
|
|
198
|
+
parts: {
|
|
199
|
+
...parts,
|
|
200
|
+
year: `000${digit}`
|
|
201
|
+
},
|
|
202
|
+
done: false
|
|
203
|
+
};
|
|
204
|
+
const newYear = `${parts.year.slice(1)}${digit}`;
|
|
205
|
+
return {
|
|
206
|
+
parts: {
|
|
207
|
+
...parts,
|
|
208
|
+
year: newYear
|
|
209
|
+
},
|
|
210
|
+
done: !newYear.startsWith("0")
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
case "month":
|
|
214
|
+
if (parts.month === "01" && [
|
|
215
|
+
"0",
|
|
216
|
+
"1",
|
|
217
|
+
"2"
|
|
218
|
+
].includes(digit)) return {
|
|
219
|
+
parts: {
|
|
220
|
+
...parts,
|
|
221
|
+
month: `1${digit}`
|
|
222
|
+
},
|
|
223
|
+
done: true
|
|
224
|
+
};
|
|
225
|
+
if (digit !== "0") return {
|
|
226
|
+
parts: {
|
|
227
|
+
...parts,
|
|
228
|
+
month: `0${digit}`
|
|
229
|
+
},
|
|
230
|
+
done: digit !== "1"
|
|
231
|
+
};
|
|
232
|
+
break;
|
|
233
|
+
case "day":
|
|
234
|
+
if (["01", "02"].includes(parts.day) || parts.day === "03" && ["0", "1"].includes(digit)) return {
|
|
235
|
+
parts: {
|
|
236
|
+
...parts,
|
|
237
|
+
day: `${parts.day.slice(1)}${digit}`
|
|
238
|
+
},
|
|
239
|
+
done: true
|
|
240
|
+
};
|
|
241
|
+
if (parts.day === "03" && digit === "3" || digit === "0") break;
|
|
242
|
+
return {
|
|
243
|
+
parts: {
|
|
244
|
+
...parts,
|
|
245
|
+
day: `0${digit}`
|
|
246
|
+
},
|
|
247
|
+
done: ![
|
|
248
|
+
"1",
|
|
249
|
+
"2",
|
|
250
|
+
"3"
|
|
251
|
+
].includes(digit)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
return null;
|
|
229
255
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
newValue = nanDefault ?? (offset2 > 0 ? min : max);
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
...parts,
|
|
274
|
-
[item]: String(Math.max(Math.min(newValue, max), min)).padStart(
|
|
275
|
-
length,
|
|
276
|
-
"0"
|
|
277
|
-
)
|
|
278
|
-
};
|
|
256
|
+
/**
|
|
257
|
+
* Calculates state updates based on offset.
|
|
258
|
+
* If the year, month, and day should be updated, a new parts object is returned.
|
|
259
|
+
* If there is no need to update the state, null is returned.
|
|
260
|
+
*/
|
|
261
|
+
function handleOffsetInput(parts, item, offset, viewDate, minDate, maxDate) {
|
|
262
|
+
if (offset === 0) return null;
|
|
263
|
+
const year = Number(parts.year);
|
|
264
|
+
const month = Number(parts.month);
|
|
265
|
+
const maxDay = isFinite(month) ? countDaysForYearMonth(isFinite(year) ? year : 2021, month - 1) : 31;
|
|
266
|
+
const { nanDefault, min, max, length } = {
|
|
267
|
+
year: {
|
|
268
|
+
nanDefault: viewDate?.getUTCFullYear(),
|
|
269
|
+
min: minDate.getUTCFullYear(),
|
|
270
|
+
max: maxDate.getUTCFullYear(),
|
|
271
|
+
length: 4
|
|
272
|
+
},
|
|
273
|
+
month: {
|
|
274
|
+
nanDefault: null,
|
|
275
|
+
min: 1,
|
|
276
|
+
max: 12,
|
|
277
|
+
length: 2
|
|
278
|
+
},
|
|
279
|
+
day: {
|
|
280
|
+
nanDefault: null,
|
|
281
|
+
min: 1,
|
|
282
|
+
max: maxDay,
|
|
283
|
+
length: 2
|
|
284
|
+
}
|
|
285
|
+
}[item];
|
|
286
|
+
const value = Number(parts[item]);
|
|
287
|
+
let newValue;
|
|
288
|
+
if (isFinite(value)) {
|
|
289
|
+
const withOffset = value + offset;
|
|
290
|
+
newValue = min <= withOffset && withOffset <= max ? withOffset : offset > 0 ? min : max;
|
|
291
|
+
} else newValue = nanDefault ?? (offset > 0 ? min : max);
|
|
292
|
+
return {
|
|
293
|
+
...parts,
|
|
294
|
+
[item]: String(Math.max(Math.min(newValue, max), min)).padStart(length, "0")
|
|
295
|
+
};
|
|
279
296
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return tryParseDateFromProperty(this.value);
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Returns the string to bind to the <input> element's .value property.
|
|
331
|
-
*
|
|
332
|
-
* - When this.value holds a valid date, show the locale-formatted date.
|
|
333
|
-
* - When _inputValue contains partial or invalid content (placeholders / impossible
|
|
334
|
-
* dates like 02/31), return it so the user's in-progress entry is preserved
|
|
335
|
-
* across Lit re-renders.
|
|
336
|
-
* - Otherwise (e.g. this.value was cleared externally while _inputValue still
|
|
337
|
-
* holds a now-stale complete valid date string) return "" so the CSS placeholder
|
|
338
|
-
* text is visible instead.
|
|
339
|
-
*/
|
|
340
|
-
get _displayValue() {
|
|
341
|
-
if (this._dateValue) {
|
|
342
|
-
return this._formatDateForUI(this._dateValue);
|
|
343
|
-
}
|
|
344
|
-
if (this._inputValue && !this._tryParseDateFromUIValue(this._inputValue)) {
|
|
345
|
-
return this._inputValue;
|
|
346
|
-
}
|
|
347
|
-
return "";
|
|
348
|
-
}
|
|
349
|
-
get _min() {
|
|
350
|
-
return tryParseDateFromProperty(this.min) ?? parseDateFromProperty(DEFAULT_MIN_DATE);
|
|
351
|
-
}
|
|
352
|
-
get _max() {
|
|
353
|
-
return tryParseDateFromProperty(this.max) ?? parseDateFromProperty(DEFAULT_MAX_DATE);
|
|
354
|
-
}
|
|
355
|
-
get _viewDate() {
|
|
356
|
-
var _a;
|
|
357
|
-
return ((_a = this._calendarElement.value) == null ? void 0 : _a.viewDate) ?? null;
|
|
358
|
-
}
|
|
359
|
-
get _open() {
|
|
360
|
-
return this.open && !this.disabled && !this.readonly;
|
|
361
|
-
}
|
|
362
|
-
_emitSelect() {
|
|
363
|
-
this.dispatchEvent(
|
|
364
|
-
new Event("select", {
|
|
365
|
-
bubbles: true,
|
|
366
|
-
composed: true
|
|
367
|
-
})
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
_handleFocusIn(event) {
|
|
371
|
-
const target = event.target;
|
|
372
|
-
this._updateInputSelection(target);
|
|
373
|
-
}
|
|
374
|
-
_handleFocusOut(event) {
|
|
375
|
-
const target = event.target;
|
|
376
|
-
if (target.value === this._getPlaceholderAll()) {
|
|
377
|
-
target.value = "";
|
|
378
|
-
this._inputValue = "";
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
_handleChange(event) {
|
|
382
|
-
this._updateValue(event.target);
|
|
383
|
-
}
|
|
384
|
-
_handleMouseUp(event) {
|
|
385
|
-
var _a, _b;
|
|
386
|
-
event.preventDefault();
|
|
387
|
-
const selectionStart = ((_a = this._dateInputElement.value) == null ? void 0 : _a.selectionStart) ?? 0;
|
|
388
|
-
const selectionEnd = ((_b = this._dateInputElement.value) == null ? void 0 : _b.selectionEnd) ?? 0;
|
|
389
|
-
const dateItemInSelection = this._getDateItemInSelection(
|
|
390
|
-
selectionStart,
|
|
391
|
-
selectionEnd
|
|
392
|
-
);
|
|
393
|
-
if (event.target.value === this._getPlaceholderAll() && !dateItemInSelection) {
|
|
394
|
-
this._updateSelection("month");
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
if (dateItemInSelection) {
|
|
398
|
-
this._updateSelection(dateItemInSelection);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
// Saves the input's display value when IME composition starts so that
|
|
402
|
-
// `_handleCompositionEnd` can restore it if the browser inserted raw IME text.
|
|
403
|
-
_handleCompositionStart(event) {
|
|
404
|
-
this._preCompositionValue = event.target.value;
|
|
405
|
-
}
|
|
406
|
-
// Handle compositionend to support full-width and half-width digit input via IME.
|
|
407
|
-
// Full-width digits are converted to half-width, then each digit is applied as if
|
|
408
|
-
// the user had typed them one by one using the existing handleDigitInput logic.
|
|
409
|
-
_handleCompositionEnd(event) {
|
|
410
|
-
const target = event.target;
|
|
411
|
-
const composedText = event.data;
|
|
412
|
-
target.value = this._preCompositionValue || this._getPlaceholderAll();
|
|
413
|
-
const digits = extractHalfWidthDigits(composedText);
|
|
414
|
-
if (digits.length === 0) {
|
|
415
|
-
this._updateInputSelection(target);
|
|
416
|
-
this._updateValue(target);
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
this._applyDigits(target, digits);
|
|
420
|
-
}
|
|
421
|
-
// Applies a single digit to the given date part, incorporating fresh-entry
|
|
422
|
-
// tracking for month and day. Extracted from _applyDigits to keep complexity low.
|
|
423
|
-
_applyDigitToPart(parts, item, digit) {
|
|
424
|
-
if (item === "month") {
|
|
425
|
-
const monthDigitIndex = this._monthDigitIndex;
|
|
426
|
-
if (monthDigitIndex === 0) {
|
|
427
|
-
this._monthDigitIndex = 1;
|
|
428
|
-
if (digit === "0") {
|
|
429
|
-
return { parts: { ...parts, month: "00" }, done: false };
|
|
430
|
-
}
|
|
431
|
-
return {
|
|
432
|
-
parts: { ...parts, month: `0${digit}` },
|
|
433
|
-
done: digit !== "1"
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
this._monthDigitIndex = 0;
|
|
437
|
-
if (parts.month === "00") {
|
|
438
|
-
if (digit === "0") return null;
|
|
439
|
-
return { parts: { ...parts, month: `0${digit}` }, done: true };
|
|
440
|
-
}
|
|
441
|
-
} else if (item === "day") {
|
|
442
|
-
const dayDigitIndex = this._dayDigitIndex;
|
|
443
|
-
if (dayDigitIndex === 0) {
|
|
444
|
-
this._dayDigitIndex = 1;
|
|
445
|
-
if (digit === "0") {
|
|
446
|
-
return { parts: { ...parts, day: "00" }, done: false };
|
|
447
|
-
}
|
|
448
|
-
return {
|
|
449
|
-
parts: { ...parts, day: `0${digit}` },
|
|
450
|
-
done: !["1", "2", "3"].includes(digit)
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
this._dayDigitIndex = 0;
|
|
454
|
-
if (parts.day === "00") {
|
|
455
|
-
if (digit === "0") return null;
|
|
456
|
-
return { parts: { ...parts, day: `0${digit}` }, done: true };
|
|
457
|
-
}
|
|
458
|
-
} else if (this._yearDigitIndex === 0) {
|
|
459
|
-
this._yearDigitIndex = 1;
|
|
460
|
-
return { parts: { ...parts, year: `000${digit}` }, done: false };
|
|
461
|
-
}
|
|
462
|
-
return handleDigitInput(parts, item, digit);
|
|
463
|
-
}
|
|
464
|
-
// Applies a sequence of digit characters to the input starting from the currently
|
|
465
|
-
// selected date item, then commits the result to this.value.
|
|
466
|
-
// Shared by _handleKeyDown (single digit) and _handleCompositionEnd (multiple digits).
|
|
467
|
-
_applyDigits(target, digits) {
|
|
468
|
-
const items = this._getDateItems();
|
|
469
|
-
let parts = this._parsePartsFromUIValue(target.value);
|
|
470
|
-
let currentItem = this._currentSelection;
|
|
471
|
-
for (const digit of digits) {
|
|
472
|
-
const currentIndex = items.findIndex(({ type }) => type === currentItem);
|
|
473
|
-
if (currentIndex < 0) break;
|
|
474
|
-
const newState = this._applyDigitToPart(parts, currentItem, digit);
|
|
475
|
-
if (!newState) continue;
|
|
476
|
-
parts = newState.parts;
|
|
477
|
-
if (!newState.done) continue;
|
|
478
|
-
const nextIndex = Math.min(currentIndex + 1, items.length - 1);
|
|
479
|
-
currentItem = items[nextIndex].type;
|
|
480
|
-
this._monthDigitIndex = 0;
|
|
481
|
-
this._dayDigitIndex = 0;
|
|
482
|
-
this._yearDigitIndex = 0;
|
|
483
|
-
}
|
|
484
|
-
target.value = this._formatPartsForUI(parts);
|
|
485
|
-
this._updateSelection(currentItem);
|
|
486
|
-
this._updateValue(target);
|
|
487
|
-
}
|
|
488
|
-
_handleKeyDown(event) {
|
|
489
|
-
if (this.readonly) {
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
if (event.isComposing || event.key === "Process" || event.keyCode === 229) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
const target = event.target;
|
|
496
|
-
const key = event.key;
|
|
497
|
-
const parts = this._parsePartsFromUIValue(target.value);
|
|
498
|
-
if (key === "Backspace" || key === "Delete") {
|
|
499
|
-
event.preventDefault();
|
|
500
|
-
const itemToRemove = this._currentSelection;
|
|
501
|
-
const placeholder = {
|
|
502
|
-
year: PLACEHOLDER_YEAR,
|
|
503
|
-
month: PLACEHOLDER_MONTH,
|
|
504
|
-
day: PLACEHOLDER_DAY
|
|
505
|
-
}[itemToRemove];
|
|
506
|
-
if (parts[itemToRemove] !== placeholder) {
|
|
507
|
-
target.value = this._formatPartsForUI({
|
|
508
|
-
...parts,
|
|
509
|
-
[itemToRemove]: placeholder
|
|
510
|
-
});
|
|
511
|
-
this._updateSelection(itemToRemove);
|
|
512
|
-
}
|
|
513
|
-
this._updateValue(target);
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
if (/^\d$/.test(key)) {
|
|
517
|
-
event.preventDefault();
|
|
518
|
-
this._applyDigits(target, [key]);
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
const moveOffset = {
|
|
522
|
-
ArrowLeft: -1,
|
|
523
|
-
ArrowRight: 1
|
|
524
|
-
}[key];
|
|
525
|
-
if (moveOffset) {
|
|
526
|
-
event.preventDefault();
|
|
527
|
-
const items = this._getDateItems();
|
|
528
|
-
const currentIndex = items.findIndex(
|
|
529
|
-
({ type }) => type === this._currentSelection
|
|
530
|
-
);
|
|
531
|
-
const newIndex = currentIndex >= 0 ? Math.min(Math.max(currentIndex + moveOffset, 0), items.length - 1) : 0;
|
|
532
|
-
this._updateSelection(items[newIndex].type);
|
|
533
|
-
return;
|
|
534
|
-
}
|
|
535
|
-
const countOffset = {
|
|
536
|
-
ArrowUp: 1,
|
|
537
|
-
ArrowDown: -1
|
|
538
|
-
}[key];
|
|
539
|
-
if (countOffset) {
|
|
540
|
-
event.preventDefault();
|
|
541
|
-
const newParts = handleOffsetInput(
|
|
542
|
-
parts,
|
|
543
|
-
this._currentSelection,
|
|
544
|
-
countOffset,
|
|
545
|
-
this._viewDate,
|
|
546
|
-
this._min,
|
|
547
|
-
this._max
|
|
548
|
-
);
|
|
549
|
-
if (newParts) {
|
|
550
|
-
target.value = this._formatPartsForUI(newParts);
|
|
551
|
-
this._updateSelection(this._currentSelection);
|
|
552
|
-
}
|
|
553
|
-
this._updateValue(target);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
if (key.length <= 1) {
|
|
557
|
-
event.preventDefault();
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
// Depending on the PC settings, a period may be entered when the space key is pressed repeatedly, so this is stopped.
|
|
562
|
-
// When this happens, the selection range changes, so this is also reset to the current item.
|
|
563
|
-
// Note: _updateInputSelection is intentionally NOT used here because it always moves focus to the
|
|
564
|
-
// first item, which would break IME input on non-first fields (e.g. compositionend would always
|
|
565
|
-
// edit the first date part instead of the one the user is on).
|
|
566
|
-
_handleBeforeInput(event) {
|
|
567
|
-
event.preventDefault();
|
|
568
|
-
if (!event.isComposing) {
|
|
569
|
-
this._updateSelection(this._currentSelection);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
_handleSelect(event) {
|
|
573
|
-
event.stopPropagation();
|
|
574
|
-
const calendar = event.target;
|
|
575
|
-
if (!calendar.value) {
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
const target = this._dateInputElement.value;
|
|
579
|
-
const value = parseDateFromProperty(calendar.value);
|
|
580
|
-
const formattedForUI = this._formatDateForUI(value);
|
|
581
|
-
this.value = formatDateForProperty(value);
|
|
582
|
-
target.value = formattedForUI;
|
|
583
|
-
this._inputValue = formattedForUI;
|
|
584
|
-
this.error = false;
|
|
585
|
-
if (event.type === "select") {
|
|
586
|
-
this.open = false;
|
|
587
|
-
}
|
|
588
|
-
this._emitSelect();
|
|
589
|
-
}
|
|
590
|
-
_handlePointerDown() {
|
|
591
|
-
this._ignoreCloseByFocusTrap = true;
|
|
592
|
-
}
|
|
593
|
-
_handlePointerUp() {
|
|
594
|
-
this._ignoreCloseByFocusTrap = false;
|
|
595
|
-
if (this.disabled || this.readonly) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
this.open = !this.open;
|
|
599
|
-
}
|
|
600
|
-
_handleCalendarKeyDown(event) {
|
|
601
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
602
|
-
event.preventDefault();
|
|
603
|
-
event.stopPropagation();
|
|
604
|
-
if (this.disabled || this.readonly) {
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
this.open = !this.open;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
_handleToggle(event) {
|
|
611
|
-
if (reDispatch(this, event, new ToggleEvent("toggle", event))) {
|
|
612
|
-
this.open = event.newState === "open";
|
|
613
|
-
const calendar = this._calendarElement.value;
|
|
614
|
-
if (calendar) {
|
|
615
|
-
calendar.view = "day";
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
/**
|
|
620
|
-
* Returns true if all date parts (year/month/day) in the input are filled with
|
|
621
|
-
* digits and no placeholder text (YYYY, MM, DD) remains.
|
|
622
|
-
*/
|
|
623
|
-
_isInputComplete(value) {
|
|
624
|
-
const parts = this._parsePartsFromUIValue(value);
|
|
625
|
-
return /^\d{4}$/.test(parts.year) && /^\d{2}$/.test(parts.month) && /^\d{2}$/.test(parts.day);
|
|
626
|
-
}
|
|
627
|
-
_updateValue(target) {
|
|
628
|
-
this._inputValue = target.value;
|
|
629
|
-
if (target.value === this._getPlaceholderAll()) {
|
|
630
|
-
this.error = false;
|
|
631
|
-
this.value = "";
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
if (!this._isInputComplete(target.value)) {
|
|
635
|
-
this.error = true;
|
|
636
|
-
this.value = "";
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
const newDate = this._tryParseDateFromUIValue(target.value);
|
|
640
|
-
if (!newDate) {
|
|
641
|
-
this.error = true;
|
|
642
|
-
this.value = "";
|
|
643
|
-
return;
|
|
297
|
+
var DaikinDatePicker = class DaikinDatePicker extends DDSFormElement {
|
|
298
|
+
constructor(..._args) {
|
|
299
|
+
super(..._args);
|
|
300
|
+
this.readonly = false;
|
|
301
|
+
this.disabled = false;
|
|
302
|
+
this.required = false;
|
|
303
|
+
this.error = false;
|
|
304
|
+
this.open = false;
|
|
305
|
+
this.defaultValue = null;
|
|
306
|
+
this.locale = null;
|
|
307
|
+
this.inputLocale = null;
|
|
308
|
+
this._label = null;
|
|
309
|
+
this._currentSelection = "month";
|
|
310
|
+
this._preCompositionValue = "";
|
|
311
|
+
this._inputValue = "";
|
|
312
|
+
this._monthDigitIndex = 0;
|
|
313
|
+
this._dayDigitIndex = 0;
|
|
314
|
+
this._yearDigitIndex = 0;
|
|
315
|
+
this._autoUpdateController = new FloatingUIAutoUpdateController(this);
|
|
316
|
+
this._dateInputElement = createRef();
|
|
317
|
+
this._calendarElement = createRef();
|
|
318
|
+
this._calendarButtonElement = createRef();
|
|
319
|
+
this._getLocale = () => this.inputLocale ?? null;
|
|
320
|
+
this._getDateItems = () => getDateItems(this._getLocale());
|
|
321
|
+
this._parsePartsFromUIValue = (v) => parsePartsFromUIValue(v, this._getLocale());
|
|
322
|
+
this._formatPartsForUI = (p) => formatPartsForUI(p, this._getLocale());
|
|
323
|
+
this._tryParseDateFromUIValue = (v) => tryParseDateFromUIValue(v, this._getLocale());
|
|
324
|
+
this._formatDateForUI = (d) => formatDateForUI(d, this._getLocale());
|
|
325
|
+
this._getPlaceholderAll = () => getPlaceholderAll(this._getLocale());
|
|
326
|
+
this._getDateItemInSelection = (s, e) => getDateItemInSelection(s, e, this._getLocale());
|
|
327
|
+
this._ignoreCloseByFocusTrap = false;
|
|
328
|
+
this._handleCloseCalendar = () => {
|
|
329
|
+
if (this._ignoreCloseByFocusTrap) return;
|
|
330
|
+
this.open = false;
|
|
331
|
+
this._calendarButtonElement.value?.focus();
|
|
332
|
+
};
|
|
333
|
+
this._focusTrapController = new FocusTrapController(this, this._handleCloseCalendar);
|
|
334
|
+
this.label = null;
|
|
335
|
+
}
|
|
336
|
+
static {
|
|
337
|
+
this.styles = css`
|
|
338
|
+
${unsafeCSS(tailwind_default)}
|
|
339
|
+
|
|
340
|
+
:host {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
height: var(--dds-input-height, 3rem);
|
|
644
344
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
this.value = newValue;
|
|
650
|
-
this._emitSelect();
|
|
651
|
-
}
|
|
652
|
-
return;
|
|
345
|
+
|
|
346
|
+
:host([readonly]:not([disabled])) input {
|
|
347
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
348
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
653
349
|
}
|
|
654
|
-
|
|
655
|
-
|
|
350
|
+
|
|
351
|
+
:host([readonly]:not([disabled])) input:hover,
|
|
352
|
+
:host([readonly]:not([disabled])) input:active {
|
|
353
|
+
--color-base: var(--dds-color-common-surface-secondary);
|
|
354
|
+
background-color: var(--dds-color-common-surface-secondary);
|
|
656
355
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
this._emitSelect();
|
|
661
|
-
}
|
|
662
|
-
_updateInputSelection(target) {
|
|
663
|
-
var _a;
|
|
664
|
-
const selection = window.getSelection();
|
|
665
|
-
if (!selection) {
|
|
666
|
-
return;
|
|
356
|
+
|
|
357
|
+
:host([readonly]:not([disabled])) input:focus-visible {
|
|
358
|
+
--color-base: var(--dds-color-common-border-focus);
|
|
667
359
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
360
|
+
|
|
361
|
+
:host([readonly][error]:not([disabled])) input,
|
|
362
|
+
:host([readonly][error]:not([disabled])) input:hover,
|
|
363
|
+
:host([readonly][error]:not([disabled])) input:active {
|
|
364
|
+
--color-base: var(--dds-color-common-danger-default);
|
|
671
365
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
itemInfo.range[1]
|
|
676
|
-
);
|
|
677
|
-
this._monthDigitIndex = 0;
|
|
678
|
-
this._dayDigitIndex = 0;
|
|
679
|
-
this._yearDigitIndex = 0;
|
|
680
|
-
this._currentSelection = itemInfo.type;
|
|
681
|
-
}
|
|
682
|
-
_updateSelection(dateItem) {
|
|
683
|
-
var _a;
|
|
684
|
-
const selection = window.getSelection();
|
|
685
|
-
if (!selection) {
|
|
686
|
-
return;
|
|
366
|
+
|
|
367
|
+
daikin-calendar[popover] {
|
|
368
|
+
display: none;
|
|
687
369
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (dateItem === "month") this._monthDigitIndex = 0;
|
|
692
|
-
if (dateItem === "day") this._dayDigitIndex = 0;
|
|
693
|
-
if (dateItem === "year") this._yearDigitIndex = 0;
|
|
694
|
-
}
|
|
695
|
-
(_a = this._dateInputElement.value) == null ? void 0 : _a.setSelectionRange(
|
|
696
|
-
itemInfo.range[0],
|
|
697
|
-
itemInfo.range[1]
|
|
698
|
-
);
|
|
699
|
-
this._currentSelection = itemInfo.type;
|
|
370
|
+
|
|
371
|
+
daikin-calendar[popover]:popover-open {
|
|
372
|
+
display: flex;
|
|
700
373
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
374
|
+
`;
|
|
375
|
+
}
|
|
376
|
+
static getDefaultPlaceholder(element) {
|
|
377
|
+
return getPlaceholderAll(element._getLocale());
|
|
378
|
+
}
|
|
379
|
+
get _dateValue() {
|
|
380
|
+
return tryParseDateFromProperty(this.value);
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Returns the string to bind to the <input> element's .value property.
|
|
384
|
+
*
|
|
385
|
+
* - When this.value holds a valid date, show the locale-formatted date.
|
|
386
|
+
* - When _inputValue contains partial or invalid content (placeholders / impossible
|
|
387
|
+
* dates like 02/31), return it so the user's in-progress entry is preserved
|
|
388
|
+
* across Lit re-renders.
|
|
389
|
+
* - Otherwise (e.g. this.value was cleared externally while _inputValue still
|
|
390
|
+
* holds a now-stale complete valid date string) return "" so the CSS placeholder
|
|
391
|
+
* text is visible instead.
|
|
392
|
+
*/
|
|
393
|
+
get _displayValue() {
|
|
394
|
+
if (this._dateValue) return this._formatDateForUI(this._dateValue);
|
|
395
|
+
if (this._inputValue && !this._tryParseDateFromUIValue(this._inputValue)) return this._inputValue;
|
|
396
|
+
return "";
|
|
397
|
+
}
|
|
398
|
+
get _min() {
|
|
399
|
+
return tryParseDateFromProperty(this.min) ?? parseDateFromProperty("1900-01-01");
|
|
400
|
+
}
|
|
401
|
+
get _max() {
|
|
402
|
+
return tryParseDateFromProperty(this.max) ?? parseDateFromProperty("2099-12-31");
|
|
403
|
+
}
|
|
404
|
+
get _viewDate() {
|
|
405
|
+
return this._calendarElement.value?.viewDate ?? null;
|
|
406
|
+
}
|
|
407
|
+
get _open() {
|
|
408
|
+
return this.open && !this.disabled && !this.readonly;
|
|
409
|
+
}
|
|
410
|
+
_emitSelect() {
|
|
411
|
+
this.dispatchEvent(new Event("select", {
|
|
412
|
+
bubbles: true,
|
|
413
|
+
composed: true
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
_handleFocusIn(event) {
|
|
417
|
+
const target = event.target;
|
|
418
|
+
this._updateInputSelection(target);
|
|
419
|
+
}
|
|
420
|
+
_handleFocusOut(event) {
|
|
421
|
+
const target = event.target;
|
|
422
|
+
if (target.value === this._getPlaceholderAll()) {
|
|
423
|
+
target.value = "";
|
|
424
|
+
this._inputValue = "";
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
_handleChange(event) {
|
|
428
|
+
this._updateValue(event.target);
|
|
429
|
+
}
|
|
430
|
+
_handleMouseUp(event) {
|
|
431
|
+
event.preventDefault();
|
|
432
|
+
const selectionStart = this._dateInputElement.value?.selectionStart ?? 0;
|
|
433
|
+
const selectionEnd = this._dateInputElement.value?.selectionEnd ?? 0;
|
|
434
|
+
const dateItemInSelection = this._getDateItemInSelection(selectionStart, selectionEnd);
|
|
435
|
+
if (event.target.value === this._getPlaceholderAll() && !dateItemInSelection) {
|
|
436
|
+
this._updateSelection("month");
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (dateItemInSelection) this._updateSelection(dateItemInSelection);
|
|
440
|
+
}
|
|
441
|
+
_handleCompositionStart(event) {
|
|
442
|
+
this._preCompositionValue = event.target.value;
|
|
443
|
+
}
|
|
444
|
+
_handleCompositionEnd(event) {
|
|
445
|
+
const target = event.target;
|
|
446
|
+
const composedText = event.data;
|
|
447
|
+
target.value = this._preCompositionValue || this._getPlaceholderAll();
|
|
448
|
+
const digits = extractHalfWidthDigits(composedText);
|
|
449
|
+
if (digits.length === 0) {
|
|
450
|
+
this._updateInputSelection(target);
|
|
451
|
+
this._updateValue(target);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
this._applyDigits(target, digits);
|
|
455
|
+
}
|
|
456
|
+
_applyDigitToPart(parts, item, digit) {
|
|
457
|
+
if (item === "month") {
|
|
458
|
+
if (this._monthDigitIndex === 0) {
|
|
459
|
+
this._monthDigitIndex = 1;
|
|
460
|
+
if (digit === "0") return {
|
|
461
|
+
parts: {
|
|
462
|
+
...parts,
|
|
463
|
+
month: "00"
|
|
464
|
+
},
|
|
465
|
+
done: false
|
|
466
|
+
};
|
|
467
|
+
return {
|
|
468
|
+
parts: {
|
|
469
|
+
...parts,
|
|
470
|
+
month: `0${digit}`
|
|
471
|
+
},
|
|
472
|
+
done: digit !== "1"
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
this._monthDigitIndex = 0;
|
|
476
|
+
if (parts.month === "00") {
|
|
477
|
+
if (digit === "0") return null;
|
|
478
|
+
return {
|
|
479
|
+
parts: {
|
|
480
|
+
...parts,
|
|
481
|
+
month: `0${digit}`
|
|
482
|
+
},
|
|
483
|
+
done: true
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
} else if (item === "day") {
|
|
487
|
+
if (this._dayDigitIndex === 0) {
|
|
488
|
+
this._dayDigitIndex = 1;
|
|
489
|
+
if (digit === "0") return {
|
|
490
|
+
parts: {
|
|
491
|
+
...parts,
|
|
492
|
+
day: "00"
|
|
493
|
+
},
|
|
494
|
+
done: false
|
|
495
|
+
};
|
|
496
|
+
return {
|
|
497
|
+
parts: {
|
|
498
|
+
...parts,
|
|
499
|
+
day: `0${digit}`
|
|
500
|
+
},
|
|
501
|
+
done: ![
|
|
502
|
+
"1",
|
|
503
|
+
"2",
|
|
504
|
+
"3"
|
|
505
|
+
].includes(digit)
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
this._dayDigitIndex = 0;
|
|
509
|
+
if (parts.day === "00") {
|
|
510
|
+
if (digit === "0") return null;
|
|
511
|
+
return {
|
|
512
|
+
parts: {
|
|
513
|
+
...parts,
|
|
514
|
+
day: `0${digit}`
|
|
515
|
+
},
|
|
516
|
+
done: true
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
} else if (this._yearDigitIndex === 0) {
|
|
520
|
+
this._yearDigitIndex = 1;
|
|
521
|
+
return {
|
|
522
|
+
parts: {
|
|
523
|
+
...parts,
|
|
524
|
+
year: `000${digit}`
|
|
525
|
+
},
|
|
526
|
+
done: false
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
return handleDigitInput(parts, item, digit);
|
|
530
|
+
}
|
|
531
|
+
_applyDigits(target, digits) {
|
|
532
|
+
const items = this._getDateItems();
|
|
533
|
+
let parts = this._parsePartsFromUIValue(target.value);
|
|
534
|
+
let currentItem = this._currentSelection;
|
|
535
|
+
for (const digit of digits) {
|
|
536
|
+
const currentIndex = items.findIndex(({ type }) => type === currentItem);
|
|
537
|
+
if (currentIndex < 0) break;
|
|
538
|
+
const newState = this._applyDigitToPart(parts, currentItem, digit);
|
|
539
|
+
if (!newState) continue;
|
|
540
|
+
parts = newState.parts;
|
|
541
|
+
if (!newState.done) continue;
|
|
542
|
+
currentItem = items[Math.min(currentIndex + 1, items.length - 1)].type;
|
|
543
|
+
this._monthDigitIndex = 0;
|
|
544
|
+
this._dayDigitIndex = 0;
|
|
545
|
+
this._yearDigitIndex = 0;
|
|
546
|
+
}
|
|
547
|
+
target.value = this._formatPartsForUI(parts);
|
|
548
|
+
this._updateSelection(currentItem);
|
|
549
|
+
this._updateValue(target);
|
|
550
|
+
}
|
|
551
|
+
_handleKeyDown(event) {
|
|
552
|
+
if (this.readonly) return;
|
|
553
|
+
if (event.isComposing || event.key === "Process" || event.keyCode === 229) return;
|
|
554
|
+
const target = event.target;
|
|
555
|
+
const key = event.key;
|
|
556
|
+
const parts = this._parsePartsFromUIValue(target.value);
|
|
557
|
+
if (key === "Backspace" || key === "Delete") {
|
|
558
|
+
event.preventDefault();
|
|
559
|
+
const itemToRemove = this._currentSelection;
|
|
560
|
+
const placeholder = {
|
|
561
|
+
year: PLACEHOLDER_YEAR,
|
|
562
|
+
month: PLACEHOLDER_MONTH,
|
|
563
|
+
day: PLACEHOLDER_DAY
|
|
564
|
+
}[itemToRemove];
|
|
565
|
+
if (parts[itemToRemove] !== placeholder) {
|
|
566
|
+
target.value = this._formatPartsForUI({
|
|
567
|
+
...parts,
|
|
568
|
+
[itemToRemove]: placeholder
|
|
569
|
+
});
|
|
570
|
+
this._updateSelection(itemToRemove);
|
|
571
|
+
}
|
|
572
|
+
this._updateValue(target);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (/^\d$/.test(key)) {
|
|
576
|
+
event.preventDefault();
|
|
577
|
+
this._applyDigits(target, [key]);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
const moveOffset = {
|
|
581
|
+
ArrowLeft: -1,
|
|
582
|
+
ArrowRight: 1
|
|
583
|
+
}[key];
|
|
584
|
+
if (moveOffset) {
|
|
585
|
+
event.preventDefault();
|
|
586
|
+
const items = this._getDateItems();
|
|
587
|
+
const currentIndex = items.findIndex(({ type }) => type === this._currentSelection);
|
|
588
|
+
const newIndex = currentIndex >= 0 ? Math.min(Math.max(currentIndex + moveOffset, 0), items.length - 1) : 0;
|
|
589
|
+
this._updateSelection(items[newIndex].type);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
const countOffset = {
|
|
593
|
+
ArrowUp: 1,
|
|
594
|
+
ArrowDown: -1
|
|
595
|
+
}[key];
|
|
596
|
+
if (countOffset) {
|
|
597
|
+
event.preventDefault();
|
|
598
|
+
const newParts = handleOffsetInput(parts, this._currentSelection, countOffset, this._viewDate, this._min, this._max);
|
|
599
|
+
if (newParts) {
|
|
600
|
+
target.value = this._formatPartsForUI(newParts);
|
|
601
|
+
this._updateSelection(this._currentSelection);
|
|
602
|
+
}
|
|
603
|
+
this._updateValue(target);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (key.length <= 1) {
|
|
607
|
+
event.preventDefault();
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
_handleBeforeInput(event) {
|
|
612
|
+
event.preventDefault();
|
|
613
|
+
if (!event.isComposing) this._updateSelection(this._currentSelection);
|
|
614
|
+
}
|
|
615
|
+
_handleSelect(event) {
|
|
616
|
+
event.stopPropagation();
|
|
617
|
+
const calendar = event.target;
|
|
618
|
+
if (!calendar.value) return;
|
|
619
|
+
const target = this._dateInputElement.value;
|
|
620
|
+
const value = parseDateFromProperty(calendar.value);
|
|
621
|
+
const formattedForUI = this._formatDateForUI(value);
|
|
622
|
+
this.value = formatDateForProperty(value);
|
|
623
|
+
target.value = formattedForUI;
|
|
624
|
+
this._inputValue = formattedForUI;
|
|
625
|
+
this.error = false;
|
|
626
|
+
if (event.type === "select") this.open = false;
|
|
627
|
+
this._emitSelect();
|
|
628
|
+
}
|
|
629
|
+
_handlePointerDown() {
|
|
630
|
+
this._ignoreCloseByFocusTrap = true;
|
|
631
|
+
}
|
|
632
|
+
_handlePointerUp() {
|
|
633
|
+
this._ignoreCloseByFocusTrap = false;
|
|
634
|
+
if (this.disabled || this.readonly) return;
|
|
635
|
+
this.open = !this.open;
|
|
636
|
+
}
|
|
637
|
+
_handleCalendarKeyDown(event) {
|
|
638
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
639
|
+
event.preventDefault();
|
|
640
|
+
event.stopPropagation();
|
|
641
|
+
if (this.disabled || this.readonly) return;
|
|
642
|
+
this.open = !this.open;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
_handleToggle(event) {
|
|
646
|
+
if (reDispatch(this, event, new ToggleEvent("toggle", event))) {
|
|
647
|
+
this.open = event.newState === "open";
|
|
648
|
+
const calendar = this._calendarElement.value;
|
|
649
|
+
if (calendar) calendar.view = "day";
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Returns true if all date parts (year/month/day) in the input are filled with
|
|
654
|
+
* digits and no placeholder text (YYYY, MM, DD) remains.
|
|
655
|
+
*/
|
|
656
|
+
_isInputComplete(value) {
|
|
657
|
+
const parts = this._parsePartsFromUIValue(value);
|
|
658
|
+
return /^\d{4}$/.test(parts.year) && /^\d{2}$/.test(parts.month) && /^\d{2}$/.test(parts.day);
|
|
659
|
+
}
|
|
660
|
+
_updateValue(target) {
|
|
661
|
+
this._inputValue = target.value;
|
|
662
|
+
if (target.value === this._getPlaceholderAll()) {
|
|
663
|
+
this.error = false;
|
|
664
|
+
this.value = "";
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
if (!this._isInputComplete(target.value)) {
|
|
668
|
+
this.error = true;
|
|
669
|
+
this.value = "";
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const newDate = this._tryParseDateFromUIValue(target.value);
|
|
673
|
+
if (!newDate) {
|
|
674
|
+
this.error = true;
|
|
675
|
+
this.value = "";
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
const newValue = formatDateForProperty(newDate);
|
|
679
|
+
if (isDateOutOfRange(newDate, this._min, this._max)) {
|
|
680
|
+
this.error = true;
|
|
681
|
+
if (this.value !== newValue) {
|
|
682
|
+
this.value = newValue;
|
|
683
|
+
this._emitSelect();
|
|
684
|
+
}
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (!this.error && !this.open && this.value === newValue) return;
|
|
688
|
+
this.error = false;
|
|
689
|
+
this.value = newValue;
|
|
690
|
+
this.open = false;
|
|
691
|
+
this._emitSelect();
|
|
692
|
+
}
|
|
693
|
+
_updateInputSelection(target) {
|
|
694
|
+
if (!window.getSelection()) return;
|
|
695
|
+
if (target.value === "") {
|
|
696
|
+
target.value = this._getPlaceholderAll();
|
|
697
|
+
this._inputValue = this._getPlaceholderAll();
|
|
698
|
+
}
|
|
699
|
+
const itemInfo = this._getDateItems()[0];
|
|
700
|
+
this._dateInputElement.value?.setSelectionRange(itemInfo.range[0], itemInfo.range[1]);
|
|
701
|
+
this._monthDigitIndex = 0;
|
|
702
|
+
this._dayDigitIndex = 0;
|
|
703
|
+
this._yearDigitIndex = 0;
|
|
704
|
+
this._currentSelection = itemInfo.type;
|
|
705
|
+
}
|
|
706
|
+
_updateSelection(dateItem) {
|
|
707
|
+
if (!window.getSelection()) return;
|
|
708
|
+
const itemInfo = this._getDateItems().find(({ type }) => type === dateItem);
|
|
709
|
+
if (itemInfo) {
|
|
710
|
+
if (dateItem !== this._currentSelection) {
|
|
711
|
+
if (dateItem === "month") this._monthDigitIndex = 0;
|
|
712
|
+
if (dateItem === "day") this._dayDigitIndex = 0;
|
|
713
|
+
if (dateItem === "year") this._yearDigitIndex = 0;
|
|
714
|
+
}
|
|
715
|
+
this._dateInputElement.value?.setSelectionRange(itemInfo.range[0], itemInfo.range[1]);
|
|
716
|
+
this._currentSelection = itemInfo.type;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Focuses on the inner date input.
|
|
721
|
+
* @param options focus options
|
|
722
|
+
*/
|
|
723
|
+
focus(options) {
|
|
724
|
+
this._dateInputElement.value?.focus(options);
|
|
725
|
+
}
|
|
726
|
+
render() {
|
|
727
|
+
const min = this._min;
|
|
728
|
+
const max = this._max;
|
|
729
|
+
return html`<div
|
|
714
730
|
class="size-full relative"
|
|
715
731
|
${this._autoUpdateController.refReference()}
|
|
716
732
|
>
|
|
@@ -769,151 +785,96 @@ let DaikinDatePicker = class extends DDSFormElement {
|
|
|
769
785
|
${this._autoUpdateController.refFloating()}
|
|
770
786
|
>
|
|
771
787
|
</daikin-calendar>
|
|
772
|
-
${
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
}
|
|
811
|
-
updated(changedProperties) {
|
|
812
|
-
var _a;
|
|
813
|
-
if (changedProperties.has("open") || changedProperties.has("disabled") || changedProperties.has("readonly")) {
|
|
814
|
-
(_a = this._autoUpdateController.floatingElement) == null ? void 0 : _a.togglePopover(this._open);
|
|
815
|
-
}
|
|
816
|
-
if (changedProperties.has("value")) {
|
|
817
|
-
this.setFormValue(this.value);
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
822
|
-
* @private
|
|
823
|
-
*/
|
|
824
|
-
reflectInputGroup(inputGroup) {
|
|
825
|
-
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
826
|
-
this.disabled = !!inputGroup.disabled;
|
|
827
|
-
this.readonly = !!inputGroup.readonly;
|
|
828
|
-
this.required = !!inputGroup.required;
|
|
829
|
-
this.error = isError;
|
|
830
|
-
this._label = inputGroup.label;
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
DaikinDatePicker.styles = css`
|
|
834
|
-
${unsafeCSS(tailwindStyles)}
|
|
835
|
-
|
|
836
|
-
:host {
|
|
837
|
-
display: flex;
|
|
838
|
-
align-items: center;
|
|
839
|
-
height: var(--dds-input-height, 3rem);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
:host([readonly]:not([disabled])) input {
|
|
843
|
-
--color-base: var(--dds-color-common-surface-secondary);
|
|
844
|
-
background-color: var(--dds-color-common-surface-secondary);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
:host([readonly]:not([disabled])) input:hover,
|
|
848
|
-
:host([readonly]:not([disabled])) input:active {
|
|
849
|
-
--color-base: var(--dds-color-common-surface-secondary);
|
|
850
|
-
background-color: var(--dds-color-common-surface-secondary);
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
:host([readonly]:not([disabled])) input:focus-visible {
|
|
854
|
-
--color-base: var(--dds-color-common-border-focus);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
:host([readonly][error]:not([disabled])) input,
|
|
858
|
-
:host([readonly][error]:not([disabled])) input:hover,
|
|
859
|
-
:host([readonly][error]:not([disabled])) input:active {
|
|
860
|
-
--color-base: var(--dds-color-common-danger-default);
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
daikin-calendar[popover] {
|
|
864
|
-
display: none;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
daikin-calendar[popover]:popover-open {
|
|
868
|
-
display: flex;
|
|
869
|
-
}
|
|
870
|
-
`;
|
|
871
|
-
__decorateClass([
|
|
872
|
-
property({
|
|
873
|
-
type: String,
|
|
874
|
-
reflect: true,
|
|
875
|
-
fallbackValue: DaikinDatePicker.getDefaultPlaceholder
|
|
876
|
-
})
|
|
877
|
-
], DaikinDatePicker.prototype, "placeholder", 2);
|
|
878
|
-
__decorateClass([
|
|
879
|
-
property({ type: String, reflect: true, fallbackValue: "1900-01-01" })
|
|
880
|
-
], DaikinDatePicker.prototype, "min", 2);
|
|
881
|
-
__decorateClass([
|
|
882
|
-
property({ type: String, reflect: true, fallbackValue: "2099-12-31" })
|
|
883
|
-
], DaikinDatePicker.prototype, "max", 2);
|
|
884
|
-
__decorateClass([
|
|
885
|
-
property({ type: Boolean, reflect: true })
|
|
886
|
-
], DaikinDatePicker.prototype, "readonly", 2);
|
|
887
|
-
__decorateClass([
|
|
888
|
-
property({ type: Boolean, reflect: true })
|
|
889
|
-
], DaikinDatePicker.prototype, "disabled", 2);
|
|
890
|
-
__decorateClass([
|
|
891
|
-
property({ type: Boolean, reflect: true })
|
|
892
|
-
], DaikinDatePicker.prototype, "required", 2);
|
|
893
|
-
__decorateClass([
|
|
894
|
-
property({ type: Boolean, reflect: true })
|
|
895
|
-
], DaikinDatePicker.prototype, "error", 2);
|
|
896
|
-
__decorateClass([
|
|
897
|
-
property({ type: Boolean, reflect: true })
|
|
898
|
-
], DaikinDatePicker.prototype, "open", 2);
|
|
899
|
-
__decorateClass([
|
|
900
|
-
property({ type: String, reflect: true, attribute: "default-value" })
|
|
901
|
-
], DaikinDatePicker.prototype, "defaultValue", 2);
|
|
902
|
-
__decorateClass([
|
|
903
|
-
property({ type: String, reflect: true })
|
|
904
|
-
], DaikinDatePicker.prototype, "locale", 2);
|
|
905
|
-
__decorateClass([
|
|
906
|
-
property({ type: String, reflect: true, attribute: "input-locale" })
|
|
907
|
-
], DaikinDatePicker.prototype, "inputLocale", 2);
|
|
908
|
-
__decorateClass([
|
|
909
|
-
state()
|
|
910
|
-
], DaikinDatePicker.prototype, "_label", 2);
|
|
911
|
-
__decorateClass([
|
|
912
|
-
state()
|
|
913
|
-
], DaikinDatePicker.prototype, "_currentSelection", 2);
|
|
914
|
-
DaikinDatePicker = __decorateClass([
|
|
915
|
-
ddsElement("daikin-date-picker")
|
|
916
|
-
], DaikinDatePicker);
|
|
917
|
-
export {
|
|
918
|
-
DaikinDatePicker
|
|
788
|
+
${guard([this.open], () => this._autoUpdateController.directive({
|
|
789
|
+
placement: "bottom-start",
|
|
790
|
+
middleware: [
|
|
791
|
+
offset({ mainAxis: 0 }),
|
|
792
|
+
flip(),
|
|
793
|
+
shift(),
|
|
794
|
+
size({ apply({ availableHeight, elements }) {
|
|
795
|
+
Object.assign(elements.floating.style, { maxHeight: `${availableHeight}px` });
|
|
796
|
+
} })
|
|
797
|
+
]
|
|
798
|
+
}, this.open))}
|
|
799
|
+
${guard([this.open], () => this._focusTrapController.directive(this.open))}`;
|
|
800
|
+
}
|
|
801
|
+
willUpdate(changedProperties) {
|
|
802
|
+
if (changedProperties.has("open") || changedProperties.has("disabled") || changedProperties.has("readonly")) this.open = this._open;
|
|
803
|
+
if (changedProperties.has("value")) {
|
|
804
|
+
if (tryParseDateFromProperty(this.value)) {
|
|
805
|
+
const newDate = parseDateFromProperty(this.value);
|
|
806
|
+
this.error = isDateOutOfRange(newDate, this._min, this._max);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
updated(changedProperties) {
|
|
811
|
+
if (changedProperties.has("open") || changedProperties.has("disabled") || changedProperties.has("readonly")) this._autoUpdateController.floatingElement?.togglePopover(this._open);
|
|
812
|
+
if (changedProperties.has("value")) this.setFormValue(this.value);
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
816
|
+
* @private
|
|
817
|
+
*/
|
|
818
|
+
reflectInputGroup(inputGroup) {
|
|
819
|
+
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
820
|
+
this.disabled = !!inputGroup.disabled;
|
|
821
|
+
this.readonly = !!inputGroup.readonly;
|
|
822
|
+
this.required = !!inputGroup.required;
|
|
823
|
+
this.error = isError;
|
|
824
|
+
this._label = inputGroup.label;
|
|
825
|
+
}
|
|
919
826
|
};
|
|
827
|
+
__decorate([property$1({
|
|
828
|
+
type: String,
|
|
829
|
+
reflect: true,
|
|
830
|
+
fallbackValue: DaikinDatePicker.getDefaultPlaceholder
|
|
831
|
+
})], DaikinDatePicker.prototype, "placeholder", void 0);
|
|
832
|
+
__decorate([property$1({
|
|
833
|
+
type: String,
|
|
834
|
+
reflect: true,
|
|
835
|
+
fallbackValue: "1900-01-01"
|
|
836
|
+
})], DaikinDatePicker.prototype, "min", void 0);
|
|
837
|
+
__decorate([property$1({
|
|
838
|
+
type: String,
|
|
839
|
+
reflect: true,
|
|
840
|
+
fallbackValue: "2099-12-31"
|
|
841
|
+
})], DaikinDatePicker.prototype, "max", void 0);
|
|
842
|
+
__decorate([property$1({
|
|
843
|
+
type: Boolean,
|
|
844
|
+
reflect: true
|
|
845
|
+
})], DaikinDatePicker.prototype, "readonly", void 0);
|
|
846
|
+
__decorate([property$1({
|
|
847
|
+
type: Boolean,
|
|
848
|
+
reflect: true
|
|
849
|
+
})], DaikinDatePicker.prototype, "disabled", void 0);
|
|
850
|
+
__decorate([property$1({
|
|
851
|
+
type: Boolean,
|
|
852
|
+
reflect: true
|
|
853
|
+
})], DaikinDatePicker.prototype, "required", void 0);
|
|
854
|
+
__decorate([property$1({
|
|
855
|
+
type: Boolean,
|
|
856
|
+
reflect: true
|
|
857
|
+
})], DaikinDatePicker.prototype, "error", void 0);
|
|
858
|
+
__decorate([property$1({
|
|
859
|
+
type: Boolean,
|
|
860
|
+
reflect: true
|
|
861
|
+
})], DaikinDatePicker.prototype, "open", void 0);
|
|
862
|
+
__decorate([property$1({
|
|
863
|
+
type: String,
|
|
864
|
+
reflect: true,
|
|
865
|
+
attribute: "default-value"
|
|
866
|
+
})], DaikinDatePicker.prototype, "defaultValue", void 0);
|
|
867
|
+
__decorate([property$1({
|
|
868
|
+
type: String,
|
|
869
|
+
reflect: true
|
|
870
|
+
})], DaikinDatePicker.prototype, "locale", void 0);
|
|
871
|
+
__decorate([property$1({
|
|
872
|
+
type: String,
|
|
873
|
+
reflect: true,
|
|
874
|
+
attribute: "input-locale"
|
|
875
|
+
})], DaikinDatePicker.prototype, "inputLocale", void 0);
|
|
876
|
+
__decorate([state()], DaikinDatePicker.prototype, "_label", void 0);
|
|
877
|
+
__decorate([state()], DaikinDatePicker.prototype, "_currentSelection", void 0);
|
|
878
|
+
DaikinDatePicker = __decorate([ddsElement("daikin-date-picker")], DaikinDatePicker);
|
|
879
|
+
//#endregion
|
|
880
|
+
export { DaikinDatePicker };
|