@daikin-oss/design-system-web-components 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +127 -0
- package/LICENSE +1 -1
- package/dist/cjs/base/dds-element.cjs +1 -1
- package/dist/cjs/base/dds-form-element.cjs +139 -0
- package/dist/cjs/base/dds-form-element.d.cts +100 -0
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +6 -3
- package/dist/cjs/components/avatar/daikin-avatar.cjs +160 -0
- package/dist/cjs/components/avatar/daikin-avatar.d.cts +67 -0
- package/dist/cjs/components/avatar/index.cjs +7 -0
- package/dist/cjs/components/avatar/index.d.cts +1 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs/components/button/daikin-button.cjs +35 -13
- package/dist/cjs/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs/components/calendar/daikin-calendar.cjs +547 -0
- package/dist/cjs/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs/components/calendar/index.cjs +7 -0
- package/dist/cjs/components/calendar/index.d.cts +1 -0
- package/dist/cjs/components/card/daikin-card.cjs +1 -1
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +13 -16
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +13 -12
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +611 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +105 -0
- package/dist/cjs/components/date-picker/index.cjs +7 -0
- package/dist/cjs/components/date-picker/index.d.cts +1 -0
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +181 -86
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +48 -18
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +97 -36
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.d.cts +6 -1
- package/dist/cjs/components/icon/icons.json.cjs +1 -1
- package/dist/cjs/components/icon/icons.json.d.cts +30 -14
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +18 -2
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +12 -2
- package/dist/cjs/components/index.cjs +55 -0
- package/dist/cjs/components/index.d.cts +11 -0
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +22 -0
- package/dist/cjs/components/list/daikin-list.cjs +75 -3
- package/dist/cjs/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +25 -5
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs/components/loading/daikin-loading.cjs +91 -0
- package/dist/cjs/components/loading/daikin-loading.d.cts +33 -0
- package/dist/cjs/components/loading/index.cjs +7 -0
- package/dist/cjs/components/loading/index.d.cts +1 -0
- package/dist/cjs/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs/components/logo/index.cjs +7 -0
- package/dist/cjs/components/logo/index.d.cts +1 -0
- package/dist/cjs/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs/components/menu/index.cjs +7 -0
- package/dist/cjs/components/menu/index.d.cts +1 -0
- package/dist/cjs/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs/components/modal/index.cjs +7 -0
- package/dist/cjs/components/modal/index.d.cts +1 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs/components/modal-footer/index.cjs +7 -0
- package/dist/cjs/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs/components/modal-header/index.cjs +7 -0
- package/dist/cjs/components/modal-header/index.d.cts +1 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +2 -2
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs/components/slider/index.cjs +7 -0
- package/dist/cjs/components/slider/index.d.cts +1 -0
- package/dist/cjs/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs/components/table/daikin-table.cjs +42 -4
- package/dist/cjs/components/table/daikin-table.d.cts +5 -0
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +1 -1
- package/dist/cjs/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs/components/text-field/daikin-text-field.cjs +149 -52
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +28 -18
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
- package/dist/cjs/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +12 -6
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +3 -2
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs/controllers/click-outside.cjs +3 -1
- package/dist/cjs/controllers/focus-trap.cjs +42 -0
- package/dist/cjs/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs/index.cjs +55 -0
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/calendar-common.cjs +151 -0
- package/dist/cjs/utils/calendar-common.d.cts +64 -0
- package/dist/cjs/utils/is-similar-to-click.cjs +4 -0
- package/dist/cjs/utils/is-similar-to-click.d.cts +1 -0
- package/dist/cjs/utils/notification-common.cjs +19 -15
- package/dist/cjs/utils/notification-common.d.cts +1 -1
- package/dist/cjs/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/cjs-dev/base/dds-element.cjs +1 -1
- package/dist/cjs-dev/base/dds-form-element.cjs +139 -0
- package/dist/cjs-dev/base/dds-form-element.d.cts +100 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +6 -3
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +160 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.d.cts +67 -0
- package/dist/cjs-dev/components/avatar/index.cjs +7 -0
- package/dist/cjs-dev/components/avatar/index.d.cts +1 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs-dev/components/button/daikin-button.cjs +35 -13
- package/dist/cjs-dev/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +558 -0
- package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs-dev/components/calendar/index.cjs +7 -0
- package/dist/cjs-dev/components/calendar/index.d.cts +1 -0
- package/dist/cjs-dev/components/card/daikin-card.cjs +1 -1
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +13 -16
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +13 -12
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs-dev/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs-dev/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +622 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +105 -0
- package/dist/cjs-dev/components/date-picker/index.cjs +7 -0
- package/dist/cjs-dev/components/date-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +181 -86
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +48 -18
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +97 -36
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.d.cts +6 -1
- package/dist/cjs-dev/components/icon/icons.json.cjs +1 -1
- package/dist/cjs-dev/components/icon/icons.json.d.cts +30 -14
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +18 -2
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +12 -2
- package/dist/cjs-dev/components/index.cjs +55 -0
- package/dist/cjs-dev/components/index.d.cts +11 -0
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +22 -0
- package/dist/cjs-dev/components/list/daikin-list.cjs +75 -3
- package/dist/cjs-dev/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +25 -5
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +91 -0
- package/dist/cjs-dev/components/loading/daikin-loading.d.cts +33 -0
- package/dist/cjs-dev/components/loading/index.cjs +7 -0
- package/dist/cjs-dev/components/loading/index.d.cts +1 -0
- package/dist/cjs-dev/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs-dev/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs-dev/components/logo/index.cjs +7 -0
- package/dist/cjs-dev/components/logo/index.d.cts +1 -0
- package/dist/cjs-dev/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs-dev/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs-dev/components/menu/index.cjs +7 -0
- package/dist/cjs-dev/components/menu/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs-dev/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs-dev/components/modal/index.cjs +7 -0
- package/dist/cjs-dev/components/modal/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs-dev/components/modal-footer/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs-dev/components/modal-header/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-header/index.d.cts +1 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +2 -2
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs-dev/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs-dev/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs-dev/components/slider/index.cjs +7 -0
- package/dist/cjs-dev/components/slider/index.d.cts +1 -0
- package/dist/cjs-dev/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs-dev/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +42 -4
- package/dist/cjs-dev/components/table/daikin-table.d.cts +5 -0
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +1 -1
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +149 -52
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +28 -18
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +12 -6
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +3 -2
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs-dev/controllers/click-outside.cjs +3 -1
- package/dist/cjs-dev/controllers/focus-trap.cjs +42 -0
- package/dist/cjs-dev/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs-dev/index.cjs +55 -0
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/calendar-common.cjs +151 -0
- package/dist/cjs-dev/utils/calendar-common.d.cts +64 -0
- package/dist/cjs-dev/utils/is-similar-to-click.cjs +4 -0
- package/dist/cjs-dev/utils/is-similar-to-click.d.cts +1 -0
- package/dist/cjs-dev/utils/notification-common.cjs +19 -15
- package/dist/cjs-dev/utils/notification-common.d.cts +1 -1
- package/dist/cjs-dev/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs-dev/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/es/base/dds-element.js +1 -1
- package/dist/es/base/dds-form-element.d.ts +100 -0
- package/dist/es/base/dds-form-element.js +139 -0
- package/dist/es/components/accordion/daikin-accordion.js +1 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.js +7 -4
- package/dist/es/components/avatar/daikin-avatar.d.ts +67 -0
- package/dist/es/components/avatar/daikin-avatar.js +161 -0
- package/dist/es/components/avatar/index.d.ts +1 -0
- package/dist/es/components/avatar/index.js +4 -0
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es/components/button/daikin-button.d.ts +20 -10
- package/dist/es/components/button/daikin-button.js +36 -14
- package/dist/es/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es/components/calendar/daikin-calendar.js +548 -0
- package/dist/es/components/calendar/index.d.ts +1 -0
- package/dist/es/components/calendar/index.js +4 -0
- package/dist/es/components/card/daikin-card.js +2 -2
- package/dist/es/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es/components/card-header/daikin-card-header.js +1 -1
- package/dist/es/components/carousel/daikin-carousel.js +1 -1
- package/dist/es/components/carousel-item/daikin-carousel-item.js +1 -1
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +13 -12
- package/dist/es/components/checkbox/daikin-checkbox.js +14 -17
- package/dist/es/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es/components/checkbox-group/index.d.ts +1 -0
- package/dist/es/components/checkbox-group/index.js +4 -0
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +105 -0
- package/dist/es/components/date-picker/daikin-date-picker.js +612 -0
- package/dist/es/components/date-picker/index.d.ts +1 -0
- package/dist/es/components/date-picker/index.js +4 -0
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +48 -18
- package/dist/es/components/dropdown/daikin-dropdown.js +182 -87
- package/dist/es/components/dropdown-item/daikin-dropdown-item.d.ts +6 -1
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +98 -37
- package/dist/es/components/icon/daikin-icon.js +1 -1
- package/dist/es/components/icon/icons.json.d.ts +30 -14
- package/dist/es/components/icon/icons.json.js +1 -1
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +12 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +19 -3
- package/dist/es/components/index.d.ts +11 -0
- package/dist/es/components/index.js +22 -0
- package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es/components/input-group/daikin-input-group.d.ts +22 -0
- package/dist/es/components/input-group/daikin-input-group.js +5 -5
- package/dist/es/components/link/daikin-link.js +1 -1
- package/dist/es/components/list/daikin-list.d.ts +16 -0
- package/dist/es/components/list/daikin-list.js +76 -4
- package/dist/es/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es/components/list-item/daikin-list-item.js +26 -6
- package/dist/es/components/loading/daikin-loading.d.ts +33 -0
- package/dist/es/components/loading/daikin-loading.js +92 -0
- package/dist/es/components/loading/index.d.ts +1 -0
- package/dist/es/components/loading/index.js +4 -0
- package/dist/es/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es/components/logo/daikin-logo.js +106 -0
- package/dist/es/components/logo/index.d.ts +1 -0
- package/dist/es/components/logo/index.js +4 -0
- package/dist/es/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es/components/menu/daikin-menu.js +206 -0
- package/dist/es/components/menu/index.d.ts +1 -0
- package/dist/es/components/menu/index.js +4 -0
- package/dist/es/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es/components/modal/daikin-modal.js +116 -0
- package/dist/es/components/modal/index.d.ts +1 -0
- package/dist/es/components/modal/index.js +4 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es/components/modal-footer/index.d.ts +1 -0
- package/dist/es/components/modal-footer/index.js +4 -0
- package/dist/es/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es/components/modal-header/index.d.ts +1 -0
- package/dist/es/components/modal-header/index.js +4 -0
- package/dist/es/components/pagination/daikin-pagination.js +1 -1
- package/dist/es/components/progress-bar/daikin-progress-bar.js +3 -3
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es/components/radio/daikin-radio.js +5 -14
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es/components/select/daikin-select.js +1 -1
- package/dist/es/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es/components/slider/daikin-slider.js +264 -0
- package/dist/es/components/slider/index.d.ts +1 -0
- package/dist/es/components/slider/index.js +4 -0
- package/dist/es/components/slider/slider-utils.d.ts +37 -0
- package/dist/es/components/slider/slider-utils.js +57 -0
- package/dist/es/components/tab/daikin-tab.js +1 -1
- package/dist/es/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es/components/table/daikin-table.d.ts +5 -0
- package/dist/es/components/table/daikin-table.js +43 -5
- package/dist/es/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +1 -1
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +1 -1
- package/dist/es/components/tabs/daikin-tabs.js +3 -3
- package/dist/es/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es/components/text-area/daikin-text-area.js +5 -14
- package/dist/es/components/text-field/daikin-text-field.d.ts +28 -18
- package/dist/es/components/text-field/daikin-text-field.js +150 -53
- package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es/components/toggle/daikin-toggle.js +5 -14
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +3 -2
- package/dist/es/components/tooltip/daikin-tooltip.js +13 -7
- package/dist/es/components/tree/daikin-tree.js +1 -1
- package/dist/es/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es/controllers/click-outside.js +3 -1
- package/dist/es/controllers/focus-trap.d.ts +10 -0
- package/dist/es/controllers/focus-trap.js +42 -0
- package/dist/es/index.js +22 -0
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/calendar-common.d.ts +64 -0
- package/dist/es/utils/calendar-common.js +151 -0
- package/dist/es/utils/is-similar-to-click.d.ts +1 -0
- package/dist/es/utils/is-similar-to-click.js +4 -0
- package/dist/es/utils/notification-common.d.ts +1 -1
- package/dist/es/utils/notification-common.js +19 -15
- package/dist/es/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es/{components/tabs → utils}/scroller.js +20 -12
- package/dist/es-dev/base/dds-element.js +1 -1
- package/dist/es-dev/base/dds-form-element.d.ts +100 -0
- package/dist/es-dev/base/dds-form-element.js +139 -0
- package/dist/es-dev/components/accordion/daikin-accordion.js +1 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +7 -4
- package/dist/es-dev/components/avatar/daikin-avatar.d.ts +67 -0
- package/dist/es-dev/components/avatar/daikin-avatar.js +161 -0
- package/dist/es-dev/components/avatar/index.d.ts +1 -0
- package/dist/es-dev/components/avatar/index.js +4 -0
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es-dev/components/button/daikin-button.d.ts +20 -10
- package/dist/es-dev/components/button/daikin-button.js +36 -14
- package/dist/es-dev/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es-dev/components/calendar/daikin-calendar.js +559 -0
- package/dist/es-dev/components/calendar/index.d.ts +1 -0
- package/dist/es-dev/components/calendar/index.js +4 -0
- package/dist/es-dev/components/card/daikin-card.js +2 -2
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es-dev/components/card-header/daikin-card-header.js +1 -1
- package/dist/es-dev/components/carousel/daikin-carousel.js +1 -1
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +1 -1
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +13 -12
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +14 -17
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es-dev/components/checkbox-group/index.d.ts +1 -0
- package/dist/es-dev/components/checkbox-group/index.js +4 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +105 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +623 -0
- package/dist/es-dev/components/date-picker/index.d.ts +1 -0
- package/dist/es-dev/components/date-picker/index.js +4 -0
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +48 -18
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +182 -87
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.d.ts +6 -1
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +98 -37
- package/dist/es-dev/components/icon/daikin-icon.js +1 -1
- package/dist/es-dev/components/icon/icons.json.d.ts +30 -14
- package/dist/es-dev/components/icon/icons.json.js +1 -1
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +12 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +19 -3
- package/dist/es-dev/components/index.d.ts +11 -0
- package/dist/es-dev/components/index.js +22 -0
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +22 -0
- package/dist/es-dev/components/input-group/daikin-input-group.js +5 -5
- package/dist/es-dev/components/link/daikin-link.js +1 -1
- package/dist/es-dev/components/list/daikin-list.d.ts +16 -0
- package/dist/es-dev/components/list/daikin-list.js +76 -4
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es-dev/components/list-item/daikin-list-item.js +26 -6
- package/dist/es-dev/components/loading/daikin-loading.d.ts +33 -0
- package/dist/es-dev/components/loading/daikin-loading.js +92 -0
- package/dist/es-dev/components/loading/index.d.ts +1 -0
- package/dist/es-dev/components/loading/index.js +4 -0
- package/dist/es-dev/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es-dev/components/logo/daikin-logo.js +106 -0
- package/dist/es-dev/components/logo/index.d.ts +1 -0
- package/dist/es-dev/components/logo/index.js +4 -0
- package/dist/es-dev/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es-dev/components/menu/daikin-menu.js +206 -0
- package/dist/es-dev/components/menu/index.d.ts +1 -0
- package/dist/es-dev/components/menu/index.js +4 -0
- package/dist/es-dev/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es-dev/components/modal/daikin-modal.js +116 -0
- package/dist/es-dev/components/modal/index.d.ts +1 -0
- package/dist/es-dev/components/modal/index.js +4 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es-dev/components/modal-footer/index.d.ts +1 -0
- package/dist/es-dev/components/modal-footer/index.js +4 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es-dev/components/modal-header/index.d.ts +1 -0
- package/dist/es-dev/components/modal-header/index.js +4 -0
- package/dist/es-dev/components/pagination/daikin-pagination.js +1 -1
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +3 -3
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es-dev/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es-dev/components/radio/daikin-radio.js +5 -14
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es-dev/components/select/daikin-select.js +1 -1
- package/dist/es-dev/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es-dev/components/slider/daikin-slider.js +264 -0
- package/dist/es-dev/components/slider/index.d.ts +1 -0
- package/dist/es-dev/components/slider/index.js +4 -0
- package/dist/es-dev/components/slider/slider-utils.d.ts +37 -0
- package/dist/es-dev/components/slider/slider-utils.js +57 -0
- package/dist/es-dev/components/tab/daikin-tab.js +1 -1
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es-dev/components/table/daikin-table.d.ts +5 -0
- package/dist/es-dev/components/table/daikin-table.js +43 -5
- package/dist/es-dev/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +1 -1
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +1 -1
- package/dist/es-dev/components/tabs/daikin-tabs.js +3 -3
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es-dev/components/text-area/daikin-text-area.js +5 -14
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +28 -18
- package/dist/es-dev/components/text-field/daikin-text-field.js +150 -53
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es-dev/components/toggle/daikin-toggle.js +5 -14
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +3 -2
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +13 -7
- package/dist/es-dev/components/tree/daikin-tree.js +1 -1
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es-dev/controllers/click-outside.js +3 -1
- package/dist/es-dev/controllers/focus-trap.d.ts +10 -0
- package/dist/es-dev/controllers/focus-trap.js +42 -0
- package/dist/es-dev/index.js +22 -0
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/calendar-common.d.ts +64 -0
- package/dist/es-dev/utils/calendar-common.js +151 -0
- package/dist/es-dev/utils/is-similar-to-click.d.ts +1 -0
- package/dist/es-dev/utils/is-similar-to-click.js +4 -0
- package/dist/es-dev/utils/notification-common.d.ts +1 -1
- package/dist/es-dev/utils/notification-common.js +19 -15
- package/dist/es-dev/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es-dev/{components/tabs → utils}/scroller.js +20 -12
- package/icons/alarm.svg +3 -0
- package/icons/calendar.svg +3 -0
- package/icons/chevron-down.svg +3 -3
- package/icons/chevron-left.svg +2 -2
- package/icons/chevron-right.svg +2 -2
- package/icons/chevron-up.svg +2 -2
- package/icons/close.svg +3 -0
- package/icons/dropdown-chevron-down.svg +3 -3
- package/icons/error.svg +3 -0
- package/icons/information.svg +3 -0
- package/icons/logo-negative.svg +10 -0
- package/icons/logo-positive.svg +10 -0
- package/icons/password-hidden.svg +3 -0
- package/icons/password-visible.svg +3 -0
- package/icons/profile.svg +4 -0
- package/icons/pulldown-down.svg +3 -0
- package/icons/search.svg +3 -0
- package/icons/success.svg +3 -0
- package/icons/warning.svg +3 -0
- package/package.json +7 -3
- package/icons/cross.svg +0 -3
- package/icons/notification-close.svg +0 -5
- package/icons/status-alarm.svg +0 -5
- package/icons/status-error.svg +0 -3
- package/icons/status-information.svg +0 -5
- package/icons/status-negative.svg +0 -5
- package/icons/status-positive.svg +0 -5
- package/icons/status-warning.svg +0 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DDSElement } from "../../base/index.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* `daikin-modal-header` is used to represent header of the modal component, and is used as a child element of the `daikin-modal` component.
|
|
4
|
+
*
|
|
5
|
+
* Hierarchy:
|
|
6
|
+
* - `daikin-modal` > `daikin-modal-header`
|
|
7
|
+
*
|
|
8
|
+
* @slot description - An optional slot for description.
|
|
9
|
+
* @slot - A slot for modal title.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* ```js
|
|
14
|
+
* import "@daikin-oss/design-system-web-components/components/modal-header/index.js";
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <!-- See `daikin-modal` component for complete example. -->
|
|
19
|
+
* <daikin-modal-header>
|
|
20
|
+
* <span slot="description">Description</span>
|
|
21
|
+
* <span>Modal Title</span>
|
|
22
|
+
* </daikin-modal-header>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class DaikinModalHeader extends DDSElement {
|
|
26
|
+
static styles: import('lit').CSSResult;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the modal is open.
|
|
29
|
+
*/
|
|
30
|
+
withCloseButton: boolean;
|
|
31
|
+
private _closeButton;
|
|
32
|
+
private _handleClick;
|
|
33
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
34
|
+
/**
|
|
35
|
+
* Focuses on the header content area.
|
|
36
|
+
*/
|
|
37
|
+
focusCloseButton(): void;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
"daikin-modal-header": DaikinModalHeader;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const daikinModalHeader = require("./daikin-modal-header.cjs");
|
|
4
|
+
Object.defineProperty(exports, "DaikinModalHeader", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: () => daikinModalHeader.DaikinModalHeader
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-modal-header.cjs";
|
|
@@ -67,14 +67,14 @@ const cvaBarContainer = classVarianceAuthority.cva(
|
|
|
67
67
|
"after:size-4",
|
|
68
68
|
"after:flex-none",
|
|
69
69
|
"after:bg-ddt-color-common-success",
|
|
70
|
-
"after:i-daikin-
|
|
70
|
+
"after:i-daikin-success"
|
|
71
71
|
],
|
|
72
72
|
indeterminate: [],
|
|
73
73
|
error: [
|
|
74
74
|
"after:size-4",
|
|
75
75
|
"after:flex-none",
|
|
76
76
|
"after:text-ddt-color-common-danger-default",
|
|
77
|
-
"after:i-daikin-
|
|
77
|
+
"after:i-daikin-error"
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -59,7 +59,7 @@ exports.DaikinProgressIndicatorItem = class DaikinProgressIndicatorItem extends
|
|
|
59
59
|
${this.status === "finished" ? lit.html`
|
|
60
60
|
<span
|
|
61
61
|
role="img"
|
|
62
|
-
class="flex-none size-4 i-daikin-
|
|
62
|
+
class="flex-none size-4 i-daikin-success text-ddt-color-common-brand-default"
|
|
63
63
|
aria-label="Completed"
|
|
64
64
|
></span>
|
|
65
65
|
` : lit.nothing}
|
|
@@ -4,9 +4,10 @@ const classVarianceAuthority = require("class-variance-authority");
|
|
|
4
4
|
const lit = require("lit");
|
|
5
5
|
const decorators_js = require("lit/decorators.js");
|
|
6
6
|
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
7
|
-
|
|
7
|
+
require("../../base/dds-element.cjs");
|
|
8
8
|
const decorators = require("../../base/decorators.cjs");
|
|
9
9
|
require("../../base/define.cjs");
|
|
10
|
+
const ddsFormElement = require("../../base/dds-form-element.cjs");
|
|
10
11
|
const tailwind = require("../../tailwind.css.cjs");
|
|
11
12
|
var __defProp = Object.defineProperty;
|
|
12
13
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -54,24 +55,21 @@ const cvaLabel = classVarianceAuthority.cva([], {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
exports.DaikinRadio = class DaikinRadio extends
|
|
58
|
+
exports.DaikinRadio = class DaikinRadio extends ddsFormElement.DDSFormElement {
|
|
58
59
|
constructor() {
|
|
59
60
|
super(...arguments);
|
|
60
|
-
this.name = "";
|
|
61
|
-
this.value = "";
|
|
62
61
|
this.label = "";
|
|
63
62
|
this.labelPosition = "right";
|
|
64
63
|
this.checked = false;
|
|
65
64
|
this.disabled = false;
|
|
66
65
|
this.disabledByParent = false;
|
|
67
66
|
this.skipTab = false;
|
|
68
|
-
this._internals = this.attachInternals();
|
|
69
67
|
}
|
|
70
68
|
get _labelHidden() {
|
|
71
69
|
return this.labelPosition === "hidden";
|
|
72
70
|
}
|
|
73
71
|
_updateFormValue() {
|
|
74
|
-
this.
|
|
72
|
+
this.setFormValue(this.checked ? this.value : null);
|
|
75
73
|
}
|
|
76
74
|
_handleClick(event) {
|
|
77
75
|
var _a;
|
|
@@ -143,13 +141,6 @@ exports.DaikinRadio.styles = lit.css`
|
|
|
143
141
|
display: inline-block;
|
|
144
142
|
}
|
|
145
143
|
`;
|
|
146
|
-
exports.DaikinRadio.formAssociated = true;
|
|
147
|
-
__decorateClass([
|
|
148
|
-
decorators_js.property({ type: String, reflect: true })
|
|
149
|
-
], exports.DaikinRadio.prototype, "name", 2);
|
|
150
|
-
__decorateClass([
|
|
151
|
-
decorators_js.property({ type: String, reflect: true })
|
|
152
|
-
], exports.DaikinRadio.prototype, "value", 2);
|
|
153
144
|
__decorateClass([
|
|
154
145
|
decorators_js.property({ type: String })
|
|
155
146
|
], exports.DaikinRadio.prototype, "label", 2);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DDSFormElement } from "../../base/dds-form-element.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* The radio button component is a UI element that allows users to select one options from a set of choices.
|
|
4
4
|
* It functions similarly to the HTML `<input type="radio">` tag. \
|
|
@@ -21,16 +21,8 @@ import { DDSElement } from "../../base/index.cjs";
|
|
|
21
21
|
* <daikin-radio name="name" value="value" label="Radio button label"></daikin-radio>
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare class DaikinRadio extends
|
|
24
|
+
export declare class DaikinRadio extends DDSFormElement {
|
|
25
25
|
static readonly styles: import('lit').CSSResult;
|
|
26
|
-
/**
|
|
27
|
-
* The form name, submitted as a name/value pair when submitting the form.
|
|
28
|
-
*/
|
|
29
|
-
name: string;
|
|
30
|
-
/**
|
|
31
|
-
* The form value, submitted as a name/value pair when submitting the form.
|
|
32
|
-
*/
|
|
33
|
-
value: string;
|
|
34
26
|
/**
|
|
35
27
|
* Label text for the radio button.
|
|
36
28
|
*/
|
|
@@ -62,9 +54,7 @@ export declare class DaikinRadio extends DDSElement {
|
|
|
62
54
|
*/
|
|
63
55
|
skipTab: boolean;
|
|
64
56
|
private _radio;
|
|
65
|
-
static readonly formAssociated = true;
|
|
66
57
|
private get _labelHidden();
|
|
67
|
-
private _internals;
|
|
68
58
|
private _updateFormValue;
|
|
69
59
|
private _handleClick;
|
|
70
60
|
private _handleChange;
|
|
@@ -19,7 +19,7 @@ var __decorateClass = (decorators2, target, key, kind) => {
|
|
|
19
19
|
if (kind && result) __defProp(target, key, result);
|
|
20
20
|
return result;
|
|
21
21
|
};
|
|
22
|
-
const cvaRadioGroup = classVarianceAuthority.cva(["size-full", "flex", "gap-x-
|
|
22
|
+
const cvaRadioGroup = classVarianceAuthority.cva(["size-full", "flex", "gap-x-8", "gap-y-2"], {
|
|
23
23
|
variants: {
|
|
24
24
|
orientation: {
|
|
25
25
|
horizontal: ["flex-row", "flex-wrap"],
|
|
@@ -40,7 +40,8 @@ export declare class DaikinRadioGroup extends DDSElement {
|
|
|
40
40
|
*/
|
|
41
41
|
orientation: RadioGroupProps["orientation"];
|
|
42
42
|
/**
|
|
43
|
-
* The form name.
|
|
43
|
+
* The form name, submitted as a name/value pair when submitting the form.
|
|
44
|
+
* When this value is set, all `daikin-radio` child components under it will be assigned this name.
|
|
44
45
|
*/
|
|
45
46
|
name: string;
|
|
46
47
|
/**
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
4
|
+
const lit = require("lit");
|
|
5
|
+
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const ref_js = require("lit/directives/ref.js");
|
|
7
|
+
const ddsFormElement = require("../../base/dds-form-element.cjs");
|
|
8
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
9
|
+
const sliderUtils = require("./slider-utils.cjs");
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
13
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators[i])
|
|
16
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
17
|
+
if (kind && result) __defProp(target, key, result);
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
const cvaSliderThumb = classVarianceAuthority.cva(
|
|
21
|
+
[
|
|
22
|
+
"absolute",
|
|
23
|
+
"top-1/2",
|
|
24
|
+
"-translate-x-1/2",
|
|
25
|
+
"-translate-y-1/2",
|
|
26
|
+
"w-4",
|
|
27
|
+
"h-4",
|
|
28
|
+
"rounded-full",
|
|
29
|
+
"left-[--slider-ratio]"
|
|
30
|
+
],
|
|
31
|
+
{
|
|
32
|
+
variants: {
|
|
33
|
+
disabled: {
|
|
34
|
+
false: [
|
|
35
|
+
"cursor-pointer",
|
|
36
|
+
"[&:not([data-dragging])]:bg-ddt-color-common-brand-default",
|
|
37
|
+
"[&:not([data-dragging])]:hover:bg-ddt-color-common-brand-hover",
|
|
38
|
+
"[&:not([data-dragging])]:active:bg-ddt-color-common-brand-press",
|
|
39
|
+
"data-[dragging]:bg-ddt-color-common-brand-press",
|
|
40
|
+
"focus-visible:outline",
|
|
41
|
+
"focus-visible:outline-2",
|
|
42
|
+
"focus-visible:outline-offset-2",
|
|
43
|
+
"focus-visible:outline-ddt-color-common-border-focus"
|
|
44
|
+
],
|
|
45
|
+
true: ["bg-ddt-color-common-disabled", "pointer-events-none"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
const cvaSliderTrack = classVarianceAuthority.cva(
|
|
51
|
+
[
|
|
52
|
+
"absolute",
|
|
53
|
+
"top-1/2",
|
|
54
|
+
"-translate-y-1/2",
|
|
55
|
+
"left-0",
|
|
56
|
+
"h-1",
|
|
57
|
+
"w-[--slider-ratio]"
|
|
58
|
+
],
|
|
59
|
+
{
|
|
60
|
+
variants: {
|
|
61
|
+
disabled: {
|
|
62
|
+
false: ["bg-ddt-color-common-brand-default"],
|
|
63
|
+
true: ["bg-ddt-color-common-border-empty"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
exports.DaikinSlider = class DaikinSlider extends ddsFormElement.DDSFormElement {
|
|
69
|
+
constructor() {
|
|
70
|
+
super();
|
|
71
|
+
this.min = "1";
|
|
72
|
+
this.max = "100";
|
|
73
|
+
this.step = "1";
|
|
74
|
+
this.disabled = false;
|
|
75
|
+
this.sliderAriaLabel = "slider";
|
|
76
|
+
this._dragging = false;
|
|
77
|
+
this._sliderRef = ref_js.createRef();
|
|
78
|
+
this._thumbRef = ref_js.createRef();
|
|
79
|
+
this.value = this.min;
|
|
80
|
+
}
|
|
81
|
+
_updateFormValue() {
|
|
82
|
+
if (this.disabled) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.setFormValue(this.value);
|
|
86
|
+
this.dispatchEvent(
|
|
87
|
+
new Event("change", {
|
|
88
|
+
bubbles: true,
|
|
89
|
+
composed: true
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
this.dispatchEvent(
|
|
93
|
+
new Event("input", {
|
|
94
|
+
bubbles: true,
|
|
95
|
+
composed: true
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
get _progress() {
|
|
100
|
+
const min = parseFloat(this.min);
|
|
101
|
+
const max = parseFloat(this.max);
|
|
102
|
+
const clampedValue = Math.max(min, Math.min(parseFloat(this.value), max));
|
|
103
|
+
return (clampedValue - min) / (max - min) * 100;
|
|
104
|
+
}
|
|
105
|
+
_handleDrag(event) {
|
|
106
|
+
const leftDistance = this._calcMousePositionRatio(event);
|
|
107
|
+
if (leftDistance == null) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const value = sliderUtils.getValueFromRatio(this, leftDistance);
|
|
111
|
+
this.value = value;
|
|
112
|
+
}
|
|
113
|
+
// This function is called when an arrow key is pressed while the thumb is focused.
|
|
114
|
+
_handleKeyDown(event) {
|
|
115
|
+
if (this.disabled) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const value = sliderUtils.getValueByKeydown(this, event.key);
|
|
119
|
+
if (value == null) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
this.value = value;
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns a normalized value of the mouse position on the slider, in the range 0 to 1.
|
|
127
|
+
*
|
|
128
|
+
* @param event A MouseEvent.
|
|
129
|
+
* @returns The mouse's X coordinate normalized to a range of 0 to 1. The left end and beyond of the slider is 0, and the right end and beyond is 1.
|
|
130
|
+
*/
|
|
131
|
+
_calcMousePositionRatio(event) {
|
|
132
|
+
var _a;
|
|
133
|
+
const box = (_a = this._sliderRef.value) == null ? void 0 : _a.getBoundingClientRect();
|
|
134
|
+
if (box == null) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const x = event instanceof MouseEvent ? event.clientX : event.targetTouches[0].clientX;
|
|
138
|
+
const relativeX = x - box.left;
|
|
139
|
+
return Math.max(0, Math.min(relativeX / box.width, 1));
|
|
140
|
+
}
|
|
141
|
+
// This function will triggered when the slider thumb button start dragging.
|
|
142
|
+
_startDrag(event) {
|
|
143
|
+
var _a;
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
if (this.disabled) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const controller = new AbortController();
|
|
149
|
+
const { signal } = controller;
|
|
150
|
+
this._dragging = true;
|
|
151
|
+
document.addEventListener(
|
|
152
|
+
"mousemove",
|
|
153
|
+
(event2) => {
|
|
154
|
+
this._handleDrag(event2);
|
|
155
|
+
},
|
|
156
|
+
{ signal }
|
|
157
|
+
);
|
|
158
|
+
document.addEventListener(
|
|
159
|
+
"mouseup",
|
|
160
|
+
() => {
|
|
161
|
+
this._dragging = false;
|
|
162
|
+
controller.abort();
|
|
163
|
+
},
|
|
164
|
+
{ once: true }
|
|
165
|
+
);
|
|
166
|
+
(_a = this._thumbRef.value) == null ? void 0 : _a.focus();
|
|
167
|
+
this._handleDrag(event);
|
|
168
|
+
}
|
|
169
|
+
// This function will triggered when the slider thumb button start dragging.
|
|
170
|
+
_startTouch(event) {
|
|
171
|
+
var _a;
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
if (this.disabled) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const controller = new AbortController();
|
|
177
|
+
const { signal } = controller;
|
|
178
|
+
this._dragging = true;
|
|
179
|
+
document.addEventListener(
|
|
180
|
+
"touchmove",
|
|
181
|
+
(event2) => {
|
|
182
|
+
this._handleDrag(event2);
|
|
183
|
+
},
|
|
184
|
+
{ signal }
|
|
185
|
+
);
|
|
186
|
+
document.addEventListener(
|
|
187
|
+
"touchend",
|
|
188
|
+
() => {
|
|
189
|
+
this._dragging = false;
|
|
190
|
+
controller.abort();
|
|
191
|
+
},
|
|
192
|
+
{ once: true }
|
|
193
|
+
);
|
|
194
|
+
(_a = this._thumbRef.value) == null ? void 0 : _a.focus();
|
|
195
|
+
this._handleDrag(event);
|
|
196
|
+
}
|
|
197
|
+
render() {
|
|
198
|
+
const progress = this._progress;
|
|
199
|
+
return lit.html`
|
|
200
|
+
<span
|
|
201
|
+
${ref_js.ref(this._sliderRef)}
|
|
202
|
+
class="w-full h-6 relative"
|
|
203
|
+
style="--slider-ratio:${progress}%"
|
|
204
|
+
@mousedown=${this._startDrag}
|
|
205
|
+
@touchstart=${this._startTouch}
|
|
206
|
+
>
|
|
207
|
+
<span
|
|
208
|
+
class="w-full absolute top-1/2 -translate-y-1/2 left-0 h-1 bg-ddt-color-common-border-empty"
|
|
209
|
+
></span>
|
|
210
|
+
<span class=${cvaSliderTrack({ disabled: this.disabled })}></span>
|
|
211
|
+
<span
|
|
212
|
+
${ref_js.ref(this._thumbRef)}
|
|
213
|
+
class=${cvaSliderThumb({ disabled: this.disabled })}
|
|
214
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
215
|
+
role="slider"
|
|
216
|
+
?data-dragging=${this._dragging}
|
|
217
|
+
aria-valuenow=${this.value}
|
|
218
|
+
aria-valuemin=${this.min}
|
|
219
|
+
aria-valuemax=${this.max}
|
|
220
|
+
aria-label=${this.sliderAriaLabel}
|
|
221
|
+
aria-disabled=${this.disabled}
|
|
222
|
+
@mousedown=${this._startDrag}
|
|
223
|
+
@keydown=${this._handleKeyDown}
|
|
224
|
+
></span>
|
|
225
|
+
</span>
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
updated(changedProperties) {
|
|
229
|
+
if (!changedProperties.has("value")) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this._updateFormValue();
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
exports.DaikinSlider.styles = lit.css`
|
|
236
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
237
|
+
|
|
238
|
+
:host {
|
|
239
|
+
display: inline-flex;
|
|
240
|
+
width: 100%;
|
|
241
|
+
}
|
|
242
|
+
`;
|
|
243
|
+
__decorateClass([
|
|
244
|
+
decorators_js.property({ type: String, reflect: true })
|
|
245
|
+
], exports.DaikinSlider.prototype, "min", 2);
|
|
246
|
+
__decorateClass([
|
|
247
|
+
decorators_js.property({ type: String, reflect: true })
|
|
248
|
+
], exports.DaikinSlider.prototype, "max", 2);
|
|
249
|
+
__decorateClass([
|
|
250
|
+
decorators_js.property({ type: String, reflect: true })
|
|
251
|
+
], exports.DaikinSlider.prototype, "step", 2);
|
|
252
|
+
__decorateClass([
|
|
253
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
254
|
+
], exports.DaikinSlider.prototype, "disabled", 2);
|
|
255
|
+
__decorateClass([
|
|
256
|
+
decorators_js.property({ type: String, reflect: true, attribute: "slider-aria-label" })
|
|
257
|
+
], exports.DaikinSlider.prototype, "sliderAriaLabel", 2);
|
|
258
|
+
__decorateClass([
|
|
259
|
+
decorators_js.state()
|
|
260
|
+
], exports.DaikinSlider.prototype, "_dragging", 2);
|
|
261
|
+
exports.DaikinSlider = __decorateClass([
|
|
262
|
+
decorators_js.customElement("daikin-slider")
|
|
263
|
+
], exports.DaikinSlider);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSFormElement } from "../../base/dds-form-element.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* The slider component is a control that allows users to input numerical values within a specific range intuitively.
|
|
5
|
+
* It functions similarly to the HTML `<input type="range">` tag, allows you to set the range of values.
|
|
6
|
+
*
|
|
7
|
+
* @fires change - A retargeted event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input type="range">` element.
|
|
8
|
+
* @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* import "@daikin-oss/design-system-web-components/components/slider/index.js";
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* ```html
|
|
17
|
+
* <daikin-slider name="name" value="1" min="1" max="100" step="1"></daikin-slider>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class DaikinSlider extends DDSFormElement {
|
|
21
|
+
static readonly styles: import('lit').CSSResult;
|
|
22
|
+
/**
|
|
23
|
+
* The smallest value in the range of permitted values.
|
|
24
|
+
*/
|
|
25
|
+
min: string;
|
|
26
|
+
/**
|
|
27
|
+
* The largest value in the range of permitted values.
|
|
28
|
+
*/
|
|
29
|
+
max: string;
|
|
30
|
+
/**
|
|
31
|
+
* The step attribute is a number that specifies the granularity that the value must adhere to.
|
|
32
|
+
*/
|
|
33
|
+
step: string;
|
|
34
|
+
/**
|
|
35
|
+
* Specify the slider disabled state.
|
|
36
|
+
*/
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The aria-label of the slider.
|
|
40
|
+
* You should specify this value based on the slider's use case, such as "air conditioner temperature".
|
|
41
|
+
*/
|
|
42
|
+
sliderAriaLabel: string;
|
|
43
|
+
constructor();
|
|
44
|
+
private _dragging;
|
|
45
|
+
private _sliderRef;
|
|
46
|
+
private _thumbRef;
|
|
47
|
+
private _updateFormValue;
|
|
48
|
+
private get _progress();
|
|
49
|
+
private _handleDrag;
|
|
50
|
+
private _handleKeyDown;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a normalized value of the mouse position on the slider, in the range 0 to 1.
|
|
53
|
+
*
|
|
54
|
+
* @param event A MouseEvent.
|
|
55
|
+
* @returns The mouse's X coordinate normalized to a range of 0 to 1. The left end and beyond of the slider is 0, and the right end and beyond is 1.
|
|
56
|
+
*/
|
|
57
|
+
private _calcMousePositionRatio;
|
|
58
|
+
private _startDrag;
|
|
59
|
+
private _startTouch;
|
|
60
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
61
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
"daikin-slider": DaikinSlider;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-slider.cjs";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function normalizeNumberString(str) {
|
|
4
|
+
return str.replace(new RegExp("(?:\\.0*|(?<=\\.\\d*?)0+)$"), "").replace(new RegExp("(?<=-|^)0+(?=[1-9]|0\\.|0)"), "").replace(/^-0$/, "0");
|
|
5
|
+
}
|
|
6
|
+
function formatValue(value, step) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const decimals = ((_b = (_a = /\.(\d*?)0*$/.exec(step)) == null ? void 0 : _a[1]) == null ? void 0 : _b.length) ?? 0;
|
|
9
|
+
const formattedValue = value.toFixed(decimals);
|
|
10
|
+
return normalizeNumberString(formattedValue);
|
|
11
|
+
}
|
|
12
|
+
function getValueFromRatio(slider, ratio) {
|
|
13
|
+
const minFloat = parseFloat(slider.min);
|
|
14
|
+
const maxFloat = parseFloat(slider.max);
|
|
15
|
+
const stepFloat = parseFloat(slider.step);
|
|
16
|
+
const rawValue = ratio * (maxFloat - minFloat) + minFloat;
|
|
17
|
+
const steppedValue = Math.round(rawValue / stepFloat) * stepFloat;
|
|
18
|
+
if (steppedValue <= minFloat) {
|
|
19
|
+
return normalizeNumberString(slider.min);
|
|
20
|
+
}
|
|
21
|
+
if (steppedValue >= maxFloat) {
|
|
22
|
+
return normalizeNumberString(slider.max);
|
|
23
|
+
}
|
|
24
|
+
return formatValue(steppedValue, slider.step);
|
|
25
|
+
}
|
|
26
|
+
function getValueByKeydown(slider, key) {
|
|
27
|
+
if (key === "Home") {
|
|
28
|
+
return slider.min;
|
|
29
|
+
}
|
|
30
|
+
if (key === "End") {
|
|
31
|
+
return slider.max;
|
|
32
|
+
}
|
|
33
|
+
const offset = {
|
|
34
|
+
ArrowLeft: -1,
|
|
35
|
+
ArrowDown: -1,
|
|
36
|
+
ArrowRight: 1,
|
|
37
|
+
ArrowUp: 1,
|
|
38
|
+
PageDown: -10,
|
|
39
|
+
PageUp: 10
|
|
40
|
+
}[key];
|
|
41
|
+
if (!offset) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const minFloat = parseFloat(slider.min);
|
|
45
|
+
const maxFloat = parseFloat(slider.max);
|
|
46
|
+
const stepFloat = parseFloat(slider.step);
|
|
47
|
+
const valueFloat = parseFloat(slider.value);
|
|
48
|
+
const clampedValue = Math.max(
|
|
49
|
+
minFloat,
|
|
50
|
+
Math.min(maxFloat, valueFloat + stepFloat * offset)
|
|
51
|
+
);
|
|
52
|
+
return formatValue(clampedValue, slider.step);
|
|
53
|
+
}
|
|
54
|
+
exports.formatValue = formatValue;
|
|
55
|
+
exports.getValueByKeydown = getValueByKeydown;
|
|
56
|
+
exports.getValueFromRatio = getValueFromRatio;
|
|
57
|
+
exports.normalizeNumberString = normalizeNumberString;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DaikinSlider } from "./daikin-slider.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a normalized numerical representation.
|
|
4
|
+
*
|
|
5
|
+
* - Removes trailing zeros from the decimal part.
|
|
6
|
+
* - Removes the decimal point if it becomes the last character.
|
|
7
|
+
* - Removes leading zeros from the integer part.
|
|
8
|
+
*
|
|
9
|
+
* @param str A numeric string.
|
|
10
|
+
* @returns Formatted value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeNumberString(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* This function is used to handle floating-point errors in calculations.
|
|
15
|
+
* Ensuring that the number of decimal places matches the decimal places of the step value.
|
|
16
|
+
*
|
|
17
|
+
* @param value The current value.
|
|
18
|
+
* @param step The step value.
|
|
19
|
+
* @returns Formatted current value.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatValue(value: number, step: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the current value and track bar's progress percentage from the distance to the left.
|
|
24
|
+
*
|
|
25
|
+
* @param slider The daikin-slider instance.
|
|
26
|
+
* @param ratio The ratio of the slider value (0-1).
|
|
27
|
+
* @returns Current value.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getValueFromRatio(slider: DaikinSlider, ratio: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the current value and track bar's progress percentage when use keyboard.
|
|
32
|
+
*
|
|
33
|
+
* @param slider The daikin-slider instance.
|
|
34
|
+
* @param moveOffset The number of thumb icon's move offset.
|
|
35
|
+
* @returns Current value.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getValueByKeydown(slider: DaikinSlider, key: string): string | undefined;
|