@daikin-oss/design-system-web-components 1.1.0 → 1.3.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -0
- package/LICENSE +1 -1
- package/dist/cjs/base/dds-element.cjs +1 -1
- package/dist/cjs/base/dds-form-element.cjs +139 -0
- package/dist/cjs/base/dds-form-element.d.cts +100 -0
- package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +7 -3
- package/dist/cjs/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs/components/avatar/daikin-avatar.d.cts +3 -0
- package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs/components/button/daikin-button.cjs +35 -13
- package/dist/cjs/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs/components/calendar/daikin-calendar.cjs +549 -0
- package/dist/cjs/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs/components/calendar/index.cjs +7 -0
- package/dist/cjs/components/calendar/index.d.cts +1 -0
- package/dist/cjs/components/card/daikin-card.cjs +1 -1
- package/dist/cjs/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +9 -12
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs/components/chip/index.cjs +7 -0
- package/dist/cjs/components/chip/index.d.cts +1 -0
- package/dist/cjs/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs/components/combobox/index.cjs +8 -0
- package/dist/cjs/components/combobox/index.d.cts +1 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.cjs +626 -0
- package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +106 -0
- package/dist/cjs/components/date-picker/index.cjs +7 -0
- package/dist/cjs/components/date-picker/index.d.cts +1 -0
- package/dist/cjs/components/dropdown/daikin-dropdown.cjs +91 -57
- package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs/components/icon/daikin-icon.cjs +117 -12
- package/dist/cjs/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs/components/icon/icons.json.cjs +6 -2
- package/dist/cjs/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs/components/index.cjs +81 -0
- package/dist/cjs/components/index.d.cts +14 -0
- package/dist/cjs/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs/components/input-group/daikin-input-group.d.cts +50 -1
- package/dist/cjs/components/list/daikin-list.cjs +75 -3
- package/dist/cjs/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs/components/list-item/daikin-list-item.cjs +27 -7
- package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs/components/loading/daikin-loading.d.cts +1 -0
- package/dist/cjs/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs/components/logo/index.cjs +7 -0
- package/dist/cjs/components/logo/index.d.cts +1 -0
- package/dist/cjs/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs/components/menu/index.cjs +7 -0
- package/dist/cjs/components/menu/index.d.cts +1 -0
- package/dist/cjs/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs/components/modal/index.cjs +7 -0
- package/dist/cjs/components/modal/index.d.cts +1 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs/components/modal-footer/index.cjs +7 -0
- package/dist/cjs/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs/components/modal-header/index.cjs +7 -0
- package/dist/cjs/components/modal-header/index.d.cts +1 -0
- package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +5 -5
- package/dist/cjs/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs/components/select/daikin-select.cjs +6 -1
- package/dist/cjs/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs/components/slider/index.cjs +7 -0
- package/dist/cjs/components/slider/index.d.cts +1 -0
- package/dist/cjs/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs/components/table/daikin-table.cjs +74 -15
- package/dist/cjs/components/table/daikin-table.d.cts +72 -34
- package/dist/cjs/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +8 -1
- package/dist/cjs/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs/components/text-field/daikin-text-field.cjs +289 -57
- package/dist/cjs/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs/components/text-field/number-utils.cjs +61 -0
- package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
- package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs/components/time-picker/index.cjs +17 -0
- package/dist/cjs/components/time-picker/index.d.cts +1 -0
- package/dist/cjs/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs/components/tooltip/daikin-tooltip.cjs +24 -8
- package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +11 -3
- package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs/controllers/click-outside.cjs +3 -1
- package/dist/cjs/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs/controllers/focus-trap.cjs +42 -0
- package/dist/cjs/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs/icon-registry.cjs +170 -0
- package/dist/cjs/icon-registry.d.cts +120 -0
- package/dist/cjs/index.cjs +84 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/tailwind.css.cjs +1 -1
- package/dist/cjs/utils/calendar-common.cjs +151 -0
- package/dist/cjs/utils/calendar-common.d.cts +64 -0
- package/dist/cjs/utils/notification-common.cjs +19 -15
- package/dist/cjs/utils/notification-common.d.cts +2 -2
- package/dist/cjs/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/cjs-dev/base/dds-element.cjs +1 -1
- package/dist/cjs-dev/base/dds-form-element.cjs +139 -0
- package/dist/cjs-dev/base/dds-form-element.d.cts +100 -0
- package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +7 -3
- package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
- package/dist/cjs-dev/components/avatar/daikin-avatar.d.cts +3 -0
- package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +2 -0
- package/dist/cjs-dev/components/button/daikin-button.cjs +35 -13
- package/dist/cjs-dev/components/button/daikin-button.d.cts +20 -10
- package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +560 -0
- package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +87 -0
- package/dist/cjs-dev/components/calendar/index.cjs +7 -0
- package/dist/cjs-dev/components/calendar/index.d.cts +1 -0
- package/dist/cjs-dev/components/card/daikin-card.cjs +1 -1
- package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +1 -1
- package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
- package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +12 -16
- package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +9 -12
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +94 -0
- package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.d.cts +69 -0
- package/dist/cjs-dev/components/checkbox-group/index.cjs +7 -0
- package/dist/cjs-dev/components/checkbox-group/index.d.cts +1 -0
- package/dist/cjs-dev/components/chip/daikin-chip.cjs +106 -0
- package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
- package/dist/cjs-dev/components/chip/index.cjs +7 -0
- package/dist/cjs-dev/components/chip/index.d.cts +1 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
- package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
- package/dist/cjs-dev/components/combobox/index.cjs +8 -0
- package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +637 -0
- package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +106 -0
- package/dist/cjs-dev/components/date-picker/index.cjs +7 -0
- package/dist/cjs-dev/components/date-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +91 -57
- package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +7 -15
- package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
- package/dist/cjs-dev/components/icon/daikin-icon.d.cts +129 -9
- package/dist/cjs-dev/components/icon/icons.json.cjs +6 -2
- package/dist/cjs-dev/components/icon/icons.json.d.cts +16 -16
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +30 -4
- package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +20 -2
- package/dist/cjs-dev/components/index.cjs +81 -0
- package/dist/cjs-dev/components/index.d.cts +14 -0
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.cjs +13 -18
- package/dist/cjs-dev/components/inline-notification/daikin-inline-notification.d.cts +3 -1
- package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +4 -4
- package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +50 -1
- package/dist/cjs-dev/components/list/daikin-list.cjs +75 -3
- package/dist/cjs-dev/components/list/daikin-list.d.cts +16 -0
- package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +27 -7
- package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -3
- package/dist/cjs-dev/components/loading/daikin-loading.cjs +1 -1
- package/dist/cjs-dev/components/loading/daikin-loading.d.cts +1 -0
- package/dist/cjs-dev/components/logo/daikin-logo.cjs +105 -0
- package/dist/cjs-dev/components/logo/daikin-logo.d.cts +54 -0
- package/dist/cjs-dev/components/logo/index.cjs +7 -0
- package/dist/cjs-dev/components/logo/index.d.cts +1 -0
- package/dist/cjs-dev/components/menu/daikin-menu.cjs +205 -0
- package/dist/cjs-dev/components/menu/daikin-menu.d.cts +89 -0
- package/dist/cjs-dev/components/menu/index.cjs +7 -0
- package/dist/cjs-dev/components/menu/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal/daikin-modal.cjs +115 -0
- package/dist/cjs-dev/components/modal/daikin-modal.d.cts +61 -0
- package/dist/cjs-dev/components/modal/index.cjs +7 -0
- package/dist/cjs-dev/components/modal/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.cjs +40 -0
- package/dist/cjs-dev/components/modal-footer/daikin-modal-footer.d.cts +33 -0
- package/dist/cjs-dev/components/modal-footer/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-footer/index.d.cts +1 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +96 -0
- package/dist/cjs-dev/components/modal-header/daikin-modal-header.d.cts +43 -0
- package/dist/cjs-dev/components/modal-header/index.cjs +7 -0
- package/dist/cjs-dev/components/modal-header/index.d.cts +1 -0
- package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +5 -5
- package/dist/cjs-dev/components/progress-indicator-item/daikin-progress-indicator-item.cjs +1 -1
- package/dist/cjs-dev/components/radio/daikin-radio.cjs +4 -13
- package/dist/cjs-dev/components/radio/daikin-radio.d.cts +2 -12
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +1 -1
- package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +2 -1
- package/dist/cjs-dev/components/select/daikin-select.cjs +6 -1
- package/dist/cjs-dev/components/slider/daikin-slider.cjs +263 -0
- package/dist/cjs-dev/components/slider/daikin-slider.d.cts +67 -0
- package/dist/cjs-dev/components/slider/index.cjs +7 -0
- package/dist/cjs-dev/components/slider/index.d.cts +1 -0
- package/dist/cjs-dev/components/slider/slider-utils.cjs +57 -0
- package/dist/cjs-dev/components/slider/slider-utils.d.cts +37 -0
- package/dist/cjs-dev/components/tab/daikin-tab.cjs +1 -0
- package/dist/cjs-dev/components/table/daikin-table.cjs +77 -18
- package/dist/cjs-dev/components/table/daikin-table.d.cts +72 -34
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +2 -1
- package/dist/cjs-dev/components/table-cell/daikin-table-cell.d.cts +1 -1
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
- package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +8 -1
- package/dist/cjs-dev/components/tabs/daikin-tabs.cjs +2 -2
- package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +4 -13
- package/dist/cjs-dev/components/text-area/daikin-text-area.d.cts +2 -12
- package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +289 -57
- package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +57 -18
- package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
- package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
- package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
- package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
- package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
- package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
- package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
- package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.cjs +10 -7
- package/dist/cjs-dev/components/toast-notification/daikin-toast-notification.d.cts +2 -0
- package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
- package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +4 -13
- package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +2 -12
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +24 -8
- package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +11 -3
- package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +2 -0
- package/dist/cjs-dev/controllers/click-outside.cjs +3 -1
- package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +22 -4
- package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
- package/dist/cjs-dev/controllers/focus-trap.cjs +42 -0
- package/dist/cjs-dev/controllers/focus-trap.d.cts +10 -0
- package/dist/cjs-dev/icon-registry.cjs +170 -0
- package/dist/cjs-dev/icon-registry.d.cts +120 -0
- package/dist/cjs-dev/index.cjs +84 -0
- package/dist/cjs-dev/index.d.cts +1 -0
- package/dist/cjs-dev/tailwind.css.cjs +1 -1
- package/dist/cjs-dev/utils/calendar-common.cjs +151 -0
- package/dist/cjs-dev/utils/calendar-common.d.cts +64 -0
- package/dist/cjs-dev/utils/notification-common.cjs +19 -15
- package/dist/cjs-dev/utils/notification-common.d.cts +2 -2
- package/dist/cjs-dev/{components/tabs → utils}/scroller.cjs +20 -12
- package/dist/cjs-dev/{components/tabs → utils}/scroller.d.cts +2 -2
- package/dist/es/base/dds-element.js +1 -1
- package/dist/es/base/dds-form-element.d.ts +100 -0
- package/dist/es/base/dds-form-element.js +139 -0
- package/dist/es/components/accordion/daikin-accordion.js +1 -1
- package/dist/es/components/accordion-item/daikin-accordion-item.js +8 -4
- package/dist/es/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es/components/avatar/daikin-avatar.js +2 -1
- package/dist/es/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es/components/button/daikin-button.d.ts +20 -10
- package/dist/es/components/button/daikin-button.js +36 -14
- package/dist/es/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es/components/calendar/daikin-calendar.js +550 -0
- package/dist/es/components/calendar/index.d.ts +1 -0
- package/dist/es/components/calendar/index.js +4 -0
- package/dist/es/components/card/daikin-card.js +2 -2
- package/dist/es/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es/components/card-header/daikin-card-header.js +2 -2
- package/dist/es/components/carousel/daikin-carousel.js +8 -4
- package/dist/es/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es/components/checkbox/daikin-checkbox.js +13 -17
- package/dist/es/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es/components/checkbox-group/index.d.ts +1 -0
- package/dist/es/components/checkbox-group/index.js +4 -0
- package/dist/es/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es/components/chip/daikin-chip.js +107 -0
- package/dist/es/components/chip/index.d.ts +1 -0
- package/dist/es/components/chip/index.js +4 -0
- package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es/components/combobox/daikin-combobox.js +605 -0
- package/dist/es/components/combobox/index.d.ts +1 -0
- package/dist/es/components/combobox/index.js +5 -0
- package/dist/es/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es/components/date-picker/daikin-date-picker.js +627 -0
- package/dist/es/components/date-picker/index.d.ts +1 -0
- package/dist/es/components/date-picker/index.js +4 -0
- package/dist/es/components/dropdown/daikin-dropdown.d.ts +7 -15
- package/dist/es/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es/components/icon/daikin-icon.js +119 -14
- package/dist/es/components/icon/icons.json.d.ts +16 -16
- package/dist/es/components/icon/icons.json.js +5 -1
- package/dist/es/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es/components/index.d.ts +14 -0
- package/dist/es/components/index.js +40 -1
- package/dist/es/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es/components/input-group/daikin-input-group.d.ts +50 -1
- package/dist/es/components/input-group/daikin-input-group.js +5 -5
- package/dist/es/components/link/daikin-link.js +1 -1
- package/dist/es/components/list/daikin-list.d.ts +16 -0
- package/dist/es/components/list/daikin-list.js +76 -4
- package/dist/es/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es/components/list-item/daikin-list-item.js +28 -8
- package/dist/es/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es/components/loading/daikin-loading.js +2 -2
- package/dist/es/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es/components/logo/daikin-logo.js +106 -0
- package/dist/es/components/logo/index.d.ts +1 -0
- package/dist/es/components/logo/index.js +4 -0
- package/dist/es/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es/components/menu/daikin-menu.js +206 -0
- package/dist/es/components/menu/index.d.ts +1 -0
- package/dist/es/components/menu/index.js +4 -0
- package/dist/es/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es/components/modal/daikin-modal.js +116 -0
- package/dist/es/components/modal/index.d.ts +1 -0
- package/dist/es/components/modal/index.js +4 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es/components/modal-footer/index.d.ts +1 -0
- package/dist/es/components/modal-footer/index.js +4 -0
- package/dist/es/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es/components/modal-header/index.d.ts +1 -0
- package/dist/es/components/modal-header/index.js +4 -0
- package/dist/es/components/pagination/daikin-pagination.js +1 -1
- package/dist/es/components/progress-bar/daikin-progress-bar.js +6 -6
- package/dist/es/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es/components/radio/daikin-radio.js +5 -14
- package/dist/es/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es/components/select/daikin-select.js +7 -2
- package/dist/es/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es/components/slider/daikin-slider.js +264 -0
- package/dist/es/components/slider/index.d.ts +1 -0
- package/dist/es/components/slider/index.js +4 -0
- package/dist/es/components/slider/slider-utils.d.ts +37 -0
- package/dist/es/components/slider/slider-utils.js +57 -0
- package/dist/es/components/tab/daikin-tab.js +2 -1
- package/dist/es/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es/components/table/daikin-table.d.ts +72 -34
- package/dist/es/components/table/daikin-table.js +75 -16
- package/dist/es/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +8 -1
- package/dist/es/components/table-header-cell/daikin-table-header-cell.js +32 -7
- package/dist/es/components/tabs/daikin-tabs.js +3 -3
- package/dist/es/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es/components/text-area/daikin-text-area.js +5 -14
- package/dist/es/components/text-field/daikin-text-field.d.ts +57 -18
- package/dist/es/components/text-field/daikin-text-field.js +290 -58
- package/dist/es/components/text-field/number-utils.d.ts +26 -0
- package/dist/es/components/text-field/number-utils.js +61 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es/components/text-masked-field/index.d.ts +1 -0
- package/dist/es/components/text-masked-field/index.js +4 -0
- package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
- package/dist/es/components/time-picker/index.d.ts +1 -0
- package/dist/es/components/time-picker/index.js +14 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es/components/toggle/daikin-toggle.js +5 -14
- package/dist/es/components/tooltip/daikin-tooltip.d.ts +11 -3
- package/dist/es/components/tooltip/daikin-tooltip.js +25 -9
- package/dist/es/components/tree/daikin-tree.js +1 -1
- package/dist/es/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es/controllers/click-outside.js +3 -1
- package/dist/es/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es/controllers/focus-trap.d.ts +10 -0
- package/dist/es/controllers/focus-trap.js +42 -0
- package/dist/es/icon-registry.d.ts +120 -0
- package/dist/es/icon-registry.js +170 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +43 -1
- package/dist/es/tailwind.css.js +1 -1
- package/dist/es/utils/calendar-common.d.ts +64 -0
- package/dist/es/utils/calendar-common.js +151 -0
- package/dist/es/utils/notification-common.d.ts +2 -2
- package/dist/es/utils/notification-common.js +19 -15
- package/dist/es/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es/{components/tabs → utils}/scroller.js +20 -12
- package/dist/es-dev/base/dds-element.js +1 -1
- package/dist/es-dev/base/dds-form-element.d.ts +100 -0
- package/dist/es-dev/base/dds-form-element.js +139 -0
- package/dist/es-dev/components/accordion/daikin-accordion.js +1 -1
- package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +8 -4
- package/dist/es-dev/components/avatar/daikin-avatar.d.ts +3 -0
- package/dist/es-dev/components/avatar/daikin-avatar.js +2 -1
- package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.js +1 -1
- package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +3 -1
- package/dist/es-dev/components/button/daikin-button.d.ts +20 -10
- package/dist/es-dev/components/button/daikin-button.js +36 -14
- package/dist/es-dev/components/calendar/daikin-calendar.d.ts +87 -0
- package/dist/es-dev/components/calendar/daikin-calendar.js +561 -0
- package/dist/es-dev/components/calendar/index.d.ts +1 -0
- package/dist/es-dev/components/calendar/index.js +4 -0
- package/dist/es-dev/components/card/daikin-card.js +2 -2
- package/dist/es-dev/components/card-footer/daikin-card-footer.js +1 -1
- package/dist/es-dev/components/card-header/daikin-card-header.js +2 -2
- package/dist/es-dev/components/carousel/daikin-carousel.js +8 -4
- package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +3 -3
- package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +9 -12
- package/dist/es-dev/components/checkbox/daikin-checkbox.js +13 -17
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.d.ts +69 -0
- package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +95 -0
- package/dist/es-dev/components/checkbox-group/index.d.ts +1 -0
- package/dist/es-dev/components/checkbox-group/index.js +4 -0
- package/dist/es-dev/components/chip/daikin-chip.d.ts +36 -0
- package/dist/es-dev/components/chip/daikin-chip.js +107 -0
- package/dist/es-dev/components/chip/index.d.ts +1 -0
- package/dist/es-dev/components/chip/index.js +4 -0
- package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
- package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
- package/dist/es-dev/components/combobox/index.d.ts +1 -0
- package/dist/es-dev/components/combobox/index.js +5 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +106 -0
- package/dist/es-dev/components/date-picker/daikin-date-picker.js +638 -0
- package/dist/es-dev/components/date-picker/index.d.ts +1 -0
- package/dist/es-dev/components/date-picker/index.js +4 -0
- package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +7 -15
- package/dist/es-dev/components/dropdown/daikin-dropdown.js +92 -58
- package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +1 -1
- package/dist/es-dev/components/icon/daikin-icon.d.ts +129 -9
- package/dist/es-dev/components/icon/daikin-icon.js +143 -18
- package/dist/es-dev/components/icon/icons.json.d.ts +16 -16
- package/dist/es-dev/components/icon/icons.json.js +5 -1
- package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +20 -2
- package/dist/es-dev/components/icon-button/daikin-icon-button.js +31 -5
- package/dist/es-dev/components/index.d.ts +14 -0
- package/dist/es-dev/components/index.js +40 -1
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.d.ts +3 -1
- package/dist/es-dev/components/inline-notification/daikin-inline-notification.js +14 -19
- package/dist/es-dev/components/input-group/daikin-input-group.d.ts +50 -1
- package/dist/es-dev/components/input-group/daikin-input-group.js +5 -5
- package/dist/es-dev/components/link/daikin-link.js +1 -1
- package/dist/es-dev/components/list/daikin-list.d.ts +16 -0
- package/dist/es-dev/components/list/daikin-list.js +76 -4
- package/dist/es-dev/components/list-item/daikin-list-item.d.ts +9 -3
- package/dist/es-dev/components/list-item/daikin-list-item.js +28 -8
- package/dist/es-dev/components/loading/daikin-loading.d.ts +1 -0
- package/dist/es-dev/components/loading/daikin-loading.js +2 -2
- package/dist/es-dev/components/logo/daikin-logo.d.ts +54 -0
- package/dist/es-dev/components/logo/daikin-logo.js +106 -0
- package/dist/es-dev/components/logo/index.d.ts +1 -0
- package/dist/es-dev/components/logo/index.js +4 -0
- package/dist/es-dev/components/menu/daikin-menu.d.ts +89 -0
- package/dist/es-dev/components/menu/daikin-menu.js +206 -0
- package/dist/es-dev/components/menu/index.d.ts +1 -0
- package/dist/es-dev/components/menu/index.js +4 -0
- package/dist/es-dev/components/modal/daikin-modal.d.ts +61 -0
- package/dist/es-dev/components/modal/daikin-modal.js +116 -0
- package/dist/es-dev/components/modal/index.d.ts +1 -0
- package/dist/es-dev/components/modal/index.js +4 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.d.ts +33 -0
- package/dist/es-dev/components/modal-footer/daikin-modal-footer.js +41 -0
- package/dist/es-dev/components/modal-footer/index.d.ts +1 -0
- package/dist/es-dev/components/modal-footer/index.js +4 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.d.ts +43 -0
- package/dist/es-dev/components/modal-header/daikin-modal-header.js +97 -0
- package/dist/es-dev/components/modal-header/index.d.ts +1 -0
- package/dist/es-dev/components/modal-header/index.js +4 -0
- package/dist/es-dev/components/pagination/daikin-pagination.js +1 -1
- package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +6 -6
- package/dist/es-dev/components/progress-indicator/daikin-progress-indicator.js +1 -1
- package/dist/es-dev/components/progress-indicator-item/daikin-progress-indicator-item.js +2 -2
- package/dist/es-dev/components/radio/daikin-radio.d.ts +2 -12
- package/dist/es-dev/components/radio/daikin-radio.js +5 -14
- package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +2 -1
- package/dist/es-dev/components/radio-group/daikin-radio-group.js +2 -2
- package/dist/es-dev/components/select/daikin-select.js +7 -2
- package/dist/es-dev/components/slider/daikin-slider.d.ts +67 -0
- package/dist/es-dev/components/slider/daikin-slider.js +264 -0
- package/dist/es-dev/components/slider/index.d.ts +1 -0
- package/dist/es-dev/components/slider/index.js +4 -0
- package/dist/es-dev/components/slider/slider-utils.d.ts +37 -0
- package/dist/es-dev/components/slider/slider-utils.js +57 -0
- package/dist/es-dev/components/tab/daikin-tab.js +2 -1
- package/dist/es-dev/components/tab-panels/daikin-tab-panels.js +1 -1
- package/dist/es-dev/components/table/daikin-table.d.ts +72 -34
- package/dist/es-dev/components/table/daikin-table.js +78 -19
- package/dist/es-dev/components/table-cell/daikin-table-cell.d.ts +1 -1
- package/dist/es-dev/components/table-cell/daikin-table-cell.js +3 -2
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +8 -1
- package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +32 -7
- package/dist/es-dev/components/tabs/daikin-tabs.js +3 -3
- package/dist/es-dev/components/text-area/daikin-text-area.d.ts +2 -12
- package/dist/es-dev/components/text-area/daikin-text-area.js +5 -14
- package/dist/es-dev/components/text-field/daikin-text-field.d.ts +57 -18
- package/dist/es-dev/components/text-field/daikin-text-field.js +290 -58
- package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
- package/dist/es-dev/components/text-field/number-utils.js +64 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
- package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
- package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
- package/dist/es-dev/components/text-masked-field/index.js +4 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
- package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
- package/dist/es-dev/components/time-picker/index.d.ts +1 -0
- package/dist/es-dev/components/time-picker/index.js +14 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.d.ts +2 -0
- package/dist/es-dev/components/toast-notification/daikin-toast-notification.js +11 -8
- package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +2 -2
- package/dist/es-dev/components/toggle/daikin-toggle.d.ts +2 -12
- package/dist/es-dev/components/toggle/daikin-toggle.js +5 -14
- package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +11 -3
- package/dist/es-dev/components/tooltip/daikin-tooltip.js +25 -9
- package/dist/es-dev/components/tree/daikin-tree.js +1 -1
- package/dist/es-dev/components/tree-item/daikin-tree-item.js +1 -1
- package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +2 -0
- package/dist/es-dev/components/tree-section/daikin-tree-section.js +1 -1
- package/dist/es-dev/controllers/click-outside.js +3 -1
- package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +12 -0
- package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
- package/dist/es-dev/controllers/focus-trap.d.ts +10 -0
- package/dist/es-dev/controllers/focus-trap.js +42 -0
- package/dist/es-dev/icon-registry.d.ts +120 -0
- package/dist/es-dev/icon-registry.js +170 -0
- package/dist/es-dev/index.d.ts +1 -0
- package/dist/es-dev/index.js +43 -1
- package/dist/es-dev/tailwind.css.js +1 -1
- package/dist/es-dev/utils/calendar-common.d.ts +64 -0
- package/dist/es-dev/utils/calendar-common.js +151 -0
- package/dist/es-dev/utils/notification-common.d.ts +2 -2
- package/dist/es-dev/utils/notification-common.js +19 -15
- package/dist/es-dev/{components/tabs → utils}/scroller.d.ts +2 -2
- package/dist/es-dev/{components/tabs → utils}/scroller.js +20 -12
- package/icons/alarm.svg +3 -0
- package/icons/calendar.svg +3 -0
- package/icons/chevron-down.svg +3 -3
- package/icons/chevron-left.svg +2 -2
- package/icons/chevron-right.svg +2 -2
- package/icons/chevron-up.svg +2 -2
- package/icons/close.svg +3 -0
- package/icons/error.svg +3 -0
- package/icons/information.svg +3 -0
- package/icons/logo-negative.svg +10 -0
- package/icons/logo-positive.svg +10 -0
- package/icons/{dropdown-chevron-down.svg → number-minus.svg} +3 -1
- package/icons/number-plus.svg +5 -0
- package/icons/password-hidden.svg +3 -0
- package/icons/password-visible.svg +3 -0
- package/icons/pulldown-down.svg +3 -0
- package/icons/search.svg +3 -0
- package/icons/success.svg +3 -0
- package/icons/warning.svg +3 -0
- package/package.json +20 -6
- package/icons/cross.svg +0 -3
- package/icons/notification-close.svg +0 -5
- package/icons/status-alarm.svg +0 -5
- package/icons/status-error.svg +0 -3
- package/icons/status-information.svg +0 -5
- package/icons/status-negative.svg +0 -5
- package/icons/status-positive.svg +0 -5
- package/icons/status-warning.svg +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
3
3
|
/**
|
|
4
4
|
* The toggle switch component is a UI element that allows users to switch between two states, typically "on" and "off".
|
|
5
5
|
* It functions similarly to a `daikin-checkbox` component but provides a more visually intuitive way to represent binary options.
|
|
@@ -18,16 +18,8 @@ import { DDSElement } from "../../base/index.js";
|
|
|
18
18
|
* <daikin-toggle name="name" value="value"></daikin-toggle>
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare class DaikinToggle extends
|
|
21
|
+
export declare class DaikinToggle extends DDSFormElement {
|
|
22
22
|
static readonly styles: import('lit').CSSResult;
|
|
23
|
-
/**
|
|
24
|
-
* The form name, submitted as a name/value pair when submitting the form.
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
/**
|
|
28
|
-
* The form value, submitted as a name/value pair when submitting the form.
|
|
29
|
-
*/
|
|
30
|
-
value: string;
|
|
31
23
|
/**
|
|
32
24
|
* Whether the toggle switch is turned on.
|
|
33
25
|
*/
|
|
@@ -36,8 +28,6 @@ export declare class DaikinToggle extends DDSElement {
|
|
|
36
28
|
* Specify the toggle switch disabled state.
|
|
37
29
|
*/
|
|
38
30
|
disabled: boolean;
|
|
39
|
-
static readonly formAssociated = true;
|
|
40
|
-
private _internals;
|
|
41
31
|
private _updateFormValue;
|
|
42
32
|
private _handleChange;
|
|
43
33
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../base/dds-element.js";
|
|
5
5
|
import { ddsElement } from "../../base/decorators.js";
|
|
6
6
|
import "../../base/define.js";
|
|
7
|
+
import { DDSFormElement } from "../../base/dds-form-element.js";
|
|
7
8
|
import tailwindStyles from "../../tailwind.css.js";
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
9
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -49,17 +50,14 @@ const TOGGLE_CLASS_NAME = cva([
|
|
|
49
50
|
"enabled:before:bg-ddt-color-common-background-default",
|
|
50
51
|
"disabled:before:bg-ddt-color-common-surface-hover"
|
|
51
52
|
])();
|
|
52
|
-
let DaikinToggle = class extends
|
|
53
|
+
let DaikinToggle = class extends DDSFormElement {
|
|
53
54
|
constructor() {
|
|
54
55
|
super(...arguments);
|
|
55
|
-
this.name = "";
|
|
56
|
-
this.value = "";
|
|
57
56
|
this.checked = false;
|
|
58
57
|
this.disabled = false;
|
|
59
|
-
this._internals = this.attachInternals();
|
|
60
58
|
}
|
|
61
59
|
_updateFormValue() {
|
|
62
|
-
this.
|
|
60
|
+
this.setFormValue(this.checked ? this.value : null);
|
|
63
61
|
}
|
|
64
62
|
_handleChange(event) {
|
|
65
63
|
this.checked = event.target.checked;
|
|
@@ -91,13 +89,6 @@ DaikinToggle.styles = css`
|
|
|
91
89
|
display: inline-flex;
|
|
92
90
|
}
|
|
93
91
|
`;
|
|
94
|
-
DaikinToggle.formAssociated = true;
|
|
95
|
-
__decorateClass([
|
|
96
|
-
property({ type: String, reflect: true })
|
|
97
|
-
], DaikinToggle.prototype, "name", 2);
|
|
98
|
-
__decorateClass([
|
|
99
|
-
property({ type: String, reflect: true })
|
|
100
|
-
], DaikinToggle.prototype, "value", 2);
|
|
101
92
|
__decorateClass([
|
|
102
93
|
property({ type: Boolean, reflect: true })
|
|
103
94
|
], DaikinToggle.prototype, "checked", 2);
|
|
@@ -12,7 +12,7 @@ type TooltipVariantProps = MergeVariantProps<typeof cvaTooltip>;
|
|
|
12
12
|
* @fires toggle - A event emitted when the tooltip is opened or closed.
|
|
13
13
|
*
|
|
14
14
|
* @slot - A slot for the element to which the tooltip is attached (the trigger element).
|
|
15
|
-
* @slot description - A slot for the tooltip description content.
|
|
15
|
+
* @slot description - A slot for the tooltip description content. Tooltips don't have a prescribed maximum or minimum width. If you plan to use longer text, please note that you'll need to manually implement line breaks.
|
|
16
16
|
*
|
|
17
17
|
* @cssprop [--ddc-tooltip-spacing=20px] - Spacing between the tooltip and the trigger.
|
|
18
18
|
*
|
|
@@ -55,6 +55,7 @@ export declare class DaikinTooltip extends DDSElement {
|
|
|
55
55
|
/**
|
|
56
56
|
* Specifies the content of the tooltip.
|
|
57
57
|
* Ignored if the `tooltip` slot exists.
|
|
58
|
+
* Tooltips don't have a prescribed maximum or minimum width. If you plan to use longer text, please note that you'll need to manually implement line breaks.
|
|
58
59
|
*/
|
|
59
60
|
description: string;
|
|
60
61
|
/**
|
|
@@ -70,13 +71,20 @@ export declare class DaikinTooltip extends DDSElement {
|
|
|
70
71
|
* - `manual`: The tooltip does not respond to user interaction. Use this to control the tooltip programmatically.
|
|
71
72
|
*/
|
|
72
73
|
trigger: "hover" | "click" | "manual";
|
|
74
|
+
/**
|
|
75
|
+
* Internal state to track whether the element will be focused by a press interaction.
|
|
76
|
+
* In this case, the tooltip will not be open via focus to prevent it from disappearing immediately afterward.
|
|
77
|
+
*/
|
|
78
|
+
private _willBeFocusedByPress;
|
|
73
79
|
private _autoUpdateController;
|
|
74
80
|
private _hostStyles;
|
|
75
81
|
private _handleClick;
|
|
76
82
|
private _handleFocusIn;
|
|
77
83
|
private _handleFocusOut;
|
|
78
|
-
private
|
|
79
|
-
private
|
|
84
|
+
private _handlePointerEnter;
|
|
85
|
+
private _handlePointerLeave;
|
|
86
|
+
private _handlePointerDown;
|
|
87
|
+
private _handlePointerUp;
|
|
80
88
|
private _handleBeforeToggle;
|
|
81
89
|
private _handleToggle;
|
|
82
90
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { offset, flip, shift } from "@floating-ui/dom";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
|
-
import {
|
|
3
|
+
import { unsafeCSS, css, html } from "lit";
|
|
4
4
|
import { property } from "lit/decorators.js";
|
|
5
5
|
import { guard } from "lit/directives/guard.js";
|
|
6
6
|
import { DDSElement } from "../../base/dds-element.js";
|
|
@@ -61,6 +61,7 @@ let DaikinTooltip = class extends DDSElement {
|
|
|
61
61
|
this.description = "";
|
|
62
62
|
this.popoverValue = "auto";
|
|
63
63
|
this.trigger = "hover";
|
|
64
|
+
this._willBeFocusedByPress = false;
|
|
64
65
|
this._autoUpdateController = new FloatingUIAutoUpdateController(this);
|
|
65
66
|
this._hostStyles = isClient ? window.getComputedStyle(this) : null;
|
|
66
67
|
}
|
|
@@ -82,21 +83,34 @@ let DaikinTooltip = class extends DDSElement {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
_handleFocusIn() {
|
|
85
|
-
this.
|
|
86
|
+
if (this.trigger !== "manual" && !this._willBeFocusedByPress) {
|
|
87
|
+
this.open = true;
|
|
88
|
+
}
|
|
86
89
|
}
|
|
87
90
|
_handleFocusOut() {
|
|
88
|
-
this.
|
|
91
|
+
if (this.trigger !== "manual") {
|
|
92
|
+
this.open = false;
|
|
93
|
+
}
|
|
89
94
|
}
|
|
90
|
-
|
|
91
|
-
if (this.trigger === "hover") {
|
|
95
|
+
_handlePointerEnter(event) {
|
|
96
|
+
if (this.trigger === "hover" && event.pointerType === "mouse") {
|
|
92
97
|
this.open = true;
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
|
-
|
|
96
|
-
if (this.trigger === "hover") {
|
|
100
|
+
_handlePointerLeave(event) {
|
|
101
|
+
if (this.trigger === "hover" && event.pointerType === "mouse") {
|
|
97
102
|
this.open = false;
|
|
98
103
|
}
|
|
99
104
|
}
|
|
105
|
+
_handlePointerDown() {
|
|
106
|
+
this._willBeFocusedByPress = this.trigger === "click" && !this.matches(":focus-within");
|
|
107
|
+
}
|
|
108
|
+
_handlePointerUp(event) {
|
|
109
|
+
this._willBeFocusedByPress = false;
|
|
110
|
+
if (this.trigger === "hover" && event.pointerType === "touch") {
|
|
111
|
+
this.open = !this.open;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
100
114
|
_handleBeforeToggle(event) {
|
|
101
115
|
reDispatch(this, event, new ToggleEvent("beforetoggle", event));
|
|
102
116
|
}
|
|
@@ -124,8 +138,10 @@ let DaikinTooltip = class extends DDSElement {
|
|
|
124
138
|
@click=${this._handleClick}
|
|
125
139
|
@focusin=${this._handleFocusIn}
|
|
126
140
|
@focusout=${this._handleFocusOut}
|
|
127
|
-
@
|
|
128
|
-
@
|
|
141
|
+
@pointerenter=${this._handlePointerEnter}
|
|
142
|
+
@pointerleave=${this._handlePointerLeave}
|
|
143
|
+
@pointerdown=${this._handlePointerDown}
|
|
144
|
+
@pointerup=${this._handlePointerUp}
|
|
129
145
|
></slot>
|
|
130
146
|
</div>
|
|
131
147
|
<span
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unsafeCSS, css, html } from "lit";
|
|
2
2
|
import { property, queryAssignedElements } from "lit/decorators.js";
|
|
3
3
|
import { DDSElement } from "../../base/dds-element.js";
|
|
4
4
|
import { ddsElement } from "../../base/decorators.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
import {
|
|
2
|
+
import { unsafeCSS, css, html } from "lit";
|
|
3
3
|
import { property } from "lit/decorators.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
@@ -9,6 +9,8 @@ import { DDSElement } from "../../base/index.js";
|
|
|
9
9
|
* - `daikin-tree` > `daikin-tree-section` > `daikin-tree-item`
|
|
10
10
|
* - `daikin-tree` > `daikin-tree-section` > `daikin-tree-section` ...
|
|
11
11
|
*
|
|
12
|
+
* @tokenImports ../tree-item/daikin-tree-item.ts
|
|
13
|
+
*
|
|
12
14
|
* @fires toggle - _Cancellable._ A custom event emitted when the user clicks the header.
|
|
13
15
|
* @fires tree-move-focus - _Internal use._ A custom event used to move the focus within a tree.
|
|
14
16
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unsafeCSS, css, html } from "lit";
|
|
2
2
|
import { property, queryAssignedElements } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
@@ -8,7 +8,9 @@ const clickOutsideDirective = createControllerDirective(
|
|
|
8
8
|
}
|
|
9
9
|
callback.call(element, event);
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
window.addEventListener("click", listener);
|
|
13
|
+
}, 0);
|
|
12
14
|
return () => {
|
|
13
15
|
window.removeEventListener("click", listener);
|
|
14
16
|
};
|
|
@@ -13,7 +13,19 @@ export declare class FloatingUIAutoUpdateController<T extends ReactiveController
|
|
|
13
13
|
private readonly _isOptionsUpdated?;
|
|
14
14
|
private _floatingElement;
|
|
15
15
|
private _referenceElement;
|
|
16
|
+
/**
|
|
17
|
+
* Context information to be passed with floating-ready event
|
|
18
|
+
*/
|
|
19
|
+
private _triggerContext;
|
|
16
20
|
constructor(_host: T, _isOptionsUpdated?: ((current: Partial<ComputePositionConfig>, previous: Partial<ComputePositionConfig>) => boolean) | undefined);
|
|
21
|
+
/**
|
|
22
|
+
* Set context information that will be included in the floating-ready event
|
|
23
|
+
*/
|
|
24
|
+
setTriggerContext(context: Record<string, unknown>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Clear the trigger context
|
|
27
|
+
*/
|
|
28
|
+
clearTriggerContext(): void;
|
|
17
29
|
private readonly _refCallbackFloating;
|
|
18
30
|
private readonly _refCallbackReference;
|
|
19
31
|
get floatingElement(): HTMLElement | undefined;
|
|
@@ -3,7 +3,7 @@ import { nothing } from "lit";
|
|
|
3
3
|
import { ref } from "lit/directives/ref.js";
|
|
4
4
|
import { createControllerDirective } from "./helpers/controller-directive.js";
|
|
5
5
|
const floatingUIAutoUpdateDirective = createControllerDirective(
|
|
6
|
-
(referenceElement, floatingElement, options) => {
|
|
6
|
+
(referenceElement, floatingElement, options, _isOptionsUpdated, triggerContext) => {
|
|
7
7
|
const cleanupAutoUpdate = autoUpdate(
|
|
8
8
|
referenceElement,
|
|
9
9
|
floatingElement,
|
|
@@ -16,7 +16,10 @@ const floatingUIAutoUpdateDirective = createControllerDirective(
|
|
|
16
16
|
floatingElement.style.setProperty("--floating-y", `${y}px`);
|
|
17
17
|
floatingElement.setAttribute("data-floating-ready", "");
|
|
18
18
|
if (isFirst) {
|
|
19
|
-
|
|
19
|
+
const event = new CustomEvent("floating-ready", {
|
|
20
|
+
detail: triggerContext
|
|
21
|
+
});
|
|
22
|
+
floatingElement.dispatchEvent(event);
|
|
20
23
|
}
|
|
21
24
|
}).catch((error) => {
|
|
22
25
|
});
|
|
@@ -34,7 +37,8 @@ const floatingUIAutoUpdateDirective = createControllerDirective(
|
|
|
34
37
|
current[0] !== previous[0] || // Check if the floating element is changed
|
|
35
38
|
current[1] !== previous[1] || // Check if the options is changed.
|
|
36
39
|
// If option comparison function (current[3]) is provided, use it to compare options. Otherwise, use `!==` to compare options.
|
|
37
|
-
(((_a = current[3]) == null ? void 0 : _a.call(current, current[2], previous[2])) ?? current[2] !== previous[2])
|
|
40
|
+
(((_a = current[3]) == null ? void 0 : _a.call(current, current[2], previous[2])) ?? current[2] !== previous[2]) || // Check if the trigger context is changed
|
|
41
|
+
current[4] !== previous[4]
|
|
38
42
|
);
|
|
39
43
|
}
|
|
40
44
|
);
|
|
@@ -42,6 +46,7 @@ class FloatingUIAutoUpdateController {
|
|
|
42
46
|
constructor(_host, _isOptionsUpdated) {
|
|
43
47
|
this._host = _host;
|
|
44
48
|
this._isOptionsUpdated = _isOptionsUpdated;
|
|
49
|
+
this._triggerContext = {};
|
|
45
50
|
this._refCallbackFloating = (element) => {
|
|
46
51
|
this._floatingElement = element;
|
|
47
52
|
this._host.requestUpdate();
|
|
@@ -52,6 +57,18 @@ class FloatingUIAutoUpdateController {
|
|
|
52
57
|
};
|
|
53
58
|
_host.addController(this);
|
|
54
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Set context information that will be included in the floating-ready event
|
|
62
|
+
*/
|
|
63
|
+
setTriggerContext(context) {
|
|
64
|
+
this._triggerContext = { ...context };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Clear the trigger context
|
|
68
|
+
*/
|
|
69
|
+
clearTriggerContext() {
|
|
70
|
+
this._triggerContext = {};
|
|
71
|
+
}
|
|
55
72
|
get floatingElement() {
|
|
56
73
|
return this._floatingElement;
|
|
57
74
|
}
|
|
@@ -72,7 +89,8 @@ class FloatingUIAutoUpdateController {
|
|
|
72
89
|
this._referenceElement,
|
|
73
90
|
this._floatingElement,
|
|
74
91
|
options,
|
|
75
|
-
this._isOptionsUpdated
|
|
92
|
+
this._isOptionsUpdated,
|
|
93
|
+
this._triggerContext
|
|
76
94
|
);
|
|
77
95
|
}
|
|
78
96
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare class FocusTrapController<T extends ReactiveControllerHost & HTMLElement> {
|
|
3
|
+
private readonly _host;
|
|
4
|
+
private readonly _onDeactivate;
|
|
5
|
+
private _container;
|
|
6
|
+
private readonly _refCallbackContainer;
|
|
7
|
+
constructor(_host: T, _onDeactivate: () => void);
|
|
8
|
+
refContainer(): import('lit-html/directive.js').DirectiveResult<typeof import('lit-html/directives/ref.js').RefDirective>;
|
|
9
|
+
directive(open?: boolean, persistent?: boolean): import('lit-html/directive.js').DirectiveResult<import('lit-html/directive.js').DirectiveClass>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createFocusTrap } from "focus-trap";
|
|
2
|
+
import { nothing } from "lit";
|
|
3
|
+
import { ref } from "lit/directives/ref.js";
|
|
4
|
+
import { createControllerDirective } from "./helpers/controller-directive.js";
|
|
5
|
+
const focusTrapDirective = createControllerDirective((container, persistent, onDeactivate) => {
|
|
6
|
+
const trap = createFocusTrap(container, {
|
|
7
|
+
escapeDeactivates: !persistent,
|
|
8
|
+
fallbackFocus: container,
|
|
9
|
+
tabbableOptions: {
|
|
10
|
+
getShadowRoot: (node) => node.shadowRoot ?? void 0
|
|
11
|
+
},
|
|
12
|
+
clickOutsideDeactivates: !persistent,
|
|
13
|
+
onDeactivate
|
|
14
|
+
});
|
|
15
|
+
trap.activate();
|
|
16
|
+
return () => {
|
|
17
|
+
trap.deactivate();
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
class FocusTrapController {
|
|
21
|
+
constructor(_host, _onDeactivate) {
|
|
22
|
+
this._host = _host;
|
|
23
|
+
this._onDeactivate = _onDeactivate;
|
|
24
|
+
this._refCallbackContainer = (element) => {
|
|
25
|
+
this._container = element;
|
|
26
|
+
this._host.requestUpdate();
|
|
27
|
+
};
|
|
28
|
+
_host.addController(this);
|
|
29
|
+
}
|
|
30
|
+
refContainer() {
|
|
31
|
+
return ref(this._refCallbackContainer);
|
|
32
|
+
}
|
|
33
|
+
directive(open = true, persistent = false) {
|
|
34
|
+
if (!open || !this._container) {
|
|
35
|
+
return nothing;
|
|
36
|
+
}
|
|
37
|
+
return focusTrapDirective(this._container, persistent, this._onDeactivate);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
FocusTrapController
|
|
42
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon data structure containing SVG information
|
|
3
|
+
*/
|
|
4
|
+
export interface IconData {
|
|
5
|
+
/** SVG content as a string */
|
|
6
|
+
svg: string;
|
|
7
|
+
/** Default color for the icon */
|
|
8
|
+
defaultColor?: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Determines how the SVG is rendered.
|
|
11
|
+
* This affects the styling and behavior of the icon.
|
|
12
|
+
*
|
|
13
|
+
* - "mask": Uses the SVG as a CSS mask, allowing for color customization. Use this for monochrome icons.
|
|
14
|
+
* - "background": Uses the SVG as a CSS background image. Use this for colorful icons with no complex styling.
|
|
15
|
+
* - "inline": Renders the SVG inline, allowing for more complex styling.
|
|
16
|
+
* **Be cautious with this mode as it can introduce security risks if the SVG content is not trusted.**
|
|
17
|
+
*
|
|
18
|
+
* @default "mask"
|
|
19
|
+
*/
|
|
20
|
+
mode?: "mask" | "background" | "inline";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Direct icon registration configuration
|
|
24
|
+
*/
|
|
25
|
+
export interface DirectIconRegistration {
|
|
26
|
+
/** Icon name */
|
|
27
|
+
name: string;
|
|
28
|
+
/** SVG content or icon data */
|
|
29
|
+
svg: string | IconData;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Dynamic icon registration configuration using regex pattern matching
|
|
33
|
+
*/
|
|
34
|
+
export interface DynamicIconRegistration {
|
|
35
|
+
/** Regular expression to match icon names */
|
|
36
|
+
match: RegExp;
|
|
37
|
+
/** Function to fetch SVG content for matched names */
|
|
38
|
+
fetch: (name: string) => Promise<string | IconData> | string | IconData;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Icon registration configuration
|
|
42
|
+
*/
|
|
43
|
+
export type IconRegistration = DirectIconRegistration | DynamicIconRegistration;
|
|
44
|
+
/**
|
|
45
|
+
* Icon registry class that manages icon registration and retrieval
|
|
46
|
+
*/
|
|
47
|
+
export declare class IconRegistry {
|
|
48
|
+
#private;
|
|
49
|
+
/**
|
|
50
|
+
* Get the singleton instance of IconRegistry
|
|
51
|
+
*/
|
|
52
|
+
static getGlobalInstance(): IconRegistry;
|
|
53
|
+
/**
|
|
54
|
+
* Register an icon or dynamic icon fetcher
|
|
55
|
+
* @param registration Icon registration configuration
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Direct registration
|
|
59
|
+
* registry.register({ name: "custom-icon", svg: "<svg>...</svg>" });
|
|
60
|
+
*
|
|
61
|
+
* // Dynamic registration
|
|
62
|
+
* registry.register({
|
|
63
|
+
* match: /^custom-/,
|
|
64
|
+
* fetch: async (name) => {
|
|
65
|
+
* const response = await fetch(`/icons/${name}.svg`);
|
|
66
|
+
* return response.text();
|
|
67
|
+
* }
|
|
68
|
+
* });
|
|
69
|
+
*/
|
|
70
|
+
register(registration: IconRegistration): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get an icon by name
|
|
73
|
+
* @param name Icon name
|
|
74
|
+
* @returns Promise that resolves to IconData or null if not found
|
|
75
|
+
*/
|
|
76
|
+
getIcon(name: string): Promise<IconData | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Check if an icon is registered (either directly or through dynamic registration)
|
|
79
|
+
* @param name Icon name
|
|
80
|
+
* @returns true if icon is available
|
|
81
|
+
*/
|
|
82
|
+
hasIcon(name: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Get all directly registered icon names
|
|
85
|
+
* @returns Array of icon names
|
|
86
|
+
*/
|
|
87
|
+
getRegisteredIconNames(): string[];
|
|
88
|
+
/**
|
|
89
|
+
* Get all dynamic registration patterns
|
|
90
|
+
* @returns Array of regex patterns
|
|
91
|
+
*/
|
|
92
|
+
getDynamicPatterns(): RegExp[];
|
|
93
|
+
/**
|
|
94
|
+
* Clear all registrations and cache
|
|
95
|
+
*/
|
|
96
|
+
clear(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Remove a specific icon registration
|
|
99
|
+
* @param name Icon name to remove
|
|
100
|
+
*/
|
|
101
|
+
unregister(name: string): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Fetch icon from dynamic registration
|
|
104
|
+
* @param registration Dynamic registration
|
|
105
|
+
* @param name Icon name
|
|
106
|
+
* @returns Promise that resolves to IconData or null
|
|
107
|
+
*/
|
|
108
|
+
private fetchDynamicIcon;
|
|
109
|
+
/**
|
|
110
|
+
* Perform the actual dynamic fetch
|
|
111
|
+
* @param registration Dynamic registration
|
|
112
|
+
* @param name Icon name
|
|
113
|
+
* @returns Promise that resolves to IconData or null
|
|
114
|
+
*/
|
|
115
|
+
private performDynamicFetch;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Global icon registry instance
|
|
119
|
+
*/
|
|
120
|
+
export declare const iconRegistry: IconRegistry;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var __typeError = (msg) => {
|
|
2
|
+
throw TypeError(msg);
|
|
3
|
+
};
|
|
4
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
+
var _instance, _icons, _dynamicRegistrations, _cache;
|
|
9
|
+
function isDynamicRegistration(registration) {
|
|
10
|
+
return "match" in registration && "fetch" in registration;
|
|
11
|
+
}
|
|
12
|
+
function isDirectRegistration(registration) {
|
|
13
|
+
return "name" in registration && "svg" in registration;
|
|
14
|
+
}
|
|
15
|
+
function normalizeIconData(svg) {
|
|
16
|
+
if (typeof svg === "string") {
|
|
17
|
+
return { mode: "mask", svg };
|
|
18
|
+
}
|
|
19
|
+
return { mode: "mask", ...svg };
|
|
20
|
+
}
|
|
21
|
+
const _IconRegistry = class _IconRegistry {
|
|
22
|
+
constructor() {
|
|
23
|
+
/** Map of registered icons by name */
|
|
24
|
+
__privateAdd(this, _icons, /* @__PURE__ */ new Map());
|
|
25
|
+
/** Array of dynamic icon registrations */
|
|
26
|
+
__privateAdd(this, _dynamicRegistrations, []);
|
|
27
|
+
/** Cache for dynamically fetched icons */
|
|
28
|
+
__privateAdd(this, _cache, /* @__PURE__ */ new Map());
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the singleton instance of IconRegistry
|
|
32
|
+
*/
|
|
33
|
+
static getGlobalInstance() {
|
|
34
|
+
const instance = __privateGet(_IconRegistry, _instance) ?? __privateSet(_IconRegistry, _instance, new _IconRegistry());
|
|
35
|
+
return instance;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Register an icon or dynamic icon fetcher
|
|
39
|
+
* @param registration Icon registration configuration
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Direct registration
|
|
43
|
+
* registry.register({ name: "custom-icon", svg: "<svg>...</svg>" });
|
|
44
|
+
*
|
|
45
|
+
* // Dynamic registration
|
|
46
|
+
* registry.register({
|
|
47
|
+
* match: /^custom-/,
|
|
48
|
+
* fetch: async (name) => {
|
|
49
|
+
* const response = await fetch(`/icons/${name}.svg`);
|
|
50
|
+
* return response.text();
|
|
51
|
+
* }
|
|
52
|
+
* });
|
|
53
|
+
*/
|
|
54
|
+
register(registration) {
|
|
55
|
+
if (isDirectRegistration(registration)) {
|
|
56
|
+
const iconData = normalizeIconData(registration.svg);
|
|
57
|
+
__privateGet(this, _icons).set(registration.name, iconData);
|
|
58
|
+
} else if (isDynamicRegistration(registration)) {
|
|
59
|
+
__privateGet(this, _dynamicRegistrations).push(registration);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get an icon by name
|
|
64
|
+
* @param name Icon name
|
|
65
|
+
* @returns Promise that resolves to IconData or null if not found
|
|
66
|
+
*/
|
|
67
|
+
async getIcon(name) {
|
|
68
|
+
const registered = __privateGet(this, _icons).get(name);
|
|
69
|
+
if (registered) {
|
|
70
|
+
return registered;
|
|
71
|
+
}
|
|
72
|
+
for (const registration of __privateGet(this, _dynamicRegistrations)) {
|
|
73
|
+
if (registration.match.test(name)) {
|
|
74
|
+
return this.fetchDynamicIcon(registration, name);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Check if an icon is registered (either directly or through dynamic registration)
|
|
81
|
+
* @param name Icon name
|
|
82
|
+
* @returns true if icon is available
|
|
83
|
+
*/
|
|
84
|
+
hasIcon(name) {
|
|
85
|
+
if (__privateGet(this, _icons).has(name)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return __privateGet(this, _dynamicRegistrations).some(
|
|
89
|
+
(registration) => registration.match.test(name)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get all directly registered icon names
|
|
94
|
+
* @returns Array of icon names
|
|
95
|
+
*/
|
|
96
|
+
getRegisteredIconNames() {
|
|
97
|
+
return Array.from(__privateGet(this, _icons).keys());
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get all dynamic registration patterns
|
|
101
|
+
* @returns Array of regex patterns
|
|
102
|
+
*/
|
|
103
|
+
getDynamicPatterns() {
|
|
104
|
+
return __privateGet(this, _dynamicRegistrations).map((reg) => reg.match);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Clear all registrations and cache
|
|
108
|
+
*/
|
|
109
|
+
clear() {
|
|
110
|
+
__privateGet(this, _icons).clear();
|
|
111
|
+
__privateGet(this, _dynamicRegistrations).length = 0;
|
|
112
|
+
__privateGet(this, _cache).clear();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Remove a specific icon registration
|
|
116
|
+
* @param name Icon name to remove
|
|
117
|
+
*/
|
|
118
|
+
unregister(name) {
|
|
119
|
+
const existed = __privateGet(this, _icons).has(name);
|
|
120
|
+
__privateGet(this, _icons).delete(name);
|
|
121
|
+
return existed;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Fetch icon from dynamic registration
|
|
125
|
+
* @param registration Dynamic registration
|
|
126
|
+
* @param name Icon name
|
|
127
|
+
* @returns Promise that resolves to IconData or null
|
|
128
|
+
*/
|
|
129
|
+
async fetchDynamicIcon(registration, name) {
|
|
130
|
+
const cacheKey = `${registration.match.source}\0${name}`;
|
|
131
|
+
const cached = __privateGet(this, _cache).get(cacheKey);
|
|
132
|
+
if (cached) {
|
|
133
|
+
return cached;
|
|
134
|
+
}
|
|
135
|
+
const fetchPromise = this.performDynamicFetch(registration, name).then(
|
|
136
|
+
(result) => {
|
|
137
|
+
__privateGet(this, _cache).set(cacheKey, result);
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
__privateGet(this, _cache).set(cacheKey, fetchPromise);
|
|
142
|
+
return fetchPromise;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Perform the actual dynamic fetch
|
|
146
|
+
* @param registration Dynamic registration
|
|
147
|
+
* @param name Icon name
|
|
148
|
+
* @returns Promise that resolves to IconData or null
|
|
149
|
+
*/
|
|
150
|
+
async performDynamicFetch(registration, name) {
|
|
151
|
+
try {
|
|
152
|
+
const result = await registration.fetch(name);
|
|
153
|
+
return normalizeIconData(result);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.warn(`Failed to fetch dynamic icon "${name}":`, error);
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
_instance = new WeakMap();
|
|
161
|
+
_icons = new WeakMap();
|
|
162
|
+
_dynamicRegistrations = new WeakMap();
|
|
163
|
+
_cache = new WeakMap();
|
|
164
|
+
__privateAdd(_IconRegistry, _instance);
|
|
165
|
+
let IconRegistry = _IconRegistry;
|
|
166
|
+
const iconRegistry = IconRegistry.getGlobalInstance();
|
|
167
|
+
export {
|
|
168
|
+
IconRegistry,
|
|
169
|
+
iconRegistry
|
|
170
|
+
};
|
package/dist/es/index.d.ts
CHANGED