@memberjunction/ng-ui-components 6.2.1 → 6.3.0-edge.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/README.md +28 -4
- package/dist/lib/accordion/accordion-sections.component.d.ts +51 -0
- package/dist/lib/accordion/accordion-sections.component.d.ts.map +1 -0
- package/dist/lib/accordion/accordion-sections.component.js +138 -0
- package/dist/lib/accordion/accordion-sections.component.js.map +1 -0
- package/dist/lib/accordion/accordion.component.d.ts +53 -4
- package/dist/lib/accordion/accordion.component.d.ts.map +1 -1
- package/dist/lib/accordion/accordion.component.js +233 -68
- package/dist/lib/accordion/accordion.component.js.map +1 -1
- package/dist/lib/accordion/accordion.scss +76 -0
- package/dist/lib/combobox/combobox.component.d.ts +1 -1
- package/dist/lib/combobox/combobox.component.js +1 -1
- package/dist/lib/combobox/combobox.component.js.map +1 -1
- package/dist/lib/confirm-dialog/confirm-dialog.component.d.ts.map +1 -1
- package/dist/lib/confirm-dialog/confirm-dialog.component.js +6 -2
- package/dist/lib/confirm-dialog/confirm-dialog.component.js.map +1 -1
- package/dist/lib/datepicker/datepicker.component.d.ts +1 -1
- package/dist/lib/datepicker/datepicker.component.js +1 -1
- package/dist/lib/datepicker/datepicker.component.js.map +1 -1
- package/dist/lib/dialog/dialog.component.d.ts +15 -6
- package/dist/lib/dialog/dialog.component.d.ts.map +1 -1
- package/dist/lib/dialog/dialog.component.js +34 -13
- package/dist/lib/dialog/dialog.component.js.map +1 -1
- package/dist/lib/dialog/dialog.scss +82 -6
- package/dist/lib/dialog/dialog.service.d.ts +3 -3
- package/dist/lib/dialog/dialog.service.js +3 -3
- package/dist/lib/dialog/dialog.service.js.map +1 -1
- package/dist/lib/dropdown/dropdown.component.d.ts +0 -1
- package/dist/lib/dropdown/dropdown.component.d.ts.map +1 -1
- package/dist/lib/dropdown/dropdown.component.js +1 -2
- package/dist/lib/dropdown/dropdown.component.js.map +1 -1
- package/dist/lib/filter-panel/filter-panel.component.d.ts.map +1 -1
- package/dist/lib/filter-panel/filter-panel.component.js +5 -4
- package/dist/lib/filter-panel/filter-panel.component.js.map +1 -1
- package/dist/lib/input/chip.scss +1 -1
- package/dist/lib/input/input.scss +4 -4
- package/dist/lib/numeric-input/numeric-input.component.d.ts +1 -1
- package/dist/lib/numeric-input/numeric-input.component.js +1 -1
- package/dist/lib/numeric-input/numeric-input.component.js.map +1 -1
- package/dist/lib/progress-bar/progress-bar.component.d.ts +1 -1
- package/dist/lib/progress-bar/progress-bar.component.js +1 -1
- package/dist/lib/progress-bar/progress-bar.component.js.map +1 -1
- package/dist/lib/section-picker/section-picker.component.d.ts +108 -0
- package/dist/lib/section-picker/section-picker.component.d.ts.map +1 -0
- package/dist/lib/section-picker/section-picker.component.js +429 -0
- package/dist/lib/section-picker/section-picker.component.js.map +1 -0
- package/dist/lib/splitter/splitter.component.d.ts +2 -5
- package/dist/lib/splitter/splitter.component.d.ts.map +1 -1
- package/dist/lib/splitter/splitter.component.js +2 -5
- package/dist/lib/splitter/splitter.component.js.map +1 -1
- package/dist/lib/switch/switch.component.d.ts +1 -1
- package/dist/lib/switch/switch.component.js +1 -1
- package/dist/lib/switch/switch.component.js.map +1 -1
- package/dist/lib/viewport/phone-viewport.d.ts +15 -0
- package/dist/lib/viewport/phone-viewport.d.ts.map +1 -0
- package/dist/lib/viewport/phone-viewport.js +29 -0
- package/dist/lib/viewport/phone-viewport.js.map +1 -0
- package/dist/lib/window/window.component.d.ts +3 -3
- package/dist/lib/window/window.component.js +3 -3
- package/dist/lib/window/window.component.js.map +1 -1
- package/dist/lib/window/window.scss +43 -4
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,65 +1,105 @@
|
|
|
1
|
-
import { Component, Input, Output, EventEmitter, HostBinding, ContentChild, Directive, NgModule } from '@angular/core';
|
|
1
|
+
import { Component, Input, Output, EventEmitter, HostBinding, ContentChild, Directive, NgModule, ChangeDetectorRef, ElementRef, inject } from '@angular/core';
|
|
2
2
|
import { NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
const _c0 = ["*"];
|
|
5
5
|
function MJAccordionPanelComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
-
i0.ɵɵelementStart(0, "div",
|
|
7
|
-
i0.ɵɵelementContainer(
|
|
6
|
+
i0.ɵɵelementStart(0, "div", 4)(1, "span", 13);
|
|
7
|
+
i0.ɵɵelementContainer(2, 7);
|
|
8
|
+
i0.ɵɵelementEnd()();
|
|
9
|
+
} if (rf & 2) {
|
|
10
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
|
+
const titleContent_r2 = i0.ɵɵreference(16);
|
|
12
|
+
i0.ɵɵproperty("id", ctx_r0.HeaderId);
|
|
13
|
+
i0.ɵɵattribute("aria-level", ctx_r0.HeadingLevel ?? 3);
|
|
14
|
+
i0.ɵɵadvance(2);
|
|
15
|
+
i0.ɵɵproperty("ngTemplateOutlet", titleContent_r2);
|
|
16
|
+
} }
|
|
17
|
+
function MJAccordionPanelComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵelementStart(0, "span", 5);
|
|
19
|
+
i0.ɵɵelementContainer(1, 7);
|
|
8
20
|
i0.ɵɵelementEnd();
|
|
9
21
|
} if (rf & 2) {
|
|
10
22
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
|
-
const
|
|
23
|
+
const titleContent_r2 = i0.ɵɵreference(16);
|
|
24
|
+
i0.ɵɵproperty("id", ctx_r0.HeaderId);
|
|
25
|
+
i0.ɵɵadvance();
|
|
26
|
+
i0.ɵɵproperty("ngTemplateOutlet", titleContent_r2);
|
|
27
|
+
} }
|
|
28
|
+
function MJAccordionPanelComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelementStart(0, "div", 6);
|
|
30
|
+
i0.ɵɵelementContainer(1, 7);
|
|
31
|
+
i0.ɵɵelementEnd();
|
|
32
|
+
} if (rf & 2) {
|
|
33
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
34
|
+
const toggleButton_r3 = i0.ɵɵreference(14);
|
|
12
35
|
i0.ɵɵattribute("aria-level", ctx_r0.HeadingLevel);
|
|
13
36
|
i0.ɵɵadvance();
|
|
14
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
37
|
+
i0.ɵɵproperty("ngTemplateOutlet", toggleButton_r3);
|
|
15
38
|
} }
|
|
16
|
-
function
|
|
17
|
-
i0.ɵɵelementContainer(0,
|
|
39
|
+
function MJAccordionPanelComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵelementContainer(0, 7);
|
|
18
41
|
} if (rf & 2) {
|
|
19
42
|
i0.ɵɵnextContext();
|
|
20
|
-
const
|
|
21
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
43
|
+
const toggleButton_r3 = i0.ɵɵreference(14);
|
|
44
|
+
i0.ɵɵproperty("ngTemplateOutlet", toggleButton_r3);
|
|
22
45
|
} }
|
|
23
|
-
function
|
|
24
|
-
i0.ɵɵelementStart(0, "div",
|
|
25
|
-
i0.ɵɵelementContainer(1,
|
|
46
|
+
function MJAccordionPanelComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵelementStart(0, "div", 8);
|
|
48
|
+
i0.ɵɵelementContainer(1, 7);
|
|
26
49
|
i0.ɵɵelementEnd();
|
|
27
50
|
} if (rf & 2) {
|
|
28
51
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
29
52
|
i0.ɵɵadvance();
|
|
30
53
|
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.actionsTemplate.templateRef);
|
|
31
54
|
} }
|
|
32
|
-
function
|
|
33
|
-
i0.ɵɵ
|
|
55
|
+
function MJAccordionPanelComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
56
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
57
|
+
i0.ɵɵelementStart(0, "button", 14);
|
|
58
|
+
i0.ɵɵlistener("click", function MJAccordionPanelComponent_Conditional_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Toggle()); });
|
|
59
|
+
i0.ɵɵelement(1, "i", 15);
|
|
60
|
+
i0.ɵɵelementEnd();
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
63
|
+
i0.ɵɵproperty("disabled", ctx_r0.Disabled);
|
|
64
|
+
} }
|
|
65
|
+
function MJAccordionPanelComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
+
i0.ɵɵelementContainer(0, 7);
|
|
34
67
|
} if (rf & 2) {
|
|
35
68
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
36
69
|
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.bodyTemplate.templateRef);
|
|
37
70
|
} }
|
|
38
|
-
function
|
|
39
|
-
i0.ɵɵ
|
|
71
|
+
function MJAccordionPanelComponent_ng_template_13_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
73
|
+
i0.ɵɵelementStart(0, "button", 16);
|
|
74
|
+
i0.ɵɵlistener("click", function MJAccordionPanelComponent_ng_template_13_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Toggle()); });
|
|
75
|
+
i0.ɵɵelementStart(1, "span", 13);
|
|
76
|
+
i0.ɵɵelementContainer(2, 7);
|
|
77
|
+
i0.ɵɵelementEnd()();
|
|
78
|
+
} if (rf & 2) {
|
|
79
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
80
|
+
const titleContent_r2 = i0.ɵɵreference(16);
|
|
81
|
+
i0.ɵɵproperty("id", ctx_r0.HeaderId)("disabled", ctx_r0.Disabled);
|
|
82
|
+
i0.ɵɵattribute("aria-expanded", ctx_r0.Expanded)("aria-controls", ctx_r0.BodyId);
|
|
83
|
+
i0.ɵɵadvance(2);
|
|
84
|
+
i0.ɵɵproperty("ngTemplateOutlet", titleContent_r2);
|
|
85
|
+
} }
|
|
86
|
+
function MJAccordionPanelComponent_ng_template_15_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
87
|
+
i0.ɵɵelementContainer(0, 7);
|
|
40
88
|
} if (rf & 2) {
|
|
41
89
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
42
90
|
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.TitleTemplate.templateRef);
|
|
43
91
|
} }
|
|
44
|
-
function
|
|
92
|
+
function MJAccordionPanelComponent_ng_template_15_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
45
93
|
i0.ɵɵtext(0);
|
|
46
94
|
} if (rf & 2) {
|
|
47
95
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
48
96
|
i0.ɵɵtextInterpolate1(" ", ctx_r0.Title, " ");
|
|
49
97
|
} }
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
i0.ɵɵelementStart(0, "button", 11);
|
|
53
|
-
i0.ɵɵlistener("click", function MJAccordionPanelComponent_ng_template_12_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Toggle()); });
|
|
54
|
-
i0.ɵɵelementStart(1, "span", 12);
|
|
55
|
-
i0.ɵɵconditionalCreate(2, MJAccordionPanelComponent_ng_template_12_Conditional_2_Template, 1, 1, "ng-container", 4)(3, MJAccordionPanelComponent_ng_template_12_Conditional_3_Template, 1, 1);
|
|
56
|
-
i0.ɵɵelementEnd()();
|
|
98
|
+
function MJAccordionPanelComponent_ng_template_15_Template(rf, ctx) { if (rf & 1) {
|
|
99
|
+
i0.ɵɵconditionalCreate(0, MJAccordionPanelComponent_ng_template_15_Conditional_0_Template, 1, 1, "ng-container", 7)(1, MJAccordionPanelComponent_ng_template_15_Conditional_1_Template, 1, 1);
|
|
57
100
|
} if (rf & 2) {
|
|
58
101
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
59
|
-
i0.ɵɵ
|
|
60
|
-
i0.ɵɵattribute("aria-expanded", ctx_r0.Expanded)("aria-controls", ctx_r0.BodyId);
|
|
61
|
-
i0.ɵɵadvance(2);
|
|
62
|
-
i0.ɵɵconditional(ctx_r0.TitleTemplate ? 2 : 3);
|
|
102
|
+
i0.ɵɵconditional(ctx_r0.TitleTemplate ? 0 : 1);
|
|
63
103
|
} }
|
|
64
104
|
/** Process-wide counter for generating unique, stable accordion element ids
|
|
65
105
|
* (used to wire `aria-controls` / `aria-labelledby` between header and body). */
|
|
@@ -162,7 +202,7 @@ export class MJAccordionBodyDirective {
|
|
|
162
202
|
}]
|
|
163
203
|
}], () => [{ type: i0.TemplateRef }], null); })();
|
|
164
204
|
/**
|
|
165
|
-
* mj-accordion-panel — Collapsible panel.
|
|
205
|
+
* mj-accordion-panel — Collapsible panel.
|
|
166
206
|
*
|
|
167
207
|
* Supports two title modes:
|
|
168
208
|
* - Simple string: `[Title]="'Details'"` — plain text title
|
|
@@ -185,6 +225,11 @@ export class MJAccordionBodyDirective {
|
|
|
185
225
|
* ```
|
|
186
226
|
*/
|
|
187
227
|
export class MJAccordionPanelComponent {
|
|
228
|
+
cdr = inject(ChangeDetectorRef);
|
|
229
|
+
el = inject(ElementRef);
|
|
230
|
+
/** The panel this one is nested in, if any; a panel inside a flat panel renders flat too. */
|
|
231
|
+
parentPanel = inject(MJAccordionPanelComponent, { optional: true, skipSelf: true });
|
|
232
|
+
childPanels = new Set();
|
|
188
233
|
Title = '';
|
|
189
234
|
_expanded = false;
|
|
190
235
|
/** Latches true the first time the panel is expanded; never resets. Lets a
|
|
@@ -254,6 +299,20 @@ export class MJAccordionPanelComponent {
|
|
|
254
299
|
* fills rather than animating to content height).
|
|
255
300
|
*/
|
|
256
301
|
Fill = false;
|
|
302
|
+
/**
|
|
303
|
+
* Flat — render as a plain headed block: the title is a heading, the body is always open,
|
|
304
|
+
* and there is no toggle, border or body padding. Panels nested inside a flat panel, or
|
|
305
|
+
* inside the active section of an `mj-accordion-sections`, render this way automatically.
|
|
306
|
+
*/
|
|
307
|
+
Flat = false;
|
|
308
|
+
/** Stable key for this panel in an `mj-accordion-sections`; falls back to its position. */
|
|
309
|
+
SectionKey = null;
|
|
310
|
+
/** The name the section picker shows; falls back to `Title`, then the rendered title text. */
|
|
311
|
+
SectionTitle = null;
|
|
312
|
+
/** Font Awesome class string for the section picker row. */
|
|
313
|
+
SectionIcon = null;
|
|
314
|
+
/** Count shown on the section picker row. */
|
|
315
|
+
SectionCount = null;
|
|
257
316
|
ExpandedChange = new EventEmitter();
|
|
258
317
|
TitleTemplate = null;
|
|
259
318
|
/** @deprecated Use {@link TitleTemplate}. */
|
|
@@ -301,6 +360,88 @@ export class MJAccordionPanelComponent {
|
|
|
301
360
|
this.Expanded = !this.Expanded;
|
|
302
361
|
this.ExpandedChange.emit(this.Expanded);
|
|
303
362
|
}
|
|
363
|
+
// ---------------------------------------------------------------- flat / sections
|
|
364
|
+
sectionMode = false;
|
|
365
|
+
sectionHidden = false;
|
|
366
|
+
parentFlat = false;
|
|
367
|
+
parentShown = true;
|
|
368
|
+
/** `section`: the active top level of an mj-accordion-sections; `block`: a flat nested panel. */
|
|
369
|
+
get FlatMode() {
|
|
370
|
+
if (this.sectionMode)
|
|
371
|
+
return 'section';
|
|
372
|
+
if (this.Flat || this.parentFlat)
|
|
373
|
+
return 'block';
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
/** Hidden because another section of an `mj-accordion-sections` is active. */
|
|
377
|
+
get IsSectionHidden() {
|
|
378
|
+
return this.sectionMode && this.sectionHidden;
|
|
379
|
+
}
|
|
380
|
+
/** On screen in a flat presentation: an active section, or a block whose parent is on screen. */
|
|
381
|
+
get IsShownFlat() {
|
|
382
|
+
if (this.sectionMode)
|
|
383
|
+
return !this.sectionHidden;
|
|
384
|
+
return this.parentFlat ? this.parentShown : true;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Open because it is flat and on screen. A hidden section (or a block inside one) is not, so its
|
|
388
|
+
* lazy body is not built until that section is picked; once picked it stays built (it was
|
|
389
|
+
* expanded then), so switching away and back keeps its state.
|
|
390
|
+
*/
|
|
391
|
+
get IsOpenFlat() {
|
|
392
|
+
return this.FlatMode !== null && this.IsShownFlat;
|
|
393
|
+
}
|
|
394
|
+
/** The name the section picker shows for this panel. */
|
|
395
|
+
ResolvedSectionTitle() {
|
|
396
|
+
if (this.SectionTitle)
|
|
397
|
+
return this.SectionTitle;
|
|
398
|
+
if (this.Title)
|
|
399
|
+
return this.Title;
|
|
400
|
+
const t = this.el.nativeElement.querySelector(':scope > .mj-accordion-panel > .mj-accordion-header-row .mj-accordion-title, :scope > .mj-accordion-panel > .mj-accordion-header-row .mj-accordion-section-label');
|
|
401
|
+
return (t?.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Called by `mj-accordion-sections`. Enabled, this panel becomes a section: shown and flat
|
|
405
|
+
* when active, hidden otherwise. Opening it emits ExpandedChange(true) once, like a click,
|
|
406
|
+
* so a body that loads on first expand still loads.
|
|
407
|
+
*/
|
|
408
|
+
SetSectionState(enabled, active) {
|
|
409
|
+
this.sectionMode = enabled;
|
|
410
|
+
this.sectionHidden = enabled && !active;
|
|
411
|
+
this.syncFlatState();
|
|
412
|
+
}
|
|
413
|
+
ngOnInit() {
|
|
414
|
+
if (!this.parentPanel)
|
|
415
|
+
return;
|
|
416
|
+
this.parentPanel.childPanels.add(this);
|
|
417
|
+
this.setParentFlat(this.parentPanel.FlatMode !== null, this.parentPanel.IsShownFlat);
|
|
418
|
+
}
|
|
419
|
+
ngOnDestroy() {
|
|
420
|
+
this.parentPanel?.childPanels.delete(this);
|
|
421
|
+
}
|
|
422
|
+
setParentFlat(flat, shown) {
|
|
423
|
+
this.parentFlat = flat;
|
|
424
|
+
this.parentShown = shown;
|
|
425
|
+
this.syncFlatState();
|
|
426
|
+
}
|
|
427
|
+
syncFlatState() {
|
|
428
|
+
if (this.FlatMode !== null && this.IsShownFlat)
|
|
429
|
+
this.openForFlat();
|
|
430
|
+
const flat = this.FlatMode !== null;
|
|
431
|
+
const shown = this.IsShownFlat;
|
|
432
|
+
for (const child of this.childPanels)
|
|
433
|
+
child.setParentFlat(flat, shown);
|
|
434
|
+
this.cdr.markForCheck();
|
|
435
|
+
}
|
|
436
|
+
/** Opens the panel for a flat presentation and reports it the way a click would. */
|
|
437
|
+
openForFlat() {
|
|
438
|
+
if (this._expanded)
|
|
439
|
+
return;
|
|
440
|
+
this.Expanded = true;
|
|
441
|
+
// After the current change-detection pass, so a listener that updates bound state does not
|
|
442
|
+
// change it mid-check.
|
|
443
|
+
queueMicrotask(() => this.ExpandedChange.emit(true));
|
|
444
|
+
}
|
|
304
445
|
static ɵfac = function MJAccordionPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJAccordionPanelComponent)(); };
|
|
305
446
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJAccordionPanelComponent, selectors: [["mj-accordion-panel"]], contentQueries: function MJAccordionPanelComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
|
|
306
447
|
i0.ɵɵcontentQuery(dirIndex, MJAccordionTitleDirective, 5)(dirIndex, MJAccordionActionsDirective, 5)(dirIndex, MJAccordionBodyDirective, 5);
|
|
@@ -309,38 +450,36 @@ export class MJAccordionPanelComponent {
|
|
|
309
450
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.TitleTemplate = _t.first);
|
|
310
451
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ActionsTemplate = _t.first);
|
|
311
452
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.BodyTemplate = _t.first);
|
|
312
|
-
} }, hostVars:
|
|
313
|
-
i0.ɵɵclassProp("mj-accordion-panel-host", ctx.hostClass)("mj-accordion-fill-active", ctx.fillActive);
|
|
314
|
-
} }, inputs: { Title: "Title", Expanded: "Expanded", Disabled: "Disabled", Variant: "Variant", TitleIconMuted: "TitleIconMuted", Size: "Size", Bare: "Bare", HeadingLevel: "HeadingLevel", FlushBody: "FlushBody", Fill: "Fill" }, outputs: { ExpandedChange: "ExpandedChange" }, ngContentSelectors: _c0, decls:
|
|
453
|
+
} }, hostVars: 6, hostBindings: function MJAccordionPanelComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
454
|
+
i0.ɵɵclassProp("mj-accordion-panel-host", ctx.hostClass)("mj-accordion-fill-active", ctx.fillActive)("mj-accordion-section-hidden", ctx.IsSectionHidden);
|
|
455
|
+
} }, inputs: { Title: "Title", Expanded: "Expanded", Disabled: "Disabled", Variant: "Variant", TitleIconMuted: "TitleIconMuted", Size: "Size", Bare: "Bare", HeadingLevel: "HeadingLevel", FlushBody: "FlushBody", Fill: "Fill", Flat: "Flat", SectionKey: "SectionKey", SectionTitle: "SectionTitle", SectionIcon: "SectionIcon", SectionCount: "SectionCount" }, outputs: { ExpandedChange: "ExpandedChange" }, ngContentSelectors: _c0, decls: 17, vars: 26, consts: [["toggleButton", ""], ["titleContent", ""], [1, "mj-accordion-panel"], [1, "mj-accordion-header-row"], ["role", "heading", 1, "mj-accordion-flat-heading", 3, "id"], [1, "mj-accordion-section-label", 3, "id"], ["role", "heading", 1, "mj-accordion-heading"], [3, "ngTemplateOutlet"], [1, "mj-accordion-actions"], ["type", "button", "tabindex", "-1", "aria-hidden", "true", 1, "mj-accordion-chevron", 3, "disabled"], [1, "mj-accordion-body-outer"], [1, "mj-accordion-body-clip"], ["role", "region", 1, "mj-accordion-body", 3, "id"], [1, "mj-accordion-title"], ["type", "button", "tabindex", "-1", "aria-hidden", "true", 1, "mj-accordion-chevron", 3, "click", "disabled"], [1, "fa-solid", "fa-chevron-down", "mj-accordion-icon"], ["type", "button", 1, "mj-accordion-header", 3, "click", "id", "disabled"]], template: function MJAccordionPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
315
456
|
i0.ɵɵprojectionDef();
|
|
316
|
-
i0.ɵɵelementStart(0, "div",
|
|
317
|
-
i0.ɵɵconditionalCreate(2, MJAccordionPanelComponent_Conditional_2_Template,
|
|
318
|
-
i0.ɵɵconditionalCreate(
|
|
319
|
-
i0.ɵɵ
|
|
320
|
-
i0.ɵɵ
|
|
321
|
-
i0.ɵɵ
|
|
322
|
-
i0.ɵɵ
|
|
323
|
-
i0.ɵɵ
|
|
324
|
-
i0.ɵɵprojection(10);
|
|
325
|
-
i0.ɵɵconditionalCreate(11, MJAccordionPanelComponent_Conditional_11_Template, 1, 1, "ng-container", 4);
|
|
457
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "div", 3);
|
|
458
|
+
i0.ɵɵconditionalCreate(2, MJAccordionPanelComponent_Conditional_2_Template, 3, 3, "div", 4)(3, MJAccordionPanelComponent_Conditional_3_Template, 2, 2, "span", 5)(4, MJAccordionPanelComponent_Conditional_4_Template, 2, 2, "div", 6)(5, MJAccordionPanelComponent_Conditional_5_Template, 1, 1, "ng-container", 7);
|
|
459
|
+
i0.ɵɵconditionalCreate(6, MJAccordionPanelComponent_Conditional_6_Template, 2, 1, "div", 8);
|
|
460
|
+
i0.ɵɵconditionalCreate(7, MJAccordionPanelComponent_Conditional_7_Template, 2, 1, "button", 9);
|
|
461
|
+
i0.ɵɵelementEnd();
|
|
462
|
+
i0.ɵɵelementStart(8, "div", 10)(9, "div", 11)(10, "div", 12);
|
|
463
|
+
i0.ɵɵprojection(11);
|
|
464
|
+
i0.ɵɵconditionalCreate(12, MJAccordionPanelComponent_Conditional_12_Template, 1, 1, "ng-container", 7);
|
|
326
465
|
i0.ɵɵelementEnd()()()();
|
|
327
|
-
i0.ɵɵtemplate(
|
|
466
|
+
i0.ɵɵtemplate(13, MJAccordionPanelComponent_ng_template_13_Template, 3, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(15, MJAccordionPanelComponent_ng_template_15_Template, 2, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
|
|
328
467
|
} if (rf & 2) {
|
|
329
|
-
i0.ɵɵclassProp("mj-accordion-panel--expanded", ctx.Expanded)("mj-accordion-panel--disabled", ctx.Disabled)("mj-accordion-panel--muted-icon", ctx.TitleIconMuted)("mj-accordion-panel--sm", ctx.Size === "sm")("mj-accordion-panel--bare", ctx.Bare)("mj-accordion-panel--flush-body", ctx.FlushBody)("mj-accordion-panel--fill", ctx.Fill);
|
|
468
|
+
i0.ɵɵclassProp("mj-accordion-panel--expanded", ctx.Expanded || ctx.IsOpenFlat)("mj-accordion-panel--disabled", ctx.Disabled)("mj-accordion-panel--flat-section", ctx.FlatMode === "section")("mj-accordion-panel--flat-block", ctx.FlatMode === "block")("mj-accordion-panel--muted-icon", ctx.TitleIconMuted)("mj-accordion-panel--sm", ctx.Size === "sm")("mj-accordion-panel--bare", ctx.Bare)("mj-accordion-panel--flush-body", ctx.FlushBody)("mj-accordion-panel--fill", ctx.Fill);
|
|
330
469
|
i0.ɵɵattribute("data-variant", ctx.Variant !== "default" ? ctx.Variant : null);
|
|
331
470
|
i0.ɵɵadvance(2);
|
|
332
|
-
i0.ɵɵconditional(ctx.
|
|
333
|
-
i0.ɵɵadvance(
|
|
334
|
-
i0.ɵɵconditional(ctx.actionsTemplate ?
|
|
471
|
+
i0.ɵɵconditional(ctx.FlatMode === "block" ? 2 : ctx.FlatMode === "section" ? 3 : ctx.HeadingLevel ? 4 : 5);
|
|
472
|
+
i0.ɵɵadvance(4);
|
|
473
|
+
i0.ɵɵconditional(ctx.actionsTemplate ? 6 : -1);
|
|
335
474
|
i0.ɵɵadvance();
|
|
336
|
-
i0.ɵɵ
|
|
337
|
-
i0.ɵɵadvance(
|
|
338
|
-
i0.ɵɵattribute("inert", ctx.Expanded ? null : "");
|
|
475
|
+
i0.ɵɵconditional(ctx.FlatMode === null ? 7 : -1);
|
|
476
|
+
i0.ɵɵadvance();
|
|
477
|
+
i0.ɵɵattribute("inert", ctx.Expanded || ctx.IsOpenFlat ? null : "");
|
|
339
478
|
i0.ɵɵadvance(2);
|
|
340
479
|
i0.ɵɵproperty("id", ctx.BodyId);
|
|
341
480
|
i0.ɵɵattribute("aria-labelledby", ctx.HeaderId);
|
|
342
481
|
i0.ɵɵadvance(2);
|
|
343
|
-
i0.ɵɵconditional(ctx.bodyTemplate && (ctx.Expanded || ctx.hasBeenExpanded) ?
|
|
482
|
+
i0.ɵɵconditional(ctx.bodyTemplate && (ctx.Expanded || ctx.hasBeenExpanded || ctx.IsOpenFlat) ? 12 : -1);
|
|
344
483
|
} }, dependencies: [NgTemplateOutlet], encapsulation: 2 });
|
|
345
484
|
}
|
|
346
485
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJAccordionPanelComponent, [{
|
|
@@ -350,7 +489,9 @@ export class MJAccordionPanelComponent {
|
|
|
350
489
|
standalone: true,
|
|
351
490
|
imports: [NgTemplateOutlet],
|
|
352
491
|
template: `
|
|
353
|
-
<div class="mj-accordion-panel" [class.mj-accordion-panel--expanded]="Expanded" [class.mj-accordion-panel--disabled]="Disabled"
|
|
492
|
+
<div class="mj-accordion-panel" [class.mj-accordion-panel--expanded]="Expanded || IsOpenFlat" [class.mj-accordion-panel--disabled]="Disabled"
|
|
493
|
+
[class.mj-accordion-panel--flat-section]="FlatMode === 'section'"
|
|
494
|
+
[class.mj-accordion-panel--flat-block]="FlatMode === 'block'"
|
|
354
495
|
[class.mj-accordion-panel--muted-icon]="TitleIconMuted"
|
|
355
496
|
[class.mj-accordion-panel--sm]="Size === 'sm'"
|
|
356
497
|
[class.mj-accordion-panel--bare]="Bare"
|
|
@@ -358,8 +499,16 @@ export class MJAccordionPanelComponent {
|
|
|
358
499
|
[class.mj-accordion-panel--fill]="Fill"
|
|
359
500
|
[attr.data-variant]="Variant !== 'default' ? Variant : null">
|
|
360
501
|
<div class="mj-accordion-header-row">
|
|
361
|
-
|
|
362
|
-
|
|
502
|
+
@if (FlatMode === 'block') {
|
|
503
|
+
<!-- Flat block: the title is a plain heading over always-open content, no toggle. -->
|
|
504
|
+
<div class="mj-accordion-flat-heading" role="heading" [attr.aria-level]="HeadingLevel ?? 3" [id]="HeaderId">
|
|
505
|
+
<span class="mj-accordion-title"><ng-container [ngTemplateOutlet]="titleContent"></ng-container></span>
|
|
506
|
+
</div>
|
|
507
|
+
} @else if (FlatMode === 'section') {
|
|
508
|
+
<!-- Flat section: the section picker names it on screen; keep the name for the region. -->
|
|
509
|
+
<span class="mj-accordion-section-label" [id]="HeaderId"><ng-container [ngTemplateOutlet]="titleContent"></ng-container></span>
|
|
510
|
+
} @else if (HeadingLevel) {
|
|
511
|
+
<!-- With HeadingLevel set, a heading wraps the toggle; without it, the toggle is a direct child of the row. -->
|
|
363
512
|
<div class="mj-accordion-heading" role="heading" [attr.aria-level]="HeadingLevel">
|
|
364
513
|
<ng-container [ngTemplateOutlet]="toggleButton"></ng-container>
|
|
365
514
|
</div>
|
|
@@ -374,19 +523,21 @@ export class MJAccordionPanelComponent {
|
|
|
374
523
|
<!-- The chevron is ALWAYS the rightmost element of the header row (after any
|
|
375
524
|
actions). It's a secondary, a11y-hidden toggle affordance — the primary
|
|
376
525
|
disclosure control is the title button above (which owns aria-expanded). -->
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
526
|
+
@if (FlatMode === null) {
|
|
527
|
+
<button class="mj-accordion-chevron" type="button" tabindex="-1" aria-hidden="true"
|
|
528
|
+
[disabled]="Disabled" (click)="Toggle()">
|
|
529
|
+
<i class="fa-solid fa-chevron-down mj-accordion-icon"></i>
|
|
530
|
+
</button>
|
|
531
|
+
}
|
|
381
532
|
</div>
|
|
382
|
-
<div class="mj-accordion-body-outer" [attr.inert]="Expanded ? null : ''">
|
|
533
|
+
<div class="mj-accordion-body-outer" [attr.inert]="Expanded || IsOpenFlat ? null : ''">
|
|
383
534
|
<div class="mj-accordion-body-clip">
|
|
384
535
|
<div class="mj-accordion-body" role="region" [id]="BodyId" [attr.aria-labelledby]="HeaderId">
|
|
385
536
|
<!-- Legacy: content placed directly in the panel (eager). -->
|
|
386
537
|
<ng-content></ng-content>
|
|
387
538
|
<!-- Preferred: [mjAccordionBody] template — instantiated lazily on first
|
|
388
539
|
expand, then kept alive so later toggles still animate. -->
|
|
389
|
-
@if (bodyTemplate && (Expanded || hasBeenExpanded)) {
|
|
540
|
+
@if (bodyTemplate && (Expanded || hasBeenExpanded || IsOpenFlat)) {
|
|
390
541
|
<ng-container [ngTemplateOutlet]="bodyTemplate.templateRef"></ng-container>
|
|
391
542
|
}
|
|
392
543
|
</div>
|
|
@@ -401,15 +552,16 @@ export class MJAccordionPanelComponent {
|
|
|
401
552
|
[attr.aria-controls]="BodyId"
|
|
402
553
|
[disabled]="Disabled"
|
|
403
554
|
(click)="Toggle()">
|
|
404
|
-
<span class="mj-accordion-title">
|
|
405
|
-
@if (TitleTemplate) {
|
|
406
|
-
<ng-container [ngTemplateOutlet]="TitleTemplate.templateRef"></ng-container>
|
|
407
|
-
} @else {
|
|
408
|
-
{{ Title }}
|
|
409
|
-
}
|
|
410
|
-
</span>
|
|
555
|
+
<span class="mj-accordion-title"><ng-container [ngTemplateOutlet]="titleContent"></ng-container></span>
|
|
411
556
|
</button>
|
|
412
557
|
</ng-template>
|
|
558
|
+
<ng-template #titleContent>
|
|
559
|
+
@if (TitleTemplate) {
|
|
560
|
+
<ng-container [ngTemplateOutlet]="TitleTemplate.templateRef"></ng-container>
|
|
561
|
+
} @else {
|
|
562
|
+
{{ Title }}
|
|
563
|
+
}
|
|
564
|
+
</ng-template>
|
|
413
565
|
`
|
|
414
566
|
}]
|
|
415
567
|
}], null, { Title: [{
|
|
@@ -432,6 +584,16 @@ export class MJAccordionPanelComponent {
|
|
|
432
584
|
type: Input
|
|
433
585
|
}], Fill: [{
|
|
434
586
|
type: Input
|
|
587
|
+
}], Flat: [{
|
|
588
|
+
type: Input
|
|
589
|
+
}], SectionKey: [{
|
|
590
|
+
type: Input
|
|
591
|
+
}], SectionTitle: [{
|
|
592
|
+
type: Input
|
|
593
|
+
}], SectionIcon: [{
|
|
594
|
+
type: Input
|
|
595
|
+
}], SectionCount: [{
|
|
596
|
+
type: Input
|
|
435
597
|
}], ExpandedChange: [{
|
|
436
598
|
type: Output
|
|
437
599
|
}], TitleTemplate: [{
|
|
@@ -449,8 +611,11 @@ export class MJAccordionPanelComponent {
|
|
|
449
611
|
}], fillActive: [{
|
|
450
612
|
type: HostBinding,
|
|
451
613
|
args: ['class.mj-accordion-fill-active']
|
|
614
|
+
}], IsSectionHidden: [{
|
|
615
|
+
type: HostBinding,
|
|
616
|
+
args: ['class.mj-accordion-section-hidden']
|
|
452
617
|
}] }); })();
|
|
453
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJAccordionPanelComponent, { className: "MJAccordionPanelComponent", filePath: "lib/accordion/accordion.component.ts", lineNumber:
|
|
618
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJAccordionPanelComponent, { className: "MJAccordionPanelComponent", filePath: "lib/accordion/accordion.component.ts", lineNumber: 187 }); })();
|
|
454
619
|
/**
|
|
455
620
|
* Convenience module bundling the accordion panel + all of its slot directives.
|
|
456
621
|
* Import this ONE symbol instead of listing the component and each directive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.component.js","sourceRoot":"","sources":["../../../src/lib/accordion/accordion.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAe,SAAS,EAAE,QAAQ,EA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BAAyB;oBACzB,2BAA2B;oBAC3B,wBAAwB;iBACzB;aACF;;wFACY,iBAAiB,cA1JjB,yBAAyB,EAnJzB,yBAAyB,EA0BzB,2BAA2B,EA2B3B,wBAAwB,aA8FxB,yBAAyB,EAnJzB,yBAAyB,EA0BzB,2BAA2B,EA2B3B,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, HostBinding, ContentChild, TemplateRef, Directive, NgModule } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/** Process-wide counter for generating unique, stable accordion element ids\n * (used to wire `aria-controls` / `aria-labelledby` between header and body). */\nlet nextAccordionUid = 0;\n\n/**\n * Directive to mark a template as the accordion panel title.\n * Supports rich HTML content (icons, badges, dynamic text).\n *\n * @example\n * ```html\n * <mj-accordion-panel [Expanded]=\"true\">\n * <ng-template mjAccordionTitle>\n * <i class=\"fa-solid fa-code\"></i> Template Editor\n * <span class=\"badge\">3</span>\n * </ng-template>\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionTitle]',\n standalone: true\n})\nexport class MJAccordionTitleDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * Directive to mark a template as the accordion header **actions** — interactive\n * controls (edit / copy / run / checkbox, etc.) that sit in the header row but\n * are NOT the expand/collapse toggle. Rendered as a sibling of the toggle\n * `<button>`, so there's no button-in-button and the toggle stays a clean,\n * accessible control.\n *\n * @example\n * ```html\n * <mj-accordion-panel>\n * <ng-template mjAccordionTitle>Connection</ng-template>\n * <ng-template mjAccordionActions>\n * <button mjButton variant=\"icon\" (click)=\"edit()\"><i class=\"fa fa-pen\"></i></button>\n * </ng-template>\n * …body…\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionActions]',\n standalone: true\n})\nexport class MJAccordionActionsDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * Directive to mark a template as the accordion **body** — the panel's collapsible\n * content. Use this INSTEAD of placing content directly in the panel when the body\n * may be expensive (code editors, grids, large lists) OR just to be future-proof:\n * the accordion instantiates the template **lazily on first expand** and then keeps\n * it alive, so nothing is created until the user opens the panel, while later\n * open/close still animates. Consumers never have to reason about content weight or\n * write `@if (expanded)` themselves.\n *\n * @example\n * ```html\n * <mj-accordion-panel [Expanded]=\"open\" (ExpandedChange)=\"open = $event\">\n * <ng-template mjAccordionTitle>Configuration</ng-template>\n * <ng-template mjAccordionBody>\n * <mj-code-editor ...></mj-code-editor> <!-- not created until first opened -->\n * </ng-template>\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionBody]',\n standalone: true\n})\nexport class MJAccordionBodyDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * mj-accordion-panel — Collapsible panel. Replaces `<kendo-panelbar-item>` and `<kendo-expansionpanel>`.\n *\n * Supports two title modes:\n * - Simple string: `[Title]=\"'Details'\"` — plain text title\n * - Rich template: `<ng-template mjAccordionTitle>` — HTML with icons, badges, etc.\n *\n * @example\n * ```html\n * <!-- Simple string title -->\n * <mj-accordion-panel Title=\"Details\" [Expanded]=\"true\">\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n *\n * <!-- Rich HTML title -->\n * <mj-accordion-panel [Expanded]=\"true\">\n * <ng-template mjAccordionTitle>\n * <i class=\"fa-solid fa-code\"></i> Template Editor\n * </ng-template>\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n * ```\n */\n@Component({\n selector: 'mj-accordion-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <div class=\"mj-accordion-panel\" [class.mj-accordion-panel--expanded]=\"Expanded\" [class.mj-accordion-panel--disabled]=\"Disabled\"\n [class.mj-accordion-panel--muted-icon]=\"TitleIconMuted\"\n [class.mj-accordion-panel--sm]=\"Size === 'sm'\"\n [class.mj-accordion-panel--bare]=\"Bare\"\n [class.mj-accordion-panel--flush-body]=\"FlushBody\"\n [class.mj-accordion-panel--fill]=\"Fill\"\n [attr.data-variant]=\"Variant !== 'default' ? Variant : null\">\n <div class=\"mj-accordion-header-row\">\n <!-- With HeadingLevel set, a heading wraps the toggle; without it, the toggle is a direct child of the row. -->\n @if (HeadingLevel) {\n <div class=\"mj-accordion-heading\" role=\"heading\" [attr.aria-level]=\"HeadingLevel\">\n <ng-container [ngTemplateOutlet]=\"toggleButton\"></ng-container>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"toggleButton\"></ng-container>\n }\n @if (actionsTemplate) {\n <div class=\"mj-accordion-actions\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"></ng-container>\n </div>\n }\n <!-- The chevron is ALWAYS the rightmost element of the header row (after any\n actions). It's a secondary, a11y-hidden toggle affordance — the primary\n disclosure control is the title button above (which owns aria-expanded). -->\n <button class=\"mj-accordion-chevron\" type=\"button\" tabindex=\"-1\" aria-hidden=\"true\"\n [disabled]=\"Disabled\" (click)=\"Toggle()\">\n <i class=\"fa-solid fa-chevron-down mj-accordion-icon\"></i>\n </button>\n </div>\n <div class=\"mj-accordion-body-outer\" [attr.inert]=\"Expanded ? null : ''\">\n <div class=\"mj-accordion-body-clip\">\n <div class=\"mj-accordion-body\" role=\"region\" [id]=\"BodyId\" [attr.aria-labelledby]=\"HeaderId\">\n <!-- Legacy: content placed directly in the panel (eager). -->\n <ng-content></ng-content>\n <!-- Preferred: [mjAccordionBody] template — instantiated lazily on first\n expand, then kept alive so later toggles still animate. -->\n @if (bodyTemplate && (Expanded || hasBeenExpanded)) {\n <ng-container [ngTemplateOutlet]=\"bodyTemplate.templateRef\"></ng-container>\n }\n </div>\n </div>\n </div>\n </div>\n <!-- The toggle button: the disclosure control that owns aria-expanded -->\n <ng-template #toggleButton>\n <button class=\"mj-accordion-header\" type=\"button\"\n [id]=\"HeaderId\"\n [attr.aria-expanded]=\"Expanded\"\n [attr.aria-controls]=\"BodyId\"\n [disabled]=\"Disabled\"\n (click)=\"Toggle()\">\n <span class=\"mj-accordion-title\">\n @if (TitleTemplate) {\n <ng-container [ngTemplateOutlet]=\"TitleTemplate.templateRef\"></ng-container>\n } @else {\n {{ Title }}\n }\n </span>\n </button>\n </ng-template>\n `\n})\nexport class MJAccordionPanelComponent {\n @Input() Title = '';\n private _expanded = false;\n /** Latches true the first time the panel is expanded; never resets. Lets a\n * [mjAccordionBody] template instantiate lazily on first open and then stay\n * alive so subsequent open/close still animates. */\n private _everExpanded = false;\n @Input()\n set Expanded(value: boolean) {\n this._expanded = value;\n if (value) this._everExpanded = true;\n }\n get Expanded(): boolean { return this._expanded; }\n protected get hasBeenExpanded(): boolean { return this._everExpanded; }\n @Input() Disabled = false;\n /**\n * Emphasis variant for visual hierarchy:\n * - `primary` — bold, solid brand-colored header (use to make a panel stand out)\n * - `secondary` — subtle brand tint\n * - `default` — standard neutral header\n * All brand-token-driven, so dark-mode-safe and themeable.\n */\n @Input() Variant: 'default' | 'primary' | 'secondary' = 'default';\n /**\n * Render icons projected into the title slot in the muted color instead of the\n * header's primary text color. Lets consumers get the common \"quiet icon\" look\n * without writing CSS. Status/brand-colored icons can still be colored inline.\n */\n @Input() TitleIconMuted = false;\n /**\n * Density. `md` (default) is the standard size; `sm` tightens header padding and\n * font for dense contexts (sidebars, flyouts, nested panels).\n */\n @Input() Size: 'sm' | 'md' = 'md';\n /**\n * Bare chrome — drop the panel's border, header background, body fill and\n * row-wide hover fill, so the panel sits cleanly inside a host that already\n * provides chrome (e.g. an expandable card) or directly on a page as a section.\n * The toggle keeps its focus ring and, on a device that can hover, a hover cue:\n * pointing at the title or the chevron gives both the brand color. A `Variant`\n * keeps its own colors.\n */\n @Input() Bare = false;\n /**\n * Heading level (1–6) for the title. When set, a `role=\"heading\"` element with this\n * `aria-level` wraps the toggle button, so the section title takes part in the page's\n * heading outline. When null, there is no wrapper and the toggle is a direct child of\n * the header row.\n */\n @Input() HeadingLevel: 1 | 2 | 3 | 4 | 5 | 6 | null = null;\n /**\n * Remove the body's default padding, for bodies that manage their own spacing\n * (code editors, full-bleed grids, custom forms).\n */\n @Input() FlushBody = false;\n /**\n * Fill mode — for \"rail section that owns the leftover height\" cases (e.g. an\n * entity tree or grid that should consume all remaining vertical space and\n * scroll *internally*), rather than the default \"reveal stacked content\"\n * disclosure. When set AND expanded, the panel becomes a flex column that\n * fills its flex parent and its body becomes a `flex:1; min-height:0` region —\n * the projected content is expected to provide its own scroll child. While\n * collapsed, the panel behaves exactly like a normal panel (header only,\n * natural height) and does NOT claim the leftover space.\n *\n * Requires the panel's parent to be a flex column with `min-height:0`.\n * Note: the open/close height animation is skipped in fill mode (the body\n * fills rather than animating to content height).\n */\n @Input() Fill = false;\n @Output() ExpandedChange = new EventEmitter<boolean>();\n @ContentChild(MJAccordionTitleDirective) TitleTemplate: MJAccordionTitleDirective | null = null;\n\n /** @deprecated Use {@link TitleTemplate}. */\n get titleTemplate(): MJAccordionTitleDirective | null {\n return this.TitleTemplate;\n }\n /** @deprecated Use {@link TitleTemplate}. */\n set titleTemplate(value: MJAccordionTitleDirective | null) {\n this.TitleTemplate = value;\n }\n @ContentChild(MJAccordionActionsDirective) ActionsTemplate: MJAccordionActionsDirective | null = null;\n\n /** @deprecated Use {@link ActionsTemplate}. */\n get actionsTemplate(): MJAccordionActionsDirective | null {\n return this.ActionsTemplate;\n }\n /** @deprecated Use {@link ActionsTemplate}. */\n set actionsTemplate(value: MJAccordionActionsDirective | null) {\n this.ActionsTemplate = value;\n }\n @ContentChild(MJAccordionBodyDirective) BodyTemplate: MJAccordionBodyDirective | null = null;\n\n /** @deprecated Use {@link BodyTemplate}. */\n get bodyTemplate(): MJAccordionBodyDirective | null {\n return this.BodyTemplate;\n }\n /** @deprecated Use {@link BodyTemplate}. */\n set bodyTemplate(value: MJAccordionBodyDirective | null) {\n this.BodyTemplate = value;\n }\n @HostBinding('class.mj-accordion-panel-host') readonly hostClass = true;\n /** Host claims flex:1 of its parent ONLY while a Fill panel is expanded —\n * so a collapsed Fill panel sits at natural (header) height like any other. */\n @HostBinding('class.mj-accordion-fill-active') get fillActive(): boolean {\n return this.Fill && this.Expanded;\n }\n\n /** Stable per-instance ids that programmatically associate the header\n * `<button>` with its body region (`aria-controls` ↔ `aria-labelledby`),\n * completing the WAI-ARIA accordion pattern so screen readers announce the\n * region with the header's name. */\n private readonly _uid = nextAccordionUid++;\n readonly HeaderId = `mj-accordion-header-${this._uid}`;\n readonly BodyId = `mj-accordion-body-${this._uid}`;\n\n Toggle(): void {\n if (this.Disabled) return;\n this.Expanded = !this.Expanded;\n this.ExpandedChange.emit(this.Expanded);\n }\n}\n\n/**\n * Convenience module bundling the accordion panel + all of its slot directives.\n * Import this ONE symbol instead of listing the component and each directive\n * separately:\n *\n * ```ts\n * import { MJAccordionModule } from '@memberjunction/ng-ui-components';\n * @NgModule({ imports: [MJAccordionModule, ...] }) // or @Component standalone imports\n * ```\n *\n * Why a module (not a bare `const [...]` array): Angular's AOT compiler can't\n * statically expand a value-array imported across a compiled-package boundary in\n * an `imports` array (NG1010), and `as const` makes it a readonly tuple the\n * `imports` type rejects (TS2322). An NgModule is always a valid `imports` entry\n * in both NgModule and standalone consumers. Adding a future accordion directive\n * here makes it available to every consumer automatically — no per-module churn.\n */\n@NgModule({\n imports: [\n MJAccordionPanelComponent,\n MJAccordionTitleDirective,\n MJAccordionActionsDirective,\n MJAccordionBodyDirective,\n ],\n exports: [\n MJAccordionPanelComponent,\n MJAccordionTitleDirective,\n MJAccordionActionsDirective,\n MJAccordionBodyDirective,\n ],\n})\nexport class MJAccordionModule {}\n"]}
|
|
1
|
+
{"version":3,"file":"accordion.component.js","sourceRoot":"","sources":["../../../src/lib/accordion/accordion.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,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AhKzB,yBAAyB,EA0BzB,2BAA2B,EA2B3B,wBAAwB,aA2GxB,yBAAyB,EAhKzB,yBAAyB,EA0BzB,2BAA2B,EA2B3B,wBAAwB","sourcesContent":["import { Component, Input, Output, EventEmitter, HostBinding, ContentChild, TemplateRef, Directive, NgModule, ChangeDetectorRef, ElementRef, OnInit, OnDestroy, inject } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/** Process-wide counter for generating unique, stable accordion element ids\n * (used to wire `aria-controls` / `aria-labelledby` between header and body). */\nlet nextAccordionUid = 0;\n\n/**\n * Directive to mark a template as the accordion panel title.\n * Supports rich HTML content (icons, badges, dynamic text).\n *\n * @example\n * ```html\n * <mj-accordion-panel [Expanded]=\"true\">\n * <ng-template mjAccordionTitle>\n * <i class=\"fa-solid fa-code\"></i> Template Editor\n * <span class=\"badge\">3</span>\n * </ng-template>\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionTitle]',\n standalone: true\n})\nexport class MJAccordionTitleDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * Directive to mark a template as the accordion header **actions** — interactive\n * controls (edit / copy / run / checkbox, etc.) that sit in the header row but\n * are NOT the expand/collapse toggle. Rendered as a sibling of the toggle\n * `<button>`, so there's no button-in-button and the toggle stays a clean,\n * accessible control.\n *\n * @example\n * ```html\n * <mj-accordion-panel>\n * <ng-template mjAccordionTitle>Connection</ng-template>\n * <ng-template mjAccordionActions>\n * <button mjButton variant=\"icon\" (click)=\"edit()\"><i class=\"fa fa-pen\"></i></button>\n * </ng-template>\n * …body…\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionActions]',\n standalone: true\n})\nexport class MJAccordionActionsDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * Directive to mark a template as the accordion **body** — the panel's collapsible\n * content. Use this INSTEAD of placing content directly in the panel when the body\n * may be expensive (code editors, grids, large lists) OR just to be future-proof:\n * the accordion instantiates the template **lazily on first expand** and then keeps\n * it alive, so nothing is created until the user opens the panel, while later\n * open/close still animates. Consumers never have to reason about content weight or\n * write `@if (expanded)` themselves.\n *\n * @example\n * ```html\n * <mj-accordion-panel [Expanded]=\"open\" (ExpandedChange)=\"open = $event\">\n * <ng-template mjAccordionTitle>Configuration</ng-template>\n * <ng-template mjAccordionBody>\n * <mj-code-editor ...></mj-code-editor> <!-- not created until first opened -->\n * </ng-template>\n * </mj-accordion-panel>\n * ```\n */\n@Directive({\n selector: '[mjAccordionBody]',\n standalone: true\n})\nexport class MJAccordionBodyDirective {\n constructor(public templateRef: TemplateRef<unknown>) {} // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply\n}\n\n/**\n * mj-accordion-panel — Collapsible panel.\n *\n * Supports two title modes:\n * - Simple string: `[Title]=\"'Details'\"` — plain text title\n * - Rich template: `<ng-template mjAccordionTitle>` — HTML with icons, badges, etc.\n *\n * @example\n * ```html\n * <!-- Simple string title -->\n * <mj-accordion-panel Title=\"Details\" [Expanded]=\"true\">\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n *\n * <!-- Rich HTML title -->\n * <mj-accordion-panel [Expanded]=\"true\">\n * <ng-template mjAccordionTitle>\n * <i class=\"fa-solid fa-code\"></i> Template Editor\n * </ng-template>\n * <p>Panel content here</p>\n * </mj-accordion-panel>\n * ```\n */\n@Component({\n selector: 'mj-accordion-panel',\n standalone: true,\n imports: [NgTemplateOutlet],\n template: `\n <div class=\"mj-accordion-panel\" [class.mj-accordion-panel--expanded]=\"Expanded || IsOpenFlat\" [class.mj-accordion-panel--disabled]=\"Disabled\"\n [class.mj-accordion-panel--flat-section]=\"FlatMode === 'section'\"\n [class.mj-accordion-panel--flat-block]=\"FlatMode === 'block'\"\n [class.mj-accordion-panel--muted-icon]=\"TitleIconMuted\"\n [class.mj-accordion-panel--sm]=\"Size === 'sm'\"\n [class.mj-accordion-panel--bare]=\"Bare\"\n [class.mj-accordion-panel--flush-body]=\"FlushBody\"\n [class.mj-accordion-panel--fill]=\"Fill\"\n [attr.data-variant]=\"Variant !== 'default' ? Variant : null\">\n <div class=\"mj-accordion-header-row\">\n @if (FlatMode === 'block') {\n <!-- Flat block: the title is a plain heading over always-open content, no toggle. -->\n <div class=\"mj-accordion-flat-heading\" role=\"heading\" [attr.aria-level]=\"HeadingLevel ?? 3\" [id]=\"HeaderId\">\n <span class=\"mj-accordion-title\"><ng-container [ngTemplateOutlet]=\"titleContent\"></ng-container></span>\n </div>\n } @else if (FlatMode === 'section') {\n <!-- Flat section: the section picker names it on screen; keep the name for the region. -->\n <span class=\"mj-accordion-section-label\" [id]=\"HeaderId\"><ng-container [ngTemplateOutlet]=\"titleContent\"></ng-container></span>\n } @else if (HeadingLevel) {\n <!-- With HeadingLevel set, a heading wraps the toggle; without it, the toggle is a direct child of the row. -->\n <div class=\"mj-accordion-heading\" role=\"heading\" [attr.aria-level]=\"HeadingLevel\">\n <ng-container [ngTemplateOutlet]=\"toggleButton\"></ng-container>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"toggleButton\"></ng-container>\n }\n @if (actionsTemplate) {\n <div class=\"mj-accordion-actions\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"></ng-container>\n </div>\n }\n <!-- The chevron is ALWAYS the rightmost element of the header row (after any\n actions). It's a secondary, a11y-hidden toggle affordance — the primary\n disclosure control is the title button above (which owns aria-expanded). -->\n @if (FlatMode === null) {\n <button class=\"mj-accordion-chevron\" type=\"button\" tabindex=\"-1\" aria-hidden=\"true\"\n [disabled]=\"Disabled\" (click)=\"Toggle()\">\n <i class=\"fa-solid fa-chevron-down mj-accordion-icon\"></i>\n </button>\n }\n </div>\n <div class=\"mj-accordion-body-outer\" [attr.inert]=\"Expanded || IsOpenFlat ? null : ''\">\n <div class=\"mj-accordion-body-clip\">\n <div class=\"mj-accordion-body\" role=\"region\" [id]=\"BodyId\" [attr.aria-labelledby]=\"HeaderId\">\n <!-- Legacy: content placed directly in the panel (eager). -->\n <ng-content></ng-content>\n <!-- Preferred: [mjAccordionBody] template — instantiated lazily on first\n expand, then kept alive so later toggles still animate. -->\n @if (bodyTemplate && (Expanded || hasBeenExpanded || IsOpenFlat)) {\n <ng-container [ngTemplateOutlet]=\"bodyTemplate.templateRef\"></ng-container>\n }\n </div>\n </div>\n </div>\n </div>\n <!-- The toggle button: the disclosure control that owns aria-expanded -->\n <ng-template #toggleButton>\n <button class=\"mj-accordion-header\" type=\"button\"\n [id]=\"HeaderId\"\n [attr.aria-expanded]=\"Expanded\"\n [attr.aria-controls]=\"BodyId\"\n [disabled]=\"Disabled\"\n (click)=\"Toggle()\">\n <span class=\"mj-accordion-title\"><ng-container [ngTemplateOutlet]=\"titleContent\"></ng-container></span>\n </button>\n </ng-template>\n <ng-template #titleContent>\n @if (TitleTemplate) {\n <ng-container [ngTemplateOutlet]=\"TitleTemplate.templateRef\"></ng-container>\n } @else {\n {{ Title }}\n }\n </ng-template>\n `\n})\nexport class MJAccordionPanelComponent implements OnInit, OnDestroy {\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n /** The panel this one is nested in, if any; a panel inside a flat panel renders flat too. */\n private readonly parentPanel = inject(MJAccordionPanelComponent, { optional: true, skipSelf: true });\n private readonly childPanels = new Set<MJAccordionPanelComponent>();\n\n @Input() Title = '';\n private _expanded = false;\n /** Latches true the first time the panel is expanded; never resets. Lets a\n * [mjAccordionBody] template instantiate lazily on first open and then stay\n * alive so subsequent open/close still animates. */\n private _everExpanded = false;\n @Input()\n set Expanded(value: boolean) {\n this._expanded = value;\n if (value) this._everExpanded = true;\n }\n get Expanded(): boolean { return this._expanded; }\n protected get hasBeenExpanded(): boolean { return this._everExpanded; }\n @Input() Disabled = false;\n /**\n * Emphasis variant for visual hierarchy:\n * - `primary` — bold, solid brand-colored header (use to make a panel stand out)\n * - `secondary` — subtle brand tint\n * - `default` — standard neutral header\n * All brand-token-driven, so dark-mode-safe and themeable.\n */\n @Input() Variant: 'default' | 'primary' | 'secondary' = 'default';\n /**\n * Render icons projected into the title slot in the muted color instead of the\n * header's primary text color. Lets consumers get the common \"quiet icon\" look\n * without writing CSS. Status/brand-colored icons can still be colored inline.\n */\n @Input() TitleIconMuted = false;\n /**\n * Density. `md` (default) is the standard size; `sm` tightens header padding and\n * font for dense contexts (sidebars, flyouts, nested panels).\n */\n @Input() Size: 'sm' | 'md' = 'md';\n /**\n * Bare chrome — drop the panel's border, header background, body fill and\n * row-wide hover fill, so the panel sits cleanly inside a host that already\n * provides chrome (e.g. an expandable card) or directly on a page as a section.\n * The toggle keeps its focus ring and, on a device that can hover, a hover cue:\n * pointing at the title or the chevron gives both the brand color. A `Variant`\n * keeps its own colors.\n */\n @Input() Bare = false;\n /**\n * Heading level (1–6) for the title. When set, a `role=\"heading\"` element with this\n * `aria-level` wraps the toggle button, so the section title takes part in the page's\n * heading outline. When null, there is no wrapper and the toggle is a direct child of\n * the header row.\n */\n @Input() HeadingLevel: 1 | 2 | 3 | 4 | 5 | 6 | null = null;\n /**\n * Remove the body's default padding, for bodies that manage their own spacing\n * (code editors, full-bleed grids, custom forms).\n */\n @Input() FlushBody = false;\n /**\n * Fill mode — for \"rail section that owns the leftover height\" cases (e.g. an\n * entity tree or grid that should consume all remaining vertical space and\n * scroll *internally*), rather than the default \"reveal stacked content\"\n * disclosure. When set AND expanded, the panel becomes a flex column that\n * fills its flex parent and its body becomes a `flex:1; min-height:0` region —\n * the projected content is expected to provide its own scroll child. While\n * collapsed, the panel behaves exactly like a normal panel (header only,\n * natural height) and does NOT claim the leftover space.\n *\n * Requires the panel's parent to be a flex column with `min-height:0`.\n * Note: the open/close height animation is skipped in fill mode (the body\n * fills rather than animating to content height).\n */\n @Input() Fill = false;\n /**\n * Flat — render as a plain headed block: the title is a heading, the body is always open,\n * and there is no toggle, border or body padding. Panels nested inside a flat panel, or\n * inside the active section of an `mj-accordion-sections`, render this way automatically.\n */\n @Input() Flat = false;\n /** Stable key for this panel in an `mj-accordion-sections`; falls back to its position. */\n @Input() SectionKey: string | null = null;\n /** The name the section picker shows; falls back to `Title`, then the rendered title text. */\n @Input() SectionTitle: string | null = null;\n /** Font Awesome class string for the section picker row. */\n @Input() SectionIcon: string | null = null;\n /** Count shown on the section picker row. */\n @Input() SectionCount: number | null = null;\n @Output() ExpandedChange = new EventEmitter<boolean>();\n @ContentChild(MJAccordionTitleDirective) TitleTemplate: MJAccordionTitleDirective | null = null;\n\n /** @deprecated Use {@link TitleTemplate}. */\n get titleTemplate(): MJAccordionTitleDirective | null {\n return this.TitleTemplate;\n }\n /** @deprecated Use {@link TitleTemplate}. */\n set titleTemplate(value: MJAccordionTitleDirective | null) {\n this.TitleTemplate = value;\n }\n @ContentChild(MJAccordionActionsDirective) ActionsTemplate: MJAccordionActionsDirective | null = null;\n\n /** @deprecated Use {@link ActionsTemplate}. */\n get actionsTemplate(): MJAccordionActionsDirective | null {\n return this.ActionsTemplate;\n }\n /** @deprecated Use {@link ActionsTemplate}. */\n set actionsTemplate(value: MJAccordionActionsDirective | null) {\n this.ActionsTemplate = value;\n }\n @ContentChild(MJAccordionBodyDirective) BodyTemplate: MJAccordionBodyDirective | null = null;\n\n /** @deprecated Use {@link BodyTemplate}. */\n get bodyTemplate(): MJAccordionBodyDirective | null {\n return this.BodyTemplate;\n }\n /** @deprecated Use {@link BodyTemplate}. */\n set bodyTemplate(value: MJAccordionBodyDirective | null) {\n this.BodyTemplate = value;\n }\n @HostBinding('class.mj-accordion-panel-host') readonly hostClass = true;\n /** Host claims flex:1 of its parent ONLY while a Fill panel is expanded —\n * so a collapsed Fill panel sits at natural (header) height like any other. */\n @HostBinding('class.mj-accordion-fill-active') get fillActive(): boolean {\n return this.Fill && this.Expanded;\n }\n\n /** Stable per-instance ids that programmatically associate the header\n * `<button>` with its body region (`aria-controls` ↔ `aria-labelledby`),\n * completing the WAI-ARIA accordion pattern so screen readers announce the\n * region with the header's name. */\n private readonly _uid = nextAccordionUid++;\n readonly HeaderId = `mj-accordion-header-${this._uid}`;\n readonly BodyId = `mj-accordion-body-${this._uid}`;\n\n Toggle(): void {\n if (this.Disabled) return;\n this.Expanded = !this.Expanded;\n this.ExpandedChange.emit(this.Expanded);\n }\n\n // ---------------------------------------------------------------- flat / sections\n\n private sectionMode = false;\n private sectionHidden = false;\n private parentFlat = false;\n private parentShown = true;\n\n /** `section`: the active top level of an mj-accordion-sections; `block`: a flat nested panel. */\n get FlatMode(): 'section' | 'block' | null {\n if (this.sectionMode) return 'section';\n if (this.Flat || this.parentFlat) return 'block';\n return null;\n }\n\n /** Hidden because another section of an `mj-accordion-sections` is active. */\n @HostBinding('class.mj-accordion-section-hidden') get IsSectionHidden(): boolean {\n return this.sectionMode && this.sectionHidden;\n }\n\n /** On screen in a flat presentation: an active section, or a block whose parent is on screen. */\n get IsShownFlat(): boolean {\n if (this.sectionMode) return !this.sectionHidden;\n return this.parentFlat ? this.parentShown : true;\n }\n\n /**\n * Open because it is flat and on screen. A hidden section (or a block inside one) is not, so its\n * lazy body is not built until that section is picked; once picked it stays built (it was\n * expanded then), so switching away and back keeps its state.\n */\n get IsOpenFlat(): boolean {\n return this.FlatMode !== null && this.IsShownFlat;\n }\n\n /** The name the section picker shows for this panel. */\n ResolvedSectionTitle(): string {\n if (this.SectionTitle) return this.SectionTitle;\n if (this.Title) return this.Title;\n const t = this.el.nativeElement.querySelector(':scope > .mj-accordion-panel > .mj-accordion-header-row .mj-accordion-title, :scope > .mj-accordion-panel > .mj-accordion-header-row .mj-accordion-section-label');\n return (t?.textContent ?? '').replace(/\\s+/g, ' ').trim();\n }\n\n /**\n * Called by `mj-accordion-sections`. Enabled, this panel becomes a section: shown and flat\n * when active, hidden otherwise. Opening it emits ExpandedChange(true) once, like a click,\n * so a body that loads on first expand still loads.\n */\n SetSectionState(enabled: boolean, active: boolean): void {\n this.sectionMode = enabled;\n this.sectionHidden = enabled && !active;\n this.syncFlatState();\n }\n\n ngOnInit(): void {\n if (!this.parentPanel) return;\n this.parentPanel.childPanels.add(this);\n this.setParentFlat(this.parentPanel.FlatMode !== null, this.parentPanel.IsShownFlat);\n }\n\n ngOnDestroy(): void {\n this.parentPanel?.childPanels.delete(this);\n }\n\n private setParentFlat(flat: boolean, shown: boolean): void {\n this.parentFlat = flat;\n this.parentShown = shown;\n this.syncFlatState();\n }\n\n private syncFlatState(): void {\n if (this.FlatMode !== null && this.IsShownFlat) this.openForFlat();\n const flat = this.FlatMode !== null;\n const shown = this.IsShownFlat;\n for (const child of this.childPanels) child.setParentFlat(flat, shown);\n this.cdr.markForCheck();\n }\n\n /** Opens the panel for a flat presentation and reports it the way a click would. */\n private openForFlat(): void {\n if (this._expanded) return;\n this.Expanded = true;\n // After the current change-detection pass, so a listener that updates bound state does not\n // change it mid-check.\n queueMicrotask(() => this.ExpandedChange.emit(true));\n }\n}\n\n/**\n * Convenience module bundling the accordion panel + all of its slot directives.\n * Import this ONE symbol instead of listing the component and each directive\n * separately:\n *\n * ```ts\n * import { MJAccordionModule } from '@memberjunction/ng-ui-components';\n * @NgModule({ imports: [MJAccordionModule, ...] }) // or @Component standalone imports\n * ```\n *\n * Why a module (not a bare `const [...]` array): Angular's AOT compiler can't\n * statically expand a value-array imported across a compiled-package boundary in\n * an `imports` array (NG1010), and `as const` makes it a readonly tuple the\n * `imports` type rejects (TS2322). An NgModule is always a valid `imports` entry\n * in both NgModule and standalone consumers. Adding a future accordion directive\n * here makes it available to every consumer automatically — no per-module churn.\n */\n@NgModule({\n imports: [\n MJAccordionPanelComponent,\n MJAccordionTitleDirective,\n MJAccordionActionsDirective,\n MJAccordionBodyDirective,\n ],\n exports: [\n MJAccordionPanelComponent,\n MJAccordionTitleDirective,\n MJAccordionActionsDirective,\n MJAccordionBodyDirective,\n ],\n})\nexport class MJAccordionModule {}\n"]}
|
|
@@ -335,3 +335,79 @@
|
|
|
335
335
|
.mj-accordion-body-outer { transition: none; }
|
|
336
336
|
.mj-accordion-panel--fill.mj-accordion-panel--expanded > .mj-accordion-body-outer > .mj-accordion-body-clip > .mj-accordion-body { animation: none; }
|
|
337
337
|
}
|
|
338
|
+
|
|
339
|
+
/* ============================================================
|
|
340
|
+
FLAT — mj-accordion-sections on phones, or [Flat]="true".
|
|
341
|
+
section: the active top level; its chrome goes, the picker names it.
|
|
342
|
+
block: a panel nested in a flat panel; a plain heading over open content.
|
|
343
|
+
============================================================ */
|
|
344
|
+
.mj-accordion-section-hidden {
|
|
345
|
+
display: none !important;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.mj-accordion-panel--flat-section,
|
|
349
|
+
.mj-accordion-panel--flat-block {
|
|
350
|
+
border: 0;
|
|
351
|
+
border-radius: 0;
|
|
352
|
+
margin-bottom: 0;
|
|
353
|
+
overflow: visible;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.mj-accordion-panel--flat-section > .mj-accordion-header-row,
|
|
357
|
+
.mj-accordion-panel--flat-block > .mj-accordion-header-row,
|
|
358
|
+
.mj-accordion-panel--flat-section:not(.mj-accordion-panel--disabled) > .mj-accordion-header-row:hover,
|
|
359
|
+
.mj-accordion-panel--flat-block:not(.mj-accordion-panel--disabled) > .mj-accordion-header-row:hover {
|
|
360
|
+
background: transparent;
|
|
361
|
+
border-bottom: 0;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* A section keeps its header row only for its actions (Copy, Run, …), right-aligned. */
|
|
365
|
+
.mj-accordion-panel--flat-section > .mj-accordion-header-row {
|
|
366
|
+
justify-content: flex-end;
|
|
367
|
+
}
|
|
368
|
+
.mj-accordion-panel--flat-section > .mj-accordion-header-row:not(:has(> .mj-accordion-actions)) {
|
|
369
|
+
display: none;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.mj-accordion-panel--flat-section > .mj-accordion-body-outer,
|
|
373
|
+
.mj-accordion-panel--flat-block > .mj-accordion-body-outer {
|
|
374
|
+
grid-template-columns: minmax(0, 1fr);
|
|
375
|
+
transition: none;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* Visible, so nothing in a flat section is clipped; min-width: 0, because a grid item whose
|
|
379
|
+
overflow is visible otherwise grows to its content and a wide table inside stops scrolling
|
|
380
|
+
in its own box (it pushes the whole section past the screen instead). */
|
|
381
|
+
.mj-accordion-panel--flat-section > .mj-accordion-body-outer > .mj-accordion-body-clip,
|
|
382
|
+
.mj-accordion-panel--flat-block > .mj-accordion-body-outer > .mj-accordion-body-clip {
|
|
383
|
+
overflow: visible;
|
|
384
|
+
min-width: 0;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.mj-accordion-panel--flat-section > .mj-accordion-body-outer > .mj-accordion-body-clip > .mj-accordion-body,
|
|
388
|
+
.mj-accordion-panel--flat-block > .mj-accordion-body-outer > .mj-accordion-body-clip > .mj-accordion-body {
|
|
389
|
+
padding: 0;
|
|
390
|
+
background: transparent;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.mj-accordion-flat-heading {
|
|
394
|
+
flex: 1 1 auto;
|
|
395
|
+
min-width: 0;
|
|
396
|
+
display: flex;
|
|
397
|
+
align-items: center;
|
|
398
|
+
padding: 14px 0 8px;
|
|
399
|
+
font-size: var(--mj-text-xs);
|
|
400
|
+
font-weight: var(--mj-font-bold, 700);
|
|
401
|
+
color: var(--mj-text-muted);
|
|
402
|
+
text-transform: uppercase;
|
|
403
|
+
letter-spacing: 0.06em;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.mj-accordion-section-label {
|
|
407
|
+
position: absolute;
|
|
408
|
+
width: 1px;
|
|
409
|
+
height: 1px;
|
|
410
|
+
overflow: hidden;
|
|
411
|
+
clip: rect(0 0 0 0);
|
|
412
|
+
white-space: nowrap;
|
|
413
|
+
}
|