@koobiq/components 20.1.0 → 20.2.0
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/_accordion-theme.scss +1 -1
- package/accordion/accordion-tokens.scss +1 -0
- package/accordion/{accordion-trigger.component.scss → accordion-trigger.scss} +4 -0
- package/accordion/{accordion.component.scss → accordion.scss} +3 -3
- package/accordion/index.d.ts +215 -119
- package/alert/_alert-theme.scss +14 -0
- package/alert/alert.component.scss +24 -13
- package/alert/index.d.ts +63 -29
- package/autocomplete/autocomplete.scss +2 -1
- package/autocomplete/index.d.ts +35 -29
- package/badge/index.d.ts +2 -3
- package/clamped-text/index.d.ts +3 -2
- package/core/index.d.ts +116 -11
- package/core/styles/_core.scss +2 -0
- package/core/styles/common/_animation.scss +31 -24
- package/core/styles/common/_connected-overlay.scss +36 -0
- package/core/styles/common/_select.scss +7 -2
- package/dropdown/dropdown-item.scss +16 -0
- package/dropdown/dropdown-tokens.scss +2 -1
- package/dropdown/dropdown.scss +9 -0
- package/dropdown/index.d.ts +73 -6
- package/fesm2022/koobiq-components-accordion.mjs +406 -303
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs +1 -1
- package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +88 -48
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs +1 -1
- package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +37 -23
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-badge.mjs +5 -4
- package/fesm2022/koobiq-components-badge.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-clamped-text.mjs +5 -0
- package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +1 -1
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +98 -4
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-datepicker.mjs +10 -7
- package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +99 -20
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +2 -2
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +203 -32
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-form-field.mjs +4 -4
- package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
- package/fesm2022/koobiq-components-icon.mjs +14 -5
- package/fesm2022/koobiq-components-icon.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +4 -2
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-navbar.mjs +117 -22
- package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
- package/fesm2022/koobiq-components-notification-center.mjs +19 -4
- package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-popover.mjs +5 -0
- package/fesm2022/koobiq-components-popover.mjs.map +1 -1
- package/fesm2022/koobiq-components-search-expandable.mjs +43 -8
- package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +36 -45
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-split-button.mjs +3 -10
- package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +29 -17
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-tags.mjs +1 -1
- package/fesm2022/koobiq-components-tags.mjs.map +1 -1
- package/fesm2022/koobiq-components-timepicker.mjs +3 -4
- package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +3 -5
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-toast.mjs +1 -1
- package/fesm2022/koobiq-components-toast.mjs.map +1 -1
- package/fesm2022/koobiq-components-tooltip.mjs +118 -6
- package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +39 -31
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/filter-bar/_filter-bar-theme.scss +0 -4
- package/filter-bar/filter-bar-tokens.scss +3 -0
- package/filter-bar/filters.scss +3 -2
- package/filter-bar/index.d.ts +62 -3
- package/filter-bar/pipes/base-pipe.scss +0 -11
- package/filter-bar/pipes/pipe-input.scss +10 -0
- package/icon/icon-button.scss +3 -1
- package/icon/index.d.ts +15 -2
- package/navbar/_navbar-item_vertical.scss +7 -5
- package/navbar/index.d.ts +38 -4
- package/navbar/navbar-brand.scss +17 -7
- package/notification-center/index.d.ts +2 -1
- package/package.json +3 -3
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/schematics/collection.json +10 -0
- package/schematics/migrations/alert-signals/README.md +64 -0
- package/schematics/migrations/alert-signals/data.js +70 -0
- package/schematics/migrations/alert-signals/index.js +350 -0
- package/schematics/migrations/alert-signals/schema.json +20 -0
- package/schematics/migrations/autocomplete-panel-width-auto/README.md +68 -0
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +70 -0
- package/schematics/migrations/autocomplete-panel-width-auto/schema.json +15 -0
- package/schematics/migrations/filter-bar-signals/README.md +1 -1
- package/schematics/migrations.json +11 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/utils/angular-parsing.js +11 -2
- package/search-expandable/index.d.ts +3 -0
- package/select/index.d.ts +51 -24
- package/tabs/_tabs-common.scss +60 -31
- package/tabs/_tabs-theme.scss +12 -0
- package/tabs/index.d.ts +2 -2
- package/tabs/tab-header.scss +14 -0
- package/tabs/tab-nav-bar.scss +4 -0
- package/tabs/tabs-tokens.scss +1 -0
- package/timezone/index.d.ts +1 -3
- package/tooltip/index.d.ts +73 -4
- package/tree-select/index.d.ts +46 -22
|
@@ -1,200 +1,91 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, ChangeDetectorRef, contentChildren, forwardRef, HostAttributeToken, input, booleanAttribute, output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, viewChild, afterNextRender, contentChild, EventEmitter, Renderer2, signal, NgModule } from '@angular/core';
|
|
3
|
-
import { Platform } from '@angular/cdk/platform';
|
|
4
|
-
import { KBQ_WINDOW, kbqInjectNativeElement } from '@koobiq/components/core';
|
|
5
|
-
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
6
|
-
import { Subject, merge, Subscription } from 'rxjs';
|
|
7
|
-
import { KbqIcon } from '@koobiq/components/icon';
|
|
8
1
|
import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
|
|
9
2
|
import { Directionality } from '@angular/cdk/bidi';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
4
|
+
import { ENTER, SPACE } from '@angular/cdk/keycodes';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { inject, Renderer2, signal, afterNextRender, RendererStyleFlags2, Directive, viewChild, ViewEncapsulation, Component, ChangeDetectorRef, contentChild, forwardRef, input, computed, output, booleanAttribute, Input, Injectable, InjectionToken, ElementRef, Injector, contentChildren, numberAttribute, effect, untracked, isDevMode, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
7
|
+
import { Subscription, Subject } from 'rxjs';
|
|
8
|
+
import { kbqInjectNativeElement, KBQ_WINDOW } from '@koobiq/components/core';
|
|
9
|
+
import { KbqIcon } from '@koobiq/components/icon';
|
|
10
|
+
import { Platform } from '@angular/cdk/platform';
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
KbqAccordionVariant["hugSpaceBetween"] = "hugSpaceBetween";
|
|
18
|
-
})(KbqAccordionVariant || (KbqAccordionVariant = {}));
|
|
19
|
-
let uniqueIdCounter$1 = 0;
|
|
20
|
-
class KbqAccordion {
|
|
21
|
-
/**
|
|
22
|
-
* The value of the item to expand when initially rendered and type is "single". Use when you do not need to control the state of the items.
|
|
23
|
-
*/
|
|
24
|
-
// TODO: Skipped for migration because:
|
|
25
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
26
|
-
get defaultValue() {
|
|
27
|
-
return this.isMultiple ? this._defaultValue : this._defaultValue[0];
|
|
28
|
-
}
|
|
29
|
-
set defaultValue(value) {
|
|
30
|
-
if (value !== this._defaultValue) {
|
|
31
|
-
this._defaultValue = Array.isArray(value) ? value : [value];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/** The controlled value of the item to expand */
|
|
35
|
-
// TODO: Skipped for migration because:
|
|
36
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
37
|
-
get value() {
|
|
38
|
-
if (this._value === undefined) {
|
|
39
|
-
return this.defaultValue;
|
|
40
|
-
}
|
|
41
|
-
return this.isMultiple ? this._value : this._value[0];
|
|
42
|
-
}
|
|
43
|
-
set value(value) {
|
|
44
|
-
if (value !== this._value) {
|
|
45
|
-
this._value = Array.isArray(value) ? value : [value];
|
|
46
|
-
this.selectionDispatcher.notify(this.value, this.id);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
get id() {
|
|
50
|
-
return this._id;
|
|
51
|
-
}
|
|
52
|
-
get isMultiple() {
|
|
53
|
-
return this.type() === 'multiple';
|
|
12
|
+
class KbqAccordionContentDirective {
|
|
13
|
+
/** @docs-private */
|
|
14
|
+
get contentId() {
|
|
15
|
+
return `${this.item.id}-content`;
|
|
54
16
|
}
|
|
55
|
-
|
|
56
|
-
|
|
17
|
+
/** @docs-private */
|
|
18
|
+
get triggerId() {
|
|
19
|
+
return `${this.item.id}-trigger`;
|
|
57
20
|
}
|
|
58
21
|
constructor() {
|
|
59
|
-
this.
|
|
60
|
-
this.localStorage = inject(KBQ_WINDOW)?.localStorage;
|
|
61
|
-
/** @docs-private */
|
|
62
|
-
this.focusMonitor = inject(FocusMonitor);
|
|
63
|
-
/** @docs-private */
|
|
64
|
-
this.elementRef = inject(ElementRef);
|
|
65
|
-
/** @docs-private */
|
|
66
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
22
|
+
this.renderer = inject(Renderer2);
|
|
67
23
|
/** @docs-private */
|
|
68
|
-
this.
|
|
24
|
+
this.nativeElement = kbqInjectNativeElement();
|
|
69
25
|
/** @docs-private */
|
|
70
|
-
this.
|
|
26
|
+
this.item = inject(KbqAccordionItem);
|
|
71
27
|
/** @docs-private */
|
|
72
|
-
this.
|
|
73
|
-
/**
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
/** Determines whether one or multiple items can be opened at the same time. */
|
|
83
|
-
this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
84
|
-
this.collapsible = input(true, ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
85
|
-
this.onValueChange = output();
|
|
86
|
-
this._defaultValue = [];
|
|
87
|
-
this._id = `kbq-accordion-${uniqueIdCounter$1++}`;
|
|
88
|
-
if (this.useStateSaving) {
|
|
89
|
-
this.getSavedState();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
ngAfterContentInit() {
|
|
93
|
-
if (this._value) {
|
|
94
|
-
this.selectionDispatcher.notify(this._value, this.id);
|
|
95
|
-
}
|
|
96
|
-
else if (this.useStateSaving && this.hasSavedState) {
|
|
97
|
-
Object.keys(this.state).forEach((key) => {
|
|
98
|
-
if (this.state && this.state[key].expanded) {
|
|
99
|
-
this.selectionDispatcher.notify(this.state[key].value, this.id);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.selectionDispatcher.notify(this._defaultValue, this.id);
|
|
105
|
-
}
|
|
106
|
-
this.keyManager = new FocusKeyManager(this.items()).withHomeAndEnd();
|
|
107
|
-
if (this.orientation() === 'horizontal') {
|
|
108
|
-
this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
this.keyManager.withVerticalOrientation();
|
|
112
|
-
}
|
|
113
|
-
this.onValueChangeSubscription = merge(...this.items().map((item) => outputToObservable(item.expandedChange))).subscribe(() => this.onValueChange.emit());
|
|
28
|
+
this.hidden = signal(true, ...(ngDevMode ? [{ debugName: "hidden" }] : []));
|
|
29
|
+
/** Whether the first browser render has happened, i.e. whether the content can be measured. */
|
|
30
|
+
this.rendered = false;
|
|
31
|
+
// `afterNextRender` never runs on the server, so no platform check is needed here.
|
|
32
|
+
this.afterRenderRef = afterNextRender(() => {
|
|
33
|
+
this.rendered = true;
|
|
34
|
+
this.updateHeight();
|
|
35
|
+
this.enableAnimation();
|
|
36
|
+
this.afterRenderRef?.destroy();
|
|
37
|
+
});
|
|
114
38
|
}
|
|
115
39
|
ngAfterViewInit() {
|
|
116
|
-
this.
|
|
117
|
-
}
|
|
118
|
-
ngOnDestroy() {
|
|
119
|
-
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
120
|
-
this.openCloseAllActions.complete();
|
|
121
|
-
this.onValueChangeSubscription.unsubscribe();
|
|
122
|
-
}
|
|
123
|
-
/** @docs-private */
|
|
124
|
-
keydownHandler(event) {
|
|
125
|
-
if (!this.keyManager.activeItem) {
|
|
126
|
-
this.keyManager.setFirstItemActive();
|
|
127
|
-
}
|
|
128
|
-
const activeItem = this.keyManager.activeItem;
|
|
129
|
-
if ((event.keyCode === ENTER || event.keyCode === SPACE) &&
|
|
130
|
-
!this.keyManager.isTyping() &&
|
|
131
|
-
activeItem &&
|
|
132
|
-
!activeItem.disabled) {
|
|
133
|
-
event.preventDefault();
|
|
134
|
-
activeItem.toggle();
|
|
135
|
-
}
|
|
136
|
-
else if (event.keyCode === TAB && event.shiftKey) {
|
|
137
|
-
if (this.keyManager.activeItemIndex === 0)
|
|
138
|
-
return;
|
|
139
|
-
this.keyManager.setPreviousItemActive();
|
|
140
|
-
event.preventDefault();
|
|
141
|
-
}
|
|
142
|
-
else if (event.keyCode === TAB) {
|
|
143
|
-
if (this.keyManager.activeItemIndex === this.items().length - 1)
|
|
144
|
-
return;
|
|
145
|
-
this.keyManager.setNextItemActive();
|
|
146
|
-
event.preventDefault();
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.keyManager.onKeydown(event);
|
|
150
|
-
}
|
|
40
|
+
this.disableAnimation();
|
|
151
41
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
42
|
+
toggle() {
|
|
43
|
+
// Re-measure while the content is still collapsed. Its natural height depends on the width
|
|
44
|
+
// it is finally laid out at, and that width is not known at first render when the accordion
|
|
45
|
+
// lives in a container sized afterwards (sidepanel, overlay, responsive layout).
|
|
46
|
+
if (this.rendered && this.item.expanded && this.hidden()) {
|
|
47
|
+
this.updateHeight();
|
|
156
48
|
}
|
|
49
|
+
this.hidden.set(!this.item.expanded);
|
|
157
50
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
this.
|
|
161
|
-
}
|
|
162
|
-
/** @docs-private */
|
|
163
|
-
setActiveItem(item) {
|
|
164
|
-
this.keyManager.setActiveItem(item);
|
|
51
|
+
disableAnimation() {
|
|
52
|
+
this.savedTransition = this.nativeElement.style.transition;
|
|
53
|
+
this.nativeElement.style.transition = 'none';
|
|
165
54
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (!this.isBrowser || (!force && !!this.state && !!this.state[item.id]))
|
|
169
|
-
return;
|
|
170
|
-
this.state = this.state || {};
|
|
171
|
-
this.state[item.id] = item.getState();
|
|
172
|
-
this.localStorage.setItem(this.id, JSON.stringify(this.state));
|
|
55
|
+
enableAnimation() {
|
|
56
|
+
this.nativeElement.style.transition = this.savedTransition;
|
|
173
57
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Publishes the natural height of the projected content as `--kbq-accordion-content-height`,
|
|
60
|
+
* which the open state animates towards.
|
|
61
|
+
*
|
|
62
|
+
* `scrollHeight` is used rather than `getBoundingClientRect()`: the host is `overflow: hidden`
|
|
63
|
+
* and collapsed to `height: 0` while closed, so its box reports `0`, whereas `scrollHeight`
|
|
64
|
+
* still reports the height of the content it clips.
|
|
65
|
+
*/
|
|
66
|
+
updateHeight() {
|
|
67
|
+
this.renderer.setStyle(this.nativeElement, '--kbq-accordion-content-height', `${this.nativeElement.scrollHeight}px`, RendererStyleFlags2.DashCase);
|
|
178
68
|
}
|
|
179
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type:
|
|
180
|
-
/** @nocollapse */ static { this.ɵ
|
|
181
|
-
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
|
182
|
-
], queries: [{ propertyName: "items", predicate: i0.forwardRef(() => KbqAccordionItem), descendants: true, isSignal: true }], ngImport: i0, template: '<ng-content />', isInline: true, styles: [".kbq-accordion{display:block}.kbq-accordion-item{box-sizing:border-box;display:block;border-width:2px;border-style:solid;border-color:transparent}.kbq-accordion-header{display:flex;height:var(--kbq-accordion-size-item-header-height)}.kbq-accordion-content{display:block;overflow:hidden}.kbq-accordion-content>p{margin:unset;padding:var(--kbq-accordion-size-item-content-padding)}.kbq-accordion-content[data-state=open]{transition:height .3s ease-out;height:var(--radix-accordion-content-height)}.kbq-accordion-content[data-state=closed]{transition:height .3s ease-out;height:0}@media(prefers-reduced-motion:reduce){.kbq-accordion-content[data-state=open],.kbq-accordion-content[data-state=closed]{transition:none}}.kbq-accordion.cdk-keyboard-focused .kbq-accordion-item:focus-within{border-color:var(--kbq-accordion-item-states-focus-border-color)}.kbq-accordion-item{background:var(--kbq-accordion-item-default-background);color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-item .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-default-icon-color)}.kbq-accordion-trigger{width:100%;background:transparent;border:none;outline:none;color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-trigger:hover:not([data-disabled=true]){cursor:pointer}.kbq-accordion-trigger:hover:not([data-disabled=true]) .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-hover-icon-color)}.kbq-accordion-trigger[data-disabled=true]{color:var(--kbq-accordion-item-states-disabled-text-color)}.kbq-accordion-trigger[data-disabled=true] .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-disabled-icon-color)!important}.kbq-accordion-header,.kbq-accordion-trigger{font-size:var(--kbq-typography-text-big-font-size);font-style:var(--kbq-typography-text-big-font-style);font-weight:var(--kbq-typography-text-big-font-weight);line-height:var(--kbq-typography-text-big-line-height);font-family:var(--kbq-typography-text-big-font-family);text-transform:var(--kbq-typography-text-big-text-transform);font-feature-settings:var(--kbq-typography-text-big-font-feature-settings);letter-spacing:var(--kbq-typography-text-big-letter-spacing)}.kbq-accordion-trigger__caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}.kbq-accordion-content{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-accordion{--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
69
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
70
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionContentDirective, isStandalone: true, selector: "[kbqAccordionContent]", host: { listeners: { "transitionend": "toggle()" }, properties: { "attr.id": "contentId", "attr.role": "\"region\"", "attr.hidden": "hidden() ? \"\" : null", "attr.aria-labelledby": "triggerId", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" } }, exportAs: ["kbqAccordionContent"], ngImport: i0 }); }
|
|
183
71
|
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type:
|
|
185
|
-
type:
|
|
186
|
-
args: [{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
'[attr.
|
|
191
|
-
'
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionContentDirective, decorators: [{
|
|
73
|
+
type: Directive,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: '[kbqAccordionContent]',
|
|
76
|
+
host: {
|
|
77
|
+
'[attr.id]': 'contentId',
|
|
78
|
+
'[attr.role]': '"region"',
|
|
79
|
+
'[attr.hidden]': 'hidden() ? "" : null',
|
|
80
|
+
'[attr.aria-labelledby]': 'triggerId',
|
|
81
|
+
'[attr.data-state]': 'item.dataState',
|
|
82
|
+
'[attr.data-disabled]': 'item.disabled',
|
|
83
|
+
'[attr.data-orientation]': 'item.orientation',
|
|
84
|
+
'(transitionend)': 'toggle()'
|
|
85
|
+
},
|
|
86
|
+
exportAs: 'kbqAccordionContent'
|
|
87
|
+
}]
|
|
88
|
+
}], ctorParameters: () => [] });
|
|
198
89
|
|
|
199
90
|
class KbqAccordionTriggerDirective {
|
|
200
91
|
constructor() {
|
|
@@ -220,12 +111,20 @@ class KbqAccordionTriggerDirective {
|
|
|
220
111
|
this.item.toggle();
|
|
221
112
|
this.accordion.setActiveItem(this.item);
|
|
222
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Keeps the accordion's key manager in sync with native focus so that arrow-key navigation
|
|
116
|
+
* continues from the header the user has just tabbed/focused into.
|
|
117
|
+
* @docs-private
|
|
118
|
+
*/
|
|
119
|
+
onFocus() {
|
|
120
|
+
this.accordion.setActiveItem(this.item);
|
|
121
|
+
}
|
|
223
122
|
/** @docs-private */
|
|
224
123
|
focus() {
|
|
225
124
|
this.nativeElement.focus();
|
|
226
125
|
}
|
|
227
126
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
228
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionTriggerDirective, isStandalone: true, selector: "[kbqAccordionTrigger]", host: { listeners: { "click": "onClick()" }, properties: { "attr.id": "triggerId", "attr.role": "\"button\"", "attr.aria-expanded": "item.expanded", "attr.aria-controls": "contentId", "attr.aria-disabled": "item.disabled", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" } }, ngImport: i0 }); }
|
|
127
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionTriggerDirective, isStandalone: true, selector: "[kbqAccordionTrigger]", host: { listeners: { "click": "onClick()", "focus": "onFocus()" }, properties: { "attr.id": "triggerId", "attr.role": "\"button\"", "attr.aria-expanded": "item.expanded", "attr.aria-controls": "contentId", "attr.aria-disabled": "item.disabled", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" } }, ngImport: i0 }); }
|
|
229
128
|
}
|
|
230
129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionTriggerDirective, decorators: [{
|
|
231
130
|
type: Directive,
|
|
@@ -240,20 +139,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
240
139
|
'[attr.data-state]': 'item.dataState',
|
|
241
140
|
'[attr.data-disabled]': 'item.disabled',
|
|
242
141
|
'[attr.data-orientation]': 'item.orientation',
|
|
243
|
-
'(click)': 'onClick()'
|
|
142
|
+
'(click)': 'onClick()',
|
|
143
|
+
'(focus)': 'onFocus()'
|
|
244
144
|
}
|
|
245
145
|
}]
|
|
246
146
|
}] });
|
|
247
147
|
|
|
248
148
|
class KbqAccordionTrigger {
|
|
249
149
|
get isFill() {
|
|
250
|
-
return this.accordion.variant() ===
|
|
150
|
+
return this.accordion.variant() === 'fill';
|
|
251
151
|
}
|
|
252
152
|
get isHug() {
|
|
253
|
-
return this.accordion.variant() ===
|
|
153
|
+
return this.accordion.variant() === 'hug';
|
|
254
154
|
}
|
|
255
155
|
get isHugSpaceBetween() {
|
|
256
|
-
return this.accordion.variant() ===
|
|
156
|
+
return this.accordion.variant() === 'hugSpaceBetween';
|
|
257
157
|
}
|
|
258
158
|
constructor() {
|
|
259
159
|
/** @docs-private */
|
|
@@ -263,13 +163,16 @@ class KbqAccordionTrigger {
|
|
|
263
163
|
/** @docs-private */
|
|
264
164
|
this.icon = viewChild.required(KbqIcon);
|
|
265
165
|
this.afterRenderRef = afterNextRender(() => {
|
|
266
|
-
setTimeout(() => this.enableAnimation());
|
|
166
|
+
this.animationTimerId = setTimeout(() => this.enableAnimation());
|
|
267
167
|
this.afterRenderRef?.destroy();
|
|
268
168
|
});
|
|
269
169
|
}
|
|
270
170
|
ngAfterViewInit() {
|
|
271
171
|
this.disableAnimation();
|
|
272
172
|
}
|
|
173
|
+
ngOnDestroy() {
|
|
174
|
+
clearTimeout(this.animationTimerId);
|
|
175
|
+
}
|
|
273
176
|
disableAnimation() {
|
|
274
177
|
this.savedTransition = this.icon().elementRef.nativeElement.style.transition;
|
|
275
178
|
this.icon().getHostElement().style.transition = 'none';
|
|
@@ -285,7 +188,7 @@ class KbqAccordionTrigger {
|
|
|
285
188
|
></i>
|
|
286
189
|
|
|
287
190
|
<ng-content />
|
|
288
|
-
`, isInline: true, styles: [".kbq-accordion-trigger{display:flex;flex-direction:row;align-items:center}.kbq-accordion-trigger .kbq-accordion-trigger__icon{box-sizing:initial;align-self:flex-start;padding:var(--kbq-size-xxs);transition:transform .3s ease-out}.kbq-accordion-trigger .kbq-accordion-trigger__badge,.kbq-accordion-trigger .kbq-accordion-trigger__caption{margin-top:var(--kbq-size-xxs);margin-right:var(--kbq-size-s)}.kbq-accordion-trigger .kbq-accordion-trigger__action{padding:var(--kbq-size-xxs) var(--kbq-size-xxs) var(--kbq-size-3xs);margin-bottom:calc(-1 * var(--kbq-size-3xs))}.kbq-accordion-trigger.kbq-accordion-trigger_fill{padding:var(--kbq-accordion-size-item-header-variant-fill-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_fill[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug{flex-direction:row-reverse;justify-content:flex-end;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between{flex-direction:row-reverse;justify-content:space-between;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(-180deg)}button.kbq-accordion-trigger{flex:1}\n", ".kbq-accordion{--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"], dependencies: [{ kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
191
|
+
`, isInline: true, styles: [".kbq-accordion-trigger{display:flex;flex-direction:row;align-items:center}.kbq-accordion-trigger .kbq-accordion-trigger__icon{box-sizing:initial;align-self:flex-start;padding:var(--kbq-size-xxs);transition:transform .3s ease-out}@media(prefers-reduced-motion:reduce){.kbq-accordion-trigger .kbq-accordion-trigger__icon{transition:none}}.kbq-accordion-trigger .kbq-accordion-trigger__badge,.kbq-accordion-trigger .kbq-accordion-trigger__caption{margin-top:var(--kbq-size-xxs);margin-right:var(--kbq-size-s)}.kbq-accordion-trigger .kbq-accordion-trigger__action{padding:var(--kbq-size-xxs) var(--kbq-size-xxs) var(--kbq-size-3xs);margin-bottom:calc(-1 * var(--kbq-size-3xs))}.kbq-accordion-trigger.kbq-accordion-trigger_fill{padding:var(--kbq-accordion-size-item-header-variant-fill-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_fill[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug{flex-direction:row-reverse;justify-content:flex-end;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between{flex-direction:row-reverse;justify-content:space-between;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(-180deg)}button.kbq-accordion-trigger{flex:1}\n", ".kbq-accordion{--kbq-accordion-size-item-border-width: 2px;--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"], dependencies: [{ kind: "component", type: KbqIcon, selector: "[kbq-icon]", inputs: ["small", "autoColor", "kbq-icon"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
289
192
|
}
|
|
290
193
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionTrigger, decorators: [{
|
|
291
194
|
type: Component,
|
|
@@ -301,24 +204,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
301
204
|
'[class.kbq-accordion-trigger_fill]': 'isFill',
|
|
302
205
|
'[class.kbq-accordion-trigger_hug]': 'isHug',
|
|
303
206
|
'[class.kbq-accordion-trigger_hug-space-between]': 'isHugSpaceBetween'
|
|
304
|
-
}, hostDirectives: [KbqAccordionTriggerDirective], styles: [".kbq-accordion-trigger{display:flex;flex-direction:row;align-items:center}.kbq-accordion-trigger .kbq-accordion-trigger__icon{box-sizing:initial;align-self:flex-start;padding:var(--kbq-size-xxs);transition:transform .3s ease-out}.kbq-accordion-trigger .kbq-accordion-trigger__badge,.kbq-accordion-trigger .kbq-accordion-trigger__caption{margin-top:var(--kbq-size-xxs);margin-right:var(--kbq-size-s)}.kbq-accordion-trigger .kbq-accordion-trigger__action{padding:var(--kbq-size-xxs) var(--kbq-size-xxs) var(--kbq-size-3xs);margin-bottom:calc(-1 * var(--kbq-size-3xs))}.kbq-accordion-trigger.kbq-accordion-trigger_fill{padding:var(--kbq-accordion-size-item-header-variant-fill-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_fill[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug{flex-direction:row-reverse;justify-content:flex-end;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between{flex-direction:row-reverse;justify-content:space-between;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(-180deg)}button.kbq-accordion-trigger{flex:1}\n", ".kbq-accordion{--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"] }]
|
|
207
|
+
}, hostDirectives: [KbqAccordionTriggerDirective], styles: [".kbq-accordion-trigger{display:flex;flex-direction:row;align-items:center}.kbq-accordion-trigger .kbq-accordion-trigger__icon{box-sizing:initial;align-self:flex-start;padding:var(--kbq-size-xxs);transition:transform .3s ease-out}@media(prefers-reduced-motion:reduce){.kbq-accordion-trigger .kbq-accordion-trigger__icon{transition:none}}.kbq-accordion-trigger .kbq-accordion-trigger__badge,.kbq-accordion-trigger .kbq-accordion-trigger__caption{margin-top:var(--kbq-size-xxs);margin-right:var(--kbq-size-s)}.kbq-accordion-trigger .kbq-accordion-trigger__action{padding:var(--kbq-size-xxs) var(--kbq-size-xxs) var(--kbq-size-3xs);margin-bottom:calc(-1 * var(--kbq-size-3xs))}.kbq-accordion-trigger.kbq-accordion-trigger_fill{padding:var(--kbq-accordion-size-item-header-variant-fill-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_fill[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug{flex-direction:row-reverse;justify-content:flex-end;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(90deg)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between{flex-direction:row-reverse;justify-content:space-between;padding:var(--kbq-accordion-size-item-header-variant-hug-padding)}.kbq-accordion-trigger.kbq-accordion-trigger_hug-space-between[data-state=open]>.kbq-accordion-trigger__icon{transform:rotate(-180deg)}button.kbq-accordion-trigger{flex:1}\n", ".kbq-accordion{--kbq-accordion-size-item-border-width: 2px;--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"] }]
|
|
305
208
|
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.ViewChild, args: [i0.forwardRef(() => KbqIcon), { isSignal: true }] }] } });
|
|
306
209
|
|
|
307
|
-
let uniqueIdCounter = 0;
|
|
210
|
+
let uniqueIdCounter$1 = 0;
|
|
308
211
|
class KbqAccordionItem {
|
|
309
212
|
/** The unique AccordionItem id. */
|
|
310
213
|
get id() {
|
|
311
214
|
return this._id;
|
|
312
215
|
}
|
|
216
|
+
/** The current open/closed state of the item. @docs-private */
|
|
313
217
|
get dataState() {
|
|
314
218
|
return this.expanded ? 'open' : 'closed';
|
|
315
219
|
}
|
|
220
|
+
/** The layout orientation inherited from the parent accordion. @docs-private */
|
|
316
221
|
get orientation() {
|
|
317
222
|
return this.accordion.orientation();
|
|
318
223
|
}
|
|
319
224
|
/** Whether the AccordionItem is expanded. */
|
|
320
|
-
//
|
|
321
|
-
//
|
|
225
|
+
// Kept as an `@Input` accessor (not `model()`): the setter runs a synchronous side-effect
|
|
226
|
+
// cascade (emits opened/closed/expandedChange, notifies the selection dispatcher, toggles the
|
|
227
|
+
// content and persists state) that sibling items rely on within the same change-detection tick.
|
|
322
228
|
get expanded() {
|
|
323
229
|
return this._expanded;
|
|
324
230
|
}
|
|
@@ -334,33 +240,26 @@ class KbqAccordionItem {
|
|
|
334
240
|
* In the unique selection dispatcher, the id parameter is the id of the KbqAccordionItem,
|
|
335
241
|
* the name value is the id of the accordion.
|
|
336
242
|
*/
|
|
337
|
-
|
|
338
|
-
this.expansionDispatcher.notify(this.value, accordionId);
|
|
243
|
+
this.expansionDispatcher.notify(this.value(), this.accordion.id);
|
|
339
244
|
}
|
|
340
245
|
else {
|
|
341
246
|
// TODO: The 'emit' function requires a mandatory void argument
|
|
342
247
|
this.closed.emit();
|
|
343
248
|
}
|
|
344
|
-
this.content()
|
|
249
|
+
this.content()?.toggle();
|
|
345
250
|
this.accordion.saveItemState(this);
|
|
346
251
|
// Ensures that the animation will run when the value is set outside of an `@Input`.
|
|
347
252
|
// This includes cases like the open, close and toggle methods.
|
|
348
253
|
this.changeDetectorRef.markForCheck();
|
|
349
254
|
}
|
|
350
255
|
}
|
|
351
|
-
// TODO: Skipped for migration because:
|
|
352
|
-
// Accessor inputs cannot be migrated as they are too complex.
|
|
353
|
-
set value(value) {
|
|
354
|
-
this._value = value;
|
|
355
|
-
}
|
|
356
|
-
get value() {
|
|
357
|
-
return this._value || this.id;
|
|
358
|
-
}
|
|
359
256
|
/** Whether the AccordionItem is disabled. */
|
|
360
|
-
//
|
|
361
|
-
//
|
|
257
|
+
// Kept as an `@Input` accessor (not a signal): `KbqAccordionItem` is a `FocusKeyManager` option,
|
|
258
|
+
// and `ListKeyManagerOption.disabled` (core/a11y/key-manager) is read as a plain `boolean` — a
|
|
259
|
+
// signal function is always truthy, which makes the key manager treat every item as disabled.
|
|
260
|
+
// The getter also merges the item's own state with the parent accordion's (an effective value).
|
|
362
261
|
get disabled() {
|
|
363
|
-
return this.accordion.disabled()
|
|
262
|
+
return this.accordion.disabled() || this._disabled;
|
|
364
263
|
}
|
|
365
264
|
set disabled(value) {
|
|
366
265
|
this._disabled = value;
|
|
@@ -378,20 +277,23 @@ class KbqAccordionItem {
|
|
|
378
277
|
this.triggerComponent = contentChild(KbqAccordionTrigger, ...(ngDevMode ? [{ debugName: "triggerComponent" }] : []));
|
|
379
278
|
/** @docs-private */
|
|
380
279
|
this.content = contentChild(forwardRef(() => KbqAccordionContentDirective), ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
381
|
-
this._id = `kbq-accordion-item-${uniqueIdCounter++}`;
|
|
280
|
+
this._id = `kbq-accordion-item-${uniqueIdCounter$1++}`;
|
|
382
281
|
this._expanded = false;
|
|
282
|
+
/**
|
|
283
|
+
* The item's own `value` input. Must stay `public`: a `protected` input cannot be bound from a
|
|
284
|
+
* consumer template (TS2445 under full AOT template type-checking).
|
|
285
|
+
* @docs-private
|
|
286
|
+
*/
|
|
287
|
+
this.valueInput = input('', ...(ngDevMode ? [{ debugName: "valueInput", alias: 'value' }] : [{ alias: 'value' }]));
|
|
288
|
+
/** The item's effective value — its own value, or the item id when none is provided. */
|
|
289
|
+
this.value = computed(() => this.valueInput() || this.id, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
383
290
|
this._disabled = false;
|
|
384
291
|
/** Event emitted every time the AccordionItem is closed. */
|
|
385
292
|
this.closed = output();
|
|
386
293
|
/** Event emitted every time the AccordionItem is opened. */
|
|
387
294
|
this.opened = output();
|
|
388
295
|
/**
|
|
389
|
-
*
|
|
390
|
-
* @docs-private
|
|
391
|
-
*/
|
|
392
|
-
this.destroyed = new EventEmitter();
|
|
393
|
-
/**
|
|
394
|
-
* Emits whenever the expanded state of the accordion changes.
|
|
296
|
+
* Emits whenever the expanded state of the accordion item changes.
|
|
395
297
|
* Primarily used to facilitate two-way binding.
|
|
396
298
|
* @docs-private
|
|
397
299
|
*/
|
|
@@ -399,28 +301,36 @@ class KbqAccordionItem {
|
|
|
399
301
|
/** Subscription to openAll/closeAll events. */
|
|
400
302
|
this.openCloseAllSubscription = Subscription.EMPTY;
|
|
401
303
|
this.removeUniqueSelectionListener = this.expansionDispatcher.listen((id, accordionId) => {
|
|
402
|
-
if (this.accordion.
|
|
403
|
-
|
|
304
|
+
if (this.accordion.id !== accordionId)
|
|
305
|
+
return;
|
|
306
|
+
// The dispatcher payload is a single value (individual toggle / single-mode value) or an
|
|
307
|
+
// array (controlled `[value]`, default value and restored state). Match exactly to avoid
|
|
308
|
+
// substring collisions (e.g. `item-10` must not open `item-1`).
|
|
309
|
+
const value = id;
|
|
310
|
+
const ownValue = this.value();
|
|
311
|
+
if (Array.isArray(value)) {
|
|
312
|
+
// Sync to array membership: opens members, closes non-members.
|
|
313
|
+
this.expanded = value.includes(ownValue);
|
|
314
|
+
}
|
|
315
|
+
else if (this.accordion.isMultiple) {
|
|
316
|
+
// Individual toggle in multiple mode: only the matching item opens; others stay independent.
|
|
317
|
+
if (value === ownValue) {
|
|
404
318
|
this.expanded = true;
|
|
405
319
|
}
|
|
406
320
|
}
|
|
407
321
|
else {
|
|
408
|
-
|
|
322
|
+
// Individual toggle / controlled value in single mode: exactly one item stays open.
|
|
323
|
+
this.expanded = value === ownValue;
|
|
409
324
|
}
|
|
410
325
|
});
|
|
411
326
|
// When an accordion item is hosted in an accordion, subscribe to open/close events.
|
|
412
|
-
|
|
413
|
-
this.openCloseAllSubscription = this.subscribeToOpenCloseAllActions();
|
|
414
|
-
}
|
|
415
|
-
this.accordion.saveItemState(this, false);
|
|
327
|
+
this.openCloseAllSubscription = this.subscribeToOpenCloseAllActions();
|
|
416
328
|
}
|
|
417
|
-
/** Emits an event for the accordion item being destroyed. */
|
|
418
329
|
ngOnDestroy() {
|
|
419
|
-
this.destroyed.emit();
|
|
420
|
-
this.destroyed.complete();
|
|
421
330
|
this.removeUniqueSelectionListener();
|
|
422
331
|
this.openCloseAllSubscription.unsubscribe();
|
|
423
332
|
}
|
|
333
|
+
/** Moves focus to the item's trigger. */
|
|
424
334
|
focus() {
|
|
425
335
|
this.trigger()?.focus();
|
|
426
336
|
}
|
|
@@ -442,16 +352,19 @@ class KbqAccordionItem {
|
|
|
442
352
|
this.expanded = true;
|
|
443
353
|
}
|
|
444
354
|
}
|
|
355
|
+
/** Returns a snapshot of the item's current persisted state. @docs-private */
|
|
445
356
|
getState() {
|
|
446
357
|
return {
|
|
447
358
|
expanded: this.expanded,
|
|
448
|
-
value: this.value
|
|
359
|
+
value: this.value()
|
|
449
360
|
};
|
|
450
361
|
}
|
|
362
|
+
/** Disables the open/close animation of the item's content and chevron. @docs-private */
|
|
451
363
|
disableAnimation() {
|
|
452
364
|
this.content()?.disableAnimation();
|
|
453
365
|
this.triggerComponent()?.disableAnimation();
|
|
454
366
|
}
|
|
367
|
+
/** Restores the open/close animation of the item's content and chevron. @docs-private */
|
|
455
368
|
enableAnimation() {
|
|
456
369
|
this.content()?.enableAnimation();
|
|
457
370
|
this.triggerComponent()?.enableAnimation();
|
|
@@ -465,7 +378,7 @@ class KbqAccordionItem {
|
|
|
465
378
|
});
|
|
466
379
|
}
|
|
467
380
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
468
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.25", type: KbqAccordionItem, isStandalone: true, selector: "kbq-accordion-item, [kbq-accordion-item]", inputs: { expanded:
|
|
381
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.25", type: KbqAccordionItem, isStandalone: true, selector: "kbq-accordion-item, [kbq-accordion-item]", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute } }, outputs: { closed: "closed", opened: "opened", expandedChange: "expandedChange" }, host: { properties: { "attr.data-state": "dataState", "attr.data-disabled": "disabled", "attr.data-orientation": "orientation" }, classAttribute: "kbq-accordion-item" }, queries: [{ propertyName: "trigger", first: true, predicate: KbqAccordionTriggerDirective, descendants: true, isSignal: true }, { propertyName: "triggerComponent", first: true, predicate: KbqAccordionTrigger, descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: i0.forwardRef(() => KbqAccordionContentDirective), descendants: true, isSignal: true }], ngImport: i0 }); }
|
|
469
382
|
}
|
|
470
383
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionItem, decorators: [{
|
|
471
384
|
type: Directive,
|
|
@@ -481,92 +394,293 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
481
394
|
}], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqAccordionTriggerDirective), { isSignal: true }] }], triggerComponent: [{ type: i0.ContentChild, args: [i0.forwardRef(() => KbqAccordionTrigger), { isSignal: true }] }], content: [{ type: i0.ContentChild, args: [forwardRef(() => KbqAccordionContentDirective), { isSignal: true }] }], expanded: [{
|
|
482
395
|
type: Input,
|
|
483
396
|
args: [{ transform: booleanAttribute }]
|
|
484
|
-
}], value: [{
|
|
485
|
-
type: Input
|
|
486
|
-
}], disabled: [{
|
|
397
|
+
}], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{
|
|
487
398
|
type: Input,
|
|
488
399
|
args: [{ transform: booleanAttribute }]
|
|
489
400
|
}], closed: [{ type: i0.Output, args: ["closed"] }], opened: [{ type: i0.Output, args: ["opened"] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });
|
|
490
401
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
402
|
+
/**
|
|
403
|
+
* Default `KbqAccordionStateStore` implementation backed by `localStorage`.
|
|
404
|
+
*
|
|
405
|
+
* All access is guarded so it is safe on the server (SSR) and in environments where storage
|
|
406
|
+
* throws on access (private mode, sandboxed iframes) or contains corrupt JSON.
|
|
407
|
+
*/
|
|
408
|
+
class KbqAccordionLocalStorageStateStore {
|
|
409
|
+
constructor() {
|
|
410
|
+
this.isBrowser = inject(Platform).isBrowser;
|
|
411
|
+
this.window = inject(KBQ_WINDOW);
|
|
495
412
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
413
|
+
getState(key) {
|
|
414
|
+
if (!this.isBrowser)
|
|
415
|
+
return null;
|
|
416
|
+
try {
|
|
417
|
+
const raw = this.window.localStorage.getItem(key);
|
|
418
|
+
return raw ? JSON.parse(raw) : null;
|
|
419
|
+
}
|
|
420
|
+
catch {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
setState(key, state) {
|
|
425
|
+
if (!this.isBrowser)
|
|
426
|
+
return;
|
|
427
|
+
try {
|
|
428
|
+
this.window.localStorage.setItem(key, JSON.stringify(state));
|
|
429
|
+
}
|
|
430
|
+
catch {
|
|
431
|
+
// Ignore storage write failures (quota exceeded, disabled/blocked storage, etc.).
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionLocalStorageStateStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
435
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionLocalStorageStateStore, providedIn: 'root' }); }
|
|
436
|
+
}
|
|
437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionLocalStorageStateStore, decorators: [{
|
|
438
|
+
type: Injectable,
|
|
439
|
+
args: [{ providedIn: 'root' }]
|
|
440
|
+
}] });
|
|
441
|
+
/**
|
|
442
|
+
* Injection token for the store used to persist accordion state while `useStateSaving` is enabled.
|
|
443
|
+
* Defaults to a `localStorage`-backed implementation (`KbqAccordionLocalStorageStateStore`).
|
|
444
|
+
*/
|
|
445
|
+
const KBQ_ACCORDION_STATE_STORE = new InjectionToken('KBQ_ACCORDION_STATE_STORE', {
|
|
446
|
+
providedIn: 'root',
|
|
447
|
+
factory: () => inject(KbqAccordionLocalStorageStateStore)
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
let uniqueIdCounter = 0;
|
|
451
|
+
class KbqAccordion {
|
|
452
|
+
/** The unique id of this accordion. */
|
|
453
|
+
get id() {
|
|
454
|
+
return this._id;
|
|
455
|
+
}
|
|
456
|
+
/** Whether multiple items can be expanded at the same time. */
|
|
457
|
+
get isMultiple() {
|
|
458
|
+
return this.type() === 'multiple';
|
|
459
|
+
}
|
|
460
|
+
/** Whether a persisted state exists for this accordion. */
|
|
461
|
+
get hasSavedState() {
|
|
462
|
+
return typeof this.state === 'object' && this.state !== null;
|
|
499
463
|
}
|
|
500
464
|
constructor() {
|
|
501
|
-
this.renderer = inject(Renderer2);
|
|
502
|
-
this.platform = inject(Platform);
|
|
503
465
|
/** @docs-private */
|
|
504
|
-
this.
|
|
466
|
+
this.focusMonitor = inject(FocusMonitor);
|
|
505
467
|
/** @docs-private */
|
|
506
|
-
this.
|
|
468
|
+
this.elementRef = inject(ElementRef);
|
|
507
469
|
/** @docs-private */
|
|
508
|
-
this.
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
470
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
471
|
+
/** @docs-private */
|
|
472
|
+
this.selectionDispatcher = inject(UniqueSelectionDispatcher);
|
|
473
|
+
/** @docs-private */
|
|
474
|
+
this.dir = inject(Directionality, { optional: true });
|
|
475
|
+
this.injector = inject(Injector);
|
|
476
|
+
this.stateStore = inject(KBQ_ACCORDION_STATE_STORE);
|
|
477
|
+
/** Emits every time `openAll()` or `closeAll()` is called. @docs-private */
|
|
478
|
+
this.openCloseAllActions = new Subject();
|
|
479
|
+
/** The accordion items projected into this accordion. @docs-private */
|
|
480
|
+
this.items = contentChildren(forwardRef(() => KbqAccordionItem), ...(ngDevMode ? [{ debugName: "items", descendants: true }] : [{ descendants: true }]));
|
|
481
|
+
/** Whether the accordion persists the expanded state of its items across reloads. Defaults to `false`. */
|
|
482
|
+
this.useStateSaving = input(false, ...(ngDevMode ? [{ debugName: "useStateSaving", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
483
|
+
/**
|
|
484
|
+
* A stable, consumer-provided key used to persist state when `useStateSaving` is enabled.
|
|
485
|
+
* Strongly recommended: without it the accordion falls back to an auto-generated,
|
|
486
|
+
* instantiation-order-dependent id that is unreliable under lazy/conditional/reordered rendering.
|
|
487
|
+
*/
|
|
488
|
+
this.stateSavingKey = input('', ...(ngDevMode ? [{ debugName: "stateSavingKey" }] : []));
|
|
489
|
+
/** The visual variant of the accordion. Defaults to `fill`. */
|
|
490
|
+
this.variant = input('fill', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
491
|
+
/** Whether the whole accordion is disabled. */
|
|
492
|
+
this.disabled = input(undefined, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
493
|
+
/** The layout orientation of the accordion. Defaults to `vertical`. */
|
|
494
|
+
this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
495
|
+
/**
|
|
496
|
+
* The `aria-level` applied to the item headings. Defaults to `2`.
|
|
497
|
+
* Set it to match the surrounding document outline (e.g. `3` when nested under an `<h2>` section).
|
|
498
|
+
*/
|
|
499
|
+
this.level = input(2, ...(ngDevMode ? [{ debugName: "level", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
500
|
+
/**
|
|
501
|
+
* The value of the item(s) to expand when initially rendered.
|
|
502
|
+
* Use when you do not need to control the state of the items.
|
|
503
|
+
*/
|
|
504
|
+
this.defaultValue = input([], ...(ngDevMode ? [{ debugName: "defaultValue" }] : []));
|
|
505
|
+
/** Determines whether one or multiple items can be expanded at the same time. */
|
|
506
|
+
this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
507
|
+
/** Whether an expanded item can be collapsed by the user. Defaults to `true`. */
|
|
508
|
+
this.collapsible = input(true, ...(ngDevMode ? [{ debugName: "collapsible" }] : []));
|
|
509
|
+
/**
|
|
510
|
+
* The raw controlled `value` input. Must stay `public`: a `protected` input cannot be bound from
|
|
511
|
+
* a consumer template (TS2445 under full AOT template type-checking).
|
|
512
|
+
* @docs-private
|
|
513
|
+
*/
|
|
514
|
+
// `input()` (not `model()`): a `model()` would auto-create a colliding `valueChange` output.
|
|
515
|
+
this.valueInput = input(undefined, ...(ngDevMode ? [{ debugName: "valueInput", alias: 'value' }] : [{ alias: 'value' }]));
|
|
516
|
+
/**
|
|
517
|
+
* The controlled value of the item(s) to expand, reshaped by mode. Supports `[(value)]`.
|
|
518
|
+
* Falls back to `defaultValue` while `value` is unbound.
|
|
519
|
+
*
|
|
520
|
+
* Always an array in `multiple` mode and always a string in `single` mode — an empty string
|
|
521
|
+
* when nothing is expanded, matching what `valueChange` emits.
|
|
522
|
+
*/
|
|
523
|
+
this.value = computed(() => {
|
|
524
|
+
const value = this.valueInput() ?? this.defaultValue();
|
|
525
|
+
const array = Array.isArray(value) ? value : [value];
|
|
526
|
+
return this.isMultiple ? array : (array[0] ?? '');
|
|
527
|
+
}, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
528
|
+
/** Emits the current value whenever the expanded state of the accordion changes. */
|
|
529
|
+
this.valueChange = output();
|
|
530
|
+
/** `defaultValue` normalized to an array for internal coordination. */
|
|
531
|
+
this.defaultValueArray = computed(() => {
|
|
532
|
+
const value = this.defaultValue();
|
|
533
|
+
return Array.isArray(value) ? value : [value];
|
|
534
|
+
}, ...(ngDevMode ? [{ debugName: "defaultValueArray" }] : []));
|
|
535
|
+
this._id = `kbq-accordion-${uniqueIdCounter++}`;
|
|
536
|
+
this.state = null;
|
|
537
|
+
// Re-emit `valueChange` whenever any (current or future) item toggles its expanded state.
|
|
538
|
+
// Reading `items()` inside the effect keeps the subscriptions in sync with dynamically
|
|
539
|
+
// added/removed items.
|
|
540
|
+
effect((onCleanup) => {
|
|
541
|
+
const subscriptions = this.items().map((item) => item.expandedChange.subscribe(() => this.valueChange.emit(this.getCurrentValue())));
|
|
542
|
+
onCleanup(() => subscriptions.forEach((subscription) => subscription.unsubscribe()));
|
|
512
543
|
});
|
|
544
|
+
// Notify the selection dispatcher when the controlled `[value]` changes (the old setter's
|
|
545
|
+
// side-effect). The `undefined` sentinel keeps the mandatory first run a no-op when unbound;
|
|
546
|
+
// when bound it re-notifies the value `ngAfterContentInit` already sent (idempotent).
|
|
547
|
+
effect(() => {
|
|
548
|
+
const value = this.valueInput();
|
|
549
|
+
if (value === undefined)
|
|
550
|
+
return;
|
|
551
|
+
untracked(() => this.selectionDispatcher.notify(this.value(), this.id));
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
ngAfterContentInit() {
|
|
555
|
+
if (this.useStateSaving()) {
|
|
556
|
+
if (isDevMode() && !this.stateSavingKey()) {
|
|
557
|
+
// eslint-disable-next-line no-console
|
|
558
|
+
console.warn('KbqAccordion: `useStateSaving` is enabled without a `stateSavingKey`. Falling back to an ' +
|
|
559
|
+
'auto-generated id, which is unreliable across lazy/conditional/reordered rendering. ' +
|
|
560
|
+
'Provide a stable `stateSavingKey`.');
|
|
561
|
+
}
|
|
562
|
+
this.state = this.stateStore.getState(this.stateStorageKey);
|
|
563
|
+
}
|
|
564
|
+
if (this.valueInput() !== undefined) {
|
|
565
|
+
this.selectionDispatcher.notify(this.value(), this.id);
|
|
566
|
+
}
|
|
567
|
+
else if (this.useStateSaving() && this.hasSavedState) {
|
|
568
|
+
const expandedValues = Object.keys(this.state)
|
|
569
|
+
.filter((key) => this.state[key].expanded)
|
|
570
|
+
.map((key) => this.state[key].value);
|
|
571
|
+
if (expandedValues.length) {
|
|
572
|
+
this.selectionDispatcher.notify((this.isMultiple ? expandedValues : expandedValues[0]), this.id);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
this.selectionDispatcher.notify(this.defaultValueArray(), this.id);
|
|
577
|
+
}
|
|
578
|
+
// Seed initial state for any items missing from the store (without overwriting existing entries).
|
|
579
|
+
if (this.useStateSaving()) {
|
|
580
|
+
this.items().forEach((item) => this.saveItemState(item, false));
|
|
581
|
+
}
|
|
582
|
+
this.keyManager = new FocusKeyManager(this.items, this.injector).withHomeAndEnd();
|
|
583
|
+
if (this.orientation() === 'horizontal') {
|
|
584
|
+
this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
this.keyManager.withVerticalOrientation();
|
|
588
|
+
}
|
|
513
589
|
}
|
|
514
590
|
ngAfterViewInit() {
|
|
515
|
-
this.
|
|
591
|
+
this.focusMonitor.monitor(this.elementRef, true);
|
|
516
592
|
}
|
|
517
|
-
|
|
518
|
-
|
|
593
|
+
ngOnDestroy() {
|
|
594
|
+
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
595
|
+
this.openCloseAllActions.complete();
|
|
596
|
+
this.keyManager?.destroy();
|
|
597
|
+
}
|
|
598
|
+
/** @docs-private */
|
|
599
|
+
keydownHandler(event) {
|
|
600
|
+
if (!this.keyManager)
|
|
519
601
|
return;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
602
|
+
if (!this.keyManager.activeItem) {
|
|
603
|
+
this.keyManager.setFirstItemActive();
|
|
604
|
+
}
|
|
605
|
+
const activeItem = this.keyManager.activeItem;
|
|
606
|
+
if ((event.keyCode === ENTER || event.keyCode === SPACE) &&
|
|
607
|
+
!this.keyManager.isTyping() &&
|
|
608
|
+
activeItem &&
|
|
609
|
+
!activeItem.disabled) {
|
|
610
|
+
event.preventDefault();
|
|
611
|
+
activeItem.toggle();
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
// Arrow/Home/End move between headers; Tab falls through natively (WAI-ARIA APG pattern).
|
|
615
|
+
this.keyManager.onKeydown(event);
|
|
616
|
+
}
|
|
525
617
|
}
|
|
526
|
-
|
|
527
|
-
|
|
618
|
+
/** Opens all enabled accordion items in an accordion where `type` is `multiple`. */
|
|
619
|
+
openAll() {
|
|
620
|
+
if (this.isMultiple) {
|
|
621
|
+
this.openCloseAllActions.next(true);
|
|
622
|
+
}
|
|
528
623
|
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
this.
|
|
624
|
+
/** Closes all enabled accordion items. */
|
|
625
|
+
closeAll() {
|
|
626
|
+
this.openCloseAllActions.next(false);
|
|
532
627
|
}
|
|
533
|
-
|
|
534
|
-
|
|
628
|
+
/** @docs-private */
|
|
629
|
+
setActiveItem(item) {
|
|
630
|
+
this.keyManager?.setActiveItem(item);
|
|
535
631
|
}
|
|
536
|
-
/**
|
|
537
|
-
|
|
632
|
+
/**
|
|
633
|
+
* Persists the current state of the given item when `useStateSaving` is enabled.
|
|
634
|
+
* @docs-private
|
|
635
|
+
*/
|
|
636
|
+
saveItemState(item, force = true) {
|
|
637
|
+
if (!this.useStateSaving())
|
|
638
|
+
return;
|
|
639
|
+
if (!force && this.state?.[item.id])
|
|
640
|
+
return;
|
|
641
|
+
this.state = this.state ?? {};
|
|
642
|
+
this.state[item.id] = item.getState();
|
|
643
|
+
this.stateStore.setState(this.stateStorageKey, this.state);
|
|
644
|
+
}
|
|
645
|
+
/** The current expanded value(s) derived from the live item state. */
|
|
646
|
+
getCurrentValue() {
|
|
647
|
+
const expandedValues = this.items()
|
|
648
|
+
.filter((item) => item.expanded)
|
|
649
|
+
.map((item) => item.value());
|
|
650
|
+
return this.isMultiple ? expandedValues : (expandedValues[0] ?? '');
|
|
651
|
+
}
|
|
652
|
+
/** The key used to persist/restore state. */
|
|
653
|
+
get stateStorageKey() {
|
|
654
|
+
return this.stateSavingKey() || this.id;
|
|
655
|
+
}
|
|
656
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordion, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
657
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.25", type: KbqAccordion, isStandalone: true, selector: "kbq-accordion, [kbq-accordion]", inputs: { useStateSaving: { classPropertyName: "useStateSaving", publicName: "useStateSaving", isSignal: true, isRequired: false, transformFunction: null }, stateSavingKey: { classPropertyName: "stateSavingKey", publicName: "stateSavingKey", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "keydownHandler($event)" }, properties: { "attr.data-orientation": "orientation()" }, classAttribute: "kbq-accordion" }, providers: [
|
|
658
|
+
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
|
659
|
+
], queries: [{ propertyName: "items", predicate: i0.forwardRef(() => KbqAccordionItem), descendants: true, isSignal: true }], ngImport: i0, template: '<ng-content />', isInline: true, styles: [".kbq-accordion{display:block}.kbq-accordion-item{box-sizing:border-box;display:block;border-width:var(--kbq-accordion-size-item-border-width);border-style:solid;border-color:transparent}.kbq-accordion-header{display:flex;height:var(--kbq-accordion-size-item-header-height)}.kbq-accordion-content{display:block;overflow:hidden}.kbq-accordion-content>.kbq-accordion-content__body{margin:unset;padding:var(--kbq-accordion-size-item-content-padding)}.kbq-accordion-content[data-state=open]{transition:height .3s ease-out;height:var(--kbq-accordion-content-height)}.kbq-accordion-content[data-state=closed]{transition:height .3s ease-out;height:0}@media(prefers-reduced-motion:reduce){.kbq-accordion-content[data-state=open],.kbq-accordion-content[data-state=closed]{transition:none}}.kbq-accordion.cdk-keyboard-focused .kbq-accordion-item:focus-within{border-color:var(--kbq-accordion-item-states-focus-border-color)}.kbq-accordion-item{background:var(--kbq-accordion-item-default-background);color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-item .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-default-icon-color)}.kbq-accordion-trigger{width:100%;background:transparent;border:none;outline:none;color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-trigger:hover:not([data-disabled=true]){cursor:pointer}.kbq-accordion-trigger:hover:not([data-disabled=true]) .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-hover-icon-color)}.kbq-accordion-trigger[data-disabled=true]{color:var(--kbq-accordion-item-states-disabled-text-color)}.kbq-accordion-trigger[data-disabled=true] .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-disabled-icon-color)}.kbq-accordion-header,.kbq-accordion-trigger{font-size:var(--kbq-typography-text-big-font-size);font-style:var(--kbq-typography-text-big-font-style);font-weight:var(--kbq-typography-text-big-font-weight);line-height:var(--kbq-typography-text-big-line-height);font-family:var(--kbq-typography-text-big-font-family);text-transform:var(--kbq-typography-text-big-text-transform);font-feature-settings:var(--kbq-typography-text-big-font-feature-settings);letter-spacing:var(--kbq-typography-text-big-letter-spacing)}.kbq-accordion-trigger__caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}.kbq-accordion-content{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-accordion{--kbq-accordion-size-item-border-width: 2px;--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
538
660
|
}
|
|
539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type:
|
|
540
|
-
type:
|
|
541
|
-
args: [{
|
|
542
|
-
|
|
543
|
-
host: {
|
|
544
|
-
|
|
545
|
-
'[attr.
|
|
546
|
-
'
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
'[attr.data-disabled]': 'item.disabled',
|
|
550
|
-
'[attr.data-orientation]': 'item.orientation',
|
|
551
|
-
'(transitionend)': 'toggle()'
|
|
552
|
-
},
|
|
553
|
-
exportAs: 'kbqAccordionContent'
|
|
554
|
-
}]
|
|
555
|
-
}], ctorParameters: () => [] });
|
|
661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordion, decorators: [{
|
|
662
|
+
type: Component,
|
|
663
|
+
args: [{ selector: 'kbq-accordion, [kbq-accordion]', template: '<ng-content />', providers: [
|
|
664
|
+
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
|
665
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
666
|
+
class: 'kbq-accordion',
|
|
667
|
+
'[attr.data-orientation]': 'orientation()',
|
|
668
|
+
'(keydown)': 'keydownHandler($event)'
|
|
669
|
+
}, styles: [".kbq-accordion{display:block}.kbq-accordion-item{box-sizing:border-box;display:block;border-width:var(--kbq-accordion-size-item-border-width);border-style:solid;border-color:transparent}.kbq-accordion-header{display:flex;height:var(--kbq-accordion-size-item-header-height)}.kbq-accordion-content{display:block;overflow:hidden}.kbq-accordion-content>.kbq-accordion-content__body{margin:unset;padding:var(--kbq-accordion-size-item-content-padding)}.kbq-accordion-content[data-state=open]{transition:height .3s ease-out;height:var(--kbq-accordion-content-height)}.kbq-accordion-content[data-state=closed]{transition:height .3s ease-out;height:0}@media(prefers-reduced-motion:reduce){.kbq-accordion-content[data-state=open],.kbq-accordion-content[data-state=closed]{transition:none}}.kbq-accordion.cdk-keyboard-focused .kbq-accordion-item:focus-within{border-color:var(--kbq-accordion-item-states-focus-border-color)}.kbq-accordion-item{background:var(--kbq-accordion-item-default-background);color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-item .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-default-icon-color)}.kbq-accordion-trigger{width:100%;background:transparent;border:none;outline:none;color:var(--kbq-accordion-item-default-text-color)}.kbq-accordion-trigger:hover:not([data-disabled=true]){cursor:pointer}.kbq-accordion-trigger:hover:not([data-disabled=true]) .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-hover-icon-color)}.kbq-accordion-trigger[data-disabled=true]{color:var(--kbq-accordion-item-states-disabled-text-color)}.kbq-accordion-trigger[data-disabled=true] .kbq-accordion-trigger__icon{color:var(--kbq-accordion-item-states-disabled-icon-color)}.kbq-accordion-header,.kbq-accordion-trigger{font-size:var(--kbq-typography-text-big-font-size);font-style:var(--kbq-typography-text-big-font-style);font-weight:var(--kbq-typography-text-big-font-weight);line-height:var(--kbq-typography-text-big-line-height);font-family:var(--kbq-typography-text-big-font-family);text-transform:var(--kbq-typography-text-big-text-transform);font-feature-settings:var(--kbq-typography-text-big-font-feature-settings);letter-spacing:var(--kbq-typography-text-big-letter-spacing)}.kbq-accordion-trigger__caption{font-size:var(--kbq-typography-text-compact-font-size);font-style:var(--kbq-typography-text-compact-font-style);font-weight:var(--kbq-typography-text-compact-font-weight);line-height:var(--kbq-typography-text-compact-line-height);font-family:var(--kbq-typography-text-compact-font-family);text-transform:var(--kbq-typography-text-compact-text-transform);font-feature-settings:var(--kbq-typography-text-compact-font-feature-settings);letter-spacing:var(--kbq-typography-text-compact-letter-spacing)}.kbq-accordion-content{font-size:var(--kbq-typography-text-normal-font-size);font-style:var(--kbq-typography-text-normal-font-style);font-weight:var(--kbq-typography-text-normal-font-weight);line-height:var(--kbq-typography-text-normal-line-height);font-family:var(--kbq-typography-text-normal-font-family);text-transform:var(--kbq-typography-text-normal-text-transform);font-feature-settings:var(--kbq-typography-text-normal-font-feature-settings);letter-spacing:var(--kbq-typography-text-normal-letter-spacing)}\n", ".kbq-accordion{--kbq-accordion-size-item-border-width: 2px;--kbq-accordion-size-item-header-height: 36px;--kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);--kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs) var(--kbq-size-m);--kbq-accordion-size-item-content-padding: 0px var(--kbq-size-m) var(--kbq-size-s) var(--kbq-size-m);--kbq-accordion-item-default-background: transparent;--kbq-accordion-item-default-text-color: var(--kbq-foreground-contrast);--kbq-accordion-item-default-icon-color: var(--kbq-icon-contrast-fade);--kbq-accordion-item-states-hover-icon-color: var(--kbq-icon-contrast);--kbq-accordion-item-states-focus-border-color: var(--kbq-line-theme);--kbq-accordion-item-states-disabled-text-color: var(--kbq-foreground-contrast-secondary);--kbq-accordion-item-states-disabled-icon-color: var(--kbq-states-icon-disabled)}\n"] }]
|
|
670
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.ContentChildren, args: [forwardRef(() => KbqAccordionItem), { ...{ descendants: true }, isSignal: true }] }], useStateSaving: [{ type: i0.Input, args: [{ isSignal: true, alias: "useStateSaving", required: false }] }], stateSavingKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateSavingKey", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
556
671
|
|
|
557
672
|
class KbqAccordionContent {
|
|
558
673
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
559
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionContent, isStandalone: true, selector: "kbq-accordion-content, [kbq-accordion-content]", host: { classAttribute: "kbq-accordion-content" }, hostDirectives: [{ directive: KbqAccordionContentDirective }], ngImport: i0, template:
|
|
560
|
-
<p><ng-content /></p>
|
|
561
|
-
`, isInline: true }); }
|
|
674
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionContent, isStandalone: true, selector: "kbq-accordion-content, [kbq-accordion-content]", host: { classAttribute: "kbq-accordion-content" }, hostDirectives: [{ directive: KbqAccordionContentDirective }], ngImport: i0, template: '<div class="kbq-accordion-content__body"><ng-content /></div>', isInline: true }); }
|
|
562
675
|
}
|
|
563
676
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionContent, decorators: [{
|
|
564
677
|
type: Component,
|
|
565
678
|
args: [{
|
|
566
679
|
selector: 'kbq-accordion-content, [kbq-accordion-content]',
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
680
|
+
// A `<div>` wrapper (not `<p>`) carries the content padding: `<p>` is invalid for projected
|
|
681
|
+
// block content (a `<div>` would auto-close it), and keeping padding off the animated
|
|
682
|
+
// `.kbq-accordion-content` host lets it collapse cleanly to `height: 0`.
|
|
683
|
+
template: '<div class="kbq-accordion-content__body"><ng-content /></div>',
|
|
570
684
|
host: {
|
|
571
685
|
class: 'kbq-accordion-content'
|
|
572
686
|
},
|
|
@@ -574,20 +688,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
574
688
|
}]
|
|
575
689
|
}] });
|
|
576
690
|
|
|
577
|
-
class
|
|
691
|
+
class KbqAccordionHeader {
|
|
578
692
|
constructor() {
|
|
693
|
+
/** @docs-private */
|
|
579
694
|
this.item = inject(KbqAccordionItem);
|
|
695
|
+
/** @docs-private */
|
|
696
|
+
this.accordion = inject(KbqAccordion);
|
|
580
697
|
}
|
|
581
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type:
|
|
582
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type:
|
|
698
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
699
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionHeader, isStandalone: true, selector: "kbq-accordion-header, [kbq-accordion-header]", host: { properties: { "attr.role": "\"heading\"", "attr.aria-level": "accordion.level()", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" }, classAttribute: "kbq-accordion-header" }, ngImport: i0 }); }
|
|
583
700
|
}
|
|
584
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type:
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionHeader, decorators: [{
|
|
585
702
|
type: Directive,
|
|
586
703
|
args: [{
|
|
587
|
-
selector: '[
|
|
704
|
+
selector: 'kbq-accordion-header, [kbq-accordion-header]',
|
|
588
705
|
host: {
|
|
706
|
+
class: 'kbq-accordion-header',
|
|
589
707
|
'[attr.role]': '"heading"',
|
|
590
|
-
'[attr.aria-level]': '
|
|
708
|
+
'[attr.aria-level]': 'accordion.level()',
|
|
591
709
|
'[attr.data-state]': 'item.dataState',
|
|
592
710
|
'[attr.data-disabled]': 'item.disabled',
|
|
593
711
|
'[attr.data-orientation]': 'item.orientation'
|
|
@@ -595,21 +713,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
595
713
|
}]
|
|
596
714
|
}] });
|
|
597
715
|
|
|
598
|
-
class KbqAccordionHeader {
|
|
599
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
600
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.25", type: KbqAccordionHeader, isStandalone: true, selector: "kbq-accordion-header, [kbq-accordion-header]", host: { classAttribute: "kbq-accordion-header" }, hostDirectives: [{ directive: KbqAccordionHeaderDirective }], ngImport: i0 }); }
|
|
601
|
-
}
|
|
602
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionHeader, decorators: [{
|
|
603
|
-
type: Directive,
|
|
604
|
-
args: [{
|
|
605
|
-
selector: 'kbq-accordion-header, [kbq-accordion-header]',
|
|
606
|
-
host: {
|
|
607
|
-
class: 'kbq-accordion-header'
|
|
608
|
-
},
|
|
609
|
-
hostDirectives: [KbqAccordionHeaderDirective]
|
|
610
|
-
}]
|
|
611
|
-
}] });
|
|
612
|
-
|
|
613
716
|
class KbqAccordionModule {
|
|
614
717
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
615
718
|
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.25", ngImport: i0, type: KbqAccordionModule, imports: [KbqIcon,
|
|
@@ -650,5 +753,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
650
753
|
* Generated bundle index. Do not edit.
|
|
651
754
|
*/
|
|
652
755
|
|
|
653
|
-
export { KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader,
|
|
756
|
+
export { KBQ_ACCORDION_STATE_STORE, KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader, KbqAccordionItem, KbqAccordionLocalStorageStateStore, KbqAccordionModule, KbqAccordionTrigger, KbqAccordionTriggerDirective };
|
|
654
757
|
//# sourceMappingURL=koobiq-components-accordion.mjs.map
|