igniteui-webcomponents 7.3.2 → 7.4.1
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 +87 -0
- 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/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.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/{resize-container/themes/resize-container.base.css.js → breadcrumb/themes/breadcrumbs.base.css.js} +2 -2
- 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.js +2 -1
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +2 -3
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +2 -2
- package/components/calendar/days-view/days-view.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/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/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 +3 -1
- package/components/checkbox/checkbox-base.js +4 -0
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +4 -12
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +1 -8
- package/components/checkbox/switch.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 +12 -7
- 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/combo/combo.d.ts +24 -24
- package/components/combo/combo.js +21 -26
- 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/date-picker/date-picker.base.d.ts +22 -27
- package/components/date-picker/date-picker.base.js +9 -3
- 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-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.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.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 +42 -40
- package/components/date-time-input/date-time-input.base.js +9 -5
- 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/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/file-input/file-input.d.ts +7 -2
- package/components/file-input/file-input.js +4 -0
- package/components/file-input/file-input.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-base.d.ts +2 -2
- package/components/input/input-base.js +3 -5
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +3 -3
- package/components/input/input.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/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/qr-code/qr-code.d.ts +1 -1
- package/components/radio/radio.d.ts +6 -4
- package/components/radio/radio.js +24 -25
- package/components/radio/radio.js.map +1 -1
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +9 -6
- package/components/rating/rating.js +17 -18
- 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 +5 -15
- package/components/select/select.js.map +1 -1
- package/components/slider/range-slider.d.ts +0 -1
- package/components/slider/range-slider.js +6 -11
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +4 -1
- package/components/slider/slider-base.js +20 -18
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider.d.ts +2 -0
- package/components/slider/slider.js +5 -1
- package/components/slider/slider.js.map +1 -1
- package/components/splitter/splitter.d.ts +6 -6
- package/components/splitter/splitter.js.map +1 -1
- package/components/textarea/textarea.d.ts +2 -5
- package/components/textarea/textarea.js +3 -5
- package/components/textarea/textarea.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/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/tooltip.d.ts +34 -13
- package/components/tooltip/tooltip.js +8 -4
- package/components/tooltip/tooltip.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/validation-container.js +2 -1
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +40 -9
- package/components/virtualization/engine.js +126 -61
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/recycle.d.ts +13 -0
- package/components/virtualization/recycle.js +152 -0
- package/components/virtualization/recycle.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +84 -65
- package/components/virtualization/virtualization.js +20 -16
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +18455 -19551
- 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 +100 -61
- package/internals/controllers/aria-projection.js +81 -31
- 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 +2 -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 +42 -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 +27 -78
- 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 +19 -19
- package/internals/templates/toggle-shell.js +12 -8
- 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 +53 -41
- package/internals/utils/dom.js +3 -4
- 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 +4 -3
- package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
- package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
- package/skills/igniteui-wc-figma-to-app/SKILL.md +328 -0
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +343 -0
- package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +489 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +370 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +363 -0
- package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
- package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +370 -0
- package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
- package/skills/igniteui-wc-grids/SKILL.md +133 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
- package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
- 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/components/resize-container/themes/resize-container.base.css.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
- /package/components/{resize-container/themes/resize-container.base.css.d.ts → breadcrumb/themes/breadcrumb.base.css.d.ts} +0 -0
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
import { type LitElement, type ReactiveController, type ReactiveControllerHost } from 'lit';
|
|
2
2
|
import { Directive, type DirectiveParameters, type ElementPart, type PartInfo } from 'lit/directive.js';
|
|
3
|
+
import type { SlotController } from './slot.js';
|
|
3
4
|
type ControllerHost = ReactiveControllerHost & LitElement;
|
|
5
|
+
/** The host attributes that {@link resolveNaming} reads. */
|
|
6
|
+
export declare const NAMING_ATTRIBUTES: string[];
|
|
7
|
+
/** The name sources of a component, resolved by {@link resolveNaming}. */
|
|
8
|
+
export type ResolvedNaming = {
|
|
9
|
+
/** The elements that name the component, bound as element references. */
|
|
10
|
+
labelledBy: ReadonlyArray<Element> | null;
|
|
11
|
+
/** The id of the own label in the shadow root, bound as an IDREF. */
|
|
12
|
+
labelledByRef?: string;
|
|
13
|
+
/** The host `aria-label` or the fallback, when no label names the component. */
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the name of a form associated component. The first source that is
|
|
18
|
+
* present wins: the host `aria-labelledby`, the external `<label>` elements,
|
|
19
|
+
* the own label of the component, the host `aria-label`, and `fallback`.
|
|
20
|
+
*
|
|
21
|
+
* `ownLabel` is the id of the own label in the shadow root, or `true` for an
|
|
22
|
+
* own label that names the control natively, for example a `<label for>`.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* Assistive technology reads the native control in the shadow root, so the
|
|
26
|
+
* name moves from the host to that control. `host.ariaLabelledByElements`
|
|
27
|
+
* resolves the host IDREFs in the host tree. An external label replaces the
|
|
28
|
+
* own label. A wrapping label contains the own label text.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveNaming(host: Element, ownLabel: string | boolean, fallback?: string): ResolvedNaming;
|
|
4
31
|
/**
|
|
5
|
-
* ARIA semantics a composite host projects onto the native editor
|
|
6
|
-
* input-shaped component.
|
|
32
|
+
* The ARIA semantics that a composite host projects onto the native editor.
|
|
7
33
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ancestor tree scopes.
|
|
34
|
+
* @remarks
|
|
35
|
+
* The host delegates focus, so assistive technology lands on the editor of
|
|
36
|
+
* the input-shaped component and reports it. Every relation travels as an
|
|
37
|
+
* element reference, because an IDREF does not cross a shadow boundary.
|
|
13
38
|
*/
|
|
14
39
|
export type ProjectedARIA = {
|
|
15
40
|
role?: string;
|
|
@@ -22,21 +47,21 @@ export type ProjectedARIA = {
|
|
|
22
47
|
labelledBy?: ReadonlyArray<Element> | null;
|
|
23
48
|
activeDescendant?: Element | null;
|
|
24
49
|
};
|
|
25
|
-
/**
|
|
50
|
+
/** The id of the helper-text container of `IgcValidationContainerComponent`. */
|
|
51
|
+
export declare const HELPER_TEXT_ID = "helper-text";
|
|
52
|
+
/** Returns the helper-text container when the `helper-text` slot has content. */
|
|
53
|
+
export declare function helperText(host: LitElement, slots: Pick<SlotController<'helper-text'>, 'hasAssignedElements'>): Element | null;
|
|
26
54
|
type AriaTargetConfig = {
|
|
27
|
-
/** Resolves the
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
* container), or `null` when it currently renders no description content.
|
|
32
|
-
*/
|
|
33
|
-
description: () => Element | null;
|
|
55
|
+
/** Resolves the helper-text container, or `null` when there is none. */
|
|
56
|
+
description?: () => Element | null;
|
|
57
|
+
/** Whether an own label names the editor natively, for example a `<label for>`. */
|
|
58
|
+
hasOwnLabel?: () => boolean;
|
|
34
59
|
};
|
|
35
60
|
/**
|
|
36
|
-
*
|
|
37
|
-
* state
|
|
38
|
-
* {@link ariaBindings} directive
|
|
39
|
-
* through
|
|
61
|
+
* The binding values for a native editor element, resolved from the projected
|
|
62
|
+
* state and the own ARIA of the editor, and applied by the
|
|
63
|
+
* {@link ariaBindings} directive. A scalar binds as an attribute, a relation
|
|
64
|
+
* through an ARIA element-reflection property.
|
|
40
65
|
*/
|
|
41
66
|
export type ResolvedARIABindings = {
|
|
42
67
|
role?: string;
|
|
@@ -45,100 +70,114 @@ export type ResolvedARIABindings = {
|
|
|
45
70
|
disabled?: string;
|
|
46
71
|
label?: string;
|
|
47
72
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
73
|
+
* The IDREF of the own description in the same root. The directive binds it
|
|
74
|
+
* while `describedBy` is null, so a tool that reads only attributes, for
|
|
75
|
+
* example axe, still sees the relation.
|
|
51
76
|
*/
|
|
52
77
|
describedByRef?: string;
|
|
78
|
+
/** The IDREF of the own label in the same root. It binds as `describedByRef`. */
|
|
79
|
+
labelledByRef?: string;
|
|
53
80
|
labelledBy: ReadonlyArray<Element> | null;
|
|
54
81
|
controls: ReadonlyArray<Element> | null;
|
|
55
82
|
describedBy: ReadonlyArray<Element> | null;
|
|
56
83
|
activeDescendant: Element | null;
|
|
57
84
|
};
|
|
58
85
|
/**
|
|
59
|
-
* The receiving end of an ARIA projection
|
|
60
|
-
*
|
|
61
|
-
*
|
|
86
|
+
* The receiving end of an ARIA projection. It names the native control in the
|
|
87
|
+
* shadow root, see {@link resolveNaming}, and applies the state that a
|
|
88
|
+
* composite host projects.
|
|
62
89
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* Not a reactive controller. The host render resolves the bindings, and the
|
|
92
|
+
* form associated mixin renders the host again when the name sources change.
|
|
65
93
|
*/
|
|
66
94
|
declare class AriaTargetController {
|
|
67
95
|
private readonly _host;
|
|
68
96
|
private readonly _config;
|
|
69
97
|
private _projected;
|
|
98
|
+
/** The bindings last resolved for the native editor. */
|
|
99
|
+
private _resolved?;
|
|
70
100
|
constructor(host: ControllerHost, config: AriaTargetConfig);
|
|
71
101
|
/**
|
|
72
|
-
* Replaces the projected state
|
|
73
|
-
*
|
|
102
|
+
* Replaces the projected state.
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* A host render happens only when the resolved bindings change, so a
|
|
106
|
+
* projection on every host update stays inexpensive. The comparison uses
|
|
107
|
+
* the resolved bindings, so it also catches a change to the own labels or
|
|
108
|
+
* description, which the component cannot observe.
|
|
74
109
|
*/
|
|
75
110
|
setProjected(state: ProjectedARIA): void;
|
|
76
111
|
/**
|
|
77
|
-
* Mirrors the projected `role
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
112
|
+
* Mirrors the projected `role` and `hasPopup` onto `data-role` and
|
|
113
|
+
* `data-haspopup`.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* The input themes style the anchor of a composite widget from these
|
|
117
|
+
* attributes. The ARIA itself stays on the editor in the shadow root, where
|
|
118
|
+
* a `:host()` selector cannot observe it.
|
|
82
119
|
*/
|
|
83
120
|
private _reflectStylingHooks;
|
|
84
121
|
/**
|
|
85
|
-
* Resolves the binding values for the native editor element
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* Projected labels take precedence over the component's own. The editor's
|
|
89
|
-
* description stays a same-root IDREF ({@link ResolvedARIABindings.describedByRef})
|
|
90
|
-
* while nothing is projected; once a host projects a description, the whole
|
|
91
|
-
* relation switches to element references - attribute and reflection cannot
|
|
92
|
-
* coexist - with the editor's own description element joining the projected
|
|
93
|
-
* ones.
|
|
122
|
+
* Resolves the binding values for the native editor element. A projected
|
|
123
|
+
* value wins over the own naming.
|
|
94
124
|
*/
|
|
95
125
|
resolveBindings(): ResolvedARIABindings;
|
|
96
126
|
}
|
|
127
|
+
/** The bindings that {@link ariaBindings} accepts. Each key is optional. */
|
|
128
|
+
export type ARIABindings = Partial<ResolvedARIABindings>;
|
|
97
129
|
/**
|
|
98
|
-
* Applies {@link
|
|
99
|
-
*
|
|
130
|
+
* Applies {@link ARIABindings} to the native editor. It writes only changed
|
|
131
|
+
* values, and only to the attributes that its bindings set.
|
|
100
132
|
*/
|
|
101
133
|
declare class AriaBindingsDirective extends Directive {
|
|
102
134
|
private _previous?;
|
|
103
135
|
constructor(partInfo: PartInfo);
|
|
104
|
-
render(_:
|
|
136
|
+
render(_: ARIABindings): unknown;
|
|
105
137
|
update(part: ElementPart, [bindings]: DirectiveParameters<this>): unknown;
|
|
106
138
|
}
|
|
107
139
|
/**
|
|
108
|
-
* Binds resolved ARIA state onto a native editor element as
|
|
109
|
-
* expression,
|
|
140
|
+
* Binds the resolved ARIA state onto a native editor element as one element
|
|
141
|
+
* expression, for example `<input ${ariaBindings(aria)} />`.
|
|
110
142
|
*/
|
|
111
|
-
export declare const ariaBindings: (_: ResolvedARIABindings) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
|
|
112
|
-
/** Configuration for the {@link AriaProjectorController}. */
|
|
143
|
+
export declare const ariaBindings: (_: Partial<ResolvedARIABindings>) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
|
|
113
144
|
type AriaProjectorConfig = {
|
|
114
|
-
/** Resolves the input-shaped component the ARIA state
|
|
145
|
+
/** Resolves the input-shaped component that receives the ARIA state. */
|
|
115
146
|
target: () => Element | null | undefined;
|
|
116
|
-
/** Computes the ARIA state to project
|
|
147
|
+
/** Computes the ARIA state to project, after every host update. */
|
|
117
148
|
state: () => ProjectedARIA;
|
|
149
|
+
/**
|
|
150
|
+
* Whether the host shows an own label. When set, the projector also
|
|
151
|
+
* projects the name of the host, see {@link resolveNaming}.
|
|
152
|
+
*/
|
|
153
|
+
hasOwnLabel?: () => boolean;
|
|
154
|
+
/** Resolves the name to use when no other source names the host. */
|
|
155
|
+
fallbackLabel?: () => string;
|
|
118
156
|
};
|
|
119
157
|
/**
|
|
120
|
-
* The sending end of an ARIA projection
|
|
121
|
-
*
|
|
122
|
-
*
|
|
158
|
+
* The sending end of an ARIA projection. A composite host such as
|
|
159
|
+
* `igc-select` adds it to push the computed ARIA state onto the
|
|
160
|
+
* {@link AriaTargetController} of the target after every host update.
|
|
123
161
|
*/
|
|
124
162
|
declare class AriaProjectorController implements ReactiveController {
|
|
125
163
|
private readonly _host;
|
|
126
164
|
private readonly _config;
|
|
127
165
|
private _retryScheduled;
|
|
128
166
|
constructor(host: ControllerHost, config: AriaProjectorConfig);
|
|
167
|
+
/** Computes the state, with the name of the host when it is configured. */
|
|
168
|
+
private _state;
|
|
129
169
|
/** @internal */
|
|
130
170
|
hostUpdated(): void;
|
|
131
171
|
}
|
|
132
172
|
/**
|
|
133
|
-
* Creates
|
|
134
|
-
* component
|
|
135
|
-
* {@link addAriaProjector}
|
|
136
|
-
* and reports once the component's host delegates focus to it.
|
|
173
|
+
* Creates an {@link AriaTargetController} and adds it to an input-shaped
|
|
174
|
+
* component. It makes the native editor of the component a valid target for
|
|
175
|
+
* {@link addAriaProjector}.
|
|
137
176
|
*/
|
|
138
177
|
export declare function addAriaTarget(host: ControllerHost, config: AriaTargetConfig): AriaTargetController;
|
|
139
178
|
/**
|
|
140
|
-
* Creates
|
|
141
|
-
*
|
|
179
|
+
* Creates an {@link AriaProjectorController} and adds it to a composite host.
|
|
180
|
+
* It projects ARIA onto the native editor of the target component.
|
|
142
181
|
*/
|
|
143
182
|
export declare function addAriaProjector(host: ControllerHost, config: AriaProjectorConfig): AriaProjectorController;
|
|
144
183
|
export type { AriaProjectorController, AriaTargetController };
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import { noChange, } from 'lit';
|
|
2
2
|
import { Directive, directive, PartType, } from 'lit/directive.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { sameItems } from '../utils/arrays.js';
|
|
4
|
+
import { isString } from '../utils/types.js';
|
|
5
|
+
import { internalsOf } from './internals.js';
|
|
6
|
+
export const NAMING_ATTRIBUTES = ['aria-label', 'aria-labelledby'];
|
|
7
|
+
export function resolveNaming(host, ownLabel, fallback) {
|
|
8
|
+
const referenced = host.ariaLabelledByElements;
|
|
9
|
+
if (referenced?.length) {
|
|
10
|
+
return { labelledBy: referenced };
|
|
11
|
+
}
|
|
12
|
+
const labels = internalsOf(host)?.labels;
|
|
13
|
+
if (labels) {
|
|
14
|
+
return { labelledBy: labels };
|
|
15
|
+
}
|
|
16
|
+
const naming = {
|
|
17
|
+
labelledBy: null,
|
|
18
|
+
label: ownLabel ? undefined : host.getAttribute('aria-label') || fallback,
|
|
19
|
+
};
|
|
20
|
+
if (isString(ownLabel)) {
|
|
21
|
+
naming.labelledByRef = ownLabel;
|
|
7
22
|
}
|
|
8
|
-
return
|
|
23
|
+
return naming;
|
|
9
24
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
a.label === b.label &&
|
|
16
|
-
(a.activeDescendant ?? null) === (b.activeDescendant ?? null) &&
|
|
17
|
-
elementsEqual(a.controls, b.controls) &&
|
|
18
|
-
elementsEqual(a.describedBy, b.describedBy) &&
|
|
19
|
-
elementsEqual(a.labelledBy, b.labelledBy));
|
|
25
|
+
export const HELPER_TEXT_ID = 'helper-text';
|
|
26
|
+
export function helperText(host, slots) {
|
|
27
|
+
return slots.hasAssignedElements('helper-text')
|
|
28
|
+
? host.renderRoot.querySelector(`#${HELPER_TEXT_ID}`)
|
|
29
|
+
: null;
|
|
20
30
|
}
|
|
31
|
+
const targets = new WeakMap();
|
|
21
32
|
class AriaTargetController {
|
|
22
33
|
constructor(host, config) {
|
|
23
34
|
this._projected = {};
|
|
@@ -26,8 +37,9 @@ class AriaTargetController {
|
|
|
26
37
|
targets.set(host, this);
|
|
27
38
|
}
|
|
28
39
|
setProjected(state) {
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
const previous = this._resolved;
|
|
41
|
+
this._projected = state;
|
|
42
|
+
if (!bindingsEqual(previous, this.resolveBindings())) {
|
|
31
43
|
this._reflectStylingHooks();
|
|
32
44
|
this._host.requestUpdate();
|
|
33
45
|
}
|
|
@@ -44,25 +56,27 @@ class AriaTargetController {
|
|
|
44
56
|
}
|
|
45
57
|
resolveBindings() {
|
|
46
58
|
const projected = this._projected;
|
|
47
|
-
const description = this._config.description();
|
|
48
|
-
|
|
59
|
+
const description = this._config.description?.() ?? null;
|
|
60
|
+
const naming = projected.labelledBy
|
|
61
|
+
? projected
|
|
62
|
+
: resolveNaming(this._host, this._config.hasOwnLabel?.() ?? false);
|
|
63
|
+
this._resolved = {
|
|
49
64
|
role: projected.role,
|
|
50
65
|
hasPopup: projected.hasPopup,
|
|
51
66
|
expanded: projected.expanded,
|
|
52
67
|
disabled: projected.disabled,
|
|
53
|
-
label: projected.label,
|
|
54
|
-
labelledBy:
|
|
68
|
+
label: projected.label ?? naming.label,
|
|
69
|
+
labelledBy: naming.labelledBy ?? null,
|
|
55
70
|
controls: projected.controls ?? null,
|
|
56
71
|
describedBy: projected.describedBy
|
|
57
72
|
? description
|
|
58
73
|
? [description, ...projected.describedBy]
|
|
59
74
|
: projected.describedBy
|
|
60
75
|
: null,
|
|
61
|
-
describedByRef:
|
|
62
|
-
? undefined
|
|
63
|
-
: description?.id || undefined,
|
|
76
|
+
describedByRef: description?.id || undefined,
|
|
64
77
|
activeDescendant: projected.activeDescendant ?? null,
|
|
65
78
|
};
|
|
79
|
+
return this._resolved;
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
const scalarBindings = [
|
|
@@ -71,8 +85,23 @@ const scalarBindings = [
|
|
|
71
85
|
['expanded', 'aria-expanded'],
|
|
72
86
|
['disabled', 'aria-disabled'],
|
|
73
87
|
['label', 'aria-label'],
|
|
74
|
-
['describedByRef', 'aria-describedby'],
|
|
75
88
|
];
|
|
89
|
+
const relationBindings = [
|
|
90
|
+
['labelledBy', 'labelledByRef', 'ariaLabelledByElements', 'aria-labelledby'],
|
|
91
|
+
[
|
|
92
|
+
'describedBy',
|
|
93
|
+
'describedByRef',
|
|
94
|
+
'ariaDescribedByElements',
|
|
95
|
+
'aria-describedby',
|
|
96
|
+
],
|
|
97
|
+
['controls', null, 'ariaControlsElements', 'aria-controls'],
|
|
98
|
+
];
|
|
99
|
+
function bindingsEqual(a, b) {
|
|
100
|
+
return (a !== undefined &&
|
|
101
|
+
a.activeDescendant === b.activeDescendant &&
|
|
102
|
+
scalarBindings.every(([key]) => a[key] === b[key]) &&
|
|
103
|
+
relationBindings.every(([key, refKey]) => sameItems(a[key], b[key]) && (!refKey || a[refKey] === b[refKey])));
|
|
104
|
+
}
|
|
76
105
|
class AriaBindingsDirective extends Directive {
|
|
77
106
|
constructor(partInfo) {
|
|
78
107
|
super(partInfo);
|
|
@@ -87,13 +116,25 @@ class AriaBindingsDirective extends Directive {
|
|
|
87
116
|
const element = part.element;
|
|
88
117
|
const previous = this._previous;
|
|
89
118
|
this._previous = bindings;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
119
|
+
for (const [key, refKey, property, attribute] of relationBindings) {
|
|
120
|
+
const next = bindings[key] ?? (refKey && bindings[refKey]) ?? null;
|
|
121
|
+
const prev = previous?.[key] ?? (refKey && previous?.[refKey]) ?? null;
|
|
122
|
+
if (typeof next === 'string') {
|
|
123
|
+
if (next !== prev) {
|
|
124
|
+
element.setAttribute(attribute, next);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (typeof prev === 'string' || !sameItems(prev, next)) {
|
|
128
|
+
element[property] = next;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const activeDescendant = bindings.activeDescendant ?? null;
|
|
132
|
+
if (activeDescendant !== (previous?.activeDescendant ?? null)) {
|
|
133
|
+
element.ariaActiveDescendantElement = activeDescendant;
|
|
134
|
+
}
|
|
94
135
|
for (const [key, attribute] of scalarBindings) {
|
|
95
136
|
const value = bindings[key];
|
|
96
|
-
if (
|
|
137
|
+
if (previous?.[key] !== value) {
|
|
97
138
|
value != null
|
|
98
139
|
? element.setAttribute(attribute, value)
|
|
99
140
|
: element.removeAttribute(attribute);
|
|
@@ -110,6 +151,15 @@ class AriaProjectorController {
|
|
|
110
151
|
this._config = config;
|
|
111
152
|
host.addController(this);
|
|
112
153
|
}
|
|
154
|
+
_state() {
|
|
155
|
+
const { state, hasOwnLabel, fallbackLabel } = this._config;
|
|
156
|
+
return hasOwnLabel
|
|
157
|
+
? {
|
|
158
|
+
...resolveNaming(this._host, hasOwnLabel(), fallbackLabel?.()),
|
|
159
|
+
...state(),
|
|
160
|
+
}
|
|
161
|
+
: state();
|
|
162
|
+
}
|
|
113
163
|
hostUpdated() {
|
|
114
164
|
const element = this._config.target();
|
|
115
165
|
if (!element) {
|
|
@@ -117,7 +167,7 @@ class AriaProjectorController {
|
|
|
117
167
|
}
|
|
118
168
|
const target = targets.get(element);
|
|
119
169
|
if (target) {
|
|
120
|
-
target.setProjected(this.
|
|
170
|
+
target.setProjected(this._state());
|
|
121
171
|
return;
|
|
122
172
|
}
|
|
123
173
|
if (!this._retryScheduled) {
|
|
@@ -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,IAAI,CAAC;QAC7D,aAAa,CAAC,CAAC,CA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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,QAAQ,GAGT,MAAM,KAAK,CAAC;AACb,O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H,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';\nimport { isString } from '../utils/types.js';\nimport { internalsOf } from './internals.js';\nimport type { SlotController } from './slot.js';\n\ntype ControllerHost = ReactiveControllerHost & LitElement;\n\n/** The host attributes that {@link resolveNaming} reads. */\nexport const NAMING_ATTRIBUTES = ['aria-label', 'aria-labelledby'];\n\n/** The name sources of a component, resolved by {@link resolveNaming}. */\nexport type ResolvedNaming = {\n /** The elements that name the component, bound as element references. */\n labelledBy: ReadonlyArray<Element> | null;\n /** The id of the own label in the shadow root, bound as an IDREF. */\n labelledByRef?: string;\n /** The host `aria-label` or the fallback, when no label names the component. */\n label?: string;\n};\n\n/**\n * Resolves the name of a form associated component. The first source that is\n * present wins: the host `aria-labelledby`, the external `<label>` elements,\n * the own label of the component, the host `aria-label`, and `fallback`.\n *\n * `ownLabel` is the id of the own label in the shadow root, or `true` for an\n * own label that names the control natively, for example a `<label for>`.\n *\n * @remarks\n * Assistive technology reads the native control in the shadow root, so the\n * name moves from the host to that control. `host.ariaLabelledByElements`\n * resolves the host IDREFs in the host tree. An external label replaces the\n * own label. A wrapping label contains the own label text.\n */\nexport function resolveNaming(\n host: Element,\n ownLabel: string | boolean,\n fallback?: string\n): ResolvedNaming {\n const referenced = host.ariaLabelledByElements;\n\n if (referenced?.length) {\n return { labelledBy: referenced };\n }\n\n const labels = internalsOf(host)?.labels;\n\n if (labels) {\n return { labelledBy: labels };\n }\n\n const naming: ResolvedNaming = {\n labelledBy: null,\n label: ownLabel ? undefined : host.getAttribute('aria-label') || fallback,\n };\n\n if (isString(ownLabel)) {\n naming.labelledByRef = ownLabel;\n }\n\n return naming;\n}\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\n/** The id of the helper-text container of `IgcValidationContainerComponent`. */\nexport const HELPER_TEXT_ID = 'helper-text';\n\n/** Returns the helper-text container when the `helper-text` slot has content. */\nexport function helperText(\n host: LitElement,\n slots: Pick<SlotController<'helper-text'>, 'hasAssignedElements'>\n): Element | null {\n return slots.hasAssignedElements('helper-text')\n ? host.renderRoot.querySelector(`#${HELPER_TEXT_ID}`)\n : null;\n}\n\ntype AriaTargetConfig = {\n /** Resolves the helper-text container, or `null` when there is none. */\n description?: () => Element | null;\n /** Whether an own label names the editor natively, for example a `<label for>`. */\n hasOwnLabel?: () => boolean;\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 IDREF of the own description in the same root. The directive binds it\n * while `describedBy` is null, so a tool that reads only attributes, for\n * example axe, still sees the relation.\n */\n describedByRef?: string;\n /** The IDREF of the own label in the same root. It binds as `describedByRef`. */\n labelledByRef?: 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\n/**\n * The receiving end of an ARIA projection. It names the native control in the\n * shadow root, see {@link resolveNaming}, and applies the state that a\n * composite host projects.\n *\n * @remarks\n * Not a reactive controller. The host render resolves the bindings, and the\n * form associated mixin renders the host again when the name sources change.\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. A projected\n * value wins over the own naming.\n */\n public resolveBindings(): ResolvedARIABindings {\n const projected = this._projected;\n const description = this._config.description?.() ?? null;\n const naming = projected.labelledBy\n ? projected\n : resolveNaming(this._host, this._config.hasOwnLabel?.() ?? false);\n\n this._resolved = {\n role: projected.role,\n hasPopup: projected.hasPopup,\n expanded: projected.expanded,\n disabled: projected.disabled,\n label: projected.label ?? naming.label,\n labelledBy: naming.labelledBy ?? null,\n controls: projected.controls ?? null,\n describedBy: projected.describedBy\n ? description\n ? [description, ...projected.describedBy]\n : projected.describedBy\n : null,\n describedByRef: 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] as const;\n\n/** The relations: the key, the IDREF key, the property, and the attribute. */\nconst relationBindings = [\n ['labelledBy', 'labelledByRef', 'ariaLabelledByElements', 'aria-labelledby'],\n [\n 'describedBy',\n 'describedByRef',\n 'ariaDescribedByElements',\n 'aria-describedby',\n ],\n ['controls', null, 'ariaControlsElements', 'aria-controls'],\n] as const;\n\nfunction bindingsEqual(\n a: ResolvedARIABindings | undefined,\n b: ResolvedARIABindings\n): boolean {\n return (\n a !== undefined &&\n a.activeDescendant === b.activeDescendant &&\n scalarBindings.every(([key]) => a[key] === b[key]) &&\n relationBindings.every(\n ([key, refKey]) =>\n sameItems(a[key], b[key]) && (!refKey || a[refKey] === b[refKey])\n )\n );\n}\n\n/** The bindings that {@link ariaBindings} accepts. Each key is optional. */\nexport type ARIABindings = Partial<ResolvedARIABindings>;\n\n/**\n * Applies {@link ARIABindings} to the native editor. It writes only changed\n * values, and only to the attributes that its bindings set.\n */\nclass AriaBindingsDirective extends Directive {\n private _previous?: ARIABindings;\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(_: ARIABindings): 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 // A value is an element list, an IDREF string or null. An IDREF write\n // clears the reflection. A null write removes the attribute.\n for (const [key, refKey, property, attribute] of relationBindings) {\n const next = bindings[key] ?? (refKey && bindings[refKey]) ?? null;\n const prev = previous?.[key] ?? (refKey && previous?.[refKey]) ?? null;\n\n if (typeof next === 'string') {\n if (next !== prev) {\n element.setAttribute(attribute, next);\n }\n } else if (typeof prev === 'string' || !sameItems(prev, next)) {\n element[property] = next;\n }\n }\n\n const activeDescendant = bindings.activeDescendant ?? null;\n\n if (activeDescendant !== (previous?.activeDescendant ?? null)) {\n element.ariaActiveDescendantElement = activeDescendant;\n }\n\n for (const [key, attribute] of scalarBindings) {\n const value = bindings[key];\n\n if (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 * Whether the host shows an own label. When set, the projector also\n * projects the name of the host, see {@link resolveNaming}.\n */\n hasOwnLabel?: () => boolean;\n /** Resolves the name to use when no other source names the host. */\n fallbackLabel?: () => string;\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 /** Computes the state, with the name of the host when it is configured. */\n private _state(): ProjectedARIA {\n const { state, hasOwnLabel, fallbackLabel } = this._config;\n\n return hasOwnLabel\n ? {\n ...resolveNaming(this._host, hasOwnLabel(), fallbackLabel?.()),\n ...state(),\n }\n : state();\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._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);
|