igniteui-webcomponents 7.3.1 → 7.4.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 +72 -1
- package/animations/easings.d.ts +21 -31
- package/animations/easings.js +21 -34
- package/animations/easings.js.map +1 -1
- package/animations/player.d.ts +8 -16
- package/animations/player.js +5 -8
- package/animations/player.js.map +1 -1
- package/animations/view-transition.d.ts +10 -10
- package/animations/view-transition.js +26 -37
- package/animations/view-transition.js.map +1 -1
- package/components/avatar/themes/avatar.base.css.js +1 -1
- package/components/avatar/themes/avatar.base.css.js.map +1 -1
- package/components/badge/themes/badge.base.css.js +1 -1
- package/components/badge/themes/badge.base.css.js.map +1 -1
- package/components/banner/themes/banner.base.css.js +1 -1
- package/components/banner/themes/banner.base.css.js.map +1 -1
- package/components/banner/themes/shared/banner.indigo.css.js +1 -1
- package/components/banner/themes/shared/banner.indigo.css.js.map +1 -1
- package/components/breadcrumb/breadcrumb.d.ts +74 -0
- package/components/breadcrumb/breadcrumb.js +107 -0
- package/components/breadcrumb/breadcrumb.js.map +1 -0
- package/components/breadcrumb/breadcrumbs.d.ts +60 -0
- package/components/breadcrumb/breadcrumbs.js +50 -0
- package/components/breadcrumb/breadcrumbs.js.map +1 -0
- package/components/breadcrumb/themes/breadcrumb.base.css.d.ts +1 -0
- package/components/breadcrumb/themes/breadcrumb.base.css.js +3 -0
- package/components/breadcrumb/themes/breadcrumb.base.css.js.map +1 -0
- package/components/breadcrumb/themes/breadcrumbs.base.css.d.ts +1 -0
- package/components/breadcrumb/themes/breadcrumbs.base.css.js +3 -0
- package/components/breadcrumb/themes/breadcrumbs.base.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/themes.d.ts +2 -0
- package/components/breadcrumb/themes/themes.js +50 -0
- package/components/breadcrumb/themes/themes.js.map +1 -0
- package/components/button/button.d.ts +0 -2
- package/components/button/button.js.map +1 -1
- package/components/button-group/button-group.d.ts +42 -12
- package/components/button-group/button-group.js +82 -34
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +6 -1
- package/components/button-group/toggle-button.js +28 -2
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/base.d.ts +7 -2
- package/components/calendar/base.js +10 -4
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +6 -3
- package/components/calendar/calendar.js +41 -14
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +5 -8
- package/components/calendar/days-view/days-view.js +7 -16
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +13 -0
- package/components/calendar/helpers.js +15 -0
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/days-view.base.css.js +1 -1
- package/components/calendar/themes/days-view.base.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
- package/components/calendar/themes/year-month-view.base.css.js +1 -1
- package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
- package/components/card/themes/container.base.css.js +1 -1
- package/components/card/themes/container.base.css.js.map +1 -1
- package/components/carousel/carousel-indicator.js +1 -0
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -1
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +3 -3
- package/components/carousel/carousel.js.map +1 -1
- package/components/carousel/themes/carousel.base.css.js +1 -1
- package/components/carousel/themes/carousel.base.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js.map +1 -1
- package/components/chat/chat-input.d.ts +1 -2
- package/components/chat/chat-input.js +1 -1
- package/components/chat/chat-input.js.map +1 -1
- package/components/chat/chat-state.d.ts +8 -9
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +1 -3
- package/components/chat/chat.js +2 -2
- package/components/chat/chat.js.map +1 -1
- package/components/chat/message-attachments.d.ts +6 -15
- package/components/chat/message-attachments.js.map +1 -1
- package/components/chat/themes/chat.base.css.js +1 -1
- package/components/chat/themes/chat.base.css.js.map +1 -1
- package/components/chat/themes/message.base.css.js +1 -1
- package/components/chat/themes/message.base.css.js.map +1 -1
- package/components/chat/utils.d.ts +0 -1
- package/components/chat/utils.js +1 -1
- package/components/chat/utils.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +1 -1
- package/components/checkbox/checkbox.js +1 -1
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/themes/checkbox.base.css.js +1 -1
- package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js.map +1 -1
- package/components/checkbox/themes/switch.base.css.js +1 -1
- package/components/checkbox/themes/switch.base.css.js.map +1 -1
- package/components/chip/chip.d.ts +2 -2
- package/components/chip/chip.js.map +1 -1
- package/components/color-picker/color-picker.d.ts +35 -34
- package/components/color-picker/color-picker.js +9 -4
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/color-picker/common.d.ts +0 -2
- package/components/color-picker/common.js +2 -2
- package/components/color-picker/common.js.map +1 -1
- package/components/color-picker/converters.js.map +1 -1
- package/components/color-picker/picker-canvas.js.map +1 -1
- package/components/color-picker/themes/color-picker.base.css.js +1 -1
- package/components/color-picker/themes/color-picker.base.css.js.map +1 -1
- package/components/combo/combo.d.ts +18 -20
- package/components/combo/combo.js +8 -2
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +7 -10
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/themes/combo-item.base.css.js +1 -1
- package/components/combo/themes/combo-item.base.css.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/shared/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/shared/combo.bootstrap.css.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +33 -29
- package/components/date-picker/date-picker.base.js +15 -4
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/date-picker.js +5 -3
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/date-picker.base.css.js +1 -1
- package/components/date-picker/themes/date-picker.base.css.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +0 -2
- package/components/date-range-picker/date-range-input.js +0 -6
- package/components/date-range-picker/date-range-input.js.map +1 -1
- package/components/date-range-picker/date-range-picker.base.css.js +1 -1
- package/components/date-range-picker/date-range-picker.base.css.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +22 -31
- package/components/date-range-picker/date-range-picker.js +7 -7
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/i18n.d.ts +21 -0
- package/components/date-range-picker/i18n.js +10 -0
- package/components/date-range-picker/i18n.js.map +1 -0
- package/components/date-range-picker/predefined-ranges-area.base.css.js +1 -1
- package/components/date-range-picker/predefined-ranges-area.base.css.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
- package/components/date-range-picker/predefined-ranges-area.js +2 -5
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +0 -4
- package/components/date-range-picker/validators.js +4 -4
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +39 -37
- package/components/date-time-input/date-time-input.base.js +6 -0
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +1 -11
- package/components/date-time-input/date-time-input.js +0 -6
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
- package/components/date-time-input/datetime-mask-parser.js +1 -1
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/dialog/dialog.js.map +1 -1
- package/components/divider/themes/divider.base.css.js +1 -1
- package/components/divider/themes/divider.base.css.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +2 -10
- package/components/dropdown/dropdown-group.js +2 -27
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +17 -23
- package/components/dropdown/dropdown.js +5 -17
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
- package/components/file-input/file-input.d.ts +2 -2
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/file-input.base.css.js +1 -1
- package/components/file-input/themes/file-input.base.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/icon.registry.d.ts +6 -6
- package/components/icon/icon.registry.js.map +1 -1
- package/components/input/input.d.ts +3 -3
- package/components/input/input.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/list/themes/item.base.css.js +1 -1
- package/components/list/themes/item.base.css.js.map +1 -1
- package/components/mask-input/mask-history.d.ts +22 -18
- package/components/mask-input/mask-history.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +1 -1
- package/components/mask-input/mask-parser.d.ts +11 -13
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/nav-drawer/themes/item.base.css.js +1 -1
- package/components/nav-drawer/themes/item.base.css.js.map +1 -1
- package/components/popover/popover.d.ts +45 -34
- package/components/popover/popover.js +54 -122
- package/components/popover/popover.js.map +1 -1
- package/components/popover/position/arrow.d.ts +19 -0
- package/components/popover/position/arrow.js +33 -0
- package/components/popover/position/arrow.js.map +1 -0
- package/components/popover/position/floating.d.ts +40 -0
- package/components/popover/position/floating.js +146 -0
- package/components/popover/position/floating.js.map +1 -0
- package/components/popover/position/native.d.ts +45 -0
- package/components/popover/position/native.js +158 -0
- package/components/popover/position/native.js.map +1 -0
- package/components/popover/position/strategy.d.ts +37 -0
- package/components/popover/position/strategy.js +21 -0
- package/components/popover/position/strategy.js.map +1 -0
- package/components/popover/position/types.d.ts +26 -0
- package/components/popover/position/types.js +15 -0
- package/components/popover/position/types.js.map +1 -0
- package/components/popover/themes/light/popover.base.css.js +1 -1
- package/components/popover/themes/light/popover.base.css.js.map +1 -1
- package/components/progress/circular-progress.d.ts +0 -5
- package/components/progress/circular-progress.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/shared/linear.progress.bootstrap.css.d.ts +1 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js +3 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js.map +1 -0
- package/components/progress/themes/linear/themes.js +3 -2
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/qr-code/qr-code.d.ts +29 -2
- package/components/qr-code/qr-code.js +56 -13
- package/components/qr-code/qr-code.js.map +1 -1
- package/components/qr-code/renderer/export.d.ts +28 -0
- package/components/qr-code/renderer/export.js +120 -0
- package/components/qr-code/renderer/export.js.map +1 -0
- package/components/qr-code/types.d.ts +26 -0
- package/components/qr-code/types.js.map +1 -1
- package/components/radio/radio.d.ts +4 -4
- package/components/radio/radio.js +17 -14
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/radio.base.css.js +1 -1
- package/components/radio/themes/radio.base.css.js.map +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +6 -6
- package/components/rating/rating.js.map +1 -1
- package/components/select/select-group.d.ts +5 -10
- package/components/select/select-group.js +10 -34
- package/components/select/select-group.js.map +1 -1
- package/components/select/select.d.ts +12 -20
- package/components/select/select.js +4 -14
- 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/shared/select.bootstrap.css.js +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
- package/components/slider/themes/shared/slider.material.css.js +1 -1
- package/components/slider/themes/shared/slider.material.css.js.map +1 -1
- package/components/slider/themes/slider.base.css.js +1 -1
- package/components/slider/themes/slider.base.css.js.map +1 -1
- package/components/snackbar/themes/snackbar.base.css.js +1 -1
- package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
- package/components/splitter/splitter.d.ts +6 -6
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/themes/splitter.base.css.js +1 -1
- package/components/splitter/themes/splitter.base.css.js.map +1 -1
- package/components/stepper/themes/step/step.base.css.js +1 -1
- package/components/stepper/themes/step/step.base.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.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/shared/tabs/tabs.material.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -1
- package/components/tabs/themes/tab.base.css.js +1 -1
- package/components/tabs/themes/tab.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +1 -1
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
- package/components/tile-manager/themes/tile.base.css.js +1 -1
- package/components/tile-manager/themes/tile.base.css.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +6 -7
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +3 -3
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/themes/toast.base.css.js +1 -1
- package/components/toast/themes/toast.base.css.js.map +1 -1
- package/components/toast/toast.d.ts +0 -2
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/service.js +4 -5
- package/components/tooltip/service.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 +34 -13
- package/components/tooltip/tooltip.js +8 -4
- package/components/tooltip/tooltip.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/tree-item.d.ts +6 -6
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +5 -6
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.js.map +1 -1
- package/components/types.d.ts +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/themes/validator.base.css.js +1 -1
- package/components/validation-container/themes/validator.base.css.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +10 -12
- package/components/validation-container/validation-container.js +14 -17
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +5 -5
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/virtualization.d.ts +61 -63
- package/components/virtualization/virtualization.js +6 -5
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +16769 -19698
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +3 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/internals/abort-handler.d.ts +13 -25
- package/internals/abort-handler.js +4 -6
- package/internals/abort-handler.js.map +1 -1
- package/internals/context.d.ts +13 -7
- package/internals/context.js +2 -1
- package/internals/context.js.map +1 -1
- package/internals/controllers/adopt-styles.d.ts +19 -20
- package/internals/controllers/adopt-styles.js +3 -8
- package/internals/controllers/adopt-styles.js.map +1 -1
- package/internals/controllers/aria-projection.d.ts +56 -55
- package/internals/controllers/aria-projection.js +14 -15
- package/internals/controllers/aria-projection.js.map +1 -1
- package/internals/controllers/async-consumer.js.map +1 -1
- package/internals/controllers/command.d.ts +15 -30
- package/internals/controllers/command.js +2 -7
- package/internals/controllers/command.js.map +1 -1
- package/internals/controllers/context-provider.d.ts +7 -13
- package/internals/controllers/context-provider.js.map +1 -1
- package/internals/controllers/focus-ring.d.ts +10 -30
- package/internals/controllers/focus-ring.js +6 -12
- package/internals/controllers/focus-ring.js.map +1 -1
- package/internals/controllers/fullscreen.d.ts +7 -23
- package/internals/controllers/fullscreen.js +3 -9
- package/internals/controllers/fullscreen.js.map +1 -1
- package/internals/controllers/gestures.d.ts +10 -29
- package/internals/controllers/gestures.js +1 -3
- package/internals/controllers/gestures.js.map +1 -1
- package/internals/controllers/group.d.ts +13 -30
- package/internals/controllers/group.js.map +1 -1
- package/internals/controllers/host-listeners.d.ts +28 -0
- package/internals/controllers/host-listeners.js +27 -0
- package/internals/controllers/host-listeners.js.map +1 -0
- package/internals/controllers/id-resolver.d.ts +8 -9
- package/internals/controllers/id-resolver.js +6 -14
- package/internals/controllers/id-resolver.js.map +1 -1
- package/internals/controllers/internals.d.ts +53 -104
- package/internals/controllers/internals.js +40 -13
- package/internals/controllers/internals.js.map +1 -1
- package/internals/controllers/key-bindings.d.ts +61 -158
- package/internals/controllers/key-bindings.js +68 -67
- package/internals/controllers/key-bindings.js.map +1 -1
- package/internals/controllers/keys.d.ts +32 -0
- package/internals/controllers/keys.js +20 -0
- package/internals/controllers/keys.js.map +1 -0
- package/internals/controllers/mutation-observer.d.ts +14 -37
- package/internals/controllers/mutation-observer.js +1 -1
- package/internals/controllers/mutation-observer.js.map +1 -1
- package/internals/controllers/resize-observer.d.ts +9 -19
- package/internals/controllers/resize-observer.js.map +1 -1
- package/internals/controllers/root-click.d.ts +11 -42
- package/internals/controllers/root-click.js +4 -6
- package/internals/controllers/root-click.js.map +1 -1
- package/internals/controllers/roving-focus.d.ts +16 -35
- package/internals/controllers/roving-focus.js.map +1 -1
- package/internals/controllers/slot.d.ts +25 -54
- package/internals/controllers/slot.js +6 -6
- package/internals/controllers/slot.js.map +1 -1
- package/internals/controllers/toggle.d.ts +44 -48
- package/internals/controllers/toggle.js.map +1 -1
- package/internals/date/compare.js.map +1 -1
- package/internals/date/converters.d.ts +10 -7
- package/internals/date/converters.js.map +1 -1
- package/internals/date/model.d.ts +9 -16
- package/internals/date/model.js +22 -25
- package/internals/date/model.js.map +1 -1
- package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
- package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
- package/internals/decorators/blazorDeepImport.d.ts +1 -3
- package/internals/decorators/blazorDeepImport.js.map +1 -1
- package/internals/decorators/blazorInclude.d.ts +3 -2
- package/internals/decorators/blazorInclude.js.map +1 -1
- package/internals/decorators/blazorIndirectRender.d.ts +1 -3
- package/internals/decorators/blazorIndirectRender.js.map +1 -1
- package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
- package/internals/decorators/blazorSuppressComponent.js.map +1 -1
- package/internals/decorators/coerced-property.d.ts +14 -20
- package/internals/decorators/coerced-property.js.map +1 -1
- package/internals/decorators/shadow-options.d.ts +2 -5
- package/internals/decorators/shadow-options.js.map +1 -1
- package/internals/definitions/defineAllComponents.js +6 -0
- package/internals/definitions/defineAllComponents.js.map +1 -1
- package/internals/directives/drag.d.ts +51 -81
- package/internals/directives/drag.js +27 -89
- package/internals/directives/drag.js.map +1 -1
- package/internals/directives/pointer-operation.d.ts +75 -0
- package/internals/directives/pointer-operation.js +92 -0
- package/internals/directives/pointer-operation.js.map +1 -0
- package/internals/directives/resize.d.ts +36 -64
- package/internals/directives/resize.js +18 -85
- package/internals/directives/resize.js.map +1 -1
- package/internals/i18n/EN/calendar.resources.d.ts +8 -2
- package/internals/i18n/EN/calendar.resources.js +2 -2
- package/internals/i18n/EN/calendar.resources.js.map +1 -1
- package/internals/i18n/EN/chat.resources.d.ts +8 -2
- package/internals/i18n/EN/chat.resources.js +3 -10
- package/internals/i18n/EN/chat.resources.js.map +1 -1
- package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
- package/internals/i18n/EN/date-picker.resources.js +1 -7
- package/internals/i18n/EN/date-picker.resources.js.map +1 -1
- package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
- package/internals/i18n/EN/date-range-picker.resources.js +2 -2
- package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
- package/internals/i18n/i18n-controller.d.ts +44 -46
- package/internals/i18n/i18n-controller.js +46 -33
- package/internals/i18n/i18n-controller.js.map +1 -1
- package/internals/i18n/utils.d.ts +9 -4
- package/internals/i18n/utils.js +4 -27
- package/internals/i18n/utils.js.map +1 -1
- package/internals/mixins/alert.d.ts +10 -25
- package/internals/mixins/alert.js.map +1 -1
- package/internals/mixins/combo-box.d.ts +21 -11
- package/internals/mixins/combo-box.js +16 -22
- package/internals/mixins/combo-box.js.map +1 -1
- package/internals/mixins/event-emitter.js +9 -11
- package/internals/mixins/event-emitter.js.map +1 -1
- package/internals/mixins/forms/associated-required.d.ts +4 -4
- package/internals/mixins/forms/associated-required.js.map +1 -1
- package/internals/mixins/forms/associated.d.ts +4 -2
- package/internals/mixins/forms/associated.js +8 -19
- package/internals/mixins/forms/associated.js.map +1 -1
- package/internals/mixins/forms/form-transformers.js.map +1 -1
- package/internals/mixins/forms/types.d.ts +24 -80
- package/internals/mixins/forms/types.js.map +1 -1
- package/internals/mixins/group.d.ts +18 -0
- package/internals/mixins/group.js +37 -0
- package/internals/mixins/group.js.map +1 -0
- package/internals/mixins/i18n.d.ts +10 -16
- package/internals/mixins/i18n.js.map +1 -1
- package/internals/mixins/mask-behavior.d.ts +8 -22
- package/internals/mixins/mask-behavior.js +1 -2
- package/internals/mixins/mask-behavior.js.map +1 -1
- package/internals/mixins/option.d.ts +1 -2
- package/internals/mixins/option.js +2 -1
- package/internals/mixins/option.js.map +1 -1
- package/internals/part-map.d.ts +4 -2
- package/internals/part-map.js +1 -1
- package/internals/part-map.js.map +1 -1
- package/internals/templates/input-shell.d.ts +8 -17
- package/internals/templates/input-shell.js +4 -1
- package/internals/templates/input-shell.js.map +1 -1
- package/internals/templates/masked-input.d.ts +7 -8
- package/internals/templates/masked-input.js.map +1 -1
- package/internals/templates/slotted-icon.d.ts +7 -12
- package/internals/templates/slotted-icon.js.map +1 -1
- package/internals/templates/toggle-shell.d.ts +6 -7
- package/internals/templates/toggle-shell.js.map +1 -1
- package/internals/timing.d.ts +5 -14
- package/internals/timing.js.map +1 -1
- package/internals/utils/arrays.d.ts +21 -21
- package/internals/utils/arrays.js +14 -0
- package/internals/utils/arrays.js.map +1 -1
- package/internals/utils/dom.d.ts +51 -39
- package/internals/utils/dom.js +1 -2
- package/internals/utils/dom.js.map +1 -1
- package/internals/utils/events.d.ts +29 -16
- package/internals/utils/events.js +9 -1
- package/internals/utils/events.js.map +1 -1
- package/internals/utils/lit.d.ts +5 -2
- package/internals/utils/lit.js.map +1 -1
- package/internals/utils/math.d.ts +8 -6
- package/internals/utils/math.js.map +1 -1
- package/internals/utils/objects.d.ts +3 -20
- package/internals/utils/objects.js +1 -39
- package/internals/utils/objects.js.map +1 -1
- package/internals/utils/strings.d.ts +9 -11
- package/internals/utils/strings.js.map +1 -1
- package/internals/utils/types.d.ts +16 -3
- package/internals/utils/types.js +3 -0
- package/internals/utils/types.js.map +1 -1
- package/internals/validators.d.ts +9 -8
- package/internals/validators.js +12 -6
- package/internals/validators.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +3 -0
- package/skills/igniteui-wc-figma-to-app/SKILL.md +907 -0
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +363 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +407 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +325 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +409 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +376 -0
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +21 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +4 -3
- package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +14 -0
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +12 -2
- package/theming/config.d.ts +14 -5
- package/theming/config.js +38 -18
- package/theming/config.js.map +1 -1
- package/theming/context.d.ts +1 -23
- package/theming/context.js.map +1 -1
- package/theming/theming-controller.d.ts +2 -32
- package/theming/theming-controller.js +15 -21
- package/theming/theming-controller.js.map +1 -1
- package/theming/theming-event.d.ts +0 -7
- package/theming/theming-event.js +0 -13
- package/theming/theming-event.js.map +1 -1
- package/theming/types.d.ts +1 -8
- package/theming/types.js.map +1 -1
- package/web-types.json +3 -3
- package/animations/presets/slide/index.d.ts +0 -3
- package/animations/presets/slide/index.js +0 -16
- package/animations/presets/slide/index.js.map +0 -1
- package/internals/controllers/root-scroll.d.ts +0 -31
- package/internals/controllers/root-scroll.js +0 -71
- package/internals/controllers/root-scroll.js.map +0 -1
- package/theming/utils.d.ts +0 -11
- package/theming/utils.js +0 -20
- package/theming/utils.js.map +0 -1
|
@@ -2,14 +2,12 @@ import { type LitElement, type ReactiveController, type ReactiveControllerHost }
|
|
|
2
2
|
import { Directive, type DirectiveParameters, type ElementPart, type PartInfo } from 'lit/directive.js';
|
|
3
3
|
type ControllerHost = ReactiveControllerHost & LitElement;
|
|
4
4
|
/**
|
|
5
|
-
* ARIA semantics a composite host projects onto the native editor
|
|
6
|
-
* input-shaped component.
|
|
5
|
+
* The ARIA semantics that a composite host projects onto the native editor.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ancestor tree scopes.
|
|
7
|
+
* @remarks
|
|
8
|
+
* The host delegates focus, so assistive technology lands on the editor of
|
|
9
|
+
* the input-shaped component and reports it. Every relation travels as an
|
|
10
|
+
* element reference, because an IDREF does not cross a shadow boundary.
|
|
13
11
|
*/
|
|
14
12
|
export type ProjectedARIA = {
|
|
15
13
|
role?: string;
|
|
@@ -22,21 +20,17 @@ export type ProjectedARIA = {
|
|
|
22
20
|
labelledBy?: ReadonlyArray<Element> | null;
|
|
23
21
|
activeDescendant?: Element | null;
|
|
24
22
|
};
|
|
25
|
-
/** Configuration for the {@link AriaTargetController}. */
|
|
26
23
|
type AriaTargetConfig = {
|
|
27
24
|
/** Resolves the component's own `ElementInternals` labels. */
|
|
28
25
|
labels: () => ReadonlyArray<Element> | null;
|
|
29
|
-
/**
|
|
30
|
-
* Resolves the component's own description element (its helper-text
|
|
31
|
-
* container), or `null` when it currently renders no description content.
|
|
32
|
-
*/
|
|
26
|
+
/** Resolves the helper-text container, or `null` when there is none. */
|
|
33
27
|
description: () => Element | null;
|
|
34
28
|
};
|
|
35
29
|
/**
|
|
36
|
-
*
|
|
37
|
-
* state
|
|
38
|
-
* {@link ariaBindings} directive
|
|
39
|
-
* through
|
|
30
|
+
* The binding values for a native editor element, resolved from the projected
|
|
31
|
+
* state and the own ARIA of the editor, and applied by the
|
|
32
|
+
* {@link ariaBindings} directive. A scalar binds as an attribute, a relation
|
|
33
|
+
* through an ARIA element-reflection property.
|
|
40
34
|
*/
|
|
41
35
|
export type ResolvedARIABindings = {
|
|
42
36
|
role?: string;
|
|
@@ -45,9 +39,9 @@ export type ResolvedARIABindings = {
|
|
|
45
39
|
disabled?: string;
|
|
46
40
|
label?: string;
|
|
47
41
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
42
|
+
* The same-root IDREF for the own description of the editor. It applies
|
|
43
|
+
* while the host projects no description, so tooling that reads attributes
|
|
44
|
+
* only, for example axe, still sees a content attribute.
|
|
51
45
|
*/
|
|
52
46
|
describedByRef?: string;
|
|
53
47
|
labelledBy: ReadonlyArray<Element> | null;
|
|
@@ -56,47 +50,56 @@ export type ResolvedARIABindings = {
|
|
|
56
50
|
activeDescendant: Element | null;
|
|
57
51
|
};
|
|
58
52
|
/**
|
|
59
|
-
* The receiving end of an ARIA projection
|
|
60
|
-
*
|
|
61
|
-
*
|
|
53
|
+
* The receiving end of an ARIA projection. Every input-shaped component adds
|
|
54
|
+
* it to hold the state that a composite host projects, and resolves that
|
|
55
|
+
* state against its own ARIA.
|
|
62
56
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Not a reactive controller: it needs only a host render when the projected
|
|
59
|
+
* state changes.
|
|
65
60
|
*/
|
|
66
61
|
declare class AriaTargetController {
|
|
67
62
|
private readonly _host;
|
|
68
63
|
private readonly _config;
|
|
69
64
|
private _projected;
|
|
65
|
+
/** The bindings last resolved for the native editor. */
|
|
66
|
+
private _resolved?;
|
|
70
67
|
constructor(host: ControllerHost, config: AriaTargetConfig);
|
|
71
68
|
/**
|
|
72
|
-
* Replaces the projected state
|
|
73
|
-
*
|
|
69
|
+
* Replaces the projected state.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* A host render happens only when the resolved bindings change, so a
|
|
73
|
+
* projection on every host update stays inexpensive. The comparison uses
|
|
74
|
+
* the resolved bindings, so it also catches a change to the own labels or
|
|
75
|
+
* description, which the component cannot observe.
|
|
74
76
|
*/
|
|
75
77
|
setProjected(state: ProjectedARIA): void;
|
|
76
78
|
/**
|
|
77
|
-
* Mirrors the projected `role
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
79
|
+
* Mirrors the projected `role` and `hasPopup` onto `data-role` and
|
|
80
|
+
* `data-haspopup`.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* The input themes style the anchor of a composite widget from these
|
|
84
|
+
* attributes. The ARIA itself stays on the editor in the shadow root, where
|
|
85
|
+
* a `:host()` selector cannot observe it.
|
|
82
86
|
*/
|
|
83
87
|
private _reflectStylingHooks;
|
|
84
88
|
/**
|
|
85
|
-
* Resolves the binding values for the native editor element
|
|
86
|
-
* projected state with the editor's own ARIA.
|
|
89
|
+
* Resolves the binding values for the native editor element.
|
|
87
90
|
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* relation switches to element references
|
|
92
|
-
*
|
|
93
|
-
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* A projected label wins over the own label of the component. The
|
|
93
|
+
* description stays a same-root IDREF while the host projects none, and the
|
|
94
|
+
* whole relation switches to element references afterwards, because an
|
|
95
|
+
* attribute and a reflection cannot coexist. See
|
|
96
|
+
* {@link ResolvedARIABindings.describedByRef}.
|
|
94
97
|
*/
|
|
95
98
|
resolveBindings(): ResolvedARIABindings;
|
|
96
99
|
}
|
|
97
100
|
/**
|
|
98
|
-
* Applies {@link ResolvedARIABindings} onto the native editor element
|
|
99
|
-
*
|
|
101
|
+
* Applies {@link ResolvedARIABindings} onto the native editor element. It
|
|
102
|
+
* applies a relation on every render, and a scalar only on a change.
|
|
100
103
|
*/
|
|
101
104
|
declare class AriaBindingsDirective extends Directive {
|
|
102
105
|
private _previous?;
|
|
@@ -105,21 +108,20 @@ declare class AriaBindingsDirective extends Directive {
|
|
|
105
108
|
update(part: ElementPart, [bindings]: DirectiveParameters<this>): unknown;
|
|
106
109
|
}
|
|
107
110
|
/**
|
|
108
|
-
* Binds resolved ARIA state onto a native editor element as
|
|
109
|
-
* expression,
|
|
111
|
+
* Binds the resolved ARIA state onto a native editor element as one element
|
|
112
|
+
* expression, for example `<input ${ariaBindings(aria)} />`.
|
|
110
113
|
*/
|
|
111
114
|
export declare const ariaBindings: (_: ResolvedARIABindings) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
|
|
112
|
-
/** Configuration for the {@link AriaProjectorController}. */
|
|
113
115
|
type AriaProjectorConfig = {
|
|
114
|
-
/** Resolves the input-shaped component the ARIA state
|
|
116
|
+
/** Resolves the input-shaped component that receives the ARIA state. */
|
|
115
117
|
target: () => Element | null | undefined;
|
|
116
|
-
/** Computes the ARIA state to project
|
|
118
|
+
/** Computes the ARIA state to project, after every host update. */
|
|
117
119
|
state: () => ProjectedARIA;
|
|
118
120
|
};
|
|
119
121
|
/**
|
|
120
|
-
* The sending end of an ARIA projection
|
|
121
|
-
*
|
|
122
|
-
*
|
|
122
|
+
* The sending end of an ARIA projection. A composite host such as
|
|
123
|
+
* `igc-select` adds it to push the computed ARIA state onto the
|
|
124
|
+
* {@link AriaTargetController} of the target after every host update.
|
|
123
125
|
*/
|
|
124
126
|
declare class AriaProjectorController implements ReactiveController {
|
|
125
127
|
private readonly _host;
|
|
@@ -130,15 +132,14 @@ declare class AriaProjectorController implements ReactiveController {
|
|
|
130
132
|
hostUpdated(): void;
|
|
131
133
|
}
|
|
132
134
|
/**
|
|
133
|
-
* Creates
|
|
134
|
-
* component
|
|
135
|
-
* {@link addAriaProjector}
|
|
136
|
-
* and reports once the component's host delegates focus to it.
|
|
135
|
+
* Creates an {@link AriaTargetController} and adds it to an input-shaped
|
|
136
|
+
* component. It makes the native editor of the component a valid target for
|
|
137
|
+
* {@link addAriaProjector}.
|
|
137
138
|
*/
|
|
138
139
|
export declare function addAriaTarget(host: ControllerHost, config: AriaTargetConfig): AriaTargetController;
|
|
139
140
|
/**
|
|
140
|
-
* Creates
|
|
141
|
-
*
|
|
141
|
+
* Creates an {@link AriaProjectorController} and adds it to a composite host.
|
|
142
|
+
* It projects ARIA onto the native editor of the target component.
|
|
142
143
|
*/
|
|
143
144
|
export declare function addAriaProjector(host: ControllerHost, config: AriaProjectorConfig): AriaProjectorController;
|
|
144
145
|
export type { AriaProjectorController, AriaTargetController };
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { noChange, } from 'lit';
|
|
2
2
|
import { Directive, directive, PartType, } from 'lit/directive.js';
|
|
3
|
+
import { sameItems } from '../utils/arrays.js';
|
|
3
4
|
const targets = new WeakMap();
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
return a.length === b.length && a.every((element, i) => element === b[i]);
|
|
9
|
-
}
|
|
10
|
-
function projectionsEqual(a, b) {
|
|
11
|
-
return (a.role === b.role &&
|
|
5
|
+
function bindingsEqual(a, b) {
|
|
6
|
+
return (a !== undefined &&
|
|
7
|
+
a.role === b.role &&
|
|
12
8
|
a.hasPopup === b.hasPopup &&
|
|
13
9
|
a.expanded === b.expanded &&
|
|
14
10
|
a.disabled === b.disabled &&
|
|
15
11
|
a.label === b.label &&
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
a.describedByRef === b.describedByRef &&
|
|
13
|
+
a.activeDescendant === b.activeDescendant &&
|
|
14
|
+
sameItems(a.controls, b.controls) &&
|
|
15
|
+
sameItems(a.describedBy, b.describedBy) &&
|
|
16
|
+
sameItems(a.labelledBy, b.labelledBy));
|
|
20
17
|
}
|
|
21
18
|
class AriaTargetController {
|
|
22
19
|
constructor(host, config) {
|
|
@@ -26,8 +23,9 @@ class AriaTargetController {
|
|
|
26
23
|
targets.set(host, this);
|
|
27
24
|
}
|
|
28
25
|
setProjected(state) {
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const previous = this._resolved;
|
|
27
|
+
this._projected = state;
|
|
28
|
+
if (!bindingsEqual(previous, this.resolveBindings())) {
|
|
31
29
|
this._reflectStylingHooks();
|
|
32
30
|
this._host.requestUpdate();
|
|
33
31
|
}
|
|
@@ -45,7 +43,7 @@ class AriaTargetController {
|
|
|
45
43
|
resolveBindings() {
|
|
46
44
|
const projected = this._projected;
|
|
47
45
|
const description = this._config.description();
|
|
48
|
-
|
|
46
|
+
this._resolved = {
|
|
49
47
|
role: projected.role,
|
|
50
48
|
hasPopup: projected.hasPopup,
|
|
51
49
|
expanded: projected.expanded,
|
|
@@ -63,6 +61,7 @@ class AriaTargetController {
|
|
|
63
61
|
: description?.id || undefined,
|
|
64
62
|
activeDescendant: projected.activeDescendant ?? null,
|
|
65
63
|
};
|
|
64
|
+
return this._resolved;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
const scalarBindings = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aria-projection.js","sourceRoot":"","sources":["../../../src/internals/controllers/aria-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,GAGT,MAAM,KAAK,CAAC;AACb,OAAO,EACL,SAAS,EAET,SAAS,EAGT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAkE1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAiC,CAAC;AAE7D,SAAS,aAAa,CACpB,CAA4C,EAC5C,CAA4C;IAE5C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAgB,EAAE,CAAgB;IAC1D,OAAO,CACL,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;QACzB,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;QACnB,CAAC,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,IAAI,IA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CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAGM,WAAW;QAChB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAEtC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1C,OAAO;QACT,CAAC;QAKD,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAE5B,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAQD,MAAM,UAAU,aAAa,CAC3B,IAAoB,EACpB,MAAwB;IAExB,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,MAA2B;IAE3B,OAAO,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {\n type LitElement,\n noChange,\n type ReactiveController,\n type ReactiveControllerHost,\n} from 'lit';\nimport {\n Directive,\n type DirectiveParameters,\n directive,\n type ElementPart,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\n\ntype ControllerHost = ReactiveControllerHost & LitElement;\n\n/**\n * ARIA semantics a composite host projects onto the native editor of an\n * input-shaped component.\n *\n * The host cannot publish these itself: it delegates focus, so the native\n * editor inside the input component's shadow root is what assistive technology\n * lands on and reports. All relations travel as element references - an IDREF\n * cannot cross a shadow boundary, while ARIA element reflection resolves into\n * ancestor tree scopes.\n */\nexport type ProjectedARIA = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n controls?: ReadonlyArray<Element> | null;\n describedBy?: ReadonlyArray<Element> | null;\n labelledBy?: ReadonlyArray<Element> | null;\n activeDescendant?: Element | null;\n};\n\n/** Configuration for the {@link AriaTargetController}. */\ntype AriaTargetConfig = {\n /** Resolves the component's own `ElementInternals` labels. */\n labels: () => ReadonlyArray<Element> | null;\n /**\n * Resolves the component's own description element (its helper-text\n * container), or `null` when it currently renders no description content.\n */\n description: () => Element | null;\n};\n\n/**\n * Binding values for a native editor element, resolved from the projected\n * state merged with the editor's own ARIA. Applied onto the editor with the\n * {@link ariaBindings} directive: scalars bind as attributes, relations bind\n * through the ARIA element-reflection properties.\n */\nexport type ResolvedARIABindings = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n /**\n * Same-root IDREF for the editor's own description, applied while no\n * description is projected. Unlike element reflection, a content attribute\n * stays visible to tooling that only reads attributes (e.g. axe).\n */\n describedByRef?: string;\n labelledBy: ReadonlyArray<Element> | null;\n controls: ReadonlyArray<Element> | null;\n describedBy: ReadonlyArray<Element> | null;\n activeDescendant: Element | null;\n};\n\n/**\n * Internal registry resolving an input-shaped component to its ARIA target\n * controller, so composite hosts can project state without the component\n * exposing a public member for it.\n */\nconst targets = new WeakMap<Element, AriaTargetController>();\n\nfunction elementsEqual(\n a: ReadonlyArray<Element> | null | undefined,\n b: ReadonlyArray<Element> | null | undefined\n): boolean {\n if (a == null || b == null) {\n return a == null && b == null;\n }\n\n return a.length === b.length && a.every((element, i) => element === b[i]);\n}\n\nfunction projectionsEqual(a: ProjectedARIA, b: ProjectedARIA): boolean {\n return (\n a.role === b.role &&\n a.hasPopup === b.hasPopup &&\n a.expanded === b.expanded &&\n a.disabled === b.disabled &&\n a.label === b.label &&\n (a.activeDescendant ?? null) === (b.activeDescendant ?? null) &&\n elementsEqual(a.controls, b.controls) &&\n elementsEqual(a.describedBy, b.describedBy) &&\n elementsEqual(a.labelledBy, b.labelledBy)\n );\n}\n\n/**\n * The receiving end of an ARIA projection, added by every input-shaped\n * component. Holds the state a composite host currently projects and resolves\n * it against the component's own ARIA when the native editor is rendered.\n *\n * Not a reactive controller - it needs no lifecycle hooks, only a render\n * scheduled on the host when the projected state changes.\n */\nclass AriaTargetController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaTargetConfig;\n private _projected: ProjectedARIA = {};\n\n constructor(host: ControllerHost, config: AriaTargetConfig) {\n this._host = host;\n this._config = config;\n targets.set(host, this);\n }\n\n /**\n * Replaces the projected state, scheduling a host render only when it\n * actually changed so projecting on every host update stays cheap.\n */\n public setProjected(state: ProjectedARIA): void {\n if (!projectionsEqual(this._projected, state)) {\n this._projected = state;\n this._reflectStylingHooks();\n this._host.requestUpdate();\n }\n }\n\n /**\n * Mirrors the projected `role`/`hasPopup` as `data-role`/`data-haspopup`\n * attributes on the component itself. The input themes style anchors of\n * composite widgets differently and key off these; the ARIA itself lives on\n * the native editor inside the shadow root, where `:host()` selectors\n * cannot observe it.\n */\n private _reflectStylingHooks(): void {\n const host = this._host;\n const { role, hasPopup } = this._projected;\n\n role\n ? host.setAttribute('data-role', role)\n : host.removeAttribute('data-role');\n hasPopup\n ? host.setAttribute('data-haspopup', hasPopup)\n : host.removeAttribute('data-haspopup');\n }\n\n /**\n * Resolves the binding values for the native editor element by merging the\n * projected state with the editor's own ARIA.\n *\n * Projected labels take precedence over the component's own. The editor's\n * description stays a same-root IDREF ({@link ResolvedARIABindings.describedByRef})\n * while nothing is projected; once a host projects a description, the whole\n * relation switches to element references - attribute and reflection cannot\n * coexist - with the editor's own description element joining the projected\n * ones.\n */\n public resolveBindings(): ResolvedARIABindings {\n const projected = this._projected;\n const description = this._config.description();\n\n return {\n role: projected.role,\n hasPopup: projected.hasPopup,\n expanded: projected.expanded,\n disabled: projected.disabled,\n label: projected.label,\n labelledBy: projected.labelledBy ?? this._config.labels(),\n controls: projected.controls ?? null,\n describedBy: projected.describedBy\n ? description\n ? [description, ...projected.describedBy]\n : projected.describedBy\n : null,\n describedByRef: projected.describedBy\n ? undefined\n : description?.id || undefined,\n activeDescendant: projected.activeDescendant ?? null,\n };\n }\n}\n\nconst scalarBindings = [\n ['role', 'role'],\n ['hasPopup', 'aria-haspopup'],\n ['expanded', 'aria-expanded'],\n ['disabled', 'aria-disabled'],\n ['label', 'aria-label'],\n ['describedByRef', 'aria-describedby'],\n] as const;\n\n/**\n * Applies {@link ResolvedARIABindings} onto the native editor element -\n * relations on every render, scalar attributes only when they changed.\n */\nclass AriaBindingsDirective extends Directive {\n private _previous?: ResolvedARIABindings;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n '`ariaBindings()` can only be used as an element expression.'\n );\n }\n }\n\n public override render(_: ResolvedARIABindings): unknown {\n return noChange;\n }\n\n public override update(\n part: ElementPart,\n [bindings]: DirectiveParameters<this>\n ): unknown {\n const element = part.element;\n const previous = this._previous;\n this._previous = bindings;\n\n // Relations are re-asserted on every render: element references assigned\n // while the editor is detached (its first render commits inside the\n // template fragment) are dropped by the browser, so memoizing them here\n // would leave the associations permanently missing.\n // Assigning them first also means the scalar pass below always observes\n // the final state, since a reflection property detaches the corresponding\n // content attribute.\n element.ariaLabelledByElements = bindings.labelledBy;\n element.ariaControlsElements = bindings.controls;\n element.ariaDescribedByElements = bindings.describedBy;\n element.ariaActiveDescendantElement = bindings.activeDescendant;\n\n for (const [key, attribute] of scalarBindings) {\n const value = bindings[key];\n\n if (!previous || previous[key] !== value) {\n value != null\n ? element.setAttribute(attribute, value)\n : element.removeAttribute(attribute);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Binds resolved ARIA state onto a native editor element as a single element\n * expression, e.g. `<input ${ariaBindings(aria)} />`.\n */\nexport const ariaBindings = directive(AriaBindingsDirective);\n\n/** Configuration for the {@link AriaProjectorController}. */\ntype AriaProjectorConfig = {\n /** Resolves the input-shaped component the ARIA state is projected onto. */\n target: () => Element | null | undefined;\n /** Computes the ARIA state to project. Invoked after every host update. */\n state: () => ProjectedARIA;\n};\n\n/**\n * The sending end of an ARIA projection, added by composite hosts\n * (e.g. `igc-select`). After every host update it pushes the computed ARIA\n * state onto the target component's {@link AriaTargetController}.\n */\nclass AriaProjectorController implements ReactiveController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaProjectorConfig;\n private _retryScheduled = false;\n\n constructor(host: ControllerHost, config: AriaProjectorConfig) {\n this._host = host;\n this._config = config;\n host.addController(this);\n }\n\n /** @internal */\n public hostUpdated(): void {\n const element = this._config.target();\n\n if (!element) {\n return;\n }\n\n const target = targets.get(element);\n\n if (target) {\n target.setProjected(this._config.state());\n return;\n }\n\n // The target exists but has no controller yet - it is not upgraded on the\n // host's first render when definitions register late. Re-project once its\n // definition resolves.\n if (!this._retryScheduled) {\n this._retryScheduled = true;\n\n customElements.whenDefined(element.localName).then(() => {\n this._retryScheduled = false;\n this._host.requestUpdate();\n });\n }\n }\n}\n\n/**\n * Creates and adds an {@link AriaTargetController} to an input-shaped\n * component, making its native editor a valid target for\n * {@link addAriaProjector} - the editor is what assistive technology lands on\n * and reports once the component's host delegates focus to it.\n */\nexport function addAriaTarget(\n host: ControllerHost,\n config: AriaTargetConfig\n): AriaTargetController {\n return new AriaTargetController(host, config);\n}\n\n/**\n * Creates and adds an {@link AriaProjectorController} to a composite host,\n * projecting ARIA semantics onto the native editor of the target component.\n */\nexport function addAriaProjector(\n host: ControllerHost,\n config: AriaProjectorConfig\n): AriaProjectorController {\n return new AriaProjectorController(host, config);\n}\n\nexport type { AriaProjectorController, AriaTargetController };\n"]}
|
|
1
|
+
{"version":3,"file":"aria-projection.js","sourceRoot":"","sources":["../../../src/internals/controllers/aria-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,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AC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACtD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;gBAC7B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAOD,MAAM,UAAU,aAAa,CAC3B,IAAoB,EACpB,MAAwB;IAExB,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAMD,MAAM,UAAU,gBAAgB,CAC9B,IAAoB,EACpB,MAA2B;IAE3B,OAAO,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {\n type LitElement,\n noChange,\n type ReactiveController,\n type ReactiveControllerHost,\n} from 'lit';\nimport {\n Directive,\n type DirectiveParameters,\n directive,\n type ElementPart,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\nimport { sameItems } from '../utils/arrays.js';\n\ntype ControllerHost = ReactiveControllerHost & LitElement;\n\n/**\n * The ARIA semantics that a composite host projects onto the native editor.\n *\n * @remarks\n * The host delegates focus, so assistive technology lands on the editor of\n * the input-shaped component and reports it. Every relation travels as an\n * element reference, because an IDREF does not cross a shadow boundary.\n */\nexport type ProjectedARIA = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n controls?: ReadonlyArray<Element> | null;\n describedBy?: ReadonlyArray<Element> | null;\n labelledBy?: ReadonlyArray<Element> | null;\n activeDescendant?: Element | null;\n};\n\ntype AriaTargetConfig = {\n /** Resolves the component's own `ElementInternals` labels. */\n labels: () => ReadonlyArray<Element> | null;\n /** Resolves the helper-text container, or `null` when there is none. */\n description: () => Element | null;\n};\n\n/**\n * The binding values for a native editor element, resolved from the projected\n * state and the own ARIA of the editor, and applied by the\n * {@link ariaBindings} directive. A scalar binds as an attribute, a relation\n * through an ARIA element-reflection property.\n */\nexport type ResolvedARIABindings = {\n role?: string;\n hasPopup?: string;\n expanded?: string;\n disabled?: string;\n label?: string;\n /**\n * The same-root IDREF for the own description of the editor. It applies\n * while the host projects no description, so tooling that reads attributes\n * only, for example axe, still sees a content attribute.\n */\n describedByRef?: string;\n labelledBy: ReadonlyArray<Element> | null;\n controls: ReadonlyArray<Element> | null;\n describedBy: ReadonlyArray<Element> | null;\n activeDescendant: Element | null;\n};\n\n/**\n * Resolves an input-shaped component to its ARIA target controller, so the\n * component needs no public member for the projection.\n */\nconst targets = new WeakMap<Element, AriaTargetController>();\n\nfunction bindingsEqual(\n a: ResolvedARIABindings | undefined,\n b: ResolvedARIABindings\n): boolean {\n return (\n a !== undefined &&\n a.role === b.role &&\n a.hasPopup === b.hasPopup &&\n a.expanded === b.expanded &&\n a.disabled === b.disabled &&\n a.label === b.label &&\n a.describedByRef === b.describedByRef &&\n a.activeDescendant === b.activeDescendant &&\n sameItems(a.controls, b.controls) &&\n sameItems(a.describedBy, b.describedBy) &&\n sameItems(a.labelledBy, b.labelledBy)\n );\n}\n\n/**\n * The receiving end of an ARIA projection. Every input-shaped component adds\n * it to hold the state that a composite host projects, and resolves that\n * state against its own ARIA.\n *\n * @remarks\n * Not a reactive controller: it needs only a host render when the projected\n * state changes.\n */\nclass AriaTargetController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaTargetConfig;\n private _projected: ProjectedARIA = {};\n /** The bindings last resolved for the native editor. */\n private _resolved?: ResolvedARIABindings;\n\n constructor(host: ControllerHost, config: AriaTargetConfig) {\n this._host = host;\n this._config = config;\n targets.set(host, this);\n }\n\n /**\n * Replaces the projected state.\n *\n * @remarks\n * A host render happens only when the resolved bindings change, so a\n * projection on every host update stays inexpensive. The comparison uses\n * the resolved bindings, so it also catches a change to the own labels or\n * description, which the component cannot observe.\n */\n public setProjected(state: ProjectedARIA): void {\n const previous = this._resolved;\n this._projected = state;\n\n if (!bindingsEqual(previous, this.resolveBindings())) {\n this._reflectStylingHooks();\n this._host.requestUpdate();\n }\n }\n\n /**\n * Mirrors the projected `role` and `hasPopup` onto `data-role` and\n * `data-haspopup`.\n *\n * @remarks\n * The input themes style the anchor of a composite widget from these\n * attributes. The ARIA itself stays on the editor in the shadow root, where\n * a `:host()` selector cannot observe it.\n */\n private _reflectStylingHooks(): void {\n const host = this._host;\n const { role, hasPopup } = this._projected;\n\n role\n ? host.setAttribute('data-role', role)\n : host.removeAttribute('data-role');\n hasPopup\n ? host.setAttribute('data-haspopup', hasPopup)\n : host.removeAttribute('data-haspopup');\n }\n\n /**\n * Resolves the binding values for the native editor element.\n *\n * @remarks\n * A projected label wins over the own label of the component. The\n * description stays a same-root IDREF while the host projects none, and the\n * whole relation switches to element references afterwards, because an\n * attribute and a reflection cannot coexist. See\n * {@link ResolvedARIABindings.describedByRef}.\n */\n public resolveBindings(): ResolvedARIABindings {\n const projected = this._projected;\n const description = this._config.description();\n\n this._resolved = {\n role: projected.role,\n hasPopup: projected.hasPopup,\n expanded: projected.expanded,\n disabled: projected.disabled,\n label: projected.label,\n labelledBy: projected.labelledBy ?? this._config.labels(),\n controls: projected.controls ?? null,\n describedBy: projected.describedBy\n ? description\n ? [description, ...projected.describedBy]\n : projected.describedBy\n : null,\n describedByRef: projected.describedBy\n ? undefined\n : description?.id || undefined,\n activeDescendant: projected.activeDescendant ?? null,\n };\n\n return this._resolved;\n }\n}\n\nconst scalarBindings = [\n ['role', 'role'],\n ['hasPopup', 'aria-haspopup'],\n ['expanded', 'aria-expanded'],\n ['disabled', 'aria-disabled'],\n ['label', 'aria-label'],\n ['describedByRef', 'aria-describedby'],\n] as const;\n\n/**\n * Applies {@link ResolvedARIABindings} onto the native editor element. It\n * applies a relation on every render, and a scalar only on a change.\n */\nclass AriaBindingsDirective extends Directive {\n private _previous?: ResolvedARIABindings;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error(\n '`ariaBindings()` can only be used as an element expression.'\n );\n }\n }\n\n public override render(_: ResolvedARIABindings): unknown {\n return noChange;\n }\n\n public override update(\n part: ElementPart,\n [bindings]: DirectiveParameters<this>\n ): unknown {\n const element = part.element;\n const previous = this._previous;\n this._previous = bindings;\n\n // The relations run on every render: the browser drops an element\n // reference assigned while the editor is outside the document, and the\n // first render commits inside the template fragment. They come first, so\n // the scalar pass sees the attributes that a reflection property removed.\n element.ariaLabelledByElements = bindings.labelledBy;\n element.ariaControlsElements = bindings.controls;\n element.ariaDescribedByElements = bindings.describedBy;\n element.ariaActiveDescendantElement = bindings.activeDescendant;\n\n for (const [key, attribute] of scalarBindings) {\n const value = bindings[key];\n\n if (!previous || previous[key] !== value) {\n value != null\n ? element.setAttribute(attribute, value)\n : element.removeAttribute(attribute);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Binds the resolved ARIA state onto a native editor element as one element\n * expression, for example `<input ${ariaBindings(aria)} />`.\n */\nexport const ariaBindings = directive(AriaBindingsDirective);\n\ntype AriaProjectorConfig = {\n /** Resolves the input-shaped component that receives the ARIA state. */\n target: () => Element | null | undefined;\n /** Computes the ARIA state to project, after every host update. */\n state: () => ProjectedARIA;\n};\n\n/**\n * The sending end of an ARIA projection. A composite host such as\n * `igc-select` adds it to push the computed ARIA state onto the\n * {@link AriaTargetController} of the target after every host update.\n */\nclass AriaProjectorController implements ReactiveController {\n private readonly _host: ControllerHost;\n private readonly _config: AriaProjectorConfig;\n private _retryScheduled = false;\n\n constructor(host: ControllerHost, config: AriaProjectorConfig) {\n this._host = host;\n this._config = config;\n host.addController(this);\n }\n\n /** @internal */\n public hostUpdated(): void {\n const element = this._config.target();\n\n if (!element) {\n return;\n }\n\n const target = targets.get(element);\n\n if (target) {\n target.setProjected(this._config.state());\n return;\n }\n\n // The target exists but is not upgraded yet, because its definition\n // registered late. Project again once that definition resolves.\n if (!this._retryScheduled) {\n this._retryScheduled = true;\n\n customElements.whenDefined(element.localName).then(() => {\n this._retryScheduled = false;\n this._host.requestUpdate();\n });\n }\n }\n}\n\n/**\n * Creates an {@link AriaTargetController} and adds it to an input-shaped\n * component. It makes the native editor of the component a valid target for\n * {@link addAriaProjector}.\n */\nexport function addAriaTarget(\n host: ControllerHost,\n config: AriaTargetConfig\n): AriaTargetController {\n return new AriaTargetController(host, config);\n}\n\n/**\n * Creates an {@link AriaProjectorController} and adds it to a composite host.\n * It projects ARIA onto the native editor of the target component.\n */\nexport function addAriaProjector(\n host: ControllerHost,\n config: AriaProjectorConfig\n): AriaProjectorController {\n return new AriaProjectorController(host, config);\n}\n\nexport type { AriaProjectorController, AriaTargetController };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-consumer.js","sourceRoot":"","sources":["../../../src/internals/controllers/async-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;AAc/E,MAAM,OAAO,oBAAoB;IAQ/B,YAAY,IAAU,EAAE,OAA+B;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;IAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"async-consumer.js","sourceRoot":"","sources":["../../../src/internals/controllers/async-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;AAc/E,MAAM,OAAO,oBAAoB;IAQ/B,YAAY,IAAU,EAAE,OAA+B;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAExB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC;IAC/B,CAAC;IAIM,KAAK,CAAC,aAAa;QACxB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QAEhC,IAAI,CAAC,SAAS,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE;YACjD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;YAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAChC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;SACnC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAIhC,IAAU,EACV,OAAU,EACV,QAAgE;IAEhE,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE;QACpC,OAAO;QACP,QAAQ;QACR,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { type Context, ContextConsumer, type ContextType } from '@lit/context';\nimport type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\n\ntype AsyncContextOptions<T extends Context<unknown, unknown>> = {\n context: T;\n callback?: (value: ContextType<T>, dispose?: () => void) => void;\n subscribe?: boolean;\n};\n\n/* blazorSuppress */\nexport class AsyncContextConsumer<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & HTMLElement,\n> implements ReactiveController {\n protected _host: Host;\n protected _options: AsyncContextOptions<T>;\n protected _consumer?: ContextConsumer<T, Host>;\n\n constructor(host: Host, options: AsyncContextOptions<T>) {\n this._host = host;\n this._options = options;\n\n this._host.addController(this);\n }\n\n public get value(): ContextType<T> | undefined {\n return this._consumer?.value;\n }\n\n // The consumer survives a disconnect, and a reconnect can land during the\n // await, so the guard runs on both sides of it.\n public async hostConnected(): Promise<void> {\n if (this._consumer) {\n return;\n }\n\n await this._host.updateComplete;\n\n this._consumer ??= new ContextConsumer(this._host, {\n context: this._options.context,\n callback: this._options.callback,\n subscribe: this._options.subscribe,\n });\n }\n}\n\nexport function createAsyncContext<\n T extends Context<unknown, unknown>,\n Host extends ReactiveControllerHost & LitElement,\n>(\n host: Host,\n context: T,\n callback?: (value: ContextType<T>, dispose?: () => void) => void\n): AsyncContextConsumer<T, Host> {\n return new AsyncContextConsumer(host, {\n context,\n callback,\n subscribe: true,\n });\n}\n"]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { LitElement
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Connects the native
|
|
4
4
|
* [Invoker Commands API](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API)
|
|
5
|
-
*
|
|
5
|
+
* to the programmatic API of a component.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `CommandEvent`
|
|
10
|
-
*
|
|
11
|
-
* string.
|
|
7
|
+
* @remarks
|
|
8
|
+
* An element with the `command` and `commandfor` attributes makes the browser
|
|
9
|
+
* send a `CommandEvent` to the host, and the controller runs the callback of
|
|
10
|
+
* that command string.
|
|
12
11
|
*
|
|
13
12
|
* @example
|
|
14
13
|
* ```ts
|
|
@@ -20,43 +19,29 @@ import type { LitElement, ReactiveController } from 'lit';
|
|
|
20
19
|
* }
|
|
21
20
|
* ```
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
* declaratively:
|
|
22
|
+
* A button in the document then controls the dialog declaratively:
|
|
25
23
|
*
|
|
26
24
|
* ```html
|
|
27
25
|
* <igc-button command="open" commandfor="my-dialog">Open</igc-button>
|
|
28
26
|
* <igc-dialog id="my-dialog"></igc-dialog>
|
|
29
27
|
* ```
|
|
30
28
|
*/
|
|
31
|
-
declare class CommandController
|
|
29
|
+
declare class CommandController {
|
|
32
30
|
private readonly _host;
|
|
33
31
|
private readonly _commandMap;
|
|
34
32
|
constructor(host: LitElement);
|
|
35
33
|
/**
|
|
36
|
-
* Registers a command string and its
|
|
34
|
+
* Registers a command string and its handler callback.
|
|
37
35
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* .set('close', this.hide);
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @param command - The command string to listen for (e.g. `'open'`,
|
|
46
|
-
* `'toggle-popover'`, or a custom `'--my-command'`).
|
|
47
|
-
* @param callback - The method to invoke when the command is received.
|
|
48
|
-
* Called with the host as `this`.
|
|
36
|
+
* @param command - The command string to listen for, for example `'open'`,
|
|
37
|
+
* `'toggle-popover'`, or a custom `'--my-command'`.
|
|
38
|
+
* @param callback - The method that runs when the command arrives. The
|
|
39
|
+
* controller calls it with the host as `this`.
|
|
49
40
|
*/
|
|
50
41
|
set(command: string, callback: () => unknown): this;
|
|
51
42
|
/** @internal */
|
|
52
|
-
hostConnected(): void;
|
|
53
|
-
/** @internal */
|
|
54
|
-
hostDisconnected(): void;
|
|
55
|
-
/** @internal */
|
|
56
43
|
handleEvent(event: Event): void;
|
|
57
44
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Creates a {@link CommandController} and attaches it to the given host.
|
|
60
|
-
*/
|
|
45
|
+
/** Creates a {@link CommandController} and adds it to the given host. */
|
|
61
46
|
export declare function addCommandController(host: LitElement): CommandController;
|
|
62
47
|
export type { CommandController };
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import { addHostListeners } from './host-listeners.js';
|
|
1
2
|
class CommandController {
|
|
2
3
|
constructor(host) {
|
|
3
4
|
this._commandMap = new Map();
|
|
4
5
|
this._host = host;
|
|
5
|
-
host
|
|
6
|
+
addHostListeners(host, { events: ['command'], listener: this });
|
|
6
7
|
}
|
|
7
8
|
set(command, callback) {
|
|
8
9
|
this._commandMap.set(command, callback);
|
|
9
10
|
return this;
|
|
10
11
|
}
|
|
11
|
-
hostConnected() {
|
|
12
|
-
this._host.addEventListener('command', this);
|
|
13
|
-
}
|
|
14
|
-
hostDisconnected() {
|
|
15
|
-
this._host.removeEventListener('command', this);
|
|
16
|
-
}
|
|
17
12
|
handleEvent(event) {
|
|
18
13
|
const commandEvent = event;
|
|
19
14
|
this._commandMap.get(commandEvent.command)?.call(this._host);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/internals/controllers/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/internals/controllers/command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA6BvD,MAAM,iBAAiB;IAIrB,YAAY,IAAgB;QAFX,gBAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;QAG9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,gBAAgB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAUM,GAAG,CAAC,OAAe,EAAE,QAAuB;QACjD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAGM,WAAW,CAAC,KAAY;QAC7B,MAAM,YAAY,GAAG,KAAqB,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;CACF;AAGD,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACnD,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { addHostListeners } from './host-listeners.js';\n\n/**\n * Connects the native\n * [Invoker Commands API](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API)\n * to the programmatic API of a component.\n *\n * @remarks\n * An element with the `command` and `commandfor` attributes makes the browser\n * send a `CommandEvent` to the host, and the controller runs the callback of\n * that command string.\n *\n * @example\n * ```ts\n * class IgcDialogComponent extends LitElement {\n * private readonly _commands = addCommandController(this)\n * .set('open', this.show)\n * .set('close', this.hide)\n * .set('toggle-popover', this.toggle);\n * }\n * ```\n *\n * A button in the document then controls the dialog declaratively:\n *\n * ```html\n * <igc-button command=\"open\" commandfor=\"my-dialog\">Open</igc-button>\n * <igc-dialog id=\"my-dialog\"></igc-dialog>\n * ```\n */\nclass CommandController {\n private readonly _host: LitElement;\n private readonly _commandMap = new Map<string, () => unknown>();\n\n constructor(host: LitElement) {\n this._host = host;\n\n addHostListeners(host, { events: ['command'], listener: this });\n }\n\n /**\n * Registers a command string and its handler callback.\n *\n * @param command - The command string to listen for, for example `'open'`,\n * `'toggle-popover'`, or a custom `'--my-command'`.\n * @param callback - The method that runs when the command arrives. The\n * controller calls it with the host as `this`.\n */\n public set(command: string, callback: () => unknown): this {\n this._commandMap.set(command, callback);\n return this;\n }\n\n /** @internal */\n public handleEvent(event: Event): void {\n const commandEvent = event as CommandEvent;\n this._commandMap.get(commandEvent.command)?.call(this._host);\n }\n}\n\n/** Creates a {@link CommandController} and adds it to the given host. */\nexport function addCommandController(host: LitElement): CommandController {\n return new CommandController(host);\n}\n\nexport type { CommandController };\n"]}
|
|
@@ -2,24 +2,19 @@ import { type Context, type ContextType } from '@lit/context';
|
|
|
2
2
|
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
3
3
|
type ProviderHost = ReactiveControllerHost & HTMLElement;
|
|
4
4
|
type ContextProviderControllerOptions<C extends Context<unknown, unknown>, H extends ProviderHost> = {
|
|
5
|
-
/** The context to provide. */
|
|
6
5
|
context: C;
|
|
7
|
-
/** Computes the context value
|
|
6
|
+
/** Computes the published context value. */
|
|
8
7
|
value: () => ContextType<C>;
|
|
9
|
-
/**
|
|
10
|
-
* Host properties whose changes republish the context. Anything else that must
|
|
11
|
-
* republish calls {@link ContextProviderController.publish}.
|
|
12
|
-
*/
|
|
8
|
+
/** The host properties that republish the context when they change. */
|
|
13
9
|
watch?: readonly (keyof H)[];
|
|
14
10
|
};
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
17
|
-
* is published when the host connects, republished before an update whenever
|
|
18
|
-
* one of the watched host properties has changed, and on demand via
|
|
19
|
-
* {@link ContextProviderController.publish}.
|
|
12
|
+
* Gives a context from the host, and keeps the subscribers current.
|
|
20
13
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Every publish notifies the subscribers, also when the value keeps its
|
|
16
|
+
* identity, so a host that shares one mutable context object still
|
|
17
|
+
* propagates its changes.
|
|
23
18
|
*
|
|
24
19
|
* @example
|
|
25
20
|
* ```typescript
|
|
@@ -40,7 +35,6 @@ declare class ContextProviderController<C extends Context<unknown, unknown>, H e
|
|
|
40
35
|
hostConnected(): void;
|
|
41
36
|
/** @internal */
|
|
42
37
|
hostUpdate(): void;
|
|
43
|
-
/** Publishes the current value to the subscribers. */
|
|
44
38
|
publish(): void;
|
|
45
39
|
}
|
|
46
40
|
/** Creates and adds a {@link ContextProviderController} to the given host. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-provider.js","sourceRoot":"","sources":["../../../src/internals/controllers/context-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"context-provider.js","sourceRoot":"","sources":["../../../src/internals/controllers/context-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAoB,MAAM,cAAc,CAAC;AAiC/E,MAAM,yBAAyB;IAS7B,YAAY,IAAO,EAAE,OAA+C;QAFnD,cAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;QAGvD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAEzE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAGM,aAAa;QAClB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAGM,UAAU;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAEpC,IAAI,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACxE,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAEM,OAAO;QACZ,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF;AAGD,MAAM,UAAU,kBAAkB,CAIhC,IAAO,EACP,OAA+C;IAE/C,OAAO,IAAI,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import { type Context, ContextProvider, type ContextType } from '@lit/context';\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\n\ntype ProviderHost = ReactiveControllerHost & HTMLElement;\n\ntype ContextProviderControllerOptions<\n C extends Context<unknown, unknown>,\n H extends ProviderHost,\n> = {\n context: C;\n /** Computes the published context value. */\n value: () => ContextType<C>;\n /** The host properties that republish the context when they change. */\n watch?: readonly (keyof H)[];\n};\n\n/**\n * Gives a context from the host, and keeps the subscribers current.\n *\n * @remarks\n * Every publish notifies the subscribers, also when the value keeps its\n * identity, so a host that shares one mutable context object still\n * propagates its changes.\n *\n * @example\n * ```typescript\n * private readonly _provider = addContextProvider(this, {\n * context: themeContext,\n * watch: ['theme', 'variant'],\n * value: () => ({ theme: this.theme, variant: this.variant }),\n * });\n * ```\n */\nclass ContextProviderController<\n C extends Context<unknown, unknown>,\n H extends ProviderHost,\n> implements ReactiveController {\n private readonly _host: H;\n private readonly _options: ContextProviderControllerOptions<C, H>;\n private readonly _provider: ContextProvider<C, H>;\n private readonly _snapshot = new Map<keyof H, unknown>();\n\n constructor(host: H, options: ContextProviderControllerOptions<C, H>) {\n this._host = host;\n this._options = options;\n this._provider = new ContextProvider(host, { context: options.context });\n\n host.addController(this);\n }\n\n /** @internal */\n public hostConnected(): void {\n this.publish();\n }\n\n /** @internal */\n public hostUpdate(): void {\n const watched = this._options.watch;\n\n if (watched?.some((key) => this._host[key] !== this._snapshot.get(key))) {\n this.publish();\n }\n }\n\n public publish(): void {\n for (const key of this._options.watch ?? []) {\n this._snapshot.set(key, this._host[key]);\n }\n\n this._provider.setValue(this._options.value.call(this._host), true);\n }\n}\n\n/** Creates and adds a {@link ContextProviderController} to the given host. */\nexport function addContextProvider<\n C extends Context<unknown, unknown>,\n H extends ProviderHost,\n>(\n host: H,\n options: ContextProviderControllerOptions<C, H>\n): ContextProviderController<C, H> {\n return new ContextProviderController(host, options);\n}\n\nexport type { ContextProviderController, ContextProviderControllerOptions };\n"]}
|
|
@@ -1,43 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* Focus rings are visible only when the user is interacting with a keyboard, not with a mouse, touch, or other input methods.
|
|
5
|
-
*
|
|
6
|
-
* By default the class attaches a keyup event handler on the component host and will update its keyboard focus
|
|
7
|
-
* state based on it.
|
|
8
|
-
*
|
|
9
|
-
* **Important Note:** This controller is designed for use with **atomic web components** that represent single,
|
|
10
|
-
* interactive elements (e.g., buttons, form fields, interactive icons). It helps these components correctly
|
|
11
|
-
* display a focus indicator *only* when keyboard navigation is occurring, improving accessibility without
|
|
12
|
-
* visual clutter during mouse or touch interactions.
|
|
13
|
-
*
|
|
14
|
-
* **Do not use this controller as a general-purpose shortcut for managing focus state in complex components or layouts.**
|
|
15
|
-
* Misusing it in this way can lead to incorrect focus ring behavior, accessibility issues, and make your
|
|
16
|
-
* application harder to maintain. For managing focus within larger, composite components, consider alternative
|
|
17
|
-
* strategies like ARIA attributes, managing `tabindex`, or a bespoke implementation if needed.
|
|
18
|
-
*/
|
|
19
|
-
declare class KeyboardFocusRingController implements ReactiveController {
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
/** Tracks the keyboard focus state. See {@link addKeyboardFocusRing}. */
|
|
3
|
+
declare class KeyboardFocusRingController {
|
|
20
4
|
private static readonly _events;
|
|
21
5
|
private readonly _host;
|
|
22
|
-
private readonly _abortHandle;
|
|
23
6
|
private _isKeyboardFocused;
|
|
24
|
-
/**
|
|
25
|
-
* Gets whether the current focus state is activated through a keyboard interaction.
|
|
26
|
-
*/
|
|
7
|
+
/** Whether a keyboard interaction activated the current focus state. */
|
|
27
8
|
get focused(): boolean;
|
|
28
9
|
constructor(host: ReactiveControllerHost & HTMLElement);
|
|
29
10
|
/** @internal */
|
|
30
|
-
hostConnected(): void;
|
|
31
|
-
/** @internal */
|
|
32
|
-
hostDisconnected(): void;
|
|
33
|
-
/** @internal */
|
|
34
11
|
handleEvent(event: Event): void;
|
|
35
12
|
}
|
|
36
13
|
export type { KeyboardFocusRingController };
|
|
37
14
|
/**
|
|
38
|
-
* Adds a
|
|
15
|
+
* Adds a controller that reports whether the host has focus from the
|
|
16
|
+
* keyboard. A component shows its focus ring only in that condition.
|
|
39
17
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Use it for an atomic component, such as a button or a form field. A
|
|
20
|
+
* composite component or a layout needs ARIA attributes, a managed
|
|
21
|
+
* `tabindex`, or an implementation of its own.
|
|
42
22
|
*/
|
|
43
23
|
export declare function addKeyboardFocusRing(host: ReactiveControllerHost & HTMLElement): KeyboardFocusRingController;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { addHostListeners } from './host-listeners.js';
|
|
2
2
|
class KeyboardFocusRingController {
|
|
3
3
|
static { this._events = ['keyup', 'focusout', 'pointerup']; }
|
|
4
4
|
get focused() {
|
|
5
5
|
return this._isKeyboardFocused;
|
|
6
6
|
}
|
|
7
7
|
constructor(host) {
|
|
8
|
-
this._abortHandle = createAbortHandle();
|
|
9
8
|
this._isKeyboardFocused = false;
|
|
10
9
|
this._host = host;
|
|
11
|
-
host
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._host.addEventListener(event, this, { passive: true, signal });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
hostDisconnected() {
|
|
20
|
-
this._abortHandle.abort();
|
|
10
|
+
addHostListeners(host, {
|
|
11
|
+
events: KeyboardFocusRingController._events,
|
|
12
|
+
listener: this,
|
|
13
|
+
options: { passive: true },
|
|
14
|
+
});
|
|
21
15
|
}
|
|
22
16
|
handleEvent(event) {
|
|
23
17
|
const focused = event.type === 'keyup';
|