@daikin-oss/design-system-web-components 0.7.0 → 1.1.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 -12
- package/README.md +2 -2
- package/dist/cjs/base/dds-element.cjs +8 -0
- package/dist/cjs/base/dds-element.d.cts +4 -0
- package/dist/cjs/base/decorators.cjs +13 -0
- package/dist/cjs/base/decorators.d.cts +2 -0
- package/dist/cjs/base/define.cjs +18 -0
- package/dist/cjs/base/define.d.cts +1 -0
- package/dist/cjs/base/index.cjs +8 -0
- package/dist/cjs/base/index.d.cts +3 -0
- package/dist/cjs/components/accordion/daikin-accordion.cjs +39 -6
- package/dist/cjs/components/accordion/daikin-accordion.d.cts +15 -2
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +37 -77
- package/dist/cjs/components/accordion-item/daikin-accordion-item.d.cts +10 -16
- package/dist/cjs/components/avatar/daikin-avatar.cjs +160 -0
- package/dist/cjs/components/avatar/daikin-avatar.d.cts +64 -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/daikin-breadcrumb.cjs +8 -5
- package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.cts +2 -2
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +8 -5
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +2 -2
- package/dist/cjs/components/button/daikin-button.cjs +20 -8
- package/dist/cjs/components/button/daikin-button.d.cts +6 -3
- package/dist/cjs/components/card/daikin-card.cjs +11 -7
- package/dist/cjs/components/card/daikin-card.d.cts +8 -2
- package/dist/cjs/components/card-footer/daikin-card-footer.cjs +9 -9
- package/dist/cjs/components/card-footer/daikin-card-footer.d.cts +6 -2
- package/dist/cjs/components/card-header/daikin-card-header.cjs +10 -10
- package/dist/cjs/components/card-header/daikin-card-header.d.cts +6 -2
- package/dist/cjs/components/carousel/daikin-carousel.cjs +217 -0
- package/dist/cjs/components/carousel/daikin-carousel.d.cts +56 -0
- package/dist/cjs/components/carousel/index.cjs +7 -0
- package/dist/cjs/components/carousel/index.d.cts +1 -0
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +80 -0
- package/dist/cjs/components/carousel-item/daikin-carousel-item.d.cts +50 -0
- package/dist/cjs/components/carousel-item/index.cjs +7 -0
- package/dist/cjs/components/carousel-item/index.d.cts +1 -0
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +35 -16
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +8 -2
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +161 -74
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +64 -11
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +109 -41
- package/dist/cjs/components/dropdown-item/daikin-dropdown-item.d.cts +16 -3
- package/dist/cjs/components/icon/daikin-icon.cjs +8 -5
- package/dist/cjs/components/icon/daikin-icon.d.cts +2 -2
- package/dist/cjs/components/icon/icons.json.cjs +1 -70
- package/dist/cjs/components/icon/icons.json.d.cts +4 -8
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +8 -5
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +2 -2
- package/dist/cjs/components/index.cjs +33 -3
- package/dist/cjs/components/index.d.cts +7 -1
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +92 -0
- package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +55 -0
- package/dist/cjs/components/inline-notification/index.cjs +7 -0
- package/dist/cjs/components/inline-notification/index.d.cts +1 -0
- package/dist/cjs/components/input-group/daikin-input-group.cjs +12 -9
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +15 -7
- package/dist/cjs/components/link/daikin-link.cjs +9 -6
- package/dist/cjs/components/link/daikin-link.d.cts +2 -2
- package/dist/cjs/components/list/daikin-list.cjs +9 -9
- package/dist/cjs/components/list/daikin-list.d.cts +7 -2
- package/dist/cjs/components/list-item/daikin-list-item.cjs +8 -5
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +6 -2
- package/dist/cjs/components/loading/daikin-loading.cjs +91 -0
- package/dist/cjs/components/loading/daikin-loading.d.cts +32 -0
- package/dist/cjs/components/loading/index.cjs +7 -0
- package/dist/cjs/components/loading/index.d.cts +1 -0
- package/dist/cjs/components/pagination/daikin-pagination.cjs +22 -13
- package/dist/cjs/components/pagination/daikin-pagination.d.cts +6 -2
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +13 -8
- package/dist/cjs/components/progress-bar/daikin-progress-bar.d.cts +3 -2
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.cjs +16 -20
- package/dist/cjs/components/progress-indicator/daikin-progress-indicator.d.cts +12 -5
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +24 -25
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.d.cts +8 -4
- package/dist/cjs/components/radio/daikin-radio.cjs +45 -23
- package/dist/cjs/components/radio/daikin-radio.d.cts +18 -8
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +31 -11
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +20 -14
- package/dist/cjs/components/select/daikin-select.cjs +15 -6
- package/dist/cjs/components/select/daikin-select.d.cts +11 -2
- package/dist/cjs/components/tab/daikin-tab.cjs +25 -10
- package/dist/cjs/components/tab/daikin-tab.d.cts +7 -2
- package/dist/cjs/components/tab-panels/daikin-tab-panels.cjs +9 -7
- package/dist/cjs/components/tab-panels/daikin-tab-panels.d.cts +2 -2
- package/dist/cjs/components/table/daikin-table.cjs +9 -6
- package/dist/cjs/components/table/daikin-table.d.cts +9 -2
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +8 -5
- package/dist/cjs/components/table-cell/daikin-table-cell.d.cts +6 -2
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +8 -5
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +6 -2
- package/dist/cjs/components/tabs/daikin-tabs.cjs +25 -10
- package/dist/cjs/components/tabs/daikin-tabs.d.cts +8 -2
- package/dist/cjs/components/text-area/daikin-text-area.cjs +16 -7
- package/dist/cjs/components/text-area/daikin-text-area.d.cts +7 -2
- package/dist/cjs/components/text-field/daikin-text-field.cjs +16 -7
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +7 -2
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +94 -0
- package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +69 -0
- package/dist/cjs/components/toast-notification/index.cjs +7 -0
- package/dist/cjs/components/toast-notification/index.d.cts +1 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +192 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +67 -0
- package/dist/cjs/components/toast-notification-manager/index.cjs +7 -0
- package/dist/cjs/components/toast-notification-manager/index.d.cts +1 -0
- package/dist/cjs/components/toggle/daikin-toggle.cjs +8 -5
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +3 -2
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +42 -30
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +16 -6
- package/dist/cjs/components/tree/daikin-tree.cjs +36 -37
- package/dist/cjs/components/tree/daikin-tree.d.cts +13 -14
- package/dist/cjs/components/tree-item/daikin-tree-item.cjs +22 -18
- package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +9 -9
- package/dist/cjs/components/tree-section/daikin-tree-section.cjs +26 -41
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +10 -20
- package/dist/cjs/controllers/click-outside.d.cts +1 -1
- package/dist/cjs/index.cjs +33 -3
- package/dist/cjs/tailwind.css.cjs +1 -1
- 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 +121 -0
- package/dist/cjs/utils/notification-common.d.cts +19 -0
- package/dist/cjs-dev/base/dds-element.cjs +8 -0
- package/dist/cjs-dev/base/dds-element.d.cts +4 -0
- package/dist/cjs-dev/base/decorators.cjs +13 -0
- package/dist/cjs-dev/base/decorators.d.cts +2 -0
- package/dist/cjs-dev/base/define.cjs +18 -0
- package/dist/cjs-dev/base/define.d.cts +1 -0
- package/dist/cjs-dev/base/index.cjs +8 -0
- package/dist/cjs-dev/base/index.d.cts +3 -0
- package/dist/cjs-dev/components/accordion/daikin-accordion.cjs +46 -6
- package/dist/cjs-dev/components/accordion/daikin-accordion.d.cts +15 -2
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +37 -77
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.cts +10 -16
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +160 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.d.cts +64 -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/daikin-breadcrumb.cjs +8 -5
- package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.cts +2 -2
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +8 -5
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +2 -2
- package/dist/cjs-dev/components/button/daikin-button.cjs +20 -8
- package/dist/cjs-dev/components/button/daikin-button.d.cts +6 -3
- package/dist/cjs-dev/components/card/daikin-card.cjs +11 -7
- package/dist/cjs-dev/components/card/daikin-card.d.cts +8 -2
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.cjs +9 -9
- package/dist/cjs-dev/components/card-footer/daikin-card-footer.d.cts +6 -2
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +10 -10
- package/dist/cjs-dev/components/card-header/daikin-card-header.d.cts +6 -2
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +227 -0
- package/dist/cjs-dev/components/carousel/daikin-carousel.d.cts +56 -0
- package/dist/cjs-dev/components/carousel/index.cjs +7 -0
- package/dist/cjs-dev/components/carousel/index.d.cts +1 -0
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +80 -0
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.d.cts +50 -0
- package/dist/cjs-dev/components/carousel-item/index.cjs +7 -0
- package/dist/cjs-dev/components/carousel-item/index.d.cts +1 -0
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +35 -16
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +8 -2
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +161 -74
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +64 -11
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +109 -41
- package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.d.cts +16 -3
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +8 -5
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +2 -2
- package/dist/cjs-dev/components/icon/icons.json.cjs +1 -70
- package/dist/cjs-dev/components/icon/icons.json.d.cts +4 -8
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +8 -5
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +2 -2
- package/dist/cjs-dev/components/index.cjs +33 -3
- package/dist/cjs-dev/components/index.d.cts +7 -1
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +92 -0
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +55 -0
- package/dist/cjs-dev/components/inline-notification/index.cjs +7 -0
- package/dist/cjs-dev/components/inline-notification/index.d.cts +1 -0
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +12 -9
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +15 -7
- package/dist/cjs-dev/components/link/daikin-link.cjs +9 -6
- package/dist/cjs-dev/components/link/daikin-link.d.cts +2 -2
- package/dist/cjs-dev/components/list/daikin-list.cjs +9 -9
- package/dist/cjs-dev/components/list/daikin-list.d.cts +7 -2
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +8 -5
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +6 -2
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +91 -0
- package/dist/cjs-dev/components/loading/daikin-loading.d.cts +32 -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/pagination/daikin-pagination.cjs +22 -13
- package/dist/cjs-dev/components/pagination/daikin-pagination.d.cts +6 -2
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +13 -8
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.cts +3 -2
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.cjs +16 -30
- package/dist/cjs-dev/components/progress-indicator/daikin-progress-indicator.d.cts +12 -5
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +24 -25
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.cts +8 -4
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +45 -23
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +18 -8
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +31 -11
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +20 -14
- package/dist/cjs-dev/components/select/daikin-select.cjs +15 -6
- package/dist/cjs-dev/components/select/daikin-select.d.cts +11 -2
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +25 -10
- package/dist/cjs-dev/components/tab/daikin-tab.d.cts +7 -2
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.cjs +9 -7
- package/dist/cjs-dev/components/tab-panels/daikin-tab-panels.d.cts +2 -2
- package/dist/cjs-dev/components/table/daikin-table.cjs +9 -6
- package/dist/cjs-dev/components/table/daikin-table.d.cts +9 -2
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +8 -5
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.d.cts +6 -2
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +8 -5
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +6 -2
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +25 -10
- package/dist/cjs-dev/components/tabs/daikin-tabs.d.cts +8 -2
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +16 -7
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.cts +7 -2
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +16 -7
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +7 -2
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +94 -0
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +69 -0
- package/dist/cjs-dev/components/toast-notification/index.cjs +7 -0
- package/dist/cjs-dev/components/toast-notification/index.d.cts +1 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +192 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +67 -0
- package/dist/cjs-dev/components/toast-notification-manager/index.cjs +7 -0
- package/dist/cjs-dev/components/toast-notification-manager/index.d.cts +1 -0
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +8 -5
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +3 -2
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +42 -30
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +16 -6
- package/dist/cjs-dev/components/tree/daikin-tree.cjs +36 -37
- package/dist/cjs-dev/components/tree/daikin-tree.d.cts +13 -14
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +22 -18
- package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +9 -9
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +26 -41
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +10 -20
- package/dist/cjs-dev/controllers/click-outside.d.cts +1 -1
- package/dist/cjs-dev/index.cjs +33 -3
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- 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 +124 -0
- package/dist/cjs-dev/utils/notification-common.d.cts +19 -0
- package/dist/es/base/dds-element.d.ts +4 -0
- package/dist/es/base/dds-element.js +8 -0
- package/dist/es/base/decorators.d.ts +2 -0
- package/dist/es/base/decorators.js +13 -0
- package/dist/es/base/define.d.ts +1 -0
- package/dist/es/base/define.js +18 -0
- package/dist/es/base/index.d.ts +3 -0
- package/dist/es/base/index.js +8 -0
- package/dist/es/components/accordion/daikin-accordion.d.ts +15 -2
- package/dist/es/components/accordion/daikin-accordion.js +38 -5
- package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +10 -16
- package/dist/es/components/accordion-item/daikin-accordion-item.js +36 -76
- package/dist/es/components/avatar/daikin-avatar.d.ts +64 -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.d.ts +2 -2
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +7 -4
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +2 -2
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +7 -4
- package/dist/es/components/button/daikin-button.d.ts +6 -3
- package/dist/es/components/button/daikin-button.js +19 -7
- package/dist/es/components/card/daikin-card.d.ts +8 -2
- package/dist/es/components/card/daikin-card.js +10 -6
- package/dist/es/components/card-footer/daikin-card-footer.d.ts +6 -2
- package/dist/es/components/card-footer/daikin-card-footer.js +7 -7
- package/dist/es/components/card-header/daikin-card-header.d.ts +6 -2
- package/dist/es/components/card-header/daikin-card-header.js +8 -8
- package/dist/es/components/carousel/daikin-carousel.d.ts +56 -0
- package/dist/es/components/carousel/daikin-carousel.js +218 -0
- package/dist/es/components/carousel/index.d.ts +1 -0
- package/dist/es/components/carousel/index.js +4 -0
- package/dist/es/components/carousel-item/daikin-carousel-item.d.ts +50 -0
- package/dist/es/components/carousel-item/daikin-carousel-item.js +81 -0
- package/dist/es/components/carousel-item/index.d.ts +1 -0
- package/dist/es/components/carousel-item/index.js +4 -0
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +8 -2
- package/dist/es/components/checkbox/daikin-checkbox.js +34 -15
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +64 -11
- package/dist/es/components/dropdown/daikin-dropdown.js +160 -73
- package/dist/es/components/dropdown-item/daikin-dropdown-item.d.ts +16 -3
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +108 -40
- package/dist/es/components/icon/daikin-icon.d.ts +2 -2
- package/dist/es/components/icon/daikin-icon.js +7 -4
- package/dist/es/components/icon/icons.json.d.ts +4 -8
- package/dist/es/components/icon/icons.json.js +1 -70
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +2 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +7 -4
- package/dist/es/components/index.d.ts +7 -1
- package/dist/es/components/index.js +14 -2
- package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +55 -0
- package/dist/es/components/inline-notification/daikin-inline-notification.js +93 -0
- package/dist/es/components/inline-notification/index.d.ts +1 -0
- package/dist/es/components/inline-notification/index.js +4 -0
- package/dist/es/components/input-group/daikin-input-group.d.ts +15 -7
- package/dist/es/components/input-group/daikin-input-group.js +11 -8
- package/dist/es/components/link/daikin-link.d.ts +2 -2
- package/dist/es/components/link/daikin-link.js +8 -5
- package/dist/es/components/list/daikin-list.d.ts +7 -2
- package/dist/es/components/list/daikin-list.js +7 -7
- package/dist/es/components/list-item/daikin-list-item.d.ts +6 -2
- package/dist/es/components/list-item/daikin-list-item.js +7 -4
- package/dist/es/components/loading/daikin-loading.d.ts +32 -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/pagination/daikin-pagination.d.ts +6 -2
- package/dist/es/components/pagination/daikin-pagination.js +21 -12
- package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +3 -2
- package/dist/es/components/progress-bar/daikin-progress-bar.js +12 -7
- package/dist/es/components/progress-indicator/daikin-progress-indicator.d.ts +12 -5
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +15 -19
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +8 -4
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +23 -24
- package/dist/es/components/radio/daikin-radio.d.ts +18 -8
- package/dist/es/components/radio/daikin-radio.js +44 -22
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +20 -14
- package/dist/es/components/radio-group/daikin-radio-group.js +30 -10
- package/dist/es/components/select/daikin-select.d.ts +11 -2
- package/dist/es/components/select/daikin-select.js +14 -5
- package/dist/es/components/tab/daikin-tab.d.ts +7 -2
- package/dist/es/components/tab/daikin-tab.js +24 -9
- package/dist/es/components/tab-panels/daikin-tab-panels.d.ts +2 -2
- package/dist/es/components/tab-panels/daikin-tab-panels.js +8 -6
- package/dist/es/components/table/daikin-table.d.ts +9 -2
- package/dist/es/components/table/daikin-table.js +8 -5
- package/dist/es/components/table-cell/daikin-table-cell.d.ts +6 -2
- package/dist/es/components/table-cell/daikin-table-cell.js +7 -4
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +6 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +7 -4
- package/dist/es/components/tabs/daikin-tabs.d.ts +8 -2
- package/dist/es/components/tabs/daikin-tabs.js +24 -9
- package/dist/es/components/text-area/daikin-text-area.d.ts +7 -2
- package/dist/es/components/text-area/daikin-text-area.js +15 -6
- package/dist/es/components/text-field/daikin-text-field.d.ts +7 -2
- package/dist/es/components/text-field/daikin-text-field.js +15 -6
- package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +69 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.js +95 -0
- package/dist/es/components/toast-notification/index.d.ts +1 -0
- package/dist/es/components/toast-notification/index.js +4 -0
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +67 -0
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +193 -0
- package/dist/es/components/toast-notification-manager/index.d.ts +1 -0
- package/dist/es/components/toast-notification-manager/index.js +4 -0
- package/dist/es/components/toggle/daikin-toggle.d.ts +3 -2
- package/dist/es/components/toggle/daikin-toggle.js +7 -4
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +16 -6
- package/dist/es/components/tooltip/daikin-tooltip.js +41 -29
- package/dist/es/components/tree/daikin-tree.d.ts +13 -14
- package/dist/es/components/tree/daikin-tree.js +35 -36
- package/dist/es/components/tree-item/daikin-tree-item.d.ts +9 -9
- package/dist/es/components/tree-item/daikin-tree-item.js +21 -17
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +10 -20
- package/dist/es/components/tree-section/daikin-tree-section.js +25 -40
- package/dist/es/controllers/click-outside.d.ts +1 -1
- package/dist/es/index.js +14 -2
- package/dist/es/tailwind.css.js +1 -1
- 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 +19 -0
- package/dist/es/utils/notification-common.js +121 -0
- package/dist/es-dev/base/dds-element.d.ts +4 -0
- package/dist/es-dev/base/dds-element.js +8 -0
- package/dist/es-dev/base/decorators.d.ts +2 -0
- package/dist/es-dev/base/decorators.js +13 -0
- package/dist/es-dev/base/define.d.ts +1 -0
- package/dist/es-dev/base/define.js +18 -0
- package/dist/es-dev/base/index.d.ts +3 -0
- package/dist/es-dev/base/index.js +8 -0
- package/dist/es-dev/components/accordion/daikin-accordion.d.ts +15 -2
- package/dist/es-dev/components/accordion/daikin-accordion.js +45 -5
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +10 -16
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +36 -76
- package/dist/es-dev/components/avatar/daikin-avatar.d.ts +64 -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.d.ts +2 -2
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +7 -4
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +2 -2
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +7 -4
- package/dist/es-dev/components/button/daikin-button.d.ts +6 -3
- package/dist/es-dev/components/button/daikin-button.js +19 -7
- package/dist/es-dev/components/card/daikin-card.d.ts +8 -2
- package/dist/es-dev/components/card/daikin-card.js +10 -6
- package/dist/es-dev/components/card-footer/daikin-card-footer.d.ts +6 -2
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +7 -7
- package/dist/es-dev/components/card-header/daikin-card-header.d.ts +6 -2
- package/dist/es-dev/components/card-header/daikin-card-header.js +8 -8
- package/dist/es-dev/components/carousel/daikin-carousel.d.ts +56 -0
- package/dist/es-dev/components/carousel/daikin-carousel.js +228 -0
- package/dist/es-dev/components/carousel/index.d.ts +1 -0
- package/dist/es-dev/components/carousel/index.js +4 -0
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.d.ts +50 -0
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +81 -0
- package/dist/es-dev/components/carousel-item/index.d.ts +1 -0
- package/dist/es-dev/components/carousel-item/index.js +4 -0
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +8 -2
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +34 -15
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +64 -11
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +160 -73
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.d.ts +16 -3
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +108 -40
- package/dist/es-dev/components/icon/daikin-icon.d.ts +2 -2
- package/dist/es-dev/components/icon/daikin-icon.js +7 -4
- package/dist/es-dev/components/icon/icons.json.d.ts +4 -8
- package/dist/es-dev/components/icon/icons.json.js +1 -70
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +2 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +7 -4
- package/dist/es-dev/components/index.d.ts +7 -1
- package/dist/es-dev/components/index.js +14 -2
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +55 -0
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +93 -0
- package/dist/es-dev/components/inline-notification/index.d.ts +1 -0
- package/dist/es-dev/components/inline-notification/index.js +4 -0
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +15 -7
- package/dist/es-dev/components/input-group/daikin-input-group.js +11 -8
- package/dist/es-dev/components/link/daikin-link.d.ts +2 -2
- package/dist/es-dev/components/link/daikin-link.js +8 -5
- package/dist/es-dev/components/list/daikin-list.d.ts +7 -2
- package/dist/es-dev/components/list/daikin-list.js +7 -7
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +6 -2
- package/dist/es-dev/components/list-item/daikin-list-item.js +7 -4
- package/dist/es-dev/components/loading/daikin-loading.d.ts +32 -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/pagination/daikin-pagination.d.ts +6 -2
- package/dist/es-dev/components/pagination/daikin-pagination.js +21 -12
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +3 -2
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +12 -7
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.d.ts +12 -5
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +15 -29
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.d.ts +8 -4
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +23 -24
- package/dist/es-dev/components/radio/daikin-radio.d.ts +18 -8
- package/dist/es-dev/components/radio/daikin-radio.js +44 -22
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +20 -14
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +30 -10
- package/dist/es-dev/components/select/daikin-select.d.ts +11 -2
- package/dist/es-dev/components/select/daikin-select.js +14 -5
- package/dist/es-dev/components/tab/daikin-tab.d.ts +7 -2
- package/dist/es-dev/components/tab/daikin-tab.js +24 -9
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.d.ts +2 -2
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +8 -6
- package/dist/es-dev/components/table/daikin-table.d.ts +9 -2
- package/dist/es-dev/components/table/daikin-table.js +8 -5
- package/dist/es-dev/components/table-cell/daikin-table-cell.d.ts +6 -2
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +7 -4
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +6 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +7 -4
- package/dist/es-dev/components/tabs/daikin-tabs.d.ts +8 -2
- package/dist/es-dev/components/tabs/daikin-tabs.js +24 -9
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +7 -2
- package/dist/es-dev/components/text-area/daikin-text-area.js +15 -6
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +7 -2
- package/dist/es-dev/components/text-field/daikin-text-field.js +15 -6
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +69 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +95 -0
- package/dist/es-dev/components/toast-notification/index.d.ts +1 -0
- package/dist/es-dev/components/toast-notification/index.js +4 -0
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +67 -0
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +193 -0
- package/dist/es-dev/components/toast-notification-manager/index.d.ts +1 -0
- package/dist/es-dev/components/toast-notification-manager/index.js +4 -0
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +3 -2
- package/dist/es-dev/components/toggle/daikin-toggle.js +7 -4
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +16 -6
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +41 -29
- package/dist/es-dev/components/tree/daikin-tree.d.ts +13 -14
- package/dist/es-dev/components/tree/daikin-tree.js +35 -36
- package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +9 -9
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +21 -17
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +10 -20
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +25 -40
- package/dist/es-dev/controllers/click-outside.d.ts +1 -1
- package/dist/es-dev/index.js +14 -2
- package/dist/es-dev/tailwind.css.js +1 -1
- 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 +19 -0
- package/dist/es-dev/utils/notification-common.js +124 -0
- package/icons/checkbox-checked.svg +2 -3
- package/icons/profile.svg +4 -0
- package/icons/status-negative.svg +4 -2
- package/icons/status-warning.svg +2 -4
- package/package.json +54 -50
- package/dist/cjs/components/notification/daikin-notification.cjs +0 -196
- package/dist/cjs/components/notification/daikin-notification.d.cts +0 -77
- package/dist/cjs/components/notification/index.cjs +0 -7
- package/dist/cjs/components/notification/index.d.cts +0 -1
- package/dist/cjs/constants/events.cjs +0 -4
- package/dist/cjs-dev/components/notification/daikin-notification.cjs +0 -196
- package/dist/cjs-dev/components/notification/daikin-notification.d.cts +0 -77
- package/dist/cjs-dev/components/notification/index.cjs +0 -7
- package/dist/cjs-dev/components/notification/index.d.cts +0 -1
- package/dist/cjs-dev/constants/events.cjs +0 -4
- package/dist/es/components/notification/daikin-notification.d.ts +0 -77
- package/dist/es/components/notification/daikin-notification.js +0 -197
- package/dist/es/components/notification/index.d.ts +0 -1
- package/dist/es/components/notification/index.js +0 -4
- package/dist/es/constants/events.js +0 -4
- package/dist/es-dev/components/notification/daikin-notification.d.ts +0 -77
- package/dist/es-dev/components/notification/daikin-notification.js +0 -197
- package/dist/es-dev/components/notification/index.d.ts +0 -1
- package/dist/es-dev/components/notification/index.js +0 -4
- package/dist/es-dev/constants/events.js +0 -4
- package/icons/arrow-up.svg +0 -3
- package/icons/status-success.svg +0 -6
|
@@ -5,15 +5,20 @@ const classVarianceAuthority = require("class-variance-authority");
|
|
|
5
5
|
const lit = require("lit");
|
|
6
6
|
const decorators_js = require("lit/decorators.js");
|
|
7
7
|
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
8
|
+
const ref_js = require("lit/directives/ref.js");
|
|
9
|
+
const ddsElement = require("../../base/dds-element.cjs");
|
|
10
|
+
const decorators = require("../../base/decorators.cjs");
|
|
11
|
+
require("../../base/define.cjs");
|
|
8
12
|
const clickOutside = require("../../controllers/click-outside.cjs");
|
|
9
13
|
const floatingUiAutoUpdate = require("../../controllers/floating-ui-auto-update.cjs");
|
|
10
14
|
const tailwind = require("../../tailwind.css.cjs");
|
|
15
|
+
const isSimpleKey = require("../../utils/is-simple-key.cjs");
|
|
11
16
|
var __defProp = Object.defineProperty;
|
|
12
17
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __decorateClass = (
|
|
18
|
+
var __decorateClass = (decorators2, target, key, kind) => {
|
|
14
19
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
|
-
for (var i =
|
|
16
|
-
if (decorator =
|
|
20
|
+
for (var i = decorators2.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators2[i])
|
|
17
22
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
18
23
|
if (kind && result) __defProp(target, key, result);
|
|
19
24
|
return result;
|
|
@@ -21,36 +26,34 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
21
26
|
const cvaButton = classVarianceAuthority.cva(
|
|
22
27
|
[
|
|
23
28
|
"flex",
|
|
29
|
+
"justify-between",
|
|
24
30
|
"items-center",
|
|
25
31
|
"gap-2",
|
|
26
32
|
"w-full",
|
|
27
33
|
"h-full",
|
|
28
34
|
"min-h-12",
|
|
29
35
|
"bg-ddt-color-common-background-default",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
36
|
+
"py-3",
|
|
37
|
+
"pl-4",
|
|
38
|
+
"pr-3",
|
|
33
39
|
"rounded",
|
|
34
40
|
"overflow-hidden",
|
|
35
41
|
"font-daikinSerif",
|
|
36
42
|
"text-left",
|
|
37
|
-
"leading-
|
|
43
|
+
"leading-[130%]",
|
|
38
44
|
"relative",
|
|
39
45
|
"outline",
|
|
40
|
-
"outline-
|
|
41
|
-
"-outline-offset-
|
|
46
|
+
"outline-1",
|
|
47
|
+
"-outline-offset-1",
|
|
42
48
|
"focus-visible:outline-2",
|
|
43
|
-
"focus-visible
|
|
49
|
+
"focus-visible:-outline-offset-2",
|
|
50
|
+
"enabled:outline-[--color-base]",
|
|
44
51
|
"disabled:text-ddt-color-common-disabled",
|
|
45
|
-
"disabled:
|
|
52
|
+
"disabled:outline-ddt-color-common-disabled",
|
|
46
53
|
"after:i-daikin-dropdown-chevron-down",
|
|
47
|
-
"after:
|
|
48
|
-
"after:
|
|
49
|
-
"after:
|
|
50
|
-
"after:m-auto",
|
|
51
|
-
"after:top-0",
|
|
52
|
-
"after:bottom-0",
|
|
53
|
-
"after:right-3",
|
|
54
|
+
"after:size-6",
|
|
55
|
+
"after:flex-none",
|
|
56
|
+
"after:ml-auto",
|
|
54
57
|
"enabled:after:text-ddt-color-common-text-primary",
|
|
55
58
|
"disabled:after:text-ddt-color-common-disabled"
|
|
56
59
|
],
|
|
@@ -61,17 +64,19 @@ const cvaButton = classVarianceAuthority.cva(
|
|
|
61
64
|
"enabled:hover:bg-ddt-color-common-surface-hover",
|
|
62
65
|
"enabled:active:bg-ddt-color-common-surface-press"
|
|
63
66
|
],
|
|
64
|
-
true: [
|
|
67
|
+
true: [
|
|
68
|
+
"enabled:bg-ddt-color-common-surface-press",
|
|
69
|
+
"after:scale-y-[-1]"
|
|
70
|
+
]
|
|
65
71
|
},
|
|
66
72
|
error: {
|
|
67
73
|
false: [
|
|
68
74
|
"var-color-ddt-color-common-neutral-default/color-base",
|
|
69
|
-
"var-color-ddt-color-common-
|
|
75
|
+
"hover:var-color-ddt-color-common-neutral-hover/color-base",
|
|
76
|
+
"active:var-color-ddt-color-common-neutral-press/color-base",
|
|
77
|
+
"focus-visible:var-color-ddt-color-common-border-focus/color-base"
|
|
70
78
|
],
|
|
71
|
-
true: [
|
|
72
|
-
"var-color-ddt-color-common-danger-default/color-base",
|
|
73
|
-
"var-color-ddt-color-common-danger-default/color-focus"
|
|
74
|
-
]
|
|
79
|
+
true: ["var-color-ddt-color-common-danger-default/color-base"]
|
|
75
80
|
},
|
|
76
81
|
placeholder: {
|
|
77
82
|
false: ["text-ddt-color-common-text-primary"],
|
|
@@ -95,7 +100,7 @@ const floatingPositionOptions = {
|
|
|
95
100
|
})
|
|
96
101
|
]
|
|
97
102
|
};
|
|
98
|
-
exports.DaikinDropdown = class DaikinDropdown extends
|
|
103
|
+
exports.DaikinDropdown = class DaikinDropdown extends ddsElement.DDSElement {
|
|
99
104
|
constructor() {
|
|
100
105
|
super(...arguments);
|
|
101
106
|
this._internals = this.attachInternals();
|
|
@@ -105,37 +110,31 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
105
110
|
this.required = false;
|
|
106
111
|
this.error = false;
|
|
107
112
|
this.open = false;
|
|
113
|
+
this.multiple = false;
|
|
114
|
+
this.selectedOptions = [];
|
|
115
|
+
this.maxLabels = null;
|
|
108
116
|
this._label = null;
|
|
109
|
-
this.
|
|
110
|
-
this._selectedItemLabel = "";
|
|
117
|
+
this._initialUpdateCompleted = false;
|
|
111
118
|
this._autoUpdateController = new floatingUiAutoUpdate.FloatingUIAutoUpdateController(this);
|
|
112
119
|
this._clickOutsideController = new clickOutside.ClickOutsideController(
|
|
113
120
|
this,
|
|
114
121
|
this._onClickOutside
|
|
115
122
|
);
|
|
116
123
|
this._lastFocusedItem = null;
|
|
124
|
+
this._dropdownRef = ref_js.createRef();
|
|
117
125
|
}
|
|
118
|
-
|
|
119
|
-
this.
|
|
126
|
+
get _selectionLabels() {
|
|
127
|
+
const items = this._items;
|
|
128
|
+
return this.selectedOptions.map(
|
|
129
|
+
(value) => {
|
|
130
|
+
var _a;
|
|
131
|
+
return ((_a = items.find((item) => item.value === value)) == null ? void 0 : _a.textContent) ?? "";
|
|
132
|
+
}
|
|
133
|
+
);
|
|
120
134
|
}
|
|
121
135
|
_onClickOutside() {
|
|
122
136
|
this.open = false;
|
|
123
137
|
}
|
|
124
|
-
_reflectItemsAndLabel() {
|
|
125
|
-
const items = this._items;
|
|
126
|
-
const selectedItem = items.find((item) => item.value === this.value);
|
|
127
|
-
for (const item of items) {
|
|
128
|
-
item.selected = item === selectedItem;
|
|
129
|
-
}
|
|
130
|
-
this._hasSelectedItem = !!selectedItem;
|
|
131
|
-
this._selectedItemLabel = (selectedItem == null ? void 0 : selectedItem.textContent) ?? "";
|
|
132
|
-
}
|
|
133
|
-
_handleClick() {
|
|
134
|
-
if (this.disabled) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
this.open = !this.open;
|
|
138
|
-
}
|
|
139
138
|
_searchItem(prefix) {
|
|
140
139
|
const items = this._items.filter(
|
|
141
140
|
(item) => {
|
|
@@ -157,13 +156,6 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
157
156
|
this.open = true;
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
|
-
_handleKeyDownEscape() {
|
|
161
|
-
if (this.open) {
|
|
162
|
-
this.open = false;
|
|
163
|
-
} else {
|
|
164
|
-
this.value = null;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
159
|
_moveFocus(moveOffset) {
|
|
168
160
|
if (!this.open) {
|
|
169
161
|
this.open = true;
|
|
@@ -185,7 +177,56 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
185
177
|
break;
|
|
186
178
|
}
|
|
187
179
|
}
|
|
180
|
+
_updateFormValue() {
|
|
181
|
+
this._internals.setFormValue(JSON.stringify(this.value));
|
|
182
|
+
}
|
|
183
|
+
_updateItemsSelectable() {
|
|
184
|
+
for (const item of this._items) {
|
|
185
|
+
item.selectable = this.multiple;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
_updateValueBySelectedOptions() {
|
|
189
|
+
this.value = this.selectedOptions.at(-1) ?? null;
|
|
190
|
+
}
|
|
191
|
+
_updateSelectedOptionsByValue() {
|
|
192
|
+
this.selectedOptions = this.value ? [this.value] : [];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Handling for when an option is selected.
|
|
196
|
+
* If multiple selection is enabled, the specified option is added to or removed from the array of selected options.
|
|
197
|
+
* If multiple selection is disabled, the current value is set to the specified option. The selection is not cleared.
|
|
198
|
+
*
|
|
199
|
+
* @param value The value of selected option.
|
|
200
|
+
*/
|
|
201
|
+
_handleSelectOption(value) {
|
|
202
|
+
this.value = value;
|
|
203
|
+
this.selectedOptions = this.multiple ? this.selectedOptions.includes(value) ? this.selectedOptions.filter((option) => option != value) : [...this.selectedOptions, value] : [value];
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Removes the last selected option.
|
|
207
|
+
*
|
|
208
|
+
* If multiple selection is enabled, remove the last selected option and the array will eventually become empty.
|
|
209
|
+
* If multiple selection is disabled, directly empty the selected options.
|
|
210
|
+
*/
|
|
211
|
+
_removeLastSelection() {
|
|
212
|
+
if (this.multiple) {
|
|
213
|
+
this.selectedOptions = this.selectedOptions.slice(0, -1);
|
|
214
|
+
this.value = this.selectedOptions.at(-1) ?? null;
|
|
215
|
+
} else {
|
|
216
|
+
this.selectedOptions = [];
|
|
217
|
+
this.value = null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
_handleClick() {
|
|
221
|
+
if (this.disabled) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
this.open = !this.open;
|
|
225
|
+
}
|
|
188
226
|
_handleKeyDown(event) {
|
|
227
|
+
if (!isSimpleKey.isSimpleKeyEvent(event)) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
189
230
|
const printableCharacter = event.key.trim().length === 1 ? event.key : null;
|
|
190
231
|
if (printableCharacter) {
|
|
191
232
|
event.preventDefault();
|
|
@@ -209,19 +250,12 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
209
250
|
break;
|
|
210
251
|
}
|
|
211
252
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (!target || !this._items.includes(target)) {
|
|
218
|
-
return;
|
|
253
|
+
_handleKeyDownEscape() {
|
|
254
|
+
if (this.open) {
|
|
255
|
+
this.open = false;
|
|
256
|
+
} else {
|
|
257
|
+
this._removeLastSelection();
|
|
219
258
|
}
|
|
220
|
-
this._hasSelectedItem = true;
|
|
221
|
-
this._selectedItemLabel = target.textContent ?? "";
|
|
222
|
-
this.value = target.value;
|
|
223
|
-
this.open = false;
|
|
224
|
-
this.dispatchEvent(new Event("change"));
|
|
225
259
|
}
|
|
226
260
|
/**
|
|
227
261
|
* Handle `focusin` event to remember last focused item.
|
|
@@ -243,14 +277,28 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
243
277
|
const item = items.find((item2) => item2 === this._lastFocusedItem) ?? items.find((item2) => item2.value === this.value) ?? items.at(0);
|
|
244
278
|
item == null ? void 0 : item.focus();
|
|
245
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Handle `select` event from `daikin-dropdown-item`.
|
|
282
|
+
*/
|
|
283
|
+
_handleSelect(event) {
|
|
284
|
+
this._handleSelectOption(event.target.value);
|
|
285
|
+
if (!this.multiple) {
|
|
286
|
+
this.open = false;
|
|
287
|
+
}
|
|
288
|
+
this.dispatchEvent(new Event("change"));
|
|
289
|
+
}
|
|
290
|
+
_handleSlotChange() {
|
|
291
|
+
this._updateItemsSelectable();
|
|
292
|
+
}
|
|
246
293
|
render() {
|
|
247
294
|
return lit.html`<div class="w-full relative" @keydown=${this._handleKeyDown}>
|
|
248
295
|
<button
|
|
296
|
+
${ref_js.ref(this._dropdownRef)}
|
|
249
297
|
type="button"
|
|
250
298
|
class=${cvaButton({
|
|
251
299
|
open: this.open,
|
|
252
300
|
error: this.error,
|
|
253
|
-
placeholder: !this.
|
|
301
|
+
placeholder: !this.selectedOptions.length
|
|
254
302
|
})}
|
|
255
303
|
?disabled=${this.disabled}
|
|
256
304
|
role="combobox"
|
|
@@ -263,18 +311,19 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
263
311
|
@click=${this._handleClick}
|
|
264
312
|
${this._autoUpdateController.refReference()}
|
|
265
313
|
>
|
|
266
|
-
${this.
|
|
314
|
+
${this.selectedOptions.length ? this.multiple && this.selectedOptions.length > (this.maxLabels ?? 0) ? `${this.selectedOptions.length} items selected` : this._selectionLabels.join(", ") : this.placeholder}
|
|
267
315
|
</button>
|
|
268
316
|
<div
|
|
269
317
|
id="dropdown-items"
|
|
270
318
|
popover
|
|
271
|
-
class="floating-unready:hidden absolute left-[--floating-x,0] top-[--floating-y,0] min-w-[--floating-width] max-h-[12.5rem] overflow-y-auto opacity-1 transition-[opacity] rounded
|
|
319
|
+
class="floating-unready:hidden absolute left-[--floating-x,0] top-[--floating-y,0] min-w-[--floating-width] max-h-[12.5rem] border border-ddt-color-divider overflow-y-auto opacity-1 transition-[opacity] rounded"
|
|
272
320
|
aria-label=${ifDefined_js.ifDefined(this._label ?? void 0)}
|
|
273
321
|
role="listbox"
|
|
274
322
|
@floating-ready=${this._handleFloatingReady}
|
|
275
323
|
${this._autoUpdateController.refFloating()}
|
|
276
324
|
>
|
|
277
325
|
<slot
|
|
326
|
+
@slotchange=${this._handleSlotChange}
|
|
278
327
|
@select=${this._handleSelect}
|
|
279
328
|
@focusin=${this._handleFocusIn}
|
|
280
329
|
></slot>
|
|
@@ -289,15 +338,37 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
289
338
|
this._clickOutsideController.directive(this.open && !this.disabled)}
|
|
290
339
|
</div>`;
|
|
291
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Focuses on the inner button.
|
|
343
|
+
* @param options focus options
|
|
344
|
+
*/
|
|
292
345
|
focus(options) {
|
|
293
346
|
var _a;
|
|
294
347
|
(_a = this._button) == null ? void 0 : _a.focus(options);
|
|
295
348
|
}
|
|
349
|
+
willUpdate(changedProperties) {
|
|
350
|
+
if (!this._initialUpdateCompleted) {
|
|
351
|
+
if (!!this.selectedOptions.length && (!this.value || !this.selectedOptions.includes(this.value))) {
|
|
352
|
+
this._updateValueBySelectedOptions();
|
|
353
|
+
} else if (!!this.value && !this.selectedOptions.length) {
|
|
354
|
+
this.selectedOptions = [this.value];
|
|
355
|
+
}
|
|
356
|
+
this._initialUpdateCompleted = true;
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const hasChangedValue = changedProperties.has("value");
|
|
360
|
+
const hasChangedSelectedOptions = changedProperties.has("selectedOptions");
|
|
361
|
+
if (hasChangedValue && !hasChangedSelectedOptions) {
|
|
362
|
+
this._updateSelectedOptionsByValue();
|
|
363
|
+
}
|
|
364
|
+
if (!hasChangedValue && hasChangedSelectedOptions) {
|
|
365
|
+
this._updateValueBySelectedOptions();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
296
368
|
updated(changedProperties) {
|
|
297
369
|
var _a;
|
|
298
370
|
if (changedProperties.has("value")) {
|
|
299
371
|
this._updateFormValue();
|
|
300
|
-
this._reflectItemsAndLabel();
|
|
301
372
|
}
|
|
302
373
|
if (changedProperties.has("open") || changedProperties.has("disabled")) {
|
|
303
374
|
(_a = this._autoUpdateController.floatingElement) == null ? void 0 : _a.togglePopover(
|
|
@@ -307,7 +378,20 @@ exports.DaikinDropdown = class DaikinDropdown extends lit.LitElement {
|
|
|
307
378
|
this.focus();
|
|
308
379
|
}
|
|
309
380
|
}
|
|
381
|
+
if (changedProperties.has("selectedOptions")) {
|
|
382
|
+
const items = this._items;
|
|
383
|
+
for (const item of items) {
|
|
384
|
+
item.selected = this.selectedOptions.includes(item.value);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (changedProperties.has("multiple")) {
|
|
388
|
+
this._updateItemsSelectable();
|
|
389
|
+
}
|
|
310
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
393
|
+
* @private
|
|
394
|
+
*/
|
|
311
395
|
reflectInputGroup(inputGroup) {
|
|
312
396
|
const isError = !inputGroup.disabled && !!inputGroup.error;
|
|
313
397
|
this.disabled = !!inputGroup.disabled;
|
|
@@ -347,6 +431,15 @@ __decorateClass([
|
|
|
347
431
|
__decorateClass([
|
|
348
432
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
349
433
|
], exports.DaikinDropdown.prototype, "open", 2);
|
|
434
|
+
__decorateClass([
|
|
435
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
436
|
+
], exports.DaikinDropdown.prototype, "multiple", 2);
|
|
437
|
+
__decorateClass([
|
|
438
|
+
decorators_js.property({ type: Array, attribute: false })
|
|
439
|
+
], exports.DaikinDropdown.prototype, "selectedOptions", 2);
|
|
440
|
+
__decorateClass([
|
|
441
|
+
decorators_js.property({ type: Number, reflect: true, attribute: "max-labels" })
|
|
442
|
+
], exports.DaikinDropdown.prototype, "maxLabels", 2);
|
|
350
443
|
__decorateClass([
|
|
351
444
|
decorators_js.queryAssignedElements({ selector: "daikin-dropdown-item" })
|
|
352
445
|
], exports.DaikinDropdown.prototype, "_items", 2);
|
|
@@ -356,12 +449,6 @@ __decorateClass([
|
|
|
356
449
|
__decorateClass([
|
|
357
450
|
decorators_js.state()
|
|
358
451
|
], exports.DaikinDropdown.prototype, "_label", 2);
|
|
359
|
-
__decorateClass([
|
|
360
|
-
decorators_js.state()
|
|
361
|
-
], exports.DaikinDropdown.prototype, "_hasSelectedItem", 2);
|
|
362
|
-
__decorateClass([
|
|
363
|
-
decorators_js.state()
|
|
364
|
-
], exports.DaikinDropdown.prototype, "_selectedItemLabel", 2);
|
|
365
452
|
exports.DaikinDropdown = __decorateClass([
|
|
366
|
-
|
|
453
|
+
decorators.ddsElement("daikin-dropdown")
|
|
367
454
|
], exports.DaikinDropdown);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSElement } from "../../base/index.cjs";
|
|
2
3
|
import { DaikinInputGroup } from "../input-group/index.cjs";
|
|
3
4
|
/**
|
|
4
5
|
* A dropdown list component.
|
|
@@ -13,6 +14,11 @@ import { DaikinInputGroup } from "../input-group/index.cjs";
|
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
*
|
|
17
|
+
* ```js
|
|
18
|
+
* import "@daikin-oss/design-system-web-components/components/dropdown/index.js";
|
|
19
|
+
* import "@daikin-oss/design-system-web-components/components/dropdown-item/index.js";
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
16
22
|
* ```html
|
|
17
23
|
* <daikin-dropdown label="Dropdown label">
|
|
18
24
|
* <daikin-dropdown-item value="value1">Dropdown item 1</daikin-dropdown-item>
|
|
@@ -21,13 +27,16 @@ import { DaikinInputGroup } from "../input-group/index.cjs";
|
|
|
21
27
|
* </daikin-dropdown>
|
|
22
28
|
* ```
|
|
23
29
|
*/
|
|
24
|
-
export declare class DaikinDropdown extends
|
|
30
|
+
export declare class DaikinDropdown extends DDSElement {
|
|
25
31
|
static readonly styles: import('lit').CSSResult;
|
|
26
32
|
static readonly formAssociated = true;
|
|
27
33
|
private _internals;
|
|
28
34
|
/**
|
|
29
35
|
* Form value of the dropdown.
|
|
30
36
|
* `null` if not selected.
|
|
37
|
+
*
|
|
38
|
+
* If `multiple` is `true`, please use `selectedOptions` instead.
|
|
39
|
+
* If multiple selection is enabled, the value set to this property will be one of the selected items, and it is not possible to predict which value will be set.
|
|
31
40
|
*/
|
|
32
41
|
value: string | null;
|
|
33
42
|
/**
|
|
@@ -50,6 +59,22 @@ export declare class DaikinDropdown extends LitElement {
|
|
|
50
59
|
* Whether the dropdown menu is opened.
|
|
51
60
|
*/
|
|
52
61
|
open: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the dropdown menu is supports multiple selections.
|
|
64
|
+
*/
|
|
65
|
+
multiple: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* An array of `value` s for the currently selected option.
|
|
68
|
+
*
|
|
69
|
+
* This can be used regardless of the value of `multiple`, but if `multiple` is `true`, always use this instead of `value`.
|
|
70
|
+
* If `multiple` is `false`, the second and subsequent items will be deleted.
|
|
71
|
+
*/
|
|
72
|
+
selectedOptions: string[];
|
|
73
|
+
/**
|
|
74
|
+
* Specifies the maximum number of items to display without omission in the label when `multiple` is `true`.
|
|
75
|
+
* Specify `null` to display all selected items without omission.
|
|
76
|
+
*/
|
|
77
|
+
maxLabels: number | null;
|
|
53
78
|
private readonly _items;
|
|
54
79
|
private _button;
|
|
55
80
|
/**
|
|
@@ -57,8 +82,8 @@ export declare class DaikinDropdown extends LitElement {
|
|
|
57
82
|
* Set automatically by `reflectInputGroup` method.
|
|
58
83
|
*/
|
|
59
84
|
private _label;
|
|
60
|
-
private
|
|
61
|
-
private
|
|
85
|
+
private get _selectionLabels();
|
|
86
|
+
private _initialUpdateCompleted;
|
|
62
87
|
private _autoUpdateController;
|
|
63
88
|
private _clickOutsideController;
|
|
64
89
|
/**
|
|
@@ -66,18 +91,32 @@ export declare class DaikinDropdown extends LitElement {
|
|
|
66
91
|
* The next time the dropdown opens, the focus will be moved to this element.
|
|
67
92
|
*/
|
|
68
93
|
private _lastFocusedItem;
|
|
69
|
-
private
|
|
94
|
+
private _dropdownRef;
|
|
70
95
|
private _onClickOutside;
|
|
71
|
-
private _reflectItemsAndLabel;
|
|
72
|
-
private _handleClick;
|
|
73
96
|
private _searchItem;
|
|
74
|
-
private _handleKeyDownEscape;
|
|
75
97
|
private _moveFocus;
|
|
76
|
-
private
|
|
98
|
+
private _updateFormValue;
|
|
99
|
+
private _updateItemsSelectable;
|
|
100
|
+
private _updateValueBySelectedOptions;
|
|
101
|
+
private _updateSelectedOptionsByValue;
|
|
77
102
|
/**
|
|
78
|
-
*
|
|
103
|
+
* Handling for when an option is selected.
|
|
104
|
+
* If multiple selection is enabled, the specified option is added to or removed from the array of selected options.
|
|
105
|
+
* If multiple selection is disabled, the current value is set to the specified option. The selection is not cleared.
|
|
106
|
+
*
|
|
107
|
+
* @param value The value of selected option.
|
|
79
108
|
*/
|
|
80
|
-
private
|
|
109
|
+
private _handleSelectOption;
|
|
110
|
+
/**
|
|
111
|
+
* Removes the last selected option.
|
|
112
|
+
*
|
|
113
|
+
* If multiple selection is enabled, remove the last selected option and the array will eventually become empty.
|
|
114
|
+
* If multiple selection is disabled, directly empty the selected options.
|
|
115
|
+
*/
|
|
116
|
+
private _removeLastSelection;
|
|
117
|
+
private _handleClick;
|
|
118
|
+
private _handleKeyDown;
|
|
119
|
+
private _handleKeyDownEscape;
|
|
81
120
|
/**
|
|
82
121
|
* Handle `focusin` event to remember last focused item.
|
|
83
122
|
*/
|
|
@@ -88,9 +127,23 @@ export declare class DaikinDropdown extends LitElement {
|
|
|
88
127
|
* Since the focus cannot be moved until the element is displayed on the screen, the focus is moved to the item after receiving the completion of the Floating UI position calculation here.
|
|
89
128
|
*/
|
|
90
129
|
private _handleFloatingReady;
|
|
130
|
+
/**
|
|
131
|
+
* Handle `select` event from `daikin-dropdown-item`.
|
|
132
|
+
*/
|
|
133
|
+
private _handleSelect;
|
|
134
|
+
private _handleSlotChange;
|
|
91
135
|
render(): import('lit-html').TemplateResult<1>;
|
|
136
|
+
/**
|
|
137
|
+
* Focuses on the inner button.
|
|
138
|
+
* @param options focus options
|
|
139
|
+
*/
|
|
92
140
|
focus(options?: FocusOptions): void;
|
|
141
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
93
142
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
143
|
+
/**
|
|
144
|
+
* This method is used by `daikin-input-group` to reflect it's attributes to this component.
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
94
147
|
reflectInputGroup(inputGroup: DaikinInputGroup): void;
|
|
95
148
|
}
|
|
96
149
|
declare global {
|