@mintplayer/ng-bootstrap 22.24.0 → 22.26.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.
Files changed (25) hide show
  1. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +27 -48
  2. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
  3. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +11 -1
  4. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
  5. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +0 -1
  6. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
  7. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +7 -19
  8. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
  9. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +6 -160
  10. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
  11. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +102 -0
  12. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -0
  13. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +1 -1
  14. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
  15. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +250 -103
  16. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
  17. package/machine/package.json +4 -0
  18. package/package.json +7 -2
  19. package/types/mintplayer-ng-bootstrap-a11y.d.ts +23 -34
  20. package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +0 -1
  21. package/types/mintplayer-ng-bootstrap-datatable.d.ts +7 -0
  22. package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +6 -18
  23. package/types/mintplayer-ng-bootstrap-dropdown.d.ts +2 -48
  24. package/types/mintplayer-ng-bootstrap-machine.d.ts +54 -0
  25. package/types/mintplayer-ng-bootstrap-typeahead.d.ts +141 -32
@@ -1 +1 @@
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';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\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 imports: [BsForwardAriaDirective],\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 /* Active route (routerLinkActive classes the ANCHOR, which ::slotted can't\n reach) — stock .dropdown-item.active look; the negative-margin fill above\n makes the anchor paint the FULL item row. */\n .dropdown-item > a.active,\n .dropdown-item > button.active {\n color: var(--bs-dropdown-link-active-color, #fff);\n background-color: var(--bs-dropdown-link-active-bg, var(--bs-primary));\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\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\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 bsForwardAria [attr.mode]=\"mode()\" [attr.max-height]=\"maxHeightAttr()\" (select)=\"onSelect($event)\">\n <ng-content></ng-content>\n</mp-dropdown-menu>\n","import { Directive, ElementRef, effect, inject, input } from '@angular/core';\nimport type { DropdownItemElement } from '@mintplayer/web-components/dropdown-menu';\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 * written to the host `<li>` as its `dropdownValue` property, which the WC\n * reads. Not the `value` property: `HTMLLIElement.value` is a native long\n * that turns an object or a string into 0.\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<DropdownItemElement>>(ElementRef);\n effect(() => {\n el.nativeElement.dropdownValue = 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;;ACT9F;;;;;;;;;;;;;;;;;;;;;AAqBG;MAyCU,uBAAuB,CAAA;AAuBxB,IAAA,QAAQ,CAAC,KAAY,EAAA;;;;;;QAM7B,KAAK,CAAC,eAAe,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,KAAgD,CAAC,MAAM,CAAC;IAC5E;AAEA,IAAA,WAAA,GAAA;AAhCA;;;;;;AAMG;QACM,IAAA,CAAA,IAAI,GAAG,KAAK,CAAe,MAAM,4EAAI,KAAK,EAAE,UAAU,EAAA,CAAG;;AAEzD,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;;;QAI3B,IAAA,CAAA,MAAM,GAAG,MAAM,EAA6B;;AAGlC,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE;AAC9B,YAAA,OAAO,KAAK,KAAK,SAAS,GAAG,IAAI,GAAG,CAAA,EAAG,KAAK,EAAE;QAChD,CAAC;0FAAC;QAcA,eAAe,CAAC,MAAK;;;YAGnB,OAAO,0CAA0C,CAAC;AACpD,QAAA,CAAC,CAAC;IACJ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zB,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBANrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,MAAM;AAClC,qBAAA;AACF,iBAAA;;;ACZD;;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 { DropdownSelectEventDetail } from '@mintplayer/web-components/dropdown-menu';\nimport { BS_DROPDOWN_MENU_CONTEXT } from '../tokens/menu-context.token';\nimport { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';\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) and inside `<bs-navbar>`. Menu only: the typeahead renders its own\n * listbox from its headless core (#436).\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).\n */\n@Component({\n selector: 'bs-dropdown-menu',\n templateUrl: './dropdown-menu.component.html',\n imports: [BsForwardAriaDirective],\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 /* Active route (routerLinkActive classes the ANCHOR, which ::slotted can't\n reach) — stock .dropdown-item.active look; the negative-margin fill above\n makes the anchor paint the FULL item row. */\n .dropdown-item > a.active,\n .dropdown-item > button.active {\n color: var(--bs-dropdown-link-active-color, #fff);\n background-color: var(--bs-dropdown-link-active-bg, var(--bs-primary));\n }\n `],\n})\nexport class BsDropdownMenuComponent {\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\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\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 bsForwardAria [attr.max-height]=\"maxHeightAttr()\" (select)=\"onSelect($event)\">\n <ng-content></ng-content>\n</mp-dropdown-menu>\n","import { Directive, ElementRef, effect, inject, input } from '@angular/core';\nimport type { DropdownItemElement } from '@mintplayer/web-components/dropdown-menu';\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.\n * - `disabled` — non-interactive; removed from the menu's roving order.\n * - `value` — opaque value carried in the menu's `select` event detail;\n * written to the host `<li>` as its `dropdownValue` property, which the WC\n * reads. Not the `value` property: `HTMLLIElement.value` is a native long\n * that turns an object or a string into 0.\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<DropdownItemElement>>(ElementRef);\n effect(() => {\n el.nativeElement.dropdownValue = 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;;ACT9F;;;;;;;;;;;;;;;;;;AAkBG;MAyCU,uBAAuB,CAAA;AAexB,IAAA,QAAQ,CAAC,KAAY,EAAA;;;;;;QAM7B,KAAK,CAAC,eAAe,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAE,KAAgD,CAAC,MAAM,CAAC;IAC5E;AAEA,IAAA,WAAA,GAAA;;AAvBS,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;;;QAI3B,IAAA,CAAA,MAAM,GAAG,MAAM,EAA6B;;AAGlC,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE;AAC9B,YAAA,OAAO,KAAK,KAAK,SAAS,GAAG,IAAI,GAAG,CAAA,EAAG,KAAK,EAAE;QAChD,CAAC;0FAAC;QAcA,eAAe,CAAC,MAAK;;;YAGnB,OAAO,0CAA0C,CAAC;AACpD,QAAA,CAAC,CAAC;IACJ;8GA/BW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,E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oBAAA,IAAI,EAAE;AACJ,wBAAA,yBAAyB,EAAE,MAAM;AAClC,qBAAA;AACF,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, forwardRef, ViewContainerRef, TemplateRef, DestroyRef, effect, Directive, ElementRef, contentChild, input, model, signal, afterNextRender, computed, output } from '@angular/core';
2
+ import { inject, forwardRef, ViewContainerRef, TemplateRef, DestroyRef, effect, Directive, ElementRef, contentChild, input, model, signal, afterNextRender } from '@angular/core';
3
3
  import { BS_DEVELOPMENT } from '@mintplayer/ng-bootstrap';
4
4
  import { BsOverlayStackService, BsIdService, BsRovingFocusDirective } from '@mintplayer/ng-bootstrap/a11y';
5
5
  import { TemplatePortal } from '@angular/cdk/portal';
@@ -152,14 +152,14 @@ class BsDropdownToggleDirective {
152
152
  });
153
153
  }
154
154
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDropdownToggleDirective, deps: [{ token: BsDropdownDirective }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
155
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDropdownToggleDirective, isStandalone: true, selector: "[bsDropdownToggle]", host: { listeners: { "click": "onClick()", "keydown.arrowdown": "onArrowDown($event)" }, properties: { "attr.aria-haspopup": "dropdown.popupRole()", "attr.aria-expanded": "dropdown.isOpen()", "attr.aria-controls": "dropdown.menuId() || null" } }, ngImport: i0 }); }
155
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDropdownToggleDirective, isStandalone: true, selector: "[bsDropdownToggle]", host: { listeners: { "click": "onClick()", "keydown.arrowdown": "onArrowDown($event)" }, properties: { "attr.aria-haspopup": "\"menu\"", "attr.aria-expanded": "dropdown.isOpen()", "attr.aria-controls": "dropdown.menuId() || null" } }, ngImport: i0 }); }
156
156
  }
157
157
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDropdownToggleDirective, decorators: [{
158
158
  type: Directive,
159
159
  args: [{
160
160
  selector: '[bsDropdownToggle]',
161
161
  host: {
162
- '[attr.aria-haspopup]': 'dropdown.popupRole()',
162
+ '[attr.aria-haspopup]': '"menu"',
163
163
  '[attr.aria-expanded]': 'dropdown.isOpen()',
164
164
  '[attr.aria-controls]': 'dropdown.menuId() || null',
165
165
  '(click)': 'onClick()',
@@ -188,8 +188,6 @@ class BsDropdownDirective {
188
188
  ...(ngDevMode ? [{ debugName: "sameDropdownWidth" }] : /* istanbul ignore next */ []));
189
189
  this.isOpen = model(false, /* @ts-ignore */
190
190
  ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
191
- this.popupRole = input('menu', /* @ts-ignore */
192
- ...(ngDevMode ? [{ debugName: "popupRole" }] : /* istanbul ignore next */ []));
193
191
  /** Reactive id used for the menu's host id and for the toggle's aria-controls. Empty until afterNextRender resolves the host's static id (or generates one), so sibling host bindings on the wrapper element get a chance to land first. */
194
192
  this._menuId = signal('', /* @ts-ignore */
195
193
  ...(ngDevMode ? [{ debugName: "_menuId" }] : /* istanbul ignore next */ []));
@@ -205,7 +203,7 @@ class BsDropdownDirective {
205
203
  }
206
204
  }
207
205
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
208
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.8", type: BsDropdownDirective, isStandalone: true, selector: "[bsDropdown]", inputs: { hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, sameWidth: { classPropertyName: "sameWidth", publicName: "sameWidth", isSignal: true, isRequired: false, transformFunction: null }, closeOnClickOutside: { classPropertyName: "closeOnClickOutside", publicName: "closeOnClickOutside", isSignal: true, isRequired: false, transformFunction: null }, sameDropdownWidth: { classPropertyName: "sameDropdownWidth", publicName: "sameDropdownWidth", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, popupRole: { classPropertyName: "popupRole", publicName: "popupRole", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange" }, host: { listeners: { "window:blur": "onBlur()" } }, queries: [{ propertyName: "menu", first: true, predicate: BsDropdownMenuDirective, descendants: true, isSignal: true }, { propertyName: "toggle", first: true, predicate: BsDropdownToggleDirective, descendants: true, isSignal: true }, { propertyName: "rovingFocus", first: true, predicate: BsRovingFocusDirective, descendants: true, isSignal: true }], exportAs: ["bsDropdown"], ngImport: i0 }); }
206
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.8", type: BsDropdownDirective, isStandalone: true, selector: "[bsDropdown]", inputs: { hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, sameWidth: { classPropertyName: "sameWidth", publicName: "sameWidth", isSignal: true, isRequired: false, transformFunction: null }, closeOnClickOutside: { classPropertyName: "closeOnClickOutside", publicName: "closeOnClickOutside", isSignal: true, isRequired: false, transformFunction: null }, sameDropdownWidth: { classPropertyName: "sameDropdownWidth", publicName: "sameDropdownWidth", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange" }, host: { listeners: { "window:blur": "onBlur()" } }, queries: [{ propertyName: "menu", first: true, predicate: BsDropdownMenuDirective, descendants: true, isSignal: true }, { propertyName: "toggle", first: true, predicate: BsDropdownToggleDirective, descendants: true, isSignal: true }, { propertyName: "rovingFocus", first: true, predicate: BsRovingFocusDirective, descendants: true, isSignal: true }], exportAs: ["bsDropdown"], ngImport: i0 }); }
209
207
  }
210
208
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDropdownDirective, decorators: [{
211
209
  type: Directive,
@@ -216,163 +214,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
216
214
  '(window:blur)': 'onBlur()',
217
215
  },
218
216
  }]
219
- }], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDropdownMenuDirective), { isSignal: true }] }], toggle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDropdownToggleDirective), { isSignal: true }] }], rovingFocus: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsRovingFocusDirective), { ...{ descendants: true }, isSignal: true }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], sameWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sameWidth", required: false }] }], closeOnClickOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClickOutside", required: false }] }], sameDropdownWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sameDropdownWidth", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], popupRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupRole", required: false }] }] } });
220
-
221
- /**
222
- * APG Combobox pattern — turns a plain `<input>` into a combobox that drives
223
- * an adjacent `bsDropdown` popup (typeahead, tree-select, etc.).
224
- *
225
- * The directive owns the input-side ARIA wiring:
226
- * - `role="combobox"` on the host
227
- * - `aria-expanded` / `aria-controls` derived from the parent dropdown
228
- * - `aria-activedescendant` mirroring the dropdown's `bsRovingFocus` active id
229
- * - `aria-autocomplete` (defaults to `"list"`)
230
- *
231
- * Keyboard model:
232
- * - **ArrowUp/Down/Home/End** — opens the popup if closed; once open,
233
- * forwards to the dropdown's `bsRovingFocus` (or emits a `navigate` event
234
- * if no roving-focus is found, so consumers can manage navigation manually).
235
- * - **Enter** — fires `activate` so the consumer can commit the highlighted
236
- * option. `stopImmediatePropagation` is called to keep sibling
237
- * `(keydown.enter)` listeners on the same input (e.g. "submit free-text
238
- * search") from also firing on the same Enter.
239
- * - **Escape** — closes the popup and fires `cancel`.
240
- * - **Tab** — hybrid behaviour: while the popup is open and a roving-focus
241
- * is present, Tab advances the active descendant; at the boundary, Tab
242
- * closes the popup and falls through to the browser's default tab order.
243
- */
244
- class BsComboboxDirective {
245
- constructor() {
246
- this.dropdown = inject(BsDropdownDirective, { optional: true });
247
- /** Aliased to bsComboboxAutocomplete to avoid colliding with the host input's native HTML autocomplete attribute. */
248
- this.autocomplete = input('list', { ...(ngDevMode ? { debugName: "autocomplete" } : /* istanbul ignore next */ {}), alias: 'bsComboboxAutocomplete' });
249
- /** Override the auto-derived activeDescendant. Defaults to dropdown.rovingFocus()'s id when present. */
250
- this.activeDescendant = input(null, /* @ts-ignore */
251
- ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
252
- this.expanded = computed(() => this.dropdown?.isOpen() ?? false, /* @ts-ignore */
253
- ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
254
- this.controls = computed(() => this.dropdown?.menuId() || null, /* @ts-ignore */
255
- ...(ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []));
256
- this.resolvedActiveDescendant = computed(() => this.activeDescendant() ?? this.dropdown?.rovingFocus()?.activeDescendantId() ?? null, /* @ts-ignore */
257
- ...(ngDevMode ? [{ debugName: "resolvedActiveDescendant" }] : /* istanbul ignore next */ []));
258
- /** Fires only when no BsRovingFocus is found inside the parent dropdown — otherwise arrow keys are forwarded automatically. */
259
- this.navigate = output();
260
- this.activate = output();
261
- this.cancel = output();
262
- }
263
- onKeydown(event) {
264
- // Skip browser/OS chords on the navigation keys; Tab is exempt because Shift+Tab is a legit chord
265
- // and Ctrl/Alt/Meta+Tab don't reach JS in any browser.
266
- if (event.key !== 'Tab' && (event.altKey || event.ctrlKey || event.metaKey))
267
- return;
268
- const isOpen = this.expanded();
269
- const rf = this.dropdown?.rovingFocus();
270
- switch (event.key) {
271
- case 'ArrowDown':
272
- if (!isOpen)
273
- this.dropdown?.isOpen.set(true);
274
- else if (rf)
275
- rf.next();
276
- else
277
- this.navigate.emit('next');
278
- event.preventDefault();
279
- break;
280
- case 'ArrowUp':
281
- if (!isOpen)
282
- this.dropdown?.isOpen.set(true);
283
- else if (rf)
284
- rf.prev();
285
- else
286
- this.navigate.emit('prev');
287
- event.preventDefault();
288
- break;
289
- case 'Home':
290
- if (isOpen) {
291
- if (rf)
292
- rf.focusFirst();
293
- else
294
- this.navigate.emit('first');
295
- event.preventDefault();
296
- }
297
- break;
298
- case 'End':
299
- if (isOpen) {
300
- if (rf)
301
- rf.focusLast();
302
- else
303
- this.navigate.emit('last');
304
- event.preventDefault();
305
- }
306
- break;
307
- case 'Escape':
308
- if (isOpen) {
309
- this.dropdown?.isOpen.set(false);
310
- this.cancel.emit(event);
311
- event.preventDefault();
312
- }
313
- break;
314
- case 'Enter':
315
- if (isOpen) {
316
- this.activate.emit(event);
317
- event.preventDefault();
318
- // Sibling listeners on the same input (e.g. a host-template
319
- // (keydown.enter) for "submit free-text search") must not also
320
- // fire when this Enter activated a suggestion — otherwise the
321
- // queued keyup of the alert-dismiss Enter would re-trigger them.
322
- event.stopImmediatePropagation();
323
- }
324
- break;
325
- case 'Tab':
326
- // Hybrid combobox TAB: when the popup is open and a roving-focus is
327
- // present, TAB advances the active descendant (focus stays in the
328
- // input). At the boundary, close the popup and fall through to the
329
- // browser's default tab traversal so focus exits the combobox.
330
- if (!isOpen || !rf)
331
- break;
332
- if (event.shiftKey) {
333
- if (rf.activeIndex() <= rf.firstEnabledIndex()) {
334
- this.dropdown?.isOpen.set(false);
335
- }
336
- else {
337
- rf.prev();
338
- event.preventDefault();
339
- }
340
- }
341
- else {
342
- if (rf.activeIndex() >= rf.lastEnabledIndex()) {
343
- this.dropdown?.isOpen.set(false);
344
- }
345
- else {
346
- rf.next();
347
- event.preventDefault();
348
- }
349
- }
350
- break;
351
- }
352
- }
353
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsComboboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
354
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsComboboxDirective, isStandalone: true, selector: "input[bsCombobox]", inputs: { autocomplete: { classPropertyName: "autocomplete", publicName: "bsComboboxAutocomplete", isSignal: true, isRequired: false, transformFunction: null }, activeDescendant: { classPropertyName: "activeDescendant", publicName: "activeDescendant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigate: "navigate", activate: "activate", cancel: "cancel" }, host: { attributes: { "role": "combobox" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-autocomplete": "autocomplete()", "attr.aria-haspopup": "\"listbox\"", "attr.aria-expanded": "expanded()", "attr.aria-controls": "controls()", "attr.aria-activedescendant": "resolvedActiveDescendant()" } }, exportAs: ["bsCombobox"], ngImport: i0 }); }
355
- }
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsComboboxDirective, decorators: [{
357
- type: Directive,
358
- args: [{
359
- selector: 'input[bsCombobox]',
360
- exportAs: 'bsCombobox',
361
- host: {
362
- 'role': 'combobox',
363
- '[attr.aria-autocomplete]': 'autocomplete()',
364
- '[attr.aria-haspopup]': '"listbox"',
365
- '[attr.aria-expanded]': 'expanded()',
366
- '[attr.aria-controls]': 'controls()',
367
- '[attr.aria-activedescendant]': 'resolvedActiveDescendant()',
368
- '(keydown)': 'onKeydown($event)',
369
- },
370
- }]
371
- }], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsComboboxAutocomplete", required: false }] }], activeDescendant: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDescendant", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }], activate: [{ type: i0.Output, args: ["activate"] }], cancel: [{ type: i0.Output, args: ["cancel"] }] } });
217
+ }], ctorParameters: () => [], propDecorators: { menu: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDropdownMenuDirective), { isSignal: true }] }], toggle: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDropdownToggleDirective), { isSignal: true }] }], rovingFocus: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsRovingFocusDirective), { ...{ descendants: true }, isSignal: true }] }], hasBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackdrop", required: false }] }], sameWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sameWidth", required: false }] }], closeOnClickOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClickOutside", required: false }] }], sameDropdownWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "sameDropdownWidth", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }] } });
372
218
 
373
219
  /**
374
220
  * Generated bundle index. Do not edit.
375
221
  */
376
222
 
377
- export { BsComboboxDirective, BsDropdownDirective, BsDropdownMenuDirective, BsDropdownToggleDirective };
223
+ export { BsDropdownDirective, BsDropdownMenuDirective, BsDropdownToggleDirective };
378
224
  //# sourceMappingURL=mintplayer-ng-bootstrap-dropdown.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-dropdown.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown-menu/dropdown-menu.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown-toggle/dropdown-toggle.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown/dropdown.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/src/combobox/combobox.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/mintplayer-ng-bootstrap-dropdown.ts"],"sourcesContent":["import { DestroyRef, Directive, effect, forwardRef, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ClickOutsideDirective } from '@mintplayer/ng-click-outside';\nimport { BS_DEVELOPMENT } from '@mintplayer/ng-bootstrap';\nimport { BsOverlayStackService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsDropdownDirective } from '../dropdown/dropdown.directive';\n\n@Directive({\n selector: '[bsDropdownMenu]',\n host: {\n '(clickOutside)': 'clickedOutside($event)',\n '(document:keydown.escape)': 'onEscape($event)',\n },\n})\nexport class BsDropdownMenuDirective extends ClickOutsideDirective {\n\n private dropdown = inject(forwardRef(() => BsDropdownDirective));\n private viewContainerRef = inject(ViewContainerRef);\n private templateRef = inject(TemplateRef);\n private overlay = inject(Overlay);\n private destroy = inject(DestroyRef);\n private bsDevelopment = inject(BS_DEVELOPMENT, { optional: true });\n private overlayStack = inject(BsOverlayStackService);\n\n private wait = false;\n private overlayRef: OverlayRef | null = null;\n private templatePortal: TemplatePortal<any> | null = null;\n private stackToken: symbol | null = null;\n\n constructor() {\n super();\n\n effect(() => {\n const isOpen = this.dropdown.isOpen();\n if (isOpen && this.stackToken === null) {\n this.stackToken = this.overlayStack.push();\n } else if (!isOpen && this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n\n if (isOpen) {\n // Prevent creating duplicate overlays if effect re-runs while still open\n if (this.overlayRef) {\n return;\n }\n\n this.wait = true;\n setTimeout(() => this.wait = false, 100);\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: this.dropdown.hasBackdrop(),\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .flexibleConnectedTo(!this.dropdown.toggle() ? this.dropdown.elementRef : this.dropdown.toggle()!.toggleButton)\n .withPositions([\n { originX: \"start\", originY: \"bottom\", overlayX: \"start\", overlayY: \"top\", offsetY: 0 },\n { originX: \"start\", originY: \"top\", overlayX: \"start\", overlayY: \"bottom\", offsetY: 0 },\n ]),\n });\n\n if (this.dropdown.hasBackdrop() && this.dropdown.closeOnClickOutside()) {\n this.overlayRef.backdropClick().subscribe(() => {\n this.dropdown.isOpen.set(false);\n });\n }\n\n this.templatePortal = new TemplatePortal(this.templateRef, this.viewContainerRef);\n const view = this.overlayRef.attach(this.templatePortal);\n\n if (this.dropdown.sameDropdownWidth()) {\n const width = this.dropdown.elementRef.nativeElement.offsetWidth;\n view.rootNodes[0].style.width = width + 'px';\n }\n } else {\n this.disposeOverlay();\n }\n });\n\n // Destroyed while open (an @if around the dropdown, a route change): the overlay and the\n // stack entry are not in this view, so nothing else would ever remove them.\n this.destroy.onDestroy(() => {\n this.disposeOverlay();\n if (this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n });\n }\n\n /** The open menu's overlay pane, where its items are; null while closed. */\n get overlayElement(): HTMLElement | null {\n return this.overlayRef?.overlayElement ?? null;\n }\n\n private disposeOverlay() {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n }\n\n clickedOutside(event: Event) {\n const ev = event as MouseEvent;\n if (!this.bsDevelopment) {\n if (!this.wait) {\n if (this.dropdown.elementRef.nativeElement.contains(ev.target as Node)) {\n return;\n }\n if (!this.overlayRef?.overlayElement.contains(<any>ev.target)) {\n this.doClose();\n }\n }\n }\n }\n\n onEscape(event: Event) {\n if (this.stackToken !== null && this.overlayStack.isTop(this.stackToken)) {\n // Unconditional: closeOnClickOutside gates POINTER dismissal semantics.\n // Escape is the keyboard's universal exit, and routing it through\n // doClose() made a closeOnClickOutside=false dropdown a keyboard trap.\n if (this.dropdown.isOpen()) this.dropdown.isOpen.set(false);\n }\n }\n\n private doClose() {\n const isOpen = this.dropdown.isOpen();\n if (isOpen && !this.dropdown.hasBackdrop() && this.dropdown.closeOnClickOutside()) {\n this.dropdown.isOpen.set(false);\n }\n }\n}\n","import { Directive, ElementRef } from '@angular/core';\nimport { BsDropdownDirective } from '../dropdown/dropdown.directive';\n\n@Directive({\n selector: '[bsDropdownToggle]',\n host: {\n '[attr.aria-haspopup]': 'dropdown.popupRole()',\n '[attr.aria-expanded]': 'dropdown.isOpen()',\n '[attr.aria-controls]': 'dropdown.menuId() || null',\n '(click)': 'onClick()',\n '(keydown.arrowdown)': 'onArrowDown($event)',\n },\n})\nexport class BsDropdownToggleDirective {\n\n constructor(\n public dropdown: BsDropdownDirective,\n toggleButton: ElementRef) {\n this.toggleButton = toggleButton;\n }\n\n toggleButton: ElementRef;\n\n onClick() {\n this.dropdown.isOpen.set(!this.dropdown.isOpen());\n }\n\n /**\n * APG menu button: ArrowDown opens the menu AND moves focus into it, so the\n * next arrow press navigates items instead of scrolling the page. Focus entry\n * goes through the roving directive when one is present — it owns which item\n * is the tab stop.\n */\n onArrowDown(event: Event) {\n event.preventDefault();\n if (!this.dropdown.isOpen()) this.dropdown.isOpen.set(true);\n setTimeout(() => {\n const roving = this.dropdown.rovingFocus();\n if (roving) {\n roving.focusFirst();\n return;\n }\n // The menu renders in an overlay, outside the dropdown's own element.\n const root = this.dropdown.menu().overlayElement ?? this.dropdown.elementRef.nativeElement;\n root.querySelector<HTMLElement>('[role=\"menu\"] [role=\"menuitem\"], .dropdown-item')?.focus();\n });\n }\n}\n","import { afterNextRender, contentChild, Directive, ElementRef, inject, input, model, signal } from '@angular/core';\nimport { BS_DEVELOPMENT } from '@mintplayer/ng-bootstrap';\nimport { BsIdService, BsRovingFocusDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsDropdownMenuDirective } from '../dropdown-menu/dropdown-menu.directive';\nimport { BsDropdownToggleDirective } from '../dropdown-toggle/dropdown-toggle.directive';\n\nexport type BsDropdownPopupRole = 'menu' | 'listbox';\n\n@Directive({\n selector: '[bsDropdown]',\n exportAs: 'bsDropdown',\n host: {\n '(window:blur)': 'onBlur()',\n },\n})\nexport class BsDropdownDirective {\n\n elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private bsDevelopment = inject(BS_DEVELOPMENT, { optional: true });\n private ids = inject(BsIdService);\n\n readonly menu = contentChild.required(BsDropdownMenuDirective);\n readonly toggle = contentChild(BsDropdownToggleDirective);\n readonly rovingFocus = contentChild(BsRovingFocusDirective, { descendants: true });\n\n hasBackdrop = input(false);\n sameWidth = input(false);\n closeOnClickOutside = input(true);\n sameDropdownWidth = input(false);\n isOpen = model<boolean>(false);\n readonly popupRole = input<BsDropdownPopupRole>('menu');\n\n /** Reactive id used for the menu's host id and for the toggle's aria-controls. Empty until afterNextRender resolves the host's static id (or generates one), so sibling host bindings on the wrapper element get a chance to land first. */\n private _menuId = signal<string>('');\n readonly menuId = this._menuId.asReadonly();\n\n constructor() {\n afterNextRender(() => {\n const hostId = this.elementRef.nativeElement.id;\n this._menuId.set(hostId ? `${hostId}-menu` : this.ids.next('bs-dropdown-menu'));\n });\n }\n\n onBlur() {\n if (this.closeOnClickOutside() && !this.bsDevelopment) {\n this.isOpen.set(false);\n }\n }\n}\n","import { computed, Directive, inject, input, output } from '@angular/core';\nimport { BsDropdownDirective } from '../dropdown/dropdown.directive';\n\nexport type BsComboboxAutocomplete = 'none' | 'list' | 'inline' | 'both';\nexport type BsComboboxNavigateDirection = 'next' | 'prev' | 'first' | 'last';\n\n/**\n * APG Combobox pattern — turns a plain `<input>` into a combobox that drives\n * an adjacent `bsDropdown` popup (typeahead, tree-select, etc.).\n *\n * The directive owns the input-side ARIA wiring:\n * - `role=\"combobox\"` on the host\n * - `aria-expanded` / `aria-controls` derived from the parent dropdown\n * - `aria-activedescendant` mirroring the dropdown's `bsRovingFocus` active id\n * - `aria-autocomplete` (defaults to `\"list\"`)\n *\n * Keyboard model:\n * - **ArrowUp/Down/Home/End** — opens the popup if closed; once open,\n * forwards to the dropdown's `bsRovingFocus` (or emits a `navigate` event\n * if no roving-focus is found, so consumers can manage navigation manually).\n * - **Enter** — fires `activate` so the consumer can commit the highlighted\n * option. `stopImmediatePropagation` is called to keep sibling\n * `(keydown.enter)` listeners on the same input (e.g. \"submit free-text\n * search\") from also firing on the same Enter.\n * - **Escape** — closes the popup and fires `cancel`.\n * - **Tab** — hybrid behaviour: while the popup is open and a roving-focus\n * is present, Tab advances the active descendant; at the boundary, Tab\n * closes the popup and falls through to the browser's default tab order.\n */\n@Directive({\n selector: 'input[bsCombobox]',\n exportAs: 'bsCombobox',\n host: {\n 'role': 'combobox',\n '[attr.aria-autocomplete]': 'autocomplete()',\n '[attr.aria-haspopup]': '\"listbox\"',\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls()',\n '[attr.aria-activedescendant]': 'resolvedActiveDescendant()',\n '(keydown)': 'onKeydown($event)',\n },\n})\nexport class BsComboboxDirective {\n private dropdown = inject(BsDropdownDirective, { optional: true });\n\n /** Aliased to bsComboboxAutocomplete to avoid colliding with the host input's native HTML autocomplete attribute. */\n readonly autocomplete = input<BsComboboxAutocomplete>('list', { alias: 'bsComboboxAutocomplete' });\n /** Override the auto-derived activeDescendant. Defaults to dropdown.rovingFocus()'s id when present. */\n readonly activeDescendant = input<string | null>(null);\n\n readonly expanded = computed(() => this.dropdown?.isOpen() ?? false);\n readonly controls = computed(() => this.dropdown?.menuId() || null);\n readonly resolvedActiveDescendant = computed(() =>\n this.activeDescendant() ?? this.dropdown?.rovingFocus()?.activeDescendantId() ?? null);\n\n /** Fires only when no BsRovingFocus is found inside the parent dropdown — otherwise arrow keys are forwarded automatically. */\n readonly navigate = output<BsComboboxNavigateDirection>();\n readonly activate = output<KeyboardEvent>();\n readonly cancel = output<KeyboardEvent>();\n\n onKeydown(event: KeyboardEvent): void {\n // Skip browser/OS chords on the navigation keys; Tab is exempt because Shift+Tab is a legit chord\n // and Ctrl/Alt/Meta+Tab don't reach JS in any browser.\n if (event.key !== 'Tab' && (event.altKey || event.ctrlKey || event.metaKey)) return;\n const isOpen = this.expanded();\n const rf = this.dropdown?.rovingFocus();\n switch (event.key) {\n case 'ArrowDown':\n if (!isOpen) this.dropdown?.isOpen.set(true);\n else if (rf) rf.next();\n else this.navigate.emit('next');\n event.preventDefault();\n break;\n case 'ArrowUp':\n if (!isOpen) this.dropdown?.isOpen.set(true);\n else if (rf) rf.prev();\n else this.navigate.emit('prev');\n event.preventDefault();\n break;\n case 'Home':\n if (isOpen) {\n if (rf) rf.focusFirst();\n else this.navigate.emit('first');\n event.preventDefault();\n }\n break;\n case 'End':\n if (isOpen) {\n if (rf) rf.focusLast();\n else this.navigate.emit('last');\n event.preventDefault();\n }\n break;\n case 'Escape':\n if (isOpen) {\n this.dropdown?.isOpen.set(false);\n this.cancel.emit(event);\n event.preventDefault();\n }\n break;\n case 'Enter':\n if (isOpen) {\n this.activate.emit(event);\n event.preventDefault();\n // Sibling listeners on the same input (e.g. a host-template\n // (keydown.enter) for \"submit free-text search\") must not also\n // fire when this Enter activated a suggestion — otherwise the\n // queued keyup of the alert-dismiss Enter would re-trigger them.\n event.stopImmediatePropagation();\n }\n break;\n case 'Tab':\n // Hybrid combobox TAB: when the popup is open and a roving-focus is\n // present, TAB advances the active descendant (focus stays in the\n // input). At the boundary, close the popup and fall through to the\n // browser's default tab traversal so focus exits the combobox.\n if (!isOpen || !rf) break;\n if (event.shiftKey) {\n if (rf.activeIndex() <= rf.firstEnabledIndex()) {\n this.dropdown?.isOpen.set(false);\n } else {\n rf.prev();\n event.preventDefault();\n }\n } else {\n if (rf.activeIndex() >= rf.lastEnabledIndex()) {\n this.dropdown?.isOpen.set(false);\n } else {\n rf.next();\n event.preventDefault();\n }\n }\n break;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.BsDropdownDirective"],"mappings":";;;;;;;;AAeM,MAAO,uBAAwB,SAAQ,qBAAqB,CAAA;AAehE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QAdD,IAAA,CAAA,QAAQ,GAAG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AAA,0BAA0B,EAAE,gBAAgB;AAC5C,wBAAA,sBAAsB,EAAE,WAAW;AACnC,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,8BAA8B,EAAE,4BAA4B;AAC5D,wBAAA,WAAW,EAAE,mBAAmB;AACjC,qBAAA;AACF,iBAAA;;;ACzCD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-dropdown.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown-menu/dropdown-menu.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown-toggle/dropdown-toggle.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/src/dropdown/dropdown.directive.ts","../../../../libs/mintplayer-ng-bootstrap/dropdown/mintplayer-ng-bootstrap-dropdown.ts"],"sourcesContent":["import { DestroyRef, Directive, effect, forwardRef, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ClickOutsideDirective } from '@mintplayer/ng-click-outside';\nimport { BS_DEVELOPMENT } from '@mintplayer/ng-bootstrap';\nimport { BsOverlayStackService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsDropdownDirective } from '../dropdown/dropdown.directive';\n\n@Directive({\n selector: '[bsDropdownMenu]',\n host: {\n '(clickOutside)': 'clickedOutside($event)',\n '(document:keydown.escape)': 'onEscape($event)',\n },\n})\nexport class BsDropdownMenuDirective extends ClickOutsideDirective {\n\n private dropdown = inject(forwardRef(() => BsDropdownDirective));\n private viewContainerRef = inject(ViewContainerRef);\n private templateRef = inject(TemplateRef);\n private overlay = inject(Overlay);\n private destroy = inject(DestroyRef);\n private bsDevelopment = inject(BS_DEVELOPMENT, { optional: true });\n private overlayStack = inject(BsOverlayStackService);\n\n private wait = false;\n private overlayRef: OverlayRef | null = null;\n private templatePortal: TemplatePortal<any> | null = null;\n private stackToken: symbol | null = null;\n\n constructor() {\n super();\n\n effect(() => {\n const isOpen = this.dropdown.isOpen();\n if (isOpen && this.stackToken === null) {\n this.stackToken = this.overlayStack.push();\n } else if (!isOpen && this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n\n if (isOpen) {\n // Prevent creating duplicate overlays if effect re-runs while still open\n if (this.overlayRef) {\n return;\n }\n\n this.wait = true;\n setTimeout(() => this.wait = false, 100);\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: this.dropdown.hasBackdrop(),\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay.position()\n .flexibleConnectedTo(!this.dropdown.toggle() ? this.dropdown.elementRef : this.dropdown.toggle()!.toggleButton)\n .withPositions([\n { originX: \"start\", originY: \"bottom\", overlayX: \"start\", overlayY: \"top\", offsetY: 0 },\n { originX: \"start\", originY: \"top\", overlayX: \"start\", overlayY: \"bottom\", offsetY: 0 },\n ]),\n });\n\n if (this.dropdown.hasBackdrop() && this.dropdown.closeOnClickOutside()) {\n this.overlayRef.backdropClick().subscribe(() => {\n this.dropdown.isOpen.set(false);\n });\n }\n\n this.templatePortal = new TemplatePortal(this.templateRef, this.viewContainerRef);\n const view = this.overlayRef.attach(this.templatePortal);\n\n if (this.dropdown.sameDropdownWidth()) {\n const width = this.dropdown.elementRef.nativeElement.offsetWidth;\n view.rootNodes[0].style.width = width + 'px';\n }\n } else {\n this.disposeOverlay();\n }\n });\n\n // Destroyed while open (an @if around the dropdown, a route change): the overlay and the\n // stack entry are not in this view, so nothing else would ever remove them.\n this.destroy.onDestroy(() => {\n this.disposeOverlay();\n if (this.stackToken !== null) {\n this.overlayStack.release(this.stackToken);\n this.stackToken = null;\n }\n });\n }\n\n /** The open menu's overlay pane, where its items are; null while closed. */\n get overlayElement(): HTMLElement | null {\n return this.overlayRef?.overlayElement ?? null;\n }\n\n private disposeOverlay() {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n }\n\n clickedOutside(event: Event) {\n const ev = event as MouseEvent;\n if (!this.bsDevelopment) {\n if (!this.wait) {\n if (this.dropdown.elementRef.nativeElement.contains(ev.target as Node)) {\n return;\n }\n if (!this.overlayRef?.overlayElement.contains(<any>ev.target)) {\n this.doClose();\n }\n }\n }\n }\n\n onEscape(event: Event) {\n if (this.stackToken !== null && this.overlayStack.isTop(this.stackToken)) {\n // Unconditional: closeOnClickOutside gates POINTER dismissal semantics.\n // Escape is the keyboard's universal exit, and routing it through\n // doClose() made a closeOnClickOutside=false dropdown a keyboard trap.\n if (this.dropdown.isOpen()) this.dropdown.isOpen.set(false);\n }\n }\n\n private doClose() {\n const isOpen = this.dropdown.isOpen();\n if (isOpen && !this.dropdown.hasBackdrop() && this.dropdown.closeOnClickOutside()) {\n this.dropdown.isOpen.set(false);\n }\n }\n}\n","import { Directive, ElementRef } from '@angular/core';\nimport { BsDropdownDirective } from '../dropdown/dropdown.directive';\n\n@Directive({\n selector: '[bsDropdownToggle]',\n host: {\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'dropdown.isOpen()',\n '[attr.aria-controls]': 'dropdown.menuId() || null',\n '(click)': 'onClick()',\n '(keydown.arrowdown)': 'onArrowDown($event)',\n },\n})\nexport class BsDropdownToggleDirective {\n\n constructor(\n public dropdown: BsDropdownDirective,\n toggleButton: ElementRef) {\n this.toggleButton = toggleButton;\n }\n\n toggleButton: ElementRef;\n\n onClick() {\n this.dropdown.isOpen.set(!this.dropdown.isOpen());\n }\n\n /**\n * APG menu button: ArrowDown opens the menu AND moves focus into it, so the\n * next arrow press navigates items instead of scrolling the page. Focus entry\n * goes through the roving directive when one is present — it owns which item\n * is the tab stop.\n */\n onArrowDown(event: Event) {\n event.preventDefault();\n if (!this.dropdown.isOpen()) this.dropdown.isOpen.set(true);\n setTimeout(() => {\n const roving = this.dropdown.rovingFocus();\n if (roving) {\n roving.focusFirst();\n return;\n }\n // The menu renders in an overlay, outside the dropdown's own element.\n const root = this.dropdown.menu().overlayElement ?? this.dropdown.elementRef.nativeElement;\n root.querySelector<HTMLElement>('[role=\"menu\"] [role=\"menuitem\"], .dropdown-item')?.focus();\n });\n }\n}\n","import { afterNextRender, contentChild, Directive, ElementRef, inject, input, model, signal } from '@angular/core';\nimport { BS_DEVELOPMENT } from '@mintplayer/ng-bootstrap';\nimport { BsIdService, BsRovingFocusDirective } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsDropdownMenuDirective } from '../dropdown-menu/dropdown-menu.directive';\nimport { BsDropdownToggleDirective } from '../dropdown-toggle/dropdown-toggle.directive';\n\n@Directive({\n selector: '[bsDropdown]',\n exportAs: 'bsDropdown',\n host: {\n '(window:blur)': 'onBlur()',\n },\n})\nexport class BsDropdownDirective {\n\n elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private bsDevelopment = inject(BS_DEVELOPMENT, { optional: true });\n private ids = inject(BsIdService);\n\n readonly menu = contentChild.required(BsDropdownMenuDirective);\n readonly toggle = contentChild(BsDropdownToggleDirective);\n readonly rovingFocus = contentChild(BsRovingFocusDirective, { descendants: true });\n\n hasBackdrop = input(false);\n sameWidth = input(false);\n closeOnClickOutside = input(true);\n sameDropdownWidth = input(false);\n isOpen = model<boolean>(false);\n\n /** Reactive id used for the menu's host id and for the toggle's aria-controls. Empty until afterNextRender resolves the host's static id (or generates one), so sibling host bindings on the wrapper element get a chance to land first. */\n private _menuId = signal<string>('');\n readonly menuId = this._menuId.asReadonly();\n\n constructor() {\n afterNextRender(() => {\n const hostId = this.elementRef.nativeElement.id;\n this._menuId.set(hostId ? `${hostId}-menu` : this.ids.next('bs-dropdown-menu'));\n });\n }\n\n onBlur() {\n if (this.closeOnClickOutside() && !this.bsDevelopment) {\n this.isOpen.set(false);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.BsDropdownDirective"],"mappings":";;;;;;;;AAeM,MAAO,uBAAwB,SAAQ,qBAAqB,CAAA;AAehE,I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,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrBnF;;AAEG;;;;"}
@@ -0,0 +1,102 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, inject, DestroyRef, input, ElementRef, Renderer2, effect, Directive, PLATFORM_ID, DOCUMENT } from '@angular/core';
3
+ import { isPlatformServer } from '@angular/common';
4
+ import { writeScopedStyleTag, installLightStyles } from '@mintplayer/ui-core/scoped-styles';
5
+
6
+ /**
7
+ * Bridge a `@mintplayer/ui-core` store into Angular's reactivity: a read-only
8
+ * `Signal` of the store's snapshot, kept current by `subscribe` and released on
9
+ * the injection context's `DestroyRef`.
10
+ *
11
+ * The signal is set synchronously from the store's notification; Angular
12
+ * coalesces the resulting change detection, so a command that commits one
13
+ * snapshot costs one render (measured in `machine-signal.spec.ts`, spike S1).
14
+ */
15
+ function machineSignal(store, destroyRef = inject(DestroyRef)) {
16
+ const state = signal(store.snapshot, /* @ts-ignore */
17
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
18
+ const unsubscribe = store.subscribe((snapshot) => state.set(snapshot));
19
+ destroyRef.onDestroy(unsubscribe);
20
+ return state.asReadonly();
21
+ }
22
+
23
+ /**
24
+ * Attribute names a bag may never set. A bag is data the core computed, but a
25
+ * generic setter is still an injection sink, so URL-bearing and script-bearing
26
+ * attributes are refused outright rather than sanitised.
27
+ */
28
+ const REFUSED = new Set(['href', 'src', 'srcdoc', 'xlink:href', 'style', 'action', 'formaction', 'data']);
29
+ function isRefused(name) {
30
+ return REFUSED.has(name) || name.startsWith('on');
31
+ }
32
+ /**
33
+ * Apply a core's attribute bag to the host element — the Angular stand-in for
34
+ * JSX/Lit/Vue attribute spread. The directive diffs the previous and next bag:
35
+ * a key that disappears is *removed* from the DOM (a stale
36
+ * `aria-activedescendant` would otherwise survive a close), and unchanged keys
37
+ * are not rewritten.
38
+ *
39
+ * Attributes are written through `Renderer2`, so they land in the server-
40
+ * rendered HTML and are re-applied identically after hydration (spike S2 in
41
+ * docs/prd/typeahead-wc-436.md). Consumers never see a bag: the front's own
42
+ * template binds `[mpProps]="api().input"` on its own nodes.
43
+ */
44
+ class MpPropsDirective {
45
+ constructor() {
46
+ this.mpProps = input(null, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "mpProps" }] : /* istanbul ignore next */ []));
48
+ this.element = inject(ElementRef).nativeElement;
49
+ this.renderer = inject(Renderer2);
50
+ this.applied = {};
51
+ effect(() => this.apply(this.mpProps() ?? {}));
52
+ }
53
+ apply(next) {
54
+ const previous = this.applied;
55
+ Object.keys(previous)
56
+ .filter((name) => !(name in next) || next[name] === null || next[name] === undefined || next[name] === false)
57
+ .forEach((name) => this.renderer.removeAttribute(this.element, name));
58
+ Object.entries(next)
59
+ .filter(([name, value]) => value !== null && value !== undefined && value !== false)
60
+ .filter(([name]) => {
61
+ if (isRefused(name)) {
62
+ throw new Error(`[mpProps] refuses to set "${name}"; bind it explicitly in the template.`);
63
+ }
64
+ return true;
65
+ })
66
+ .filter(([name, value]) => !Object.is(previous[name], value))
67
+ .forEach(([name, value]) => this.renderer.setAttribute(this.element, name, value === true ? '' : String(value)));
68
+ this.applied = next;
69
+ }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: MpPropsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
71
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: MpPropsDirective, isStandalone: true, selector: "[mpProps]", inputs: { mpProps: { classPropertyName: "mpProps", publicName: "mpProps", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: MpPropsDirective, decorators: [{
74
+ type: Directive,
75
+ args: [{ selector: '[mpProps]' }]
76
+ }], ctorParameters: () => [], propDecorators: { mpProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "mpProps", required: false }] }] } });
77
+
78
+ /**
79
+ * Install a core's scoped stylesheet from an Angular front. In the browser it
80
+ * goes through the shared registry (`installLightStyles`: once per key,
81
+ * cross-bundle safe). On the server the registry cannot run, so the marker
82
+ * `<style data-mp-light-styles="<key>">` is written straight into the
83
+ * request's `DOCUMENT` head — the client registry then treats it as already
84
+ * installed. No string post-processing of the response is involved.
85
+ *
86
+ * Call from the component's constructor (an injection context).
87
+ */
88
+ function useScopedStyles(key, cssText) {
89
+ if (isPlatformServer(inject(PLATFORM_ID))) {
90
+ writeScopedStyleTag(inject(DOCUMENT), key, cssText);
91
+ }
92
+ else {
93
+ installLightStyles(key, cssText);
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Generated bundle index. Do not edit.
99
+ */
100
+
101
+ export { MpPropsDirective, machineSignal, useScopedStyles };
102
+ //# sourceMappingURL=mintplayer-ng-bootstrap-machine.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-machine.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/machine/src/machine-signal.ts","../../../../libs/mintplayer-ng-bootstrap/machine/src/props.directive.ts","../../../../libs/mintplayer-ng-bootstrap/machine/src/scoped-styles.ts","../../../../libs/mintplayer-ng-bootstrap/machine/mintplayer-ng-bootstrap-machine.ts"],"sourcesContent":["import { DestroyRef, inject, Signal, signal } from '@angular/core';\nimport type { Store } from '@mintplayer/ui-core/store';\n\n/**\n * Bridge a `@mintplayer/ui-core` store into Angular's reactivity: a read-only\n * `Signal` of the store's snapshot, kept current by `subscribe` and released on\n * the injection context's `DestroyRef`.\n *\n * The signal is set synchronously from the store's notification; Angular\n * coalesces the resulting change detection, so a command that commits one\n * snapshot costs one render (measured in `machine-signal.spec.ts`, spike S1).\n */\nexport function machineSignal<S extends object>(store: Store<S>, destroyRef: DestroyRef = inject(DestroyRef)): Signal<S> {\n const state = signal<S>(store.snapshot);\n const unsubscribe = store.subscribe((snapshot) => state.set(snapshot));\n destroyRef.onDestroy(unsubscribe);\n return state.asReadonly();\n}\n","import { Directive, effect, ElementRef, inject, input, Renderer2 } from '@angular/core';\n\n/** An attribute bag as a core's `connect()` returns it. `null`/`undefined`/`false` remove the attribute; `true` sets it empty. */\nexport type PropBag = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Attribute names a bag may never set. A bag is data the core computed, but a\n * generic setter is still an injection sink, so URL-bearing and script-bearing\n * attributes are refused outright rather than sanitised.\n */\nconst REFUSED = new Set(['href', 'src', 'srcdoc', 'xlink:href', 'style', 'action', 'formaction', 'data']);\n\nfunction isRefused(name: string): boolean {\n return REFUSED.has(name) || name.startsWith('on');\n}\n\n/**\n * Apply a core's attribute bag to the host element — the Angular stand-in for\n * JSX/Lit/Vue attribute spread. The directive diffs the previous and next bag:\n * a key that disappears is *removed* from the DOM (a stale\n * `aria-activedescendant` would otherwise survive a close), and unchanged keys\n * are not rewritten.\n *\n * Attributes are written through `Renderer2`, so they land in the server-\n * rendered HTML and are re-applied identically after hydration (spike S2 in\n * docs/prd/typeahead-wc-436.md). Consumers never see a bag: the front's own\n * template binds `[mpProps]=\"api().input\"` on its own nodes.\n */\n@Directive({ selector: '[mpProps]' })\nexport class MpPropsDirective {\n readonly mpProps = input<PropBag | null | undefined>(null);\n\n private readonly element = inject(ElementRef).nativeElement as Element;\n private readonly renderer = inject(Renderer2);\n private applied: PropBag = {};\n\n constructor() {\n effect(() => this.apply(this.mpProps() ?? {}));\n }\n\n private apply(next: PropBag): void {\n const previous = this.applied;\n Object.keys(previous)\n .filter((name) => !(name in next) || next[name] === null || next[name] === undefined || next[name] === false)\n .forEach((name) => this.renderer.removeAttribute(this.element, name));\n Object.entries(next)\n .filter(([name, value]) => value !== null && value !== undefined && value !== false)\n .filter(([name]) => {\n if (isRefused(name)) {\n throw new Error(`[mpProps] refuses to set \"${name}\"; bind it explicitly in the template.`);\n }\n return true;\n })\n .filter(([name, value]) => !Object.is(previous[name], value))\n .forEach(([name, value]) => this.renderer.setAttribute(this.element, name, value === true ? '' : String(value)));\n this.applied = next;\n }\n}\n","import { DOCUMENT, inject, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\nimport { installLightStyles, writeScopedStyleTag } from '@mintplayer/ui-core/scoped-styles';\n\n/**\n * Install a core's scoped stylesheet from an Angular front. In the browser it\n * goes through the shared registry (`installLightStyles`: once per key,\n * cross-bundle safe). On the server the registry cannot run, so the marker\n * `<style data-mp-light-styles=\"<key>\">` is written straight into the\n * request's `DOCUMENT` head — the client registry then treats it as already\n * installed. No string post-processing of the response is involved.\n *\n * Call from the component's constructor (an injection context).\n */\nexport function useScopedStyles(key: string, cssText: string): void {\n if (isPlatformServer(inject(PLATFORM_ID))) {\n writeScopedStyleTag(inject(DOCUMENT), key, cssText);\n } else {\n installLightStyles(key, cssText);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;;;;;;AAQG;AACG,SAAU,aAAa,CAAmB,KAAe,EAAE,UAAA,GAAyB,MAAM,CAAC,UAAU,CAAC,EAAA;AAC1G,IAAA,MAAM,KAAK,GAAG,MAAM,CAAI,KAAK,CAAC,QAAQ;8EAAC;AACvC,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtE,IAAA,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC;AACjC,IAAA,OAAO,KAAK,CAAC,UAAU,EAAE;AAC3B;;ACZA;;;;AAIG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,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AC,WAAW,CAAC,CAAC,EAAE;QACzC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC;IACrD;SAAO;AACL,QAAA,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC;IAClC;AACF;;ACpBA;;AAEG;;;;"}
@@ -271,7 +271,7 @@ class BsNavbarDropdownComponent {
271
271
  rla.isActiveChange.pipe(takeUntilDestroyed()).subscribe((active) => this.routeActive.set(active));
272
272
  }
273
273
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsNavbarDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
274
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: BsNavbarDropdownComponent, isStandalone: true, selector: "bs-navbar-dropdown", providers: [{ provide: BS_DROPDOWN_MENU_CONTEXT, useValue: true }], queries: [{ propertyName: "label", first: true, predicate: BsNavbarDropdownLabelDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.RouterLinkActive }], ngImport: i0, template: "<mp-navbar-dropdown bsForwardAria [attr.active]=\"routeActive() ? '' : null\">\n <span slot=\"label\"><ng-container [ngTemplateOutlet]=\"label().templateRef\"></ng-container></span>\n <bs-dropdown-menu>\n <ng-content></ng-content>\n </bs-dropdown-menu>\n</mp-navbar-dropdown>\n", dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: BsDropdownMenuComponent, selector: "bs-dropdown-menu", inputs: ["menuMode", "maxHeight"], outputs: ["select"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
274
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: BsNavbarDropdownComponent, isStandalone: true, selector: "bs-navbar-dropdown", providers: [{ provide: BS_DROPDOWN_MENU_CONTEXT, useValue: true }], queries: [{ propertyName: "label", first: true, predicate: BsNavbarDropdownLabelDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.RouterLinkActive }], ngImport: i0, template: "<mp-navbar-dropdown bsForwardAria [attr.active]=\"routeActive() ? '' : null\">\n <span slot=\"label\"><ng-container [ngTemplateOutlet]=\"label().templateRef\"></ng-container></span>\n <bs-dropdown-menu>\n <ng-content></ng-content>\n </bs-dropdown-menu>\n</mp-navbar-dropdown>\n", dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: BsDropdownMenuComponent, selector: "bs-dropdown-menu", inputs: ["maxHeight"], outputs: ["select"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
275
275
  }
276
276
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsNavbarDropdownComponent, decorators: [{
277
277
  type: Component,