@fluxhub/fluxhub-lib 22.0.1 → 22.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, Inject, forwardRef, ViewChild, Optional, Pipe, HostListener, Directive, ViewEncapsulation, ViewContainerRef, ElementRef, ViewChildren, HostBinding } from '@angular/core';
2
+ import { Injectable, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, ViewChild, Inject, forwardRef, Optional, Pipe, HostListener, Directive, ViewEncapsulation, ViewContainerRef, ElementRef, ViewChildren, HostBinding } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common/http';
4
4
  import { HttpHeaders, HttpEventType, HttpErrorResponse } from '@angular/common/http';
5
5
  import { map, catchError, flatMap, debounceTime, switchMap, filter, take, tap } from 'rxjs/operators';
@@ -2000,6 +2000,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
2000
2000
  type: Output
2001
2001
  }] } });
2002
2002
 
2003
+ /** minuscolo e senza accenti, un carattere per carattere (gli indici restano allineati) */
2004
+ function fold(s) {
2005
+ let r = '';
2006
+ for (const c of s) {
2007
+ const f = c.normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
2008
+ r += f.length === 1 ? f : c.toLowerCase().charAt(0);
2009
+ }
2010
+ return r;
2011
+ }
2003
2012
  /**
2004
2013
  * Dialog di scelta da lista **con ricerca** — il "modo grande" di `FHComboBox`.
2005
2014
  *
@@ -2010,16 +2019,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
2010
2019
  * Non fa query: riceve le voci gia' caricate da `FHComboBox` (che le prende dal suo
2011
2020
  * `sql`/`option_values` come sempre). Ritorna il `valore` scelto, `''` per la voce
2012
2021
  * vuota, `undefined` se si chiude senza scegliere.
2022
+ *
2023
+ * La ricerca ignora maiuscole e accenti e accetta piu' parole (devono esserci tutte,
2024
+ * in qualsiasi ordine). Da tastiera: frecce per muoversi, Invio per scegliere.
2013
2025
  */
2014
2026
  class FHWinSearchListComponent {
2015
2027
  ref;
2016
2028
  data;
2017
2029
  filter = '';
2018
- visible = [];
2030
+ rows = [];
2031
+ /** quante voci vere (esclusa la voce vuota) passano il filtro */
2032
+ matches = 0;
2033
+ /** riga evidenziata da tastiera/mouse: Invio sceglie questa */
2034
+ active = -1;
2035
+ /** altezza della lista all'apertura: filtrando la dialog non si accorcia a scatti */
2036
+ listMinHeight = null;
2037
+ searchInput;
2038
+ list;
2019
2039
  /** un solo pulsante: la scelta chiude la dialog, come nel pannello di una combo */
2020
2040
  buttons = [
2021
2041
  { text: 'ANNULLA', type: 'stroked', returnValue: undefined },
2022
2042
  ];
2043
+ /** descrizioni gia' "piegate" (minuscole, senza accenti), calcolate una volta */
2044
+ folded = [];
2023
2045
  constructor(ref, data) {
2024
2046
  this.ref = ref;
2025
2047
  this.data = data;
@@ -2027,75 +2049,193 @@ class FHWinSearchListComponent {
2027
2049
  this.data = { items: [] };
2028
2050
  if (!this.data.items)
2029
2051
  this.data.items = [];
2030
- this.visible = this.data.items;
2052
+ this.folded = this.data.items.map((v) => fold(v.descrizione_valore || ''));
2053
+ this.applyFilter();
2054
+ // all'apertura la riga attiva e' quella gia' scelta
2055
+ const i = this.rows.findIndex((r) => this.isSelected(r));
2056
+ this.active = i >= 0 ? i : -1;
2057
+ }
2058
+ ngAfterViewInit() {
2059
+ setTimeout(() => {
2060
+ this.searchInput?.nativeElement.focus();
2061
+ const el = this.list?.nativeElement;
2062
+ if (!el)
2063
+ return;
2064
+ // chi scrolla e' il wrapper di DialogBase: si blocca solo la parte visibile della
2065
+ // lista, non tutta (altrimenti filtrando resterebbe una scrollbar su spazio vuoto)
2066
+ const sc = el.parentElement?.parentElement;
2067
+ // (misure di layout, non getBoundingClientRect: la dialog sta ancora animando la scala)
2068
+ if (sc) {
2069
+ const overflow = Math.max(0, sc.scrollHeight - sc.clientHeight);
2070
+ this.listMinHeight = Math.max(0, el.offsetHeight - overflow);
2071
+ }
2072
+ this.scrollToActive('center');
2073
+ });
2074
+ }
2075
+ isSelected(r) {
2076
+ const s = this.data.selected;
2077
+ if (r.empty)
2078
+ return !s || s === '-1';
2079
+ return r.valore === s;
2031
2080
  }
2032
2081
  applyFilter() {
2033
- const f = (this.filter || '').trim().toLowerCase();
2034
- this.visible = !f
2035
- ? this.data.items
2036
- : this.data.items.filter((v) => (v.descrizione_valore || '').toLowerCase().includes(f));
2082
+ const terms = fold((this.filter || '').trim())
2083
+ .split(/\s+/)
2084
+ .filter((t) => t);
2085
+ const rows = [];
2086
+ if (this.data.allowEmpty && !terms.length) {
2087
+ rows.push({
2088
+ valore: '',
2089
+ parts: [{ t: this.data.emptyLabel || '', m: false }],
2090
+ empty: true,
2091
+ });
2092
+ }
2093
+ this.data.items.forEach((v, i) => {
2094
+ const d = v.descrizione_valore || '';
2095
+ const f = this.folded[i];
2096
+ if (!terms.every((t) => f.includes(t)))
2097
+ return;
2098
+ rows.push({ valore: v.valore, parts: this.split(d, f, terms) });
2099
+ });
2100
+ this.rows = rows;
2101
+ this.matches = rows.filter((r) => !r.empty).length;
2102
+ // filtrando, la prima voce che corrisponde e' gia' pronta per Invio
2103
+ this.active = terms.length && rows.length ? 0 : -1;
2104
+ if (this.active === 0)
2105
+ this.scrollToActive('nearest');
2106
+ }
2107
+ /** spezza la descrizione nei tratti che corrispondono ai termini cercati */
2108
+ split(d, f, terms) {
2109
+ if (!terms.length)
2110
+ return [{ t: d, m: false }];
2111
+ const hit = new Array(d.length).fill(false);
2112
+ for (const t of terms) {
2113
+ let p = f.indexOf(t);
2114
+ while (p >= 0) {
2115
+ for (let k = p; k < p + t.length; k++)
2116
+ hit[k] = true;
2117
+ p = f.indexOf(t, p + t.length);
2118
+ }
2119
+ }
2120
+ const parts = [];
2121
+ for (let k = 0; k < d.length; k++) {
2122
+ const last = parts[parts.length - 1];
2123
+ if (last && last.m === hit[k])
2124
+ last.t += d[k];
2125
+ else
2126
+ parts.push({ t: d[k], m: hit[k] });
2127
+ }
2128
+ return parts;
2037
2129
  }
2038
2130
  clearFilter() {
2039
2131
  this.filter = '';
2040
2132
  this.applyFilter();
2133
+ this.searchInput?.nativeElement.focus();
2134
+ }
2135
+ onKey(e) {
2136
+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
2137
+ e.preventDefault();
2138
+ if (!this.rows.length)
2139
+ return;
2140
+ const step = e.key === 'ArrowDown' ? 1 : -1;
2141
+ const n = this.rows.length;
2142
+ this.active = this.active < 0 ? (step > 0 ? 0 : n - 1) : (this.active + step + n) % n;
2143
+ this.scrollToActive('nearest');
2144
+ }
2145
+ else if (e.key === 'Enter') {
2146
+ e.preventDefault();
2147
+ const r = this.rows[this.active];
2148
+ if (r)
2149
+ this.choose(r.valore);
2150
+ }
2151
+ }
2152
+ scrollToActive(block) {
2153
+ setTimeout(() => {
2154
+ const el = this.list?.nativeElement.children[this.active];
2155
+ el?.scrollIntoView({ block });
2156
+ });
2041
2157
  }
2042
2158
  choose(valore) {
2043
2159
  this.ref.close(valore);
2044
2160
  }
2045
2161
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FHWinSearchListComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2046
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: FHWinSearchListComponent, isStandalone: true, selector: "FHWinSearchList", ngImport: i0, template: `
2162
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: FHWinSearchListComponent, isStandalone: true, selector: "FHWinSearchList", viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true }], ngImport: i0, template: `
2047
2163
  <fh-dialog-base
2048
2164
  [title]="data.title || ''"
2049
2165
  [buttons]="buttons"
2050
2166
  [showCloseButton]="true"
2051
2167
  >
2052
2168
  <div dialog-content>
2053
- <div class="fh-sl-search">
2054
- <mat-icon>search</mat-icon>
2055
- <input
2056
- type="text"
2057
- [placeholder]="(data.searchLabel || 'Cerca...') | translate"
2058
- [(ngModel)]="filter"
2059
- (ngModelChange)="applyFilter()"
2060
- autocomplete="off"
2061
- />
2062
- @if (filter) {
2063
- <button type="button" class="fh-sl-clear" (click)="clearFilter()">
2064
- <mat-icon>close</mat-icon>
2065
- </button>
2066
- }
2169
+ <!-- sticky: chi scrolla e' il wrapper di DialogBase, la ricerca deve restare in cima -->
2170
+ <div class="fh-sl-head">
2171
+ <div class="fh-sl-search">
2172
+ <mat-icon>search</mat-icon>
2173
+ <input
2174
+ #searchInput
2175
+ type="text"
2176
+ [placeholder]="(data.searchLabel || 'Cerca...') | translate"
2177
+ [(ngModel)]="filter"
2178
+ (ngModelChange)="applyFilter()"
2179
+ (keydown)="onKey($event)"
2180
+ autocomplete="off"
2181
+ />
2182
+ <!-- contatore dentro la casella: una riga in meno, piu' voci visibili -->
2183
+ <span class="fh-sl-count">
2184
+ @if (filter) {
2185
+ {{ matches }} / {{ data.items.length }}
2186
+ } @else {
2187
+ {{ data.items.length }} {{ 'voci' | translate }}
2188
+ }
2189
+ </span>
2190
+ @if (filter) {
2191
+ <button
2192
+ type="button"
2193
+ class="fh-sl-clear"
2194
+ tabindex="-1"
2195
+ (click)="clearFilter()"
2196
+ >
2197
+ <mat-icon>close</mat-icon>
2198
+ </button>
2199
+ }
2200
+ </div>
2067
2201
  </div>
2068
2202
 
2069
- <div class="fh-sl-list">
2070
- @if (data.allowEmpty && !filter) {
2071
- <button
2072
- type="button"
2073
- class="fh-sl-item fh-sl-item--empty"
2074
- [class.sel]="!data.selected || data.selected === '-1'"
2075
- (click)="choose('')"
2076
- >
2077
- {{ data.emptyLabel || '' }}
2078
- </button>
2079
- }
2080
- @for (v of visible; track v.valore) {
2203
+ <div class="fh-sl-list" #list [style.min-height.px]="listMinHeight">
2204
+ @for (r of rows; track r.valore; let i = $index) {
2081
2205
  <button
2082
2206
  type="button"
2207
+ tabindex="-1"
2083
2208
  class="fh-sl-item"
2084
- [class.sel]="v.valore === data.selected"
2085
- (click)="choose(v.valore)"
2209
+ [class.fh-sl-item--empty]="r.empty"
2210
+ [class.sel]="isSelected(r)"
2211
+ [class.active]="i === active"
2212
+ (mousemove)="active = i"
2213
+ (click)="choose(r.valore)"
2086
2214
  >
2087
- {{ v.descrizione_valore }}
2215
+ <span class="fh-sl-text">
2216
+ @for (p of r.parts; track $index) {
2217
+ @if (p.m) {
2218
+ <mark>{{ p.t }}</mark>
2219
+ } @else {
2220
+ {{ p.t }}
2221
+ }
2222
+ }
2223
+ </span>
2224
+ @if (isSelected(r)) {
2225
+ <mat-icon class="fh-sl-check">check</mat-icon>
2226
+ }
2088
2227
  </button>
2089
2228
  }
2090
- @if (!visible.length) {
2229
+ @if (!matches) {
2091
2230
  <div class="fh-sl-empty">
2231
+ <mat-icon>search_off</mat-icon>
2092
2232
  {{ 'Nessuna voce corrisponde alla ricerca.' | translate }}
2093
2233
  </div>
2094
2234
  }
2095
2235
  </div>
2096
2236
  </div>
2097
2237
  </fh-dialog-base>
2098
- `, isInline: true, styles: [".fh-sl-search{display:flex;align-items:center;gap:6px;border:1px solid #ccc;border-radius:4px;padding:4px 8px;margin-bottom:8px}.fh-sl-search input{flex:1;border:0;outline:0;font-size:14px;background:transparent}.fh-sl-search mat-icon{color:#888;font-size:20px;width:20px;height:20px}.fh-sl-clear{border:0;background:transparent;cursor:pointer;line-height:0;padding:0}.fh-sl-list{display:flex;flex-direction:column}.fh-sl-item{text-align:left;border:0;border-bottom:1px solid #eee;background:transparent;padding:8px 6px;font-size:13px;line-height:1.35;cursor:pointer}.fh-sl-item:hover{background:#0000000a}.fh-sl-item.sel{background:#3f51b51f;font-weight:600}.fh-sl-item--empty{font-style:italic;opacity:.75}.fh-sl-empty{padding:12px 6px;opacity:.7;font-size:13px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: DialogBaseComponent, selector: "fh-dialog-base", inputs: ["title", "buttons", "showCloseButton", "canValidate", "buttonsAlignment"], outputs: ["buttonClick", "beforeClose"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
2238
+ `, isInline: true, styles: [":host{--fh-sl-accent: var(--mat-sys-primary, #3f51b5)}.fh-sl-head{position:sticky;top:-24px;z-index:1;margin:-24px -10px 0;padding:8px 10px;background:var(--mat-sys-surface, #fff);box-shadow:0 6px 6px -6px #0000002e}.fh-sl-search{display:flex;align-items:center;gap:8px;height:40px;border:1px solid rgba(0,0,0,.25);border-radius:8px;padding:0 6px 0 10px;transition:border-color .15s,box-shadow .15s}.fh-sl-search:focus-within{border-color:var(--fh-sl-accent);box-shadow:0 0 0 1px var(--fh-sl-accent)}.fh-sl-search input{flex:1;min-width:0;border:0;outline:0;font:inherit;font-size:14px;background:transparent;color:inherit}.fh-sl-search mat-icon{color:#00000080;font-size:20px;width:20px;height:20px}.fh-sl-search:focus-within>mat-icon{color:var(--fh-sl-accent)}.fh-sl-clear{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:50%;background:transparent;cursor:pointer;padding:0}.fh-sl-clear:hover{background:#0000000f}.fh-sl-count{flex-shrink:0;font-size:12px;color:#00000080;white-space:nowrap}.fh-sl-count:last-child{padding-right:6px}.fh-sl-list{display:flex;flex-direction:column;padding-top:4px;box-sizing:border-box}.fh-sl-item{display:flex;align-items:center;gap:8px;text-align:left;border:0;border-radius:6px;background:transparent;color:inherit;padding:9px 10px;font:inherit;font-size:13px;line-height:1.4;cursor:pointer;scroll-margin-top:90px;scroll-margin-bottom:8px}.fh-sl-item+.fh-sl-item{margin-top:1px}.fh-sl-text{flex:1;min-width:0}.fh-sl-item.active{background:#0000000d}.fh-sl-item.sel{background:color-mix(in srgb,var(--fh-sl-accent) 12%,transparent);font-weight:600}.fh-sl-item.sel.active{background:color-mix(in srgb,var(--fh-sl-accent) 18%,transparent)}.fh-sl-check{flex-shrink:0;color:var(--fh-sl-accent);font-size:20px;width:20px;height:20px}.fh-sl-item--empty{font-style:italic;color:#0009}.fh-sl-item mark{background:color-mix(in srgb,#ffc107 45%,transparent);color:inherit;border-radius:2px}.fh-sl-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:28px 6px;color:#0000008c;font-size:13px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: DialogBaseComponent, selector: "fh-dialog-base", inputs: ["title", "buttons", "showCloseButton", "canValidate", "buttonsAlignment"], outputs: ["buttonClick", "beforeClose"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
2099
2239
  }
2100
2240
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: FHWinSearchListComponent, decorators: [{
2101
2241
  type: Component,
@@ -2113,56 +2253,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
2113
2253
  [showCloseButton]="true"
2114
2254
  >
2115
2255
  <div dialog-content>
2116
- <div class="fh-sl-search">
2117
- <mat-icon>search</mat-icon>
2118
- <input
2119
- type="text"
2120
- [placeholder]="(data.searchLabel || 'Cerca...') | translate"
2121
- [(ngModel)]="filter"
2122
- (ngModelChange)="applyFilter()"
2123
- autocomplete="off"
2124
- />
2125
- @if (filter) {
2126
- <button type="button" class="fh-sl-clear" (click)="clearFilter()">
2127
- <mat-icon>close</mat-icon>
2128
- </button>
2129
- }
2256
+ <!-- sticky: chi scrolla e' il wrapper di DialogBase, la ricerca deve restare in cima -->
2257
+ <div class="fh-sl-head">
2258
+ <div class="fh-sl-search">
2259
+ <mat-icon>search</mat-icon>
2260
+ <input
2261
+ #searchInput
2262
+ type="text"
2263
+ [placeholder]="(data.searchLabel || 'Cerca...') | translate"
2264
+ [(ngModel)]="filter"
2265
+ (ngModelChange)="applyFilter()"
2266
+ (keydown)="onKey($event)"
2267
+ autocomplete="off"
2268
+ />
2269
+ <!-- contatore dentro la casella: una riga in meno, piu' voci visibili -->
2270
+ <span class="fh-sl-count">
2271
+ @if (filter) {
2272
+ {{ matches }} / {{ data.items.length }}
2273
+ } @else {
2274
+ {{ data.items.length }} {{ 'voci' | translate }}
2275
+ }
2276
+ </span>
2277
+ @if (filter) {
2278
+ <button
2279
+ type="button"
2280
+ class="fh-sl-clear"
2281
+ tabindex="-1"
2282
+ (click)="clearFilter()"
2283
+ >
2284
+ <mat-icon>close</mat-icon>
2285
+ </button>
2286
+ }
2287
+ </div>
2130
2288
  </div>
2131
2289
 
2132
- <div class="fh-sl-list">
2133
- @if (data.allowEmpty && !filter) {
2134
- <button
2135
- type="button"
2136
- class="fh-sl-item fh-sl-item--empty"
2137
- [class.sel]="!data.selected || data.selected === '-1'"
2138
- (click)="choose('')"
2139
- >
2140
- {{ data.emptyLabel || '' }}
2141
- </button>
2142
- }
2143
- @for (v of visible; track v.valore) {
2290
+ <div class="fh-sl-list" #list [style.min-height.px]="listMinHeight">
2291
+ @for (r of rows; track r.valore; let i = $index) {
2144
2292
  <button
2145
2293
  type="button"
2294
+ tabindex="-1"
2146
2295
  class="fh-sl-item"
2147
- [class.sel]="v.valore === data.selected"
2148
- (click)="choose(v.valore)"
2296
+ [class.fh-sl-item--empty]="r.empty"
2297
+ [class.sel]="isSelected(r)"
2298
+ [class.active]="i === active"
2299
+ (mousemove)="active = i"
2300
+ (click)="choose(r.valore)"
2149
2301
  >
2150
- {{ v.descrizione_valore }}
2302
+ <span class="fh-sl-text">
2303
+ @for (p of r.parts; track $index) {
2304
+ @if (p.m) {
2305
+ <mark>{{ p.t }}</mark>
2306
+ } @else {
2307
+ {{ p.t }}
2308
+ }
2309
+ }
2310
+ </span>
2311
+ @if (isSelected(r)) {
2312
+ <mat-icon class="fh-sl-check">check</mat-icon>
2313
+ }
2151
2314
  </button>
2152
2315
  }
2153
- @if (!visible.length) {
2316
+ @if (!matches) {
2154
2317
  <div class="fh-sl-empty">
2318
+ <mat-icon>search_off</mat-icon>
2155
2319
  {{ 'Nessuna voce corrisponde alla ricerca.' | translate }}
2156
2320
  </div>
2157
2321
  }
2158
2322
  </div>
2159
2323
  </div>
2160
2324
  </fh-dialog-base>
2161
- `, changeDetection: ChangeDetectionStrategy.Eager, styles: [".fh-sl-search{display:flex;align-items:center;gap:6px;border:1px solid #ccc;border-radius:4px;padding:4px 8px;margin-bottom:8px}.fh-sl-search input{flex:1;border:0;outline:0;font-size:14px;background:transparent}.fh-sl-search mat-icon{color:#888;font-size:20px;width:20px;height:20px}.fh-sl-clear{border:0;background:transparent;cursor:pointer;line-height:0;padding:0}.fh-sl-list{display:flex;flex-direction:column}.fh-sl-item{text-align:left;border:0;border-bottom:1px solid #eee;background:transparent;padding:8px 6px;font-size:13px;line-height:1.35;cursor:pointer}.fh-sl-item:hover{background:#0000000a}.fh-sl-item.sel{background:#3f51b51f;font-weight:600}.fh-sl-item--empty{font-style:italic;opacity:.75}.fh-sl-empty{padding:12px 6px;opacity:.7;font-size:13px}\n"] }]
2325
+ `, changeDetection: ChangeDetectionStrategy.Eager, styles: [":host{--fh-sl-accent: var(--mat-sys-primary, #3f51b5)}.fh-sl-head{position:sticky;top:-24px;z-index:1;margin:-24px -10px 0;padding:8px 10px;background:var(--mat-sys-surface, #fff);box-shadow:0 6px 6px -6px #0000002e}.fh-sl-search{display:flex;align-items:center;gap:8px;height:40px;border:1px solid rgba(0,0,0,.25);border-radius:8px;padding:0 6px 0 10px;transition:border-color .15s,box-shadow .15s}.fh-sl-search:focus-within{border-color:var(--fh-sl-accent);box-shadow:0 0 0 1px var(--fh-sl-accent)}.fh-sl-search input{flex:1;min-width:0;border:0;outline:0;font:inherit;font-size:14px;background:transparent;color:inherit}.fh-sl-search mat-icon{color:#00000080;font-size:20px;width:20px;height:20px}.fh-sl-search:focus-within>mat-icon{color:var(--fh-sl-accent)}.fh-sl-clear{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:50%;background:transparent;cursor:pointer;padding:0}.fh-sl-clear:hover{background:#0000000f}.fh-sl-count{flex-shrink:0;font-size:12px;color:#00000080;white-space:nowrap}.fh-sl-count:last-child{padding-right:6px}.fh-sl-list{display:flex;flex-direction:column;padding-top:4px;box-sizing:border-box}.fh-sl-item{display:flex;align-items:center;gap:8px;text-align:left;border:0;border-radius:6px;background:transparent;color:inherit;padding:9px 10px;font:inherit;font-size:13px;line-height:1.4;cursor:pointer;scroll-margin-top:90px;scroll-margin-bottom:8px}.fh-sl-item+.fh-sl-item{margin-top:1px}.fh-sl-text{flex:1;min-width:0}.fh-sl-item.active{background:#0000000d}.fh-sl-item.sel{background:color-mix(in srgb,var(--fh-sl-accent) 12%,transparent);font-weight:600}.fh-sl-item.sel.active{background:color-mix(in srgb,var(--fh-sl-accent) 18%,transparent)}.fh-sl-check{flex-shrink:0;color:var(--fh-sl-accent);font-size:20px;width:20px;height:20px}.fh-sl-item--empty{font-style:italic;color:#0009}.fh-sl-item mark{background:color-mix(in srgb,#ffc107 45%,transparent);color:inherit;border-radius:2px}.fh-sl-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:28px 6px;color:#0000008c;font-size:13px}\n"] }]
2162
2326
  }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
2163
2327
  type: Inject,
2164
2328
  args: [MAT_DIALOG_DATA]
2165
- }] }] });
2329
+ }] }], propDecorators: { searchInput: [{
2330
+ type: ViewChild,
2331
+ args: ['searchInput']
2332
+ }], list: [{
2333
+ type: ViewChild,
2334
+ args: ['list']
2335
+ }] } });
2166
2336
 
2167
2337
  class OdbcService {
2168
2338
  http;