@spartan-ng/brain 0.0.1-alpha.404 → 0.0.1-alpha.406

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 (46) hide show
  1. package/alert-dialog/lib/brn-alert-dialog-trigger.directive.d.ts +3 -2
  2. package/command/lib/brn-command-item.directive.d.ts +2 -0
  3. package/command/lib/brn-command-search-input.directive.d.ts +15 -7
  4. package/dialog/index.d.ts +1 -0
  5. package/dialog/lib/brn-dialog-close.directive.d.ts +2 -4
  6. package/dialog/lib/brn-dialog-content.directive.d.ts +3 -3
  7. package/dialog/lib/brn-dialog-overlay.component.d.ts +3 -2
  8. package/dialog/lib/brn-dialog-token.d.ts +8 -0
  9. package/dialog/lib/brn-dialog-trigger.directive.d.ts +5 -2
  10. package/dialog/lib/brn-dialog.component.d.ts +52 -31
  11. package/esm2022/alert-dialog/lib/brn-alert-dialog-trigger.directive.mjs +16 -9
  12. package/esm2022/alert-dialog/lib/brn-alert-dialog.component.mjs +5 -5
  13. package/esm2022/command/lib/brn-command-item.directive.mjs +8 -4
  14. package/esm2022/command/lib/brn-command-search-input.directive.mjs +50 -18
  15. package/esm2022/command/lib/brn-command.directive.mjs +12 -10
  16. package/esm2022/dialog/index.mjs +2 -1
  17. package/esm2022/dialog/lib/brn-dialog-close.directive.mjs +6 -11
  18. package/esm2022/dialog/lib/brn-dialog-content.directive.mjs +19 -19
  19. package/esm2022/dialog/lib/brn-dialog-overlay.component.mjs +13 -9
  20. package/esm2022/dialog/lib/brn-dialog-token.mjs +15 -0
  21. package/esm2022/dialog/lib/brn-dialog-trigger.directive.mjs +16 -8
  22. package/esm2022/dialog/lib/brn-dialog.component.mjs +112 -133
  23. package/esm2022/popover/lib/brn-popover-trigger.directive.mjs +19 -13
  24. package/esm2022/popover/lib/brn-popover.component.mjs +36 -40
  25. package/esm2022/select/lib/brn-select.component.mjs +5 -3
  26. package/esm2022/sheet/lib/brn-sheet-trigger.directive.mjs +8 -9
  27. package/esm2022/sheet/lib/brn-sheet.component.mjs +27 -25
  28. package/fesm2022/spartan-ng-brain-alert-dialog.mjs +18 -11
  29. package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -1
  30. package/fesm2022/spartan-ng-brain-command.mjs +66 -28
  31. package/fesm2022/spartan-ng-brain-command.mjs.map +1 -1
  32. package/fesm2022/spartan-ng-brain-dialog.mjs +170 -171
  33. package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
  34. package/fesm2022/spartan-ng-brain-popover.mjs +52 -50
  35. package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -1
  36. package/fesm2022/spartan-ng-brain-select.mjs +4 -2
  37. package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
  38. package/fesm2022/spartan-ng-brain-sheet.mjs +32 -31
  39. package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -1
  40. package/hlm-tailwind-preset.css +43 -0
  41. package/package.json +2 -1
  42. package/popover/lib/brn-popover-trigger.directive.d.ts +2 -2
  43. package/popover/lib/brn-popover.component.d.ts +3 -6
  44. package/select/lib/brn-select.component.d.ts +3 -2
  45. package/sheet/lib/brn-sheet-trigger.directive.d.ts +2 -2
  46. package/sheet/lib/brn-sheet.component.d.ts +4 -3
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-command.mjs","sources":["../../../../libs/brain/command/src/lib/brn-command.token.ts","../../../../libs/brain/command/src/lib/brn-command-empty.directive.ts","../../../../libs/brain/command/src/lib/brn-command-item.token.ts","../../../../libs/brain/command/src/lib/brn-command-group.directive.ts","../../../../libs/brain/command/src/lib/brn-command-item.directive.ts","../../../../libs/brain/command/src/lib/brn-command-list.directive.ts","../../../../libs/brain/command/src/lib/brn-command-search-input.token.ts","../../../../libs/brain/command/src/lib/brn-command-search-input.directive.ts","../../../../libs/brain/command/src/lib/brn-command.directive.ts","../../../../libs/brain/command/src/index.ts","../../../../libs/brain/command/src/spartan-ng-brain-command.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandDirective } from './brn-command.directive';\n\nexport const BrnCommandToken = new InjectionToken<BrnCommandDirective>('BrnCommandToken');\n\nexport function provideBrnCommand(command: Type<BrnCommandDirective>): ExistingProvider {\n\treturn { provide: BrnCommandToken, useExisting: command };\n}\n\nexport function injectBrnCommand(): BrnCommandDirective {\n\treturn inject(BrnCommandToken);\n}\n","import { computed, Directive, effect, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tstandalone: true,\n\tselector: '[brnCommandEmpty]',\n})\nexport class BrnCommandEmptyDirective {\n\tprivate readonly _templateRef = inject<TemplateRef<void>>(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any visible items */\n\tprivate readonly _visible = computed(() => this._command.items().some((item) => item.visible()));\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tif (this._visible()) {\n\t\t\t\tthis._viewContainerRef.clear();\n\t\t\t} else {\n\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t}\n\t\t});\n\t}\n}\n","import { ExistingProvider, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandItemDirective } from './brn-command-item.directive';\n\nexport const BrnCommandItemToken = new InjectionToken<BrnCommandItemDirective>('BrnCommandItemToken');\n\nexport function provideBrnCommandItem(command: Type<BrnCommandItemDirective>): ExistingProvider {\n\treturn { provide: BrnCommandItemToken, useExisting: command };\n}\n","import { computed, contentChildren, Directive, input } from '@angular/core';\nimport { BrnCommandItemToken } from './brn-command-item.token';\n\n@Directive({\n\tselector: '[brnCommandGroup]',\n\tstandalone: true,\n\thost: {\n\t\trole: 'group',\n\t\t'[attr.data-hidden]': '!visible() ? \"\" : null',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandGroupDirective {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-group-${BrnCommandGroupDirective._id++}`);\n\n\t/** Get the items in the group */\n\tprivate readonly _items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** Determine if there are any visible items in the group */\n\tprotected readonly visible = computed(() => this._items().some((item) => item.visible()));\n}\n","import { Highlightable } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tDirective,\n\tElementRef,\n\tHostListener,\n\tinject,\n\tinput,\n\tOnInit,\n\toutput,\n\tPLATFORM_ID,\n\tsignal,\n} from '@angular/core';\nimport { provideBrnCommandItem } from './brn-command-item.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'button[brnCommandItem]',\n\tstandalone: true,\n\tproviders: [provideBrnCommandItem(BrnCommandItemDirective)],\n\thost: {\n\t\ttype: 'button',\n\t\trole: 'option',\n\t\ttabIndex: '-1',\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': '_disabled() ? true : null',\n\t\t'[attr.data-value]': 'value()',\n\t\t'[attr.data-hidden]': \"!visible() ? '' : null\",\n\t\t'[attr.aria-selected]': 'active()',\n\t\t'[attr.data-selected]': \"active() ? '' : null\",\n\t},\n})\nexport class BrnCommandItemDirective implements Highlightable, OnInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\t/** Access the command component */\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** A unique id for the item */\n\tpublic readonly id = input(`brn-command-item-${BrnCommandItemDirective._id++}`);\n\n\t/** The value this item represents. */\n\tpublic readonly value = input.required<string>();\n\n\t/** Whether the item is disabled. */\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Expose disabled as a value - used by the Highlightable interface */\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\t/** Whether the item is initialized, this is to prevent accessing the value-input before the component is initialized.\n\t * The brn-command-empty directive accesses the value before the component is initialized, which causes an error.\n\t */\n\tprivate readonly _initialized = signal(false);\n\n\t/** Whether the item is selected. */\n\tprotected readonly active = signal(false);\n\n\t/** Emits when the item is selected. */\n\tpublic readonly selected = output<void>();\n\n\t/** @internal Determine if this item is visible based on the current search query */\n\tpublic readonly visible = computed(() => {\n\t\tif (!this._initialized()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this._command.filter()(this.value(), this._command.search());\n\t});\n\n\t/** @internal Get the display value */\n\tpublic getLabel(): string {\n\t\treturn this.value();\n\t}\n\n\t/** @internal */\n\tsetActiveStyles(): void {\n\t\tthis.active.set(true);\n\n\t\t// ensure the item is in view\n\t\tif (isPlatformBrowser(this._platform)) {\n\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n\t\t}\n\t}\n\n\t/** @internal */\n\tsetInactiveStyles(): void {\n\t\tthis.active.set(false);\n\t}\n\n\t@HostListener('click')\n\tprotected onClick(): void {\n\t\tthis._command.keyManager.setActiveItem(this);\n\t\tthis.selected.emit();\n\t}\n\n\tngOnInit(): void {\n\t\tthis._initialized.set(true);\n\t}\n}\n","import { Directive, input } from '@angular/core';\n\n@Directive({\n\tstandalone: true,\n\tselector: '[brnCommandList]',\n\thost: {\n\t\trole: 'listbox',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandListDirective {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-list-${BrnCommandListDirective._id++}`);\n}\n","import { ExistingProvider, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandSearchInputDirective } from './brn-command-search-input.directive';\n\nexport const BrnCommandSearchInputToken = new InjectionToken<BrnCommandSearchInputDirective>(\n\t'BrnCommandSearchInputToken',\n);\n\nexport function provideBrnCommandSearchInput(command: Type<BrnCommandSearchInputDirective>): ExistingProvider {\n\treturn { provide: BrnCommandSearchInputToken, useExisting: command };\n}\n","import { Directive, ElementRef, HostListener, inject, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { startWith } from 'rxjs/operators';\nimport { provideBrnCommandSearchInput } from './brn-command-search-input.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'input[brnCommandSearchInput]',\n\tstandalone: true,\n\tproviders: [provideBrnCommandSearchInput(BrnCommandSearchInputDirective)],\n\thost: {\n\t\trole: 'combobox',\n\t\t'aria-autocomplete': 'list',\n\t\t'[attr.aria-activedescendant]': '_activeDescendant()',\n\t},\n})\nexport class BrnCommandSearchInputDirective {\n\tprivate readonly _command = injectBrnCommand();\n\tprivate readonly _elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n\t/** @internal Expose the current text value */\n\tpublic readonly value = signal<string>('');\n\n\t/** The id of the active option */\n\tprotected readonly _activeDescendant = signal<string | undefined>(undefined);\n\n\tconstructor() {\n\t\tthis._command.keyManager.change\n\t\t\t.pipe(startWith(this._command.keyManager.activeItemIndex), takeUntilDestroyed())\n\t\t\t.subscribe(() => this._activeDescendant.set(this._command.keyManager.activeItem?.id()));\n\t}\n\n\t/** Listen for changes to the input value */\n\t@HostListener('input')\n\tprotected onInput(): void {\n\t\tthis.value.set(this._elementRef.nativeElement.value);\n\t}\n\n\t/** Listen for keydown events */\n\t@HostListener('keydown', ['$event'])\n\tprotected onKeyDown(event: KeyboardEvent): void {\n\t\tthis._command.keyManager.onKeydown(event);\n\t}\n}\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tAfterViewInit,\n\tcomputed,\n\tcontentChild,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tHostListener,\n\tinject,\n\tInjector,\n\tinput,\n\toutput,\n\tPLATFORM_ID,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BrnCommandItemToken } from './brn-command-item.token';\nimport { BrnCommandSearchInputDirective } from './brn-command-search-input.directive';\nimport { provideBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommand]',\n\tstandalone: true,\n\tproviders: [provideBrnCommand(BrnCommandDirective)],\n\thost: {\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandDirective implements AfterViewInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The id of the command */\n\tpublic readonly id = input<string>(`brn-command-${BrnCommandDirective._id++}`);\n\n\t/** The default filter function */\n\tprivate readonly _defaultFilter = (value: string, search: string) =>\n\t\tvalue.toLowerCase().includes(search.toLowerCase());\n\n\t/** A custom filter function to use when searching. */\n\tpublic readonly filter = input<CommandFilter>(this._defaultFilter);\n\n\t/** when the selection has changed */\n\tpublic readonly valueChange = output<string>();\n\n\t/** @internal The search query */\n\tpublic readonly search = computed(() => this._searchInput()?.value() ?? '');\n\n\t/** Access the search input if present */\n\tprivate readonly _searchInput = contentChild(BrnCommandSearchInputDirective, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal Access all the items within the commmand */\n\tpublic readonly items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal The key manager for managing active descendant */\n\tpublic readonly keyManager = new ActiveDescendantKeyManager(this.items, this._injector);\n\n\tconstructor() {\n\t\tthis.keyManager\n\t\t\t.withVerticalOrientation()\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t.withTypeAhead()\n\t\t\t.skipPredicate((item) => item.disabled || !item.visible());\n\n\t\t// When clearing the search input we also want to reset the active item to the first one\n\t\teffect(\n\t\t\t() => {\n\t\t\t\tconst searchInput = this._searchInput()?.value();\n\t\t\t\tif (searchInput !== undefined && searchInput.length === 0) {\n\t\t\t\t\tthis.keyManager.setActiveItem(0);\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ allowSignalWrites: true },\n\t\t);\n\n\t\tthis.keyManager.change.pipe(takeUntilDestroyed()).subscribe(() => {\n\t\t\tconst value = this.keyManager.activeItem?.value();\n\t\t\tif (value) {\n\t\t\t\tthis.valueChange.emit(value);\n\t\t\t}\n\t\t});\n\t}\n\n\tngAfterViewInit(): void {\n\t\tif (isPlatformBrowser(this._platform) && this.items().length) {\n\t\t\tthis.keyManager.setActiveItem(0);\n\t\t}\n\t}\n\n\t@HostListener('keydown.enter')\n\tprotected selectActiveItem(): void {\n\t\tthis.keyManager.activeItem?.selected.emit();\n\t}\n}\n\nexport type CommandFilter = (value: string, search: string) => boolean;\n","import { NgModule } from '@angular/core';\nimport { BrnCommandEmptyDirective } from './lib/brn-command-empty.directive';\nimport { BrnCommandGroupDirective } from './lib/brn-command-group.directive';\nimport { BrnCommandItemDirective } from './lib/brn-command-item.directive';\nimport { BrnCommandListDirective } from './lib/brn-command-list.directive';\nimport { BrnCommandSearchInputDirective } from './lib/brn-command-search-input.directive';\nimport { BrnCommandDirective } from './lib/brn-command.directive';\n\nexport * from './lib/brn-command-empty.directive';\nexport * from './lib/brn-command-group.directive';\nexport * from './lib/brn-command-item.directive';\nexport * from './lib/brn-command-item.token';\nexport * from './lib/brn-command-list.directive';\nexport * from './lib/brn-command-search-input.directive';\nexport * from './lib/brn-command-search-input.token';\nexport * from './lib/brn-command.directive';\nexport * from './lib/brn-command.token';\n\nexport const BrnCommandImports = [\n\tBrnCommandEmptyDirective,\n\tBrnCommandGroupDirective,\n\tBrnCommandItemDirective,\n\tBrnCommandListDirective,\n\tBrnCommandSearchInputDirective,\n\tBrnCommandDirective,\n] as const;\n\n@NgModule({\n\timports: [...BrnCommandImports],\n\texports: [...BrnCommandImports],\n})\nexport class BrnCommandModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAGa,eAAe,GAAG,IAAI,cAAc,CAAsB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OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAZ5B,wBAAwB;YACxB,wBAAwB;YACxB,uBAAuB;YACvB,uBAAuB;YACvB,8BAA8B;AAC9B,YAAA,mBAAmB,aALnB,wBAAwB;YACxB,wBAAwB;YACxB,uBAAuB;YACvB,uBAAuB;YACvB,8BAA8B;YAC9B,mBAAmB,CAAA,EAAA,CAAA;2HAOP,gBAAgB,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAC/B,oBAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAC/B,iBAAA;;;AC9BD;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-command.mjs","sources":["../../../../libs/brain/command/src/lib/brn-command.token.ts","../../../../libs/brain/command/src/lib/brn-command-empty.directive.ts","../../../../libs/brain/command/src/lib/brn-command-item.token.ts","../../../../libs/brain/command/src/lib/brn-command-group.directive.ts","../../../../libs/brain/command/src/lib/brn-command-item.directive.ts","../../../../libs/brain/command/src/lib/brn-command-list.directive.ts","../../../../libs/brain/command/src/lib/brn-command-search-input.token.ts","../../../../libs/brain/command/src/lib/brn-command-search-input.directive.ts","../../../../libs/brain/command/src/lib/brn-command.directive.ts","../../../../libs/brain/command/src/index.ts","../../../../libs/brain/command/src/spartan-ng-brain-command.ts"],"sourcesContent":["import { ExistingProvider, inject, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandDirective } from './brn-command.directive';\n\nexport const BrnCommandToken = new InjectionToken<BrnCommandDirective>('BrnCommandToken');\n\nexport function provideBrnCommand(command: Type<BrnCommandDirective>): ExistingProvider {\n\treturn { provide: BrnCommandToken, useExisting: command };\n}\n\nexport function injectBrnCommand(): BrnCommandDirective {\n\treturn inject(BrnCommandToken);\n}\n","import { computed, Directive, effect, inject, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tstandalone: true,\n\tselector: '[brnCommandEmpty]',\n})\nexport class BrnCommandEmptyDirective {\n\tprivate readonly _templateRef = inject<TemplateRef<void>>(TemplateRef);\n\tprivate readonly _viewContainerRef = inject(ViewContainerRef);\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** Determine if the command has any visible items */\n\tprivate readonly _visible = computed(() => this._command.items().some((item) => item.visible()));\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tif (this._visible()) {\n\t\t\t\tthis._viewContainerRef.clear();\n\t\t\t} else {\n\t\t\t\tthis._viewContainerRef.createEmbeddedView(this._templateRef);\n\t\t\t}\n\t\t});\n\t}\n}\n","import { ExistingProvider, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandItemDirective } from './brn-command-item.directive';\n\nexport const BrnCommandItemToken = new InjectionToken<BrnCommandItemDirective>('BrnCommandItemToken');\n\nexport function provideBrnCommandItem(command: Type<BrnCommandItemDirective>): ExistingProvider {\n\treturn { provide: BrnCommandItemToken, useExisting: command };\n}\n","import { computed, contentChildren, Directive, input } from '@angular/core';\nimport { BrnCommandItemToken } from './brn-command-item.token';\n\n@Directive({\n\tselector: '[brnCommandGroup]',\n\tstandalone: true,\n\thost: {\n\t\trole: 'group',\n\t\t'[attr.data-hidden]': '!visible() ? \"\" : null',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandGroupDirective {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-group-${BrnCommandGroupDirective._id++}`);\n\n\t/** Get the items in the group */\n\tprivate readonly _items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** Determine if there are any visible items in the group */\n\tprotected readonly visible = computed(() => this._items().some((item) => item.visible()));\n}\n","import { Highlightable } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tDirective,\n\tElementRef,\n\tHostListener,\n\tinject,\n\tinput,\n\tOnInit,\n\toutput,\n\tPLATFORM_ID,\n\tsignal,\n} from '@angular/core';\nimport { provideBrnCommandItem } from './brn-command-item.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'button[brnCommandItem]',\n\tstandalone: true,\n\tproviders: [provideBrnCommandItem(BrnCommandItemDirective)],\n\thost: {\n\t\ttype: 'button',\n\t\trole: 'option',\n\t\ttabIndex: '-1',\n\t\t'[id]': 'id()',\n\t\t'[attr.disabled]': '_disabled() ? true : null',\n\t\t'[attr.data-value]': 'value()',\n\t\t'[attr.data-hidden]': \"!visible() ? '' : null\",\n\t\t'[attr.aria-selected]': 'active()',\n\t\t'[attr.data-selected]': \"active() ? '' : null\",\n\t},\n})\nexport class BrnCommandItemDirective implements Highlightable, OnInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n\t/** Access the command component */\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** A unique id for the item */\n\tpublic readonly id = input(`brn-command-item-${BrnCommandItemDirective._id++}`);\n\n\t/** The value this item represents. */\n\tpublic readonly value = input.required<string>();\n\n\t/** Whether the item is disabled. */\n\tpublic readonly _disabled = input<boolean, BooleanInput>(false, {\n\t\talias: 'disabled',\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/** Expose disabled as a value - used by the Highlightable interface */\n\tpublic get disabled() {\n\t\treturn this._disabled();\n\t}\n\n\t/** Whether the item is initialized, this is to prevent accessing the value-input before the component is initialized.\n\t * The brn-command-empty directive accesses the value before the component is initialized, which causes an error.\n\t */\n\tprivate readonly _initialized = signal(false);\n\n\t/** Whether the item is selected. */\n\tprotected readonly active = signal(false);\n\n\t/** Emits when the item is selected. */\n\tpublic readonly selected = output<void>();\n\n\t/** @internal Determine if this item is visible based on the current search query */\n\tpublic readonly visible = computed(() => {\n\t\treturn this._command.filter()(this.safeValue(), this._command.search());\n\t});\n\n\t/** @internal Get the value of the item, with check if it has been initialized to avoid errors */\n\tpublic safeValue = computed(() => {\n\t\tif (!this._initialized()) {\n\t\t\treturn '';\n\t\t}\n\t\treturn this.value();\n\t});\n\n\t/** @internal Get the display value */\n\tpublic getLabel(): string {\n\t\treturn this.safeValue();\n\t}\n\n\t/** @internal */\n\tsetActiveStyles(): void {\n\t\tthis.active.set(true);\n\n\t\t// ensure the item is in view\n\t\tif (isPlatformBrowser(this._platform)) {\n\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'nearest' });\n\t\t}\n\t}\n\n\t/** @internal */\n\tsetInactiveStyles(): void {\n\t\tthis.active.set(false);\n\t}\n\n\t@HostListener('click')\n\tprotected onClick(): void {\n\t\tthis._command.keyManager.setActiveItem(this);\n\t\tthis.selected.emit();\n\t}\n\n\tngOnInit(): void {\n\t\tthis._initialized.set(true);\n\t}\n}\n","import { Directive, input } from '@angular/core';\n\n@Directive({\n\tstandalone: true,\n\tselector: '[brnCommandList]',\n\thost: {\n\t\trole: 'listbox',\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandListDirective {\n\tprivate static _id = 0;\n\n\t/** The id of the command list */\n\tpublic readonly id = input<string>(`brn-command-list-${BrnCommandListDirective._id++}`);\n}\n","import { ExistingProvider, InjectionToken, Type } from '@angular/core';\nimport type { BrnCommandSearchInputDirective } from './brn-command-search-input.directive';\n\nexport const BrnCommandSearchInputToken = new InjectionToken<BrnCommandSearchInputDirective>(\n\t'BrnCommandSearchInputToken',\n);\n\nexport function provideBrnCommandSearchInput(command: Type<BrnCommandSearchInputDirective>): ExistingProvider {\n\treturn { provide: BrnCommandSearchInputToken, useExisting: command };\n}\n","import { computed, Directive, effect, ElementRef, Inject, input, Optional, Renderer2, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { COMPOSITION_BUFFER_MODE, DefaultValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { startWith } from 'rxjs/operators';\nimport { provideBrnCommandSearchInput } from './brn-command-search-input.token';\nimport { injectBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: 'input[brnCommandSearchInput]',\n\tstandalone: true,\n\tproviders: [\n\t\tprovideBrnCommandSearchInput(BrnCommandSearchInputDirective),\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: BrnCommandSearchInputDirective,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\thost: {\n\t\trole: 'combobox',\n\t\t'aria-autocomplete': 'list',\n\t\t'[attr.aria-activedescendant]': '_activeDescendant()',\n\t\t'(keydown)': 'onKeyDown($event)',\n\t\t'(input)': 'onInput()',\n\t},\n})\nexport class BrnCommandSearchInputDirective extends DefaultValueAccessor {\n\tprivate readonly _command = injectBrnCommand();\n\n\t/** The initial value of the search input */\n\tpublic readonly value = input<string>('');\n\n\t/** @internal The mutable value of the search input */\n\tpublic readonly mutableValue = computed(() => signal(this.value()));\n\n\t/** @internal The \"real\" value of the search input */\n\tpublic readonly valueState = computed(() => this.mutableValue()());\n\n\t/** The id of the active option */\n\tprotected readonly _activeDescendant = signal<string | undefined>(undefined);\n\n\tconstructor(\n\t\trenderer: Renderer2,\n\t\tprivate readonly elementRef: ElementRef,\n\t\t@Optional() @Inject(COMPOSITION_BUFFER_MODE) compositionMode: boolean,\n\t) {\n\t\tsuper(renderer, elementRef, compositionMode);\n\t\tthis._command.keyManager.change\n\t\t\t.pipe(startWith(this._command.keyManager.activeItemIndex), takeUntilDestroyed())\n\t\t\t.subscribe(() => this._activeDescendant.set(this._command.keyManager.activeItem?.id()));\n\t\teffect(() => {\n\t\t\tthis.elementRef.nativeElement.value = this.valueState();\n\t\t});\n\t}\n\t/** Listen for changes to the input value */\n\tprotected onInput(): void {\n\t\tthis.mutableValue().set(this.elementRef.nativeElement.value);\n\t}\n\n\t/** Listen for keydown events */\n\tprotected onKeyDown(event: KeyboardEvent): void {\n\t\tthis._command.keyManager.onKeydown(event);\n\t}\n\n\t/** CONROL VALUE ACCESSOR */\n\toverride writeValue(value: string | null): void {\n\t\tsuper.writeValue(value);\n\t\tif (value) {\n\t\t\tthis.mutableValue().set(value);\n\t\t}\n\t}\n}\n","import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\tAfterViewInit,\n\tcomputed,\n\tcontentChild,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tHostListener,\n\tinject,\n\tInjector,\n\tinput,\n\toutput,\n\tPLATFORM_ID,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BrnCommandItemToken } from './brn-command-item.token';\nimport { BrnCommandSearchInputDirective } from './brn-command-search-input.directive';\nimport { provideBrnCommand } from './brn-command.token';\n\n@Directive({\n\tselector: '[brnCommand]',\n\tstandalone: true,\n\tproviders: [provideBrnCommand(BrnCommandDirective)],\n\thost: {\n\t\t'[id]': 'id()',\n\t},\n})\nexport class BrnCommandDirective implements AfterViewInit {\n\tprivate static _id = 0;\n\n\tprivate readonly _platform = inject(PLATFORM_ID);\n\n\tprivate readonly _injector = inject(Injector);\n\n\t/** The id of the command */\n\tpublic readonly id = input<string>(`brn-command-${BrnCommandDirective._id++}`);\n\n\t/** The default filter function */\n\tprivate readonly _defaultFilter = (value: string, search: string) =>\n\t\tvalue.toLowerCase().includes(search.toLowerCase());\n\n\t/** A custom filter function to use when searching. */\n\tpublic readonly filter = input<CommandFilter>(this._defaultFilter);\n\n\t/** when the selection has changed */\n\tpublic readonly valueChange = output<string>();\n\n\t/** @internal The search query */\n\tpublic readonly search = computed(() => this._searchInput()?.valueState() ?? '');\n\n\t/** Access the search input if present */\n\tprivate readonly _searchInput = contentChild(BrnCommandSearchInputDirective, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal Access all the items within the commmand */\n\tpublic readonly items = contentChildren(BrnCommandItemToken, {\n\t\tdescendants: true,\n\t});\n\n\t/** @internal The key manager for managing active descendant */\n\tpublic readonly keyManager = new ActiveDescendantKeyManager(this.items, this._injector);\n\n\tconstructor() {\n\t\tthis.keyManager\n\t\t\t.withVerticalOrientation()\n\t\t\t.withHomeAndEnd()\n\t\t\t.withWrap()\n\t\t\t.skipPredicate((item) => item.disabled || !item.visible());\n\n\t\t// When clearing the search input we also want to reset the active item to the first one\n\t\teffect(() => {\n\t\t\tconst searchInput = this.search();\n\t\t\tuntracked(() => {\n\t\t\t\tconst activeItemIsVisible = this.keyManager.activeItem?.visible();\n\t\t\t\tif ((searchInput !== undefined && searchInput.length === 0) || !activeItemIsVisible) {\n\t\t\t\t\tthis.keyManager.setFirstItemActive();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis.keyManager.change.pipe(takeUntilDestroyed()).subscribe(() => {\n\t\t\tconst value = this.keyManager.activeItem?.safeValue();\n\t\t\tif (value) {\n\t\t\t\tthis.valueChange.emit(value);\n\t\t\t}\n\t\t});\n\t}\n\n\tngAfterViewInit(): void {\n\t\tif (isPlatformBrowser(this._platform) && this.items().length) {\n\t\t\tthis.keyManager.setActiveItem(0);\n\t\t}\n\t}\n\n\t@HostListener('keydown.enter')\n\tprotected selectActiveItem(): void {\n\t\tthis.keyManager.activeItem?.selected.emit();\n\t}\n}\n\nexport type CommandFilter = (value: string, search: string) => boolean;\n","import { NgModule } from '@angular/core';\nimport { BrnCommandEmptyDirective } from './lib/brn-command-empty.directive';\nimport { BrnCommandGroupDirective } from './lib/brn-command-group.directive';\nimport { BrnCommandItemDirective } from './lib/brn-command-item.directive';\nimport { BrnCommandListDirective } from './lib/brn-command-list.directive';\nimport { BrnCommandSearchInputDirective } from './lib/brn-command-search-input.directive';\nimport { BrnCommandDirective } from './lib/brn-command.directive';\n\nexport * from './lib/brn-command-empty.directive';\nexport * from './lib/brn-command-group.directive';\nexport * from './lib/brn-command-item.directive';\nexport * from './lib/brn-command-item.token';\nexport * from './lib/brn-command-list.directive';\nexport * from './lib/brn-command-search-input.directive';\nexport * from './lib/brn-command-search-input.token';\nexport * from './lib/brn-command.directive';\nexport * from './lib/brn-command.token';\n\nexport const BrnCommandImports = [\n\tBrnCommandEmptyDirective,\n\tBrnCommandGroupDirective,\n\tBrnCommandItemDirective,\n\tBrnCommandListDirective,\n\tBrnCommandSearchInputDirective,\n\tBrnCommandDirective,\n] as const;\n\n@NgModule({\n\timports: [...BrnCommandImports],\n\texports: [...BrnCommandImports],\n})\nexport class BrnCommandModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAGa,eAAe,GAAG,IAAI,cAAc,CAAsB,iBAAiB;AAElF,SAAU,iBAAiB,CAAC,OAAkC,EAAA;IACnE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO,EAAE;AAC1D;SAEgB,gBAAgB,GAAA;AAC/B,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAC/B;;MCJa,wBAAwB,CAAA;AACnB,IAAA,YAAY,GAAG,MAAM,CAAoB,WAAW,CAAC;AACrD,IAAA,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC5C,QAAQ,GAAG,gBAAgB,EAAE;;IAG7B,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAEhG,IAAA,WAAA,GAAA;QACC,MAAM,CAAC,MAAK;AACX,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;AACpB,gBAAA,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE;;iBACxB;gBACN,IAAI,CA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nB,wBAAwB;YACxB,wBAAwB;YACxB,uBAAuB;YACvB,uBAAuB;YACvB,8BAA8B;YAC9B,mBAAmB,CAAA,EAAA,CAAA;2HAOP,gBAAgB,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAC/B,oBAAA,OAAO,EAAE,CAAC,GAAG,iBAAiB,CAAC;AAC/B,iBAAA;;;AC9BD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Directive, Input, RendererFactory2, Injector, signal, computed, runInInjectionContext, effect, Injectable, ViewContainerRef, EventEmitter, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, TemplateRef, input, NgModule } from '@angular/core';
2
+ import { inject, input, Directive, InjectionToken, RendererFactory2, Injector, signal, computed, runInInjectionContext, effect, Injectable, ViewContainerRef, output, booleanAttribute, untracked, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, TemplateRef, NgModule } from '@angular/core';
3
3
  import { coerceNumberProperty } from '@angular/cdk/coercion';
4
4
  import { Subject } from 'rxjs';
5
5
  import { take, takeUntil, filter } from 'rxjs/operators';
@@ -72,15 +72,12 @@ class BrnDialogRef {
72
72
 
73
73
  class BrnDialogCloseDirective {
74
74
  _brnDialogRef = inject(BrnDialogRef);
75
- _delay;
76
- set delay(value) {
77
- this._delay = coerceNumberProperty(value);
78
- }
75
+ delay = input(undefined, { transform: coerceNumberProperty });
79
76
  close() {
80
- this._brnDialogRef.close(undefined, this._delay);
77
+ this._brnDialogRef.close(undefined, this.delay());
81
78
  }
82
79
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
83
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnDialogCloseDirective, isStandalone: true, selector: "button[brnDialogClose]", inputs: { delay: "delay" }, host: { listeners: { "click": "close()" } }, ngImport: i0 });
80
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogCloseDirective, isStandalone: true, selector: "button[brnDialogClose]", inputs: { delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "close()" } }, ngImport: i0 });
84
81
  }
85
82
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogCloseDirective, decorators: [{
86
83
  type: Directive,
@@ -91,9 +88,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
91
88
  '(click)': 'close()',
92
89
  },
93
90
  }]
94
- }], propDecorators: { delay: [{
95
- type: Input
96
- }] } });
91
+ }] });
97
92
 
98
93
  const DEFAULT_BRN_DIALOG_OPTIONS = {
99
94
  role: 'dialog',
@@ -114,6 +109,20 @@ const DEFAULT_BRN_DIALOG_OPTIONS = {
114
109
  ariaModal: true,
115
110
  };
116
111
 
112
+ const defaultOptions = {
113
+ closeDelay: 0,
114
+ };
115
+ const BRN_DIALOG_DEFAULT_OPTIONS = new InjectionToken('brn-dialog-default-options', {
116
+ providedIn: 'root',
117
+ factory: () => defaultOptions,
118
+ });
119
+ function provideBrnDialogDefaultOptions(options) {
120
+ return { provide: BRN_DIALOG_DEFAULT_OPTIONS, useValue: { ...defaultOptions, ...options } };
121
+ }
122
+ function injectBrnDialogDefaultOptions() {
123
+ return inject(BRN_DIALOG_DEFAULT_OPTIONS, { optional: true }) ?? defaultOptions;
124
+ }
125
+
117
126
  let dialogSequence = 0;
118
127
  /** @deprecated `injectBrnDialogCtx` will no longer be supported once components are stable. Use `injectBrnDialogContext` instead. */
119
128
  const injectBrnDialogCtx = () => {
@@ -240,91 +249,120 @@ class BrnDialogComponent {
240
249
  positionBuilder = inject(OverlayPositionBuilder);
241
250
  ssos = inject(ScrollStrategyOptions);
242
251
  _injector = inject(Injector);
252
+ _defaultOptions = injectBrnDialogDefaultOptions();
243
253
  _context = {};
244
- _options = {
245
- ...DEFAULT_BRN_DIALOG_OPTIONS,
246
- };
254
+ stateComputed = computed(() => this._dialogRef()?.state() ?? 'closed');
247
255
  _contentTemplate;
248
256
  _dialogRef = signal(undefined);
249
257
  _dialogStateEffectRef;
250
- state = computed(() => this._dialogRef()?.state() ?? 'closed');
251
- closed = new EventEmitter();
252
- stateChanged = new EventEmitter();
253
- // eslint-disable-next-line @angular-eslint/no-input-rename
254
- set newState(state) {
255
- if (state === 'open') {
256
- this.open();
257
- }
258
- if (state === 'closed') {
259
- this.close(this._options.closeDelay);
260
- }
261
- }
262
- set role(role) {
263
- this._options.role = role;
264
- }
265
- set hasBackdrop(hasBackdrop) {
266
- this._options.hasBackdrop = hasBackdrop;
267
- }
268
- set positionStrategy(positionStrategy) {
269
- this._options.positionStrategy = positionStrategy;
270
- }
271
- set scrollStrategy(scrollStrategy) {
272
- if (scrollStrategy === 'close') {
273
- this._options.scrollStrategy = this.ssos.close();
258
+ _backdropClass = signal(null);
259
+ _panelClass = signal(null);
260
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
261
+ closed = output();
262
+ stateChanged = output();
263
+ state = input(null);
264
+ role = input('dialog');
265
+ mutableRole = computed(() => signal(this.role()));
266
+ _roleState = computed(() => this.mutableRole()());
267
+ hasBackdrop = input(true, { transform: booleanAttribute });
268
+ _mutableHasBackdrop = computed(() => signal(this.hasBackdrop()));
269
+ _hasBackdropState = computed(() => this._mutableHasBackdrop()());
270
+ positionStrategy = input();
271
+ mutablePositionStrategy = computed(() => signal(this.positionStrategy()));
272
+ _positionStrategyState = computed(() => this.mutablePositionStrategy()());
273
+ scrollStrategy = input(null);
274
+ mutableScrollStrategy = computed(() => signal(this.scrollStrategy()));
275
+ _scrollStrategyState = computed(() => this.mutableScrollStrategy()());
276
+ _options = computed(() => {
277
+ const scrollStrategyInput = this._scrollStrategyState();
278
+ let scrollStrategy;
279
+ if (scrollStrategyInput === 'close') {
280
+ scrollStrategy = this.ssos.close();
274
281
  }
275
- else if (scrollStrategy === 'reposition') {
276
- this._options.scrollStrategy = this.ssos.reposition();
282
+ else if (scrollStrategyInput === 'reposition') {
283
+ scrollStrategy = this.ssos.reposition();
277
284
  }
278
285
  else {
279
- this._options.scrollStrategy = scrollStrategy;
286
+ scrollStrategy = scrollStrategyInput;
280
287
  }
288
+ return {
289
+ ...DEFAULT_BRN_DIALOG_OPTIONS,
290
+ role: this._roleState(),
291
+ hasBackdrop: this._hasBackdropState(),
292
+ positionStrategy: this._positionStrategyState(),
293
+ scrollStrategy,
294
+ restoreFocus: this.restoreFocus(),
295
+ closeOnOutsidePointerEvents: this._closeOnOutsidePointerEventsState(),
296
+ closeOnBackdropClick: this._closeOnBackdropClickState(),
297
+ attachTo: this._attachToState(),
298
+ attachPositions: this._attachPositionsState(),
299
+ autoFocus: this.autoFocus(),
300
+ closeDelay: 100,
301
+ disableClose: this.disableClose(),
302
+ backdropClass: this._backdropClass() ?? '',
303
+ panelClass: this._panelClass() ?? '',
304
+ ariaDescribedBy: this._ariaDescribedByState(),
305
+ ariaLabelledBy: this._ariaLabelledByState(),
306
+ ariaLabel: this._ariaLabelState(),
307
+ ariaModal: this._ariaModalState(),
308
+ };
309
+ });
310
+ constructor() {
311
+ effect(() => {
312
+ const state = this.state();
313
+ if (state === 'open') {
314
+ untracked(() => this.open());
315
+ }
316
+ if (state === 'closed') {
317
+ untracked(() => this.close(this._options().closeDelay));
318
+ }
319
+ });
281
320
  }
282
- set restoreFocus(restoreFocus) {
283
- this._options.restoreFocus = restoreFocus;
284
- }
285
- set closeOnOutsidePointerEvents(closeOnOutsidePointerEvents) {
286
- this._options.closeOnOutsidePointerEvents = closeOnOutsidePointerEvents;
287
- }
288
- set closeOnBackdropClick(closeOnBackdropClick) {
289
- this._options.closeOnBackdropClick = closeOnBackdropClick;
290
- }
291
- set attachTo(attachTo) {
292
- this._options.attachTo = attachTo;
293
- }
294
- set attachPositions(attachPositions) {
295
- this._options.attachPositions = attachPositions;
296
- }
297
- set autoFocus(autoFocus) {
298
- this._options.autoFocus = autoFocus;
299
- }
300
- set closeDelay(closeDelay) {
301
- this._options.closeDelay = closeDelay;
302
- }
303
- set disableClose(disableClose) {
304
- this._options.disableClose = disableClose;
305
- }
306
- /* eslint-disable-next-line @angular-eslint/no-input-rename */
307
- set ariaDescribedBy(ariaDescribedBy) {
308
- this.setAriaDescribedBy(ariaDescribedBy);
309
- }
310
- /* eslint-disable-next-line @angular-eslint/no-input-rename */
311
- set ariaLabelledBy(ariaLabelledBy) {
312
- this.setAriaLabelledBy(ariaLabelledBy);
313
- }
314
- set ariaLabel(ariaLabel) {
315
- this.setAriaLabel(ariaLabel);
316
- }
317
- set ariaModal(isModal) {
318
- this.setAriaModal(isModal);
319
- }
321
+ restoreFocus = input(true);
322
+ closeOnOutsidePointerEvents = input(false, {
323
+ transform: booleanAttribute,
324
+ });
325
+ mutableCloseOnOutsidePointerEvents = computed(() => signal(this.closeOnOutsidePointerEvents()));
326
+ _closeOnOutsidePointerEventsState = computed(() => this.mutableCloseOnOutsidePointerEvents()());
327
+ closeOnBackdropClick = input(DEFAULT_BRN_DIALOG_OPTIONS.closeOnBackdropClick, {
328
+ transform: booleanAttribute,
329
+ });
330
+ mutableCloseOnBackdropClick = computed(() => signal(this.closeOnBackdropClick()));
331
+ _closeOnBackdropClickState = computed(() => this.mutableCloseOnBackdropClick()());
332
+ attachTo = input(null);
333
+ mutableAttachTo = computed(() => signal(this.attachTo()));
334
+ _attachToState = computed(() => this.mutableAttachTo()());
335
+ attachPositions = input([]);
336
+ mutableAttachPositions = computed(() => signal(this.attachPositions()));
337
+ _attachPositionsState = computed(() => this.mutableAttachPositions()());
338
+ autoFocus = input('first-tabbable');
339
+ closeDelay = input(100, { alias: 'closeDelay', transform: numberAttribute });
340
+ disableClose = input(false, { transform: booleanAttribute });
341
+ ariaDescribedBy = input(null, {
342
+ alias: 'aria-describedby',
343
+ });
344
+ _mutableAriaDescribedBy = computed(() => signal(this.ariaDescribedBy()));
345
+ _ariaDescribedByState = computed(() => this._mutableAriaDescribedBy()());
346
+ ariaLabelledBy = input(null, { alias: 'aria-labelledby' });
347
+ _mutableAriaLabelledBy = computed(() => signal(this.ariaLabelledBy()));
348
+ _ariaLabelledByState = computed(() => this._mutableAriaLabelledBy()());
349
+ ariaLabel = input(null, { alias: 'aria-label' });
350
+ _mutableAriaLabel = computed(() => signal(this.ariaLabel()));
351
+ _ariaLabelState = computed(() => this._mutableAriaLabel()());
352
+ ariaModal = input(true, { alias: 'aria-modal', transform: booleanAttribute });
353
+ _mutableAriaModal = computed(() => signal(this.ariaModal()));
354
+ _ariaModalState = computed(() => this._mutableAriaModal()());
320
355
  open() {
321
356
  if (!this._contentTemplate || this._dialogRef())
322
357
  return;
323
358
  this._dialogStateEffectRef?.destroy();
324
- const dialogRef = this._dialogService.open(this._contentTemplate, this._vcr, this._context, this._options);
359
+ const dialogRef = this._dialogService.open(this._contentTemplate, this._vcr, this._context, this._options());
325
360
  this._dialogRef.set(dialogRef);
326
361
  runInInjectionContext(this._injector, () => {
327
- this._dialogStateEffectRef = effect(() => this.stateChanged.emit(dialogRef.state()));
362
+ this._dialogStateEffectRef = effect(() => {
363
+ const state = dialogRef.state();
364
+ untracked(() => this.stateChanged.emit(state));
365
+ });
328
366
  });
329
367
  dialogRef.closed$.pipe(take(1)).subscribe((result) => {
330
368
  this._dialogRef.set(undefined);
@@ -333,17 +371,17 @@ class BrnDialogComponent {
333
371
  }
334
372
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
335
373
  close(result, delay) {
336
- this._dialogRef()?.close(result, delay ?? this._options.closeDelay);
374
+ this._dialogRef()?.close(result, delay ?? this._options().closeDelay);
337
375
  }
338
376
  registerTemplate(template) {
339
377
  this._contentTemplate = template;
340
378
  }
341
379
  setOverlayClass(overlayClass) {
342
- this._options.backdropClass = overlayClass ?? '';
380
+ this._backdropClass.set(overlayClass);
343
381
  this._dialogRef()?.setOverlayClass(overlayClass);
344
382
  }
345
383
  setPanelClass(panelClass) {
346
- this._options.panelClass = panelClass ?? '';
384
+ this._panelClass.set(panelClass ?? '');
347
385
  this._dialogRef()?.setPanelClass(panelClass);
348
386
  }
349
387
  setContext(context) {
@@ -352,22 +390,22 @@ class BrnDialogComponent {
352
390
  this._context = { ...this._context, ...context };
353
391
  }
354
392
  setAriaDescribedBy(ariaDescribedBy) {
355
- this._options = { ...this._options, ariaDescribedBy };
393
+ this._mutableAriaDescribedBy().set(ariaDescribedBy);
356
394
  this._dialogRef()?.setAriaDescribedBy(ariaDescribedBy);
357
395
  }
358
396
  setAriaLabelledBy(ariaLabelledBy) {
359
- this._options = { ...this._options, ariaLabelledBy };
397
+ this._mutableAriaLabelledBy().set(ariaLabelledBy);
360
398
  this._dialogRef()?.setAriaLabelledBy(ariaLabelledBy);
361
399
  }
362
400
  setAriaLabel(ariaLabel) {
363
- this._options = { ...this._options, ariaLabel };
401
+ this._mutableAriaLabel().set(ariaLabel);
364
402
  this._dialogRef()?.setAriaLabel(ariaLabel);
365
403
  }
366
404
  setAriaModal(ariaModal) {
367
- this._options = { ...this._options, ariaModal };
405
+ this._mutableAriaModal().set(ariaModal);
368
406
  }
369
407
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
370
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.5", type: BrnDialogComponent, isStandalone: true, selector: "brn-dialog", inputs: { newState: ["state", "newState"], role: "role", hasBackdrop: ["hasBackdrop", "hasBackdrop", booleanAttribute], positionStrategy: "positionStrategy", scrollStrategy: "scrollStrategy", restoreFocus: "restoreFocus", closeOnOutsidePointerEvents: ["closeOnOutsidePointerEvents", "closeOnOutsidePointerEvents", booleanAttribute], closeOnBackdropClick: ["closeOnBackdropClick", "closeOnBackdropClick", booleanAttribute], attachTo: "attachTo", attachPositions: "attachPositions", autoFocus: "autoFocus", closeDelay: ["closeDelay", "closeDelay", numberAttribute], disableClose: ["disableClose", "disableClose", booleanAttribute], ariaDescribedBy: ["aria-describedby", "ariaDescribedBy"], ariaLabelledBy: ["aria-labelledby", "ariaLabelledBy"], ariaLabel: ["aria-label", "ariaLabel"], ariaModal: ["aria-modal", "ariaModal", booleanAttribute] }, outputs: { closed: "closed", stateChanged: "stateChanged" }, exportAs: ["brnDialog"], ngImport: i0, template: `
408
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogComponent, isStandalone: true, selector: "brn-dialog", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null }, positionStrategy: { classPropertyName: "positionStrategy", publicName: "positionStrategy", isSignal: true, isRequired: false, transformFunction: null }, scrollStrategy: { classPropertyName: "scrollStrategy", publicName: "scrollStrategy", isSignal: true, isRequired: false, transformFunction: null }, restoreFocus: { classPropertyName: "restoreFocus", publicName: "restoreFocus", isSignal: true, isRequired: false, transformFunction: null }, closeOnOutsidePointerEvents: { classPropertyName: "closeOnOutsidePointerEvents", publicName: "closeOnOutsidePointerEvents", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdropClick: { classPropertyName: "closeOnBackdropClick", publicName: "closeOnBackdropClick", isSignal: true, isRequired: false, transformFunction: null }, attachTo: { classPropertyName: "attachTo", publicName: "attachTo", isSignal: true, isRequired: false, transformFunction: null }, attachPositions: { classPropertyName: "attachPositions", publicName: "attachPositions", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, disableClose: { classPropertyName: "disableClose", publicName: "disableClose", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaModal: { classPropertyName: "ariaModal", publicName: "aria-modal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed", stateChanged: "stateChanged" }, exportAs: ["brnDialog"], ngImport: i0, template: `
371
409
  <ng-content />
372
410
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
373
411
  }
@@ -383,81 +421,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
383
421
  encapsulation: ViewEncapsulation.None,
384
422
  exportAs: 'brnDialog',
385
423
  }]
386
- }], propDecorators: { closed: [{
387
- type: Output
388
- }], stateChanged: [{
389
- type: Output
390
- }], newState: [{
391
- type: Input,
392
- args: ['state']
393
- }], role: [{
394
- type: Input
395
- }], hasBackdrop: [{
396
- type: Input,
397
- args: [{ transform: booleanAttribute }]
398
- }], positionStrategy: [{
399
- type: Input
400
- }], scrollStrategy: [{
401
- type: Input
402
- }], restoreFocus: [{
403
- type: Input
404
- }], closeOnOutsidePointerEvents: [{
405
- type: Input,
406
- args: [{ transform: booleanAttribute }]
407
- }], closeOnBackdropClick: [{
408
- type: Input,
409
- args: [{ transform: booleanAttribute }]
410
- }], attachTo: [{
411
- type: Input
412
- }], attachPositions: [{
413
- type: Input
414
- }], autoFocus: [{
415
- type: Input
416
- }], closeDelay: [{
417
- type: Input,
418
- args: [{ transform: numberAttribute }]
419
- }], disableClose: [{
420
- type: Input,
421
- args: [{ transform: booleanAttribute }]
422
- }], ariaDescribedBy: [{
423
- type: Input,
424
- args: ['aria-describedby']
425
- }], ariaLabelledBy: [{
426
- type: Input,
427
- args: ['aria-labelledby']
428
- }], ariaLabel: [{
429
- type: Input,
430
- args: ['aria-label']
431
- }], ariaModal: [{
432
- type: Input,
433
- args: [{
434
- alias: 'aria-modal',
435
- transform: booleanAttribute,
436
- }]
437
- }] } });
424
+ }], ctorParameters: () => [] });
438
425
 
439
426
  class BrnDialogContentDirective {
440
427
  _brnDialog = inject(BrnDialogComponent, { optional: true });
441
428
  _brnDialogRef = inject(BrnDialogRef, { optional: true });
442
429
  _template = inject(TemplateRef);
443
- state = computed(() => this._brnDialog?.state() ?? this._brnDialogRef?.state() ?? 'closed');
444
- set class(newClass) {
445
- if (!this._brnDialog)
446
- return;
447
- this._brnDialog.setPanelClass(newClass);
448
- }
449
- set context(context) {
450
- if (!this._brnDialog)
451
- return;
452
- this._brnDialog.setContext(context);
453
- }
430
+ state = computed(() => this._brnDialog?.stateComputed() ?? this._brnDialogRef?.state() ?? 'closed');
431
+ className = input(undefined, { alias: 'class' });
432
+ context = input(undefined);
454
433
  constructor() {
455
434
  if (!this._brnDialog)
456
435
  return;
457
436
  this._brnDialog.registerTemplate(this._template);
437
+ effect(() => {
438
+ const context = this.context();
439
+ if (!this._brnDialog || !context)
440
+ return;
441
+ untracked(() => this._brnDialog?.setContext(context));
442
+ });
443
+ effect(() => {
444
+ if (!this._brnDialog)
445
+ return;
446
+ const newClass = this.className();
447
+ untracked(() => this._brnDialog?.setPanelClass(newClass));
448
+ });
458
449
  }
459
450
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
460
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnDialogContentDirective, isStandalone: true, selector: "[brnDialogContent]", inputs: { class: "class", context: "context" }, providers: [provideExposesStateProviderExisting((() => BrnDialogContentDirective))], ngImport: i0 });
451
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogContentDirective, isStandalone: true, selector: "[brnDialogContent]", inputs: { className: { classPropertyName: "className", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideExposesStateProviderExisting((() => BrnDialogContentDirective))], ngImport: i0 });
461
452
  }
462
453
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogContentDirective, decorators: [{
463
454
  type: Directive,
@@ -466,11 +457,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
466
457
  standalone: true,
467
458
  providers: [provideExposesStateProviderExisting((() => BrnDialogContentDirective))],
468
459
  }]
469
- }], ctorParameters: () => [], propDecorators: { class: [{
470
- type: Input
471
- }], context: [{
472
- type: Input
473
- }] } });
460
+ }], ctorParameters: () => [] });
474
461
 
475
462
  class BrnDialogDescriptionDirective {
476
463
  _brnDialogRef = inject(BrnDialogRef);
@@ -496,14 +483,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
496
483
 
497
484
  class BrnDialogOverlayComponent {
498
485
  _brnDialog = inject(BrnDialogComponent);
499
- set class(newClass) {
500
- this._brnDialog.setOverlayClass(newClass);
501
- }
486
+ className = input(undefined, { alias: 'class' });
502
487
  setClassToCustomElement(newClass) {
503
488
  this._brnDialog.setOverlayClass(newClass);
504
489
  }
490
+ constructor() {
491
+ effect(() => {
492
+ if (!this._brnDialog)
493
+ return;
494
+ const newClass = this.className();
495
+ untracked(() => this._brnDialog.setOverlayClass(newClass));
496
+ });
497
+ }
505
498
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
506
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.5", type: BrnDialogOverlayComponent, isStandalone: true, selector: "brn-dialog-overlay", inputs: { class: "class" }, providers: [provideCustomClassSettableExisting((() => BrnDialogOverlayComponent))], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
499
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogOverlayComponent, isStandalone: true, selector: "brn-dialog-overlay", inputs: { className: { classPropertyName: "className", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideCustomClassSettableExisting((() => BrnDialogOverlayComponent))], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
507
500
  }
508
501
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogOverlayComponent, decorators: [{
509
502
  type: Component,
@@ -515,9 +508,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
515
508
  changeDetection: ChangeDetectionStrategy.OnPush,
516
509
  encapsulation: ViewEncapsulation.None,
517
510
  }]
518
- }], propDecorators: { class: [{
519
- type: Input
520
- }] } });
511
+ }], ctorParameters: () => [] });
521
512
 
522
513
  class BrnDialogTitleDirective {
523
514
  _brnDialogRef = inject(BrnDialogRef);
@@ -548,14 +539,24 @@ class BrnDialogTriggerDirective {
548
539
  id = input(`brn-dialog-trigger-${idSequence++}`);
549
540
  state = this._brnDialogRef?.state ?? signal('closed');
550
541
  dialogId = `brn-dialog-${this._brnDialogRef?.dialogId ?? idSequence++}`;
551
- set brnDialogTriggerFor(brnDialog) {
552
- this._brnDialog = brnDialog;
542
+ brnDialogTriggerFor = input(undefined, {
543
+ alias: 'brnDialogTriggerFor',
544
+ });
545
+ mutableBrnDialogTriggerFor = computed(() => signal(this.brnDialogTriggerFor()));
546
+ brnDialogTriggerForState = computed(() => this.mutableBrnDialogTriggerFor()());
547
+ constructor() {
548
+ effect(() => {
549
+ const brnDialog = this.brnDialogTriggerForState();
550
+ if (!brnDialog)
551
+ return;
552
+ this._brnDialog = brnDialog;
553
+ });
553
554
  }
554
555
  open() {
555
556
  this._brnDialog?.open();
556
557
  }
557
558
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
558
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogTriggerDirective, isStandalone: true, selector: "button[brnDialogTrigger],button[brnDialogTriggerFor]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, brnDialogTriggerFor: { classPropertyName: "brnDialogTriggerFor", publicName: "brnDialogTriggerFor", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "dialog" }, listeners: { "click": "open()" }, properties: { "id": "id()", "attr.aria-expanded": "state() === 'open' ? 'true': 'false'", "attr.data-state": "state()", "attr.aria-controls": "dialogId" } }, exportAs: ["brnDialogTrigger"], ngImport: i0 });
559
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnDialogTriggerDirective, isStandalone: true, selector: "button[brnDialogTrigger],button[brnDialogTriggerFor]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, brnDialogTriggerFor: { classPropertyName: "brnDialogTriggerFor", publicName: "brnDialogTriggerFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-haspopup": "dialog" }, listeners: { "click": "open()" }, properties: { "id": "id()", "attr.aria-expanded": "state() === 'open' ? 'true': 'false'", "attr.data-state": "state()", "attr.aria-controls": "dialogId" } }, exportAs: ["brnDialogTrigger"], ngImport: i0 });
559
560
  }
560
561
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnDialogTriggerDirective, decorators: [{
561
562
  type: Directive,
@@ -572,9 +573,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
572
573
  },
573
574
  exportAs: 'brnDialogTrigger',
574
575
  }]
575
- }], propDecorators: { brnDialogTriggerFor: [{
576
- type: Input
577
- }] } });
576
+ }], ctorParameters: () => [] });
578
577
 
579
578
  const BrnDialogImports = [
580
579
  BrnDialogComponent,
@@ -614,5 +613,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImpor
614
613
  * Generated bundle index. Do not edit.
615
614
  */
616
615
 
617
- export { BrnDialogCloseDirective, BrnDialogComponent, BrnDialogContentDirective, BrnDialogDescriptionDirective, BrnDialogImports, BrnDialogModule, BrnDialogOverlayComponent, BrnDialogRef, BrnDialogService, BrnDialogTitleDirective, BrnDialogTriggerDirective, DEFAULT_BRN_DIALOG_OPTIONS, cssClassesToArray, injectBrnDialogContext, injectBrnDialogCtx };
616
+ export { BrnDialogCloseDirective, BrnDialogComponent, BrnDialogContentDirective, BrnDialogDescriptionDirective, BrnDialogImports, BrnDialogModule, BrnDialogOverlayComponent, BrnDialogRef, BrnDialogService, BrnDialogTitleDirective, BrnDialogTriggerDirective, DEFAULT_BRN_DIALOG_OPTIONS, cssClassesToArray, defaultOptions, injectBrnDialogContext, injectBrnDialogCtx, injectBrnDialogDefaultOptions, provideBrnDialogDefaultOptions };
618
617
  //# sourceMappingURL=spartan-ng-brain-dialog.mjs.map