@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import { css,
|
|
2
|
+
import { unsafeCSS, css, nothing, html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
5
|
import { DDSElement } from "../../base/dds-element.js";
|
|
@@ -57,7 +57,7 @@ let DaikinProgressIndicatorItem = class extends DDSElement {
|
|
|
57
57
|
${this.status === "finished" ? html`
|
|
58
58
|
<span
|
|
59
59
|
role="img"
|
|
60
|
-
class="flex-none size-4 i-daikin-
|
|
60
|
+
class="flex-none size-4 i-daikin-success text-ddt-color-common-brand-default"
|
|
61
61
|
aria-label="Completed"
|
|
62
62
|
></span>
|
|
63
63
|
` : nothing}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
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.js";
|
|
|
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;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import { css,
|
|
2
|
+
import { unsafeCSS, css, nothing, html } from "lit";
|
|
3
3
|
import { property, query } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
|
-
import
|
|
5
|
+
import "../../base/dds-element.js";
|
|
6
6
|
import { ddsElement } from "../../base/decorators.js";
|
|
7
7
|
import "../../base/define.js";
|
|
8
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
8
9
|
import tailwindStyles from "../../tailwind.css.js";
|
|
9
10
|
var __defProp = Object.defineProperty;
|
|
10
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -52,24 +53,21 @@ const cvaLabel = cva([], {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
});
|
|
55
|
-
let DaikinRadio = class extends
|
|
56
|
+
let DaikinRadio = class extends DDSFormElement {
|
|
56
57
|
constructor() {
|
|
57
58
|
super(...arguments);
|
|
58
|
-
this.name = "";
|
|
59
|
-
this.value = "";
|
|
60
59
|
this.label = "";
|
|
61
60
|
this.labelPosition = "right";
|
|
62
61
|
this.checked = false;
|
|
63
62
|
this.disabled = false;
|
|
64
63
|
this.disabledByParent = false;
|
|
65
64
|
this.skipTab = false;
|
|
66
|
-
this._internals = this.attachInternals();
|
|
67
65
|
}
|
|
68
66
|
get _labelHidden() {
|
|
69
67
|
return this.labelPosition === "hidden";
|
|
70
68
|
}
|
|
71
69
|
_updateFormValue() {
|
|
72
|
-
this.
|
|
70
|
+
this.setFormValue(this.checked ? this.value : null);
|
|
73
71
|
}
|
|
74
72
|
_handleClick(event) {
|
|
75
73
|
var _a;
|
|
@@ -141,13 +139,6 @@ DaikinRadio.styles = css`
|
|
|
141
139
|
display: inline-block;
|
|
142
140
|
}
|
|
143
141
|
`;
|
|
144
|
-
DaikinRadio.formAssociated = true;
|
|
145
|
-
__decorateClass([
|
|
146
|
-
property({ type: String, reflect: true })
|
|
147
|
-
], DaikinRadio.prototype, "name", 2);
|
|
148
|
-
__decorateClass([
|
|
149
|
-
property({ type: String, reflect: true })
|
|
150
|
-
], DaikinRadio.prototype, "value", 2);
|
|
151
142
|
__decorateClass([
|
|
152
143
|
property({ type: String })
|
|
153
144
|
], DaikinRadio.prototype, "label", 2);
|
|
@@ -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
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
3
|
import { queryAssignedElements, property, state } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
5
|
import { DDSElement } from "../../base/dds-element.js";
|
|
@@ -17,7 +17,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
17
17
|
if (kind && result) __defProp(target, key, result);
|
|
18
18
|
return result;
|
|
19
19
|
};
|
|
20
|
-
const cvaRadioGroup = cva(["size-full", "flex", "gap-x-
|
|
20
|
+
const cvaRadioGroup = cva(["size-full", "flex", "gap-x-8", "gap-y-2"], {
|
|
21
21
|
variants: {
|
|
22
22
|
orientation: {
|
|
23
23
|
horizontal: ["flex-row", "flex-wrap"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
3
|
import { property, queryAssignedElements, state } from "lit/decorators.js";
|
|
4
4
|
import { DDSElement } from "../../base/dds-element.js";
|
|
5
5
|
import { ddsElement } from "../../base/decorators.js";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
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,264 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
4
|
+
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
6
|
+
import tailwindStyles from "../../tailwind.css.js";
|
|
7
|
+
import { getValueFromRatio, getValueByKeydown } from "./slider-utils.js";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
const cvaSliderThumb = cva(
|
|
19
|
+
[
|
|
20
|
+
"absolute",
|
|
21
|
+
"top-1/2",
|
|
22
|
+
"-translate-x-1/2",
|
|
23
|
+
"-translate-y-1/2",
|
|
24
|
+
"w-4",
|
|
25
|
+
"h-4",
|
|
26
|
+
"rounded-full",
|
|
27
|
+
"left-[--slider-ratio]"
|
|
28
|
+
],
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
disabled: {
|
|
32
|
+
false: [
|
|
33
|
+
"cursor-pointer",
|
|
34
|
+
"[&:not([data-dragging])]:bg-ddt-color-common-brand-default",
|
|
35
|
+
"[&:not([data-dragging])]:hover:bg-ddt-color-common-brand-hover",
|
|
36
|
+
"[&:not([data-dragging])]:active:bg-ddt-color-common-brand-press",
|
|
37
|
+
"data-[dragging]:bg-ddt-color-common-brand-press",
|
|
38
|
+
"focus-visible:outline",
|
|
39
|
+
"focus-visible:outline-2",
|
|
40
|
+
"focus-visible:outline-offset-2",
|
|
41
|
+
"focus-visible:outline-ddt-color-common-border-focus"
|
|
42
|
+
],
|
|
43
|
+
true: ["bg-ddt-color-common-disabled", "pointer-events-none"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
const cvaSliderTrack = cva(
|
|
49
|
+
[
|
|
50
|
+
"absolute",
|
|
51
|
+
"top-1/2",
|
|
52
|
+
"-translate-y-1/2",
|
|
53
|
+
"left-0",
|
|
54
|
+
"h-1",
|
|
55
|
+
"w-[--slider-ratio]"
|
|
56
|
+
],
|
|
57
|
+
{
|
|
58
|
+
variants: {
|
|
59
|
+
disabled: {
|
|
60
|
+
false: ["bg-ddt-color-common-brand-default"],
|
|
61
|
+
true: ["bg-ddt-color-common-border-empty"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
let DaikinSlider = class extends DDSFormElement {
|
|
67
|
+
constructor() {
|
|
68
|
+
super();
|
|
69
|
+
this.min = "1";
|
|
70
|
+
this.max = "100";
|
|
71
|
+
this.step = "1";
|
|
72
|
+
this.disabled = false;
|
|
73
|
+
this.sliderAriaLabel = "slider";
|
|
74
|
+
this._dragging = false;
|
|
75
|
+
this._sliderRef = createRef();
|
|
76
|
+
this._thumbRef = createRef();
|
|
77
|
+
this.value = this.min;
|
|
78
|
+
}
|
|
79
|
+
_updateFormValue() {
|
|
80
|
+
if (this.disabled) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.setFormValue(this.value);
|
|
84
|
+
this.dispatchEvent(
|
|
85
|
+
new Event("change", {
|
|
86
|
+
bubbles: true,
|
|
87
|
+
composed: true
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
this.dispatchEvent(
|
|
91
|
+
new Event("input", {
|
|
92
|
+
bubbles: true,
|
|
93
|
+
composed: true
|
|
94
|
+
})
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
get _progress() {
|
|
98
|
+
const min = parseFloat(this.min);
|
|
99
|
+
const max = parseFloat(this.max);
|
|
100
|
+
const clampedValue = Math.max(min, Math.min(parseFloat(this.value), max));
|
|
101
|
+
return (clampedValue - min) / (max - min) * 100;
|
|
102
|
+
}
|
|
103
|
+
_handleDrag(event) {
|
|
104
|
+
const leftDistance = this._calcMousePositionRatio(event);
|
|
105
|
+
if (leftDistance == null) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const value = getValueFromRatio(this, leftDistance);
|
|
109
|
+
this.value = value;
|
|
110
|
+
}
|
|
111
|
+
// This function is called when an arrow key is pressed while the thumb is focused.
|
|
112
|
+
_handleKeyDown(event) {
|
|
113
|
+
if (this.disabled) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const value = getValueByKeydown(this, event.key);
|
|
117
|
+
if (value == null) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.value = value;
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Returns a normalized value of the mouse position on the slider, in the range 0 to 1.
|
|
125
|
+
*
|
|
126
|
+
* @param event A MouseEvent.
|
|
127
|
+
* @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.
|
|
128
|
+
*/
|
|
129
|
+
_calcMousePositionRatio(event) {
|
|
130
|
+
var _a;
|
|
131
|
+
const box = (_a = this._sliderRef.value) == null ? void 0 : _a.getBoundingClientRect();
|
|
132
|
+
if (box == null) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const x = event instanceof MouseEvent ? event.clientX : event.targetTouches[0].clientX;
|
|
136
|
+
const relativeX = x - box.left;
|
|
137
|
+
return Math.max(0, Math.min(relativeX / box.width, 1));
|
|
138
|
+
}
|
|
139
|
+
// This function will triggered when the slider thumb button start dragging.
|
|
140
|
+
_startDrag(event) {
|
|
141
|
+
var _a;
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
if (this.disabled) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const controller = new AbortController();
|
|
147
|
+
const { signal } = controller;
|
|
148
|
+
this._dragging = true;
|
|
149
|
+
document.addEventListener(
|
|
150
|
+
"mousemove",
|
|
151
|
+
(event2) => {
|
|
152
|
+
this._handleDrag(event2);
|
|
153
|
+
},
|
|
154
|
+
{ signal }
|
|
155
|
+
);
|
|
156
|
+
document.addEventListener(
|
|
157
|
+
"mouseup",
|
|
158
|
+
() => {
|
|
159
|
+
this._dragging = false;
|
|
160
|
+
controller.abort();
|
|
161
|
+
},
|
|
162
|
+
{ once: true }
|
|
163
|
+
);
|
|
164
|
+
(_a = this._thumbRef.value) == null ? void 0 : _a.focus();
|
|
165
|
+
this._handleDrag(event);
|
|
166
|
+
}
|
|
167
|
+
// This function will triggered when the slider thumb button start dragging.
|
|
168
|
+
_startTouch(event) {
|
|
169
|
+
var _a;
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
if (this.disabled) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const controller = new AbortController();
|
|
175
|
+
const { signal } = controller;
|
|
176
|
+
this._dragging = true;
|
|
177
|
+
document.addEventListener(
|
|
178
|
+
"touchmove",
|
|
179
|
+
(event2) => {
|
|
180
|
+
this._handleDrag(event2);
|
|
181
|
+
},
|
|
182
|
+
{ signal }
|
|
183
|
+
);
|
|
184
|
+
document.addEventListener(
|
|
185
|
+
"touchend",
|
|
186
|
+
() => {
|
|
187
|
+
this._dragging = false;
|
|
188
|
+
controller.abort();
|
|
189
|
+
},
|
|
190
|
+
{ once: true }
|
|
191
|
+
);
|
|
192
|
+
(_a = this._thumbRef.value) == null ? void 0 : _a.focus();
|
|
193
|
+
this._handleDrag(event);
|
|
194
|
+
}
|
|
195
|
+
render() {
|
|
196
|
+
const progress = this._progress;
|
|
197
|
+
return html`
|
|
198
|
+
<span
|
|
199
|
+
${ref(this._sliderRef)}
|
|
200
|
+
class="w-full h-6 relative"
|
|
201
|
+
style="--slider-ratio:${progress}%"
|
|
202
|
+
@mousedown=${this._startDrag}
|
|
203
|
+
@touchstart=${this._startTouch}
|
|
204
|
+
>
|
|
205
|
+
<span
|
|
206
|
+
class="w-full absolute top-1/2 -translate-y-1/2 left-0 h-1 bg-ddt-color-common-border-empty"
|
|
207
|
+
></span>
|
|
208
|
+
<span class=${cvaSliderTrack({ disabled: this.disabled })}></span>
|
|
209
|
+
<span
|
|
210
|
+
${ref(this._thumbRef)}
|
|
211
|
+
class=${cvaSliderThumb({ disabled: this.disabled })}
|
|
212
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
213
|
+
role="slider"
|
|
214
|
+
?data-dragging=${this._dragging}
|
|
215
|
+
aria-valuenow=${this.value}
|
|
216
|
+
aria-valuemin=${this.min}
|
|
217
|
+
aria-valuemax=${this.max}
|
|
218
|
+
aria-label=${this.sliderAriaLabel}
|
|
219
|
+
aria-disabled=${this.disabled}
|
|
220
|
+
@mousedown=${this._startDrag}
|
|
221
|
+
@keydown=${this._handleKeyDown}
|
|
222
|
+
></span>
|
|
223
|
+
</span>
|
|
224
|
+
`;
|
|
225
|
+
}
|
|
226
|
+
updated(changedProperties) {
|
|
227
|
+
if (!changedProperties.has("value")) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this._updateFormValue();
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
DaikinSlider.styles = css`
|
|
234
|
+
${unsafeCSS(tailwindStyles)}
|
|
235
|
+
|
|
236
|
+
:host {
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
width: 100%;
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
__decorateClass([
|
|
242
|
+
property({ type: String, reflect: true })
|
|
243
|
+
], DaikinSlider.prototype, "min", 2);
|
|
244
|
+
__decorateClass([
|
|
245
|
+
property({ type: String, reflect: true })
|
|
246
|
+
], DaikinSlider.prototype, "max", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
property({ type: String, reflect: true })
|
|
249
|
+
], DaikinSlider.prototype, "step", 2);
|
|
250
|
+
__decorateClass([
|
|
251
|
+
property({ type: Boolean, reflect: true })
|
|
252
|
+
], DaikinSlider.prototype, "disabled", 2);
|
|
253
|
+
__decorateClass([
|
|
254
|
+
property({ type: String, reflect: true, attribute: "slider-aria-label" })
|
|
255
|
+
], DaikinSlider.prototype, "sliderAriaLabel", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
state()
|
|
258
|
+
], DaikinSlider.prototype, "_dragging", 2);
|
|
259
|
+
DaikinSlider = __decorateClass([
|
|
260
|
+
customElement("daikin-slider")
|
|
261
|
+
], DaikinSlider);
|
|
262
|
+
export {
|
|
263
|
+
DaikinSlider
|
|
264
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-slider.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DaikinSlider } from "./daikin-slider.js";
|
|
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;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function normalizeNumberString(str) {
|
|
2
|
+
return str.replace(new RegExp("(?:\\.0*|(?<=\\.\\d*?)0+)$"), "").replace(new RegExp("(?<=-|^)0+(?=[1-9]|0\\.|0)"), "").replace(/^-0$/, "0");
|
|
3
|
+
}
|
|
4
|
+
function formatValue(value, step) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const decimals = ((_b = (_a = /\.(\d*?)0*$/.exec(step)) == null ? void 0 : _a[1]) == null ? void 0 : _b.length) ?? 0;
|
|
7
|
+
const formattedValue = value.toFixed(decimals);
|
|
8
|
+
return normalizeNumberString(formattedValue);
|
|
9
|
+
}
|
|
10
|
+
function getValueFromRatio(slider, ratio) {
|
|
11
|
+
const minFloat = parseFloat(slider.min);
|
|
12
|
+
const maxFloat = parseFloat(slider.max);
|
|
13
|
+
const stepFloat = parseFloat(slider.step);
|
|
14
|
+
const rawValue = ratio * (maxFloat - minFloat) + minFloat;
|
|
15
|
+
const steppedValue = Math.round(rawValue / stepFloat) * stepFloat;
|
|
16
|
+
if (steppedValue <= minFloat) {
|
|
17
|
+
return normalizeNumberString(slider.min);
|
|
18
|
+
}
|
|
19
|
+
if (steppedValue >= maxFloat) {
|
|
20
|
+
return normalizeNumberString(slider.max);
|
|
21
|
+
}
|
|
22
|
+
return formatValue(steppedValue, slider.step);
|
|
23
|
+
}
|
|
24
|
+
function getValueByKeydown(slider, key) {
|
|
25
|
+
if (key === "Home") {
|
|
26
|
+
return slider.min;
|
|
27
|
+
}
|
|
28
|
+
if (key === "End") {
|
|
29
|
+
return slider.max;
|
|
30
|
+
}
|
|
31
|
+
const offset = {
|
|
32
|
+
ArrowLeft: -1,
|
|
33
|
+
ArrowDown: -1,
|
|
34
|
+
ArrowRight: 1,
|
|
35
|
+
ArrowUp: 1,
|
|
36
|
+
PageDown: -10,
|
|
37
|
+
PageUp: 10
|
|
38
|
+
}[key];
|
|
39
|
+
if (!offset) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const minFloat = parseFloat(slider.min);
|
|
43
|
+
const maxFloat = parseFloat(slider.max);
|
|
44
|
+
const stepFloat = parseFloat(slider.step);
|
|
45
|
+
const valueFloat = parseFloat(slider.value);
|
|
46
|
+
const clampedValue = Math.max(
|
|
47
|
+
minFloat,
|
|
48
|
+
Math.min(maxFloat, valueFloat + stepFloat * offset)
|
|
49
|
+
);
|
|
50
|
+
return formatValue(clampedValue, slider.step);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
formatValue,
|
|
54
|
+
getValueByKeydown,
|
|
55
|
+
getValueFromRatio,
|
|
56
|
+
normalizeNumberString
|
|
57
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
3
|
import { property, query } from "lit/decorators.js";
|
|
4
4
|
import { DDSElement } from "../../base/dds-element.js";
|
|
5
5
|
import { ddsElement } from "../../base/decorators.js";
|
|
@@ -119,11 +119,16 @@ export declare class DaikinTable<T extends {
|
|
|
119
119
|
* Currently this is a sorted `rows`, but pagination may be considered in the future.
|
|
120
120
|
*/
|
|
121
121
|
private _currentView;
|
|
122
|
+
private _currentTouchHoverRowId;
|
|
123
|
+
private _tableRef;
|
|
122
124
|
private _updateCurrentView;
|
|
123
125
|
private _emitChangeCheckEvent;
|
|
124
126
|
private _handleHeaderCheckboxChange;
|
|
125
127
|
private _handleBodyCheckboxChange;
|
|
126
128
|
private _handleClickSort;
|
|
129
|
+
private _handleTouchMove;
|
|
130
|
+
private _handleTouchStart;
|
|
131
|
+
private _handleTouchEnd;
|
|
127
132
|
private _updateHeaderCheckboxState;
|
|
128
133
|
render(): import('lit-html').TemplateResult<1>;
|
|
129
134
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|