@angular/aria 21.0.0-rc.2 → 21.0.0-rc.3
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/_adev_assets/aria-accordion.json +5 -19
- package/_adev_assets/aria-combobox.json +9 -97
- package/_adev_assets/aria-grid.json +5 -19
- package/_adev_assets/aria-listbox.json +0 -51
- package/_adev_assets/aria-menu.json +7 -35
- package/_adev_assets/aria-tabs.json +3 -294
- package/_adev_assets/aria-toolbar.json +22 -212
- package/_adev_assets/aria-tree.json +3 -356
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +11 -11
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +5 -11
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +5 -4
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +8 -8
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +6 -4
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +5 -3
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +23 -22
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +40 -20
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +21 -20
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/types/accordion.d.ts +2 -2
- package/types/combobox.d.ts +1 -5
- package/types/grid.d.ts +1 -1
- package/types/listbox.d.ts +2 -2
- package/types/menu.d.ts +3 -3
- package/types/private.d.ts +1 -1
- package/types/tabs.d.ts +8 -8
- package/types/toolbar.d.ts +12 -10
- package/types/tree.d.ts +8 -8
package/fesm2022/accordion.mjs
CHANGED
|
@@ -16,13 +16,13 @@ class AccordionPanel {
|
|
|
16
16
|
visible = computed(() => !this._pattern.hidden(), ...(ngDevMode ? [{
|
|
17
17
|
debugName: "visible"
|
|
18
18
|
}] : []));
|
|
19
|
-
|
|
20
|
-
debugName: "
|
|
19
|
+
_accordionTriggerPattern = signal(undefined, ...(ngDevMode ? [{
|
|
20
|
+
debugName: "_accordionTriggerPattern"
|
|
21
21
|
}] : []));
|
|
22
22
|
_pattern = new AccordionPanelPattern({
|
|
23
23
|
id: this.id,
|
|
24
24
|
panelId: this.panelId,
|
|
25
|
-
accordionTrigger: () => this.
|
|
25
|
+
accordionTrigger: () => this._accordionTriggerPattern()
|
|
26
26
|
});
|
|
27
27
|
constructor() {
|
|
28
28
|
afterRenderEffect(() => {
|
|
@@ -30,13 +30,13 @@ class AccordionPanel {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
expand() {
|
|
33
|
-
this.
|
|
33
|
+
this._accordionTriggerPattern()?.open();
|
|
34
34
|
}
|
|
35
35
|
collapse() {
|
|
36
|
-
this.
|
|
36
|
+
this._accordionTriggerPattern()?.close();
|
|
37
37
|
}
|
|
38
38
|
toggle() {
|
|
39
|
-
this.
|
|
39
|
+
this._accordionTriggerPattern()?.toggle();
|
|
40
40
|
}
|
|
41
41
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
42
42
|
minVersion: "12.0.0",
|
|
@@ -132,13 +132,13 @@ class AccordionTrigger {
|
|
|
132
132
|
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
133
133
|
debugName: "active"
|
|
134
134
|
}] : []));
|
|
135
|
-
|
|
136
|
-
debugName: "
|
|
135
|
+
_accordionPanelPattern = signal(undefined, ...(ngDevMode ? [{
|
|
136
|
+
debugName: "_accordionPanelPattern"
|
|
137
137
|
}] : []));
|
|
138
138
|
_pattern = new AccordionTriggerPattern({
|
|
139
139
|
...this,
|
|
140
140
|
accordionGroup: computed(() => this._accordionGroup._pattern),
|
|
141
|
-
accordionPanel: this.
|
|
141
|
+
accordionPanel: this._accordionPanelPattern,
|
|
142
142
|
element: () => this.element
|
|
143
143
|
});
|
|
144
144
|
expand() {
|
|
@@ -295,9 +295,9 @@ class AccordionGroup {
|
|
|
295
295
|
const panels = this._panels();
|
|
296
296
|
for (const trigger of triggers) {
|
|
297
297
|
const panel = panels.find(p => p.panelId() === trigger.panelId());
|
|
298
|
-
trigger.
|
|
298
|
+
trigger._accordionPanelPattern.set(panel?._pattern);
|
|
299
299
|
if (panel) {
|
|
300
|
-
panel.
|
|
300
|
+
panel._accordionTriggerPattern.set(trigger._pattern);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/accordion/accordion.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n input,\n ElementRef,\n inject,\n contentChildren,\n afterRenderEffect,\n signal,\n model,\n booleanAttribute,\n computed,\n WritableSignal,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n DeferredContent,\n DeferredContentAware,\n AccordionGroupPattern,\n AccordionPanelPattern,\n AccordionTriggerPattern,\n} from '@angular/aria/private';\n\n/**\n * The content panel of an accordion item that is conditionally visible.\n *\n * This directive is a container for the content that is shown or hidden. It requires\n * a `panelId` that must match the `panelId` of its corresponding `ngAccordionTrigger`.\n * The content within the panel should be provided using an `ng-template` with the\n * `ngAccordionContent` directive so that the content is not rendered on the page until the trigger\n * is expanded. It applies `role=\"region\"` for accessibility and uses the `inert` attribute to hide\n * its content from assistive technologies when not visible.\n *\n * ```html\n * <div ngAccordionPanel panelId=\"unique-id-1\">\n * <ng-template ngAccordionContent>\n * <p>This content is lazily rendered and will be shown when the panel is expanded.</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionPanel]',\n exportAs: 'ngAccordionPanel',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n 'role': 'region',\n '[attr.id]': '_pattern.id()',\n '[attr.aria-labelledby]': '_pattern.accordionTrigger()?.id()',\n '[attr.inert]': '!visible() ? true : null',\n },\n})\nexport class AccordionPanel {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** A global unique identifier for the panel. */\n readonly id = input(inject(_IdGenerator).getId('ng-accordion-panel-', true));\n\n /** A local unique identifier for the panel, used to match with its trigger's `panelId`. */\n readonly panelId = input.required<string>();\n\n /** Whether the accordion panel is visible. True if the associated trigger is expanded. */\n readonly visible = computed(() => !this._pattern.hidden());\n\n /** The parent accordion trigger pattern that controls this panel. This is set by AccordionGroup. */\n readonly accordionTrigger: WritableSignal<AccordionTriggerPattern | undefined> =\n signal(undefined);\n\n /** The UI pattern instance for this panel. */\n readonly _pattern: AccordionPanelPattern = new AccordionPanelPattern({\n id: this.id,\n panelId: this.panelId,\n accordionTrigger: () => this.accordionTrigger(),\n });\n\n constructor() {\n // Connect the panel's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this._deferredContentAware.contentVisible.set(this.visible());\n });\n }\n\n /** Expands this item. */\n expand() {\n this.accordionTrigger()?.open();\n }\n\n /** Collapses this item. */\n collapse() {\n this.accordionTrigger()?.close();\n }\n\n /** Toggles the expansion state of this item. */\n toggle() {\n this.accordionTrigger()?.toggle();\n }\n}\n\n/**\n * The trigger that toggles the visibility of its associated `ngAccordionPanel`.\n *\n * This directive requires a `panelId` that must match the `panelId` of the `ngAccordionPanel` it\n * controls. When clicked, it will expand or collapse the panel. It also handles keyboard\n * interactions for navigation within the `ngAccordionGroup`. It applies `role=\"button\"` and manages\n * `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.\n * The `disabled` input can be used to disable the trigger.\n *\n * ```html\n * <button ngAccordionTrigger panelId=\"unique-id-1\">\n * Accordion Trigger Text\n * </button>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionTrigger]',\n exportAs: 'ngAccordionTrigger',\n host: {\n '[attr.data-active]': 'active()',\n 'role': 'button',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': '_pattern.controls()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.disabled]': '_pattern.hardDisabled() ? true : null',\n '[attr.tabindex]': '_pattern.tabIndex()',\n },\n})\nexport class AccordionTrigger {\n /** A reference to the trigger element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the trigger element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent AccordionGroup. */\n private readonly _accordionGroup = inject(AccordionGroup);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-accordion-trigger-', true));\n\n /** A local unique identifier for the trigger, used to match with its panel's `panelId`. */\n readonly panelId = input.required<string>();\n\n /** Whether the trigger is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the corresponding panel is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** Whether the trigger is active. */\n readonly active = computed(() => this._pattern.active());\n\n /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */\n readonly _accordionPanel: WritableSignal<AccordionPanelPattern | undefined> = signal(undefined);\n\n /** The UI pattern instance for this trigger. */\n readonly _pattern: AccordionTriggerPattern = new AccordionTriggerPattern({\n ...this,\n accordionGroup: computed(() => this._accordionGroup._pattern),\n accordionPanel: this._accordionPanel,\n element: () => this.element,\n });\n\n /** Expands this item. */\n expand() {\n this._pattern.open();\n }\n\n /** Collapses this item. */\n collapse() {\n this._pattern.close();\n }\n\n /** Toggles the expansion state of this item. */\n toggle() {\n this._pattern.toggle();\n }\n}\n\n/**\n * A container for a group of accordion items. It manages the overall state and\n * interactions of the accordion, such as keyboard navigation and expansion mode.\n *\n * The `ngAccordionGroup` serves as the root of a group of accordion triggers and panels,\n * coordinating the behavior of the `ngAccordionTrigger` and `ngAccordionPanel` elements within it.\n * It supports both single and multiple expansion modes.\n *\n * ```html\n * <div ngAccordionGroup [multiExpandable]=\"true\" [(expandedPanels)]=\"expandedItems\">\n * <div class=\"accordion-item\">\n * <h3>\n * <button ngAccordionTrigger panelId=\"item-1\">Item 1</button>\n * </h3>\n * <div ngAccordionPanel panelId=\"item-1\">\n * <ng-template ngAccordionContent>\n * <p>Content for Item 1.</p>\n * </ng-template>\n * </div>\n * </div>\n * <div class=\"accordion-item\">\n * <h3>\n * <button ngAccordionTrigger panelId=\"item-2\">Item 2</button>\n * </h3>\n * <div ngAccordionPanel panelId=\"item-2\">\n * <ng-template ngAccordionContent>\n * <p>Content for Item 2.</p>\n * </ng-template>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionGroup]',\n exportAs: 'ngAccordionGroup',\n host: {\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_pattern.onFocus($event)',\n },\n})\nexport class AccordionGroup {\n /** A reference to the group element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the group element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The AccordionTriggers nested inside this group. */\n private readonly _triggers = contentChildren(AccordionTrigger, {descendants: true});\n\n /** The AccordionTrigger patterns nested inside this group. */\n private readonly _triggerPatterns = computed(() => this._triggers().map(t => t._pattern));\n\n /** The AccordionPanels nested inside this group. */\n private readonly _panels = contentChildren(AccordionPanel, {descendants: true});\n\n /** The text direction (ltr or rtl). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the entire accordion group is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether multiple accordion items can be expanded simultaneously. */\n readonly multiExpandable = input(true, {transform: booleanAttribute});\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */\n readonly wrap = input(false, {transform: booleanAttribute});\n\n /** The UI pattern instance for this accordion group. */\n readonly _pattern: AccordionGroupPattern = new AccordionGroupPattern({\n ...this,\n activeItem: signal(undefined),\n items: this._triggerPatterns,\n // TODO(ok7sai): Investigate whether an accordion should support horizontal mode.\n orientation: () => 'vertical',\n getItem: e => this._getItem(e),\n element: () => this.element,\n });\n\n constructor() {\n // Effect to link triggers with their corresponding panels and update the group's items.\n afterRenderEffect(() => {\n const triggers = this._triggers();\n const panels = this._panels();\n\n for (const trigger of triggers) {\n const panel = panels.find(p => p.panelId() === trigger.panelId());\n trigger._accordionPanel.set(panel?._pattern);\n if (panel) {\n panel.accordionTrigger.set(trigger._pattern);\n }\n }\n });\n }\n\n /** Expands all accordion panels if multi-expandable. */\n expandAll() {\n this._pattern.expansionBehavior.openAll();\n }\n\n /** Collapses all accordion panels. */\n collapseAll() {\n this._pattern.expansionBehavior.closeAll();\n }\n\n /** Gets the trigger pattern for a given element. */\n private _getItem(element: Element | null | undefined): AccordionTriggerPattern | undefined {\n let target = element;\n\n while (target) {\n const pattern = this._triggerPatterns().find(t => t.element() === target);\n if (pattern) {\n return pattern;\n }\n\n target = target.parentElement?.closest('[ngAccordionTrigger]');\n }\n\n return undefined;\n }\n}\n\n/**\n * A structural directive that provides a mechanism for lazily rendering the content for an\n * `ngAccordionPanel`.\n *\n * This directive should be applied to an `ng-template` inside an `ngAccordionPanel`.\n * It allows the content of the panel to be lazily rendered, improving performance\n * by only creating the content when the panel is first expanded.\n *\n * ```html\n * <div ngAccordionPanel panelId=\"unique-id-1\">\n * <ng-template ngAccordionContent>\n * <p>This is the content that will be displayed inside the panel.</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngAccordionContent]',\n hostDirectives: [DeferredContent],\n})\nexport class AccordionContent {}\n"],"names":["AccordionPanel","_deferredContentAware","inject","DeferredContentAware","id","input","_IdGenerator","getId","panelId","required","visible","computed","_pattern","hidden","accordionTrigger","signal","undefined","AccordionPanelPattern","constructor","afterRenderEffect","contentVisible","set","expand","open","collapse","close","toggle","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","host","attributes","properties","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","AccordionTrigger","_elementRef","ElementRef","element","nativeElement","_accordionGroup","AccordionGroup","disabled","transform","booleanAttribute","expanded","model","active","_accordionPanel","AccordionTriggerPattern","accordionGroup","accordionPanel","outputs","_triggers","contentChildren","descendants","_triggerPatterns","map","t","ngDevMode","debugName","_panels","textDirection","Directionality","valueSignal","multiExpandable","softDisabled","wrap","AccordionGroupPattern","activeItem","items","orientation","getItem","e","_getItem","triggers","panels","trigger","panel","find","p","expandAll","expansionBehavior","openAll","collapseAll","closeAll","pattern","parentElement","closest","listeners","queries","propertyName","predicate","AccordionContent","DeferredContent"],"mappings":";;;;;;;MAmEaA,cAAc,CAAA;AAERC,EAAAA,qBAAqB,GAAGC,MAAM,CAACC,oBAAoB,CAAC;AAG5DC,EAAAA,EAAE,GAAGC,KAAK,CAACH,MAAM,CAACI,YAAY,CAAC,CAACC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC;;WAAC;EAGnEC,OAAO,GAAGH,KAAK,CAACI,QAAQ;;WAAU;AAGlCC,EAAAA,OAAO,GAAGC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAACC,QAAQ,CAACC,MAAM,EAAE;;WAAC;EAGjDC,gBAAgB,GACvBC,MAAM,CAACC,SAAS;;WAAC;EAGVJ,QAAQ,GAA0B,IAAIK,qBAAqB,CAAC;IACnEb,EAAE,EAAE,IAAI,CAACA,EAAE;IACXI,OAAO,EAAE,IAAI,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AAA,WAAW,EAAE,4BAA4B;AACzC,QAAA,eAAe,EAAE,gCAAgC;AACjD,QAAA,WAAW,EAAE;AACd;KACF;;;;MA+GYoE,gBAAgB,CAAA;;;;;UAAhBA,gBAAgB;AAAAjF,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAhB6E,gBAAgB;AAAA5E,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA,EAAA,iCAAA;AAAAW,IAAAA,cAAA,EAAA,CAAA;MAAAC,SAAA,EAAAC,EAAA,CAAA+D;AAAA,KAAA,CAAA;AAAA9D,IAAAA,QAAA,EAAAlB;AAAA,GAAA,CAAA;;;;;;QAAhB+E,gBAAgB;AAAA5D,EAAAA,UAAA,EAAA,CAAA;UAJ5BjB,SAAS;AAACkB,IAAAA,IAAA,EAAA,CAAA;AACThB,MAAAA,QAAQ,EAAE,iCAAiC;MAC3CW,cAAc,EAAE,CAACiE,eAAe;KACjC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"accordion.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/accordion/accordion.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n input,\n ElementRef,\n inject,\n contentChildren,\n afterRenderEffect,\n signal,\n model,\n booleanAttribute,\n computed,\n WritableSignal,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n DeferredContent,\n DeferredContentAware,\n AccordionGroupPattern,\n AccordionPanelPattern,\n AccordionTriggerPattern,\n} from '@angular/aria/private';\n\n/**\n * The content panel of an accordion item that is conditionally visible.\n *\n * This directive is a container for the content that is shown or hidden. It requires\n * a `panelId` that must match the `panelId` of its corresponding `ngAccordionTrigger`.\n * The content within the panel should be provided using an `ng-template` with the\n * `ngAccordionContent` directive so that the content is not rendered on the page until the trigger\n * is expanded. It applies `role=\"region\"` for accessibility and uses the `inert` attribute to hide\n * its content from assistive technologies when not visible.\n *\n * ```html\n * <div ngAccordionPanel panelId=\"unique-id-1\">\n * <ng-template ngAccordionContent>\n * <p>This content is lazily rendered and will be shown when the panel is expanded.</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionPanel]',\n exportAs: 'ngAccordionPanel',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n 'role': 'region',\n '[attr.id]': '_pattern.id()',\n '[attr.aria-labelledby]': '_pattern.accordionTrigger()?.id()',\n '[attr.inert]': '!visible() ? true : null',\n },\n})\nexport class AccordionPanel {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware);\n\n /** A global unique identifier for the panel. */\n readonly id = input(inject(_IdGenerator).getId('ng-accordion-panel-', true));\n\n /** A local unique identifier for the panel, used to match with its trigger's `panelId`. */\n readonly panelId = input.required<string>();\n\n /** Whether the accordion panel is visible. True if the associated trigger is expanded. */\n readonly visible = computed(() => !this._pattern.hidden());\n\n /** The parent accordion trigger pattern that controls this panel. This is set by AccordionGroup. */\n readonly _accordionTriggerPattern: WritableSignal<AccordionTriggerPattern | undefined> =\n signal(undefined);\n\n /** The UI pattern instance for this panel. */\n readonly _pattern: AccordionPanelPattern = new AccordionPanelPattern({\n id: this.id,\n panelId: this.panelId,\n accordionTrigger: () => this._accordionTriggerPattern(),\n });\n\n constructor() {\n // Connect the panel's hidden state to the DeferredContentAware's visibility.\n afterRenderEffect(() => {\n this._deferredContentAware.contentVisible.set(this.visible());\n });\n }\n\n /** Expands this item. */\n expand() {\n this._accordionTriggerPattern()?.open();\n }\n\n /** Collapses this item. */\n collapse() {\n this._accordionTriggerPattern()?.close();\n }\n\n /** Toggles the expansion state of this item. */\n toggle() {\n this._accordionTriggerPattern()?.toggle();\n }\n}\n\n/**\n * The trigger that toggles the visibility of its associated `ngAccordionPanel`.\n *\n * This directive requires a `panelId` that must match the `panelId` of the `ngAccordionPanel` it\n * controls. When clicked, it will expand or collapse the panel. It also handles keyboard\n * interactions for navigation within the `ngAccordionGroup`. It applies `role=\"button\"` and manages\n * `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.\n * The `disabled` input can be used to disable the trigger.\n *\n * ```html\n * <button ngAccordionTrigger panelId=\"unique-id-1\">\n * Accordion Trigger Text\n * </button>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionTrigger]',\n exportAs: 'ngAccordionTrigger',\n host: {\n '[attr.data-active]': 'active()',\n 'role': 'button',\n '[id]': '_pattern.id()',\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': '_pattern.controls()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.disabled]': '_pattern.hardDisabled() ? true : null',\n '[attr.tabindex]': '_pattern.tabIndex()',\n },\n})\nexport class AccordionTrigger {\n /** A reference to the trigger element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the trigger element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The parent AccordionGroup. */\n private readonly _accordionGroup = inject(AccordionGroup);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-accordion-trigger-', true));\n\n /** A local unique identifier for the trigger, used to match with its panel's `panelId`. */\n readonly panelId = input.required<string>();\n\n /** Whether the trigger is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the corresponding panel is expanded. */\n readonly expanded = model<boolean>(false);\n\n /** Whether the trigger is active. */\n readonly active = computed(() => this._pattern.active());\n\n /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */\n readonly _accordionPanelPattern: WritableSignal<AccordionPanelPattern | undefined> =\n signal(undefined);\n\n /** The UI pattern instance for this trigger. */\n readonly _pattern: AccordionTriggerPattern = new AccordionTriggerPattern({\n ...this,\n accordionGroup: computed(() => this._accordionGroup._pattern),\n accordionPanel: this._accordionPanelPattern,\n element: () => this.element,\n });\n\n /** Expands this item. */\n expand() {\n this._pattern.open();\n }\n\n /** Collapses this item. */\n collapse() {\n this._pattern.close();\n }\n\n /** Toggles the expansion state of this item. */\n toggle() {\n this._pattern.toggle();\n }\n}\n\n/**\n * A container for a group of accordion items. It manages the overall state and\n * interactions of the accordion, such as keyboard navigation and expansion mode.\n *\n * The `ngAccordionGroup` serves as the root of a group of accordion triggers and panels,\n * coordinating the behavior of the `ngAccordionTrigger` and `ngAccordionPanel` elements within it.\n * It supports both single and multiple expansion modes.\n *\n * ```html\n * <div ngAccordionGroup [multiExpandable]=\"true\" [(expandedPanels)]=\"expandedItems\">\n * <div class=\"accordion-item\">\n * <h3>\n * <button ngAccordionTrigger panelId=\"item-1\">Item 1</button>\n * </h3>\n * <div ngAccordionPanel panelId=\"item-1\">\n * <ng-template ngAccordionContent>\n * <p>Content for Item 1.</p>\n * </ng-template>\n * </div>\n * </div>\n * <div class=\"accordion-item\">\n * <h3>\n * <button ngAccordionTrigger panelId=\"item-2\">Item 2</button>\n * </h3>\n * <div ngAccordionPanel panelId=\"item-2\">\n * <ng-template ngAccordionContent>\n * <p>Content for Item 2.</p>\n * </ng-template>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngAccordionGroup]',\n exportAs: 'ngAccordionGroup',\n host: {\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(focusin)': '_pattern.onFocus($event)',\n },\n})\nexport class AccordionGroup {\n /** A reference to the group element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the group element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The AccordionTriggers nested inside this group. */\n private readonly _triggers = contentChildren(AccordionTrigger, {descendants: true});\n\n /** The AccordionTrigger patterns nested inside this group. */\n private readonly _triggerPatterns = computed(() => this._triggers().map(t => t._pattern));\n\n /** The AccordionPanels nested inside this group. */\n private readonly _panels = contentChildren(AccordionPanel, {descendants: true});\n\n /** The text direction (ltr or rtl). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether the entire accordion group is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether multiple accordion items can be expanded simultaneously. */\n readonly multiExpandable = input(true, {transform: booleanAttribute});\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /** Whether keyboard navigation should wrap around from the last item to the first, and vice-versa. */\n readonly wrap = input(false, {transform: booleanAttribute});\n\n /** The UI pattern instance for this accordion group. */\n readonly _pattern: AccordionGroupPattern = new AccordionGroupPattern({\n ...this,\n activeItem: signal(undefined),\n items: this._triggerPatterns,\n // TODO(ok7sai): Investigate whether an accordion should support horizontal mode.\n orientation: () => 'vertical',\n getItem: e => this._getItem(e),\n element: () => this.element,\n });\n\n constructor() {\n // Effect to link triggers with their corresponding panels and update the group's items.\n afterRenderEffect(() => {\n const triggers = this._triggers();\n const panels = this._panels();\n\n for (const trigger of triggers) {\n const panel = panels.find(p => p.panelId() === trigger.panelId());\n trigger._accordionPanelPattern.set(panel?._pattern);\n if (panel) {\n panel._accordionTriggerPattern.set(trigger._pattern);\n }\n }\n });\n }\n\n /** Expands all accordion panels if multi-expandable. */\n expandAll() {\n this._pattern.expansionBehavior.openAll();\n }\n\n /** Collapses all accordion panels. */\n collapseAll() {\n this._pattern.expansionBehavior.closeAll();\n }\n\n /** Gets the trigger pattern for a given element. */\n private _getItem(element: Element | null | undefined): AccordionTriggerPattern | undefined {\n let target = element;\n\n while (target) {\n const pattern = this._triggerPatterns().find(t => t.element() === target);\n if (pattern) {\n return pattern;\n }\n\n target = target.parentElement?.closest('[ngAccordionTrigger]');\n }\n\n return undefined;\n }\n}\n\n/**\n * A structural directive that provides a mechanism for lazily rendering the content for an\n * `ngAccordionPanel`.\n *\n * This directive should be applied to an `ng-template` inside an `ngAccordionPanel`.\n * It allows the content of the panel to be lazily rendered, improving performance\n * by only creating the content when the panel is first expanded.\n *\n * ```html\n * <div ngAccordionPanel panelId=\"unique-id-1\">\n * <ng-template ngAccordionContent>\n * <p>This is the content that will be displayed inside the panel.</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngAccordionContent]',\n hostDirectives: [DeferredContent],\n})\nexport class AccordionContent {}\n"],"names":["AccordionPanel","_deferredContentAware","inject","DeferredContentAware","id","input","_IdGenerator","getId","panelId","required","visible","computed","_pattern","hidden","_accordionTriggerPattern","signal","undefined","AccordionPanelPattern","accordionTrigger","constructor","afterRenderEffect","contentVisible","set","expand","open","collapse","close","toggle","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","host","attributes","properties","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","AccordionTrigger","_elementRef","ElementRef","element","nativeElement","_accordionGroup","AccordionGroup","disabled","transform","booleanAttribute","expanded","model","active","_accordionPanelPattern","AccordionTriggerPattern","accordionGroup","accordionPanel","outputs","_triggers","contentChildren","descendants","_triggerPatterns","map","t","ngDevMode","debugName","_panels","textDirection","Directionality","valueSignal","multiExpandable","softDisabled","wrap","AccordionGroupPattern","activeItem","items","orientation","getItem","e","_getItem","triggers","panels","trigger","panel","find","p","expandAll","expansionBehavior","openAll","collapseAll","closeAll","pattern","parentElement","closest","listeners","queries","propertyName","predicate","AccordionContent","DeferredContent"],"mappings":";;;;;;;MAmEaA,cAAc,CAAA;AAERC,EAAAA,qBAAqB,GAAGC,MAAM,CAACC,oBAAoB,CAAC;AAG5DC,EAAAA,EAAE,GAAGC,KAAK,CAACH,MAAM,CAACI,YAAY,CAAC,CAACC,KAAK,CAAC,qBA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;AAAAjC,MAAAA,QAAA,EAAA;AAAA,KAAA,CAAA;IAAAM,QAAA,EAAA,CAAA,kBAAA,CAAA;AAAAI,IAAAA,QAAA,EAAAlB;AAAA,GAAA,CAAA;;;;;;QAd9C2B,cAAc;AAAAR,EAAAA,UAAA,EAAA,CAAA;UAT1BjB,SAAS;AAACkB,IAAAA,IAAA,EAAA,CAAA;AACThB,MAAAA,QAAQ,EAAE,oBAAoB;AAC9BU,MAAAA,QAAQ,EAAE,kBAAkB;AAC5BH,MAAAA,IAAI,EAAE;AACJ,QAAA,WAAW,EAAE,4BAA4B;AACzC,QAAA,eAAe,EAAE,gCAAgC;AACjD,QAAA,WAAW,EAAE;AACd;KACF;;;;MA+GYoE,gBAAgB,CAAA;;;;;UAAhBA,gBAAgB;AAAAjF,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAhB6E,gBAAgB;AAAA5E,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA,EAAA,iCAAA;AAAAW,IAAAA,cAAA,EAAA,CAAA;MAAAC,SAAA,EAAAC,EAAA,CAAA+D;AAAA,KAAA,CAAA;AAAA9D,IAAAA,QAAA,EAAAlB;AAAA,GAAA,CAAA;;;;;;QAAhB+E,gBAAgB;AAAA5D,EAAAA,UAAA,EAAA,CAAA;UAJ5BjB,SAAS;AAACkB,IAAAA,IAAA,EAAA,CAAA;AACThB,MAAAA,QAAQ,EAAE,iCAAiC;MAC3CW,cAAc,EAAE,CAACiE,eAAe;KACjC;;;;;;"}
|
package/fesm2022/aria.mjs
CHANGED
package/fesm2022/aria.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aria.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"aria.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the CDK Experimental package. */\nexport const VERSION = new Version('21.0.0-rc.3');\n"],"names":["VERSION","Version"],"mappings":";;MAWaA,OAAO,GAAG,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
|
package/fesm2022/combobox.mjs
CHANGED
|
@@ -56,7 +56,7 @@ class Combobox {
|
|
|
56
56
|
inputValue: signal(''),
|
|
57
57
|
inputEl: signal(undefined),
|
|
58
58
|
containerEl: () => this._elementRef.nativeElement,
|
|
59
|
-
popupControls: () => this.popup()?.
|
|
59
|
+
popupControls: () => this.popup()?._controls()
|
|
60
60
|
});
|
|
61
61
|
constructor() {
|
|
62
62
|
afterRenderEffect(() => {
|
|
@@ -78,12 +78,6 @@ class Combobox {
|
|
|
78
78
|
close() {
|
|
79
79
|
this._pattern.close();
|
|
80
80
|
}
|
|
81
|
-
expand() {
|
|
82
|
-
this._pattern.open();
|
|
83
|
-
}
|
|
84
|
-
collapse() {
|
|
85
|
-
this._pattern.close();
|
|
86
|
-
}
|
|
87
81
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
88
82
|
minVersion: "12.0.0",
|
|
89
83
|
version: "20.2.0-next.2",
|
|
@@ -198,7 +192,7 @@ class ComboboxInput {
|
|
|
198
192
|
constructor() {
|
|
199
193
|
this.combobox._pattern.inputs.inputEl.set(this._elementRef.nativeElement);
|
|
200
194
|
this.combobox._pattern.inputs.inputValue = this.value;
|
|
201
|
-
const controls = this.combobox.popup()?.
|
|
195
|
+
const controls = this.combobox.popup()?._controls();
|
|
202
196
|
if (controls instanceof ComboboxDialogPattern) {
|
|
203
197
|
return;
|
|
204
198
|
}
|
|
@@ -318,8 +312,8 @@ class ComboboxPopup {
|
|
|
318
312
|
combobox = inject(Combobox, {
|
|
319
313
|
optional: true
|
|
320
314
|
});
|
|
321
|
-
|
|
322
|
-
debugName: "
|
|
315
|
+
_controls = signal(undefined, ...(ngDevMode ? [{
|
|
316
|
+
debugName: "_controls"
|
|
323
317
|
}] : []));
|
|
324
318
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
325
319
|
minVersion: "12.0.0",
|
|
@@ -367,7 +361,7 @@ class ComboboxDialog {
|
|
|
367
361
|
combobox: this.combobox._pattern
|
|
368
362
|
});
|
|
369
363
|
if (this._popup) {
|
|
370
|
-
this._popup.
|
|
364
|
+
this._popup._controls.set(this._pattern);
|
|
371
365
|
}
|
|
372
366
|
afterRenderEffect(() => {
|
|
373
367
|
if (this._elementRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/combobox/combobox.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n signal,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {\n DeferredContent,\n DeferredContentAware,\n ComboboxPattern,\n ComboboxListboxControls,\n ComboboxTreeControls,\n ComboboxDialogPattern,\n} from '@angular/aria/private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\n\n/**\n * The container element that wraps a combobox input and popup, and orchestrates its behavior.\n *\n * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its\n * behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which\n * is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the\n * `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.\n *\n * ```html\n * <div ngCombobox filterMode=\"highlight\">\n * <input\n * ngComboboxInput\n * placeholder=\"Search for a state...\"\n * [(value)]=\"searchString\"\n * />\n *\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * @for (option of filteredOptions(); track option) {\n * <div ngOption [value]=\"option\" [label]=\"option\">\n * <span>{{option}}</span>\n * </div>\n * }\n * </div>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngCombobox]',\n exportAs: 'ngCombobox',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n '[attr.data-expanded]': 'expanded()',\n '(input)': '_pattern.onInput($event)',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class Combobox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the combobox element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n\n /** The combobox popup. */\n readonly popup = contentChild<ComboboxPopup<V>>(ComboboxPopup);\n\n /**\n * The filter mode for the combobox.\n * - `manual`: The consumer is responsible for filtering the options.\n * - `auto-select`: The combobox automatically selects the first matching option.\n * - `highlight`: The combobox highlights matching text in the options without changing selection.\n */\n filterMode = input<'manual' | 'auto-select' | 'highlight'>('manual');\n\n /** Whether the combobox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox is read-only. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the first matching item in the popup. */\n readonly firstMatch = input<V | undefined>(undefined);\n\n /** Whether the combobox is expanded. */\n readonly expanded = computed(() => this.alwaysExpanded() || this._pattern.expanded());\n\n // TODO: Maybe make expanded a signal that can be passed in?\n // Or an \"always expanded\" option?\n\n /** Whether the combobox popup should always be expanded, regardless of user interaction. */\n readonly alwaysExpanded = input(false, {transform: booleanAttribute});\n\n /** Input element connected to the combobox, if any. */\n readonly inputElement = computed(() => this._pattern.inputs.inputEl());\n\n /** The combobox ui pattern. */\n readonly _pattern = new ComboboxPattern<any, V>({\n ...this,\n textDirection: this.textDirection,\n disabled: this.disabled,\n readonly: this.readonly,\n inputValue: signal(''),\n inputEl: signal(undefined),\n containerEl: () => this._elementRef.nativeElement,\n popupControls: () => this.popup()?.controls(),\n });\n\n constructor() {\n afterRenderEffect(() => {\n if (this.alwaysExpanded()) {\n this._pattern.expanded.set(true);\n }\n });\n\n afterRenderEffect(() => {\n if (\n !this._deferredContentAware?.contentVisible() &&\n (this._pattern.isFocused() || this.alwaysExpanded())\n ) {\n this._deferredContentAware?.contentVisible.set(true);\n }\n });\n }\n\n /** Opens the combobox to the selected item. */\n open() {\n this._pattern.open({selected: true});\n }\n\n /** Closes the combobox. */\n close() {\n this._pattern.close();\n }\n\n /** Expands the combobox popup. */\n expand() {\n this._pattern.open();\n }\n\n /** Collapses the combobox popup. */\n collapse() {\n this._pattern.close();\n }\n}\n\n/**\n * An input that is part of a combobox. It is responsible for displaying the\n * current value and handling user input for filtering and selection.\n *\n * This directive should be applied to an `<input>` element within an `ngCombobox`\n * container. It automatically handles keyboard interactions, such as opening the\n * popup and navigating through the options.\n *\n * ```html\n * <input\n * ngComboboxInput\n * placeholder=\"Search...\"\n * [(value)]=\"searchString\"\n * />\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'input[ngComboboxInput]',\n exportAs: 'ngComboboxInput',\n host: {\n 'role': 'combobox',\n '[value]': 'value()',\n '[attr.aria-disabled]': 'combobox._pattern.disabled()',\n '[attr.aria-expanded]': 'combobox._pattern.expanded()',\n '[attr.aria-activedescendant]': 'combobox._pattern.activeDescendant()',\n '[attr.aria-controls]': 'combobox._pattern.popupId()',\n '[attr.aria-haspopup]': 'combobox._pattern.hasPopup()',\n '[attr.aria-autocomplete]': 'combobox._pattern.autocomplete()',\n '[attr.readonly]': 'combobox._pattern.readonly()',\n },\n})\nexport class ComboboxInput {\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n /** A reference to the input element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the input belongs to. */\n readonly combobox = inject(Combobox);\n\n /** The value of the input. */\n value = model<string>('');\n\n constructor() {\n (this.combobox._pattern.inputs.inputEl as WritableSignal<HTMLInputElement>).set(\n this._elementRef.nativeElement,\n );\n this.combobox._pattern.inputs.inputValue = this.value;\n\n const controls = this.combobox.popup()?.controls();\n if (controls instanceof ComboboxDialogPattern) {\n return;\n }\n\n /** Focuses & selects the first item in the combobox if the user changes the input value. */\n afterRenderEffect(() => {\n this.value();\n controls?.items();\n untracked(() => this.combobox._pattern.onFilter());\n });\n }\n}\n\n/**\n * A structural directive that marks the `ng-template` to be used as the popup\n * for a combobox. This content is conditionally rendered.\n *\n * The content of the popup can be a `ngListbox`, `ngTree`, or `role=\"dialog\"`, allowing for\n * flexible and complex combobox implementations. The consumer is responsible for\n * implementing the filtering logic based on the `ngComboboxInput`'s value.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * When using CdkOverlay, this directive can be replaced by `cdkConnectedOverlay`.\n *\n * ```html\n * <ng-template\n * [cdkConnectedOverlay]=\"{origin: inputElement, usePopover: 'inline' matchWidth: true}\"\n * [cdkConnectedOverlayOpen]=\"combobox.expanded()\">\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngComboboxPopupContainer]',\n exportAs: 'ngComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class ComboboxPopupContainer {}\n\n/**\n * Identifies an element as a popup for an `ngCombobox`.\n *\n * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact\n * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that\n * manages the options. It's primarily used as a host directive and is responsible for\n * exposing the popup's control pattern to the parent combobox.\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n})\nexport class ComboboxPopup<V> {\n /** The combobox that the popup belongs to. */\n readonly combobox = inject<Combobox<V>>(Combobox, {optional: true});\n\n /** The popup controls exposed to the combobox. */\n readonly controls = signal<\n | ComboboxListboxControls<any, V>\n | ComboboxTreeControls<any, V>\n | ComboboxDialogPattern\n | undefined\n >(undefined);\n}\n\n/**\n * Integrates a native `<dialog>` element with the combobox, allowing for\n * a modal or non-modal popup experience. It handles the opening and closing of the dialog\n * based on the combobox's expanded state.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <dialog ngComboboxDialog class=\"example-dialog\">\n * <!-- ... dialog content ... -->\n * </dialog>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'dialog[ngComboboxDialog]',\n exportAs: 'ngComboboxDialog',\n host: {\n '[attr.data-open]': 'combobox._pattern.expanded()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n },\n hostDirectives: [ComboboxPopup],\n})\nexport class ComboboxDialog {\n /** The dialog element. */\n private readonly _elementRef = inject(ElementRef<HTMLDialogElement>);\n\n /** A reference to the dialog element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the dialog belongs to. */\n readonly combobox = inject(Combobox);\n\n /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<unknown>>(ComboboxPopup, {\n optional: true,\n });\n\n _pattern: ComboboxDialogPattern;\n\n constructor() {\n this._pattern = new ComboboxDialogPattern({\n id: () => '',\n element: () => this._elementRef.nativeElement,\n combobox: this.combobox._pattern,\n });\n\n if (this._popup) {\n this._popup.controls.set(this._pattern);\n }\n\n afterRenderEffect(() => {\n if (this._elementRef) {\n this.combobox._pattern.expanded()\n ? this._elementRef.nativeElement.showModal()\n : this._elementRef.nativeElement.close();\n }\n });\n }\n\n close() {\n this._popup?.combobox?._pattern.close();\n }\n}\n"],"names":["Combobox","_directionality","inject","Directionality","textDirection","toSignal","change","initialValue","value","_elementRef","ElementRef","element","nativeElement","_deferredContentAware","DeferredContentAware","optional","popup","contentChild","ComboboxPopup","filterMode","input","disabled","transform","booleanAttribute","readonly","firstMatch","undefined","expanded","computed","alwaysExpanded","_pattern","inputElement","inputs","inputEl","ComboboxPattern","inputValue","signal","containerEl","popupControls","controls","constructor","afterRenderEffect","set","contentVisible","isFocused","open","selected","close","expand","collapse","deps","target","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","descendants","isSignal","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","selector","host","ComboboxInput","combobox","model","ComboboxDialogPattern","items","untracked","onFilter","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","attributes","properties","ComboboxPopupContainer","DeferredContent","ComboboxDialog","_popup","id","showModal"],"mappings":";;;;;;;MAiFaA,QAAQ,CAAA;AAEFC,EAAAA,eAAe,GAAGC,MAAM,CAACC,cAAc,CAAC;EAG/CC,aAAa,GAAGC,QAAQ,CAAC,IAAI,CAACJ,eAAe,CAACK,MAAM,EAAE;AAC9DC,IAAAA,YAAY,EAAE,IAAI,CAACN,eAAe,CAACO;AACpC,GAAA,CAAC;AAGeC,EAAAA,WAAW,GAAGP,MAAM,CAACQ,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAA4B;AAG/CC,EAAAA,qBAAqB,GAAGX,MAAM,CAACY,oBAAoB,EAAE;AAACC,IAAAA,QAAQ,EAAE;AAAK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C,QAAA,SAAS,EAAE;OACZ;MACDP,cAAc,EAAE,CAAC7C,aAAa;KAC/B;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"combobox.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/combobox/combobox.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChild,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n signal,\n untracked,\n WritableSignal,\n} from '@angular/core';\nimport {\n DeferredContent,\n DeferredContentAware,\n ComboboxPattern,\n ComboboxListboxControls,\n ComboboxTreeControls,\n ComboboxDialogPattern,\n} from '@angular/aria/private';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {toSignal} from '@angular/core/rxjs-interop';\n\n/**\n * The container element that wraps a combobox input and popup, and orchestrates its behavior.\n *\n * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its\n * behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which\n * is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the\n * `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.\n *\n * ```html\n * <div ngCombobox filterMode=\"highlight\">\n * <input\n * ngComboboxInput\n * placeholder=\"Search for a state...\"\n * [(value)]=\"searchString\"\n * />\n *\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * @for (option of filteredOptions(); track option) {\n * <div ngOption [value]=\"option\" [label]=\"option\">\n * <span>{{option}}</span>\n * </div>\n * }\n * </div>\n * </ng-template>\n * </div>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngCombobox]',\n exportAs: 'ngCombobox',\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n host: {\n '[attr.data-expanded]': 'expanded()',\n '(input)': '_pattern.onInput($event)',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class Combobox<V> {\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n protected textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the combobox element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n\n /** The combobox popup. */\n readonly popup = contentChild<ComboboxPopup<V>>(ComboboxPopup);\n\n /**\n * The filter mode for the combobox.\n * - `manual`: The consumer is responsible for filtering the options.\n * - `auto-select`: The combobox automatically selects the first matching option.\n * - `highlight`: The combobox highlights matching text in the options without changing selection.\n */\n filterMode = input<'manual' | 'auto-select' | 'highlight'>('manual');\n\n /** Whether the combobox is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the combobox is read-only. */\n readonly readonly = input(false, {transform: booleanAttribute});\n\n /** The value of the first matching item in the popup. */\n readonly firstMatch = input<V | undefined>(undefined);\n\n /** Whether the combobox is expanded. */\n readonly expanded = computed(() => this.alwaysExpanded() || this._pattern.expanded());\n\n // TODO: Maybe make expanded a signal that can be passed in?\n // Or an \"always expanded\" option?\n\n /** Whether the combobox popup should always be expanded, regardless of user interaction. */\n readonly alwaysExpanded = input(false, {transform: booleanAttribute});\n\n /** Input element connected to the combobox, if any. */\n readonly inputElement = computed(() => this._pattern.inputs.inputEl());\n\n /** The combobox ui pattern. */\n readonly _pattern = new ComboboxPattern<any, V>({\n ...this,\n textDirection: this.textDirection,\n disabled: this.disabled,\n readonly: this.readonly,\n inputValue: signal(''),\n inputEl: signal(undefined),\n containerEl: () => this._elementRef.nativeElement,\n popupControls: () => this.popup()?._controls(),\n });\n\n constructor() {\n afterRenderEffect(() => {\n if (this.alwaysExpanded()) {\n this._pattern.expanded.set(true);\n }\n });\n\n afterRenderEffect(() => {\n if (\n !this._deferredContentAware?.contentVisible() &&\n (this._pattern.isFocused() || this.alwaysExpanded())\n ) {\n this._deferredContentAware?.contentVisible.set(true);\n }\n });\n }\n\n /** Opens the combobox to the selected item. */\n open() {\n this._pattern.open({selected: true});\n }\n\n /** Closes the combobox. */\n close() {\n this._pattern.close();\n }\n}\n\n/**\n * An input that is part of a combobox. It is responsible for displaying the\n * current value and handling user input for filtering and selection.\n *\n * This directive should be applied to an `<input>` element within an `ngCombobox`\n * container. It automatically handles keyboard interactions, such as opening the\n * popup and navigating through the options.\n *\n * ```html\n * <input\n * ngComboboxInput\n * placeholder=\"Search...\"\n * [(value)]=\"searchString\"\n * />\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'input[ngComboboxInput]',\n exportAs: 'ngComboboxInput',\n host: {\n 'role': 'combobox',\n '[value]': 'value()',\n '[attr.aria-disabled]': 'combobox._pattern.disabled()',\n '[attr.aria-expanded]': 'combobox._pattern.expanded()',\n '[attr.aria-activedescendant]': 'combobox._pattern.activeDescendant()',\n '[attr.aria-controls]': 'combobox._pattern.popupId()',\n '[attr.aria-haspopup]': 'combobox._pattern.hasPopup()',\n '[attr.aria-autocomplete]': 'combobox._pattern.autocomplete()',\n '[attr.readonly]': 'combobox._pattern.readonly()',\n },\n})\nexport class ComboboxInput {\n /** The element that the combobox is attached to. */\n private readonly _elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n /** A reference to the input element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the input belongs to. */\n readonly combobox = inject(Combobox);\n\n /** The value of the input. */\n value = model<string>('');\n\n constructor() {\n (this.combobox._pattern.inputs.inputEl as WritableSignal<HTMLInputElement>).set(\n this._elementRef.nativeElement,\n );\n this.combobox._pattern.inputs.inputValue = this.value;\n\n const controls = this.combobox.popup()?._controls();\n if (controls instanceof ComboboxDialogPattern) {\n return;\n }\n\n /** Focuses & selects the first item in the combobox if the user changes the input value. */\n afterRenderEffect(() => {\n this.value();\n controls?.items();\n untracked(() => this.combobox._pattern.onFilter());\n });\n }\n}\n\n/**\n * A structural directive that marks the `ng-template` to be used as the popup\n * for a combobox. This content is conditionally rendered.\n *\n * The content of the popup can be a `ngListbox`, `ngTree`, or `role=\"dialog\"`, allowing for\n * flexible and complex combobox implementations. The consumer is responsible for\n * implementing the filtering logic based on the `ngComboboxInput`'s value.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * When using CdkOverlay, this directive can be replaced by `cdkConnectedOverlay`.\n *\n * ```html\n * <ng-template\n * [cdkConnectedOverlay]=\"{origin: inputElement, usePopover: 'inline' matchWidth: true}\"\n * [cdkConnectedOverlayOpen]=\"combobox.expanded()\">\n * <div ngListbox [(value)]=\"selectedValue\">\n * <!-- ... options ... -->\n * </div>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'ng-template[ngComboboxPopupContainer]',\n exportAs: 'ngComboboxPopupContainer',\n hostDirectives: [DeferredContent],\n})\nexport class ComboboxPopupContainer {}\n\n/**\n * Identifies an element as a popup for an `ngCombobox`.\n *\n * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact\n * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that\n * manages the options. It's primarily used as a host directive and is responsible for\n * exposing the popup's control pattern to the parent combobox.\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngComboboxPopup]',\n exportAs: 'ngComboboxPopup',\n})\nexport class ComboboxPopup<V> {\n /** The combobox that the popup belongs to. */\n readonly combobox = inject<Combobox<V>>(Combobox, {optional: true});\n\n /** The popup controls exposed to the combobox. */\n readonly _controls = signal<\n | ComboboxListboxControls<any, V>\n | ComboboxTreeControls<any, V>\n | ComboboxDialogPattern\n | undefined\n >(undefined);\n}\n\n/**\n * Integrates a native `<dialog>` element with the combobox, allowing for\n * a modal or non-modal popup experience. It handles the opening and closing of the dialog\n * based on the combobox's expanded state.\n *\n * ```html\n * <ng-template ngComboboxPopupContainer>\n * <dialog ngComboboxDialog class=\"example-dialog\">\n * <!-- ... dialog content ... -->\n * </dialog>\n * </ng-template>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: 'dialog[ngComboboxDialog]',\n exportAs: 'ngComboboxDialog',\n host: {\n '[attr.data-open]': 'combobox._pattern.expanded()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(click)': '_pattern.onClick($event)',\n },\n hostDirectives: [ComboboxPopup],\n})\nexport class ComboboxDialog {\n /** The dialog element. */\n private readonly _elementRef = inject(ElementRef<HTMLDialogElement>);\n\n /** A reference to the dialog element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The combobox that the dialog belongs to. */\n readonly combobox = inject(Combobox);\n\n /** A reference to the parent combobox popup, if one exists. */\n private readonly _popup = inject<ComboboxPopup<unknown>>(ComboboxPopup, {\n optional: true,\n });\n\n _pattern: ComboboxDialogPattern;\n\n constructor() {\n this._pattern = new ComboboxDialogPattern({\n id: () => '',\n element: () => this._elementRef.nativeElement,\n combobox: this.combobox._pattern,\n });\n\n if (this._popup) {\n this._popup._controls.set(this._pattern);\n }\n\n afterRenderEffect(() => {\n if (this._elementRef) {\n this.combobox._pattern.expanded()\n ? this._elementRef.nativeElement.showModal()\n : this._elementRef.nativeElement.close();\n }\n });\n }\n\n close() {\n this._popup?.combobox?._pattern.close();\n }\n}\n"],"names":["Combobox","_directionality","inject","Directionality","textDirection","toSignal","change","initialValue","value","_elementRef","ElementRef","element","nativeElement","_deferredContentAware","DeferredContentAware","optional","popup","contentChild","ComboboxPopup","filterMode","input","disabled","transform","booleanAttribute","readonly","firstMatch","undefined","expanded","computed","alwaysExpanded","_pattern","inputElement","inputs","inputEl","ComboboxPattern","inputValue","signal","containerEl","popupControls","_controls","constructor","afterRenderEffect","set","contentVisible","isFocused","open","selected","close","deps","target","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","descendants","isSignal","exportAs","hostDirectives","directive","i1","ngImport","decorators","args","selector","host","ComboboxInput","combobox","model","controls","ComboboxDialogPattern","items","untracked","onFilter","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","attributes","properties","ComboboxPopupContainer","DeferredContent","ComboboxDialog","_popup","id","showModal"],"mappings":";;;;;;;MAiFaA,QAAQ,CAAA;AAEFC,EAAAA,eAAe,GAAGC,MAAM,CAACC,cAAc,CAAC;EAG/CC,aAAa,GAAGC,QAAQ,CAAC,IAAI,CAACJ,eAAe,CAACK,MAAM,EAAE;AAC9DC,IAAAA,YAAY,EAAE,IAAI,CAACN,eAAe,CAACO;AACpC,GAAA,CAAC;AAGeC,EAAAA,WAAW,GAAGP,MAAM,CAACQ,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACF,WAAW,CAACG,aAA4B;AAG/CC,EAAAA,qBAAqB,GAAGX,MAAM,CAACY,oBAAoB,EAAE;AAACC,IAAAA,QAAQ,EAAE;AAAK,GAAA,CAAC;EAG9EC,KAAK,GAAGC,YAAY,CAAmBC,aAAa;;WAAC;EAQ9DC,UAAU,GAAGC,KAAK,CAAyC,QAAQ;;WAAC;EAG3DC,QAAQ,GAAGD,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,CAA5B;AAACD,IAAAA,SAAS,EAAEC;GAAiB,GAAC;EAGtDC,QAAQ,GAAGJ,KAAK,CAAC,KAAK;;AAAGE,IAAAA,SAAS,EAAEC;GAAgB,CAAA,GAAA,CAA5B;AAACD,IAAAA,SAAS,EAAEC;GAAiB,GAAC;EAGtDE,UAAU,GAAGL,KAAK,CAAgBM,SAAS;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vC,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;AAAd,EAAA,OAAAC,IAAA,GAAAH,EAAA,CAAAI,oBAAA,CAAA;AAAAC,IAAAA,UAAA,EAAA,QAAA;AAAAC,IAAAA,OAAA,EAAA,eAAA;AAAAC,IAAAA,IAAA,EAAA8B,cAAc;;;;;;;;;;;;;;iBAtCdrE;AAAa,KAAA,CAAA;AAAA8C,IAAAA,QAAA,EAAAd;AAAA,GAAA,CAAA;;;;;;QAsCbqC,cAAc;AAAAtB,EAAAA,UAAA,EAAA,CAAA;UAV1Bb,SAAS;AAACc,IAAAA,IAAA,EAAA,CAAA;AACTC,MAAAA,QAAQ,EAAE,0BAA0B;AACpCP,MAAAA,QAAQ,EAAE,kBAAkB;AAC5BQ,MAAAA,IAAI,EAAE;AACJ,QAAA,kBAAkB,EAAE,8BAA8B;AAClD,QAAA,WAAW,EAAE,4BAA4B;AACzC,QAAA,SAAS,EAAE;OACZ;MACDP,cAAc,EAAE,CAAC3C,aAAa;KAC/B;;;;;;;"}
|
package/fesm2022/grid.mjs
CHANGED
|
@@ -234,15 +234,16 @@ class GridRow {
|
|
|
234
234
|
debugName: "_cellPatterns"
|
|
235
235
|
}] : []));
|
|
236
236
|
_grid = inject(Grid);
|
|
237
|
-
|
|
238
|
-
debugName: "
|
|
237
|
+
_gridPattern = computed(() => this._grid._pattern, ...(ngDevMode ? [{
|
|
238
|
+
debugName: "_gridPattern"
|
|
239
239
|
}] : []));
|
|
240
240
|
rowIndex = input(...(ngDevMode ? [undefined, {
|
|
241
241
|
debugName: "rowIndex"
|
|
242
242
|
}] : []));
|
|
243
243
|
_pattern = new GridRowPattern({
|
|
244
244
|
...this,
|
|
245
|
-
cells: this._cellPatterns
|
|
245
|
+
cells: this._cellPatterns,
|
|
246
|
+
grid: this._gridPattern
|
|
246
247
|
});
|
|
247
248
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
248
249
|
minVersion: "12.0.0",
|
|
@@ -368,7 +369,7 @@ class GridCell {
|
|
|
368
369
|
}] : []));
|
|
369
370
|
_pattern = new GridCellPattern({
|
|
370
371
|
...this,
|
|
371
|
-
grid: this._row.
|
|
372
|
+
grid: this._row._gridPattern,
|
|
372
373
|
row: () => this._row._pattern,
|
|
373
374
|
widgets: this._widgetPatterns,
|
|
374
375
|
getWidget: e => this._getWidget(e),
|
package/fesm2022/grid.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/grid/grid.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n model,\n Signal,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {GridPattern, GridRowPattern, GridCellPattern, GridCellWidgetPattern} from '../private';\n\n/**\n * The container for a grid. It provides keyboard navigation and focus management for the grid's\n * rows and cells. It manages the overall behavior of the grid, including focus\n * wrapping, selection, and disabled states.\n *\n * ```html\n * <table ngGrid [multi]=\"true\" [enableSelection]=\"true\">\n * @for (row of gridData; track row) {\n * <tr ngGridRow>\n * @for (cell of row; track cell) {\n * <td ngGridCell [disabled]=\"cell.disabled\">\n * {{cell.value}}\n * </td>\n * }\n * </tr>\n * }\n * </table>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGrid]',\n exportAs: 'ngGrid',\n host: {\n 'class': 'grid',\n 'role': 'grid',\n '[tabindex]': '_pattern.tabIndex()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(pointermove)': '_pattern.onPointermove($event)',\n '(pointerup)': '_pattern.onPointerup($event)',\n '(focusin)': '_pattern.onFocusIn($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class Grid {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The rows that make up the grid. */\n private readonly _rows = contentChildren(GridRow, {descendants: true});\n\n /** The UI patterns for the rows in the grid. */\n private readonly _rowPatterns: Signal<GridRowPattern[]> = computed(() =>\n this._rows().map(r => r._pattern),\n );\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether selection is enabled for the grid. */\n readonly enableSelection = input(false, {transform: booleanAttribute});\n\n /** Whether the grid is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /**\n * The focus strategy used by the grid.\n * - `roving`: Focus is moved to the active cell using `tabindex`.\n * - `activedescendant`: Focus remains on the grid container, and `aria-activedescendant` is used to indicate the active cell.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /**\n * The wrapping behavior for keyboard navigation along the row axis.\n * - `continuous`: Navigation wraps from the last row to the first, and vice-versa.\n * - `loop`: Navigation wraps within the current row.\n * - `nowrap`: Navigation stops at the first/last item in the row.\n */\n readonly rowWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');\n\n /**\n * The wrapping behavior for keyboard navigation along the column axis.\n * - `continuous`: Navigation wraps from the last column to the first, and vice-versa.\n * - `loop`: Navigation wraps within the current column.\n * - `nowrap`: Navigation stops at the first/last item in the column.\n */\n readonly colWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');\n\n /** Whether multiple cells in the grid can be selected. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /**\n * The selection strategy used by the grid.\n * - `follow`: The focused cell is automatically selected.\n * - `explicit`: Cells are selected explicitly by the user (e.g., via click or spacebar).\n */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether enable range selections (with modifier keys or dragging). */\n readonly enableRangeSelection = input(false, {transform: booleanAttribute});\n\n /** The UI pattern for the grid. */\n readonly _pattern = new GridPattern({\n ...this,\n rows: this._rowPatterns,\n getCell: e => this._getCell(e),\n element: () => this.element,\n });\n\n constructor() {\n afterRenderEffect(() => this._pattern.setDefaultStateEffect());\n afterRenderEffect(() => this._pattern.resetStateEffect());\n afterRenderEffect(() => this._pattern.resetFocusEffect());\n afterRenderEffect(() => this._pattern.restoreFocusEffect());\n afterRenderEffect(() => this._pattern.focusEffect());\n }\n\n /** Gets the cell pattern for a given element. */\n private _getCell(element: Element | null | undefined): GridCellPattern | undefined {\n let target = element;\n\n while (target) {\n for (const row of this._rowPatterns()) {\n for (const cell of row.inputs.cells()) {\n if (cell.element() === target) {\n return cell;\n }\n }\n }\n\n target = target.parentElement?.closest('[ngGridCell]');\n }\n\n return undefined;\n }\n}\n\n/**\n * Represents a row within a grid. It is a container for `ngGridCell` directives.\n *\n * ```html\n * <tr ngGridRow>\n * <!-- ... cells ... -->\n * </tr>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridRow]',\n exportAs: 'ngGridRow',\n host: {\n 'class': 'grid-row',\n 'role': 'row',\n '[attr.aria-rowindex]': '_pattern.rowIndex()',\n },\n})\nexport class GridRow {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The cells that make up this row. */\n private readonly _cells = contentChildren(GridCell, {descendants: true});\n\n /** The UI patterns for the cells in this row. */\n private readonly _cellPatterns: Signal<GridCellPattern[]> = computed(() =>\n this._cells().map(c => c._pattern),\n );\n\n /** The parent grid. */\n private readonly _grid = inject(Grid);\n\n /** The parent grid UI pattern. */\n readonly grid = computed(() => this._grid._pattern);\n\n /** The index of this row within the grid. */\n readonly rowIndex = input<number>();\n\n /** The UI pattern for the grid row. */\n readonly _pattern = new GridRowPattern({\n ...this,\n cells: this._cellPatterns,\n });\n}\n\n/**\n * Represents a cell within a grid row. It is the primary focusable element\n * within the grid. It can be disabled and can have its selection state managed\n * through the `selected` input.\n *\n * ```html\n * <td ngGridCell [disabled]=\"isDisabled\" [(selected)]=\"isSelected\">\n * Cell Content\n * </td>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridCell]',\n exportAs: 'ngGridCell',\n host: {\n 'class': 'grid-cell',\n '[attr.role]': 'role()',\n '[attr.id]': '_pattern.id()',\n '[attr.rowspan]': '_pattern.rowSpan()',\n '[attr.colspan]': '_pattern.colSpan()',\n '[attr.data-active]': 'active()',\n '[attr.data-anchor]': '_pattern.anchor()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-rowspan]': '_pattern.rowSpan()',\n '[attr.aria-colspan]': '_pattern.colSpan()',\n '[attr.aria-rowindex]': '_pattern.ariaRowIndex()',\n '[attr.aria-colindex]': '_pattern.ariaColIndex()',\n '[attr.aria-selected]': '_pattern.ariaSelected()',\n '[tabindex]': '_tabIndex()',\n },\n})\nexport class GridCell {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** Whether the cell is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The widgets contained within this cell, if any. */\n private readonly _widgets = contentChildren(GridCellWidget, {descendants: true});\n\n /** The UI pattern for the widget in this cell. */\n private readonly _widgetPatterns: Signal<GridCellWidgetPattern[]> = computed(() =>\n this._widgets().map(w => w._pattern),\n );\n\n /** The parent row. */\n private readonly _row = inject(GridRow);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** A unique identifier for the cell. */\n readonly id = input(inject(_IdGenerator).getId('ng-grid-cell-', true));\n\n /** The ARIA role for the cell. */\n readonly role = input<'gridcell' | 'columnheader' | 'rowheader'>('gridcell');\n\n /** The number of rows the cell should span. */\n readonly rowSpan = input<number>(1);\n\n /** The number of columns the cell should span. */\n readonly colSpan = input<number>(1);\n\n /** The index of this cell's row within the grid. */\n readonly rowIndex = input<number>();\n\n /** The index of this cell's column within the grid. */\n readonly colIndex = input<number>();\n\n /** Whether the cell is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the cell is selected. */\n readonly selected = model<boolean>(false);\n\n /** Whether the cell is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Orientation of the widgets in the cell. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether widgets navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The tabindex override. */\n readonly tabindex = input<number | undefined>();\n\n /**\n * The tabindex value set to the element.\n * If a focus target exists then return -1. Unless an override.\n */\n protected readonly _tabIndex: Signal<number> = computed(\n () => this.tabindex() ?? this._pattern.tabIndex(),\n );\n\n /** The UI pattern for the grid cell. */\n readonly _pattern = new GridCellPattern({\n ...this,\n grid: this._row.grid,\n row: () => this._row._pattern,\n widgets: this._widgetPatterns,\n getWidget: e => this._getWidget(e),\n element: () => this.element,\n });\n\n constructor() {}\n\n /** Gets the cell widget pattern for a given element. */\n private _getWidget(element: Element | null | undefined): GridCellWidgetPattern | undefined {\n let target = element;\n\n while (target) {\n const pattern = this._widgetPatterns().find(w => w.element() === target);\n if (pattern) {\n return pattern;\n }\n\n target = target.parentElement?.closest('[ngGridCellWidget]');\n }\n\n return undefined;\n }\n}\n\n/**\n * Represents an interactive element inside a `GridCell`. It allows for pausing grid navigation to\n * interact with the widget.\n *\n * When the user interacts with the widget (e.g., by typing in an input or opening a menu), grid\n * navigation is temporarily suspended to allow the widget to handle keyboard\n * events.\n *\n * ```html\n * <td ngGridCell>\n * <button ngGridCellWidget>Click Me</button>\n * </td>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridCellWidget]',\n exportAs: 'ngGridCellWidget',\n host: {\n 'class': 'grid-cell-widget',\n '[attr.data-active]': 'active()',\n '[attr.data-active-control]': 'isActivated() ? \"widget\" : \"cell\"',\n '[tabindex]': '_tabIndex()',\n },\n})\nexport class GridCellWidget {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** Whether the widget is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The parent cell. */\n private readonly _cell = inject(GridCell);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-grid-cell-widget-', true));\n\n /** The type of widget, which determines how it is activated. */\n readonly widgetType = input<'simple' | 'complex' | 'editable'>('simple');\n\n /** Whether the widget is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The target that will receive focus instead of the widget. */\n readonly focusTarget = input<ElementRef | HTMLElement | undefined>();\n\n /** Emits when the widget is activated. */\n readonly onActivate = output<KeyboardEvent | FocusEvent | undefined>();\n\n /** Emits when the widget is deactivated. */\n readonly onDeactivate = output<KeyboardEvent | FocusEvent | undefined>();\n\n /** The tabindex override. */\n readonly tabindex = input<number | undefined>();\n\n /**\n * The tabindex value set to the element.\n * If a focus target exists then return -1. Unless an override.\n */\n protected readonly _tabIndex: Signal<number> = computed(\n () => this.tabindex() ?? (this.focusTarget() ? -1 : this._pattern.tabIndex()),\n );\n\n /** The UI pattern for the grid cell widget. */\n readonly _pattern = new GridCellWidgetPattern({\n ...this,\n element: () => this.element,\n cell: () => this._cell._pattern,\n focusTarget: computed(() => {\n if (this.focusTarget() instanceof ElementRef) {\n return (this.focusTarget() as ElementRef).nativeElement;\n }\n return this.focusTarget();\n }),\n });\n\n /** Whether the widget is activated. */\n get isActivated(): Signal<boolean> {\n return this._pattern.isActivated.asReadonly();\n }\n\n constructor() {\n afterRenderEffect(() => {\n const activateEvent = this._pattern.lastActivateEvent();\n if (activateEvent) {\n this.onActivate.emit(activateEvent);\n }\n });\n\n afterRenderEffect(() => {\n const deactivateEvent = this._pattern.lastDeactivateEvent();\n if (deactivateEvent) {\n this.onDeactivate.emit(deactivateEvent);\n }\n });\n }\n\n /** Activates the widget. */\n activate(): void {\n this._pattern.activate();\n }\n\n /** Deactivates the widget. */\n deactivate(): void {\n this._pattern.deactivate();\n }\n}\n"],"names":["Grid","_elementRef","inject","ElementRef","element","nativeElement","_rows","contentChildren","GridRow","descendants","_rowPatterns","computed","map","r","_pattern","ngDevMode","debugName","textDirection","Directionality","valueSignal","enableSelection","input","transform","booleanAttribute","disabled","softDisabled","focusMode","rowWrap","colWrap","multi","selectionMode","enableRangeSelection","GridPattern","rows","getCell","e","_getCell","constructor","afterRenderEffect","setDefaultStateEffect","resetStateEffect","resetFocusEffect","restoreFocusEffect","focusEffect","target","row","cell","inputs","cells","parentElement","closest","undefined","deps","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","isSignal","exportAs","ngImport","decorators","args","selector","host","_cells","GridCell","_cellPatterns","c","_grid","grid","rowIndex","GridRowPattern","active","_widgets","GridCellWidget","_widgetPatterns","w","_row","id","_IdGenerator","getId","role","rowSpan","colSpan","colIndex","selected","model","selectable","orientation","wrap","tabindex","_tabIndex","tabIndex","GridCellPattern","widgets","getWidget","_getWidget","pattern","find","_cell","widgetType","focusTarget","onActivate","output","onDeactivate","GridCellWidgetPattern","isActivated","asReadonly","activateEvent","lastActivateEvent","emit","deactivateEvent","lastDeactivateEvent","activate","deactivate","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","properties","classAttribute"],"mappings":";;;;;;MA+DaA,IAAI,CAAA;AAEEC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACH,WAA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AAE,UAAU;AAChC,QAAA,4BAA4B,EAAE,mCAAmC;AACjE,QAAA,YAAY,EAAE;AACf;KACF;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"grid.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/grid/grid.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n output,\n model,\n Signal,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {GridPattern, GridRowPattern, GridCellPattern, GridCellWidgetPattern} from '../private';\n\n/**\n * The container for a grid. It provides keyboard navigation and focus management for the grid's\n * rows and cells. It manages the overall behavior of the grid, including focus\n * wrapping, selection, and disabled states.\n *\n * ```html\n * <table ngGrid [multi]=\"true\" [enableSelection]=\"true\">\n * @for (row of gridData; track row) {\n * <tr ngGridRow>\n * @for (cell of row; track cell) {\n * <td ngGridCell [disabled]=\"cell.disabled\">\n * {{cell.value}}\n * </td>\n * }\n * </tr>\n * }\n * </table>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGrid]',\n exportAs: 'ngGrid',\n host: {\n 'class': 'grid',\n 'role': 'grid',\n '[tabindex]': '_pattern.tabIndex()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-activedescendant]': '_pattern.activeDescendant()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(pointerdown)': '_pattern.onPointerdown($event)',\n '(pointermove)': '_pattern.onPointermove($event)',\n '(pointerup)': '_pattern.onPointerup($event)',\n '(focusin)': '_pattern.onFocusIn($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class Grid {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The rows that make up the grid. */\n private readonly _rows = contentChildren(GridRow, {descendants: true});\n\n /** The UI patterns for the rows in the grid. */\n private readonly _rowPatterns: Signal<GridRowPattern[]> = computed(() =>\n this._rows().map(r => r._pattern),\n );\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** Whether selection is enabled for the grid. */\n readonly enableSelection = input(false, {transform: booleanAttribute});\n\n /** Whether the grid is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /**\n * Whether to allow disabled items to receive focus. When `true`, disabled items are\n * focusable but not interactive. When `false`, disabled items are skipped during navigation.\n */\n readonly softDisabled = input(true, {transform: booleanAttribute});\n\n /**\n * The focus strategy used by the grid.\n * - `roving`: Focus is moved to the active cell using `tabindex`.\n * - `activedescendant`: Focus remains on the grid container, and `aria-activedescendant` is used to indicate the active cell.\n */\n readonly focusMode = input<'roving' | 'activedescendant'>('roving');\n\n /**\n * The wrapping behavior for keyboard navigation along the row axis.\n * - `continuous`: Navigation wraps from the last row to the first, and vice-versa.\n * - `loop`: Navigation wraps within the current row.\n * - `nowrap`: Navigation stops at the first/last item in the row.\n */\n readonly rowWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');\n\n /**\n * The wrapping behavior for keyboard navigation along the column axis.\n * - `continuous`: Navigation wraps from the last column to the first, and vice-versa.\n * - `loop`: Navigation wraps within the current column.\n * - `nowrap`: Navigation stops at the first/last item in the column.\n */\n readonly colWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');\n\n /** Whether multiple cells in the grid can be selected. */\n readonly multi = input(false, {transform: booleanAttribute});\n\n /**\n * The selection strategy used by the grid.\n * - `follow`: The focused cell is automatically selected.\n * - `explicit`: Cells are selected explicitly by the user (e.g., via click or spacebar).\n */\n readonly selectionMode = input<'follow' | 'explicit'>('follow');\n\n /** Whether enable range selections (with modifier keys or dragging). */\n readonly enableRangeSelection = input(false, {transform: booleanAttribute});\n\n /** The UI pattern for the grid. */\n readonly _pattern = new GridPattern({\n ...this,\n rows: this._rowPatterns,\n getCell: e => this._getCell(e),\n element: () => this.element,\n });\n\n constructor() {\n afterRenderEffect(() => this._pattern.setDefaultStateEffect());\n afterRenderEffect(() => this._pattern.resetStateEffect());\n afterRenderEffect(() => this._pattern.resetFocusEffect());\n afterRenderEffect(() => this._pattern.restoreFocusEffect());\n afterRenderEffect(() => this._pattern.focusEffect());\n }\n\n /** Gets the cell pattern for a given element. */\n private _getCell(element: Element | null | undefined): GridCellPattern | undefined {\n let target = element;\n\n while (target) {\n for (const row of this._rowPatterns()) {\n for (const cell of row.inputs.cells()) {\n if (cell.element() === target) {\n return cell;\n }\n }\n }\n\n target = target.parentElement?.closest('[ngGridCell]');\n }\n\n return undefined;\n }\n}\n\n/**\n * Represents a row within a grid. It is a container for `ngGridCell` directives.\n *\n * ```html\n * <tr ngGridRow>\n * <!-- ... cells ... -->\n * </tr>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridRow]',\n exportAs: 'ngGridRow',\n host: {\n 'class': 'grid-row',\n 'role': 'row',\n '[attr.aria-rowindex]': '_pattern.rowIndex()',\n },\n})\nexport class GridRow {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** The cells that make up this row. */\n private readonly _cells = contentChildren(GridCell, {descendants: true});\n\n /** The UI patterns for the cells in this row. */\n private readonly _cellPatterns: Signal<GridCellPattern[]> = computed(() =>\n this._cells().map(c => c._pattern),\n );\n\n /** The parent grid. */\n private readonly _grid = inject(Grid);\n\n /** The parent grid UI pattern. */\n readonly _gridPattern = computed(() => this._grid._pattern);\n\n /** The index of this row within the grid. */\n readonly rowIndex = input<number>();\n\n /** The UI pattern for the grid row. */\n readonly _pattern = new GridRowPattern({\n ...this,\n cells: this._cellPatterns,\n grid: this._gridPattern,\n });\n}\n\n/**\n * Represents a cell within a grid row. It is the primary focusable element\n * within the grid. It can be disabled and can have its selection state managed\n * through the `selected` input.\n *\n * ```html\n * <td ngGridCell [disabled]=\"isDisabled\" [(selected)]=\"isSelected\">\n * Cell Content\n * </td>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridCell]',\n exportAs: 'ngGridCell',\n host: {\n 'class': 'grid-cell',\n '[attr.role]': 'role()',\n '[attr.id]': '_pattern.id()',\n '[attr.rowspan]': '_pattern.rowSpan()',\n '[attr.colspan]': '_pattern.colSpan()',\n '[attr.data-active]': 'active()',\n '[attr.data-anchor]': '_pattern.anchor()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-rowspan]': '_pattern.rowSpan()',\n '[attr.aria-colspan]': '_pattern.colSpan()',\n '[attr.aria-rowindex]': '_pattern.ariaRowIndex()',\n '[attr.aria-colindex]': '_pattern.ariaColIndex()',\n '[attr.aria-selected]': '_pattern.ariaSelected()',\n '[tabindex]': '_tabIndex()',\n },\n})\nexport class GridCell {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** Whether the cell is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The widgets contained within this cell, if any. */\n private readonly _widgets = contentChildren(GridCellWidget, {descendants: true});\n\n /** The UI pattern for the widget in this cell. */\n private readonly _widgetPatterns: Signal<GridCellWidgetPattern[]> = computed(() =>\n this._widgets().map(w => w._pattern),\n );\n\n /** The parent row. */\n private readonly _row = inject(GridRow);\n\n /** Text direction. */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** A unique identifier for the cell. */\n readonly id = input(inject(_IdGenerator).getId('ng-grid-cell-', true));\n\n /** The ARIA role for the cell. */\n readonly role = input<'gridcell' | 'columnheader' | 'rowheader'>('gridcell');\n\n /** The number of rows the cell should span. */\n readonly rowSpan = input<number>(1);\n\n /** The number of columns the cell should span. */\n readonly colSpan = input<number>(1);\n\n /** The index of this cell's row within the grid. */\n readonly rowIndex = input<number>();\n\n /** The index of this cell's column within the grid. */\n readonly colIndex = input<number>();\n\n /** Whether the cell is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** Whether the cell is selected. */\n readonly selected = model<boolean>(false);\n\n /** Whether the cell is selectable. */\n readonly selectable = input<boolean>(true);\n\n /** Orientation of the widgets in the cell. */\n readonly orientation = input<'vertical' | 'horizontal'>('horizontal');\n\n /** Whether widgets navigation wraps. */\n readonly wrap = input(true, {transform: booleanAttribute});\n\n /** The tabindex override. */\n readonly tabindex = input<number | undefined>();\n\n /**\n * The tabindex value set to the element.\n * If a focus target exists then return -1. Unless an override.\n */\n protected readonly _tabIndex: Signal<number> = computed(\n () => this.tabindex() ?? this._pattern.tabIndex(),\n );\n\n /** The UI pattern for the grid cell. */\n readonly _pattern = new GridCellPattern({\n ...this,\n grid: this._row._gridPattern,\n row: () => this._row._pattern,\n widgets: this._widgetPatterns,\n getWidget: e => this._getWidget(e),\n element: () => this.element,\n });\n\n constructor() {}\n\n /** Gets the cell widget pattern for a given element. */\n private _getWidget(element: Element | null | undefined): GridCellWidgetPattern | undefined {\n let target = element;\n\n while (target) {\n const pattern = this._widgetPatterns().find(w => w.element() === target);\n if (pattern) {\n return pattern;\n }\n\n target = target.parentElement?.closest('[ngGridCellWidget]');\n }\n\n return undefined;\n }\n}\n\n/**\n * Represents an interactive element inside a `GridCell`. It allows for pausing grid navigation to\n * interact with the widget.\n *\n * When the user interacts with the widget (e.g., by typing in an input or opening a menu), grid\n * navigation is temporarily suspended to allow the widget to handle keyboard\n * events.\n *\n * ```html\n * <td ngGridCell>\n * <button ngGridCellWidget>Click Me</button>\n * </td>\n * ```\n *\n * @developerPreview 21.0\n */\n@Directive({\n selector: '[ngGridCellWidget]',\n exportAs: 'ngGridCellWidget',\n host: {\n 'class': 'grid-cell-widget',\n '[attr.data-active]': 'active()',\n '[attr.data-active-control]': 'isActivated() ? \"widget\" : \"cell\"',\n '[tabindex]': '_tabIndex()',\n },\n})\nexport class GridCellWidget {\n /** A reference to the host element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the host element. */\n readonly element = this._elementRef.nativeElement as HTMLElement;\n\n /** Whether the widget is currently active (focused). */\n readonly active = computed(() => this._pattern.active());\n\n /** The parent cell. */\n private readonly _cell = inject(GridCell);\n\n /** A unique identifier for the widget. */\n readonly id = input(inject(_IdGenerator).getId('ng-grid-cell-widget-', true));\n\n /** The type of widget, which determines how it is activated. */\n readonly widgetType = input<'simple' | 'complex' | 'editable'>('simple');\n\n /** Whether the widget is disabled. */\n readonly disabled = input(false, {transform: booleanAttribute});\n\n /** The target that will receive focus instead of the widget. */\n readonly focusTarget = input<ElementRef | HTMLElement | undefined>();\n\n /** Emits when the widget is activated. */\n readonly onActivate = output<KeyboardEvent | FocusEvent | undefined>();\n\n /** Emits when the widget is deactivated. */\n readonly onDeactivate = output<KeyboardEvent | FocusEvent | undefined>();\n\n /** The tabindex override. */\n readonly tabindex = input<number | undefined>();\n\n /**\n * The tabindex value set to the element.\n * If a focus target exists then return -1. Unless an override.\n */\n protected readonly _tabIndex: Signal<number> = computed(\n () => this.tabindex() ?? (this.focusTarget() ? -1 : this._pattern.tabIndex()),\n );\n\n /** The UI pattern for the grid cell widget. */\n readonly _pattern = new GridCellWidgetPattern({\n ...this,\n element: () => this.element,\n cell: () => this._cell._pattern,\n focusTarget: computed(() => {\n if (this.focusTarget() instanceof ElementRef) {\n return (this.focusTarget() as ElementRef).nativeElement;\n }\n return this.focusTarget();\n }),\n });\n\n /** Whether the widget is activated. */\n get isActivated(): Signal<boolean> {\n return this._pattern.isActivated.asReadonly();\n }\n\n constructor() {\n afterRenderEffect(() => {\n const activateEvent = this._pattern.lastActivateEvent();\n if (activateEvent) {\n this.onActivate.emit(activateEvent);\n }\n });\n\n afterRenderEffect(() => {\n const deactivateEvent = this._pattern.lastDeactivateEvent();\n if (deactivateEvent) {\n this.onDeactivate.emit(deactivateEvent);\n }\n });\n }\n\n /** Activates the widget. */\n activate(): void {\n this._pattern.activate();\n }\n\n /** Deactivates the widget. */\n deactivate(): void {\n this._pattern.deactivate();\n }\n}\n"],"names":["Grid","_elementRef","inject","ElementRef","element","nativeElement","_rows","contentChildren","GridRow","descendants","_rowPatterns","computed","map","r","_pattern","ngDevMode","debugName","textDirection","Directionality","valueSignal","enableSelection","input","transform","booleanAttribute","disabled","softDisabled","focusMode","rowWrap","colWrap","multi","selectionMode","enableRangeSelection","GridPattern","rows","getCell","e","_getCell","constructor","afterRenderEffect","setDefaultStateEffect","resetStateEffect","resetFocusEffect","restoreFocusEffect","focusEffect","target","row","cell","inputs","cells","parentElement","closest","undefined","deps","i0","ɵɵFactoryTarget","Directive","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","isSignal","exportAs","ngImport","decorators","args","selector","host","_cells","GridCell","_cellPatterns","c","_grid","_gridPattern","rowIndex","GridRowPattern","grid","active","_widgets","GridCellWidget","_widgetPatterns","w","_row","id","_IdGenerator","getId","role","rowSpan","colSpan","colIndex","selected","model","selectable","orientation","wrap","tabindex","_tabIndex","tabIndex","GridCellPattern","widgets","getWidget","_getWidget","pattern","find","_cell","widgetType","focusTarget","onActivate","output","onDeactivate","GridCellWidgetPattern","isActivated","asReadonly","activateEvent","lastActivateEvent","emit","deactivateEvent","lastDeactivateEvent","activate","deactivate","isStandalone","classPropertyName","publicName","isRequired","transformFunction","outputs","properties","classAttribute"],"mappings":";;;;;;MA+DaA,IAAI,CAAA;AAEEC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCC,EAAAA,OAAO,GAAG,IAAI,CAACH,WAAW,CAACI,aAA4B;EAG/CC,KAAK,GAAGC,eAAe,CAACC,OAAO;;AAAGC,IAAAA,WAAW,EAAE;GAAI,CAAA,GAAA,CAAlB;AAACA,IAAAA,WAAW,EAAE;GAAK,GAAC;EAGrDC,YAAY,GAA6BC,QAAQ,CAAC,MACjE,IAAI,CAACL,KAAK,EAA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|
|
90
90
|
this._pattern = this._popup?.combobox ? new ComboboxListboxPattern(inputs) : new ListboxPattern(inputs);
|
|
91
91
|
if (this._popup) {
|
|
92
|
-
this._popup.
|
|
92
|
+
this._popup._controls.set(this._pattern);
|
|
93
93
|
}
|
|
94
94
|
afterRenderEffect(() => {
|
|
95
95
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
@@ -119,7 +119,7 @@ class Listbox {
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
_onFocus() {
|
|
123
123
|
this._hasFocused.set(true);
|
|
124
124
|
}
|
|
125
125
|
scrollActiveItemIntoView(options = {
|
|
@@ -233,7 +233,7 @@ class Listbox {
|
|
|
233
233
|
listeners: {
|
|
234
234
|
"keydown": "_pattern.onKeydown($event)",
|
|
235
235
|
"pointerdown": "_pattern.onPointerdown($event)",
|
|
236
|
-
"focusin": "
|
|
236
|
+
"focusin": "_onFocus()"
|
|
237
237
|
},
|
|
238
238
|
properties: {
|
|
239
239
|
"attr.id": "id()",
|
|
@@ -279,7 +279,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
279
279
|
'[attr.aria-activedescendant]': '_pattern.activeDescendant()',
|
|
280
280
|
'(keydown)': '_pattern.onKeydown($event)',
|
|
281
281
|
'(pointerdown)': '_pattern.onPointerdown($event)',
|
|
282
|
-
'(focusin)': '
|
|
282
|
+
'(focusin)': '_onFocus()'
|
|
283
283
|
},
|
|
284
284
|
hostDirectives: [ComboboxPopup]
|
|
285
285
|
}]
|
|
@@ -299,8 +299,8 @@ class Option {
|
|
|
299
299
|
searchTerm = computed(() => this.label() ?? this.element.textContent, ...(ngDevMode ? [{
|
|
300
300
|
debugName: "searchTerm"
|
|
301
301
|
}] : []));
|
|
302
|
-
|
|
303
|
-
debugName: "
|
|
302
|
+
_listboxPattern = computed(() => this._listbox._pattern, ...(ngDevMode ? [{
|
|
303
|
+
debugName: "_listboxPattern"
|
|
304
304
|
}] : []));
|
|
305
305
|
value = input.required(...(ngDevMode ? [{
|
|
306
306
|
debugName: "value"
|
|
@@ -321,9 +321,9 @@ class Option {
|
|
|
321
321
|
...this,
|
|
322
322
|
id: this.id,
|
|
323
323
|
value: this.value,
|
|
324
|
-
listbox: this.
|
|
324
|
+
listbox: this._listboxPattern,
|
|
325
325
|
element: () => this.element,
|
|
326
|
-
searchTerm: this.searchTerm
|
|
326
|
+
searchTerm: () => this.searchTerm() ?? ''
|
|
327
327
|
});
|
|
328
328
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
329
329
|
minVersion: "12.0.0",
|