avero-ui 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1043 -2
- package/fesm2022/avero-ui-accordion.mjs +515 -0
- package/fesm2022/avero-ui-accordion.mjs.map +1 -0
- package/fesm2022/avero-ui-animate-on-scroll.mjs +223 -0
- package/fesm2022/avero-ui-animate-on-scroll.mjs.map +1 -0
- package/fesm2022/avero-ui-auto-complete.mjs +638 -0
- package/fesm2022/avero-ui-auto-complete.mjs.map +1 -0
- package/fesm2022/avero-ui-auto-focus.mjs +88 -0
- package/fesm2022/avero-ui-auto-focus.mjs.map +1 -0
- package/fesm2022/avero-ui-avatar.mjs +274 -0
- package/fesm2022/avero-ui-avatar.mjs.map +1 -0
- package/fesm2022/avero-ui-badge.mjs +278 -0
- package/fesm2022/avero-ui-badge.mjs.map +1 -0
- package/fesm2022/avero-ui-bind.mjs +103 -0
- package/fesm2022/avero-ui-bind.mjs.map +1 -0
- package/fesm2022/avero-ui-block-ui.mjs +175 -0
- package/fesm2022/avero-ui-block-ui.mjs.map +1 -0
- package/fesm2022/avero-ui-breadcrumb.mjs +187 -0
- package/fesm2022/avero-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/avero-ui-button.mjs +118 -0
- package/fesm2022/avero-ui-button.mjs.map +1 -0
- package/fesm2022/avero-ui-calendar.mjs +412 -0
- package/fesm2022/avero-ui-calendar.mjs.map +1 -0
- package/fesm2022/avero-ui-card.mjs +305 -0
- package/fesm2022/avero-ui-card.mjs.map +1 -0
- package/fesm2022/avero-ui-carousel.mjs +390 -0
- package/fesm2022/avero-ui-carousel.mjs.map +1 -0
- package/fesm2022/avero-ui-cascade-select.mjs +771 -0
- package/fesm2022/avero-ui-cascade-select.mjs.map +1 -0
- package/fesm2022/avero-ui-chart.mjs +361 -0
- package/fesm2022/avero-ui-chart.mjs.map +1 -0
- package/fesm2022/avero-ui-checkbox.mjs +279 -0
- package/fesm2022/avero-ui-checkbox.mjs.map +1 -0
- package/fesm2022/avero-ui-chip.mjs +256 -0
- package/fesm2022/avero-ui-chip.mjs.map +1 -0
- package/fesm2022/avero-ui-class-names.mjs +80 -0
- package/fesm2022/avero-ui-class-names.mjs.map +1 -0
- package/fesm2022/avero-ui-color-picker.mjs +665 -0
- package/fesm2022/avero-ui-color-picker.mjs.map +1 -0
- package/fesm2022/avero-ui-confirm-dialog.mjs +561 -0
- package/fesm2022/avero-ui-confirm-dialog.mjs.map +1 -0
- package/fesm2022/avero-ui-confirm-popup.mjs +406 -0
- package/fesm2022/avero-ui-confirm-popup.mjs.map +1 -0
- package/fesm2022/avero-ui-context-menu.mjs +409 -0
- package/fesm2022/avero-ui-context-menu.mjs.map +1 -0
- package/fesm2022/avero-ui-core.mjs +38 -0
- package/fesm2022/avero-ui-core.mjs.map +1 -0
- package/fesm2022/avero-ui-data-view.mjs +312 -0
- package/fesm2022/avero-ui-data-view.mjs.map +1 -0
- package/fesm2022/avero-ui-dialog.mjs +595 -0
- package/fesm2022/avero-ui-dialog.mjs.map +1 -0
- package/fesm2022/avero-ui-divider.mjs +119 -0
- package/fesm2022/avero-ui-divider.mjs.map +1 -0
- package/fesm2022/avero-ui-dock.mjs +243 -0
- package/fesm2022/avero-ui-dock.mjs.map +1 -0
- package/fesm2022/avero-ui-drawer.mjs +577 -0
- package/fesm2022/avero-ui-drawer.mjs.map +1 -0
- package/fesm2022/avero-ui-dropdown.mjs +510 -0
- package/fesm2022/avero-ui-dropdown.mjs.map +1 -0
- package/fesm2022/avero-ui-dynamic-dialog.mjs +268 -0
- package/fesm2022/avero-ui-dynamic-dialog.mjs.map +1 -0
- package/fesm2022/avero-ui-fieldset.mjs +354 -0
- package/fesm2022/avero-ui-fieldset.mjs.map +1 -0
- package/fesm2022/avero-ui-file-upload.mjs +658 -0
- package/fesm2022/avero-ui-file-upload.mjs.map +1 -0
- package/fesm2022/avero-ui-fluid.mjs +147 -0
- package/fesm2022/avero-ui-fluid.mjs.map +1 -0
- package/fesm2022/avero-ui-focus-trap.mjs +120 -0
- package/fesm2022/avero-ui-focus-trap.mjs.map +1 -0
- package/fesm2022/avero-ui-galleria.mjs +523 -0
- package/fesm2022/avero-ui-galleria.mjs.map +1 -0
- package/fesm2022/avero-ui-icon-field.mjs +99 -0
- package/fesm2022/avero-ui-icon-field.mjs.map +1 -0
- package/fesm2022/avero-ui-image-compare.mjs +274 -0
- package/fesm2022/avero-ui-image-compare.mjs.map +1 -0
- package/fesm2022/avero-ui-image.mjs +397 -0
- package/fesm2022/avero-ui-image.mjs.map +1 -0
- package/fesm2022/avero-ui-input-group.mjs +79 -0
- package/fesm2022/avero-ui-input-group.mjs.map +1 -0
- package/fesm2022/avero-ui-input-mask.mjs +678 -0
- package/fesm2022/avero-ui-input-mask.mjs.map +1 -0
- package/fesm2022/avero-ui-input-number.mjs +390 -0
- package/fesm2022/avero-ui-input-number.mjs.map +1 -0
- package/fesm2022/avero-ui-input-otp.mjs +541 -0
- package/fesm2022/avero-ui-input-otp.mjs.map +1 -0
- package/fesm2022/avero-ui-input.mjs +140 -0
- package/fesm2022/avero-ui-input.mjs.map +1 -0
- package/fesm2022/avero-ui-knob.mjs +436 -0
- package/fesm2022/avero-ui-knob.mjs.map +1 -0
- package/fesm2022/avero-ui-mega-menu.mjs +431 -0
- package/fesm2022/avero-ui-mega-menu.mjs.map +1 -0
- package/fesm2022/avero-ui-menu.mjs +398 -0
- package/fesm2022/avero-ui-menu.mjs.map +1 -0
- package/fesm2022/avero-ui-menubar.mjs +387 -0
- package/fesm2022/avero-ui-menubar.mjs.map +1 -0
- package/fesm2022/avero-ui-message.mjs +221 -0
- package/fesm2022/avero-ui-message.mjs.map +1 -0
- package/fesm2022/avero-ui-order-list.mjs +302 -0
- package/fesm2022/avero-ui-order-list.mjs.map +1 -0
- package/fesm2022/avero-ui-organization-chart.mjs +505 -0
- package/fesm2022/avero-ui-organization-chart.mjs.map +1 -0
- package/fesm2022/avero-ui-paginator.mjs +319 -0
- package/fesm2022/avero-ui-paginator.mjs.map +1 -0
- package/fesm2022/avero-ui-panel-menu.mjs +339 -0
- package/fesm2022/avero-ui-panel-menu.mjs.map +1 -0
- package/fesm2022/avero-ui-password.mjs +483 -0
- package/fesm2022/avero-ui-password.mjs.map +1 -0
- package/fesm2022/avero-ui-popover.mjs +469 -0
- package/fesm2022/avero-ui-popover.mjs.map +1 -0
- package/fesm2022/avero-ui-progress-bar.mjs +194 -0
- package/fesm2022/avero-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/avero-ui-progress-spinner.mjs +150 -0
- package/fesm2022/avero-ui-progress-spinner.mjs.map +1 -0
- package/fesm2022/avero-ui-radio.mjs +67 -0
- package/fesm2022/avero-ui-radio.mjs.map +1 -0
- package/fesm2022/avero-ui-rating.mjs +271 -0
- package/fesm2022/avero-ui-rating.mjs.map +1 -0
- package/fesm2022/avero-ui-scroll-panel.mjs +415 -0
- package/fesm2022/avero-ui-scroll-panel.mjs.map +1 -0
- package/fesm2022/avero-ui-slider.mjs +274 -0
- package/fesm2022/avero-ui-slider.mjs.map +1 -0
- package/fesm2022/avero-ui-splitter.mjs +438 -0
- package/fesm2022/avero-ui-splitter.mjs.map +1 -0
- package/fesm2022/avero-ui-stepper.mjs +626 -0
- package/fesm2022/avero-ui-stepper.mjs.map +1 -0
- package/fesm2022/avero-ui-switch.mjs +252 -0
- package/fesm2022/avero-ui-switch.mjs.map +1 -0
- package/fesm2022/avero-ui-table.mjs +448 -0
- package/fesm2022/avero-ui-table.mjs.map +1 -0
- package/fesm2022/avero-ui-tabs.mjs +693 -0
- package/fesm2022/avero-ui-tabs.mjs.map +1 -0
- package/fesm2022/avero-ui-textarea.mjs +180 -0
- package/fesm2022/avero-ui-textarea.mjs.map +1 -0
- package/fesm2022/avero-ui-tiered-menu.mjs +444 -0
- package/fesm2022/avero-ui-tiered-menu.mjs.map +1 -0
- package/fesm2022/avero-ui-timeline.mjs +348 -0
- package/fesm2022/avero-ui-timeline.mjs.map +1 -0
- package/fesm2022/avero-ui-toast.mjs +291 -0
- package/fesm2022/avero-ui-toast.mjs.map +1 -0
- package/fesm2022/avero-ui-toggle-button.mjs +317 -0
- package/fesm2022/avero-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/avero-ui-toolbar.mjs +284 -0
- package/fesm2022/avero-ui-toolbar.mjs.map +1 -0
- package/fesm2022/avero-ui-tooltip.mjs +442 -0
- package/fesm2022/avero-ui-tooltip.mjs.map +1 -0
- package/fesm2022/avero-ui-tree.mjs +426 -0
- package/fesm2022/avero-ui-tree.mjs.map +1 -0
- package/fesm2022/avero-ui-virtual-scroller.mjs +503 -0
- package/fesm2022/avero-ui-virtual-scroller.mjs.map +1 -0
- package/fesm2022/avero-ui.mjs +114 -0
- package/fesm2022/avero-ui.mjs.map +1 -0
- package/package.json +342 -3
- package/scripts/install-agent-skills.mjs +31 -0
- package/skills/avero-ui-build/SKILL.md +40 -0
- package/skills/avero-ui-build/agents/openai.yaml +4 -0
- package/skills/avero-ui-build/assets/workspace-page.scss +94 -0
- package/skills/avero-ui-build/assets/workspace-page.ts +222 -0
- package/skills/avero-ui-build/references/components.md +47 -0
- package/skills/avero-ui-build/references/integration.md +65 -0
- package/skills/avero-ui-build/references/recipes.md +88 -0
- package/styles/theme.scss +92 -0
- package/types/avero-ui-accordion.d.ts +101 -0
- package/types/avero-ui-animate-on-scroll.d.ts +56 -0
- package/types/avero-ui-auto-complete.d.ts +188 -0
- package/types/avero-ui-auto-focus.d.ts +24 -0
- package/types/avero-ui-avatar.d.ts +73 -0
- package/types/avero-ui-badge.d.ts +71 -0
- package/types/avero-ui-bind.d.ts +26 -0
- package/types/avero-ui-block-ui.d.ts +31 -0
- package/types/avero-ui-breadcrumb.d.ts +65 -0
- package/types/avero-ui-button.d.ts +37 -0
- package/types/avero-ui-calendar.d.ts +105 -0
- package/types/avero-ui-card.d.ts +53 -0
- package/types/avero-ui-carousel.d.ts +128 -0
- package/types/avero-ui-cascade-select.d.ts +212 -0
- package/types/avero-ui-chart.d.ts +106 -0
- package/types/avero-ui-checkbox.d.ts +90 -0
- package/types/avero-ui-chip.d.ts +63 -0
- package/types/avero-ui-class-names.d.ts +24 -0
- package/types/avero-ui-color-picker.d.ts +173 -0
- package/types/avero-ui-confirm-dialog.d.ts +113 -0
- package/types/avero-ui-confirm-popup.d.ts +68 -0
- package/types/avero-ui-context-menu.d.ts +95 -0
- package/types/avero-ui-core.d.ts +11 -0
- package/types/avero-ui-data-view.d.ts +102 -0
- package/types/avero-ui-dialog.d.ts +118 -0
- package/types/avero-ui-divider.d.ts +31 -0
- package/types/avero-ui-dock.d.ts +80 -0
- package/types/avero-ui-drawer.d.ts +109 -0
- package/types/avero-ui-dropdown.d.ts +146 -0
- package/types/avero-ui-dynamic-dialog.d.ts +51 -0
- package/types/avero-ui-fieldset.d.ts +73 -0
- package/types/avero-ui-file-upload.d.ts +195 -0
- package/types/avero-ui-fluid.d.ts +32 -0
- package/types/avero-ui-focus-trap.d.ts +25 -0
- package/types/avero-ui-galleria.d.ts +156 -0
- package/types/avero-ui-icon-field.d.ts +22 -0
- package/types/avero-ui-image-compare.d.ts +77 -0
- package/types/avero-ui-image.d.ts +111 -0
- package/types/avero-ui-input-group.d.ts +14 -0
- package/types/avero-ui-input-mask.d.ts +178 -0
- package/types/avero-ui-input-number.d.ts +131 -0
- package/types/avero-ui-input-otp.d.ts +140 -0
- package/types/avero-ui-input.d.ts +36 -0
- package/types/avero-ui-knob.d.ts +139 -0
- package/types/avero-ui-mega-menu.d.ts +115 -0
- package/types/avero-ui-menu.d.ts +100 -0
- package/types/avero-ui-menubar.d.ts +91 -0
- package/types/avero-ui-message.d.ts +54 -0
- package/types/avero-ui-order-list.d.ts +85 -0
- package/types/avero-ui-organization-chart.d.ts +145 -0
- package/types/avero-ui-paginator.d.ts +104 -0
- package/types/avero-ui-panel-menu.d.ts +99 -0
- package/types/avero-ui-password.d.ts +163 -0
- package/types/avero-ui-popover.d.ts +91 -0
- package/types/avero-ui-progress-bar.d.ts +45 -0
- package/types/avero-ui-progress-spinner.d.ts +41 -0
- package/types/avero-ui-radio.d.ts +16 -0
- package/types/avero-ui-rating.d.ts +75 -0
- package/types/avero-ui-scroll-panel.d.ts +78 -0
- package/types/avero-ui-slider.d.ts +92 -0
- package/types/avero-ui-splitter.d.ts +90 -0
- package/types/avero-ui-stepper.d.ts +134 -0
- package/types/avero-ui-switch.d.ts +83 -0
- package/types/avero-ui-table.d.ts +150 -0
- package/types/avero-ui-tabs.d.ts +135 -0
- package/types/avero-ui-textarea.d.ts +43 -0
- package/types/avero-ui-tiered-menu.d.ts +105 -0
- package/types/avero-ui-timeline.d.ts +97 -0
- package/types/avero-ui-toast.d.ts +99 -0
- package/types/avero-ui-toggle-button.d.ts +115 -0
- package/types/avero-ui-toolbar.d.ts +33 -0
- package/types/avero-ui-tooltip.d.ts +93 -0
- package/types/avero-ui-tree.d.ts +128 -0
- package/types/avero-ui-virtual-scroller.d.ts +149 -0
- package/types/avero-ui.d.ts +82 -0
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
var AvAccordion = class AvAccordion {
|
|
5
|
+
inputId = input.required(...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
|
|
6
|
+
value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
7
|
+
multiple = input(false, {
|
|
8
|
+
...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
|
|
9
|
+
transform: booleanAttribute
|
|
10
|
+
});
|
|
11
|
+
disabled = input(false, {
|
|
12
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
13
|
+
transform: booleanAttribute
|
|
14
|
+
});
|
|
15
|
+
headingLevel = input(3, ...ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []);
|
|
16
|
+
onOpen = output();
|
|
17
|
+
onClose = output();
|
|
18
|
+
children = contentChildren(forwardRef(() => AvAccordionPanel), {
|
|
19
|
+
...ngDevMode ? { debugName: "children" } : /* istanbul ignore next */ {},
|
|
20
|
+
descendants: true
|
|
21
|
+
});
|
|
22
|
+
panels = computed(() => this.children().filter((panel) => panel.accordion === this), ...ngDevMode ? [{ debugName: "panels" }] : /* istanbul ignore next */ []);
|
|
23
|
+
activeValues = computed(() => {
|
|
24
|
+
const value = this.value();
|
|
25
|
+
const keys = value === null ? [] : Array.isArray(value) ? value : [value];
|
|
26
|
+
return this.multiple() ? [...new Set(keys)] : keys.slice(0, 1);
|
|
27
|
+
}, ...ngDevMode ? [{ debugName: "activeValues" }] : /* istanbul ignore next */ []);
|
|
28
|
+
level = computed(() => Math.max(1, Math.min(6, Math.trunc(this.headingLevel()) || 3)), ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
|
|
29
|
+
toggle(panel, event) {
|
|
30
|
+
if (panel.blocked()) return;
|
|
31
|
+
const key = panel.value();
|
|
32
|
+
const previous = this.activeValues();
|
|
33
|
+
const open = previous.includes(key);
|
|
34
|
+
const next = open ? previous.filter((item) => item !== key) : this.multiple() ? [...previous, key] : [key];
|
|
35
|
+
this.value.set(this.multiple() ? next : next[0] ?? null);
|
|
36
|
+
for (const item of previous) if (!next.includes(item)) this.onClose.emit({
|
|
37
|
+
value: item,
|
|
38
|
+
originalEvent: event
|
|
39
|
+
});
|
|
40
|
+
if (!open) this.onOpen.emit({
|
|
41
|
+
value: key,
|
|
42
|
+
originalEvent: event
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
navigate(panel, event) {
|
|
46
|
+
if (panel.blocked() || ![
|
|
47
|
+
"ArrowDown",
|
|
48
|
+
"ArrowUp",
|
|
49
|
+
"Home",
|
|
50
|
+
"End"
|
|
51
|
+
].includes(event.key)) return;
|
|
52
|
+
const enabled = this.panels().filter((item) => !item.blocked());
|
|
53
|
+
const index = enabled.indexOf(panel);
|
|
54
|
+
if (index < 0) return;
|
|
55
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : (index + (event.key === "ArrowDown" ? 1 : -1) + enabled.length) % enabled.length;
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
enabled[next].header()?.focus();
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
60
|
+
minVersion: "12.0.0",
|
|
61
|
+
version: "22.3.2",
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
type: AvAccordion,
|
|
64
|
+
deps: [],
|
|
65
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
66
|
+
});
|
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
68
|
+
minVersion: "17.2.0",
|
|
69
|
+
version: "22.3.2",
|
|
70
|
+
type: AvAccordion,
|
|
71
|
+
isStandalone: true,
|
|
72
|
+
selector: "av-accordion",
|
|
73
|
+
inputs: {
|
|
74
|
+
inputId: {
|
|
75
|
+
classPropertyName: "inputId",
|
|
76
|
+
publicName: "inputId",
|
|
77
|
+
isSignal: true,
|
|
78
|
+
isRequired: true,
|
|
79
|
+
transformFunction: null
|
|
80
|
+
},
|
|
81
|
+
value: {
|
|
82
|
+
classPropertyName: "value",
|
|
83
|
+
publicName: "value",
|
|
84
|
+
isSignal: true,
|
|
85
|
+
isRequired: false,
|
|
86
|
+
transformFunction: null
|
|
87
|
+
},
|
|
88
|
+
multiple: {
|
|
89
|
+
classPropertyName: "multiple",
|
|
90
|
+
publicName: "multiple",
|
|
91
|
+
isSignal: true,
|
|
92
|
+
isRequired: false,
|
|
93
|
+
transformFunction: null
|
|
94
|
+
},
|
|
95
|
+
disabled: {
|
|
96
|
+
classPropertyName: "disabled",
|
|
97
|
+
publicName: "disabled",
|
|
98
|
+
isSignal: true,
|
|
99
|
+
isRequired: false,
|
|
100
|
+
transformFunction: null
|
|
101
|
+
},
|
|
102
|
+
headingLevel: {
|
|
103
|
+
classPropertyName: "headingLevel",
|
|
104
|
+
publicName: "headingLevel",
|
|
105
|
+
isSignal: true,
|
|
106
|
+
isRequired: false,
|
|
107
|
+
transformFunction: null
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
outputs: {
|
|
111
|
+
value: "valueChange",
|
|
112
|
+
onOpen: "onOpen",
|
|
113
|
+
onClose: "onClose"
|
|
114
|
+
},
|
|
115
|
+
queries: [{
|
|
116
|
+
propertyName: "children",
|
|
117
|
+
predicate: i0.forwardRef(() => AvAccordionPanel),
|
|
118
|
+
descendants: true,
|
|
119
|
+
isSignal: true
|
|
120
|
+
}],
|
|
121
|
+
ngImport: i0,
|
|
122
|
+
template: "<ng-content />",
|
|
123
|
+
isInline: true,
|
|
124
|
+
styles: [":host{display:block;border:1px solid var(--av-accordion-border, var(--av-border, #dfe7e4));border-radius:var(--av-accordion-radius, 10px);overflow:hidden;background:var(--av-accordion-background, var(--av-surface, white));color:var(--av-accordion-color, var(--av-text, #334155))}\n"],
|
|
125
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.3.2",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: AvAccordion,
|
|
133
|
+
decorators: [{
|
|
134
|
+
type: Component,
|
|
135
|
+
args: [{
|
|
136
|
+
selector: "av-accordion",
|
|
137
|
+
standalone: true,
|
|
138
|
+
template: "<ng-content />",
|
|
139
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
140
|
+
styles: [":host{display:block;border:1px solid var(--av-accordion-border, var(--av-border, #dfe7e4));border-radius:var(--av-accordion-radius, 10px);overflow:hidden;background:var(--av-accordion-background, var(--av-surface, white));color:var(--av-accordion-color, var(--av-text, #334155))}\n"]
|
|
141
|
+
}]
|
|
142
|
+
}],
|
|
143
|
+
propDecorators: {
|
|
144
|
+
inputId: [{
|
|
145
|
+
type: i0.Input,
|
|
146
|
+
args: [{
|
|
147
|
+
isSignal: true,
|
|
148
|
+
alias: "inputId",
|
|
149
|
+
required: true
|
|
150
|
+
}]
|
|
151
|
+
}],
|
|
152
|
+
value: [{
|
|
153
|
+
type: i0.Input,
|
|
154
|
+
args: [{
|
|
155
|
+
isSignal: true,
|
|
156
|
+
alias: "value",
|
|
157
|
+
required: false
|
|
158
|
+
}]
|
|
159
|
+
}, {
|
|
160
|
+
type: i0.Output,
|
|
161
|
+
args: ["valueChange"]
|
|
162
|
+
}],
|
|
163
|
+
multiple: [{
|
|
164
|
+
type: i0.Input,
|
|
165
|
+
args: [{
|
|
166
|
+
isSignal: true,
|
|
167
|
+
alias: "multiple",
|
|
168
|
+
required: false
|
|
169
|
+
}]
|
|
170
|
+
}],
|
|
171
|
+
disabled: [{
|
|
172
|
+
type: i0.Input,
|
|
173
|
+
args: [{
|
|
174
|
+
isSignal: true,
|
|
175
|
+
alias: "disabled",
|
|
176
|
+
required: false
|
|
177
|
+
}]
|
|
178
|
+
}],
|
|
179
|
+
headingLevel: [{
|
|
180
|
+
type: i0.Input,
|
|
181
|
+
args: [{
|
|
182
|
+
isSignal: true,
|
|
183
|
+
alias: "headingLevel",
|
|
184
|
+
required: false
|
|
185
|
+
}]
|
|
186
|
+
}],
|
|
187
|
+
onOpen: [{
|
|
188
|
+
type: i0.Output,
|
|
189
|
+
args: ["onOpen"]
|
|
190
|
+
}],
|
|
191
|
+
onClose: [{
|
|
192
|
+
type: i0.Output,
|
|
193
|
+
args: ["onClose"]
|
|
194
|
+
}],
|
|
195
|
+
children: [{
|
|
196
|
+
type: i0.ContentChildren,
|
|
197
|
+
args: [forwardRef(() => AvAccordionPanel), {
|
|
198
|
+
descendants: true,
|
|
199
|
+
isSignal: true
|
|
200
|
+
}]
|
|
201
|
+
}]
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
var AvAccordionPanel = class AvAccordionPanel {
|
|
205
|
+
accordion = inject(AvAccordion);
|
|
206
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
207
|
+
disabled = input(false, {
|
|
208
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
209
|
+
transform: booleanAttribute
|
|
210
|
+
});
|
|
211
|
+
expanded = computed(() => this.accordion.activeValues().includes(this.value()), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
212
|
+
blocked = computed(() => this.disabled() || this.accordion.disabled(), ...ngDevMode ? [{ debugName: "blocked" }] : /* istanbul ignore next */ []);
|
|
213
|
+
header = contentChild(forwardRef(() => AvAccordionHeader), ...ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []);
|
|
214
|
+
id = computed(() => `${this.accordion.inputId()}-${typeof this.value() === "number" ? "n" : "s"}-${encodeURIComponent(String(this.value()))}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
216
|
+
minVersion: "12.0.0",
|
|
217
|
+
version: "22.3.2",
|
|
218
|
+
ngImport: i0,
|
|
219
|
+
type: AvAccordionPanel,
|
|
220
|
+
deps: [],
|
|
221
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
222
|
+
});
|
|
223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
224
|
+
minVersion: "17.2.0",
|
|
225
|
+
version: "22.3.2",
|
|
226
|
+
type: AvAccordionPanel,
|
|
227
|
+
isStandalone: true,
|
|
228
|
+
selector: "av-accordion-panel",
|
|
229
|
+
inputs: {
|
|
230
|
+
value: {
|
|
231
|
+
classPropertyName: "value",
|
|
232
|
+
publicName: "value",
|
|
233
|
+
isSignal: true,
|
|
234
|
+
isRequired: true,
|
|
235
|
+
transformFunction: null
|
|
236
|
+
},
|
|
237
|
+
disabled: {
|
|
238
|
+
classPropertyName: "disabled",
|
|
239
|
+
publicName: "disabled",
|
|
240
|
+
isSignal: true,
|
|
241
|
+
isRequired: false,
|
|
242
|
+
transformFunction: null
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
queries: [{
|
|
246
|
+
propertyName: "header",
|
|
247
|
+
first: true,
|
|
248
|
+
predicate: i0.forwardRef(() => AvAccordionHeader),
|
|
249
|
+
descendants: true,
|
|
250
|
+
isSignal: true
|
|
251
|
+
}],
|
|
252
|
+
ngImport: i0,
|
|
253
|
+
template: "<ng-content />",
|
|
254
|
+
isInline: true,
|
|
255
|
+
styles: [":host{display:block;border-top:1px solid var(--av-accordion-border, var(--av-border, #dfe7e4))}:host(:first-of-type){border-top:0}\n"],
|
|
256
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
260
|
+
minVersion: "12.0.0",
|
|
261
|
+
version: "22.3.2",
|
|
262
|
+
ngImport: i0,
|
|
263
|
+
type: AvAccordionPanel,
|
|
264
|
+
decorators: [{
|
|
265
|
+
type: Component,
|
|
266
|
+
args: [{
|
|
267
|
+
selector: "av-accordion-panel",
|
|
268
|
+
standalone: true,
|
|
269
|
+
template: "<ng-content />",
|
|
270
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
271
|
+
styles: [":host{display:block;border-top:1px solid var(--av-accordion-border, var(--av-border, #dfe7e4))}:host(:first-of-type){border-top:0}\n"]
|
|
272
|
+
}]
|
|
273
|
+
}],
|
|
274
|
+
propDecorators: {
|
|
275
|
+
value: [{
|
|
276
|
+
type: i0.Input,
|
|
277
|
+
args: [{
|
|
278
|
+
isSignal: true,
|
|
279
|
+
alias: "value",
|
|
280
|
+
required: true
|
|
281
|
+
}]
|
|
282
|
+
}],
|
|
283
|
+
disabled: [{
|
|
284
|
+
type: i0.Input,
|
|
285
|
+
args: [{
|
|
286
|
+
isSignal: true,
|
|
287
|
+
alias: "disabled",
|
|
288
|
+
required: false
|
|
289
|
+
}]
|
|
290
|
+
}],
|
|
291
|
+
header: [{
|
|
292
|
+
type: i0.ContentChild,
|
|
293
|
+
args: [forwardRef(() => AvAccordionHeader), { isSignal: true }]
|
|
294
|
+
}]
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
var AvAccordionHeader = class AvAccordionHeader {
|
|
298
|
+
panel = inject(AvAccordionPanel);
|
|
299
|
+
button = viewChild("button", ...ngDevMode ? [{ debugName: "button" }] : /* istanbul ignore next */ []);
|
|
300
|
+
focus() {
|
|
301
|
+
this.button()?.nativeElement.focus();
|
|
302
|
+
}
|
|
303
|
+
keydown(event) {
|
|
304
|
+
if (event.target === this.button()?.nativeElement) this.panel.accordion.navigate(this.panel, event);
|
|
305
|
+
}
|
|
306
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
307
|
+
minVersion: "12.0.0",
|
|
308
|
+
version: "22.3.2",
|
|
309
|
+
ngImport: i0,
|
|
310
|
+
type: AvAccordionHeader,
|
|
311
|
+
deps: [],
|
|
312
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
313
|
+
});
|
|
314
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
315
|
+
minVersion: "17.2.0",
|
|
316
|
+
version: "22.3.2",
|
|
317
|
+
type: AvAccordionHeader,
|
|
318
|
+
isStandalone: true,
|
|
319
|
+
selector: "av-accordion-header",
|
|
320
|
+
viewQueries: [{
|
|
321
|
+
propertyName: "button",
|
|
322
|
+
first: true,
|
|
323
|
+
predicate: ["button"],
|
|
324
|
+
descendants: true,
|
|
325
|
+
isSignal: true
|
|
326
|
+
}],
|
|
327
|
+
ngImport: i0,
|
|
328
|
+
template: `<div role="heading" [attr.aria-level]="panel.accordion.level()">
|
|
329
|
+
<button
|
|
330
|
+
#button
|
|
331
|
+
type="button"
|
|
332
|
+
[id]="panel.id() + '-header'"
|
|
333
|
+
[disabled]="panel.blocked()"
|
|
334
|
+
[attr.aria-expanded]="panel.expanded()"
|
|
335
|
+
[attr.aria-controls]="panel.id() + '-content'"
|
|
336
|
+
(click)="panel.accordion.toggle(panel, $event)"
|
|
337
|
+
(keydown)="keydown($event)"
|
|
338
|
+
>
|
|
339
|
+
<span class="label"><ng-content /></span>
|
|
340
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" [class.open]="panel.expanded()">
|
|
341
|
+
<path d="m5 3 5 5-5 5" />
|
|
342
|
+
</svg>
|
|
343
|
+
</button>
|
|
344
|
+
</div>`,
|
|
345
|
+
isInline: true,
|
|
346
|
+
styles: [":host{display:block}button{width:100%;display:flex;align-items:center;gap:16px;text-align:start;border:0;padding:20px;background:transparent;color:inherit;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.label{flex:1;min-width:0;overflow-wrap:anywhere}button:hover:not(:disabled){background:var(--av-accordion-hover, var(--av-surface-hover, #f4f8f6))}button[aria-expanded=true]{color:var(--av-accordion-accent, var(--av-primary, #0f766e))}button:focus-visible{outline:2px solid var(--av-accordion-accent, var(--av-primary, #0f766e));outline-offset:-3px}button:disabled{opacity:.5;cursor:default}svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6;transition:transform .15s}svg.open{transform:rotate(90deg)}@media(prefers-reduced-motion:reduce){svg{transition:none}}\n"],
|
|
347
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
351
|
+
minVersion: "12.0.0",
|
|
352
|
+
version: "22.3.2",
|
|
353
|
+
ngImport: i0,
|
|
354
|
+
type: AvAccordionHeader,
|
|
355
|
+
decorators: [{
|
|
356
|
+
type: Component,
|
|
357
|
+
args: [{
|
|
358
|
+
selector: "av-accordion-header",
|
|
359
|
+
standalone: true,
|
|
360
|
+
template: `<div role="heading" [attr.aria-level]="panel.accordion.level()">
|
|
361
|
+
<button
|
|
362
|
+
#button
|
|
363
|
+
type="button"
|
|
364
|
+
[id]="panel.id() + '-header'"
|
|
365
|
+
[disabled]="panel.blocked()"
|
|
366
|
+
[attr.aria-expanded]="panel.expanded()"
|
|
367
|
+
[attr.aria-controls]="panel.id() + '-content'"
|
|
368
|
+
(click)="panel.accordion.toggle(panel, $event)"
|
|
369
|
+
(keydown)="keydown($event)"
|
|
370
|
+
>
|
|
371
|
+
<span class="label"><ng-content /></span>
|
|
372
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" [class.open]="panel.expanded()">
|
|
373
|
+
<path d="m5 3 5 5-5 5" />
|
|
374
|
+
</svg>
|
|
375
|
+
</button>
|
|
376
|
+
</div>`,
|
|
377
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
378
|
+
styles: [":host{display:block}button{width:100%;display:flex;align-items:center;gap:16px;text-align:start;border:0;padding:20px;background:transparent;color:inherit;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.label{flex:1;min-width:0;overflow-wrap:anywhere}button:hover:not(:disabled){background:var(--av-accordion-hover, var(--av-surface-hover, #f4f8f6))}button[aria-expanded=true]{color:var(--av-accordion-accent, var(--av-primary, #0f766e))}button:focus-visible{outline:2px solid var(--av-accordion-accent, var(--av-primary, #0f766e));outline-offset:-3px}button:disabled{opacity:.5;cursor:default}svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6;transition:transform .15s}svg.open{transform:rotate(90deg)}@media(prefers-reduced-motion:reduce){svg{transition:none}}\n"]
|
|
379
|
+
}]
|
|
380
|
+
}],
|
|
381
|
+
propDecorators: { button: [{
|
|
382
|
+
type: i0.ViewChild,
|
|
383
|
+
args: ["button", { isSignal: true }]
|
|
384
|
+
}] }
|
|
385
|
+
});
|
|
386
|
+
var AvAccordionLazy = class AvAccordionLazy {
|
|
387
|
+
template = inject(TemplateRef);
|
|
388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
389
|
+
minVersion: "12.0.0",
|
|
390
|
+
version: "22.3.2",
|
|
391
|
+
ngImport: i0,
|
|
392
|
+
type: AvAccordionLazy,
|
|
393
|
+
deps: [],
|
|
394
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
395
|
+
});
|
|
396
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
397
|
+
minVersion: "14.0.0",
|
|
398
|
+
version: "22.3.2",
|
|
399
|
+
type: AvAccordionLazy,
|
|
400
|
+
isStandalone: true,
|
|
401
|
+
selector: "ng-template[avAccordionLazy]",
|
|
402
|
+
ngImport: i0
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
406
|
+
minVersion: "12.0.0",
|
|
407
|
+
version: "22.3.2",
|
|
408
|
+
ngImport: i0,
|
|
409
|
+
type: AvAccordionLazy,
|
|
410
|
+
decorators: [{
|
|
411
|
+
type: Directive,
|
|
412
|
+
args: [{
|
|
413
|
+
selector: "ng-template[avAccordionLazy]",
|
|
414
|
+
standalone: true
|
|
415
|
+
}]
|
|
416
|
+
}]
|
|
417
|
+
});
|
|
418
|
+
var AvAccordionContent = class AvAccordionContent {
|
|
419
|
+
panel = inject(AvAccordionPanel);
|
|
420
|
+
lazy = contentChild(AvAccordionLazy, ...ngDevMode ? [{ debugName: "lazy" }] : /* istanbul ignore next */ []);
|
|
421
|
+
visited = signal(false, ...ngDevMode ? [{ debugName: "visited" }] : /* istanbul ignore next */ []);
|
|
422
|
+
constructor() {
|
|
423
|
+
effect(() => {
|
|
424
|
+
if (this.panel.expanded()) this.visited.set(true);
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
428
|
+
minVersion: "12.0.0",
|
|
429
|
+
version: "22.3.2",
|
|
430
|
+
ngImport: i0,
|
|
431
|
+
type: AvAccordionContent,
|
|
432
|
+
deps: [],
|
|
433
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
434
|
+
});
|
|
435
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
436
|
+
minVersion: "17.0.0",
|
|
437
|
+
version: "22.3.2",
|
|
438
|
+
type: AvAccordionContent,
|
|
439
|
+
isStandalone: true,
|
|
440
|
+
selector: "av-accordion-content",
|
|
441
|
+
host: {
|
|
442
|
+
attributes: { "role": "region" },
|
|
443
|
+
properties: {
|
|
444
|
+
"id": "panel.id() + '-content'",
|
|
445
|
+
"attr.aria-labelledby": "panel.id() + '-header'",
|
|
446
|
+
"hidden": "!panel.expanded()"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
queries: [{
|
|
450
|
+
propertyName: "lazy",
|
|
451
|
+
first: true,
|
|
452
|
+
predicate: AvAccordionLazy,
|
|
453
|
+
descendants: true,
|
|
454
|
+
isSignal: true
|
|
455
|
+
}],
|
|
456
|
+
ngImport: i0,
|
|
457
|
+
template: `@if (lazy(); as content) {
|
|
458
|
+
@if (panel.expanded() || visited()) {
|
|
459
|
+
<ng-container [ngTemplateOutlet]="content.template" />
|
|
460
|
+
}
|
|
461
|
+
} @else {
|
|
462
|
+
<ng-content />
|
|
463
|
+
}`,
|
|
464
|
+
isInline: true,
|
|
465
|
+
styles: [":host{display:block;padding:0 20px 20px;line-height:1.7;font-size:14px;color:var(--av-accordion-content-color, var(--av-text-muted, #64748b))}:host([hidden]){display:none}\n"],
|
|
466
|
+
dependencies: [{
|
|
467
|
+
kind: "directive",
|
|
468
|
+
type: NgTemplateOutlet,
|
|
469
|
+
selector: "[ngTemplateOutlet]",
|
|
470
|
+
inputs: [
|
|
471
|
+
"ngTemplateOutletContext",
|
|
472
|
+
"ngTemplateOutlet",
|
|
473
|
+
"ngTemplateOutletInjector"
|
|
474
|
+
]
|
|
475
|
+
}],
|
|
476
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
480
|
+
minVersion: "12.0.0",
|
|
481
|
+
version: "22.3.2",
|
|
482
|
+
ngImport: i0,
|
|
483
|
+
type: AvAccordionContent,
|
|
484
|
+
decorators: [{
|
|
485
|
+
type: Component,
|
|
486
|
+
args: [{
|
|
487
|
+
selector: "av-accordion-content",
|
|
488
|
+
standalone: true,
|
|
489
|
+
imports: [NgTemplateOutlet],
|
|
490
|
+
template: `@if (lazy(); as content) {
|
|
491
|
+
@if (panel.expanded() || visited()) {
|
|
492
|
+
<ng-container [ngTemplateOutlet]="content.template" />
|
|
493
|
+
}
|
|
494
|
+
} @else {
|
|
495
|
+
<ng-content />
|
|
496
|
+
}`,
|
|
497
|
+
host: {
|
|
498
|
+
role: "region",
|
|
499
|
+
"[id]": "panel.id() + '-content'",
|
|
500
|
+
"[attr.aria-labelledby]": "panel.id() + '-header'",
|
|
501
|
+
"[hidden]": "!panel.expanded()"
|
|
502
|
+
},
|
|
503
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
504
|
+
styles: [":host{display:block;padding:0 20px 20px;line-height:1.7;font-size:14px;color:var(--av-accordion-content-color, var(--av-text-muted, #64748b))}:host([hidden]){display:none}\n"]
|
|
505
|
+
}]
|
|
506
|
+
}],
|
|
507
|
+
ctorParameters: () => [],
|
|
508
|
+
propDecorators: { lazy: [{
|
|
509
|
+
type: i0.ContentChild,
|
|
510
|
+
args: [i0.forwardRef(() => AvAccordionLazy), { isSignal: true }]
|
|
511
|
+
}] }
|
|
512
|
+
});
|
|
513
|
+
export { AvAccordion, AvAccordionContent, AvAccordionHeader, AvAccordionLazy, AvAccordionPanel };
|
|
514
|
+
|
|
515
|
+
//# sourceMappingURL=avero-ui-accordion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avero-ui-accordion.mjs","names":[],"sources":["../../../projects/avero-ui/src/lib/accordion/accordion.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n model,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\nexport type AvAccordionKey = string | number;\nexport type AvAccordionValue = AvAccordionKey | readonly AvAccordionKey[] | null;\nexport interface AvAccordionEvent {\n value: AvAccordionKey;\n originalEvent: Event;\n}\n\n@Component({\n selector: 'av-accordion',\n standalone: true,\n template: '<ng-content />',\n styleUrl: './accordion.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AvAccordion {\n readonly inputId = input.required<string>();\n readonly value = model<AvAccordionValue>(null);\n readonly multiple = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly headingLevel = input(3);\n readonly onOpen = output<AvAccordionEvent>();\n readonly onClose = output<AvAccordionEvent>();\n private readonly children = contentChildren<AvAccordionPanel>(\n forwardRef(() => AvAccordionPanel),\n { descendants: true },\n );\n readonly panels = computed(() => this.children().filter((panel) => panel.accordion === this));\n readonly activeValues = computed<readonly AvAccordionKey[]>(() => {\n const value = this.value();\n const keys = value === null ? [] : Array.isArray(value) ? value : [value as AvAccordionKey];\n return this.multiple() ? [...new Set(keys)] : keys.slice(0, 1);\n });\n readonly level = computed(() => Math.max(1, Math.min(6, Math.trunc(this.headingLevel()) || 3)));\n\n toggle(panel: AvAccordionPanel, event: Event): void {\n if (panel.blocked()) return;\n const key = panel.value();\n const previous = this.activeValues();\n const open = previous.includes(key);\n const next = open\n ? previous.filter((item) => item !== key)\n : this.multiple()\n ? [...previous, key]\n : [key];\n this.value.set(this.multiple() ? next : (next[0] ?? null));\n for (const item of previous) {\n if (!next.includes(item)) this.onClose.emit({ value: item, originalEvent: event });\n }\n if (!open) this.onOpen.emit({ value: key, originalEvent: event });\n }\n navigate(panel: AvAccordionPanel, event: KeyboardEvent): void {\n if (panel.blocked() || !['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;\n const enabled = this.panels().filter((item) => !item.blocked());\n const index = enabled.indexOf(panel);\n if (index < 0) return;\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? enabled.length - 1\n : (index + (event.key === 'ArrowDown' ? 1 : -1) + enabled.length) % enabled.length;\n event.preventDefault();\n enabled[next].header()?.focus();\n }\n}\n\n@Component({\n selector: 'av-accordion-panel',\n standalone: true,\n template: '<ng-content />',\n styles:\n ':host { display: block; border-top: 1px solid var(--av-accordion-border, var(--av-border, #dfe7e4)); } :host(:first-of-type) { border-top: 0; }',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AvAccordionPanel {\n readonly accordion = inject(AvAccordion);\n readonly value = input.required<AvAccordionKey>();\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly expanded = computed(() => this.accordion.activeValues().includes(this.value()));\n readonly blocked = computed(() => this.disabled() || this.accordion.disabled());\n readonly header = contentChild<AvAccordionHeader>(forwardRef(() => AvAccordionHeader));\n readonly id = computed(\n () =>\n `${this.accordion.inputId()}-${typeof this.value() === 'number' ? 'n' : 's'}-${encodeURIComponent(String(this.value()))}`,\n );\n}\n\n@Component({\n selector: 'av-accordion-header',\n standalone: true,\n template: `<div role=\"heading\" [attr.aria-level]=\"panel.accordion.level()\">\n <button\n #button\n type=\"button\"\n [id]=\"panel.id() + '-header'\"\n [disabled]=\"panel.blocked()\"\n [attr.aria-expanded]=\"panel.expanded()\"\n [attr.aria-controls]=\"panel.id() + '-content'\"\n (click)=\"panel.accordion.toggle(panel, $event)\"\n (keydown)=\"keydown($event)\"\n >\n <span class=\"label\"><ng-content /></span>\n <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" [class.open]=\"panel.expanded()\">\n <path d=\"m5 3 5 5-5 5\" />\n </svg>\n </button>\n </div>`,\n styleUrl: './accordion-header.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AvAccordionHeader {\n readonly panel = inject(AvAccordionPanel);\n private readonly button = viewChild<ElementRef<HTMLButtonElement>>('button');\n focus(): void {\n this.button()?.nativeElement.focus();\n }\n protected keydown(event: KeyboardEvent): void {\n if (event.target === this.button()?.nativeElement)\n this.panel.accordion.navigate(this.panel, event);\n }\n}\n\n@Directive({ selector: 'ng-template[avAccordionLazy]', standalone: true })\nexport class AvAccordionLazy {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n\n@Component({\n selector: 'av-accordion-content',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `@if (lazy(); as content) {\n @if (panel.expanded() || visited()) {\n <ng-container [ngTemplateOutlet]=\"content.template\" />\n }\n } @else {\n <ng-content />\n }`,\n styles: `\n :host {\n display: block;\n padding: 0 20px 20px;\n line-height: 1.7;\n font-size: 14px;\n color: var(--av-accordion-content-color, var(--av-text-muted, #64748b));\n }\n :host([hidden]) {\n display: none;\n }\n `,\n host: {\n role: 'region',\n '[id]': \"panel.id() + '-content'\",\n '[attr.aria-labelledby]': \"panel.id() + '-header'\",\n '[hidden]': '!panel.expanded()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AvAccordionContent {\n readonly panel = inject(AvAccordionPanel);\n protected readonly lazy = contentChild(AvAccordionLazy);\n protected readonly visited = signal(false);\n constructor() {\n effect(() => {\n if (this.panel.expanded()) this.visited.set(true);\n });\n }\n}\n"],"mappings":";;;AAmCA,IAAa,cAAb,MAAa,YAAW;CACb,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,QAAQ,MAAwB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACrC,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACrD,eAAe,MAAM,GAAE,GA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