@zambon-dev/ui 1.5.0 → 1.6.1

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,11 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, ContentChildren, Directive, ElementRef, EventEmitter, HostListener, Injectable, InjectionToken, Input, KeyValueDiffers, NgModule, NgZone, Output, Pipe, TemplateRef, ViewChild, ViewContainerRef, computed, contentChildren, inject, input, model, output, signal, viewChild } from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ContentChildren, DestroyRef, Directive, ElementRef, EventEmitter, HostListener, Injectable, InjectionToken, Injector, Input, KeyValueDiffers, LOCALE_ID, NgModule, NgZone, Output, Pipe, Renderer2, TemplateRef, ViewChild, ViewContainerRef, afterNextRender, computed, contentChildren, effect, forwardRef, inject, input, linkedSignal, model, output, signal, viewChild } from "@angular/core";
3
3
  import { Observable, ReplaySubject, Subject, debounceTime, delay, filter, forkJoin, fromEvent, map, merge, of, pairwise, startWith, switchMap, take, takeUntil, tap, throwError } from "rxjs";
4
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
5
+ import { TranslatePipe, TranslateService } from "@ngx-translate/core";
4
6
  import { Overlay, OverlayPositionBuilder } from "@angular/cdk/overlay";
5
- import { TemplatePortal } from "@angular/cdk/portal";
7
+ import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
6
8
  import * as i2$1 from "@angular/forms";
7
- import { ControlContainer, FormArray, FormControl, FormGroup, FormGroupDirective, FormGroupName, FormsModule, ReactiveFormsModule } from "@angular/forms";
8
- import { TranslatePipe, TranslateService } from "@ngx-translate/core";
9
+ import { ControlContainer, FormArray, FormControl, FormGroup, FormGroupDirective, FormGroupName, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from "@angular/forms";
9
10
  import { HttpClient } from "@angular/common/http";
10
11
  import { ActivatedRoute, NavigationEnd, NavigationStart, Router } from "@angular/router";
11
12
  import * as i1$1 from "@angular/common";
@@ -14,6 +15,104 @@ import * as i1 from "@angular/cdk/scrolling";
14
15
  import { CdkVirtualScrollViewport, ScrollingModule } from "@angular/cdk/scrolling";
15
16
  import * as i2 from "ngx-resize-observer";
16
17
  import { NgxResizeObserverModule } from "ngx-resize-observer";
18
+ var BadgeComponent = class BadgeComponent {
19
+ intent = input("neutral", ...ngDevMode ? [{ debugName: "intent" }] : /* istanbul ignore next */ []);
20
+ icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
21
+ dot = input(false, ...ngDevMode ? [{ debugName: "dot" }] : /* istanbul ignore next */ []);
22
+ static ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.0",
25
+ ngImport: i0,
26
+ type: BadgeComponent,
27
+ deps: [],
28
+ target: i0.ɵɵFactoryTarget.Component
29
+ });
30
+ static ɵcmp = i0.ɵɵngDeclareComponent({
31
+ minVersion: "17.0.0",
32
+ version: "22.2.0",
33
+ type: BadgeComponent,
34
+ isStandalone: true,
35
+ selector: "lib-badge",
36
+ inputs: {
37
+ intent: {
38
+ classPropertyName: "intent",
39
+ publicName: "intent",
40
+ isSignal: true,
41
+ isRequired: false,
42
+ transformFunction: null
43
+ },
44
+ icon: {
45
+ classPropertyName: "icon",
46
+ publicName: "icon",
47
+ isSignal: true,
48
+ isRequired: false,
49
+ transformFunction: null
50
+ },
51
+ dot: {
52
+ classPropertyName: "dot",
53
+ publicName: "dot",
54
+ isSignal: true,
55
+ isRequired: false,
56
+ transformFunction: null
57
+ }
58
+ },
59
+ host: {
60
+ properties: {
61
+ "class": "'intent-' + intent()",
62
+ "class.has-dot": "dot()"
63
+ },
64
+ classAttribute: "lib-badge"
65
+ },
66
+ ngImport: i0,
67
+ template: "@if (dot()) {\n <span class=\"lib-badge-dot\" aria-hidden=\"true\"></span>\n}\n@if (icon()) {\n <i class=\"lib-badge-icon\" [class]=\"icon()\" aria-hidden=\"true\"></i>\n}\n<span class=\"lib-badge-label\"><ng-content></ng-content></span>\n",
68
+ styles: ["@layer properties;:host{display:inline-flex;max-width:100%;align-items:center;gap:var(--spacing, .25rem);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * .5);vertical-align:middle;white-space:nowrap;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:1px;font-size:var(--text-caption);font-weight:var(--font-weight-ui);line-height:1rem;background-color:var(--lib-badge-role);border-color:var(--lib-badge-role);color:var(--lib-badge-role)}@supports (color: color-mix(in lab,red,red)){:host{background-color:color-mix(in srgb,var(--lib-badge-role) 14%,transparent)}}@supports (color: color-mix(in lab,red,red)){:host{border-color:color-mix(in srgb,var(--lib-badge-role) 30%,transparent)}}@supports (color: color-mix(in lab,red,red)){:host{color:color-mix(in srgb,var(--lib-badge-role) 60%,var(--color-content-primary))}}:host(.intent-neutral){background-color:var(--color-surface-inset);border-color:var(--color-line);color:var(--color-content-secondary)}:host(.intent-success){--lib-badge-role: var(--color-success)}:host(.intent-warning){--lib-badge-role: var(--color-warning)}:host(.intent-danger){--lib-badge-role: var(--color-danger)}:host(.intent-info){--lib-badge-role: var(--color-info)}:host(.intent-accent){--lib-badge-role: var(--color-accent)}.lib-badge-label{overflow:hidden;text-overflow:ellipsis}.lib-badge-dot{display:inline-block;height:calc(var(--spacing, .25rem) * 1.5);width:calc(var(--spacing, .25rem) * 1.5);flex-shrink:0;border-radius:calc(infinity * 1px);background-color:var(--lib-badge-role, var(--color-content-subtle))}.lib-badge-icon{flex-shrink:0;font-size:.875em}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
69
+ });
70
+ };
71
+ i0.ɵɵngDeclareClassMetadata({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.0",
74
+ ngImport: i0,
75
+ type: BadgeComponent,
76
+ decorators: [{
77
+ type: Component,
78
+ args: [{
79
+ selector: "lib-badge",
80
+ host: {
81
+ class: "lib-badge",
82
+ "[class]": "'intent-' + intent()",
83
+ "[class.has-dot]": "dot()"
84
+ },
85
+ template: "@if (dot()) {\n <span class=\"lib-badge-dot\" aria-hidden=\"true\"></span>\n}\n@if (icon()) {\n <i class=\"lib-badge-icon\" [class]=\"icon()\" aria-hidden=\"true\"></i>\n}\n<span class=\"lib-badge-label\"><ng-content></ng-content></span>\n",
86
+ styles: ["@layer properties;:host{display:inline-flex;max-width:100%;align-items:center;gap:var(--spacing, .25rem);padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:calc(var(--spacing, .25rem) * .5);vertical-align:middle;white-space:nowrap;border-radius:calc(infinity * 1px);border-style:var(--tw-border-style);border-width:1px;font-size:var(--text-caption);font-weight:var(--font-weight-ui);line-height:1rem;background-color:var(--lib-badge-role);border-color:var(--lib-badge-role);color:var(--lib-badge-role)}@supports (color: color-mix(in lab,red,red)){:host{background-color:color-mix(in srgb,var(--lib-badge-role) 14%,transparent)}}@supports (color: color-mix(in lab,red,red)){:host{border-color:color-mix(in srgb,var(--lib-badge-role) 30%,transparent)}}@supports (color: color-mix(in lab,red,red)){:host{color:color-mix(in srgb,var(--lib-badge-role) 60%,var(--color-content-primary))}}:host(.intent-neutral){background-color:var(--color-surface-inset);border-color:var(--color-line);color:var(--color-content-secondary)}:host(.intent-success){--lib-badge-role: var(--color-success)}:host(.intent-warning){--lib-badge-role: var(--color-warning)}:host(.intent-danger){--lib-badge-role: var(--color-danger)}:host(.intent-info){--lib-badge-role: var(--color-info)}:host(.intent-accent){--lib-badge-role: var(--color-accent)}.lib-badge-label{overflow:hidden;text-overflow:ellipsis}.lib-badge-dot{display:inline-block;height:calc(var(--spacing, .25rem) * 1.5);width:calc(var(--spacing, .25rem) * 1.5);flex-shrink:0;border-radius:calc(infinity * 1px);background-color:var(--lib-badge-role, var(--color-content-subtle))}.lib-badge-icon{flex-shrink:0;font-size:.875em}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
87
+ }]
88
+ }],
89
+ propDecorators: {
90
+ intent: [{
91
+ type: i0.Input,
92
+ args: [{
93
+ isSignal: true,
94
+ alias: "intent",
95
+ required: false
96
+ }]
97
+ }],
98
+ icon: [{
99
+ type: i0.Input,
100
+ args: [{
101
+ isSignal: true,
102
+ alias: "icon",
103
+ required: false
104
+ }]
105
+ }],
106
+ dot: [{
107
+ type: i0.Input,
108
+ args: [{
109
+ isSignal: true,
110
+ alias: "dot",
111
+ required: false
112
+ }]
113
+ }]
114
+ }
115
+ });
17
116
  var BaseComponent = class BaseComponent {
18
117
  destroy$ = new Subject();
19
118
  ngOnDestroy() {
@@ -218,57 +317,211 @@ i0.ɵɵngDeclareClassMetadata({
218
317
  }]
219
318
  }
220
319
  });
221
- var DateHelpers = class {
222
- static diffDays(initialDate, finalDate) {
223
- const initialDateOnly = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());
224
- const finalDateOnly = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());
225
- const diff = initialDateOnly.getTime() - finalDateOnly.getTime();
226
- return Math.floor(diff / 864e5);
227
- }
228
- };
229
- var DisplayControls = class DisplayControls {
230
- static marked = /* @__PURE__ */ new WeakSet();
231
- static isDisplayControl(control) {
232
- return !!control && DisplayControls.marked.has(control);
233
- }
234
- static markAsDisplayControl(control) {
235
- if (control) DisplayControls.marked.add(control);
320
+ const SUNDAY_FIRST_REGIONS = /* @__PURE__ */ new Set([
321
+ "BR",
322
+ "CA",
323
+ "HK",
324
+ "IL",
325
+ "IN",
326
+ "JP",
327
+ "KR",
328
+ "MX",
329
+ "PH",
330
+ "PT",
331
+ "TW",
332
+ "US",
333
+ "ZA"
334
+ ]);
335
+ const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
336
+ const ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?$/;
337
+ function isValidLocale(locale) {
338
+ if (typeof locale !== "string" || locale.trim() === "") return false;
339
+ try {
340
+ return Intl.getCanonicalLocales(locale).length > 0;
341
+ } catch {
342
+ return false;
236
343
  }
237
- };
238
- var GuidHelper = class {
239
- static generateGUID() {
240
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
241
- const r = Math.random() * 16 | 0;
242
- return (c === "x" ? r : r & 3 | 8).toString(16);
243
- });
344
+ }
345
+ function getDatePattern(locale) {
346
+ const parts = new Intl.DateTimeFormat(locale, {
347
+ day: "2-digit",
348
+ month: "2-digit",
349
+ year: "numeric"
350
+ }).formatToParts(new Date(2001, 10, 22));
351
+ return {
352
+ order: parts.map((part) => part.type).filter((type) => type === "day" || type === "month" || type === "year"),
353
+ separator: parts.find((part) => part.type === "literal")?.value.trim() || "/"
354
+ };
355
+ }
356
+ function formatDateText(date, locale) {
357
+ const { order, separator } = getDatePattern(locale);
358
+ const values = {
359
+ day: String(date.getDate()).padStart(2, "0"),
360
+ month: String(date.getMonth() + 1).padStart(2, "0"),
361
+ year: String(date.getFullYear()).padStart(4, "0")
362
+ };
363
+ return order.map((part) => values[part]).join(separator);
364
+ }
365
+ function parseDateText(text, locale) {
366
+ const trimmed = text.trim();
367
+ if (trimmed === "") return null;
368
+ const iso = trimmed.match(ISO_DATE);
369
+ if (iso) return buildDate(Number(iso[1]), Number(iso[2]), Number(iso[3]));
370
+ const { order } = getDatePattern(locale);
371
+ let pieces = trimmed.split(/\D+/).filter((piece) => piece !== "");
372
+ if (pieces.length === 1 && (pieces[0].length === 8 || pieces[0].length === 6)) {
373
+ const digits = pieces[0];
374
+ const yearLength = digits.length === 8 ? 4 : 2;
375
+ pieces = [];
376
+ let index = 0;
377
+ for (const part of order) {
378
+ const length = part === "year" ? yearLength : 2;
379
+ pieces.push(digits.slice(index, index + length));
380
+ index += length;
381
+ }
244
382
  }
245
- };
246
- var RouterFormatter = class {
247
- static getURL(route) {
248
- let parentRoute = "";
249
- if (route.parent) parentRoute = this.getURL(route.parent);
250
- let path = route.routeConfig?.path ?? "";
251
- route.paramMap.keys.forEach((k) => {
252
- path = path.replace(":" + k, k === "view" ? "" : route.paramMap.get(k) ?? "");
253
- });
254
- if (!route.parent || parentRoute !== "" && parentRoute !== "/" && route.routeConfig?.path && path) parentRoute += "/";
255
- return parentRoute + path;
383
+ if (pieces.length !== 3) return null;
384
+ const values = {};
385
+ order.forEach((part, index) => values[part] = pieces[index]);
386
+ const yearText = values.year ?? "";
387
+ if (yearText.length !== 2 && yearText.length !== 4) return null;
388
+ return buildDate(yearText.length === 2 ? 2e3 + Number(yearText) : Number(yearText), Number(values.month), Number(values.day));
389
+ }
390
+ function uses12HourClock(locale) {
391
+ const hourCycle = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;
392
+ return hourCycle === "h11" || hourCycle === "h12";
393
+ }
394
+ function formatTimeText(date, locale) {
395
+ return new Intl.DateTimeFormat(locale, {
396
+ hour: "2-digit",
397
+ minute: "2-digit"
398
+ }).format(date);
399
+ }
400
+ function parseTimeText(text) {
401
+ const match = text.trim().toLowerCase().replace(/[\u00a0\u202f]/g, " ").match(/^(\d{1,2})(?:[:.h]?(\d{2}))?\s*(?:([ap])\.?\s*m?\.?)?$/);
402
+ if (!match) return null;
403
+ let hours = Number(match[1]);
404
+ const minutes = match[2] ? Number(match[2]) : 0;
405
+ const meridiem = match[3];
406
+ if (minutes > 59) return null;
407
+ if (meridiem) {
408
+ if (hours < 1 || hours > 12) return null;
409
+ hours = hours % 12 + (meridiem === "p" ? 12 : 0);
410
+ } else if (hours > 23) return null;
411
+ return {
412
+ hours,
413
+ minutes
414
+ };
415
+ }
416
+ function toIsoDate(date) {
417
+ return [
418
+ String(date.getFullYear()).padStart(4, "0"),
419
+ String(date.getMonth() + 1).padStart(2, "0"),
420
+ String(date.getDate()).padStart(2, "0")
421
+ ].join("-");
422
+ }
423
+ function toIsoDateTime(date) {
424
+ return `${toIsoDate(date)}T${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
425
+ }
426
+ function parseIsoValue(value) {
427
+ if (value === null || value === void 0 || value === "") return null;
428
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : new Date(value.getTime());
429
+ if (typeof value !== "string") return null;
430
+ const date = value.match(ISO_DATE);
431
+ if (date) return buildDate(Number(date[1]), Number(date[2]), Number(date[3]));
432
+ const dateTime = value.match(ISO_DATE_TIME);
433
+ if (dateTime) {
434
+ const result = buildDate(Number(dateTime[1]), Number(dateTime[2]), Number(dateTime[3]));
435
+ result?.setHours(Number(dateTime[4]), Number(dateTime[5]), Number(dateTime[6] ?? 0), 0);
436
+ return result;
437
+ }
438
+ const parsed = new Date(value);
439
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
440
+ }
441
+ function getFirstDayOfWeek(locale) {
442
+ try {
443
+ const intlLocale = new Intl.Locale(locale);
444
+ const firstDay = intlLocale.getWeekInfo?.().firstDay ?? intlLocale.weekInfo?.firstDay;
445
+ if (firstDay !== void 0) return firstDay % 7;
446
+ const region = intlLocale.maximize().region;
447
+ return region && SUNDAY_FIRST_REGIONS.has(region) ? 0 : 1;
448
+ } catch {
449
+ return 0;
256
450
  }
257
- };
258
- var CatalogService = class CatalogService {
259
- http = inject(HttpClient);
260
- search(endpoint, maxResults, criteria, filters = null) {
261
- return this.http.post(`${endpoint}`, {
262
- maxResults,
263
- criteria,
264
- filters
265
- });
451
+ }
452
+ function getNumberSeparators(locale) {
453
+ const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);
454
+ return {
455
+ decimal: parts.find((part) => part.type === "decimal")?.value ?? ".",
456
+ group: parts.find((part) => part.type === "group")?.value ?? ","
457
+ };
458
+ }
459
+ function formatLocaleNumber(value, locale, options = {}) {
460
+ const minimumFractionDigits = options.minFractionDigits ?? 0;
461
+ return new Intl.NumberFormat(locale, {
462
+ minimumFractionDigits,
463
+ maximumFractionDigits: Math.max(options.maxFractionDigits ?? 3, minimumFractionDigits),
464
+ useGrouping: options.grouping ?? true
465
+ }).format(value);
466
+ }
467
+ function parseLocaleNumber(text, locale) {
468
+ const { decimal, group } = getNumberSeparators(locale);
469
+ let normalized = text.replace(/[\s\u00a0\u202f]/g, "");
470
+ if (normalized === "") return null;
471
+ if (group.trim() !== "" && normalized.includes(group)) {
472
+ const groups = normalized.split(decimal)[0].replace(/^[-\u2212]/, "").split(group);
473
+ if (!(/^\d{1,3}$/.test(groups[0]) && groups.slice(1).every((piece) => /^\d{3}$/.test(piece)))) return NaN;
474
+ normalized = normalized.split(group).join("");
475
+ }
476
+ if (decimal !== ".") {
477
+ if (normalized.includes(".")) return NaN;
478
+ normalized = normalized.replace(decimal, ".");
479
+ }
480
+ normalized = normalized.replace(/^\u2212/, "-");
481
+ return /^-?(\d+\.?\d*|\.\d+)$/.test(normalized) ? Number(normalized) : NaN;
482
+ }
483
+ function parseDigitsInfo(digitsInfo) {
484
+ const match = digitsInfo?.match(/^(\d+)?\.(\d+)?(?:-(\d+))?$/);
485
+ if (!match) return;
486
+ const minFractionDigits = match[2] !== void 0 ? Number(match[2]) : 0;
487
+ const maxFractionDigits = match[3] !== void 0 ? Number(match[3]) : Math.max(minFractionDigits, 3);
488
+ return {
489
+ minFractionDigits,
490
+ maxFractionDigits: Math.max(minFractionDigits, maxFractionDigits)
491
+ };
492
+ }
493
+ function buildDate(year, month, day) {
494
+ if (!Number.isInteger(year) || month < 1 || month > 12 || day < 1 || day > 31) return null;
495
+ const date = new Date(year, month - 1, day);
496
+ date.setFullYear(year);
497
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) return null;
498
+ return date;
499
+ }
500
+ var LocaleService = class LocaleService {
501
+ fallbackLocale = inject(LOCALE_ID);
502
+ translate = inject(TranslateService, { optional: true });
503
+ languageChanged = signal(0, ...ngDevMode ? [{ debugName: "languageChanged" }] : /* istanbul ignore next */ []);
504
+ locale = computed(() => {
505
+ this.languageChanged();
506
+ return this.resolveLocale();
507
+ }, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
508
+ constructor() {
509
+ if (this.translate) merge(this.translate.onLangChange, this.translate.onTranslationChange, this.translate.onDefaultLangChange).pipe(takeUntilDestroyed()).subscribe(() => this.languageChanged.update((count) => count + 1));
510
+ }
511
+ resolveLocale() {
512
+ if (this.translate) {
513
+ const fromKey = this.translate.currentLang ? this.translate.instant("locale") : void 0;
514
+ if (fromKey !== "locale" && isValidLocale(fromKey)) return fromKey;
515
+ const language = this.translate.currentLang || this.translate.defaultLang;
516
+ if (isValidLocale(language)) return language;
517
+ }
518
+ return this.fallbackLocale;
266
519
  }
267
520
  static ɵfac = i0.ɵɵngDeclareFactory({
268
521
  minVersion: "12.0.0",
269
522
  version: "22.2.0",
270
523
  ngImport: i0,
271
- type: CatalogService,
524
+ type: LocaleService,
272
525
  deps: [],
273
526
  target: i0.ɵɵFactoryTarget.Injectable
274
527
  });
@@ -276,7 +529,7 @@ var CatalogService = class CatalogService {
276
529
  minVersion: "12.0.0",
277
530
  version: "22.2.0",
278
531
  ngImport: i0,
279
- type: CatalogService,
532
+ type: LocaleService,
280
533
  providedIn: "root"
281
534
  });
282
535
  };
@@ -284,99 +537,482 @@ i0.ɵɵngDeclareClassMetadata({
284
537
  minVersion: "12.0.0",
285
538
  version: "22.2.0",
286
539
  ngImport: i0,
287
- type: CatalogService,
540
+ type: LocaleService,
288
541
  decorators: [{
289
542
  type: Injectable,
290
543
  args: [{ providedIn: "root" }]
291
- }]
544
+ }],
545
+ ctorParameters: () => []
292
546
  });
293
- var DataProviderService = class DataProviderService {
294
- activatedRoute = inject(ActivatedRoute);
295
- destroy$ = new Subject();
296
- shouldLazyLoad = false;
297
- _entityID = signal(void 0, ...ngDevMode ? [{ debugName: "_entityID" }] : /* istanbul ignore next */ []);
298
- errorSubject = new Subject();
299
- isLoading = false;
300
- isModelLoaded = false;
301
- modelCache = new ReplaySubject(1);
302
- get entityID() {
303
- return this._entityID();
304
- }
305
- get hasEntityID() {
306
- return !!this.entityID;
307
- }
308
- constructor() {
309
- this.activatedRoute.paramMap.pipe(take(1)).subscribe((paramMap) => {
310
- const newID = Number(paramMap.get("id"));
311
- if (newID !== this.entityID) {
312
- this._entityID.set(newID);
313
- queueMicrotask(() => {
314
- if (!this.shouldLazyLoad) this.refreshModel();
547
+ var CalendarComponent = class CalendarComponent {
548
+ selected = input(...ngDevMode ? [void 0, { debugName: "selected" }] : /* istanbul ignore next */ []);
549
+ min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
550
+ max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
551
+ locale = input(...ngDevMode ? [void 0, { debugName: "locale" }] : /* istanbul ignore next */ []);
552
+ dateSelected = output();
553
+ cancelled = output();
554
+ injector = inject(Injector);
555
+ localeService = inject(LocaleService);
556
+ grid = viewChild("grid", ...ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []);
557
+ currentLocale = computed(() => this.locale() || this.localeService.locale(), ...ngDevMode ? [{ debugName: "currentLocale" }] : /* istanbul ignore next */ []);
558
+ selectedDate = computed(() => startOfDay(parseIsoValue(this.selected())), ...ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []);
559
+ minDate = computed(() => startOfDay(parseIsoValue(this.min())), ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
560
+ maxDate = computed(() => startOfDay(parseIsoValue(this.max())), ...ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []);
561
+ activeDate = linkedSignal(() => this.clamp(this.selectedDate() ?? today()), ...ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []);
562
+ monthLabel = computed(() => this.monthName(this.activeDate()), ...ngDevMode ? [{ debugName: "monthLabel" }] : /* istanbul ignore next */ []);
563
+ previousMonthLabel = computed(() => this.monthName(this.monthStart(-1)), ...ngDevMode ? [{ debugName: "previousMonthLabel" }] : /* istanbul ignore next */ []);
564
+ nextMonthLabel = computed(() => this.monthName(this.monthStart(1)), ...ngDevMode ? [{ debugName: "nextMonthLabel" }] : /* istanbul ignore next */ []);
565
+ todayLabel = computed(() => {
566
+ const text = new Intl.RelativeTimeFormat(this.currentLocale(), { numeric: "auto" }).format(0, "day");
567
+ return text.charAt(0).toLocaleUpperCase(this.currentLocale()) + text.slice(1);
568
+ }, ...ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []);
569
+ isTodayDisabled = computed(() => this.isDisabled(today()), ...ngDevMode ? [{ debugName: "isTodayDisabled" }] : /* istanbul ignore next */ []);
570
+ isPreviousDisabled = computed(() => {
571
+ const min = this.minDate();
572
+ return !!min && endOfMonth(this.monthStart(-1)) < min;
573
+ }, ...ngDevMode ? [{ debugName: "isPreviousDisabled" }] : /* istanbul ignore next */ []);
574
+ isNextDisabled = computed(() => {
575
+ const max = this.maxDate();
576
+ return !!max && this.monthStart(1) > max;
577
+ }, ...ngDevMode ? [{ debugName: "isNextDisabled" }] : /* istanbul ignore next */ []);
578
+ weekdays = computed(() => {
579
+ const locale = this.currentLocale();
580
+ const firstDay = getFirstDayOfWeek(locale);
581
+ const short = new Intl.DateTimeFormat(locale, { weekday: "narrow" });
582
+ const long = new Intl.DateTimeFormat(locale, { weekday: "long" });
583
+ return Array.from({ length: 7 }, (_, index) => {
584
+ const day = new Date(1970, 0, 4 + (firstDay + index) % 7);
585
+ return {
586
+ short: short.format(day),
587
+ long: long.format(day)
588
+ };
589
+ });
590
+ }, ...ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []);
591
+ weeks = computed(() => {
592
+ const locale = this.currentLocale();
593
+ const active = this.activeDate();
594
+ const selected = this.selectedDate();
595
+ const now = today();
596
+ const firstDay = getFirstDayOfWeek(locale);
597
+ const fullFormat = new Intl.DateTimeFormat(locale, { dateStyle: "full" });
598
+ const offset = (new Date(active.getFullYear(), active.getMonth(), 1).getDay() - firstDay + 7) % 7;
599
+ const weeks = [];
600
+ for (let week = 0; week < 6; week++) {
601
+ const days = [];
602
+ for (let weekday = 0; weekday < 7; weekday++) {
603
+ const date = new Date(active.getFullYear(), active.getMonth(), 1 - offset + week * 7 + weekday);
604
+ days.push({
605
+ date,
606
+ key: date.toDateString(),
607
+ label: String(date.getDate()),
608
+ fullLabel: fullFormat.format(date),
609
+ isOutsideMonth: date.getMonth() !== active.getMonth(),
610
+ isToday: isSameDay(date, now),
611
+ isSelected: !!selected && isSameDay(date, selected),
612
+ isActive: isSameDay(date, active),
613
+ isDisabled: this.isDisabled(date)
315
614
  });
316
615
  }
317
- });
616
+ weeks.push(days);
617
+ }
618
+ return weeks;
619
+ }, ...ngDevMode ? [{ debugName: "weeks" }] : /* istanbul ignore next */ []);
620
+ onDayClick(day) {
621
+ if (!day.isDisabled) {
622
+ this.activeDate.set(day.date);
623
+ this.dateSelected.emit(day.date);
624
+ }
318
625
  }
319
- ngOnDestroy() {
320
- this.destroy$.next(true);
321
- this.destroy$.complete();
626
+ onKeydown(event) {
627
+ const active = this.activeDate();
628
+ const weekdayIndex = (active.getDay() - getFirstDayOfWeek(this.currentLocale()) + 7) % 7;
629
+ let next;
630
+ switch (event.key) {
631
+ case "ArrowLeft":
632
+ next = addDays(active, -1);
633
+ break;
634
+ case "ArrowRight":
635
+ next = addDays(active, 1);
636
+ break;
637
+ case "ArrowUp":
638
+ next = addDays(active, -7);
639
+ break;
640
+ case "ArrowDown":
641
+ next = addDays(active, 7);
642
+ break;
643
+ case "Home":
644
+ next = addDays(active, -weekdayIndex);
645
+ break;
646
+ case "End":
647
+ next = addDays(active, 6 - weekdayIndex);
648
+ break;
649
+ case "PageUp":
650
+ next = addMonthsKeepingDay(active, event.shiftKey ? -12 : -1);
651
+ break;
652
+ case "PageDown":
653
+ next = addMonthsKeepingDay(active, event.shiftKey ? 12 : 1);
654
+ break;
655
+ case "Enter":
656
+ case " ":
657
+ event.preventDefault();
658
+ if (!this.isDisabled(active)) this.dateSelected.emit(active);
659
+ return;
660
+ case "Escape":
661
+ event.preventDefault();
662
+ event.stopPropagation();
663
+ this.cancelled.emit();
664
+ return;
665
+ default: return;
666
+ }
667
+ event.preventDefault();
668
+ this.activeDate.set(this.clamp(next));
669
+ this.focusActiveDay();
322
670
  }
323
- getError$() {
324
- return this.errorSubject.asObservable();
671
+ onPreviousMonth() {
672
+ this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), -1)));
325
673
  }
326
- getModel$() {
327
- if (!this.isModelLoaded && !this.shouldLazyLoad) this.refreshModel();
328
- return this.modelCache.asObservable();
674
+ onNextMonth() {
675
+ this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), 1)));
329
676
  }
330
- refreshModel() {
331
- if (this.isLoading) return;
332
- this.isLoading = true;
333
- this.loadModel(this.entityID).pipe(take(1)).subscribe({
334
- next: (model) => {
335
- this.isLoading = false;
336
- this.updateModel(model);
337
- },
338
- error: (error) => {
339
- this.isLoading = false;
340
- this.isModelLoaded = true;
341
- this.modelCache.next(null);
342
- this.errorSubject.next(error);
343
- }
344
- });
677
+ onToday() {
678
+ const now = today();
679
+ if (!this.isDisabled(now)) {
680
+ this.activeDate.set(now);
681
+ this.dateSelected.emit(now);
682
+ }
345
683
  }
346
- resetForNewEntity() {
347
- this._entityID.set(void 0);
348
- this.isModelLoaded = false;
349
- this.modelCache.next(null);
684
+ onEscape(event) {
685
+ event.preventDefault();
686
+ event.stopPropagation();
687
+ this.cancelled.emit();
350
688
  }
351
- updateModel(model) {
352
- this.isModelLoaded = true;
353
- if (model && model.id !== this.entityID) this._entityID.set(model.id);
354
- this.modelCache.next(model);
689
+ focusActiveDay() {
690
+ afterNextRender(() => this.grid()?.nativeElement.querySelector("button[tabindex=\"0\"]")?.focus(), { injector: this.injector });
691
+ }
692
+ monthStart(months) {
693
+ const active = this.activeDate();
694
+ return new Date(active.getFullYear(), active.getMonth() + months, 1);
695
+ }
696
+ clamp(date) {
697
+ const min = this.minDate();
698
+ const max = this.maxDate();
699
+ if (min && date < min) return min;
700
+ if (max && date > max) return max;
701
+ return date;
702
+ }
703
+ isDisabled(date) {
704
+ const min = this.minDate();
705
+ const max = this.maxDate();
706
+ return !!min && date < min || !!max && date > max;
707
+ }
708
+ monthName(date) {
709
+ return new Intl.DateTimeFormat(this.currentLocale(), {
710
+ month: "long",
711
+ year: "numeric"
712
+ }).format(date);
355
713
  }
356
714
  static ɵfac = i0.ɵɵngDeclareFactory({
357
715
  minVersion: "12.0.0",
358
716
  version: "22.2.0",
359
717
  ngImport: i0,
360
- type: DataProviderService,
718
+ type: CalendarComponent,
361
719
  deps: [],
362
- target: i0.ɵɵFactoryTarget.Injectable
720
+ target: i0.ɵɵFactoryTarget.Component
363
721
  });
364
- static ɵprov = i0.ɵɵngDeclareInjectable({
365
- minVersion: "12.0.0",
722
+ static ɵcmp = i0.ɵɵngDeclareComponent({
723
+ minVersion: "17.0.0",
366
724
  version: "22.2.0",
367
- ngImport: i0,
368
- type: DataProviderService
369
- });
370
- };
371
- i0.ɵɵngDeclareClassMetadata({
372
- minVersion: "12.0.0",
373
- version: "22.2.0",
374
- ngImport: i0,
375
- type: DataProviderService,
376
- decorators: [{ type: Injectable }],
377
- ctorParameters: () => []
378
- });
379
- var BaseDataset = class BaseDataset {
725
+ type: CalendarComponent,
726
+ isStandalone: true,
727
+ selector: "lib-calendar",
728
+ inputs: {
729
+ selected: {
730
+ classPropertyName: "selected",
731
+ publicName: "selected",
732
+ isSignal: true,
733
+ isRequired: false,
734
+ transformFunction: null
735
+ },
736
+ min: {
737
+ classPropertyName: "min",
738
+ publicName: "min",
739
+ isSignal: true,
740
+ isRequired: false,
741
+ transformFunction: null
742
+ },
743
+ max: {
744
+ classPropertyName: "max",
745
+ publicName: "max",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ },
750
+ locale: {
751
+ classPropertyName: "locale",
752
+ publicName: "locale",
753
+ isSignal: true,
754
+ isRequired: false,
755
+ transformFunction: null
756
+ }
757
+ },
758
+ outputs: {
759
+ dateSelected: "dateSelected",
760
+ cancelled: "cancelled"
761
+ },
762
+ host: { classAttribute: "lib-calendar" },
763
+ viewQueries: [{
764
+ propertyName: "grid",
765
+ first: true,
766
+ predicate: ["grid"],
767
+ descendants: true,
768
+ isSignal: true
769
+ }],
770
+ ngImport: i0,
771
+ template: "<div class=\"calendar-header\">\n <button\n class=\"calendar-nav\"\n type=\"button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n [disabled]=\"isPreviousDisabled()\"\n (click)=\"onPreviousMonth()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n <i class=\"fa-solid fa-chevron-left fa-fw\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"calendar-title\" aria-live=\"polite\">{{ monthLabel() }}</span>\n <button\n class=\"calendar-nav\"\n type=\"button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n [disabled]=\"isNextDisabled()\"\n (click)=\"onNextMonth()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n <i class=\"fa-solid fa-chevron-right fa-fw\" aria-hidden=\"true\"></i>\n </button>\n</div>\n\n<!-- The grid owns the arrow keys; each day is a real button with roving tabindex. -->\n<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<table #grid class=\"calendar-grid\" role=\"grid\" [attr.aria-label]=\"monthLabel()\" (keydown)=\"onKeydown($event)\">\n <thead>\n <tr>\n @for (weekday of weekdays(); track $index) {\n <th scope=\"col\" [attr.abbr]=\"weekday.long\">\n <span aria-hidden=\"true\">{{ weekday.short }}</span>\n <span class=\"visually-hidden\">{{ weekday.long }}</span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.key) {\n <td [attr.aria-selected]=\"day.isSelected\">\n <button\n class=\"calendar-day\"\n type=\"button\"\n [class.is-outside]=\"day.isOutsideMonth\"\n [class.is-today]=\"day.isToday\"\n [class.is-selected]=\"day.isSelected\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [attr.aria-label]=\"day.fullLabel\"\n [attr.tabindex]=\"day.isActive ? 0 : -1\"\n [disabled]=\"day.isDisabled\"\n (click)=\"onDayClick(day)\"\n >\n {{ day.label }}\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n\n<div class=\"calendar-footer\">\n <button\n class=\"calendar-today\"\n type=\"button\"\n [disabled]=\"isTodayDisabled()\"\n (click)=\"onToday()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n {{ todayLabel() }}\n </button>\n</div>\n",
772
+ styles: ["@layer properties;:host{display:inline-flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3);width:18rem;max-width:100%;border:1px solid var(--color-line);border-radius:var(--radius-control);background-color:var(--color-surface-solid);color:var(--color-content-primary);font-size:var(--text-body)}.calendar-header{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}.calendar-title{flex:1;text-align:center;font-weight:var(--font-weight-emphasis)}.calendar-title:first-letter{text-transform:uppercase}.calendar-grid{width:100%;border-collapse:collapse;table-layout:fixed}.calendar-grid th{padding-bottom:var(--spacing, .25rem);text-align:center;color:var(--color-content-secondary);font-size:var(--text-caption);font-weight:var(--font-weight-ui)}.calendar-grid td{padding:0;text-align:center}.calendar-nav,.calendar-day,.calendar-today{cursor:pointer;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;-webkit-user-select:none;user-select:none;border-radius:var(--radius-field);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.calendar-nav:hover:not(:disabled),.calendar-day:hover:not(:disabled),.calendar-today:hover:not(:disabled){background-color:var(--state-hover)}.calendar-nav:focus-visible,.calendar-day:focus-visible,.calendar-today:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.calendar-nav:focus-visible,.calendar-day:focus-visible,.calendar-today:focus-visible{outline:2px solid transparent;outline-offset:2px}}.calendar-nav:disabled,.calendar-day:disabled,.calendar-today:disabled{cursor:default;opacity:var(--opacity-disabled)}.calendar-nav{display:inline-flex;height:calc(var(--spacing, .25rem) * 8);width:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center;color:var(--color-content-secondary)}.calendar-day{display:inline-flex;height:calc(var(--spacing, .25rem) * 8);width:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center}.calendar-day.is-outside{color:var(--color-content-subtle)}.calendar-day.is-today{border-color:var(--color-line-strong);font-weight:var(--font-weight-emphasis)}.calendar-day.is-selected,.calendar-day.is-selected:hover{background-color:var(--color-accent);color:var(--color-content-on-accent)}.calendar-day:disabled{text-decoration:line-through}.calendar-footer{display:flex;justify-content:center}.calendar-today{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:var(--spacing, .25rem);color:var(--color-accent);font-weight:var(--font-weight-ui)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
773
+ });
774
+ };
775
+ i0.ɵɵngDeclareClassMetadata({
776
+ minVersion: "12.0.0",
777
+ version: "22.2.0",
778
+ ngImport: i0,
779
+ type: CalendarComponent,
780
+ decorators: [{
781
+ type: Component,
782
+ args: [{
783
+ selector: "lib-calendar",
784
+ host: { class: "lib-calendar" },
785
+ template: "<div class=\"calendar-header\">\n <button\n class=\"calendar-nav\"\n type=\"button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n [disabled]=\"isPreviousDisabled()\"\n (click)=\"onPreviousMonth()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n <i class=\"fa-solid fa-chevron-left fa-fw\" aria-hidden=\"true\"></i>\n </button>\n <span class=\"calendar-title\" aria-live=\"polite\">{{ monthLabel() }}</span>\n <button\n class=\"calendar-nav\"\n type=\"button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n [disabled]=\"isNextDisabled()\"\n (click)=\"onNextMonth()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n <i class=\"fa-solid fa-chevron-right fa-fw\" aria-hidden=\"true\"></i>\n </button>\n</div>\n\n<!-- The grid owns the arrow keys; each day is a real button with roving tabindex. -->\n<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<table #grid class=\"calendar-grid\" role=\"grid\" [attr.aria-label]=\"monthLabel()\" (keydown)=\"onKeydown($event)\">\n <thead>\n <tr>\n @for (weekday of weekdays(); track $index) {\n <th scope=\"col\" [attr.abbr]=\"weekday.long\">\n <span aria-hidden=\"true\">{{ weekday.short }}</span>\n <span class=\"visually-hidden\">{{ weekday.long }}</span>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.key) {\n <td [attr.aria-selected]=\"day.isSelected\">\n <button\n class=\"calendar-day\"\n type=\"button\"\n [class.is-outside]=\"day.isOutsideMonth\"\n [class.is-today]=\"day.isToday\"\n [class.is-selected]=\"day.isSelected\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [attr.aria-label]=\"day.fullLabel\"\n [attr.tabindex]=\"day.isActive ? 0 : -1\"\n [disabled]=\"day.isDisabled\"\n (click)=\"onDayClick(day)\"\n >\n {{ day.label }}\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n\n<div class=\"calendar-footer\">\n <button\n class=\"calendar-today\"\n type=\"button\"\n [disabled]=\"isTodayDisabled()\"\n (click)=\"onToday()\"\n (keydown.escape)=\"onEscape($event)\"\n >\n {{ todayLabel() }}\n </button>\n</div>\n",
786
+ styles: ["@layer properties;:host{display:inline-flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3);width:18rem;max-width:100%;border:1px solid var(--color-line);border-radius:var(--radius-control);background-color:var(--color-surface-solid);color:var(--color-content-primary);font-size:var(--text-body)}.calendar-header{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}.calendar-title{flex:1;text-align:center;font-weight:var(--font-weight-emphasis)}.calendar-title:first-letter{text-transform:uppercase}.calendar-grid{width:100%;border-collapse:collapse;table-layout:fixed}.calendar-grid th{padding-bottom:var(--spacing, .25rem);text-align:center;color:var(--color-content-secondary);font-size:var(--text-caption);font-weight:var(--font-weight-ui)}.calendar-grid td{padding:0;text-align:center}.calendar-nav,.calendar-day,.calendar-today{cursor:pointer;border-style:var(--tw-border-style);border-width:1px;border-color:transparent;-webkit-user-select:none;user-select:none;border-radius:var(--radius-field);transition-property:background-color,color;transition-duration:var(--duration-instant);transition-timing-function:var(--ease-standard)}.calendar-nav:hover:not(:disabled),.calendar-day:hover:not(:disabled),.calendar-today:hover:not(:disabled){background-color:var(--state-hover)}.calendar-nav:focus-visible,.calendar-day:focus-visible,.calendar-today:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){.calendar-nav:focus-visible,.calendar-day:focus-visible,.calendar-today:focus-visible{outline:2px solid transparent;outline-offset:2px}}.calendar-nav:disabled,.calendar-day:disabled,.calendar-today:disabled{cursor:default;opacity:var(--opacity-disabled)}.calendar-nav{display:inline-flex;height:calc(var(--spacing, .25rem) * 8);width:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center;color:var(--color-content-secondary)}.calendar-day{display:inline-flex;height:calc(var(--spacing, .25rem) * 8);width:calc(var(--spacing, .25rem) * 8);align-items:center;justify-content:center}.calendar-day.is-outside{color:var(--color-content-subtle)}.calendar-day.is-today{border-color:var(--color-line-strong);font-weight:var(--font-weight-emphasis)}.calendar-day.is-selected,.calendar-day.is-selected:hover{background-color:var(--color-accent);color:var(--color-content-on-accent)}.calendar-day:disabled{text-decoration:line-through}.calendar-footer{display:flex;justify-content:center}.calendar-today{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:var(--spacing, .25rem);color:var(--color-accent);font-weight:var(--font-weight-ui)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border-width:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
787
+ }]
788
+ }],
789
+ propDecorators: {
790
+ selected: [{
791
+ type: i0.Input,
792
+ args: [{
793
+ isSignal: true,
794
+ alias: "selected",
795
+ required: false
796
+ }]
797
+ }],
798
+ min: [{
799
+ type: i0.Input,
800
+ args: [{
801
+ isSignal: true,
802
+ alias: "min",
803
+ required: false
804
+ }]
805
+ }],
806
+ max: [{
807
+ type: i0.Input,
808
+ args: [{
809
+ isSignal: true,
810
+ alias: "max",
811
+ required: false
812
+ }]
813
+ }],
814
+ locale: [{
815
+ type: i0.Input,
816
+ args: [{
817
+ isSignal: true,
818
+ alias: "locale",
819
+ required: false
820
+ }]
821
+ }],
822
+ dateSelected: [{
823
+ type: i0.Output,
824
+ args: ["dateSelected"]
825
+ }],
826
+ cancelled: [{
827
+ type: i0.Output,
828
+ args: ["cancelled"]
829
+ }],
830
+ grid: [{
831
+ type: i0.ViewChild,
832
+ args: ["grid", { isSignal: true }]
833
+ }]
834
+ }
835
+ });
836
+ function today() {
837
+ const now = /* @__PURE__ */ new Date();
838
+ return new Date(now.getFullYear(), now.getMonth(), now.getDate());
839
+ }
840
+ function startOfDay(date) {
841
+ return date ? new Date(date.getFullYear(), date.getMonth(), date.getDate()) : null;
842
+ }
843
+ function endOfMonth(date) {
844
+ return new Date(date.getFullYear(), date.getMonth() + 1, 0);
845
+ }
846
+ function addDays(date, days) {
847
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
848
+ }
849
+ function addMonthsKeepingDay(date, months) {
850
+ const target = new Date(date.getFullYear(), date.getMonth() + months, 1);
851
+ const lastDay = endOfMonth(target).getDate();
852
+ return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));
853
+ }
854
+ function isSameDay(a, b) {
855
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
856
+ }
857
+ var DateHelpers = class {
858
+ static diffDays(initialDate, finalDate) {
859
+ const initialDateOnly = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());
860
+ const finalDateOnly = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());
861
+ const diff = initialDateOnly.getTime() - finalDateOnly.getTime();
862
+ return Math.floor(diff / 864e5);
863
+ }
864
+ };
865
+ var DisplayControls = class DisplayControls {
866
+ static marked = /* @__PURE__ */ new WeakSet();
867
+ static isDisplayControl(control) {
868
+ return !!control && DisplayControls.marked.has(control);
869
+ }
870
+ static markAsDisplayControl(control) {
871
+ if (control) DisplayControls.marked.add(control);
872
+ }
873
+ };
874
+ var GuidHelper = class {
875
+ static generateGUID() {
876
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
877
+ const r = Math.random() * 16 | 0;
878
+ return (c === "x" ? r : r & 3 | 8).toString(16);
879
+ });
880
+ }
881
+ };
882
+ var RouterFormatter = class {
883
+ static getURL(route) {
884
+ let parentRoute = "";
885
+ if (route.parent) parentRoute = this.getURL(route.parent);
886
+ let path = route.routeConfig?.path ?? "";
887
+ route.paramMap.keys.forEach((k) => {
888
+ path = path.replace(":" + k, k === "view" ? "" : route.paramMap.get(k) ?? "");
889
+ });
890
+ if (!route.parent || parentRoute !== "" && parentRoute !== "/" && route.routeConfig?.path && path) parentRoute += "/";
891
+ return parentRoute + path;
892
+ }
893
+ };
894
+ var CatalogService = class CatalogService {
895
+ http = inject(HttpClient);
896
+ search(endpoint, maxResults, criteria, filters = null) {
897
+ return this.http.post(`${endpoint}`, {
898
+ maxResults,
899
+ criteria,
900
+ filters
901
+ });
902
+ }
903
+ static ɵfac = i0.ɵɵngDeclareFactory({
904
+ minVersion: "12.0.0",
905
+ version: "22.2.0",
906
+ ngImport: i0,
907
+ type: CatalogService,
908
+ deps: [],
909
+ target: i0.ɵɵFactoryTarget.Injectable
910
+ });
911
+ static ɵprov = i0.ɵɵngDeclareInjectable({
912
+ minVersion: "12.0.0",
913
+ version: "22.2.0",
914
+ ngImport: i0,
915
+ type: CatalogService,
916
+ providedIn: "root"
917
+ });
918
+ };
919
+ i0.ɵɵngDeclareClassMetadata({
920
+ minVersion: "12.0.0",
921
+ version: "22.2.0",
922
+ ngImport: i0,
923
+ type: CatalogService,
924
+ decorators: [{
925
+ type: Injectable,
926
+ args: [{ providedIn: "root" }]
927
+ }]
928
+ });
929
+ var DataProviderService = class DataProviderService {
930
+ activatedRoute = inject(ActivatedRoute);
931
+ destroy$ = new Subject();
932
+ shouldLazyLoad = false;
933
+ _entityID = signal(void 0, ...ngDevMode ? [{ debugName: "_entityID" }] : /* istanbul ignore next */ []);
934
+ errorSubject = new Subject();
935
+ isLoading = false;
936
+ isModelLoaded = false;
937
+ modelCache = new ReplaySubject(1);
938
+ get entityID() {
939
+ return this._entityID();
940
+ }
941
+ get hasEntityID() {
942
+ return !!this.entityID;
943
+ }
944
+ constructor() {
945
+ this.activatedRoute.paramMap.pipe(take(1)).subscribe((paramMap) => {
946
+ const newID = Number(paramMap.get("id"));
947
+ if (newID !== this.entityID) {
948
+ this._entityID.set(newID);
949
+ queueMicrotask(() => {
950
+ if (!this.shouldLazyLoad) this.refreshModel();
951
+ });
952
+ }
953
+ });
954
+ }
955
+ ngOnDestroy() {
956
+ this.destroy$.next(true);
957
+ this.destroy$.complete();
958
+ }
959
+ getError$() {
960
+ return this.errorSubject.asObservable();
961
+ }
962
+ getModel$() {
963
+ if (!this.isModelLoaded && !this.shouldLazyLoad) this.refreshModel();
964
+ return this.modelCache.asObservable();
965
+ }
966
+ refreshModel() {
967
+ if (this.isLoading) return;
968
+ this.isLoading = true;
969
+ this.loadModel(this.entityID).pipe(take(1)).subscribe({
970
+ next: (model) => {
971
+ this.isLoading = false;
972
+ this.updateModel(model);
973
+ },
974
+ error: (error) => {
975
+ this.isLoading = false;
976
+ this.isModelLoaded = true;
977
+ this.modelCache.next(null);
978
+ this.errorSubject.next(error);
979
+ }
980
+ });
981
+ }
982
+ resetForNewEntity() {
983
+ this._entityID.set(void 0);
984
+ this.isModelLoaded = false;
985
+ this.modelCache.next(null);
986
+ }
987
+ updateModel(model) {
988
+ this.isModelLoaded = true;
989
+ if (model && model.id !== this.entityID) this._entityID.set(model.id);
990
+ this.modelCache.next(model);
991
+ }
992
+ static ɵfac = i0.ɵɵngDeclareFactory({
993
+ minVersion: "12.0.0",
994
+ version: "22.2.0",
995
+ ngImport: i0,
996
+ type: DataProviderService,
997
+ deps: [],
998
+ target: i0.ɵɵFactoryTarget.Injectable
999
+ });
1000
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1001
+ minVersion: "12.0.0",
1002
+ version: "22.2.0",
1003
+ ngImport: i0,
1004
+ type: DataProviderService
1005
+ });
1006
+ };
1007
+ i0.ɵɵngDeclareClassMetadata({
1008
+ minVersion: "12.0.0",
1009
+ version: "22.2.0",
1010
+ ngImport: i0,
1011
+ type: DataProviderService,
1012
+ decorators: [{ type: Injectable }],
1013
+ ctorParameters: () => []
1014
+ });
1015
+ var BaseDataset = class BaseDataset {
380
1016
  revision = signal(0, ...ngDevMode ? [{ debugName: "revision" }] : /* istanbul ignore next */ []);
381
1017
  dataProvider;
382
1018
  destroy$ = new Subject();
@@ -432,6 +1068,7 @@ var GridConfigsProvider = class GridConfigsProvider {
432
1068
  this._configs = {
433
1069
  loadingDisplayText: "Loading...",
434
1070
  messageOnEmpty: "No results",
1071
+ messageOnFailed: "The records could not be loaded.",
435
1072
  recordBlockSize: 100,
436
1073
  rowHeight: 41.6,
437
1074
  rowsToDisplay: 6
@@ -1282,48 +1919,934 @@ var SidebarService = class SidebarService {
1282
1919
  this.deselectMenu(menu);
1283
1920
  }
1284
1921
  }
1285
- deselectMenu(menu, shouldUpdateParents = true) {
1286
- if (!menu.isSelected) return;
1287
- menu.isSelected = false;
1288
- this.selectionChanged.emit(menu);
1289
- if ((menu.children?.length ?? 0) > 0) menu.children.filter((child) => child.isSelected).forEach((child) => {
1290
- this.deselectMenu(child, false);
1291
- });
1292
- if (!!menu.parent && shouldUpdateParents) while (menu.parent) {
1293
- this.selectionChanged.emit(menu.parent);
1294
- menu = menu.parent;
1922
+ deselectMenu(menu, shouldUpdateParents = true) {
1923
+ if (!menu.isSelected) return;
1924
+ menu.isSelected = false;
1925
+ this.selectionChanged.emit(menu);
1926
+ if ((menu.children?.length ?? 0) > 0) menu.children.filter((child) => child.isSelected).forEach((child) => {
1927
+ this.deselectMenu(child, false);
1928
+ });
1929
+ if (!!menu.parent && shouldUpdateParents) while (menu.parent) {
1930
+ this.selectionChanged.emit(menu.parent);
1931
+ menu = menu.parent;
1932
+ }
1933
+ }
1934
+ selectMenu(menu) {
1935
+ menu.isSelected = true;
1936
+ this.selectionChanged.emit(menu);
1937
+ if (menu.parent) this.selectMenu(menu.parent);
1938
+ }
1939
+ static ɵfac = i0.ɵɵngDeclareFactory({
1940
+ minVersion: "12.0.0",
1941
+ version: "22.2.0",
1942
+ ngImport: i0,
1943
+ type: SidebarService,
1944
+ deps: [],
1945
+ target: i0.ɵɵFactoryTarget.Injectable
1946
+ });
1947
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1948
+ minVersion: "12.0.0",
1949
+ version: "22.2.0",
1950
+ ngImport: i0,
1951
+ type: SidebarService,
1952
+ providedIn: "root"
1953
+ });
1954
+ };
1955
+ i0.ɵɵngDeclareClassMetadata({
1956
+ minVersion: "12.0.0",
1957
+ version: "22.2.0",
1958
+ ngImport: i0,
1959
+ type: SidebarService,
1960
+ decorators: [{
1961
+ type: Injectable,
1962
+ args: [{ providedIn: "root" }]
1963
+ }]
1964
+ });
1965
+ let nextCalendarId = 0;
1966
+ var DateInputComponent = class DateInputComponent {
1967
+ mode = input("date", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
1968
+ min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
1969
+ max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
1970
+ readOnly = input(false, ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
1971
+ invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
1972
+ ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1973
+ blurred = output();
1974
+ focused = output();
1975
+ inputChanged = output();
1976
+ injector = inject(Injector);
1977
+ localeService = inject(LocaleService);
1978
+ overlay = inject(Overlay);
1979
+ viewContainerRef = inject(ViewContainerRef);
1980
+ container = viewChild("container", ...ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []);
1981
+ dateField = viewChild("dateField", ...ngDevMode ? [{ debugName: "dateField" }] : /* istanbul ignore next */ []);
1982
+ calendarTemplate = viewChild("calendarTemplate", ...ngDevMode ? [{ debugName: "calendarTemplate" }] : /* istanbul ignore next */ []);
1983
+ overlayRef;
1984
+ onChange = () => void 0;
1985
+ onTouched = () => void 0;
1986
+ onValidatorChange = () => void 0;
1987
+ current = signal(null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
1988
+ hasTypingError = signal(false, ...ngDevMode ? [{ debugName: "hasTypingError" }] : /* istanbul ignore next */ []);
1989
+ calendarId = `lib-date-input-calendar-${nextCalendarId++}`;
1990
+ isDisabled = signal(false, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
1991
+ isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
1992
+ locale = computed(() => this.localeService.locale(), ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
1993
+ dateText = linkedSignal(() => {
1994
+ const value = this.current();
1995
+ return value ? formatDateText(value, this.locale()) : "";
1996
+ }, ...ngDevMode ? [{ debugName: "dateText" }] : /* istanbul ignore next */ []);
1997
+ timeText = linkedSignal(() => {
1998
+ const value = this.current();
1999
+ return value ? formatTimeText(value, this.locale()) : "";
2000
+ }, ...ngDevMode ? [{ debugName: "timeText" }] : /* istanbul ignore next */ []);
2001
+ datePlaceholder = computed(() => {
2002
+ const locale = this.locale();
2003
+ const { order, separator } = getDatePattern(locale);
2004
+ try {
2005
+ const names = new Intl.DisplayNames(locale, { type: "dateTimeField" });
2006
+ return order.map((part) => names.of(part) ?? part).join(separator);
2007
+ } catch {
2008
+ return order.join(separator);
2009
+ }
2010
+ }, ...ngDevMode ? [{ debugName: "datePlaceholder" }] : /* istanbul ignore next */ []);
2011
+ timeLabel = computed(() => {
2012
+ let hour = "Time";
2013
+ try {
2014
+ hour = new Intl.DisplayNames(this.locale(), { type: "dateTimeField" }).of("hour") ?? hour;
2015
+ } catch {}
2016
+ return [this.ariaLabel(), hour].filter(Boolean).join(", ");
2017
+ }, ...ngDevMode ? [{ debugName: "timeLabel" }] : /* istanbul ignore next */ []);
2018
+ calendarSelection = computed(() => this.current(), ...ngDevMode ? [{ debugName: "calendarSelection" }] : /* istanbul ignore next */ []);
2019
+ isFieldInvalid = computed(() => this.invalid() || this.hasTypingError(), ...ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []);
2020
+ constructor() {
2021
+ let previous;
2022
+ effect(() => {
2023
+ const limits = JSON.stringify([limitKey(this.min()), limitKey(this.max())]);
2024
+ if (previous !== void 0 && previous !== limits) this.onValidatorChange();
2025
+ previous = limits;
2026
+ });
2027
+ }
2028
+ ngOnDestroy() {
2029
+ this.disposeOverlay();
2030
+ }
2031
+ writeValue(value) {
2032
+ this.hasTypingError.set(false);
2033
+ this.current.set(parseIsoValue(value));
2034
+ }
2035
+ registerOnChange(fn) {
2036
+ this.onChange = fn;
2037
+ }
2038
+ registerOnTouched(fn) {
2039
+ this.onTouched = fn;
2040
+ }
2041
+ setDisabledState(isDisabled) {
2042
+ this.isDisabled.set(isDisabled);
2043
+ if (isDisabled) this.close(false);
2044
+ }
2045
+ validate(_control) {
2046
+ if (this.hasTypingError()) return { dateInvalid: true };
2047
+ const value = this.current();
2048
+ if (!value) return null;
2049
+ const day = new Date(value.getFullYear(), value.getMonth(), value.getDate());
2050
+ const min = parseIsoValue(this.min());
2051
+ const max = parseIsoValue(this.max());
2052
+ if (min && day < new Date(min.getFullYear(), min.getMonth(), min.getDate())) return { dateMin: {
2053
+ min: toIsoDate(min),
2054
+ actual: toIsoDate(day)
2055
+ } };
2056
+ if (max && day > new Date(max.getFullYear(), max.getMonth(), max.getDate())) return { dateMax: {
2057
+ max: toIsoDate(max),
2058
+ actual: toIsoDate(day)
2059
+ } };
2060
+ return null;
2061
+ }
2062
+ registerOnValidatorChange(fn) {
2063
+ this.onValidatorChange = fn;
2064
+ }
2065
+ onDateTyped(event) {
2066
+ this.dateText.set(event.target.value);
2067
+ this.inputChanged.emit();
2068
+ }
2069
+ onTimeTyped(event) {
2070
+ this.timeText.set(event.target.value);
2071
+ this.inputChanged.emit();
2072
+ }
2073
+ onFieldFocus(event) {
2074
+ if (!this.isInsideField(event.relatedTarget)) this.focused.emit();
2075
+ }
2076
+ onFieldBlur(event) {
2077
+ if (this.isInsideField(event.relatedTarget)) return;
2078
+ this.commitText();
2079
+ this.onTouched();
2080
+ this.blurred.emit();
2081
+ }
2082
+ onFieldKeydown(event) {
2083
+ if (event.key === "ArrowDown" && event.altKey) {
2084
+ event.preventDefault();
2085
+ this.open();
2086
+ } else if (event.key === "Enter") this.commitText();
2087
+ else if (event.key === "Escape" && this.isOpen()) {
2088
+ event.preventDefault();
2089
+ event.stopPropagation();
2090
+ this.close(true);
2091
+ }
2092
+ }
2093
+ onToggleClick() {
2094
+ if (this.isOpen()) this.close(true);
2095
+ else this.open();
2096
+ }
2097
+ onDatePicked(day) {
2098
+ const previous = this.current();
2099
+ const value = new Date(day.getFullYear(), day.getMonth(), day.getDate());
2100
+ if (this.mode() === "datetime") {
2101
+ const time = parseTimeText(this.timeText());
2102
+ value.setHours(time?.hours ?? previous?.getHours() ?? 0, time?.minutes ?? previous?.getMinutes() ?? 0);
2103
+ }
2104
+ this.setValue(value);
2105
+ this.onTouched();
2106
+ this.close(true);
2107
+ }
2108
+ onCalendarCancelled() {
2109
+ this.close(true);
2110
+ }
2111
+ open() {
2112
+ const container = this.container()?.nativeElement;
2113
+ const template = this.calendarTemplate();
2114
+ if (this.isOpen() || this.isDisabled() || this.readOnly() || !container || !template) return;
2115
+ this.commitText();
2116
+ this.overlayRef = this.overlay.create({
2117
+ hasBackdrop: true,
2118
+ backdropClass: "cdk-overlay-transparent-backdrop",
2119
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
2120
+ positionStrategy: this.overlay.position().flexibleConnectedTo(container).withPush(true).withViewportMargin(8).withPositions([
2121
+ {
2122
+ originX: "start",
2123
+ originY: "bottom",
2124
+ overlayX: "start",
2125
+ overlayY: "top",
2126
+ offsetY: 4
2127
+ },
2128
+ {
2129
+ originX: "start",
2130
+ originY: "top",
2131
+ overlayX: "start",
2132
+ overlayY: "bottom",
2133
+ offsetY: -4
2134
+ },
2135
+ {
2136
+ originX: "end",
2137
+ originY: "bottom",
2138
+ overlayX: "end",
2139
+ overlayY: "top",
2140
+ offsetY: 4
2141
+ }
2142
+ ])
2143
+ });
2144
+ this.overlayRef.backdropClick().subscribe(() => this.close(false));
2145
+ this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));
2146
+ this.isOpen.set(true);
2147
+ const overlayElement = this.overlayRef.overlayElement;
2148
+ afterNextRender(() => overlayElement.querySelector(".calendar-day[tabindex=\"0\"]")?.focus(), { injector: this.injector });
2149
+ }
2150
+ close(returnFocus) {
2151
+ if (!this.isOpen()) return;
2152
+ this.disposeOverlay();
2153
+ this.isOpen.set(false);
2154
+ if (returnFocus) this.dateField()?.nativeElement.focus();
2155
+ }
2156
+ isInsideField(target) {
2157
+ return target instanceof Node && !!this.container()?.nativeElement.contains(target);
2158
+ }
2159
+ commitText() {
2160
+ const dateText = this.dateText().trim();
2161
+ const timeText = this.timeText().trim();
2162
+ const isDateTime = this.mode() === "datetime";
2163
+ if (dateText === "" && (!isDateTime || timeText === "")) {
2164
+ this.setValue(null);
2165
+ return;
2166
+ }
2167
+ const day = parseDateText(dateText, this.locale());
2168
+ const time = isDateTime && timeText !== "" ? parseTimeText(timeText) : null;
2169
+ if (!day || isDateTime && timeText !== "" && !time) {
2170
+ const hadValue = this.current() !== null;
2171
+ this.hasTypingError.set(true);
2172
+ this.current.set(null);
2173
+ this.dateText.set(dateText);
2174
+ this.timeText.set(timeText);
2175
+ if (hadValue) this.onChange(null);
2176
+ this.onValidatorChange();
2177
+ return;
2178
+ }
2179
+ if (time) day.setHours(time.hours, time.minutes);
2180
+ this.setValue(day);
2181
+ }
2182
+ setValue(value) {
2183
+ const hadTypingError = this.hasTypingError();
2184
+ this.hasTypingError.set(false);
2185
+ const previous = this.serialize(this.current());
2186
+ this.current.set(value);
2187
+ const next = this.serialize(value);
2188
+ if (next !== previous) this.onChange(next);
2189
+ else if (hadTypingError) this.onValidatorChange();
2190
+ }
2191
+ serialize(value) {
2192
+ if (!value) return null;
2193
+ return this.mode() === "datetime" ? toIsoDateTime(value) : toIsoDate(value);
2194
+ }
2195
+ disposeOverlay() {
2196
+ this.overlayRef?.dispose();
2197
+ this.overlayRef = void 0;
2198
+ }
2199
+ static ɵfac = i0.ɵɵngDeclareFactory({
2200
+ minVersion: "12.0.0",
2201
+ version: "22.2.0",
2202
+ ngImport: i0,
2203
+ type: DateInputComponent,
2204
+ deps: [],
2205
+ target: i0.ɵɵFactoryTarget.Component
2206
+ });
2207
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2208
+ minVersion: "17.0.0",
2209
+ version: "22.2.0",
2210
+ type: DateInputComponent,
2211
+ isStandalone: true,
2212
+ selector: "lib-date-input",
2213
+ inputs: {
2214
+ mode: {
2215
+ classPropertyName: "mode",
2216
+ publicName: "mode",
2217
+ isSignal: true,
2218
+ isRequired: false,
2219
+ transformFunction: null
2220
+ },
2221
+ min: {
2222
+ classPropertyName: "min",
2223
+ publicName: "min",
2224
+ isSignal: true,
2225
+ isRequired: false,
2226
+ transformFunction: null
2227
+ },
2228
+ max: {
2229
+ classPropertyName: "max",
2230
+ publicName: "max",
2231
+ isSignal: true,
2232
+ isRequired: false,
2233
+ transformFunction: null
2234
+ },
2235
+ readOnly: {
2236
+ classPropertyName: "readOnly",
2237
+ publicName: "readOnly",
2238
+ isSignal: true,
2239
+ isRequired: false,
2240
+ transformFunction: null
2241
+ },
2242
+ invalid: {
2243
+ classPropertyName: "invalid",
2244
+ publicName: "invalid",
2245
+ isSignal: true,
2246
+ isRequired: false,
2247
+ transformFunction: null
2248
+ },
2249
+ ariaLabel: {
2250
+ classPropertyName: "ariaLabel",
2251
+ publicName: "ariaLabel",
2252
+ isSignal: true,
2253
+ isRequired: false,
2254
+ transformFunction: null
2255
+ }
2256
+ },
2257
+ outputs: {
2258
+ blurred: "blurred",
2259
+ focused: "focused",
2260
+ inputChanged: "inputChanged"
2261
+ },
2262
+ host: { classAttribute: "lib-date-input" },
2263
+ providers: [{
2264
+ provide: NG_VALUE_ACCESSOR,
2265
+ useExisting: forwardRef(() => DateInputComponent),
2266
+ multi: true
2267
+ }, {
2268
+ provide: NG_VALIDATORS,
2269
+ useExisting: forwardRef(() => DateInputComponent),
2270
+ multi: true
2271
+ }],
2272
+ viewQueries: [
2273
+ {
2274
+ propertyName: "container",
2275
+ first: true,
2276
+ predicate: ["container"],
2277
+ descendants: true,
2278
+ isSignal: true
2279
+ },
2280
+ {
2281
+ propertyName: "dateField",
2282
+ first: true,
2283
+ predicate: ["dateField"],
2284
+ descendants: true,
2285
+ isSignal: true
2286
+ },
2287
+ {
2288
+ propertyName: "calendarTemplate",
2289
+ first: true,
2290
+ predicate: ["calendarTemplate"],
2291
+ descendants: true,
2292
+ isSignal: true
2293
+ }
2294
+ ],
2295
+ ngImport: i0,
2296
+ template: "<div\n #container\n class=\"date-input-container\"\n [class.invalid]=\"isFieldInvalid()\"\n [class.disabled]=\"isDisabled()\"\n [class.read-only]=\"readOnly()\"\n>\n <input\n #dateField\n class=\"date-field\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-controls]=\"isOpen() ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.placeholder]=\"datePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"dateText()\"\n (blur)=\"onFieldBlur($event)\"\n (focus)=\"onFieldFocus($event)\"\n (input)=\"onDateTyped($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n />\n <!-- A pointer shortcut, next to the date it fills. Keyboard users open the calendar with\n Alt+Down in the field, so the button stays out of the tab order and out of the accessibility\n tree, like the clear button of lib-catalog-select. -->\n <button\n class=\"calendar-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isDisabled() || readOnly()\"\n (click)=\"onToggleClick()\"\n >\n <i class=\"fa-regular fa-calendar fa-fw\"></i>\n </button>\n @if (mode() === 'datetime') {\n <input\n class=\"time-field\"\n [attr.aria-label]=\"timeLabel()\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n placeholder=\"--:--\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"timeText()\"\n (blur)=\"onFieldBlur($event)\"\n (focus)=\"onFieldFocus($event)\"\n (input)=\"onTimeTyped($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n />\n }\n</div>\n\n<ng-template #calendarTemplate>\n <lib-calendar\n class=\"date-input-calendar\"\n [attr.id]=\"calendarId\"\n [max]=\"max()\"\n [min]=\"min()\"\n [selected]=\"calendarSelection()\"\n (cancelled)=\"onCalendarCancelled()\"\n (dateSelected)=\"onDatePicked($event)\"\n ></lib-calendar>\n</ng-template>\n",
2297
+ styles: ["@layer properties;:host{display:block}.date-input-container{display:flex;width:100%;align-items:stretch;border-style:var(--tw-border-style);border-width:1px;--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:var(--color-line-strong);border-radius:var(--radius-field);background-color:var(--color-surface-solid);transition-property:border-color,box-shadow;transition-duration:var(--duration-instant)}.date-input-container:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color: var(--color-focus-ring)}:host(.ng-invalid.ng-touched) .date-input-container,.date-input-container.invalid{border-color:var(--color-danger)}:host(.ng-invalid.ng-touched) .date-input-container:focus-within,.date-input-container.invalid:focus-within{--tw-ring-color: var(--color-danger)}.date-input-container.disabled,.date-input-container.read-only{background-color:var(--color-surface-inset)}.date-field,.time-field{min-width:0px;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);color:var(--color-content-primary);font-size:inherit}.date-field:focus,.date-field:focus-visible,.time-field:focus,.time-field:focus-visible{--tw-outline-style: none;outline-style:none;box-shadow:none}@media(forced-colors:active){.date-field:focus,.date-field:focus-visible,.time-field:focus,.time-field:focus-visible{outline:2px solid transparent;outline-offset:2px}}.date-field::placeholder,.time-field::placeholder{color:var(--color-content-subtle)}.date-field{width:0px;flex:1}.time-field{width:calc(var(--spacing, .25rem) * 24);flex-shrink:0;border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-line)}.calendar-toggle{display:inline-flex;width:calc(var(--spacing, .25rem) * 9);flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;color:var(--color-content-secondary)}.calendar-toggle:last-child{border-radius:0 var(--radius-field) var(--radius-field) 0}.calendar-toggle:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.calendar-toggle:disabled{cursor:default;opacity:var(--opacity-disabled)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
2298
+ dependencies: [{
2299
+ kind: "component",
2300
+ type: CalendarComponent,
2301
+ selector: "lib-calendar",
2302
+ inputs: [
2303
+ "selected",
2304
+ "min",
2305
+ "max",
2306
+ "locale"
2307
+ ],
2308
+ outputs: ["dateSelected", "cancelled"]
2309
+ }]
2310
+ });
2311
+ };
2312
+ i0.ɵɵngDeclareClassMetadata({
2313
+ minVersion: "12.0.0",
2314
+ version: "22.2.0",
2315
+ ngImport: i0,
2316
+ type: DateInputComponent,
2317
+ decorators: [{
2318
+ type: Component,
2319
+ args: [{
2320
+ selector: "lib-date-input",
2321
+ imports: [CalendarComponent],
2322
+ providers: [{
2323
+ provide: NG_VALUE_ACCESSOR,
2324
+ useExisting: forwardRef(() => DateInputComponent),
2325
+ multi: true
2326
+ }, {
2327
+ provide: NG_VALIDATORS,
2328
+ useExisting: forwardRef(() => DateInputComponent),
2329
+ multi: true
2330
+ }],
2331
+ host: { class: "lib-date-input" },
2332
+ template: "<div\n #container\n class=\"date-input-container\"\n [class.invalid]=\"isFieldInvalid()\"\n [class.disabled]=\"isDisabled()\"\n [class.read-only]=\"readOnly()\"\n>\n <input\n #dateField\n class=\"date-field\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n role=\"combobox\"\n aria-haspopup=\"grid\"\n [attr.aria-controls]=\"isOpen() ? calendarId : null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.placeholder]=\"datePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"dateText()\"\n (blur)=\"onFieldBlur($event)\"\n (focus)=\"onFieldFocus($event)\"\n (input)=\"onDateTyped($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n />\n <!-- A pointer shortcut, next to the date it fills. Keyboard users open the calendar with\n Alt+Down in the field, so the button stays out of the tab order and out of the accessibility\n tree, like the clear button of lib-catalog-select. -->\n <button\n class=\"calendar-toggle\"\n type=\"button\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [disabled]=\"isDisabled() || readOnly()\"\n (click)=\"onToggleClick()\"\n >\n <i class=\"fa-regular fa-calendar fa-fw\"></i>\n </button>\n @if (mode() === 'datetime') {\n <input\n class=\"time-field\"\n [attr.aria-label]=\"timeLabel()\"\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n placeholder=\"--:--\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"timeText()\"\n (blur)=\"onFieldBlur($event)\"\n (focus)=\"onFieldFocus($event)\"\n (input)=\"onTimeTyped($event)\"\n (keydown)=\"onFieldKeydown($event)\"\n />\n }\n</div>\n\n<ng-template #calendarTemplate>\n <lib-calendar\n class=\"date-input-calendar\"\n [attr.id]=\"calendarId\"\n [max]=\"max()\"\n [min]=\"min()\"\n [selected]=\"calendarSelection()\"\n (cancelled)=\"onCalendarCancelled()\"\n (dateSelected)=\"onDatePicked($event)\"\n ></lib-calendar>\n</ng-template>\n",
2333
+ styles: ["@layer properties;:host{display:block}.date-input-container{display:flex;width:100%;align-items:stretch;border-style:var(--tw-border-style);border-width:1px;--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:var(--color-line-strong);border-radius:var(--radius-field);background-color:var(--color-surface-solid);transition-property:border-color,box-shadow;transition-duration:var(--duration-instant)}.date-input-container:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color: var(--color-focus-ring)}:host(.ng-invalid.ng-touched) .date-input-container,.date-input-container.invalid{border-color:var(--color-danger)}:host(.ng-invalid.ng-touched) .date-input-container:focus-within,.date-input-container.invalid:focus-within{--tw-ring-color: var(--color-danger)}.date-input-container.disabled,.date-input-container.read-only{background-color:var(--color-surface-inset)}.date-field,.time-field{min-width:0px;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);color:var(--color-content-primary);font-size:inherit}.date-field:focus,.date-field:focus-visible,.time-field:focus,.time-field:focus-visible{--tw-outline-style: none;outline-style:none;box-shadow:none}@media(forced-colors:active){.date-field:focus,.date-field:focus-visible,.time-field:focus,.time-field:focus-visible{outline:2px solid transparent;outline-offset:2px}}.date-field::placeholder,.time-field::placeholder{color:var(--color-content-subtle)}.date-field{width:0px;flex:1}.time-field{width:calc(var(--spacing, .25rem) * 24);flex-shrink:0;border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--color-line)}.calendar-toggle{display:inline-flex;width:calc(var(--spacing, .25rem) * 9);flex-shrink:0;cursor:pointer;align-items:center;justify-content:center;color:var(--color-content-secondary)}.calendar-toggle:last-child{border-radius:0 var(--radius-field) var(--radius-field) 0}.calendar-toggle:hover:not(:disabled){background-color:var(--state-hover);color:var(--color-content-primary)}.calendar-toggle:disabled{cursor:default;opacity:var(--opacity-disabled)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
2334
+ }]
2335
+ }],
2336
+ ctorParameters: () => [],
2337
+ propDecorators: {
2338
+ mode: [{
2339
+ type: i0.Input,
2340
+ args: [{
2341
+ isSignal: true,
2342
+ alias: "mode",
2343
+ required: false
2344
+ }]
2345
+ }],
2346
+ min: [{
2347
+ type: i0.Input,
2348
+ args: [{
2349
+ isSignal: true,
2350
+ alias: "min",
2351
+ required: false
2352
+ }]
2353
+ }],
2354
+ max: [{
2355
+ type: i0.Input,
2356
+ args: [{
2357
+ isSignal: true,
2358
+ alias: "max",
2359
+ required: false
2360
+ }]
2361
+ }],
2362
+ readOnly: [{
2363
+ type: i0.Input,
2364
+ args: [{
2365
+ isSignal: true,
2366
+ alias: "readOnly",
2367
+ required: false
2368
+ }]
2369
+ }],
2370
+ invalid: [{
2371
+ type: i0.Input,
2372
+ args: [{
2373
+ isSignal: true,
2374
+ alias: "invalid",
2375
+ required: false
2376
+ }]
2377
+ }],
2378
+ ariaLabel: [{
2379
+ type: i0.Input,
2380
+ args: [{
2381
+ isSignal: true,
2382
+ alias: "ariaLabel",
2383
+ required: false
2384
+ }]
2385
+ }],
2386
+ blurred: [{
2387
+ type: i0.Output,
2388
+ args: ["blurred"]
2389
+ }],
2390
+ focused: [{
2391
+ type: i0.Output,
2392
+ args: ["focused"]
2393
+ }],
2394
+ inputChanged: [{
2395
+ type: i0.Output,
2396
+ args: ["inputChanged"]
2397
+ }],
2398
+ container: [{
2399
+ type: i0.ViewChild,
2400
+ args: ["container", { isSignal: true }]
2401
+ }],
2402
+ dateField: [{
2403
+ type: i0.ViewChild,
2404
+ args: ["dateField", { isSignal: true }]
2405
+ }],
2406
+ calendarTemplate: [{
2407
+ type: i0.ViewChild,
2408
+ args: ["calendarTemplate", { isSignal: true }]
2409
+ }]
2410
+ }
2411
+ });
2412
+ function limitKey(limit) {
2413
+ const date = parseIsoValue(limit);
2414
+ return date ? toIsoDate(date) : null;
2415
+ }
2416
+ var NumberInputComponent = class NumberInputComponent {
2417
+ min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
2418
+ max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
2419
+ step = input(1, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
2420
+ decimals = input(...ngDevMode ? [void 0, { debugName: "decimals" }] : /* istanbul ignore next */ []);
2421
+ minDecimals = input(...ngDevMode ? [void 0, { debugName: "minDecimals" }] : /* istanbul ignore next */ []);
2422
+ grouping = input(true, ...ngDevMode ? [{ debugName: "grouping" }] : /* istanbul ignore next */ []);
2423
+ prefix = input(...ngDevMode ? [void 0, { debugName: "prefix" }] : /* istanbul ignore next */ []);
2424
+ suffix = input(...ngDevMode ? [void 0, { debugName: "suffix" }] : /* istanbul ignore next */ []);
2425
+ currency = input(...ngDevMode ? [void 0, { debugName: "currency" }] : /* istanbul ignore next */ []);
2426
+ readOnly = input(false, ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
2427
+ invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
2428
+ ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2429
+ blurred = output();
2430
+ focused = output();
2431
+ inputChanged = output();
2432
+ localeService = inject(LocaleService);
2433
+ onChange = () => void 0;
2434
+ onTouched = () => void 0;
2435
+ onValidatorChange = () => void 0;
2436
+ current = signal(null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
2437
+ hasTypingError = signal(false, ...ngDevMode ? [{ debugName: "hasTypingError" }] : /* istanbul ignore next */ []);
2438
+ hasFocus = signal(false, ...ngDevMode ? [{ debugName: "hasFocus" }] : /* istanbul ignore next */ []);
2439
+ wasEdited = false;
2440
+ isDisabled = signal(false, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
2441
+ locale = computed(() => this.localeService.locale(), ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
2442
+ currencyAffix = computed(() => {
2443
+ const currency = this.currency();
2444
+ if (!currency) return null;
2445
+ try {
2446
+ const format = new Intl.NumberFormat(this.locale(), {
2447
+ style: "currency",
2448
+ currency
2449
+ });
2450
+ const parts = format.formatToParts(1);
2451
+ const symbolIndex = parts.findIndex((part) => part.type === "currency");
2452
+ const integerIndex = parts.findIndex((part) => part.type === "integer");
2453
+ return {
2454
+ symbol: parts[symbolIndex]?.value ?? currency,
2455
+ position: symbolIndex > integerIndex ? "suffix" : "prefix",
2456
+ fractionDigits: format.resolvedOptions().maximumFractionDigits ?? 2
2457
+ };
2458
+ } catch {
2459
+ return null;
2460
+ }
2461
+ }, ...ngDevMode ? [{ debugName: "currencyAffix" }] : /* istanbul ignore next */ []);
2462
+ prefixText = computed(() => {
2463
+ const affix = this.currencyAffix();
2464
+ return this.prefix() ?? (affix?.position === "prefix" ? affix.symbol : void 0);
2465
+ }, ...ngDevMode ? [{ debugName: "prefixText" }] : /* istanbul ignore next */ []);
2466
+ suffixText = computed(() => {
2467
+ const affix = this.currencyAffix();
2468
+ return this.suffix() ?? (affix?.position === "suffix" ? affix.symbol : void 0);
2469
+ }, ...ngDevMode ? [{ debugName: "suffixText" }] : /* istanbul ignore next */ []);
2470
+ maxDecimals = computed(() => this.decimals() ?? this.currencyAffix()?.fractionDigits ?? 3, ...ngDevMode ? [{ debugName: "maxDecimals" }] : /* istanbul ignore next */ []);
2471
+ fixedDecimals = computed(() => Math.min(this.minDecimals() ?? this.currencyAffix()?.fractionDigits ?? 0, this.maxDecimals()), ...ngDevMode ? [{ debugName: "fixedDecimals" }] : /* istanbul ignore next */ []);
2472
+ text = linkedSignal(() => {
2473
+ const value = this.current();
2474
+ if (value === null) return "";
2475
+ const isEditing = this.hasFocus();
2476
+ return formatLocaleNumber(value, this.locale(), {
2477
+ minFractionDigits: isEditing ? 0 : this.fixedDecimals(),
2478
+ maxFractionDigits: isEditing ? 20 : this.maxDecimals(),
2479
+ grouping: !isEditing && this.grouping()
2480
+ });
2481
+ }, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
2482
+ inputMode = computed(() => this.maxDecimals() > 0 ? "decimal" : "numeric", ...ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []);
2483
+ isFieldInvalid = computed(() => this.invalid() || this.hasTypingError(), ...ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []);
2484
+ constructor() {
2485
+ let previous;
2486
+ effect(() => {
2487
+ const limits = JSON.stringify([this.min(), this.max()]);
2488
+ if (previous !== void 0 && previous !== limits) this.onValidatorChange();
2489
+ previous = limits;
2490
+ });
2491
+ }
2492
+ writeValue(value) {
2493
+ this.hasTypingError.set(false);
2494
+ if (value === null || value === void 0 || value === "") {
2495
+ this.current.set(null);
2496
+ return;
2497
+ }
2498
+ const number = typeof value === "number" ? value : Number(value);
2499
+ this.current.set(Number.isFinite(number) ? number : null);
2500
+ }
2501
+ registerOnChange(fn) {
2502
+ this.onChange = fn;
2503
+ }
2504
+ registerOnTouched(fn) {
2505
+ this.onTouched = fn;
2506
+ }
2507
+ setDisabledState(isDisabled) {
2508
+ this.isDisabled.set(isDisabled);
2509
+ }
2510
+ validate(_control) {
2511
+ if (this.hasTypingError()) return { numberInvalid: true };
2512
+ const value = this.current();
2513
+ if (value === null) return null;
2514
+ const min = this.min();
2515
+ const max = this.max();
2516
+ if (min !== null && min !== void 0 && value < min) return { min: {
2517
+ min,
2518
+ actual: value
2519
+ } };
2520
+ if (max !== null && max !== void 0 && value > max) return { max: {
2521
+ max,
2522
+ actual: value
2523
+ } };
2524
+ return null;
2525
+ }
2526
+ registerOnValidatorChange(fn) {
2527
+ this.onValidatorChange = fn;
2528
+ }
2529
+ onFocus() {
2530
+ this.hasFocus.set(true);
2531
+ this.wasEdited = false;
2532
+ this.focused.emit();
2533
+ }
2534
+ onBlur() {
2535
+ this.hasFocus.set(false);
2536
+ const value = this.current();
2537
+ if (this.wasEdited && !this.hasTypingError() && value !== null) this.setValue(this.round(value));
2538
+ this.wasEdited = false;
2539
+ this.onTouched();
2540
+ this.blurred.emit();
2541
+ }
2542
+ onTyped(event) {
2543
+ const text = event.target.value;
2544
+ this.wasEdited = true;
2545
+ this.inputChanged.emit();
2546
+ const parsed = parseLocaleNumber(text, this.locale());
2547
+ if (parsed !== null && Number.isNaN(parsed)) {
2548
+ const hadValue = this.current() !== null;
2549
+ this.hasTypingError.set(true);
2550
+ this.current.set(null);
2551
+ if (hadValue) this.onChange(null);
2552
+ this.onValidatorChange();
2553
+ } else this.setValue(parsed);
2554
+ this.text.set(text);
2555
+ }
2556
+ onKeydown(event) {
2557
+ if (this.readOnly()) return;
2558
+ if (event.key === "ArrowUp" || event.key === "ArrowDown") {
2559
+ event.preventDefault();
2560
+ const direction = event.key === "ArrowUp" ? 1 : -1;
2561
+ this.setValue(this.clamp(this.round((this.current() ?? 0) + direction * this.step())));
2562
+ return;
2563
+ }
2564
+ if (event.code === "NumpadDecimal" || event.key === "Decimal") {
2565
+ event.preventDefault();
2566
+ this.insertText(event.target, getNumberSeparators(this.locale()).decimal);
1295
2567
  }
1296
2568
  }
1297
- selectMenu(menu) {
1298
- menu.isSelected = true;
1299
- this.selectionChanged.emit(menu);
1300
- if (menu.parent) this.selectMenu(menu.parent);
2569
+ setValue(value) {
2570
+ const hadTypingError = this.hasTypingError();
2571
+ this.hasTypingError.set(false);
2572
+ if (value !== this.current()) {
2573
+ this.current.set(value);
2574
+ this.onChange(value);
2575
+ } else if (hadTypingError) this.onValidatorChange();
2576
+ }
2577
+ round(value) {
2578
+ const decimals = this.maxDecimals();
2579
+ const shifted = Math.round(Number(`${value}e${decimals}`));
2580
+ const rounded = Number(`${shifted}e-${decimals}`);
2581
+ return Number.isFinite(rounded) ? rounded : value;
2582
+ }
2583
+ clamp(value) {
2584
+ const min = this.min();
2585
+ const max = this.max();
2586
+ if (min !== null && min !== void 0 && value < min) return min;
2587
+ if (max !== null && max !== void 0 && value > max) return max;
2588
+ return value;
2589
+ }
2590
+ insertText(field, text) {
2591
+ const start = field.selectionStart ?? field.value.length;
2592
+ const end = field.selectionEnd ?? field.value.length;
2593
+ field.setRangeText(text, start, end, "end");
2594
+ field.dispatchEvent(new Event("input", { bubbles: true }));
1301
2595
  }
1302
2596
  static ɵfac = i0.ɵɵngDeclareFactory({
1303
2597
  minVersion: "12.0.0",
1304
2598
  version: "22.2.0",
1305
2599
  ngImport: i0,
1306
- type: SidebarService,
2600
+ type: NumberInputComponent,
1307
2601
  deps: [],
1308
- target: i0.ɵɵFactoryTarget.Injectable
2602
+ target: i0.ɵɵFactoryTarget.Component
1309
2603
  });
1310
- static ɵprov = i0.ɵɵngDeclareInjectable({
1311
- minVersion: "12.0.0",
2604
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2605
+ minVersion: "17.0.0",
1312
2606
  version: "22.2.0",
2607
+ type: NumberInputComponent,
2608
+ isStandalone: true,
2609
+ selector: "lib-number-input",
2610
+ inputs: {
2611
+ min: {
2612
+ classPropertyName: "min",
2613
+ publicName: "min",
2614
+ isSignal: true,
2615
+ isRequired: false,
2616
+ transformFunction: null
2617
+ },
2618
+ max: {
2619
+ classPropertyName: "max",
2620
+ publicName: "max",
2621
+ isSignal: true,
2622
+ isRequired: false,
2623
+ transformFunction: null
2624
+ },
2625
+ step: {
2626
+ classPropertyName: "step",
2627
+ publicName: "step",
2628
+ isSignal: true,
2629
+ isRequired: false,
2630
+ transformFunction: null
2631
+ },
2632
+ decimals: {
2633
+ classPropertyName: "decimals",
2634
+ publicName: "decimals",
2635
+ isSignal: true,
2636
+ isRequired: false,
2637
+ transformFunction: null
2638
+ },
2639
+ minDecimals: {
2640
+ classPropertyName: "minDecimals",
2641
+ publicName: "minDecimals",
2642
+ isSignal: true,
2643
+ isRequired: false,
2644
+ transformFunction: null
2645
+ },
2646
+ grouping: {
2647
+ classPropertyName: "grouping",
2648
+ publicName: "grouping",
2649
+ isSignal: true,
2650
+ isRequired: false,
2651
+ transformFunction: null
2652
+ },
2653
+ prefix: {
2654
+ classPropertyName: "prefix",
2655
+ publicName: "prefix",
2656
+ isSignal: true,
2657
+ isRequired: false,
2658
+ transformFunction: null
2659
+ },
2660
+ suffix: {
2661
+ classPropertyName: "suffix",
2662
+ publicName: "suffix",
2663
+ isSignal: true,
2664
+ isRequired: false,
2665
+ transformFunction: null
2666
+ },
2667
+ currency: {
2668
+ classPropertyName: "currency",
2669
+ publicName: "currency",
2670
+ isSignal: true,
2671
+ isRequired: false,
2672
+ transformFunction: null
2673
+ },
2674
+ readOnly: {
2675
+ classPropertyName: "readOnly",
2676
+ publicName: "readOnly",
2677
+ isSignal: true,
2678
+ isRequired: false,
2679
+ transformFunction: null
2680
+ },
2681
+ invalid: {
2682
+ classPropertyName: "invalid",
2683
+ publicName: "invalid",
2684
+ isSignal: true,
2685
+ isRequired: false,
2686
+ transformFunction: null
2687
+ },
2688
+ ariaLabel: {
2689
+ classPropertyName: "ariaLabel",
2690
+ publicName: "ariaLabel",
2691
+ isSignal: true,
2692
+ isRequired: false,
2693
+ transformFunction: null
2694
+ }
2695
+ },
2696
+ outputs: {
2697
+ blurred: "blurred",
2698
+ focused: "focused",
2699
+ inputChanged: "inputChanged"
2700
+ },
2701
+ host: { classAttribute: "lib-number-input" },
2702
+ providers: [{
2703
+ provide: NG_VALUE_ACCESSOR,
2704
+ useExisting: forwardRef(() => NumberInputComponent),
2705
+ multi: true
2706
+ }, {
2707
+ provide: NG_VALIDATORS,
2708
+ useExisting: forwardRef(() => NumberInputComponent),
2709
+ multi: true
2710
+ }],
1313
2711
  ngImport: i0,
1314
- type: SidebarService,
1315
- providedIn: "root"
2712
+ template: "<div\n class=\"number-input-container\"\n [class.invalid]=\"isFieldInvalid()\"\n [class.disabled]=\"isDisabled()\"\n [class.read-only]=\"readOnly()\"\n>\n @if (prefixText()) {\n <span class=\"affix prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\n }\n <input\n class=\"number-field\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.inputmode]=\"inputMode()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"text()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onTyped($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (suffixText()) {\n <span class=\"affix suffix\" aria-hidden=\"true\">{{ suffixText() }}</span>\n }\n</div>\n",
2713
+ styles: ["@layer properties;:host{display:block}.number-input-container{display:flex;width:100%;align-items:stretch;border-style:var(--tw-border-style);border-width:1px;--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:var(--color-line-strong);border-radius:var(--radius-field);background-color:var(--color-surface-solid);transition-property:border-color,box-shadow;transition-duration:var(--duration-instant)}.number-input-container:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color: var(--color-focus-ring)}:host(.ng-invalid.ng-touched) .number-input-container,.number-input-container.invalid{border-color:var(--color-danger)}:host(.ng-invalid.ng-touched) .number-input-container:focus-within,.number-input-container.invalid:focus-within{--tw-ring-color: var(--color-danger)}.number-input-container.disabled,.number-input-container.read-only{background-color:var(--color-surface-inset)}.number-field{width:0px;min-width:0px;flex:1;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);text-align:right;color:var(--color-content-primary);font-size:inherit;font-variant-numeric:tabular-nums}.number-field:focus,.number-field:focus-visible{--tw-outline-style: none;outline-style:none;box-shadow:none}@media(forced-colors:active){.number-field:focus,.number-field:focus-visible{outline:2px solid transparent;outline-offset:2px}}.affix{display:inline-flex;flex-shrink:0;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 2);-webkit-user-select:none;user-select:none;color:var(--color-content-secondary)}.prefix{padding-right:0}.suffix{padding-left:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1316
2714
  });
1317
2715
  };
1318
2716
  i0.ɵɵngDeclareClassMetadata({
1319
2717
  minVersion: "12.0.0",
1320
2718
  version: "22.2.0",
1321
2719
  ngImport: i0,
1322
- type: SidebarService,
2720
+ type: NumberInputComponent,
1323
2721
  decorators: [{
1324
- type: Injectable,
1325
- args: [{ providedIn: "root" }]
1326
- }]
2722
+ type: Component,
2723
+ args: [{
2724
+ selector: "lib-number-input",
2725
+ providers: [{
2726
+ provide: NG_VALUE_ACCESSOR,
2727
+ useExisting: forwardRef(() => NumberInputComponent),
2728
+ multi: true
2729
+ }, {
2730
+ provide: NG_VALIDATORS,
2731
+ useExisting: forwardRef(() => NumberInputComponent),
2732
+ multi: true
2733
+ }],
2734
+ host: { class: "lib-number-input" },
2735
+ template: "<div\n class=\"number-input-container\"\n [class.invalid]=\"isFieldInvalid()\"\n [class.disabled]=\"isDisabled()\"\n [class.read-only]=\"readOnly()\"\n>\n @if (prefixText()) {\n <span class=\"affix prefix\" aria-hidden=\"true\">{{ prefixText() }}</span>\n }\n <input\n class=\"number-field\"\n type=\"text\"\n autocomplete=\"off\"\n [attr.aria-invalid]=\"isFieldInvalid() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.inputmode]=\"inputMode()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readOnly()\"\n [value]=\"text()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onTyped($event)\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (suffixText()) {\n <span class=\"affix suffix\" aria-hidden=\"true\">{{ suffixText() }}</span>\n }\n</div>\n",
2736
+ styles: ["@layer properties;:host{display:block}.number-input-container{display:flex;width:100%;align-items:stretch;border-style:var(--tw-border-style);border-width:1px;--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:var(--color-line-strong);border-radius:var(--radius-field);background-color:var(--color-surface-solid);transition-property:border-color,box-shadow;transition-duration:var(--duration-instant)}.number-input-container:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color: var(--color-focus-ring)}:host(.ng-invalid.ng-touched) .number-input-container,.number-input-container.invalid{border-color:var(--color-danger)}:host(.ng-invalid.ng-touched) .number-input-container:focus-within,.number-input-container.invalid:focus-within{--tw-ring-color: var(--color-danger)}.number-input-container.disabled,.number-input-container.read-only{background-color:var(--color-surface-inset)}.number-field{width:0px;min-width:0px;flex:1;border-style:var(--tw-border-style);border-width:0px;background-color:transparent;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);text-align:right;color:var(--color-content-primary);font-size:inherit;font-variant-numeric:tabular-nums}.number-field:focus,.number-field:focus-visible{--tw-outline-style: none;outline-style:none;box-shadow:none}@media(forced-colors:active){.number-field:focus,.number-field:focus-visible{outline:2px solid transparent;outline-offset:2px}}.affix{display:inline-flex;flex-shrink:0;align-items:center;padding-inline:calc(var(--spacing, .25rem) * 2);-webkit-user-select:none;user-select:none;color:var(--color-content-secondary)}.prefix{padding-right:0}.suffix{padding-left:0}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
2737
+ }]
2738
+ }],
2739
+ ctorParameters: () => [],
2740
+ propDecorators: {
2741
+ min: [{
2742
+ type: i0.Input,
2743
+ args: [{
2744
+ isSignal: true,
2745
+ alias: "min",
2746
+ required: false
2747
+ }]
2748
+ }],
2749
+ max: [{
2750
+ type: i0.Input,
2751
+ args: [{
2752
+ isSignal: true,
2753
+ alias: "max",
2754
+ required: false
2755
+ }]
2756
+ }],
2757
+ step: [{
2758
+ type: i0.Input,
2759
+ args: [{
2760
+ isSignal: true,
2761
+ alias: "step",
2762
+ required: false
2763
+ }]
2764
+ }],
2765
+ decimals: [{
2766
+ type: i0.Input,
2767
+ args: [{
2768
+ isSignal: true,
2769
+ alias: "decimals",
2770
+ required: false
2771
+ }]
2772
+ }],
2773
+ minDecimals: [{
2774
+ type: i0.Input,
2775
+ args: [{
2776
+ isSignal: true,
2777
+ alias: "minDecimals",
2778
+ required: false
2779
+ }]
2780
+ }],
2781
+ grouping: [{
2782
+ type: i0.Input,
2783
+ args: [{
2784
+ isSignal: true,
2785
+ alias: "grouping",
2786
+ required: false
2787
+ }]
2788
+ }],
2789
+ prefix: [{
2790
+ type: i0.Input,
2791
+ args: [{
2792
+ isSignal: true,
2793
+ alias: "prefix",
2794
+ required: false
2795
+ }]
2796
+ }],
2797
+ suffix: [{
2798
+ type: i0.Input,
2799
+ args: [{
2800
+ isSignal: true,
2801
+ alias: "suffix",
2802
+ required: false
2803
+ }]
2804
+ }],
2805
+ currency: [{
2806
+ type: i0.Input,
2807
+ args: [{
2808
+ isSignal: true,
2809
+ alias: "currency",
2810
+ required: false
2811
+ }]
2812
+ }],
2813
+ readOnly: [{
2814
+ type: i0.Input,
2815
+ args: [{
2816
+ isSignal: true,
2817
+ alias: "readOnly",
2818
+ required: false
2819
+ }]
2820
+ }],
2821
+ invalid: [{
2822
+ type: i0.Input,
2823
+ args: [{
2824
+ isSignal: true,
2825
+ alias: "invalid",
2826
+ required: false
2827
+ }]
2828
+ }],
2829
+ ariaLabel: [{
2830
+ type: i0.Input,
2831
+ args: [{
2832
+ isSignal: true,
2833
+ alias: "ariaLabel",
2834
+ required: false
2835
+ }]
2836
+ }],
2837
+ blurred: [{
2838
+ type: i0.Output,
2839
+ args: ["blurred"]
2840
+ }],
2841
+ focused: [{
2842
+ type: i0.Output,
2843
+ args: ["focused"]
2844
+ }],
2845
+ inputChanged: [{
2846
+ type: i0.Output,
2847
+ args: ["inputChanged"]
2848
+ }]
2849
+ }
1327
2850
  });
1328
2851
  var FormInputComponent = class FormInputComponent extends BaseComponent {
1329
2852
  autofocus = input(false, ...ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []);
@@ -1349,6 +2872,8 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1349
2872
  formGroupDirective = inject(FormGroupDirective);
1350
2873
  formGroupName = inject(FormGroupName, { optional: true });
1351
2874
  formService = inject(FormService);
2875
+ angularLocale = inject(LOCALE_ID);
2876
+ localeService = inject(LocaleService);
1352
2877
  formChanged = signal(0, ...ngDevMode ? [{ debugName: "formChanged" }] : /* istanbul ignore next */ []);
1353
2878
  isEditable = computed(() => {
1354
2879
  this.formChanged();
@@ -1360,6 +2885,12 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1360
2885
  this.formChanged();
1361
2886
  return this.fixedValue() ?? this.formGroupDirective.form?.get(this.disabledControlName() ?? this.controlName())?.value;
1362
2887
  }, ...ngDevMode ? [{ debugName: "shownValue" }] : /* istanbul ignore next */ []);
2888
+ shownText = computed(() => this.toDisplayText(this.shownValue()), ...ngDevMode ? [{ debugName: "shownText" }] : /* istanbul ignore next */ []);
2889
+ fixedText = computed(() => this.toDisplayText(this.fixedValue()), ...ngDevMode ? [{ debugName: "fixedText" }] : /* istanbul ignore next */ []);
2890
+ numberDigits = computed(() => parseDigitsInfo(this.format()) ?? {
2891
+ minFractionDigits: 0,
2892
+ maxFractionDigits: 3
2893
+ }, ...ngDevMode ? [{ debugName: "numberDigits" }] : /* istanbul ignore next */ []);
1363
2894
  get formControl() {
1364
2895
  return this.controlName() ? this.formGroup.get(this.controlName()) : null;
1365
2896
  }
@@ -1396,15 +2927,13 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1396
2927
  if (value !== null && value === "") this.formControl?.setValue(null);
1397
2928
  });
1398
2929
  break;
1399
- case "date":
1400
- if (this.format() === void 0) this.format.set("yyyy-MM-dd");
1401
- if (this.formControl) this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value) => {
1402
- if (value !== null) try {
1403
- if (value !== formatDate(value, "yyyy-MM-dd", "en")) this.formControl?.setValue(formatDate(value, "yyyy-MM-dd", "en"), { emitEvent: false });
1404
- } catch {
1405
- this.formControl?.setValue(null, { emitEvent: false });
1406
- }
1407
- });
2930
+ case "date": if (this.formControl) this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value) => {
2931
+ if (value !== null) try {
2932
+ if (value !== formatDate(value, "yyyy-MM-dd", "en")) this.formControl?.setValue(formatDate(value, "yyyy-MM-dd", "en"), { emitEvent: false });
2933
+ } catch {
2934
+ this.formControl?.setValue(null, { emitEvent: false });
2935
+ }
2936
+ });
1408
2937
  }
1409
2938
  }
1410
2939
  onBlur() {
@@ -1423,6 +2952,26 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1423
2952
  this.fixedValue.set(newText);
1424
2953
  this.fixedValueChanged.emit(newText);
1425
2954
  }
2955
+ toDisplayText(value) {
2956
+ if (value === null || value === void 0 || value === "") return "";
2957
+ const locale = this.localeService.locale();
2958
+ const format = this.format();
2959
+ switch (this.type()) {
2960
+ case "date":
2961
+ case "datetime-local": {
2962
+ const date = parseIsoValue(value);
2963
+ if (!date) return String(value);
2964
+ if (format) return formatDate(date, format, this.angularLocale);
2965
+ const day = formatDateText(date, locale);
2966
+ return this.type() === "date" ? day : `${day} ${formatTimeText(date, locale)}`;
2967
+ }
2968
+ case "number": {
2969
+ const number = typeof value === "number" ? value : Number(value);
2970
+ return Number.isFinite(number) ? formatLocaleNumber(number, locale, this.numberDigits()) : String(value);
2971
+ }
2972
+ default: return String(value);
2973
+ }
2974
+ }
1426
2975
  static ɵfac = i0.ɵɵngDeclareFactory({
1427
2976
  minVersion: "12.0.0",
1428
2977
  version: "22.2.0",
@@ -1559,7 +3108,7 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1559
3108
  } },
1560
3109
  usesInheritance: true,
1561
3110
  ngImport: i0,
1562
- template: "@if (isEditable()) {\n @switch (type()) {\n @case ('textarea') {\n <textarea\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.rows]=\"rows()\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n ></textarea>\n }\n @case ('checkbox') {\n @if (isFormControl) {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [(ngModel)]=\"fixedValue\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n @default {\n @if (isFormControl) {\n <input\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"readOnly() ? true : null\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [formControlName]=\"controlName()\"\n [type]=\"type()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n type=\"text\"\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"true\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"\n type() === 'date' || type() === 'datetime-local'\n ? (fixedValue() | date: format())\n : type() === 'number'\n ? (fixedValue() | number)\n : fixedValue()\n \"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n }\n} @else {\n @switch (type()) {\n @case ('checkbox') {\n <span class=\"value\">\n <i [ngClass]=\"shownValue() ? 'fa-solid fa-square-check' : 'fa-regular fa-square'\"></i>\n </span>\n }\n @case ('date') {\n <span class=\"value\">\n {{ shownValue() | date: format() }}\n </span>\n }\n @case ('datetime-local') {\n <span class=\"value\">\n {{ shownValue() | date: format() }}\n </span>\n }\n @case ('number') {\n <span class=\"value\">\n {{ shownValue() | number: format() }}\n </span>\n }\n @default {\n <span class=\"value text\">{{ shownValue() }}</span>\n }\n }\n}\n\n<ng-template #fixedTextbox let-fixedValue=\"fixedValue\"> </ng-template>\n",
3111
+ template: "@if (isEditable()) {\n @switch (type()) {\n @case ('textarea') {\n <textarea\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.rows]=\"rows()\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n ></textarea>\n }\n @case ('checkbox') {\n @if (isFormControl) {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [(ngModel)]=\"fixedValue\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n @case ('number') {\n @if (isFormControl) {\n <lib-number-input\n [decimals]=\"numberDigits().maxFractionDigits\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [minDecimals]=\"numberDigits().minFractionDigits\"\n [min]=\"min()\"\n [readOnly]=\"readOnly()\"\n [step]=\"step()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-number-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @case ('date') {\n @if (isFormControl) {\n <lib-date-input\n mode=\"date\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [readOnly]=\"readOnly()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-date-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @case ('datetime-local') {\n @if (isFormControl) {\n <lib-date-input\n mode=\"datetime\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [readOnly]=\"readOnly()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-date-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @default {\n @if (isFormControl) {\n <input\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"readOnly() ? true : null\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [formControlName]=\"controlName()\"\n [type]=\"type()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n type=\"text\"\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"true\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"fixedValue()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n }\n} @else {\n @switch (type()) {\n @case ('checkbox') {\n <span class=\"value\">\n <i [ngClass]=\"shownValue() ? 'fa-solid fa-square-check' : 'fa-regular fa-square'\"></i>\n </span>\n }\n @case ('date') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @case ('datetime-local') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @case ('number') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @default {\n <span class=\"value text\">{{ shownValue() }}</span>\n }\n }\n}\n\n<!-- A date or number shown from `fixedValue`: read-only text, formatted in the application's language. -->\n<ng-template #fixedTextbox>\n <input\n type=\"text\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [value]=\"fixedText()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n</ng-template>\n",
1563
3112
  styles: ["@layer properties;:host{display:block}:host.full-height{height:100%}:host.full-height textarea{height:100%}input,textarea{border-color:var(--color-line-strong)}input:focus-visible,textarea:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){input:focus-visible,textarea:focus-visible{outline:2px solid transparent;outline-offset:2px}}input,textarea{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))}input:invalid,textarea:invalid{border-color:var(--color-danger)}input:disabled,input.readonly-as-disabled[readonly],textarea:disabled,textarea.readonly-as-disabled[readonly]{background-color:var(--color-surface-inset)}input.ng-invalid.ng-touched,input.invalid,textarea.ng-invalid.ng-touched,textarea.invalid{border-color:var(--color-danger)}input[type=text],input[type=number],input[type=password],input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=month],input[type=tel],input[type=time],input[type=url],input[type=week],textarea{display:block;width:100%;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--radius-field)}input[type=text].ng-invalid.ng-touched,input[type=text].invalid,input[type=number].ng-invalid.ng-touched,input[type=number].invalid,input[type=password].ng-invalid.ng-touched,input[type=password].invalid,input[type=date].ng-invalid.ng-touched,input[type=date].invalid,input[type=datetime-local].ng-invalid.ng-touched,input[type=datetime-local].invalid,input[type=email].ng-invalid.ng-touched,input[type=email].invalid,input[type=file].ng-invalid.ng-touched,input[type=file].invalid,input[type=month].ng-invalid.ng-touched,input[type=month].invalid,input[type=tel].ng-invalid.ng-touched,input[type=tel].invalid,input[type=time].ng-invalid.ng-touched,input[type=time].invalid,input[type=url].ng-invalid.ng-touched,input[type=url].invalid,input[type=week].ng-invalid.ng-touched,input[type=week].invalid,textarea.ng-invalid.ng-touched,textarea.invalid{margin-right:calc(var(--spacing, .25rem) * -9);padding-right:calc(var(--spacing, .25rem) * 9);transition-property:none}input[type=text].ng-invalid.ng-touched:focus-visible,input[type=text].invalid:focus-visible,input[type=number].ng-invalid.ng-touched:focus-visible,input[type=number].invalid:focus-visible,input[type=password].ng-invalid.ng-touched:focus-visible,input[type=password].invalid:focus-visible,input[type=date].ng-invalid.ng-touched:focus-visible,input[type=date].invalid:focus-visible,input[type=datetime-local].ng-invalid.ng-touched:focus-visible,input[type=datetime-local].invalid:focus-visible,input[type=email].ng-invalid.ng-touched:focus-visible,input[type=email].invalid:focus-visible,input[type=file].ng-invalid.ng-touched:focus-visible,input[type=file].invalid:focus-visible,input[type=month].ng-invalid.ng-touched:focus-visible,input[type=month].invalid:focus-visible,input[type=tel].ng-invalid.ng-touched:focus-visible,input[type=tel].invalid:focus-visible,input[type=time].ng-invalid.ng-touched:focus-visible,input[type=time].invalid:focus-visible,input[type=url].ng-invalid.ng-touched:focus-visible,input[type=url].invalid:focus-visible,input[type=week].ng-invalid.ng-touched:focus-visible,input[type=week].invalid:focus-visible,textarea.ng-invalid.ng-touched:focus-visible,textarea.invalid:focus-visible{--tw-ring-color: var(--color-danger)}input[type=text].ng-invalid.ng-touched,input[type=text].invalid,input[type=number].ng-invalid.ng-touched,input[type=number].invalid,input[type=password].ng-invalid.ng-touched,input[type=password].invalid,input[type=date].ng-invalid.ng-touched,input[type=date].invalid,input[type=datetime-local].ng-invalid.ng-touched,input[type=datetime-local].invalid,input[type=email].ng-invalid.ng-touched,input[type=email].invalid,input[type=file].ng-invalid.ng-touched,input[type=file].invalid,input[type=month].ng-invalid.ng-touched,input[type=month].invalid,input[type=tel].ng-invalid.ng-touched,input[type=tel].invalid,input[type=time].ng-invalid.ng-touched,input[type=time].invalid,input[type=url].ng-invalid.ng-touched,input[type=url].invalid,input[type=week].ng-invalid.ng-touched,input[type=week].invalid,textarea.ng-invalid.ng-touched,textarea.invalid{background-size:1.125rem 1.125rem;background-position:right .5625rem center;background-repeat:no-repeat;background-image:url(\"data:image/svg+xml,%3csvg class='text-white' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\")}input[type=checkbox]{position:relative;margin-block:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 5);width:calc(var(--spacing, .25rem) * 5);border-radius:var(--radius-sm, .25rem);padding:calc(var(--spacing, .25rem) * .5);display:inline-flex;flex-direction:row;justify-content:flex-end;appearance:none;background-color:var(--color-surface-solid)}input[type=checkbox]:disabled{pointer-events:none}input[type=checkbox]:disabled{opacity:50%}input[type=checkbox]:not(.switch){border-style:var(--tw-border-style);border-width:2px;--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}input[type=checkbox]:not(.switch):focus-visible{--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}input[type=checkbox]:not(.switch):before{border-radius:var(--radius-sm, .25rem);--tw-content: \"\";content:var(--tw-content);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing, .25rem);font-family:var(--fa-family-classic, \"Font Awesome 6 Free\");font-weight:900}input[type=checkbox]:checked{background-image:none;background-color:var(--color-accent);border-color:var(--color-accent)}input[type=checkbox]:checked:before{--tw-content: \"\\f00c\";content:var(--tw-content);color:var(--color-content-on-accent)}input[type=checkbox]:disabled~label{opacity:50%}input[type=checkbox]~label{margin-left:calc(var(--spacing, .25rem) * 2);-webkit-user-select:none;user-select:none}input[type=checkbox].switch{height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 12);border-radius:2rem;appearance:none;background-color:var(--color-surface-solid)}input[type=checkbox].switch:before{aspect-ratio:1 / 1;height:100%;border-radius:calc(infinity * 1px);--tw-content: \"\";content:var(--tw-content);background-color:var(--color-content-subtle)}input[type=checkbox].switch:after{flex-grow:1;--tw-content: \"\";content:var(--tw-content);transition:flex-grow .15s ease-in-out}input[type=checkbox].switch:focus-visible:before{background-color:var(--color-accent)}input[type=checkbox].switch:checked{background-image:none;background-color:var(--color-accent);border-color:var(--color-accent)}input[type=checkbox].switch:checked:before{--tw-content: \"\";content:var(--tw-content);background-color:var(--color-surface-solid)}input[type=checkbox].switch:checked:after{flex-grow:0}label,.value{display:block;padding-block:var(--spacing, .25rem);overflow-wrap:break-word}label.text,.value.text{white-space:pre-wrap}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-content{syntax: \"*\"; inherits: false; initial-value: \"\";}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid;--tw-content: \"\"}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
1564
3113
  dependencies: [
1565
3114
  {
@@ -1572,6 +3121,34 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1572
3121
  selector: "[ngClass]",
1573
3122
  inputs: ["class", "ngClass"]
1574
3123
  },
3124
+ {
3125
+ kind: "directive",
3126
+ type: i1$1.NgTemplateOutlet,
3127
+ selector: "[ngTemplateOutlet]",
3128
+ inputs: [
3129
+ "ngTemplateOutletContext",
3130
+ "ngTemplateOutlet",
3131
+ "ngTemplateOutletInjector"
3132
+ ]
3133
+ },
3134
+ {
3135
+ kind: "component",
3136
+ type: DateInputComponent,
3137
+ selector: "lib-date-input",
3138
+ inputs: [
3139
+ "mode",
3140
+ "min",
3141
+ "max",
3142
+ "readOnly",
3143
+ "invalid",
3144
+ "ariaLabel"
3145
+ ],
3146
+ outputs: [
3147
+ "blurred",
3148
+ "focused",
3149
+ "inputChanged"
3150
+ ]
3151
+ },
1575
3152
  {
1576
3153
  kind: "ngmodule",
1577
3154
  type: FormsModule
@@ -1601,8 +3178,32 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1601
3178
  "ngModel",
1602
3179
  "ngModelOptions"
1603
3180
  ],
1604
- outputs: ["ngModelChange"],
1605
- exportAs: ["ngModel"]
3181
+ outputs: ["ngModelChange"],
3182
+ exportAs: ["ngModel"]
3183
+ },
3184
+ {
3185
+ kind: "component",
3186
+ type: NumberInputComponent,
3187
+ selector: "lib-number-input",
3188
+ inputs: [
3189
+ "min",
3190
+ "max",
3191
+ "step",
3192
+ "decimals",
3193
+ "minDecimals",
3194
+ "grouping",
3195
+ "prefix",
3196
+ "suffix",
3197
+ "currency",
3198
+ "readOnly",
3199
+ "invalid",
3200
+ "ariaLabel"
3201
+ ],
3202
+ outputs: [
3203
+ "blurred",
3204
+ "focused",
3205
+ "inputChanged"
3206
+ ]
1606
3207
  },
1607
3208
  {
1608
3209
  kind: "ngmodule",
@@ -1618,16 +3219,6 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
1618
3219
  "ngModel"
1619
3220
  ],
1620
3221
  outputs: ["ngModelChange"]
1621
- },
1622
- {
1623
- kind: "pipe",
1624
- type: i1$1.DecimalPipe,
1625
- name: "number"
1626
- },
1627
- {
1628
- kind: "pipe",
1629
- type: i1$1.DatePipe,
1630
- name: "date"
1631
3222
  }
1632
3223
  ],
1633
3224
  viewProviders: [{
@@ -1647,7 +3238,9 @@ i0.ɵɵngDeclareClassMetadata({
1647
3238
  selector: "lib-form-input",
1648
3239
  imports: [
1649
3240
  CommonModule,
3241
+ DateInputComponent,
1650
3242
  FormsModule,
3243
+ NumberInputComponent,
1651
3244
  ReactiveFormsModule
1652
3245
  ],
1653
3246
  viewProviders: [{
@@ -1658,7 +3251,7 @@ i0.ɵɵngDeclareClassMetadata({
1658
3251
  "[class.full-height]": "isFullHeight()",
1659
3252
  "[attr.type]": "null"
1660
3253
  },
1661
- template: "@if (isEditable()) {\n @switch (type()) {\n @case ('textarea') {\n <textarea\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.rows]=\"rows()\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n ></textarea>\n }\n @case ('checkbox') {\n @if (isFormControl) {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [(ngModel)]=\"fixedValue\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n @default {\n @if (isFormControl) {\n <input\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"readOnly() ? true : null\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [formControlName]=\"controlName()\"\n [type]=\"type()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n type=\"text\"\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"true\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"\n type() === 'date' || type() === 'datetime-local'\n ? (fixedValue() | date: format())\n : type() === 'number'\n ? (fixedValue() | number)\n : fixedValue()\n \"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n }\n} @else {\n @switch (type()) {\n @case ('checkbox') {\n <span class=\"value\">\n <i [ngClass]=\"shownValue() ? 'fa-solid fa-square-check' : 'fa-regular fa-square'\"></i>\n </span>\n }\n @case ('date') {\n <span class=\"value\">\n {{ shownValue() | date: format() }}\n </span>\n }\n @case ('datetime-local') {\n <span class=\"value\">\n {{ shownValue() | date: format() }}\n </span>\n }\n @case ('number') {\n <span class=\"value\">\n {{ shownValue() | number: format() }}\n </span>\n }\n @default {\n <span class=\"value text\">{{ shownValue() }}</span>\n }\n }\n}\n\n<ng-template #fixedTextbox let-fixedValue=\"fixedValue\"> </ng-template>\n",
3254
+ template: "@if (isEditable()) {\n @switch (type()) {\n @case ('textarea') {\n <textarea\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.rows]=\"rows()\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n ></textarea>\n }\n @case ('checkbox') {\n @if (isFormControl) {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [class.invalid]=\"invalid()\"\n [formControlName]=\"controlName()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n class=\"switch\"\n type=\"checkbox\"\n [(ngModel)]=\"fixedValue\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n @case ('number') {\n @if (isFormControl) {\n <lib-number-input\n [decimals]=\"numberDigits().maxFractionDigits\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [minDecimals]=\"numberDigits().minFractionDigits\"\n [min]=\"min()\"\n [readOnly]=\"readOnly()\"\n [step]=\"step()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-number-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @case ('date') {\n @if (isFormControl) {\n <lib-date-input\n mode=\"date\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [readOnly]=\"readOnly()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-date-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @case ('datetime-local') {\n @if (isFormControl) {\n <lib-date-input\n mode=\"datetime\"\n [formControlName]=\"controlName()\"\n [invalid]=\"invalid()\"\n [readOnly]=\"readOnly()\"\n (blurred)=\"onBlur()\"\n (focused)=\"onFocus()\"\n (inputChanged)=\"onInput()\"\n ></lib-date-input>\n } @else {\n <ng-container *ngTemplateOutlet=\"fixedTextbox\"></ng-container>\n }\n }\n @default {\n @if (isFormControl) {\n <input\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"readOnly() ? true : null\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [formControlName]=\"controlName()\"\n [type]=\"type()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n />\n } @else {\n <input\n type=\"text\"\n [attr.maxLength]=\"maxLength() ?? null\"\n [attr.min]=\"minAttributeValue\"\n [attr.readonly]=\"true\"\n [attr.step]=\"stepAttributeValue\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"fixedValue()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n (input)=\"onInput()\"\n (ngModelChange)=\"onValueChanged($event)\"\n />\n }\n }\n }\n} @else {\n @switch (type()) {\n @case ('checkbox') {\n <span class=\"value\">\n <i [ngClass]=\"shownValue() ? 'fa-solid fa-square-check' : 'fa-regular fa-square'\"></i>\n </span>\n }\n @case ('date') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @case ('datetime-local') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @case ('number') {\n <span class=\"value\">\n {{ shownText() }}\n </span>\n }\n @default {\n <span class=\"value text\">{{ shownValue() }}</span>\n }\n }\n}\n\n<!-- A date or number shown from `fixedValue`: read-only text, formatted in the application's language. -->\n<ng-template #fixedTextbox>\n <input\n type=\"text\"\n [attr.readonly]=\"true\"\n [class.invalid]=\"invalid()\"\n [class.readonly-as-disabled]=\"displayReadOnlyAsDisabled()\"\n [disabled]=\"isDisabled()\"\n [value]=\"fixedText()\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n />\n</ng-template>\n",
1662
3255
  styles: ["@layer properties;:host{display:block}:host.full-height{height:100%}:host.full-height textarea{height:100%}input,textarea{border-color:var(--color-line-strong)}input:focus-visible,textarea:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(var(--focus-ring-width) + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style: none;outline-style:none;--tw-ring-color: var(--color-focus-ring)}@media(forced-colors:active){input:focus-visible,textarea:focus-visible{outline:2px solid transparent;outline-offset:2px}}input,textarea{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))}input:invalid,textarea:invalid{border-color:var(--color-danger)}input:disabled,input.readonly-as-disabled[readonly],textarea:disabled,textarea.readonly-as-disabled[readonly]{background-color:var(--color-surface-inset)}input.ng-invalid.ng-touched,input.invalid,textarea.ng-invalid.ng-touched,textarea.invalid{border-color:var(--color-danger)}input[type=text],input[type=number],input[type=password],input[type=date],input[type=datetime-local],input[type=email],input[type=file],input[type=month],input[type=tel],input[type=time],input[type=url],input[type=week],textarea{display:block;width:100%;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--radius-field)}input[type=text].ng-invalid.ng-touched,input[type=text].invalid,input[type=number].ng-invalid.ng-touched,input[type=number].invalid,input[type=password].ng-invalid.ng-touched,input[type=password].invalid,input[type=date].ng-invalid.ng-touched,input[type=date].invalid,input[type=datetime-local].ng-invalid.ng-touched,input[type=datetime-local].invalid,input[type=email].ng-invalid.ng-touched,input[type=email].invalid,input[type=file].ng-invalid.ng-touched,input[type=file].invalid,input[type=month].ng-invalid.ng-touched,input[type=month].invalid,input[type=tel].ng-invalid.ng-touched,input[type=tel].invalid,input[type=time].ng-invalid.ng-touched,input[type=time].invalid,input[type=url].ng-invalid.ng-touched,input[type=url].invalid,input[type=week].ng-invalid.ng-touched,input[type=week].invalid,textarea.ng-invalid.ng-touched,textarea.invalid{margin-right:calc(var(--spacing, .25rem) * -9);padding-right:calc(var(--spacing, .25rem) * 9);transition-property:none}input[type=text].ng-invalid.ng-touched:focus-visible,input[type=text].invalid:focus-visible,input[type=number].ng-invalid.ng-touched:focus-visible,input[type=number].invalid:focus-visible,input[type=password].ng-invalid.ng-touched:focus-visible,input[type=password].invalid:focus-visible,input[type=date].ng-invalid.ng-touched:focus-visible,input[type=date].invalid:focus-visible,input[type=datetime-local].ng-invalid.ng-touched:focus-visible,input[type=datetime-local].invalid:focus-visible,input[type=email].ng-invalid.ng-touched:focus-visible,input[type=email].invalid:focus-visible,input[type=file].ng-invalid.ng-touched:focus-visible,input[type=file].invalid:focus-visible,input[type=month].ng-invalid.ng-touched:focus-visible,input[type=month].invalid:focus-visible,input[type=tel].ng-invalid.ng-touched:focus-visible,input[type=tel].invalid:focus-visible,input[type=time].ng-invalid.ng-touched:focus-visible,input[type=time].invalid:focus-visible,input[type=url].ng-invalid.ng-touched:focus-visible,input[type=url].invalid:focus-visible,input[type=week].ng-invalid.ng-touched:focus-visible,input[type=week].invalid:focus-visible,textarea.ng-invalid.ng-touched:focus-visible,textarea.invalid:focus-visible{--tw-ring-color: var(--color-danger)}input[type=text].ng-invalid.ng-touched,input[type=text].invalid,input[type=number].ng-invalid.ng-touched,input[type=number].invalid,input[type=password].ng-invalid.ng-touched,input[type=password].invalid,input[type=date].ng-invalid.ng-touched,input[type=date].invalid,input[type=datetime-local].ng-invalid.ng-touched,input[type=datetime-local].invalid,input[type=email].ng-invalid.ng-touched,input[type=email].invalid,input[type=file].ng-invalid.ng-touched,input[type=file].invalid,input[type=month].ng-invalid.ng-touched,input[type=month].invalid,input[type=tel].ng-invalid.ng-touched,input[type=tel].invalid,input[type=time].ng-invalid.ng-touched,input[type=time].invalid,input[type=url].ng-invalid.ng-touched,input[type=url].invalid,input[type=week].ng-invalid.ng-touched,input[type=week].invalid,textarea.ng-invalid.ng-touched,textarea.invalid{background-size:1.125rem 1.125rem;background-position:right .5625rem center;background-repeat:no-repeat;background-image:url(\"data:image/svg+xml,%3csvg class='text-white' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\")}input[type=checkbox]{position:relative;margin-block:var(--spacing, .25rem);height:calc(var(--spacing, .25rem) * 5);width:calc(var(--spacing, .25rem) * 5);border-radius:var(--radius-sm, .25rem);padding:calc(var(--spacing, .25rem) * .5);display:inline-flex;flex-direction:row;justify-content:flex-end;appearance:none;background-color:var(--color-surface-solid)}input[type=checkbox]:disabled{pointer-events:none}input[type=checkbox]:disabled{opacity:50%}input[type=checkbox]:not(.switch){border-style:var(--tw-border-style);border-width:2px;--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}input[type=checkbox]:not(.switch):focus-visible{--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}input[type=checkbox]:not(.switch):before{border-radius:var(--radius-sm, .25rem);--tw-content: \"\";content:var(--tw-content);position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--spacing, .25rem);font-family:var(--fa-family-classic, \"Font Awesome 6 Free\");font-weight:900}input[type=checkbox]:checked{background-image:none;background-color:var(--color-accent);border-color:var(--color-accent)}input[type=checkbox]:checked:before{--tw-content: \"\\f00c\";content:var(--tw-content);color:var(--color-content-on-accent)}input[type=checkbox]:disabled~label{opacity:50%}input[type=checkbox]~label{margin-left:calc(var(--spacing, .25rem) * 2);-webkit-user-select:none;user-select:none}input[type=checkbox].switch{height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 12);border-radius:2rem;appearance:none;background-color:var(--color-surface-solid)}input[type=checkbox].switch:before{aspect-ratio:1 / 1;height:100%;border-radius:calc(infinity * 1px);--tw-content: \"\";content:var(--tw-content);background-color:var(--color-content-subtle)}input[type=checkbox].switch:after{flex-grow:1;--tw-content: \"\";content:var(--tw-content);transition:flex-grow .15s ease-in-out}input[type=checkbox].switch:focus-visible:before{background-color:var(--color-accent)}input[type=checkbox].switch:checked{background-image:none;background-color:var(--color-accent);border-color:var(--color-accent)}input[type=checkbox].switch:checked:before{--tw-content: \"\";content:var(--tw-content);background-color:var(--color-surface-solid)}input[type=checkbox].switch:checked:after{flex-grow:0}label,.value{display:block;padding-block:var(--spacing, .25rem);overflow-wrap:break-word}label.text,.value.text{white-space:pre-wrap}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-content{syntax: \"*\"; inherits: false; initial-value: \"\";}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-border-style: solid;--tw-content: \"\"}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
1663
3256
  }]
1664
3257
  }],
@@ -1812,6 +3405,129 @@ i0.ɵɵngDeclareClassMetadata({
1812
3405
  }]
1813
3406
  }
1814
3407
  });
3408
+ var SkeletonComponent = class SkeletonComponent {
3409
+ shape = input("text", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
3410
+ lines = input(1, ...ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []);
3411
+ width = input(...ngDevMode ? [void 0, { debugName: "width" }] : /* istanbul ignore next */ []);
3412
+ height = input(...ngDevMode ? [void 0, { debugName: "height" }] : /* istanbul ignore next */ []);
3413
+ lineIndexes = computed(() => Array.from({ length: Math.max(1, Math.floor(this.lines() || 1)) }, (_, index) => index), ...ngDevMode ? [{ debugName: "lineIndexes" }] : /* istanbul ignore next */ []);
3414
+ static ɵfac = i0.ɵɵngDeclareFactory({
3415
+ minVersion: "12.0.0",
3416
+ version: "22.2.0",
3417
+ ngImport: i0,
3418
+ type: SkeletonComponent,
3419
+ deps: [],
3420
+ target: i0.ɵɵFactoryTarget.Component
3421
+ });
3422
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3423
+ minVersion: "17.0.0",
3424
+ version: "22.2.0",
3425
+ type: SkeletonComponent,
3426
+ isStandalone: true,
3427
+ selector: "lib-skeleton",
3428
+ inputs: {
3429
+ shape: {
3430
+ classPropertyName: "shape",
3431
+ publicName: "shape",
3432
+ isSignal: true,
3433
+ isRequired: false,
3434
+ transformFunction: null
3435
+ },
3436
+ lines: {
3437
+ classPropertyName: "lines",
3438
+ publicName: "lines",
3439
+ isSignal: true,
3440
+ isRequired: false,
3441
+ transformFunction: null
3442
+ },
3443
+ width: {
3444
+ classPropertyName: "width",
3445
+ publicName: "width",
3446
+ isSignal: true,
3447
+ isRequired: false,
3448
+ transformFunction: null
3449
+ },
3450
+ height: {
3451
+ classPropertyName: "height",
3452
+ publicName: "height",
3453
+ isSignal: true,
3454
+ isRequired: false,
3455
+ transformFunction: null
3456
+ }
3457
+ },
3458
+ host: {
3459
+ attributes: { "aria-hidden": "true" },
3460
+ properties: {
3461
+ "class.shape-text": "shape() === 'text'",
3462
+ "class.shape-block": "shape() === 'block'",
3463
+ "class.shape-circle": "shape() === 'circle'",
3464
+ "style.width": "width() ?? null",
3465
+ "style.height": "shape() === 'text' ? null : (height() ?? null)"
3466
+ },
3467
+ classAttribute: "lib-skeleton"
3468
+ },
3469
+ ngImport: i0,
3470
+ template: "@if (shape() === 'text') {\n @for (line of lineIndexes(); track line) {\n <span class=\"lib-skeleton-line\" [style.height]=\"height() ?? null\"></span>\n }\n}\n",
3471
+ styles: [":host{--lib-skeleton-fill: color-mix(in srgb, oklch(70.7% .022 261.325) 35%, transparent);display:block;animation:var(--animate-pulse, pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}@supports (color: color-mix(in lab,red,red)){:host{--lib-skeleton-fill: color-mix(in srgb, var(--color-content-subtle) 35%, transparent)}}:host-context([data-theme=dark]){--lib-skeleton-fill: var(--color-surface-inset)}:host(.shape-text){display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.lib-skeleton-line{display:block;height:calc(var(--spacing, .25rem) * 2.5);width:100%;border-radius:calc(infinity * 1px);background-color:var(--lib-skeleton-fill)}.lib-skeleton-line:last-child:not(:first-child){width:calc(3 / 5 * 100%)}:host(.shape-block){height:calc(var(--spacing, .25rem) * 16);width:100%;border-radius:var(--radius-field);background-color:var(--lib-skeleton-fill)}:host(.shape-circle){width:calc(var(--spacing, .25rem) * 10);flex-shrink:0;border-radius:calc(infinity * 1px);aspect-ratio:1;background-color:var(--lib-skeleton-fill)}@media(prefers-reduced-motion:reduce){:host{animation:none}}@keyframes pulse{50%{opacity:.5}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
3472
+ });
3473
+ };
3474
+ i0.ɵɵngDeclareClassMetadata({
3475
+ minVersion: "12.0.0",
3476
+ version: "22.2.0",
3477
+ ngImport: i0,
3478
+ type: SkeletonComponent,
3479
+ decorators: [{
3480
+ type: Component,
3481
+ args: [{
3482
+ selector: "lib-skeleton",
3483
+ host: {
3484
+ class: "lib-skeleton",
3485
+ "aria-hidden": "true",
3486
+ "[class.shape-text]": "shape() === 'text'",
3487
+ "[class.shape-block]": "shape() === 'block'",
3488
+ "[class.shape-circle]": "shape() === 'circle'",
3489
+ "[style.width]": "width() ?? null",
3490
+ "[style.height]": "shape() === 'text' ? null : (height() ?? null)"
3491
+ },
3492
+ template: "@if (shape() === 'text') {\n @for (line of lineIndexes(); track line) {\n <span class=\"lib-skeleton-line\" [style.height]=\"height() ?? null\"></span>\n }\n}\n",
3493
+ styles: [":host{--lib-skeleton-fill: color-mix(in srgb, oklch(70.7% .022 261.325) 35%, transparent);display:block;animation:var(--animate-pulse, pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}@supports (color: color-mix(in lab,red,red)){:host{--lib-skeleton-fill: color-mix(in srgb, var(--color-content-subtle) 35%, transparent)}}:host-context([data-theme=dark]){--lib-skeleton-fill: var(--color-surface-inset)}:host(.shape-text){display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.lib-skeleton-line{display:block;height:calc(var(--spacing, .25rem) * 2.5);width:100%;border-radius:calc(infinity * 1px);background-color:var(--lib-skeleton-fill)}.lib-skeleton-line:last-child:not(:first-child){width:calc(3 / 5 * 100%)}:host(.shape-block){height:calc(var(--spacing, .25rem) * 16);width:100%;border-radius:var(--radius-field);background-color:var(--lib-skeleton-fill)}:host(.shape-circle){width:calc(var(--spacing, .25rem) * 10);flex-shrink:0;border-radius:calc(infinity * 1px);aspect-ratio:1;background-color:var(--lib-skeleton-fill)}@media(prefers-reduced-motion:reduce){:host{animation:none}}@keyframes pulse{50%{opacity:.5}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
3494
+ }]
3495
+ }],
3496
+ propDecorators: {
3497
+ shape: [{
3498
+ type: i0.Input,
3499
+ args: [{
3500
+ isSignal: true,
3501
+ alias: "shape",
3502
+ required: false
3503
+ }]
3504
+ }],
3505
+ lines: [{
3506
+ type: i0.Input,
3507
+ args: [{
3508
+ isSignal: true,
3509
+ alias: "lines",
3510
+ required: false
3511
+ }]
3512
+ }],
3513
+ width: [{
3514
+ type: i0.Input,
3515
+ args: [{
3516
+ isSignal: true,
3517
+ alias: "width",
3518
+ required: false
3519
+ }]
3520
+ }],
3521
+ height: [{
3522
+ type: i0.Input,
3523
+ args: [{
3524
+ isSignal: true,
3525
+ alias: "height",
3526
+ required: false
3527
+ }]
3528
+ }]
3529
+ }
3530
+ });
1815
3531
  var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponent {
1816
3532
  autofocus = input(false, ...ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []);
1817
3533
  alignContent = input("center", ...ngDevMode ? [{ debugName: "alignContent" }] : /* istanbul ignore next */ []);
@@ -2028,8 +3744,8 @@ var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponen
2028
3744
  } },
2029
3745
  usesInheritance: true,
2030
3746
  ngImport: i0,
2031
- template: "@if (showLabel()) {\n <label [attr.for]=\"controlName()\"> {{ label() | translate }}: </label>\n}\n\n<div class=\"field\" [class.col-span-2]=\"!showLabel()\" [ngStyle]=\"{ 'align-content': alignContent() }\">\n @if (loadingField() || (formService.loading && formService.model === null)) {\n <div class=\"loading\">\n <div></div>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"template() ?? defaultTemplate\"> </ng-container>\n @if (isTouched()) {\n <div class=\"validations\" [class.show]=\"isInvalid()\">\n @for (error of errors() | keyvalue; track error) {\n @if (hasValidation(error.key)) {\n <span>{{ validations()[error.key] | translate }}</span>\n }\n <ng-template #defaultValidationError>{{ error.key }}</ng-template>\n }\n </div>\n }\n <ng-template #defaultTemplate>\n <lib-form-input\n #formInput\n [autofocus]=\"autofocus()\"\n [controlName]=\"controlName()\"\n [fixedValue]=\"fixedValue()\"\n [format]=\"format()\"\n [isDisabled]=\"isDisabled()\"\n [isFullHeight]=\"isFullHeight()\"\n [min]=\"min()\"\n [maxLength]=\"maxLength()\"\n [readOnly]=\"readOnly()\"\n [rows]=\"rows()!\"\n [step]=\"step()\"\n [type]=\"type()\"\n >\n </lib-form-input>\n </ng-template>\n @if (hasNotes) {\n <span class=\"text-sm italic\"> *{{ notes() | translate }} </span>\n }\n }\n</div>\n",
2032
- styles: ["@layer properties;:host{grid-column:span 2 / span 2;display:grid;grid-template-columns:subgrid;gap:calc(var(--spacing, .25rem) * 3)}:host.full-height{max-height:100%;overflow:auto}label{padding-block:var(--spacing, .25rem);white-space:nowrap;text-align:right;--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);font-size:var(--text-caption);font-weight:var(--font-weight-emphasis);color:var(--color-content-secondary)}.field .validations{flex-basis:100%;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-danger)}.field .validations.show{margin-top:var(--spacing, .25rem)}.field .validations span{display:block}.field .loading{max-width:var(--container-sm, 24rem);animation:var(--animate-pulse, pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.field .loading *{height:calc(var(--spacing, .25rem) * 2.5);width:100%;border-radius:calc(infinity * 1px);background-color:var(--color-surface-inset)}@property --tw-leading{syntax: \"*\"; inherits: false;}@keyframes pulse{50%{opacity:.5}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
3747
+ template: "@if (showLabel()) {\n <label [attr.for]=\"controlName()\"> {{ label() | translate }}: </label>\n}\n\n<div class=\"field\" [class.col-span-2]=\"!showLabel()\" [ngStyle]=\"{ 'align-content': alignContent() }\">\n @if (loadingField() || (formService.loading && formService.model === null)) {\n <lib-skeleton class=\"loading\"></lib-skeleton>\n } @else {\n <ng-container *ngTemplateOutlet=\"template() ?? defaultTemplate\"> </ng-container>\n @if (isTouched()) {\n <div class=\"validations\" [class.show]=\"isInvalid()\">\n @for (error of errors() | keyvalue; track error) {\n @if (hasValidation(error.key)) {\n <span>{{ validations()[error.key] | translate }}</span>\n }\n <ng-template #defaultValidationError>{{ error.key }}</ng-template>\n }\n </div>\n }\n <ng-template #defaultTemplate>\n <lib-form-input\n #formInput\n [autofocus]=\"autofocus()\"\n [controlName]=\"controlName()\"\n [fixedValue]=\"fixedValue()\"\n [format]=\"format()\"\n [isDisabled]=\"isDisabled()\"\n [isFullHeight]=\"isFullHeight()\"\n [min]=\"min()\"\n [maxLength]=\"maxLength()\"\n [readOnly]=\"readOnly()\"\n [rows]=\"rows()!\"\n [step]=\"step()\"\n [type]=\"type()\"\n >\n </lib-form-input>\n </ng-template>\n @if (hasNotes) {\n <span class=\"text-sm italic\"> *{{ notes() | translate }} </span>\n }\n }\n</div>\n",
3748
+ styles: ["@layer properties;:host{grid-column:span 2 / span 2;display:grid;grid-template-columns:subgrid;gap:calc(var(--spacing, .25rem) * 3)}:host.full-height{max-height:100%;overflow:auto}label{padding-block:var(--spacing, .25rem);white-space:nowrap;text-align:right;--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);font-size:var(--text-caption);font-weight:var(--font-weight-emphasis);color:var(--color-content-secondary)}.field .validations{flex-basis:100%;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-danger)}.field .validations.show{margin-top:var(--spacing, .25rem)}.field .validations span{display:block}.field .loading{max-width:var(--container-sm, 24rem)}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
2033
3749
  dependencies: [
2034
3750
  {
2035
3751
  kind: "component",
@@ -2078,6 +3794,17 @@ var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponen
2078
3794
  "ngTemplateOutletInjector"
2079
3795
  ]
2080
3796
  },
3797
+ {
3798
+ kind: "component",
3799
+ type: SkeletonComponent,
3800
+ selector: "lib-skeleton",
3801
+ inputs: [
3802
+ "shape",
3803
+ "lines",
3804
+ "width",
3805
+ "height"
3806
+ ]
3807
+ },
2081
3808
  {
2082
3809
  kind: "pipe",
2083
3810
  type: KeyValuePipe,
@@ -2105,14 +3832,15 @@ i0.ɵɵngDeclareClassMetadata({
2105
3832
  KeyValuePipe,
2106
3833
  NgStyle,
2107
3834
  NgTemplateOutlet,
3835
+ SkeletonComponent,
2108
3836
  TranslatePipe
2109
3837
  ],
2110
3838
  host: {
2111
3839
  "[class.full-height]": "isFullHeight()",
2112
3840
  "[attr.type]": "null"
2113
3841
  },
2114
- template: "@if (showLabel()) {\n <label [attr.for]=\"controlName()\"> {{ label() | translate }}: </label>\n}\n\n<div class=\"field\" [class.col-span-2]=\"!showLabel()\" [ngStyle]=\"{ 'align-content': alignContent() }\">\n @if (loadingField() || (formService.loading && formService.model === null)) {\n <div class=\"loading\">\n <div></div>\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"template() ?? defaultTemplate\"> </ng-container>\n @if (isTouched()) {\n <div class=\"validations\" [class.show]=\"isInvalid()\">\n @for (error of errors() | keyvalue; track error) {\n @if (hasValidation(error.key)) {\n <span>{{ validations()[error.key] | translate }}</span>\n }\n <ng-template #defaultValidationError>{{ error.key }}</ng-template>\n }\n </div>\n }\n <ng-template #defaultTemplate>\n <lib-form-input\n #formInput\n [autofocus]=\"autofocus()\"\n [controlName]=\"controlName()\"\n [fixedValue]=\"fixedValue()\"\n [format]=\"format()\"\n [isDisabled]=\"isDisabled()\"\n [isFullHeight]=\"isFullHeight()\"\n [min]=\"min()\"\n [maxLength]=\"maxLength()\"\n [readOnly]=\"readOnly()\"\n [rows]=\"rows()!\"\n [step]=\"step()\"\n [type]=\"type()\"\n >\n </lib-form-input>\n </ng-template>\n @if (hasNotes) {\n <span class=\"text-sm italic\"> *{{ notes() | translate }} </span>\n }\n }\n</div>\n",
2115
- styles: ["@layer properties;:host{grid-column:span 2 / span 2;display:grid;grid-template-columns:subgrid;gap:calc(var(--spacing, .25rem) * 3)}:host.full-height{max-height:100%;overflow:auto}label{padding-block:var(--spacing, .25rem);white-space:nowrap;text-align:right;--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);font-size:var(--text-caption);font-weight:var(--font-weight-emphasis);color:var(--color-content-secondary)}.field .validations{flex-basis:100%;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-danger)}.field .validations.show{margin-top:var(--spacing, .25rem)}.field .validations span{display:block}.field .loading{max-width:var(--container-sm, 24rem);animation:var(--animate-pulse, pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.field .loading *{height:calc(var(--spacing, .25rem) * 2.5);width:100%;border-radius:calc(infinity * 1px);background-color:var(--color-surface-inset)}@property --tw-leading{syntax: \"*\"; inherits: false;}@keyframes pulse{50%{opacity:.5}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
3842
+ template: "@if (showLabel()) {\n <label [attr.for]=\"controlName()\"> {{ label() | translate }}: </label>\n}\n\n<div class=\"field\" [class.col-span-2]=\"!showLabel()\" [ngStyle]=\"{ 'align-content': alignContent() }\">\n @if (loadingField() || (formService.loading && formService.model === null)) {\n <lib-skeleton class=\"loading\"></lib-skeleton>\n } @else {\n <ng-container *ngTemplateOutlet=\"template() ?? defaultTemplate\"> </ng-container>\n @if (isTouched()) {\n <div class=\"validations\" [class.show]=\"isInvalid()\">\n @for (error of errors() | keyvalue; track error) {\n @if (hasValidation(error.key)) {\n <span>{{ validations()[error.key] | translate }}</span>\n }\n <ng-template #defaultValidationError>{{ error.key }}</ng-template>\n }\n </div>\n }\n <ng-template #defaultTemplate>\n <lib-form-input\n #formInput\n [autofocus]=\"autofocus()\"\n [controlName]=\"controlName()\"\n [fixedValue]=\"fixedValue()\"\n [format]=\"format()\"\n [isDisabled]=\"isDisabled()\"\n [isFullHeight]=\"isFullHeight()\"\n [min]=\"min()\"\n [maxLength]=\"maxLength()\"\n [readOnly]=\"readOnly()\"\n [rows]=\"rows()!\"\n [step]=\"step()\"\n [type]=\"type()\"\n >\n </lib-form-input>\n </ng-template>\n @if (hasNotes) {\n <span class=\"text-sm italic\"> *{{ notes() | translate }} </span>\n }\n }\n</div>\n",
3843
+ styles: ["@layer properties;:host{grid-column:span 2 / span 2;display:grid;grid-template-columns:subgrid;gap:calc(var(--spacing, .25rem) * 3)}:host.full-height{max-height:100%;overflow:auto}label{padding-block:var(--spacing, .25rem);white-space:nowrap;text-align:right;--tw-leading: calc(var(--spacing, .25rem) * 6);line-height:calc(var(--spacing, .25rem) * 6);font-size:var(--text-caption);font-weight:var(--font-weight-emphasis);color:var(--color-content-secondary)}.field .validations{flex-basis:100%;font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-danger)}.field .validations.show{margin-top:var(--spacing, .25rem)}.field .validations span{display:block}.field .loading{max-width:var(--container-sm, 24rem)}@property --tw-leading{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
2116
3844
  }]
2117
3845
  }],
2118
3846
  ctorParameters: () => [],
@@ -3108,7 +4836,7 @@ var DataGridRowComponent = class DataGridRowComponent extends BaseComponent {
3108
4836
  else this.dataGridDataset.deselectRow(this.rowKey);
3109
4837
  }
3110
4838
  getValue(field) {
3111
- return field.split(".").reduce((value, field) => value[field], this.rowData);
4839
+ return field.split(".").reduce((value, field) => value?.[field], this.rowData);
3112
4840
  }
3113
4841
  refreshSelection() {
3114
4842
  this.selected.set(this.isRowDataSelected);
@@ -3463,7 +5191,10 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
3463
5191
  transformFunction: null
3464
5192
  }
3465
5193
  },
3466
- host: { properties: { "class.no-borders": "showButtons()" } },
5194
+ host: { properties: {
5195
+ "class.no-borders": "showButtons()",
5196
+ "class.hide-borders": "configs.hideBorders === true"
5197
+ } },
3467
5198
  viewQueries: [{
3468
5199
  propertyName: "bodyElement",
3469
5200
  first: true,
@@ -3479,8 +5210,8 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
3479
5210
  }],
3480
5211
  usesInheritance: true,
3481
5212
  ngImport: i0,
3482
- template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n @if (!loading() && hasBeenLoaded && (!hasLoadedRows || hasFailed())) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
3483
- styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-surface-solid);border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
5213
+ template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
5214
+ styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
3484
5215
  dependencies: [
3485
5216
  {
3486
5217
  kind: "component",
@@ -3549,15 +5280,18 @@ i0.ɵɵngDeclareClassMetadata({
3549
5280
  type: Component,
3550
5281
  args: [{
3551
5282
  selector: "lib-data-grid",
3552
- host: { "[class.no-borders]": "showButtons()" },
5283
+ host: {
5284
+ "[class.no-borders]": "showButtons()",
5285
+ "[class.hide-borders]": "configs.hideBorders === true"
5286
+ },
3553
5287
  imports: [
3554
5288
  DataGridRowComponent,
3555
5289
  NgStyle,
3556
5290
  ScrollingModule,
3557
5291
  TranslatePipe
3558
5292
  ],
3559
- template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n @if (!loading() && hasBeenLoaded && (!hasLoadedRows || hasFailed())) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
3560
- styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){border-style:var(--tw-border-style);border-width:1px;background-color:var(--color-surface-solid);border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
5293
+ template: "@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n",
5294
+ styles: ["@charset \"UTF-8\";@layer properties;:host{display:flex;flex-direction:column;overflow:hidden;-webkit-user-select:none;user-select:none}:host:not(.no-borders){background-color:var(--color-surface-solid)}:host:not(.no-borders):not(.hide-borders){border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-line);border-radius:var(--surface-radius, .5rem)}:host.no-borders .header .header-row{padding-block:calc(var(--spacing, .25rem) * 1.5)}:host.no-borders .body lib-data-grid-row{padding-block:var(--spacing, .25rem)}.header-row,lib-data-grid-row,.loading,.message{gap:calc(var(--spacing, .25rem) * 4);padding-inline:calc(var(--spacing, .25rem) * 4)}.header{overflow:hidden;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;--tw-font-weight: var(--font-weight-bold, 700);font-weight:var(--font-weight-bold, 700);background-color:color-mix(in srgb,oklch(21% .034 264.665) 14%,transparent);border-color:var(--color-line)}@supports (color: color-mix(in lab,red,red)){.header{background-color:color-mix(in srgb,var(--color-content-primary) 14%,transparent)}}.header.hide{display:none}.header .header-row{display:flex;flex-direction:row;padding-block:calc(var(--spacing, .25rem) * 3)}.header .header-cell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header .header-cell:not(.selection){flex:none}.body{position:relative;flex-grow:1}.body cdk-virtual-scroll-viewport{position:absolute;inset:0}.body cdk-virtual-scroll-viewport ::ng-deep .cdk-virtual-scroll-content-wrapper{display:grid;grid-template-columns:inherit}.body lib-data-grid-row{margin-top:-1px;cursor:pointer;border-block-style:var(--tw-border-style);border-block-width:1px;padding-block:calc(var(--spacing, .25rem) * 2);border-color:var(--color-line)}.body lib-data-grid-row.striped{background-color:var(--state-hover)}.body lib-data-grid-row:hover{background-color:var(--state-selected)}.body lib-data-grid-row.focused{z-index:1;border-color:var(--color-line-strong)}.body lib-data-grid-row.selected{position:relative;z-index:10;background-color:var(--state-selected);border-color:var(--color-line-selected)}.body lib-data-grid-row.selected:hover{background-color:var(--state-selected)}.body .loading,.body .message{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);white-space:nowrap;height:calc(var(--spacing, .25rem) * 10);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--color-line);grid-column:1 / -1}.body .loading span,.body .message span{overflow:hidden;text-overflow:ellipsis}.body .loading svg{height:calc(var(--spacing, .25rem) * 6);min-height:calc(var(--spacing, .25rem) * 6);width:calc(var(--spacing, .25rem) * 6);min-width:calc(var(--spacing, .25rem) * 6);animation:var(--animate-spin, spin 1s linear infinite);transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));transition-duration:var(--duration-short);transition-timing-function:var(--ease-standard)}.buttons{display:flex;border-top-style:var(--tw-border-style);border-top-width:1px;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;padding:var(--spacing, .25rem);border-color:var(--color-line)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-font-weight: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
3561
5295
  }]
3562
5296
  }],
3563
5297
  ctorParameters: () => [],
@@ -5761,6 +7495,410 @@ i0.ɵɵngDeclareClassMetadata({
5761
7495
  label: [{ type: Input }]
5762
7496
  }
5763
7497
  });
7498
+ var TooltipComponent = class TooltipComponent {
7499
+ text = input("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
7500
+ tooltipId = input(...ngDevMode ? [void 0, { debugName: "tooltipId" }] : /* istanbul ignore next */ []);
7501
+ static ɵfac = i0.ɵɵngDeclareFactory({
7502
+ minVersion: "12.0.0",
7503
+ version: "22.2.0",
7504
+ ngImport: i0,
7505
+ type: TooltipComponent,
7506
+ deps: [],
7507
+ target: i0.ɵɵFactoryTarget.Component
7508
+ });
7509
+ static ɵcmp = i0.ɵɵngDeclareComponent({
7510
+ minVersion: "17.1.0",
7511
+ version: "22.2.0",
7512
+ type: TooltipComponent,
7513
+ isStandalone: true,
7514
+ selector: "lib-tooltip",
7515
+ inputs: {
7516
+ text: {
7517
+ classPropertyName: "text",
7518
+ publicName: "text",
7519
+ isSignal: true,
7520
+ isRequired: false,
7521
+ transformFunction: null
7522
+ },
7523
+ tooltipId: {
7524
+ classPropertyName: "tooltipId",
7525
+ publicName: "tooltipId",
7526
+ isSignal: true,
7527
+ isRequired: false,
7528
+ transformFunction: null
7529
+ }
7530
+ },
7531
+ host: {
7532
+ attributes: { "role": "tooltip" },
7533
+ properties: { "attr.id": "tooltipId()" },
7534
+ classAttribute: "lib-tooltip"
7535
+ },
7536
+ ngImport: i0,
7537
+ template: `{{ text() | translate }}`,
7538
+ isInline: true,
7539
+ styles: [":host{display:block;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);overflow-wrap:break-word;max-width:min(20rem,100vw - 1rem);border-radius:var(--radius-field);background-color:var(--color-content-primary);color:var(--color-surface-solid);box-shadow:var(--shadow-overlay);font-size:var(--text-caption);font-weight:var(--font-weight-ui);line-height:1.4;animation:lib-tooltip-in var(--duration-instant) var(--ease-standard)}@keyframes lib-tooltip-in{0%{opacity:0}}@media(prefers-reduced-motion:reduce){:host{animation:none}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
7540
+ dependencies: [{
7541
+ kind: "pipe",
7542
+ type: TranslatePipe,
7543
+ name: "translate"
7544
+ }]
7545
+ });
7546
+ };
7547
+ i0.ɵɵngDeclareClassMetadata({
7548
+ minVersion: "12.0.0",
7549
+ version: "22.2.0",
7550
+ ngImport: i0,
7551
+ type: TooltipComponent,
7552
+ decorators: [{
7553
+ type: Component,
7554
+ args: [{
7555
+ selector: "lib-tooltip",
7556
+ template: `{{ text() | translate }}`,
7557
+ host: {
7558
+ class: "lib-tooltip",
7559
+ role: "tooltip",
7560
+ "[attr.id]": "tooltipId()"
7561
+ },
7562
+ imports: [TranslatePipe],
7563
+ styles: [":host{display:block;padding-inline:calc(var(--spacing, .25rem) * 2);padding-block:var(--spacing, .25rem);overflow-wrap:break-word;max-width:min(20rem,100vw - 1rem);border-radius:var(--radius-field);background-color:var(--color-content-primary);color:var(--color-surface-solid);box-shadow:var(--shadow-overlay);font-size:var(--text-caption);font-weight:var(--font-weight-ui);line-height:1.4;animation:lib-tooltip-in var(--duration-instant) var(--ease-standard)}@keyframes lib-tooltip-in{0%{opacity:0}}@media(prefers-reduced-motion:reduce){:host{animation:none}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
7564
+ }]
7565
+ }],
7566
+ propDecorators: {
7567
+ text: [{
7568
+ type: i0.Input,
7569
+ args: [{
7570
+ isSignal: true,
7571
+ alias: "text",
7572
+ required: false
7573
+ }]
7574
+ }],
7575
+ tooltipId: [{
7576
+ type: i0.Input,
7577
+ args: [{
7578
+ isSignal: true,
7579
+ alias: "tooltipId",
7580
+ required: false
7581
+ }]
7582
+ }]
7583
+ }
7584
+ });
7585
+ const OFFSET = 6;
7586
+ const HIDE_GRACE_MS = 100;
7587
+ const LONG_PRESS_MS = 500;
7588
+ const TOUCH_LINGER_MS = 1500;
7589
+ const EMULATED_MOUSE_WINDOW_MS = 800;
7590
+ const FOCUSABLE = "button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
7591
+ let hideOpenTooltip;
7592
+ const ABOVE = {
7593
+ originX: "center",
7594
+ originY: "top",
7595
+ overlayX: "center",
7596
+ overlayY: "bottom",
7597
+ offsetY: -6
7598
+ };
7599
+ const BELOW = {
7600
+ originX: "center",
7601
+ originY: "bottom",
7602
+ overlayX: "center",
7603
+ overlayY: "top",
7604
+ offsetY: OFFSET
7605
+ };
7606
+ const BEFORE = {
7607
+ originX: "start",
7608
+ originY: "center",
7609
+ overlayX: "end",
7610
+ overlayY: "center",
7611
+ offsetX: -6
7612
+ };
7613
+ const AFTER = {
7614
+ originX: "end",
7615
+ originY: "center",
7616
+ overlayX: "start",
7617
+ overlayY: "center",
7618
+ offsetX: OFFSET
7619
+ };
7620
+ const POSITIONS = {
7621
+ top: [
7622
+ ABOVE,
7623
+ BELOW,
7624
+ AFTER,
7625
+ BEFORE
7626
+ ],
7627
+ bottom: [
7628
+ BELOW,
7629
+ ABOVE,
7630
+ AFTER,
7631
+ BEFORE
7632
+ ],
7633
+ start: [
7634
+ BEFORE,
7635
+ AFTER,
7636
+ ABOVE,
7637
+ BELOW
7638
+ ],
7639
+ end: [
7640
+ AFTER,
7641
+ BEFORE,
7642
+ ABOVE,
7643
+ BELOW
7644
+ ]
7645
+ };
7646
+ var TooltipDirective = class TooltipDirective {
7647
+ text = input("", {
7648
+ ...ngDevMode ? { debugName: "text" } : /* istanbul ignore next */ {},
7649
+ alias: "libTooltip"
7650
+ });
7651
+ tooltipPosition = input("top", ...ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []);
7652
+ tooltipDisabled = input(false, ...ngDevMode ? [{ debugName: "tooltipDisabled" }] : /* istanbul ignore next */ []);
7653
+ tooltipDelay = input(300, ...ngDevMode ? [{ debugName: "tooltipDelay" }] : /* istanbul ignore next */ []);
7654
+ static instances = 0;
7655
+ tooltipId = `lib-tooltip-${TooltipDirective.instances++}`;
7656
+ host = inject(ElementRef);
7657
+ overlay = inject(Overlay);
7658
+ renderer = inject(Renderer2);
7659
+ viewContainerRef = inject(ViewContainerRef);
7660
+ overlayRef;
7661
+ tooltipRef;
7662
+ removeListeners = [];
7663
+ describedElement;
7664
+ previousDescribedBy = null;
7665
+ showTimer;
7666
+ hideTimer;
7667
+ lastTouch = 0;
7668
+ hideThis = () => this.hide();
7669
+ isHostHovered = false;
7670
+ isTooltipHovered = false;
7671
+ isFocused = false;
7672
+ constructor() {
7673
+ effect(() => {
7674
+ const text = this.text() ?? "";
7675
+ if (this.tooltipDisabled() || !text) this.hide();
7676
+ else this.tooltipRef?.setInput("text", text);
7677
+ });
7678
+ inject(DestroyRef).onDestroy(() => this.hide());
7679
+ }
7680
+ onMouseEnter() {
7681
+ if (this.isEmulatedMouse()) return;
7682
+ this.isHostHovered = true;
7683
+ this.scheduleShow(this.tooltipDelay());
7684
+ }
7685
+ onMouseLeave() {
7686
+ this.isHostHovered = false;
7687
+ this.scheduleHideIfIdle();
7688
+ }
7689
+ onFocusIn() {
7690
+ if (this.isEmulatedMouse()) return;
7691
+ this.isFocused = true;
7692
+ this.scheduleShow(this.tooltipDelay());
7693
+ }
7694
+ onFocusOut() {
7695
+ this.isFocused = false;
7696
+ this.scheduleHideIfIdle();
7697
+ }
7698
+ onTouchStart() {
7699
+ this.lastTouch = Date.now();
7700
+ this.scheduleShow(LONG_PRESS_MS);
7701
+ }
7702
+ onTouchEnd() {
7703
+ this.lastTouch = Date.now();
7704
+ this.clearShowTimer();
7705
+ if (this.overlayRef) {
7706
+ this.clearHideTimer();
7707
+ this.hideTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);
7708
+ }
7709
+ }
7710
+ show() {
7711
+ this.clearShowTimer();
7712
+ this.clearHideTimer();
7713
+ if (this.overlayRef || this.tooltipDisabled() || !this.text()) return;
7714
+ if (hideOpenTooltip && hideOpenTooltip !== this.hideThis) hideOpenTooltip();
7715
+ hideOpenTooltip = this.hideThis;
7716
+ const host = this.host.nativeElement;
7717
+ this.overlayRef = this.overlay.create({
7718
+ positionStrategy: this.overlay.position().flexibleConnectedTo(host).withPositions(POSITIONS[this.tooltipPosition()]).withFlexibleDimensions(false).withViewportMargin(8),
7719
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
7720
+ panelClass: "lib-tooltip-pane"
7721
+ });
7722
+ this.tooltipRef = this.overlayRef.attach(new ComponentPortal(TooltipComponent, this.viewContainerRef));
7723
+ this.tooltipRef.setInput("text", this.text());
7724
+ this.tooltipRef.setInput("tooltipId", this.tooltipId);
7725
+ const pane = this.overlayRef.overlayElement;
7726
+ this.removeListeners = [
7727
+ this.renderer.listen(pane, "mouseenter", () => {
7728
+ this.isTooltipHovered = true;
7729
+ this.clearHideTimer();
7730
+ }),
7731
+ this.renderer.listen(pane, "mouseleave", () => {
7732
+ this.isTooltipHovered = false;
7733
+ this.scheduleHideIfIdle();
7734
+ }),
7735
+ this.renderer.listen("window", "keydown", (event) => {
7736
+ if (event.key === "Escape") {
7737
+ if (this.isFocused) event.stopPropagation();
7738
+ this.hide();
7739
+ }
7740
+ }, { capture: true })
7741
+ ];
7742
+ this.describedElement = this.findDescribedElement();
7743
+ this.previousDescribedBy = this.describedElement.getAttribute("aria-describedby");
7744
+ const describedBy = [this.previousDescribedBy, this.tooltipId].filter(Boolean).join(" ");
7745
+ this.describedElement.setAttribute("aria-describedby", describedBy);
7746
+ }
7747
+ hide() {
7748
+ this.clearShowTimer();
7749
+ this.clearHideTimer();
7750
+ this.isTooltipHovered = false;
7751
+ if (!this.overlayRef) return;
7752
+ if (hideOpenTooltip === this.hideThis) hideOpenTooltip = void 0;
7753
+ this.removeListeners.forEach((remove) => remove());
7754
+ this.removeListeners = [];
7755
+ this.overlayRef.dispose();
7756
+ this.overlayRef = void 0;
7757
+ this.tooltipRef = void 0;
7758
+ if (this.previousDescribedBy) this.describedElement?.setAttribute("aria-describedby", this.previousDescribedBy);
7759
+ else this.describedElement?.removeAttribute("aria-describedby");
7760
+ this.describedElement = void 0;
7761
+ this.previousDescribedBy = null;
7762
+ }
7763
+ scheduleShow(delay) {
7764
+ this.clearHideTimer();
7765
+ if (this.overlayRef || this.showTimer || this.tooltipDisabled() || !this.text()) return;
7766
+ this.showTimer = setTimeout(() => this.show(), Math.max(0, delay));
7767
+ }
7768
+ scheduleHideIfIdle() {
7769
+ if (this.isHostHovered || this.isTooltipHovered || this.isFocused) return;
7770
+ this.clearShowTimer();
7771
+ this.clearHideTimer();
7772
+ if (this.overlayRef) this.hideTimer = setTimeout(() => this.hide(), HIDE_GRACE_MS);
7773
+ }
7774
+ findDescribedElement() {
7775
+ const host = this.host.nativeElement;
7776
+ if (host.matches(FOCUSABLE)) return host;
7777
+ return host.querySelector(FOCUSABLE) ?? host;
7778
+ }
7779
+ isEmulatedMouse() {
7780
+ return Date.now() - this.lastTouch < EMULATED_MOUSE_WINDOW_MS;
7781
+ }
7782
+ clearShowTimer() {
7783
+ clearTimeout(this.showTimer);
7784
+ this.showTimer = void 0;
7785
+ }
7786
+ clearHideTimer() {
7787
+ clearTimeout(this.hideTimer);
7788
+ this.hideTimer = void 0;
7789
+ }
7790
+ static ɵfac = i0.ɵɵngDeclareFactory({
7791
+ minVersion: "12.0.0",
7792
+ version: "22.2.0",
7793
+ ngImport: i0,
7794
+ type: TooltipDirective,
7795
+ deps: [],
7796
+ target: i0.ɵɵFactoryTarget.Directive
7797
+ });
7798
+ static ɵdir = i0.ɵɵngDeclareDirective({
7799
+ minVersion: "17.1.0",
7800
+ version: "22.2.0",
7801
+ type: TooltipDirective,
7802
+ isStandalone: true,
7803
+ selector: "[libTooltip]",
7804
+ inputs: {
7805
+ text: {
7806
+ classPropertyName: "text",
7807
+ publicName: "libTooltip",
7808
+ isSignal: true,
7809
+ isRequired: false,
7810
+ transformFunction: null
7811
+ },
7812
+ tooltipPosition: {
7813
+ classPropertyName: "tooltipPosition",
7814
+ publicName: "tooltipPosition",
7815
+ isSignal: true,
7816
+ isRequired: false,
7817
+ transformFunction: null
7818
+ },
7819
+ tooltipDisabled: {
7820
+ classPropertyName: "tooltipDisabled",
7821
+ publicName: "tooltipDisabled",
7822
+ isSignal: true,
7823
+ isRequired: false,
7824
+ transformFunction: null
7825
+ },
7826
+ tooltipDelay: {
7827
+ classPropertyName: "tooltipDelay",
7828
+ publicName: "tooltipDelay",
7829
+ isSignal: true,
7830
+ isRequired: false,
7831
+ transformFunction: null
7832
+ }
7833
+ },
7834
+ host: { listeners: {
7835
+ "mouseenter": "onMouseEnter()",
7836
+ "mouseleave": "onMouseLeave()",
7837
+ "focusin": "onFocusIn()",
7838
+ "focusout": "onFocusOut()",
7839
+ "touchstart": "onTouchStart()",
7840
+ "touchend": "onTouchEnd()",
7841
+ "touchcancel": "onTouchEnd()"
7842
+ } },
7843
+ ngImport: i0
7844
+ });
7845
+ };
7846
+ i0.ɵɵngDeclareClassMetadata({
7847
+ minVersion: "12.0.0",
7848
+ version: "22.2.0",
7849
+ ngImport: i0,
7850
+ type: TooltipDirective,
7851
+ decorators: [{
7852
+ type: Directive,
7853
+ args: [{
7854
+ selector: "[libTooltip]",
7855
+ host: {
7856
+ "(mouseenter)": "onMouseEnter()",
7857
+ "(mouseleave)": "onMouseLeave()",
7858
+ "(focusin)": "onFocusIn()",
7859
+ "(focusout)": "onFocusOut()",
7860
+ "(touchstart)": "onTouchStart()",
7861
+ "(touchend)": "onTouchEnd()",
7862
+ "(touchcancel)": "onTouchEnd()"
7863
+ }
7864
+ }]
7865
+ }],
7866
+ ctorParameters: () => [],
7867
+ propDecorators: {
7868
+ text: [{
7869
+ type: i0.Input,
7870
+ args: [{
7871
+ isSignal: true,
7872
+ alias: "libTooltip",
7873
+ required: false
7874
+ }]
7875
+ }],
7876
+ tooltipPosition: [{
7877
+ type: i0.Input,
7878
+ args: [{
7879
+ isSignal: true,
7880
+ alias: "tooltipPosition",
7881
+ required: false
7882
+ }]
7883
+ }],
7884
+ tooltipDisabled: [{
7885
+ type: i0.Input,
7886
+ args: [{
7887
+ isSignal: true,
7888
+ alias: "tooltipDisabled",
7889
+ required: false
7890
+ }]
7891
+ }],
7892
+ tooltipDelay: [{
7893
+ type: i0.Input,
7894
+ args: [{
7895
+ isSignal: true,
7896
+ alias: "tooltipDelay",
7897
+ required: false
7898
+ }]
7899
+ }]
7900
+ }
7901
+ });
5764
7902
  var EnumTranslatePipe = class EnumTranslatePipe {
5765
7903
  translate = inject(TranslateService);
5766
7904
  transform(enumType) {
@@ -6089,6 +8227,6 @@ var DateValidators = class {
6089
8227
  };
6090
8228
  }
6091
8229
  };
6092
- export { BaseComponent, BaseDataset, ButtonComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, toSidebarMenuOpenMode };
8230
+ export { BadgeComponent, BaseComponent, BaseDataset, ButtonComponent, CalendarComponent, CatalogSelectComponent, CatalogService, DataGridComponent, DataGridConfigsProvider, DataGridDataset, DataGridRowComponent, DataProviderService, DateHelpers, DateInputComponent, DateValidators, DisplayControls, EnumTranslatePipe, FormGroupComponent, FormGroupService, FormInputComponent, FormInputGroupComponent, FormService, GridConfigsProvider, GridDataset, GroupAccordionComponent, GroupContainerComponent, GroupScrollSpyComponent, GuidHelper, LibraryModule, LocaleService, ModalComponent, MultiEditorComponent, MultiEditorDataset, MultiSelectComponent, MultiSelectResultDataset, MultiSelectResultGridComponent, NumberInputComponent, ReplaceManyPipe, ReplacePipe, RibbonButtonComponent, RibbonComponent, RibbonGroupChild, RibbonGroupComponent, RouterFormatter, SIDEBAR_CONFIGS, ScrollSpyDirective, SidebarComponent, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, SidebarService, SkeletonComponent, TooltipDirective, formatDateText, formatLocaleNumber, formatTimeText, getDatePattern, getFirstDayOfWeek, getNumberSeparators, isValidLocale, parseDateText, parseDigitsInfo, parseIsoValue, parseLocaleNumber, parseTimeText, toIsoDate, toIsoDateTime, toSidebarMenuOpenMode, uses12HourClock };
6093
8231
 
6094
8232
  //# sourceMappingURL=zambon-dev-ui-library.mjs.map