@angular/aria 22.0.0-next.6 → 22.0.0-next.8
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 +1 -1
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -3
- package/fesm2022/_collection-chunk.mjs.map +1 -0
- package/fesm2022/_deferred-content-chunk.mjs +16 -14
- package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
- package/fesm2022/_expansion-chunk.mjs.map +1 -1
- package/fesm2022/_list-chunk.mjs +4 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs +4 -2
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +6 -50
- package/fesm2022/_option-chunk.mjs.map +1 -0
- package/fesm2022/_tabs-chunk.mjs +22 -47
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_transforms-chunk.mjs +8 -0
- package/fesm2022/_transforms-chunk.mjs.map +1 -0
- package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
- package/fesm2022/_tree-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +84 -21
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs.map +1 -1
- package/fesm2022/accordion.mjs +32 -57
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox-testing.mjs +79 -0
- package/fesm2022/combobox-testing.mjs.map +1 -0
- package/fesm2022/combobox.mjs +287 -296
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid-testing.mjs +80 -0
- package/fesm2022/grid-testing.mjs.map +1 -0
- package/fesm2022/grid.mjs +113 -86
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +4 -0
- package/fesm2022/listbox-testing.mjs.map +1 -1
- package/fesm2022/listbox.mjs +231 -225
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +11 -0
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +66 -84
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +166 -9
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +241 -222
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +5 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +23 -33
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +12 -0
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +160 -156
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +10 -2
- package/types/_accordion-chunk.d.ts +2 -2
- package/types/_collection-chunk.d.ts +42 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +23 -9
- package/types/_keyboard-event-manager-chunk.d.ts +1 -1
- package/types/_list-chunk.d.ts +1 -1
- package/types/_list-navigation-chunk.d.ts +1 -1
- package/types/_listbox-chunk.d.ts +1 -1
- package/types/_menu-chunk.d.ts +1 -1
- package/types/_tabs-chunk.d.ts +8 -43
- package/types/_toolbar-chunk.d.ts +1 -1
- package/types/_tree-chunk.d.ts +1 -1
- package/types/accordion.d.ts +7 -13
- package/types/combobox-testing.d.ts +63 -0
- package/types/combobox.d.ts +96 -192
- package/types/grid-testing.d.ts +83 -0
- package/types/grid.d.ts +102 -90
- package/types/listbox-testing.d.ts +25 -0
- package/types/listbox.d.ts +60 -63
- package/types/menu-testing.d.ts +6 -0
- package/types/menu.d.ts +24 -17
- package/types/private.d.ts +115 -133
- package/types/tabs.d.ts +26 -24
- package/types/toolbar-testing.d.ts +4 -0
- package/types/toolbar.d.ts +5 -6
- package/types/tree-testing.d.ts +8 -0
- package/types/tree.d.ts +11 -15
- package/fesm2022/_combobox-chunk.mjs +0 -429
- package/fesm2022/_combobox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
- package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
- package/fesm2022/_element-chunk.mjs +0 -6
- package/fesm2022/_element-chunk.mjs.map +0 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
- package/fesm2022/_signal-like-chunk.mjs.map +0 -1
- package/resources/code-examples.db +0 -0
- package/types/_combobox-chunk.d.ts +0 -194
- package/types/_element-chunk.d.ts +0 -10
- package/types/_pointer-event-manager-chunk.d.ts +0 -34
- package/types/_signal-like-chunk.d.ts +0 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ListExpansion } from './_expansion-chunk.mjs';
|
|
2
2
|
import { ListFocus, ListNavigation } from './_list-navigation-chunk.mjs';
|
|
3
|
-
import { computed, KeyboardEventManager } from './
|
|
3
|
+
import { computed, KeyboardEventManager } from './_collection-chunk.mjs';
|
|
4
4
|
import { ClickEventManager } from './_click-event-manager-chunk.mjs';
|
|
5
5
|
|
|
6
6
|
const focusMode = () => 'roving';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_accordion-chunk.mjs","sources":["../../../../../k8-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, ClickEventManager} 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 readonly 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 readonly 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 readonly 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 click event manager for the accordion trigger. */\n readonly click = computed(() => {\n return new ClickEventManager<PointerEvent>().on((e: PointerEvent) => {\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 click events on the trigger, delegating to the group if not disabled. */\n onClick(event: PointerEvent): void {\n this.click().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","click","ClickEventManager","e","item","_findTriggerPattern","target","goto","onKeydown","event","handle","onClick","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,IAAA,CAAAA,MAAM,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,EAAA;EAGSS,OAAO,GAAGC,QAAQ,CAAC,MAAK;IAC/B,IAAI,IAAI,CAACV,MAAM,CAACW,WAAW,EAAE,KAAK,UAAU,EAAE;AAC5C,MAAA,OAAO,SAAS;AAClB,IAAA;AACA,IAAA,OAAO,IAAI,CAACX,MAAM,CAACY,aAAa,EAAE,KAAK,KAAK,GAAG,YAAY,GAAG,WAAW;AAC3E,EAAA,CAAC,CAAC;EAGO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AI,CAACG,QAAQ,GAAGxD,MAAM,CAAC6D,gBAAgB;AACzC,EAAA;AAGAC,EAAAA,IAAIA,GAAA;AACF,IAAA,IAAI,CAAC9D,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAAC2D,IAAI,CAAC,IAAI,CAAC;AAC3D,EAAA;AAGAC,EAAAA,KAAKA,GAAA;AACH,IAAA,IAAI,CAAC/D,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAAC4D,KAAK,CAAC,IAAI,CAAC;AAC5D,EAAA;AAGAzC,EAAAA,MAAMA,GAAA;AACJ,IAAA,IAAI,CAACtB,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAACmB,MAAM,CAAC,IAAI,CAAC;AAC7D,EAAA;AACD;;;;"}
|
|
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, ClickEventManager} 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 readonly 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 readonly 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 readonly 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 click event manager for the accordion trigger. */\n readonly click = computed(() => {\n return new ClickEventManager<PointerEvent>().on((e: PointerEvent) => {\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 click events on the trigger, delegating to the group if not disabled. */\n onClick(event: PointerEvent): void {\n this.click().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","click","ClickEventManager","e","item","_findTriggerPattern","target","goto","onKeydown","event","handle","onClick","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,IAAA,CAAAA,MAAM,GAANA,MAAM;AACzB,IAAA,IAAI,CAACE,aAAa,GAAG,IAAIG,SAAS,CAAC;AACjC,MAAA,GAAGL,MA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uB,QAAQ,GAAGhD,QAAQ,CAC1B,MAAM,IAAI,CAACV,MAAM,CAAC0D,QAAQ,EAAE,IAAI,IAAI,CAAC1D,MAAM,CAACuD,cAAc,EAAE,CAACvD,MAAM,CAAC0D,QAAQ,EAAE,CAC/E;EAGQC,YAAY,GAAGjD,QAAQ,CAC9B,MAAM,IAAI,CAACgD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC1D,MAAM,CAACuD,cAAc,EAAE,CAACvD,MAAM,CAAC4D,YAAY,EAAE,CAC7E;EAEDxD,WAAAA,CAAqBJ,MAA8B,EAAA;IAA9B,IAAA,CAAAA,MAAM,GAANA,MAAM;AACzB,IAAA,IAAI,CAACmD,EAAE,GAAGnD,MAAM,CAACmD,EAAE;AACnB,IAAA,IAAI,CAACE,QAAQ,GAAGrD,MAAM,CAACqD,QAAQ;AAC/B,IAAA,IAAI,CAACG,QAAQ,GAAGxD,MAAM,CAAC6D,gBAAgB;AACzC,EAAA;AAGAC,EAAAA,IAAIA,GAAA;AACF,IAAA,IAAI,CAAC9D,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAAC2D,IAAI,CAAC,IAAI,CAAC;AAC3D,EAAA;AAGAC,EAAAA,KAAKA,GAAA;AACH,IAAA,IAAI,CAAC/D,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAAC4D,KAAK,CAAC,IAAI,CAAC;AAC5D,EAAA;AAGAzC,EAAAA,MAAMA,GAAA;AACJ,IAAA,IAAI,CAACtB,MAAM,CAACuD,cAAc,EAAE,CAACpD,iBAAiB,CAACmB,MAAM,CAAC,IAAI,CAAC;AAC7D,EAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_click-event-manager-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_click-event-manager-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/click-event-manager.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 EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n Modifier,\n} from './event-manager';\n\n/**\n * Gets whether an event could be a simulated click event.\n *\n * Screen readers and keyboard activation (Enter/Space) often dispatch fake click\n * events. We distinguish them by checking if `event.detail` is zero or if\n * `event.pointerType` is missing.\n */\nexport function isFakeClick(event: PointerEvent): boolean {\n return event.detail === 0 || !event.pointerType;\n}\n\n/**\n * Gets whether an event is a programmatic click (e.g. triggered by .click() or .dispatchEvent()).\n * Programmatic events are untrusted.\n */\nexport function isProgrammaticClick(event: Event): boolean {\n return !event.isTrusted;\n}\n\n/**\n * An event manager that is specialized for handling click events.\n *\n * This manager should ONLY be used to handle click events. It explicitly\n * filters out simulated click events generated by browsers when Enter or Space\n * keys are pressed, to avoid concurrent logic or overwriting selection state\n * when handling keyboard activation explicitly via KeyboardEventManager.\n */\nexport class ClickEventManager<T extends PointerEvent> extends EventManager<T> {\n readonly options: EventHandlerOptions = {\n preventDefault: false,\n stopPropagation: false,\n };\n\n /**\n * Configures this event manager to handle events with a specific modifier combination.\n */\n on(modifiers: ModifierInputs, handler: EventHandler<T>): this;\n\n /**\n * Configures this event manager to handle events with no modifiers.\n *\n * @param handler The handler function\n */\n on(handler: EventHandler<T>): this;\n\n on(...args: unknown[]) {\n const {handler, modifiers} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler,\n matcher: event => this._isMatch(event, modifiers),\n ...this.options,\n });\n return this;\n }\n\n private _normalizeInputs(...args: unknown[]) {\n if (args.length === 2) {\n return {\n modifiers: args[0] as ModifierInputs,\n handler: args[1] as EventHandler<T>,\n };\n }\n\n return {\n modifiers: Modifier.None,\n handler: args[0] as EventHandler<T>,\n };\n }\n\n _isMatch(event: T, modifiers: ModifierInputs) {\n const isAllowed = isProgrammaticClick(event) || !isFakeClick(event);\n return isAllowed && hasModifiers(event, modifiers);\n }\n}\n"],"names":["isFakeClick","event","detail","pointerType","isProgrammaticClick","isTrusted","ClickEventManager","EventManager","options","preventDefault","stopPropagation","on","args","handler","modifiers","_normalizeInputs","configs","push","matcher","_isMatch","length","Modifier","None","isAllowed","hasModifiers"],"mappings":";;AAwBM,SAAUA,WAAWA,CAACC,KAAmB,EAAA;EAC7C,OAAOA,KAAK,CAACC,MAAM,KAAK,CAAC,IAAI,CAACD,KAAK,CAACE,WAAW;AACjD;AAMM,SAAUC,mBAAmBA,CAACH,KAAY,EAAA;EAC9C,OAAO,CAACA,KAAK,CAACI,SAAS;AACzB;AAUM,MAAOC,iBAA0C,SAAQC,YAAe,CAAA;AACnEC,EAAAA,OAAO,GAAwB;AACtCC,IAAAA,cAAc,EAAE,KAAK;AACrBC,IAAAA,eAAe,EAAE;GAClB;EAcDC,EAAEA,CAAC,GAAGC,IAAe,EAAA;IACnB,MAAM;MAACC,OAAO;AAAEC,MAAAA;AAAS,KAAC,GAAG,IAAI,CAACC,gBAAgB,CAAC,GAAGH,IAAI,CAAC;AAE3D,IAAA,IAAI,CAACI,OAAO,CAACC,IAAI,CAAC;MAChBJ,OAAO;MACPK,OAAO,EAAEjB,KAAK,IAAI,IAAI,CAACkB,QAAQ,CAAClB,KAAK,EAAEa,SAAS,CAAC;AACjD,MAAA,GAAG,IAAI,CAACN;AACT,KAAA,CAAC;AACF,IAAA,OAAO,IAAI;AACb,EAAA;EAEQO,gBAAgBA,CAAC,GAAGH,IAAe,EAAA;AACzC,IAAA,IAAIA,IAAI,CAACQ,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO;AACLN,QAAAA,SAAS,EAAEF,IAAI,CAAC,CAAC,CAAmB;QACpCC,OAAO,EAAED,IAAI,CAAC,CAAC;OAChB;AACH,IAAA;IAEA,OAAO;MACLE,SAAS,EAAEO,QAAQ,CAACC,IAAI;MACxBT,OAAO,EAAED,IAAI,CAAC,CAAC;KAChB;AACH,EAAA;AAEAO,EAAAA,QAAQA,CAAClB,KAAQ,EAAEa,SAAyB,EAAA;IAC1C,MAAMS,SAAS,GAAGnB,mBAAmB,CAACH,KAAK,CAAC,IAAI,CAACD,WAAW,CAACC,KAAK,CAAC;AACnE,IAAA,OAAOsB,SAAS,IAAIC,YAAY,CAACvB,KAAK,EAAEa,SAAS,CAAC;AACpD,EAAA;AACD;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createComputed, SIGNAL, createLinkedSignal, linkedSignalUpdateFn, linkedSignalSetFn, createSignal } from '@angular/core/primitives/signals';
|
|
2
|
+
import { signal as signal$1, computed as computed$1 } from '@angular/core';
|
|
2
3
|
|
|
3
4
|
var Modifier;
|
|
4
5
|
(function (Modifier) {
|
|
@@ -95,7 +96,6 @@ function convertGetterSetterToWritableSignalLike(getter, setter) {
|
|
|
95
96
|
}
|
|
96
97
|
function computed(computation) {
|
|
97
98
|
const computed = createComputed(computation);
|
|
98
|
-
computed.toString = () => `[Computed: ${computed()}]`;
|
|
99
99
|
computed[SIGNAL].debugName = '';
|
|
100
100
|
return computed;
|
|
101
101
|
}
|
|
@@ -118,5 +118,53 @@ function linkedSignal(sourceFn) {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
function sortDirectives(a, b) {
|
|
122
|
+
return (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_PRECEDING) > 0 ? 1 : -1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
class SortedCollection {
|
|
126
|
+
_items = signal$1(new Set());
|
|
127
|
+
_version = signal$1(0);
|
|
128
|
+
_observer;
|
|
129
|
+
orderedItems = computed$1(() => {
|
|
130
|
+
this._version();
|
|
131
|
+
const itemsArray = Array.from(this._items());
|
|
132
|
+
return itemsArray.sort(sortDirectives);
|
|
133
|
+
});
|
|
134
|
+
register(item) {
|
|
135
|
+
this._items.update(set => {
|
|
136
|
+
const newSet = new Set(set);
|
|
137
|
+
newSet.add(item);
|
|
138
|
+
return newSet;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
unregister(item) {
|
|
142
|
+
this._items.update(set => {
|
|
143
|
+
const newSet = new Set(set);
|
|
144
|
+
newSet.delete(item);
|
|
145
|
+
return newSet;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
startObserving(element) {
|
|
149
|
+
if (this._observer) {
|
|
150
|
+
this._observer.disconnect();
|
|
151
|
+
}
|
|
152
|
+
this._observer = new MutationObserver(mutations => {
|
|
153
|
+
const hasStructuralChange = mutations.some(m => m.addedNodes.length || m.removedNodes.length);
|
|
154
|
+
if (hasStructuralChange) {
|
|
155
|
+
this._version.update(v => v + 1);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
this._observer.observe(element, {
|
|
159
|
+
childList: true,
|
|
160
|
+
subtree: true
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
stopObserving() {
|
|
164
|
+
this._observer?.disconnect();
|
|
165
|
+
this._observer = undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { EventManager, KeyboardEventManager, Modifier, SortedCollection, computed, convertGetterSetterToWritableSignalLike, hasModifiers, linkedSignal, signal, sortDirectives };
|
|
170
|
+
//# sourceMappingURL=_collection-chunk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_collection-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/event-manager/keyboard-event-manager.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/signal-like/signal-like.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/utils/element.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/utils/collection.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\n/**\n * An event that supports modifier keys.\n *\n * Matches the native KeyboardEvent, MouseEvent, and TouchEvent.\n */\nexport interface EventWithModifiers extends Event {\n ctrlKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n metaKey: boolean;\n}\n\n/**\n * Options that are applicable to all event handlers.\n *\n * This library has not yet had a need for stopPropagationImmediate.\n */\nexport interface EventHandlerOptions {\n ignoreRepeat?: boolean;\n stopPropagation: boolean;\n preventDefault: boolean;\n}\n\n/** A basic event handler. */\nexport type EventHandler<T extends Event> = (event: T) => void;\n\n/** A function that determines whether an event is to be handled. */\nexport type EventMatcher<T extends Event> = (event: T) => boolean;\n\n/** A config that specifies how to handle a particular event. */\nexport interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {\n matcher: EventMatcher<T>;\n handler: EventHandler<T>;\n}\n\n/** Bit flag representation of the possible modifier keys that can be present on an event. */\nexport enum Modifier {\n None = 0,\n Ctrl = 0b1,\n Shift = 0b10,\n Alt = 0b100,\n Meta = 0b1000,\n Any = 'Any',\n}\n\nexport type ModifierInputs = Modifier | Modifier[];\n\n/**\n * Abstract base class for all event managers.\n *\n * Event managers are designed to normalize how event handlers are authored and create a safety net\n * for common event handling gotchas like remembering to call preventDefault or stopPropagation.\n */\nexport abstract class EventManager<T extends Event> {\n protected configs: EventHandlerConfig<T>[] = [];\n abstract options: EventHandlerOptions;\n\n /** Runs the handlers that match with the given event. */\n handle(event: T): void {\n for (const config of this.configs) {\n if (config.matcher(event)) {\n config.handler(event);\n\n if (config.preventDefault) {\n event.preventDefault();\n }\n\n if (config.stopPropagation) {\n event.stopPropagation();\n }\n }\n }\n }\n\n /** Configures the event manager to handle specific events. (See subclasses for more). */\n abstract on(...args: [...unknown[]]): this;\n}\n\n/** Gets bit flag representation of the modifier keys present on the given event. */\nexport function getModifiers(event: EventWithModifiers): number {\n return (\n (+event.ctrlKey && Modifier.Ctrl) |\n (+event.shiftKey && Modifier.Shift) |\n (+event.altKey && Modifier.Alt) |\n (+event.metaKey && Modifier.Meta)\n );\n}\n\n/**\n * Checks if the given event has modifiers that are an exact match for any of the given modifier\n * flag combinations.\n */\nexport function hasModifiers(event: EventWithModifiers, modifiers: ModifierInputs): boolean {\n const eventModifiers = getModifiers(event);\n const modifiersList = Array.isArray(modifiers) ? modifiers : [modifiers];\n\n if (modifiersList.includes(Modifier.Any)) {\n return true;\n }\n\n return modifiersList.some(modifiers => eventModifiers === modifiers);\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 {\n EventHandler,\n EventHandlerOptions,\n EventManager,\n hasModifiers,\n ModifierInputs,\n Modifier,\n} from './event-manager';\n\n/**\n * Used to represent a keycode.\n *\n * This is used to match whether an events keycode should be handled. The ability to match using a\n * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.\n */\ntype KeyCode = string | SignalLike<string> | RegExp;\n\n/**\n * An event manager that is specialized for handling keyboard events. By default this manager stops\n * propagation and prevents default on all events it handles.\n */\nexport class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {\n readonly options: EventHandlerOptions = {\n ignoreRepeat: true,\n preventDefault: true,\n stopPropagation: true,\n };\n\n /** Configures this event manager to handle events with a specific key and no modifiers. */\n on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;\n\n /** Configures this event manager to handle events with a specific modifer and key combination. */\n on(\n modifiers: ModifierInputs,\n key: KeyCode,\n handler: EventHandler<T>,\n options?: Partial<EventHandlerOptions>,\n ): this;\n\n on(...args: any[]) {\n const {modifiers, key, handler, options} = this._normalizeInputs(...args);\n\n this.configs.push({\n handler: handler,\n matcher: event => this._isMatch(event, key, modifiers, options),\n ...this.options,\n ...options,\n });\n\n return this;\n }\n\n private _normalizeInputs(...args: any[]) {\n const withModifiers = Array.isArray(args[0]) || args[0] in Modifier;\n const modifiers = withModifiers ? args[0] : Modifier.None;\n const key = withModifiers ? args[1] : args[0];\n const handler = withModifiers ? args[2] : args[1];\n const options = withModifiers ? args[3] : args[2];\n\n return {\n key: key as KeyCode,\n handler: handler as EventHandler<T>,\n modifiers: modifiers as ModifierInputs,\n options: (options ?? {}) as Partial<EventHandlerOptions>,\n };\n }\n\n private _isMatch(\n event: T,\n key: KeyCode,\n modifiers: ModifierInputs,\n options?: Partial<EventHandlerOptions>,\n ): boolean {\n if (!hasModifiers(event, modifiers)) {\n return false;\n }\n\n // Default is to ignore repeated key events unless explicitly set to false.\n if (event.repeat && options?.ignoreRepeat !== false) {\n return false;\n }\n\n if (key instanceof RegExp) {\n return key.test(event.key);\n }\n\n const keyStr = typeof key === 'string' ? key : key();\n return keyStr.toLowerCase() === event.key.toLowerCase();\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 createComputed,\n createLinkedSignal,\n createSignal,\n linkedSignalSetFn,\n linkedSignalUpdateFn,\n SIGNAL,\n untracked as primitiveUntracked,\n} from '@angular/core/primitives/signals';\n\nexport {primitiveUntracked as untracked};\n\nexport type SignalLike<T> = () => T;\n\nexport interface WritableSignalLike<T> extends SignalLike<T> {\n set(value: T): void;\n update(updateFn: (value: T) => T): void;\n asReadonly(): SignalLike<T>;\n}\n\n/** Converts a getter setter style signal to a WritableSignalLike. */\nexport function convertGetterSetterToWritableSignalLike<T>(\n getter: () => T,\n setter: (v: T) => void,\n): WritableSignalLike<T> {\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the getter function.\n return Object.assign(getter, {\n set: setter,\n update: (updateCallback: (v: T) => T) => setter(updateCallback(getter())),\n asReadonly: () => getter,\n });\n}\n\nexport function computed<T>(computation: () => T): SignalLike<T> {\n const computed = createComputed(computation);\n computed[SIGNAL].debugName = '';\n return computed;\n}\n\nexport function signal<T>(initialValue: T): WritableSignalLike<T> {\n const [get, set, update] = createSignal(initialValue);\n get[SIGNAL].debugName = '';\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the getter function.\n return Object.assign(get, {set, update, asReadonly: () => get});\n}\n\nexport function linkedSignal<T>(sourceFn: () => T): WritableSignalLike<T> {\n const getter = createLinkedSignal(sourceFn, s => s);\n getter[SIGNAL].debugName = '';\n // tslint:disable-next-line:ban Have to use `Object.assign` to preserve the getter function.\n return Object.assign(getter, {\n set: (v: T) => linkedSignalSetFn(getter[SIGNAL], v),\n update: (updater: (v: T) => T) => linkedSignalUpdateFn(getter[SIGNAL], updater),\n asReadonly: () => getter,\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\nexport interface HasElement {\n element: HTMLElement;\n}\n\n/**\n * Sort directives by their document order.\n */\nexport function sortDirectives(a: HasElement, b: HasElement) {\n return (a.element.compareDocumentPosition(b.element) & Node.DOCUMENT_POSITION_PRECEDING) > 0\n ? 1\n : -1;\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 {signal, computed, Signal} from '@angular/core';\nimport {sortDirectives, HasElement} from './element';\n\n/**\n * A collection that lazily sorts its items based on their DOM position.\n * It uses manual registration and updates its order when items are added/removed\n * or when structural DOM changes are detected via MutationObserver.\n *\n * TODO(ok7sai): replace Mutation Observer with internal API.\n */\nexport class SortedCollection<T extends HasElement> {\n private readonly _items = signal<Set<T>>(new Set());\n private readonly _version = signal(0);\n private _observer?: MutationObserver;\n\n readonly orderedItems: Signal<T[]> = computed(() => {\n this._version(); // Track DOM changes\n const itemsArray = Array.from(this._items());\n return itemsArray.sort(sortDirectives);\n });\n\n register(item: T) {\n this._items.update(set => {\n const newSet = new Set(set);\n newSet.add(item);\n return newSet;\n });\n }\n\n unregister(item: T) {\n this._items.update(set => {\n const newSet = new Set(set);\n newSet.delete(item);\n return newSet;\n });\n }\n\n startObserving(element: HTMLElement) {\n if (this._observer) {\n this._observer.disconnect();\n }\n\n this._observer = new MutationObserver(mutations => {\n const hasStructuralChange = mutations.some(m => m.addedNodes.length || m.removedNodes.length);\n if (hasStructuralChange) {\n this._version.update(v => v + 1);\n }\n });\n\n this._observer.observe(element, {childList: true, subtree: true});\n }\n\n stopObserving() {\n this._observer?.disconnect();\n this._observer = undefined;\n }\n}\n"],"names":["Modifier","EventManager","configs","handle","event","config","matcher","handler","preventDefault","stopPropagation","getModifiers","ctrlKey","Ctrl","shiftKey","Shift","altKey","Alt","metaKey","Meta","hasModifiers","modifiers","eventModifiers","modifiersList","Array","isArray","includes","Any","some","KeyboardEventManager","options","ignoreRepeat","on","args","key","_normalizeInputs","push","_isMatch","withModifiers","None","repeat","RegExp","test","keyStr","toLowerCase","convertGetterSetterToWritableSignalLike","getter","setter","Object","assign","set","update","updateCallback","asReadonly","computed","computation","createComputed","SIGNAL","debugName","signal","initialValue","get","createSignal","linkedSignal","sourceFn","createLinkedSignal","s","v","linkedSignalSetFn","updater","linkedSignalUpdateFn","sortDirectives","a","b","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","SortedCollection","_items","Set","_version","_observer","orderedItems","itemsArray","from","sort","register","item","newSet","add","unregister","delete","startObserving","disconnect","MutationObserver","mutations","hasStructuralChange","m","addedNodes","length","removedNodes","observe","childList","subtree","stopObserving","undefined"],"mappings":";;;IA4CYA;AAAZ,CAAA,UAAYA,QAAQ,EAAA;EAClBA,QAAA,CAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;EACRA,QAAA,CAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAU;E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,CAACC,SAAS,IAAG;AAChD,MAAA,MAAMC,mBAAmB,GAAGD,SAAS,CAACpE,IAAI,CAACsE,CAAC,IAAIA,CAAC,CAACC,UAAU,CAACC,MAAM,IAAIF,CAAC,CAACG,YAAY,CAACD,MAAM,CAAC;AAC7F,MAAA,IAAIH,mBAAmB,EAAE;QACvB,IAAI,CAAChB,QAAQ,CAAC9B,MAAM,CAACgB,CAAC,IAAIA,CAAC,GAAG,CAAC,CAAC;AAClC,MAAA;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,IAAI,CAACe,SAAS,CAACoB,OAAO,CAAC5B,OAAO,EAAE;AAAC6B,MAAAA,SAAS,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAI,KAAC,CAAC;AACnE,EAAA;AAEAC,EAAAA,aAAaA,GAAA;AACX,IAAA,IAAI,CAACvB,SAAS,EAAEY,UAAU,EAAE;IAC5B,IAAI,CAACZ,SAAS,GAAGwB,SAAS;AAC5B,EAAA;AACD;;;;"}
|
|
@@ -10,7 +10,7 @@ class DeferredContentAware {
|
|
|
10
10
|
}] : []));
|
|
11
11
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
12
|
minVersion: "12.0.0",
|
|
13
|
-
version: "22.0.0-next.
|
|
13
|
+
version: "22.0.0-next.10",
|
|
14
14
|
ngImport: i0,
|
|
15
15
|
type: DeferredContentAware,
|
|
16
16
|
deps: [],
|
|
@@ -18,7 +18,7 @@ class DeferredContentAware {
|
|
|
18
18
|
});
|
|
19
19
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
20
20
|
minVersion: "17.1.0",
|
|
21
|
-
version: "22.0.0-next.
|
|
21
|
+
version: "22.0.0-next.10",
|
|
22
22
|
type: DeferredContentAware,
|
|
23
23
|
isStandalone: true,
|
|
24
24
|
inputs: {
|
|
@@ -38,7 +38,7 @@ class DeferredContentAware {
|
|
|
38
38
|
}
|
|
39
39
|
i0.ɵɵngDeclareClassMetadata({
|
|
40
40
|
minVersion: "12.0.0",
|
|
41
|
-
version: "22.0.0-next.
|
|
41
|
+
version: "22.0.0-next.10",
|
|
42
42
|
ngImport: i0,
|
|
43
43
|
type: DeferredContentAware,
|
|
44
44
|
decorators: [{
|
|
@@ -70,16 +70,18 @@ class DeferredContent {
|
|
|
70
70
|
debugName: "deferredContentAware"
|
|
71
71
|
}] : []));
|
|
72
72
|
constructor() {
|
|
73
|
-
afterRenderEffect(
|
|
74
|
-
|
|
75
|
-
if (
|
|
73
|
+
afterRenderEffect({
|
|
74
|
+
write: () => {
|
|
75
|
+
if (this.deferredContentAware()?.contentVisible()) {
|
|
76
|
+
if (!this._isRendered) {
|
|
77
|
+
this._destroyContent();
|
|
78
|
+
this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);
|
|
79
|
+
this._isRendered = true;
|
|
80
|
+
}
|
|
81
|
+
} else if (!this.deferredContentAware()?.preserveContent()) {
|
|
76
82
|
this._destroyContent();
|
|
77
|
-
this.
|
|
78
|
-
this._isRendered = true;
|
|
83
|
+
this._isRendered = false;
|
|
79
84
|
}
|
|
80
|
-
} else if (!this.deferredContentAware()?.preserveContent()) {
|
|
81
|
-
this._destroyContent();
|
|
82
|
-
this._isRendered = false;
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
}
|
|
@@ -95,7 +97,7 @@ class DeferredContent {
|
|
|
95
97
|
}
|
|
96
98
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
97
99
|
minVersion: "12.0.0",
|
|
98
|
-
version: "22.0.0-next.
|
|
100
|
+
version: "22.0.0-next.10",
|
|
99
101
|
ngImport: i0,
|
|
100
102
|
type: DeferredContent,
|
|
101
103
|
deps: [],
|
|
@@ -103,7 +105,7 @@ class DeferredContent {
|
|
|
103
105
|
});
|
|
104
106
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
105
107
|
minVersion: "14.0.0",
|
|
106
|
-
version: "22.0.0-next.
|
|
108
|
+
version: "22.0.0-next.10",
|
|
107
109
|
type: DeferredContent,
|
|
108
110
|
isStandalone: true,
|
|
109
111
|
ngImport: i0
|
|
@@ -111,7 +113,7 @@ class DeferredContent {
|
|
|
111
113
|
}
|
|
112
114
|
i0.ɵɵngDeclareClassMetadata({
|
|
113
115
|
minVersion: "12.0.0",
|
|
114
|
-
version: "22.0.0-next.
|
|
116
|
+
version: "22.0.0-next.10",
|
|
115
117
|
ngImport: i0,
|
|
116
118
|
type: DeferredContent,
|
|
117
119
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_deferred-content-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_deferred-content-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/deferred-content/deferred-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 afterRenderEffect,\n Directive,\n inject,\n TemplateRef,\n signal,\n ViewContainerRef,\n model,\n EmbeddedViewRef,\n OnDestroy,\n} from '@angular/core';\n\n/**\n * A container directive controls the visibility of its content.\n */\n@Directive()\nexport class DeferredContentAware {\n readonly contentVisible = signal(false);\n readonly preserveContent = model(false);\n}\n\n/**\n * DeferredContent loads/unloads the content based on the visibility.\n * The visibilty signal is sent from a parent directive implements\n * DeferredContentAware.\n *\n * Use this directive as a host directive. For example:\n *\n * ```ts\n * @Directive({\n * selector: 'ng-template[AccordionContent]',\n * hostDirectives: [DeferredContent],\n * })\n * class AccordionContent {}\n * ```\n */\n@Directive()\nexport class DeferredContent implements OnDestroy {\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n private readonly _templateRef = inject(TemplateRef);\n private readonly _viewContainerRef = inject(ViewContainerRef);\n private _currentViewRef: EmbeddedViewRef<unknown> | null = null;\n private _isRendered = false;\n\n readonly deferredContentAware = signal(this._deferredContentAware);\n\n constructor() {\n afterRenderEffect({\n write: () => {\n if (this.deferredContentAware()?.contentVisible()) {\n if (!this._isRendered) {\n this._destroyContent();\n this._currentViewRef = this._viewContainerRef.createEmbeddedView(this._templateRef);\n this._isRendered = true;\n }\n } else if (!this.deferredContentAware()?.preserveContent()) {\n this._destroyContent();\n this._isRendered = false;\n }\n },\n });\n }\n\n ngOnDestroy(): void {\n this._destroyContent();\n }\n\n private _destroyContent() {\n const ref = this._currentViewRef;\n\n if (ref && !ref.destroyed) {\n ref.destroy();\n this._currentViewRef = null;\n }\n }\n}\n"],"names":["DeferredContentAware","contentVisible","signal","preserveContent","model","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","ngImport","decorators","DeferredContent","_deferredContentAware","inject","optional","_templateRef","TemplateRef","_viewContainerRef","ViewContainerRef","_currentViewRef","_isRendered","deferredContentAware","constructor","afterRenderEffect","write","_destroyContent","createEmbeddedView","ngOnDestroy","ref","destroyed","destroy"],"mappings":";;;MAwBaA,oBAAoB,CAAA;EACtBC,cAAc,GAAGC,MAAM,CAAC,KAAK;;WAAC;EAC9BC,eAAe,GAAGC,KAAK,CAAC,KAAK;;WAAC;;;;;UAF5BJ,oBAAoB;AAAAK,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAApBT,oBAAoB;AAAAU,IAAAA,YAAA,EAAA,IAAA;AAAAC,IAAAA,MAAA,EAAA;AAAAR,MAAAA,eAAA,EAAA;AAAAS,QAAAA,iBAAA,EAAA,iBAAA;AAAAC,QAAAA,UAAA,EAAA,iBAAA;AAAAC,QAAAA,QAAA,EAAA,IAAA;AAAAC,QAAAA,UAAA,EAAA,KAAA;AAAAC,QAAAA,iBAAA,EAAA;AAAA;KAAA;AAAAC,IAAAA,OAAA,EAAA;AAAAd,MAAAA,eAAA,EAAA;KAAA;AAAAe,IAAAA,QAAA,EAAAX;AAA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G,CAACC,SAAS,EAAE;MACzBD,GAAG,CAACE,OAAO,EAAE;MACb,IAAI,CAACX,eAAe,GAAG,IAAI;AAC7B,IAAA;AACF,EAAA;;;;;UArCWR,eAAe;AAAAf,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;UAAfW,eAAe;AAAAV,IAAAA,YAAA,EAAA,IAAA;AAAAQ,IAAAA,QAAA,EAAAX;AAAA,GAAA,CAAA;;;;;;QAAfa,eAAe;AAAAD,EAAAA,UAAA,EAAA,CAAA;UAD3BV;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_expansion-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_expansion-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/expansion/expansion.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 */\nimport {SignalLike, WritableSignalLike} from '../signal-like/signal-like';\n\n/** Represents an item that can be expanded or collapsed. */\nexport interface ExpansionItem {\n /** Whether the item is expandable. */\n expandable: SignalLike<boolean>;\n\n /** Whether the item is expanded. */\n expanded: WritableSignalLike<boolean>;\n\n /** Whether the expansion is disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Represents the required inputs for an expansion behavior. */\nexport interface ListExpansionInputs {\n /** Whether multiple items can be expanded at once. */\n multiExpandable: SignalLike<boolean>;\n\n /** An array of expansion items. */\n items: SignalLike<ExpansionItem[]>;\n\n /** Whether all expansions are disabled. */\n disabled: SignalLike<boolean>;\n}\n\n/** Manages the expansion state of a list of items. */\nexport class ListExpansion {\n constructor(readonly inputs: ListExpansionInputs) {}\n\n /** Opens the specified item. */\n open(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n if (item.expanded()) return false;\n if (!this.inputs.multiExpandable()) {\n this.closeAll();\n }\n item.expanded.set(true);\n return true;\n }\n\n /** Closes the specified item. */\n close(item: ExpansionItem): boolean {\n if (!this.isExpandable(item)) return false;\n\n item.expanded.set(false);\n return true;\n }\n\n /** Toggles the expansion state of the specified item. */\n toggle(item: ExpansionItem): boolean {\n return item.expanded() ? this.close(item) : this.open(item);\n }\n\n /** Opens all focusable items in the list. */\n openAll(): void {\n if (this.inputs.multiExpandable()) {\n for (const item of this.inputs.items()) {\n this.open(item);\n }\n }\n }\n\n /** Closes all focusable items in the list. */\n closeAll(): void {\n for (const item of this.inputs.items()) {\n this.close(item);\n }\n }\n\n /** Checks whether the specified item is expandable / collapsible. */\n isExpandable(item: ExpansionItem) {\n return !this.inputs.disabled() && !item.disabled() && item.expandable();\n }\n}\n"],"names":["ListExpansion","inputs","constructor","open","item","isExpandable","expanded","multiExpandable","closeAll","set","close","toggle","openAll","items","disabled","expandable"],"mappings":"MAkCaA,aAAa,CAAA;EACHC,MAAA;EAArBC,WAAAA,CAAqBD,MAA2B,EAAA;IAA3B,IAAA,CAAAA,MAAM,GAANA,MAAM;AAAwB,EAAA;EAGnDE,IAAIA,CAACC,IAAmB,EAAA;IACtB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAC1C,IAAA,IAAIA,IAAI,CAACE,QAAQ,EAAE,EAAE,OAAO,KAAK;IACjC,IAAI,CAAC,IAAI,CAACL,MAAM,CAACM,eAAe,EAAE,EAAE;MAClC,IAAI,CAACC,QAAQ,EAAE;AACjB,IAAA;AACAJ,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,IAAI,CAAC;AACvB,IAAA,OAAO,IAAI;AACb,EAAA;EAGAC,KAAKA,CAACN,IAAmB,EAAA;IACvB,IAAI,CAAC,IAAI,CAACC,YAAY,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;AAE1CA,IAAAA,IAAI,CAACE,QAAQ,CAACG,GAAG,CAAC,KAAK,CAAC;AACxB,IAAA,OAAO,IAAI;AACb,EAAA;EAGAE,MAAMA,CAACP,IAAmB,EAAA;AACxB,IAAA,OAAOA,IAAI,CAACE,QAAQ,EAAE,GAAG,IAAI,CAACI,KAAK,CAACN,IAAI,CAAC,GAAG,IAAI,CAACD,IAAI,CAACC,IAAI,CAAC;AAC7D,EAAA;AAGAQ,EAAAA,OAAOA,GAAA;AACL,IAAA,IAAI,IAAI,CAACX,MAAM,CAACM,eAAe,EAAE,EAAE;MACjC,KAAK,MAAMH,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,QAAA,IAAI,CAACV,IAAI,CAACC,IAAI,CAAC;AACjB,MAAA;AACF,IAAA;AACF,EAAA;AAGAI,EAAAA,QAAQA,GAAA;IACN,KAAK,MAAMJ,IAAI,IAAI,IAAI,CAACH,MAAM,CAACY,KAAK,EAAE,EAAE;AACtC,MAAA,IAAI,CAACH,KAAK,CAACN,IAAI,CAAC;AAClB,IAAA;AACF,EAAA;EAGAC,YAAYA,CAACD,IAAmB,EAAA;IAC9B,OAAO,CAAC,IAAI,CAACH,MAAM,CAACa,QAAQ,EAAE,IAAI,CAACV,IAAI,CAACU,QAAQ,EAAE,IAAIV,IAAI,CAACW,UAAU,EAAE;AACzE,EAAA;AACD;;;;"}
|
package/fesm2022/_list-chunk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, signal } from './
|
|
1
|
+
import { computed, signal } from './_collection-chunk.mjs';
|
|
2
2
|
import { ListFocus, ListNavigation } from './_list-navigation-chunk.mjs';
|
|
3
3
|
import { ListSelection, ListTypeahead } from './_list-typeahead-chunk.mjs';
|
|
4
4
|
|
|
@@ -112,6 +112,9 @@ class List {
|
|
|
112
112
|
const moved = operation();
|
|
113
113
|
if (moved) {
|
|
114
114
|
this.updateSelection(opts);
|
|
115
|
+
if (!opts?.selectRange) {
|
|
116
|
+
this.anchor(this.activeIndex());
|
|
117
|
+
}
|
|
115
118
|
}
|
|
116
119
|
this._wrap.set(true);
|
|
117
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list/list.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} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../list-selection/list-selection';\nimport {\n ListTypeahead,\n ListTypeaheadInputs,\n ListTypeaheadItem,\n} from '../list-typeahead/list-typeahead';\n\n/** The operations that the list can perform after navigation. */\nexport interface NavOptions<T = any> {\n toggle?: boolean;\n select?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n focusElement?: boolean;\n items?: T[];\n}\n\n/** Represents an item in the list. */\nexport type ListItem<V> = ListTypeaheadItem &\n ListNavigationItem &\n ListSelectionItem<V> &\n ListFocusItem;\n\n/** The necessary inputs for the list behavior. */\nexport type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T>;\n\n/** Controls the state of a list. */\nexport class List<T extends ListItem<V>, V> {\n /** Controls navigation for the list. */\n readonly navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the list. */\n readonly selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the list. */\n readonly typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the list. */\n readonly focusBehavior: ListFocus<T>;\n\n /** Whether the list is disabled. */\n readonly disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the list. */\n readonly tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the list. */\n readonly activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n private readonly _anchorIndex = signal(0);\n\n /** Whether the list should wrap. Used to disable wrapping while range selecting. */\n private readonly _wrap = signal(true);\n\n constructor(readonly inputs: ListInputs<T, V>) {\n this.focusBehavior = new ListFocus(inputs);\n this.selectionBehavior = new ListSelection({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead({...inputs, focusManager: this.focusBehavior});\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusManager: this.focusBehavior,\n wrap: computed(() => this._wrap() && this.inputs.wrap()),\n });\n }\n\n /** Returns the tab index for the given item. */\n getItemTabindex(item: T) {\n return this.focusBehavior.getItemTabIndex(item);\n }\n\n /** Navigates to the first option in the list. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the list. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the list. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the list. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the given item in the list. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the list. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Marks the given index as the potential start of a range selection. */\n anchor(index: number) {\n this._anchorIndex.set(index);\n }\n\n /** Handles typeahead search navigation for the list. */\n search(char: string, opts?: NavOptions) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the list is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the list. */\n select(item?: T) {\n this.selectionBehavior.select(item);\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.selectionBehavior.selectOne();\n }\n\n /** Deselects the currently active item in the list. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the list. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the list, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the list. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Handles updating selection for the list. */\n updateSelection(opts: NavOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: NavOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n }\n\n this._wrap.set(true);\n }\n}\n"],"names":["List","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListFocus","ListSelection","focusManager","ListTypeahead","ListNavigation","wrap","getItemTabindex","item","getItemTabIndex","first","opts","_navigate","last","next","prev","goto","unfocus","activeItem","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","isFocusable","updateSelection","selectRange","rangeStartIndex","operation","moved"],"mappings":";;;;MAkDaA,IAAI,CAAA;EA0CMC,MAAA;EAxCZC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACG,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACK,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACO,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACQ,WAAW,EAAE,CAAC;AActDC,EAAAA,YAAY,GAAGC,MAAM,CAAC,CAAC,CAAC;AAGxBC,EAAAA,KAAK,GAAGD,MAAM,CAAC,IAAI,CAAC;EAErCE,WAAAA,CAAqBhB,MAAwB,EAAA;IAAxB,IAAA,CAAAA,MAAM,GAANA,MAAM;AACzB,IAAA,IAAI,CAAC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AI,CAACjC,iBAAiB,CAACkD,eAAe,CAACjB,GAAG,CAAC,IAAI,CAACtB,YAAY,EAAE,CAAC;AACjE,IAAA;AAEA,IAAA,MAAMyC,KAAK,GAAGD,SAAS,EAAE;AAEzB,IAAA,IAAIC,KAAK,EAAE;AACT,MAAA,IAAI,CAACJ,eAAe,CAACvB,IAAI,CAAC;AAC5B,IAAA;AAEA,IAAA,IAAI,CAACZ,KAAK,CAACoB,GAAG,CAAC,IAAI,CAAC;AACtB,EAAA;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"_list-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list/list.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} from '../signal-like/signal-like';\nimport {ListFocus, ListFocusInputs, ListFocusItem} from '../list-focus/list-focus';\nimport {\n ListNavigation,\n ListNavigationInputs,\n ListNavigationItem,\n} from '../list-navigation/list-navigation';\nimport {\n ListSelection,\n ListSelectionInputs,\n ListSelectionItem,\n} from '../list-selection/list-selection';\nimport {\n ListTypeahead,\n ListTypeaheadInputs,\n ListTypeaheadItem,\n} from '../list-typeahead/list-typeahead';\n\n/** The operations that the list can perform after navigation. */\nexport interface NavOptions<T = any> {\n toggle?: boolean;\n select?: boolean;\n selectOne?: boolean;\n selectRange?: boolean;\n anchor?: boolean;\n focusElement?: boolean;\n items?: T[];\n}\n\n/** Represents an item in the list. */\nexport type ListItem<V> = ListTypeaheadItem &\n ListNavigationItem &\n ListSelectionItem<V> &\n ListFocusItem;\n\n/** The necessary inputs for the list behavior. */\nexport type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> &\n ListNavigationInputs<T> &\n ListSelectionInputs<T, V> &\n ListTypeaheadInputs<T>;\n\n/** Controls the state of a list. */\nexport class List<T extends ListItem<V>, V> {\n /** Controls navigation for the list. */\n readonly navigationBehavior: ListNavigation<T>;\n\n /** Controls selection for the list. */\n readonly selectionBehavior: ListSelection<T, V>;\n\n /** Controls typeahead for the list. */\n readonly typeaheadBehavior: ListTypeahead<T>;\n\n /** Controls focus for the list. */\n readonly focusBehavior: ListFocus<T>;\n\n /** Whether the list is disabled. */\n readonly disabled = computed(() => this.focusBehavior.isListDisabled());\n\n /** The id of the current active item. */\n readonly activeDescendant = computed(() => this.focusBehavior.getActiveDescendant());\n\n /** The tab index of the list. */\n readonly tabIndex = computed(() => this.focusBehavior.getListTabIndex());\n\n /** The index of the currently active item in the list. */\n readonly activeIndex = computed(() => this.focusBehavior.activeIndex());\n\n /**\n * The uncommitted index for selecting a range of options.\n *\n * NOTE: This is subtly distinct from the \"rangeStartIndex\" in the ListSelection behavior.\n * The anchorIndex does not necessarily represent the start of a range, but represents the most\n * recent index where the user showed intent to begin a range selection. Usually, this is wherever\n * the user most recently pressed the \"Shift\" key, but if the user presses shift + space to select\n * from the anchor, the user is not intending to start a new range from this index.\n *\n * In other words, \"rangeStartIndex\" is only set when a user commits to starting a range selection\n * while \"anchorIndex\" is set whenever a user indicates they may be starting a range selection.\n */\n private readonly _anchorIndex = signal(0);\n\n /** Whether the list should wrap. Used to disable wrapping while range selecting. */\n private readonly _wrap = signal(true);\n\n constructor(readonly inputs: ListInputs<T, V>) {\n this.focusBehavior = new ListFocus(inputs);\n this.selectionBehavior = new ListSelection({...inputs, focusManager: this.focusBehavior});\n this.typeaheadBehavior = new ListTypeahead({...inputs, focusManager: this.focusBehavior});\n this.navigationBehavior = new ListNavigation({\n ...inputs,\n focusManager: this.focusBehavior,\n wrap: computed(() => this._wrap() && this.inputs.wrap()),\n });\n }\n\n /** Returns the tab index for the given item. */\n getItemTabindex(item: T) {\n return this.focusBehavior.getItemTabIndex(item);\n }\n\n /** Navigates to the first option in the list. */\n first(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.first(opts));\n }\n\n /** Navigates to the last option in the list. */\n last(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.last(opts));\n }\n\n /** Navigates to the next option in the list. */\n next(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.next(opts));\n }\n\n /** Navigates to the previous option in the list. */\n prev(opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.prev(opts));\n }\n\n /** Navigates to the given item in the list. */\n goto(item: T, opts?: NavOptions<T>) {\n this._navigate(opts, () => this.navigationBehavior.goto(item, opts));\n }\n\n /** Removes focus from the list. */\n unfocus() {\n this.inputs.activeItem.set(undefined);\n }\n\n /** Marks the given index as the potential start of a range selection. */\n anchor(index: number) {\n this._anchorIndex.set(index);\n }\n\n /** Handles typeahead search navigation for the list. */\n search(char: string, opts?: NavOptions) {\n this._navigate(opts, () => this.typeaheadBehavior.search(char));\n }\n\n /** Checks if the list is currently typing for typeahead search. */\n isTyping() {\n return this.typeaheadBehavior.isTyping();\n }\n\n /** Selects the currently active item in the list. */\n select(item?: T) {\n this.selectionBehavior.select(item);\n }\n\n /** Sets the selection to only the current active item. */\n selectOne() {\n this.selectionBehavior.selectOne();\n }\n\n /** Deselects the currently active item in the list. */\n deselect(item?: T) {\n this.selectionBehavior.deselect(item);\n }\n\n /** Deselects all items in the list. */\n deselectAll() {\n this.selectionBehavior.deselectAll();\n }\n\n /** Toggles the currently active item in the list. */\n toggle(item?: T) {\n this.selectionBehavior.toggle(item);\n }\n\n /** Toggles the currently active item in the list, deselecting all other items. */\n toggleOne() {\n this.selectionBehavior.toggleOne();\n }\n\n /** Toggles the selection of all items in the list. */\n toggleAll() {\n this.selectionBehavior.toggleAll();\n }\n\n /** Checks if the given item is able to receive focus. */\n isFocusable(item: T) {\n return this.focusBehavior.isFocusable(item);\n }\n\n /** Handles updating selection for the list. */\n updateSelection(opts: NavOptions = {anchor: true}) {\n if (opts.toggle) {\n this.selectionBehavior.toggle();\n }\n if (opts.select) {\n this.selectionBehavior.select();\n }\n if (opts.selectOne) {\n this.selectionBehavior.selectOne();\n }\n if (opts.selectRange) {\n this.selectionBehavior.selectRange();\n }\n if (!opts.anchor) {\n this.anchor(this.selectionBehavior.rangeStartIndex());\n }\n }\n\n /**\n * Safely performs a navigation operation.\n *\n * Handles conditionally disabling wrapping for when a navigation\n * operation is occurring while the user is selecting a range of options.\n *\n * Handles boilerplate calling of focus & selection operations. Also ensures these\n * additional operations are only called if the navigation operation moved focus to a new option.\n */\n private _navigate(opts: NavOptions = {}, operation: () => boolean) {\n if (opts?.selectRange) {\n this._wrap.set(false);\n this.selectionBehavior.rangeStartIndex.set(this._anchorIndex());\n }\n\n const moved = operation();\n\n if (moved) {\n this.updateSelection(opts);\n if (!opts?.selectRange) {\n this.anchor(this.activeIndex());\n }\n }\n\n this._wrap.set(true);\n }\n}\n"],"names":["List","inputs","navigationBehavior","selectionBehavior","typeaheadBehavior","focusBehavior","disabled","computed","isListDisabled","activeDescendant","getActiveDescendant","tabIndex","getListTabIndex","activeIndex","_anchorIndex","signal","_wrap","constructor","ListFocus","ListSelection","focusManager","ListTypeahead","ListNavigation","wrap","getItemTabindex","item","getItemTabIndex","first","opts","_navigate","last","next","prev","goto","unfocus","activeItem","set","undefined","anchor","index","search","char","isTyping","select","selectOne","deselect","deselectAll","toggle","toggleOne","toggleAll","isFocusable","updateSelection","selectRange","rangeStartIndex","operation","moved"],"mappings":";;;;MAkDaA,IAAI,CAAA;EA0CMC,MAAA;EAxCZC,kBAAkB;EAGlBC,iBAAiB;EAGjBC,iBAAiB;EAGjBC,aAAa;EAGbC,QAAQ,GAAGC,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACG,cAAc,EAAE,CAAC;EAG9DC,gBAAgB,GAAGF,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACK,mBAAmB,EAAE,CAAC;EAG3EC,QAAQ,GAAGJ,QAAQ,CAAC,MAAM,IAAI,CAACF,aAAa,CAACO,eAAe,EAAE,CAAC;EAG/DC,WAAW,GAAGN,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CAAC,IAAI,CAACnC,iBAAiB,CAACkD,eAAe,EAAE,CAAC;AACvD,IAAA;AACF,EAAA;AAWQxB,EAAAA,SAASA,CAACD,IAAA,GAAmB,EAAE,EAAE0B,SAAwB,EAAA;IAC/D,IAAI1B,IAAI,EAAEwB,WAAW,EAAE;AACrB,MAAA,IAAI,CAACpC,KAAK,CAACoB,GAAG,CAAC,KAAK,CAAC;AACrB,MAAA,IAAI,CAACjC,iBAAiB,CAACkD,eAAe,CAACjB,GAAG,CAAC,IAAI,CAACtB,YAAY,EAAE,CAAC;AACjE,IAAA;AAEA,IAAA,MAAMyC,KAAK,GAAGD,SAAS,EAAE;AAEzB,IAAA,IAAIC,KAAK,EAAE;AACT,MAAA,IAAI,CAACJ,eAAe,CAACvB,IAAI,CAAC;AAC1B,MAAA,IAAI,CAACA,IAAI,EAAEwB,WAAW,EAAE;QACtB,IAAI,CAACd,MAAM,CAAC,IAAI,CAACzB,WAAW,EAAE,CAAC;AACjC,MAAA;AACF,IAAA;AAEA,IAAA,IAAI,CAACG,KAAK,CAACoB,GAAG,CAAC,IAAI,CAAC;AACtB,EAAA;AACD;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { signal, computed } from './
|
|
1
|
+
import { signal, computed } from './_collection-chunk.mjs';
|
|
2
2
|
|
|
3
3
|
class ListFocus {
|
|
4
4
|
inputs;
|
|
@@ -46,7 +46,9 @@ class ListFocus {
|
|
|
46
46
|
this.prevActiveItem.set(this.inputs.activeItem());
|
|
47
47
|
this.inputs.activeItem.set(item);
|
|
48
48
|
if (opts?.focusElement || opts?.focusElement === undefined) {
|
|
49
|
-
this.inputs.focusMode() === 'roving'
|
|
49
|
+
if (this.inputs.focusMode() === 'roving') {
|
|
50
|
+
item.element()?.focus();
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_list-navigation-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/private/behaviors/list-focus/list-focus.ts","../../../../../k8-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 readonly prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n readonly prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n readonly 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;AAZZC,EAAAA,cAAc,GAAGC,MAAM,CAAgBC,SAAS,CAAC;EAGjDC,eAAe,GAAGC,QAAQ,CAAC,MAAK;IACvC,OAAO,IAAI,CAACJ,cAAc,EAAE,GAAG,IAAI,CAACD,MAAM,CAACM,KAAK,EAAE,CAACC,OAAO,CAAC,IAAI,CAACN,cAAc,EAAG,CAAC,GAAG,EAAE;AACzF,EAAA,CAAC,CAAC;EAGOO,WAAW,GAAGH,QAAQ,CAAC,MAAK;AACnC,IAAA,OAAO,IAAI,CAACL,MAAM,CAACS,UAAU,EAAE,GAAG,IAAI,CAACT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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,MAAA;AACF,IAAA;AAEA,IAAA;AACF,EAAA;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 readonly prevActiveItem = signal<T | undefined>(undefined);\n\n /** The index of the last item that was active. */\n readonly prevActiveIndex = computed(() => {\n return this.prevActiveItem() ? this.inputs.items().indexOf(this.prevActiveItem()!) : -1;\n });\n\n /** The current active index in the list. */\n readonly 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 if (this.inputs.focusMode() === 'roving') {\n item.element()?.focus();\n }\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;AAZZC,EAAAA,cAAc,G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