@angular/aria 21.2.2 → 21.2.4
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/fesm2022/_accordion-chunk.mjs +24 -18
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +44 -111
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/private.mjs +1 -1
- package/package.json +2 -2
- package/resources/code-examples.db +0 -0
- package/types/_accordion-chunk.d.ts +11 -31
- package/types/_list-navigation-chunk.d.ts +0 -2
- package/types/accordion.d.ts +31 -35
- package/types/private.d.ts +1 -1
|
@@ -45,7 +45,7 @@ class AccordionGroupPattern {
|
|
|
45
45
|
});
|
|
46
46
|
pointerdown = computed(() => {
|
|
47
47
|
return new PointerEventManager().on(e => {
|
|
48
|
-
const item = this.
|
|
48
|
+
const item = this._findTriggerPattern(e.target);
|
|
49
49
|
if (!item) return;
|
|
50
50
|
this.navigationBehavior.goto(item);
|
|
51
51
|
this.expansionBehavior.toggle(item);
|
|
@@ -58,7 +58,7 @@ class AccordionGroupPattern {
|
|
|
58
58
|
this.pointerdown().handle(event);
|
|
59
59
|
}
|
|
60
60
|
onFocus(event) {
|
|
61
|
-
const item = this.
|
|
61
|
+
const item = this._findTriggerPattern(event.target);
|
|
62
62
|
if (!item) return;
|
|
63
63
|
if (!this.focusBehavior.isFocusable(item)) return;
|
|
64
64
|
this.focusBehavior.focus(item);
|
|
@@ -68,22 +68,40 @@ class AccordionGroupPattern {
|
|
|
68
68
|
if (activeItem === undefined) return;
|
|
69
69
|
this.expansionBehavior.toggle(activeItem);
|
|
70
70
|
}
|
|
71
|
+
expandAll() {
|
|
72
|
+
this.expansionBehavior.openAll();
|
|
73
|
+
}
|
|
74
|
+
collapseAll() {
|
|
75
|
+
this.expansionBehavior.closeAll();
|
|
76
|
+
}
|
|
77
|
+
_findTriggerPattern(element) {
|
|
78
|
+
let target = element;
|
|
79
|
+
while (target) {
|
|
80
|
+
const pattern = this.inputs.items().find(t => t.element() === target);
|
|
81
|
+
if (pattern) {
|
|
82
|
+
return pattern;
|
|
83
|
+
}
|
|
84
|
+
target = target.parentElement?.closest('[ngAccordionTrigger]');
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
71
88
|
}
|
|
72
89
|
class AccordionTriggerPattern {
|
|
73
90
|
inputs;
|
|
74
|
-
id
|
|
91
|
+
id;
|
|
75
92
|
element = () => this.inputs.element();
|
|
76
93
|
expandable = () => true;
|
|
77
94
|
expanded;
|
|
78
95
|
active = computed(() => this.inputs.accordionGroup().inputs.activeItem() === this);
|
|
79
|
-
controls
|
|
96
|
+
controls;
|
|
80
97
|
tabIndex = computed(() => this.inputs.accordionGroup().focusBehavior.isFocusable(this) ? 0 : -1);
|
|
81
98
|
disabled = computed(() => this.inputs.disabled() || this.inputs.accordionGroup().inputs.disabled());
|
|
82
99
|
hardDisabled = computed(() => this.disabled() && !this.inputs.accordionGroup().inputs.softDisabled());
|
|
83
|
-
index = computed(() => this.inputs.accordionGroup().inputs.items().indexOf(this));
|
|
84
100
|
constructor(inputs) {
|
|
85
101
|
this.inputs = inputs;
|
|
102
|
+
this.id = inputs.id;
|
|
86
103
|
this.expanded = inputs.expanded;
|
|
104
|
+
this.controls = inputs.accordionPanelId;
|
|
87
105
|
}
|
|
88
106
|
open() {
|
|
89
107
|
this.inputs.accordionGroup().expansionBehavior.open(this);
|
|
@@ -95,18 +113,6 @@ class AccordionTriggerPattern {
|
|
|
95
113
|
this.inputs.accordionGroup().expansionBehavior.toggle(this);
|
|
96
114
|
}
|
|
97
115
|
}
|
|
98
|
-
class AccordionPanelPattern {
|
|
99
|
-
inputs;
|
|
100
|
-
id;
|
|
101
|
-
accordionTrigger;
|
|
102
|
-
hidden;
|
|
103
|
-
constructor(inputs) {
|
|
104
|
-
this.inputs = inputs;
|
|
105
|
-
this.id = inputs.id;
|
|
106
|
-
this.accordionTrigger = inputs.accordionTrigger;
|
|
107
|
-
this.hidden = computed(() => inputs.accordionTrigger()?.expanded() === false);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
116
|
|
|
111
|
-
export { AccordionGroupPattern,
|
|
117
|
+
export { AccordionGroupPattern, AccordionTriggerPattern };
|
|
112
118
|
//# sourceMappingURL=_accordion-chunk.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_accordion-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/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 {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {ExpansionItem, ListExpansion, ListExpansionInputs} from '../behaviors/expansion/expansion';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {computed, SignalLike, WritableSignalLike} from '../behaviors/signal-like/signal-like';\n\n/** Inputs of the AccordionGroupPattern. */\nexport interface AccordionGroupInputs extends Omit<\n ListNavigationInputs<AccordionTriggerPattern> &\n ListFocusInputs<AccordionTriggerPattern> &\n Omit<ListExpansionInputs, 'items'>,\n 'focusMode'\n> {\n /** A function that returns the trigger associated with a given element. */\n getItem: (e: Element | null | undefined) => AccordionTriggerPattern | undefined;\n}\n\nconst focusMode = () => 'roving' as const;\n\n/** A pattern controls the nested Accordions. */\nexport class AccordionGroupPattern {\n /** Controls navigation for the group. */\n readonly navigationBehavior: ListNavigation<AccordionTriggerPattern>;\n\n /** Controls focus for the group. */\n readonly focusBehavior: ListFocus<AccordionTriggerPattern>;\n\n /** Controls expansion for the group. */\n readonly expansionBehavior: ListExpansion;\n\n constructor(readonly inputs: AccordionGroupInputs) {\n this.focusBehavior = new ListFocus({\n ...inputs,\n focusMode,\n });\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusMode,\n focusManager: this.focusBehavior,\n });\n this.expansionBehavior = new ListExpansion({\n ...inputs,\n });\n }\n\n /** The key used to navigate to the previous accordion trigger. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next accordion trigger. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the accordion trigger. */\n keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.navigationBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.navigationBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.navigationBehavior.first())\n .on('End', () => this.navigationBehavior.last())\n .on(' ', () => this.toggle())\n .on('Enter', () => this.toggle());\n });\n\n /** The pointerdown event manager for the accordion trigger. */\n pointerdown = computed(() => {\n return new PointerEventManager().on(e => {\n const item = this.inputs.getItem(e.target as Element);\n if (!item) return;\n\n this.navigationBehavior.goto(item);\n this.expansionBehavior.toggle(item);\n });\n });\n\n /** Handles keydown events on the trigger, delegating to the group if not disabled. */\n onKeydown(event: KeyboardEvent): void {\n this.keydown().handle(event);\n }\n\n /** Handles pointerdown events on the trigger, delegating to the group if not disabled. */\n onPointerdown(event: PointerEvent): void {\n this.pointerdown().handle(event);\n }\n\n /** Handles focus events on the trigger. This ensures the tabbing changes the active index. */\n onFocus(event: FocusEvent): void {\n const item = this.inputs.getItem(event.target as Element);\n if (!item) return;\n if (!this.focusBehavior.isFocusable(item)) return;\n\n this.focusBehavior.focus(item);\n }\n\n /** Toggles the expansion state of the active accordion item. */\n toggle() {\n const activeItem = this.inputs.activeItem();\n if (activeItem === undefined) return;\n this.expansionBehavior.toggle(activeItem);\n }\n}\n\n/** Inputs for the AccordionTriggerPattern. */\nexport interface AccordionTriggerInputs\n extends Omit<ListNavigationItem & ListFocusItem, 'index'>, Omit<ExpansionItem, 'expandable'> {\n /** A local unique identifier for the trigger's corresponding panel. */\n panelId: SignalLike<string>;\n\n /** The parent accordion group that controls this trigger. */\n accordionGroup: SignalLike<AccordionGroupPattern>;\n\n /** The accordion panel controlled by this trigger. */\n accordionPanel: SignalLike<AccordionPanelPattern | undefined>;\n}\n\n/** A pattern controls the expansion state of an accordion. */\nexport class AccordionTriggerPattern implements ListNavigationItem, ListFocusItem, ExpansionItem {\n /** A unique identifier for this trigger. */\n readonly id: SignalLike<string> = () => this.inputs.id();\n\n /** A reference to the trigger element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether this trigger has expandable panel. */\n readonly expandable: SignalLike<boolean> = () => true;\n\n /** Whether the corresponding panel is expanded. */\n readonly expanded: WritableSignalLike<boolean>;\n\n /** Whether the trigger is active. */\n readonly active = computed(() => this.inputs.accordionGroup().inputs.activeItem() === this);\n\n /** Id of the accordion panel controlled by the trigger. */\n readonly controls = computed(() => this.inputs.accordionPanel()?.inputs.id());\n\n /** The tabindex of the trigger. */\n readonly tabIndex = computed(() =>\n this.inputs.accordionGroup().focusBehavior.isFocusable(this) ? 0 : -1,\n );\n\n /** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */\n readonly disabled = computed(\n () => this.inputs.disabled() || this.inputs.accordionGroup().inputs.disabled(),\n );\n\n /** Whether the trigger is hard disabled. */\n readonly hardDisabled = computed(\n () => this.disabled() && !this.inputs.accordionGroup().inputs.softDisabled(),\n );\n\n /** The index of the trigger within its accordion group. */\n readonly index = computed(() => this.inputs.accordionGroup().inputs.items().indexOf(this));\n\n constructor(readonly inputs: AccordionTriggerInputs) {\n this.expanded = inputs.expanded;\n }\n\n /** Opens the accordion panel. */\n open(): void {\n this.inputs.accordionGroup().expansionBehavior.open(this);\n }\n\n /** Closes the accordion panel. */\n close(): void {\n this.inputs.accordionGroup().expansionBehavior.close(this);\n }\n\n /** Toggles the accordion panel. */\n toggle(): void {\n this.inputs.accordionGroup().expansionBehavior.toggle(this);\n }\n}\n\n/** Represents the required inputs for the AccordionPanelPattern. */\nexport interface AccordionPanelInputs {\n /** A global unique identifier for the panel. */\n id: SignalLike<string>;\n\n /** A local unique identifier for the panel, matching its trigger's panelId. */\n panelId: SignalLike<string>;\n\n /** The parent accordion trigger that controls this panel. */\n accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;\n}\n\n/** Represents an accordion panel. */\nexport class AccordionPanelPattern {\n /** A global unique identifier for the panel. */\n id: SignalLike<string>;\n\n /** The parent accordion trigger that controls this panel. */\n accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;\n\n /** Whether the accordion panel is hidden. True if the associated trigger is not expanded. */\n hidden: SignalLike<boolean>;\n\n constructor(readonly inputs: AccordionPanelInputs) {\n this.id = inputs.id;\n this.accordionTrigger = inputs.accordionTrigger;\n this.hidden = computed(() => inputs.accordionTrigger()?.expanded() === false);\n }\n}\n"],"names":["focusMode","AccordionGroupPattern","inputs","navigationBehavior","focusBehavior","expansionBehavior","constructor","ListFocus","ListNavigation","focusManager","ListExpansion","prevKey","computed","orientation","textDirection","nextKey","keydown","KeyboardEventManager","on","prev","ignoreRepeat","next","first","last","toggle","pointerdown","PointerEventManager","e","item","getItem","target","goto","onKeydown","event","handle","onPointerdown","onFocus","isFocusable","focus","activeItem","undefined","AccordionTriggerPattern","id","element","expandable","expanded","active","accordionGroup","controls","accordionPanel","tabIndex","disabled","hardDisabled","softDisabled","index","items","indexOf","open","close","AccordionPanelPattern","accordionTrigger","hidden"],"mappings":";;;;;AA6BA,MAAMA,SAAS,GAAGA,MAAM,QAAiB;MAG5BC,qBAAqB,CAAA;EAUXC,MAAA;E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ST-fdfa778d11ba/bin/src/aria/private/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 {KeyboardEventManager, PointerEventManager} from '../behaviors/event-manager';\nimport {ExpansionItem, ListExpansion, ListExpansionInputs} from '../behaviors/expansion/expansion';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../behaviors/list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../behaviors/list-navigation/list-navigation';\nimport {computed, SignalLike, WritableSignalLike} from '../behaviors/signal-like/signal-like';\n\n/** Inputs of the AccordionGroupPattern. */\nexport interface AccordionGroupInputs extends Omit<\n ListNavigationInputs<AccordionTriggerPattern> &\n ListFocusInputs<AccordionTriggerPattern> &\n Omit<ListExpansionInputs, 'items'>,\n 'focusMode'\n> {}\n\nconst focusMode = () => 'roving' as const;\n\n/** A pattern controls the nested Accordions. */\nexport class AccordionGroupPattern {\n /** Controls navigation for the group. */\n readonly navigationBehavior: ListNavigation<AccordionTriggerPattern>;\n\n /** Controls focus for the group. */\n readonly focusBehavior: ListFocus<AccordionTriggerPattern>;\n\n /** Controls expansion for the group. */\n readonly expansionBehavior: ListExpansion;\n\n constructor(readonly inputs: AccordionGroupInputs) {\n this.focusBehavior = new ListFocus({\n ...inputs,\n focusMode,\n });\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusMode,\n focusManager: this.focusBehavior,\n });\n this.expansionBehavior = new ListExpansion({\n ...inputs,\n });\n }\n\n /** The key used to navigate to the previous accordion trigger. */\n prevKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowUp';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n });\n\n /** The key used to navigate to the next accordion trigger. */\n nextKey = computed(() => {\n if (this.inputs.orientation() === 'vertical') {\n return 'ArrowDown';\n }\n return this.inputs.textDirection() === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n });\n\n /** The keydown event manager for the accordion trigger. */\n keydown = computed(() => {\n return new KeyboardEventManager()\n .on(this.prevKey, () => this.navigationBehavior.prev(), {ignoreRepeat: false})\n .on(this.nextKey, () => this.navigationBehavior.next(), {ignoreRepeat: false})\n .on('Home', () => this.navigationBehavior.first())\n .on('End', () => this.navigationBehavior.last())\n .on(' ', () => this.toggle())\n .on('Enter', () => this.toggle());\n });\n\n /** The pointerdown event manager for the accordion trigger. */\n pointerdown = computed(() => {\n return new PointerEventManager().on(e => {\n const item = this._findTriggerPattern(e.target as Element);\n if (!item) return;\n\n this.navigationBehavior.goto(item);\n this.expansionBehavior.toggle(item);\n });\n });\n\n /** Handles keydown events on the trigger, delegating to the group if not disabled. */\n onKeydown(event: KeyboardEvent): void {\n this.keydown().handle(event);\n }\n\n /** Handles pointerdown events on the trigger, delegating to the group if not disabled. */\n onPointerdown(event: PointerEvent): void {\n this.pointerdown().handle(event);\n }\n\n /** Handles focus events on the trigger. This ensures the tabbing changes the active index. */\n onFocus(event: FocusEvent): void {\n const item = this._findTriggerPattern(event.target as Element);\n if (!item) return;\n if (!this.focusBehavior.isFocusable(item)) return;\n\n this.focusBehavior.focus(item);\n }\n\n /** Toggles the expansion state of the active accordion item. */\n toggle() {\n const activeItem = this.inputs.activeItem();\n if (activeItem === undefined) return;\n this.expansionBehavior.toggle(activeItem);\n }\n\n /** Expands all accordion panels if multi-expandable. */\n expandAll() {\n this.expansionBehavior.openAll();\n }\n\n /** Collapses all accordion panels. */\n collapseAll() {\n this.expansionBehavior.closeAll();\n }\n\n /** Finds the trigger pattern for a given element. */\n private _findTriggerPattern(\n element: Element | null | undefined,\n ): AccordionTriggerPattern | undefined {\n let target = element;\n\n while (target) {\n const pattern = this.inputs.items().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/** Inputs for the AccordionTriggerPattern. */\nexport interface AccordionTriggerInputs\n extends Omit<ListNavigationItem & ListFocusItem, 'index'>, Omit<ExpansionItem, 'expandable'> {\n /** The parent accordion group that controls this trigger. */\n accordionGroup: SignalLike<AccordionGroupPattern>;\n\n /** The accordion panel id controlled by this trigger. */\n accordionPanelId: SignalLike<string>;\n}\n\n/** A pattern controls the expansion state of an accordion. */\nexport class AccordionTriggerPattern implements ListNavigationItem, ListFocusItem, ExpansionItem {\n /** A unique identifier for this trigger. */\n readonly id: SignalLike<string>; // set from inputs\n\n /** A reference to the trigger element. */\n readonly element: SignalLike<HTMLElement> = () => this.inputs.element()!;\n\n /** Whether this trigger has expandable panel. */\n readonly expandable: SignalLike<boolean> = () => true;\n\n /** Whether the corresponding panel is expanded. */\n readonly expanded: WritableSignalLike<boolean>; // set from inputs\n\n /** Whether the trigger is active. */\n readonly active = computed(() => this.inputs.accordionGroup().inputs.activeItem() === this);\n\n /** Id of the accordion panel controlled by the trigger. */\n readonly controls: SignalLike<string>; // set from inputs\n\n /** The tabindex of the trigger. */\n readonly tabIndex = computed(() =>\n this.inputs.accordionGroup().focusBehavior.isFocusable(this) ? 0 : -1,\n );\n\n /** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */\n readonly disabled = computed(\n () => this.inputs.disabled() || this.inputs.accordionGroup().inputs.disabled(),\n );\n\n /** Whether the trigger is hard disabled. */\n readonly hardDisabled = computed(\n () => this.disabled() && !this.inputs.accordionGroup().inputs.softDisabled(),\n );\n\n constructor(readonly inputs: AccordionTriggerInputs) {\n this.id = inputs.id;\n this.expanded = inputs.expanded;\n this.controls = inputs.accordionPanelId;\n }\n\n /** Opens the accordion panel. */\n open(): void {\n this.inputs.accordionGroup().expansionBehavior.open(this);\n }\n\n /** Closes the accordion panel. */\n close(): void {\n this.inputs.accordionGroup().expansionBehavior.close(this);\n }\n\n /** Toggles the accordion panel. */\n toggle(): void {\n this.inputs.accordionGroup().expansionBehavior.toggle(this);\n }\n}\n"],"names":["focusMode","AccordionGroupPattern","inputs","navigationBehavior","focusBehavior","expansionBehavior","constructor","ListFocus","ListNavigation","focusManager","ListExpansion","prevKey","computed","orientation","textDirection","nextKey","keydown","KeyboardEventManager","on","prev","ignoreRepeat","next","first","last","toggle","pointerdown","PointerEventManager","e","item","_findTriggerPattern","target","goto","onKeydown","event","handle","onPointerdown","onFocus","isFocusable","focus","activeItem","undefined","expandAll","openAll","collapseAll","closeAll","element","pattern","items","find","t","parentElement","closest","AccordionTriggerPattern","id","expandable","expanded","active","accordionGroup","controls","tabIndex","disabled","hardDisabled","softDisabled","accordionPanelId","open","close"],"mappings":";;;;;AA0BA,MAAMA,SAAS,GAAGA,MAAM,QAAiB;MAG5BC,qBAAqB,CAAA;EAUXC,MAAA;EARZC,kBAAkB;EAGlBC,aAAa;EAGbC,iBAAiB;EAE1BC,WAAAA,CAAqBJ,MAA4B,EAAA;IAA5B,IAAM,CAAAA,MAAA,GAANA,MAAM;AACzB,IAAA,IAAI,CAACE,aAAa,GAAG,IAAIG,SAAS,CAAC;AACjC,MAAA,GAAGL,MAAM;AACTF,MAAAA;AACD,KAAA,CAAC;AACF,IAAA,IAAI,CAACG,kBAAkB,GAAG,IAAIK,cAAc,CAAC;AAC3C,MAAA,GAAGN,MAAM;MACTF,SAAS;MACTS,YAAY,EAAE,IAAI,CAACL;AACpB,KAAA,CAAC;AACF,IAAA,IAAI,CAACC,iBAAiB,GAAG,IAAIK,aAAa,CAAC;MACzC,GAAGR;AACJ,KAAA,CAAC;AACJ;EAGAS,OAAO,GAAGC,QAAQ,CAAC,MAAK;IACtB,IAAI,IAAI,CAACV,MAAM,CAACW,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,MAAA,OAAO,SAAS;AAClB;AACA,IAAA,OAAO,IAAI,CAACX,MAAM,CAACY,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW;AAC3E,GAAC,CAAC;EAGFC,OAAO,GAAGH,QAAQ,CAAC,MAAK;IACtB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AAc,EAAE,CAACpD,iBAAiB,CAAC2D,IAAI,CAAC,IAAI,CAAC;AAC3D;AAGAC,EAAAA,KAAKA,GAAA;AACH,IAAA,IAAI,CAAC/D,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAAC4D,KAAK,CAAC,IAAI,CAAC;AAC5D;AAGAzC,EAAAA,MAAMA,GAAA;AACJ,IAAA,IAAI,CAACtB,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAACmB,MAAM,CAAC,IAAI,CAAC;AAC7D;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-navigation-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-navigation/list-navigation.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 {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The index of the item in the list. */\n index: SignalLike<number>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n\n /** Whether the list is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** The active item. */\n activeItem: WritableSignalLike<T | undefined>;\n\n /** Whether disabled items in the list should be focusable. */\n softDisabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The last item that was active. */\n prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n activeIndex = computed(() => {\n return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()!) : -1;\n });\n\n constructor(readonly inputs: ListFocusInputs<T>) {}\n\n /** Whether the list is in a disabled state. */\n isListDisabled(): boolean {\n return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.isListDisabled()) {\n return undefined;\n }\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n return this.inputs.activeItem()?.id() ?? undefined;\n }\n\n /** The tab index for the list. */\n getListTabIndex(): -1 | 0 {\n if (this.isListDisabled()) {\n return 0;\n }\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tab index for the given item. */\n getItemTabIndex(item: T): -1 | 0 {\n if (this.isListDisabled()) {\n return -1;\n }\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n return this.inputs.activeItem() === item ? 0 : -1;\n }\n\n /** Moves focus to the given item if it is focusable. */\n focus(item: T, opts?: {focusElement?: boolean}): boolean {\n if (this.isListDisabled() || !this.isFocusable(item)) {\n return false;\n }\n\n this.prevActiveItem.set(this.inputs.activeItem());\n this.inputs.activeItem.set(item);\n\n if (opts?.focusElement || opts?.focusElement === undefined) {\n this.inputs.focusMode() === 'roving'\n ? item.element()?.focus()\n : this.inputs.element()?.focus();\n }\n\n return true;\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || this.inputs.softDisabled();\n }\n}\n","/**\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 {SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem extends ListFocusItem {}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Options for list navigation. */\nexport interface ListNavigationOpts<T> {\n /**\n * Whether to focus the item's element.\n * Defaults to true.\n */\n focusElement?: boolean;\n\n /**\n * The list of items to navigate through.\n * Defaults to the list of items from the inputs.\n */\n items?: T[];\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n constructor(readonly inputs: ListNavigationInputs<T> & {focusManager: ListFocus<T>}) {}\n\n /** Navigates to the given item. */\n goto(item?: T, opts?: ListNavigationOpts<T>): boolean {\n return item ? this.inputs.focusManager.focus(item, opts) : false;\n }\n\n /** Navigates to the next item in the list. */\n next(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(1, opts);\n }\n\n /** Peeks the next item in the list. */\n peekNext(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(1, opts);\n }\n\n /** Navigates to the previous item in the list. */\n prev(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(-1, opts);\n }\n\n /** Peeks the previous item in the list. */\n peekPrev(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(-1, opts);\n }\n\n /** Navigates to the first item in the list. */\n first(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekFirst(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Navigates to the last item in the list. */\n last(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekLast(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Gets the first focusable item from the given list of items. */\n peekFirst(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n return items.find(i => this.inputs.focusManager.isFocusable(i));\n }\n\n /** Gets the last focusable item from the given list of items. */\n peekLast(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n return;\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1, opts?: ListNavigationOpts<T>): boolean {\n const item = this._peek(delta, opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Peeks the next or previous focusable item in the list based on the given delta. */\n private _peek(delta: 1 | -1, opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n const itemCount = items.length;\n const activeItem = this.inputs.focusManager.inputs.activeItem();\n const startIndex =\n opts?.items && activeItem\n ? items.indexOf(activeItem)\n : this.inputs.focusManager.activeIndex();\n\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n\n return;\n }\n}\n"],"names":["ListFocus","inputs","prevActiveItem","signal","undefined","prevActiveIndex","computed","items","indexOf","activeIndex","activeItem","constructor","isListDisabled","disabled","every","i","getActiveDescendant","focusMode","id","getListTabIndex","getItemTabIndex","item","focus","opts","isFocusable","set","focusElement","element","softDisabled","ListNavigation","goto","focusManager","next","_advance","peekNext","_peek","prev","peekPrev","first","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AAA,GACxB,IAAI,CAACT,MAAM,CAAC8B,YAAY,CAACtB,WAAW,EAAE;IAE5C,MAAMsC,IAAI,GAAIhC,CAAS,IACrB,IAAI,CAACd,MAAM,CAAC+C,IAAI,EAAE,GAAG,CAACjC,CAAC,GAAG6B,KAAK,GAAGC,SAAS,IAAIA,SAAS,GAAG9B,CAAC,GAAG6B,KAAK;IAKtE,KAAK,IAAI7B,CAAC,GAAGgC,IAAI,CAACD,UAAU,CAAC,EAAE/B,CAAC,KAAK+B,UAAU,IAAI/B,CAAC,GAAG8B,SAAS,IAAI9B,CAAC,IAAI,CAAC,EAAEA,CAAC,GAAGgC,IAAI,CAAChC,CAAC,CAAC,EAAE;AACvF,MAAA,IAAI,IAAI,CAACd,MAAM,CAAC8B,YAAY,CAACP,WAAW,CAACjB,KAAK,CAACQ,CAAC,CAAC,CAAC,EAAE;QAClD,OAAOR,KAAK,CAACQ,CAAC,CAAC;AACjB;AACF;AAEA,IAAA;AACF;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"_list-navigation-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-navigation/list-navigation.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 {computed, signal, SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item in a collection, such as a listbox option, than may receive focus. */\nexport interface ListFocusItem {\n /** A unique identifier for the item. */\n id: SignalLike<string>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n\n /** Whether an item is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for a collection that contains focusable items. */\nexport interface ListFocusInputs<T extends ListFocusItem> {\n /** The focus strategy used by the list. */\n focusMode: SignalLike<'roving' | 'activedescendant'>;\n\n /** Whether the list is disabled. */\n disabled: SignalLike<boolean>;\n\n /** The items in the list. */\n items: SignalLike<T[]>;\n\n /** The active item. */\n activeItem: WritableSignalLike<T | undefined>;\n\n /** Whether disabled items in the list should be focusable. */\n softDisabled: SignalLike<boolean>;\n\n /** The html element that should receive focus. */\n element: SignalLike<HTMLElement | undefined>;\n}\n\n/** Controls focus for a list of items. */\nexport class ListFocus<T extends ListFocusItem> {\n /** The last item that was active. */\n prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n activeIndex = computed(() => {\n return this.inputs.activeItem() ? this.inputs.items().indexOf(this.inputs.activeItem()!) : -1;\n });\n\n constructor(readonly inputs: ListFocusInputs<T>) {}\n\n /** Whether the list is in a disabled state. */\n isListDisabled(): boolean {\n return this.inputs.disabled() || this.inputs.items().every(i => i.disabled());\n }\n\n /** The id of the current active item. */\n getActiveDescendant(): string | undefined {\n if (this.isListDisabled()) {\n return undefined;\n }\n if (this.inputs.focusMode() === 'roving') {\n return undefined;\n }\n return this.inputs.activeItem()?.id() ?? undefined;\n }\n\n /** The tab index for the list. */\n getListTabIndex(): -1 | 0 {\n if (this.isListDisabled()) {\n return 0;\n }\n return this.inputs.focusMode() === 'activedescendant' ? 0 : -1;\n }\n\n /** Returns the tab index for the given item. */\n getItemTabIndex(item: T): -1 | 0 {\n if (this.isListDisabled()) {\n return -1;\n }\n if (this.inputs.focusMode() === 'activedescendant') {\n return -1;\n }\n return this.inputs.activeItem() === item ? 0 : -1;\n }\n\n /** Moves focus to the given item if it is focusable. */\n focus(item: T, opts?: {focusElement?: boolean}): boolean {\n if (this.isListDisabled() || !this.isFocusable(item)) {\n return false;\n }\n\n this.prevActiveItem.set(this.inputs.activeItem());\n this.inputs.activeItem.set(item);\n\n if (opts?.focusElement || opts?.focusElement === undefined) {\n this.inputs.focusMode() === 'roving'\n ? item.element()?.focus()\n : this.inputs.element()?.focus();\n }\n\n return true;\n }\n\n /** Returns true if the given item can be navigated to. */\n isFocusable(item: T): boolean {\n return !item.disabled() || this.inputs.softDisabled();\n }\n}\n","/**\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 {SignalLike} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\n\n/** Represents an item in a collection, such as a listbox option, than can be navigated to. */\nexport interface ListNavigationItem extends ListFocusItem {}\n\n/** Represents the required inputs for a collection that has navigable items. */\nexport interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {\n /** Whether focus should wrap when navigating. */\n wrap: SignalLike<boolean>;\n\n /** Whether the list is vertically or horizontally oriented. */\n orientation: SignalLike<'vertical' | 'horizontal'>;\n\n /** The direction that text is read based on the users locale. */\n textDirection: SignalLike<'rtl' | 'ltr'>;\n}\n\n/** Options for list navigation. */\nexport interface ListNavigationOpts<T> {\n /**\n * Whether to focus the item's element.\n * Defaults to true.\n */\n focusElement?: boolean;\n\n /**\n * The list of items to navigate through.\n * Defaults to the list of items from the inputs.\n */\n items?: T[];\n}\n\n/** Controls navigation for a list of items. */\nexport class ListNavigation<T extends ListNavigationItem> {\n constructor(readonly inputs: ListNavigationInputs<T> & {focusManager: ListFocus<T>}) {}\n\n /** Navigates to the given item. */\n goto(item?: T, opts?: ListNavigationOpts<T>): boolean {\n return item ? this.inputs.focusManager.focus(item, opts) : false;\n }\n\n /** Navigates to the next item in the list. */\n next(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(1, opts);\n }\n\n /** Peeks the next item in the list. */\n peekNext(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(1, opts);\n }\n\n /** Navigates to the previous item in the list. */\n prev(opts?: ListNavigationOpts<T>): boolean {\n return this._advance(-1, opts);\n }\n\n /** Peeks the previous item in the list. */\n peekPrev(opts?: ListNavigationOpts<T>): T | undefined {\n return this._peek(-1, opts);\n }\n\n /** Navigates to the first item in the list. */\n first(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekFirst(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Navigates to the last item in the list. */\n last(opts?: ListNavigationOpts<T>): boolean {\n const item = this.peekLast(opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Gets the first focusable item from the given list of items. */\n peekFirst(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n return items.find(i => this.inputs.focusManager.isFocusable(i));\n }\n\n /** Gets the last focusable item from the given list of items. */\n peekLast(opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n for (let i = items.length - 1; i >= 0; i--) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n return;\n }\n\n /** Advances to the next or previous focusable item in the list based on the given delta. */\n private _advance(delta: 1 | -1, opts?: ListNavigationOpts<T>): boolean {\n const item = this._peek(delta, opts);\n return item ? this.goto(item, opts) : false;\n }\n\n /** Peeks the next or previous focusable item in the list based on the given delta. */\n private _peek(delta: 1 | -1, opts?: ListNavigationOpts<T>): T | undefined {\n const items = opts?.items ?? this.inputs.items();\n const itemCount = items.length;\n const activeItem = this.inputs.focusManager.inputs.activeItem();\n const startIndex =\n opts?.items && activeItem\n ? items.indexOf(activeItem)\n : this.inputs.focusManager.activeIndex();\n\n const step = (i: number) =>\n this.inputs.wrap() ? (i + delta + itemCount) % itemCount : i + delta;\n\n // If wrapping is enabled, this loop ultimately terminates when `i` gets back to `startIndex`\n // in the case that all options are disabled. If wrapping is disabled, the loop terminates\n // when the index goes out of bounds.\n for (let i = step(startIndex); i !== startIndex && i < itemCount && i >= 0; i = step(i)) {\n if (this.inputs.focusManager.isFocusable(items[i])) {\n return items[i];\n }\n }\n\n return;\n }\n}\n"],"names":["ListFocus","inputs","prevActiveItem","signal","undefined","prevActiveIndex","computed","items","indexOf","activeIndex","activeItem","constructor","isListDisabled","disabled","every","i","getActiveDescendant","focusMode","id","getListTabIndex","getItemTabIndex","item","focus","opts","isFocusable","set","focusElement","element","softDisabled","ListNavigation","goto","focusManager","next","_advance","peekNext","_peek","prev","peekPrev","first","peekFirst","last","peekLast","find","length","delta","itemCount","startIndex","step","wrap"],"mappings":";;MA4CaA,SAAS,CAAA;EAcCC,MAAA;AAZrBC,EAAAA,cAAc,GAAGC,MAAM,CAAgBC,SAAS,CAAC;EAGjDC,eAAe,GAAGC,QAAQ,CAAC,MAAK;IAC9B,OAAO,IAAI,CAACJ,cAAc,EAAE,GAAG,IAAI,CAACD,MAAM,CAACM,KAAK,EAAE,CAACC,OAAO,CAAC,IAAI,CAACN,cAAc,EAAG,CAAC,GAAG,CAAC,CAAC;AACzF,GAAC,CAAC;EAGFO,WAAW,GAAGH,QAAQ,CAAC,MAAK;AAC1B,IAAA,OAAO,IAAI,CAACL,MAAM,CAACS,UAAU,EAAE,GAAG,IAAI,CAACT,MAAM,CAACM,KAAK,EAAE,CAACC,OAAO,CAAC,IAAI,CAACP,MAAM,CAACS,UAAU,EAAG,CAAC,GAAG,CAAC,CAAC;AAC/F,GAAC,CAAC;EAEFC,WAAAA,CAAqBV,MAA0B,EAAA;IAA1B,IAAM,CAAAA,MAAA,GAANA,MAAM;AAAuB;AAGlDW,EAAAA,cAAcA,GAAA;IACZ,OAAO,IAAI,CAACX,MAAM,CAACY,QAAQ,EAAE,IAAI,IAAI,CAACZ,MAAM,CAACM,KAAK,EAAE,CAACO,KAAK,CAACC,CAAC,IAAIA,CAAC,CAACF,QAAQ,EAAE,CAAC;AAC/E;AAGAG,EAAAA,mBAAmBA,GAAA;AACjB,IAAA,IAAI,IAAI,CAACJ,cAAc,EAAE,EAAE;AACzB,MAAA,OAAOR,SAAS;AAClB;IACA,IAAI,IAAI,CAACH,MAAM,CAACgB,SAAS,EAAE,KAAK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CAACoC,MAAM;AAC9B,IAAA,MAAMjC,UAAU,GAAG,IAAI,CAACT,MAAM,CAAC8B,YAAY,CAAC9B,MAAM,CAACS,UAAU,EAAE;IAC/D,MAAMoC,UAAU,GACdvB,IAAI,EAAEhB,KAAK,IAAIG,UAAU,GACrBH,KAAK,CAACC,OAAO,CAACE,UAAU,CAAA,GACxB,IAAI,CAACT,MAAM,CAAC8B,YAAY,CAACtB,WAAW,EAAE;IAE5C,MAAMsC,IAAI,GAAIhC,CAAS,IACrB,IAAI,CAACd,MAAM,CAAC+C,IAAI,EAAE,GAAG,CAACjC,CAAC,GAAG6B,KAAK,GAAGC,SAAS,IAAIA,SAAS,GAAG9B,CAAC,GAAG6B,KAAK;IAKtE,KAAK,IAAI7B,CAAC,GAAGgC,IAAI,CAACD,UAAU,CAAC,EAAE/B,CAAC,KAAK+B,UAAU,IAAI/B,CAAC,GAAG8B,SAAS,IAAI9B,CAAC,IAAI,CAAC,EAAEA,CAAC,GAAGgC,IAAI,CAAChC,CAAC,CAAC,EAAE;AACvF,MAAA,IAAI,IAAI,CAACd,MAAM,CAAC8B,YAAY,CAACP,WAAW,CAACjB,KAAK,CAACQ,CAAC,CAAC,CAAC,EAAE;QAClD,OAAOR,KAAK,CAACQ,CAAC,CAAC;AACjB;AACF;AAEA,IAAA;AACF;AACD;;;;"}
|
package/fesm2022/accordion.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed,
|
|
2
|
+
import { inject, input, computed, afterRenderEffect, Directive, InjectionToken, ElementRef, booleanAttribute, model, contentChildren, signal } from '@angular/core';
|
|
3
3
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
4
|
import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.mjs';
|
|
5
|
-
import { AccordionPanelPattern, AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.mjs';
|
|
6
5
|
import { Directionality } from '@angular/cdk/bidi';
|
|
6
|
+
import { AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.mjs';
|
|
7
7
|
import './_expansion-chunk.mjs';
|
|
8
8
|
import './_list-navigation-chunk.mjs';
|
|
9
9
|
import './_signal-like-chunk.mjs';
|
|
@@ -15,33 +15,23 @@ class AccordionPanel {
|
|
|
15
15
|
id = input(inject(_IdGenerator).getId('ng-accordion-panel-', true), ...(ngDevMode ? [{
|
|
16
16
|
debugName: "id"
|
|
17
17
|
}] : []));
|
|
18
|
-
|
|
19
|
-
debugName: "panelId"
|
|
20
|
-
}] : []));
|
|
21
|
-
visible = computed(() => !this._pattern.hidden(), ...(ngDevMode ? [{
|
|
18
|
+
visible = computed(() => this._pattern?.expanded() === true, ...(ngDevMode ? [{
|
|
22
19
|
debugName: "visible"
|
|
23
20
|
}] : []));
|
|
24
|
-
|
|
25
|
-
debugName: "_accordionTriggerPattern"
|
|
26
|
-
}] : []));
|
|
27
|
-
_pattern = new AccordionPanelPattern({
|
|
28
|
-
id: this.id,
|
|
29
|
-
panelId: this.panelId,
|
|
30
|
-
accordionTrigger: () => this._accordionTriggerPattern()
|
|
31
|
-
});
|
|
21
|
+
_pattern;
|
|
32
22
|
constructor() {
|
|
33
23
|
afterRenderEffect(() => {
|
|
34
24
|
this._deferredContentAware.contentVisible.set(this.visible());
|
|
35
25
|
});
|
|
36
26
|
}
|
|
37
27
|
expand() {
|
|
38
|
-
this.
|
|
28
|
+
this._pattern?.open();
|
|
39
29
|
}
|
|
40
30
|
collapse() {
|
|
41
|
-
this.
|
|
31
|
+
this._pattern?.close();
|
|
42
32
|
}
|
|
43
33
|
toggle() {
|
|
44
|
-
this.
|
|
34
|
+
this._pattern?.toggle();
|
|
45
35
|
}
|
|
46
36
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
47
37
|
minVersion: "12.0.0",
|
|
@@ -64,13 +54,6 @@ class AccordionPanel {
|
|
|
64
54
|
isSignal: true,
|
|
65
55
|
isRequired: false,
|
|
66
56
|
transformFunction: null
|
|
67
|
-
},
|
|
68
|
-
panelId: {
|
|
69
|
-
classPropertyName: "panelId",
|
|
70
|
-
publicName: "panelId",
|
|
71
|
-
isSignal: true,
|
|
72
|
-
isRequired: true,
|
|
73
|
-
transformFunction: null
|
|
74
57
|
}
|
|
75
58
|
},
|
|
76
59
|
host: {
|
|
@@ -78,8 +61,8 @@ class AccordionPanel {
|
|
|
78
61
|
"role": "region"
|
|
79
62
|
},
|
|
80
63
|
properties: {
|
|
81
|
-
"attr.id": "
|
|
82
|
-
"attr.aria-labelledby": "_pattern
|
|
64
|
+
"attr.id": "id()",
|
|
65
|
+
"attr.aria-labelledby": "_pattern?.id()",
|
|
83
66
|
"attr.inert": "!visible() ? true : null"
|
|
84
67
|
}
|
|
85
68
|
},
|
|
@@ -107,8 +90,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
107
90
|
}],
|
|
108
91
|
host: {
|
|
109
92
|
'role': 'region',
|
|
110
|
-
'[attr.id]': '
|
|
111
|
-
'[attr.aria-labelledby]': '_pattern
|
|
93
|
+
'[attr.id]': 'id()',
|
|
94
|
+
'[attr.aria-labelledby]': '_pattern?.id()',
|
|
112
95
|
'[attr.inert]': '!visible() ? true : null'
|
|
113
96
|
}
|
|
114
97
|
}]
|
|
@@ -122,14 +105,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
122
105
|
alias: "id",
|
|
123
106
|
required: false
|
|
124
107
|
}]
|
|
125
|
-
}],
|
|
126
|
-
panelId: [{
|
|
127
|
-
type: i0.Input,
|
|
128
|
-
args: [{
|
|
129
|
-
isSignal: true,
|
|
130
|
-
alias: "panelId",
|
|
131
|
-
required: true
|
|
132
|
-
}]
|
|
133
108
|
}]
|
|
134
109
|
}
|
|
135
110
|
});
|
|
@@ -140,10 +115,13 @@ class AccordionTrigger {
|
|
|
140
115
|
_elementRef = inject(ElementRef);
|
|
141
116
|
element = this._elementRef.nativeElement;
|
|
142
117
|
_accordionGroup = inject(ACCORDION_GROUP);
|
|
118
|
+
panel = input.required(...(ngDevMode ? [{
|
|
119
|
+
debugName: "panel"
|
|
120
|
+
}] : []));
|
|
143
121
|
id = input(inject(_IdGenerator).getId('ng-accordion-trigger-', true), ...(ngDevMode ? [{
|
|
144
122
|
debugName: "id"
|
|
145
123
|
}] : []));
|
|
146
|
-
panelId =
|
|
124
|
+
panelId = computed(() => this.panel().id(), ...(ngDevMode ? [{
|
|
147
125
|
debugName: "panelId"
|
|
148
126
|
}] : []));
|
|
149
127
|
disabled = input(false, {
|
|
@@ -158,15 +136,16 @@ class AccordionTrigger {
|
|
|
158
136
|
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
159
137
|
debugName: "active"
|
|
160
138
|
}] : []));
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
139
|
+
_pattern;
|
|
140
|
+
ngOnInit() {
|
|
141
|
+
this._pattern = new AccordionTriggerPattern({
|
|
142
|
+
...this,
|
|
143
|
+
element: () => this.element,
|
|
144
|
+
accordionGroup: () => this._accordionGroup._pattern,
|
|
145
|
+
accordionPanelId: this.panelId
|
|
146
|
+
});
|
|
147
|
+
this.panel()._pattern = this._pattern;
|
|
148
|
+
}
|
|
170
149
|
expand() {
|
|
171
150
|
this._pattern.open();
|
|
172
151
|
}
|
|
@@ -191,6 +170,13 @@ class AccordionTrigger {
|
|
|
191
170
|
isStandalone: true,
|
|
192
171
|
selector: "[ngAccordionTrigger]",
|
|
193
172
|
inputs: {
|
|
173
|
+
panel: {
|
|
174
|
+
classPropertyName: "panel",
|
|
175
|
+
publicName: "panel",
|
|
176
|
+
isSignal: true,
|
|
177
|
+
isRequired: true,
|
|
178
|
+
transformFunction: null
|
|
179
|
+
},
|
|
194
180
|
id: {
|
|
195
181
|
classPropertyName: "id",
|
|
196
182
|
publicName: "id",
|
|
@@ -198,13 +184,6 @@ class AccordionTrigger {
|
|
|
198
184
|
isRequired: false,
|
|
199
185
|
transformFunction: null
|
|
200
186
|
},
|
|
201
|
-
panelId: {
|
|
202
|
-
classPropertyName: "panelId",
|
|
203
|
-
publicName: "panelId",
|
|
204
|
-
isSignal: true,
|
|
205
|
-
isRequired: true,
|
|
206
|
-
transformFunction: null
|
|
207
|
-
},
|
|
208
187
|
disabled: {
|
|
209
188
|
classPropertyName: "disabled",
|
|
210
189
|
publicName: "disabled",
|
|
@@ -229,7 +208,7 @@ class AccordionTrigger {
|
|
|
229
208
|
},
|
|
230
209
|
properties: {
|
|
231
210
|
"attr.data-active": "active()",
|
|
232
|
-
"id": "
|
|
211
|
+
"id": "id()",
|
|
233
212
|
"attr.aria-expanded": "expanded()",
|
|
234
213
|
"attr.aria-controls": "_pattern.controls()",
|
|
235
214
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
@@ -254,7 +233,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
254
233
|
host: {
|
|
255
234
|
'[attr.data-active]': 'active()',
|
|
256
235
|
'role': 'button',
|
|
257
|
-
'[id]': '
|
|
236
|
+
'[id]': 'id()',
|
|
258
237
|
'[attr.aria-expanded]': 'expanded()',
|
|
259
238
|
'[attr.aria-controls]': '_pattern.controls()',
|
|
260
239
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
@@ -264,20 +243,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
264
243
|
}]
|
|
265
244
|
}],
|
|
266
245
|
propDecorators: {
|
|
267
|
-
|
|
246
|
+
panel: [{
|
|
268
247
|
type: i0.Input,
|
|
269
248
|
args: [{
|
|
270
249
|
isSignal: true,
|
|
271
|
-
alias: "
|
|
272
|
-
required:
|
|
250
|
+
alias: "panel",
|
|
251
|
+
required: true
|
|
273
252
|
}]
|
|
274
253
|
}],
|
|
275
|
-
|
|
254
|
+
id: [{
|
|
276
255
|
type: i0.Input,
|
|
277
256
|
args: [{
|
|
278
257
|
isSignal: true,
|
|
279
|
-
alias: "
|
|
280
|
-
required:
|
|
258
|
+
alias: "id",
|
|
259
|
+
required: false
|
|
281
260
|
}]
|
|
282
261
|
}],
|
|
283
262
|
disabled: [{
|
|
@@ -314,12 +293,6 @@ class AccordionGroup {
|
|
|
314
293
|
_triggerPatterns = computed(() => this._triggers().map(t => t._pattern), ...(ngDevMode ? [{
|
|
315
294
|
debugName: "_triggerPatterns"
|
|
316
295
|
}] : []));
|
|
317
|
-
_panels = contentChildren(AccordionPanel, {
|
|
318
|
-
...(ngDevMode ? {
|
|
319
|
-
debugName: "_panels"
|
|
320
|
-
} : {}),
|
|
321
|
-
descendants: true
|
|
322
|
-
});
|
|
323
296
|
textDirection = inject(Directionality).valueSignal;
|
|
324
297
|
disabled = input(false, {
|
|
325
298
|
...(ngDevMode ? {
|
|
@@ -347,41 +320,16 @@ class AccordionGroup {
|
|
|
347
320
|
});
|
|
348
321
|
_pattern = new AccordionGroupPattern({
|
|
349
322
|
...this,
|
|
323
|
+
element: () => this.element,
|
|
350
324
|
activeItem: signal(undefined),
|
|
351
325
|
items: this._triggerPatterns,
|
|
352
|
-
orientation: () => 'vertical'
|
|
353
|
-
getItem: e => this._getItem(e),
|
|
354
|
-
element: () => this.element
|
|
326
|
+
orientation: () => 'vertical'
|
|
355
327
|
});
|
|
356
|
-
constructor() {
|
|
357
|
-
afterRenderEffect(() => {
|
|
358
|
-
const triggers = this._triggers();
|
|
359
|
-
const panels = this._panels();
|
|
360
|
-
for (const trigger of triggers) {
|
|
361
|
-
const panel = panels.find(p => p.panelId() === trigger.panelId());
|
|
362
|
-
trigger._accordionPanelPattern.set(panel?._pattern);
|
|
363
|
-
if (panel) {
|
|
364
|
-
panel._accordionTriggerPattern.set(trigger._pattern);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
328
|
expandAll() {
|
|
370
|
-
this._pattern.
|
|
329
|
+
this._pattern.expandAll();
|
|
371
330
|
}
|
|
372
331
|
collapseAll() {
|
|
373
|
-
this._pattern.
|
|
374
|
-
}
|
|
375
|
-
_getItem(element) {
|
|
376
|
-
let target = element;
|
|
377
|
-
while (target) {
|
|
378
|
-
const pattern = this._triggerPatterns().find(t => t.element() === target);
|
|
379
|
-
if (pattern) {
|
|
380
|
-
return pattern;
|
|
381
|
-
}
|
|
382
|
-
target = target.parentElement?.closest('[ngAccordionTrigger]');
|
|
383
|
-
}
|
|
384
|
-
return undefined;
|
|
332
|
+
this._pattern.collapseAll();
|
|
385
333
|
}
|
|
386
334
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
387
335
|
minVersion: "12.0.0",
|
|
@@ -443,11 +391,6 @@ class AccordionGroup {
|
|
|
443
391
|
predicate: AccordionTrigger,
|
|
444
392
|
descendants: true,
|
|
445
393
|
isSignal: true
|
|
446
|
-
}, {
|
|
447
|
-
propertyName: "_panels",
|
|
448
|
-
predicate: AccordionPanel,
|
|
449
|
-
descendants: true,
|
|
450
|
-
isSignal: true
|
|
451
394
|
}],
|
|
452
395
|
exportAs: ["ngAccordionGroup"],
|
|
453
396
|
ngImport: i0
|
|
@@ -474,7 +417,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
474
417
|
}]
|
|
475
418
|
}]
|
|
476
419
|
}],
|
|
477
|
-
ctorParameters: () => [],
|
|
478
420
|
propDecorators: {
|
|
479
421
|
_triggers: [{
|
|
480
422
|
type: i0.ContentChildren,
|
|
@@ -485,15 +427,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
485
427
|
isSignal: true
|
|
486
428
|
}]
|
|
487
429
|
}],
|
|
488
|
-
_panels: [{
|
|
489
|
-
type: i0.ContentChildren,
|
|
490
|
-
args: [i0.forwardRef(() => AccordionPanel), {
|
|
491
|
-
...{
|
|
492
|
-
descendants: true
|
|
493
|
-
},
|
|
494
|
-
isSignal: true
|
|
495
|
-
}]
|
|
496
|
-
}],
|
|
497
430
|
disabled: [{
|
|
498
431
|
type: i0.Input,
|
|
499
432
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-panel.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-trigger.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-group.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-content.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 inject,\n afterRenderEffect,\n signal,\n computed,\n WritableSignal,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {DeferredContentAware, AccordionPanelPattern, AccordionTriggerPattern} from '../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 * @see [Accordion](guide/aria/accordion)\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 * @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 {InjectionToken} from '@angular/core';\nimport type {AccordionGroup} from './accordion-group';\n\n/** Token used to expose the accordion group. */\nexport const ACCORDION_GROUP = new InjectionToken<AccordionGroup>('ACCORDION_GROUP');\n","/**\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 signal,\n model,\n booleanAttribute,\n computed,\n WritableSignal,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {AccordionPanelPattern, AccordionTriggerPattern} from '../private';\nimport {ACCORDION_GROUP} from './accordion-tokens';\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 * @see [Accordion](guide/aria/accordion)\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(ACCORDION_GROUP);\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 * @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 booleanAttribute,\n computed,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {AccordionGroupPattern, AccordionTriggerPattern} from '../private';\nimport {AccordionTrigger} from './accordion-trigger';\nimport {AccordionPanel} from './accordion-panel';\nimport {ACCORDION_GROUP} from './accordion-tokens';\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 * @see [Accordion](guide/aria/accordion)\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 providers: [{provide: ACCORDION_GROUP, useExisting: AccordionGroup}],\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 * @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 {Directive} from '@angular/core';\nimport {DeferredContent} from '../private';\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 * @see [Accordion](guide/aria/accordion)\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","ACCORDION_GROUP","InjectionToken","AccordionTrigger","_elementRef","ElementRef","element","nativeElement","_accordionGroup","disabled","transform","booleanAttribute","expanded","model","active","_accordionPanelPattern","AccordionTriggerPattern","accordionGroup","accordionPanel","outputs","AccordionGroup","_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","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","listeners","providers","provide","useExisting","queries","propertyName","predicate","ctorParameters","propDecorators","ContentChildren","forwardRef","Input","alias","AccordionContent","DeferredContent"],"mappings":";;;;;;;;;;;;MAyDaA,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,wBAAwB,GAC/BC,MAAM,CAACC,SAAS;;WAAC;EAGVJ,QAAQ,GAA0B,IAAIK,qBAAqB,CAAC;IACnEb,EAAE,EAAE,IAAI,CAACA,EAAE;IACXI,OAAO,EAAE,IAAI,CAACA,OAAO;AACrBU,IAAAA,gBAAgB,EAAEA,MAAM,IAAI,CAACJ,wBAAwB;AACtD,GAAA,CAAC;AAEFK,EAAAA,WAAAA,GAAA;A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,EAAA,CAAA;AAAAZ,QAAAA,QAAA,EAAA,IAAA;AAAAsF,QAAAA,KAAA,EAAA,cAAA;AAAAnH,QAAAA,QAAA,EAAA;OAAA;AAAA,KAAA,CAAA;AAAA4E,IAAAA,IAAA,EAAA,CAAA;MAAA0B,IAAA,EAAAjF,EAAA,CAAA6F,KAAA;AAAAzE,MAAAA,IAAA,EAAA,CAAA;AAAAZ,QAAAA,QAAA,EAAA,IAAA;AAAAsF,QAAAA,KAAA,EAAA,MAAA;AAAAnH,QAAAA,QAAA,EAAA;OAAA;KAAA;AAAA;AAAA,CAAA,CAAA;;MCnDnEoH,gBAAgB,CAAA;;;;;UAAhBA,gBAAgB;AAAAjG,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAhB6F,gBAAgB;AAAA5F,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,QAAA,EAAA,iCAAA;AAAAW,IAAAA,cAAA,EAAA,CAAA;MAAAC,SAAA,EAAAC;AAAA,KAAA,CAAA;AAAAC,IAAAA,QAAA,EAAAlB;AAAA,GAAA,CAAA;;;;;;QAAhB+F,gBAAgB;AAAA5E,EAAAA,UAAA,EAAA,CAAA;UAJ5BjB,SAAS;AAACkB,IAAAA,IAAA,EAAA,CAAA;AACThB,MAAAA,QAAQ,EAAE,iCAAiC;MAC3CW,cAAc,EAAE,CAACiF,eAAe;KACjC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"accordion.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-panel.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-tokens.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-trigger.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-group.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/accordion-content.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 {Directive, afterRenderEffect, computed, inject, input} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {DeferredContentAware, AccordionTriggerPattern} from '../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 should\n * expose a template reference that will be used by the 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 #panel=\"ngAccordionPanel\">\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 * @see [Accordion](guide/aria/accordion)\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]': 'id()',\n '[attr.aria-labelledby]': '_pattern?.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 /** Whether the accordion panel is visible. True if the associated trigger is expanded. */\n readonly visible = computed(() => this._pattern?.expanded() === true);\n\n /**\n * The pattern for the accordion trigger that controls this panel.\n * This is set by the trigger when it initializes.\n * There is no need for a panel pattern, as the trigger has all the necessary logic.\n */\n _pattern?: AccordionTriggerPattern;\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._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 * @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 {InjectionToken} from '@angular/core';\nimport type {AccordionGroup} from './accordion-group';\n\n/** Token used to expose the accordion group. */\nexport const ACCORDION_GROUP = new InjectionToken<AccordionGroup>('ACCORDION_GROUP');\n","/**\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 ElementRef,\n OnInit,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n} from '@angular/core';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {AccordionTriggerPattern} from '../private';\nimport {ACCORDION_GROUP} from './accordion-tokens';\nimport {AccordionPanel} from './accordion-panel';\n\n/**\n * The trigger that toggles the visibility of its associated `ngAccordionPanel`.\n *\n * This directive requires the `panel` input be set to the template reference of the `ngAccordionPanel`\n * it 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 [panel]=\"panel\">\n * Accordion Trigger Text\n * </button>\n * ```\n *\n * @developerPreview 21.0\n * @see [Accordion](guide/aria/accordion)\n */\n@Directive({\n selector: '[ngAccordionTrigger]',\n exportAs: 'ngAccordionTrigger',\n host: {\n '[attr.data-active]': 'active()',\n 'role': 'button',\n '[id]': '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 implements OnInit {\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(ACCORDION_GROUP);\n\n /** The associated AccordionPanel. */\n readonly panel = input.required<AccordionPanel>();\n\n /** The unique identifier for the trigger. */\n readonly id = input(inject(_IdGenerator).getId('ng-accordion-trigger-', true));\n\n /** The unique identifier for the correspondingtrigger panel. */\n readonly panelId = computed(() => this.panel().id());\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 UI pattern instance for this trigger. */\n _pattern!: AccordionTriggerPattern;\n\n ngOnInit() {\n this._pattern = new AccordionTriggerPattern({\n ...this,\n element: () => this.element,\n accordionGroup: () => this._accordionGroup._pattern,\n accordionPanelId: this.panelId,\n });\n\n this.panel()._pattern = this._pattern;\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 * @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 ElementRef,\n booleanAttribute,\n computed,\n contentChildren,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {AccordionGroupPattern} from '../private';\nimport {AccordionTrigger} from './accordion-trigger';\nimport {ACCORDION_GROUP} from './accordion-tokens';\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\">\n * <div class=\"accordion-item\">\n * <h3>\n * <button ngAccordionTrigger [panel]=\"panel1\">Item 1</button>\n * </h3>\n * <div ngAccordionPanel #panel1=\"ngAccordionPanel\">\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 [panel]=\"panel2\">Item 2</button>\n * </h3>\n * <div ngAccordionPanel #panel2=\"ngAccordionPanel\">\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 * @see [Accordion](guide/aria/accordion)\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 providers: [{provide: ACCORDION_GROUP, useExisting: AccordionGroup}],\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 corresponding patterns for the accordion triggers. */\n private readonly _triggerPatterns = computed(() => this._triggers().map(t => t._pattern));\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 element: () => this.element,\n activeItem: signal(undefined),\n items: this._triggerPatterns,\n // TODO(ok7sai): Investigate whether an accordion should support horizontal mode.\n orientation: () => 'vertical',\n });\n\n /** Expands all accordion panels if multi-expandable. */\n expandAll() {\n this._pattern.expandAll();\n }\n\n /** Collapses all accordion panels. */\n collapseAll() {\n this._pattern.collapseAll();\n }\n}\n","/**\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 {Directive} from '@angular/core';\nimport {DeferredContent} from '../private';\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 * @see [Accordion](guide/aria/accordion)\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","visible","computed","_pattern","expanded","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","ACCORDION_GROUP","InjectionToken","AccordionTrigger","_elementRef","ElementRef","element","nativeElement","_accordionGroup","panel","required","panelId","disabled","transform","booleanAttribute","model","active","ngOnInit","AccordionTriggerPattern","accordionGroup","accordionPanelId","outputs","AccordionGroup","_triggers","contentChildren","descendants","_triggerPatterns","map","t","ngDevMode","debugName","textDirection","Directionality","valueSignal","multiExpandable","softDisabled","wrap","AccordionGroupPattern","activeItem","signal","undefined","items","orientation","expandAll","collapseAll","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","listeners","providers","provide","useExisting","propDecorators","ContentChildren","forwardRef","Input","alias","AccordionContent","DeferredContent"],"mappings":";;;;;;;;;;;;MAiDaA,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;AAGnEC,EAAAA,OAAO,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACC,QAAQ,EAAEC,QAAQ,EAAE,KAAK,IAAI;;WAAC;EAOrED,QAAQ;AAERE,EAAAA,WAAAA,GAAA;AAEEC,IAAAA,iBAAiB,CAAC,MAAK;AACrB,MAAA,IAAI,CAACZ,qBAAqB,CAACa,cAAc,CAACC,GAAG,CAAC,IAAI,CAACP,OAAO,EAAE,CAAC;AAC/D,KAAC,CAAC;AACJ;AAGAQ,EAAAA,MAAMA,GAAA;AACJ,IAAA,IAAI,CAACN,QAAQ,EAAEO,IAAI,EAAE;AACvB;AAGAC,EAAAA,QAAQA,GAAA;AACN,IAAA,IAAI,CAACR,QAAQ,EAAES,KAAK,EAAE;AACxB;AAGAC,EAAAA,MAAMA,GAAA;AACJ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AA,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":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/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 Aria package. */\nexport const VERSION = new Version('21.2.
|
|
1
|
+
{"version":3,"file":"aria.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/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 Aria package. */\nexport const VERSION = new Version('21.2.4');\n"],"names":["VERSION","Version"],"mappings":";;MAWaA,OAAO,GAAG,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
|
package/fesm2022/private.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export { untracked } from '@angular/core/primitives/signals';
|
|
|
5
5
|
export { computed, convertGetterSetterToWritableSignalLike, linkedSignal, signal } from './_signal-like-chunk.mjs';
|
|
6
6
|
export { TabListPattern, TabPanelPattern, TabPattern } from './_tabs-chunk.mjs';
|
|
7
7
|
export { ToolbarPattern, ToolbarWidgetGroupPattern, ToolbarWidgetPattern } from './_toolbar-widget-group-chunk.mjs';
|
|
8
|
-
export { AccordionGroupPattern,
|
|
8
|
+
export { AccordionGroupPattern, AccordionTriggerPattern } from './_accordion-chunk.mjs';
|
|
9
9
|
export { ComboboxTreePattern, TreeItemPattern, TreePattern } from './_combobox-tree-chunk.mjs';
|
|
10
10
|
export { GridCellPattern, GridCellWidgetPattern, GridPattern, GridRowPattern } from './_widget-chunk.mjs';
|
|
11
11
|
export { DeferredContent, DeferredContentAware } from './_deferred-content-chunk.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/aria",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.4",
|
|
4
4
|
"description": "Angular Aria",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/angular/components#readme",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/cdk": "21.2.
|
|
15
|
+
"@angular/cdk": "21.2.4",
|
|
16
16
|
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
Binary file
|
|
@@ -5,8 +5,6 @@ import { ListNavigationInputs, ListFocusInputs, ListNavigation, ListFocus, Signa
|
|
|
5
5
|
|
|
6
6
|
/** Inputs of the AccordionGroupPattern. */
|
|
7
7
|
interface AccordionGroupInputs extends Omit<ListNavigationInputs<AccordionTriggerPattern> & ListFocusInputs<AccordionTriggerPattern> & Omit<ListExpansionInputs, 'items'>, 'focusMode'> {
|
|
8
|
-
/** A function that returns the trigger associated with a given element. */
|
|
9
|
-
getItem: (e: Element | null | undefined) => AccordionTriggerPattern | undefined;
|
|
10
8
|
}
|
|
11
9
|
/** A pattern controls the nested Accordions. */
|
|
12
10
|
declare class AccordionGroupPattern {
|
|
@@ -34,15 +32,19 @@ declare class AccordionGroupPattern {
|
|
|
34
32
|
onFocus(event: FocusEvent): void;
|
|
35
33
|
/** Toggles the expansion state of the active accordion item. */
|
|
36
34
|
toggle(): void;
|
|
35
|
+
/** Expands all accordion panels if multi-expandable. */
|
|
36
|
+
expandAll(): void;
|
|
37
|
+
/** Collapses all accordion panels. */
|
|
38
|
+
collapseAll(): void;
|
|
39
|
+
/** Finds the trigger pattern for a given element. */
|
|
40
|
+
private _findTriggerPattern;
|
|
37
41
|
}
|
|
38
42
|
/** Inputs for the AccordionTriggerPattern. */
|
|
39
43
|
interface AccordionTriggerInputs extends Omit<ListNavigationItem & ListFocusItem, 'index'>, Omit<ExpansionItem, 'expandable'> {
|
|
40
|
-
/** A local unique identifier for the trigger's corresponding panel. */
|
|
41
|
-
panelId: SignalLike<string>;
|
|
42
44
|
/** The parent accordion group that controls this trigger. */
|
|
43
45
|
accordionGroup: SignalLike<AccordionGroupPattern>;
|
|
44
|
-
/** The accordion panel controlled by this trigger. */
|
|
45
|
-
|
|
46
|
+
/** The accordion panel id controlled by this trigger. */
|
|
47
|
+
accordionPanelId: SignalLike<string>;
|
|
46
48
|
}
|
|
47
49
|
/** A pattern controls the expansion state of an accordion. */
|
|
48
50
|
declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusItem, ExpansionItem {
|
|
@@ -58,15 +60,13 @@ declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusIt
|
|
|
58
60
|
/** Whether the trigger is active. */
|
|
59
61
|
readonly active: SignalLike<boolean>;
|
|
60
62
|
/** Id of the accordion panel controlled by the trigger. */
|
|
61
|
-
readonly controls: SignalLike<string
|
|
63
|
+
readonly controls: SignalLike<string>;
|
|
62
64
|
/** The tabindex of the trigger. */
|
|
63
65
|
readonly tabIndex: SignalLike<-1 | 0>;
|
|
64
66
|
/** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */
|
|
65
67
|
readonly disabled: SignalLike<boolean>;
|
|
66
68
|
/** Whether the trigger is hard disabled. */
|
|
67
69
|
readonly hardDisabled: SignalLike<boolean>;
|
|
68
|
-
/** The index of the trigger within its accordion group. */
|
|
69
|
-
readonly index: SignalLike<number>;
|
|
70
70
|
constructor(inputs: AccordionTriggerInputs);
|
|
71
71
|
/** Opens the accordion panel. */
|
|
72
72
|
open(): void;
|
|
@@ -75,26 +75,6 @@ declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusIt
|
|
|
75
75
|
/** Toggles the accordion panel. */
|
|
76
76
|
toggle(): void;
|
|
77
77
|
}
|
|
78
|
-
/** Represents the required inputs for the AccordionPanelPattern. */
|
|
79
|
-
interface AccordionPanelInputs {
|
|
80
|
-
/** A global unique identifier for the panel. */
|
|
81
|
-
id: SignalLike<string>;
|
|
82
|
-
/** A local unique identifier for the panel, matching its trigger's panelId. */
|
|
83
|
-
panelId: SignalLike<string>;
|
|
84
|
-
/** The parent accordion trigger that controls this panel. */
|
|
85
|
-
accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;
|
|
86
|
-
}
|
|
87
|
-
/** Represents an accordion panel. */
|
|
88
|
-
declare class AccordionPanelPattern {
|
|
89
|
-
readonly inputs: AccordionPanelInputs;
|
|
90
|
-
/** A global unique identifier for the panel. */
|
|
91
|
-
id: SignalLike<string>;
|
|
92
|
-
/** The parent accordion trigger that controls this panel. */
|
|
93
|
-
accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;
|
|
94
|
-
/** Whether the accordion panel is hidden. True if the associated trigger is not expanded. */
|
|
95
|
-
hidden: SignalLike<boolean>;
|
|
96
|
-
constructor(inputs: AccordionPanelInputs);
|
|
97
|
-
}
|
|
98
78
|
|
|
99
|
-
export { AccordionGroupPattern,
|
|
100
|
-
export type { AccordionGroupInputs,
|
|
79
|
+
export { AccordionGroupPattern, AccordionTriggerPattern };
|
|
80
|
+
export type { AccordionGroupInputs, AccordionTriggerInputs };
|
|
@@ -18,8 +18,6 @@ interface ListFocusItem {
|
|
|
18
18
|
element: SignalLike<HTMLElement | undefined>;
|
|
19
19
|
/** Whether an item is disabled. */
|
|
20
20
|
disabled: SignalLike<boolean>;
|
|
21
|
-
/** The index of the item in the list. */
|
|
22
|
-
index: SignalLike<number>;
|
|
23
21
|
}
|
|
24
22
|
/** Represents the required inputs for a collection that contains focusable items. */
|
|
25
23
|
interface ListFocusInputs<T extends ListFocusItem> {
|
package/types/accordion.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { AccordionTriggerPattern,
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import { AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.js';
|
|
4
4
|
import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.js';
|
|
5
5
|
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
6
6
|
import './_keyboard-event-manager-chunk.js';
|
|
@@ -11,15 +11,15 @@ import './_expansion-chunk.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* The content panel of an accordion item that is conditionally visible.
|
|
13
13
|
*
|
|
14
|
-
* This directive is a container for the content that is shown or hidden. It
|
|
15
|
-
* a
|
|
14
|
+
* This directive is a container for the content that is shown or hidden. It should
|
|
15
|
+
* expose a template reference that will be used by the corresponding `ngAccordionTrigger`.
|
|
16
16
|
* The content within the panel should be provided using an `ng-template` with the
|
|
17
17
|
* `ngAccordionContent` directive so that the content is not rendered on the page until the trigger
|
|
18
18
|
* is expanded. It applies `role="region"` for accessibility and uses the `inert` attribute to hide
|
|
19
19
|
* its content from assistive technologies when not visible.
|
|
20
20
|
*
|
|
21
21
|
* ```html
|
|
22
|
-
* <div ngAccordionPanel
|
|
22
|
+
* <div ngAccordionPanel #panel="ngAccordionPanel">
|
|
23
23
|
* <ng-template ngAccordionContent>
|
|
24
24
|
* <p>This content is lazily rendered and will be shown when the panel is expanded.</p>
|
|
25
25
|
* </ng-template>
|
|
@@ -34,14 +34,14 @@ declare class AccordionPanel {
|
|
|
34
34
|
private readonly _deferredContentAware;
|
|
35
35
|
/** A global unique identifier for the panel. */
|
|
36
36
|
readonly id: _angular_core.InputSignal<string>;
|
|
37
|
-
/** A local unique identifier for the panel, used to match with its trigger's `panelId`. */
|
|
38
|
-
readonly panelId: _angular_core.InputSignal<string>;
|
|
39
37
|
/** Whether the accordion panel is visible. True if the associated trigger is expanded. */
|
|
40
38
|
readonly visible: _angular_core.Signal<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The pattern for the accordion trigger that controls this panel.
|
|
41
|
+
* This is set by the trigger when it initializes.
|
|
42
|
+
* There is no need for a panel pattern, as the trigger has all the necessary logic.
|
|
43
|
+
*/
|
|
44
|
+
_pattern?: AccordionTriggerPattern;
|
|
45
45
|
constructor();
|
|
46
46
|
/** Expands this item. */
|
|
47
47
|
expand(): void;
|
|
@@ -50,7 +50,7 @@ declare class AccordionPanel {
|
|
|
50
50
|
/** Toggles the expansion state of this item. */
|
|
51
51
|
toggle(): void;
|
|
52
52
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionPanel, never>;
|
|
53
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "id": { "alias": "id"; "required": false; "isSignal": true; };
|
|
53
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -62,12 +62,12 @@ declare class AccordionPanel {
|
|
|
62
62
|
* It supports both single and multiple expansion modes.
|
|
63
63
|
*
|
|
64
64
|
* ```html
|
|
65
|
-
* <div ngAccordionGroup [multiExpandable]="true"
|
|
65
|
+
* <div ngAccordionGroup [multiExpandable]="true">
|
|
66
66
|
* <div class="accordion-item">
|
|
67
67
|
* <h3>
|
|
68
|
-
* <button ngAccordionTrigger
|
|
68
|
+
* <button ngAccordionTrigger [panel]="panel1">Item 1</button>
|
|
69
69
|
* </h3>
|
|
70
|
-
* <div ngAccordionPanel
|
|
70
|
+
* <div ngAccordionPanel #panel1="ngAccordionPanel">
|
|
71
71
|
* <ng-template ngAccordionContent>
|
|
72
72
|
* <p>Content for Item 1.</p>
|
|
73
73
|
* </ng-template>
|
|
@@ -75,9 +75,9 @@ declare class AccordionPanel {
|
|
|
75
75
|
* </div>
|
|
76
76
|
* <div class="accordion-item">
|
|
77
77
|
* <h3>
|
|
78
|
-
* <button ngAccordionTrigger
|
|
78
|
+
* <button ngAccordionTrigger [panel]="panel2">Item 2</button>
|
|
79
79
|
* </h3>
|
|
80
|
-
* <div ngAccordionPanel
|
|
80
|
+
* <div ngAccordionPanel #panel2="ngAccordionPanel">
|
|
81
81
|
* <ng-template ngAccordionContent>
|
|
82
82
|
* <p>Content for Item 2.</p>
|
|
83
83
|
* </ng-template>
|
|
@@ -96,10 +96,8 @@ declare class AccordionGroup {
|
|
|
96
96
|
readonly element: HTMLElement;
|
|
97
97
|
/** The AccordionTriggers nested inside this group. */
|
|
98
98
|
private readonly _triggers;
|
|
99
|
-
/** The
|
|
99
|
+
/** The corresponding patterns for the accordion triggers. */
|
|
100
100
|
private readonly _triggerPatterns;
|
|
101
|
-
/** The AccordionPanels nested inside this group. */
|
|
102
|
-
private readonly _panels;
|
|
103
101
|
/** The text direction (ltr or rtl). */
|
|
104
102
|
readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
105
103
|
/** Whether the entire accordion group is disabled. */
|
|
@@ -115,28 +113,25 @@ declare class AccordionGroup {
|
|
|
115
113
|
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
116
114
|
/** The UI pattern instance for this accordion group. */
|
|
117
115
|
readonly _pattern: AccordionGroupPattern;
|
|
118
|
-
constructor();
|
|
119
116
|
/** Expands all accordion panels if multi-expandable. */
|
|
120
117
|
expandAll(): void;
|
|
121
118
|
/** Collapses all accordion panels. */
|
|
122
119
|
collapseAll(): void;
|
|
123
|
-
/** Gets the trigger pattern for a given element. */
|
|
124
|
-
private _getItem;
|
|
125
120
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
|
|
126
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, ["_triggers"
|
|
121
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, ["_triggers"], never, true, never>;
|
|
127
122
|
}
|
|
128
123
|
|
|
129
124
|
/**
|
|
130
125
|
* The trigger that toggles the visibility of its associated `ngAccordionPanel`.
|
|
131
126
|
*
|
|
132
|
-
* This directive requires
|
|
133
|
-
* controls. When clicked, it will expand or collapse the panel. It also handles keyboard
|
|
127
|
+
* This directive requires the `panel` input be set to the template reference of the `ngAccordionPanel`
|
|
128
|
+
* it controls. When clicked, it will expand or collapse the panel. It also handles keyboard
|
|
134
129
|
* interactions for navigation within the `ngAccordionGroup`. It applies `role="button"` and manages
|
|
135
130
|
* `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.
|
|
136
131
|
* The `disabled` input can be used to disable the trigger.
|
|
137
132
|
*
|
|
138
133
|
* ```html
|
|
139
|
-
* <button ngAccordionTrigger
|
|
134
|
+
* <button ngAccordionTrigger [panel]="panel">
|
|
140
135
|
* Accordion Trigger Text
|
|
141
136
|
* </button>
|
|
142
137
|
* ```
|
|
@@ -144,27 +139,28 @@ declare class AccordionGroup {
|
|
|
144
139
|
* @developerPreview 21.0
|
|
145
140
|
* @see [Accordion](guide/aria/accordion)
|
|
146
141
|
*/
|
|
147
|
-
declare class AccordionTrigger {
|
|
142
|
+
declare class AccordionTrigger implements OnInit {
|
|
148
143
|
/** A reference to the trigger element. */
|
|
149
144
|
private readonly _elementRef;
|
|
150
145
|
/** A reference to the trigger element. */
|
|
151
146
|
readonly element: HTMLElement;
|
|
152
147
|
/** The parent AccordionGroup. */
|
|
153
148
|
private readonly _accordionGroup;
|
|
154
|
-
/**
|
|
149
|
+
/** The associated AccordionPanel. */
|
|
150
|
+
readonly panel: _angular_core.InputSignal<AccordionPanel>;
|
|
151
|
+
/** The unique identifier for the trigger. */
|
|
155
152
|
readonly id: _angular_core.InputSignal<string>;
|
|
156
|
-
/**
|
|
157
|
-
readonly panelId: _angular_core.
|
|
153
|
+
/** The unique identifier for the correspondingtrigger panel. */
|
|
154
|
+
readonly panelId: _angular_core.Signal<string>;
|
|
158
155
|
/** Whether the trigger is disabled. */
|
|
159
156
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
160
157
|
/** Whether the corresponding panel is expanded. */
|
|
161
158
|
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
162
159
|
/** Whether the trigger is active. */
|
|
163
160
|
readonly active: _angular_core.Signal<boolean>;
|
|
164
|
-
/** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
|
|
165
|
-
readonly _accordionPanelPattern: WritableSignal<AccordionPanelPattern | undefined>;
|
|
166
161
|
/** The UI pattern instance for this trigger. */
|
|
167
|
-
|
|
162
|
+
_pattern: AccordionTriggerPattern;
|
|
163
|
+
ngOnInit(): void;
|
|
168
164
|
/** Expands this item. */
|
|
169
165
|
expand(): void;
|
|
170
166
|
/** Collapses this item. */
|
|
@@ -172,7 +168,7 @@ declare class AccordionTrigger {
|
|
|
172
168
|
/** Toggles the expansion state of this item. */
|
|
173
169
|
toggle(): void;
|
|
174
170
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
|
|
175
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "
|
|
171
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "panel": { "alias": "panel"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
|
|
176
172
|
}
|
|
177
173
|
|
|
178
174
|
/**
|
package/types/private.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { WritableSignalLike, computed, convertGetterSetterToWritableSignalLike,
|
|
|
7
7
|
export { MenuBarInputs, MenuBarPattern, MenuInputs, MenuItemInputs, MenuItemPattern, MenuPattern, MenuTriggerInputs, MenuTriggerPattern } from './_menu-chunk.js';
|
|
8
8
|
export { TabInputs, TabListInputs, TabListPattern, TabPanelInputs, TabPanelPattern, TabPattern } from './_tabs-chunk.js';
|
|
9
9
|
export { ToolbarInputs, ToolbarPattern, ToolbarWidgetGroupInputs, ToolbarWidgetGroupPattern, ToolbarWidgetInputs, ToolbarWidgetPattern } from './_toolbar-chunk.js';
|
|
10
|
-
export { AccordionGroupInputs, AccordionGroupPattern,
|
|
10
|
+
export { AccordionGroupInputs, AccordionGroupPattern, AccordionTriggerInputs, AccordionTriggerPattern } from './_accordion-chunk.js';
|
|
11
11
|
import { TreeInputs, TreeItemPattern, TreePattern } from './_tree-chunk.js';
|
|
12
12
|
export { TreeItemInputs } from './_tree-chunk.js';
|
|
13
13
|
export { GridCellInputs, GridCellPattern, GridCellWidgetInputs, GridCellWidgetPattern, GridInputs, GridPattern, GridRowInputs, GridRowPattern } from './_grid-chunk.js';
|