@mintplayer/ng-bootstrap 22.5.0 → 22.6.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/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +128 -74
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +82 -246
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +25 -4
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-observe-size.mjs +48 -0
- package/fesm2022/mintplayer-ng-bootstrap-observe-size.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +106 -0
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/observe-size/package.json +4 -0
- package/package.json +9 -2
- package/splitter/package.json +4 -0
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +88 -27
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +57 -109
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +14 -1
- package/types/mintplayer-ng-bootstrap-observe-size.d.ts +24 -0
- package/types/mintplayer-ng-bootstrap-priority-nav.d.ts +1 -1
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +66 -0
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +1 -1
|
@@ -1,105 +1,159 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
|
|
4
|
-
import { BsReducedMotionDirective } from '@mintplayer/ng-bootstrap/reduced-motion';
|
|
5
|
-
import { SlideUpDownAnimation } from '@mintplayer/ng-animations';
|
|
6
|
-
import { BsNoNoscriptDirective } from '@mintplayer/ng-bootstrap/no-noscript';
|
|
3
|
+
import { inject, TemplateRef, Directive, model, input, contentChild, computed, ChangeDetectionStrategy, Component, contentChildren, forwardRef, viewChild, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
4
|
+
export * from '@mintplayer/web-components/accordion';
|
|
7
5
|
|
|
6
|
+
/**
|
|
7
|
+
* `*bsAccordionTabHeader` — declares the header content of the enclosing
|
|
8
|
+
* `<bs-accordion-tab>`.
|
|
9
|
+
*
|
|
10
|
+
* It is a template rather than projected content because the header has to
|
|
11
|
+
* end up as a direct child of `<mp-accordion>` (named slots accept nothing
|
|
12
|
+
* else) while being authored inside the tab it belongs to. The parent
|
|
13
|
+
* accordion renders each captured template into the matching header slot.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors `*bsTabPageHeader` on `bs-tab-control`. Replaces the former
|
|
16
|
+
* `<bs-accordion-tab-header>` component.
|
|
17
|
+
*
|
|
18
|
+
* <bs-accordion>
|
|
19
|
+
* <bs-accordion-tab>
|
|
20
|
+
* <ng-container *bsAccordionTabHeader>Profile</ng-container>
|
|
21
|
+
* Body content here
|
|
22
|
+
* </bs-accordion-tab>
|
|
23
|
+
* </bs-accordion>
|
|
24
|
+
*/
|
|
25
|
+
class BsAccordionTabHeaderDirective {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.template = inject(TemplateRef);
|
|
28
|
+
}
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionTabHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
30
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: BsAccordionTabHeaderDirective, isStandalone: true, selector: "[bsAccordionTabHeader]", ngImport: i0 }); }
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionTabHeaderDirective, decorators: [{
|
|
33
|
+
type: Directive,
|
|
34
|
+
args: [{
|
|
35
|
+
selector: '[bsAccordionTabHeader]',
|
|
36
|
+
}]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* `<bs-accordion-tab>` — one tab of a `<bs-accordion>`.
|
|
41
|
+
*
|
|
42
|
+
* This host element IS the tab marker the web component reads: it carries
|
|
43
|
+
* `accordion-tab`, its index slot and the tab's state, and its projected
|
|
44
|
+
* children become the tab body. There is no separate `<mp-accordion-tab>`
|
|
45
|
+
* here — an Angular component can only render inside its own host, which
|
|
46
|
+
* would put that element one level too deep to be slotted.
|
|
47
|
+
*
|
|
48
|
+
* The header is declared with `*bsAccordionTabHeader` and rendered by the
|
|
49
|
+
* parent accordion (see `BsAccordionComponent`).
|
|
50
|
+
*/
|
|
8
51
|
class BsAccordionTabComponent {
|
|
9
52
|
constructor() {
|
|
10
53
|
this.accordion = inject(BsAccordionComponent);
|
|
11
|
-
this
|
|
12
|
-
...(ngDevMode ? [{ debugName: "accordionTabId" }] : /* istanbul ignore next */ []));
|
|
13
|
-
this.accordionTabName = computed(() => `${this.accordion.accordionName()}-${this.accordionTabId()}`, /* @ts-ignore */
|
|
14
|
-
...(ngDevMode ? [{ debugName: "accordionTabName" }] : /* istanbul ignore next */ []));
|
|
15
|
-
this.childAccordions = contentChildren(forwardRef(() => BsAccordionComponent), /* @ts-ignore */
|
|
16
|
-
...(ngDevMode ? [{ debugName: "childAccordions" }] : /* istanbul ignore next */ []));
|
|
54
|
+
/** Two-way: whether this tab is open. */
|
|
17
55
|
this.isActive = model(false, /* @ts-ignore */
|
|
18
56
|
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
19
|
-
this.
|
|
57
|
+
this.disabled = input(false, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.headerTemplate = contentChild(BsAccordionTabHeaderDirective, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/** Position among its siblings — the tab's identity for slots and events. */
|
|
62
|
+
this.index = computed(() => this.accordion.tabPages().indexOf(this), /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
20
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Open or close this tab through the web component, so single-open
|
|
67
|
+
* exclusivity and the nested-accordion collapse both apply — unlike
|
|
68
|
+
* writing `isActive` directly.
|
|
69
|
+
*/
|
|
21
70
|
setActive(value) {
|
|
22
|
-
|
|
23
|
-
this.isActive.set(value);
|
|
24
|
-
if (value && !this.accordion.multi()) {
|
|
25
|
-
this.accordion.tabPages().filter((tab) => {
|
|
26
|
-
return tab !== this;
|
|
27
|
-
}).forEach((tab) => {
|
|
28
|
-
tab.isActive.set(false);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
if (!value) {
|
|
32
|
-
this.childAccordions().forEach((accordion) => {
|
|
33
|
-
accordion.tabPages().forEach((tab) => {
|
|
34
|
-
tab.isActive.set(false);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
71
|
+
this.accordion.setActive(this.index(), value);
|
|
39
72
|
}
|
|
40
73
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionTabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
41
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: BsAccordionTabComponent, isStandalone: true, selector: "bs-accordion-tab", inputs: { isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isActive: "isActiveChange" }, host: { attributes: { "accordion-tab": "" }, properties: { "attr.slot": "\"c\" + index()", "attr.is-active": "isActive() ? \"\" : null", "attr.disabled": "disabled() ? \"\" : null" } }, queries: [{ propertyName: "headerTemplate", first: true, predicate: BsAccordionTabHeaderDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
42
75
|
}
|
|
43
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionTabComponent, decorators: [{
|
|
44
77
|
type: Component,
|
|
45
|
-
args: [{ selector: 'bs-accordion-tab',
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
args: [{ selector: 'bs-accordion-tab', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
79
|
+
'accordion-tab': '',
|
|
80
|
+
'[attr.slot]': '"c" + index()',
|
|
81
|
+
'[attr.is-active]': 'isActive() ? "" : null',
|
|
82
|
+
'[attr.disabled]': 'disabled() ? "" : null',
|
|
83
|
+
}, template: "<ng-content></ng-content>\n" }]
|
|
84
|
+
}], propDecorators: { isActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isActive", required: false }] }, { type: i0.Output, args: ["isActiveChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsAccordionTabHeaderDirective), { isSignal: true }] }] } });
|
|
49
85
|
|
|
86
|
+
/**
|
|
87
|
+
* `<bs-accordion>` — Angular wrapper around the `<mp-accordion>` web component.
|
|
88
|
+
*
|
|
89
|
+
* <bs-accordion [multi]="true">
|
|
90
|
+
* <bs-accordion-tab [(isActive)]="open">
|
|
91
|
+
* <ng-container *bsAccordionTabHeader>Profile</ng-container>
|
|
92
|
+
* Body content
|
|
93
|
+
* </bs-accordion-tab>
|
|
94
|
+
* </bs-accordion>
|
|
95
|
+
*
|
|
96
|
+
* Each tab's header is HOISTED out of the tab and rendered here, as a sibling
|
|
97
|
+
* of the tab's own marker element. Named slots only accept direct children of
|
|
98
|
+
* the shadow host, and an Angular component can only render inside its own
|
|
99
|
+
* host element — so a header authored inside `<bs-accordion-tab>` could never
|
|
100
|
+
* reach the accordion's shadow on its own. `*bsAccordionTabHeader` captures it
|
|
101
|
+
* as a template that this component renders in the right place.
|
|
102
|
+
*
|
|
103
|
+
* The WC owns interaction, ARIA, animation and the no-JS tier; this wrapper
|
|
104
|
+
* bridges inputs to attributes and the toggle event back into each tab's
|
|
105
|
+
* `isActive` model.
|
|
106
|
+
*/
|
|
50
107
|
class BsAccordionComponent {
|
|
51
108
|
constructor() {
|
|
52
|
-
|
|
53
|
-
this.tabPages = contentChildren(forwardRef(() => BsAccordionTabComponent), /* @ts-ignore */
|
|
54
|
-
...(ngDevMode ? [{ debugName: "tabPages" }] : /* istanbul ignore next */ []));
|
|
55
|
-
this.animationsDisabled = computed(() => this.reducedMotion.matches(), /* @ts-ignore */
|
|
56
|
-
...(ngDevMode ? [{ debugName: "animationsDisabled" }] : /* istanbul ignore next */ []));
|
|
57
|
-
this.highlightActiveTab = input(false, /* @ts-ignore */
|
|
58
|
-
...(ngDevMode ? [{ debugName: "highlightActiveTab" }] : /* istanbul ignore next */ []));
|
|
109
|
+
/** Allow several tabs to stay open at once (checkbox machine with JS off). */
|
|
59
110
|
this.multi = input(false, /* @ts-ignore */
|
|
60
111
|
...(ngDevMode ? [{ debugName: "multi" }] : /* istanbul ignore next */ []));
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
...(ngDevMode ? [{ debugName: "
|
|
112
|
+
/** Paint the open header with the Bootstrap active background. */
|
|
113
|
+
this.highlightActiveTab = input(false, /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "highlightActiveTab" }] : /* istanbul ignore next */ []));
|
|
115
|
+
this.tabPages = contentChildren(forwardRef(() => BsAccordionTabComponent), /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "tabPages" }] : /* istanbul ignore next */ []));
|
|
117
|
+
this.element = viewChild('element', /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "element" }] : /* istanbul ignore next */ []));
|
|
119
|
+
this.multiAttr = computed(() => (this.multi() ? '' : null), /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "multiAttr" }] : /* istanbul ignore next */ []));
|
|
121
|
+
this.highlightActiveTabAttr = computed(() => this.highlightActiveTab() ? '' : null, /* @ts-ignore */
|
|
122
|
+
...(ngDevMode ? [{ debugName: "highlightActiveTabAttr" }] : /* istanbul ignore next */ []));
|
|
68
123
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionComponent, decorators: [{
|
|
74
|
-
type: Component,
|
|
75
|
-
args: [{ selector: 'bs-accordion', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [BsReducedMotionDirective], template: "<div class=\"accordion\">\n <ng-content></ng-content>\n</div>", styles: [":host ::ng-deep .accordion{--bs-accordion-color: var(--bs-body-color);--bs-accordion-bg: var(--bs-body-bg);--bs-accordion-transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, border-radius .15s ease;--bs-accordion-border-color: var(--bs-border-color);--bs-accordion-border-width: var(--bs-border-width);--bs-accordion-border-radius: var(--bs-border-radius);--bs-accordion-inner-border-radius: calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-accordion-btn-padding-x: 1.25rem;--bs-accordion-btn-padding-y: 1rem;--bs-accordion-btn-color: var(--bs-body-color);--bs-accordion-btn-bg: var(--bs-accordion-bg);--bs-accordion-btn-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");--bs-accordion-btn-icon-width: 1.25rem;--bs-accordion-btn-icon-transform: rotate(-180deg);--bs-accordion-btn-icon-transition: transform .2s ease-in-out;--bs-accordion-btn-active-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='rgb%285.2, 44, 101.2%29' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m2 5 6 6 6-6'/%3e%3c/svg%3e\");--bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);--bs-accordion-body-padding-x: 1.25rem;--bs-accordion-body-padding-y: 1rem;--bs-accordion-active-color: var(--bs-primary-text-emphasis);--bs-accordion-active-bg: var(--bs-primary-bg-subtle)}:host ::ng-deep .accordion-button{position:relative;display:flex;align-items:center;width:100%;padding:var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);font-size:1rem;color:var(--bs-accordion-btn-color);text-align:left;background-color:var(--bs-accordion-btn-bg);border:0;border-radius:0;overflow-anchor:none;transition:var(--bs-accordion-transition)}@media(prefers-reduced-motion:reduce){:host ::ng-deep .accordion-button{transition:none}}:host ::ng-deep .accordion-button:not(.collapsed){color:var(--bs-accordion-active-color);background-color:var(--bs-accordion-active-bg);box-shadow:inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color)}:host ::ng-deep .accordion-button:not(.collapsed):after{background-image:var(--bs-accordion-btn-active-icon);transform:var(--bs-accordion-btn-icon-transform)}:host ::ng-deep .accordion-button:after{flex-shrink:0;width:var(--bs-accordion-btn-icon-width);height:var(--bs-accordion-btn-icon-width);margin-left:auto;content:\"\";background-image:var(--bs-accordion-btn-icon);background-repeat:no-repeat;background-size:var(--bs-accordion-btn-icon-width);transition:var(--bs-accordion-btn-icon-transition)}@media(prefers-reduced-motion:reduce){:host ::ng-deep .accordion-button:after{transition:none}}:host ::ng-deep .accordion-button:hover{z-index:2}:host ::ng-deep .accordion-button:focus{z-index:3;outline:0;box-shadow:var(--bs-accordion-btn-focus-box-shadow)}:host ::ng-deep .accordion-header{margin-bottom:0}:host ::ng-deep .accordion-item{color:var(--bs-accordion-color);background-color:var(--bs-accordion-bg);border:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}:host ::ng-deep .accordion-item:first-of-type{border-top-left-radius:var(--bs-accordion-border-radius);border-top-right-radius:var(--bs-accordion-border-radius)}:host ::ng-deep .accordion-item:first-of-type>.accordion-header .accordion-button{border-top-left-radius:var(--bs-accordion-inner-border-radius);border-top-right-radius:var(--bs-accordion-inner-border-radius)}:host ::ng-deep .accordion-item:not(:first-of-type){border-top:0}:host ::ng-deep .accordion-item:last-of-type{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}:host ::ng-deep .accordion-item:last-of-type>.accordion-header .accordion-button.collapsed{border-bottom-right-radius:var(--bs-accordion-inner-border-radius);border-bottom-left-radius:var(--bs-accordion-inner-border-radius)}:host ::ng-deep .accordion-item:last-of-type>.accordion-collapse{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}:host ::ng-deep .accordion-body{padding:var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x)}:host ::ng-deep .accordion-flush>.accordion-item{border-right:0;border-left:0;border-radius:0}:host ::ng-deep .accordion-flush>.accordion-item:first-child{border-top:0}:host ::ng-deep .accordion-flush>.accordion-item:last-child{border-bottom:0}:host ::ng-deep .accordion-flush>.accordion-item>.accordion-collapse,:host ::ng-deep .accordion-flush>.accordion-item>.accordion-header .accordion-button,:host ::ng-deep .accordion-flush>.accordion-item>.accordion-header .accordion-button.collapsed{border-radius:0}:host ::ng-deep [data-bs-theme=dark] .accordion-button:after{--bs-accordion-btn-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='rgb%28109.8, 168, 253.8%29'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e\");--bs-accordion-btn-active-icon: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='rgb%28109.8, 168, 253.8%29'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3e%3c/svg%3e\")}:host ::ng-deep bs-accordion{margin:-1px}\n"] }]
|
|
76
|
-
}], ctorParameters: () => [], propDecorators: { tabPages: [{ type: i0.ContentChildren, args: [forwardRef(() => BsAccordionTabComponent), { isSignal: true }] }], highlightActiveTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightActiveTab", required: false }] }], multi: [{ type: i0.Input, args: [{ isSignal: true, alias: "multi", required: false }] }] } });
|
|
77
|
-
|
|
78
|
-
class BsAccordionTabHeaderComponent {
|
|
79
|
-
constructor() {
|
|
80
|
-
this.accordionTab = inject(BsAccordionTabComponent);
|
|
124
|
+
/** Close every open tab, and every accordion nested inside them. */
|
|
125
|
+
closeAll() {
|
|
126
|
+
this.element()?.nativeElement.closeAll();
|
|
81
127
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
128
|
+
/** Drive a tab through the WC so nested accordions collapse with it. */
|
|
129
|
+
setActive(index, active) {
|
|
130
|
+
const accordion = this.element()?.nativeElement;
|
|
131
|
+
if (active)
|
|
132
|
+
accordion?.open(index);
|
|
133
|
+
else
|
|
134
|
+
accordion?.close(index);
|
|
85
135
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
136
|
+
onTabToggle(event) {
|
|
137
|
+
// Nesting is the normal case here and the WC's event is composed, so a
|
|
138
|
+
// descendant accordion's toggles pass straight through this host. Claim
|
|
139
|
+
// only our own — then stop, since this accordion has already handled it.
|
|
140
|
+
if (event.target !== this.element()?.nativeElement)
|
|
141
|
+
return;
|
|
142
|
+
event.stopPropagation();
|
|
143
|
+
const detail = event.detail;
|
|
144
|
+
this.tabPages()[detail.index]?.isActive.set(detail.active);
|
|
91
145
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type:
|
|
93
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
147
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: BsAccordionComponent, isStandalone: true, selector: "bs-accordion", inputs: { multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, highlightActiveTab: { classPropertyName: "highlightActiveTab", publicName: "highlightActiveTab", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "tabPages", predicate: i0.forwardRef(() => BsAccordionTabComponent), isSignal: true }], viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, isSignal: true }], ngImport: i0, template: "<mp-accordion\n #element\n [attr.multi]=\"multiAttr()\"\n [attr.highlight-active-tab]=\"highlightActiveTabAttr()\"\n (mp-accordion-tab-toggle)=\"onTabToggle($event)\">\n @for (tab of tabPages(); track tab; let i = $index) {\n <span accordion-header [attr.slot]=\"'h' + i\">\n @if (tab.headerTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.template\"></ng-container>\n }\n </span>\n }\n <ng-content></ng-content>\n</mp-accordion>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
94
148
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type:
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsAccordionComponent, decorators: [{
|
|
96
150
|
type: Component,
|
|
97
|
-
args: [{ selector: 'bs-accordion
|
|
98
|
-
}] });
|
|
151
|
+
args: [{ selector: 'bs-accordion', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<mp-accordion\n #element\n [attr.multi]=\"multiAttr()\"\n [attr.highlight-active-tab]=\"highlightActiveTabAttr()\"\n (mp-accordion-tab-toggle)=\"onTabToggle($event)\">\n @for (tab of tabPages(); track tab; let i = $index) {\n <span accordion-header [attr.slot]=\"'h' + i\">\n @if (tab.headerTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.template\"></ng-container>\n }\n </span>\n }\n <ng-content></ng-content>\n</mp-accordion>\n", styles: [":host{display:block}\n"] }]
|
|
152
|
+
}], propDecorators: { multi: [{ type: i0.Input, args: [{ isSignal: true, alias: "multi", required: false }] }], highlightActiveTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightActiveTab", required: false }] }], tabPages: [{ type: i0.ContentChildren, args: [forwardRef(() => BsAccordionTabComponent), { isSignal: true }] }], element: [{ type: i0.ViewChild, args: ['element', { isSignal: true }] }] } });
|
|
99
153
|
|
|
100
154
|
/**
|
|
101
155
|
* Generated bundle index. Do not edit.
|
|
102
156
|
*/
|
|
103
157
|
|
|
104
|
-
export { BsAccordionComponent, BsAccordionTabComponent,
|
|
158
|
+
export { BsAccordionComponent, BsAccordionTabComponent, BsAccordionTabHeaderDirective };
|
|
105
159
|
//# sourceMappingURL=mintplayer-ng-bootstrap-accordion.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-accordion.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab/accordion-tab.component.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab/accordion-tab.component.html","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion/accordion.component.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion/accordion.component.html","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab-header/accordion-tab-header.component.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab-header/accordion-tab-header.component.html","../../../../libs/mintplayer-ng-bootstrap/accordion/mintplayer-ng-bootstrap-accordion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, contentChildren, forwardRef, inject, model, computed, signal } from '@angular/core';\nimport { SlideUpDownAnimation } from '@mintplayer/ng-animations';\nimport { BsNoNoscriptDirective } from '@mintplayer/ng-bootstrap/no-noscript';\nimport { BsAccordionComponent } from '../accordion/accordion.component';\n\n@Component({\n selector: 'bs-accordion-tab',\n templateUrl: './accordion-tab.component.html',\n styleUrls: ['./accordion-tab.component.scss'],\n imports: [BsNoNoscriptDirective],\n animations: [SlideUpDownAnimation],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'accordion-item d-block',\n },\n})\nexport class BsAccordionTabComponent {\n accordion = inject(BsAccordionComponent);\n accordionTabId = signal<number>(0);\n accordionTabName = computed(() => `${this.accordion.accordionName()}-${this.accordionTabId()}`);\n readonly childAccordions = contentChildren<BsAccordionComponent>(forwardRef(() => BsAccordionComponent));\n\n constructor() {\n this.accordionTabId.set(++this.accordion.accordionTabCounter);\n }\n\n isActive = model<boolean>(false);\n\n setActive(value: boolean) {\n if (this.isActive() !== value) {\n this.isActive.set(value);\n if (value && !this.accordion.multi()) {\n this.accordion.tabPages().filter((tab) => {\n return tab !== this;\n }).forEach((tab) => {\n tab.isActive.set(false);\n });\n }\n if (!value) {\n this.childAccordions().forEach((accordion) => {\n accordion.tabPages().forEach((tab: BsAccordionTabComponent) => {\n tab.isActive.set(false);\n });\n });\n }\n }\n }\n}\n","<div [@.disabled]=\"accordion.animationsDisabled()\" bsNoNoscript>\n @if (accordion.multi()) {\n <input type=\"checkbox\" class=\"d-none\"\n [id]=\"accordionTabName()\"\n [checked]=\"isActive()\">\n } @else {\n <input type=\"radio\" class=\"d-none\"\n [name]=\"accordion.accordionName()\"\n [id]=\"accordionTabName()\"\n [checked]=\"isActive()\">\n }\n <ng-content select=\"bs-accordion-tab-header\"></ng-content>\n <div [id]=\"accordionTabName() + '-content'\"\n class=\"accordion-collapse collapse show overflow-hidden\"\n role=\"region\"\n [attr.aria-labelledby]=\"accordionTabName() + '-header'\"\n [@slideUpDown]=\"isActive()\">\n <div class=\"accordion-body p-0\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, contentChildren, forwardRef, inject, input, signal, computed } from '@angular/core';\nimport { BsReducedMotionDirective } from '@mintplayer/ng-bootstrap/reduced-motion';\nimport { BsAccordionTabComponent } from '../accordion-tab/accordion-tab.component';\n\n@Component({\n selector: 'bs-accordion',\n templateUrl: './accordion.component.html',\n styleUrls: ['./accordion.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [BsReducedMotionDirective],\n})\nexport class BsAccordionComponent {\n private readonly reducedMotion = inject(BsReducedMotionDirective);\n\n constructor() {\n this.accordionId = signal(++BsAccordionComponent.accordionCounter);\n }\n\n readonly tabPages = contentChildren<BsAccordionTabComponent>(forwardRef(() => BsAccordionTabComponent));\n readonly animationsDisabled = computed(() => this.reducedMotion.matches());\n highlightActiveTab = input(false);\n multi = input(false);\n\n accordionId = signal<number>(0);\n accordionName = computed(() => `bs-accordion-${this.accordionId()}`);\n accordionTabCounter = 0;\n static accordionCounter = 0;\n}\n","<div class=\"accordion\">\n <ng-content></ng-content>\n</div>","import { Component, inject, ChangeDetectionStrategy} from '@angular/core';\nimport { BsAccordionTabComponent } from '../accordion-tab/accordion-tab.component';\n\n@Component({\n selector: 'bs-accordion-tab-header',\n templateUrl: './accordion-tab-header.component.html',\n styleUrls: ['./accordion-tab-header.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsAccordionTabHeaderComponent {\n accordionTab = inject(BsAccordionTabComponent);\n\n headerClicked(event: Event) {\n event.preventDefault();\n this.accordionTab.setActive(!this.accordionTab.isActive());\n }\n\n headerKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.accordionTab.setActive(!this.accordionTab.isActive());\n }\n }\n}\n","<h2 class=\"accordion-header\">\n <label role=\"button\"\n tabindex=\"0\"\n class=\"accordion-button\"\n [for]=\"accordionTab.accordionTabName()\"\n [id]=\"accordionTab.accordionTabName() + '-header'\"\n [class.collapsed]=\"!accordionTab.isActive()\"\n [class.bg-unset]=\"!accordionTab.accordion.highlightActiveTab()\"\n [attr.aria-expanded]=\"accordionTab.isActive()\"\n [attr.aria-controls]=\"accordionTab.accordionTabName() + '-content'\"\n (click)=\"headerClicked($event)\"\n (keydown)=\"headerKeydown($event)\">\n <ng-content></ng-content>\n </label>\n</h2>","/**\n * Generated bundle index. Do not edit.\n */\n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A,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,mFCT1C,uoBAcK,EAAA,MAAA,EAAA,CAAA,+BAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDLQ,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBANzC,SAAS;+BACE,yBAAyB,EAAA,eAAA,EAGlB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,uoBAAA,EAAA,MAAA,EAAA,CAAA,+BAAA,CAAA,EAAA;;;AEPjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-accordion.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab-header/accordion-tab-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab/accordion-tab.component.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion-tab/accordion-tab.component.html","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion/accordion.component.ts","../../../../libs/mintplayer-ng-bootstrap/accordion/src/accordion/accordion.component.html","../../../../libs/mintplayer-ng-bootstrap/accordion/mintplayer-ng-bootstrap-accordion.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * `*bsAccordionTabHeader` — declares the header content of the enclosing\n * `<bs-accordion-tab>`.\n *\n * It is a template rather than projected content because the header has to\n * end up as a direct child of `<mp-accordion>` (named slots accept nothing\n * else) while being authored inside the tab it belongs to. The parent\n * accordion renders each captured template into the matching header slot.\n *\n * Mirrors `*bsTabPageHeader` on `bs-tab-control`. Replaces the former\n * `<bs-accordion-tab-header>` component.\n *\n * <bs-accordion>\n * <bs-accordion-tab>\n * <ng-container *bsAccordionTabHeader>Profile</ng-container>\n * Body content here\n * </bs-accordion-tab>\n * </bs-accordion>\n */\n@Directive({\n selector: '[bsAccordionTabHeader]',\n})\nexport class BsAccordionTabHeaderDirective {\n readonly template = inject(TemplateRef);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n inject,\n input,\n model,\n} from '@angular/core';\nimport { BsAccordionComponent } from '../accordion/accordion.component';\nimport { BsAccordionTabHeaderDirective } from '../accordion-tab-header/accordion-tab-header.directive';\n\n/**\n * `<bs-accordion-tab>` — one tab of a `<bs-accordion>`.\n *\n * This host element IS the tab marker the web component reads: it carries\n * `accordion-tab`, its index slot and the tab's state, and its projected\n * children become the tab body. There is no separate `<mp-accordion-tab>`\n * here — an Angular component can only render inside its own host, which\n * would put that element one level too deep to be slotted.\n *\n * The header is declared with `*bsAccordionTabHeader` and rendered by the\n * parent accordion (see `BsAccordionComponent`).\n */\n@Component({\n selector: 'bs-accordion-tab',\n templateUrl: './accordion-tab.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'accordion-tab': '',\n '[attr.slot]': '\"c\" + index()',\n '[attr.is-active]': 'isActive() ? \"\" : null',\n '[attr.disabled]': 'disabled() ? \"\" : null',\n },\n})\nexport class BsAccordionTabComponent {\n readonly accordion = inject(BsAccordionComponent);\n\n /** Two-way: whether this tab is open. */\n readonly isActive = model<boolean>(false);\n readonly disabled = input<boolean>(false);\n\n readonly headerTemplate = contentChild(BsAccordionTabHeaderDirective);\n\n /** Position among its siblings — the tab's identity for slots and events. */\n readonly index = computed(() => this.accordion.tabPages().indexOf(this));\n\n /**\n * Open or close this tab through the web component, so single-open\n * exclusivity and the nested-accordion collapse both apply — unlike\n * writing `isActive` directly.\n */\n setActive(value: boolean): void {\n this.accordion.setActive(this.index(), value);\n }\n}\n","<ng-content></ng-content>\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n CUSTOM_ELEMENTS_SCHEMA,\n ElementRef,\n forwardRef,\n input,\n viewChild,\n} from '@angular/core';\n// Eager side-effect registration: the SSR chrome is injected as Declarative\n// Shadow DOM, so there is no unstyled window to protect by deferring.\nimport '@mintplayer/web-components/accordion';\nimport type { AccordionTabToggleDetail, MpAccordion } from '@mintplayer/web-components/accordion';\nimport { BsAccordionTabComponent } from '../accordion-tab/accordion-tab.component';\n\n/**\n * `<bs-accordion>` — Angular wrapper around the `<mp-accordion>` web component.\n *\n * <bs-accordion [multi]=\"true\">\n * <bs-accordion-tab [(isActive)]=\"open\">\n * <ng-container *bsAccordionTabHeader>Profile</ng-container>\n * Body content\n * </bs-accordion-tab>\n * </bs-accordion>\n *\n * Each tab's header is HOISTED out of the tab and rendered here, as a sibling\n * of the tab's own marker element. Named slots only accept direct children of\n * the shadow host, and an Angular component can only render inside its own\n * host element — so a header authored inside `<bs-accordion-tab>` could never\n * reach the accordion's shadow on its own. `*bsAccordionTabHeader` captures it\n * as a template that this component renders in the right place.\n *\n * The WC owns interaction, ARIA, animation and the no-JS tier; this wrapper\n * bridges inputs to attributes and the toggle event back into each tab's\n * `isActive` model.\n */\n@Component({\n selector: 'bs-accordion',\n templateUrl: './accordion.component.html',\n styleUrls: ['./accordion.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class BsAccordionComponent {\n /** Allow several tabs to stay open at once (checkbox machine with JS off). */\n readonly multi = input(false);\n /** Paint the open header with the Bootstrap active background. */\n readonly highlightActiveTab = input(false);\n\n readonly tabPages = contentChildren<BsAccordionTabComponent>(\n forwardRef(() => BsAccordionTabComponent),\n );\n\n protected readonly element = viewChild<ElementRef<MpAccordion>>('element');\n\n protected readonly multiAttr = computed(() => (this.multi() ? '' : null));\n protected readonly highlightActiveTabAttr = computed(() =>\n this.highlightActiveTab() ? '' : null,\n );\n\n /** Close every open tab, and every accordion nested inside them. */\n closeAll(): void {\n this.element()?.nativeElement.closeAll();\n }\n\n /** Drive a tab through the WC so nested accordions collapse with it. */\n setActive(index: number, active: boolean): void {\n const accordion = this.element()?.nativeElement;\n if (active) accordion?.open(index);\n else accordion?.close(index);\n }\n\n protected onTabToggle(event: Event): void {\n // Nesting is the normal case here and the WC's event is composed, so a\n // descendant accordion's toggles pass straight through this host. Claim\n // only our own — then stop, since this accordion has already handled it.\n if (event.target !== this.element()?.nativeElement) return;\n event.stopPropagation();\n\n const detail = (event as CustomEvent<AccordionTabToggleDetail>).detail;\n this.tabPages()[detail.index]?.isActive.set(detail.active);\n }\n}\n","<mp-accordion\n #element\n [attr.multi]=\"multiAttr()\"\n [attr.highlight-active-tab]=\"highlightActiveTabAttr()\"\n (mp-accordion-tab-toggle)=\"onTabToggle($event)\">\n @for (tab of tabPages(); track tab; let i = $index) {\n <span accordion-header [attr.slot]=\"'h' + i\">\n @if (tab.headerTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.template\"></ng-container>\n }\n </span>\n }\n <ng-content></ng-content>\n</mp-accordion>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;AAkBG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAIW,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;AACxC,IAAA;8GAFY,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA7B,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA7B,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE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