@daikin-oss/design-system-web-components 1.1.0 → 1.3.0-next.2
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 +145 -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 +7 -3
- package/dist/cjs/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs/components/avatar/daikin-avatar.d.cts +3 -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 +549 -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/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +9 -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/chip/daikin-chip.cjs +106 -0
- package/dist/cjs/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs/components/chip/index.cjs +7 -0
- package/dist/cjs/components/chip/index.d.cts +1 -0
- package/dist/cjs/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs/components/combobox/index.cjs +8 -0
- package/dist/cjs/components/combobox/index.d.cts +1 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +626 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +106 -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 +91 -57
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs/components/icon/daikin-icon.cjs +117 -12
- package/dist/cjs/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs/components/icon/icons.json.cjs +6 -2
- package/dist/cjs/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs/components/index.cjs +81 -0
- package/dist/cjs/components/index.d.cts +14 -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 +50 -1
- 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 +27 -7
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs/components/loading/daikin-loading.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 +5 -5
- 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/select/daikin-select.cjs +6 -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/tab/daikin-tab.cjs +1 -0
- package/dist/cjs/components/table/daikin-table.cjs +74 -15
- package/dist/cjs/components/table/daikin-table.d.cts +72 -34
- 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.cjs +31 -6
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +8 -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 +289 -57
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs/components/text-field/number-utils.cjs +61 -0
- package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs/components/time-picker/index.cjs +17 -0
- package/dist/cjs/components/time-picker/index.d.cts +1 -0
- 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/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 +24 -8
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +11 -3
- 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/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs/controllers/focus-trap.cjs +42 -0
- package/dist/cjs/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs/icon-registry.cjs +170 -0
- package/dist/cjs/icon-registry.d.cts +120 -0
- package/dist/cjs/index.cjs +84 -0
- package/dist/cjs/index.d.cts +1 -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/notification-common.cjs +19 -15
- package/dist/cjs/utils/notification-common.d.cts +2 -2
- 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 +7 -3
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.d.cts +3 -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 +560 -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/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +9 -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/chip/daikin-chip.cjs +106 -0
- package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs-dev/components/chip/index.cjs +7 -0
- package/dist/cjs-dev/components/chip/index.d.cts +1 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs-dev/components/combobox/index.cjs +8 -0
- package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +637 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +106 -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 +91 -57
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs-dev/components/icon/icons.json.cjs +6 -2
- package/dist/cjs-dev/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs-dev/components/index.cjs +81 -0
- package/dist/cjs-dev/components/index.d.cts +14 -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 +50 -1
- 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 +27 -7
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs-dev/components/loading/daikin-loading.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 +5 -5
- 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/select/daikin-select.cjs +6 -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/tab/daikin-tab.cjs +1 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +77 -18
- package/dist/cjs-dev/components/table/daikin-table.d.cts +72 -34
- 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.cjs +31 -6
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +8 -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 +289 -57
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
- package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
- package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
- 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/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 +24 -8
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +11 -3
- 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/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
- 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/icon-registry.cjs +170 -0
- package/dist/cjs-dev/icon-registry.d.cts +120 -0
- package/dist/cjs-dev/index.cjs +84 -0
- package/dist/cjs-dev/index.d.cts +1 -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/notification-common.cjs +19 -15
- package/dist/cjs-dev/utils/notification-common.d.cts +2 -2
- 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 +8 -4
- package/dist/es/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es/components/avatar/daikin-avatar.js +2 -1
- 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 +550 -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 +2 -2
- package/dist/es/components/carousel/daikin-carousel.js +8 -4
- package/dist/es/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es/components/checkbox/daikin-checkbox.js +13 -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/chip/daikin-chip.d.ts +36 -0
- package/dist/es/components/chip/daikin-chip.js +107 -0
- package/dist/es/components/chip/index.d.ts +1 -0
- package/dist/es/components/chip/index.js +4 -0
- package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es/components/combobox/daikin-combobox.js +605 -0
- package/dist/es/components/combobox/index.d.ts +1 -0
- package/dist/es/components/combobox/index.js +5 -0
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es/components/date-picker/daikin-date-picker.js +627 -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 +7 -15
- package/dist/es/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es/components/icon/daikin-icon.js +119 -14
- package/dist/es/components/icon/icons.json.d.ts +16 -16
- package/dist/es/components/icon/icons.json.js +5 -1
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es/components/index.d.ts +14 -0
- package/dist/es/components/index.js +40 -1
- 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 +50 -1
- 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 +28 -8
- package/dist/es/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es/components/loading/daikin-loading.js +2 -2
- 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 +6 -6
- 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 +7 -2
- 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 +2 -1
- package/dist/es/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es/components/table/daikin-table.d.ts +72 -34
- package/dist/es/components/table/daikin-table.js +75 -16
- 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 +8 -1
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +32 -7
- 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 +57 -18
- package/dist/es/components/text-field/daikin-text-field.js +290 -58
- package/dist/es/components/text-field/number-utils.d.ts +26 -0
- package/dist/es/components/text-field/number-utils.js +61 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es/components/text-masked-field/index.d.ts +1 -0
- package/dist/es/components/text-masked-field/index.js +4 -0
- package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
- package/dist/es/components/time-picker/index.d.ts +1 -0
- package/dist/es/components/time-picker/index.js +14 -0
- 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.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 +11 -3
- package/dist/es/components/tooltip/daikin-tooltip.js +25 -9
- 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/floating-ui-auto-update.d.ts +12 -0
- package/dist/es/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es/controllers/focus-trap.d.ts +10 -0
- package/dist/es/controllers/focus-trap.js +42 -0
- package/dist/es/icon-registry.d.ts +120 -0
- package/dist/es/icon-registry.js +170 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +43 -1
- 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/notification-common.d.ts +2 -2
- 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 +8 -4
- package/dist/es-dev/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es-dev/components/avatar/daikin-avatar.js +2 -1
- 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 +561 -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 +2 -2
- package/dist/es-dev/components/carousel/daikin-carousel.js +8 -4
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +13 -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/chip/daikin-chip.d.ts +36 -0
- package/dist/es-dev/components/chip/daikin-chip.js +107 -0
- package/dist/es-dev/components/chip/index.d.ts +1 -0
- package/dist/es-dev/components/chip/index.js +4 -0
- package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
- package/dist/es-dev/components/combobox/index.d.ts +1 -0
- package/dist/es-dev/components/combobox/index.js +5 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +638 -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 +7 -15
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es-dev/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es-dev/components/icon/daikin-icon.js +143 -18
- package/dist/es-dev/components/icon/icons.json.d.ts +16 -16
- package/dist/es-dev/components/icon/icons.json.js +5 -1
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es-dev/components/index.d.ts +14 -0
- package/dist/es-dev/components/index.js +40 -1
- 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 +50 -1
- 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 +28 -8
- package/dist/es-dev/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es-dev/components/loading/daikin-loading.js +2 -2
- 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 +6 -6
- 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 +7 -2
- 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 +2 -1
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es-dev/components/table/daikin-table.d.ts +72 -34
- package/dist/es-dev/components/table/daikin-table.js +78 -19
- 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 +8 -1
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +32 -7
- 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 +57 -18
- package/dist/es-dev/components/text-field/daikin-text-field.js +290 -58
- package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
- package/dist/es-dev/components/text-field/number-utils.js +64 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
- package/dist/es-dev/components/text-masked-field/index.js +4 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
- package/dist/es-dev/components/time-picker/index.d.ts +1 -0
- package/dist/es-dev/components/time-picker/index.js +14 -0
- 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.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 +11 -3
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +25 -9
- 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/floating-ui-auto-update.d.ts +12 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
- 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/icon-registry.d.ts +120 -0
- package/dist/es-dev/icon-registry.js +170 -0
- package/dist/es-dev/index.d.ts +1 -0
- package/dist/es-dev/index.js +43 -1
- 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/notification-common.d.ts +2 -2
- 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/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/{dropdown-chevron-down.svg → number-minus.svg} +3 -1
- package/icons/number-plus.svg +5 -0
- package/icons/password-hidden.svg +3 -0
- package/icons/password-visible.svg +3 -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 +20 -6
- 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,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;
|
|
@@ -4,6 +4,7 @@ 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
|
+
const ref_js = require("lit/directives/ref.js");
|
|
7
8
|
const repeat_js = require("lit/directives/repeat.js");
|
|
8
9
|
const ddsElement = require("../../base/dds-element.cjs");
|
|
9
10
|
const decorators = require("../../base/decorators.cjs");
|
|
@@ -35,10 +36,14 @@ const cvaRow = classVarianceAuthority.cva(
|
|
|
35
36
|
{
|
|
36
37
|
variants: {
|
|
37
38
|
selected: {
|
|
38
|
-
false: [
|
|
39
|
+
false: [
|
|
40
|
+
"group-[:not([data-hover])]:media-hover:bg-ddt-color-common-surface-hover",
|
|
41
|
+
"data-[hover]:bg-ddt-color-common-surface-hover"
|
|
42
|
+
],
|
|
39
43
|
true: [
|
|
40
44
|
"bg-ddt-color-common-surface-selected-default",
|
|
41
|
-
"hover:bg-ddt-color-common-surface-selected-hover"
|
|
45
|
+
"group-[:not([data-hover])]:media-hover:bg-ddt-color-common-surface-selected-hover",
|
|
46
|
+
"data-[hover]:bg-ddt-color-common-surface-selected-hover"
|
|
42
47
|
]
|
|
43
48
|
}
|
|
44
49
|
}
|
|
@@ -52,11 +57,13 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
52
57
|
this.selectable = false;
|
|
53
58
|
this.sortable = false;
|
|
54
59
|
this.selection = [];
|
|
55
|
-
this.order = null;
|
|
56
60
|
this.sort = null;
|
|
61
|
+
this.order = null;
|
|
57
62
|
this.sortFunction = null;
|
|
58
63
|
this._bulkRowsCheckState = "unchecked";
|
|
59
64
|
this._currentView = [];
|
|
65
|
+
this._currentTouchHoverRowId = null;
|
|
66
|
+
this._tableRef = ref_js.createRef();
|
|
60
67
|
}
|
|
61
68
|
_updateCurrentView() {
|
|
62
69
|
var _a;
|
|
@@ -104,34 +111,70 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
104
111
|
}
|
|
105
112
|
this.dispatchEvent(new Event("change-sort"));
|
|
106
113
|
}
|
|
114
|
+
_handleTouchMove(event) {
|
|
115
|
+
var _a;
|
|
116
|
+
const touch = event.touches[0];
|
|
117
|
+
const row = touch && ((_a = (this.shadowRoot ?? document).elementsFromPoint(touch.clientX, touch.clientY).find(
|
|
118
|
+
(element) => {
|
|
119
|
+
var _a2;
|
|
120
|
+
return ((_a2 = this._tableRef.value) == null ? void 0 : _a2.contains(element)) && element.closest("tr");
|
|
121
|
+
}
|
|
122
|
+
)) == null ? void 0 : _a.closest("tr"));
|
|
123
|
+
this._currentTouchHoverRowId = (row == null ? void 0 : row.dataset.id) ?? null;
|
|
124
|
+
}
|
|
125
|
+
_handleTouchStart(event) {
|
|
126
|
+
this._handleTouchMove(event);
|
|
127
|
+
}
|
|
128
|
+
_handleTouchEnd() {
|
|
129
|
+
this._currentTouchHoverRowId = null;
|
|
130
|
+
}
|
|
107
131
|
_updateHeaderCheckboxState() {
|
|
108
132
|
const rowIdSet = new Set(this.rows.map(({ id }) => id));
|
|
109
133
|
this.selection = this.selection.filter((id) => rowIdSet.has(id));
|
|
110
134
|
const selectionCount = this.selection.length;
|
|
111
135
|
this._bulkRowsCheckState = this._currentView.length === selectionCount ? "checked" : selectionCount ? "indeterminate" : "unchecked";
|
|
112
136
|
}
|
|
137
|
+
_reflectSlotProperties() {
|
|
138
|
+
var _a;
|
|
139
|
+
for (const { key } of this.headers) {
|
|
140
|
+
const headerCell = (_a = (this.shadowRoot ?? this).querySelector(
|
|
141
|
+
`slot[name="header:${CSS.escape(String(key))}"]`
|
|
142
|
+
)) == null ? void 0 : _a.assignedElements()[0];
|
|
143
|
+
if ((headerCell == null ? void 0 : headerCell.tagName) !== "DAIKIN-TABLE-HEADER-CELL") {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
headerCell.order = this.sort === key ? this.order : null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
_handleSlotChange() {
|
|
150
|
+
this._reflectSlotProperties();
|
|
151
|
+
}
|
|
113
152
|
render() {
|
|
114
153
|
const createHeaderRow = () => repeat_js.repeat(
|
|
115
154
|
this.headers,
|
|
116
155
|
({ key }) => key,
|
|
117
|
-
({ key, label, alignment, sortable }) =>
|
|
156
|
+
({ key, label, alignment, sortable }) => {
|
|
157
|
+
const currentSort = this.sortable && this.sort === key ? this.order === "asc" ? "ascending" : "descending" : void 0;
|
|
158
|
+
return lit.html`<th
|
|
118
159
|
class="h-full p-0"
|
|
119
|
-
aria-sort=${ifDefined_js.ifDefined(
|
|
120
|
-
this.sortable && this.sort === key ? this.order === "asc" ? "ascending" : "descending" : void 0
|
|
121
|
-
)}
|
|
160
|
+
aria-sort=${ifDefined_js.ifDefined(currentSort)}
|
|
122
161
|
>
|
|
123
162
|
<slot
|
|
124
163
|
name=${`header:${key}`}
|
|
164
|
+
data-key=${key}
|
|
125
165
|
@change-sort=${(event) => this._handleClickSort(event, key)}
|
|
166
|
+
@slotchange=${this._handleSlotChange}
|
|
126
167
|
>
|
|
127
168
|
<daikin-table-header-cell
|
|
128
169
|
alignment=${alignment ?? "left"}
|
|
129
170
|
?sortable=${this.sortable && sortable}
|
|
171
|
+
order=${ifDefined_js.ifDefined(currentSort && this.order)}
|
|
130
172
|
>
|
|
131
173
|
${label}
|
|
132
174
|
</daikin-table-header-cell>
|
|
133
175
|
</slot>
|
|
134
|
-
</th
|
|
176
|
+
</th>`;
|
|
177
|
+
}
|
|
135
178
|
);
|
|
136
179
|
const createRow = (item) => repeat_js.repeat(
|
|
137
180
|
this.headers,
|
|
@@ -145,7 +188,11 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
145
188
|
</td>`
|
|
146
189
|
);
|
|
147
190
|
return lit.html`<div class="flex flex-col gap-6 w-full font-daikinSerif">
|
|
148
|
-
<table
|
|
191
|
+
<table
|
|
192
|
+
${ref_js.ref(this._tableRef)}
|
|
193
|
+
class="w-full group"
|
|
194
|
+
?data-hover=${this._currentTouchHoverRowId != null}
|
|
195
|
+
>
|
|
149
196
|
<thead>
|
|
150
197
|
<tr class="border-b border-b-ddt-color-divider">
|
|
151
198
|
${this.selectable ? lit.html`<td class="w-12 p-0">
|
|
@@ -164,7 +211,11 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
164
211
|
${createHeaderRow()}
|
|
165
212
|
</tr>
|
|
166
213
|
</thead>
|
|
167
|
-
<tbody
|
|
214
|
+
<tbody
|
|
215
|
+
@touchstart=${this._handleTouchStart}
|
|
216
|
+
@touchmove=${this._handleTouchMove}
|
|
217
|
+
@touchend=${this._handleTouchEnd}
|
|
218
|
+
>
|
|
168
219
|
${repeat_js.repeat(
|
|
169
220
|
this._currentView,
|
|
170
221
|
({ id }) => id,
|
|
@@ -172,6 +223,8 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
172
223
|
class=${cvaRow({
|
|
173
224
|
selected: this.selectable && !!this.selection.find((id) => id === row.id)
|
|
174
225
|
})}
|
|
226
|
+
data-id=${row.id}
|
|
227
|
+
?data-hover=${this._currentTouchHoverRowId === row.id}
|
|
175
228
|
>
|
|
176
229
|
${this.selectable ? lit.html`<td class="w-12 p-0">
|
|
177
230
|
<span
|
|
@@ -194,7 +247,7 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
194
247
|
</div>`;
|
|
195
248
|
}
|
|
196
249
|
willUpdate(changedProperties) {
|
|
197
|
-
const viewChanged = changedProperties.has("rows") || changedProperties.has("sort") || changedProperties.has("order") || changedProperties.has("sortFunction");
|
|
250
|
+
const viewChanged = changedProperties.has("headers") || changedProperties.has("rows") || changedProperties.has("sort") || changedProperties.has("order") || changedProperties.has("sortFunction");
|
|
198
251
|
const selectionChanged = changedProperties.has("selection");
|
|
199
252
|
if (viewChanged) {
|
|
200
253
|
this._updateCurrentView();
|
|
@@ -204,20 +257,22 @@ exports.DaikinTable = class DaikinTable extends ddsElement.DDSElement {
|
|
|
204
257
|
}
|
|
205
258
|
}
|
|
206
259
|
updated(changedProperties) {
|
|
207
|
-
|
|
208
|
-
{
|
|
260
|
+
{
|
|
261
|
+
if (changedProperties.has("headers")) {
|
|
209
262
|
if (this.headers.length !== [...new Set(this.headers.map(({ key }) => key))].length) {
|
|
210
263
|
console.warn("The `key` values in `headers` are duplicated");
|
|
211
264
|
}
|
|
212
265
|
}
|
|
213
|
-
|
|
214
|
-
if (changedProperties.has("rows")) {
|
|
215
|
-
{
|
|
266
|
+
if (changedProperties.has("rows")) {
|
|
216
267
|
if (this.rows.length !== [...new Set(this.rows.map(({ id }) => id))].length) {
|
|
217
268
|
console.warn("The `id` values in `rows` are duplicated");
|
|
218
269
|
}
|
|
219
270
|
}
|
|
220
271
|
}
|
|
272
|
+
const sortChanged = changedProperties.has("headers") || changedProperties.has("sort") || changedProperties.has("order");
|
|
273
|
+
if (sortChanged) {
|
|
274
|
+
this._reflectSlotProperties();
|
|
275
|
+
}
|
|
221
276
|
}
|
|
222
277
|
};
|
|
223
278
|
exports.DaikinTable.styles = lit.css`
|
|
@@ -226,6 +281,7 @@ exports.DaikinTable.styles = lit.css`
|
|
|
226
281
|
:host {
|
|
227
282
|
display: block;
|
|
228
283
|
width: 100%;
|
|
284
|
+
overflow: auto;
|
|
229
285
|
}
|
|
230
286
|
`;
|
|
231
287
|
__decorateClass([
|
|
@@ -245,10 +301,10 @@ __decorateClass([
|
|
|
245
301
|
], exports.DaikinTable.prototype, "selection", 2);
|
|
246
302
|
__decorateClass([
|
|
247
303
|
decorators_js.property({ type: String, reflect: true })
|
|
248
|
-
], exports.DaikinTable.prototype, "
|
|
304
|
+
], exports.DaikinTable.prototype, "sort", 2);
|
|
249
305
|
__decorateClass([
|
|
250
306
|
decorators_js.property({ type: String, reflect: true })
|
|
251
|
-
], exports.DaikinTable.prototype, "
|
|
307
|
+
], exports.DaikinTable.prototype, "order", 2);
|
|
252
308
|
__decorateClass([
|
|
253
309
|
decorators_js.property({ attribute: false })
|
|
254
310
|
], exports.DaikinTable.prototype, "sortFunction", 2);
|
|
@@ -258,6 +314,9 @@ __decorateClass([
|
|
|
258
314
|
__decorateClass([
|
|
259
315
|
decorators_js.state()
|
|
260
316
|
], exports.DaikinTable.prototype, "_currentView", 2);
|
|
317
|
+
__decorateClass([
|
|
318
|
+
decorators_js.state()
|
|
319
|
+
], exports.DaikinTable.prototype, "_currentTouchHoverRowId", 2);
|
|
261
320
|
exports.DaikinTable = __decorateClass([
|
|
262
321
|
decorators.ddsElement("daikin-table")
|
|
263
322
|
], exports.DaikinTable);
|
|
@@ -9,9 +9,11 @@ export type HeaderType<T extends string = string> = {
|
|
|
9
9
|
/**
|
|
10
10
|
* The table component is a component that can display multiple data objects in a tabular format.
|
|
11
11
|
*
|
|
12
|
-
* It is modeled on the HTML `<table>` element. However, unlike a normal `<table>` element, this component
|
|
12
|
+
* It is modeled on the HTML `<table>` element. However, unlike a normal `<table>` element, this component generates table structure automatically from data. You must provide the `headers` and `rows` properties to define the table structure and content. You can also customize table cell content by providing custom content in slots.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* By specifying the `rows` property, you can only display plain text content. If you need to display richer content within the row cells, such as an icon or a button, provide custom content using the cell slot pattern: ``slot=${`cell:${rows[j].id}:${headers[i].key}`}``
|
|
15
|
+
*
|
|
16
|
+
* By specifying the headers property, you can only display plain text, define text alignment and sorting buttons. If you need to display richer content within the header cells, such as an icon or a button, provide custom content using the cell slot pattern: ``slot=${`header:${headers[i].key}`}``
|
|
15
17
|
*
|
|
16
18
|
* The table provides two functions: checkboxes and sorting, and you can select the functions you need.
|
|
17
19
|
*
|
|
@@ -34,19 +36,8 @@ export type HeaderType<T extends string = string> = {
|
|
|
34
36
|
* ```
|
|
35
37
|
*
|
|
36
38
|
* ```html
|
|
37
|
-
* <daikin-table
|
|
38
|
-
* .
|
|
39
|
-
* { key: 'name', label: 'Name', sortable: true },
|
|
40
|
-
* { key: 'season', label: 'Season', sortable: true },
|
|
41
|
-
* { key: 'price', label: 'Price', alignment: 'right', sortable: false },
|
|
42
|
-
* ]"
|
|
43
|
-
* .rows="[
|
|
44
|
-
* { id: '1', name: 'Apple', season: 'Autumn', price: '$2' },
|
|
45
|
-
* { id: '2', name: 'Peach', season: 'Summer', price: '$4' },
|
|
46
|
-
* { id: '3', name: 'Orange', season: 'Winter', price: '$1' },
|
|
47
|
-
* { id: '4', name: 'Strawberry', season: 'Spring', price: '$4' },
|
|
48
|
-
* ]"
|
|
49
|
-
* >
|
|
39
|
+
* <daikin-table>
|
|
40
|
+
* <!-- By using a slot, you can add a subtitle below the content in the name column for each row. -->
|
|
50
41
|
* <daikin-table-cell slot="cell:1:name">
|
|
51
42
|
* Apple
|
|
52
43
|
* <span slot="subtitle">This is a autumn fruit.</span>
|
|
@@ -64,6 +55,22 @@ export type HeaderType<T extends string = string> = {
|
|
|
64
55
|
* <span slot="subtitle">This is a spring fruit.</span>
|
|
65
56
|
* </daikin-table-cell>
|
|
66
57
|
* </daikin-table>
|
|
58
|
+
*
|
|
59
|
+
* <script>
|
|
60
|
+
* // Set up the table data
|
|
61
|
+
* const tableElement = document.querySelector('daikin-table');
|
|
62
|
+
* tableElement.headers = [
|
|
63
|
+
* { key: 'name', label: 'Name', sortable: true },
|
|
64
|
+
* { key: 'season', label: 'Season', sortable: true },
|
|
65
|
+
* { key: 'price', label: 'Price', alignment: 'right', sortable: false },
|
|
66
|
+
* ];
|
|
67
|
+
* tableElement.rows = [
|
|
68
|
+
* { id: '1', name: 'Apple', season: 'Autumn', price: '$2' },
|
|
69
|
+
* { id: '2', name: 'Peach', season: 'Summer', price: '$4' },
|
|
70
|
+
* { id: '3', name: 'Orange', season: 'Winter', price: '$1' },
|
|
71
|
+
* { id: '4', name: 'Strawberry', season: 'Spring', price: '$4' },
|
|
72
|
+
* ];
|
|
73
|
+
* </script>
|
|
67
74
|
* ```
|
|
68
75
|
*/
|
|
69
76
|
export declare class DaikinTable<T extends {
|
|
@@ -72,59 +79,90 @@ export declare class DaikinTable<T extends {
|
|
|
72
79
|
static readonly styles: import('lit').CSSResult;
|
|
73
80
|
/**
|
|
74
81
|
* Headers of the table.
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* -
|
|
82
|
+
* An array of header configuration objects that define the table columns.
|
|
83
|
+
* Each object must have a unique `key` (used to match row data) and a `label` (displayed text).
|
|
84
|
+
*
|
|
85
|
+
* - key: The `key` value corresponds to the property name in the row data (excluding `id`). All `key` values must be unique within the headers array. Use only alphanumeric characters, `$`, and `_` in the `key`.
|
|
86
|
+
* - label: The text displayed in the header cells.
|
|
87
|
+
* - alignment: The text alignment direction. Defaults to left alignment if omitted.
|
|
88
|
+
* - sortable: When `sortable = true`, enables sorting for this column.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* [
|
|
92
|
+
* { key: 'name', label: 'Name', sortable: true },
|
|
93
|
+
* { key: 'price', label: 'Price', alignment: 'right', sortable: false },
|
|
94
|
+
* ]
|
|
79
95
|
*/
|
|
80
96
|
headers: readonly HeaderType<Extract<keyof T, string>>[];
|
|
81
97
|
/**
|
|
82
98
|
* Rows of the table.
|
|
83
|
-
* An array
|
|
84
|
-
*
|
|
99
|
+
* An array of data objects where each object represents a table row.
|
|
100
|
+
* Each object must have a unique `id` property and properties that match the `key` values defined in `headers`.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* [
|
|
104
|
+
* { id: '1', name: 'Apple', price: '$2' },
|
|
105
|
+
* { id: '2', name: 'Orange', price: '$1' },
|
|
106
|
+
* ]
|
|
85
107
|
*/
|
|
86
108
|
rows: T[];
|
|
87
109
|
/**
|
|
88
|
-
* Whether
|
|
89
|
-
*
|
|
110
|
+
* Whether to enable row selection.
|
|
111
|
+
* When `true`, a checkbox will be displayed to the left of each row.
|
|
90
112
|
*/
|
|
91
113
|
selectable: boolean;
|
|
92
114
|
/**
|
|
93
|
-
* Whether
|
|
94
|
-
*
|
|
115
|
+
* Whether to enable row sorting.
|
|
116
|
+
* When `true`, a sort button will be displayed to the right of each sortable header cell.
|
|
95
117
|
*/
|
|
96
118
|
sortable: boolean;
|
|
97
119
|
/**
|
|
98
|
-
* An array of `id`
|
|
120
|
+
* An array of `id` values for the selected rows.
|
|
99
121
|
*/
|
|
100
122
|
selection: string[];
|
|
101
|
-
/**
|
|
102
|
-
* Sort order of the table.
|
|
103
|
-
*/
|
|
104
|
-
order: "asc" | "desc" | null;
|
|
105
123
|
/**
|
|
106
124
|
* The `key` of the currently sorted column.
|
|
125
|
+
* Used with the `order` property to determine which column is sorted and in which direction.
|
|
126
|
+
*
|
|
127
|
+
* For example, if `sort = "name"` and `order = "asc"`, the table will be sorted by the "name" column in ascending order.
|
|
107
128
|
*/
|
|
108
129
|
sort: keyof T | null;
|
|
109
130
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
131
|
+
* The sort order of the table.
|
|
132
|
+
* Used with the `sort` property.
|
|
133
|
+
*
|
|
134
|
+
* - "asc": ascending order
|
|
135
|
+
* - "desc": descending order
|
|
136
|
+
*
|
|
137
|
+
* For example, if `sort = "price"` and `order = "desc"`, the table will be sorted by the "price" column in descending order.
|
|
138
|
+
*/
|
|
139
|
+
order: "asc" | "desc" | null;
|
|
140
|
+
/**
|
|
141
|
+
* Custom sort function for table columns.
|
|
142
|
+
* The function should return a comparison result for ascending order: `0`, `1`, or `-1`.
|
|
112
143
|
*/
|
|
113
144
|
sortFunction: {
|
|
114
145
|
[key in keyof T]?: (a: T, b: T, key: key) => number;
|
|
115
146
|
} | ((a: T, b: T, key: keyof T) => number) | false | null;
|
|
116
147
|
private _bulkRowsCheckState;
|
|
117
148
|
/**
|
|
118
|
-
* The rows displayed in the
|
|
119
|
-
*
|
|
149
|
+
* The rows currently displayed in the table.
|
|
150
|
+
* This is a sorted version of `rows`. Pagination may be added in the future.
|
|
120
151
|
*/
|
|
121
152
|
private _currentView;
|
|
153
|
+
private _currentTouchHoverRowId;
|
|
154
|
+
private _tableRef;
|
|
122
155
|
private _updateCurrentView;
|
|
123
156
|
private _emitChangeCheckEvent;
|
|
124
157
|
private _handleHeaderCheckboxChange;
|
|
125
158
|
private _handleBodyCheckboxChange;
|
|
126
159
|
private _handleClickSort;
|
|
160
|
+
private _handleTouchMove;
|
|
161
|
+
private _handleTouchStart;
|
|
162
|
+
private _handleTouchEnd;
|
|
127
163
|
private _updateHeaderCheckboxState;
|
|
164
|
+
private _reflectSlotProperties;
|
|
165
|
+
private _handleSlotChange;
|
|
128
166
|
render(): import('lit-html').TemplateResult<1>;
|
|
129
167
|
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
130
168
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DDSElement } from "../../base/index.cjs";
|
|
2
2
|
import { MergeVariantProps } from "../../type-utils.cjs";
|
|
3
3
|
declare const cvaCell: (props?: ({
|
|
4
|
-
alignment?: "
|
|
4
|
+
alignment?: "center" | "right" | "left" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
type TableCellVariantProps = MergeVariantProps<typeof cvaCell>;
|
|
7
7
|
/**
|
|
@@ -46,11 +46,31 @@ const cvaHeaderCell = classVarianceAuthority.cva(
|
|
|
46
46
|
"focus-visible:-outline-offset-2",
|
|
47
47
|
"focus-visible:outline-ddt-color-common-border-focus",
|
|
48
48
|
"after:flex-none",
|
|
49
|
-
"after:size-6"
|
|
50
|
-
"after:i-daikin-sort"
|
|
49
|
+
"after:size-6"
|
|
51
50
|
]
|
|
51
|
+
},
|
|
52
|
+
order: {
|
|
53
|
+
asc: [],
|
|
54
|
+
desc: []
|
|
52
55
|
}
|
|
53
|
-
}
|
|
56
|
+
},
|
|
57
|
+
compoundVariants: [
|
|
58
|
+
{
|
|
59
|
+
sortable: true,
|
|
60
|
+
order: null,
|
|
61
|
+
class: ["after:i-daikin-sort"]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
sortable: true,
|
|
65
|
+
order: "asc",
|
|
66
|
+
class: ["after:i-daikin-chevron-up"]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
sortable: true,
|
|
70
|
+
order: "desc",
|
|
71
|
+
class: ["after:i-daikin-chevron-up", "after:rotate-180"]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
54
74
|
}
|
|
55
75
|
);
|
|
56
76
|
exports.DaikinTableHeaderCell = class DaikinTableHeaderCell extends ddsElement.DDSElement {
|
|
@@ -58,14 +78,16 @@ exports.DaikinTableHeaderCell = class DaikinTableHeaderCell extends ddsElement.D
|
|
|
58
78
|
super(...arguments);
|
|
59
79
|
this.alignment = "left";
|
|
60
80
|
this.sortable = false;
|
|
81
|
+
this.order = null;
|
|
61
82
|
}
|
|
62
83
|
render() {
|
|
63
84
|
const headerCellCN = cvaHeaderCell({
|
|
64
85
|
alignment: this.alignment,
|
|
65
|
-
sortable: this.sortable
|
|
86
|
+
sortable: this.sortable,
|
|
87
|
+
order: this.order === "asc" || this.order === "desc" ? this.order : null
|
|
66
88
|
});
|
|
67
|
-
const content = lit.html`<slot name="left-icon" class="icon-size-6"></slot
|
|
68
|
-
|
|
89
|
+
const content = lit.html`<slot name="left-icon" class="icon-size-6"></slot
|
|
90
|
+
><slot></slot>`;
|
|
69
91
|
return this.sortable ? lit.html`<button
|
|
70
92
|
type="button"
|
|
71
93
|
class=${headerCellCN}
|
|
@@ -90,6 +112,9 @@ __decorateClass([
|
|
|
90
112
|
__decorateClass([
|
|
91
113
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
92
114
|
], exports.DaikinTableHeaderCell.prototype, "sortable", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
decorators_js.property({ type: String, reflect: true })
|
|
117
|
+
], exports.DaikinTableHeaderCell.prototype, "order", 2);
|
|
93
118
|
exports.DaikinTableHeaderCell = __decorateClass([
|
|
94
119
|
decorators.ddsElement("daikin-table-header-cell")
|
|
95
120
|
], exports.DaikinTableHeaderCell);
|