igniteui-webcomponents 7.4.0 → 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 +38 -0
- package/components/checkbox/checkbox-base.d.ts +2 -0
- package/components/checkbox/checkbox-base.js +4 -0
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +3 -11
- 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/color-picker/color-picker.js +3 -3
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/combo/combo.d.ts +6 -4
- package/components/combo/combo.js +13 -24
- package/components/combo/combo.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +3 -3
- package/components/date-picker/date-picker.base.js +2 -2
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +4 -4
- package/components/date-time-input/date-time-input.base.js +3 -5
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/file-input/file-input.d.ts +5 -0
- package/components/file-input/file-input.js +4 -0
- package/components/file-input/file-input.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 +1 -1
- package/components/radio/radio.d.ts +2 -0
- package/components/radio/radio.js +7 -11
- package/components/radio/radio.js.map +1 -1
- package/components/rating/rating.d.ts +3 -0
- package/components/rating/rating.js +17 -18
- package/components/rating/rating.js.map +1 -1
- package/components/select/select.js +1 -1
- 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/textarea/textarea.d.ts +1 -4
- package/components/textarea/textarea.js +3 -5
- package/components/textarea/textarea.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 +35 -4
- 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 +32 -11
- package/components/virtualization/virtualization.js +14 -11
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +2382 -79
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/internals/controllers/aria-projection.d.ts +61 -23
- package/internals/controllers/aria-projection.js +77 -26
- package/internals/controllers/aria-projection.js.map +1 -1
- package/internals/mixins/forms/associated.js +34 -0
- package/internals/mixins/forms/associated.js.map +1 -1
- package/internals/mixins/forms/types.d.ts +5 -0
- package/internals/mixins/forms/types.js.map +1 -1
- package/internals/templates/toggle-shell.d.ts +15 -14
- package/internals/templates/toggle-shell.js +12 -8
- package/internals/templates/toggle-shell.js.map +1 -1
- package/internals/utils/dom.d.ts +2 -2
- package/internals/utils/dom.js +2 -2
- package/internals/utils/dom.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +2 -4
- 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 +133 -712
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +42 -62
- 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 +189 -107
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +129 -84
- package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +81 -127
- 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 +74 -80
- 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/web-types.json +1 -1
package/index.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export { default as IgcQrCodeComponent } from './components/qr-code/qr-code.js';
|
|
|
76
76
|
export { default as IgcBreadcrumbsComponent } from './components/breadcrumb/breadcrumbs.js';
|
|
77
77
|
export { default as IgcBreadcrumbComponent } from './components/breadcrumb/breadcrumb.js';
|
|
78
78
|
export { default as IgcVirtualScrollComponent } from './components/virtualization/virtualization.js';
|
|
79
|
-
export type { IgcVirtualScrollComponentEventMap, VirtualScrollItemTemplate, } from './components/virtualization/virtualization.js';
|
|
79
|
+
export type { IgcVirtualScrollComponentEventMap, VirtualScrollItemTemplate, VirtualScrollKeyFunction, } from './components/virtualization/virtualization.js';
|
|
80
80
|
export type { VirtualScrollItemContext, VirtualScrollState, VirtualScrollDataRequest, } from './components/virtualization/types.js';
|
|
81
81
|
export { defineComponents } from '#internals/definitions/defineComponents.js';
|
|
82
82
|
export { defineAllComponents } from '#internals/definitions/defineAllComponents.js';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE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5F,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAYrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAGpF,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,UAAU,GACX,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EACL,2BAA2B,GAE5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,mCAAmC,GAEpC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,uBAAuB,GAExB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAUL,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,oBAAoB,CAAC;AA+C5B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAyCrE,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG/F,OAAO,EAAE,0BAA0B,IAAI,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGnH,OAAO,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["// Components\nexport { default as IgcAvatarComponent } from './components/avatar/avatar.js';\nexport { default as IgcAccordionComponent } from './components/accordion/accordion.js';\nexport { default as IgcBadgeComponent } from './components/badge/badge.js';\nexport { default as IgcBannerComponent } from './components/banner/banner.js';\nexport { default as IgcButtonComponent } from './components/button/button.js';\nexport { default as IgcButtonGroupComponent } from './components/button-group/button-group.js';\nexport { default as IgcCalendarComponent } from './components/calendar/calendar.js';\nexport { default as IgcCardComponent } from './components/card/card.js';\nexport { default as IgcCardActionsComponent } from './components/card/card.actions.js';\nexport { default as IgcCardContentComponent } from './components/card/card.content.js';\nexport { default as IgcCardHeaderComponent } from './components/card/card.header.js';\nexport { default as IgcCardMediaComponent } from './components/card/card.media.js';\nexport { default as IgcCarouselComponent } from './components/carousel/carousel.js';\nexport { default as IgcCarouselIndicatorComponent } from './components/carousel/carousel-indicator.js';\nexport { default as IgcCarouselSlideComponent } from './components/carousel/carousel-slide.js';\nexport { default as IgcChatComponent } from './components/chat/chat.js';\nexport { default as IgcColorPickerComponent } from './components/color-picker/color-picker.js';\nexport { default as IgcCheckboxComponent } from './components/checkbox/checkbox.js';\nexport { default as IgcCircularProgressComponent } from './components/progress/circular-progress.js';\nexport { default as IgcCircularGradientComponent } from './components/progress/circular-gradient.js';\nexport { default as IgcChipComponent } from './components/chip/chip.js';\nexport { default as IgcComboComponent } from './components/combo/combo.js';\nexport { default as IgcDatePickerComponent } from './components/date-picker/date-picker.js';\nexport { default as IgcDateRangePickerComponent } from './components/date-range-picker/date-range-picker.js';\nexport { default as IgcDateTimeInputComponent } from './components/date-time-input/date-time-input.js';\nexport { default as IgcDialogComponent } from './components/dialog/dialog.js';\nexport { default as IgcDividerComponent } from './components/divider/divider.js';\nexport { default as IgcDropdownComponent } from './components/dropdown/dropdown.js';\nexport { default as IgcDropdownGroupComponent } from './components/dropdown/dropdown-group.js';\nexport { default as IgcDropdownHeaderComponent } from './components/dropdown/dropdown-header.js';\nexport { default as IgcDropdownItemComponent } from './components/dropdown/dropdown-item.js';\nexport { default as IgcFileInputComponent } from './components/file-input/file-input.js';\nexport { default as IgcSelectComponent } from './components/select/select.js';\nexport { default as IgcSelectGroupComponent } from './components/select/select-group.js';\nexport { default as IgcSelectHeaderComponent } from './components/select/select-header.js';\nexport { default as IgcSelectItemComponent } from './components/select/select-item.js';\nexport { default as IgcExpansionPanelComponent } from './components/expansion-panel/expansion-panel.js';\nexport { default as IgcIconComponent } from './components/icon/icon.js';\nexport { default as IgcIconButtonComponent } from './components/button/icon-button.js';\nexport { default as IgcInputComponent } from './components/input/input.js';\nexport { default as IgcLinearProgressComponent } from './components/progress/linear-progress.js';\nexport { default as IgcListComponent } from './components/list/list.js';\nexport { default as IgcListHeaderComponent } from './components/list/list-header.js';\nexport { default as IgcListItemComponent } from './components/list/list-item.js';\nexport { default as IgcMaskInputComponent } from './components/mask-input/mask-input.js';\nexport { default as IgcNavDrawerComponent } from './components/nav-drawer/nav-drawer.js';\nexport { default as IgcNavDrawerHeaderItemComponent } from './components/nav-drawer/nav-drawer-header-item.js';\nexport { default as IgcNavDrawerItemComponent } from './components/nav-drawer/nav-drawer-item.js';\nexport { default as IgcNavbarComponent } from './components/navbar/navbar.js';\nexport { default as IgcRadioGroupComponent } from './components/radio-group/radio-group.js';\nexport { default as IgcRadioComponent } from './components/radio/radio.js';\nexport { default as IgcRatingComponent } from './components/rating/rating.js';\nexport { default as IgcRatingSymbolComponent } from './components/rating/rating-symbol.js';\nexport { default as IgcRippleComponent } from './components/ripple/ripple.js';\nexport { default as IgcRangeSliderComponent } from './components/slider/range-slider.js';\nexport { default as IgcSnackbarComponent } from './components/snackbar/snackbar.js';\nexport { default as IgcSliderComponent } from './components/slider/slider.js';\nexport { default as IgcSliderLabelComponent } from './components/slider/slider-label.js';\nexport { default as IgcTabsComponent } from './components/tabs/tabs.js';\nexport { default as IgcTabComponent } from './components/tabs/tab.js';\nexport { default as IgcTileComponent } from './components/tile-manager/tile.js';\nexport { default as IgcTileManagerComponent } from './components/tile-manager/tile-manager.js';\nexport { default as IgcToastComponent } from './components/toast/toast.js';\nexport { default as IgcToggleButtonComponent } from './components/button-group/toggle-button.js';\nexport { default as IgcSwitchComponent } from './components/checkbox/switch.js';\nexport { default as IgcTextareaComponent } from './components/textarea/textarea.js';\nexport { default as IgcTreeComponent } from './components/tree/tree.js';\nexport { default as IgcTreeItemComponent } from './components/tree/tree-item.js';\nexport { default as IgcSplitterComponent } from './components/splitter/splitter.js';\nexport { default as IgcStepperComponent } from './components/stepper/stepper.js';\nexport { default as IgcStepComponent } from './components/stepper/step.js';\nexport { default as IgcHighlightComponent } from './components/highlight/highlight.js';\nexport { default as IgcTooltipComponent } from './components/tooltip/tooltip.js';\nexport { default as IgcThemeProviderComponent } from './components/theme-provider/theme-provider.js';\nexport { default as IgcQrCodeComponent } from './components/qr-code/qr-code.js';\nexport { default as IgcBreadcrumbsComponent } from './components/breadcrumb/breadcrumbs.js';\nexport { default as IgcBreadcrumbComponent } from './components/breadcrumb/breadcrumb.js';\nexport { default as IgcVirtualScrollComponent } from './components/virtualization/virtualization.js';\nexport type {\n IgcVirtualScrollComponentEventMap,\n VirtualScrollItemTemplate,\n} from './components/virtualization/virtualization.js';\nexport type {\n VirtualScrollItemContext,\n VirtualScrollState,\n VirtualScrollDataRequest,\n} from './components/virtualization/types.js';\n\n// definitions\nexport { defineComponents } from '#internals/definitions/defineComponents.js';\nexport { defineAllComponents } from '#internals/definitions/defineAllComponents.js';\n\n// icon registration\nexport {\n registerIcon,\n registerIconFromText,\n setIconRef,\n} from './components/icon/icon.registry.js';\n\n// theming configuration\nexport { configureTheme } from '#theming/config.js';\nexport type { Theme, ThemeVariant } from '#theming/types.js';\n\n// localization objects\nexport {\n IgcCalendarResourceStringEN,\n type IgcCalendarResourceStrings,\n} from '#internals/i18n/EN/calendar.resources.js';\nexport {\n IgcDateRangePickerResourceStringsEN,\n type IgcDateRangePickerResourceStrings,\n} from '#internals/i18n/EN/date-range-picker.resources.js';\nexport {\n IgcChatResourceStringEN,\n type IgcChatResourceStrings,\n} from '#internals/i18n/EN/chat.resources.js';\nexport {\n type ICalendarResourceStrings,\n type ICarouselResourceStrings,\n type IChatResourceStrings,\n type IChipResourceStrings,\n type IComboResourceStrings,\n type IDatePickerResourceStrings,\n type IDateRangePickerResourceStrings,\n type IFileInputResourceStrings,\n type ITreeResourceStrings,\n CalendarResourceStringsEN,\n CarouselResourceStringsEN,\n ChatResourceStringsEN,\n ChipResourceStringsEN,\n ComboResourceStringsEN,\n DatePickerResourceStringsEN,\n DateRangePickerResourceStringsEN,\n FileInputResourceStringsEN,\n TreeResourceStringsEN,\n registerI18n,\n setCurrentI18n,\n} from 'igniteui-i18n-core';\n\n// Event maps\nexport type { IgcBannerComponentEventMap } from './components/banner/banner.js';\nexport type { IgcButtonGroupComponentEventMap } from './components/button-group/button-group.js';\nexport type { IgcCalendarComponentEventMap } from './components/calendar/types.js';\nexport type { IgcCarouselComponentEventMap } from './components/carousel/carousel.js';\nexport type { IgcChatComponentEventMap } from './components/chat/chat.js';\nexport type { IgcCheckboxComponentEventMap } from './components/checkbox/checkbox-base.js';\nexport type { IgcCheckboxComponentEventMap as IgcSwitchComponentEventMap } from './components/checkbox/checkbox-base.js';\nexport type { IgcChipComponentEventMap } from './components/chip/chip.js';\nexport type { IgcComboComponentEventMap } from './components/combo/types.js';\nexport type { IgcColorPickerComponentEventMap } from './components/color-picker/color-picker.js';\nexport type { IgcDatePickerComponentEventMap } from './components/date-picker/date-picker.js';\nexport type { IgcDateRangePickerComponentEventMap } from './components/date-range-picker/date-range-picker.js';\nexport type { IgcDateTimeInputComponentEventMap } from './components/date-time-input/date-time-input.js';\nexport type { IgcDialogComponentEventMap } from './components/dialog/dialog.js';\nexport type { IgcDropdownComponentEventMap } from './components/dropdown/dropdown.js';\nexport type { IgcExpansionPanelComponentEventMap } from './components/expansion-panel/expansion-panel.js';\nexport type { IgcInputComponentEventMap } from './components/input/input-base.js';\nexport type { IgcInputComponentEventMap as IgcMaskInputComponentEventMap } from './components/input/input-base.js';\nexport type { IgcNavDrawerComponentEventMap } from './components/nav-drawer/nav-drawer.js';\nexport type { IgcFileInputComponentEventMap } from './components/file-input/file-input.js';\nexport type { IgcRadioComponentEventMap } from './components/radio/radio.js';\nexport type { IgcRatingComponentEventMap } from './components/rating/rating.js';\nexport type { IgcSelectComponentEventMap } from './components/select/select.js';\nexport type { IgcSliderComponentEventMap } from './components/slider/slider.js';\nexport type { IgcRangeSliderComponentEventMap } from './components/slider/range-slider.js';\nexport type { IgcSnackbarComponentEventMap } from './components/snackbar/snackbar.js';\nexport type { IgcSplitterComponentEventMap } from './components/splitter/splitter.js';\nexport type { IgcStepperComponentEventMap } from './components/stepper/common/types.js';\nexport type { IgcTabsComponentEventMap } from './components/tabs/tabs.js';\nexport type { IgcTextareaComponentEventMap } from './components/textarea/textarea.js';\nexport type { IgcTileComponentEventMap } from './components/tile-manager/tile.js';\nexport type { IgcTreeComponentEventMap } from './components/tree/tree.common.js';\nexport type { IgcTooltipComponentEventMap } from './components/tooltip/tooltip.js';\n\n// Public types\nexport type * from './components/types.js';\nexport type { IgcTileChangeStateEventArgs } from './components/tile-manager/tile.js';\nexport type {\n CalendarActiveView,\n CalendarHeaderOrientation,\n CalendarSelection,\n DateRangeDescriptor,\n WeekDays,\n} from './components/calendar/types.js';\nexport { DateRangeType } from './components/calendar/types.js';\nexport type { IgcCheckboxChangeEventArgs } from './components/checkbox/checkbox-base.js';\nexport { DatePart } from './components/date-time-input/date-part.js';\nexport type { DatePartDeltas } from './components/date-time-input/date-part.js';\nexport type {\n CustomDateRange,\n DateRangeValue,\n} from './components/date-range-picker/date-range-picker.js';\nexport type { PopoverPlacement } from './components/popover/popover.js';\nexport type { IgcRadioChangeEventArgs } from './components/radio/radio.js';\nexport type { IgcRangeSliderValueEventArgs } from './components/slider/range-slider.js';\nexport type {\n IgcSplitterResizeEventArgs,\n IgcSplitterResizeEventDetail,\n IgcSplitterLayoutChangedEventArgs,\n} from './components/splitter/splitter.js';\nexport type {\n IgcActiveStepChangingEventArgs,\n IgcActiveStepChangedEventArgs,\n} from './components/stepper/common/types.js';\nexport type { IgcTreeSelectionEventArgs } from './components/tree/tree.common.js';\nexport type {\n ComboItemTemplate,\n ComboTemplateProps,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n} from './components/combo/types.js';\nexport type {\n IconMeta,\n RegisterIconOptions,\n} from './components/icon/registry/types.js';\nexport type * from './components/chat/types.js';\nexport type {\n QrCodeExportFormat,\n QrCodeExportOptions,\n QrCornerSquareStyle,\n QrDotStyle,\n QrErrorCorrectionLevel,\n} from './components/qr-code/types.js';\n\n// Internal exports for other packages\n/** @hidden @internal */\nexport { addThemingController as θaddThemingController } from '#theming/theming-controller.js';\n\n/** @hidden @internal */\nexport { addAdoptedStylesController as θaddAdoptedStylesController } from '#internals/controllers/adopt-styles.js';\n\n/** @hidden @internal */\nexport { createAbortHandle as θcreateAbortHandle } from '#internals/abort-handler.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,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AoB,CAAC;AA+C5B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAyCrE,OAAO,EAAE,oBAAoB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG/F,OAAO,EAAE,0BAA0B,IAAI,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGnH,OAAO,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["// Components\nexport { default as IgcAvatarComponent } from './components/avatar/avatar.js';\nexport { default as IgcAccordionComponent } from './components/accordion/accordion.js';\nexport { default as IgcBadgeComponent } from './components/badge/badge.js';\nexport { default as IgcBannerComponent } from './components/banner/banner.js';\nexport { default as IgcButtonComponent } from './components/button/button.js';\nexport { default as IgcButtonGroupComponent } from './components/button-group/button-group.js';\nexport { default as IgcCalendarComponent } from './components/calendar/calendar.js';\nexport { default as IgcCardComponent } from './components/card/card.js';\nexport { default as IgcCardActionsComponent } from './components/card/card.actions.js';\nexport { default as IgcCardContentComponent } from './components/card/card.content.js';\nexport { default as IgcCardHeaderComponent } from './components/card/card.header.js';\nexport { default as IgcCardMediaComponent } from './components/card/card.media.js';\nexport { default as IgcCarouselComponent } from './components/carousel/carousel.js';\nexport { default as IgcCarouselIndicatorComponent } from './components/carousel/carousel-indicator.js';\nexport { default as IgcCarouselSlideComponent } from './components/carousel/carousel-slide.js';\nexport { default as IgcChatComponent } from './components/chat/chat.js';\nexport { default as IgcColorPickerComponent } from './components/color-picker/color-picker.js';\nexport { default as IgcCheckboxComponent } from './components/checkbox/checkbox.js';\nexport { default as IgcCircularProgressComponent } from './components/progress/circular-progress.js';\nexport { default as IgcCircularGradientComponent } from './components/progress/circular-gradient.js';\nexport { default as IgcChipComponent } from './components/chip/chip.js';\nexport { default as IgcComboComponent } from './components/combo/combo.js';\nexport { default as IgcDatePickerComponent } from './components/date-picker/date-picker.js';\nexport { default as IgcDateRangePickerComponent } from './components/date-range-picker/date-range-picker.js';\nexport { default as IgcDateTimeInputComponent } from './components/date-time-input/date-time-input.js';\nexport { default as IgcDialogComponent } from './components/dialog/dialog.js';\nexport { default as IgcDividerComponent } from './components/divider/divider.js';\nexport { default as IgcDropdownComponent } from './components/dropdown/dropdown.js';\nexport { default as IgcDropdownGroupComponent } from './components/dropdown/dropdown-group.js';\nexport { default as IgcDropdownHeaderComponent } from './components/dropdown/dropdown-header.js';\nexport { default as IgcDropdownItemComponent } from './components/dropdown/dropdown-item.js';\nexport { default as IgcFileInputComponent } from './components/file-input/file-input.js';\nexport { default as IgcSelectComponent } from './components/select/select.js';\nexport { default as IgcSelectGroupComponent } from './components/select/select-group.js';\nexport { default as IgcSelectHeaderComponent } from './components/select/select-header.js';\nexport { default as IgcSelectItemComponent } from './components/select/select-item.js';\nexport { default as IgcExpansionPanelComponent } from './components/expansion-panel/expansion-panel.js';\nexport { default as IgcIconComponent } from './components/icon/icon.js';\nexport { default as IgcIconButtonComponent } from './components/button/icon-button.js';\nexport { default as IgcInputComponent } from './components/input/input.js';\nexport { default as IgcLinearProgressComponent } from './components/progress/linear-progress.js';\nexport { default as IgcListComponent } from './components/list/list.js';\nexport { default as IgcListHeaderComponent } from './components/list/list-header.js';\nexport { default as IgcListItemComponent } from './components/list/list-item.js';\nexport { default as IgcMaskInputComponent } from './components/mask-input/mask-input.js';\nexport { default as IgcNavDrawerComponent } from './components/nav-drawer/nav-drawer.js';\nexport { default as IgcNavDrawerHeaderItemComponent } from './components/nav-drawer/nav-drawer-header-item.js';\nexport { default as IgcNavDrawerItemComponent } from './components/nav-drawer/nav-drawer-item.js';\nexport { default as IgcNavbarComponent } from './components/navbar/navbar.js';\nexport { default as IgcRadioGroupComponent } from './components/radio-group/radio-group.js';\nexport { default as IgcRadioComponent } from './components/radio/radio.js';\nexport { default as IgcRatingComponent } from './components/rating/rating.js';\nexport { default as IgcRatingSymbolComponent } from './components/rating/rating-symbol.js';\nexport { default as IgcRippleComponent } from './components/ripple/ripple.js';\nexport { default as IgcRangeSliderComponent } from './components/slider/range-slider.js';\nexport { default as IgcSnackbarComponent } from './components/snackbar/snackbar.js';\nexport { default as IgcSliderComponent } from './components/slider/slider.js';\nexport { default as IgcSliderLabelComponent } from './components/slider/slider-label.js';\nexport { default as IgcTabsComponent } from './components/tabs/tabs.js';\nexport { default as IgcTabComponent } from './components/tabs/tab.js';\nexport { default as IgcTileComponent } from './components/tile-manager/tile.js';\nexport { default as IgcTileManagerComponent } from './components/tile-manager/tile-manager.js';\nexport { default as IgcToastComponent } from './components/toast/toast.js';\nexport { default as IgcToggleButtonComponent } from './components/button-group/toggle-button.js';\nexport { default as IgcSwitchComponent } from './components/checkbox/switch.js';\nexport { default as IgcTextareaComponent } from './components/textarea/textarea.js';\nexport { default as IgcTreeComponent } from './components/tree/tree.js';\nexport { default as IgcTreeItemComponent } from './components/tree/tree-item.js';\nexport { default as IgcSplitterComponent } from './components/splitter/splitter.js';\nexport { default as IgcStepperComponent } from './components/stepper/stepper.js';\nexport { default as IgcStepComponent } from './components/stepper/step.js';\nexport { default as IgcHighlightComponent } from './components/highlight/highlight.js';\nexport { default as IgcTooltipComponent } from './components/tooltip/tooltip.js';\nexport { default as IgcThemeProviderComponent } from './components/theme-provider/theme-provider.js';\nexport { default as IgcQrCodeComponent } from './components/qr-code/qr-code.js';\nexport { default as IgcBreadcrumbsComponent } from './components/breadcrumb/breadcrumbs.js';\nexport { default as IgcBreadcrumbComponent } from './components/breadcrumb/breadcrumb.js';\nexport { default as IgcVirtualScrollComponent } from './components/virtualization/virtualization.js';\nexport type {\n IgcVirtualScrollComponentEventMap,\n VirtualScrollItemTemplate,\n VirtualScrollKeyFunction,\n} from './components/virtualization/virtualization.js';\nexport type {\n VirtualScrollItemContext,\n VirtualScrollState,\n VirtualScrollDataRequest,\n} from './components/virtualization/types.js';\n\n// definitions\nexport { defineComponents } from '#internals/definitions/defineComponents.js';\nexport { defineAllComponents } from '#internals/definitions/defineAllComponents.js';\n\n// icon registration\nexport {\n registerIcon,\n registerIconFromText,\n setIconRef,\n} from './components/icon/icon.registry.js';\n\n// theming configuration\nexport { configureTheme } from '#theming/config.js';\nexport type { Theme, ThemeVariant } from '#theming/types.js';\n\n// localization objects\nexport {\n IgcCalendarResourceStringEN,\n type IgcCalendarResourceStrings,\n} from '#internals/i18n/EN/calendar.resources.js';\nexport {\n IgcDateRangePickerResourceStringsEN,\n type IgcDateRangePickerResourceStrings,\n} from '#internals/i18n/EN/date-range-picker.resources.js';\nexport {\n IgcChatResourceStringEN,\n type IgcChatResourceStrings,\n} from '#internals/i18n/EN/chat.resources.js';\nexport {\n type ICalendarResourceStrings,\n type ICarouselResourceStrings,\n type IChatResourceStrings,\n type IChipResourceStrings,\n type IComboResourceStrings,\n type IDatePickerResourceStrings,\n type IDateRangePickerResourceStrings,\n type IFileInputResourceStrings,\n type ITreeResourceStrings,\n CalendarResourceStringsEN,\n CarouselResourceStringsEN,\n ChatResourceStringsEN,\n ChipResourceStringsEN,\n ComboResourceStringsEN,\n DatePickerResourceStringsEN,\n DateRangePickerResourceStringsEN,\n FileInputResourceStringsEN,\n TreeResourceStringsEN,\n registerI18n,\n setCurrentI18n,\n} from 'igniteui-i18n-core';\n\n// Event maps\nexport type { IgcBannerComponentEventMap } from './components/banner/banner.js';\nexport type { IgcButtonGroupComponentEventMap } from './components/button-group/button-group.js';\nexport type { IgcCalendarComponentEventMap } from './components/calendar/types.js';\nexport type { IgcCarouselComponentEventMap } from './components/carousel/carousel.js';\nexport type { IgcChatComponentEventMap } from './components/chat/chat.js';\nexport type { IgcCheckboxComponentEventMap } from './components/checkbox/checkbox-base.js';\nexport type { IgcCheckboxComponentEventMap as IgcSwitchComponentEventMap } from './components/checkbox/checkbox-base.js';\nexport type { IgcChipComponentEventMap } from './components/chip/chip.js';\nexport type { IgcComboComponentEventMap } from './components/combo/types.js';\nexport type { IgcColorPickerComponentEventMap } from './components/color-picker/color-picker.js';\nexport type { IgcDatePickerComponentEventMap } from './components/date-picker/date-picker.js';\nexport type { IgcDateRangePickerComponentEventMap } from './components/date-range-picker/date-range-picker.js';\nexport type { IgcDateTimeInputComponentEventMap } from './components/date-time-input/date-time-input.js';\nexport type { IgcDialogComponentEventMap } from './components/dialog/dialog.js';\nexport type { IgcDropdownComponentEventMap } from './components/dropdown/dropdown.js';\nexport type { IgcExpansionPanelComponentEventMap } from './components/expansion-panel/expansion-panel.js';\nexport type { IgcInputComponentEventMap } from './components/input/input-base.js';\nexport type { IgcInputComponentEventMap as IgcMaskInputComponentEventMap } from './components/input/input-base.js';\nexport type { IgcNavDrawerComponentEventMap } from './components/nav-drawer/nav-drawer.js';\nexport type { IgcFileInputComponentEventMap } from './components/file-input/file-input.js';\nexport type { IgcRadioComponentEventMap } from './components/radio/radio.js';\nexport type { IgcRatingComponentEventMap } from './components/rating/rating.js';\nexport type { IgcSelectComponentEventMap } from './components/select/select.js';\nexport type { IgcSliderComponentEventMap } from './components/slider/slider.js';\nexport type { IgcRangeSliderComponentEventMap } from './components/slider/range-slider.js';\nexport type { IgcSnackbarComponentEventMap } from './components/snackbar/snackbar.js';\nexport type { IgcSplitterComponentEventMap } from './components/splitter/splitter.js';\nexport type { IgcStepperComponentEventMap } from './components/stepper/common/types.js';\nexport type { IgcTabsComponentEventMap } from './components/tabs/tabs.js';\nexport type { IgcTextareaComponentEventMap } from './components/textarea/textarea.js';\nexport type { IgcTileComponentEventMap } from './components/tile-manager/tile.js';\nexport type { IgcTreeComponentEventMap } from './components/tree/tree.common.js';\nexport type { IgcTooltipComponentEventMap } from './components/tooltip/tooltip.js';\n\n// Public types\nexport type * from './components/types.js';\nexport type { IgcTileChangeStateEventArgs } from './components/tile-manager/tile.js';\nexport type {\n CalendarActiveView,\n CalendarHeaderOrientation,\n CalendarSelection,\n DateRangeDescriptor,\n WeekDays,\n} from './components/calendar/types.js';\nexport { DateRangeType } from './components/calendar/types.js';\nexport type { IgcCheckboxChangeEventArgs } from './components/checkbox/checkbox-base.js';\nexport { DatePart } from './components/date-time-input/date-part.js';\nexport type { DatePartDeltas } from './components/date-time-input/date-part.js';\nexport type {\n CustomDateRange,\n DateRangeValue,\n} from './components/date-range-picker/date-range-picker.js';\nexport type { PopoverPlacement } from './components/popover/popover.js';\nexport type { IgcRadioChangeEventArgs } from './components/radio/radio.js';\nexport type { IgcRangeSliderValueEventArgs } from './components/slider/range-slider.js';\nexport type {\n IgcSplitterResizeEventArgs,\n IgcSplitterResizeEventDetail,\n IgcSplitterLayoutChangedEventArgs,\n} from './components/splitter/splitter.js';\nexport type {\n IgcActiveStepChangingEventArgs,\n IgcActiveStepChangedEventArgs,\n} from './components/stepper/common/types.js';\nexport type { IgcTreeSelectionEventArgs } from './components/tree/tree.common.js';\nexport type {\n ComboItemTemplate,\n ComboTemplateProps,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n} from './components/combo/types.js';\nexport type {\n IconMeta,\n RegisterIconOptions,\n} from './components/icon/registry/types.js';\nexport type * from './components/chat/types.js';\nexport type {\n QrCodeExportFormat,\n QrCodeExportOptions,\n QrCornerSquareStyle,\n QrDotStyle,\n QrErrorCorrectionLevel,\n} from './components/qr-code/types.js';\n\n// Internal exports for other packages\n/** @hidden @internal */\nexport { addThemingController as θaddThemingController } from '#theming/theming-controller.js';\n\n/** @hidden @internal */\nexport { addAdoptedStylesController as θaddAdoptedStylesController } from '#internals/controllers/adopt-styles.js';\n\n/** @hidden @internal */\nexport { createAbortHandle as θcreateAbortHandle } from '#internals/abort-handler.js';\n"]}
|
|
@@ -1,6 +1,33 @@
|
|
|
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
32
|
* The ARIA semantics that a composite host projects onto the native editor.
|
|
6
33
|
*
|
|
@@ -20,11 +47,15 @@ export type ProjectedARIA = {
|
|
|
20
47
|
labelledBy?: ReadonlyArray<Element> | null;
|
|
21
48
|
activeDescendant?: Element | null;
|
|
22
49
|
};
|
|
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;
|
|
23
54
|
type AriaTargetConfig = {
|
|
24
|
-
/** Resolves the component's own `ElementInternals` labels. */
|
|
25
|
-
labels: () => ReadonlyArray<Element> | null;
|
|
26
55
|
/** Resolves the helper-text container, or `null` when there is none. */
|
|
27
|
-
description
|
|
56
|
+
description?: () => Element | null;
|
|
57
|
+
/** Whether an own label names the editor natively, for example a `<label for>`. */
|
|
58
|
+
hasOwnLabel?: () => boolean;
|
|
28
59
|
};
|
|
29
60
|
/**
|
|
30
61
|
* The binding values for a native editor element, resolved from the projected
|
|
@@ -39,24 +70,26 @@ export type ResolvedARIABindings = {
|
|
|
39
70
|
disabled?: string;
|
|
40
71
|
label?: string;
|
|
41
72
|
/**
|
|
42
|
-
* The
|
|
43
|
-
* while
|
|
44
|
-
*
|
|
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.
|
|
45
76
|
*/
|
|
46
77
|
describedByRef?: string;
|
|
78
|
+
/** The IDREF of the own label in the same root. It binds as `describedByRef`. */
|
|
79
|
+
labelledByRef?: string;
|
|
47
80
|
labelledBy: ReadonlyArray<Element> | null;
|
|
48
81
|
controls: ReadonlyArray<Element> | null;
|
|
49
82
|
describedBy: ReadonlyArray<Element> | null;
|
|
50
83
|
activeDescendant: Element | null;
|
|
51
84
|
};
|
|
52
85
|
/**
|
|
53
|
-
* The receiving end of an ARIA projection.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
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.
|
|
56
89
|
*
|
|
57
90
|
* @remarks
|
|
58
|
-
* Not a reactive controller
|
|
59
|
-
*
|
|
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.
|
|
60
93
|
*/
|
|
61
94
|
declare class AriaTargetController {
|
|
62
95
|
private readonly _host;
|
|
@@ -86,37 +119,40 @@ declare class AriaTargetController {
|
|
|
86
119
|
*/
|
|
87
120
|
private _reflectStylingHooks;
|
|
88
121
|
/**
|
|
89
|
-
* Resolves the binding values for the native editor element.
|
|
90
|
-
*
|
|
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}.
|
|
122
|
+
* Resolves the binding values for the native editor element. A projected
|
|
123
|
+
* value wins over the own naming.
|
|
97
124
|
*/
|
|
98
125
|
resolveBindings(): ResolvedARIABindings;
|
|
99
126
|
}
|
|
127
|
+
/** The bindings that {@link ariaBindings} accepts. Each key is optional. */
|
|
128
|
+
export type ARIABindings = Partial<ResolvedARIABindings>;
|
|
100
129
|
/**
|
|
101
|
-
* Applies {@link
|
|
102
|
-
*
|
|
130
|
+
* Applies {@link ARIABindings} to the native editor. It writes only changed
|
|
131
|
+
* values, and only to the attributes that its bindings set.
|
|
103
132
|
*/
|
|
104
133
|
declare class AriaBindingsDirective extends Directive {
|
|
105
134
|
private _previous?;
|
|
106
135
|
constructor(partInfo: PartInfo);
|
|
107
|
-
render(_:
|
|
136
|
+
render(_: ARIABindings): unknown;
|
|
108
137
|
update(part: ElementPart, [bindings]: DirectiveParameters<this>): unknown;
|
|
109
138
|
}
|
|
110
139
|
/**
|
|
111
140
|
* Binds the resolved ARIA state onto a native editor element as one element
|
|
112
141
|
* expression, for example `<input ${ariaBindings(aria)} />`.
|
|
113
142
|
*/
|
|
114
|
-
export declare const ariaBindings: (_: ResolvedARIABindings) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
|
|
143
|
+
export declare const ariaBindings: (_: Partial<ResolvedARIABindings>) => import("lit-html/directive.js").DirectiveResult<typeof AriaBindingsDirective>;
|
|
115
144
|
type AriaProjectorConfig = {
|
|
116
145
|
/** Resolves the input-shaped component that receives the ARIA state. */
|
|
117
146
|
target: () => Element | null | undefined;
|
|
118
147
|
/** Computes the ARIA state to project, after every host update. */
|
|
119
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;
|
|
120
156
|
};
|
|
121
157
|
/**
|
|
122
158
|
* The sending end of an ARIA projection. A composite host such as
|
|
@@ -128,6 +164,8 @@ declare class AriaProjectorController implements ReactiveController {
|
|
|
128
164
|
private readonly _config;
|
|
129
165
|
private _retryScheduled;
|
|
130
166
|
constructor(host: ControllerHost, config: AriaProjectorConfig);
|
|
167
|
+
/** Computes the state, with the name of the host when it is configured. */
|
|
168
|
+
private _state;
|
|
131
169
|
/** @internal */
|
|
132
170
|
hostUpdated(): void;
|
|
133
171
|
}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { noChange, } from 'lit';
|
|
2
2
|
import { Directive, directive, PartType, } from 'lit/directive.js';
|
|
3
3
|
import { sameItems } from '../utils/arrays.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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;
|
|
22
|
+
}
|
|
23
|
+
return naming;
|
|
24
|
+
}
|
|
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;
|
|
17
30
|
}
|
|
31
|
+
const targets = new WeakMap();
|
|
18
32
|
class AriaTargetController {
|
|
19
33
|
constructor(host, config) {
|
|
20
34
|
this._projected = {};
|
|
@@ -42,23 +56,24 @@ class AriaTargetController {
|
|
|
42
56
|
}
|
|
43
57
|
resolveBindings() {
|
|
44
58
|
const projected = this._projected;
|
|
45
|
-
const description = this._config.description();
|
|
59
|
+
const description = this._config.description?.() ?? null;
|
|
60
|
+
const naming = projected.labelledBy
|
|
61
|
+
? projected
|
|
62
|
+
: resolveNaming(this._host, this._config.hasOwnLabel?.() ?? false);
|
|
46
63
|
this._resolved = {
|
|
47
64
|
role: projected.role,
|
|
48
65
|
hasPopup: projected.hasPopup,
|
|
49
66
|
expanded: projected.expanded,
|
|
50
67
|
disabled: projected.disabled,
|
|
51
|
-
label: projected.label,
|
|
52
|
-
labelledBy:
|
|
68
|
+
label: projected.label ?? naming.label,
|
|
69
|
+
labelledBy: naming.labelledBy ?? null,
|
|
53
70
|
controls: projected.controls ?? null,
|
|
54
71
|
describedBy: projected.describedBy
|
|
55
72
|
? description
|
|
56
73
|
? [description, ...projected.describedBy]
|
|
57
74
|
: projected.describedBy
|
|
58
75
|
: null,
|
|
59
|
-
describedByRef:
|
|
60
|
-
? undefined
|
|
61
|
-
: description?.id || undefined,
|
|
76
|
+
describedByRef: description?.id || undefined,
|
|
62
77
|
activeDescendant: projected.activeDescendant ?? null,
|
|
63
78
|
};
|
|
64
79
|
return this._resolved;
|
|
@@ -70,8 +85,23 @@ const scalarBindings = [
|
|
|
70
85
|
['expanded', 'aria-expanded'],
|
|
71
86
|
['disabled', 'aria-disabled'],
|
|
72
87
|
['label', 'aria-label'],
|
|
73
|
-
['describedByRef', 'aria-describedby'],
|
|
74
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
|
+
}
|
|
75
105
|
class AriaBindingsDirective extends Directive {
|
|
76
106
|
constructor(partInfo) {
|
|
77
107
|
super(partInfo);
|
|
@@ -86,13 +116,25 @@ class AriaBindingsDirective extends Directive {
|
|
|
86
116
|
const element = part.element;
|
|
87
117
|
const previous = this._previous;
|
|
88
118
|
this._previous = bindings;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
+
}
|
|
93
135
|
for (const [key, attribute] of scalarBindings) {
|
|
94
136
|
const value = bindings[key];
|
|
95
|
-
if (
|
|
137
|
+
if (previous?.[key] !== value) {
|
|
96
138
|
value != null
|
|
97
139
|
? element.setAttribute(attribute, value)
|
|
98
140
|
: element.removeAttribute(attribute);
|
|
@@ -109,6 +151,15 @@ class AriaProjectorController {
|
|
|
109
151
|
this._config = config;
|
|
110
152
|
host.addController(this);
|
|
111
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
|
+
}
|
|
112
163
|
hostUpdated() {
|
|
113
164
|
const element = this._config.target();
|
|
114
165
|
if (!element) {
|
|
@@ -116,7 +167,7 @@ class AriaProjectorController {
|
|
|
116
167
|
}
|
|
117
168
|
const target = targets.get(element);
|
|
118
169
|
if (target) {
|
|
119
|
-
target.setProjected(this.
|
|
170
|
+
target.setProjected(this._state());
|
|
120
171
|
return;
|
|
121
172
|
}
|
|
122
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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AAC,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
|
+
{"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;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAM7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;AA0BnE,MAAM,UAAU,aAAa,CAC3B,IAAa,EACb,QAA0B,EAC1B,QAAiB;IAEjB,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC;IAE/C,IAAI,UAAU,EAAE,MAAM,EAAE,CAAC;QACvB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEzC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAChC,CAAC;IAED,MAAM,MAAM,GAAmB;QAC7B,UAAU,EAAE,IAAI;QAChB,KAAK,EAAE,QAA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AM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnC,OAAO;QACT,CAAC;QAID,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;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"]}
|
|
@@ -6,8 +6,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { isServer } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { NAMING_ATTRIBUTES } from '../../controllers/aria-projection.js';
|
|
9
10
|
import { addInternalsController } from '../../controllers/internals.js';
|
|
10
11
|
import { enterKey, isKey } from '../../controllers/keys.js';
|
|
12
|
+
import { sameItems } from '../../utils/arrays.js';
|
|
11
13
|
import { addSafeEventListener } from '../../utils/events.js';
|
|
12
14
|
import { isFunction, isString } from '../../utils/types.js';
|
|
13
15
|
import { InternalInvalidEvent, InternalResetEvent, } from './types.js';
|
|
@@ -22,6 +24,10 @@ function emitInternalFormEvent(host, name) {
|
|
|
22
24
|
function BaseFormAssociated(base) {
|
|
23
25
|
class BaseFormAssociatedElement extends base {
|
|
24
26
|
static { this.formAssociated = true; }
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
const inherited = Reflect.get(base, 'observedAttributes', this);
|
|
29
|
+
return [...inherited, ...NAMING_ATTRIBUTES];
|
|
30
|
+
}
|
|
25
31
|
get _shouldApplyStyles() {
|
|
26
32
|
if (this._isExternalInvalid) {
|
|
27
33
|
return true;
|
|
@@ -69,10 +75,23 @@ function BaseFormAssociated(base) {
|
|
|
69
75
|
this._isInternalValidation = false;
|
|
70
76
|
this._touched = false;
|
|
71
77
|
this._isExternalInvalid = false;
|
|
78
|
+
this._renderedLabels = null;
|
|
72
79
|
this._disabled = false;
|
|
73
80
|
this._invalid = false;
|
|
74
81
|
this._pristine = true;
|
|
75
82
|
addSafeEventListener(this, 'invalid', this._handleInvalid);
|
|
83
|
+
addSafeEventListener(this, 'click', this._handleHostClick);
|
|
84
|
+
addSafeEventListener(this, 'focusin', this._handleFocusEnter);
|
|
85
|
+
}
|
|
86
|
+
attributeChangedCallback(name, prev, current) {
|
|
87
|
+
super.attributeChangedCallback(name, prev, current);
|
|
88
|
+
if (NAMING_ATTRIBUTES.includes(name)) {
|
|
89
|
+
this.requestUpdate();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
update(properties) {
|
|
93
|
+
this._renderedLabels = this._internals.labels;
|
|
94
|
+
super.update(properties);
|
|
76
95
|
}
|
|
77
96
|
connectedCallback() {
|
|
78
97
|
super.connectedCallback();
|
|
@@ -82,6 +101,21 @@ function BaseFormAssociated(base) {
|
|
|
82
101
|
}
|
|
83
102
|
this._validate();
|
|
84
103
|
}
|
|
104
|
+
_handleHostClick(event) {
|
|
105
|
+
if (!this.disabled &&
|
|
106
|
+
event.bubbles &&
|
|
107
|
+
!event.defaultPrevented &&
|
|
108
|
+
event.composedPath()[0] === this) {
|
|
109
|
+
this._handleLabelActivation();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
_handleFocusEnter(event) {
|
|
113
|
+
if (!this.contains(event.relatedTarget) &&
|
|
114
|
+
!sameItems(this._internals.labels, this._renderedLabels)) {
|
|
115
|
+
this.requestUpdate();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
_handleLabelActivation() { }
|
|
85
119
|
_handleEnterKeydown(event) {
|
|
86
120
|
if (!isKey(event, enterKey) || event.repeat) {
|
|
87
121
|
return;
|