igniteui-webcomponents 7.2.4 → 7.3.0-beta.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 +142 -0
- package/animations/player.js +1 -1
- package/animations/player.js.map +1 -1
- package/animations/view-transition.js +1 -1
- package/animations/view-transition.js.map +1 -1
- package/components/accordion/accordion.d.ts +1 -1
- package/components/accordion/accordion.js +7 -6
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.js +3 -3
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/themes.d.ts +1 -1
- package/components/avatar/themes/themes.js.map +1 -1
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/badge.js +5 -5
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/themes.d.ts +1 -1
- package/components/badge/themes/themes.js.map +1 -1
- package/components/banner/banner.d.ts +2 -2
- package/components/banner/banner.js +8 -8
- package/components/banner/banner.js.map +1 -1
- package/components/banner/themes/themes.d.ts +1 -1
- package/components/banner/themes/themes.js.map +1 -1
- package/components/button/button-base.d.ts +2 -2
- package/components/button/button-base.js +9 -8
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +3 -3
- package/components/button/button.js +2 -2
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.js +3 -3
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/themes.d.ts +1 -1
- package/components/button/themes/button/themes.js.map +1 -1
- package/components/button/themes/icon-button/themes.d.ts +1 -1
- package/components/button/themes/icon-button/themes.js.map +1 -1
- package/components/button-group/button-group.d.ts +42 -21
- package/components/button-group/button-group.js +101 -106
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/button.d.ts +1 -1
- package/components/button-group/themes/button.js.map +1 -1
- package/components/button-group/themes/group.d.ts +1 -1
- package/components/button-group/themes/group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +17 -10
- package/components/button-group/toggle-button.js +28 -13
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/base.d.ts +29 -10
- package/components/calendar/base.js +12 -15
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +39 -8
- package/components/calendar/calendar.js +96 -85
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +49 -22
- package/components/calendar/days-view/days-view.js +102 -163
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +3 -62
- package/components/calendar/helpers.js +6 -110
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/months-view/months-view.d.ts +7 -21
- package/components/calendar/months-view/months-view.js +30 -83
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/selection.d.ts +21 -0
- package/components/calendar/selection.js +42 -0
- package/components/calendar/selection.js.map +1 -0
- package/components/calendar/themes/calendar.d.ts +1 -1
- package/components/calendar/themes/calendar.js.map +1 -1
- package/components/calendar/themes/days.d.ts +1 -1
- package/components/calendar/themes/days.js.map +1 -1
- package/components/calendar/themes/year-month.d.ts +1 -1
- package/components/calendar/themes/year-month.js.map +1 -1
- package/components/calendar/types.d.ts +18 -0
- package/components/calendar/types.js.map +1 -1
- package/components/calendar/year-month-view.base.d.ts +44 -0
- package/components/calendar/year-month-view.base.js +89 -0
- package/components/calendar/year-month-view.base.js.map +1 -0
- package/components/calendar/years-view/years-view.d.ts +7 -20
- package/components/calendar/years-view/years-view.js +25 -79
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.actions.js +2 -2
- package/components/card/card.actions.js.map +1 -1
- package/components/card/card.content.d.ts +1 -1
- package/components/card/card.content.js +2 -2
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.d.ts +1 -1
- package/components/card/card.header.js +2 -2
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +2 -2
- package/components/card/card.js.map +1 -1
- package/components/card/card.media.d.ts +1 -1
- package/components/card/card.media.js +1 -1
- package/components/card/card.media.js.map +1 -1
- package/components/card/themes/actions.d.ts +1 -1
- package/components/card/themes/actions.js.map +1 -1
- package/components/card/themes/container.d.ts +1 -1
- package/components/card/themes/container.js.map +1 -1
- package/components/card/themes/content.d.ts +1 -1
- package/components/card/themes/content.js.map +1 -1
- package/components/card/themes/header.d.ts +1 -1
- package/components/card/themes/header.js.map +1 -1
- package/components/carousel/animations.d.ts +1 -1
- package/components/carousel/animations.js +2 -2
- package/components/carousel/animations.js.map +1 -1
- package/components/carousel/carousel-indicator-container.js +4 -4
- package/components/carousel/carousel-indicator-container.js.map +1 -1
- package/components/carousel/carousel-indicator.d.ts +1 -1
- package/components/carousel/carousel-indicator.js +5 -5
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -1
- package/components/carousel/carousel-slide.js +9 -9
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +7 -7
- package/components/carousel/carousel.js +39 -28
- package/components/carousel/carousel.js.map +1 -1
- package/components/carousel/themes/container.d.ts +1 -1
- package/components/carousel/themes/container.js.map +1 -1
- package/components/carousel/themes/indicator-container.d.ts +1 -1
- package/components/carousel/themes/indicator-container.js.map +1 -1
- package/components/chat/chat-input.d.ts +4 -4
- package/components/chat/chat-input.js +9 -8
- package/components/chat/chat-input.js.map +1 -1
- package/components/chat/chat-message.d.ts +1 -1
- package/components/chat/chat-message.js +7 -6
- package/components/chat/chat-message.js.map +1 -1
- package/components/chat/chat-state.d.ts +2 -2
- package/components/chat/chat-state.js +2 -1
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +4 -4
- package/components/chat/chat.js +7 -7
- package/components/chat/chat.js.map +1 -1
- package/components/chat/message-attachments.js +5 -5
- package/components/chat/message-attachments.js.map +1 -1
- package/components/chat/themes/attachments.d.ts +1 -1
- package/components/chat/themes/attachments.js.map +1 -1
- package/components/chat/themes/input.d.ts +1 -1
- package/components/chat/themes/input.js.map +1 -1
- package/components/chat/themes/message.d.ts +1 -1
- package/components/chat/themes/message.js.map +1 -1
- package/components/chat/themes/themes.d.ts +1 -1
- package/components/chat/themes/themes.js.map +1 -1
- package/components/chat/types.d.ts +2 -2
- package/components/chat/types.js.map +1 -1
- package/components/chat/utils.d.ts +1 -1
- package/components/chat/utils.js +3 -3
- package/components/chat/utils.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +7 -7
- package/components/checkbox/checkbox-base.js +7 -7
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +7 -6
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +7 -6
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/checkbox-themes.d.ts +1 -1
- package/components/checkbox/themes/checkbox-themes.js.map +1 -1
- package/components/checkbox/themes/switch-themes.d.ts +1 -1
- package/components/checkbox/themes/switch-themes.js.map +1 -1
- package/components/checkbox/validators.d.ts +1 -1
- package/components/checkbox/validators.js +1 -1
- package/components/checkbox/validators.js.map +1 -1
- package/components/chip/chip.d.ts +9 -3
- package/components/chip/chip.js +10 -6
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +1 -1
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/dark/chip.material.css.js +1 -1
- package/components/chip/themes/dark/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/light/chip.fluent.css.js +1 -1
- package/components/chip/themes/light/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/light/chip.indigo.css.js +1 -1
- package/components/chip/themes/light/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/light/chip.material.css.js +1 -1
- package/components/chip/themes/light/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.shared.css.js +1 -1
- package/components/chip/themes/light/chip.shared.css.js.map +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/themes.d.ts +1 -1
- package/components/chip/themes/themes.js.map +1 -1
- package/components/combo/combo-header.js +2 -2
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.d.ts +0 -2
- package/components/combo/combo-item.js +4 -7
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo.d.ts +84 -27
- package/components/combo/combo.js +194 -157
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +30 -3
- package/components/combo/controllers/data.js +34 -9
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +8 -2
- package/components/combo/controllers/navigation.js +11 -12
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/operations/filter.d.ts +17 -1
- package/components/combo/operations/filter.js +29 -9
- package/components/combo/operations/filter.js.map +1 -1
- package/components/combo/operations/group.js +1 -1
- package/components/combo/operations/group.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/themes/themes.d.ts +1 -1
- package/components/combo/themes/themes.js.map +1 -1
- package/components/combo/types.d.ts +8 -4
- package/components/combo/types.js.map +1 -1
- package/components/combo/validators.d.ts +1 -1
- package/components/combo/validators.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +294 -0
- package/components/date-picker/date-picker.base.js +480 -0
- package/components/date-picker/date-picker.base.js.map +1 -0
- package/components/date-picker/date-picker.d.ts +53 -174
- package/components/date-picker/date-picker.js +88 -399
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/themes.d.ts +1 -1
- package/components/date-picker/themes/themes.js.map +1 -1
- package/components/date-picker/validators.d.ts +1 -1
- package/components/date-picker/validators.js +2 -2
- package/components/date-picker/validators.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +12 -14
- package/components/date-range-picker/date-range-input.js +42 -98
- package/components/date-range-picker/date-range-input.js.map +1 -1
- package/components/date-range-picker/date-range-mask-parser.d.ts +22 -34
- package/components/date-range-picker/date-range-mask-parser.js +38 -69
- package/components/date-range-picker/date-range-mask-parser.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +97 -191
- package/components/date-range-picker/date-range-picker.js +210 -532
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +2 -2
- package/components/date-range-picker/predefined-ranges-area.js +5 -5
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/themes/ranges-themes.d.ts +1 -1
- package/components/date-range-picker/themes/ranges-themes.js.map +1 -1
- package/components/date-range-picker/themes/themes.d.ts +1 -1
- package/components/date-range-picker/themes/themes.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +1 -1
- package/components/date-range-picker/validators.js +15 -22
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-part.d.ts +18 -1
- package/components/date-time-input/date-part.js +10 -0
- package/components/date-time-input/date-part.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +72 -25
- package/components/date-time-input/date-time-input.base.js +100 -36
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +13 -23
- package/components/date-time-input/date-time-input.js +45 -65
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +45 -109
- package/components/date-time-input/datetime-mask-parser.js +88 -139
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/date-time-input/validators.d.ts +1 -1
- package/components/date-time-input/validators.js +2 -2
- package/components/date-time-input/validators.js.map +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +17 -18
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/themes.d.ts +1 -1
- package/components/dialog/themes/themes.js.map +1 -1
- package/components/divider/divider.d.ts +2 -1
- package/components/divider/divider.js +3 -3
- package/components/divider/divider.js.map +1 -1
- package/components/divider/themes/themes.d.ts +1 -1
- package/components/divider/themes/themes.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +10 -3
- package/components/dropdown/dropdown-group.js +21 -5
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +2 -2
- package/components/dropdown/dropdown-header.js +7 -2
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +4 -4
- package/components/dropdown/dropdown-item.js +3 -3
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +75 -32
- package/components/dropdown/dropdown.js +189 -110
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/container.d.ts +1 -1
- package/components/dropdown/themes/container.js.map +1 -1
- package/components/dropdown/themes/group.d.ts +1 -1
- package/components/dropdown/themes/group.js.map +1 -1
- package/components/dropdown/themes/header.d.ts +1 -1
- package/components/dropdown/themes/header.js.map +1 -1
- package/components/dropdown/themes/item.d.ts +1 -1
- package/components/dropdown/themes/item.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +14 -5
- package/components/expansion-panel/expansion-panel.js +10 -9
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/themes.d.ts +1 -1
- package/components/expansion-panel/themes/themes.js.map +1 -1
- package/components/file-input/file-input.d.ts +20 -12
- package/components/file-input/file-input.js +17 -12
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/themes.d.ts +1 -1
- package/components/file-input/themes/themes.js.map +1 -1
- package/components/file-input/validators.d.ts +1 -1
- package/components/file-input/validators.js +1 -1
- package/components/file-input/validators.js.map +1 -1
- package/components/focus-trap/focus-trap.js +3 -2
- package/components/focus-trap/focus-trap.js.map +1 -1
- package/components/highlight/highlight.js +2 -2
- package/components/highlight/highlight.js.map +1 -1
- package/components/highlight/service.d.ts +4 -1
- package/components/highlight/service.js +23 -7
- package/components/highlight/service.js.map +1 -1
- package/components/highlight/themes/themes.d.ts +1 -1
- package/components/highlight/themes/themes.js.map +1 -1
- package/components/icon/icon-references.d.ts +3 -2
- package/components/icon/icon-references.js +103 -491
- package/components/icon/icon-references.js.map +1 -1
- package/components/icon/icon-state.broadcast.d.ts +14 -17
- package/components/icon/icon-state.broadcast.js +19 -20
- package/components/icon/icon-state.broadcast.js.map +1 -1
- package/components/icon/icon.d.ts +12 -24
- package/components/icon/icon.js +36 -28
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.d.ts +69 -131
- package/components/icon/icon.registry.js +51 -53
- package/components/icon/icon.registry.js.map +1 -1
- package/components/icon/internal-icons-lib.js +2 -2
- package/components/icon/internal-icons-lib.js.map +1 -1
- package/components/icon/registry/parser.d.ts +15 -3
- package/components/icon/registry/parser.js +36 -11
- package/components/icon/registry/parser.js.map +1 -1
- package/components/icon/registry/types.d.ts +55 -11
- package/components/icon/registry/types.js.map +1 -1
- package/components/icon/themes/icon.base.css.js +1 -1
- package/components/icon/themes/icon.base.css.js.map +1 -1
- package/components/icon/themes/shared/icon.common.css.js +1 -1
- package/components/icon/themes/shared/icon.common.css.js.map +1 -1
- package/components/icon/themes/themes.d.ts +1 -1
- package/components/icon/themes/themes.js.map +1 -1
- package/components/input/input-base.d.ts +10 -25
- package/components/input/input-base.js +14 -23
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +15 -12
- package/components/input/input.js +8 -9
- package/components/input/input.js.map +1 -1
- package/components/input/themes/input.base.css.js +1 -1
- package/components/input/themes/input.base.css.js.map +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.common.css.js +1 -1
- package/components/input/themes/shared/input.common.css.js.map +1 -1
- package/components/input/themes/shared/input.fluent.css.js +1 -1
- package/components/input/themes/shared/input.fluent.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/input/themes/themes.d.ts +1 -1
- package/components/input/themes/themes.js.map +1 -1
- package/components/input/validators.d.ts +1 -1
- package/components/input/validators.js +1 -1
- package/components/input/validators.js.map +1 -1
- package/components/list/list-header.js +3 -3
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.js +3 -3
- package/components/list/list-item.js.map +1 -1
- package/components/list/list.js +3 -3
- package/components/list/list.js.map +1 -1
- package/components/list/themes/container.d.ts +1 -1
- package/components/list/themes/container.js.map +1 -1
- package/components/list/themes/header.d.ts +1 -1
- package/components/list/themes/header.js.map +1 -1
- package/components/list/themes/item.d.ts +1 -1
- package/components/list/themes/item.js.map +1 -1
- package/components/mask-input/mask-history.d.ts +99 -0
- package/components/mask-input/mask-history.js +95 -0
- package/components/mask-input/mask-history.js.map +1 -0
- package/components/mask-input/mask-input.d.ts +14 -9
- package/components/mask-input/mask-input.js +20 -24
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.d.ts +20 -2
- package/components/mask-input/mask-parser.js +21 -13
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/mask-input/validators.d.ts +1 -1
- package/components/mask-input/validators.js +1 -1
- package/components/mask-input/validators.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.d.ts +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +2 -2
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.d.ts +2 -2
- package/components/nav-drawer/nav-drawer-item.js +4 -4
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +3 -3
- package/components/nav-drawer/nav-drawer.js +11 -14
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/nav-drawer/themes/container.d.ts +1 -1
- package/components/nav-drawer/themes/container.js +2 -3
- package/components/nav-drawer/themes/container.js.map +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.js.map +1 -1
- package/components/nav-drawer/themes/header-item.d.ts +1 -1
- package/components/nav-drawer/themes/header-item.js.map +1 -1
- package/components/nav-drawer/themes/item.d.ts +1 -1
- package/components/nav-drawer/themes/item.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js.map +1 -1
- package/components/navbar/navbar.js +2 -2
- package/components/navbar/navbar.js.map +1 -1
- package/components/navbar/themes/themes.d.ts +1 -1
- package/components/navbar/themes/themes.js.map +1 -1
- package/components/popover/popover.d.ts +10 -3
- package/components/popover/popover.js +114 -99
- package/components/popover/popover.js.map +1 -1
- package/components/progress/base.d.ts +1 -1
- package/components/progress/base.js +5 -4
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-gradient.d.ts +2 -2
- package/components/progress/circular-gradient.js +1 -1
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.d.ts +15 -15
- package/components/progress/circular-progress.js +7 -6
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.d.ts +12 -12
- package/components/progress/linear-progress.js +4 -4
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js.map +1 -1
- package/components/progress/themes/circular/themes.d.ts +1 -1
- package/components/progress/themes/circular/themes.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/themes.d.ts +1 -1
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/qr-code/model/encode.d.ts +20 -0
- package/components/qr-code/model/encode.js +166 -0
- package/components/qr-code/model/encode.js.map +1 -0
- package/components/qr-code/model/error-correction.d.ts +15 -0
- package/components/qr-code/model/error-correction.js +1114 -0
- package/components/qr-code/model/error-correction.js.map +1 -0
- package/components/qr-code/model/mask.d.ts +11 -0
- package/components/qr-code/model/mask.js +161 -0
- package/components/qr-code/model/mask.js.map +1 -0
- package/components/qr-code/model/matrix.d.ts +15 -0
- package/components/qr-code/model/matrix.js +277 -0
- package/components/qr-code/model/matrix.js.map +1 -0
- package/components/qr-code/qr-code.d.ts +134 -0
- package/components/qr-code/qr-code.js +221 -0
- package/components/qr-code/qr-code.js.map +1 -0
- package/components/qr-code/renderer/constants.d.ts +26 -0
- package/components/qr-code/renderer/constants.js +5 -0
- package/components/qr-code/renderer/constants.js.map +1 -0
- package/components/qr-code/renderer/corner.d.ts +23 -0
- package/components/qr-code/renderer/corner.js +25 -0
- package/components/qr-code/renderer/corner.js.map +1 -0
- package/components/qr-code/renderer/dots.d.ts +14 -0
- package/components/qr-code/renderer/dots.js +7 -0
- package/components/qr-code/renderer/dots.js.map +1 -0
- package/components/qr-code/renderer/helpers.d.ts +18 -0
- package/components/qr-code/renderer/helpers.js +158 -0
- package/components/qr-code/renderer/helpers.js.map +1 -0
- package/components/qr-code/renderer/image.d.ts +23 -0
- package/components/qr-code/renderer/image.js +29 -0
- package/components/qr-code/renderer/image.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js.map +1 -0
- package/components/qr-code/themes/qr-code.base.css.d.ts +1 -0
- package/components/qr-code/themes/qr-code.base.css.js +3 -0
- package/components/qr-code/themes/qr-code.base.css.js.map +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.d.ts +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js +3 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js.map +1 -0
- package/components/qr-code/themes/themes.d.ts +2 -0
- package/components/qr-code/themes/themes.js +46 -0
- package/components/qr-code/themes/themes.js.map +1 -0
- package/components/qr-code/types.d.ts +16 -0
- package/components/qr-code/types.js +2 -0
- package/components/qr-code/types.js.map +1 -0
- package/components/radio/controller.d.ts +35 -0
- package/components/radio/controller.js +100 -0
- package/components/radio/controller.js.map +1 -0
- package/components/radio/radio.d.ts +26 -14
- package/components/radio/radio.js +47 -36
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/themes.d.ts +1 -1
- package/components/radio/themes/themes.js.map +1 -1
- package/components/radio/validators.d.ts +1 -1
- package/components/radio/validators.js +5 -3
- package/components/radio/validators.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +19 -10
- package/components/radio-group/radio-group.js +50 -41
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/themes/themes.d.ts +1 -1
- package/components/radio-group/themes/themes.js.map +1 -1
- package/components/rating/rating-symbol.d.ts +1 -1
- package/components/rating/rating-symbol.js +1 -1
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.d.ts +6 -6
- package/components/rating/rating.js +12 -9
- package/components/rating/rating.js.map +1 -1
- package/components/rating/themes/themes.d.ts +1 -1
- package/components/rating/themes/themes.js.map +1 -1
- package/components/resize-container/resize-container.d.ts +4 -4
- package/components/resize-container/resize-container.js +4 -4
- package/components/resize-container/resize-container.js.map +1 -1
- package/components/resize-container/resize-controller.js +2 -2
- package/components/resize-container/resize-controller.js.map +1 -1
- package/components/resize-container/themes/themes.d.ts +1 -1
- package/components/resize-container/themes/themes.js.map +1 -1
- package/components/ripple/ripple.d.ts +1 -1
- package/components/ripple/ripple.js +3 -2
- package/components/ripple/ripple.js.map +1 -1
- package/components/select/select-group.d.ts +9 -2
- package/components/select/select-group.js +21 -5
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-header.d.ts +1 -1
- package/components/select/select-header.js +7 -2
- package/components/select/select-header.js.map +1 -1
- package/components/select/select-item.d.ts +4 -4
- package/components/select/select-item.js +3 -3
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.d.ts +48 -27
- package/components/select/select.js +128 -74
- package/components/select/select.js.map +1 -1
- package/components/select/themes/select.base.css.js +1 -1
- package/components/select/themes/select.base.css.js.map +1 -1
- package/components/select/themes/themes.d.ts +1 -1
- package/components/select/themes/themes.js.map +1 -1
- package/components/select/validators.d.ts +1 -1
- package/components/select/validators.js +1 -1
- package/components/select/validators.js.map +1 -1
- package/components/slider/range-slider.d.ts +2 -2
- package/components/slider/range-slider.js +3 -3
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.js +9 -5
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider-label.js +1 -1
- package/components/slider/slider-label.js.map +1 -1
- package/components/slider/slider.d.ts +3 -3
- package/components/slider/slider.js +6 -6
- package/components/slider/slider.js.map +1 -1
- package/components/slider/themes/themes.d.ts +1 -1
- package/components/slider/themes/themes.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +3 -3
- package/components/snackbar/snackbar.js +4 -4
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/themes.d.ts +1 -1
- package/components/snackbar/themes/themes.js.map +1 -1
- package/components/splitter/splitter.d.ts +106 -23
- package/components/splitter/splitter.js +234 -147
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/themes/themes.d.ts +1 -1
- package/components/splitter/themes/themes.js.map +1 -1
- package/components/splitter/types.d.ts +14 -3
- package/components/splitter/types.js.map +1 -1
- package/components/stepper/common/animations.d.ts +1 -1
- package/components/stepper/common/animations.js +2 -2
- package/components/stepper/common/animations.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +7 -7
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +5 -5
- package/components/stepper/stepper.js +12 -9
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/themes.d.ts +1 -1
- package/components/stepper/themes/step/themes.js.map +1 -1
- package/components/tabs/tab-dom.d.ts +31 -28
- package/components/tabs/tab-dom.js +84 -34
- package/components/tabs/tab-dom.js.map +1 -1
- package/components/tabs/tab.d.ts +24 -6
- package/components/tabs/tab.js +34 -13
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +36 -22
- package/components/tabs/tabs.js +113 -102
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
- package/components/tabs/themes/tab-themes.d.ts +1 -1
- package/components/tabs/themes/tab-themes.js.map +1 -1
- package/components/tabs/themes/tabs-themes.d.ts +1 -1
- package/components/tabs/themes/tabs-themes.js.map +1 -1
- package/components/tabs/themes/tabs.base.css.js +1 -1
- package/components/tabs/themes/tabs.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +19 -14
- package/components/textarea/textarea.js +22 -17
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/themes.d.ts +1 -1
- package/components/textarea/themes/themes.js.map +1 -1
- package/components/textarea/validators.d.ts +1 -1
- package/components/textarea/validators.js +1 -1
- package/components/textarea/validators.js.map +1 -1
- package/components/theme-provider/theme-provider.d.ts +1 -1
- package/components/theme-provider/theme-provider.js +2 -2
- package/components/theme-provider/theme-provider.js.map +1 -1
- package/components/tile-manager/position.d.ts +1 -1
- package/components/tile-manager/position.js +2 -2
- package/components/tile-manager/position.js.map +1 -1
- package/components/tile-manager/resize-state.js +4 -3
- package/components/tile-manager/resize-state.js.map +1 -1
- package/components/tile-manager/themes/container.d.ts +1 -1
- package/components/tile-manager/themes/container.js.map +1 -1
- package/components/tile-manager/themes/tile.d.ts +1 -1
- package/components/tile-manager/themes/tile.js.map +1 -1
- package/components/tile-manager/tile-ghost-util.js +1 -1
- package/components/tile-manager/tile-ghost-util.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +1 -1
- package/components/tile-manager/tile-manager.js +7 -7
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +4 -4
- package/components/tile-manager/tile.js +16 -13
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/themes/themes.d.ts +1 -1
- package/components/toast/themes/themes.js.map +1 -1
- package/components/toast/toast.d.ts +1 -1
- package/components/toast/toast.js +3 -3
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.d.ts +18 -16
- package/components/tooltip/controller.js +62 -41
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/service.d.ts +2 -1
- package/components/tooltip/service.js +10 -15
- package/components/tooltip/service.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js.map +1 -1
- package/components/tooltip/themes/themes.d.ts +1 -1
- package/components/tooltip/themes/themes.js.map +1 -1
- package/components/tooltip/themes/tooltip.base.css.js +1 -1
- package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
- package/components/tooltip/tooltip.d.ts +64 -18
- package/components/tooltip/tooltip.js +110 -60
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/tree/themes/container.base.css.js +1 -1
- package/components/tree/themes/container.base.css.js.map +1 -1
- package/components/tree/themes/container.d.ts +1 -1
- package/components/tree/themes/container.js.map +1 -1
- package/components/tree/themes/item.base.css.js +1 -1
- package/components/tree/themes/item.base.css.js.map +1 -1
- package/components/tree/themes/item.d.ts +1 -1
- package/components/tree/themes/item.js.map +1 -1
- package/components/tree/tree-item.d.ts +62 -36
- package/components/tree/tree-item.js +198 -208
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.common.d.ts +16 -1
- package/components/tree/tree.common.js +40 -1
- package/components/tree/tree.common.js.map +1 -1
- package/components/tree/tree.d.ts +21 -14
- package/components/tree/tree.js +64 -72
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +39 -29
- package/components/tree/tree.navigation.js +140 -192
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.d.ts +32 -31
- package/components/tree/tree.selection.js +184 -178
- package/components/tree/tree.selection.js.map +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +1 -1
- package/components/validation-container/validation-container.js +7 -6
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +92 -0
- package/components/virtualization/engine.js +217 -0
- package/components/virtualization/engine.js.map +1 -0
- package/components/virtualization/types.d.ts +53 -0
- package/components/virtualization/types.js +14 -0
- package/components/virtualization/types.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +235 -0
- package/components/virtualization/virtualization.js +474 -0
- package/components/virtualization/virtualization.js.map +1 -0
- package/components/visually-hidden/visually-hidden.js +1 -1
- package/components/visually-hidden/visually-hidden.js.map +1 -1
- package/custom-elements.json +57745 -48130
- package/extras/chat-markdown-renderer.d.ts +1 -1
- package/extras/chat-markdown-renderer.js.map +1 -1
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +17 -12
- package/index.js +11 -9
- package/index.js.map +1 -1
- package/internals/abort-handler.js.map +1 -0
- package/internals/context.d.ts +39 -0
- package/{components/common → internals}/context.js +2 -1
- package/internals/context.js.map +1 -0
- package/internals/controllers/adopt-styles.d.ts +76 -0
- package/internals/controllers/adopt-styles.js +173 -0
- package/internals/controllers/adopt-styles.js.map +1 -0
- package/internals/controllers/aria-projection.d.ts +144 -0
- package/internals/controllers/aria-projection.js +138 -0
- package/internals/controllers/aria-projection.js.map +1 -0
- package/{components/common → internals}/controllers/async-consumer.js +8 -7
- package/internals/controllers/async-consumer.js.map +1 -0
- package/internals/controllers/command.js.map +1 -0
- package/{components/common → internals}/controllers/drag.js +3 -2
- package/internals/controllers/drag.js.map +1 -0
- package/{components/common → internals}/controllers/focus-ring.js +5 -2
- package/internals/controllers/focus-ring.js.map +1 -0
- package/{components/common → internals}/controllers/fullscreen.js +6 -3
- package/internals/controllers/fullscreen.js.map +1 -0
- package/{components/common → internals}/controllers/gestures.d.ts +1 -1
- package/{components/common → internals}/controllers/gestures.js +4 -4
- package/internals/controllers/gestures.js.map +1 -0
- package/{components/common → internals}/controllers/id-resolver.js +15 -21
- package/internals/controllers/id-resolver.js.map +1 -0
- package/{components/common → internals}/controllers/internals.d.ts +39 -3
- package/{components/common → internals}/controllers/internals.js +28 -0
- package/internals/controllers/internals.js.map +1 -0
- package/{components/common → internals}/controllers/key-bindings.d.ts +3 -6
- package/{components/common → internals}/controllers/key-bindings.js +43 -29
- package/internals/controllers/key-bindings.js.map +1 -0
- package/{components/common → internals}/controllers/mutation-observer.d.ts +3 -2
- package/{components/common → internals}/controllers/mutation-observer.js +24 -22
- package/internals/controllers/mutation-observer.js.map +1 -0
- package/{components/common → internals}/controllers/resize-observer.d.ts +11 -1
- package/{components/common → internals}/controllers/resize-observer.js +13 -2
- package/internals/controllers/resize-observer.js.map +1 -0
- package/{components/common → internals}/controllers/root-click.js +8 -13
- package/internals/controllers/root-click.js.map +1 -0
- package/{components/common → internals}/controllers/root-scroll.d.ts +11 -8
- package/internals/controllers/root-scroll.js +71 -0
- package/internals/controllers/root-scroll.js.map +1 -0
- package/{components/common → internals}/controllers/slot.d.ts +17 -1
- package/{components/common → internals}/controllers/slot.js +18 -6
- package/internals/controllers/slot.js.map +1 -0
- package/internals/date/compare.d.ts +2 -0
- package/internals/date/compare.js +23 -0
- package/internals/date/compare.js.map +1 -0
- package/internals/date/converters.d.ts +18 -0
- package/internals/date/converters.js +73 -0
- package/internals/date/converters.js.map +1 -0
- package/{components/calendar → internals/date}/model.d.ts +6 -3
- package/{components/calendar → internals/date}/model.js +23 -0
- package/internals/date/model.js.map +1 -0
- package/internals/decorators/blazorAdditionalDependencies.js.map +1 -0
- package/internals/decorators/blazorDeepImport.js.map +1 -0
- package/internals/decorators/blazorInclude.js.map +1 -0
- package/internals/decorators/blazorIndirectRender.js.map +1 -0
- package/internals/decorators/blazorSuppressComponent.js.map +1 -0
- package/internals/decorators/shadow-options.js.map +1 -0
- package/internals/decorators/watch.js.map +1 -0
- package/internals/definitions/defineAllComponents.js +153 -0
- package/internals/definitions/defineAllComponents.js.map +1 -0
- package/internals/definitions/defineComponents.js.map +1 -0
- package/internals/definitions/register.js.map +1 -0
- package/{components/common → internals}/i18n/EN/calendar.resources.js +1 -1
- package/internals/i18n/EN/calendar.resources.js.map +1 -0
- package/internals/i18n/EN/chat.resources.js.map +1 -0
- package/internals/i18n/EN/date-picker.resources.js.map +1 -0
- package/internals/i18n/EN/date-range-picker.resources.js.map +1 -0
- package/internals/i18n/i18n-controller.js.map +1 -0
- package/{components/common → internals}/i18n/utils.js +1 -1
- package/internals/i18n/utils.js.map +1 -0
- package/{components/common → internals}/mixins/alert.d.ts +2 -2
- package/{components/common → internals}/mixins/alert.js +3 -3
- package/internals/mixins/alert.js.map +1 -0
- package/{components/common → internals}/mixins/combo-box.d.ts +10 -2
- package/{components/common → internals}/mixins/combo-box.js +9 -4
- package/internals/mixins/combo-box.js.map +1 -0
- package/internals/mixins/constructor.js.map +1 -0
- package/internals/mixins/event-emitter.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated-required.js +10 -19
- package/internals/mixins/forms/associated-required.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated.js +45 -38
- package/internals/mixins/forms/associated.js.map +1 -0
- package/{components/common → internals}/mixins/forms/form-transformers.d.ts +1 -1
- package/{components/common → internals}/mixins/forms/form-transformers.js +2 -2
- package/internals/mixins/forms/form-transformers.js.map +1 -0
- package/internals/mixins/forms/form-value.js.map +1 -0
- package/{components/common → internals}/mixins/forms/types.d.ts +5 -6
- package/internals/mixins/forms/types.js.map +1 -0
- package/{components/common → internals}/mixins/mask-behavior.d.ts +11 -3
- package/{components/common → internals}/mixins/mask-behavior.js +117 -29
- package/internals/mixins/mask-behavior.js.map +1 -0
- package/{components/common → internals}/mixins/option.d.ts +0 -2
- package/{components/common → internals}/mixins/option.js +1 -4
- package/internals/mixins/option.js.map +1 -0
- package/internals/part-map.js.map +1 -0
- package/{components/common → internals}/templates/input-shell.d.ts +8 -1
- package/{components/common → internals}/templates/input-shell.js +14 -4
- package/internals/templates/input-shell.js.map +1 -0
- package/{components/common → internals}/templates/masked-input.d.ts +8 -4
- package/{components/common → internals}/templates/masked-input.js +4 -3
- package/internals/templates/masked-input.js.map +1 -0
- package/internals/utils/arrays.d.ts +53 -0
- package/internals/utils/arrays.js +31 -0
- package/internals/utils/arrays.js.map +1 -0
- package/internals/utils/dom.d.ts +92 -0
- package/internals/utils/dom.js +143 -0
- package/internals/utils/dom.js.map +1 -0
- package/internals/utils/events.d.ts +41 -0
- package/internals/utils/events.js +37 -0
- package/internals/utils/events.js.map +1 -0
- package/internals/utils/lit.d.ts +8 -0
- package/internals/utils/lit.js +15 -0
- package/internals/utils/lit.js.map +1 -0
- package/internals/utils/math.d.ts +50 -0
- package/internals/utils/math.js +38 -0
- package/internals/utils/math.js.map +1 -0
- package/internals/utils/objects.d.ts +25 -0
- package/internals/utils/objects.js +125 -0
- package/internals/utils/objects.js.map +1 -0
- package/internals/utils/strings.d.ts +44 -0
- package/internals/utils/strings.js +46 -0
- package/internals/utils/strings.js.map +1 -0
- package/internals/utils/types.d.ts +13 -0
- package/internals/utils/types.js +31 -0
- package/internals/utils/types.js.map +1 -0
- package/{components/common → internals}/validators.d.ts +1 -1
- package/{components/common → internals}/validators.js +4 -2
- package/internals/validators.js.map +1 -0
- package/package.json +15 -7
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/themes/light/bootstrap.css +1 -1
- package/themes/light/fluent.css +1 -1
- package/themes/light/indigo.css +1 -1
- package/themes/light/material.css +1 -1
- package/theming/theming-controller.d.ts +2 -2
- package/theming/theming-controller.js.map +1 -1
- package/web-types.json +3 -3
- package/components/calendar/model.js.map +0 -1
- package/components/combo/combo-list.d.ts +0 -11
- package/components/combo/combo-list.js +0 -13
- package/components/combo/combo-list.js.map +0 -1
- package/components/common/abort-handler.js.map +0 -1
- package/components/common/context.d.ts +0 -25
- package/components/common/context.js.map +0 -1
- package/components/common/controllers/adopt-styles.d.ts +0 -124
- package/components/common/controllers/adopt-styles.js +0 -75
- package/components/common/controllers/adopt-styles.js.map +0 -1
- package/components/common/controllers/async-consumer.js.map +0 -1
- package/components/common/controllers/command.js.map +0 -1
- package/components/common/controllers/drag.js.map +0 -1
- package/components/common/controllers/focus-ring.js.map +0 -1
- package/components/common/controllers/fullscreen.js.map +0 -1
- package/components/common/controllers/gestures.js.map +0 -1
- package/components/common/controllers/id-resolver.js.map +0 -1
- package/components/common/controllers/internals.js.map +0 -1
- package/components/common/controllers/key-bindings.js.map +0 -1
- package/components/common/controllers/mutation-observer.js.map +0 -1
- package/components/common/controllers/resize-observer.js.map +0 -1
- package/components/common/controllers/root-click.js.map +0 -1
- package/components/common/controllers/root-scroll.js +0 -63
- package/components/common/controllers/root-scroll.js.map +0 -1
- package/components/common/controllers/slot.js.map +0 -1
- package/components/common/decorators/blazorAdditionalDependencies.js.map +0 -1
- package/components/common/decorators/blazorDeepImport.js.map +0 -1
- package/components/common/decorators/blazorInclude.js.map +0 -1
- package/components/common/decorators/blazorIndirectRender.js.map +0 -1
- package/components/common/decorators/blazorSuppressComponent.js.map +0 -1
- package/components/common/decorators/shadow-options.js.map +0 -1
- package/components/common/decorators/watch.js.map +0 -1
- package/components/common/definitions/defineAllComponents.js +0 -151
- package/components/common/definitions/defineAllComponents.js.map +0 -1
- package/components/common/definitions/defineComponents.js.map +0 -1
- package/components/common/definitions/register.js.map +0 -1
- package/components/common/i18n/EN/calendar.resources.js.map +0 -1
- package/components/common/i18n/EN/chat.resources.js.map +0 -1
- package/components/common/i18n/EN/date-picker.resources.js.map +0 -1
- package/components/common/i18n/EN/date-range-picker.resources.js.map +0 -1
- package/components/common/i18n/i18n-controller.js.map +0 -1
- package/components/common/i18n/utils.js.map +0 -1
- package/components/common/mixins/alert.js.map +0 -1
- package/components/common/mixins/combo-box.js.map +0 -1
- package/components/common/mixins/constructor.js.map +0 -1
- package/components/common/mixins/event-emitter.js.map +0 -1
- package/components/common/mixins/forms/associated-required.js.map +0 -1
- package/components/common/mixins/forms/associated.js.map +0 -1
- package/components/common/mixins/forms/form-transformers.js.map +0 -1
- package/components/common/mixins/forms/form-value.js.map +0 -1
- package/components/common/mixins/forms/types.js.map +0 -1
- package/components/common/mixins/mask-behavior.js.map +0 -1
- package/components/common/mixins/option.js.map +0 -1
- package/components/common/part-map.js.map +0 -1
- package/components/common/templates/input-shell.js.map +0 -1
- package/components/common/templates/masked-input.js.map +0 -1
- package/components/common/util.d.ts +0 -196
- package/components/common/util.js +0 -390
- package/components/common/util.js.map +0 -1
- package/components/common/validators.js.map +0 -1
- package/components/icon/registry/default-map.d.ts +0 -107
- package/components/icon/registry/default-map.js +0 -25
- package/components/icon/registry/default-map.js.map +0 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js +0 -3
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js.map +0 -1
- package/components/radio/utils.d.ts +0 -13
- package/components/radio/utils.js +0 -37
- package/components/radio/utils.js.map +0 -1
- /package/components/{nav-drawer/themes/shared/container/nav-drawer.fluent.css.d.ts → qr-code/themes/dark/qr-code.bootstrap.css.d.ts} +0 -0
- /package/{components/common → internals}/abort-handler.d.ts +0 -0
- /package/{components/common → internals}/abort-handler.js +0 -0
- /package/{components/common → internals}/controllers/async-consumer.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.js +0 -0
- /package/{components/common → internals}/controllers/drag.d.ts +0 -0
- /package/{components/common → internals}/controllers/focus-ring.d.ts +0 -0
- /package/{components/common → internals}/controllers/fullscreen.d.ts +0 -0
- /package/{components/common → internals}/controllers/id-resolver.d.ts +0 -0
- /package/{components/common → internals}/controllers/root-click.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.js +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.js +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.js +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.js +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.js +0 -0
- /package/{components/common → internals}/decorators/shadow-options.d.ts +0 -0
- /package/{components/common → internals}/decorators/shadow-options.js +0 -0
- /package/{components/common → internals}/decorators/watch.d.ts +0 -0
- /package/{components/common → internals}/decorators/watch.js +0 -0
- /package/{components/common → internals}/definitions/defineAllComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.js +0 -0
- /package/{components/common → internals}/definitions/register.d.ts +0 -0
- /package/{components/common → internals}/definitions/register.js +0 -0
- /package/{components/common → internals}/i18n/EN/calendar.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.d.ts +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.js +0 -0
- /package/{components/common → internals}/i18n/utils.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.js +0 -0
- /package/{components/common → internals}/mixins/event-emitter.d.ts +0 -0
- /package/{components/common → internals}/mixins/event-emitter.js +0 -0
- /package/{components/common → internals}/mixins/forms/associated-required.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/associated.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.js +0 -0
- /package/{components/common → internals}/mixins/forms/types.js +0 -0
- /package/{components/common → internals}/part-map.d.ts +0 -0
- /package/{components/common → internals}/part-map.js +0 -0
|
@@ -1,200 +1,138 @@
|
|
|
1
|
-
import type { Theme } from '
|
|
2
|
-
import type { IconCallback, IconMeta, IconReferencePair, SvgIcon } from './registry/types.js';
|
|
1
|
+
import type { Theme } from '#theming/types.js';
|
|
2
|
+
import type { IconCallback, IconMeta, IconReferencePair, RegisterIconOptions, SvgIcon } from './registry/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Global singleton registry for managing SVG icons and their references.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* The
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
* - Cross-context synchronization via BroadcastChannel
|
|
12
|
-
* - Batched notifications for performance optimization
|
|
7
|
+
* The registry stores SVG icons in named collections, resolves aliases against
|
|
8
|
+
* the active theme, notifies subscribers once per microtask however many icons
|
|
9
|
+
* changed, and publishes user-set state to other browsing contexts (see
|
|
10
|
+
* {@link IconsStateBroadcast}).
|
|
13
11
|
*
|
|
14
|
-
*
|
|
15
|
-
* across the entire application, even with multiple bundle instances.
|
|
16
|
-
*
|
|
17
|
-
* @internal This class is not directly exposed. Use the exported functions instead.
|
|
12
|
+
* @internal Not exposed directly - use the exported functions.
|
|
18
13
|
*/
|
|
19
14
|
declare class IconsRegistry {
|
|
20
|
-
/** Set of callbacks subscribed to icon change notifications */
|
|
21
15
|
private readonly _listeners;
|
|
22
|
-
/** Set of pending icon:collection keys awaiting notification */
|
|
23
|
-
private readonly _pendingNotifications;
|
|
24
|
-
/** Map of icon references/aliases by collection and name */
|
|
25
16
|
private readonly _references;
|
|
26
|
-
/** Map of registered SVG icons by collection and name */
|
|
27
17
|
private readonly _collections;
|
|
28
|
-
/** Parser for converting SVG text to icon metadata */
|
|
29
18
|
private readonly _svgIconParser;
|
|
30
|
-
/** Broadcast channel manager for cross-context synchronization */
|
|
31
19
|
private readonly _broadcast;
|
|
32
|
-
/** Flag indicating if a notification microtask is scheduled */
|
|
33
20
|
private _notificationScheduled;
|
|
34
21
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param name - The unique name for the icon within its collection
|
|
38
|
-
* @param iconText - The SVG markup as a string
|
|
39
|
-
* @param collection - The collection to register the icon in (default: 'default')
|
|
40
|
-
*
|
|
41
|
-
* @remarks
|
|
42
|
-
* This method:
|
|
43
|
-
* 1. Parses the SVG text into icon metadata
|
|
44
|
-
* 2. Stores the icon in the specified collection
|
|
45
|
-
* 3. Broadcasts the registration to other contexts
|
|
46
|
-
* 4. Notifies subscribed components (batched)
|
|
22
|
+
* Parses and stores an SVG icon, then publishes and notifies.
|
|
47
23
|
*
|
|
48
|
-
* @
|
|
24
|
+
* @param stripMeta - See {@link RegisterIconOptions.stripMeta}.
|
|
25
|
+
* @throws If the SVG text is malformed.
|
|
49
26
|
*/
|
|
50
|
-
register(name: string, iconText: string, collection?: string): void;
|
|
27
|
+
register(name: string, iconText: string, collection?: string, stripMeta?: boolean): void;
|
|
51
28
|
/**
|
|
52
|
-
* Subscribes a callback to
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @remarks
|
|
57
|
-
* The callback receives the icon name and collection when changes occur.
|
|
58
|
-
* Notifications are batched using microtasks for performance.
|
|
29
|
+
* Subscribes a callback to registry changes. It is invoked once per
|
|
30
|
+
* microtask, however many icons changed, so subscribers re-resolve their
|
|
31
|
+
* own state.
|
|
59
32
|
*/
|
|
60
33
|
subscribe(callback: IconCallback): void;
|
|
61
|
-
/**
|
|
62
|
-
* Unsubscribes a callback from icon change notifications.
|
|
63
|
-
*
|
|
64
|
-
* @param callback - The previously subscribed callback to remove
|
|
65
|
-
*/
|
|
34
|
+
/** Unsubscribes a previously subscribed callback. */
|
|
66
35
|
unsubscribe(callback: IconCallback): void;
|
|
67
36
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* @param options - Configuration for the icon reference
|
|
37
|
+
* Aliases an icon name to another icon.
|
|
71
38
|
*
|
|
72
39
|
* @remarks
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* - System-set (external: false) - used internally, not synced
|
|
77
|
-
*
|
|
78
|
-
* When overwrite is true, the reference is stored and subscribers are notified.
|
|
79
|
-
* When external is true, the reference is broadcast to other contexts.
|
|
40
|
+
* `overwrite` stores the reference and notifies subscribers; `external`
|
|
41
|
+
* marks it as user-set, which takes precedence over the built-in theme
|
|
42
|
+
* aliases and is published to other browsing contexts.
|
|
80
43
|
*/
|
|
81
44
|
setIconRef(options: IconReferencePair): void;
|
|
82
45
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @param name - The icon name or alias
|
|
86
|
-
* @param collection - The collection name
|
|
87
|
-
* @param theme - The theme to use for resolving aliases
|
|
88
|
-
* @returns The resolved icon metadata (without the internal 'external' flag)
|
|
46
|
+
* Resolves a name that may be an alias to the icon it points at, for the
|
|
47
|
+
* given theme. The result never carries the internal `external` flag.
|
|
89
48
|
*/
|
|
90
49
|
getIconRef(name: string, collection: string, theme?: Theme): IconMeta;
|
|
91
|
-
/**
|
|
92
|
-
* Retrieves an icon from the registry.
|
|
93
|
-
*
|
|
94
|
-
* @param name - The icon name
|
|
95
|
-
* @param collection - The collection name (default: 'default')
|
|
96
|
-
* @returns The SVG icon metadata, or undefined if not found
|
|
97
|
-
*
|
|
98
|
-
* @remarks
|
|
99
|
-
* Use `getIconRef` first to resolve aliases before calling this method.
|
|
100
|
-
*/
|
|
50
|
+
/** Retrieves an icon. Resolve aliases with `getIconRef` first. */
|
|
101
51
|
get(name: string, collection?: string): SvgIcon | undefined;
|
|
102
52
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* @param name - The icon name that changed
|
|
106
|
-
* @param collection - The collection name
|
|
107
|
-
*
|
|
108
|
-
* @remarks
|
|
109
|
-
* Notifications are batched in a microtask queue to avoid excessive
|
|
110
|
-
* listener calls when multiple icons are registered synchronously.
|
|
111
|
-
* Duplicate icon:collection pairs are automatically deduplicated.
|
|
112
|
-
*
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
private _notifyAll;
|
|
116
|
-
/**
|
|
117
|
-
* Flushes pending notifications to all subscribed listeners.
|
|
118
|
-
*
|
|
119
|
-
* @remarks
|
|
120
|
-
* This method is called as a microtask after icons are registered.
|
|
121
|
-
* It processes all pending icon:collection pairs and notifies listeners.
|
|
122
|
-
*
|
|
123
|
-
* @internal
|
|
53
|
+
* Notifies subscribers, coalescing a burst of changes in the same microtask
|
|
54
|
+
* into a single notification.
|
|
124
55
|
*/
|
|
125
|
-
private
|
|
56
|
+
private _notify;
|
|
126
57
|
}
|
|
127
58
|
/**
|
|
128
|
-
* Gets the
|
|
59
|
+
* Gets the icon registry, creating it on first use. The well-known symbol on
|
|
60
|
+
* `globalThis` keeps it a single instance even across multiple bundles.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getIconRegistry(): IconsRegistry;
|
|
63
|
+
/**
|
|
64
|
+
* Registers an icon by fetching it from a URL.
|
|
129
65
|
*
|
|
130
|
-
* @
|
|
66
|
+
* @param name - The unique name for the icon
|
|
67
|
+
* @param url - The URL to fetch the SVG icon from
|
|
68
|
+
* @param collection - The collection to register the icon in (default: `'default'`)
|
|
131
69
|
*
|
|
132
|
-
* @
|
|
133
|
-
* This function ensures only one instance of the registry exists globally,
|
|
134
|
-
* even across multiple bundle instances. The registry is stored on globalThis
|
|
135
|
-
* using a well-known Symbol.
|
|
70
|
+
* @returns A promise that resolves when the icon is registered
|
|
136
71
|
*
|
|
137
|
-
* @
|
|
138
|
-
* ```typescript
|
|
139
|
-
* const registry = getIconRegistry();
|
|
140
|
-
* registry.subscribe((name, collection) => {
|
|
141
|
-
* console.log(`Icon ${name} changed in ${collection}`);
|
|
142
|
-
* });
|
|
143
|
-
* ```
|
|
72
|
+
* @throws If the HTTP request fails or returns a non-OK status
|
|
144
73
|
*/
|
|
145
|
-
export declare function
|
|
74
|
+
export declare function registerIcon(name: string, url: string, collection?: string): Promise<void>;
|
|
146
75
|
/**
|
|
147
76
|
* Registers an icon by fetching it from a URL.
|
|
148
77
|
*
|
|
149
78
|
* @param name - The unique name for the icon
|
|
150
79
|
* @param url - The URL to fetch the SVG icon from
|
|
151
|
-
* @param
|
|
80
|
+
* @param options - Registration options: target collection and/or `stripMeta`
|
|
152
81
|
*
|
|
153
82
|
* @returns A promise that resolves when the icon is registered
|
|
154
83
|
*
|
|
155
84
|
* @throws If the HTTP request fails or returns a non-OK status
|
|
156
85
|
*
|
|
157
86
|
* @remarks
|
|
158
|
-
* This
|
|
159
|
-
*
|
|
160
|
-
* components in the application.
|
|
87
|
+
* This overload accepts a {@link RegisterIconOptions} object so you can control
|
|
88
|
+
* the target collection **and** opt into SVG meta stripping in one call:
|
|
161
89
|
*
|
|
162
|
-
* @example
|
|
163
90
|
* ```typescript
|
|
164
|
-
* //
|
|
165
|
-
* await registerIcon('
|
|
91
|
+
* // Strip <title>/<desc> to prevent browser-native tooltips on hover
|
|
92
|
+
* await registerIcon('home', '/icons/home.svg', { stripMeta: true });
|
|
166
93
|
*
|
|
167
|
-
* //
|
|
168
|
-
*
|
|
94
|
+
* // Or with a custom collection:
|
|
95
|
+
* await registerIcon('home', '/icons/home.svg', {
|
|
96
|
+
* collection: 'my-lib',
|
|
97
|
+
* stripMeta: true,
|
|
98
|
+
* });
|
|
169
99
|
* ```
|
|
170
100
|
*/
|
|
171
|
-
export declare function registerIcon(name: string, url: string,
|
|
101
|
+
export declare function registerIcon(name: string, url: string, options?: RegisterIconOptions): Promise<void>;
|
|
172
102
|
/**
|
|
173
103
|
* Registers an icon from SVG text content.
|
|
174
104
|
*
|
|
175
105
|
* @param name - The unique name for the icon
|
|
176
106
|
* @param iconText - The SVG markup as a string
|
|
177
|
-
* @param collection - The collection to register the icon in (default: 'default')
|
|
107
|
+
* @param collection - The collection to register the icon in (default: `'default'`)
|
|
178
108
|
*
|
|
179
109
|
* @throws If the SVG text is malformed or doesn't contain an SVG element
|
|
110
|
+
*/
|
|
111
|
+
export declare function registerIconFromText(name: string, iconText: string, collection?: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Registers an icon from SVG text content.
|
|
180
114
|
*
|
|
181
|
-
* @
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* becomes immediately available to all icon components.
|
|
115
|
+
* @param name - The unique name for the icon
|
|
116
|
+
* @param iconText - The SVG markup as a string
|
|
117
|
+
* @param options - Registration options: target collection and/or `stripMeta`
|
|
185
118
|
*
|
|
186
|
-
*
|
|
119
|
+
* @throws If the SVG text is malformed or doesn't contain an SVG element
|
|
120
|
+
*
|
|
121
|
+
* @remarks
|
|
122
|
+
* This overload accepts a {@link RegisterIconOptions} object so you can control
|
|
123
|
+
* the target collection **and** opt into SVG meta stripping in one call:
|
|
187
124
|
*
|
|
188
|
-
* @example
|
|
189
125
|
* ```typescript
|
|
190
|
-
* const iconSvg = '<svg viewBox="0 0 24 24"><path d="..."/></svg>';
|
|
191
|
-
*
|
|
126
|
+
* const iconSvg = '<svg viewBox="0 0 24 24"><title>Home</title><path d="..."/></svg>';
|
|
127
|
+
*
|
|
128
|
+
* // Strip <title>/<desc> to prevent browser-native tooltips on hover
|
|
129
|
+
* registerIconFromText('home', iconSvg, { stripMeta: true });
|
|
192
130
|
*
|
|
193
|
-
* //
|
|
194
|
-
*
|
|
131
|
+
* // Or with a custom collection:
|
|
132
|
+
* registerIconFromText('home', iconSvg, { collection: 'my-lib', stripMeta: true });
|
|
195
133
|
* ```
|
|
196
134
|
*/
|
|
197
|
-
export declare function registerIconFromText(name: string, iconText: string,
|
|
135
|
+
export declare function registerIconFromText(name: string, iconText: string, options?: RegisterIconOptions): void;
|
|
198
136
|
/**
|
|
199
137
|
* Sets an icon reference/alias that points to another icon.
|
|
200
138
|
*
|
|
@@ -210,7 +148,7 @@ export declare function registerIconFromText(name: string, iconText: string, col
|
|
|
210
148
|
* - Providing fallbacks for missing icons
|
|
211
149
|
*
|
|
212
150
|
* User-set references are marked as external and have higher priority than
|
|
213
|
-
* theme-based aliases. They are also
|
|
151
|
+
* theme-based aliases. They are also published to other browsing contexts.
|
|
214
152
|
*
|
|
215
153
|
* @example
|
|
216
154
|
* ```typescript
|
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
import { ICON_REFERENCES } from './icon-references.js';
|
|
2
2
|
import { IconsStateBroadcast } from './icon-state.broadcast.js';
|
|
3
3
|
import { internalIcons } from './internal-icons-lib.js';
|
|
4
|
-
import { createIconDefaultMap } from './registry/default-map.js';
|
|
5
4
|
import { SvgIconParser } from './registry/parser.js';
|
|
6
5
|
import { ActionType } from './registry/types.js';
|
|
6
|
+
function resolveIconOptions(collectionOrOptions) {
|
|
7
|
+
if (typeof collectionOrOptions === 'string') {
|
|
8
|
+
return { collection: collectionOrOptions, stripMeta: false };
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
collection: collectionOrOptions?.collection ?? 'default',
|
|
12
|
+
stripMeta: collectionOrOptions?.stripMeta ?? false,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function collectionOf(collections, name) {
|
|
16
|
+
let collection = collections.get(name);
|
|
17
|
+
if (!collection) {
|
|
18
|
+
collection = new Map();
|
|
19
|
+
collections.set(name, collection);
|
|
20
|
+
}
|
|
21
|
+
return collection;
|
|
22
|
+
}
|
|
7
23
|
class IconsRegistry {
|
|
8
24
|
constructor() {
|
|
9
25
|
this._listeners = new Set();
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
|
|
26
|
+
this._references = new Map();
|
|
27
|
+
this._collections = new Map([
|
|
28
|
+
['internal', internalIcons],
|
|
29
|
+
]);
|
|
13
30
|
this._svgIconParser = new SvgIconParser();
|
|
14
31
|
this._broadcast = new IconsStateBroadcast(this._collections, this._references);
|
|
15
32
|
this._notificationScheduled = false;
|
|
16
33
|
}
|
|
17
|
-
register(name, iconText, collection = 'default') {
|
|
18
|
-
const svgIcon = this._svgIconParser.parse(iconText);
|
|
19
|
-
this._collections
|
|
20
|
-
const icons = createIconDefaultMap();
|
|
21
|
-
icons.getOrCreate(collection).set(name, svgIcon);
|
|
34
|
+
register(name, iconText, collection = 'default', stripMeta = false) {
|
|
35
|
+
const svgIcon = this._svgIconParser.parse(iconText, stripMeta);
|
|
36
|
+
collectionOf(this._collections, collection).set(name, svgIcon);
|
|
22
37
|
this._broadcast.send({
|
|
23
38
|
actionType: ActionType.RegisterIcon,
|
|
24
|
-
collections:
|
|
39
|
+
collections: new Map([[collection, new Map([[name, svgIcon]])]]),
|
|
25
40
|
});
|
|
26
|
-
this.
|
|
41
|
+
this._notify();
|
|
27
42
|
}
|
|
28
43
|
subscribe(callback) {
|
|
29
44
|
this._listeners.add(callback);
|
|
@@ -33,24 +48,19 @@ class IconsRegistry {
|
|
|
33
48
|
}
|
|
34
49
|
setIconRef(options) {
|
|
35
50
|
const { alias, target, overwrite } = options;
|
|
36
|
-
const reference = this._references.getOrCreate(alias.collection);
|
|
37
51
|
if (overwrite) {
|
|
38
|
-
|
|
52
|
+
collectionOf(this._references, alias.collection).set(alias.name, {
|
|
39
53
|
name: target.name,
|
|
40
54
|
collection: target.collection,
|
|
41
55
|
external: target.external,
|
|
42
56
|
});
|
|
43
|
-
this.
|
|
57
|
+
this._notify();
|
|
44
58
|
}
|
|
45
59
|
if (target.external) {
|
|
46
|
-
const
|
|
47
|
-
refs.getOrCreate(alias.collection).set(alias.name, {
|
|
48
|
-
name: target.name,
|
|
49
|
-
collection: target.collection,
|
|
50
|
-
});
|
|
60
|
+
const ref = { name: target.name, collection: target.collection };
|
|
51
61
|
this._broadcast.send({
|
|
52
62
|
actionType: ActionType.UpdateIconReference,
|
|
53
|
-
references:
|
|
63
|
+
references: new Map([[alias.collection, new Map([[alias.name, ref]])]]),
|
|
54
64
|
});
|
|
55
65
|
}
|
|
56
66
|
}
|
|
@@ -63,12 +73,10 @@ class IconsRegistry {
|
|
|
63
73
|
};
|
|
64
74
|
}
|
|
65
75
|
if (collection === 'default' && theme) {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return target;
|
|
71
|
-
}
|
|
76
|
+
const targets = ICON_REFERENCES.get(name);
|
|
77
|
+
const target = targets?.get(theme) ?? targets?.get('default');
|
|
78
|
+
if (target) {
|
|
79
|
+
return target;
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
return { name, collection };
|
|
@@ -76,49 +84,39 @@ class IconsRegistry {
|
|
|
76
84
|
get(name, collection = 'default') {
|
|
77
85
|
return this._collections.get(collection)?.get(name);
|
|
78
86
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!this._notificationScheduled) {
|
|
83
|
-
this._notificationScheduled = true;
|
|
84
|
-
queueMicrotask(() => {
|
|
85
|
-
this._flushNotifications();
|
|
86
|
-
});
|
|
87
|
+
_notify() {
|
|
88
|
+
if (this._notificationScheduled) {
|
|
89
|
+
return;
|
|
87
90
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this._pendingNotifications.clear();
|
|
92
|
-
this._notificationScheduled = false;
|
|
93
|
-
for (const key of notifications) {
|
|
94
|
-
const [collection, ...nameParts] = key.split(':');
|
|
95
|
-
const name = nameParts.join(':');
|
|
91
|
+
this._notificationScheduled = true;
|
|
92
|
+
queueMicrotask(() => {
|
|
93
|
+
this._notificationScheduled = false;
|
|
96
94
|
for (const listener of this._listeners) {
|
|
97
|
-
listener(
|
|
95
|
+
listener();
|
|
98
96
|
}
|
|
99
|
-
}
|
|
97
|
+
});
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
const registry = Symbol.for('igc.icons-registry.instance');
|
|
103
101
|
export function getIconRegistry() {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
return _global[registry];
|
|
102
|
+
const global = globalThis;
|
|
103
|
+
global[registry] ??= new IconsRegistry();
|
|
104
|
+
return global[registry];
|
|
109
105
|
}
|
|
110
|
-
export async function registerIcon(name, url,
|
|
106
|
+
export async function registerIcon(name, url, collectionOrOptions) {
|
|
107
|
+
const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);
|
|
111
108
|
const response = await fetch(url);
|
|
112
109
|
if (response.ok) {
|
|
113
110
|
const value = await response.text();
|
|
114
|
-
getIconRegistry().register(name, value, collection);
|
|
111
|
+
getIconRegistry().register(name, value, collection, stripMeta);
|
|
115
112
|
}
|
|
116
113
|
else {
|
|
117
114
|
throw new Error(`Icon request failed. Status: ${response.status}.`);
|
|
118
115
|
}
|
|
119
116
|
}
|
|
120
|
-
export function registerIconFromText(name, iconText,
|
|
121
|
-
|
|
117
|
+
export function registerIconFromText(name, iconText, collectionOrOptions) {
|
|
118
|
+
const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);
|
|
119
|
+
getIconRegistry().register(name, iconText, collection, stripMeta);
|
|
122
120
|
}
|
|
123
121
|
export function setIconRef(name, collection, icon) {
|
|
124
122
|
getIconRegistry().setIconRef({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAkBjD,MAAM,aAAa;IAAnB;QAEmB,eAAU,GAAG,IAAI,GAAG,EAAgB,CAAC;QAGrC,0BAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;QAG1C,gBAAW,GAAG,oBAAoB,EAAoB,CAAC;QAGvD,iBAAY,GAAG,oBAAoB,EAAmB,CAAC,GAAG,CACzE,UAAU,EACV,aAAa,CACd,CAAC;QAGe,mBAAc,GAAG,IAAI,aAAa,EAAE,CAAC;QAGrC,eAAU,GAAG,IAAI,mBAAmB,CACnD,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,W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,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Theme } from '../../theming/types.js';\nimport { ICON_REFERENCES } from './icon-references.js';\nimport { IconsStateBroadcast } from './icon-state.broadcast.js';\nimport { internalIcons } from './internal-icons-lib.js';\nimport { createIconDefaultMap } from './registry/default-map.js';\nimport { SvgIconParser } from './registry/parser.js';\nimport type {\n IconCallback,\n IconMeta,\n IconReferencePair,\n SvgIcon,\n} from './registry/types.js';\nimport { ActionType } from './registry/types.js';\n\n/**\n * Global singleton registry for managing SVG icons and their references.\n *\n * @remarks\n * The IconsRegistry class handles:\n * - Registration and storage of SVG icons in collections\n * - Icon reference/alias management with theme-based resolution\n * - Notification of icon changes to subscribed components\n * - Cross-context synchronization via BroadcastChannel\n * - Batched notifications for performance optimization\n *\n * This is a singleton managed via Symbol.for to ensure a single instance\n * across the entire application, even with multiple bundle instances.\n *\n * @internal This class is not directly exposed. Use the exported functions instead.\n */\nclass IconsRegistry {\n /** Set of callbacks subscribed to icon change notifications */\n private readonly _listeners = new Set<IconCallback>();\n\n /** Set of pending icon:collection keys awaiting notification */\n private readonly _pendingNotifications = new Set<string>();\n\n /** Map of icon references/aliases by collection and name */\n private readonly _references = createIconDefaultMap<string, IconMeta>();\n\n /** Map of registered SVG icons by collection and name */\n private readonly _collections = createIconDefaultMap<string, SvgIcon>().set(\n 'internal',\n internalIcons\n );\n\n /** Parser for converting SVG text to icon metadata */\n private readonly _svgIconParser = new SvgIconParser();\n\n /** Broadcast channel manager for cross-context synchronization */\n private readonly _broadcast = new IconsStateBroadcast(\n this._collections,\n this._references\n );\n\n /** Flag indicating if a notification microtask is scheduled */\n private _notificationScheduled = false;\n\n /**\n * Registers an SVG icon in the registry.\n *\n * @param name - The unique name for the icon within its collection\n * @param iconText - The SVG markup as a string\n * @param collection - The collection to register the icon in (default: 'default')\n *\n * @remarks\n * This method:\n * 1. Parses the SVG text into icon metadata\n * 2. Stores the icon in the specified collection\n * 3. Broadcasts the registration to other contexts\n * 4. Notifies subscribed components (batched)\n *\n * @throws Will throw if the SVG text is malformed\n */\n public register(\n name: string,\n iconText: string,\n collection = 'default'\n ): void {\n const svgIcon = this._svgIconParser.parse(iconText);\n this._collections.getOrCreate(collection).set(name, svgIcon);\n\n const icons = createIconDefaultMap<string, SvgIcon>();\n icons.getOrCreate(collection).set(name, svgIcon);\n\n this._broadcast.send({\n actionType: ActionType.RegisterIcon,\n collections: icons.toPlainMap(),\n });\n\n this._notifyAll(name, collection);\n }\n\n /**\n * Subscribes a callback to icon change notifications.\n *\n * @param callback - Function to call when icons are registered or updated\n *\n * @remarks\n * The callback receives the icon name and collection when changes occur.\n * Notifications are batched using microtasks for performance.\n */\n public subscribe(callback: IconCallback): void {\n this._listeners.add(callback);\n }\n\n /**\n * Unsubscribes a callback from icon change notifications.\n *\n * @param callback - The previously subscribed callback to remove\n */\n public unsubscribe(callback: IconCallback): void {\n this._listeners.delete(callback);\n }\n\n /**\n * Sets an icon reference/alias.\n *\n * @param options - Configuration for the icon reference\n *\n * @remarks\n * Icon references allow icons to be aliased with different names.\n * They can be:\n * - User-set (external: true) - higher priority, synced across contexts\n * - System-set (external: false) - used internally, not synced\n *\n * When overwrite is true, the reference is stored and subscribers are notified.\n * When external is true, the reference is broadcast to other contexts.\n */\n public setIconRef(options: IconReferencePair): void {\n const { alias, target, overwrite } = options;\n const reference = this._references.getOrCreate(alias.collection);\n\n if (overwrite) {\n reference.set(alias.name, {\n name: target.name,\n collection: target.collection,\n external: target.external,\n });\n this._notifyAll(alias.name, alias.collection);\n }\n if (target.external) {\n const refs = createIconDefaultMap<string, IconMeta>();\n refs.getOrCreate(alias.collection).set(alias.name, {\n name: target.name,\n collection: target.collection,\n });\n\n this._broadcast.send({\n actionType: ActionType.UpdateIconReference,\n references: refs.toPlainMap(),\n });\n }\n }\n\n /**\n * Gets the icon reference, resolving aliases based on the provided theme.\n *\n * @param name - The icon name or alias\n * @param collection - The collection name\n * @param theme - The theme to use for resolving aliases\n * @returns The resolved icon metadata (without the internal 'external' flag)\n */\n public getIconRef(name: string, collection: string, theme?: Theme): IconMeta {\n // Check for any user-set reference first (external or internal)\n const storedRef = this._references.get(collection)?.get(name);\n if (storedRef) {\n return {\n name: storedRef.name,\n collection: storedRef.collection,\n };\n }\n\n // Resolve theme-based alias for default collection\n if (collection === 'default' && theme) {\n const alias = ICON_REFERENCES.find(\n (ref) => ref.alias.name === name && ref.alias.collection === 'default'\n );\n\n if (alias) {\n const target = alias.target.get(theme) ?? alias.target.get('default');\n if (target) {\n return target;\n }\n }\n }\n\n // Return as-is if no reference found\n return { name, collection };\n }\n\n /**\n * Retrieves an icon from the registry.\n *\n * @param name - The icon name\n * @param collection - The collection name (default: 'default')\n * @returns The SVG icon metadata, or undefined if not found\n *\n * @remarks\n * Use `getIconRef` first to resolve aliases before calling this method.\n */\n public get(name: string, collection = 'default'): SvgIcon | undefined {\n return this._collections.get(collection)?.get(name);\n }\n\n /**\n * Schedules a batched notification for icon changes.\n *\n * @param name - The icon name that changed\n * @param collection - The collection name\n *\n * @remarks\n * Notifications are batched in a microtask queue to avoid excessive\n * listener calls when multiple icons are registered synchronously.\n * Duplicate icon:collection pairs are automatically deduplicated.\n *\n * @internal\n */\n private _notifyAll(name: string, collection: string): void {\n const key = `${collection}:${name}`;\n this._pendingNotifications.add(key);\n\n if (!this._notificationScheduled) {\n this._notificationScheduled = true;\n queueMicrotask(() => {\n this._flushNotifications();\n });\n }\n }\n\n /**\n * Flushes pending notifications to all subscribed listeners.\n *\n * @remarks\n * This method is called as a microtask after icons are registered.\n * It processes all pending icon:collection pairs and notifies listeners.\n *\n * @internal\n */\n private _flushNotifications(): void {\n const notifications = Array.from(this._pendingNotifications);\n this._pendingNotifications.clear();\n this._notificationScheduled = false;\n\n for (const key of notifications) {\n const [collection, ...nameParts] = key.split(':');\n const name = nameParts.join(':');\n\n for (const listener of this._listeners) {\n listener(name, collection);\n }\n }\n }\n}\n\n/** Global symbol key for the singleton registry instance */\nconst registry = Symbol.for('igc.icons-registry.instance');\n\n/** Type augmentation for globalThis to include the registry */\ntype IgcIconRegistry = typeof globalThis & {\n [registry]?: IconsRegistry;\n};\n\n/**\n * Gets the global icon registry singleton instance.\n *\n * @returns The IconsRegistry singleton\n *\n * @remarks\n * This function ensures only one instance of the registry exists globally,\n * even across multiple bundle instances. The registry is stored on globalThis\n * using a well-known Symbol.\n *\n * @example\n * ```typescript\n * const registry = getIconRegistry();\n * registry.subscribe((name, collection) => {\n * console.log(`Icon ${name} changed in ${collection}`);\n * });\n * ```\n */\nexport function getIconRegistry() {\n const _global = globalThis as IgcIconRegistry;\n if (!_global[registry]) {\n _global[registry] = new IconsRegistry();\n }\n return _global[registry];\n}\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param collection - The collection to register the icon in (default: 'default')\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n *\n * @remarks\n * This function fetches SVG content from the provided URL and registers it\n * in the icon registry. The icon becomes immediately available to all icon\n * components in the application.\n *\n * @example\n * ```typescript\n * // Register an icon from a URL\n * await registerIcon('custom-icon', '/assets/icons/custom.svg');\n *\n * // Use in HTML\n * // <igc-icon name=\"custom-icon\"></igc-icon>\n * ```\n */\nexport async function registerIcon(\n name: string,\n url: string,\n collection = 'default'\n) {\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n getIconRegistry().register(name, value, collection);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n}\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param collection - The collection to register the icon in (default: 'default')\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n *\n * @remarks\n * This is the preferred method for registering icons when you have the SVG\n * content directly (e.g., from a bundled asset or inline string). The icon\n * becomes immediately available to all icon components.\n *\n * The SVG text is parsed to extract viewBox, title, and other metadata.\n *\n * @example\n * ```typescript\n * const iconSvg = '<svg viewBox=\"0 0 24 24\"><path d=\"...\"/></svg>';\n * registerIconFromText('my-icon', iconSvg, 'custom');\n *\n * // Use in HTML\n * // <igc-icon name=\"my-icon\" collection=\"custom\"></igc-icon>\n * ```\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collection = 'default'\n) {\n getIconRegistry().register(name, iconText, collection);\n}\n\n/**\n * Sets an icon reference/alias that points to another icon.\n *\n * @param name - The alias name\n * @param collection - The collection for the alias\n * @param icon - The target icon metadata (name and collection)\n *\n * @remarks\n * Icon references allow you to create aliases that point to other icons.\n * This is useful for:\n * - Creating semantic names (e.g., 'close' → 'x')\n * - Overriding default icon mappings\n * - Providing fallbacks for missing icons\n *\n * User-set references are marked as external and have higher priority than\n * theme-based aliases. They are also synchronized across browsing contexts.\n *\n * @example\n * ```typescript\n * // Register target icon\n * registerIconFromText('x-mark', '<svg>...</svg>');\n *\n * // Create an alias\n * setIconRef('close', 'default', {\n * name: 'x-mark',\n * collection: 'default'\n * });\n *\n * // Both work the same way:\n * // <igc-icon name=\"close\"></igc-icon>\n * // <igc-icon name=\"x-mark\"></igc-icon>\n * ```\n */\nexport function setIconRef(name: string, collection: string, icon: IconMeta) {\n getIconRegistry().setIconRef({\n alias: { name, collection },\n target: {\n name: icon.name,\n collection: icon.collection,\n external: true,\n },\n overwrite: true,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"icon.registry.js","sourceRoot":"","sources":["../../../src/components/icon/icon.registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AASrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,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C,UAAU,CAAC;QAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAC3B,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI;SACf;QACD,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Theme } from '#theming/types.js';\nimport { ICON_REFERENCES } from './icon-references.js';\nimport { IconsStateBroadcast } from './icon-state.broadcast.js';\nimport { internalIcons } from './internal-icons-lib.js';\nimport { SvgIconParser } from './registry/parser.js';\nimport type {\n IconCallback,\n IconMeta,\n IconReferencePair,\n IconsCollection,\n RegisterIconOptions,\n SvgIcon,\n} from './registry/types.js';\nimport { ActionType } from './registry/types.js';\n\n/**\n * Normalizes the third argument of `registerIcon` / `registerIconFromText`,\n * which is either a collection name or a {@link RegisterIconOptions} object.\n */\nfunction resolveIconOptions(\n collectionOrOptions?: string | RegisterIconOptions\n): Required<RegisterIconOptions> {\n if (typeof collectionOrOptions === 'string') {\n return { collection: collectionOrOptions, stripMeta: false };\n }\n\n return {\n collection: collectionOrOptions?.collection ?? 'default',\n stripMeta: collectionOrOptions?.stripMeta ?? false,\n };\n}\n\n/** Returns the named collection, creating it when absent. */\nfunction collectionOf<V>(\n collections: IconsCollection<V>,\n name: string\n): Map<string, V> {\n let collection = collections.get(name);\n\n if (!collection) {\n collection = new Map();\n collections.set(name, collection);\n }\n\n return collection;\n}\n\n/**\n * Global singleton registry for managing SVG icons and their references.\n *\n * @remarks\n * The registry stores SVG icons in named collections, resolves aliases against\n * the active theme, notifies subscribers once per microtask however many icons\n * changed, and publishes user-set state to other browsing contexts (see\n * {@link IconsStateBroadcast}).\n *\n * @internal Not exposed directly - use the exported functions.\n */\nclass IconsRegistry {\n private readonly _listeners = new Set<IconCallback>();\n private readonly _references: IconsCollection<IconMeta> = new Map();\n private readonly _collections: IconsCollection<SvgIcon> = new Map([\n ['internal', internalIcons],\n ]);\n private readonly _svgIconParser = new SvgIconParser();\n private readonly _broadcast = new IconsStateBroadcast(\n this._collections,\n this._references\n );\n private _notificationScheduled = false;\n\n /**\n * Parses and stores an SVG icon, then publishes and notifies.\n *\n * @param stripMeta - See {@link RegisterIconOptions.stripMeta}.\n * @throws If the SVG text is malformed.\n */\n public register(\n name: string,\n iconText: string,\n collection = 'default',\n stripMeta = false\n ): void {\n const svgIcon = this._svgIconParser.parse(iconText, stripMeta);\n collectionOf(this._collections, collection).set(name, svgIcon);\n\n this._broadcast.send({\n actionType: ActionType.RegisterIcon,\n collections: new Map([[collection, new Map([[name, svgIcon]])]]),\n });\n\n this._notify();\n }\n\n /**\n * Subscribes a callback to registry changes. It is invoked once per\n * microtask, however many icons changed, so subscribers re-resolve their\n * own state.\n */\n public subscribe(callback: IconCallback): void {\n this._listeners.add(callback);\n }\n\n /** Unsubscribes a previously subscribed callback. */\n public unsubscribe(callback: IconCallback): void {\n this._listeners.delete(callback);\n }\n\n /**\n * Aliases an icon name to another icon.\n *\n * @remarks\n * `overwrite` stores the reference and notifies subscribers; `external`\n * marks it as user-set, which takes precedence over the built-in theme\n * aliases and is published to other browsing contexts.\n */\n public setIconRef(options: IconReferencePair): void {\n const { alias, target, overwrite } = options;\n\n if (overwrite) {\n collectionOf(this._references, alias.collection).set(alias.name, {\n name: target.name,\n collection: target.collection,\n external: target.external,\n });\n this._notify();\n }\n\n if (target.external) {\n const ref = { name: target.name, collection: target.collection };\n\n this._broadcast.send({\n actionType: ActionType.UpdateIconReference,\n references: new Map([[alias.collection, new Map([[alias.name, ref]])]]),\n });\n }\n }\n\n /**\n * Resolves a name that may be an alias to the icon it points at, for the\n * given theme. The result never carries the internal `external` flag.\n */\n public getIconRef(name: string, collection: string, theme?: Theme): IconMeta {\n // Check for any user-set reference first (external or internal)\n const storedRef = this._references.get(collection)?.get(name);\n if (storedRef) {\n return {\n name: storedRef.name,\n collection: storedRef.collection,\n };\n }\n\n // Resolve theme-based alias for the default collection\n if (collection === 'default' && theme) {\n const targets = ICON_REFERENCES.get(name);\n const target = targets?.get(theme) ?? targets?.get('default');\n\n if (target) {\n return target;\n }\n }\n\n return { name, collection };\n }\n\n /** Retrieves an icon. Resolve aliases with `getIconRef` first. */\n public get(name: string, collection = 'default'): SvgIcon | undefined {\n return this._collections.get(collection)?.get(name);\n }\n\n /**\n * Notifies subscribers, coalescing a burst of changes in the same microtask\n * into a single notification.\n */\n private _notify(): void {\n if (this._notificationScheduled) {\n return;\n }\n\n this._notificationScheduled = true;\n\n queueMicrotask(() => {\n this._notificationScheduled = false;\n\n for (const listener of this._listeners) {\n listener();\n }\n });\n }\n}\n\nconst registry = Symbol.for('igc.icons-registry.instance');\n\ntype IgcIconRegistry = typeof globalThis & {\n [registry]?: IconsRegistry;\n};\n\n/**\n * Gets the icon registry, creating it on first use. The well-known symbol on\n * `globalThis` keeps it a single instance even across multiple bundles.\n */\nexport function getIconRegistry(): IconsRegistry {\n const global = globalThis as IgcIconRegistry;\n global[registry] ??= new IconsRegistry();\n return global[registry];\n}\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n */\nexport async function registerIcon(\n name: string,\n url: string,\n collection?: string\n): Promise<void>;\n\n/**\n * Registers an icon by fetching it from a URL.\n *\n * @param name - The unique name for the icon\n * @param url - The URL to fetch the SVG icon from\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @returns A promise that resolves when the icon is registered\n *\n * @throws If the HTTP request fails or returns a non-OK status\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * await registerIcon('home', '/icons/home.svg', { stripMeta: true });\n *\n * // Or with a custom collection:\n * await registerIcon('home', '/icons/home.svg', {\n * collection: 'my-lib',\n * stripMeta: true,\n * });\n * ```\n */\nexport async function registerIcon(\n name: string,\n url: string,\n options?: RegisterIconOptions\n): Promise<void>;\n\nexport async function registerIcon(\n name: string,\n url: string,\n collectionOrOptions?: string | RegisterIconOptions\n): Promise<void> {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n const response = await fetch(url);\n\n if (response.ok) {\n const value = await response.text();\n getIconRegistry().register(name, value, collection, stripMeta);\n } else {\n throw new Error(`Icon request failed. Status: ${response.status}.`);\n }\n}\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param collection - The collection to register the icon in (default: `'default'`)\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collection?: string\n): void;\n\n/**\n * Registers an icon from SVG text content.\n *\n * @param name - The unique name for the icon\n * @param iconText - The SVG markup as a string\n * @param options - Registration options: target collection and/or `stripMeta`\n *\n * @throws If the SVG text is malformed or doesn't contain an SVG element\n *\n * @remarks\n * This overload accepts a {@link RegisterIconOptions} object so you can control\n * the target collection **and** opt into SVG meta stripping in one call:\n *\n * ```typescript\n * const iconSvg = '<svg viewBox=\"0 0 24 24\"><title>Home</title><path d=\"...\"/></svg>';\n *\n * // Strip <title>/<desc> to prevent browser-native tooltips on hover\n * registerIconFromText('home', iconSvg, { stripMeta: true });\n *\n * // Or with a custom collection:\n * registerIconFromText('home', iconSvg, { collection: 'my-lib', stripMeta: true });\n * ```\n */\nexport function registerIconFromText(\n name: string,\n iconText: string,\n options?: RegisterIconOptions\n): void;\n\nexport function registerIconFromText(\n name: string,\n iconText: string,\n collectionOrOptions?: string | RegisterIconOptions\n): void {\n const { collection, stripMeta } = resolveIconOptions(collectionOrOptions);\n getIconRegistry().register(name, iconText, collection, stripMeta);\n}\n\n/**\n * Sets an icon reference/alias that points to another icon.\n *\n * @param name - The alias name\n * @param collection - The collection for the alias\n * @param icon - The target icon metadata (name and collection)\n *\n * @remarks\n * Icon references allow you to create aliases that point to other icons.\n * This is useful for:\n * - Creating semantic names (e.g., 'close' → 'x')\n * - Overriding default icon mappings\n * - Providing fallbacks for missing icons\n *\n * User-set references are marked as external and have higher priority than\n * theme-based aliases. They are also published to other browsing contexts.\n *\n * @example\n * ```typescript\n * // Register target icon\n * registerIconFromText('x-mark', '<svg>...</svg>');\n *\n * // Create an alias\n * setIconRef('close', 'default', {\n * name: 'x-mark',\n * collection: 'default'\n * });\n *\n * // Both work the same way:\n * // <igc-icon name=\"close\"></igc-icon>\n * // <igc-icon name=\"x-mark\"></igc-icon>\n * ```\n */\nexport function setIconRef(name: string, collection: string, icon: IconMeta) {\n getIconRegistry().setIconRef({\n alias: { name, collection },\n target: {\n name: icon.name,\n collection: icon.collection,\n external: true,\n },\n overwrite: true,\n });\n}\n"]}
|
|
@@ -111,7 +111,7 @@ export const internalIcons = new Map(Object.entries({
|
|
|
111
111
|
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 -960 960 960"><path d="M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z"/></svg>`,
|
|
112
112
|
},
|
|
113
113
|
open_in_new: {
|
|
114
|
-
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M6.75 1.5 5.378 3H3c-.825 0-1.5.675-1.5 1.5v9c0 .825.675 1.5 1.5 1.5h12c.825 0 1.5-.675 1.5-1.5v-9c0-.825-.675-1.5-1.5-1.5h-2.377L11.25 1.5h-4.5ZM9 12.75c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75Z"/></svg>`,
|
|
114
|
+
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 18 18"><path d="M6.75 1.5 5.378 3H3c-.825 0-1.5.675-1.5 1.5v9c0 .825.675 1.5 1.5 1.5h12c.825 0 1.5-.675 1.5-1.5v-9c0-.825-.675-1.5-1.5-1.5h-2.377L11.25 1.5h-4.5ZM9 12.75c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75Z"/></svg>`,
|
|
115
115
|
},
|
|
116
116
|
star: {
|
|
117
117
|
svg: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M0 0h24v24H0z" fill="none"/><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>`,
|
|
@@ -325,7 +325,7 @@ export const internalIcons = new Map(Object.entries({
|
|
|
325
325
|
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 24 24"><path d="M14.068 3.247a9.05 9.05 0 0 0-8.98 2.925c-1.08 1.263-1.79 2.35-2.054 3.991a1.58 1.58 0 0 0-.034.315v.003A1.519 1.519 0 0 0 4.504 12a1.458 1.458 0 0 0 1.515-1.184l.002-.012.002-.012c.148-1.107.602-1.702 1.312-2.565a5.999 5.999 0 0 1 8.533-.75l-1.314 1.308a1.396 1.396 0 0 0-.314.445.761.761 0 0 0-.015.582.756.756 0 0 0 .418.406c.163.07.347.095.531.095H20.03A.985.985 0 0 0 21 9.348v-4.84c0-.323-.09-.772-.5-.94-.407-.17-.79.084-1.022.315l-1.45 1.444a9.05 9.05 0 0 0-3.96-2.08ZM3.977 13.687H3.97A.984.984 0 0 0 3 14.65v4.84c0 .324.09.773.499.942.408.17.79-.084 1.023-.315l1.45-1.444a9.049 9.049 0 0 0 12.94-.845c1.08-1.263 1.79-2.35 2.054-3.991.022-.104.033-.209.034-.315v-.003A1.518 1.518 0 0 0 19.496 12a1.458 1.458 0 0 0-1.513 1.184l-.002.012-.002.012c-.148 1.108-.602 1.702-1.312 2.565a6 6 0 0 1-8.535.75l1.314-1.308c.133-.132.246-.281.314-.445a.76.76 0 0 0 .015-.582.756.756 0 0 0-.418-.406 1.364 1.364 0 0 0-.531-.095h-4.85Z"/></svg>`,
|
|
326
326
|
},
|
|
327
327
|
indigo_search: {
|
|
328
|
-
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.393 3a7.393 7.393 0 1 0 4.068 13.567l3.996 3.997a1.49 1.49 0 1 0 2.107-2.107l-3.997-3.996A7.393 7.393 0 0 0 10.393 3ZM6 10.393a4.393 4.393 0 1 1 8.786 0 4.393 4.393 0 0 1-8.786 0Z"
|
|
328
|
+
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.393 3a7.393 7.393 0 1 0 4.068 13.567l3.996 3.997a1.49 1.49 0 1 0 2.107-2.107l-3.997-3.996A7.393 7.393 0 0 0 10.393 3ZM6 10.393a4.393 4.393 0 1 1 8.786 0 4.393 4.393 0 0 1-8.786 0Z"/></svg>`,
|
|
329
329
|
},
|
|
330
330
|
indigo_send: {
|
|
331
331
|
svg: `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.302 10.84S5.5 2.591 4.352 2.13C3.207 1.666 3 2.59 3 2.59v17.791c0 .277.077.549.223.79.146.242.356.444.611.589a1.871 1.871 0 0 0 1.708.064l14.5-8.216c.29-.136.533-.343.702-.6.17-.256.258-.551.256-.851a1.528 1.528 0 0 0-.267-.85 1.672 1.672 0 0 0-.431-.433v-.035ZM6.5 10.021V6.803l9.5 5.385-9.5 5.555v-3.146l3.583-.645.036-.01a1.76 1.76 0 0 0 .913-.572 1.54 1.54 0 0 0 .361-.964 1.535 1.535 0 0 0-.336-.972 1.753 1.753 0 0 0-.898-.593l-.034-.01-3.625-.81Z"/></svg>`,
|