@spartan-ng/brain 0.0.1-alpha.702 → 0.0.1-alpha.704

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.
@@ -29,9 +29,10 @@ declare class BrnAccordionTrigger implements FocusableOption {
29
29
  declare class BrnAccordion implements AfterContentInit, OnDestroy {
30
30
  private readonly _el;
31
31
  private readonly _dir;
32
+ private readonly _brnAccordionItems;
32
33
  private readonly _focusMonitor;
33
34
  private readonly _keyManager;
34
- private readonly _focused;
35
+ private _focused;
35
36
  private readonly _openItemIds;
36
37
  readonly openItemIds: _angular_core.Signal<number[]>;
37
38
  readonly state: _angular_core.Signal<"open" | "closed">;
@@ -59,8 +60,10 @@ declare class BrnAccordion implements AfterContentInit, OnDestroy {
59
60
  private isEditableTarget;
60
61
  private shouldIgnoreEvent;
61
62
  private preventDefaultEvents;
63
+ openAll(): void;
64
+ closeAll(): void;
62
65
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordion, never>;
63
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordion, "[brnAccordion]", ["brnAccordion"], { "type": { "alias": "type"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
66
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordion, "[brnAccordion]", ["brnAccordion"], { "type": { "alias": "type"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, ["_brnAccordionItems"], never, true, never>;
64
67
  }
65
68
 
66
69
  declare class BrnAccordionContent {
@@ -123,6 +126,8 @@ declare class BrnAccordionItem {
123
126
  */
124
127
  readonly openedChange: _angular_core.OutputEmitterRef<boolean>;
125
128
  constructor();
129
+ open(): void;
130
+ close(): void;
126
131
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordionItem, never>;
127
132
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionItem, "[brnAccordionItem]", ["brnAccordionItem"], { "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "stateChange": "stateChange"; "openedChange": "openedChange"; }, never, never, true, never>;
128
133
  }
@@ -15,6 +15,8 @@ declare class BrnAutocompleteInput<T> {
15
15
  readonly id: _angular_core.InputSignal<string>;
16
16
  /** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */
17
17
  readonly ariaInvalidOverride: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
18
+ /** Forces the invalid state visually, regardless of form control state. */
19
+ readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
18
20
  readonly disabled: _angular_core.Signal<boolean>;
19
21
  /** Whether the autocomplete panel is expanded */
20
22
  protected readonly _isExpanded: _angular_core.Signal<boolean>;
@@ -27,7 +29,7 @@ declare class BrnAutocompleteInput<T> {
27
29
  protected onInput(event: Event): void;
28
30
  protected onKeyDown(event: KeyboardEvent): void;
29
31
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAutocompleteInput<any>, never>;
30
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteInput<any>, "input[brnAutocompleteInput]", ["brnAutocompleteInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
32
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAutocompleteInput<any>, "input[brnAutocompleteInput]", ["brnAutocompleteInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
31
33
  }
32
34
 
33
35
  declare class BrnAutocompleteItem<T> implements Highlightable {
@@ -168,8 +170,8 @@ declare class BrnAutocompleteClear {
168
170
  private readonly _renderer;
169
171
  private readonly _templateRef;
170
172
  private readonly _viewContainerRef;
171
- /** Determine if the combobox has a value */
172
- private readonly _hasValue;
173
+ /** Determine if the autocomplete has a value or search text */
174
+ private readonly _shouldShowClear;
173
175
  constructor();
174
176
  clear(): void;
175
177
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAutocompleteClear, never>;
@@ -128,6 +128,8 @@ declare class BrnComboboxInput<T> {
128
128
  readonly id: _angular_core.InputSignal<string>;
129
129
  /** Manual override for aria-invalid. When not set, auto-detects from the parent combobox error state. */
130
130
  readonly ariaInvalidOverride: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
131
+ /** Forces the invalid state visually, regardless of form control state. */
132
+ readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
131
133
  readonly disabled: _angular_core.Signal<boolean>;
132
134
  /** Whether the combobox panel is expanded */
133
135
  protected readonly _isExpanded: _angular_core.Signal<boolean>;
@@ -141,7 +143,7 @@ declare class BrnComboboxInput<T> {
141
143
  /** Listen for keydown events */
142
144
  protected onKeyDown(event: KeyboardEvent): void;
143
145
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxInput<any>, never>;
144
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxInput<any>, "input[brnComboboxInput]", ["brnComboboxInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
146
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxInput<any>, "input[brnComboboxInput]", ["brnComboboxInput"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
145
147
  }
146
148
 
147
149
  declare const BRN_COMBOBOX_VALUE_ACCESSOR: {
@@ -254,7 +256,7 @@ declare class BrnComboboxClear {
254
256
  private readonly _templateRef;
255
257
  private readonly _viewContainerRef;
256
258
  /** Determine if the combobox has a value */
257
- private readonly _hasValue;
259
+ private readonly _shouldShowClear;
258
260
  constructor();
259
261
  private clear;
260
262
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxClear, never>;
@@ -264,8 +266,8 @@ declare class BrnComboboxClear {
264
266
  declare class BrnComboboxContent {
265
267
  private readonly _combobox;
266
268
  readonly el: ElementRef<HTMLElement>;
267
- /** Determine if the combobox is empty */
268
- protected readonly _empty: _angular_core.Signal<boolean>;
269
+ /** Determine if the combobox has no visible items */
270
+ protected readonly _isEmpty: _angular_core.Signal<boolean>;
269
271
  protected readonly _comboboxWidth: _angular_core.Signal<number | null>;
270
272
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnComboboxContent, never>;
271
273
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnComboboxContent, "[brnComboboxContent]", never, {}, {}, never, never, true, never>;
@@ -1,7 +1,7 @@
1
1
  import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
2
2
  import { Directionality } from '@angular/cdk/bidi';
3
3
  import * as i0 from '@angular/core';
4
- import { InjectionToken, inject, ElementRef, computed, signal, input, Directive, DestroyRef, NgZone, PLATFORM_ID, afterNextRender, booleanAttribute, output, effect, untracked, isDevMode } from '@angular/core';
4
+ import { InjectionToken, inject, input, booleanAttribute, computed, output, effect, untracked, Directive, ElementRef, contentChildren, signal, DestroyRef, NgZone, PLATFORM_ID, afterNextRender, isDevMode } from '@angular/core';
5
5
  import { isPlatformBrowser } from '@angular/common';
6
6
  import { measureDimensions } from '@spartan-ng/brain/core';
7
7
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -32,6 +32,83 @@ function injectBrnAccordionConfig() {
32
32
  return inject(BrnAccordionConfigToken, { optional: true }) ?? defaultConfig;
33
33
  }
34
34
 
35
+ class BrnAccordionItem {
36
+ static _itemIdGenerator = 0;
37
+ id = ++BrnAccordionItem._itemIdGenerator;
38
+ _accordion = injectBrnAccordion();
39
+ /**
40
+ * Whether the item is opened or closed.
41
+ * @default false
42
+ */
43
+ isOpened = input(false, ...(ngDevMode ? [{ debugName: "isOpened", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
44
+ /**
45
+ * Whether the item is disabled.
46
+ * @default false
47
+ */
48
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
49
+ /**
50
+ * Computed state of the item, either 'open' or 'closed'
51
+ * @default closed
52
+ */
53
+ state = computed(() => (this._accordion.openItemIds()?.includes(this.id) ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "state" }] : []));
54
+ /**
55
+ * Emits boolean when the item is opened or closed.
56
+ */
57
+ stateChange = output();
58
+ /**
59
+ * Emits state change when item is opened or closed
60
+ */
61
+ openedChange = output();
62
+ constructor() {
63
+ if (!this._accordion) {
64
+ throw Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');
65
+ }
66
+ effect(() => {
67
+ const state = this.state();
68
+ if (untracked(this.disabled))
69
+ return;
70
+ untracked(() => {
71
+ this.stateChange.emit(state);
72
+ this.openedChange.emit(state === 'open');
73
+ });
74
+ });
75
+ effect(() => {
76
+ const isOpened = this.isOpened();
77
+ untracked(() => {
78
+ if (isOpened) {
79
+ this.open();
80
+ }
81
+ else {
82
+ this.close();
83
+ }
84
+ });
85
+ });
86
+ }
87
+ open() {
88
+ if (this.disabled())
89
+ return;
90
+ this._accordion.openItem(this.id);
91
+ }
92
+ close() {
93
+ if (this.disabled())
94
+ return;
95
+ this._accordion.closeItem(this.id);
96
+ }
97
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
98
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.17", type: BrnAccordionItem, isStandalone: true, selector: "[brnAccordionItem]", inputs: { isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange", openedChange: "openedChange" }, host: { properties: { "attr.data-state": "state()" } }, providers: [provideBrnAccordionItem(BrnAccordionItem)], exportAs: ["brnAccordionItem"], ngImport: i0 });
99
+ }
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, decorators: [{
101
+ type: Directive,
102
+ args: [{
103
+ selector: '[brnAccordionItem]',
104
+ exportAs: 'brnAccordionItem',
105
+ providers: [provideBrnAccordionItem(BrnAccordionItem)],
106
+ host: {
107
+ '[attr.data-state]': 'state()',
108
+ },
109
+ }]
110
+ }], ctorParameters: () => [], propDecorators: { isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }] } });
111
+
35
112
  const HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [
36
113
  'ArrowLeft',
37
114
  'ArrowRight',
@@ -55,6 +132,7 @@ const VERTICAL_KEYS_TO_PREVENT_DEFAULT = [
55
132
  class BrnAccordion {
56
133
  _el = inject((ElementRef));
57
134
  _dir = inject(Directionality);
135
+ _brnAccordionItems = contentChildren(BrnAccordionItem, ...(ngDevMode ? [{ debugName: "_brnAccordionItems" }] : []));
58
136
  _focusMonitor = inject(FocusMonitor);
59
137
  _keyManager = computed(() => new FocusKeyManager(this._triggers())
60
138
  .withHomeAndEnd()
@@ -63,7 +141,9 @@ class BrnAccordion {
63
141
  .withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this._direction() ?? 'ltr'))
64
142
  .withVerticalOrientation(this.orientation() === 'vertical')
65
143
  .skipPredicate((item) => item.disabled), ...(ngDevMode ? [{ debugName: "_keyManager" }] : []));
66
- _focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : []));
144
+ // Not a signal: FocusMonitor can fire mid-render (a disabled child blurs during change
145
+ // detection) and a signal write there throws NG0600. Only read imperatively in keydown. #1371
146
+ _focused = false;
67
147
  _openItemIds = signal([], ...(ngDevMode ? [{ debugName: "_openItemIds" }] : []));
68
148
  openItemIds = this._openItemIds.asReadonly();
69
149
  state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "state" }] : []));
@@ -87,7 +167,9 @@ class BrnAccordion {
87
167
  this._keyManager()?.onKeydown(event);
88
168
  this.preventDefaultEvents(event);
89
169
  });
90
- this._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));
170
+ this._focusMonitor.monitor(this._el, true).subscribe((origin) => {
171
+ this._focused = origin !== null;
172
+ });
91
173
  }
92
174
  ngOnDestroy() {
93
175
  this._focusMonitor.stopMonitoring(this._el);
@@ -145,7 +227,7 @@ class BrnAccordion {
145
227
  preventDefaultEvents(event) {
146
228
  if (event.defaultPrevented)
147
229
  return;
148
- if (!this._focused())
230
+ if (!this._focused)
149
231
  return;
150
232
  if (!('key' in event))
151
233
  return;
@@ -154,8 +236,23 @@ class BrnAccordion {
154
236
  event.preventDefault();
155
237
  }
156
238
  }
239
+ openAll() {
240
+ if (this.type() === 'multiple') {
241
+ this._brnAccordionItems()
242
+ .filter((a) => !a.disabled())
243
+ .forEach((a) => this.openItem(a.id));
244
+ }
245
+ else {
246
+ console.warn('[BrnAccordion]: openAll is only available in multiple mode');
247
+ }
248
+ }
249
+ closeAll() {
250
+ this._brnAccordionItems()
251
+ .filter((a) => !a.disabled())
252
+ .forEach((a) => this.closeItem(a.id));
253
+ }
157
254
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
158
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.17", type: BrnAccordion, isStandalone: true, selector: "[brnAccordion]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.dir": "_direction()", "attr.data-state": "state()", "attr.data-orientation": "orientation()" } }, providers: [provideBrnAccordion(BrnAccordion)], exportAs: ["brnAccordion"], ngImport: i0 });
255
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.17", type: BrnAccordion, isStandalone: true, selector: "[brnAccordion]", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.dir": "_direction()", "attr.data-state": "state()", "attr.data-orientation": "orientation()" } }, providers: [provideBrnAccordion(BrnAccordion)], queries: [{ propertyName: "_brnAccordionItems", predicate: BrnAccordionItem, isSignal: true }], exportAs: ["brnAccordion"], ngImport: i0 });
159
256
  }
160
257
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordion, decorators: [{
161
258
  type: Directive,
@@ -169,7 +266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
169
266
  '[attr.data-orientation]': 'orientation()',
170
267
  },
171
268
  }]
172
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
269
+ }], propDecorators: { _brnAccordionItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnAccordionItem), { isSignal: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
173
270
 
174
271
  class BrnAccordionContent {
175
272
  _config = injectBrnAccordionConfig();
@@ -264,71 +361,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
264
361
  }]
265
362
  }] });
266
363
 
267
- class BrnAccordionItem {
268
- static _itemIdGenerator = 0;
269
- id = ++BrnAccordionItem._itemIdGenerator;
270
- _accordion = injectBrnAccordion();
271
- /**
272
- * Whether the item is opened or closed.
273
- * @default false
274
- */
275
- isOpened = input(false, ...(ngDevMode ? [{ debugName: "isOpened", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
276
- /**
277
- * Whether the item is disabled.
278
- * @default false
279
- */
280
- disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
281
- /**
282
- * Computed state of the item, either 'open' or 'closed'
283
- * @default closed
284
- */
285
- state = computed(() => (this._accordion.openItemIds()?.includes(this.id) ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "state" }] : []));
286
- /**
287
- * Emits boolean when the item is opened or closed.
288
- */
289
- stateChange = output();
290
- /**
291
- * Emits state change when item is opened or closed
292
- */
293
- openedChange = output();
294
- constructor() {
295
- if (!this._accordion) {
296
- throw Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');
297
- }
298
- effect(() => {
299
- const state = this.state();
300
- untracked(() => {
301
- this.stateChange.emit(state);
302
- this.openedChange.emit(state === 'open');
303
- });
304
- });
305
- effect(() => {
306
- const isOpened = this.isOpened();
307
- untracked(() => {
308
- if (isOpened) {
309
- this._accordion.openItem(this.id);
310
- }
311
- else {
312
- this._accordion.closeItem(this.id);
313
- }
314
- });
315
- });
316
- }
317
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
318
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.17", type: BrnAccordionItem, isStandalone: true, selector: "[brnAccordionItem]", inputs: { isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange", openedChange: "openedChange" }, host: { properties: { "attr.data-state": "state()" } }, providers: [provideBrnAccordionItem(BrnAccordionItem)], exportAs: ["brnAccordionItem"], ngImport: i0 });
319
- }
320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, decorators: [{
321
- type: Directive,
322
- args: [{
323
- selector: '[brnAccordionItem]',
324
- exportAs: 'brnAccordionItem',
325
- providers: [provideBrnAccordionItem(BrnAccordionItem)],
326
- host: {
327
- '[attr.data-state]': 'state()',
328
- },
329
- }]
330
- }], ctorParameters: () => [], propDecorators: { isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }] } });
331
-
332
364
  class BrnAccordionTrigger {
333
365
  _destroyRef = inject(DestroyRef);
334
366
  _accordion = injectBrnAccordion();
@@ -354,7 +386,9 @@ class BrnAccordionTrigger {
354
386
  fromEvent(this._el.nativeElement, 'focus')
355
387
  .pipe(takeUntilDestroyed())
356
388
  .subscribe(() => {
357
- this._accordion.setActiveItem(this);
389
+ // Focus can land here mid-render, and setActiveItem writes the key manager's signals.
390
+ // untracked keeps that from throwing NG0600 (those signals aren't read by any view). #1371
391
+ untracked(() => this._accordion.setActiveItem(this));
358
392
  });
359
393
  }
360
394
  toggle(event) {
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion-token.ts","../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-header.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-item.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-trigger.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type, type ValueProvider } from '@angular/core';\nimport type { MeasurementDisplay } from '@spartan-ng/brain/core';\nimport type { BrnAccordion } from './brn-accordion';\nimport type { BrnAccordionItem } from './brn-accordion-item';\n\nexport const BrnAccordionToken = new InjectionToken<BrnAccordion>('BrnAccordionToken');\n\nexport function injectBrnAccordion() {\n\treturn inject(BrnAccordionToken);\n}\n\nexport function provideBrnAccordion(accordion: Type<BrnAccordion>): ExistingProvider {\n\treturn { provide: BrnAccordionToken, useExisting: accordion };\n}\n\nexport const BrnAccordionItemToken = new InjectionToken<BrnAccordionItem>('BrnAccordionItemToken');\n\nexport function injectBrnAccordionItem() {\n\treturn inject(BrnAccordionItemToken);\n}\n\nexport function provideBrnAccordionItem(item: Type<BrnAccordionItem>): ExistingProvider {\n\treturn { provide: BrnAccordionItemToken, useExisting: item };\n}\n\nexport interface BrBrnAccordionConfig {\n\t/**\n\t * The display style to use when measuring element dimensions.\n\t * @default 'block'\n\t */\n\tmeasurementDisplay: MeasurementDisplay;\n}\n\nconst defaultConfig: BrBrnAccordionConfig = {\n\tmeasurementDisplay: 'block',\n};\n\nconst BrnAccordionConfigToken = new InjectionToken<BrBrnAccordionConfig>('BrnBrnAccordionConfig');\n\nexport function provideBrnAccordionConfig(config: Partial<BrBrnAccordionConfig>): ValueProvider {\n\treturn { provide: BrnAccordionConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnAccordionConfig(): BrBrnAccordionConfig {\n\treturn inject(BrnAccordionConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tDirective,\n\tElementRef,\n\tinject,\n\tinput,\n\ttype OnDestroy,\n\tsignal,\n} from '@angular/core';\nimport { provideBrnAccordion } from './brn-accordion-token';\nimport type { BrnAccordionTrigger } from './brn-accordion-trigger';\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\texportAs: 'brnAccordion',\n\tproviders: [provideBrnAccordion(BrnAccordion)],\n\thost: {\n\t\t'[attr.dir]': '_direction()',\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this._triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this._direction() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical')\n\t\t\t.skipPredicate((item) => item.disabled),\n\t);\n\n\tprivate readonly _focused = signal<boolean>(false);\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tprivate readonly _triggers = signal<BrnAccordionTrigger[]>([]);\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\t/** internal **/\n\tprotected readonly _direction = this._dir.valueSignal;\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic registerTrigger(trigger: BrnAccordionTrigger) {\n\t\tthis._triggers.update((triggers) => [...triggers, trigger]);\n\t}\n\n\tpublic unregisterTrigger(trigger: BrnAccordionTrigger) {\n\t\tthis._triggers.update((triggers) => triggers.filter((t) => t !== trigger));\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused()) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\tDirective,\n\tElementRef,\n\tNgZone,\n\tPLATFORM_ID,\n\tafterNextRender,\n\tcomputed,\n\tinject,\n\tinput,\n\tsignal,\n} from '@angular/core';\nimport { measureDimensions } from '@spartan-ng/brain/core';\nimport { injectBrnAccordionConfig, injectBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: 'brn-accordion-content,[brnAccordionContent]',\n\thost: {\n\t\t'[attr.data-state]': 'state?.()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t\t'[style.--brn-accordion-content-width.px]': '_width()',\n\t\t'[style.--brn-accordion-content-height.px]': '_height()',\n\t\t'[attr.inert]': '_inert()',\n\t\t'[attr.style]': 'style()',\n\t},\n})\nexport class BrnAccordionContent {\n\tprivate readonly _config = injectBrnAccordionConfig();\n\tprivate readonly _item = injectBrnAccordionItem();\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _ngZone = inject(NgZone);\n\tprivate readonly _platformId = inject(PLATFORM_ID);\n\n\tprotected readonly _width = signal<number | null>(null);\n\tprotected readonly _height = signal<number | null>(null);\n\tprotected readonly _inert = computed(() => (this.state?.() === 'closed' ? true : undefined));\n\n\tpublic readonly state = this._item?.state;\n\tpublic readonly id = `brn-accordion-content-${this._item?.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item?.id}`;\n\t/**\n\t * The style to be applied to the host element after the dimensions are calculated.\n\t * @default 'overflow: hidden'\n\t */\n\tpublic readonly style = input<string>('overflow: hidden');\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t\tafterNextRender(() => {\n\t\t\tconst hasValidDimensions = this._measureAndSetDimensions();\n\t\t\tif (!hasValidDimensions) {\n\t\t\t\tthis._setupVisibilityObserver();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _measureAndSetDimensions(): boolean {\n\t\tconst content = this._elementRef.nativeElement.firstChild as HTMLElement | null;\n\t\tif (!content) return false;\n\n\t\tconst { width, height } = measureDimensions(content, this._config.measurementDisplay);\n\t\tthis._width.set(width);\n\t\tthis._height.set(height);\n\n\t\treturn width > 0 && height > 0;\n\t}\n\n\tprivate _setupVisibilityObserver(): void {\n\t\tif (!isPlatformBrowser(this._platformId)) return;\n\t\tif (typeof IntersectionObserver === 'undefined') return;\n\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tconst observer = new IntersectionObserver(\n\t\t\t\t(entries) => {\n\t\t\t\t\tif (entries[0].isIntersecting) {\n\t\t\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\t\t\tif (this._measureAndSetDimensions()) {\n\t\t\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ root: null, threshold: 0 },\n\t\t\t);\n\n\t\t\tobserver.observe(this._elementRef.nativeElement);\n\t\t\tthis._destroyRef.onDestroy(() => observer.disconnect());\n\t\t});\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectBrnAccordion } from './brn-accordion-token';\n\n@Directive({\n\tselector: '[brnAccordionHeader]',\n\thost: {\n\t\t'[attr.data-orientation]': '_orientation()',\n\t},\n})\nexport class BrnAccordionHeader {\n\tprivate readonly _accordion = injectBrnAccordion();\n\n\tprotected readonly _orientation = this._accordion.orientation;\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, input, output, untracked } from '@angular/core';\nimport { injectBrnAccordion, provideBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\texportAs: 'brnAccordionItem',\n\tproviders: [provideBrnAccordionItem(BrnAccordionItem)],\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = injectBrnAccordion();\n\t/**\n\t * Whether the item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the item is disabled.\n\t * @default false\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Computed state of the item, either 'open' or 'closed'\n\t * @default closed\n\t */\n\tpublic readonly state = computed(() => (this._accordion.openItemIds()?.includes(this.id) ? 'open' : 'closed'));\n\t/**\n\t * Emits boolean when the item is opened or closed.\n\t */\n\tpublic readonly stateChange = output<'open' | 'closed'>();\n\t/**\n\t * Emits state change when item is opened or closed\n\t */\n\tpublic readonly openedChange = output<boolean>();\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst state = this.state();\n\t\t\tuntracked(() => {\n\t\t\t\tthis.stateChange.emit(state);\n\t\t\t\tthis.openedChange.emit(state === 'open');\n\t\t\t});\n\t\t});\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis._accordion.openItem(this.id);\n\t\t\t\t} else {\n\t\t\t\t\tthis._accordion.closeItem(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import type { FocusableOption } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, ElementRef, inject, isDevMode } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\nimport { injectBrnAccordion, injectBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: 'button[brnAccordionTrigger]',\n\thost: {\n\t\t'[id]': 'id',\n\t\ttype: 'button',\n\t\ttabindex: '0',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-expanded]': '_isExpanded()',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[attr.aria-disabled]': '_disabled()',\n\t\t'[disabled]': '_disabled()',\n\t\t'(click)': 'toggle($event)',\n\t\t'(keyup.space)': 'toggle($event)',\n\t\t'(keyup.enter)': 'toggle($event)',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _accordion = injectBrnAccordion();\n\tprivate readonly _item = injectBrnAccordionItem();\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tprotected readonly _orientation = this._accordion.orientation;\n\tprotected readonly _state = this._item.state;\n\tprotected readonly _isExpanded = computed(() => this._item.state() === 'open');\n\tprotected readonly _disabled = this._item.disabled;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\n\t\tthis._accordion.registerTrigger(this);\n\n\t\tthis._destroyRef.onDestroy(() => this._accordion.unregisterTrigger(this));\n\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._accordion.setActiveItem(this);\n\t\t\t});\n\t}\n\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tconst message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';\n\t\t\tif (isDevMode()) {\n\t\t\t\tthrow Error(message);\n\t\t\t} else {\n\t\t\t\tconsole.warn(message);\n\t\t\t}\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n","import { BrnAccordion } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\nimport { BrnAccordionHeader } from './lib/brn-accordion-header';\nimport { BrnAccordionItem } from './lib/brn-accordion-item';\nimport { BrnAccordionTrigger } from './lib/brn-accordion-trigger';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\nexport * from './lib/brn-accordion-header';\nexport * from './lib/brn-accordion-item';\nexport * from './lib/brn-accordion-token';\nexport * from './lib/brn-accordion-trigger';\n\nexport const BrnAccordionImports = [\n\tBrnAccordion,\n\tBrnAccordionContent,\n\tBrnAccordionHeader,\n\tBrnAccordionItem,\n\tBrnAccordionTrigger,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n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nB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;;;AClBpB;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion-token.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-item.ts","../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-header.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-trigger.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type, type ValueProvider } from '@angular/core';\nimport type { MeasurementDisplay } from '@spartan-ng/brain/core';\nimport type { BrnAccordion } from './brn-accordion';\nimport type { BrnAccordionItem } from './brn-accordion-item';\n\nexport const BrnAccordionToken = new InjectionToken<BrnAccordion>('BrnAccordionToken');\n\nexport function injectBrnAccordion() {\n\treturn inject(BrnAccordionToken);\n}\n\nexport function provideBrnAccordion(accordion: Type<BrnAccordion>): ExistingProvider {\n\treturn { provide: BrnAccordionToken, useExisting: accordion };\n}\n\nexport const BrnAccordionItemToken = new InjectionToken<BrnAccordionItem>('BrnAccordionItemToken');\n\nexport function injectBrnAccordionItem() {\n\treturn inject(BrnAccordionItemToken);\n}\n\nexport function provideBrnAccordionItem(item: Type<BrnAccordionItem>): ExistingProvider {\n\treturn { provide: BrnAccordionItemToken, useExisting: item };\n}\n\nexport interface BrBrnAccordionConfig {\n\t/**\n\t * The display style to use when measuring element dimensions.\n\t * @default 'block'\n\t */\n\tmeasurementDisplay: MeasurementDisplay;\n}\n\nconst defaultConfig: BrBrnAccordionConfig = {\n\tmeasurementDisplay: 'block',\n};\n\nconst BrnAccordionConfigToken = new InjectionToken<BrBrnAccordionConfig>('BrnBrnAccordionConfig');\n\nexport function provideBrnAccordionConfig(config: Partial<BrBrnAccordionConfig>): ValueProvider {\n\treturn { provide: BrnAccordionConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectBrnAccordionConfig(): BrBrnAccordionConfig {\n\treturn inject(BrnAccordionConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import type { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, computed, Directive, effect, input, output, untracked } from '@angular/core';\nimport { injectBrnAccordion, provideBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\texportAs: 'brnAccordionItem',\n\tproviders: [provideBrnAccordionItem(BrnAccordionItem)],\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = injectBrnAccordion();\n\t/**\n\t * Whether the item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the item is disabled.\n\t * @default false\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Computed state of the item, either 'open' or 'closed'\n\t * @default closed\n\t */\n\tpublic readonly state = computed(() => (this._accordion.openItemIds()?.includes(this.id) ? 'open' : 'closed'));\n\t/**\n\t * Emits boolean when the item is opened or closed.\n\t */\n\tpublic readonly stateChange = output<'open' | 'closed'>();\n\t/**\n\t * Emits state change when item is opened or closed\n\t */\n\tpublic readonly openedChange = output<boolean>();\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst state = this.state();\n\t\t\tif (untracked(this.disabled)) return;\n\t\t\tuntracked(() => {\n\t\t\t\tthis.stateChange.emit(state);\n\t\t\t\tthis.openedChange.emit(state === 'open');\n\t\t\t});\n\t\t});\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis.open();\n\t\t\t\t} else {\n\t\t\t\t\tthis.close();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tpublic open(): void {\n\t\tif (this.disabled()) return;\n\t\tthis._accordion.openItem(this.id);\n\t}\n\n\tpublic close(): void {\n\t\tif (this.disabled()) return;\n\t\tthis._accordion.closeItem(this.id);\n\t}\n}\n","import { FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\tElementRef,\n\tinject,\n\tinput,\n\ttype OnDestroy,\n\tsignal,\n} from '@angular/core';\nimport { BrnAccordionItem } from './brn-accordion-item';\nimport { provideBrnAccordion } from './brn-accordion-token';\nimport type { BrnAccordionTrigger } from './brn-accordion-trigger';\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\texportAs: 'brnAccordion',\n\tproviders: [provideBrnAccordion(BrnAccordion)],\n\thost: {\n\t\t'[attr.dir]': '_direction()',\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _brnAccordionItems = contentChildren(BrnAccordionItem);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this._triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this._direction() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical')\n\t\t\t.skipPredicate((item) => item.disabled),\n\t);\n\n\t// Not a signal: FocusMonitor can fire mid-render (a disabled child blurs during change\n\t// detection) and a signal write there throws NG0600. Only read imperatively in keydown. #1371\n\tprivate _focused = false;\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tprivate readonly _triggers = signal<BrnAccordionTrigger[]>([]);\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\t/** internal **/\n\tprotected readonly _direction = this._dir.valueSignal;\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => {\n\t\t\tthis._focused = origin !== null;\n\t\t});\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic registerTrigger(trigger: BrnAccordionTrigger) {\n\t\tthis._triggers.update((triggers) => [...triggers, trigger]);\n\t}\n\n\tpublic unregisterTrigger(trigger: BrnAccordionTrigger) {\n\t\tthis._triggers.update((triggers) => triggers.filter((t) => t !== trigger));\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tpublic openAll(): void {\n\t\tif (this.type() === 'multiple') {\n\t\t\tthis._brnAccordionItems()\n\t\t\t\t.filter((a) => !a.disabled())\n\t\t\t\t.forEach((a) => this.openItem(a.id));\n\t\t} else {\n\t\t\tconsole.warn('[BrnAccordion]: openAll is only available in multiple mode');\n\t\t}\n\t}\n\n\tpublic closeAll(): void {\n\t\tthis._brnAccordionItems()\n\t\t\t.filter((a) => !a.disabled())\n\t\t\t.forEach((a) => this.closeItem(a.id));\n\t}\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\tDirective,\n\tElementRef,\n\tNgZone,\n\tPLATFORM_ID,\n\tafterNextRender,\n\tcomputed,\n\tinject,\n\tinput,\n\tsignal,\n} from '@angular/core';\nimport { measureDimensions } from '@spartan-ng/brain/core';\nimport { injectBrnAccordionConfig, injectBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: 'brn-accordion-content,[brnAccordionContent]',\n\thost: {\n\t\t'[attr.data-state]': 'state?.()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t\t'[style.--brn-accordion-content-width.px]': '_width()',\n\t\t'[style.--brn-accordion-content-height.px]': '_height()',\n\t\t'[attr.inert]': '_inert()',\n\t\t'[attr.style]': 'style()',\n\t},\n})\nexport class BrnAccordionContent {\n\tprivate readonly _config = injectBrnAccordionConfig();\n\tprivate readonly _item = injectBrnAccordionItem();\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _ngZone = inject(NgZone);\n\tprivate readonly _platformId = inject(PLATFORM_ID);\n\n\tprotected readonly _width = signal<number | null>(null);\n\tprotected readonly _height = signal<number | null>(null);\n\tprotected readonly _inert = computed(() => (this.state?.() === 'closed' ? true : undefined));\n\n\tpublic readonly state = this._item?.state;\n\tpublic readonly id = `brn-accordion-content-${this._item?.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item?.id}`;\n\t/**\n\t * The style to be applied to the host element after the dimensions are calculated.\n\t * @default 'overflow: hidden'\n\t */\n\tpublic readonly style = input<string>('overflow: hidden');\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t\tafterNextRender(() => {\n\t\t\tconst hasValidDimensions = this._measureAndSetDimensions();\n\t\t\tif (!hasValidDimensions) {\n\t\t\t\tthis._setupVisibilityObserver();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _measureAndSetDimensions(): boolean {\n\t\tconst content = this._elementRef.nativeElement.firstChild as HTMLElement | null;\n\t\tif (!content) return false;\n\n\t\tconst { width, height } = measureDimensions(content, this._config.measurementDisplay);\n\t\tthis._width.set(width);\n\t\tthis._height.set(height);\n\n\t\treturn width > 0 && height > 0;\n\t}\n\n\tprivate _setupVisibilityObserver(): void {\n\t\tif (!isPlatformBrowser(this._platformId)) return;\n\t\tif (typeof IntersectionObserver === 'undefined') return;\n\n\t\tthis._ngZone.runOutsideAngular(() => {\n\t\t\tconst observer = new IntersectionObserver(\n\t\t\t\t(entries) => {\n\t\t\t\t\tif (entries[0].isIntersecting) {\n\t\t\t\t\t\tthis._ngZone.run(() => {\n\t\t\t\t\t\t\tif (this._measureAndSetDimensions()) {\n\t\t\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ root: null, threshold: 0 },\n\t\t\t);\n\n\t\t\tobserver.observe(this._elementRef.nativeElement);\n\t\t\tthis._destroyRef.onDestroy(() => observer.disconnect());\n\t\t});\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { injectBrnAccordion } from './brn-accordion-token';\n\n@Directive({\n\tselector: '[brnAccordionHeader]',\n\thost: {\n\t\t'[attr.data-orientation]': '_orientation()',\n\t},\n})\nexport class BrnAccordionHeader {\n\tprivate readonly _accordion = injectBrnAccordion();\n\n\tprotected readonly _orientation = this._accordion.orientation;\n}\n","import type { FocusableOption } from '@angular/cdk/a11y';\nimport { computed, DestroyRef, Directive, ElementRef, inject, isDevMode, untracked } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\nimport { injectBrnAccordion, injectBrnAccordionItem } from './brn-accordion-token';\n\n@Directive({\n\tselector: 'button[brnAccordionTrigger]',\n\thost: {\n\t\t'[id]': 'id',\n\t\ttype: 'button',\n\t\ttabindex: '0',\n\t\t'[attr.data-orientation]': '_orientation()',\n\t\t'[attr.data-state]': '_state()',\n\t\t'[attr.aria-expanded]': '_isExpanded()',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[attr.aria-disabled]': '_disabled()',\n\t\t'[disabled]': '_disabled()',\n\t\t'(click)': 'toggle($event)',\n\t\t'(keyup.space)': 'toggle($event)',\n\t\t'(keyup.enter)': 'toggle($event)',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _accordion = injectBrnAccordion();\n\tprivate readonly _item = injectBrnAccordionItem();\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tprotected readonly _orientation = this._accordion.orientation;\n\tprotected readonly _state = this._item.state;\n\tprotected readonly _isExpanded = computed(() => this._item.state() === 'open');\n\tprotected readonly _disabled = this._item.disabled;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\n\t\tthis._accordion.registerTrigger(this);\n\n\t\tthis._destroyRef.onDestroy(() => this._accordion.unregisterTrigger(this));\n\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\t// Focus can land here mid-render, and setActiveItem writes the key manager's signals.\n\t\t\t\t// untracked keeps that from throwing NG0600 (those signals aren't read by any view). #1371\n\t\t\t\tuntracked(() => this._accordion.setActiveItem(this));\n\t\t\t});\n\t}\n\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tconst message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';\n\t\t\tif (isDevMode()) {\n\t\t\t\tthrow Error(message);\n\t\t\t} else {\n\t\t\t\tconsole.warn(message);\n\t\t\t}\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n","import { BrnAccordion } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\nimport { BrnAccordionHeader } from './lib/brn-accordion-header';\nimport { BrnAccordionItem } from './lib/brn-accordion-item';\nimport { BrnAccordionTrigger } from './lib/brn-accordion-trigger';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\nexport * from './lib/brn-accordion-header';\nexport * from './lib/brn-accordion-item';\nexport * from './lib/brn-accordion-token';\nexport * from './lib/brn-accordion-trigger';\n\nexport const BrnAccordionImports = [\n\tBrnAccordion,\n\tBrnAccordionContent,\n\tBrnAccordionHeader,\n\tBrnAccordionItem,\n\tBrnAccordionTrigger,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAKa,iBAAiB,GAAG,IAAI,cAAc,CAAe,mBAAmB;SAErE,kBAAkB,GAAA;AACjC,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC;AACjC;AAEM,SAAU,mBAAmB,CAAC,SAA6B,EAAA;IAChE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC9D;MAEa,qBAAqB,GAAG,IAAI,cAAc,CAAmB,uBAAuB;SAEjF,sBAAsB,GAAA;AACrC,IAAA,OAAO,MAAM,CAAC,qBAAqB,CAAC;AACrC;AAEM,SAAU,uBAAuB,CAAC,IAA4B,EAAA;IACnE,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,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IAClC,YAAY;IACZ,mBAAmB;IACnB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;;;AClBpB;;AAEG;;;;"}
@@ -236,12 +236,12 @@ class BrnAutocompleteClear {
236
236
  _renderer = inject(Renderer2);
237
237
  _templateRef = inject(TemplateRef);
238
238
  _viewContainerRef = inject(ViewContainerRef);
239
- /** Determine if the combobox has a value */
240
- _hasValue = computed(() => this._autocomplete.value() !== null, ...(ngDevMode ? [{ debugName: "_hasValue" }] : []));
239
+ /** Determine if the autocomplete has a value or search text */
240
+ _shouldShowClear = computed(() => this._autocomplete.value() !== null || this._autocomplete.search() !== '', ...(ngDevMode ? [{ debugName: "_shouldShowClear" }] : []));
241
241
  constructor() {
242
242
  effect(() => {
243
243
  this._viewContainerRef.clear();
244
- if (this._hasValue()) {
244
+ if (this._shouldShowClear()) {
245
245
  const view = this._viewContainerRef.createEmbeddedView(this._templateRef);
246
246
  view.rootNodes.forEach((node) => {
247
247
  this._renderer.listen(node, 'click', (e) => {
@@ -359,12 +359,14 @@ class BrnAutocompleteInput {
359
359
  transform: (v) => (v === '' || v === undefined ? undefined : booleanAttribute(v)),
360
360
  alias: 'aria-invalid',
361
361
  }]));
362
+ /** Forces the invalid state visually, regardless of form control state. */
363
+ forceInvalid = input(false, ...(ngDevMode ? [{ debugName: "forceInvalid", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
362
364
  disabled = this._autocomplete.disabledState;
363
365
  /** Whether the autocomplete panel is expanded */
364
366
  _isExpanded = this._autocomplete.isExpanded;
365
367
  /** Computed aria-invalid: uses manual override if provided, otherwise reads from parent error state. */
366
368
  _ariaInvalid = computed(() => this.ariaInvalidOverride() ?? this._autocomplete.controlState?.()?.invalid, ...(ngDevMode ? [{ debugName: "_ariaInvalid" }] : []));
367
- _spartanInvalid = computed(() => this._autocomplete.controlState?.()?.spartanInvalid, ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : []));
369
+ _spartanInvalid = computed(() => this.forceInvalid() || this._autocomplete.controlState?.()?.spartanInvalid, ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : []));
368
370
  _touched = computed(() => this._autocomplete.controlState?.()?.touched, ...(ngDevMode ? [{ debugName: "_touched" }] : []));
369
371
  _dirty = computed(() => this._autocomplete.controlState?.()?.dirty, ...(ngDevMode ? [{ debugName: "_dirty" }] : []));
370
372
  constructor() {
@@ -407,7 +409,7 @@ class BrnAutocompleteInput {
407
409
  this._autocomplete.keyManager.onKeydown(event);
408
410
  }
409
411
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAutocompleteInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
410
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.17", type: BrnAutocompleteInput, isStandalone: true, selector: "input[brnAutocompleteInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidOverride: { classPropertyName: "ariaInvalidOverride", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-invalid": "_ariaInvalid() ? \"true\": null", "attr.data-invalid": "_ariaInvalid() ? \"true\": null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\": null", "attr.data-touched": "_touched() ? \"true\": null", "attr.data-dirty": "_dirty() ? \"true\": null", "attr.disabled": "disabled() ? \"\" : null" } }, exportAs: ["brnAutocompleteInput"], ngImport: i0 });
412
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.17", type: BrnAutocompleteInput, isStandalone: true, selector: "input[brnAutocompleteInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidOverride: { classPropertyName: "ariaInvalidOverride", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "text", "role": "combobox", "autocomplete": "off", "autocorrect": "off", "autocapitalize": "none", "spellcheck": "false", "aria-autocomplete": "list", "aria-haspopup": "listbox" }, listeners: { "keydown": "onKeyDown($event)", "input": "onInput($event)" }, properties: { "id": "id()", "attr.aria-expanded": "_isExpanded()", "attr.aria-invalid": "_ariaInvalid() ? \"true\": null", "attr.data-invalid": "_ariaInvalid() ? \"true\": null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\": null", "attr.data-touched": "_touched() ? \"true\": null", "attr.data-dirty": "_dirty() ? \"true\": null", "attr.disabled": "disabled() ? \"\" : null" } }, exportAs: ["brnAutocompleteInput"], ngImport: i0 });
411
413
  }
412
414
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAutocompleteInput, decorators: [{
413
415
  type: Directive,
@@ -435,7 +437,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
435
437
  '(input)': 'onInput($event)',
436
438
  },
437
439
  }]
438
- }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaInvalidOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }] } });
440
+ }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaInvalidOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }] } });
439
441
 
440
442
  class BrnAutocompleteItem {
441
443
  static _id = 0;