@spartan-ng/brain 1.3.0 → 1.3.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, forwardRef, Injector, input, booleanAttribute, linkedSignal, output, model, contentChildren, effect, untracked, afterNextRender, Directive, TemplateRef, ViewContainerRef, computed, ElementRef, signal, PLATFORM_ID } from '@angular/core';
3
+ import { InjectionToken, inject, forwardRef, Injector, input, booleanAttribute, linkedSignal, output, model, contentChildren, signal, computed, effect, untracked, afterNextRender, Directive, TemplateRef, ViewContainerRef, ElementRef, PLATFORM_ID } from '@angular/core';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
6
  import { startWith } from 'rxjs/operators';
@@ -55,6 +55,13 @@ class BrnCommand {
55
55
  items = contentChildren(BrnCommandItemToken, { ...(ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {}), descendants: true });
56
56
  /** @internal The key manager for managing active descendant */
57
57
  keyManager = new ActiveDescendantKeyManager(this.items, this._injector);
58
+ _commandList = signal(undefined, ...(ngDevMode ? [{ debugName: "_commandList" }] : /* istanbul ignore next */ []));
59
+ /** @internal The id of the command list, registered by BrnCommandList. Used by the input for aria-controls. */
60
+ listId = computed(() => this._commandList()?.id(), ...(ngDevMode ? [{ debugName: "listId" }] : /* istanbul ignore next */ []));
61
+ /** @internal Register the command list. Called by BrnCommandList in its constructor. */
62
+ registerCommandList(list) {
63
+ this._commandList.set(list);
64
+ }
58
65
  _onChange;
59
66
  _onTouched;
60
67
  constructor() {
@@ -183,6 +190,7 @@ class BrnCommandInput {
183
190
  _initialId = `brn-command-input-${++BrnCommandInput._id}`;
184
191
  /** The id of the command input */
185
192
  id = input(this._initialId, { ...(ngDevMode ? { debugName: "id" } : /* istanbul ignore next */ {}), transform: (value) => value || this._initialId });
193
+ _commandListId = this._command.listId;
186
194
  _disabled = this._command.disabledState;
187
195
  /** The id of the active option */
188
196
  _activeDescendant = signal(undefined, ...(ngDevMode ? [{ debugName: "_activeDescendant" }] : /* istanbul ignore next */ []));
@@ -206,7 +214,7 @@ class BrnCommandInput {
206
214
  this._command.keyManager.onKeydown(event);
207
215
  }
208
216
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
209
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCommandInput, isStandalone: true, selector: "input[brnCommandInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "aria-autocomplete": "list", "type": "text", "autocomplete": "off", "autocorrect": "off", "spellcheck": "false" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput()" }, properties: { "id": "id()", "attr.aria-activedescendant": "_activeDescendant()", "attr.disabled": "_disabled() ? \"\" : null" } }, providers: [provideBrnCommandInput(BrnCommandInput)], ngImport: i0 });
217
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCommandInput, isStandalone: true, selector: "input[brnCommandInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": "true", "type": "text", "autocomplete": "off", "autocorrect": "off", "spellcheck": "false" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput()" }, properties: { "id": "id()", "attr.aria-controls": "_commandListId()", "attr.aria-activedescendant": "_activeDescendant()", "attr.disabled": "_disabled() ? \"\" : null" } }, providers: [provideBrnCommandInput(BrnCommandInput)], ngImport: i0 });
210
218
  }
211
219
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandInput, decorators: [{
212
220
  type: Directive,
@@ -217,6 +225,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
217
225
  '[id]': 'id()',
218
226
  role: 'combobox',
219
227
  'aria-autocomplete': 'list',
228
+ 'aria-haspopup': 'listbox',
229
+ 'aria-expanded': 'true',
230
+ '[attr.aria-controls]': '_commandListId()',
220
231
  '[attr.aria-activedescendant]': '_activeDescendant()',
221
232
  '[attr.disabled]': '_disabled() ? "" : null',
222
233
  '(keydown)': 'onKeyDown($event)',
@@ -322,10 +333,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
322
333
 
323
334
  class BrnCommandList {
324
335
  static _id = 0;
336
+ _command = injectBrnCommand();
325
337
  /** The id of the command list */
326
338
  id = input(`brn-command-list-${++BrnCommandList._id}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
339
+ /** Optional accessible name for the listbox. Usually not needed as the combobox names the widget. */
340
+ ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
341
+ constructor() {
342
+ this._command.registerCommandList(this);
343
+ }
327
344
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandList, deps: [], target: i0.ɵɵFactoryTarget.Directive });
328
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCommandList, isStandalone: true, selector: "[brnCommandList]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listbox" }, properties: { "id": "id()" } }, ngImport: i0 });
345
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnCommandList, isStandalone: true, selector: "[brnCommandList]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listbox" }, properties: { "id": "id()", "attr.aria-label": "ariaLabel()" } }, ngImport: i0 });
329
346
  }
330
347
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandList, decorators: [{
331
348
  type: Directive,
@@ -334,23 +351,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
334
351
  host: {
335
352
  role: 'listbox',
336
353
  '[id]': 'id()',
354
+ '[attr.aria-label]': 'ariaLabel()',
337
355
  },
338
356
  }]
339
- }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
357
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }] } });
340
358
 
341
359
  class BrnCommandSeparator {
342
360
  _command = injectBrnCommand();
343
361
  /** Determine if the command has any search input */
344
362
  _hasSearchInput = computed(() => this._command.search().length > 0, ...(ngDevMode ? [{ debugName: "_hasSearchInput" }] : /* istanbul ignore next */ []));
345
363
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
346
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCommandSeparator, isStandalone: true, selector: "[brnCommandSeparator]", host: { attributes: { "role": "separator" }, properties: { "attr.data-hidden": "_hasSearchInput() ? true : null" } }, ngImport: i0 });
364
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnCommandSeparator, isStandalone: true, selector: "[brnCommandSeparator]", host: { attributes: { "role": "presentation" }, properties: { "attr.data-hidden": "_hasSearchInput() ? true : null" } }, ngImport: i0 });
347
365
  }
348
366
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCommandSeparator, decorators: [{
349
367
  type: Directive,
350
368
  args: [{
351
369
  selector: '[brnCommandSeparator]',
352
370
  host: {
353
- role: 'separator',
371
+ role: 'presentation',
354
372
  '[attr.data-hidden]': '_hasSearchInput() ? true : null',
355
373
  },
356
374
  }]
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-command.mjs","sources":["../../../../libs/brain/command/src/lib/brn-command-item.token.ts","../../../../libs/brain/command/src/lib/brn-command.token.ts","../../../../libs/brain/command/src/lib/brn-command.ts","../../../../libs/brain/command/src/lib/brn-command-empty.ts","../../../../libs/brain/command/src/lib/brn-command-group.ts","../../../../libs/brain/command/src/lib/brn-command-input.token.ts","../../../../libs/brain/command/src/lib/brn-command-input.ts","../../../../libs/brain/command/src/lib/brn-command-item.ts","../../../../libs/brain/command/src/lib/brn-command-list.ts","../../../../libs/brain/command/src/lib/brn-command-separator.ts","../../../../libs/brain/command/src/index.ts","../../../../libs/brain/command/src/spartan-ng-brain-command.ts"],"sourcesContent":["import { type ExistingProvider, InjectionToken, type Type } from '@angular/core';\nimport type { BrnCommandItem } from './brn-command-item';\n\nexport const BrnCommandItemToken = new InjectionToken<BrnCommandItem>('BrnCommandItemToken');\n\nexport function provideBrnCommandItem(command: Type<BrnCommandItem>): ExistingProvider {\n\treturn { provide: BrnCommandItemToken, useExisting: command };\n}\n","import { type ExistingProvider, inject, InjectionToken, type Type, type ValueProvider } from '@angular/core';\nimport type { BrnCommand } from './brn-command';\n\nexport const BrnCommandToken = new InjectionToken<BrnCommand>('BrnCommandToken');\n\nexport function provideBrnCommand(command: Type<BrnCommand>): ExistingProvider {\n\treturn { provide: BrnCommandToken, useExisting: command };\n}\n\nexport function injectBrnCommand(): BrnCommand {\n\treturn inject(BrnCommandToken);\n}\n\n// config\nexport type CommandFilter = (value: string, search: string) => boolean;\n\nexport interface BrnCommandConfig {\n\tfilter: CommandFilter;\n}\n\nconst defaultConfig: BrnCommandConfig = {\n\tfilter: (value: string, search: string) => value.toLowerCase().includes(search.toLowerCase()),\n};\n\nconst BrnCommandConfigToken = new InjectionToken<BrnCommandConfig>('BrnCommandConfig');\n\nexport function provideBrnCommandConfig(config: Partial<BrnCommandConfig>): ValueProvider {\n\treturn { provide: BrnCommandConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnCommandConfig(): BrnCommandConfig {\n\treturn inject(BrnCommandConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tforwardRef,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnCommandItemToken } from './brn-command-item.token';\nimport { type CommandFilter, injectBrnCommandConfig, provideBrnCommand } from './brn-command.token';\n\nexport const BRN_COMMAND_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCommand),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnCommand]',\n\tproviders: [provideBrnCommand(BrnCommand), BRN_COMMAND_VALUE_ACCESSOR],\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'(keydown.enter)': 'selectActiveItem()',\n\t},\n})\nexport class BrnCommand implements ControlValueAccessor {\n\tprivate static _id = 0;\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprivate readonly _config = injectBrnCommandConfig();\n\n\t/** The id of the command */\n\tpublic readonly id = input<string>(`brn-command-${++BrnCommand._id}`);\n\n\t/** A custom filter function to use when searching. */\n\tpublic readonly filter = input<CommandFilter>(this._config.filter);\n\n\t/** Whether the command is disabled */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\tprivate readonly _disabled = linkedSignal(this.disabled);\n\n\t/** @internal The disabled state as a readonly signal */\n\tpublic readonly disabledState = this._disabled.asReadonly();\n\n\t/** when the selection has changed */\n\tpublic readonly valueChange = output<string>();\n\n\t/** The current search query. */\n\tpublic readonly search = model<string>('');\n\n\t/** @internal Access all the items within the command */\n\tpublic readonly items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal The key manager for managing active descendant */\n\tpublic readonly keyManager = new ActiveDescendantKeyManager(this.items, this._injector);\n\n\tprotected _onChange?: ChangeFn<string | null>;\n\tprotected _onTouched?: TouchFn;\n\n\tconstructor() {\n\t\tthis.keyManager\n\t\t\t.withVerticalOrientation()\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t.skipPredicate((item) => item.disabled || !item.visible());\n\n\t\t// When clearing the search input we also want to reset the active item to the first one\n\t\teffect(() => {\n\t\t\tconst searchInput = this.search();\n\t\t\tuntracked(() => {\n\t\t\t\tconst activeItemIsVisible = this.keyManager.activeItem?.visible();\n\t\t\t\tif ((searchInput !== undefined && searchInput.length === 0) || !activeItemIsVisible) {\n\t\t\t\t\tthis.keyManager.setFirstItemActive();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis.keyManager.change.pipe(takeUntilDestroyed()).subscribe(() => {\n\t\t\tconst value = this.keyManager.activeItem?.safeValue();\n\t\t\tif (value) {\n\t\t\t\tthis.valueChange.emit(value);\n\t\t\t}\n\t\t});\n\n\t\tafterNextRender(() => {\n\t\t\tif (this.items().length) {\n\t\t\t\tthis.keyManager.setActiveItem(0);\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected selectActiveItem(): void {\n\t\tthis.keyManager.activeItem?.selected.emit();\n\t}\n\n\t/** CONTROL VALUE ACCESSOR */\n\twriteValue(value: string | null): void {\n\t\tif (value) {\n\t\t\tthis.search.set(value);\n\t\t}\n\t}\n\n\tregisterOnChange(fn: ChangeFn<string | null>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._disabled.set(isDisabled);\n\t}\n}\n","import { computed, Directive, effect, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommandEmpty]',\n})\nexport class BrnCommandEmpty {\n\tprivate readonly _templateRef = inject<TemplateRef<void>>(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any visible items */\n\tprivate readonly _visible = computed(() => this._command.items().some((item) => item.visible()));\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tif (this._visible()) {\n\t\t\t\tthis._viewContainerRef.clear();\n\t\t\t} else {\n\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t}\n\t\t});\n\t}\n}\n","import { computed, contentChildren, Directive, input } from '@angular/core';\nimport { BrnCommandItemToken } from './brn-command-item.token';\n\n@Directive({\n\tselector: '[brnCommandGroup]',\n\thost: {\n\t\trole: 'group',\n\t\t'[attr.data-hidden]': '!_visible() ? true : null',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandGroup {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-group-${++BrnCommandGroup._id}`);\n\n\t/** Get the items in the group */\n\tprivate readonly _items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** Determine if there are any visible items in the group */\n\tprotected readonly _visible = computed(() => this._items().some((item) => item.visible()));\n}\n","import { type ExistingProvider, InjectionToken, type Type } from '@angular/core';\nimport type { BrnCommandInput } from './brn-command-input';\n\nexport const BrnCommandInputToken = new InjectionToken<BrnCommandInput>('BrnCommandInputToken');\n\nexport function provideBrnCommandInput(command: Type<BrnCommandInput>): ExistingProvider {\n\treturn { provide: BrnCommandInputToken, useExisting: command };\n}\n","import { Directive, effect, ElementRef, inject, input, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { startWith } from 'rxjs/operators';\nimport { provideBrnCommandInput } from './brn-command-input.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'input[brnCommandInput]',\n\tproviders: [provideBrnCommandInput(BrnCommandInput)],\n\thost: {\n\t\t'[id]': 'id()',\n\t\trole: 'combobox',\n\t\t'aria-autocomplete': 'list',\n\t\t'[attr.aria-activedescendant]': '_activeDescendant()',\n\t\t'[attr.disabled]': '_disabled() ? \"\" : null',\n\t\t'(keydown)': 'onKeyDown($event)',\n\t\t'(input)': 'onInput()',\n\t\ttype: 'text',\n\t\tautocomplete: 'off',\n\t\tautocorrect: 'off',\n\t\tspellcheck: 'false',\n\t},\n})\nexport class BrnCommandInput {\n\tprivate static _id = 0;\n\n\tprivate readonly _el = inject(ElementRef);\n\tprivate readonly _command = injectBrnCommand();\n\n\tprivate readonly _initialId = `brn-command-input-${++BrnCommandInput._id}`;\n\n\t/** The id of the command input */\n\tpublic readonly id = input<string, string | undefined>(this._initialId, {\n\t\ttransform: (value) => value || this._initialId,\n\t});\n\n\tprotected readonly _disabled = this._command.disabledState;\n\n\t/** The id of the active option */\n\tprotected readonly _activeDescendant = signal<string | undefined>(undefined);\n\n\tconstructor() {\n\t\tthis._command.keyManager.change\n\t\t\t.pipe(startWith(this._command.keyManager.activeItemIndex), takeUntilDestroyed())\n\t\t\t.subscribe(() => this._activeDescendant.set(this._command.keyManager.activeItem?.id()));\n\n\t\teffect(() => {\n\t\t\tconst search = this._command.search();\n\n\t\t\tif (this._el.nativeElement.value !== search) {\n\t\t\t\tthis._el.nativeElement.value = search;\n\t\t\t}\n\t\t});\n\t}\n\t/** Listen for changes to the input value */\n\tprotected onInput(): void {\n\t\tthis._command.search.set(this._el.nativeElement.value);\n\t}\n\n\t/** Listen for keydown events */\n\tprotected onKeyDown(event: KeyboardEvent): void {\n\t\tthis._command.keyManager.onKeydown(event);\n\t}\n}\n","import type { Highlightable } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tDirective,\n\tElementRef,\n\tinject,\n\tinput,\n\ttype OnInit,\n\toutput,\n\tPLATFORM_ID,\n\tsignal,\n} from '@angular/core';\nimport { provideBrnCommandItem } from './brn-command-item.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'button[brnCommandItem]',\n\tproviders: [provideBrnCommandItem(BrnCommandItem)],\n\thost: {\n\t\ttype: 'button',\n\t\trole: 'option',\n\t\ttabIndex: '-1',\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': '_disabled() ? true : null',\n\t\t'[attr.data-disabled]': '_disabled() ? \"\" : null',\n\t\t'[attr.data-value]': 'value()',\n\t\t'[attr.data-hidden]': '!visible() ? true : null',\n\t\t'[attr.aria-selected]': '_active()',\n\t\t'[attr.data-selected]': '_active() ? true : null',\n\t\t'(click)': 'onClick()',\n\t\t'(mouseenter)': 'activate()',\n\t},\n})\nexport class BrnCommandItem implements Highlightable, OnInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\t/** Access the command component */\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** A unique id for the item */\n\tpublic readonly id = input<string>(`brn-command-item-${++BrnCommandItem._id}`);\n\n\t/** The value this item represents. */\n\tpublic readonly value = input.required<string>();\n\n\t/** Whether the item is disabled. */\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Expose disabled as a value - used by the Highlightable interface */\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\t/** Whether the item is initialized, this is to prevent accessing the value-input before the component is initialized.\n\t * The brn-command-empty directive accesses the value before the component is initialized, which causes an error.\n\t */\n\tprivate readonly _initialized = signal(false);\n\n\t/** Whether the item is selected. */\n\tprotected readonly _active = signal(false);\n\n\t/** Emits when the item is selected. */\n\tpublic readonly selected = output<void>();\n\n\t/** @internal Determine if this item is visible based on the current search query */\n\tpublic readonly visible = computed(() => {\n\t\treturn this._command.filter()(this.safeValue(), this._command.search());\n\t});\n\n\t/** @internal Get the value of the item, with check if it has been initialized to avoid errors */\n\tpublic readonly safeValue = computed(() => {\n\t\tif (!this._initialized()) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this.value();\n\t});\n\n\t/** @internal Get the display value */\n\tpublic getLabel(): string {\n\t\treturn this.safeValue();\n\t}\n\n\t/** @internal */\n\tsetActiveStyles(): void {\n\t\tthis._active.set(true);\n\n\t\t// ensure the item is in view\n\t\tif (isPlatformBrowser(this._platform)) {\n\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n\t\t}\n\t}\n\n\t/** @internal */\n\tsetInactiveStyles(): void {\n\t\tthis._active.set(false);\n\t}\n\n\tprotected onClick(): void {\n\t\tthis._command.keyManager.setActiveItem(this);\n\t\tthis.selected.emit();\n\t}\n\n\tprotected activate(): void {\n\t\tif (this._disabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._command.keyManager.setActiveItem(this);\n\t}\n\n\tngOnInit(): void {\n\t\tthis._initialized.set(true);\n\t}\n}\n","import { Directive, input } from '@angular/core';\n\n@Directive({\n\tselector: '[brnCommandList]',\n\thost: {\n\t\trole: 'listbox',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandList {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-list-${++BrnCommandList._id}`);\n}\n","import { computed, Directive } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommandSeparator]',\n\thost: {\n\t\trole: 'separator',\n\t\t'[attr.data-hidden]': '_hasSearchInput() ? true : null',\n\t},\n})\nexport class BrnCommandSeparator {\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any search input */\n\tprotected readonly _hasSearchInput = computed(() => this._command.search().length > 0);\n}\n","import { BrnCommand } from './lib/brn-command';\nimport { BrnCommandEmpty } from './lib/brn-command-empty';\nimport { BrnCommandGroup } from './lib/brn-command-group';\nimport { BrnCommandInput } from './lib/brn-command-input';\nimport { BrnCommandItem } from './lib/brn-command-item';\nimport { BrnCommandList } from './lib/brn-command-list';\nimport { BrnCommandSeparator } from './lib/brn-command-separator';\n\nexport * from './lib/brn-command';\nexport * from './lib/brn-command-empty';\nexport * from './lib/brn-command-group';\nexport * from './lib/brn-command-input';\nexport * from './lib/brn-command-input.token';\nexport * from './lib/brn-command-item';\nexport * from './lib/brn-command-item.token';\nexport * from './lib/brn-command-list';\nexport * from './lib/brn-command-separator';\nexport * from './lib/brn-command.token';\n\nexport const BrnCommandImports = [\n\tBrnCommand,\n\tBrnCommandEmpty,\n\tBrnCommandGroup,\n\tBrnCommandInput,\n\tBrnCommandItem,\n\tBrnCommandList,\n\tBrnCommandSeparator,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAGa,mBAAmB,GAAG,IAAI,cAAc,CAAiB,qBAAqB;AAErF,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AChC,UAAU;IACV,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,mBAAmB;;;AC1BpB;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-command.mjs","sources":["../../../../libs/brain/command/src/lib/brn-command-item.token.ts","../../../../libs/brain/command/src/lib/brn-command.token.ts","../../../../libs/brain/command/src/lib/brn-command.ts","../../../../libs/brain/command/src/lib/brn-command-empty.ts","../../../../libs/brain/command/src/lib/brn-command-group.ts","../../../../libs/brain/command/src/lib/brn-command-input.token.ts","../../../../libs/brain/command/src/lib/brn-command-input.ts","../../../../libs/brain/command/src/lib/brn-command-item.ts","../../../../libs/brain/command/src/lib/brn-command-list.ts","../../../../libs/brain/command/src/lib/brn-command-separator.ts","../../../../libs/brain/command/src/index.ts","../../../../libs/brain/command/src/spartan-ng-brain-command.ts"],"sourcesContent":["import { type ExistingProvider, InjectionToken, type Type } from '@angular/core';\nimport type { BrnCommandItem } from './brn-command-item';\n\nexport const BrnCommandItemToken = new InjectionToken<BrnCommandItem>('BrnCommandItemToken');\n\nexport function provideBrnCommandItem(command: Type<BrnCommandItem>): ExistingProvider {\n\treturn { provide: BrnCommandItemToken, useExisting: command };\n}\n","import { type ExistingProvider, inject, InjectionToken, type Type, type ValueProvider } from '@angular/core';\nimport type { BrnCommand } from './brn-command';\n\nexport const BrnCommandToken = new InjectionToken<BrnCommand>('BrnCommandToken');\n\nexport function provideBrnCommand(command: Type<BrnCommand>): ExistingProvider {\n\treturn { provide: BrnCommandToken, useExisting: command };\n}\n\nexport function injectBrnCommand(): BrnCommand {\n\treturn inject(BrnCommandToken);\n}\n\n// config\nexport type CommandFilter = (value: string, search: string) => boolean;\n\nexport interface BrnCommandConfig {\n\tfilter: CommandFilter;\n}\n\nconst defaultConfig: BrnCommandConfig = {\n\tfilter: (value: string, search: string) => value.toLowerCase().includes(search.toLowerCase()),\n};\n\nconst BrnCommandConfigToken = new InjectionToken<BrnCommandConfig>('BrnCommandConfig');\n\nexport function provideBrnCommandConfig(config: Partial<BrnCommandConfig>): ValueProvider {\n\treturn { provide: BrnCommandConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnCommandConfig(): BrnCommandConfig {\n\treturn inject(BrnCommandConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tforwardRef,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n\tsignal,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnCommandItemToken } from './brn-command-item.token';\nimport type { BrnCommandList } from './brn-command-list';\nimport { type CommandFilter, injectBrnCommandConfig, provideBrnCommand } from './brn-command.token';\n\nexport const BRN_COMMAND_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCommand),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnCommand]',\n\tproviders: [provideBrnCommand(BrnCommand), BRN_COMMAND_VALUE_ACCESSOR],\n\thost: {\n\t\t'[id]': 'id()',\n\t\t'(keydown.enter)': 'selectActiveItem()',\n\t},\n})\nexport class BrnCommand implements ControlValueAccessor {\n\tprivate static _id = 0;\n\n\tprivate readonly _injector = inject(Injector);\n\n\tprivate readonly _config = injectBrnCommandConfig();\n\n\t/** The id of the command */\n\tpublic readonly id = input<string>(`brn-command-${++BrnCommand._id}`);\n\n\t/** A custom filter function to use when searching. */\n\tpublic readonly filter = input<CommandFilter>(this._config.filter);\n\n\t/** Whether the command is disabled */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\tprivate readonly _disabled = linkedSignal(this.disabled);\n\n\t/** @internal The disabled state as a readonly signal */\n\tpublic readonly disabledState = this._disabled.asReadonly();\n\n\t/** when the selection has changed */\n\tpublic readonly valueChange = output<string>();\n\n\t/** The current search query. */\n\tpublic readonly search = model<string>('');\n\n\t/** @internal Access all the items within the command */\n\tpublic readonly items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal The key manager for managing active descendant */\n\tpublic readonly keyManager = new ActiveDescendantKeyManager(this.items, this._injector);\n\n\tprivate readonly _commandList = signal<BrnCommandList | undefined>(undefined);\n\n\t/** @internal The id of the command list, registered by BrnCommandList. Used by the input for aria-controls. */\n\tpublic readonly listId = computed(() => this._commandList()?.id());\n\n\t/** @internal Register the command list. Called by BrnCommandList in its constructor. */\n\tpublic registerCommandList(list: BrnCommandList): void {\n\t\tthis._commandList.set(list);\n\t}\n\n\tprotected _onChange?: ChangeFn<string | null>;\n\tprotected _onTouched?: TouchFn;\n\n\tconstructor() {\n\t\tthis.keyManager\n\t\t\t.withVerticalOrientation()\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t.skipPredicate((item) => item.disabled || !item.visible());\n\n\t\t// When clearing the search input we also want to reset the active item to the first one\n\t\teffect(() => {\n\t\t\tconst searchInput = this.search();\n\t\t\tuntracked(() => {\n\t\t\t\tconst activeItemIsVisible = this.keyManager.activeItem?.visible();\n\t\t\t\tif ((searchInput !== undefined && searchInput.length === 0) || !activeItemIsVisible) {\n\t\t\t\t\tthis.keyManager.setFirstItemActive();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis.keyManager.change.pipe(takeUntilDestroyed()).subscribe(() => {\n\t\t\tconst value = this.keyManager.activeItem?.safeValue();\n\t\t\tif (value) {\n\t\t\t\tthis.valueChange.emit(value);\n\t\t\t}\n\t\t});\n\n\t\tafterNextRender(() => {\n\t\t\tif (this.items().length) {\n\t\t\t\tthis.keyManager.setActiveItem(0);\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected selectActiveItem(): void {\n\t\tthis.keyManager.activeItem?.selected.emit();\n\t}\n\n\t/** CONTROL VALUE ACCESSOR */\n\twriteValue(value: string | null): void {\n\t\tif (value) {\n\t\t\tthis.search.set(value);\n\t\t}\n\t}\n\n\tregisterOnChange(fn: ChangeFn<string | null>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._disabled.set(isDisabled);\n\t}\n}\n","import { computed, Directive, effect, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommandEmpty]',\n})\nexport class BrnCommandEmpty {\n\tprivate readonly _templateRef = inject<TemplateRef<void>>(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any visible items */\n\tprivate readonly _visible = computed(() => this._command.items().some((item) => item.visible()));\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tif (this._visible()) {\n\t\t\t\tthis._viewContainerRef.clear();\n\t\t\t} else {\n\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t}\n\t\t});\n\t}\n}\n","import { computed, contentChildren, Directive, input } from '@angular/core';\nimport { BrnCommandItemToken } from './brn-command-item.token';\n\n@Directive({\n\tselector: '[brnCommandGroup]',\n\thost: {\n\t\trole: 'group',\n\t\t'[attr.data-hidden]': '!_visible() ? true : null',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandGroup {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-group-${++BrnCommandGroup._id}`);\n\n\t/** Get the items in the group */\n\tprivate readonly _items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** Determine if there are any visible items in the group */\n\tprotected readonly _visible = computed(() => this._items().some((item) => item.visible()));\n}\n","import { type ExistingProvider, InjectionToken, type Type } from '@angular/core';\nimport type { BrnCommandInput } from './brn-command-input';\n\nexport const BrnCommandInputToken = new InjectionToken<BrnCommandInput>('BrnCommandInputToken');\n\nexport function provideBrnCommandInput(command: Type<BrnCommandInput>): ExistingProvider {\n\treturn { provide: BrnCommandInputToken, useExisting: command };\n}\n","import { Directive, effect, ElementRef, inject, input, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { startWith } from 'rxjs/operators';\nimport { provideBrnCommandInput } from './brn-command-input.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'input[brnCommandInput]',\n\tproviders: [provideBrnCommandInput(BrnCommandInput)],\n\thost: {\n\t\t'[id]': 'id()',\n\t\trole: 'combobox',\n\t\t'aria-autocomplete': 'list',\n\t\t'aria-haspopup': 'listbox',\n\t\t'aria-expanded': 'true',\n\t\t'[attr.aria-controls]': '_commandListId()',\n\t\t'[attr.aria-activedescendant]': '_activeDescendant()',\n\t\t'[attr.disabled]': '_disabled() ? \"\" : null',\n\t\t'(keydown)': 'onKeyDown($event)',\n\t\t'(input)': 'onInput()',\n\t\ttype: 'text',\n\t\tautocomplete: 'off',\n\t\tautocorrect: 'off',\n\t\tspellcheck: 'false',\n\t},\n})\nexport class BrnCommandInput {\n\tprivate static _id = 0;\n\n\tprivate readonly _el = inject(ElementRef);\n\tprivate readonly _command = injectBrnCommand();\n\tprivate readonly _initialId = `brn-command-input-${++BrnCommandInput._id}`;\n\n\t/** The id of the command input */\n\tpublic readonly id = input<string, string | undefined>(this._initialId, {\n\t\ttransform: (value) => value || this._initialId,\n\t});\n\n\tprotected readonly _commandListId = this._command.listId;\n\n\tprotected readonly _disabled = this._command.disabledState;\n\n\t/** The id of the active option */\n\tprotected readonly _activeDescendant = signal<string | undefined>(undefined);\n\n\tconstructor() {\n\t\tthis._command.keyManager.change\n\t\t\t.pipe(startWith(this._command.keyManager.activeItemIndex), takeUntilDestroyed())\n\t\t\t.subscribe(() => this._activeDescendant.set(this._command.keyManager.activeItem?.id()));\n\n\t\teffect(() => {\n\t\t\tconst search = this._command.search();\n\n\t\t\tif (this._el.nativeElement.value !== search) {\n\t\t\t\tthis._el.nativeElement.value = search;\n\t\t\t}\n\t\t});\n\t}\n\t/** Listen for changes to the input value */\n\tprotected onInput(): void {\n\t\tthis._command.search.set(this._el.nativeElement.value);\n\t}\n\n\t/** Listen for keydown events */\n\tprotected onKeyDown(event: KeyboardEvent): void {\n\t\tthis._command.keyManager.onKeydown(event);\n\t}\n}\n","import type { Highlightable } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tDirective,\n\tElementRef,\n\tinject,\n\tinput,\n\ttype OnInit,\n\toutput,\n\tPLATFORM_ID,\n\tsignal,\n} from '@angular/core';\nimport { provideBrnCommandItem } from './brn-command-item.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'button[brnCommandItem]',\n\tproviders: [provideBrnCommandItem(BrnCommandItem)],\n\thost: {\n\t\ttype: 'button',\n\t\trole: 'option',\n\t\ttabIndex: '-1',\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': '_disabled() ? true : null',\n\t\t'[attr.data-disabled]': '_disabled() ? \"\" : null',\n\t\t'[attr.data-value]': 'value()',\n\t\t'[attr.data-hidden]': '!visible() ? true : null',\n\t\t'[attr.aria-selected]': '_active()',\n\t\t'[attr.data-selected]': '_active() ? true : null',\n\t\t'(click)': 'onClick()',\n\t\t'(mouseenter)': 'activate()',\n\t},\n})\nexport class BrnCommandItem implements Highlightable, OnInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\t/** Access the command component */\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** A unique id for the item */\n\tpublic readonly id = input<string>(`brn-command-item-${++BrnCommandItem._id}`);\n\n\t/** The value this item represents. */\n\tpublic readonly value = input.required<string>();\n\n\t/** Whether the item is disabled. */\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Expose disabled as a value - used by the Highlightable interface */\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\t/** Whether the item is initialized, this is to prevent accessing the value-input before the component is initialized.\n\t * The brn-command-empty directive accesses the value before the component is initialized, which causes an error.\n\t */\n\tprivate readonly _initialized = signal(false);\n\n\t/** Whether the item is selected. */\n\tprotected readonly _active = signal(false);\n\n\t/** Emits when the item is selected. */\n\tpublic readonly selected = output<void>();\n\n\t/** @internal Determine if this item is visible based on the current search query */\n\tpublic readonly visible = computed(() => {\n\t\treturn this._command.filter()(this.safeValue(), this._command.search());\n\t});\n\n\t/** @internal Get the value of the item, with check if it has been initialized to avoid errors */\n\tpublic readonly safeValue = computed(() => {\n\t\tif (!this._initialized()) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this.value();\n\t});\n\n\t/** @internal Get the display value */\n\tpublic getLabel(): string {\n\t\treturn this.safeValue();\n\t}\n\n\t/** @internal */\n\tsetActiveStyles(): void {\n\t\tthis._active.set(true);\n\n\t\t// ensure the item is in view\n\t\tif (isPlatformBrowser(this._platform)) {\n\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n\t\t}\n\t}\n\n\t/** @internal */\n\tsetInactiveStyles(): void {\n\t\tthis._active.set(false);\n\t}\n\n\tprotected onClick(): void {\n\t\tthis._command.keyManager.setActiveItem(this);\n\t\tthis.selected.emit();\n\t}\n\n\tprotected activate(): void {\n\t\tif (this._disabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._command.keyManager.setActiveItem(this);\n\t}\n\n\tngOnInit(): void {\n\t\tthis._initialized.set(true);\n\t}\n}\n","import { Directive, input } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommandList]',\n\thost: {\n\t\trole: 'listbox',\n\t\t'[id]': 'id()',\n\t\t'[attr.aria-label]': 'ariaLabel()',\n\t},\n})\nexport class BrnCommandList {\n\tprivate static _id = 0;\n\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-list-${++BrnCommandList._id}`);\n\n\t/** Optional accessible name for the listbox. Usually not needed as the combobox names the widget. */\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tconstructor() {\n\t\tthis._command.registerCommandList(this);\n\t}\n}\n","import { computed, Directive } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommandSeparator]',\n\thost: {\n\t\trole: 'presentation',\n\t\t'[attr.data-hidden]': '_hasSearchInput() ? true : null',\n\t},\n})\nexport class BrnCommandSeparator {\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any search input */\n\tprotected readonly _hasSearchInput = computed(() => this._command.search().length > 0);\n}\n","import { BrnCommand } from './lib/brn-command';\nimport { BrnCommandEmpty } from './lib/brn-command-empty';\nimport { BrnCommandGroup } from './lib/brn-command-group';\nimport { BrnCommandInput } from './lib/brn-command-input';\nimport { BrnCommandItem } from './lib/brn-command-item';\nimport { BrnCommandList } from './lib/brn-command-list';\nimport { BrnCommandSeparator } from './lib/brn-command-separator';\n\nexport * from './lib/brn-command';\nexport * from './lib/brn-command-empty';\nexport * from './lib/brn-command-group';\nexport * from './lib/brn-command-input';\nexport * from './lib/brn-command-input.token';\nexport * from './lib/brn-command-item';\nexport * from './lib/brn-command-item.token';\nexport * from './lib/brn-command-list';\nexport * from './lib/brn-command-separator';\nexport * from './lib/brn-command.token';\n\nexport const BrnCommandImports = [\n\tBrnCommand,\n\tBrnCommandEmpty,\n\tBrnCommandGroup,\n\tBrnCommandInput,\n\tBrnCommandItem,\n\tBrnCommandList,\n\tBrnCommandSeparator,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAGa,mBAAmB,GAAG,IAAI,cAAc,CAAiB,qBAAqB;AAErF,SAAU,qBAAqB,CAAC,OAA6B,EAAA;IAClE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE;AAC9D;;MCJa,eAAe,GAAG,IAAI,cAAc,CAAa,iBAAiB;AAEzE,SAAU,iBAAiB,CAAC,OAAyB,EAAA;IAC1D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE;AAC1D;SAEgB,gBAAgB,GAAA;AAC/B,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAC/B;AASA,MAAM,aAAa,GAAqB;AACvC,IAAA,MAAM,EAAE,CAAC,KAAa,EAAE,MAAc,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;CAC7F;AAED,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAmB,kBAAkB,CAAC;AAEhF,SAAU,uBAAuB,CAAC,MAAiC,EAAA;AACxE,IAAA,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE;AACrF;SAEgB,sBAAsB,GAAA;AACrC,IAAA,OAAO,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,aAAa;AAC1E;;ACNO,MAAM,0BAA0B,GAAG;AACzC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,UAAU,CAAC;AACzC,IAAA,KAA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"name": "@spartan-ng/brain",
3
- "version": "1.3.0",
3
+ "version": "1.3.1-beta.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/spartan-ng/spartan.git"
@@ -11,6 +11,8 @@ declare class BrnAutocompleteInput<T> {
11
11
  private static _id;
12
12
  private readonly _el;
13
13
  private readonly _autocomplete;
14
+ /** The id of the autocomplete list, used for aria-controls. */
15
+ protected readonly _autocompleteListId: _angular_core.Signal<string | undefined>;
14
16
  /** The id of the autocomplete input */
15
17
  readonly id: _angular_core.InputSignal<string>;
16
18
  /** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */
@@ -57,6 +59,20 @@ declare class BrnAutocompleteItem<T> implements Highlightable {
57
59
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteItem<any>, "[brnAutocompleteItem]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "_disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
58
60
  }
59
61
 
62
+ declare class BrnAutocompleteList {
63
+ private static _id;
64
+ private readonly _autocomplete;
65
+ /** Determine if the autocomplete has any visible items */
66
+ protected readonly _visibleItems: _angular_core.Signal<boolean>;
67
+ /** The id of the autocomplete list */
68
+ readonly id: _angular_core.InputSignal<string>;
69
+ /** Optional accessible name for the listbox. Usually not needed as the autocomplete names the widget. */
70
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
71
+ constructor();
72
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAutocompleteList, never>;
73
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteList, "[brnAutocompleteList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
74
+ }
75
+
60
76
  interface BrnAutocompleteBase<T> {
61
77
  itemToString: InputSignal<AutocompleteItemToString<T> | undefined>;
62
78
  search: ModelSignal<string>;
@@ -68,6 +84,7 @@ interface BrnAutocompleteBase<T> {
68
84
  isExpanded: Signal<boolean>;
69
85
  searchInputWrapperWidth: Signal<number | null>;
70
86
  controlState: Signal<ControlState | null> | undefined;
87
+ listId: Signal<string | undefined>;
71
88
  updateSearch: (value: string) => void;
72
89
  isSelected: (itemValue: T) => boolean;
73
90
  select: (itemValue: T) => void;
@@ -76,6 +93,7 @@ interface BrnAutocompleteBase<T> {
76
93
  /** Select the active item with Enter key. */
77
94
  selectActiveItem: () => void;
78
95
  registerAutocompleteInput: (input: BrnAutocompleteInput<T>) => void;
96
+ registerAutocompleteList: (list: BrnAutocompleteList) => void;
79
97
  updateInputWidth: (width: number | null) => void;
80
98
  }
81
99
  declare const BrnAutocompleteBaseToken: InjectionToken<BrnAutocompleteBase<unknown>>;
@@ -129,12 +147,17 @@ declare class BrnAutocomplete<T> implements BrnAutocompleteBase<T>, ControlValue
129
147
  /** @internal Whether the autocomplete is expanded */
130
148
  readonly isExpanded: _angular_core.Signal<boolean>;
131
149
  private readonly _autocompleteInput;
150
+ private readonly _autocompleteList;
151
+ /** @internal The id of the autocomplete list, registered by BrnAutocompleteList. Used by the input for aria-controls. */
152
+ readonly listId: _angular_core.Signal<string | undefined>;
132
153
  protected _onChange?: ChangeFn<T | undefined | null>;
133
154
  protected _onTouched?: TouchFn;
134
155
  readonly labelableId: _angular_core.Signal<string | undefined>;
135
156
  readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined;
136
157
  constructor();
137
158
  registerAutocompleteInput(input: BrnAutocompleteInput<T>): void;
159
+ /** @internal Register the autocomplete list. Called by BrnAutocompleteList in its constructor. */
160
+ registerAutocompleteList(list: BrnAutocompleteList): void;
138
161
  updateInputWidth(width: number | null): void;
139
162
  updateSearch(value: string): void;
140
163
  isSelected(itemValue: T): boolean;
@@ -213,17 +236,6 @@ declare class BrnAutocompleteLabel {
213
236
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteLabel, "[brnAutocompleteLabel]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
214
237
  }
215
238
 
216
- declare class BrnAutocompleteList {
217
- private static _id;
218
- private readonly _autocomplete;
219
- /** Determine if the autocomplete has any visible items */
220
- protected readonly _visibleItems: _angular_core.Signal<boolean>;
221
- /** The id of the autocomplete list */
222
- readonly id: _angular_core.InputSignal<string>;
223
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAutocompleteList, never>;
224
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteList, "[brnAutocompleteList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
225
- }
226
-
227
239
  declare const BRN_AUTOCOMPLETE_SEARCH_VALUE_ACCESSOR: {
228
240
  provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
229
241
  useExisting: _angular_core.Type<any>;
@@ -261,11 +273,16 @@ declare class BrnAutocompleteSearch<T> implements BrnAutocompleteBase<T>, Contro
261
273
  /** @internal Whether the autocomplete is expanded */
262
274
  readonly isExpanded: _angular_core.Signal<boolean>;
263
275
  private readonly _autocompleteInput;
276
+ private readonly _autocompleteList;
277
+ /** @internal The id of the autocomplete list, registered by BrnAutocompleteList. Used by the input for aria-controls. */
278
+ readonly listId: _angular_core.Signal<string | undefined>;
264
279
  protected _onChange?: ChangeFn<string | undefined | null>;
265
280
  protected _onTouched?: TouchFn;
266
281
  readonly labelableId: _angular_core.Signal<string | undefined>;
267
282
  constructor();
268
283
  registerAutocompleteInput(input: BrnAutocompleteInput<T>): void;
284
+ /** @internal Register the autocomplete list. Called by BrnAutocompleteList in its constructor. */
285
+ registerAutocompleteList(list: BrnAutocompleteList): void;
269
286
  updateInputWidth(width: number | null): void;
270
287
  updateSearch(value: string): void;
271
288
  isSelected(itemValue: T): boolean;
@@ -59,6 +59,20 @@ declare class BrnComboboxItem<T> implements Highlightable {
59
59
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxItem<any>, "[brnComboboxItem]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "_disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
60
60
  }
61
61
 
62
+ declare class BrnComboboxList {
63
+ private static _id;
64
+ private readonly _combobox;
65
+ /** Determine if the combobox has any visible items */
66
+ protected readonly _visibleItems: _angular_core.Signal<boolean>;
67
+ /** The id of the combobox list */
68
+ readonly id: _angular_core.InputSignal<string>;
69
+ /** Optional accessible name for the listbox. Usually not needed as the combobox names the widget. */
70
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
71
+ constructor();
72
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxList, never>;
73
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxList, "[brnComboboxList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
74
+ }
75
+
62
76
  type ComboboxInputMode = 'combobox' | 'popup';
63
77
  interface BrnComboboxBase<T> {
64
78
  filter: InputSignal<ComboboxFilter<T>>;
@@ -75,6 +89,7 @@ interface BrnComboboxBase<T> {
75
89
  mode: Signal<ComboboxInputMode>;
76
90
  controlState?: Signal<ControlState | null>;
77
91
  hasValue: Signal<boolean>;
92
+ listId: Signal<string | undefined>;
78
93
  isSelected: (itemValue: T) => boolean;
79
94
  select: (itemValue: T) => void;
80
95
  open: () => void;
@@ -91,6 +106,8 @@ interface BrnComboboxBase<T> {
91
106
  registerComboboxInput?: (input: BrnComboboxInput<T>) => void;
92
107
  /** Register the combobox chip input component for multi selection mode */
93
108
  registerComboboxChipInput?: (input: BrnComboboxChipInput<T>) => void;
109
+ /** Register the combobox list component so the input can reference its id via aria-controls */
110
+ registerComboboxList?: (list: BrnComboboxList) => void;
94
111
  updateInputWidth: (width: number | null) => void;
95
112
  }
96
113
  declare const BrnComboboxBaseToken: InjectionToken<BrnComboboxBase<unknown>>;
@@ -134,6 +151,8 @@ declare class BrnComboboxInput<T> {
134
151
  private readonly _combobox;
135
152
  private readonly _content;
136
153
  readonly mode: _angular_core.Signal<ComboboxInputMode>;
154
+ /** The id of the command list, used for aria-controls. */
155
+ protected readonly _comboboxListId: _angular_core.Signal<string | undefined>;
137
156
  /** The id of the combobox input */
138
157
  readonly id: _angular_core.InputSignal<string>;
139
158
  /** Manual override for aria-invalid. When not set, auto-detects from the parent combobox error state. */
@@ -212,12 +231,17 @@ declare class BrnCombobox<T> implements BrnComboboxBase<T>, ControlValueAccessor
212
231
  /** @internal Whether the combobox is expanded */
213
232
  readonly isExpanded: _angular_core.Signal<boolean>;
214
233
  private readonly _comboboxInput;
234
+ private readonly _comboboxList;
235
+ /** @internal The id of the combobox list, registered by BrnComboboxList. Used by the input for aria-controls. */
236
+ readonly listId: _angular_core.Signal<string | undefined>;
215
237
  readonly mode: _angular_core.Signal<ComboboxInputMode>;
216
238
  readonly labelableId: _angular_core.Signal<string | undefined>;
217
239
  protected _onChange?: ChangeFn<T | undefined | null>;
218
240
  protected _onTouched?: TouchFn;
219
241
  constructor();
220
242
  registerComboboxInput(input: BrnComboboxInput<T>): void;
243
+ /** @internal Register the combobox list. Called by BrnComboboxList in its constructor. */
244
+ registerComboboxList(list: BrnComboboxList): void;
221
245
  updateInputWidth(width: number | null): void;
222
246
  isSelected(itemValue: T): boolean;
223
247
  select(itemValue: T): void;
@@ -316,17 +340,6 @@ declare class BrnComboboxLabel {
316
340
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxLabel, "[brnComboboxLabel]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
317
341
  }
318
342
 
319
- declare class BrnComboboxList {
320
- private static _id;
321
- private readonly _combobox;
322
- /** Determine if the combobox has any visible items */
323
- protected readonly _visibleItems: _angular_core.Signal<boolean>;
324
- /** The id of the combobox list */
325
- readonly id: _angular_core.InputSignal<string>;
326
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxList, never>;
327
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxList, "[brnComboboxList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
328
- }
329
-
330
343
  declare const BRN_COMBOBOX_MULTIPLE_VALUE_ACCESSOR: {
331
344
  provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
332
345
  useExisting: _angular_core.Type<any>;
@@ -382,12 +395,17 @@ declare class BrnComboboxMultiple<T> implements BrnComboboxBase<T>, ControlValue
382
395
  /** @internal Whether the autocomplete is expanded */
383
396
  readonly isExpanded: _angular_core.Signal<boolean>;
384
397
  private readonly _comboboxChipInput;
398
+ private readonly _comboboxList;
399
+ /** @internal The id of the combobox list, registered by BrnComboboxList. Used by the input for aria-controls. */
400
+ readonly listId: _angular_core.Signal<string | undefined>;
385
401
  readonly mode: _angular_core.Signal<ComboboxInputMode>;
386
402
  readonly labelableId: _angular_core.Signal<string | undefined>;
387
403
  protected _onChange?: ChangeFn<T[] | undefined | null>;
388
404
  protected _onTouched?: TouchFn;
389
405
  constructor();
390
406
  registerComboboxChipInput(input: BrnComboboxChipInput<T>): void;
407
+ /** @internal Register the combobox list. Called by BrnComboboxList in its constructor. */
408
+ registerComboboxList(list: BrnComboboxList): void;
391
409
  updateInputWidth(width: number | null): void;
392
410
  isSelected(itemValue: T): boolean;
393
411
  select(itemValue: T): void;
@@ -6,6 +6,18 @@ import { BooleanInput } from '@angular/cdk/coercion';
6
6
  import { ControlValueAccessor } from '@angular/forms';
7
7
  import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
8
8
 
9
+ declare class BrnCommandList {
10
+ private static _id;
11
+ private readonly _command;
12
+ /** The id of the command list */
13
+ readonly id: _angular_core.InputSignal<string>;
14
+ /** Optional accessible name for the listbox. Usually not needed as the combobox names the widget. */
15
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
16
+ constructor();
17
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCommandList, never>;
18
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCommandList, "[brnCommandList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
19
+ }
20
+
9
21
  declare const BrnCommandToken: InjectionToken<BrnCommand>;
10
22
  declare function provideBrnCommand(command: Type<BrnCommand>): ExistingProvider;
11
23
  declare function injectBrnCommand(): BrnCommand;
@@ -42,6 +54,11 @@ declare class BrnCommand implements ControlValueAccessor {
42
54
  readonly items: _angular_core.Signal<readonly _spartan_ng_brain_command.BrnCommandItem[]>;
43
55
  /** @internal The key manager for managing active descendant */
44
56
  readonly keyManager: ActiveDescendantKeyManager<_spartan_ng_brain_command.BrnCommandItem>;
57
+ private readonly _commandList;
58
+ /** @internal The id of the command list, registered by BrnCommandList. Used by the input for aria-controls. */
59
+ readonly listId: _angular_core.Signal<string | undefined>;
60
+ /** @internal Register the command list. Called by BrnCommandList in its constructor. */
61
+ registerCommandList(list: BrnCommandList): void;
45
62
  protected _onChange?: ChangeFn<string | null>;
46
63
  protected _onTouched?: TouchFn;
47
64
  constructor();
@@ -85,6 +102,7 @@ declare class BrnCommandInput {
85
102
  private readonly _initialId;
86
103
  /** The id of the command input */
87
104
  readonly id: _angular_core.InputSignalWithTransform<string, string | undefined>;
105
+ protected readonly _commandListId: _angular_core.Signal<string | undefined>;
88
106
  protected readonly _disabled: _angular_core.Signal<boolean>;
89
107
  /** The id of the active option */
90
108
  protected readonly _activeDescendant: _angular_core.WritableSignal<string | undefined>;
@@ -136,14 +154,6 @@ declare class BrnCommandItem implements Highlightable, OnInit {
136
154
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCommandItem, "button[brnCommandItem]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "_disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "selected": "selected"; }, never, never, true, never>;
137
155
  }
138
156
 
139
- declare class BrnCommandList {
140
- private static _id;
141
- /** The id of the command list */
142
- readonly id: _angular_core.InputSignal<string>;
143
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnCommandList, never>;
144
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnCommandList, "[brnCommandList]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
145
- }
146
-
147
157
  declare class BrnCommandSeparator {
148
158
  private readonly _command;
149
159
  /** Determine if the command has any search input */