@spartan-ng/brain 0.0.1-alpha.664 → 0.0.1-alpha.666
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/accordion/index.d.ts
CHANGED
|
@@ -1,50 +1,57 @@
|
|
|
1
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
import { AfterContentInit, OnDestroy, InjectionToken, Type, ExistingProvider, ValueProvider } from '@angular/core';
|
|
3
|
-
import
|
|
4
|
+
import * as _angular_cdk_coercion from '@angular/cdk/coercion';
|
|
4
5
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
+
import { FocusableOption } from '@angular/cdk/a11y';
|
|
5
7
|
import { MeasurementDisplay } from '@spartan-ng/brain/core';
|
|
6
8
|
|
|
7
9
|
declare class BrnAccordionTrigger implements FocusableOption {
|
|
10
|
+
private readonly _destroyRef;
|
|
8
11
|
private readonly _accordion;
|
|
9
12
|
private readonly _item;
|
|
10
13
|
private readonly _el;
|
|
11
|
-
readonly
|
|
14
|
+
protected readonly _orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
15
|
+
protected readonly _state: _angular_core.Signal<"open" | "closed">;
|
|
16
|
+
protected readonly _isExpanded: _angular_core.Signal<boolean>;
|
|
17
|
+
protected readonly _disabled: _angular_core.InputSignalWithTransform<boolean, _angular_cdk_coercion.BooleanInput>;
|
|
12
18
|
readonly id: string;
|
|
13
19
|
readonly ariaControls: string;
|
|
20
|
+
get disabled(): boolean;
|
|
14
21
|
constructor();
|
|
15
22
|
protected toggle(event: Event): void;
|
|
16
23
|
focus(): void;
|
|
17
24
|
private validateAriaStructure;
|
|
18
25
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordionTrigger, never>;
|
|
19
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionTrigger, "[brnAccordionTrigger]", never, {}, {}, never, never, true, never>;
|
|
26
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionTrigger, "button[brnAccordionTrigger]", never, {}, {}, never, never, true, never>;
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
declare class BrnAccordion implements AfterContentInit, OnDestroy {
|
|
23
30
|
private readonly _el;
|
|
31
|
+
private readonly _dir;
|
|
24
32
|
private readonly _focusMonitor;
|
|
25
33
|
private readonly _keyManager;
|
|
26
34
|
private readonly _focused;
|
|
27
35
|
private readonly _openItemIds;
|
|
28
36
|
readonly openItemIds: _angular_core.Signal<number[]>;
|
|
29
37
|
readonly state: _angular_core.Signal<"open" | "closed">;
|
|
30
|
-
|
|
38
|
+
private readonly _triggers;
|
|
31
39
|
/**
|
|
32
40
|
* Whether the accordion is in single or multiple mode.
|
|
33
41
|
* @default 'single'
|
|
34
42
|
*/
|
|
35
43
|
readonly type: _angular_core.InputSignal<"single" | "multiple">;
|
|
36
|
-
/**
|
|
37
|
-
* The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
|
|
38
|
-
* @default null
|
|
39
|
-
*/
|
|
40
|
-
readonly dir: _angular_core.InputSignal<"ltr" | "rtl" | null>;
|
|
41
44
|
/**
|
|
42
45
|
* The orientation of the accordion, either 'horizontal' or 'vertical'.
|
|
43
46
|
* @default 'vertical'
|
|
44
47
|
*/
|
|
45
48
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
49
|
+
/** internal **/
|
|
50
|
+
protected readonly _direction: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
46
51
|
ngAfterContentInit(): void;
|
|
47
52
|
ngOnDestroy(): void;
|
|
53
|
+
registerTrigger(trigger: BrnAccordionTrigger): void;
|
|
54
|
+
unregisterTrigger(trigger: BrnAccordionTrigger): void;
|
|
48
55
|
setActiveItem(item: BrnAccordionTrigger): void;
|
|
49
56
|
toggleItem(id: number): void;
|
|
50
57
|
openItem(id: number): void;
|
|
@@ -53,7 +60,7 @@ declare class BrnAccordion implements AfterContentInit, OnDestroy {
|
|
|
53
60
|
private shouldIgnoreEvent;
|
|
54
61
|
private preventDefaultEvents;
|
|
55
62
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordion, never>;
|
|
56
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordion, "[brnAccordion]", ["brnAccordion"], { "type": { "alias": "type"; "required": false; "isSignal": true; }; "
|
|
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>;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
declare class BrnAccordionContent {
|
|
@@ -81,6 +88,13 @@ declare class BrnAccordionContent {
|
|
|
81
88
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionContent, "brn-accordion-content,[brnAccordionContent]", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
82
89
|
}
|
|
83
90
|
|
|
91
|
+
declare class BrnAccordionHeader {
|
|
92
|
+
private readonly _accordion;
|
|
93
|
+
protected readonly _orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
94
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordionHeader, never>;
|
|
95
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionHeader, "[brnAccordionHeader]", never, {}, {}, never, never, true, never>;
|
|
96
|
+
}
|
|
97
|
+
|
|
84
98
|
declare class BrnAccordionItem {
|
|
85
99
|
private static _itemIdGenerator;
|
|
86
100
|
readonly id: number;
|
|
@@ -90,6 +104,11 @@ declare class BrnAccordionItem {
|
|
|
90
104
|
* @default false
|
|
91
105
|
*/
|
|
92
106
|
readonly isOpened: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the item is disabled.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
93
112
|
/**
|
|
94
113
|
* Computed state of the item, either 'open' or 'closed'
|
|
95
114
|
* @default closed
|
|
@@ -105,7 +124,7 @@ declare class BrnAccordionItem {
|
|
|
105
124
|
readonly openedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
106
125
|
constructor();
|
|
107
126
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnAccordionItem, never>;
|
|
108
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BrnAccordionItem, "[brnAccordionItem]", ["brnAccordionItem"], { "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; }, { "stateChange": "stateChange"; "openedChange": "openedChange"; }, never, never, true, never>;
|
|
127
|
+
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>;
|
|
109
128
|
}
|
|
110
129
|
|
|
111
130
|
declare const BrnAccordionToken: InjectionToken<BrnAccordion>;
|
|
@@ -124,7 +143,7 @@ interface BrBrnAccordionConfig {
|
|
|
124
143
|
declare function provideBrnAccordionConfig(config: Partial<BrBrnAccordionConfig>): ValueProvider;
|
|
125
144
|
declare function injectBrnAccordionConfig(): BrBrnAccordionConfig;
|
|
126
145
|
|
|
127
|
-
declare const BrnAccordionImports: readonly [typeof BrnAccordion, typeof BrnAccordionContent, typeof BrnAccordionItem, typeof BrnAccordionTrigger];
|
|
146
|
+
declare const BrnAccordionImports: readonly [typeof BrnAccordion, typeof BrnAccordionContent, typeof BrnAccordionHeader, typeof BrnAccordionItem, typeof BrnAccordionTrigger];
|
|
128
147
|
|
|
129
|
-
export { BrnAccordion, BrnAccordionContent, BrnAccordionImports, BrnAccordionItem, BrnAccordionItemToken, BrnAccordionToken, BrnAccordionTrigger, injectBrnAccordion, injectBrnAccordionConfig, injectBrnAccordionItem, provideBrnAccordion, provideBrnAccordionConfig, provideBrnAccordionItem };
|
|
148
|
+
export { BrnAccordion, BrnAccordionContent, BrnAccordionHeader, BrnAccordionImports, BrnAccordionItem, BrnAccordionItemToken, BrnAccordionToken, BrnAccordionTrigger, injectBrnAccordion, injectBrnAccordionConfig, injectBrnAccordionItem, provideBrnAccordion, provideBrnAccordionConfig, provideBrnAccordionItem };
|
|
130
149
|
export type { BrBrnAccordionConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
|
|
2
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, ElementRef,
|
|
4
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { fromEvent } from 'rxjs';
|
|
4
|
+
import { InjectionToken, inject, ElementRef, computed, signal, input, Directive, DestroyRef, NgZone, PLATFORM_ID, afterNextRender, booleanAttribute, output, effect, untracked, isDevMode } from '@angular/core';
|
|
6
5
|
import { isPlatformBrowser } from '@angular/common';
|
|
7
6
|
import { measureDimensions } from '@spartan-ng/brain/core';
|
|
8
|
-
import {
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { fromEvent } from 'rxjs';
|
|
9
9
|
|
|
10
10
|
const BrnAccordionToken = new InjectionToken('BrnAccordionToken');
|
|
11
11
|
function injectBrnAccordion() {
|
|
@@ -32,80 +32,6 @@ function injectBrnAccordionConfig() {
|
|
|
32
32
|
return inject(BrnAccordionConfigToken, { optional: true }) ?? defaultConfig;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
class BrnAccordionTrigger {
|
|
36
|
-
_accordion = injectBrnAccordion();
|
|
37
|
-
_item = injectBrnAccordionItem();
|
|
38
|
-
_el = inject((ElementRef));
|
|
39
|
-
state = this._item.state;
|
|
40
|
-
id = `brn-accordion-trigger-${this._item.id}`;
|
|
41
|
-
ariaControls = `brn-accordion-content-${this._item.id}`;
|
|
42
|
-
constructor() {
|
|
43
|
-
if (!this._accordion)
|
|
44
|
-
throw Error('Accordion trigger requires a parent Accordion.');
|
|
45
|
-
if (!this._item)
|
|
46
|
-
throw Error('Accordion trigger requires a parent AccordionItem.');
|
|
47
|
-
this.validateAriaStructure();
|
|
48
|
-
fromEvent(this._el.nativeElement, 'focus')
|
|
49
|
-
.pipe(takeUntilDestroyed())
|
|
50
|
-
.subscribe(() => {
|
|
51
|
-
this._accordion.setActiveItem(this);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
toggle(event) {
|
|
55
|
-
event.preventDefault();
|
|
56
|
-
this._accordion.toggleItem(this._item.id);
|
|
57
|
-
}
|
|
58
|
-
focus() {
|
|
59
|
-
this._el.nativeElement.focus();
|
|
60
|
-
}
|
|
61
|
-
validateAriaStructure() {
|
|
62
|
-
const element = this._el.nativeElement;
|
|
63
|
-
const isButton = element.tagName === 'BUTTON';
|
|
64
|
-
const hasButtonRole = element.getAttribute('role') === 'button';
|
|
65
|
-
if (!isButton && !hasButtonRole) {
|
|
66
|
-
throw Error(`BrnAccordionTrigger: The trigger element must be a <button> or have role="button". ` +
|
|
67
|
-
`Found: <${element.tagName.toLowerCase()}>`);
|
|
68
|
-
}
|
|
69
|
-
const parent = element.parentElement;
|
|
70
|
-
if (!parent) {
|
|
71
|
-
const message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';
|
|
72
|
-
if (isDevMode()) {
|
|
73
|
-
throw Error(message);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
console.warn(message);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const isNativeHeading = /^H[1-6]$/.test(parent.tagName);
|
|
80
|
-
const hasHeadingRole = parent.getAttribute('role') === 'heading';
|
|
81
|
-
if (!isNativeHeading && !hasHeadingRole) {
|
|
82
|
-
throw Error(`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +
|
|
83
|
-
`(h1-h6) or an element with role="heading". Found parent: <${parent.tagName.toLowerCase()}>`);
|
|
84
|
-
}
|
|
85
|
-
if (hasHeadingRole && !parent.hasAttribute('aria-level')) {
|
|
86
|
-
throw Error('BrnAccordionTrigger: Elements with role="heading" must have an aria-level attribute.');
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
90
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.17", type: BrnAccordionTrigger, isStandalone: true, selector: "[brnAccordionTrigger]", host: { listeners: { "click": "toggle($event)", "keyup.space": "toggle($event)", "keyup.enter": "toggle($event)" }, properties: { "attr.data-state": "state()", "attr.aria-expanded": "state() === \"open\"", "attr.aria-controls": "ariaControls", "id": "id", "attr.role": "\"button\"" } }, ngImport: i0 });
|
|
91
|
-
}
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionTrigger, decorators: [{
|
|
93
|
-
type: Directive,
|
|
94
|
-
args: [{
|
|
95
|
-
selector: '[brnAccordionTrigger]',
|
|
96
|
-
host: {
|
|
97
|
-
'[attr.data-state]': 'state()',
|
|
98
|
-
'[attr.aria-expanded]': 'state() === "open"',
|
|
99
|
-
'[attr.aria-controls]': 'ariaControls',
|
|
100
|
-
'[id]': 'id',
|
|
101
|
-
'[attr.role]': '"button"',
|
|
102
|
-
'(click)': 'toggle($event)',
|
|
103
|
-
'(keyup.space)': 'toggle($event)',
|
|
104
|
-
'(keyup.enter)': 'toggle($event)',
|
|
105
|
-
},
|
|
106
|
-
}]
|
|
107
|
-
}], ctorParameters: () => [] });
|
|
108
|
-
|
|
109
35
|
const HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [
|
|
110
36
|
'ArrowLeft',
|
|
111
37
|
'ArrowRight',
|
|
@@ -128,33 +54,32 @@ const VERTICAL_KEYS_TO_PREVENT_DEFAULT = [
|
|
|
128
54
|
];
|
|
129
55
|
class BrnAccordion {
|
|
130
56
|
_el = inject((ElementRef));
|
|
57
|
+
_dir = inject(Directionality);
|
|
131
58
|
_focusMonitor = inject(FocusMonitor);
|
|
132
|
-
_keyManager = computed(() => new FocusKeyManager(this.
|
|
59
|
+
_keyManager = computed(() => new FocusKeyManager(this._triggers())
|
|
133
60
|
.withHomeAndEnd()
|
|
134
61
|
.withPageUpDown()
|
|
135
62
|
.withWrap()
|
|
136
|
-
.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this.
|
|
137
|
-
.withVerticalOrientation(this.orientation() === 'vertical')
|
|
63
|
+
.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this._direction() ?? 'ltr'))
|
|
64
|
+
.withVerticalOrientation(this.orientation() === 'vertical')
|
|
65
|
+
.skipPredicate((item) => item.disabled), ...(ngDevMode ? [{ debugName: "_keyManager" }] : []));
|
|
138
66
|
_focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : []));
|
|
139
67
|
_openItemIds = signal([], ...(ngDevMode ? [{ debugName: "_openItemIds" }] : []));
|
|
140
68
|
openItemIds = this._openItemIds.asReadonly();
|
|
141
69
|
state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'), ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
142
|
-
|
|
70
|
+
_triggers = signal([], ...(ngDevMode ? [{ debugName: "_triggers" }] : []));
|
|
143
71
|
/**
|
|
144
72
|
* Whether the accordion is in single or multiple mode.
|
|
145
73
|
* @default 'single'
|
|
146
74
|
*/
|
|
147
75
|
type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
148
|
-
/**
|
|
149
|
-
* The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
|
|
150
|
-
* @default null
|
|
151
|
-
*/
|
|
152
|
-
dir = input(null, ...(ngDevMode ? [{ debugName: "dir" }] : []));
|
|
153
76
|
/**
|
|
154
77
|
* The orientation of the accordion, either 'horizontal' or 'vertical'.
|
|
155
78
|
* @default 'vertical'
|
|
156
79
|
*/
|
|
157
80
|
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
81
|
+
/** internal **/
|
|
82
|
+
_direction = this._dir.valueSignal;
|
|
158
83
|
ngAfterContentInit() {
|
|
159
84
|
this._el.nativeElement.addEventListener('keydown', (event) => {
|
|
160
85
|
if (this.shouldIgnoreEvent(event))
|
|
@@ -167,6 +92,12 @@ class BrnAccordion {
|
|
|
167
92
|
ngOnDestroy() {
|
|
168
93
|
this._focusMonitor.stopMonitoring(this._el);
|
|
169
94
|
}
|
|
95
|
+
registerTrigger(trigger) {
|
|
96
|
+
this._triggers.update((triggers) => [...triggers, trigger]);
|
|
97
|
+
}
|
|
98
|
+
unregisterTrigger(trigger) {
|
|
99
|
+
this._triggers.update((triggers) => triggers.filter((t) => t !== trigger));
|
|
100
|
+
}
|
|
170
101
|
setActiveItem(item) {
|
|
171
102
|
this._keyManager()?.setActiveItem(item);
|
|
172
103
|
}
|
|
@@ -224,7 +155,7 @@ class BrnAccordion {
|
|
|
224
155
|
}
|
|
225
156
|
}
|
|
226
157
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
227
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.
|
|
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 });
|
|
228
159
|
}
|
|
229
160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordion, decorators: [{
|
|
230
161
|
type: Directive,
|
|
@@ -233,11 +164,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
233
164
|
exportAs: 'brnAccordion',
|
|
234
165
|
providers: [provideBrnAccordion(BrnAccordion)],
|
|
235
166
|
host: {
|
|
167
|
+
'[attr.dir]': '_direction()',
|
|
236
168
|
'[attr.data-state]': 'state()',
|
|
237
169
|
'[attr.data-orientation]': 'orientation()',
|
|
238
170
|
},
|
|
239
171
|
}]
|
|
240
|
-
}], propDecorators: {
|
|
172
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }] } });
|
|
241
173
|
|
|
242
174
|
class BrnAccordionContent {
|
|
243
175
|
_config = injectBrnAccordionConfig();
|
|
@@ -316,6 +248,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
316
248
|
}]
|
|
317
249
|
}], ctorParameters: () => [], propDecorators: { style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }] } });
|
|
318
250
|
|
|
251
|
+
class BrnAccordionHeader {
|
|
252
|
+
_accordion = injectBrnAccordion();
|
|
253
|
+
_orientation = this._accordion.orientation;
|
|
254
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
255
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.17", type: BrnAccordionHeader, isStandalone: true, selector: "[brnAccordionHeader]", host: { properties: { "attr.data-orientation": "_orientation()" } }, ngImport: i0 });
|
|
256
|
+
}
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionHeader, decorators: [{
|
|
258
|
+
type: Directive,
|
|
259
|
+
args: [{
|
|
260
|
+
selector: '[brnAccordionHeader]',
|
|
261
|
+
host: {
|
|
262
|
+
'[attr.data-orientation]': '_orientation()',
|
|
263
|
+
},
|
|
264
|
+
}]
|
|
265
|
+
}] });
|
|
266
|
+
|
|
319
267
|
class BrnAccordionItem {
|
|
320
268
|
static _itemIdGenerator = 0;
|
|
321
269
|
id = ++BrnAccordionItem._itemIdGenerator;
|
|
@@ -324,7 +272,12 @@ class BrnAccordionItem {
|
|
|
324
272
|
* Whether the item is opened or closed.
|
|
325
273
|
* @default false
|
|
326
274
|
*/
|
|
327
|
-
isOpened = input(false, ...(ngDevMode ? [{ debugName: "isOpened", transform:
|
|
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 }]));
|
|
328
281
|
/**
|
|
329
282
|
* Computed state of the item, either 'open' or 'closed'
|
|
330
283
|
* @default closed
|
|
@@ -362,7 +315,7 @@ class BrnAccordionItem {
|
|
|
362
315
|
});
|
|
363
316
|
}
|
|
364
317
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
365
|
-
/** @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 } }, outputs: { stateChange: "stateChange", openedChange: "openedChange" }, host: { properties: { "attr.data-state": "state()" } }, providers: [provideBrnAccordionItem(BrnAccordionItem)], exportAs: ["brnAccordionItem"], ngImport: i0 });
|
|
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 });
|
|
366
319
|
}
|
|
367
320
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionItem, decorators: [{
|
|
368
321
|
type: Directive,
|
|
@@ -374,13 +327,106 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
374
327
|
'[attr.data-state]': 'state()',
|
|
375
328
|
},
|
|
376
329
|
}]
|
|
377
|
-
}], ctorParameters: () => [], propDecorators: { isOpened: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpened", required: false }] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], openedChange: [{ type: i0.Output, args: ["openedChange"] }] } });
|
|
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"] }] } });
|
|
378
331
|
|
|
379
|
-
|
|
332
|
+
class BrnAccordionTrigger {
|
|
333
|
+
_destroyRef = inject(DestroyRef);
|
|
334
|
+
_accordion = injectBrnAccordion();
|
|
335
|
+
_item = injectBrnAccordionItem();
|
|
336
|
+
_el = inject((ElementRef));
|
|
337
|
+
_orientation = this._accordion.orientation;
|
|
338
|
+
_state = this._item.state;
|
|
339
|
+
_isExpanded = computed(() => this._item.state() === 'open', ...(ngDevMode ? [{ debugName: "_isExpanded" }] : []));
|
|
340
|
+
_disabled = this._item.disabled;
|
|
341
|
+
id = `brn-accordion-trigger-${this._item.id}`;
|
|
342
|
+
ariaControls = `brn-accordion-content-${this._item.id}`;
|
|
343
|
+
get disabled() {
|
|
344
|
+
return this._disabled();
|
|
345
|
+
}
|
|
346
|
+
constructor() {
|
|
347
|
+
if (!this._accordion)
|
|
348
|
+
throw Error('Accordion trigger requires a parent Accordion.');
|
|
349
|
+
if (!this._item)
|
|
350
|
+
throw Error('Accordion trigger requires a parent AccordionItem.');
|
|
351
|
+
this._accordion.registerTrigger(this);
|
|
352
|
+
this._destroyRef.onDestroy(() => this._accordion.unregisterTrigger(this));
|
|
353
|
+
this.validateAriaStructure();
|
|
354
|
+
fromEvent(this._el.nativeElement, 'focus')
|
|
355
|
+
.pipe(takeUntilDestroyed())
|
|
356
|
+
.subscribe(() => {
|
|
357
|
+
this._accordion.setActiveItem(this);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
toggle(event) {
|
|
361
|
+
event.preventDefault();
|
|
362
|
+
this._accordion.toggleItem(this._item.id);
|
|
363
|
+
}
|
|
364
|
+
focus() {
|
|
365
|
+
this._el.nativeElement.focus();
|
|
366
|
+
}
|
|
367
|
+
validateAriaStructure() {
|
|
368
|
+
const element = this._el.nativeElement;
|
|
369
|
+
const isButton = element.tagName === 'BUTTON';
|
|
370
|
+
const hasButtonRole = element.getAttribute('role') === 'button';
|
|
371
|
+
if (!isButton && !hasButtonRole) {
|
|
372
|
+
throw Error(`BrnAccordionTrigger: The trigger element must be a <button> or have role="button". ` +
|
|
373
|
+
`Found: <${element.tagName.toLowerCase()}>`);
|
|
374
|
+
}
|
|
375
|
+
const parent = element.parentElement;
|
|
376
|
+
if (!parent) {
|
|
377
|
+
const message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';
|
|
378
|
+
if (isDevMode()) {
|
|
379
|
+
throw Error(message);
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
console.warn(message);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const isNativeHeading = /^H[1-6]$/.test(parent.tagName);
|
|
386
|
+
const hasHeadingRole = parent.getAttribute('role') === 'heading';
|
|
387
|
+
if (!isNativeHeading && !hasHeadingRole) {
|
|
388
|
+
throw Error(`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +
|
|
389
|
+
`(h1-h6) or an element with role="heading". Found parent: <${parent.tagName.toLowerCase()}>`);
|
|
390
|
+
}
|
|
391
|
+
if (hasHeadingRole && !parent.hasAttribute('aria-level')) {
|
|
392
|
+
throw Error('BrnAccordionTrigger: Elements with role="heading" must have an aria-level attribute.');
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
396
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.17", type: BrnAccordionTrigger, isStandalone: true, selector: "button[brnAccordionTrigger]", host: { attributes: { "type": "button", "tabindex": "0" }, listeners: { "click": "toggle($event)", "keyup.space": "toggle($event)", "keyup.enter": "toggle($event)" }, properties: { "id": "id", "attr.data-orientation": "_orientation()", "attr.data-state": "_state()", "attr.aria-expanded": "_isExpanded()", "attr.aria-controls": "ariaControls", "attr.aria-disabled": "_disabled()", "disabled": "_disabled()" } }, ngImport: i0 });
|
|
397
|
+
}
|
|
398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: BrnAccordionTrigger, decorators: [{
|
|
399
|
+
type: Directive,
|
|
400
|
+
args: [{
|
|
401
|
+
selector: 'button[brnAccordionTrigger]',
|
|
402
|
+
host: {
|
|
403
|
+
'[id]': 'id',
|
|
404
|
+
type: 'button',
|
|
405
|
+
tabindex: '0',
|
|
406
|
+
'[attr.data-orientation]': '_orientation()',
|
|
407
|
+
'[attr.data-state]': '_state()',
|
|
408
|
+
'[attr.aria-expanded]': '_isExpanded()',
|
|
409
|
+
'[attr.aria-controls]': 'ariaControls',
|
|
410
|
+
'[attr.aria-disabled]': '_disabled()',
|
|
411
|
+
'[disabled]': '_disabled()',
|
|
412
|
+
'(click)': 'toggle($event)',
|
|
413
|
+
'(keyup.space)': 'toggle($event)',
|
|
414
|
+
'(keyup.enter)': 'toggle($event)',
|
|
415
|
+
},
|
|
416
|
+
}]
|
|
417
|
+
}], ctorParameters: () => [] });
|
|
418
|
+
|
|
419
|
+
const BrnAccordionImports = [
|
|
420
|
+
BrnAccordion,
|
|
421
|
+
BrnAccordionContent,
|
|
422
|
+
BrnAccordionHeader,
|
|
423
|
+
BrnAccordionItem,
|
|
424
|
+
BrnAccordionTrigger,
|
|
425
|
+
];
|
|
380
426
|
|
|
381
427
|
/**
|
|
382
428
|
* Generated bundle index. Do not edit.
|
|
383
429
|
*/
|
|
384
430
|
|
|
385
|
-
export { BrnAccordion, BrnAccordionContent, BrnAccordionImports, BrnAccordionItem, BrnAccordionItemToken, BrnAccordionToken, BrnAccordionTrigger, injectBrnAccordion, injectBrnAccordionConfig, injectBrnAccordionItem, provideBrnAccordion, provideBrnAccordionConfig, provideBrnAccordionItem };
|
|
431
|
+
export { BrnAccordion, BrnAccordionContent, BrnAccordionHeader, BrnAccordionImports, BrnAccordionItem, BrnAccordionItemToken, BrnAccordionToken, BrnAccordionTrigger, injectBrnAccordion, injectBrnAccordionConfig, injectBrnAccordionItem, provideBrnAccordion, provideBrnAccordionConfig, provideBrnAccordionItem };
|
|
386
432
|
//# sourceMappingURL=spartan-ng-brain-accordion.mjs.map
|
|
@@ -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-trigger.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-item.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 { FocusableOption } from '@angular/cdk/a11y';\nimport { 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: '[brnAccordionTrigger]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-expanded]': 'state() === \"open\"',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[id]': 'id',\n\t\t'[attr.role]': '\"button\"',\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 _accordion = injectBrnAccordion();\n\tprivate readonly _item = injectBrnAccordionItem();\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\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\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 { FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\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 { provideBrnAccordion } from './brn-accordion-token';\nimport { 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.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 _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.dir() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical'),\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\tpublic readonly triggers = contentChildren(BrnAccordionTrigger, { descendants: true });\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\t/**\n\t * The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n\t * @default null\n\t */\n\tpublic readonly dir = input<'ltr' | 'rtl' | null>(null);\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\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 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 { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { 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: coerceBooleanProperty });\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 { BrnAccordion } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\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-item';\nexport * from './lib/brn-accordion-token';\nexport * from './lib/brn-accordion-trigger';\n\nexport const BrnAccordionImports = [BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger] 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,WAAW,EAAE,IAAI,EAAE;AAC7D;AAUA,MAAM,aAAa,GAAyB;AAC3C,IAAA,kBAAkB,EAAE,OAAO;CAC3B;AAED,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAuB,uBAAuB,CAAC;AAE3F,SAAU,yBAAyB,CAAC,MAAqC,EAAA;AAC9E,I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AACD,iBAAA;;;ACAM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB;;ACX5G;;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.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\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,WAAW,EAAE,IAAI,EAAE;AAC7D;AAUA,MAAM,aAAa,GAAyB;AAC3C,IAAA,kBAAkB,EAAE,OAAO;CAC3B;AAED,MAAM,uBAAuB,GAAG,IAAI,cAAc,CAAuB,uBAAuB,CAAC;AAE3F,SAAU,yBAAyB,CAAC,MAAqC,EAAA;AAC9E,IAAA,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE;AACvF;SAEgB,wBAAwB,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,aAAa;AAC5E;;AC9BA,MAAM,kCAAkC,GAAG;IAC1C,WAAW;IACX,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,MAAM;IACN,KAAK;IACL,GAAG;IACH,OAAO;CACE;AAEV,MAAM,gCAAgC,GAAG;IACxC,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,MAAM;IACN,KAAK;IACL,GAAG;IACH,O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