@odx/angular 12.7.0 → 12.9.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 (71) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/cdk/autocomplete-control/index.d.ts +1 -0
  3. package/cdk/autocomplete-control/lib/directives/highlight-search-result.directive.d.ts +19 -0
  4. package/cdk/autocomplete-control/lib/directives/index.d.ts +1 -0
  5. package/components/data-table/README.md +3 -0
  6. package/components/data-table/index.d.ts +4 -0
  7. package/components/data-table/lib/data-table.component.d.ts +32 -0
  8. package/components/data-table/lib/data-table.module.d.ts +14 -0
  9. package/components/data-table/lib/directives/cell-def.directive.d.ts +7 -0
  10. package/components/data-table/lib/directives/cell.directive.d.ts +5 -0
  11. package/components/data-table/lib/directives/column-def.directive.d.ts +11 -0
  12. package/components/data-table/lib/directives/header-cell-def.directive.d.ts +7 -0
  13. package/components/data-table/lib/directives/header-cell.directive.d.ts +5 -0
  14. package/components/data-table/lib/directives/index.d.ts +6 -0
  15. package/components/data-table/lib/directives/table-empty.directive.d.ts +5 -0
  16. package/components/data-table/lib/models/index.d.ts +3 -0
  17. package/components/data-table/lib/models/sort-direction.d.ts +6 -0
  18. package/components/data-table/lib/models/sort-state.d.ts +5 -0
  19. package/components/data-table/lib/models/table-variant.d.ts +5 -0
  20. package/components/main-menu/lib/main-menu.component.d.ts +0 -1
  21. package/components/modal/lib/modal.component.d.ts +1 -1
  22. package/components/table/lib/components/header-title/header-title.component.d.ts +2 -2
  23. package/components/table/lib/models/header-cell.d.ts +1 -2
  24. package/components/table/lib/models/index.d.ts +1 -2
  25. package/components/table/lib/table.component.d.ts +3 -3
  26. package/esm2022/cdk/autocomplete-control/index.mjs +2 -1
  27. package/esm2022/cdk/autocomplete-control/lib/directives/highlight-search-result.directive.mjs +43 -0
  28. package/esm2022/cdk/autocomplete-control/lib/directives/index.mjs +2 -0
  29. package/esm2022/cdk/connected-overlay/lib/connected-overlay.component.mjs +2 -2
  30. package/esm2022/components/data-table/index.mjs +5 -0
  31. package/esm2022/components/data-table/lib/data-table.component.mjs +51 -0
  32. package/esm2022/components/data-table/lib/data-table.module.mjs +19 -0
  33. package/esm2022/components/data-table/lib/directives/cell-def.directive.mjs +17 -0
  34. package/esm2022/components/data-table/lib/directives/cell.directive.mjs +18 -0
  35. package/esm2022/components/data-table/lib/directives/column-def.directive.mjs +27 -0
  36. package/esm2022/components/data-table/lib/directives/header-cell-def.directive.mjs +17 -0
  37. package/esm2022/components/data-table/lib/directives/header-cell.directive.mjs +18 -0
  38. package/esm2022/components/data-table/lib/directives/index.mjs +7 -0
  39. package/esm2022/components/data-table/lib/directives/table-empty.directive.mjs +11 -0
  40. package/esm2022/components/data-table/lib/models/index.mjs +4 -0
  41. package/esm2022/components/data-table/lib/models/sort-direction.mjs +6 -0
  42. package/esm2022/components/data-table/lib/models/sort-state.mjs +2 -0
  43. package/esm2022/components/data-table/lib/models/table-variant.mjs +5 -0
  44. package/esm2022/components/data-table/odx-angular-components-data-table.mjs +5 -0
  45. package/esm2022/components/main-menu/lib/main-menu.component.mjs +4 -8
  46. package/esm2022/components/modal/lib/modal.component.mjs +8 -10
  47. package/esm2022/components/table/lib/components/header-title/header-title.component.mjs +1 -1
  48. package/esm2022/components/table/lib/models/header-cell.mjs +1 -1
  49. package/esm2022/components/table/lib/models/index.mjs +2 -3
  50. package/esm2022/components/table/lib/models/table-body-cell.mjs +2 -0
  51. package/esm2022/components/table/lib/table.component.mjs +7 -19
  52. package/esm2022/components/toast/lib/components/toast-container/toast-container.component.mjs +6 -5
  53. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs +43 -2
  54. package/fesm2022/odx-angular-cdk-autocomplete-control.mjs.map +1 -1
  55. package/fesm2022/odx-angular-cdk-connected-overlay.mjs +1 -1
  56. package/fesm2022/odx-angular-cdk-connected-overlay.mjs.map +1 -1
  57. package/fesm2022/odx-angular-components-data-table.mjs +176 -0
  58. package/fesm2022/odx-angular-components-data-table.mjs.map +1 -0
  59. package/fesm2022/odx-angular-components-main-menu.mjs +3 -7
  60. package/fesm2022/odx-angular-components-main-menu.mjs.map +1 -1
  61. package/fesm2022/odx-angular-components-modal.mjs +7 -6
  62. package/fesm2022/odx-angular-components-modal.mjs.map +1 -1
  63. package/fesm2022/odx-angular-components-table.mjs +6 -18
  64. package/fesm2022/odx-angular-components-table.mjs.map +1 -1
  65. package/fesm2022/odx-angular-components-toast.mjs +5 -4
  66. package/fesm2022/odx-angular-components-toast.mjs.map +1 -1
  67. package/package.json +13 -7
  68. package/components/table/lib/models/column-width.d.ts +0 -5
  69. package/esm2022/components/table/lib/models/body-cell.mjs +0 -2
  70. package/esm2022/components/table/lib/models/column-width.mjs +0 -2
  71. /package/components/table/lib/models/{body-cell.d.ts → table-body-cell.d.ts} +0 -0
@@ -1,11 +1,12 @@
1
1
  import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Directive, ViewChild, Input, Output, HostListener, InjectionToken } from '@angular/core';
3
+ import { inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Directive, ViewChild, Input, Output, HostListener, computed, SecurityContext, input, InjectionToken } from '@angular/core';
4
4
  import { detectControllerChanges, ODX_STRING_SEARCH_HANDLER, ODX_STRINGIFY } from '@odx/angular';
5
5
  import { CustomFormControl } from '@odx/angular/cdk/custom-form-control';
6
6
  import { DropdownDirective } from '@odx/angular/components/dropdown';
7
7
  import { FormFieldComponent } from '@odx/angular/components/form-field';
8
8
  import { untilDestroyed, injectElement, isFunction, Pure } from '@odx/angular/utils';
9
+ import { DomSanitizer } from '@angular/platform-browser';
9
10
  import { __decorate, __metadata } from 'tslib';
10
11
 
11
12
  /**
@@ -198,6 +199,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
198
199
  args: ['focusout', ['$event']]
199
200
  }] } });
200
201
 
202
+ class HighlightSearchDirective {
203
+ constructor() {
204
+ this.sanitizer = inject(DomSanitizer);
205
+ this.highlightedText = computed(() => {
206
+ const search = this.odxHighlightSearch().trim();
207
+ const text = this.sanitizer.sanitize(SecurityContext.HTML, this.text()) ?? '';
208
+ if (!search) {
209
+ return text;
210
+ }
211
+ const regex = new RegExp(search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi');
212
+ const highlightedText = text.replace(regex, '<mark>$&</mark>');
213
+ return this.sanitizer.bypassSecurityTrustHtml(highlightedText);
214
+ });
215
+ /**
216
+ * Search string
217
+ * @required
218
+ * @type string
219
+ */
220
+ this.odxHighlightSearch = input.required();
221
+ /**
222
+ * Text to highlight
223
+ * @required
224
+ * @type string
225
+ */
226
+ this.text = input.required();
227
+ }
228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HighlightSearchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
229
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: HighlightSearchDirective, isStandalone: true, selector: "odx-highlight", inputs: { odxHighlightSearch: { classPropertyName: "odxHighlightSearch", publicName: "odxHighlightSearch", isSignal: true, isRequired: true, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "innerHTML": "highlightedText()" } }, ngImport: i0 }); }
230
+ }
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HighlightSearchDirective, decorators: [{
232
+ type: Directive,
233
+ args: [{
234
+ selector: 'odx-highlight',
235
+ standalone: true,
236
+ host: {
237
+ '[innerHTML]': 'highlightedText()',
238
+ },
239
+ }]
240
+ }] });
241
+
201
242
  const ODX_SEARCH_FILTER_HOST = new InjectionToken('@odx/angular/cdk/autocomplete-control::SearchFilterHost');
202
243
  class BaseSearchFilterPipe {
203
244
  constructor() {
@@ -245,5 +286,5 @@ __decorate([
245
286
  * Generated bundle index. Do not edit.
246
287
  */
247
288
 
248
- export { AutocompleteControl, BaseSearchFilterPipe, ODX_SEARCH_FILTER_HOST };
289
+ export { AutocompleteControl, BaseSearchFilterPipe, HighlightSearchDirective, ODX_SEARCH_FILTER_HOST };
249
290
  //# sourceMappingURL=odx-angular-cdk-autocomplete-control.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-autocomplete-control.mjs","sources":["../../../../libs/angular/cdk/autocomplete-control/src/lib/autocomplete-control.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/pipes/base-search-filter-pipe.ts","../../../../libs/angular/cdk/autocomplete-control/src/odx-angular-cdk-autocomplete-control.ts"],"sourcesContent":["import { ActiveDescendantKeyManager, Highlightable } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport { detectControllerChanges, StringifyFn } from '@odx/angular';\nimport { CustomFormControl, InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { FormFieldComponent } from '@odx/angular/components/form-field';\nimport { injectElement, isFunction, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `AutocompleteControl` is a base directive to enhance an input field with autocomplete functionality,\n * providing keyboard navigation and selection for options displayed in a dropdown. It's designed to be extended\n * for specific implementations.\n * Extends `CustomFormControl` to provide form control behavior and state management.\n *\n * @see {CustomFormControl}\n *\n * This directive manages the open/close state of the dropdown, the loading state indication, and the interaction between\n * the autocomplete input and the dropdown options. It utilizes `ActiveDescendantKeyManager` for keyboard navigation among options.\n *\n * Extend this directive to create a fully functional autocomplete control tailored to your data type and UI requirements.\n *\n * @template T - The type of the items displayed in the autocomplete dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n '[class.is-open]': 'isOpen',\n '[attr.aria-disabled]': 'isDisabled || null',\n },\n})\nexport abstract class AutocompleteControl<T> extends CustomFormControl<T | null> implements AfterViewInit {\n protected abstract readonly options?: QueryList<OptionControl<T>>;\n\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly formField = inject(FormFieldComponent, { optional: true });\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected keyManager?: ActiveDescendantKeyManager<Highlightable>;\n protected smoothScrollEnabled = false;\n\n @ViewChild(DropdownDirective)\n protected readonly dropdown?: DropdownDirective;\n\n public abstract searchField?: InputControlDirective;\n\n public readonly element = injectElement();\n\n public get dropdownReferenceElement(): HTMLElement {\n return this.formField?.controlElement?.nativeElement ?? this.element?.nativeElement;\n }\n\n public get hasOptions(): boolean {\n return !!this.options?.length;\n }\n\n public get isOpen(): boolean {\n return !!this.dropdown?.isOpen;\n }\n\n @Input({ transform: booleanAttribute })\n public isLoading = false;\n\n /**\n * A function that converts an item of type T to a string representation.\n * Used by the AutocompleteControl component to display the selected item.\n *\n * @type {StringifyFn<T>}\n *\n * @example\n * ```ts\n * // Define a stringify function for a custom type Person\n * const stringifyPerson: StringifyFn<Person> = (person) => `${person.firstName} ${person.lastName}`;\n *\n * // Assign the stringify function to the AutocompleteControl\n * autocompleteControl.stringify = stringifyPerson;\n * ```\n */\n @Input()\n public stringify?: StringifyFn<T>;\n\n /**\n * Emits the selected option when an option is selected from the dropdown.\n *\n * @emits {T} - The selected option.\n *\n * @example\n * ```ts\n * autocompleteControl.optionSelected.subscribe((selectedOption) => {\n * console.log('Selected option:', selectedOption);\n * });\n * ```\n */\n @Output()\n public optionSelected = new EventEmitter<T>();\n\n /**\n * Event emitted before the dropdown opens.\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownOpen)=\"onBeforeDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown opened.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownOpen)=\"onAfterDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted before the dropdown closes.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownClose)=\"onBeforeDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownClose = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown closed.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownClose)=\"onAfterDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownClose = new EventEmitter<void>();\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n if (!this.options) return;\n\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n }\n\n /**\n * Scrolls the specified option element into view.\n * @param {OptionControl<T>} option - The option control containing the element to scroll into view.\n * @returns {void}\n *\n * @example\n * ```ts\n * const optionControl: OptionControl<string> = { element: myOptionElement };\n * scrollOptionIntoView(optionControl);\n * ```\n */\n public scrollOptionIntoView({ element }: OptionControl<T>): void {\n const behavior = this.smoothScrollEnabled ? 'smooth' : undefined;\n if (isFunction(element.nativeElement.scrollIntoView)) {\n element.nativeElement.scrollIntoView({ block: 'center', behavior });\n }\n }\n\n protected abstract handleQueryListOption(options: QueryList<OptionControl<T>>): void;\n\n protected abstract handleSearchFieldChanges(): void;\n\n protected abstract activateSelectedOption(): void;\n\n protected initKeyManager(options: Highlightable[]): void {\n this.keyManager = new ActiveDescendantKeyManager<Highlightable>(options).withHomeAndEnd();\n }\n\n protected disableSmoothScroll(): void {\n this.smoothScrollEnabled = false;\n }\n\n protected enableSmoothScroll(): void {\n this.smoothScrollEnabled = true;\n }\n\n protected openDropdown(): void {\n this.dropdown?.open();\n }\n\n protected closeDropdown(): void {\n this.dropdown?.close();\n }\n\n protected onDropdownOpen(): void {\n this.beforeDropdownOpen.emit();\n this.activateSelectedOption();\n }\n\n protected onDropdownOpened(): void {\n this.afterDropdownOpen.emit();\n this.enableSmoothScroll();\n }\n\n protected onDropdownClose(): void {\n this.beforeDropdownClose.emit();\n this.disableSmoothScroll();\n }\n\n protected onDropdownClosed(): void {\n this.afterDropdownClose.emit();\n }\n\n @HostListener('focusout', ['$event'])\n protected handleFocusOut(event: FocusEvent): void {\n if (this.isOpen) {\n event.stopImmediatePropagation();\n }\n this.onTouched();\n }\n}\n","import { inject, InjectionToken, PipeTransform } from '@angular/core';\nimport { ODX_STRINGIFY, ODX_STRING_SEARCH_HANDLER, StringifyFn, StringSearchHandler } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { isFunction, Pure } from '@odx/angular/utils';\n\ninterface HostController {\n searchField?: InputControlDirective;\n stringify?: StringifyFn<unknown>;\n}\n\ninterface SearchFilterPipeOptions<T> {\n searchHandler?: StringSearchHandler;\n stringify?: StringifyFn<T>;\n}\n\nexport const ODX_SEARCH_FILTER_HOST = new InjectionToken<HostController>('@odx/angular/cdk/autocomplete-control::SearchFilterHost');\n\nexport abstract class BaseSearchFilterPipe implements PipeTransform {\n private readonly stringSearchHandler = inject(ODX_STRING_SEARCH_HANDLER);\n private readonly defaultStringify = inject(ODX_STRINGIFY);\n protected readonly hostController = inject(ODX_SEARCH_FILTER_HOST, { optional: true });\n\n protected get searchField(): InputControlDirective | undefined {\n return this.hostController?.searchField;\n }\n\n protected get stringify(): StringifyFn<unknown> {\n return this.hostController?.stringify ?? this.defaultStringify;\n }\n\n public transform<T>(items: T[] | null, optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): T[] | null {\n const searchHandler = this.isStringSearchHandler(optionsOrHandler) ? optionsOrHandler : optionsOrHandler?.searchHandler;\n const stringify = this.isStringSearchHandler(optionsOrHandler) ? null : optionsOrHandler?.stringify;\n if (this.searchField) {\n return this.filter(items, this.searchField.nativeElementValue, stringify ?? (this.stringify as never), searchHandler ?? this.stringSearchHandler);\n }\n return items;\n }\n\n protected queryHandler(query: string): string {\n return query?.trim() || '';\n }\n\n @Pure\n private filter<T>(items: T[] | null, query: string, stringify: StringifyFn<T>, searchHandler: StringSearchHandler): T[] | null {\n if (!items) return null;\n\n query = this.queryHandler(query);\n\n if (query === '') return items;\n\n return items.filter((item) => searchHandler(stringify(item), query));\n }\n\n private isStringSearchHandler<T>(optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): optionsOrHandler is StringSearchHandler {\n return isFunction(optionsOrHandler);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAqBA;;;;;;;;;;;;;;AAcG;AAQG,MAAgB,mBAAuB,SAAQ,iBAA2B,CAAA;AAiB9E,IAAA,IAAW,wBAAwB,GAAA;AACjC,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;KACrF;AAED,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;KAC/B;AAED,IAAA,IAAW,MAAM,GAAA;AACf,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;KAChC;AA6FD,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,IAAI,CAAC,CAAC;AAtHK,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC3C,IAAS,CAAA,SAAA,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;QAG/C,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;QAOtB,IAAO,CAAA,OAAA,GAAG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EAAE,KAAa,EAAE,SAAyB,EAAE,aAAkC,EAAA;AAC/G,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,IAAI,CAAC;AAExB,QAAA,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,KAAK,KAAK,EAAE;AAAE,YAAA,OAAO,KAAK,CAAC;AAE/B,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;KACtE;AAEO,IAAA,qBAAqB,CAAI,gBAAmE,EAAA;AAClG,QAAA,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;KACrC;AACF,CAAA;AAbS,UAAA,CAAA;IADP,IAAI;;;;AASJ,CAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;ACpDH;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-autocomplete-control.mjs","sources":["../../../../libs/angular/cdk/autocomplete-control/src/lib/autocomplete-control.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/directives/highlight-search-result.directive.ts","../../../../libs/angular/cdk/autocomplete-control/src/lib/pipes/base-search-filter-pipe.ts","../../../../libs/angular/cdk/autocomplete-control/src/odx-angular-cdk-autocomplete-control.ts"],"sourcesContent":["import { ActiveDescendantKeyManager, Highlightable } from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n QueryList,\n ViewChild,\n} from '@angular/core';\nimport { detectControllerChanges, StringifyFn } from '@odx/angular';\nimport { CustomFormControl, InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { OptionControl } from '@odx/angular/cdk/option-control';\nimport { DropdownDirective } from '@odx/angular/components/dropdown';\nimport { FormFieldComponent } from '@odx/angular/components/form-field';\nimport { injectElement, isFunction, untilDestroyed } from '@odx/angular/utils';\n\n/**\n * `AutocompleteControl` is a base directive to enhance an input field with autocomplete functionality,\n * providing keyboard navigation and selection for options displayed in a dropdown. It's designed to be extended\n * for specific implementations.\n * Extends `CustomFormControl` to provide form control behavior and state management.\n *\n * @see {CustomFormControl}\n *\n * This directive manages the open/close state of the dropdown, the loading state indication, and the interaction between\n * the autocomplete input and the dropdown options. It utilizes `ActiveDescendantKeyManager` for keyboard navigation among options.\n *\n * Extend this directive to create a fully functional autocomplete control tailored to your data type and UI requirements.\n *\n * @template T - The type of the items displayed in the autocomplete dropdown.\n */\n@Directive({\n standalone: true,\n host: {\n '[class.is-open]': 'isOpen',\n '[attr.aria-disabled]': 'isDisabled || null',\n },\n})\nexport abstract class AutocompleteControl<T> extends CustomFormControl<T | null> implements AfterViewInit {\n protected abstract readonly options?: QueryList<OptionControl<T>>;\n\n protected readonly changeDetector = inject(ChangeDetectorRef);\n protected readonly formField = inject(FormFieldComponent, { optional: true });\n protected readonly takeUntilDestroyed = untilDestroyed();\n\n protected keyManager?: ActiveDescendantKeyManager<Highlightable>;\n protected smoothScrollEnabled = false;\n\n @ViewChild(DropdownDirective)\n protected readonly dropdown?: DropdownDirective;\n\n public abstract searchField?: InputControlDirective;\n\n public readonly element = injectElement();\n\n public get dropdownReferenceElement(): HTMLElement {\n return this.formField?.controlElement?.nativeElement ?? this.element?.nativeElement;\n }\n\n public get hasOptions(): boolean {\n return !!this.options?.length;\n }\n\n public get isOpen(): boolean {\n return !!this.dropdown?.isOpen;\n }\n\n @Input({ transform: booleanAttribute })\n public isLoading = false;\n\n /**\n * A function that converts an item of type T to a string representation.\n * Used by the AutocompleteControl component to display the selected item.\n *\n * @type {StringifyFn<T>}\n *\n * @example\n * ```ts\n * // Define a stringify function for a custom type Person\n * const stringifyPerson: StringifyFn<Person> = (person) => `${person.firstName} ${person.lastName}`;\n *\n * // Assign the stringify function to the AutocompleteControl\n * autocompleteControl.stringify = stringifyPerson;\n * ```\n */\n @Input()\n public stringify?: StringifyFn<T>;\n\n /**\n * Emits the selected option when an option is selected from the dropdown.\n *\n * @emits {T} - The selected option.\n *\n * @example\n * ```ts\n * autocompleteControl.optionSelected.subscribe((selectedOption) => {\n * console.log('Selected option:', selectedOption);\n * });\n * ```\n */\n @Output()\n public optionSelected = new EventEmitter<T>();\n\n /**\n * Event emitted before the dropdown opens.\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownOpen)=\"onBeforeDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown opened.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownOpen)=\"onAfterDropdownOpen()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownOpen = new EventEmitter<void>();\n\n /**\n * Event emitted before the dropdown closes.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (beforeDropdownClose)=\"onBeforeDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public beforeDropdownClose = new EventEmitter<void>();\n\n /**\n * Event emitted after the dropdown closed.\n *\n * @emits {void}\n *\n * @example\n * ```html\n * <odx-select (afterDropdownClose)=\"onAfterDropdownClose()\">\n * </odx-select>\n * ```\n */\n @Output()\n public afterDropdownClose = new EventEmitter<void>();\n\n constructor() {\n super(null);\n detectControllerChanges(this).subscribe();\n }\n\n public ngAfterViewInit(): void {\n if (!this.options) return;\n\n this.initKeyManager(this.options.toArray());\n this.handleQueryListOption(this.options);\n this.handleSearchFieldChanges();\n }\n\n /**\n * Scrolls the specified option element into view.\n * @param {OptionControl<T>} option - The option control containing the element to scroll into view.\n * @returns {void}\n *\n * @example\n * ```ts\n * const optionControl: OptionControl<string> = { element: myOptionElement };\n * scrollOptionIntoView(optionControl);\n * ```\n */\n public scrollOptionIntoView({ element }: OptionControl<T>): void {\n const behavior = this.smoothScrollEnabled ? 'smooth' : undefined;\n if (isFunction(element.nativeElement.scrollIntoView)) {\n element.nativeElement.scrollIntoView({ block: 'center', behavior });\n }\n }\n\n protected abstract handleQueryListOption(options: QueryList<OptionControl<T>>): void;\n\n protected abstract handleSearchFieldChanges(): void;\n\n protected abstract activateSelectedOption(): void;\n\n protected initKeyManager(options: Highlightable[]): void {\n this.keyManager = new ActiveDescendantKeyManager<Highlightable>(options).withHomeAndEnd();\n }\n\n protected disableSmoothScroll(): void {\n this.smoothScrollEnabled = false;\n }\n\n protected enableSmoothScroll(): void {\n this.smoothScrollEnabled = true;\n }\n\n protected openDropdown(): void {\n this.dropdown?.open();\n }\n\n protected closeDropdown(): void {\n this.dropdown?.close();\n }\n\n protected onDropdownOpen(): void {\n this.beforeDropdownOpen.emit();\n this.activateSelectedOption();\n }\n\n protected onDropdownOpened(): void {\n this.afterDropdownOpen.emit();\n this.enableSmoothScroll();\n }\n\n protected onDropdownClose(): void {\n this.beforeDropdownClose.emit();\n this.disableSmoothScroll();\n }\n\n protected onDropdownClosed(): void {\n this.afterDropdownClose.emit();\n }\n\n @HostListener('focusout', ['$event'])\n protected handleFocusOut(event: FocusEvent): void {\n if (this.isOpen) {\n event.stopImmediatePropagation();\n }\n this.onTouched();\n }\n}\n","import { computed, Directive, inject, input, SecurityContext } from '@angular/core';\nimport { DomSanitizer } from '@angular/platform-browser';\n\n@Directive({\n selector: 'odx-highlight',\n standalone: true,\n host: {\n '[innerHTML]': 'highlightedText()',\n },\n})\nexport class HighlightSearchDirective {\n private readonly sanitizer = inject(DomSanitizer);\n\n protected highlightedText = computed(() => {\n const search = this.odxHighlightSearch().trim();\n const text = this.sanitizer.sanitize(SecurityContext.HTML, this.text()) ?? '';\n\n if (!search) {\n return text;\n }\n\n const regex = new RegExp(search.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'gi');\n const highlightedText = text.replace(regex, '<mark>$&</mark>');\n\n return this.sanitizer.bypassSecurityTrustHtml(highlightedText);\n });\n\n /**\n * Search string\n * @required\n * @type string\n */\n public odxHighlightSearch = input.required<string>();\n\n /**\n * Text to highlight\n * @required\n * @type string\n */\n public text = input.required<string>();\n}\n","import { inject, InjectionToken, PipeTransform } from '@angular/core';\nimport { ODX_STRINGIFY, ODX_STRING_SEARCH_HANDLER, StringifyFn, StringSearchHandler } from '@odx/angular';\nimport { InputControlDirective } from '@odx/angular/cdk/custom-form-control';\nimport { isFunction, Pure } from '@odx/angular/utils';\n\ninterface HostController {\n searchField?: InputControlDirective;\n stringify?: StringifyFn<unknown>;\n}\n\ninterface SearchFilterPipeOptions<T> {\n searchHandler?: StringSearchHandler;\n stringify?: StringifyFn<T>;\n}\n\nexport const ODX_SEARCH_FILTER_HOST = new InjectionToken<HostController>('@odx/angular/cdk/autocomplete-control::SearchFilterHost');\n\nexport abstract class BaseSearchFilterPipe implements PipeTransform {\n private readonly stringSearchHandler = inject(ODX_STRING_SEARCH_HANDLER);\n private readonly defaultStringify = inject(ODX_STRINGIFY);\n protected readonly hostController = inject(ODX_SEARCH_FILTER_HOST, { optional: true });\n\n protected get searchField(): InputControlDirective | undefined {\n return this.hostController?.searchField;\n }\n\n protected get stringify(): StringifyFn<unknown> {\n return this.hostController?.stringify ?? this.defaultStringify;\n }\n\n public transform<T>(items: T[] | null, optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): T[] | null {\n const searchHandler = this.isStringSearchHandler(optionsOrHandler) ? optionsOrHandler : optionsOrHandler?.searchHandler;\n const stringify = this.isStringSearchHandler(optionsOrHandler) ? null : optionsOrHandler?.stringify;\n if (this.searchField) {\n return this.filter(items, this.searchField.nativeElementValue, stringify ?? (this.stringify as never), searchHandler ?? this.stringSearchHandler);\n }\n return items;\n }\n\n protected queryHandler(query: string): string {\n return query?.trim() || '';\n }\n\n @Pure\n private filter<T>(items: T[] | null, query: string, stringify: StringifyFn<T>, searchHandler: StringSearchHandler): T[] | null {\n if (!items) return null;\n\n query = this.queryHandler(query);\n\n if (query === '') return items;\n\n return items.filter((item) => searchHandler(stringify(item), query));\n }\n\n private isStringSearchHandler<T>(optionsOrHandler?: SearchFilterPipeOptions<T> | StringSearchHandler): optionsOrHandler is StringSearchHandler {\n return isFunction(optionsOrHandler);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;;;;;;;;;;;;;;AAcG;AAQG,MAAgB,mBAAuB,SAAQ,iBAA2B,CAAA;AAiB9E,IAAA,IAAW,wBAAwB,GAAA;AACjC,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;KACrF;AAED,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;KAC/B;AAED,IAAA,IAAW,MAAM,GAAA;AACf,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;KAChC;AA6FD,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,IAAI,CAAC,CAAC;AAtHK,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC3C,IAAS,CAAA,SAAA,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAkB,CAAA,kBAAA,GAAG,cAAc,EAAE,CAAC;QAG/C,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAC;QAOtB,IAAO,CAAA,OAAA,GAAG,aAAa,EAAE,CAAC;QAenC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;AAoBzB;;;;;;;;;;;AAWG;AAEI,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAK,CAAC;AAE9C;;;;;;;;;AASG;AAEI,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAQ,CAAC;AAErD;;;;;;;;;;AAUG;AAEI,QAA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,CAAC,WAAW,CAAC,kBAAkB,EAAE,SAAS,IAAK,IAAI,CAAC,SAAmB,EAAE,aAAa,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC;SACnJ;AACD,QAAA,OAAO,KAAK,CAAC;KACd;AAES,IAAA,YAAY,CAAC,KAAa,EAAA;AAClC,QAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;KAC5B;AAGO,IAAA,MAAM,CAAI,KAAiB,EAAE,KAAa,EAAE,SAAyB,EAAE,aAAkC,EAAA;AAC/G,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,IAAI,CAAC;AAExB,QAAA,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,KAAK,KAAK,EAAE;AAAE,YAAA,OAAO,KAAK,CAAC;AAE/B,QAAA,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;KACtE;AAEO,IAAA,qBAAqB,CAAI,gBAAmE,EAAA;AAClG,QAAA,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAC;KACrC;AACF,CAAA;AAbS,UAAA,CAAA;IADP,IAAI;;;;AASJ,CAAA,EAAA,oBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,IAAA,CAAA;;ACpDH;;AAEG;;;;"}
@@ -155,7 +155,7 @@ let ConnectedOverlayComponent = class ConnectedOverlayComponent {
155
155
  ngOnInit() {
156
156
  this.options.hooks?.beforeOpen?.();
157
157
  deferFn(() => {
158
- this.element.nativeElement?.showPopover?.();
158
+ this.element.nativeElement?.isConnected && this.element.nativeElement?.showPopover?.();
159
159
  this.options.hooks?.afterOpen?.();
160
160
  });
161
161
  }
@@ -1 +1 @@
1
- {"version":3,"file":"odx-angular-cdk-connected-overlay.mjs","sources":["../../../../libs/angular/cdk/connected-overlay/src/lib/helpers/compute-overlay-position.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-options.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-ref.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.html","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.service.ts","../../../../libs/angular/cdk/connected-overlay/src/odx-angular-cdk-connected-overlay.ts"],"sourcesContent":["import { ComputePositionReturn, VirtualElement, arrow, computePosition, flip, hide, shift, size, offset as withOffset } from '@floating-ui/dom';\nimport { applyStyles, getOppositeSide, getSide, px } from '@odx/angular/utils';\nimport { ConnectedOverlayOptions } from '../models';\n\n/**\n * Computes the position of an overlay element relative to a reference element.\n *\n * @param referenceElement - The reference element to position the overlay relative to.\n * @param overlayElement - The overlay element to be positioned.\n * @param contentElement - The content element within the overlay.\n * @param arrowElement - The arrow element within the overlay.\n * @param options - The options for positioning the overlay.\n * @returns A promise that resolves to the computed position of the overlay.\n */\nexport async function computeOverlayPosition(\n referenceElement: VirtualElement,\n overlayElement: HTMLElement,\n contentElement: HTMLElement,\n arrowElement: HTMLElement,\n options: ConnectedOverlayOptions,\n): Promise<ComputePositionReturn> {\n const variablePrefix = '--odx-cdk-connected-overlay';\n const { position, offset, outerPadding, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, strategy, minHeight } = options;\n const arrowSize = options.showArrow ? arrowElement.offsetWidth : 0;\n const arrowMiddleware = options.showArrow ? [arrow({ element: arrowElement, padding: 8 })] : [];\n const flipMiddleWare = enableFallback ? [flip({ fallbackAxisSideDirection })] : [];\n return computePosition(referenceElement, overlayElement, {\n strategy,\n placement: position,\n middleware: [\n withOffset(Math.max(offset, arrowSize + offset)),\n shift({ padding: outerPadding }),\n ...flipMiddleWare,\n size({\n padding: outerPadding,\n apply: ({ availableHeight, rects }) => {\n contentElement.style.setProperty?.(`${variablePrefix}-min-height`, minHeight ? px(Math.min(availableHeight, minHeight)) : null);\n contentElement.style.setProperty?.(`${variablePrefix}-min-width`, matchReferenceWidth ? px(rects.reference.width) : null);\n },\n }),\n ...arrowMiddleware,\n hide({ rootBoundary: 'viewport' }),\n ],\n }).then((result) => {\n overlayElement.style.setProperty?.(`${variablePrefix}-position-x`, px(result.x));\n overlayElement.style.setProperty?.(`${variablePrefix}-position-y`, px(result.y));\n if (options.hiddenClass) {\n overlayElement.classList.toggle(options.hiddenClass, !!result.middlewareData.hide?.referenceHidden);\n }\n if (options.showArrow) {\n const overlaySide = getSide(result.placement);\n const arrowSide = getOppositeSide(result.placement);\n applyStyles(arrowElement, {\n display: null,\n top: px(result.middlewareData.arrow?.y),\n left: px(result.middlewareData.arrow?.x),\n [arrowSide]: px(-arrowSize / 2),\n [overlaySide]: null,\n });\n } else {\n applyStyles(arrowElement, { display: 'none' });\n }\n\n return result;\n });\n}\n","import { Strategy } from '@floating-ui/dom';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { Position } from '@odx/angular/utils';\n\nexport interface ConnectedOverlayOptions {\n content?: DynamicContent | null;\n context?: Record<string, unknown>;\n containerClass?: string | null;\n hiddenClass: string | null;\n enableFallback: boolean;\n fallbackAxisSideDirection: 'start' | 'end';\n matchReferenceWidth: boolean;\n minHeight?: number | null;\n offset: number;\n outerPadding: number;\n position: Position;\n strategy: Strategy;\n showArrow?: boolean;\n updateOnAnimationFrame?: boolean;\n nonInteractive?: boolean;\n hooks?: {\n beforeOpen?: () => void;\n afterOpen?: () => void;\n beforeClose?: () => void;\n afterClose?: () => void;\n };\n}\n\nexport const DefaultConnectedOverlayOptions: ConnectedOverlayOptions = {\n hiddenClass: 'is-hidden',\n enableFallback: false,\n fallbackAxisSideDirection: 'start',\n matchReferenceWidth: false,\n offset: 8,\n outerPadding: 12,\n position: Position.BOTTOM,\n strategy: 'fixed',\n};\n","import { DynamicViewRef } from '@odx/angular/cdk/dynamic-view';\nimport { waitForAnimations } from '@odx/angular/utils';\nimport { EMPTY, Observable } from 'rxjs';\nimport { ConnectedOverlayComponent } from '../connected-overlay.component';\nimport { ConnectedOverlayOptions } from './connected-overlay-options';\n\n/**\n * A reference to a connected overlay created by the `ConnectedOverlayService`. This class provides methods to interact\n * with the overlay, such as updating its options or closing it. It encapsulates the `DynamicViewRef` for the overlay's instance,\n * allowing for direct manipulation of the overlay's state and behavior.\n *\n * This example demonstrates how to use a `ConnectedOverlayRef` to update and close a connected overlay in response\n * to user interactions.\n *\n * @example\n * ```ts\n * class MyComponent {\n * private overlayRef?: ConnectedOverlayRef;\n *\n * constructor(private overlayService: ConnectedOverlayService) {}\n *\n * openOverlay() {\n * this.overlayRef = this.overlayService.createOverlay(this.someElementRef.nativeElement, { position: 'bottom' });\n * }\n *\n * updateOverlayPosition() {\n * if (this.overlayRef) {\n * this.overlayRef.update({ position: 'top' });\n * }\n * }\n *\n * closeOverlay() {\n * this.overlayRef?.close();\n * }\n * }\n * ```\n *\n * In this example, `MyComponent` uses the `ConnectedOverlayService` to create an overlay. It stores a reference to\n * the created overlay in `overlayRef`, allowing it to update the overlay's position or close it when necessary.\n */\nexport class ConnectedOverlayRef {\n public readonly element = this.dynamicViewRef.getElement();\n\n /**\n * An Observable that emits when the overlay is closed.\n *\n * @emits {void} - Emits when the overlay is closed.\n *\n */\n public readonly onClose$: Observable<void> = this.dynamicViewRef.getContext().closed ?? EMPTY;\n\n constructor(private readonly dynamicViewRef: DynamicViewRef<typeof ConnectedOverlayComponent>) {}\n\n /**\n * Updates the connected overlay with new options.\n *\n * @param options {Partial<ConnectedOverlayOptions>} - The new options to be applied to the connected overlay.\n */\n public update(options: Partial<ConnectedOverlayOptions>): void {\n this.dynamicViewRef.update({ options: options as ConnectedOverlayOptions });\n }\n\n /**\n * Closes the connected overlay.\n *\n * @returns {void}\n */\n public async close(force = false) {\n const hiddenClass = force ? 'force-hidden' : this.dynamicViewRef.getContext().options?.hiddenClass || 'is-hidden';\n this.element?.classList.add(hiddenClass);\n await waitForAnimations(this.element);\n this.dynamicViewRef.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { VirtualElement, autoUpdate } from '@floating-ui/dom';\nimport { CoreModule } from '@odx/angular';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgChanges, Side, deferFn, getSide, hasChanged, injectElement, isPresent } from '@odx/angular/utils';\nimport { Subject } from 'rxjs';\nimport { computeOverlayPosition } from './helpers';\nimport { ConnectedOverlayOptions, DefaultConnectedOverlayOptions } from './models';\n\n@CSSComponent('cdk-connected-overlay')\n@Component({\n standalone: true,\n selector: 'odx-connected-overlay[popover=\"manual\"]',\n imports: [CoreModule, DynamicViewDirective],\n templateUrl: 'connected-overlay.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConnectedOverlayComponent implements OnInit, OnChanges, OnDestroy {\n private readonly zone = inject(NgZone);\n private positionUpdater: (() => void) | null = null;\n\n protected readonly injector = inject(Injector);\n protected overlaySide?: Side;\n\n @ViewChild('content', { static: true })\n protected contentElement!: ElementRef<HTMLElement>;\n\n @ViewChild('arrow', { static: true })\n protected arrowElement!: ElementRef<HTMLElement>;\n\n public readonly element = injectElement();\n\n @Input()\n public referenceElement!: VirtualElement;\n\n @Input()\n public options: ConnectedOverlayOptions = DefaultConnectedOverlayOptions;\n\n @Output()\n public closed = new Subject<void>();\n\n public ngOnInit(): void {\n this.options.hooks?.beforeOpen?.();\n deferFn(() => {\n this.element.nativeElement?.showPopover?.();\n this.options.hooks?.afterOpen?.();\n });\n }\n\n public ngOnChanges(changes: NgChanges<ConnectedOverlayComponent>): void {\n if (hasChanged(changes, ['options'], false)) {\n this.overlaySide = getSide(this.options.position);\n this.element.nativeElement.classList.toggle('odx-cdk-connected-overlay--non-interactive', this.options.nonInteractive ?? false);\n }\n if (hasChanged(changes, ['referenceElement', 'options'], false)) {\n this.stopPositionUpdater();\n this.startPositionUpdater();\n }\n }\n\n public ngOnDestroy(): void {\n this.options.hooks?.beforeClose?.();\n this.stopPositionUpdater();\n this.element.nativeElement?.hidePopover?.();\n this.closed.next();\n this.options.hooks?.afterClose?.();\n }\n\n private startPositionUpdater(): void {\n this.positionUpdater = this.zone.runOutsideAngular(() =>\n autoUpdate(this.referenceElement, this.element.nativeElement, () => this.updatePosition(), {\n elementResize: isPresent(window.ResizeObserver),\n animationFrame: this.options.updateOnAnimationFrame,\n }),\n );\n }\n\n private stopPositionUpdater(): void {\n this.positionUpdater?.();\n this.positionUpdater = null;\n }\n\n private async updatePosition(): Promise<void> {\n return computeOverlayPosition(\n this.referenceElement,\n this.element.nativeElement,\n this.contentElement.nativeElement,\n this.arrowElement.nativeElement,\n this.options,\n ).then(({ placement }) => {\n this.overlaySide = getSide(placement);\n });\n }\n}\n","<div class=\"odx-cdk-connected-overlay__content {{ options.containerClass }}\" #content>\n <ng-template [odxDynamicView]=\"options.content\" [odxDynamicViewContext]=\"options.context\" [odxDynamicViewInjector]=\"injector\" />\n <div class=\"odx-cdk-connected-overlay-arrow\" #arrow></div>\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { VirtualElement } from '@floating-ui/dom';\nimport { DynamicViewRenderingOptions, DynamicViewService } from '@odx/angular/cdk/dynamic-view';\nimport { deepmerge } from '@odx/angular/internal';\nimport { ConnectedOverlayComponent } from './connected-overlay.component';\nimport { ConnectedOverlayOptions, ConnectedOverlayRef, DefaultConnectedOverlayOptions } from './models';\n\n/**\n * Service for creating and managing connected overlays. These overlays are UI elements such as popovers, tooltips,\n * or dropdown menus that are positioned relative to a reference element in the DOM. This service leverages the `DynamicViewService`\n * for dynamic component rendering and provides a streamlined API for creating overlays with custom positioning and options.\n *\n * Use the `ConnectedOverlayService` to dynamically create an overlay next to a specific element in your Angular application.\n * This example demonstrates creating a connected overlay next to a button element when the button is clicked.\n *\n * @example\n * ```ts\n * import { Component, ElementRef, ViewChild } from '@angular/core';\n * import { ConnectedOverlayService, ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\n *\n * @Component({\n * selector: 'app-example',\n * template: `<button #triggerElement>Click me</button>`,\n * })\n * class AppComponent {\n * @ViewChild('triggerElement') triggerElementRef!: ElementRef;\n *\n * constructor(private connectedOverlayService: ConnectedOverlayService) {}\n *\n * showOverlay(): void {\n * const options: Partial<ConnectedOverlayOptions> = {\n * position: 'bottom-start',\n * showArrow: true,\n * content: 'Hello, world!',\n * };\n *\n * this.connectedOverlayService.createOverlay(this.triggerElementRef.nativeElement, options);\n * }\n * }\n * ```\n *\n * This service simplifies the process of creating dynamic, positionally aware overlays that enhance the interactivity\n * and visual appeal of Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectedOverlayService {\n private readonly dynamicViewService = inject(DynamicViewService);\n\n /**\n * Creates a connected overlay.\n * @param referenceElement - The reference element to which the overlay will be connected.\n * @param options - Optional configuration for the connected overlay.\n * @param renderingOptions - Optional rendering options for the connected overlay.\n * @returns {ConnectedOverlayRef} The created Connected Overlay reference instance.\n */\n public createOverlay(\n referenceElement: VirtualElement,\n options?: Partial<ConnectedOverlayOptions>,\n renderingOptions?: Partial<DynamicViewRenderingOptions>,\n ): ConnectedOverlayRef {\n const dynamicViewRef = this.dynamicViewService.createView(ConnectedOverlayComponent, {\n ...renderingOptions,\n context: { options: deepmerge(DefaultConnectedOverlayOptions, options) as ConnectedOverlayOptions, referenceElement },\n });\n\n return new ConnectedOverlayRef(dynamicViewRef);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","withOffset"],"mappings":";;;;;;;;;;AAIA;;;;;;;;;AASG;AACI,eAAe,sBAAsB,CAC1C,gBAAgC,EAChC,cAA2B,EAC3B,cAA2B,EAC3B,YAAyB,EACzB,OAAgC,EAAA;IAEhC,MA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ArBU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA,EAAA;;4FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;AC5ClC;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-angular-cdk-connected-overlay.mjs","sources":["../../../../libs/angular/cdk/connected-overlay/src/lib/helpers/compute-overlay-position.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-options.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/models/connected-overlay-ref.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.ts","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.component.html","../../../../libs/angular/cdk/connected-overlay/src/lib/connected-overlay.service.ts","../../../../libs/angular/cdk/connected-overlay/src/odx-angular-cdk-connected-overlay.ts"],"sourcesContent":["import { ComputePositionReturn, VirtualElement, arrow, computePosition, flip, hide, shift, size, offset as withOffset } from '@floating-ui/dom';\nimport { applyStyles, getOppositeSide, getSide, px } from '@odx/angular/utils';\nimport { ConnectedOverlayOptions } from '../models';\n\n/**\n * Computes the position of an overlay element relative to a reference element.\n *\n * @param referenceElement - The reference element to position the overlay relative to.\n * @param overlayElement - The overlay element to be positioned.\n * @param contentElement - The content element within the overlay.\n * @param arrowElement - The arrow element within the overlay.\n * @param options - The options for positioning the overlay.\n * @returns A promise that resolves to the computed position of the overlay.\n */\nexport async function computeOverlayPosition(\n referenceElement: VirtualElement,\n overlayElement: HTMLElement,\n contentElement: HTMLElement,\n arrowElement: HTMLElement,\n options: ConnectedOverlayOptions,\n): Promise<ComputePositionReturn> {\n const variablePrefix = '--odx-cdk-connected-overlay';\n const { position, offset, outerPadding, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, strategy, minHeight } = options;\n const arrowSize = options.showArrow ? arrowElement.offsetWidth : 0;\n const arrowMiddleware = options.showArrow ? [arrow({ element: arrowElement, padding: 8 })] : [];\n const flipMiddleWare = enableFallback ? [flip({ fallbackAxisSideDirection })] : [];\n return computePosition(referenceElement, overlayElement, {\n strategy,\n placement: position,\n middleware: [\n withOffset(Math.max(offset, arrowSize + offset)),\n shift({ padding: outerPadding }),\n ...flipMiddleWare,\n size({\n padding: outerPadding,\n apply: ({ availableHeight, rects }) => {\n contentElement.style.setProperty?.(`${variablePrefix}-min-height`, minHeight ? px(Math.min(availableHeight, minHeight)) : null);\n contentElement.style.setProperty?.(`${variablePrefix}-min-width`, matchReferenceWidth ? px(rects.reference.width) : null);\n },\n }),\n ...arrowMiddleware,\n hide({ rootBoundary: 'viewport' }),\n ],\n }).then((result) => {\n overlayElement.style.setProperty?.(`${variablePrefix}-position-x`, px(result.x));\n overlayElement.style.setProperty?.(`${variablePrefix}-position-y`, px(result.y));\n if (options.hiddenClass) {\n overlayElement.classList.toggle(options.hiddenClass, !!result.middlewareData.hide?.referenceHidden);\n }\n if (options.showArrow) {\n const overlaySide = getSide(result.placement);\n const arrowSide = getOppositeSide(result.placement);\n applyStyles(arrowElement, {\n display: null,\n top: px(result.middlewareData.arrow?.y),\n left: px(result.middlewareData.arrow?.x),\n [arrowSide]: px(-arrowSize / 2),\n [overlaySide]: null,\n });\n } else {\n applyStyles(arrowElement, { display: 'none' });\n }\n\n return result;\n });\n}\n","import { Strategy } from '@floating-ui/dom';\nimport { DynamicContent } from '@odx/angular/cdk/dynamic-view';\nimport { Position } from '@odx/angular/utils';\n\nexport interface ConnectedOverlayOptions {\n content?: DynamicContent | null;\n context?: Record<string, unknown>;\n containerClass?: string | null;\n hiddenClass: string | null;\n enableFallback: boolean;\n fallbackAxisSideDirection: 'start' | 'end';\n matchReferenceWidth: boolean;\n minHeight?: number | null;\n offset: number;\n outerPadding: number;\n position: Position;\n strategy: Strategy;\n showArrow?: boolean;\n updateOnAnimationFrame?: boolean;\n nonInteractive?: boolean;\n hooks?: {\n beforeOpen?: () => void;\n afterOpen?: () => void;\n beforeClose?: () => void;\n afterClose?: () => void;\n };\n}\n\nexport const DefaultConnectedOverlayOptions: ConnectedOverlayOptions = {\n hiddenClass: 'is-hidden',\n enableFallback: false,\n fallbackAxisSideDirection: 'start',\n matchReferenceWidth: false,\n offset: 8,\n outerPadding: 12,\n position: Position.BOTTOM,\n strategy: 'fixed',\n};\n","import { DynamicViewRef } from '@odx/angular/cdk/dynamic-view';\nimport { waitForAnimations } from '@odx/angular/utils';\nimport { EMPTY, Observable } from 'rxjs';\nimport { ConnectedOverlayComponent } from '../connected-overlay.component';\nimport { ConnectedOverlayOptions } from './connected-overlay-options';\n\n/**\n * A reference to a connected overlay created by the `ConnectedOverlayService`. This class provides methods to interact\n * with the overlay, such as updating its options or closing it. It encapsulates the `DynamicViewRef` for the overlay's instance,\n * allowing for direct manipulation of the overlay's state and behavior.\n *\n * This example demonstrates how to use a `ConnectedOverlayRef` to update and close a connected overlay in response\n * to user interactions.\n *\n * @example\n * ```ts\n * class MyComponent {\n * private overlayRef?: ConnectedOverlayRef;\n *\n * constructor(private overlayService: ConnectedOverlayService) {}\n *\n * openOverlay() {\n * this.overlayRef = this.overlayService.createOverlay(this.someElementRef.nativeElement, { position: 'bottom' });\n * }\n *\n * updateOverlayPosition() {\n * if (this.overlayRef) {\n * this.overlayRef.update({ position: 'top' });\n * }\n * }\n *\n * closeOverlay() {\n * this.overlayRef?.close();\n * }\n * }\n * ```\n *\n * In this example, `MyComponent` uses the `ConnectedOverlayService` to create an overlay. It stores a reference to\n * the created overlay in `overlayRef`, allowing it to update the overlay's position or close it when necessary.\n */\nexport class ConnectedOverlayRef {\n public readonly element = this.dynamicViewRef.getElement();\n\n /**\n * An Observable that emits when the overlay is closed.\n *\n * @emits {void} - Emits when the overlay is closed.\n *\n */\n public readonly onClose$: Observable<void> = this.dynamicViewRef.getContext().closed ?? EMPTY;\n\n constructor(private readonly dynamicViewRef: DynamicViewRef<typeof ConnectedOverlayComponent>) {}\n\n /**\n * Updates the connected overlay with new options.\n *\n * @param options {Partial<ConnectedOverlayOptions>} - The new options to be applied to the connected overlay.\n */\n public update(options: Partial<ConnectedOverlayOptions>): void {\n this.dynamicViewRef.update({ options: options as ConnectedOverlayOptions });\n }\n\n /**\n * Closes the connected overlay.\n *\n * @returns {void}\n */\n public async close(force = false) {\n const hiddenClass = force ? 'force-hidden' : this.dynamicViewRef.getContext().options?.hiddenClass || 'is-hidden';\n this.element?.classList.add(hiddenClass);\n await waitForAnimations(this.element);\n this.dynamicViewRef.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { VirtualElement, autoUpdate } from '@floating-ui/dom';\nimport { CoreModule } from '@odx/angular';\nimport { DynamicViewDirective } from '@odx/angular/cdk/dynamic-view';\nimport { CSSComponent } from '@odx/angular/internal';\nimport { NgChanges, Side, deferFn, getSide, hasChanged, injectElement, isPresent } from '@odx/angular/utils';\nimport { Subject } from 'rxjs';\nimport { computeOverlayPosition } from './helpers';\nimport { ConnectedOverlayOptions, DefaultConnectedOverlayOptions } from './models';\n\n@CSSComponent('cdk-connected-overlay')\n@Component({\n standalone: true,\n selector: 'odx-connected-overlay[popover=\"manual\"]',\n imports: [CoreModule, DynamicViewDirective],\n templateUrl: 'connected-overlay.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ConnectedOverlayComponent implements OnInit, OnChanges, OnDestroy {\n private readonly zone = inject(NgZone);\n private positionUpdater: (() => void) | null = null;\n\n protected readonly injector = inject(Injector);\n protected overlaySide?: Side;\n\n @ViewChild('content', { static: true })\n protected contentElement!: ElementRef<HTMLElement>;\n\n @ViewChild('arrow', { static: true })\n protected arrowElement!: ElementRef<HTMLElement>;\n\n public readonly element = injectElement();\n\n @Input()\n public referenceElement!: VirtualElement;\n\n @Input()\n public options: ConnectedOverlayOptions = DefaultConnectedOverlayOptions;\n\n @Output()\n public closed = new Subject<void>();\n\n public ngOnInit(): void {\n this.options.hooks?.beforeOpen?.();\n deferFn(() => {\n this.element.nativeElement?.isConnected && this.element.nativeElement?.showPopover?.();\n this.options.hooks?.afterOpen?.();\n });\n }\n\n public ngOnChanges(changes: NgChanges<ConnectedOverlayComponent>): void {\n if (hasChanged(changes, ['options'], false)) {\n this.overlaySide = getSide(this.options.position);\n this.element.nativeElement.classList.toggle('odx-cdk-connected-overlay--non-interactive', this.options.nonInteractive ?? false);\n }\n if (hasChanged(changes, ['referenceElement', 'options'], false)) {\n this.stopPositionUpdater();\n this.startPositionUpdater();\n }\n }\n\n public ngOnDestroy(): void {\n this.options.hooks?.beforeClose?.();\n this.stopPositionUpdater();\n this.element.nativeElement?.hidePopover?.();\n this.closed.next();\n this.options.hooks?.afterClose?.();\n }\n\n private startPositionUpdater(): void {\n this.positionUpdater = this.zone.runOutsideAngular(() =>\n autoUpdate(this.referenceElement, this.element.nativeElement, () => this.updatePosition(), {\n elementResize: isPresent(window.ResizeObserver),\n animationFrame: this.options.updateOnAnimationFrame,\n }),\n );\n }\n\n private stopPositionUpdater(): void {\n this.positionUpdater?.();\n this.positionUpdater = null;\n }\n\n private async updatePosition(): Promise<void> {\n return computeOverlayPosition(\n this.referenceElement,\n this.element.nativeElement,\n this.contentElement.nativeElement,\n this.arrowElement.nativeElement,\n this.options,\n ).then(({ placement }) => {\n this.overlaySide = getSide(placement);\n });\n }\n}\n","<div class=\"odx-cdk-connected-overlay__content {{ options.containerClass }}\" #content>\n <ng-template [odxDynamicView]=\"options.content\" [odxDynamicViewContext]=\"options.context\" [odxDynamicViewInjector]=\"injector\" />\n <div class=\"odx-cdk-connected-overlay-arrow\" #arrow></div>\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { VirtualElement } from '@floating-ui/dom';\nimport { DynamicViewRenderingOptions, DynamicViewService } from '@odx/angular/cdk/dynamic-view';\nimport { deepmerge } from '@odx/angular/internal';\nimport { ConnectedOverlayComponent } from './connected-overlay.component';\nimport { ConnectedOverlayOptions, ConnectedOverlayRef, DefaultConnectedOverlayOptions } from './models';\n\n/**\n * Service for creating and managing connected overlays. These overlays are UI elements such as popovers, tooltips,\n * or dropdown menus that are positioned relative to a reference element in the DOM. This service leverages the `DynamicViewService`\n * for dynamic component rendering and provides a streamlined API for creating overlays with custom positioning and options.\n *\n * Use the `ConnectedOverlayService` to dynamically create an overlay next to a specific element in your Angular application.\n * This example demonstrates creating a connected overlay next to a button element when the button is clicked.\n *\n * @example\n * ```ts\n * import { Component, ElementRef, ViewChild } from '@angular/core';\n * import { ConnectedOverlayService, ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay';\n *\n * @Component({\n * selector: 'app-example',\n * template: `<button #triggerElement>Click me</button>`,\n * })\n * class AppComponent {\n * @ViewChild('triggerElement') triggerElementRef!: ElementRef;\n *\n * constructor(private connectedOverlayService: ConnectedOverlayService) {}\n *\n * showOverlay(): void {\n * const options: Partial<ConnectedOverlayOptions> = {\n * position: 'bottom-start',\n * showArrow: true,\n * content: 'Hello, world!',\n * };\n *\n * this.connectedOverlayService.createOverlay(this.triggerElementRef.nativeElement, options);\n * }\n * }\n * ```\n *\n * This service simplifies the process of creating dynamic, positionally aware overlays that enhance the interactivity\n * and visual appeal of Angular applications.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectedOverlayService {\n private readonly dynamicViewService = inject(DynamicViewService);\n\n /**\n * Creates a connected overlay.\n * @param referenceElement - The reference element to which the overlay will be connected.\n * @param options - Optional configuration for the connected overlay.\n * @param renderingOptions - Optional rendering options for the connected overlay.\n * @returns {ConnectedOverlayRef} The created Connected Overlay reference instance.\n */\n public createOverlay(\n referenceElement: VirtualElement,\n options?: Partial<ConnectedOverlayOptions>,\n renderingOptions?: Partial<DynamicViewRenderingOptions>,\n ): ConnectedOverlayRef {\n const dynamicViewRef = this.dynamicViewService.createView(ConnectedOverlayComponent, {\n ...renderingOptions,\n context: { options: deepmerge(DefaultConnectedOverlayOptions, options) as ConnectedOverlayOptions, referenceElement },\n });\n\n return new ConnectedOverlayRef(dynamicViewRef);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["offset","withOffset"],"mappings":";;;;;;;;;;AAIA;;;;;;;;;AASG;AACI,eAAe,sBAAsB,CAC1C,gBAAgC,EAChC,cAA2B,EAC3B,cAA2B,EAC3B,YAAyB,EACzB,OAAgC,EAAA;IAEhC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AACrD,IAAA,MAAM,EAAE,QAAQ,UAAEA,QAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;AACxI,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,WAAW,GAAG,CAAC,CAAC;IACnE,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AAChG,IAAA,MAAM,cAAc,GAAG,cAAc,GAAG,CAAC,IAAI,CAAC,EAAE,yBAAyB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AACnF,IAAA,OAAO,eAAe,CAAC,gBAAgB,EAAE,cAAc,EAAE;QACvD,QAAQ;AACR,QAAA,SAAS,EAAE,QAAQ;AACnB,QAAA,UAAU,EAAE;YACVC,MAAU,CAAC,IAAI,CAAC,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MAAM,EAAA,CAAA;sBADZ,MAAM;;;AE/CT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;MAEU,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAqBlE,KAAA;AAnBC;;;;;;AAMG;AACI,IAAA,aAAa,CAClB,gBAAgC,EAChC,OAA0C,EAC1C,gBAAuD,EAAA;QAEvD,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,yBAAyB,EAAE;AACnF,YAAA,GAAG,gBAAgB;AACnB,YAAA,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,8BAA8B,EAAE,OAAO,CAA4B,EAAE,gBAAgB,EAAE;AACtH,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,mBAAmB,CAAC,cAAc,CAAC,CAAC;KAChD;+GArBU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA,EAAA;;4FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;AC5ClC;;AAEG;;;;"}
@@ -0,0 +1,176 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, TemplateRef, Directive, contentChild, input, contentChildren, computed, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
4
+ import { CoreModule } from '@odx/angular';
5
+
6
+ class CellDef {
7
+ constructor() {
8
+ this.template = inject(TemplateRef);
9
+ }
10
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
11
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: CellDef, isStandalone: true, selector: "[odxCellDef]", ngImport: i0 }); }
12
+ }
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CellDef, decorators: [{
14
+ type: Directive,
15
+ args: [{
16
+ selector: '[odxCellDef]',
17
+ standalone: true,
18
+ }]
19
+ }] });
20
+
21
+ class CellDirective {
22
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
23
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: CellDirective, isStandalone: true, selector: "td[odxCell]", host: { attributes: { "role": "cell" }, classAttribute: "odx-table__cell" }, ngImport: i0 }); }
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CellDirective, decorators: [{
26
+ type: Directive,
27
+ args: [{
28
+ selector: 'td[odxCell]',
29
+ standalone: true,
30
+ host: {
31
+ role: 'cell',
32
+ class: 'odx-table__cell',
33
+ },
34
+ }]
35
+ }] });
36
+
37
+ class HeaderCellDef {
38
+ constructor() {
39
+ this.template = inject(TemplateRef);
40
+ }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: HeaderCellDef, isStandalone: true, selector: "[odxHeaderCellDef]", ngImport: i0 }); }
43
+ }
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderCellDef, decorators: [{
45
+ type: Directive,
46
+ args: [{
47
+ selector: '[odxHeaderCellDef]',
48
+ standalone: true,
49
+ }]
50
+ }] });
51
+
52
+ class ColumnDef {
53
+ constructor() {
54
+ this.headerCellDef = contentChild.required(HeaderCellDef);
55
+ this.cellDef = contentChild.required(CellDef);
56
+ this.name = input.required({ alias: 'odxColumnDef' });
57
+ }
58
+ getHeaderTemplate() {
59
+ return this.headerCellDef().template ?? null;
60
+ }
61
+ getCellTemplate() {
62
+ return this.cellDef().template ?? null;
63
+ }
64
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
65
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.13", type: ColumnDef, isStandalone: true, selector: "[odxColumnDef]", inputs: { name: { classPropertyName: "name", publicName: "odxColumnDef", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "headerCellDef", first: true, predicate: HeaderCellDef, descendants: true, isSignal: true }, { propertyName: "cellDef", first: true, predicate: CellDef, descendants: true, isSignal: true }], ngImport: i0 }); }
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ColumnDef, decorators: [{
68
+ type: Directive,
69
+ args: [{
70
+ selector: '[odxColumnDef]',
71
+ standalone: true,
72
+ }]
73
+ }] });
74
+
75
+ class HeaderCellDirective {
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
77
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: HeaderCellDirective, isStandalone: true, selector: "th[odxHeaderCell]", host: { attributes: { "role": "columnheader" }, classAttribute: "odx-table__header-cell odx-data-table__header-cell" }, ngImport: i0 }); }
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderCellDirective, decorators: [{
80
+ type: Directive,
81
+ args: [{
82
+ selector: 'th[odxHeaderCell]',
83
+ standalone: true,
84
+ host: {
85
+ role: 'columnheader',
86
+ class: 'odx-table__header-cell odx-data-table__header-cell',
87
+ },
88
+ }]
89
+ }] });
90
+
91
+ class TableEmptyDirective {
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableEmptyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
93
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TableEmptyDirective, isStandalone: true, selector: "odx-table-empty", ngImport: i0 }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TableEmptyDirective, decorators: [{
96
+ type: Directive,
97
+ args: [{ selector: 'odx-table-empty', standalone: true }]
98
+ }] });
99
+
100
+ const SortDirection = {
101
+ UNSORTED: 'unsorted',
102
+ ASC: 'asc',
103
+ DESC: 'desc',
104
+ };
105
+
106
+ const TableVariant = {
107
+ DEFAULT: 'default',
108
+ STRIPED: 'striped',
109
+ };
110
+
111
+ /**
112
+ * DataTableComponent is a dynamic table structure built for displaying content.
113
+ */
114
+ class DataTableComponent {
115
+ constructor() {
116
+ this.columnDefs = contentChildren(ColumnDef, { descendants: true });
117
+ this.orderedColumns = computed(() => {
118
+ const cols = this.columnDefs() ?? [];
119
+ const displayedCols = this.displayedColumns() ?? [];
120
+ return displayedCols.length > 0
121
+ ? displayedCols.map((colName) => cols.find((colDef) => colDef.name() === colName)).filter((colDef) => !!colDef)
122
+ : cols;
123
+ });
124
+ /**
125
+ * The data to be displayed in the table.
126
+ * @required
127
+ * @type {T[]}
128
+ */
129
+ this.dataSource = input.required();
130
+ /**
131
+ * The columns to be displayed in the table.
132
+ * @required
133
+ * @type {string[]}
134
+ */
135
+ this.displayedColumns = input.required();
136
+ /**
137
+ * The variant of the table.
138
+ * @default TableVariant.DEFAULT
139
+ * @type {TableVariant}
140
+ */
141
+ this.variant = input(TableVariant.DEFAULT);
142
+ }
143
+ get classList() {
144
+ return computed(() => `odx-table odx-data-table odx-table--${this.variant()}`);
145
+ }
146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
147
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DataTableComponent, isStandalone: true, selector: "table[odxDataTable]", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "table" }, properties: { "class": "classList()" } }, queries: [{ propertyName: "columnDefs", predicate: ColumnDef, descendants: true, isSignal: true }], ngImport: i0, template: "<thead role=\"rowgroup\" class=\"odx-table__head\">\n <tr role=\"row\" class=\"odx-table__header-row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getHeaderTemplate()\" />\n }\n </tr>\n</thead>\n<tbody role=\"rowgroup\" class=\"odx-table__body\">\n @for (item of dataSource(); track item) {\n <tr class=\"odx-table__row\" role=\"row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getCellTemplate(); context: { $implicit: item }\" />\n }\n </tr>\n } @empty {\n <tr class=\"odx-table__row\" role=\"row\">\n <td class=\"odx-table__cell\" role=\"cell\" [attr.colspan]=\"orderedColumns().length\">\n <ng-content select=\"odx-table-empty\" />\n </td>\n </tr>\n }\n</tbody>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableComponent, decorators: [{
150
+ type: Component,
151
+ args: [{ selector: 'table[odxDataTable]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
152
+ role: 'table',
153
+ '[class]': 'classList()',
154
+ }, imports: [NgTemplateOutlet], template: "<thead role=\"rowgroup\" class=\"odx-table__head\">\n <tr role=\"row\" class=\"odx-table__header-row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getHeaderTemplate()\" />\n }\n </tr>\n</thead>\n<tbody role=\"rowgroup\" class=\"odx-table__body\">\n @for (item of dataSource(); track item) {\n <tr class=\"odx-table__row\" role=\"row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getCellTemplate(); context: { $implicit: item }\" />\n }\n </tr>\n } @empty {\n <tr class=\"odx-table__row\" role=\"row\">\n <td class=\"odx-table__cell\" role=\"cell\" [attr.colspan]=\"orderedColumns().length\">\n <ng-content select=\"odx-table-empty\" />\n </td>\n </tr>\n }\n</tbody>\n" }]
155
+ }] });
156
+
157
+ const modules = [DataTableComponent, CellDef, ColumnDef, HeaderCellDef, TableEmptyDirective, CellDirective, HeaderCellDirective];
158
+ class DataTableModule {
159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
160
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: DataTableModule, imports: [DataTableComponent, CellDef, ColumnDef, HeaderCellDef, TableEmptyDirective, CellDirective, HeaderCellDirective], exports: [CoreModule, DataTableComponent, CellDef, ColumnDef, HeaderCellDef, TableEmptyDirective, CellDirective, HeaderCellDirective] }); }
161
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableModule, imports: [CoreModule] }); }
162
+ }
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableModule, decorators: [{
164
+ type: NgModule,
165
+ args: [{
166
+ imports: modules,
167
+ exports: [CoreModule, ...modules],
168
+ }]
169
+ }] });
170
+
171
+ /**
172
+ * Generated bundle index. Do not edit.
173
+ */
174
+
175
+ export { CellDef, CellDirective, ColumnDef, DataTableComponent, DataTableModule, HeaderCellDef, HeaderCellDirective, SortDirection, TableEmptyDirective, TableVariant };
176
+ //# sourceMappingURL=odx-angular-components-data-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odx-angular-components-data-table.mjs","sources":["../../../../libs/angular/components/data-table/src/lib/directives/cell-def.directive.ts","../../../../libs/angular/components/data-table/src/lib/directives/cell.directive.ts","../../../../libs/angular/components/data-table/src/lib/directives/header-cell-def.directive.ts","../../../../libs/angular/components/data-table/src/lib/directives/column-def.directive.ts","../../../../libs/angular/components/data-table/src/lib/directives/header-cell.directive.ts","../../../../libs/angular/components/data-table/src/lib/directives/table-empty.directive.ts","../../../../libs/angular/components/data-table/src/lib/models/sort-direction.ts","../../../../libs/angular/components/data-table/src/lib/models/table-variant.ts","../../../../libs/angular/components/data-table/src/lib/data-table.component.ts","../../../../libs/angular/components/data-table/src/lib/data-table.component.html","../../../../libs/angular/components/data-table/src/lib/data-table.module.ts","../../../../libs/angular/components/data-table/src/odx-angular-components-data-table.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[odxCellDef]',\n standalone: true,\n})\nexport class CellDef {\n public template = inject(TemplateRef);\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'td[odxCell]',\n standalone: true,\n host: {\n role: 'cell',\n class: 'odx-table__cell',\n },\n})\nexport class CellDirective {}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n@Directive({\n selector: '[odxHeaderCellDef]',\n standalone: true,\n})\nexport class HeaderCellDef {\n public template = inject(TemplateRef);\n}\n","import { contentChild, Directive, input, TemplateRef } from '@angular/core';\nimport { CellDef } from './cell-def.directive';\nimport { HeaderCellDef } from './header-cell-def.directive';\n\n@Directive({\n selector: '[odxColumnDef]',\n standalone: true,\n})\nexport class ColumnDef {\n private readonly headerCellDef = contentChild.required(HeaderCellDef);\n private readonly cellDef = contentChild.required(CellDef);\n\n public name = input.required<string>({ alias: 'odxColumnDef' });\n\n public getHeaderTemplate(): TemplateRef<unknown> | null {\n return this.headerCellDef().template ?? null;\n }\n\n public getCellTemplate(): TemplateRef<unknown> | null {\n return this.cellDef().template ?? null;\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'th[odxHeaderCell]',\n standalone: true,\n host: {\n role: 'columnheader',\n class: 'odx-table__header-cell odx-data-table__header-cell',\n },\n})\nexport class HeaderCellDirective {}\n","import { Directive } from '@angular/core';\n\n@Directive({ selector: 'odx-table-empty', standalone: true })\nexport class TableEmptyDirective {}\n","export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];\n\nexport const SortDirection = {\n UNSORTED: 'unsorted',\n ASC: 'asc',\n DESC: 'desc',\n} as const;\n","export type TableVariant = typeof TableVariant[keyof typeof TableVariant];\n\nexport const TableVariant = {\n DEFAULT: 'default',\n STRIPED: 'striped',\n} as const;\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, contentChildren, input, Signal, ViewEncapsulation } from '@angular/core';\nimport { ColumnDef } from './directives';\nimport { TableVariant } from './models';\n\n/**\n * DataTableComponent is a dynamic table structure built for displaying content.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'table[odxDataTable]',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'table',\n '[class]': 'classList()',\n },\n templateUrl: './data-table.component.html',\n imports: [NgTemplateOutlet],\n})\nexport class DataTableComponent<T = unknown> {\n protected columnDefs = contentChildren(ColumnDef, { descendants: true });\n\n protected orderedColumns = computed(() => {\n const cols = this.columnDefs() ?? [];\n const displayedCols = this.displayedColumns() ?? [];\n\n return displayedCols.length > 0\n ? displayedCols.map((colName) => cols.find((colDef) => colDef.name() === colName)).filter((colDef): colDef is ColumnDef => !!colDef)\n : cols;\n });\n\n /**\n * The data to be displayed in the table.\n * @required\n * @type {T[]}\n */\n public dataSource = input.required<T[]>();\n\n /**\n * The columns to be displayed in the table.\n * @required\n * @type {string[]}\n */\n public displayedColumns = input.required<string[]>();\n\n /**\n * The variant of the table.\n * @default TableVariant.DEFAULT\n * @type {TableVariant}\n */\n public variant = input<TableVariant>(TableVariant.DEFAULT);\n\n protected get classList(): Signal<string> {\n return computed(() => `odx-table odx-data-table odx-table--${this.variant()}`);\n }\n}\n","<thead role=\"rowgroup\" class=\"odx-table__head\">\n <tr role=\"row\" class=\"odx-table__header-row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getHeaderTemplate()\" />\n }\n </tr>\n</thead>\n<tbody role=\"rowgroup\" class=\"odx-table__body\">\n @for (item of dataSource(); track item) {\n <tr class=\"odx-table__row\" role=\"row\">\n @for (col of orderedColumns(); track col.name) {\n <ng-container *ngTemplateOutlet=\"col.getCellTemplate(); context: { $implicit: item }\" />\n }\n </tr>\n } @empty {\n <tr class=\"odx-table__row\" role=\"row\">\n <td class=\"odx-table__cell\" role=\"cell\" [attr.colspan]=\"orderedColumns().length\">\n <ng-content select=\"odx-table-empty\" />\n </td>\n </tr>\n }\n</tbody>\n","import { NgModule } from '@angular/core';\nimport { CoreModule } from '@odx/angular';\nimport { DataTableComponent } from './data-table.component';\nimport { CellDef, CellDirective, ColumnDef, HeaderCellDef, HeaderCellDirective, TableEmptyDirective } from './directives';\n\nconst modules = [DataTableComponent, CellDef, ColumnDef, HeaderCellDef, TableEmptyDirective, CellDirective, HeaderCellDirective];\n\n@NgModule({\n imports: modules,\n exports: [CoreModule, ...modules],\n})\nexport class DataTableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,OAAO,CAAA;AAJpB,IAAA,WAAA,GAAA;AAKS,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,KAAA;+GAFY,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,cAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBAJnB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;;;MCKY,aAAa,CAAA;+GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,EAAA,QAAA,EAAA,EA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,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC;MAMpH,eAAe,CAAA;+GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EANX,OAAA,EAAA,CAAA,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,mBAAmB,CAInH,EAAA,OAAA,EAAA,CAAA,UAAU,EAJL,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;AAMlH,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAFhB,UAAU,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAET,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,OAAO;AAChB,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;AAClC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
@@ -235,14 +235,10 @@ let MainMenuComponent = class MainMenuComponent {
235
235
  this.mainMenuService.close();
236
236
  }
237
237
  slideMenuInner(isOpen = false) {
238
- const { nativeElement } = this.menuInner || {};
239
- if (!(nativeElement && this.isPopoverElement(nativeElement)))
238
+ const nativeElement = this.menuInner?.nativeElement;
239
+ if (!nativeElement?.isConnected)
240
240
  return;
241
- const method = isOpen ? 'showPopover' : 'hidePopover';
242
- nativeElement[method]();
243
- }
244
- isPopoverElement(element) {
245
- return element.hasAttribute('popover') && 'showPopover' in element && 'hidePopover' in element;
241
+ (isOpen ? nativeElement.showPopover : nativeElement.hidePopover)?.();
246
242
  }
247
243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MainMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
248
244
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MainMenuComponent, isStandalone: true, selector: "odx-main-menu", inputs: { title: "title", subtitle: "subtitle", copyright: "copyright", isOpen: ["isOpen", "isOpen", booleanAttribute] }, outputs: { menuOpen: "menuOpen" }, host: { listeners: { "window:keyup.esc": "close()" }, properties: { "class.is-open": "isOpen" } }, providers: [provideTranslations(mainMenuTranslations)], viewQueries: [{ propertyName: "menuInner", first: true, predicate: ["menuInner"], descendants: true }], ngImport: i0, template: "<aside class=\"odx-main-menu__inner\" [ngClass]=\"(isOpen$ | async) ? 'opened' : 'closed'\" #menuInner popover=\"auto\" cdkTrapFocus cdkTrapFocusAutoCapture>\n <div class=\"odx-main-menu__actions\">\n <button class=\"odx-main-menu__close\" odxButton disabled=\"false\" (click)=\"close()\"><odx-icon name=\"close\" iconSet=\"core\" /></button>\n </div>\n <odx-area-header class=\"odx-main-menu__header\" size=\"large\">\n <ng-template [odxDynamicView]=\"title\" />\n @if (subtitle) {\n <odx-area-header-subtitle>\n <ng-template [odxDynamicView]=\"subtitle\" />\n </odx-area-header-subtitle>\n }\n </odx-area-header>\n <nav class=\"odx-main-menu__content\">\n <ng-content />\n </nav>\n <div class=\"odx-main-menu__info\">\n <ng-content select=\"[odxLink]\" />\n @for (link of mainMenuLinks$ | async; track $index) {\n <a odxLink [href]=\"link.url\" target=\"_blank\">\n {{ link.name | odxTranslate | async }}\n </a>\n }\n </div>\n <div class=\"odx-main-menu__footer\">\n <odx-logo variant=\"inverse\" />\n @if (copyright) {\n <p class=\"odx-text odx-text--small\">\n <ng-template [odxDynamicView]=\"copyright\" />\n </p>\n }\n </div>\n</aside>\n", dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i1$1.DisabledController, selector: "[disabled]", inputs: ["disabled"] }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: CoreModule }, { kind: "ngmodule", type: AreaHeaderModule }, { kind: "component", type: i4.AreaHeaderComponent, selector: "odx-area-header", inputs: ["size"] }, { kind: "directive", type: i4.AreaHeaderSubtitleDirective, selector: "odx-area-header-subtitle" }, { kind: "component", type: i5.ButtonComponent, selector: "button[odxButton], a[odxButton]", inputs: ["variant", "size"] }, { kind: "component", type: i6.IconComponent, selector: "odx-icon", inputs: ["inline", "size", "name", "iconSet", "identifier"] }, { kind: "directive", type: LogoDirective, selector: "odx-logo", inputs: ["size", "variant"] }, { kind: "pipe", type: TranslatePipe, name: "odxTranslate" }, { kind: "directive", type: LinkDirective, selector: "a[odxLink]" }, { kind: "directive", type: DynamicViewDirective, selector: "ng-template[odxDynamicView]", inputs: ["odxDynamicView", "odxDynamicViewInjector", "odxDynamicViewContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }