@siemens/element-ng 49.0.0 → 49.2.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 (47) hide show
  1. package/fesm2022/siemens-element-ng-accordion.mjs +2 -2
  2. package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -1
  3. package/fesm2022/siemens-element-ng-application-header.mjs +12 -4
  4. package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
  5. package/fesm2022/siemens-element-ng-chat-messages.mjs +5 -5
  6. package/fesm2022/siemens-element-ng-chat-messages.mjs.map +1 -1
  7. package/fesm2022/siemens-element-ng-common.mjs +2 -2
  8. package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
  9. package/fesm2022/siemens-element-ng-dashboard.mjs +16 -20
  10. package/fesm2022/siemens-element-ng-dashboard.mjs.map +1 -1
  11. package/fesm2022/siemens-element-ng-datatable.mjs +2 -1
  12. package/fesm2022/siemens-element-ng-datatable.mjs.map +1 -1
  13. package/fesm2022/siemens-element-ng-datepicker.mjs +1 -1
  14. package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -1
  15. package/fesm2022/siemens-element-ng-file-uploader.mjs +0 -1
  16. package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -1
  17. package/fesm2022/siemens-element-ng-filtered-search.mjs +94 -103
  18. package/fesm2022/siemens-element-ng-filtered-search.mjs.map +1 -1
  19. package/fesm2022/siemens-element-ng-formly.mjs +2 -2
  20. package/fesm2022/siemens-element-ng-formly.mjs.map +1 -1
  21. package/fesm2022/siemens-element-ng-landing-page.mjs +19 -5
  22. package/fesm2022/siemens-element-ng-landing-page.mjs.map +1 -1
  23. package/fesm2022/siemens-element-ng-navbar-vertical.mjs +2 -2
  24. package/fesm2022/siemens-element-ng-navbar-vertical.mjs.map +1 -1
  25. package/fesm2022/siemens-element-ng-select.mjs +2 -2
  26. package/fesm2022/siemens-element-ng-select.mjs.map +1 -1
  27. package/fesm2022/siemens-element-ng-side-panel.mjs +2 -2
  28. package/fesm2022/siemens-element-ng-side-panel.mjs.map +1 -1
  29. package/fesm2022/siemens-element-ng-tabs.mjs +67 -5
  30. package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -1
  31. package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
  32. package/fesm2022/siemens-element-ng-typeahead.mjs +83 -23
  33. package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -1
  34. package/package.json +4 -4
  35. package/schematics/utils/ts-compiler-host.js +3 -0
  36. package/template-i18n.json +2 -0
  37. package/types/siemens-element-ng-application-header.d.ts +1 -0
  38. package/types/siemens-element-ng-common.d.ts +1 -1
  39. package/types/siemens-element-ng-dashboard.d.ts +13 -14
  40. package/types/siemens-element-ng-datatable.d.ts +1 -0
  41. package/types/siemens-element-ng-file-uploader.d.ts +2 -2
  42. package/types/siemens-element-ng-filtered-search.d.ts +3 -9
  43. package/types/siemens-element-ng-form.d.ts +1 -1
  44. package/types/siemens-element-ng-landing-page.d.ts +6 -0
  45. package/types/siemens-element-ng-tabs.d.ts +51 -2
  46. package/types/siemens-element-ng-translate.d.ts +2 -0
  47. package/types/siemens-element-ng-typeahead.d.ts +36 -4
@@ -1,15 +1,16 @@
1
1
  import { Overlay } from '@angular/cdk/overlay';
2
2
  import { ComponentPortal } from '@angular/cdk/portal';
3
3
  import * as i0 from '@angular/core';
4
- import { Directive, inject, computed, viewChild, ElementRef, HostListener, ChangeDetectionStrategy, Component, input, booleanAttribute, numberAttribute, output, signal, Injector, effect, NgModule } from '@angular/core';
5
- import { toSignal } from '@angular/core/rxjs-interop';
4
+ import { Directive, inject, computed, viewChild, ElementRef, HostListener, ChangeDetectionStrategy, Component, untracked, input, booleanAttribute, numberAttribute, output, signal, Injector, effect, NgModule } from '@angular/core';
5
+ import { toSignal, toObservable } from '@angular/core/rxjs-interop';
6
6
  import * as i1 from '@siemens/element-ng/autocomplete';
7
7
  import { SiAutocompleteDirective, SiAutocompleteListboxDirective, SiAutocompleteOptionDirective } from '@siemens/element-ng/autocomplete';
8
8
  import { SiTranslatePipe, t } from '@siemens/element-translate-ng/translate';
9
- import { ReplaySubject, isObservable } from 'rxjs';
10
- import { map } from 'rxjs/operators';
9
+ import { ReplaySubject, isObservable, Subscription, catchError, timer } from 'rxjs';
10
+ import { map, switchMap, share, takeUntil } from 'rxjs/operators';
11
11
  import { NgTemplateOutlet } from '@angular/common';
12
12
  import { SiIconComponent } from '@siemens/element-ng/icon';
13
+ import { SiLoadingSpinnerDirective } from '@siemens/element-ng/loading-spinner';
13
14
 
14
15
  /**
15
16
  * Copyright (c) Siemens 2016 - 2026
@@ -80,7 +81,7 @@ class SiTypeaheadComponent {
80
81
  }
81
82
  }
82
83
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTypeaheadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiTypeaheadComponent, isStandalone: true, selector: "si-typeahead", host: { listeners: { "mousedown": "onMouseDown($event)" }, classAttribute: "w-100" }, viewQueries: [{ propertyName: "typeaheadElement", first: true, predicate: ["typeahead"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n", styles: [".dropdown-menu{display:block;position:relative;inset-block-start:0;inset-inline-start:0;margin-block-start:1px;overflow-y:auto;overflow-x:hidden;max-block-size:100%}.typeahead-match-segment-matching{font-weight:600}.dropdown-item *{flex-shrink:0}.dropdown-item span{white-space:pre-wrap}\n"], dependencies: [{ kind: "directive", type: SiAutocompleteListboxDirective, selector: "[siAutocompleteListboxFor]", inputs: ["id", "siAutocompleteListboxFor", "siAutocompleteDefaultIndex"], outputs: ["siAutocompleteOptionSubmitted"], exportAs: ["siAutocompleteListbox"] }, { kind: "directive", type: SiAutocompleteOptionDirective, selector: "[siAutocompleteOption]", inputs: ["id", "disabled", "siAutocompleteOption"], exportAs: ["siAutocompleteOption"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SiTypeaheadItemTemplateDirective, selector: "[siTypeaheadItemTemplate]" }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiTypeaheadComponent, isStandalone: true, selector: "si-typeahead", host: { listeners: { "mousedown": "onMouseDown($event)" }, classAttribute: "w-100" }, viewQueries: [{ propertyName: "typeaheadElement", first: true, predicate: ["typeahead"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [class.empty-loading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [siLoading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [initialDelay]=\"false\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n @if (parent.typeaheadLoading() && matches().length) {\n <li class=\"dropdown-item\" [siLoading]=\"true\" [initialDelay]=\"false\"></li>\n }\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n", styles: [":host{--loading-spinner-size: 24px}.dropdown-menu{display:block;position:relative;inset-block-start:0;inset-inline-start:0;margin-block-start:1px;overflow-y:auto;overflow-x:hidden;max-block-size:100%}.dropdown-menu.empty-loading{min-block-size:176px}.typeahead-match-segment-matching{font-weight:600}.dropdown-item *{flex-shrink:0}.dropdown-item span{white-space:pre-wrap}\n"], dependencies: [{ kind: "directive", type: SiAutocompleteListboxDirective, selector: "[siAutocompleteListboxFor]", inputs: ["id", "siAutocompleteListboxFor", "siAutocompleteDefaultIndex"], outputs: ["siAutocompleteOptionSubmitted"], exportAs: ["siAutocompleteListbox"] }, { kind: "directive", type: SiAutocompleteOptionDirective, selector: "[siAutocompleteOption]", inputs: ["id", "disabled", "siAutocompleteOption"], exportAs: ["siAutocompleteOption"] }, { kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SiTypeaheadItemTemplateDirective, selector: "[siTypeaheadItemTemplate]" }, { kind: "directive", type: SiLoadingSpinnerDirective, selector: "[siLoading]", inputs: ["siLoading", "blocking", "initialDelay"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
85
  }
85
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTypeaheadComponent, decorators: [{
86
87
  type: Component,
@@ -90,8 +91,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
90
91
  SiIconComponent,
91
92
  NgTemplateOutlet,
92
93
  SiTranslatePipe,
93
- SiTypeaheadItemTemplateDirective
94
- ], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'w-100' }, template: "<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n", styles: [".dropdown-menu{display:block;position:relative;inset-block-start:0;inset-inline-start:0;margin-block-start:1px;overflow-y:auto;overflow-x:hidden;max-block-size:100%}.typeahead-match-segment-matching{font-weight:600}.dropdown-item *{flex-shrink:0}.dropdown-item span{white-space:pre-wrap}\n"] }]
94
+ SiTypeaheadItemTemplateDirective,
95
+ SiLoadingSpinnerDirective
96
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'w-100' }, template: "<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [class.empty-loading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [siLoading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [initialDelay]=\"false\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n @if (parent.typeaheadLoading() && matches().length) {\n <li class=\"dropdown-item\" [siLoading]=\"true\" [initialDelay]=\"false\"></li>\n }\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n", styles: [":host{--loading-spinner-size: 24px}.dropdown-menu{display:block;position:relative;inset-block-start:0;inset-inline-start:0;margin-block-start:1px;overflow-y:auto;overflow-x:hidden;max-block-size:100%}.dropdown-menu.empty-loading{min-block-size:176px}.typeahead-match-segment-matching{font-weight:600}.dropdown-item *{flex-shrink:0}.dropdown-item span{white-space:pre-wrap}\n"] }]
95
97
  }], propDecorators: { typeaheadElement: [{ type: i0.ViewChild, args: ['typeahead', { ...{
96
98
  read: ElementRef
97
99
  }, isSignal: true }] }], onMouseDown: [{
@@ -126,12 +128,20 @@ class TypeaheadSearch {
126
128
  datasource;
127
129
  query;
128
130
  options;
129
- matches = computed(() => this.search(this.datasource(), this.query()), ...(ngDevMode ? [{ debugName: "matches" }] : []));
131
+ matches = computed(() => this.search(this.datasource(), this.readQuery()), ...(ngDevMode ? [{ debugName: "matches" }] : []));
130
132
  constructor(datasource, query, options) {
131
133
  this.datasource = datasource;
132
134
  this.query = query;
133
135
  this.options = options;
134
136
  }
137
+ readQuery() {
138
+ if (this.options.lazy) {
139
+ return untracked(() => this.query());
140
+ }
141
+ else {
142
+ return this.query();
143
+ }
144
+ }
135
145
  escapeRegex(query) {
136
146
  return query.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
137
147
  }
@@ -485,6 +495,11 @@ class SiTypeaheadDirective {
485
495
  * @defaultValue false
486
496
  */
487
497
  typeaheadFullWidth = input(false, { ...(ngDevMode ? { debugName: "typeaheadFullWidth" } : {}), transform: booleanAttribute });
498
+ /**
499
+ * Optional CDK scroll strategy used for the typeahead overlay.
500
+ * If not provided, no strategy is set explicitly and CDK will apply its default behavior.
501
+ */
502
+ typeaheadScrollStrategy = input(...(ngDevMode ? [undefined, { debugName: "typeaheadScrollStrategy" }] : []));
488
503
  /**
489
504
  * This option will be shown at the end of the typeahead.
490
505
  * Use it to allow users to create new options on the fly.
@@ -537,6 +552,16 @@ class SiTypeaheadDirective {
537
552
  sourceSubscription;
538
553
  matchSorter = new SiTypeaheadSorting();
539
554
  overlayRef;
555
+ loadingSubscription;
556
+ /**
557
+ * Indicates whether the typeahead is currently loading.
558
+ * When using {@link TypeaheadOptionSource}, this is controlled by the `isLoading()` method
559
+ * or automatically set to `true` while fetching options.
560
+ *
561
+ * @internal
562
+ * @defaultValue false
563
+ */
564
+ typeaheadLoading = signal(false, ...(ngDevMode ? [{ debugName: "typeaheadLoading" }] : []));
540
565
  /**
541
566
  * Indicates that the typeahead can be potentially open.
542
567
  * This signal is typically `true` when the input is focussed.
@@ -552,7 +577,8 @@ class SiTypeaheadDirective {
552
577
  typeaheadSearch = typeaheadSearch(this.typeaheadOptions, this.query, computed(() => ({
553
578
  matchAllTokens: this.typeaheadMatchAllTokens(),
554
579
  disableTokenizing: !this.typeaheadTokenize(),
555
- skipProcessing: !this.typeaheadProcess()
580
+ skipProcessing: !this.typeaheadProcess(),
581
+ lazy: !(Array.isArray(this.siTypeahead()) || isObservable(this.siTypeahead()))
556
582
  })));
557
583
  processedSearch = computed(() => {
558
584
  this.selectionCounter(); // This is a workaround for the multi-select which needs to trigger a change detection in the typeahead component.
@@ -602,19 +628,17 @@ class SiTypeaheadDirective {
602
628
  const matches = this.foundMatches();
603
629
  if (this.canBeOpen() &&
604
630
  this.query().length >= this.typeaheadMinLength() &&
605
- (matches.length || (this.typeaheadCreateOption() && this.query().length))) {
631
+ // Ensure that we have content to show: matches, create option or loading indicator
632
+ (matches.length ||
633
+ (this.typeaheadCreateOption() && this.query().length) ||
634
+ this.typeaheadLoading())) {
606
635
  const escapedQuery = this.escapeRegex(this.query());
607
636
  const equalsExp = new RegExp(`^${escapedQuery}$`, 'i');
608
637
  const fullMatches = matches.filter(match => match.result.length === 1 && equalsExp.test(match.text));
609
638
  if (fullMatches.length > 0) {
610
639
  this.typeaheadOnFullMatch.emit(fullMatches[0]);
611
640
  }
612
- if (matches.length || this.typeaheadCreateOption()) {
613
- this.loadComponent();
614
- }
615
- else {
616
- this.removeComponent();
617
- }
641
+ this.loadComponent();
618
642
  }
619
643
  else {
620
644
  this.removeComponent();
@@ -625,12 +649,21 @@ class SiTypeaheadDirective {
625
649
  ngOnChanges(changes) {
626
650
  if (changes.siTypeahead) {
627
651
  this.sourceSubscription?.unsubscribe();
652
+ this.loadingSubscription?.unsubscribe();
628
653
  const typeahead = this.siTypeahead();
629
- if (isObservable(typeahead)) {
654
+ if (Array.isArray(typeahead)) {
655
+ // Handle TypeaheadArray
656
+ this.$typeahead.next(typeahead);
657
+ this.typeaheadLoading.set(false);
658
+ }
659
+ else if (isObservable(typeahead)) {
660
+ // Handle TypeaheadObservable
630
661
  this.sourceSubscription = typeahead.subscribe(this.$typeahead);
662
+ this.typeaheadLoading.set(false);
631
663
  }
632
- else {
633
- this.$typeahead.next(typeahead);
664
+ else if (typeof typeahead === 'function') {
665
+ // Handle TypeaheadOptionSource
666
+ this.handleTypeaheadOptionSource(typeahead);
634
667
  }
635
668
  }
636
669
  }
@@ -664,13 +697,35 @@ class SiTypeaheadDirective {
664
697
  ngOnDestroy() {
665
698
  this.clearTimer();
666
699
  this.sourceSubscription?.unsubscribe();
700
+ this.loadingSubscription?.unsubscribe();
667
701
  this.overlayRef?.dispose();
668
702
  }
703
+ /**
704
+ * Handles TypeaheadOptionSource by subscribing to query changes and fetching options.
705
+ * Manages loading state automatically or uses custom isLoading() observable if provided.
706
+ */
707
+ handleTypeaheadOptionSource(source) {
708
+ this.sourceSubscription = new Subscription();
709
+ const queryObservable = toObservable(this.query, { injector: this.injector });
710
+ const resultObservable = queryObservable.pipe(switchMap(query => source(query)),
711
+ // Catch errors by the source observable to prevent endless spinner. Showing the error is not our responsibility.
712
+ catchError(e => {
713
+ console.error(e);
714
+ return [];
715
+ }), share());
716
+ this.sourceSubscription.add(queryObservable
717
+ .pipe(switchMap(() => timer(500).pipe(takeUntil(resultObservable))))
718
+ .subscribe(() => this.typeaheadLoading.set(true)));
719
+ this.sourceSubscription.add(resultObservable.subscribe(result => {
720
+ this.$typeahead.next(result);
721
+ this.typeaheadLoading.set(false);
722
+ }));
723
+ }
669
724
  // Dynamically create the typeahead component and then set the matches and the query.
670
725
  loadComponent() {
671
726
  if (!this.overlayRef?.hasAttached()) {
672
727
  this.overlayRef?.dispose();
673
- this.overlayRef = this.overlay.create({
728
+ const overlayConfig = {
674
729
  positionStrategy: this.overlay
675
730
  .position()
676
731
  .flexibleConnectedTo(this.elementRef.nativeElement)
@@ -678,7 +733,12 @@ class SiTypeaheadDirective {
678
733
  minWidth: this.typeaheadFullWidth()
679
734
  ? this.elementRef.nativeElement.getBoundingClientRect().width + 2 // 2px border
680
735
  : 0
681
- });
736
+ };
737
+ const scrollStrategy = this.typeaheadScrollStrategy();
738
+ if (scrollStrategy) {
739
+ overlayConfig.scrollStrategy = scrollStrategy;
740
+ }
741
+ this.overlayRef = this.overlay.create(overlayConfig);
682
742
  }
683
743
  if (this.overlayRef.hasAttached()) {
684
744
  return;
@@ -762,7 +822,7 @@ class SiTypeaheadDirective {
762
822
  return query.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
763
823
  }
764
824
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTypeaheadDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
765
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: SiTypeaheadDirective, isStandalone: true, selector: "[siTypeahead]", inputs: { siTypeahead: { classPropertyName: "siTypeahead", publicName: "siTypeahead", isSignal: true, isRequired: true, transformFunction: null }, typeaheadProcess: { classPropertyName: "typeaheadProcess", publicName: "typeaheadProcess", isSignal: true, isRequired: false, transformFunction: null }, typeaheadScrollable: { classPropertyName: "typeaheadScrollable", publicName: "typeaheadScrollable", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsInScrollableView: { classPropertyName: "typeaheadOptionsInScrollableView", publicName: "typeaheadOptionsInScrollableView", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsLimit: { classPropertyName: "typeaheadOptionsLimit", publicName: "typeaheadOptionsLimit", isSignal: true, isRequired: false, transformFunction: null }, typeaheadScrollableAdditionalHeight: { classPropertyName: "typeaheadScrollableAdditionalHeight", publicName: "typeaheadScrollableAdditionalHeight", isSignal: true, isRequired: false, transformFunction: null }, typeaheadAutoSelectIndex: { classPropertyName: "typeaheadAutoSelectIndex", publicName: "typeaheadAutoSelectIndex", isSignal: true, isRequired: false, transformFunction: null }, typeaheadCloseOnEsc: { classPropertyName: "typeaheadCloseOnEsc", publicName: "typeaheadCloseOnEsc", isSignal: true, isRequired: false, transformFunction: null }, typeaheadClearValueOnSelect: { classPropertyName: "typeaheadClearValueOnSelect", publicName: "typeaheadClearValueOnSelect", isSignal: true, isRequired: false, transformFunction: null }, typeaheadWaitMs: { classPropertyName: "typeaheadWaitMs", publicName: "typeaheadWaitMs", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMinLength: { classPropertyName: "typeaheadMinLength", publicName: "typeaheadMinLength", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionField: { classPropertyName: "typeaheadOptionField", publicName: "typeaheadOptionField", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMultiSelect: { classPropertyName: "typeaheadMultiSelect", publicName: "typeaheadMultiSelect", isSignal: true, isRequired: false, transformFunction: null }, typeaheadTokenize: { classPropertyName: "typeaheadTokenize", publicName: "typeaheadTokenize", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMatchAllTokens: { classPropertyName: "typeaheadMatchAllTokens", publicName: "typeaheadMatchAllTokens", isSignal: true, isRequired: false, transformFunction: null }, typeaheadItemTemplate: { classPropertyName: "typeaheadItemTemplate", publicName: "typeaheadItemTemplate", isSignal: true, isRequired: false, transformFunction: null }, typeaheadSkipSortingMatches: { classPropertyName: "typeaheadSkipSortingMatches", publicName: "typeaheadSkipSortingMatches", isSignal: true, isRequired: false, transformFunction: null }, typeaheadAutocompleteListLabel: { classPropertyName: "typeaheadAutocompleteListLabel", publicName: "typeaheadAutocompleteListLabel", isSignal: true, isRequired: false, transformFunction: null }, typeaheadFullWidth: { classPropertyName: "typeaheadFullWidth", publicName: "typeaheadFullWidth", isSignal: true, isRequired: false, transformFunction: null }, typeaheadCreateOption: { classPropertyName: "typeaheadCreateOption", publicName: "typeaheadCreateOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { typeaheadOnInput: "typeaheadOnInput", typeaheadOnSelect: "typeaheadOnSelect", typeaheadOnFullMatch: "typeaheadOnFullMatch", typeaheadOpenChange: "typeaheadOpenChange", typeaheadOnCreateOption: "typeaheadOnCreateOption" }, host: { listeners: { "focusout": "onBlur()", "focusin": "onInput($event)", "input": "onInput($event)", "keydown.escape": "onKeydownEscape()" }, classAttribute: "si-typeahead" }, exportAs: ["si-typeahead"], usesOnChanges: true, hostDirectives: [{ directive: i1.SiAutocompleteDirective }], ngImport: i0 });
825
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: SiTypeaheadDirective, isStandalone: true, selector: "[siTypeahead]", inputs: { siTypeahead: { classPropertyName: "siTypeahead", publicName: "siTypeahead", isSignal: true, isRequired: true, transformFunction: null }, typeaheadProcess: { classPropertyName: "typeaheadProcess", publicName: "typeaheadProcess", isSignal: true, isRequired: false, transformFunction: null }, typeaheadScrollable: { classPropertyName: "typeaheadScrollable", publicName: "typeaheadScrollable", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsInScrollableView: { classPropertyName: "typeaheadOptionsInScrollableView", publicName: "typeaheadOptionsInScrollableView", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionsLimit: { classPropertyName: "typeaheadOptionsLimit", publicName: "typeaheadOptionsLimit", isSignal: true, isRequired: false, transformFunction: null }, typeaheadScrollableAdditionalHeight: { classPropertyName: "typeaheadScrollableAdditionalHeight", publicName: "typeaheadScrollableAdditionalHeight", isSignal: true, isRequired: false, transformFunction: null }, typeaheadAutoSelectIndex: { classPropertyName: "typeaheadAutoSelectIndex", publicName: "typeaheadAutoSelectIndex", isSignal: true, isRequired: false, transformFunction: null }, typeaheadCloseOnEsc: { classPropertyName: "typeaheadCloseOnEsc", publicName: "typeaheadCloseOnEsc", isSignal: true, isRequired: false, transformFunction: null }, typeaheadClearValueOnSelect: { classPropertyName: "typeaheadClearValueOnSelect", publicName: "typeaheadClearValueOnSelect", isSignal: true, isRequired: false, transformFunction: null }, typeaheadWaitMs: { classPropertyName: "typeaheadWaitMs", publicName: "typeaheadWaitMs", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMinLength: { classPropertyName: "typeaheadMinLength", publicName: "typeaheadMinLength", isSignal: true, isRequired: false, transformFunction: null }, typeaheadOptionField: { classPropertyName: "typeaheadOptionField", publicName: "typeaheadOptionField", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMultiSelect: { classPropertyName: "typeaheadMultiSelect", publicName: "typeaheadMultiSelect", isSignal: true, isRequired: false, transformFunction: null }, typeaheadTokenize: { classPropertyName: "typeaheadTokenize", publicName: "typeaheadTokenize", isSignal: true, isRequired: false, transformFunction: null }, typeaheadMatchAllTokens: { classPropertyName: "typeaheadMatchAllTokens", publicName: "typeaheadMatchAllTokens", isSignal: true, isRequired: false, transformFunction: null }, typeaheadItemTemplate: { classPropertyName: "typeaheadItemTemplate", publicName: "typeaheadItemTemplate", isSignal: true, isRequired: false, transformFunction: null }, typeaheadSkipSortingMatches: { classPropertyName: "typeaheadSkipSortingMatches", publicName: "typeaheadSkipSortingMatches", isSignal: true, isRequired: false, transformFunction: null }, typeaheadAutocompleteListLabel: { classPropertyName: "typeaheadAutocompleteListLabel", publicName: "typeaheadAutocompleteListLabel", isSignal: true, isRequired: false, transformFunction: null }, typeaheadFullWidth: { classPropertyName: "typeaheadFullWidth", publicName: "typeaheadFullWidth", isSignal: true, isRequired: false, transformFunction: null }, typeaheadScrollStrategy: { classPropertyName: "typeaheadScrollStrategy", publicName: "typeaheadScrollStrategy", isSignal: true, isRequired: false, transformFunction: null }, typeaheadCreateOption: { classPropertyName: "typeaheadCreateOption", publicName: "typeaheadCreateOption", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { typeaheadOnInput: "typeaheadOnInput", typeaheadOnSelect: "typeaheadOnSelect", typeaheadOnFullMatch: "typeaheadOnFullMatch", typeaheadOpenChange: "typeaheadOpenChange", typeaheadOnCreateOption: "typeaheadOnCreateOption" }, host: { listeners: { "focusout": "onBlur()", "focusin": "onInput($event)", "input": "onInput($event)", "keydown.escape": "onKeydownEscape()" }, classAttribute: "si-typeahead" }, exportAs: ["si-typeahead"], usesOnChanges: true, hostDirectives: [{ directive: i1.SiAutocompleteDirective }], ngImport: i0 });
766
826
  }
767
827
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiTypeaheadDirective, decorators: [{
768
828
  type: Directive,
@@ -774,7 +834,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
774
834
  hostDirectives: [SiAutocompleteDirective],
775
835
  exportAs: 'si-typeahead'
776
836
  }]
777
- }], ctorParameters: () => [], propDecorators: { siTypeahead: [{ type: i0.Input, args: [{ isSignal: true, alias: "siTypeahead", required: true }] }], typeaheadProcess: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadProcess", required: false }] }], typeaheadScrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadScrollable", required: false }] }], typeaheadOptionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsInScrollableView", required: false }] }], typeaheadOptionsLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsLimit", required: false }] }], typeaheadScrollableAdditionalHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadScrollableAdditionalHeight", required: false }] }], typeaheadAutoSelectIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadAutoSelectIndex", required: false }] }], typeaheadCloseOnEsc: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadCloseOnEsc", required: false }] }], typeaheadClearValueOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadClearValueOnSelect", required: false }] }], typeaheadWaitMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadWaitMs", required: false }] }], typeaheadMinLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMinLength", required: false }] }], typeaheadOptionField: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionField", required: false }] }], typeaheadMultiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMultiSelect", required: false }] }], typeaheadTokenize: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadTokenize", required: false }] }], typeaheadMatchAllTokens: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMatchAllTokens", required: false }] }], typeaheadItemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadItemTemplate", required: false }] }], typeaheadSkipSortingMatches: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadSkipSortingMatches", required: false }] }], typeaheadAutocompleteListLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadAutocompleteListLabel", required: false }] }], typeaheadFullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadFullWidth", required: false }] }], typeaheadCreateOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadCreateOption", required: false }] }], typeaheadOnInput: [{ type: i0.Output, args: ["typeaheadOnInput"] }], typeaheadOnSelect: [{ type: i0.Output, args: ["typeaheadOnSelect"] }], typeaheadOnFullMatch: [{ type: i0.Output, args: ["typeaheadOnFullMatch"] }], typeaheadOpenChange: [{ type: i0.Output, args: ["typeaheadOpenChange"] }], typeaheadOnCreateOption: [{ type: i0.Output, args: ["typeaheadOnCreateOption"] }], onBlur: [{
837
+ }], ctorParameters: () => [], propDecorators: { siTypeahead: [{ type: i0.Input, args: [{ isSignal: true, alias: "siTypeahead", required: true }] }], typeaheadProcess: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadProcess", required: false }] }], typeaheadScrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadScrollable", required: false }] }], typeaheadOptionsInScrollableView: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsInScrollableView", required: false }] }], typeaheadOptionsLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionsLimit", required: false }] }], typeaheadScrollableAdditionalHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadScrollableAdditionalHeight", required: false }] }], typeaheadAutoSelectIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadAutoSelectIndex", required: false }] }], typeaheadCloseOnEsc: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadCloseOnEsc", required: false }] }], typeaheadClearValueOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadClearValueOnSelect", required: false }] }], typeaheadWaitMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadWaitMs", required: false }] }], typeaheadMinLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMinLength", required: false }] }], typeaheadOptionField: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadOptionField", required: false }] }], typeaheadMultiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMultiSelect", required: false }] }], typeaheadTokenize: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadTokenize", required: false }] }], typeaheadMatchAllTokens: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadMatchAllTokens", required: false }] }], typeaheadItemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadItemTemplate", required: false }] }], typeaheadSkipSortingMatches: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadSkipSortingMatches", required: false }] }], typeaheadAutocompleteListLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadAutocompleteListLabel", required: false }] }], typeaheadFullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadFullWidth", required: false }] }], typeaheadScrollStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadScrollStrategy", required: false }] }], typeaheadCreateOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeaheadCreateOption", required: false }] }], typeaheadOnInput: [{ type: i0.Output, args: ["typeaheadOnInput"] }], typeaheadOnSelect: [{ type: i0.Output, args: ["typeaheadOnSelect"] }], typeaheadOnFullMatch: [{ type: i0.Output, args: ["typeaheadOnFullMatch"] }], typeaheadOpenChange: [{ type: i0.Output, args: ["typeaheadOpenChange"] }], typeaheadOnCreateOption: [{ type: i0.Output, args: ["typeaheadOnCreateOption"] }], onBlur: [{
778
838
  type: HostListener,
779
839
  args: ['focusout']
780
840
  }], onInput: [{
@@ -1 +1 @@
1
- {"version":3,"file":"siemens-element-ng-typeahead.mjs","sources":["../../../../projects/element-ng/typeahead/si-typeahead-item-template.directive.ts","../../../../projects/element-ng/typeahead/si-typeahead.component.ts","../../../../projects/element-ng/typeahead/si-typeahead.component.html","../../../../projects/element-ng/typeahead/si-typeahead.search.ts","../../../../projects/element-ng/typeahead/si-typeahead.sorting.ts","../../../../projects/element-ng/typeahead/si-typeahead.directive.ts","../../../../projects/element-ng/typeahead/si-typeahead.module.ts","../../../../projects/element-ng/typeahead/index.ts","../../../../projects/element-ng/typeahead/siemens-element-ng-typeahead.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { TypeaheadOptionItemContext } from './si-typeahead.model';\n\n@Directive({\n selector: '[siTypeaheadItemTemplate]'\n})\nexport class SiTypeaheadItemTemplateDirective {\n static ngTemplateContextGuard(\n dir: SiTypeaheadItemTemplateDirective,\n ctx: any\n ): ctx is TypeaheadOptionItemContext {\n return true;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n HostListener,\n inject,\n viewChild\n} from '@angular/core';\nimport {\n SiAutocompleteDirective,\n SiAutocompleteListboxDirective,\n SiAutocompleteOptionDirective\n} from '@siemens/element-ng/autocomplete';\nimport { SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiTypeaheadItemTemplateDirective } from './si-typeahead-item-template.directive';\nimport { SiTypeaheadDirective } from './si-typeahead.directive';\nimport { TypeaheadMatch } from './si-typeahead.model';\n\n@Component({\n selector: 'si-typeahead',\n imports: [\n SiAutocompleteListboxDirective,\n SiAutocompleteOptionDirective,\n SiIconComponent,\n NgTemplateOutlet,\n SiTranslatePipe,\n SiTypeaheadItemTemplateDirective\n ],\n templateUrl: './si-typeahead.component.html',\n styleUrl: './si-typeahead.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'w-100' }\n})\nexport class SiTypeaheadComponent implements AfterViewInit {\n protected parent = inject(SiTypeaheadDirective);\n protected readonly matches = computed(() =>\n this.parent.typeaheadOptionsLimit()\n ? this.parent.foundMatches().slice(0, this.parent.typeaheadOptionsLimit())\n : this.parent.foundMatches()\n );\n\n protected readonly multiselect = computed(() => this.parent.typeaheadMultiSelect());\n\n private readonly typeaheadElement = viewChild.required('typeahead', {\n read: ElementRef\n });\n\n protected autocompleteDirective = inject(SiAutocompleteDirective);\n\n ngAfterViewInit(): void {\n this.setHeight(this.typeaheadElement());\n }\n\n @HostListener('mousedown', ['$event'])\n protected onMouseDown(event: Event): void {\n event.preventDefault();\n }\n\n /*\n * Set the height of the element passed to it (typeahead) if there are items displayed,\n * the number of displayed items changed and it is scrollable.\n */\n private setHeight(element: ElementRef): void {\n if (this.matches().length) {\n if (\n this.parent.typeaheadScrollable() &&\n this.parent.typeaheadOptionsInScrollableView() < this.matches().length\n ) {\n const computedStyle = getComputedStyle(element.nativeElement);\n const matchComputedStyle = getComputedStyle(element.nativeElement.firstElementChild);\n const matchHeight = parseFloat(matchComputedStyle.height || '0');\n const paddingTop = parseFloat(computedStyle.paddingTop || '0');\n const paddingBottom = parseFloat(computedStyle.paddingBottom || '');\n const height = this.parent.typeaheadOptionsInScrollableView() * matchHeight;\n element.nativeElement.style.maxBlockSize = `${\n height + paddingTop + paddingBottom + this.parent.typeaheadScrollableAdditionalHeight()\n }px`;\n } else {\n element.nativeElement.style.maxBlockSize = 'auto';\n }\n }\n }\n\n // Gets called when a match is selected by clicking on it.\n protected selectMatch(match: TypeaheadMatch | undefined): void {\n if (match) {\n this.parent.selectMatch(match);\n } else {\n this.parent.createOption();\n }\n }\n}\n","<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { computed, Signal } from '@angular/core';\n\nexport interface SearchOptions<T> {\n /** The text that will be used for searching. */\n text: string;\n /** The raw option that will be also included in the Match results */\n option: T;\n}\n\nexport interface MatchSegment {\n text: string;\n isMatching: boolean;\n matches: number;\n uniqueMatches: number;\n}\n\nexport interface Match<T> {\n option: T;\n text: string;\n result: MatchSegment[];\n stringMatch: boolean;\n atBeginning: boolean;\n matches: number;\n uniqueMatches: number;\n uniqueSeparateMatches: number;\n matchesEntireQuery: boolean;\n matchesAllParts: boolean;\n matchesAllPartsSeparately: boolean;\n}\n\nexport interface SearchConfig {\n /** Defines whether to tokenize the search or match the whole search. */\n disableTokenizing?: boolean;\n /**\n * Defines whether and how to require to match with all the tokens if {@link typeaheadTokenize} is enabled.\n * - `no` does not require all of the tokens to match.\n * - `once` requires all of the parts to be found in the search.\n * - `separately` requires all of the parts to be found in the search where there is not an overlapping different result.\n * - `independently` requires all of the parts to be found in the search where there is not an overlapping or adjacent different result.\n * ('independently' also slightly changes sorting behavior in the same way.)\n */\n matchAllTokens: 'no' | 'once' | 'separately' | 'independently';\n}\n\n/**\n * Constructs a typeahead search and provides the matches as a signal.\n *\n * @param options - Factory function that should return the array of options to search in.\n * Is run in a reactive context.\n * @param query - Factory function that should return the current search query. Is run in a reactive context.\n * @param config - Configuration for the search. Is run in a reactive context.\n *\n * @example\n * In a real world, myOptions and mayQuery would be signals.\n * ```ts\n * const search = typeaheadSearch(\n * () => myOptions().map(...),\n * () => myQuery().toLowerCase(),\n * () => ({ matchAllTokens: 'separately' })\n * )\n * ```\n */\nexport const typeaheadSearch = <T>(\n options: () => SearchOptions<T>[],\n query: () => string,\n config: () => SearchConfig\n): Signal<Match<T>[]> => computed(() => new TypeaheadSearch<T>(options, query, config()).matches());\n\nclass TypeaheadSearch<T> {\n readonly matches = computed<Match<T>[]>(() => this.search(this.datasource(), this.query()));\n\n constructor(\n private readonly datasource: () => SearchOptions<T>[],\n private readonly query: () => string,\n private readonly options: SearchConfig\n ) {}\n\n private escapeRegex(query: string): string {\n return query.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n }\n\n private search(options: SearchOptions<T>[], query: string): Match<T>[] {\n try {\n const entireQueryRegex = new RegExp(this.escapeRegex(query), 'gi');\n\n const queryParts = !this.options.disableTokenizing\n ? query.split(/\\s+/g).filter(queryPart => queryPart)\n : query\n ? [query]\n : [];\n\n const queryRegexes = queryParts.map(\n queryPart => new RegExp(this.escapeRegex(queryPart), 'gi')\n );\n // Process the options.\n const matches: Match<T>[] = [];\n options.forEach(option => {\n const optionValue = option.text;\n const stringMatch =\n optionValue.toLocaleLowerCase().trim() === query.toLocaleLowerCase().trim();\n const candidate: Match<T> = {\n option: option.option,\n text: optionValue,\n result: [],\n stringMatch,\n atBeginning: false,\n matches: 0,\n uniqueMatches: 0,\n uniqueSeparateMatches: 0,\n matchesEntireQuery: false,\n matchesAllParts: false,\n matchesAllPartsSeparately: false\n };\n\n // Only search the options if a part of the query is at least one character long to prevent an endless loop.\n if (queryParts.length === 0) {\n if (optionValue) {\n candidate.result.push({\n text: optionValue,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n matches.push(candidate);\n } else {\n const allResults: { index: number; start: number; end: number; result: string }[] = [];\n const allIndexes: number[] = [];\n\n candidate.matchesEntireQuery = !!optionValue.match(entireQueryRegex);\n\n // Loop through the option value to find multiple matches, then store every segment (matching or non-matching) in the results.\n queryRegexes.forEach((queryRegex, index) => {\n let regexMatch = queryRegex.exec(optionValue);\n\n while (regexMatch) {\n allResults.push({\n index,\n start: regexMatch.index,\n end: regexMatch.index + regexMatch[0].length,\n result: regexMatch[0]\n });\n if (!regexMatch.index) {\n candidate.atBeginning = true;\n }\n if (!allIndexes.includes(index)) {\n allIndexes.push(index);\n }\n regexMatch = queryRegex.exec(optionValue);\n }\n });\n\n candidate.matchesAllParts = allIndexes.length === queryParts.length;\n\n // Check if all parts of the query match at least once (if required).\n if (this.options.matchAllTokens === 'no' || candidate.matchesAllParts) {\n const combinedResults: {\n indexes: number[];\n uniqueIndexes: number[];\n start: number;\n end: number;\n result: string;\n }[] = [];\n\n // First combine intersecting (or if set to independently adjacent) results to combined results.\n // We achieve this by first sorting them by the starting index, then by the ending index and then looking for overlaps.\n allResults\n .sort((a, b) => a.start - b.start || a.end - b.end)\n .forEach(result => {\n if (combinedResults.length) {\n const foundPreviousResult = combinedResults.find(previousResult =>\n this.options.matchAllTokens === 'independently'\n ? result.start <= previousResult.end\n : result.start < previousResult.end\n );\n if (foundPreviousResult) {\n foundPreviousResult.result += result.result.slice(\n foundPreviousResult.end - result.start,\n result.result.length\n );\n if (result.end > foundPreviousResult.end) {\n foundPreviousResult.end = result.end;\n }\n foundPreviousResult.indexes.push(result.index);\n if (!foundPreviousResult.uniqueIndexes.includes(result.index)) {\n foundPreviousResult.uniqueIndexes.push(result.index);\n }\n return;\n }\n }\n combinedResults.push({\n ...result,\n indexes: [result.index],\n uniqueIndexes: [result.index]\n });\n });\n\n // Recursively go through all unique combinations of the unique indexes to get the option which has the most indexes.\n const countUniqueSubindexes = (\n indexIndex = 0,\n previousIndexes: number[] = []\n ): number =>\n indexIndex === combinedResults.length\n ? previousIndexes.length\n : Math.max(\n previousIndexes.length,\n ...combinedResults[indexIndex].uniqueIndexes\n .filter(index => !previousIndexes.includes(index))\n .map(index =>\n countUniqueSubindexes(indexIndex + 1, [index, ...previousIndexes])\n )\n );\n\n candidate.uniqueSeparateMatches = countUniqueSubindexes();\n candidate.matchesAllPartsSeparately =\n candidate.uniqueSeparateMatches === queryParts.length;\n\n let currentPreviousEnd = 0;\n\n // Add the combined results to the candidate including the non-matching parts in between.\n combinedResults.forEach(result => {\n const textBefore = optionValue.slice(currentPreviousEnd, result.start);\n if (textBefore) {\n candidate.result.push({\n text: textBefore,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n candidate.result.push({\n text: result.result,\n isMatching: true,\n matches: result.indexes.length,\n uniqueMatches: result.uniqueIndexes.length\n });\n currentPreviousEnd = result.end;\n candidate.matches += result.indexes.length;\n candidate.uniqueMatches += result.uniqueIndexes.length;\n });\n\n // Check if there are result segments and all parts are matched independently (if required).\n if (\n candidate.result.length !== 0 &&\n ((this.options.matchAllTokens !== 'separately' &&\n this.options.matchAllTokens !== 'independently') ||\n candidate.matchesAllPartsSeparately)\n ) {\n const textAtEnd = optionValue.slice(currentPreviousEnd);\n if (textAtEnd) {\n candidate.result.push({\n text: textAtEnd,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n matches.push(candidate);\n }\n }\n }\n });\n\n return matches;\n } catch {\n // Could not create regex (only in extremely rare cases, maybe even impossible), so return an empty array.\n return [];\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { TypeaheadMatch } from './si-typeahead.model';\n\nexport class SiTypeaheadSorting {\n sortMatches(matches: TypeaheadMatch[]): TypeaheadMatch[] {\n // Sort the matches,\n // first is the option and query an exact match.\n // then according to whether it is matching in the beginning,\n // then whether it matches the entire untokenized query.\n // then according to how many unique separate matches it contains.\n // then according to how many unique matches it contains.\n // then according to how many matches it contains.\n return matches.sort((matchA, matchB) => {\n if (matchA.stringMatch || matchB.stringMatch) {\n return matchA.stringMatch ? -1 : 1;\n }\n if (matchA.atBeginning) {\n return !matchB.atBeginning ? -1 : this.compareMatches(matchA, matchB);\n } else {\n return matchB.atBeginning ? 1 : this.compareMatches(matchA, matchB);\n }\n });\n }\n\n private compareMatchesNumbers(matchA: TypeaheadMatch, matchB: TypeaheadMatch): number {\n return (\n matchB.uniqueSeparateMatches - matchA.uniqueSeparateMatches ||\n matchB.uniqueMatches - matchA.uniqueMatches ||\n matchB.matches - matchA.matches\n );\n }\n\n private compareMatches(matchA: TypeaheadMatch, matchB: TypeaheadMatch): number {\n if (matchA.matchesEntireQuery) {\n return !matchB.matchesEntireQuery ? -1 : this.compareMatchesNumbers(matchA, matchB);\n } else {\n return matchB.matchesEntireQuery ? 1 : this.compareMatchesNumbers(matchA, matchB);\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ConnectionPositionPair, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n booleanAttribute,\n ComponentRef,\n computed,\n Directive,\n effect,\n ElementRef,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n OnChanges,\n OnDestroy,\n output,\n signal,\n SimpleChanges,\n TemplateRef\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { SiAutocompleteDirective } from '@siemens/element-ng/autocomplete';\nimport { t, TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { isObservable, ReplaySubject, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { SiTypeaheadComponent } from './si-typeahead.component';\nimport {\n Typeahead,\n TypeaheadArray,\n TypeaheadMatch,\n TypeaheadOption,\n TypeaheadOptionItemContext\n} from './si-typeahead.model';\nimport { typeaheadSearch } from './si-typeahead.search';\nimport { SiTypeaheadSorting } from './si-typeahead.sorting';\n\n@Directive({\n selector: '[siTypeahead]',\n host: {\n class: 'si-typeahead'\n },\n hostDirectives: [SiAutocompleteDirective],\n exportAs: 'si-typeahead'\n})\nexport class SiTypeaheadDirective implements OnChanges, OnDestroy {\n protected static readonly overlayPositions: ConnectionPositionPair[] = [\n {\n overlayX: 'start',\n overlayY: 'top',\n originX: 'start',\n originY: 'bottom',\n offsetY: 2\n },\n {\n overlayX: 'start',\n overlayY: 'bottom',\n originX: 'start',\n originY: 'top',\n offsetY: -4\n },\n {\n overlayX: 'end',\n overlayY: 'top',\n originX: 'end',\n originY: 'bottom',\n offsetY: 2\n },\n {\n overlayX: 'end',\n overlayY: 'bottom',\n originX: 'end',\n originY: 'top',\n offsetY: -4\n }\n ];\n\n /**\n * Set the options of the typeahead.\n * Has to be either an Array or an Observable of an Array\n * of options (string or object)\n */\n readonly siTypeahead = input.required<Typeahead>();\n\n /**\n * Turns on/off the processing (searching and sorting) of the typeahead options.\n * Is used when searching and sorting is done externally.\n *\n * @defaultValue true\n */\n readonly typeaheadProcess = input(true, {\n transform: booleanAttribute\n });\n /**\n * Makes the typeahead scrollable and sets its height.\n * Uses {@link typeaheadOptionsInScrollableView} and {@link typeaheadScrollableAdditionalHeight}.\n *\n * @defaultValue false\n */\n readonly typeaheadScrollable = input(false, { transform: booleanAttribute });\n\n /**\n * If {@link typeaheadScrollable} is `true`, defines the number of items visible at once.\n *\n * @defaultValue 10\n */\n readonly typeaheadOptionsInScrollableView = input(10);\n\n /**\n * Defines the maximum number of items added into the DOM. Default is 20 and 0 means unlimited.\n *\n * @defaultValue 20\n */\n readonly typeaheadOptionsLimit = input(20);\n\n /**\n * If {@link typeaheadScrollable} is `true`, defines the number of additional pixels\n * to be added the the bottom of the typeahead to show users that it is scrollable.\n *\n * @defaultValue 13\n */\n readonly typeaheadScrollableAdditionalHeight = input(13);\n\n /**\n * Defines the index of the item which should automatically be selected.\n *\n * @defaultValue 0\n */\n readonly typeaheadAutoSelectIndex = input(0, { transform: numberAttribute });\n /**\n * Defines whether the typeahead can be closed using escape.\n *\n * @defaultValue true\n */\n readonly typeaheadCloseOnEsc = input(true, { transform: booleanAttribute });\n /**\n * Defines whether the host value should be cleared when a value is selected.\n *\n * @defaultValue false\n */\n readonly typeaheadClearValueOnSelect = input(false, { transform: booleanAttribute });\n /**\n * Defines the number of milliseconds to wait before displaying a typeahead after the host was\n * focused or a value inputted.\n *\n * @defaultValue 0\n */\n readonly typeaheadWaitMs = input(0);\n\n /**\n * Defines the number of characters the value of the host needs to be before a typeahead is displayed.\n * Use `0` to have it display when focussing the host (clicking or tabbing into it).\n *\n * @defaultValue 1\n */\n readonly typeaheadMinLength = input(1);\n\n /**\n * Defines the name of the field/property the option string is in when the typeahead options are objects.\n *\n * @defaultValue 'name'\n */\n readonly typeaheadOptionField = input('name');\n /**\n * Defines whether multiselection of typeahead is possible with checkboxes.\n *\n * @defaultValue false\n */\n readonly typeaheadMultiSelect = input(false, { transform: booleanAttribute });\n\n /**\n * Defines whether to tokenize the search or match the whole search.\n *\n * @defaultValue true\n */\n readonly typeaheadTokenize = input(true, { transform: booleanAttribute });\n /**\n * Defines whether and how to require to match with all the tokens if {@link typeaheadTokenize} is enabled.\n * - `no` does not require all of the tokens to match.\n * - `once` requires all of the parts to be found in the search.\n * - `separately` requires all of the parts to be found in the search where there is not an overlapping different result.\n * - `independently` requires all of the parts to be found in the search where there is not an overlapping or adjacent different result.\n * ('independently' also slightly changes sorting behavior in the same way.)\n *\n * @defaultValue 'separately'\n */\n readonly typeaheadMatchAllTokens = input<'no' | 'once' | 'separately' | 'independently'>(\n 'separately'\n );\n /**\n * Defines an optional template to use as the typeahead match item instead of the one built in.\n * Gets the {@link TypeaheadOptionItemContext} passed to it.\n */\n readonly typeaheadItemTemplate = input<TemplateRef<TypeaheadOptionItemContext>>();\n /**\n * Skip the sorting of matches.\n * If the value is `true`, the matches are sorted according to {@link SiTypeaheadSorting}.\n *\n * @defaultValue false\n */\n readonly typeaheadSkipSortingMatches = input(false, { transform: booleanAttribute });\n\n /**\n * Screen reader only label for the autocomplete list.\n *\n * @defaultValue\n * ```\n * t(() => $localize`:@@SI_TYPEAHEAD.AUTOCOMPLETE_LIST_LABEL:Suggestions`)\n * ```\n */\n readonly typeaheadAutocompleteListLabel = input(\n t(() => $localize`:@@SI_TYPEAHEAD.AUTOCOMPLETE_LIST_LABEL:Suggestions`)\n );\n\n /**\n * If set, the typeahead will at minium have the width of the connected input field.\n *\n * @defaultValue false\n */\n readonly typeaheadFullWidth = input(false, { transform: booleanAttribute });\n\n /**\n * This option will be shown at the end of the typeahead.\n * Use it to allow users to create new options on the fly.\n *\n * Use the `{{ query }}` parameter in translation values to include the current text from the input.\n *\n * @experimental\n */\n readonly typeaheadCreateOption = input<TranslatableString>();\n /**\n * Emits an Event when the input field is changed.\n */\n readonly typeaheadOnInput = output<string>();\n /**\n * Emits an Event when a typeahead match is selected.\n * The event is a {@link TypeaheadMatch}\n */\n readonly typeaheadOnSelect = output<TypeaheadMatch>();\n\n /**\n * Emits an Event when a typeahead full match exists. A full match occurs when the entered text\n * is equal to one of the typeahead options.\n * The event is a {@link TypeaheadMatch}\n */\n readonly typeaheadOnFullMatch = output<TypeaheadMatch>();\n\n /** Emits whenever the typeahead overlay is opened or closed. */\n readonly typeaheadOpenChange = output<boolean>();\n\n /**\n * Emits when the create option is selected.\n * It will emit the current search query.\n *\n * @experimental\n */\n readonly typeaheadOnCreateOption = output<string>();\n\n /** @internal */\n readonly foundMatches = computed(() =>\n this.typeaheadProcess() ? this.processedSearch() : this.unprocessedSearch()\n );\n /** @internal */\n readonly query = signal('');\n\n /**\n * Indicates whether the typeahead is shown.\n */\n get typeaheadOpen(): boolean {\n return !!this.componentRef;\n }\n private overlay = inject(Overlay);\n private elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private injector = inject(Injector);\n\n private $typeahead = new ReplaySubject<TypeaheadArray>(1);\n private componentRef?: ComponentRef<SiTypeaheadComponent>;\n private inputTimer: any;\n\n private sourceSubscription?: Subscription;\n private matchSorter = new SiTypeaheadSorting();\n\n private overlayRef?: OverlayRef;\n\n /**\n * Indicates that the typeahead can be potentially open.\n * This signal is typically `true` when the input is focussed.\n * It may be overridden and set to `false` when escape is pressed\n * or when an option was selected.\n */\n private readonly canBeOpen = signal(false);\n private readonly selectionCounter = signal(0);\n private readonly typeaheadOptions = toSignal(\n this.$typeahead.pipe(\n map(options =>\n options.map(option => ({\n text: this.getOptionValue(option),\n option\n }))\n )\n ),\n { initialValue: [] }\n );\n private readonly typeaheadSearch = typeaheadSearch(\n this.typeaheadOptions,\n this.query,\n computed(() => ({\n matchAllTokens: this.typeaheadMatchAllTokens(),\n disableTokenizing: !this.typeaheadTokenize(),\n skipProcessing: !this.typeaheadProcess()\n }))\n );\n private readonly processedSearch = computed(() => {\n this.selectionCounter(); // This is a workaround for the multi-select which needs to trigger a change detection in the typeahead component.\n const matches = this.typeaheadSearch().map(match => ({\n ...match,\n itemSelected: this.typeaheadMultiSelect()\n ? (match.option as Record<string, any>).selected\n : false,\n iconClass: this.getOptionField(match.option, 'iconClass')\n }));\n\n if (this.typeaheadSkipSortingMatches()) {\n return matches;\n } else {\n return this.matchSorter.sortMatches(matches);\n }\n });\n private readonly unprocessedSearch = computed(() => {\n this.selectionCounter(); // This is a workaround for the multi-select which needs to trigger a change detection in the typeahead component.\n return this.typeaheadOptions().map(option => {\n const itemSelected = this.typeaheadMultiSelect()\n ? (option as Record<string, any>).selected\n : false;\n return {\n option,\n text: option.text,\n result: option.text\n ? [{ text: option.text, isMatching: false, matches: 0, uniqueMatches: 0 }]\n : [],\n itemSelected,\n iconClass: this.getOptionField(option.option, 'iconClass'),\n stringMatch: false,\n atBeginning: false,\n matches: 0,\n uniqueMatches: 0,\n uniqueSeparateMatches: 0,\n matchesEntireQuery: false,\n matchesAllParts: false,\n matchesAllPartsSeparately: false,\n active: false\n };\n });\n });\n\n constructor() {\n effect(() => {\n // The value needs to fulfil the minimum length requirement set.\n const matches = this.foundMatches();\n if (\n this.canBeOpen() &&\n this.query().length >= this.typeaheadMinLength() &&\n (matches.length || (this.typeaheadCreateOption() && this.query().length))\n ) {\n const escapedQuery = this.escapeRegex(this.query());\n const equalsExp = new RegExp(`^${escapedQuery}$`, 'i');\n const fullMatches = matches.filter(\n match => match.result.length === 1 && equalsExp.test(match.text)\n );\n if (fullMatches.length > 0) {\n this.typeaheadOnFullMatch.emit(fullMatches[0]);\n }\n if (matches.length || this.typeaheadCreateOption()) {\n this.loadComponent();\n } else {\n this.removeComponent();\n }\n } else {\n this.removeComponent();\n }\n });\n }\n\n // Every time the main input changes, detect whether it is async and if it is not make an observable out of the array.\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.siTypeahead) {\n this.sourceSubscription?.unsubscribe();\n const typeahead = this.siTypeahead();\n if (isObservable(typeahead)) {\n this.sourceSubscription = typeahead.subscribe(this.$typeahead);\n } else {\n this.$typeahead.next(typeahead);\n }\n }\n }\n\n // Clear the current input timeout (if set) and remove the component when the focus of the host is lost.\n @HostListener('focusout')\n protected onBlur(): void {\n this.clearTimer();\n this.canBeOpen.set(false);\n }\n\n // Start the input timeout to display the typeahead when the host is focussed or a value is inputted into it.\n @HostListener('focusin', ['$event'])\n @HostListener('input', ['$event'])\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n if (!target) {\n return;\n }\n\n // Get the value or otherwise textContent of the host element now, because later it could be reset.\n const firstValue = target.value || target.textContent;\n this.inputTimer ??= setTimeout(() => {\n this.inputTimer = undefined;\n const value = (target.value || target.textContent) ?? firstValue ?? '';\n this.query.set(value);\n this.typeaheadOnInput.emit(value ?? '');\n this.canBeOpen.set(true);\n }, this.typeaheadWaitMs());\n }\n\n @HostListener('keydown.escape')\n protected onKeydownEscape(): void {\n if (this.typeaheadCloseOnEsc()) {\n this.clearTimer();\n this.canBeOpen.set(false);\n }\n }\n\n ngOnDestroy(): void {\n this.clearTimer();\n this.sourceSubscription?.unsubscribe();\n\n this.overlayRef?.dispose();\n }\n\n // Dynamically create the typeahead component and then set the matches and the query.\n private loadComponent(): void {\n if (!this.overlayRef?.hasAttached()) {\n this.overlayRef?.dispose();\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef.nativeElement)\n .withPositions(SiTypeaheadDirective.overlayPositions),\n minWidth: this.typeaheadFullWidth()\n ? this.elementRef.nativeElement.getBoundingClientRect().width + 2 // 2px border\n : 0\n });\n }\n\n if (this.overlayRef.hasAttached()) {\n return;\n }\n const typeaheadPortal = new ComponentPortal(SiTypeaheadComponent, null, this.injector);\n this.componentRef = this.overlayRef.attach(typeaheadPortal);\n this.typeaheadOpenChange.emit(true);\n }\n\n /**\n * Extracts the display value from a typeahead option.\n *\n * For string options, returns the string value directly.\n * For object options, returns the value of the field specified by {@link typeaheadOptionField}\n * (defaults to 'name'), or an empty string if the field doesn't exist.\n *\n * @param option - The typeahead option to extract the value from\n * @returns The string representation of the option for display purposes\n */\n private getOptionValue(option: TypeaheadOption): string {\n return typeof option !== 'object'\n ? option.toString()\n : (option[this.typeaheadOptionField()] ?? '');\n }\n\n /**\n * Extracts a specific field value from a typeahead option.\n *\n * This method is used to access additional properties of object-type options,\n * such as 'selected' for multi-select functionality or 'iconClass' for displaying icons.\n *\n * @param option - The typeahead option to extract the field from\n * @param field - The name of the field to extract\n * @returns The field value as a string if the option is an object and the field exists,\n * otherwise undefined\n */\n private getOptionField(option: TypeaheadOption, field: string): string | undefined {\n return typeof option !== 'object' ? undefined : option[field];\n }\n\n /** @internal */\n createOption(): void {\n this.typeaheadOnCreateOption.emit(this.query());\n this.clearTimer();\n if (!this.typeaheadMultiSelect() && this.typeaheadClearValueOnSelect()) {\n const inputElement =\n this.elementRef.nativeElement.querySelector('input')! ?? this.elementRef.nativeElement;\n inputElement.value = '';\n inputElement.dispatchEvent(new Event('input'));\n }\n this.canBeOpen.set(false);\n }\n\n // Select a match, either gets called due to a enter keypress or from the component due to a click.\n /** @internal */\n selectMatch(match: TypeaheadMatch): void {\n match.itemSelected = !match.itemSelected;\n if (!this.typeaheadMultiSelect()) {\n const inputElement =\n this.elementRef.nativeElement.querySelector('input')! ?? this.elementRef.nativeElement;\n inputElement.value = this.typeaheadClearValueOnSelect() ? '' : match.text;\n inputElement.dispatchEvent(new Event('input'));\n }\n\n // Clear the current input timeout (if set) and remove the typeahead.\n this.clearTimer();\n this.typeaheadOnSelect.emit(match);\n if (!this.typeaheadMultiSelect()) {\n this.canBeOpen.set(false);\n }\n }\n\n // Remove the component by clearing the viewContainerRef\n private removeComponent(): void {\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef?.detach();\n this.typeaheadOpenChange.emit(false);\n }\n\n this.componentRef?.destroy();\n this.componentRef = undefined;\n }\n\n private clearTimer(): void {\n if (this.inputTimer) {\n clearTimeout(this.inputTimer);\n this.inputTimer = undefined;\n }\n }\n\n private escapeRegex(query: string): string {\n return query.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiTypeaheadItemTemplateDirective } from './si-typeahead-item-template.directive';\nimport { SiTypeaheadDirective } from './si-typeahead.directive';\n\n@NgModule({\n imports: [SiTypeaheadDirective, SiTypeaheadItemTemplateDirective],\n exports: [SiTypeaheadDirective, SiTypeaheadItemTemplateDirective]\n})\nexport class SiTypeaheadModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-typeahead.directive';\nexport * from './si-typeahead.model';\nexport * from './si-typeahead.module';\nexport * from './si-typeahead-item-template.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;AAGG;MAQU,gCAAgC,CAAA;AAC3C,IAAA,OAAO,sBAAsB,CAC3B,GAAqC,EACrC,GAAQ,EAAA;AAER,QAAA,OAAO,IAAI;IACb;uGANW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhC,gCAAgC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACVD;;;AAGG;MAuCU,oBAAoB,CAAA;AACrB,IAAA,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAC5B,OAAO,GAAG,QAAQ,CAAC,MACpC,IAAI,CAAC,MAAM,CAAC,qBAAqB;AAC/B,UAAE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;UACvE,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,mDAC/B;AAEkB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7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,gCAAgC,CAAC;AACjE,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,gCAAgC;AACjE,iBAAA;;;ACZD;;;AAGG;;ACHH;;AAEG;;;;"}
1
+ {"version":3,"file":"siemens-element-ng-typeahead.mjs","sources":["../../../../projects/element-ng/typeahead/si-typeahead-item-template.directive.ts","../../../../projects/element-ng/typeahead/si-typeahead.component.ts","../../../../projects/element-ng/typeahead/si-typeahead.component.html","../../../../projects/element-ng/typeahead/si-typeahead.search.ts","../../../../projects/element-ng/typeahead/si-typeahead.sorting.ts","../../../../projects/element-ng/typeahead/si-typeahead.directive.ts","../../../../projects/element-ng/typeahead/si-typeahead.module.ts","../../../../projects/element-ng/typeahead/index.ts","../../../../projects/element-ng/typeahead/siemens-element-ng-typeahead.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { TypeaheadOptionItemContext } from './si-typeahead.model';\n\n@Directive({\n selector: '[siTypeaheadItemTemplate]'\n})\nexport class SiTypeaheadItemTemplateDirective {\n static ngTemplateContextGuard(\n dir: SiTypeaheadItemTemplateDirective,\n ctx: any\n ): ctx is TypeaheadOptionItemContext {\n return true;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n HostListener,\n inject,\n viewChild\n} from '@angular/core';\nimport {\n SiAutocompleteDirective,\n SiAutocompleteListboxDirective,\n SiAutocompleteOptionDirective\n} from '@siemens/element-ng/autocomplete';\nimport { SiIconComponent } from '@siemens/element-ng/icon';\nimport { SiLoadingSpinnerDirective } from '@siemens/element-ng/loading-spinner';\nimport { SiTranslatePipe } from '@siemens/element-translate-ng/translate';\n\nimport { SiTypeaheadItemTemplateDirective } from './si-typeahead-item-template.directive';\nimport { SiTypeaheadDirective } from './si-typeahead.directive';\nimport { TypeaheadMatch } from './si-typeahead.model';\n\n@Component({\n selector: 'si-typeahead',\n imports: [\n SiAutocompleteListboxDirective,\n SiAutocompleteOptionDirective,\n SiIconComponent,\n NgTemplateOutlet,\n SiTranslatePipe,\n SiTypeaheadItemTemplateDirective,\n SiLoadingSpinnerDirective\n ],\n templateUrl: './si-typeahead.component.html',\n styleUrl: './si-typeahead.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'w-100' }\n})\nexport class SiTypeaheadComponent implements AfterViewInit {\n protected parent = inject(SiTypeaheadDirective);\n protected readonly matches = computed(() =>\n this.parent.typeaheadOptionsLimit()\n ? this.parent.foundMatches().slice(0, this.parent.typeaheadOptionsLimit())\n : this.parent.foundMatches()\n );\n\n protected readonly multiselect = computed(() => this.parent.typeaheadMultiSelect());\n\n private readonly typeaheadElement = viewChild.required('typeahead', {\n read: ElementRef\n });\n\n protected autocompleteDirective = inject(SiAutocompleteDirective);\n\n ngAfterViewInit(): void {\n this.setHeight(this.typeaheadElement());\n }\n\n @HostListener('mousedown', ['$event'])\n protected onMouseDown(event: Event): void {\n event.preventDefault();\n }\n\n /*\n * Set the height of the element passed to it (typeahead) if there are items displayed,\n * the number of displayed items changed and it is scrollable.\n */\n private setHeight(element: ElementRef): void {\n if (this.matches().length) {\n if (\n this.parent.typeaheadScrollable() &&\n this.parent.typeaheadOptionsInScrollableView() < this.matches().length\n ) {\n const computedStyle = getComputedStyle(element.nativeElement);\n const matchComputedStyle = getComputedStyle(element.nativeElement.firstElementChild);\n const matchHeight = parseFloat(matchComputedStyle.height || '0');\n const paddingTop = parseFloat(computedStyle.paddingTop || '0');\n const paddingBottom = parseFloat(computedStyle.paddingBottom || '');\n const height = this.parent.typeaheadOptionsInScrollableView() * matchHeight;\n element.nativeElement.style.maxBlockSize = `${\n height + paddingTop + paddingBottom + this.parent.typeaheadScrollableAdditionalHeight()\n }px`;\n } else {\n element.nativeElement.style.maxBlockSize = 'auto';\n }\n }\n }\n\n // Gets called when a match is selected by clicking on it.\n protected selectMatch(match: TypeaheadMatch | undefined): void {\n if (match) {\n this.parent.selectMatch(match);\n } else {\n this.parent.createOption();\n }\n }\n}\n","<!-- Template to be used for every match, can be replaced using an input. -->\n<ng-template #defaultItemTemplate let-match=\"match\" siTypeaheadItemTemplate>\n @if (multiselect()) {\n <div class=\"d-flex pe-4\" aria-hidden=\"true\">\n <span class=\"form-check-input si-form-checkbox\" [class.checked]=\"match.itemSelected\"></span>\n </div>\n }\n @if (match.iconClass) {\n <si-icon class=\"icon me-2\" [icon]=\"match.iconClass\" />\n }\n @for (segment of match.result; track $index) {\n <span [class.typeahead-match-segment-matching]=\"segment.isMatching\">{{ segment.text }}</span>\n }\n</ng-template>\n\n@let createOption = parent.typeaheadCreateOption();\n\n<!-- Only display the component if there are any matches and set the CSS transform to properly position the typeahead -->\n<ul\n #typeahead\n class=\"typeahead dropdown-menu\"\n [class.empty-loading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [siLoading]=\"parent.typeaheadLoading() && matches().length === 0\"\n [initialDelay]=\"false\"\n [siAutocompleteListboxFor]=\"autocompleteDirective\"\n [siAutocompleteDefaultIndex]=\"parent.typeaheadAutoSelectIndex()\"\n [attr.aria-label]=\"parent.typeaheadAutocompleteListLabel() | translate\"\n (siAutocompleteOptionSubmitted)=\"selectMatch($event)\"\n>\n @if (parent.typeaheadLoading() && matches().length) {\n <li class=\"dropdown-item\" [siLoading]=\"true\" [initialDelay]=\"false\"></li>\n }\n <!-- Loop through every match and bind events, the mousedown prevent default is to prevent the host from losing focus on click -->\n @for (match of matches(); track $index) {\n <li\n #typeaheadMatch\n class=\"dropdown-item\"\n [siAutocompleteOption]=\"match\"\n [attr.aria-label]=\"match.text\"\n [attr.aria-selected]=\"multiselect() ? match.itemSelected : null\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <!-- Display either a template set as the input or the template above -->\n <ng-template\n [ngTemplateOutlet]=\"parent.typeaheadItemTemplate() || defaultItemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: match.option,\n index: $index,\n match: match,\n query: parent.query()\n }\"\n />\n </li>\n }\n @if (createOption && parent.query().length) {\n <li class=\"dropdown-item\" [siAutocompleteOption]=\"undefined\">\n {{ createOption | translate: { query: parent.query() } }}\n </li>\n }\n</ul>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { computed, Signal, untracked } from '@angular/core';\n\nexport interface SearchOptions<T> {\n /** The text that will be used for searching. */\n text: string;\n /** The raw option that will be also included in the Match results */\n option: T;\n}\n\nexport interface MatchSegment {\n text: string;\n isMatching: boolean;\n matches: number;\n uniqueMatches: number;\n}\n\nexport interface Match<T> {\n option: T;\n text: string;\n result: MatchSegment[];\n stringMatch: boolean;\n atBeginning: boolean;\n matches: number;\n uniqueMatches: number;\n uniqueSeparateMatches: number;\n matchesEntireQuery: boolean;\n matchesAllParts: boolean;\n matchesAllPartsSeparately: boolean;\n}\n\nexport interface SearchConfig {\n /** Defines whether to tokenize the search or match the whole search. */\n disableTokenizing?: boolean;\n /**\n * Defines whether and how to require to match with all the tokens if {@link typeaheadTokenize} is enabled.\n * - `no` does not require all of the tokens to match.\n * - `once` requires all of the parts to be found in the search.\n * - `separately` requires all of the parts to be found in the search where there is not an overlapping different result.\n * - `independently` requires all of the parts to be found in the search where there is not an overlapping or adjacent different result.\n * ('independently' also slightly changes sorting behavior in the same way.)\n */\n matchAllTokens: 'no' | 'once' | 'separately' | 'independently';\n /**\n * When enabled, the search output will only be updated, if the options are changed.\n * Query changes will not trigger an update.\n *\n * Use this when lazy loading the options, so the search need to wait, until the options are loaded.\n */\n lazy?: boolean;\n}\n\n/**\n * Constructs a typeahead search and provides the matches as a signal.\n *\n * @param options - Factory function that should return the array of options to search in.\n * Is run in a reactive context.\n * @param query - Factory function that should return the current search query. Is run in a reactive context.\n * @param config - Configuration for the search. Is run in a reactive context.\n *\n * @example\n * In a real world, myOptions and mayQuery would be signals.\n * ```ts\n * const search = typeaheadSearch(\n * () => myOptions().map(...),\n * () => myQuery().toLowerCase(),\n * () => ({ matchAllTokens: 'separately' })\n * )\n * ```\n */\nexport const typeaheadSearch = <T>(\n options: () => SearchOptions<T>[],\n query: () => string,\n config: () => SearchConfig\n): Signal<Match<T>[]> => computed(() => new TypeaheadSearch<T>(options, query, config()).matches());\n\nclass TypeaheadSearch<T> {\n readonly matches = computed<Match<T>[]>(() => this.search(this.datasource(), this.readQuery()));\n\n constructor(\n private readonly datasource: () => SearchOptions<T>[],\n private readonly query: () => string,\n private readonly options: SearchConfig\n ) {}\n\n private readQuery(): string {\n if (this.options.lazy) {\n return untracked(() => this.query());\n } else {\n return this.query();\n }\n }\n\n private escapeRegex(query: string): string {\n return query.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n }\n\n private search(options: SearchOptions<T>[], query: string): Match<T>[] {\n try {\n const entireQueryRegex = new RegExp(this.escapeRegex(query), 'gi');\n\n const queryParts = !this.options.disableTokenizing\n ? query.split(/\\s+/g).filter(queryPart => queryPart)\n : query\n ? [query]\n : [];\n\n const queryRegexes = queryParts.map(\n queryPart => new RegExp(this.escapeRegex(queryPart), 'gi')\n );\n // Process the options.\n const matches: Match<T>[] = [];\n options.forEach(option => {\n const optionValue = option.text;\n const stringMatch =\n optionValue.toLocaleLowerCase().trim() === query.toLocaleLowerCase().trim();\n const candidate: Match<T> = {\n option: option.option,\n text: optionValue,\n result: [],\n stringMatch,\n atBeginning: false,\n matches: 0,\n uniqueMatches: 0,\n uniqueSeparateMatches: 0,\n matchesEntireQuery: false,\n matchesAllParts: false,\n matchesAllPartsSeparately: false\n };\n\n // Only search the options if a part of the query is at least one character long to prevent an endless loop.\n if (queryParts.length === 0) {\n if (optionValue) {\n candidate.result.push({\n text: optionValue,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n matches.push(candidate);\n } else {\n const allResults: { index: number; start: number; end: number; result: string }[] = [];\n const allIndexes: number[] = [];\n\n candidate.matchesEntireQuery = !!optionValue.match(entireQueryRegex);\n\n // Loop through the option value to find multiple matches, then store every segment (matching or non-matching) in the results.\n queryRegexes.forEach((queryRegex, index) => {\n let regexMatch = queryRegex.exec(optionValue);\n\n while (regexMatch) {\n allResults.push({\n index,\n start: regexMatch.index,\n end: regexMatch.index + regexMatch[0].length,\n result: regexMatch[0]\n });\n if (!regexMatch.index) {\n candidate.atBeginning = true;\n }\n if (!allIndexes.includes(index)) {\n allIndexes.push(index);\n }\n regexMatch = queryRegex.exec(optionValue);\n }\n });\n\n candidate.matchesAllParts = allIndexes.length === queryParts.length;\n\n // Check if all parts of the query match at least once (if required).\n if (this.options.matchAllTokens === 'no' || candidate.matchesAllParts) {\n const combinedResults: {\n indexes: number[];\n uniqueIndexes: number[];\n start: number;\n end: number;\n result: string;\n }[] = [];\n\n // First combine intersecting (or if set to independently adjacent) results to combined results.\n // We achieve this by first sorting them by the starting index, then by the ending index and then looking for overlaps.\n allResults\n .sort((a, b) => a.start - b.start || a.end - b.end)\n .forEach(result => {\n if (combinedResults.length) {\n const foundPreviousResult = combinedResults.find(previousResult =>\n this.options.matchAllTokens === 'independently'\n ? result.start <= previousResult.end\n : result.start < previousResult.end\n );\n if (foundPreviousResult) {\n foundPreviousResult.result += result.result.slice(\n foundPreviousResult.end - result.start,\n result.result.length\n );\n if (result.end > foundPreviousResult.end) {\n foundPreviousResult.end = result.end;\n }\n foundPreviousResult.indexes.push(result.index);\n if (!foundPreviousResult.uniqueIndexes.includes(result.index)) {\n foundPreviousResult.uniqueIndexes.push(result.index);\n }\n return;\n }\n }\n combinedResults.push({\n ...result,\n indexes: [result.index],\n uniqueIndexes: [result.index]\n });\n });\n\n // Recursively go through all unique combinations of the unique indexes to get the option which has the most indexes.\n const countUniqueSubindexes = (\n indexIndex = 0,\n previousIndexes: number[] = []\n ): number =>\n indexIndex === combinedResults.length\n ? previousIndexes.length\n : Math.max(\n previousIndexes.length,\n ...combinedResults[indexIndex].uniqueIndexes\n .filter(index => !previousIndexes.includes(index))\n .map(index =>\n countUniqueSubindexes(indexIndex + 1, [index, ...previousIndexes])\n )\n );\n\n candidate.uniqueSeparateMatches = countUniqueSubindexes();\n candidate.matchesAllPartsSeparately =\n candidate.uniqueSeparateMatches === queryParts.length;\n\n let currentPreviousEnd = 0;\n\n // Add the combined results to the candidate including the non-matching parts in between.\n combinedResults.forEach(result => {\n const textBefore = optionValue.slice(currentPreviousEnd, result.start);\n if (textBefore) {\n candidate.result.push({\n text: textBefore,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n candidate.result.push({\n text: result.result,\n isMatching: true,\n matches: result.indexes.length,\n uniqueMatches: result.uniqueIndexes.length\n });\n currentPreviousEnd = result.end;\n candidate.matches += result.indexes.length;\n candidate.uniqueMatches += result.uniqueIndexes.length;\n });\n\n // Check if there are result segments and all parts are matched independently (if required).\n if (\n candidate.result.length !== 0 &&\n ((this.options.matchAllTokens !== 'separately' &&\n this.options.matchAllTokens !== 'independently') ||\n candidate.matchesAllPartsSeparately)\n ) {\n const textAtEnd = optionValue.slice(currentPreviousEnd);\n if (textAtEnd) {\n candidate.result.push({\n text: textAtEnd,\n isMatching: false,\n matches: 0,\n uniqueMatches: 0\n });\n }\n matches.push(candidate);\n }\n }\n }\n });\n\n return matches;\n } catch {\n // Could not create regex (only in extremely rare cases, maybe even impossible), so return an empty array.\n return [];\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { TypeaheadMatch } from './si-typeahead.model';\n\nexport class SiTypeaheadSorting {\n sortMatches(matches: TypeaheadMatch[]): TypeaheadMatch[] {\n // Sort the matches,\n // first is the option and query an exact match.\n // then according to whether it is matching in the beginning,\n // then whether it matches the entire untokenized query.\n // then according to how many unique separate matches it contains.\n // then according to how many unique matches it contains.\n // then according to how many matches it contains.\n return matches.sort((matchA, matchB) => {\n if (matchA.stringMatch || matchB.stringMatch) {\n return matchA.stringMatch ? -1 : 1;\n }\n if (matchA.atBeginning) {\n return !matchB.atBeginning ? -1 : this.compareMatches(matchA, matchB);\n } else {\n return matchB.atBeginning ? 1 : this.compareMatches(matchA, matchB);\n }\n });\n }\n\n private compareMatchesNumbers(matchA: TypeaheadMatch, matchB: TypeaheadMatch): number {\n return (\n matchB.uniqueSeparateMatches - matchA.uniqueSeparateMatches ||\n matchB.uniqueMatches - matchA.uniqueMatches ||\n matchB.matches - matchA.matches\n );\n }\n\n private compareMatches(matchA: TypeaheadMatch, matchB: TypeaheadMatch): number {\n if (matchA.matchesEntireQuery) {\n return !matchB.matchesEntireQuery ? -1 : this.compareMatchesNumbers(matchA, matchB);\n } else {\n return matchB.matchesEntireQuery ? 1 : this.compareMatchesNumbers(matchA, matchB);\n }\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n ConnectionPositionPair,\n Overlay,\n OverlayConfig,\n OverlayRef,\n ScrollStrategy\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n booleanAttribute,\n ComponentRef,\n computed,\n Directive,\n effect,\n ElementRef,\n HostListener,\n inject,\n Injector,\n input,\n numberAttribute,\n OnChanges,\n OnDestroy,\n output,\n signal,\n SimpleChanges,\n TemplateRef\n} from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { SiAutocompleteDirective } from '@siemens/element-ng/autocomplete';\nimport { t, TranslatableString } from '@siemens/element-translate-ng/translate';\nimport { catchError, isObservable, ReplaySubject, Subscription, timer } from 'rxjs';\nimport { map, share, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { SiTypeaheadComponent } from './si-typeahead.component';\nimport {\n Typeahead,\n TypeaheadArray,\n TypeaheadMatch,\n TypeaheadOption,\n TypeaheadOptionItemContext,\n TypeaheadOptionSource\n} from './si-typeahead.model';\nimport { typeaheadSearch } from './si-typeahead.search';\nimport { SiTypeaheadSorting } from './si-typeahead.sorting';\n\n@Directive({\n selector: '[siTypeahead]',\n host: {\n class: 'si-typeahead'\n },\n hostDirectives: [SiAutocompleteDirective],\n exportAs: 'si-typeahead'\n})\nexport class SiTypeaheadDirective implements OnChanges, OnDestroy {\n protected static readonly overlayPositions: ConnectionPositionPair[] = [\n {\n overlayX: 'start',\n overlayY: 'top',\n originX: 'start',\n originY: 'bottom',\n offsetY: 2\n },\n {\n overlayX: 'start',\n overlayY: 'bottom',\n originX: 'start',\n originY: 'top',\n offsetY: -4\n },\n {\n overlayX: 'end',\n overlayY: 'top',\n originX: 'end',\n originY: 'bottom',\n offsetY: 2\n },\n {\n overlayX: 'end',\n overlayY: 'bottom',\n originX: 'end',\n originY: 'top',\n offsetY: -4\n }\n ];\n\n /**\n * Set the options of the typeahead.\n * Has to be either an Array or an Observable of an Array\n * of options (string or object)\n */\n readonly siTypeahead = input.required<Typeahead>();\n\n /**\n * Turns on/off the processing (searching and sorting) of the typeahead options.\n * Is used when searching and sorting is done externally.\n *\n * @defaultValue true\n */\n readonly typeaheadProcess = input(true, {\n transform: booleanAttribute\n });\n /**\n * Makes the typeahead scrollable and sets its height.\n * Uses {@link typeaheadOptionsInScrollableView} and {@link typeaheadScrollableAdditionalHeight}.\n *\n * @defaultValue false\n */\n readonly typeaheadScrollable = input(false, { transform: booleanAttribute });\n\n /**\n * If {@link typeaheadScrollable} is `true`, defines the number of items visible at once.\n *\n * @defaultValue 10\n */\n readonly typeaheadOptionsInScrollableView = input(10);\n\n /**\n * Defines the maximum number of items added into the DOM. Default is 20 and 0 means unlimited.\n *\n * @defaultValue 20\n */\n readonly typeaheadOptionsLimit = input(20);\n\n /**\n * If {@link typeaheadScrollable} is `true`, defines the number of additional pixels\n * to be added the the bottom of the typeahead to show users that it is scrollable.\n *\n * @defaultValue 13\n */\n readonly typeaheadScrollableAdditionalHeight = input(13);\n\n /**\n * Defines the index of the item which should automatically be selected.\n *\n * @defaultValue 0\n */\n readonly typeaheadAutoSelectIndex = input(0, { transform: numberAttribute });\n /**\n * Defines whether the typeahead can be closed using escape.\n *\n * @defaultValue true\n */\n readonly typeaheadCloseOnEsc = input(true, { transform: booleanAttribute });\n /**\n * Defines whether the host value should be cleared when a value is selected.\n *\n * @defaultValue false\n */\n readonly typeaheadClearValueOnSelect = input(false, { transform: booleanAttribute });\n /**\n * Defines the number of milliseconds to wait before displaying a typeahead after the host was\n * focused or a value inputted.\n *\n * @defaultValue 0\n */\n readonly typeaheadWaitMs = input(0);\n\n /**\n * Defines the number of characters the value of the host needs to be before a typeahead is displayed.\n * Use `0` to have it display when focussing the host (clicking or tabbing into it).\n *\n * @defaultValue 1\n */\n readonly typeaheadMinLength = input(1);\n\n /**\n * Defines the name of the field/property the option string is in when the typeahead options are objects.\n *\n * @defaultValue 'name'\n */\n readonly typeaheadOptionField = input('name');\n /**\n * Defines whether multiselection of typeahead is possible with checkboxes.\n *\n * @defaultValue false\n */\n readonly typeaheadMultiSelect = input(false, { transform: booleanAttribute });\n\n /**\n * Defines whether to tokenize the search or match the whole search.\n *\n * @defaultValue true\n */\n readonly typeaheadTokenize = input(true, { transform: booleanAttribute });\n /**\n * Defines whether and how to require to match with all the tokens if {@link typeaheadTokenize} is enabled.\n * - `no` does not require all of the tokens to match.\n * - `once` requires all of the parts to be found in the search.\n * - `separately` requires all of the parts to be found in the search where there is not an overlapping different result.\n * - `independently` requires all of the parts to be found in the search where there is not an overlapping or adjacent different result.\n * ('independently' also slightly changes sorting behavior in the same way.)\n *\n * @defaultValue 'separately'\n */\n readonly typeaheadMatchAllTokens = input<'no' | 'once' | 'separately' | 'independently'>(\n 'separately'\n );\n /**\n * Defines an optional template to use as the typeahead match item instead of the one built in.\n * Gets the {@link TypeaheadOptionItemContext} passed to it.\n */\n readonly typeaheadItemTemplate = input<TemplateRef<TypeaheadOptionItemContext>>();\n /**\n * Skip the sorting of matches.\n * If the value is `true`, the matches are sorted according to {@link SiTypeaheadSorting}.\n *\n * @defaultValue false\n */\n readonly typeaheadSkipSortingMatches = input(false, { transform: booleanAttribute });\n\n /**\n * Screen reader only label for the autocomplete list.\n *\n * @defaultValue\n * ```\n * t(() => $localize`:@@SI_TYPEAHEAD.AUTOCOMPLETE_LIST_LABEL:Suggestions`)\n * ```\n */\n readonly typeaheadAutocompleteListLabel = input(\n t(() => $localize`:@@SI_TYPEAHEAD.AUTOCOMPLETE_LIST_LABEL:Suggestions`)\n );\n\n /**\n * If set, the typeahead will at minium have the width of the connected input field.\n *\n * @defaultValue false\n */\n readonly typeaheadFullWidth = input(false, { transform: booleanAttribute });\n\n /**\n * Optional CDK scroll strategy used for the typeahead overlay.\n * If not provided, no strategy is set explicitly and CDK will apply its default behavior.\n */\n readonly typeaheadScrollStrategy = input<ScrollStrategy>();\n\n /**\n * This option will be shown at the end of the typeahead.\n * Use it to allow users to create new options on the fly.\n *\n * Use the `{{ query }}` parameter in translation values to include the current text from the input.\n *\n * @experimental\n */\n readonly typeaheadCreateOption = input<TranslatableString>();\n /**\n * Emits an Event when the input field is changed.\n */\n readonly typeaheadOnInput = output<string>();\n /**\n * Emits an Event when a typeahead match is selected.\n * The event is a {@link TypeaheadMatch}\n */\n readonly typeaheadOnSelect = output<TypeaheadMatch>();\n\n /**\n * Emits an Event when a typeahead full match exists. A full match occurs when the entered text\n * is equal to one of the typeahead options.\n * The event is a {@link TypeaheadMatch}\n */\n readonly typeaheadOnFullMatch = output<TypeaheadMatch>();\n\n /** Emits whenever the typeahead overlay is opened or closed. */\n readonly typeaheadOpenChange = output<boolean>();\n\n /**\n * Emits when the create option is selected.\n * It will emit the current search query.\n *\n * @experimental\n */\n readonly typeaheadOnCreateOption = output<string>();\n\n /** @internal */\n readonly foundMatches = computed(() =>\n this.typeaheadProcess() ? this.processedSearch() : this.unprocessedSearch()\n );\n /** @internal */\n readonly query = signal('');\n\n /**\n * Indicates whether the typeahead is shown.\n */\n get typeaheadOpen(): boolean {\n return !!this.componentRef;\n }\n private overlay = inject(Overlay);\n private elementRef = inject<ElementRef<HTMLInputElement>>(ElementRef);\n private injector = inject(Injector);\n\n private $typeahead = new ReplaySubject<TypeaheadArray>(1);\n private componentRef?: ComponentRef<SiTypeaheadComponent>;\n private inputTimer: any;\n\n private sourceSubscription?: Subscription;\n private matchSorter = new SiTypeaheadSorting();\n\n private overlayRef?: OverlayRef;\n\n private loadingSubscription?: Subscription;\n\n /**\n * Indicates whether the typeahead is currently loading.\n * When using {@link TypeaheadOptionSource}, this is controlled by the `isLoading()` method\n * or automatically set to `true` while fetching options.\n *\n * @internal\n * @defaultValue false\n */\n readonly typeaheadLoading = signal(false);\n\n /**\n * Indicates that the typeahead can be potentially open.\n * This signal is typically `true` when the input is focussed.\n * It may be overridden and set to `false` when escape is pressed\n * or when an option was selected.\n */\n private readonly canBeOpen = signal(false);\n private readonly selectionCounter = signal(0);\n private readonly typeaheadOptions = toSignal(\n this.$typeahead.pipe(\n map(options =>\n options.map(option => ({\n text: this.getOptionValue(option),\n option\n }))\n )\n ),\n { initialValue: [] }\n );\n private readonly typeaheadSearch = typeaheadSearch(\n this.typeaheadOptions,\n this.query,\n computed(() => ({\n matchAllTokens: this.typeaheadMatchAllTokens(),\n disableTokenizing: !this.typeaheadTokenize(),\n skipProcessing: !this.typeaheadProcess(),\n lazy: !(Array.isArray(this.siTypeahead()) || isObservable(this.siTypeahead()))\n }))\n );\n private readonly processedSearch = computed(() => {\n this.selectionCounter(); // This is a workaround for the multi-select which needs to trigger a change detection in the typeahead component.\n const matches = this.typeaheadSearch().map(match => ({\n ...match,\n itemSelected: this.typeaheadMultiSelect()\n ? (match.option as Record<string, any>).selected\n : false,\n iconClass: this.getOptionField(match.option, 'iconClass')\n }));\n\n if (this.typeaheadSkipSortingMatches()) {\n return matches;\n } else {\n return this.matchSorter.sortMatches(matches);\n }\n });\n private readonly unprocessedSearch = computed(() => {\n this.selectionCounter(); // This is a workaround for the multi-select which needs to trigger a change detection in the typeahead component.\n return this.typeaheadOptions().map(option => {\n const itemSelected = this.typeaheadMultiSelect()\n ? (option as Record<string, any>).selected\n : false;\n return {\n option,\n text: option.text,\n result: option.text\n ? [{ text: option.text, isMatching: false, matches: 0, uniqueMatches: 0 }]\n : [],\n itemSelected,\n iconClass: this.getOptionField(option.option, 'iconClass'),\n stringMatch: false,\n atBeginning: false,\n matches: 0,\n uniqueMatches: 0,\n uniqueSeparateMatches: 0,\n matchesEntireQuery: false,\n matchesAllParts: false,\n matchesAllPartsSeparately: false,\n active: false\n };\n });\n });\n\n constructor() {\n effect(() => {\n // The value needs to fulfil the minimum length requirement set.\n const matches = this.foundMatches();\n if (\n this.canBeOpen() &&\n this.query().length >= this.typeaheadMinLength() &&\n // Ensure that we have content to show: matches, create option or loading indicator\n (matches.length ||\n (this.typeaheadCreateOption() && this.query().length) ||\n this.typeaheadLoading())\n ) {\n const escapedQuery = this.escapeRegex(this.query());\n const equalsExp = new RegExp(`^${escapedQuery}$`, 'i');\n const fullMatches = matches.filter(\n match => match.result.length === 1 && equalsExp.test(match.text)\n );\n if (fullMatches.length > 0) {\n this.typeaheadOnFullMatch.emit(fullMatches[0]);\n }\n this.loadComponent();\n } else {\n this.removeComponent();\n }\n });\n }\n\n // Every time the main input changes, detect whether it is async and if it is not make an observable out of the array.\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.siTypeahead) {\n this.sourceSubscription?.unsubscribe();\n this.loadingSubscription?.unsubscribe();\n const typeahead = this.siTypeahead();\n\n if (Array.isArray(typeahead)) {\n // Handle TypeaheadArray\n this.$typeahead.next(typeahead);\n this.typeaheadLoading.set(false);\n } else if (isObservable(typeahead)) {\n // Handle TypeaheadObservable\n this.sourceSubscription = typeahead.subscribe(this.$typeahead);\n this.typeaheadLoading.set(false);\n } else if (typeof typeahead === 'function') {\n // Handle TypeaheadOptionSource\n this.handleTypeaheadOptionSource(typeahead);\n }\n }\n }\n\n // Clear the current input timeout (if set) and remove the component when the focus of the host is lost.\n @HostListener('focusout')\n protected onBlur(): void {\n this.clearTimer();\n this.canBeOpen.set(false);\n }\n\n // Start the input timeout to display the typeahead when the host is focussed or a value is inputted into it.\n @HostListener('focusin', ['$event'])\n @HostListener('input', ['$event'])\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n if (!target) {\n return;\n }\n\n // Get the value or otherwise textContent of the host element now, because later it could be reset.\n const firstValue = target.value || target.textContent;\n this.inputTimer ??= setTimeout(() => {\n this.inputTimer = undefined;\n const value = (target.value || target.textContent) ?? firstValue ?? '';\n this.query.set(value);\n this.typeaheadOnInput.emit(value ?? '');\n this.canBeOpen.set(true);\n }, this.typeaheadWaitMs());\n }\n\n @HostListener('keydown.escape')\n protected onKeydownEscape(): void {\n if (this.typeaheadCloseOnEsc()) {\n this.clearTimer();\n this.canBeOpen.set(false);\n }\n }\n\n ngOnDestroy(): void {\n this.clearTimer();\n this.sourceSubscription?.unsubscribe();\n this.loadingSubscription?.unsubscribe();\n\n this.overlayRef?.dispose();\n }\n\n /**\n * Handles TypeaheadOptionSource by subscribing to query changes and fetching options.\n * Manages loading state automatically or uses custom isLoading() observable if provided.\n */\n private handleTypeaheadOptionSource(source: TypeaheadOptionSource): void {\n this.sourceSubscription = new Subscription();\n const queryObservable = toObservable(this.query, { injector: this.injector });\n const resultObservable = queryObservable.pipe(\n switchMap(query => source(query)),\n // Catch errors by the source observable to prevent endless spinner. Showing the error is not our responsibility.\n catchError(e => {\n console.error(e);\n return [];\n }),\n share()\n );\n\n this.sourceSubscription.add(\n queryObservable\n .pipe(switchMap(() => timer(500).pipe(takeUntil(resultObservable))))\n .subscribe(() => this.typeaheadLoading.set(true))\n );\n\n this.sourceSubscription.add(\n resultObservable.subscribe(result => {\n this.$typeahead.next(result);\n this.typeaheadLoading.set(false);\n })\n );\n }\n\n // Dynamically create the typeahead component and then set the matches and the query.\n private loadComponent(): void {\n if (!this.overlayRef?.hasAttached()) {\n this.overlayRef?.dispose();\n\n const overlayConfig: OverlayConfig = {\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef.nativeElement)\n .withPositions(SiTypeaheadDirective.overlayPositions),\n minWidth: this.typeaheadFullWidth()\n ? this.elementRef.nativeElement.getBoundingClientRect().width + 2 // 2px border\n : 0\n };\n\n const scrollStrategy = this.typeaheadScrollStrategy();\n if (scrollStrategy) {\n overlayConfig.scrollStrategy = scrollStrategy;\n }\n\n this.overlayRef = this.overlay.create(overlayConfig);\n }\n\n if (this.overlayRef.hasAttached()) {\n return;\n }\n const typeaheadPortal = new ComponentPortal(SiTypeaheadComponent, null, this.injector);\n this.componentRef = this.overlayRef.attach(typeaheadPortal);\n this.typeaheadOpenChange.emit(true);\n }\n\n /**\n * Extracts the display value from a typeahead option.\n *\n * For string options, returns the string value directly.\n * For object options, returns the value of the field specified by {@link typeaheadOptionField}\n * (defaults to 'name'), or an empty string if the field doesn't exist.\n *\n * @param option - The typeahead option to extract the value from\n * @returns The string representation of the option for display purposes\n */\n private getOptionValue(option: TypeaheadOption): string {\n return typeof option !== 'object'\n ? option.toString()\n : (option[this.typeaheadOptionField()] ?? '');\n }\n\n /**\n * Extracts a specific field value from a typeahead option.\n *\n * This method is used to access additional properties of object-type options,\n * such as 'selected' for multi-select functionality or 'iconClass' for displaying icons.\n *\n * @param option - The typeahead option to extract the field from\n * @param field - The name of the field to extract\n * @returns The field value as a string if the option is an object and the field exists,\n * otherwise undefined\n */\n private getOptionField(option: TypeaheadOption, field: string): string | undefined {\n return typeof option !== 'object' ? undefined : option[field];\n }\n\n /** @internal */\n createOption(): void {\n this.typeaheadOnCreateOption.emit(this.query());\n this.clearTimer();\n if (!this.typeaheadMultiSelect() && this.typeaheadClearValueOnSelect()) {\n const inputElement =\n this.elementRef.nativeElement.querySelector('input')! ?? this.elementRef.nativeElement;\n inputElement.value = '';\n inputElement.dispatchEvent(new Event('input'));\n }\n this.canBeOpen.set(false);\n }\n\n // Select a match, either gets called due to a enter keypress or from the component due to a click.\n /** @internal */\n selectMatch(match: TypeaheadMatch): void {\n match.itemSelected = !match.itemSelected;\n if (!this.typeaheadMultiSelect()) {\n const inputElement =\n this.elementRef.nativeElement.querySelector('input')! ?? this.elementRef.nativeElement;\n inputElement.value = this.typeaheadClearValueOnSelect() ? '' : match.text;\n inputElement.dispatchEvent(new Event('input'));\n }\n\n // Clear the current input timeout (if set) and remove the typeahead.\n this.clearTimer();\n this.typeaheadOnSelect.emit(match);\n if (!this.typeaheadMultiSelect()) {\n this.canBeOpen.set(false);\n }\n }\n\n // Remove the component by clearing the viewContainerRef\n private removeComponent(): void {\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef?.detach();\n this.typeaheadOpenChange.emit(false);\n }\n\n this.componentRef?.destroy();\n this.componentRef = undefined;\n }\n\n private clearTimer(): void {\n if (this.inputTimer) {\n clearTimeout(this.inputTimer);\n this.inputTimer = undefined;\n }\n }\n\n private escapeRegex(query: string): string {\n return query.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiTypeaheadItemTemplateDirective } from './si-typeahead-item-template.directive';\nimport { SiTypeaheadDirective } from './si-typeahead.directive';\n\n@NgModule({\n imports: [SiTypeaheadDirective, SiTypeaheadItemTemplateDirective],\n exports: [SiTypeaheadDirective, SiTypeaheadItemTemplateDirective]\n})\nexport class SiTypeaheadModule {}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-typeahead.directive';\nexport * from './si-typeahead.model';\nexport * from './si-typeahead.module';\nexport * from './si-typeahead-item-template.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;AAGG;MAQU,gCAAgC,CAAA;AAC3C,IAAA,OAAO,sBAAsB,CAC3B,GAAqC,EACrC,GAAQ,EAAA;AA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