@mintplayer/ng-bootstrap 22.4.0 → 22.5.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.
@@ -1,206 +1,179 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, computed, afterNextRender, ChangeDetectionStrategy, Component, signal, contentChildren } from '@angular/core';
3
- import { BsDropdownDirective } from '@mintplayer/ng-bootstrap/dropdown';
4
- import { BsIdService } from '@mintplayer/ng-bootstrap/a11y';
2
+ import { InjectionToken, input, output, computed, afterNextRender, ViewEncapsulation, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component, inject, ElementRef, effect, Directive } from '@angular/core';
5
3
 
6
- class BsDropdownItemComponent {
7
- /**
8
- * Resolved after first render so static `id="…"` attributes set by the consumer
9
- * and any sibling host bindings have applied first. Read-only access for any
10
- * other directive on the same element (e.g. BsRovingFocusItem) that needs a
11
- * stable target id for aria-activedescendant.
12
- */
13
- get itemId() {
14
- return this.elementRef.nativeElement.id;
4
+ /**
5
+ * DI marker meaning "this content is authored inside a dropdown menu".
6
+ *
7
+ * Provided by `BsDropdownMenuComponent` and `BsNavbarDropdownComponent`;
8
+ * optionally injected by context-aware children (`bs-navbar-item`) to render
9
+ * their `.dropdown-item` shape instead of their nav-link shape, so the same
10
+ * item element works at every nesting level of a navbar.
11
+ *
12
+ * Element injectors follow the CONSUMER template's nesting (not the projection
13
+ * site), so any `<bs-navbar-item>` written between the tags of either provider
14
+ * sees the token — including content projected through `<ng-content>`.
15
+ */
16
+ const BS_DROPDOWN_MENU_CONTEXT = new InjectionToken('BS_DROPDOWN_MENU_CONTEXT');
17
+
18
+ /**
19
+ * `<bs-dropdown-menu>` — Angular wrapper around the `<mp-dropdown-menu>` web
20
+ * component. This is the single dropdown-menu implementation: it is used
21
+ * standalone (projected through `*bsDropdownMenu` by the `[bsDropdown]` trigger
22
+ * stack), inside `<bs-navbar>`, and as the listbox panel for the combobox /
23
+ * typeahead (`mode="listbox"`).
24
+ *
25
+ * Keyboard navigation, roving tabindex, the ARIA roles and the theme-aware
26
+ * styling all live in the WC (single source of UI truth). This wrapper bridges
27
+ * inputs to attributes and projects `[bsDropdownItem]` / `[bsDropdownDivider]` /
28
+ * `[bsDropdownHeader]` `<li>`s into the WC's default slot.
29
+ *
30
+ * The WC is registered **client-side only** (`afterNextRender`); on the server
31
+ * Angular emits a bare `<mp-dropdown-menu>` tag and the SSR layer injects its
32
+ * Declarative Shadow DOM (see `injectMpDropdownDsd`), so it renders with JS off.
33
+ *
34
+ * This wrapper stays framework-agnostic of the `[bsDropdown]` trigger stack (it
35
+ * lives in a sibling entry point). When projected as a combobox/listbox panel,
36
+ * the consumer sets `mode="listbox"` and mirrors the trigger's `menuId`/
37
+ * `popupRole` onto this host (`[attr.id]`/`[attr.role]`) via the exported
38
+ * `bsDropdown` reference — the same directive the toggle and combobox read.
39
+ */
40
+ class BsDropdownMenuComponent {
41
+ onSelect(event) {
42
+ // The WC's `select` is a general-purpose DOM event (bubbles + composed).
43
+ // The public Angular API is this typed `output()`, so consume the raw
44
+ // event here. Without `stopPropagation` it keeps bubbling to the consumer's
45
+ // `<bs-dropdown-menu>` host, where their `(select)` binding fires a
46
+ // SECOND time with the raw `CustomEvent` (Angular doesn't unwrap `.detail`).
47
+ event.stopPropagation();
48
+ this.select.emit(event.detail);
15
49
  }
16
50
  constructor() {
17
- this.parent = inject(BsDropdownDirective, { optional: true });
18
- this.menu = inject(BsDropdownMenuComponent, { optional: true });
19
- /** Public so BsDropdownMenuComponent can imperatively focus this item during keyboard nav. */
20
- this.elementRef = inject(ElementRef);
21
- this.ids = inject(BsIdService);
22
- this.isSelected = input(false, /* @ts-ignore */
23
- ...(ngDevMode ? [{ debugName: "isSelected" }] : /* istanbul ignore next */ []));
24
- this.disabled = input(false, /* @ts-ignore */
25
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
26
- this.itemRole = computed(() => this.parent?.popupRole() === 'listbox' ? 'option' : 'menuitem', /* @ts-ignore */
27
- ...(ngDevMode ? [{ debugName: "itemRole" }] : /* istanbul ignore next */ []));
28
- this.ariaSelected = computed(() => {
29
- if (this.parent?.popupRole() !== 'listbox')
30
- return null;
31
- return this.isSelected() ? 'true' : 'false';
32
- }, /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "ariaSelected" }] : /* istanbul ignore next */ []));
34
51
  /**
35
- * Roving tabindex in menu mode: the focused item is 0, others -1.
36
- * In listbox mode (typeahead/tree-select/etc.), the consumer applies bsRovingFocusItem
37
- * externally for activedescendant management; this binding stays null so it
38
- * doesn't fight that directive.
52
+ * `menu` (default, roving-tabindex nav) | `listbox` (consumer manages focus).
53
+ *
54
+ * Aliased to `menuMode` so it never collides with the `mode` input of the
55
+ * a11y `bsRovingFocus` directive when a combobox/listbox stacks both on this
56
+ * one element (same reason `bsCombobox` aliases its `autocomplete`).
39
57
  */
40
- this.tabindex = computed(() => {
41
- if (!this.menu?.isMenuMode())
42
- return null;
43
- if (this.disabled())
44
- return -1;
45
- return this.menu.isItemFocused(this) ? 0 : -1;
58
+ this.mode = input('menu', { ...(ngDevMode ? { debugName: "mode" } : /* istanbul ignore next */ {}), alias: 'menuMode' });
59
+ /** Pixel cap on the menu height; scrolls beyond. */
60
+ this.maxHeight = input(/* @ts-ignore */
61
+ ...(ngDevMode ? [undefined, { debugName: "maxHeight" }] : /* istanbul ignore next */ []));
62
+ /** Id of an external label, set as `aria-labelledby` on the WC's list. */
63
+ this.labelId = input(/* @ts-ignore */
64
+ ...(ngDevMode ? [undefined, { debugName: "labelId" }] : /* istanbul ignore next */ []));
65
+ /** Fires when an enabled item is activated (re-emits the WC's `select`). */
66
+ this.select = output();
67
+ /** `max-height` attribute is numeric-or-absent; derive once via a signal. */
68
+ this.maxHeightAttr = computed(() => {
69
+ const value = this.maxHeight();
70
+ return value === undefined ? null : `${value}`;
46
71
  }, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
72
+ ...(ngDevMode ? [{ debugName: "maxHeightAttr" }] : /* istanbul ignore next */ []));
73
+ this.labelIdAttr = computed(() => this.labelId() ?? null, /* @ts-ignore */
74
+ ...(ngDevMode ? [{ debugName: "labelIdAttr" }] : /* istanbul ignore next */ []));
48
75
  afterNextRender(() => {
49
- if (!this.elementRef.nativeElement.id) {
50
- this.elementRef.nativeElement.id = this.ids.next('bs-dropdown-item');
51
- }
76
+ // Side-effect import registers <mp-dropdown-menu> and friends; client-only
77
+ // so SSR stays a bare tag for DSD injection.
78
+ import('@mintplayer/web-components/dropdown-menu');
52
79
  });
53
80
  }
54
- onFocus() {
55
- this.menu?.setFocusedItem(this);
56
- }
57
- onActivate(event) {
58
- if (this.disabled())
59
- return;
60
- event.preventDefault();
61
- this.elementRef.nativeElement.click();
62
- }
63
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
64
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: BsDropdownItemComponent, isStandalone: true, selector: "bs-dropdown-item", inputs: { isSelected: { classPropertyName: "isSelected", publicName: "isSelected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "onFocus()", "keydown.enter": "onActivate($event)", "keydown.space": "onActivate($event)" }, properties: { "attr.role": "itemRole()", "attr.aria-selected": "ariaSelected()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "tabindex()" } }, ngImport: i0, template: "<li role=\"presentation\" class=\"dropdown-item cursor-pointer\" [class.active]=\"isSelected()\" [class.disabled]=\"disabled()\">\n <ng-content></ng-content>\n</li>\n", styles: [":host(.bs-rovingfocus-active)>.dropdown-item:not(.disabled):not(.active){color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
81
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
82
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: BsDropdownMenuComponent, isStandalone: true, selector: "bs-dropdown-menu", inputs: { mode: { classPropertyName: "mode", publicName: "menuMode", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, labelId: { classPropertyName: "labelId", publicName: "labelId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select" }, providers: [{ provide: BS_DROPDOWN_MENU_CONTEXT, useValue: true }], ngImport: i0, template: "<mp-dropdown-menu [attr.mode]=\"mode()\" [attr.max-height]=\"maxHeightAttr()\" [attr.label-id]=\"labelIdAttr()\" (select)=\"onSelect($event)\">\n <ng-content></ng-content>\n</mp-dropdown-menu>\n", styles: [".dropdown-item>a,.dropdown-item>button{display:block;width:auto;margin:calc(-1 * var(--bs-dropdown-item-padding-y, .25rem)) calc(-1 * var(--bs-dropdown-item-padding-x, 1rem));padding:var(--bs-dropdown-item-padding-y, .25rem) var(--bs-dropdown-item-padding-x, 1rem);color:inherit;text-decoration:none;text-align:inherit;background:none;border:0;font:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
65
83
  }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownItemComponent, decorators: [{
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownMenuComponent, decorators: [{
67
85
  type: Component,
68
- args: [{ selector: 'bs-dropdown-item', changeDetection: ChangeDetectionStrategy.OnPush, host: {
69
- '[attr.role]': 'itemRole()',
70
- '[attr.aria-selected]': 'ariaSelected()',
71
- '[attr.aria-disabled]': 'disabled() ? "true" : null',
72
- '[attr.tabindex]': 'tabindex()',
73
- '(focus)': 'onFocus()',
74
- '(keydown.enter)': 'onActivate($event)',
75
- '(keydown.space)': 'onActivate($event)',
76
- }, template: "<li role=\"presentation\" class=\"dropdown-item cursor-pointer\" [class.active]=\"isSelected()\" [class.disabled]=\"disabled()\">\n <ng-content></ng-content>\n</li>\n", styles: [":host(.bs-rovingfocus-active)>.dropdown-item:not(.disabled):not(.active){color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}\n"] }]
77
- }], ctorParameters: () => [], propDecorators: { isSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSelected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
86
+ args: [{ selector: 'bs-dropdown-menu', changeDetection: ChangeDetectionStrategy.OnPush, schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [{ provide: BS_DROPDOWN_MENU_CONTEXT, useValue: true }], encapsulation: ViewEncapsulation.None, template: "<mp-dropdown-menu [attr.mode]=\"mode()\" [attr.max-height]=\"maxHeightAttr()\" [attr.label-id]=\"labelIdAttr()\" (select)=\"onSelect($event)\">\n <ng-content></ng-content>\n</mp-dropdown-menu>\n", styles: [".dropdown-item>a,.dropdown-item>button{display:block;width:auto;margin:calc(-1 * var(--bs-dropdown-item-padding-y, .25rem)) calc(-1 * var(--bs-dropdown-item-padding-x, 1rem));padding:var(--bs-dropdown-item-padding-y, .25rem) var(--bs-dropdown-item-padding-x, 1rem);color:inherit;text-decoration:none;text-align:inherit;background:none;border:0;font:inherit}\n"] }]
87
+ }], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuMode", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], labelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelId", required: false }] }], select: [{ type: i0.Output, args: ["select"] }] } });
78
88
 
79
- class BsDropdownMenuComponent {
89
+ /**
90
+ * `[bsDropdownItem]` — marks a plain `<li>` as a Bootstrap `.dropdown-item`
91
+ * inside a `<bs-dropdown-menu>`. There is no per-item web component: the item is
92
+ * light-DOM `<li>` slotted into `<mp-dropdown-menu>`, whose shadow styles the box
93
+ * via `::slotted(.dropdown-item)`. A nested `<a>`/`<button>` (e.g. a `routerLink`)
94
+ * is reset by the companion light-DOM stylesheet the menu wrapper ships.
95
+ *
96
+ * Usage: `<li bsDropdownItem><a routerLink="/x">Action</a></li>`.
97
+ *
98
+ * Inputs:
99
+ * - `active` — Bootstrap `.active` appearance (also drives `aria-selected` in
100
+ * a `listbox` menu).
101
+ * - `disabled` — non-interactive; removed from the menu's roving order.
102
+ * - `value` — opaque value carried in the menu's `select` event detail;
103
+ * assigned as a `value` property on the host `<li>` (the WC reads it).
104
+ */
105
+ class BsDropdownItemDirective {
80
106
  constructor() {
81
- this.bsDropdown = inject(BsDropdownDirective, { optional: true });
82
- this.maxHeight = input(null, /* @ts-ignore */
83
- ...(ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []));
84
- this.dropdownWith = signal(null, /* @ts-ignore */
85
- ...(ngDevMode ? [{ debugName: "dropdownWith" }] : /* istanbul ignore next */ []));
86
- this.menuRole = computed(() => this.bsDropdown?.popupRole() ?? null, /* @ts-ignore */
87
- ...(ngDevMode ? [{ debugName: "menuRole" }] : /* istanbul ignore next */ []));
88
- this.menuId = computed(() => this.bsDropdown?.menuId() || null, /* @ts-ignore */
89
- ...(ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []));
90
- /**
91
- * Items projected into this menu. Used in menu mode (popupRole='menu') to
92
- * implement roving-tabindex keyboard navigation. In listbox mode, callers
93
- * (typeahead/tree-select/etc.) typically apply their own bsRovingFocus directly,
94
- * so this menu's keyboard handler is a no-op.
95
- */
96
- this.dropdownItems = contentChildren(BsDropdownItemComponent, { ...(ngDevMode ? { debugName: "dropdownItems" } : /* istanbul ignore next */ {}), descendants: true });
97
- /** True when this is a plain menu (default), false when used as a combobox listbox. */
98
- this.isMenuMode = computed(() => this.bsDropdown?.popupRole() !== 'listbox', /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "isMenuMode" }] : /* istanbul ignore next */ []));
100
- /** Index into dropdownItems() of the item that currently holds the roving tabindex (menu mode). */
101
- this.focusedIndex = signal(0, /* @ts-ignore */
102
- ...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
103
- }
104
- isItemFocused(item) {
105
- if (!this.isMenuMode())
106
- return false;
107
- return this.dropdownItems()[this.focusedIndex()] === item;
108
- }
109
- setFocusedItem(item) {
110
- if (!this.isMenuMode())
111
- return;
112
- const idx = this.dropdownItems().indexOf(item);
113
- if (idx >= 0)
114
- this.focusedIndex.set(idx);
115
- }
116
- onResize() {
117
- if ((typeof window !== 'undefined') && this.bsDropdown && this.bsDropdown.sameDropdownWidth()) {
118
- const element = this.bsDropdown.elementRef.nativeElement;
119
- this.dropdownWith.set(window.getComputedStyle(element).width);
120
- }
121
- }
122
- ngAfterViewInit() {
123
- this.onResize();
124
- }
125
- onKeydown(event) {
126
- if (!this.isMenuMode())
127
- return;
128
- const items = this.dropdownItems();
129
- if (items.length === 0)
130
- return;
131
- let handled = false;
132
- switch (event.key) {
133
- case 'ArrowDown':
134
- this.moveFocus(+1);
135
- handled = true;
136
- break;
137
- case 'ArrowUp':
138
- this.moveFocus(-1);
139
- handled = true;
140
- break;
141
- case 'Home':
142
- this.moveTo(this.firstEnabledIndex());
143
- handled = true;
144
- break;
145
- case 'End':
146
- this.moveTo(this.lastEnabledIndex());
147
- handled = true;
148
- break;
149
- }
150
- if (handled)
151
- event.preventDefault();
152
- }
153
- moveFocus(delta) {
154
- const items = this.dropdownItems();
155
- const total = items.length;
156
- if (total === 0)
157
- return;
158
- let cursor = this.focusedIndex();
159
- for (let i = 0; i < total; i++) {
160
- cursor = (cursor + delta + total) % total;
161
- if (!items[cursor].disabled()) {
162
- this.moveTo(cursor);
163
- return;
164
- }
165
- }
166
- }
167
- firstEnabledIndex() {
168
- return this.dropdownItems().findIndex(it => !it.disabled());
169
- }
170
- lastEnabledIndex() {
171
- const items = this.dropdownItems();
172
- for (let i = items.length - 1; i >= 0; i--) {
173
- if (!items[i].disabled())
174
- return i;
175
- }
176
- return -1;
177
- }
178
- moveTo(index) {
179
- if (index < 0)
180
- return;
181
- this.focusedIndex.set(index);
182
- const target = this.dropdownItems()[index];
183
- if (target) {
184
- target.elementRef.nativeElement.focus();
185
- }
107
+ this.active = input(false, /* @ts-ignore */
108
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
109
+ this.disabled = input(false, /* @ts-ignore */
110
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
111
+ /** Opaque value carried in the menu's `select` event detail. */
112
+ this.value = input(/* @ts-ignore */
113
+ ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
114
+ const el = inject(ElementRef);
115
+ effect(() => {
116
+ el.nativeElement.value = this.value();
117
+ });
186
118
  }
187
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
188
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.0", type: BsDropdownMenuComponent, isStandalone: true, selector: "bs-dropdown-menu", inputs: { maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()", "keydown": "onKeydown($event)" }, properties: { "style.width": "dropdownWith()", "attr.role": "menuRole()", "attr.id": "menuId()" } }, queries: [{ propertyName: "dropdownItems", predicate: BsDropdownItemComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ul role=\"presentation\" class=\"dropdown-menu position-static w-100 overflow-auto show\" [style.max-height.px]=\"maxHeight()\">\n <ng-content></ng-content>\n</ul>\n", styles: [":host ::ng-deep .dropup,:host ::ng-deep .dropend,:host ::ng-deep .dropdown,:host ::ng-deep .dropstart,:host ::ng-deep .dropup-center,:host ::ng-deep .dropdown-center{position:relative}:host ::ng-deep .dropdown-toggle{white-space:nowrap}:host ::ng-deep .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}:host ::ng-deep .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropdown-menu{--bs-dropdown-zindex: 1000;--bs-dropdown-min-width: 10rem;--bs-dropdown-padding-x: 0;--bs-dropdown-padding-y: .5rem;--bs-dropdown-spacer: .125rem;--bs-dropdown-font-size: 1rem;--bs-dropdown-color: var(--bs-body-color);--bs-dropdown-bg: var(--bs-body-bg);--bs-dropdown-border-color: var(--bs-border-color-translucent);--bs-dropdown-border-radius: var(--bs-border-radius);--bs-dropdown-border-width: var(--bs-border-width);--bs-dropdown-inner-border-radius: calc(var(--bs-border-radius) - var(--bs-border-width));--bs-dropdown-divider-bg: var(--bs-border-color-translucent);--bs-dropdown-divider-margin-y: .5rem;--bs-dropdown-box-shadow: var(--bs-box-shadow);--bs-dropdown-link-color: var(--bs-body-color);--bs-dropdown-link-hover-color: var(--bs-body-color);--bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: var(--bs-tertiary-color);--bs-dropdown-item-padding-x: 1rem;--bs-dropdown-item-padding-y: .25rem;--bs-dropdown-header-color: #6c757d;--bs-dropdown-header-padding-x: 1rem;--bs-dropdown-header-padding-y: .5rem;position:absolute;z-index:var(--bs-dropdown-zindex);display:none;min-width:var(--bs-dropdown-min-width);padding:var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);margin:0;font-size:var(--bs-dropdown-font-size);color:var(--bs-dropdown-color);text-align:left;list-style:none;background-color:var(--bs-dropdown-bg);background-clip:padding-box;border:var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);border-radius:var(--bs-dropdown-border-radius)}:host ::ng-deep .dropdown-menu[data-bs-popper]{top:100%;left:0;margin-top:var(--bs-dropdown-spacer)}:host ::ng-deep .dropdown-menu-start{--bs-position: start}:host ::ng-deep .dropdown-menu-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-end{--bs-position: end}:host ::ng-deep .dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media(min-width:576px){:host ::ng-deep .dropdown-menu-sm-start{--bs-position: start}:host ::ng-deep .dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-sm-end{--bs-position: end}:host ::ng-deep .dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media(min-width:768px){:host ::ng-deep .dropdown-menu-md-start{--bs-position: start}:host ::ng-deep .dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-md-end{--bs-position: end}:host ::ng-deep .dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media(min-width:992px){:host ::ng-deep .dropdown-menu-lg-start{--bs-position: start}:host ::ng-deep .dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-lg-end{--bs-position: end}:host ::ng-deep .dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media(min-width:1200px){:host ::ng-deep .dropdown-menu-xl-start{--bs-position: start}:host ::ng-deep .dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-xl-end{--bs-position: end}:host ::ng-deep .dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media(min-width:1400px){:host ::ng-deep .dropdown-menu-xxl-start{--bs-position: start}:host ::ng-deep .dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-xxl-end{--bs-position: end}:host ::ng-deep .dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}:host ::ng-deep .dropup .dropdown-menu[data-bs-popper]{top:auto;bottom:100%;margin-top:0;margin-bottom:var(--bs-dropdown-spacer)}:host ::ng-deep .dropup .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}:host ::ng-deep .dropup .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropend .dropdown-menu[data-bs-popper]{top:0;right:auto;left:100%;margin-top:0;margin-left:var(--bs-dropdown-spacer)}:host ::ng-deep .dropend .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}:host ::ng-deep .dropend .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropend .dropdown-toggle:after{vertical-align:0}:host ::ng-deep .dropstart .dropdown-menu[data-bs-popper]{top:0;right:100%;left:auto;margin-top:0;margin-right:var(--bs-dropdown-spacer)}:host ::ng-deep .dropstart .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\"}:host ::ng-deep .dropstart .dropdown-toggle:after{display:none}:host ::ng-deep .dropstart .dropdown-toggle:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}:host ::ng-deep .dropstart .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropstart .dropdown-toggle:before{vertical-align:0}:host ::ng-deep .dropdown-divider{height:0;margin:var(--bs-dropdown-divider-margin-y) 0;overflow:hidden;border-top:1px solid var(--bs-dropdown-divider-bg);opacity:1}:host ::ng-deep .dropdown-item{display:block;width:100%;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);clear:both;font-weight:400;color:var(--bs-dropdown-link-color);text-align:inherit;text-decoration:none;white-space:nowrap;background-color:transparent;border:0;border-radius:var(--bs-dropdown-item-border-radius, 0)}:host ::ng-deep .dropdown-item:hover,:host ::ng-deep .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}:host ::ng-deep .dropdown-item.active,:host ::ng-deep .dropdown-item:active{color:var(--bs-dropdown-link-active-color);text-decoration:none;background-color:var(--bs-dropdown-link-active-bg)}:host ::ng-deep .dropdown-item.disabled,:host ::ng-deep .dropdown-item:disabled{color:var(--bs-dropdown-link-disabled-color);pointer-events:none;background-color:transparent}:host ::ng-deep .dropdown-menu.show{display:block}:host ::ng-deep .dropdown-header{display:block;padding:var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);margin-bottom:0;font-size:.875rem;color:var(--bs-dropdown-header-color);white-space:nowrap}:host ::ng-deep .dropdown-item-text{display:block;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);color:var(--bs-dropdown-link-color)}:host ::ng-deep .dropdown-menu-dark{--bs-dropdown-color: #dee2e6;--bs-dropdown-bg: #343a40;--bs-dropdown-border-color: var(--bs-border-color-translucent);--bs-dropdown-box-shadow: ;--bs-dropdown-link-color: #dee2e6;--bs-dropdown-link-hover-color: #fff;--bs-dropdown-divider-bg: var(--bs-border-color-translucent);--bs-dropdown-link-hover-bg: rgba(255, 255, 255, .15);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: #adb5bd;--bs-dropdown-header-color: #adb5bd}:host ::ng-deep .dropdown-menu{--bs-dropdown-color: var(--bs-body-color);--bs-dropdown-bg: var(--bs-body-bg);--bs-dropdown-border-color: var(--bs-border-color);--bs-dropdown-link-color: var(--bs-body-color);--bs-dropdown-link-hover-color: var(--bs-emphasis-color);--bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: var(--bs-primary);--bs-dropdown-link-disabled-color: var(--bs-secondary-color);--bs-dropdown-divider-bg: var(--bs-border-color);--bs-dropdown-header-color: var(--bs-secondary-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
120
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: BsDropdownItemDirective, isStandalone: true, selector: "[bsDropdownItem]", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dropdown-item": "true", "class.active": "active()", "class.disabled": "disabled()", "attr.aria-disabled": "disabled() ? 'true' : null" } }, ngImport: i0 }); }
189
121
  }
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownMenuComponent, decorators: [{
191
- type: Component,
192
- args: [{ selector: 'bs-dropdown-menu', changeDetection: ChangeDetectionStrategy.OnPush, host: {
193
- '[style.width]': 'dropdownWith()',
194
- '(window:resize)': 'onResize()',
195
- '[attr.role]': 'menuRole()',
196
- '[attr.id]': 'menuId()',
197
- '(keydown)': 'onKeydown($event)',
198
- }, template: "<ul role=\"presentation\" class=\"dropdown-menu position-static w-100 overflow-auto show\" [style.max-height.px]=\"maxHeight()\">\n <ng-content></ng-content>\n</ul>\n", styles: [":host ::ng-deep .dropup,:host ::ng-deep .dropend,:host ::ng-deep .dropdown,:host ::ng-deep .dropstart,:host ::ng-deep .dropup-center,:host ::ng-deep .dropdown-center{position:relative}:host ::ng-deep .dropdown-toggle{white-space:nowrap}:host ::ng-deep .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}:host ::ng-deep .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropdown-menu{--bs-dropdown-zindex: 1000;--bs-dropdown-min-width: 10rem;--bs-dropdown-padding-x: 0;--bs-dropdown-padding-y: .5rem;--bs-dropdown-spacer: .125rem;--bs-dropdown-font-size: 1rem;--bs-dropdown-color: var(--bs-body-color);--bs-dropdown-bg: var(--bs-body-bg);--bs-dropdown-border-color: var(--bs-border-color-translucent);--bs-dropdown-border-radius: var(--bs-border-radius);--bs-dropdown-border-width: var(--bs-border-width);--bs-dropdown-inner-border-radius: calc(var(--bs-border-radius) - var(--bs-border-width));--bs-dropdown-divider-bg: var(--bs-border-color-translucent);--bs-dropdown-divider-margin-y: .5rem;--bs-dropdown-box-shadow: var(--bs-box-shadow);--bs-dropdown-link-color: var(--bs-body-color);--bs-dropdown-link-hover-color: var(--bs-body-color);--bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: var(--bs-tertiary-color);--bs-dropdown-item-padding-x: 1rem;--bs-dropdown-item-padding-y: .25rem;--bs-dropdown-header-color: #6c757d;--bs-dropdown-header-padding-x: 1rem;--bs-dropdown-header-padding-y: .5rem;position:absolute;z-index:var(--bs-dropdown-zindex);display:none;min-width:var(--bs-dropdown-min-width);padding:var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);margin:0;font-size:var(--bs-dropdown-font-size);color:var(--bs-dropdown-color);text-align:left;list-style:none;background-color:var(--bs-dropdown-bg);background-clip:padding-box;border:var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);border-radius:var(--bs-dropdown-border-radius)}:host ::ng-deep .dropdown-menu[data-bs-popper]{top:100%;left:0;margin-top:var(--bs-dropdown-spacer)}:host ::ng-deep .dropdown-menu-start{--bs-position: start}:host ::ng-deep .dropdown-menu-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-end{--bs-position: end}:host ::ng-deep .dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media(min-width:576px){:host ::ng-deep .dropdown-menu-sm-start{--bs-position: start}:host ::ng-deep .dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-sm-end{--bs-position: end}:host ::ng-deep .dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media(min-width:768px){:host ::ng-deep .dropdown-menu-md-start{--bs-position: start}:host ::ng-deep .dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-md-end{--bs-position: end}:host ::ng-deep .dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media(min-width:992px){:host ::ng-deep .dropdown-menu-lg-start{--bs-position: start}:host ::ng-deep .dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-lg-end{--bs-position: end}:host ::ng-deep .dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media(min-width:1200px){:host ::ng-deep .dropdown-menu-xl-start{--bs-position: start}:host ::ng-deep .dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-xl-end{--bs-position: end}:host ::ng-deep .dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media(min-width:1400px){:host ::ng-deep .dropdown-menu-xxl-start{--bs-position: start}:host ::ng-deep .dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}:host ::ng-deep .dropdown-menu-xxl-end{--bs-position: end}:host ::ng-deep .dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}:host ::ng-deep .dropup .dropdown-menu[data-bs-popper]{top:auto;bottom:100%;margin-top:0;margin-bottom:var(--bs-dropdown-spacer)}:host ::ng-deep .dropup .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}:host ::ng-deep .dropup .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropend .dropdown-menu[data-bs-popper]{top:0;right:auto;left:100%;margin-top:0;margin-left:var(--bs-dropdown-spacer)}:host ::ng-deep .dropend .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}:host ::ng-deep .dropend .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropend .dropdown-toggle:after{vertical-align:0}:host ::ng-deep .dropstart .dropdown-menu[data-bs-popper]{top:0;right:100%;left:auto;margin-top:0;margin-right:var(--bs-dropdown-spacer)}:host ::ng-deep .dropstart .dropdown-toggle:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:\"\"}:host ::ng-deep .dropstart .dropdown-toggle:after{display:none}:host ::ng-deep .dropstart .dropdown-toggle:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:\"\";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}:host ::ng-deep .dropstart .dropdown-toggle:empty:after{margin-left:0}:host ::ng-deep .dropstart .dropdown-toggle:before{vertical-align:0}:host ::ng-deep .dropdown-divider{height:0;margin:var(--bs-dropdown-divider-margin-y) 0;overflow:hidden;border-top:1px solid var(--bs-dropdown-divider-bg);opacity:1}:host ::ng-deep .dropdown-item{display:block;width:100%;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);clear:both;font-weight:400;color:var(--bs-dropdown-link-color);text-align:inherit;text-decoration:none;white-space:nowrap;background-color:transparent;border:0;border-radius:var(--bs-dropdown-item-border-radius, 0)}:host ::ng-deep .dropdown-item:hover,:host ::ng-deep .dropdown-item:focus{color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}:host ::ng-deep .dropdown-item.active,:host ::ng-deep .dropdown-item:active{color:var(--bs-dropdown-link-active-color);text-decoration:none;background-color:var(--bs-dropdown-link-active-bg)}:host ::ng-deep .dropdown-item.disabled,:host ::ng-deep .dropdown-item:disabled{color:var(--bs-dropdown-link-disabled-color);pointer-events:none;background-color:transparent}:host ::ng-deep .dropdown-menu.show{display:block}:host ::ng-deep .dropdown-header{display:block;padding:var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);margin-bottom:0;font-size:.875rem;color:var(--bs-dropdown-header-color);white-space:nowrap}:host ::ng-deep .dropdown-item-text{display:block;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);color:var(--bs-dropdown-link-color)}:host ::ng-deep .dropdown-menu-dark{--bs-dropdown-color: #dee2e6;--bs-dropdown-bg: #343a40;--bs-dropdown-border-color: var(--bs-border-color-translucent);--bs-dropdown-box-shadow: ;--bs-dropdown-link-color: #dee2e6;--bs-dropdown-link-hover-color: #fff;--bs-dropdown-divider-bg: var(--bs-border-color-translucent);--bs-dropdown-link-hover-bg: rgba(255, 255, 255, .15);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: #0d6efd;--bs-dropdown-link-disabled-color: #adb5bd;--bs-dropdown-header-color: #adb5bd}:host ::ng-deep .dropdown-menu{--bs-dropdown-color: var(--bs-body-color);--bs-dropdown-bg: var(--bs-body-bg);--bs-dropdown-border-color: var(--bs-border-color);--bs-dropdown-link-color: var(--bs-body-color);--bs-dropdown-link-hover-color: var(--bs-emphasis-color);--bs-dropdown-link-hover-bg: var(--bs-tertiary-bg);--bs-dropdown-link-active-color: #fff;--bs-dropdown-link-active-bg: var(--bs-primary);--bs-dropdown-link-disabled-color: var(--bs-secondary-color);--bs-dropdown-divider-bg: var(--bs-border-color);--bs-dropdown-header-color: var(--bs-secondary-color)}\n"] }]
199
- }], propDecorators: { maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], dropdownItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BsDropdownItemComponent), { ...{ descendants: true }, isSignal: true }] }] } });
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownItemDirective, decorators: [{
123
+ type: Directive,
124
+ args: [{
125
+ selector: '[bsDropdownItem]',
126
+ host: {
127
+ '[class.dropdown-item]': 'true',
128
+ '[class.active]': 'active()',
129
+ '[class.disabled]': 'disabled()',
130
+ '[attr.aria-disabled]': "disabled() ? 'true' : null",
131
+ },
132
+ }]
133
+ }], ctorParameters: () => [], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
134
+
135
+ /**
136
+ * `[bsDropdownDivider]` — marks an element (typically an `<li>`) as a Bootstrap
137
+ * `.dropdown-divider` inside a `<bs-dropdown-menu>`. Styled by the menu shadow's
138
+ * `::slotted(.dropdown-divider)` rule. Usage: `<li bsDropdownDivider></li>`.
139
+ */
140
+ class BsDropdownDividerDirective {
141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownDividerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
142
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: BsDropdownDividerDirective, isStandalone: true, selector: "[bsDropdownDivider]", host: { attributes: { "role": "separator" }, properties: { "class.dropdown-divider": "true" } }, ngImport: i0 }); }
143
+ }
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownDividerDirective, decorators: [{
145
+ type: Directive,
146
+ args: [{
147
+ selector: '[bsDropdownDivider]',
148
+ host: {
149
+ '[class.dropdown-divider]': 'true',
150
+ role: 'separator',
151
+ },
152
+ }]
153
+ }] });
154
+
155
+ /**
156
+ * `[bsDropdownHeader]` — marks an element (an `<li>` or a heading) as a Bootstrap
157
+ * `.dropdown-header` inside a `<bs-dropdown-menu>`. Styled by the menu shadow's
158
+ * `::slotted(.dropdown-header)` rule. Usage: `<li bsDropdownHeader>Section</li>`.
159
+ */
160
+ class BsDropdownHeaderDirective {
161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
162
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: BsDropdownHeaderDirective, isStandalone: true, selector: "[bsDropdownHeader]", host: { properties: { "class.dropdown-header": "true" } }, ngImport: i0 }); }
163
+ }
164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: BsDropdownHeaderDirective, decorators: [{
165
+ type: Directive,
166
+ args: [{
167
+ selector: '[bsDropdownHeader]',
168
+ host: {
169
+ '[class.dropdown-header]': 'true',
170
+ },
171
+ }]
172
+ }] });
200
173
 
201
174
  /**
202
175
  * Generated bundle index. Do not edit.
203
176
  */
204
177
 
205
- export { BsDropdownItemComponent, BsDropdownMenuComponent };
178
+ export { BS_DROPDOWN_MENU_CONTEXT, BsDropdownDividerDirective, BsDropdownHeaderDirective, BsDropdownItemDirective, BsDropdownMenuComponent };
206
179
  //# sourceMappingURL=mintplayer-ng-bootstrap-dropdown-menu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-dropdown-menu.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-item/dropdown-item.component.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-item/dropdown-item.component.html","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-menu/dropdown-menu.component.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-menu/dropdown-menu.component.html","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/mintplayer-ng-bootstrap-dropdown-menu.ts"],"sourcesContent":["import { afterNextRender, Component, computed, ElementRef, inject, input, ChangeDetectionStrategy } from '@angular/core';\nimport { BsDropdownDirective } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsDropdownMenuComponent } from '../dropdown-menu/dropdown-menu.component';\n\n@Component({\n selector: 'bs-dropdown-item',\n templateUrl: './dropdown-item.component.html',\n styleUrls: ['./dropdown-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.role]': 'itemRole()',\n '[attr.aria-selected]': 'ariaSelected()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.tabindex]': 'tabindex()',\n '(focus)': 'onFocus()',\n '(keydown.enter)': 'onActivate($event)',\n '(keydown.space)': 'onActivate($event)',\n },\n})\nexport class BsDropdownItemComponent {\n private parent = inject(BsDropdownDirective, { optional: true });\n private menu = inject(BsDropdownMenuComponent, { optional: true });\n /** Public so BsDropdownMenuComponent can imperatively focus this item during keyboard nav. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private ids = inject(BsIdService);\n\n readonly isSelected = input(false);\n readonly disabled = input(false);\n\n readonly itemRole = computed(() =>\n this.parent?.popupRole() === 'listbox' ? 'option' : 'menuitem');\n\n readonly ariaSelected = computed(() => {\n if (this.parent?.popupRole() !== 'listbox') return null;\n return this.isSelected() ? 'true' : 'false';\n });\n\n /**\n * Roving tabindex in menu mode: the focused item is 0, others -1.\n * In listbox mode (typeahead/tree-select/etc.), the consumer applies bsRovingFocusItem\n * externally for activedescendant management; this binding stays null so it\n * doesn't fight that directive.\n */\n readonly tabindex = computed<number | null>(() => {\n if (!this.menu?.isMenuMode()) return null;\n if (this.disabled()) return -1;\n return this.menu.isItemFocused(this) ? 0 : -1;\n });\n\n /**\n * Resolved after first render so static `id=\"…\"` attributes set by the consumer\n * and any sibling host bindings have applied first. Read-only access for any\n * other directive on the same element (e.g. BsRovingFocusItem) that needs a\n * stable target id for aria-activedescendant.\n */\n get itemId(): string {\n return this.elementRef.nativeElement.id;\n }\n\n constructor() {\n afterNextRender(() => {\n if (!this.elementRef.nativeElement.id) {\n this.elementRef.nativeElement.id = this.ids.next('bs-dropdown-item');\n }\n });\n }\n\n onFocus() {\n this.menu?.setFocusedItem(this);\n }\n\n onActivate(event: Event) {\n if (this.disabled()) return;\n event.preventDefault();\n this.elementRef.nativeElement.click();\n }\n}\n","<li role=\"presentation\" class=\"dropdown-item cursor-pointer\" [class.active]=\"isSelected()\" [class.disabled]=\"disabled()\">\n <ng-content></ng-content>\n</li>\n","import { AfterViewInit, Component, computed, contentChildren, ElementRef, inject, input, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { BsDropdownDirective } from '@mintplayer/ng-bootstrap/dropdown';\nimport { BsDropdownItemComponent } from '../dropdown-item/dropdown-item.component';\n\n@Component({\n selector: 'bs-dropdown-menu',\n templateUrl: './dropdown-menu.component.html',\n styleUrls: ['./dropdown-menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.width]': 'dropdownWith()',\n '(window:resize)': 'onResize()',\n '[attr.role]': 'menuRole()',\n '[attr.id]': 'menuId()',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class BsDropdownMenuComponent implements AfterViewInit {\n private bsDropdown = inject(BsDropdownDirective, { optional: true });\n\n readonly maxHeight = input<number | null>(null);\n dropdownWith = signal<string | null>(null);\n\n readonly menuRole = computed(() => this.bsDropdown?.popupRole() ?? null);\n readonly menuId = computed(() => this.bsDropdown?.menuId() || null);\n\n /**\n * Items projected into this menu. Used in menu mode (popupRole='menu') to\n * implement roving-tabindex keyboard navigation. In listbox mode, callers\n * (typeahead/tree-select/etc.) typically apply their own bsRovingFocus directly,\n * so this menu's keyboard handler is a no-op.\n */\n readonly dropdownItems = contentChildren(BsDropdownItemComponent, { descendants: true });\n\n /** True when this is a plain menu (default), false when used as a combobox listbox. */\n readonly isMenuMode = computed(() => this.bsDropdown?.popupRole() !== 'listbox');\n\n /** Index into dropdownItems() of the item that currently holds the roving tabindex (menu mode). */\n readonly focusedIndex = signal<number>(0);\n\n isItemFocused(item: BsDropdownItemComponent): boolean {\n if (!this.isMenuMode()) return false;\n return this.dropdownItems()[this.focusedIndex()] === item;\n }\n\n setFocusedItem(item: BsDropdownItemComponent) {\n if (!this.isMenuMode()) return;\n const idx = this.dropdownItems().indexOf(item);\n if (idx >= 0) this.focusedIndex.set(idx);\n }\n\n onResize() {\n if ((typeof window !== 'undefined') && this.bsDropdown && this.bsDropdown.sameDropdownWidth()) {\n const element = this.bsDropdown.elementRef.nativeElement;\n this.dropdownWith.set(window.getComputedStyle(element).width);\n }\n }\n\n ngAfterViewInit() {\n this.onResize();\n }\n\n onKeydown(event: KeyboardEvent) {\n if (!this.isMenuMode()) return;\n const items = this.dropdownItems();\n if (items.length === 0) return;\n\n let handled = false;\n switch (event.key) {\n case 'ArrowDown':\n this.moveFocus(+1);\n handled = true;\n break;\n case 'ArrowUp':\n this.moveFocus(-1);\n handled = true;\n break;\n case 'Home':\n this.moveTo(this.firstEnabledIndex());\n handled = true;\n break;\n case 'End':\n this.moveTo(this.lastEnabledIndex());\n handled = true;\n break;\n }\n if (handled) event.preventDefault();\n }\n\n private moveFocus(delta: 1 | -1): void {\n const items = this.dropdownItems();\n const total = items.length;\n if (total === 0) return;\n let cursor = this.focusedIndex();\n for (let i = 0; i < total; i++) {\n cursor = (cursor + delta + total) % total;\n if (!items[cursor].disabled()) {\n this.moveTo(cursor);\n return;\n }\n }\n }\n\n private firstEnabledIndex(): number {\n return this.dropdownItems().findIndex(it => !it.disabled());\n }\n\n private lastEnabledIndex(): number {\n const items = this.dropdownItems();\n for (let i = items.length - 1; i >= 0; i--) {\n if (!items[i].disabled()) return i;\n }\n return -1;\n }\n\n private moveTo(index: number): void {\n if (index < 0) return;\n this.focusedIndex.set(index);\n const target = this.dropdownItems()[index];\n if (target) {\n target.elementRef.nativeElement.focus();\n }\n }\n}\n","<ul role=\"presentation\" class=\"dropdown-menu position-static w-100 overflow-auto show\" [style.max-height.px]=\"maxHeight()\">\n <ng-content></ng-content>\n</ul>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAoBa,uBAAuB,CAAA;AA8BlC;;;;;AAKG;AACH,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;IACzC;AAEA,IAAA,WAAA,GAAA;QAvCQ,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxD,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AAEzD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACzD,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC;QAExB,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK;uFAAC;QACzB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK;qFAAC;QAEvB,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAC3B,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,SAAS,GAAG,QAAQ,GAAG,UAAU;qFAAC;AAExD,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;AACpC,YAAA,IAAI,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,SAAS;AAAE,gBAAA,OAAO,IAAI;AACvD,YAAA,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,GAAG,OAAO;QAC7C,CAAC;yFAAC;AAEF;;;;;AAKG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AA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDca,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAbnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,eAAe,EAAE,gBAAgB;AACjC,wBAAA,iBAAiB,EAAE,YAAY;AAC/B,wBAAA,aAAa,EAAE,YAAY;AAC3B,wBAAA,WAAW,EAAE,UAAU;AACvB,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA,EAAA,QAAA,EAAA,2KAAA,EAAA,MAAA,EAAA,CAAA,87PAAA,CAAA,EAAA;AAiBwC,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,uBAAuB,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEhCzF;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-dropdown-menu.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/tokens/menu-context.token.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-menu/dropdown-menu.component.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/dropdown-menu/dropdown-menu.component.html","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/directives/dropdown-item.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/directives/dropdown-divider.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/src/directives/dropdown-header.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown-menu/mintplayer-ng-bootstrap-dropdown-menu.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/**\n * DI marker meaning \"this content is authored inside a dropdown menu\".\n *\n * Provided by `BsDropdownMenuComponent` and `BsNavbarDropdownComponent`;\n * optionally injected by context-aware children (`bs-navbar-item`) to render\n * their `.dropdown-item` shape instead of their nav-link shape, so the same\n * item element works at every nesting level of a navbar.\n *\n * Element injectors follow the CONSUMER template's nesting (not the projection\n * site), so any `<bs-navbar-item>` written between the tags of either provider\n * sees the token — including content projected through `<ng-content>`.\n */\nexport const BS_DROPDOWN_MENU_CONTEXT = new InjectionToken<boolean>('BS_DROPDOWN_MENU_CONTEXT');\n","import { afterNextRender, ChangeDetectionStrategy, Component, computed, CUSTOM_ELEMENTS_SCHEMA, input, output, ViewEncapsulation } from '@angular/core';\nimport type { DropdownMode, DropdownSelectEventDetail } from '@mintplayer/web-components/dropdown-menu';\nimport { BS_DROPDOWN_MENU_CONTEXT } from '../tokens/menu-context.token';\n\n/**\n * `<bs-dropdown-menu>` — Angular wrapper around the `<mp-dropdown-menu>` web\n * component. This is the single dropdown-menu implementation: it is used\n * standalone (projected through `*bsDropdownMenu` by the `[bsDropdown]` trigger\n * stack), inside `<bs-navbar>`, and as the listbox panel for the combobox /\n * typeahead (`mode=\"listbox\"`).\n *\n * Keyboard navigation, roving tabindex, the ARIA roles and the theme-aware\n * styling all live in the WC (single source of UI truth). This wrapper bridges\n * inputs to attributes and projects `[bsDropdownItem]` / `[bsDropdownDivider]` /\n * `[bsDropdownHeader]` `<li>`s into the WC's default slot.\n *\n * The WC is registered **client-side only** (`afterNextRender`); on the server\n * Angular emits a bare `<mp-dropdown-menu>` tag and the SSR layer injects its\n * Declarative Shadow DOM (see `injectMpDropdownDsd`), so it renders with JS off.\n *\n * This wrapper stays framework-agnostic of the `[bsDropdown]` trigger stack (it\n * lives in a sibling entry point). When projected as a combobox/listbox panel,\n * the consumer sets `mode=\"listbox\"` and mirrors the trigger's `menuId`/\n * `popupRole` onto this host (`[attr.id]`/`[attr.role]`) via the exported\n * `bsDropdown` reference — the same directive the toggle and combobox read.\n */\n@Component({\n selector: 'bs-dropdown-menu',\n templateUrl: './dropdown-menu.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n // Marks content authored between these tags as \"inside a menu\" so\n // context-aware children (bs-navbar-item) render their dropdown-item shape.\n providers: [{ provide: BS_DROPDOWN_MENU_CONTEXT, useValue: true }],\n // The COMPANION light-DOM sheet: the one thing the menu's shadow `::slotted`\n // rules cannot reach is a nested `<a>`/`<button>` inside an item. Ship it as an\n // un-encapsulated (global, class-scoped) rule so the link fills the padded item\n // box and inherits its color — the whole row navigates, like Bootstrap. The\n // `--bs-dropdown-item-padding-*` tokens inherit out of the menu's shadow through\n // the flat tree (fallbacks cover standalone use).\n encapsulation: ViewEncapsulation.None,\n styles: [`\n .dropdown-item > a,\n .dropdown-item > button {\n display: block;\n width: auto;\n margin: calc(-1 * var(--bs-dropdown-item-padding-y, 0.25rem)) calc(-1 * var(--bs-dropdown-item-padding-x, 1rem));\n padding: var(--bs-dropdown-item-padding-y, 0.25rem) var(--bs-dropdown-item-padding-x, 1rem);\n color: inherit;\n text-decoration: none;\n text-align: inherit;\n background: none;\n border: 0;\n font: inherit;\n }\n `],\n})\nexport class BsDropdownMenuComponent {\n /**\n * `menu` (default, roving-tabindex nav) | `listbox` (consumer manages focus).\n *\n * Aliased to `menuMode` so it never collides with the `mode` input of the\n * a11y `bsRovingFocus` directive when a combobox/listbox stacks both on this\n * one element (same reason `bsCombobox` aliases its `autocomplete`).\n */\n readonly mode = input<DropdownMode>('menu', { alias: 'menuMode' });\n /** Pixel cap on the menu height; scrolls beyond. */\n readonly maxHeight = input<number>();\n /** Id of an external label, set as `aria-labelledby` on the WC's list. */\n readonly labelId = input<string>();\n\n /** Fires when an enabled item is activated (re-emits the WC's `select`). */\n readonly select = output<DropdownSelectEventDetail>();\n\n /** `max-height` attribute is numeric-or-absent; derive once via a signal. */\n protected readonly maxHeightAttr = computed(() => {\n const value = this.maxHeight();\n return value === undefined ? null : `${value}`;\n });\n\n protected readonly labelIdAttr = computed(() => this.labelId() ?? null);\n\n protected onSelect(event: Event) {\n // The WC's `select` is a general-purpose DOM event (bubbles + composed).\n // The public Angular API is this typed `output()`, so consume the raw\n // event here. Without `stopPropagation` it keeps bubbling to the consumer's\n // `<bs-dropdown-menu>` host, where their `(select)` binding fires a\n // SECOND time with the raw `CustomEvent` (Angular doesn't unwrap `.detail`).\n event.stopPropagation();\n this.select.emit((event as CustomEvent<DropdownSelectEventDetail>).detail);\n }\n\n constructor() {\n afterNextRender(() => {\n // Side-effect import registers <mp-dropdown-menu> and friends; client-only\n // so SSR stays a bare tag for DSD injection.\n import('@mintplayer/web-components/dropdown-menu');\n });\n }\n}\n","<mp-dropdown-menu [attr.mode]=\"mode()\" [attr.max-height]=\"maxHeightAttr()\" [attr.label-id]=\"labelIdAttr()\" (select)=\"onSelect($event)\">\n <ng-content></ng-content>\n</mp-dropdown-menu>\n","import { Directive, ElementRef, effect, inject, input } from '@angular/core';\n\n/**\n * `[bsDropdownItem]` — marks a plain `<li>` as a Bootstrap `.dropdown-item`\n * inside a `<bs-dropdown-menu>`. There is no per-item web component: the item is\n * light-DOM `<li>` slotted into `<mp-dropdown-menu>`, whose shadow styles the box\n * via `::slotted(.dropdown-item)`. A nested `<a>`/`<button>` (e.g. a `routerLink`)\n * is reset by the companion light-DOM stylesheet the menu wrapper ships.\n *\n * Usage: `<li bsDropdownItem><a routerLink=\"/x\">Action</a></li>`.\n *\n * Inputs:\n * - `active` — Bootstrap `.active` appearance (also drives `aria-selected` in\n * a `listbox` menu).\n * - `disabled` — non-interactive; removed from the menu's roving order.\n * - `value` — opaque value carried in the menu's `select` event detail;\n * assigned as a `value` property on the host `<li>` (the WC reads it).\n */\n@Directive({\n selector: '[bsDropdownItem]',\n host: {\n '[class.dropdown-item]': 'true',\n '[class.active]': 'active()',\n '[class.disabled]': 'disabled()',\n '[attr.aria-disabled]': \"disabled() ? 'true' : null\",\n },\n})\nexport class BsDropdownItemDirective {\n readonly active = input(false);\n readonly disabled = input(false);\n /** Opaque value carried in the menu's `select` event detail. */\n readonly value = input<unknown>();\n\n constructor() {\n const el = inject<ElementRef<HTMLElement>>(ElementRef);\n effect(() => {\n (el.nativeElement as HTMLElement & { value?: unknown }).value = this.value();\n });\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * `[bsDropdownDivider]` — marks an element (typically an `<li>`) as a Bootstrap\n * `.dropdown-divider` inside a `<bs-dropdown-menu>`. Styled by the menu shadow's\n * `::slotted(.dropdown-divider)` rule. Usage: `<li bsDropdownDivider></li>`.\n */\n@Directive({\n selector: '[bsDropdownDivider]',\n host: {\n '[class.dropdown-divider]': 'true',\n role: 'separator',\n },\n})\nexport class BsDropdownDividerDirective {}\n","import { Directive } from '@angular/core';\n\n/**\n * `[bsDropdownHeader]` — marks an element (an `<li>` or a heading) as a Bootstrap\n * `.dropdown-header` inside a `<bs-dropdown-menu>`. Styled by the menu shadow's\n * `::slotted(.dropdown-header)` rule. Usage: `<li bsDropdownHeader>Section</li>`.\n */\n@Directive({\n selector: '[bsDropdownHeader]',\n host: {\n '[class.dropdown-header]': 'true',\n },\n})\nexport class BsDropdownHeaderDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;AAWG;MACU,wBAAwB,GAAG,IAAI,cAAc,CAAU,0BAA0B;;ACV9F;;;;;;;;;;;;;;;;;;;;;AAqBG;MAgCU,uBAAuB,CAAA;AAyBxB,IAAA,QAAQ,CAAC,KAAY,EAAA;;;;;;QAM7B,KAAK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