@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
package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const classVarianceAuthority = require("class-variance-authority");
|
|
4
|
+
const lit = require("lit");
|
|
5
|
+
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const ref_js = require("lit/directives/ref.js");
|
|
7
|
+
const ddsElement = require("../../base/dds-element.cjs");
|
|
8
|
+
const decorators = require("../../base/decorators.cjs");
|
|
9
|
+
require("../../base/define.cjs");
|
|
10
|
+
const tailwind = require("../../tailwind.css.cjs");
|
|
11
|
+
const notificationCommon = require("../../utils/notification-common.cjs");
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators2, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators2.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators2[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result) __defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
const CONTAINER_TRANSITION_DURATION = "--container-transition-duration";
|
|
23
|
+
const CONTAINER_MOVE_OFFSET_Y = "--container-move-offset-y";
|
|
24
|
+
const TOAST_MOVE_OFFSET_X = "24px";
|
|
25
|
+
const TOAST_MOVE_OFFSET_Y_TOP_SIGN = -1;
|
|
26
|
+
const TOAST_MOVE_OFFSET_Y_BOTTOM_SIGN = 1;
|
|
27
|
+
const cvaContainer = classVarianceAuthority.cva(
|
|
28
|
+
[
|
|
29
|
+
"flex",
|
|
30
|
+
"gap-2",
|
|
31
|
+
"w-max",
|
|
32
|
+
"fixed",
|
|
33
|
+
"transition-transform",
|
|
34
|
+
"translate-y-[var(--container-move-offset-y,0)]",
|
|
35
|
+
"duration-[var(--container-transition-duration,200ms)]"
|
|
36
|
+
],
|
|
37
|
+
{
|
|
38
|
+
variants: {
|
|
39
|
+
position: {
|
|
40
|
+
top: [
|
|
41
|
+
"items-center",
|
|
42
|
+
"flex-col",
|
|
43
|
+
"m-auto",
|
|
44
|
+
"top-4",
|
|
45
|
+
"left-0",
|
|
46
|
+
"right-0"
|
|
47
|
+
],
|
|
48
|
+
"top-left": ["items-start", "flex-col", "top-4", "left-4"],
|
|
49
|
+
"top-right": ["items-end", "flex-col", "top-4", "right-4"],
|
|
50
|
+
bottom: [
|
|
51
|
+
"items-center",
|
|
52
|
+
"flex-col-reverse",
|
|
53
|
+
"m-auto",
|
|
54
|
+
"bottom-4",
|
|
55
|
+
"left-0",
|
|
56
|
+
"right-0"
|
|
57
|
+
],
|
|
58
|
+
"bottom-left": [
|
|
59
|
+
"items-start",
|
|
60
|
+
"flex-col-reverse",
|
|
61
|
+
"bottom-4",
|
|
62
|
+
"left-4"
|
|
63
|
+
],
|
|
64
|
+
"bottom-right": [
|
|
65
|
+
"items-end",
|
|
66
|
+
"flex-col-reverse",
|
|
67
|
+
"bottom-4",
|
|
68
|
+
"right-4"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
exports.DaikinToastNotificationManager = class DaikinToastNotificationManager extends ddsElement.DDSElement {
|
|
75
|
+
constructor() {
|
|
76
|
+
super(...arguments);
|
|
77
|
+
this.position = "bottom-right";
|
|
78
|
+
this._knownItemSet = /* @__PURE__ */ new Set();
|
|
79
|
+
this._closedItemSet = /* @__PURE__ */ new WeakSet();
|
|
80
|
+
this._containerRef = ref_js.createRef();
|
|
81
|
+
}
|
|
82
|
+
get _positionY() {
|
|
83
|
+
return this.position.startsWith("top") ? "top" : "bottom";
|
|
84
|
+
}
|
|
85
|
+
get _sign() {
|
|
86
|
+
return this._positionY === "top" ? TOAST_MOVE_OFFSET_Y_TOP_SIGN : TOAST_MOVE_OFFSET_Y_BOTTOM_SIGN;
|
|
87
|
+
}
|
|
88
|
+
_close(target) {
|
|
89
|
+
if (this._closedItemSet.has(target)) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this._closedItemSet.add(target);
|
|
93
|
+
const items = this._items;
|
|
94
|
+
const targetIndex = items.findIndex((item) => item === target);
|
|
95
|
+
if (targetIndex === -1) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const moveOffsetY = `calc(${0.5 * this._sign}rem + ${target.clientHeight * this._sign}px)`;
|
|
99
|
+
for (const [index, item] of items.entries()) {
|
|
100
|
+
item.style.removeProperty("--transition-duration");
|
|
101
|
+
if (index > targetIndex) {
|
|
102
|
+
item.style.setProperty("--move-offset-y", moveOffsetY);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
target.style.setProperty("--move-offset-x", TOAST_MOVE_OFFSET_X);
|
|
106
|
+
target.style.setProperty("--opacity", "0");
|
|
107
|
+
target.style.setProperty("--pointer-events", "none");
|
|
108
|
+
setTimeout(() => {
|
|
109
|
+
for (const item of this._items) {
|
|
110
|
+
item.style.setProperty("--transition-duration", "0");
|
|
111
|
+
item.style.removeProperty("--move-offset-y");
|
|
112
|
+
}
|
|
113
|
+
target.hidden = true;
|
|
114
|
+
this.dispatchEvent(new CustomEvent("close", { detail: { target } }));
|
|
115
|
+
}, notificationCommon.TOAST_ANIMATION_DURATION);
|
|
116
|
+
}
|
|
117
|
+
_handleClose(event) {
|
|
118
|
+
event.stopPropagation();
|
|
119
|
+
this._close(event.target);
|
|
120
|
+
}
|
|
121
|
+
_handleNewItem(newItem) {
|
|
122
|
+
const container = this._containerRef.value;
|
|
123
|
+
if (!container) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
requestAnimationFrame(() => {
|
|
127
|
+
newItem.style.setProperty("--opacity", "0");
|
|
128
|
+
container.style.setProperty(CONTAINER_TRANSITION_DURATION, "0");
|
|
129
|
+
container.style.setProperty(
|
|
130
|
+
CONTAINER_MOVE_OFFSET_Y,
|
|
131
|
+
`calc(${0.5 * this._sign}rem + ${newItem.clientHeight * this._sign}px)`
|
|
132
|
+
);
|
|
133
|
+
requestAnimationFrame(() => {
|
|
134
|
+
container.style.removeProperty(CONTAINER_TRANSITION_DURATION);
|
|
135
|
+
container.style.removeProperty(CONTAINER_MOVE_OFFSET_Y);
|
|
136
|
+
newItem.style.removeProperty("--opacity");
|
|
137
|
+
this._scheduleRemoveToast(newItem);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
_handleSlotchange() {
|
|
142
|
+
const items = this._items;
|
|
143
|
+
const newItems = items.filter((item) => !this._knownItemSet.has(item));
|
|
144
|
+
this._knownItemSet = new Set(items);
|
|
145
|
+
for (const newItem of newItems) {
|
|
146
|
+
this._handleNewItem(newItem);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
_scheduleRemoveToast(target) {
|
|
150
|
+
if (target.duration === null) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
this._close(target);
|
|
155
|
+
}, target.duration);
|
|
156
|
+
}
|
|
157
|
+
render() {
|
|
158
|
+
return lit.html`<aside
|
|
159
|
+
${ref_js.ref(this._containerRef)}
|
|
160
|
+
class=${cvaContainer({ position: this.position })}
|
|
161
|
+
popover="manual"
|
|
162
|
+
>
|
|
163
|
+
<slot
|
|
164
|
+
@close=${this._handleClose}
|
|
165
|
+
@slotchange=${this._handleSlotchange}
|
|
166
|
+
></slot>
|
|
167
|
+
</aside>`;
|
|
168
|
+
}
|
|
169
|
+
firstUpdated() {
|
|
170
|
+
const container = this._containerRef.value;
|
|
171
|
+
if (container) {
|
|
172
|
+
container.showPopover();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
exports.DaikinToastNotificationManager.styles = lit.css`
|
|
177
|
+
${lit.unsafeCSS(tailwind.default)}
|
|
178
|
+
|
|
179
|
+
:host {
|
|
180
|
+
display: block;
|
|
181
|
+
width: max-content;
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
__decorateClass([
|
|
185
|
+
decorators_js.property({ type: String, reflect: true })
|
|
186
|
+
], exports.DaikinToastNotificationManager.prototype, "position", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
decorators_js.queryAssignedElements({ selector: "daikin-toast-notification" })
|
|
189
|
+
], exports.DaikinToastNotificationManager.prototype, "_items", 2);
|
|
190
|
+
exports.DaikinToastNotificationManager = __decorateClass([
|
|
191
|
+
decorators.ddsElement("daikin-toast-notification-manager")
|
|
192
|
+
], exports.DaikinToastNotificationManager);
|
package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DDSElement } from "../../base/index.cjs";
|
|
2
|
+
import { MergeVariantProps } from "../../type-utils.cjs";
|
|
3
|
+
declare const cvaContainer: (props?: ({
|
|
4
|
+
position?: "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export type ToastPosition = MergeVariantProps<typeof cvaContainer>["position"];
|
|
7
|
+
/**
|
|
8
|
+
* The toast manager component manages the position and display state of notification toasts.
|
|
9
|
+
* Just place a notification toast in the slot and it will automatically be placed, stacked and animated.
|
|
10
|
+
*
|
|
11
|
+
* Hierarchy:
|
|
12
|
+
* - `daikin-toast-notification-manager` > `daikin-toast-notification`
|
|
13
|
+
*
|
|
14
|
+
* @fires close - A custom event emitted when a user clicks the close button. The toast manager does not remove toast elements, so you will need to remove the relevant toast element after receiving this event.
|
|
15
|
+
*
|
|
16
|
+
* @slot A slot for toasts. Place `daikin-toast-notification` elements here.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```js
|
|
21
|
+
* import "@daikin-oss/design-system-web-components/components/toast-notification-manager/index.js";
|
|
22
|
+
* import "@daikin-oss/design-system-web-components/components/toast-notification/index.js";
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ```html
|
|
26
|
+
* <daikin-toast-notification-manager>
|
|
27
|
+
* <daikin-toast-notification name="toast1">
|
|
28
|
+
* <span slot="title">Toast title</span>
|
|
29
|
+
* <span slot="description">Toast description</span>
|
|
30
|
+
* </daikin-toast-notification>
|
|
31
|
+
* <daikin-toast-notification name="toast2">
|
|
32
|
+
* <span slot="title">Toast title</span>
|
|
33
|
+
* <span slot="description">Toast description</span>
|
|
34
|
+
* </daikin-toast-notification>
|
|
35
|
+
* <daikin-toast-notification name="toast3">
|
|
36
|
+
* <span slot="title">Toast title</span>
|
|
37
|
+
* <span slot="description">Toast description</span>
|
|
38
|
+
* </daikin-toast-notification>
|
|
39
|
+
* </daikin-toast-notification-manager>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class DaikinToastNotificationManager extends DDSElement {
|
|
43
|
+
static readonly styles: import('lit').CSSResult;
|
|
44
|
+
/**
|
|
45
|
+
* Specify where on the screen the toast will be displayed.
|
|
46
|
+
*/
|
|
47
|
+
position: ToastPosition;
|
|
48
|
+
private readonly _items;
|
|
49
|
+
private _knownItemSet;
|
|
50
|
+
private _closedItemSet;
|
|
51
|
+
private _containerRef;
|
|
52
|
+
private get _positionY();
|
|
53
|
+
private get _sign();
|
|
54
|
+
private _close;
|
|
55
|
+
private _handleClose;
|
|
56
|
+
private _handleNewItem;
|
|
57
|
+
private _handleSlotchange;
|
|
58
|
+
private _scheduleRemoveToast;
|
|
59
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
60
|
+
protected firstUpdated(): void;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
"daikin-toast-notification-manager": DaikinToastNotificationManager;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const daikinToastNotificationManager = require("./daikin-toast-notification-manager.cjs");
|
|
4
|
+
Object.defineProperty(exports, "DaikinToastNotificationManager", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: () => daikinToastNotificationManager.DaikinToastNotificationManager
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./daikin-toast-notification-manager.cjs";
|
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const classVarianceAuthority = require("class-variance-authority");
|
|
4
4
|
const lit = require("lit");
|
|
5
5
|
const decorators_js = require("lit/decorators.js");
|
|
6
|
+
const ddsElement = require("../../base/dds-element.cjs");
|
|
7
|
+
const decorators = require("../../base/decorators.cjs");
|
|
8
|
+
require("../../base/define.cjs");
|
|
6
9
|
const tailwind = require("../../tailwind.css.cjs");
|
|
7
10
|
var __defProp = Object.defineProperty;
|
|
8
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __decorateClass = (
|
|
12
|
+
var __decorateClass = (decorators2, target, key, kind) => {
|
|
10
13
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
-
for (var i =
|
|
12
|
-
if (decorator =
|
|
14
|
+
for (var i = decorators2.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators2[i])
|
|
13
16
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
17
|
if (kind && result) __defProp(target, key, result);
|
|
15
18
|
return result;
|
|
@@ -48,7 +51,7 @@ const TOGGLE_CLASS_NAME = classVarianceAuthority.cva([
|
|
|
48
51
|
"enabled:before:bg-ddt-color-common-background-default",
|
|
49
52
|
"disabled:before:bg-ddt-color-common-surface-hover"
|
|
50
53
|
])();
|
|
51
|
-
exports.DaikinToggle = class DaikinToggle extends
|
|
54
|
+
exports.DaikinToggle = class DaikinToggle extends ddsElement.DDSElement {
|
|
52
55
|
constructor() {
|
|
53
56
|
super(...arguments);
|
|
54
57
|
this.name = "";
|
|
@@ -104,5 +107,5 @@ __decorateClass([
|
|
|
104
107
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
105
108
|
], exports.DaikinToggle.prototype, "disabled", 2);
|
|
106
109
|
exports.DaikinToggle = __decorateClass([
|
|
107
|
-
|
|
110
|
+
decorators.ddsElement("daikin-toggle")
|
|
108
111
|
], exports.DaikinToggle);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSElement } from "../../base/index.cjs";
|
|
2
3
|
/**
|
|
3
4
|
* The toggle switch component is a UI element that allows users to switch between two states, typically "on" and "off".
|
|
4
5
|
* It functions similarly to a `daikin-checkbox` component but provides a more visually intuitive way to represent binary options.
|
|
@@ -17,7 +18,7 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
17
18
|
* <daikin-toggle name="name" value="value"></daikin-toggle>
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
export declare class DaikinToggle extends
|
|
21
|
+
export declare class DaikinToggle extends DDSElement {
|
|
21
22
|
static readonly styles: import('lit').CSSResult;
|
|
22
23
|
/**
|
|
23
24
|
* The form name, submitted as a name/value pair when submitting the form.
|
|
@@ -5,54 +5,60 @@ const classVarianceAuthority = require("class-variance-authority");
|
|
|
5
5
|
const lit = require("lit");
|
|
6
6
|
const decorators_js = require("lit/decorators.js");
|
|
7
7
|
const guard_js = require("lit/directives/guard.js");
|
|
8
|
+
const ddsElement = require("../../base/dds-element.cjs");
|
|
9
|
+
const decorators = require("../../base/decorators.cjs");
|
|
10
|
+
require("../../base/define.cjs");
|
|
8
11
|
const floatingUiAutoUpdate = require("../../controllers/floating-ui-auto-update.cjs");
|
|
9
12
|
const isClient = require("../../is-client.cjs");
|
|
10
13
|
const tailwind = require("../../tailwind.css.cjs");
|
|
11
14
|
const reDispatch = require("../../utils/re-dispatch.cjs");
|
|
12
15
|
var __defProp = Object.defineProperty;
|
|
13
16
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
-
var __decorateClass = (
|
|
17
|
+
var __decorateClass = (decorators2, target, key, kind) => {
|
|
15
18
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
-
for (var i =
|
|
17
|
-
if (decorator =
|
|
19
|
+
for (var i = decorators2.length - 1, decorator; i >= 0; i--)
|
|
20
|
+
if (decorator = decorators2[i])
|
|
18
21
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
22
|
if (kind && result) __defProp(target, key, result);
|
|
20
23
|
return result;
|
|
21
24
|
};
|
|
22
25
|
const cvaTooltip = classVarianceAuthority.cva(
|
|
23
26
|
[
|
|
24
|
-
"floating-unready:hidden",
|
|
25
|
-
"absolute",
|
|
26
27
|
"left-[--floating-x,0]",
|
|
27
28
|
"top-[--floating-y,0]",
|
|
28
|
-
"justify-center",
|
|
29
|
-
"items-center",
|
|
30
29
|
"w-max",
|
|
31
|
-
"
|
|
30
|
+
"text-sm",
|
|
31
|
+
"p-2",
|
|
32
|
+
"leading-[130%]",
|
|
32
33
|
"border",
|
|
33
|
-
"border-solid",
|
|
34
34
|
"rounded",
|
|
35
|
-
"text-sm",
|
|
36
35
|
"font-daikinSerif",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"leading-5"
|
|
36
|
+
"absolute",
|
|
37
|
+
"floating-unready:hidden"
|
|
40
38
|
],
|
|
41
39
|
{
|
|
42
40
|
variants: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
color: {
|
|
42
|
+
default: [
|
|
43
|
+
"text-ddt-color-common-text-primary",
|
|
44
|
+
"bg-ddt-color-common-background-default",
|
|
45
|
+
"border-ddt-color-common-neutral-default"
|
|
46
|
+
],
|
|
47
|
+
inverse: [
|
|
48
|
+
"text-ddt-color-common-text-inverse",
|
|
49
|
+
"bg-ddt-color-common-surface-inverse",
|
|
50
|
+
"border-transparent"
|
|
51
|
+
]
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
}
|
|
49
55
|
);
|
|
50
56
|
const DEFAULT_TOOLTIP_SPACING = "20px";
|
|
51
|
-
exports.DaikinTooltip = class DaikinTooltip extends
|
|
57
|
+
exports.DaikinTooltip = class DaikinTooltip extends ddsElement.DDSElement {
|
|
52
58
|
constructor() {
|
|
53
59
|
super(...arguments);
|
|
54
60
|
this.placement = "bottom";
|
|
55
|
-
this.
|
|
61
|
+
this.color = "default";
|
|
56
62
|
this.open = false;
|
|
57
63
|
this.description = "";
|
|
58
64
|
this.popoverValue = "auto";
|
|
@@ -77,6 +83,12 @@ exports.DaikinTooltip = class DaikinTooltip extends lit.LitElement {
|
|
|
77
83
|
this.open = !this.open;
|
|
78
84
|
}
|
|
79
85
|
}
|
|
86
|
+
_handleFocusIn() {
|
|
87
|
+
this.open = true;
|
|
88
|
+
}
|
|
89
|
+
_handleFocusOut() {
|
|
90
|
+
this.open = false;
|
|
91
|
+
}
|
|
80
92
|
_handleMouseEnter() {
|
|
81
93
|
if (this.trigger === "hover") {
|
|
82
94
|
this.open = true;
|
|
@@ -87,11 +99,8 @@ exports.DaikinTooltip = class DaikinTooltip extends lit.LitElement {
|
|
|
87
99
|
this.open = false;
|
|
88
100
|
}
|
|
89
101
|
}
|
|
90
|
-
|
|
91
|
-
this
|
|
92
|
-
}
|
|
93
|
-
_handleFocusOut() {
|
|
94
|
-
this.open = false;
|
|
102
|
+
_handleBeforeToggle(event) {
|
|
103
|
+
reDispatch.reDispatch(this, event, new ToggleEvent("beforetoggle", event));
|
|
95
104
|
}
|
|
96
105
|
_handleToggle(event) {
|
|
97
106
|
if (reDispatch.reDispatch(this, event, new ToggleEvent("toggle", event))) {
|
|
@@ -104,7 +113,9 @@ exports.DaikinTooltip = class DaikinTooltip extends lit.LitElement {
|
|
|
104
113
|
((_a = this._hostStyles) == null ? void 0 : _a.getPropertyValue("--ddc-tooltip-spacing")) || DEFAULT_TOOLTIP_SPACING,
|
|
105
114
|
10
|
|
106
115
|
);
|
|
107
|
-
return lit.html`<div
|
|
116
|
+
return lit.html`<div
|
|
117
|
+
class="relative inline-block text-ddt-color-common-text-primary font-daikinSerif"
|
|
118
|
+
>
|
|
108
119
|
<div
|
|
109
120
|
id="trigger"
|
|
110
121
|
aria-labelledby="trigger"
|
|
@@ -113,19 +124,20 @@ exports.DaikinTooltip = class DaikinTooltip extends lit.LitElement {
|
|
|
113
124
|
>
|
|
114
125
|
<slot
|
|
115
126
|
@click=${this._handleClick}
|
|
116
|
-
@mouseenter=${this._handleMouseEnter}
|
|
117
|
-
@mouseleave=${this._handleMouseLeave}
|
|
118
127
|
@focusin=${this._handleFocusIn}
|
|
119
128
|
@focusout=${this._handleFocusOut}
|
|
129
|
+
@mouseenter=${this._handleMouseEnter}
|
|
130
|
+
@mouseleave=${this._handleMouseLeave}
|
|
120
131
|
></slot>
|
|
121
132
|
</div>
|
|
122
133
|
<span
|
|
123
134
|
id="tooltip"
|
|
124
135
|
role="tooltip"
|
|
125
136
|
aria-labelledby="tooltip"
|
|
126
|
-
|
|
137
|
+
part="tooltip"
|
|
138
|
+
class=${cvaTooltip({ color: this.color })}
|
|
127
139
|
popover=${this.popoverValue}
|
|
128
|
-
@beforetoggle=${
|
|
140
|
+
@beforetoggle=${this._handleBeforeToggle}
|
|
129
141
|
@toggle=${this._handleToggle}
|
|
130
142
|
${this._autoUpdateController.refFloating()}
|
|
131
143
|
>
|
|
@@ -168,7 +180,7 @@ __decorateClass([
|
|
|
168
180
|
], exports.DaikinTooltip.prototype, "placement", 2);
|
|
169
181
|
__decorateClass([
|
|
170
182
|
decorators_js.property({ type: String, reflect: true })
|
|
171
|
-
], exports.DaikinTooltip.prototype, "
|
|
183
|
+
], exports.DaikinTooltip.prototype, "color", 2);
|
|
172
184
|
__decorateClass([
|
|
173
185
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
174
186
|
], exports.DaikinTooltip.prototype, "open", 2);
|
|
@@ -182,6 +194,6 @@ __decorateClass([
|
|
|
182
194
|
decorators_js.property({ type: String, reflect: true })
|
|
183
195
|
], exports.DaikinTooltip.prototype, "trigger", 2);
|
|
184
196
|
exports.DaikinTooltip = __decorateClass([
|
|
185
|
-
|
|
197
|
+
decorators.ddsElement("daikin-tooltip")
|
|
186
198
|
], exports.DaikinTooltip);
|
|
187
199
|
exports.DaikinTooltip.registerCSSCustomProperties();
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { DDSElement } from "../../base/index.cjs";
|
|
3
|
+
import { MergeVariantProps } from "../../type-utils.cjs";
|
|
4
|
+
declare const cvaTooltip: (props?: ({
|
|
5
|
+
color?: "default" | "inverse" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
type TooltipVariantProps = MergeVariantProps<typeof cvaTooltip>;
|
|
2
8
|
/**
|
|
3
9
|
* A tooltip component is used to show brief information when a user interacts with an element.
|
|
4
10
|
*
|
|
@@ -8,7 +14,9 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
8
14
|
* @slot - A slot for the element to which the tooltip is attached (the trigger element).
|
|
9
15
|
* @slot description - A slot for the tooltip description content.
|
|
10
16
|
*
|
|
11
|
-
* @cssprop [--ddc-tooltip-spacing=20px] - Spacing between the tooltip and the trigger
|
|
17
|
+
* @cssprop [--ddc-tooltip-spacing=20px] - Spacing between the tooltip and the trigger.
|
|
18
|
+
*
|
|
19
|
+
* @csspart tooltip - Change the style of tooltips.
|
|
12
20
|
*
|
|
13
21
|
* @example
|
|
14
22
|
*
|
|
@@ -29,7 +37,7 @@ import { LitElement, PropertyValues } from 'lit';
|
|
|
29
37
|
* </daikin-tooltip>
|
|
30
38
|
* ```
|
|
31
39
|
*/
|
|
32
|
-
export declare class DaikinTooltip extends
|
|
40
|
+
export declare class DaikinTooltip extends DDSElement {
|
|
33
41
|
static registerCSSCustomProperties(): void;
|
|
34
42
|
static readonly styles: import('lit').CSSResult;
|
|
35
43
|
/**
|
|
@@ -39,7 +47,7 @@ export declare class DaikinTooltip extends LitElement {
|
|
|
39
47
|
/**
|
|
40
48
|
* Specifies the tooltip theme.
|
|
41
49
|
*/
|
|
42
|
-
|
|
50
|
+
color: TooltipVariantProps["color"];
|
|
43
51
|
/**
|
|
44
52
|
* Whether the tooltip is open.
|
|
45
53
|
*/
|
|
@@ -65,10 +73,11 @@ export declare class DaikinTooltip extends LitElement {
|
|
|
65
73
|
private _autoUpdateController;
|
|
66
74
|
private _hostStyles;
|
|
67
75
|
private _handleClick;
|
|
68
|
-
private _handleMouseEnter;
|
|
69
|
-
private _handleMouseLeave;
|
|
70
76
|
private _handleFocusIn;
|
|
71
77
|
private _handleFocusOut;
|
|
78
|
+
private _handleMouseEnter;
|
|
79
|
+
private _handleMouseLeave;
|
|
80
|
+
private _handleBeforeToggle;
|
|
72
81
|
private _handleToggle;
|
|
73
82
|
render(): import('lit-html').TemplateResult<1>;
|
|
74
83
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
@@ -78,3 +87,4 @@ declare global {
|
|
|
78
87
|
"daikin-tooltip": DaikinTooltip;
|
|
79
88
|
}
|
|
80
89
|
}
|
|
90
|
+
export {};
|
|
@@ -2,53 +2,56 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const lit = require("lit");
|
|
4
4
|
const decorators_js = require("lit/decorators.js");
|
|
5
|
+
const ddsElement = require("../../base/dds-element.cjs");
|
|
6
|
+
const decorators = require("../../base/decorators.cjs");
|
|
7
|
+
require("../../base/define.cjs");
|
|
5
8
|
const tailwind = require("../../tailwind.css.cjs");
|
|
6
9
|
const common = require("./common.cjs");
|
|
7
10
|
var __defProp = Object.defineProperty;
|
|
8
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __decorateClass = (
|
|
12
|
+
var __decorateClass = (decorators2, target, key, kind) => {
|
|
10
13
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
-
for (var i =
|
|
12
|
-
if (decorator =
|
|
14
|
+
for (var i = decorators2.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators2[i])
|
|
13
16
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
17
|
if (kind && result) __defProp(target, key, result);
|
|
15
18
|
return result;
|
|
16
19
|
};
|
|
17
|
-
exports.DaikinTree = class DaikinTree extends
|
|
20
|
+
exports.DaikinTree = class DaikinTree extends ddsElement.DDSElement {
|
|
18
21
|
constructor() {
|
|
19
22
|
super(...arguments);
|
|
20
23
|
this.selectable = false;
|
|
21
|
-
this.
|
|
24
|
+
this.selectedItems = [];
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this._sections.forEach((section) => {
|
|
28
|
-
section.selectable = this.selectable;
|
|
29
|
-
});
|
|
26
|
+
_handleMouseDown(event) {
|
|
27
|
+
if (event.detail >= 2) {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
}
|
|
30
30
|
}
|
|
31
31
|
_handleSlotChange() {
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
32
|
+
this._children.forEach((child) => child.level = 0);
|
|
33
|
+
this.selectItems(this.selectedItems);
|
|
34
34
|
}
|
|
35
35
|
_handleTreeMoveFocus(event) {
|
|
36
36
|
common.handleTreeMoveFocusRoot(event, this._children);
|
|
37
37
|
}
|
|
38
38
|
_handleTreeSelect(event) {
|
|
39
|
-
event.stopPropagation();
|
|
40
39
|
if (!this.selectable) {
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
42
|
+
event.stopPropagation();
|
|
43
43
|
const target = event.target;
|
|
44
|
-
this.
|
|
44
|
+
this.selectedItems = [target.value];
|
|
45
45
|
}
|
|
46
46
|
_handleTreeUnselect(event) {
|
|
47
|
+
if (!this.selectable) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
47
50
|
event.stopPropagation();
|
|
48
|
-
this.
|
|
51
|
+
this.selectedItems = this.getSelectedItems();
|
|
49
52
|
}
|
|
50
53
|
render() {
|
|
51
|
-
return lit.html`<div role="tree">
|
|
54
|
+
return lit.html`<div role="tree" @mousedown=${this._handleMouseDown}>
|
|
52
55
|
<slot
|
|
53
56
|
@slotchange=${this._handleSlotChange}
|
|
54
57
|
@tree-move-focus=${this._handleTreeMoveFocus}
|
|
@@ -58,31 +61,30 @@ exports.DaikinTree = class DaikinTree extends lit.LitElement {
|
|
|
58
61
|
</div>`;
|
|
59
62
|
}
|
|
60
63
|
updated(changedProperties) {
|
|
61
|
-
if (changedProperties.has("
|
|
62
|
-
this.
|
|
63
|
-
}
|
|
64
|
-
if (changedProperties.has("selected") && this.selectable) {
|
|
65
|
-
this.selectItem(this.selected);
|
|
64
|
+
if (changedProperties.has("selectedItems")) {
|
|
65
|
+
this.selectItems(this.selectedItems);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* Calls `
|
|
69
|
+
* Calls `selectItems` for the tree sections and tree items of the child elements in the slot.
|
|
70
70
|
*
|
|
71
71
|
* @param value Tree item value.
|
|
72
72
|
* @private
|
|
73
73
|
*/
|
|
74
|
-
|
|
75
|
-
this._children.forEach((child) => child.
|
|
74
|
+
selectItems(values) {
|
|
75
|
+
this._children.forEach((child) => child.selectItems(values));
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* Returns the `value` of the currently selected
|
|
79
|
-
* If nothing is selected, returns `
|
|
78
|
+
* Returns an array of the `value` of the currently selected sections and items.
|
|
79
|
+
* If nothing is selected, returns `[]`.
|
|
80
80
|
*
|
|
81
|
-
* @returns
|
|
81
|
+
* @returns An array of the `value` of the selected sections and items (if any). `[]` if there is none.
|
|
82
82
|
* @private
|
|
83
83
|
*/
|
|
84
|
-
|
|
85
|
-
return
|
|
84
|
+
getSelectedItems() {
|
|
85
|
+
return Array.from(
|
|
86
|
+
new Set(this._children.flatMap((child) => child.getSelectedItems()))
|
|
87
|
+
);
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
exports.DaikinTree.styles = lit.css`
|
|
@@ -96,14 +98,11 @@ __decorateClass([
|
|
|
96
98
|
decorators_js.property({ type: Boolean, reflect: true })
|
|
97
99
|
], exports.DaikinTree.prototype, "selectable", 2);
|
|
98
100
|
__decorateClass([
|
|
99
|
-
decorators_js.property({ type:
|
|
100
|
-
], exports.DaikinTree.prototype, "
|
|
101
|
+
decorators_js.property({ type: Array, attribute: false })
|
|
102
|
+
], exports.DaikinTree.prototype, "selectedItems", 2);
|
|
101
103
|
__decorateClass([
|
|
102
104
|
decorators_js.queryAssignedElements({ selector: "daikin-tree-section,daikin-tree-item" })
|
|
103
105
|
], exports.DaikinTree.prototype, "_children", 2);
|
|
104
|
-
__decorateClass([
|
|
105
|
-
decorators_js.queryAssignedElements({ selector: "daikin-tree-section" })
|
|
106
|
-
], exports.DaikinTree.prototype, "_sections", 2);
|
|
107
106
|
exports.DaikinTree = __decorateClass([
|
|
108
|
-
|
|
107
|
+
decorators.ddsElement("daikin-tree")
|
|
109
108
|
], exports.DaikinTree);
|