@zambon-dev/ui 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -15
- package/LICENSE +21 -0
- package/README.md +55 -54
- package/fesm2022/zambon-dev-ui-framework.mjs +751 -13
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +2188 -57
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-shared.mjs +446 -446
- package/fesm2022/zambon-dev-ui-shared.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-testing.mjs.map +1 -1
- package/i18n/framework/en.json +14 -1
- package/i18n/framework/pt.json +14 -1
- package/i18n/shared/top-bar/en.json +4 -0
- package/i18n/shared/top-bar/pt.json +4 -0
- package/package.json +14 -9
- package/styles/theme.css +15 -6
- package/styles/variables.scss +3 -3
- package/types/zambon-dev-ui-framework.d.ts +703 -27
- package/types/zambon-dev-ui-library.d.ts +1058 -3
- package/types/zambon-dev-ui-shared.d.ts +180 -10
- package/types/zambon-dev-ui-testing.d.ts +1 -0
|
@@ -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,6 +317,543 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
218
317
|
}]
|
|
219
318
|
}
|
|
220
319
|
});
|
|
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;
|
|
343
|
+
}
|
|
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
|
+
}
|
|
382
|
+
}
|
|
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;
|
|
450
|
+
}
|
|
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;
|
|
519
|
+
}
|
|
520
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
521
|
+
minVersion: "12.0.0",
|
|
522
|
+
version: "22.2.0",
|
|
523
|
+
ngImport: i0,
|
|
524
|
+
type: LocaleService,
|
|
525
|
+
deps: [],
|
|
526
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
527
|
+
});
|
|
528
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
529
|
+
minVersion: "12.0.0",
|
|
530
|
+
version: "22.2.0",
|
|
531
|
+
ngImport: i0,
|
|
532
|
+
type: LocaleService,
|
|
533
|
+
providedIn: "root"
|
|
534
|
+
});
|
|
535
|
+
};
|
|
536
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
537
|
+
minVersion: "12.0.0",
|
|
538
|
+
version: "22.2.0",
|
|
539
|
+
ngImport: i0,
|
|
540
|
+
type: LocaleService,
|
|
541
|
+
decorators: [{
|
|
542
|
+
type: Injectable,
|
|
543
|
+
args: [{ providedIn: "root" }]
|
|
544
|
+
}],
|
|
545
|
+
ctorParameters: () => []
|
|
546
|
+
});
|
|
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)
|
|
614
|
+
});
|
|
615
|
+
}
|
|
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
|
+
}
|
|
625
|
+
}
|
|
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();
|
|
670
|
+
}
|
|
671
|
+
onPreviousMonth() {
|
|
672
|
+
this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), -1)));
|
|
673
|
+
}
|
|
674
|
+
onNextMonth() {
|
|
675
|
+
this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), 1)));
|
|
676
|
+
}
|
|
677
|
+
onToday() {
|
|
678
|
+
const now = today();
|
|
679
|
+
if (!this.isDisabled(now)) {
|
|
680
|
+
this.activeDate.set(now);
|
|
681
|
+
this.dateSelected.emit(now);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
onEscape(event) {
|
|
685
|
+
event.preventDefault();
|
|
686
|
+
event.stopPropagation();
|
|
687
|
+
this.cancelled.emit();
|
|
688
|
+
}
|
|
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);
|
|
713
|
+
}
|
|
714
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
715
|
+
minVersion: "12.0.0",
|
|
716
|
+
version: "22.2.0",
|
|
717
|
+
ngImport: i0,
|
|
718
|
+
type: CalendarComponent,
|
|
719
|
+
deps: [],
|
|
720
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
721
|
+
});
|
|
722
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
723
|
+
minVersion: "17.0.0",
|
|
724
|
+
version: "22.2.0",
|
|
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
|
+
}
|
|
221
857
|
var DateHelpers = class {
|
|
222
858
|
static diffDays(initialDate, finalDate) {
|
|
223
859
|
const initialDateOnly = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());
|
|
@@ -693,7 +1329,7 @@ var DataGridDataset = class DataGridDataset extends GridDataset {
|
|
|
693
1329
|
}
|
|
694
1330
|
get columnsSize() {
|
|
695
1331
|
const sizes = [];
|
|
696
|
-
if (this.configs.multiSelect) sizes.push(this.configs.multiSelectSize ?? "
|
|
1332
|
+
if (this.configs.multiSelect) sizes.push(this.configs.multiSelectSize ?? "min-content");
|
|
697
1333
|
sizes.push(...this.columns.map((col) => col.size ?? "minmax(0,1fr)"));
|
|
698
1334
|
return sizes.join(" ");
|
|
699
1335
|
}
|
|
@@ -1281,49 +1917,935 @@ var SidebarService = class SidebarService {
|
|
|
1281
1917
|
this.selectedMenu = null;
|
|
1282
1918
|
this.deselectMenu(menu);
|
|
1283
1919
|
}
|
|
1284
|
-
}
|
|
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);
|
|
1920
|
+
}
|
|
1921
|
+
deselectMenu(menu, shouldUpdateParents = true) {
|
|
1922
|
+
if (!menu.isSelected) return;
|
|
1923
|
+
menu.isSelected = false;
|
|
1924
|
+
this.selectionChanged.emit(menu);
|
|
1925
|
+
if ((menu.children?.length ?? 0) > 0) menu.children.filter((child) => child.isSelected).forEach((child) => {
|
|
1926
|
+
this.deselectMenu(child, false);
|
|
1927
|
+
});
|
|
1928
|
+
if (!!menu.parent && shouldUpdateParents) while (menu.parent) {
|
|
1929
|
+
this.selectionChanged.emit(menu.parent);
|
|
1930
|
+
menu = menu.parent;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
selectMenu(menu) {
|
|
1934
|
+
menu.isSelected = true;
|
|
1935
|
+
this.selectionChanged.emit(menu);
|
|
1936
|
+
if (menu.parent) this.selectMenu(menu.parent);
|
|
1937
|
+
}
|
|
1938
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1939
|
+
minVersion: "12.0.0",
|
|
1940
|
+
version: "22.2.0",
|
|
1941
|
+
ngImport: i0,
|
|
1942
|
+
type: SidebarService,
|
|
1943
|
+
deps: [],
|
|
1944
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1945
|
+
});
|
|
1946
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1947
|
+
minVersion: "12.0.0",
|
|
1948
|
+
version: "22.2.0",
|
|
1949
|
+
ngImport: i0,
|
|
1950
|
+
type: SidebarService,
|
|
1951
|
+
providedIn: "root"
|
|
1952
|
+
});
|
|
1953
|
+
};
|
|
1954
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1955
|
+
minVersion: "12.0.0",
|
|
1956
|
+
version: "22.2.0",
|
|
1957
|
+
ngImport: i0,
|
|
1958
|
+
type: SidebarService,
|
|
1959
|
+
decorators: [{
|
|
1960
|
+
type: Injectable,
|
|
1961
|
+
args: [{ providedIn: "root" }]
|
|
1962
|
+
}]
|
|
1963
|
+
});
|
|
1964
|
+
let nextCalendarId = 0;
|
|
1965
|
+
var DateInputComponent = class DateInputComponent {
|
|
1966
|
+
mode = input("date", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
|
|
1967
|
+
min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
|
|
1968
|
+
max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
|
|
1969
|
+
readOnly = input(false, ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
|
|
1970
|
+
invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
|
|
1971
|
+
ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1972
|
+
blurred = output();
|
|
1973
|
+
focused = output();
|
|
1974
|
+
inputChanged = output();
|
|
1975
|
+
injector = inject(Injector);
|
|
1976
|
+
localeService = inject(LocaleService);
|
|
1977
|
+
overlay = inject(Overlay);
|
|
1978
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
1979
|
+
container = viewChild("container", ...ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []);
|
|
1980
|
+
dateField = viewChild("dateField", ...ngDevMode ? [{ debugName: "dateField" }] : /* istanbul ignore next */ []);
|
|
1981
|
+
calendarTemplate = viewChild("calendarTemplate", ...ngDevMode ? [{ debugName: "calendarTemplate" }] : /* istanbul ignore next */ []);
|
|
1982
|
+
overlayRef;
|
|
1983
|
+
onChange = () => void 0;
|
|
1984
|
+
onTouched = () => void 0;
|
|
1985
|
+
onValidatorChange = () => void 0;
|
|
1986
|
+
current = signal(null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
1987
|
+
hasTypingError = signal(false, ...ngDevMode ? [{ debugName: "hasTypingError" }] : /* istanbul ignore next */ []);
|
|
1988
|
+
calendarId = `lib-date-input-calendar-${nextCalendarId++}`;
|
|
1989
|
+
isDisabled = signal(false, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
1990
|
+
isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
|
|
1991
|
+
locale = computed(() => this.localeService.locale(), ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
1992
|
+
dateText = linkedSignal(() => {
|
|
1993
|
+
const value = this.current();
|
|
1994
|
+
return value ? formatDateText(value, this.locale()) : "";
|
|
1995
|
+
}, ...ngDevMode ? [{ debugName: "dateText" }] : /* istanbul ignore next */ []);
|
|
1996
|
+
timeText = linkedSignal(() => {
|
|
1997
|
+
const value = this.current();
|
|
1998
|
+
return value ? formatTimeText(value, this.locale()) : "";
|
|
1999
|
+
}, ...ngDevMode ? [{ debugName: "timeText" }] : /* istanbul ignore next */ []);
|
|
2000
|
+
datePlaceholder = computed(() => {
|
|
2001
|
+
const locale = this.locale();
|
|
2002
|
+
const { order, separator } = getDatePattern(locale);
|
|
2003
|
+
try {
|
|
2004
|
+
const names = new Intl.DisplayNames(locale, { type: "dateTimeField" });
|
|
2005
|
+
return order.map((part) => names.of(part) ?? part).join(separator);
|
|
2006
|
+
} catch {
|
|
2007
|
+
return order.join(separator);
|
|
2008
|
+
}
|
|
2009
|
+
}, ...ngDevMode ? [{ debugName: "datePlaceholder" }] : /* istanbul ignore next */ []);
|
|
2010
|
+
timeLabel = computed(() => {
|
|
2011
|
+
let hour = "Time";
|
|
2012
|
+
try {
|
|
2013
|
+
hour = new Intl.DisplayNames(this.locale(), { type: "dateTimeField" }).of("hour") ?? hour;
|
|
2014
|
+
} catch {}
|
|
2015
|
+
return [this.ariaLabel(), hour].filter(Boolean).join(", ");
|
|
2016
|
+
}, ...ngDevMode ? [{ debugName: "timeLabel" }] : /* istanbul ignore next */ []);
|
|
2017
|
+
calendarSelection = computed(() => this.current(), ...ngDevMode ? [{ debugName: "calendarSelection" }] : /* istanbul ignore next */ []);
|
|
2018
|
+
isFieldInvalid = computed(() => this.invalid() || this.hasTypingError(), ...ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []);
|
|
2019
|
+
constructor() {
|
|
2020
|
+
let previous;
|
|
2021
|
+
effect(() => {
|
|
2022
|
+
const limits = JSON.stringify([limitKey(this.min()), limitKey(this.max())]);
|
|
2023
|
+
if (previous !== void 0 && previous !== limits) this.onValidatorChange();
|
|
2024
|
+
previous = limits;
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
ngOnDestroy() {
|
|
2028
|
+
this.disposeOverlay();
|
|
2029
|
+
}
|
|
2030
|
+
writeValue(value) {
|
|
2031
|
+
this.hasTypingError.set(false);
|
|
2032
|
+
this.current.set(parseIsoValue(value));
|
|
2033
|
+
}
|
|
2034
|
+
registerOnChange(fn) {
|
|
2035
|
+
this.onChange = fn;
|
|
2036
|
+
}
|
|
2037
|
+
registerOnTouched(fn) {
|
|
2038
|
+
this.onTouched = fn;
|
|
2039
|
+
}
|
|
2040
|
+
setDisabledState(isDisabled) {
|
|
2041
|
+
this.isDisabled.set(isDisabled);
|
|
2042
|
+
if (isDisabled) this.close(false);
|
|
2043
|
+
}
|
|
2044
|
+
validate(_control) {
|
|
2045
|
+
if (this.hasTypingError()) return { dateInvalid: true };
|
|
2046
|
+
const value = this.current();
|
|
2047
|
+
if (!value) return null;
|
|
2048
|
+
const day = new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
2049
|
+
const min = parseIsoValue(this.min());
|
|
2050
|
+
const max = parseIsoValue(this.max());
|
|
2051
|
+
if (min && day < new Date(min.getFullYear(), min.getMonth(), min.getDate())) return { dateMin: {
|
|
2052
|
+
min: toIsoDate(min),
|
|
2053
|
+
actual: toIsoDate(day)
|
|
2054
|
+
} };
|
|
2055
|
+
if (max && day > new Date(max.getFullYear(), max.getMonth(), max.getDate())) return { dateMax: {
|
|
2056
|
+
max: toIsoDate(max),
|
|
2057
|
+
actual: toIsoDate(day)
|
|
2058
|
+
} };
|
|
2059
|
+
return null;
|
|
2060
|
+
}
|
|
2061
|
+
registerOnValidatorChange(fn) {
|
|
2062
|
+
this.onValidatorChange = fn;
|
|
2063
|
+
}
|
|
2064
|
+
onDateTyped(event) {
|
|
2065
|
+
this.dateText.set(event.target.value);
|
|
2066
|
+
this.inputChanged.emit();
|
|
2067
|
+
}
|
|
2068
|
+
onTimeTyped(event) {
|
|
2069
|
+
this.timeText.set(event.target.value);
|
|
2070
|
+
this.inputChanged.emit();
|
|
2071
|
+
}
|
|
2072
|
+
onFieldFocus(event) {
|
|
2073
|
+
if (!this.isInsideField(event.relatedTarget)) this.focused.emit();
|
|
2074
|
+
}
|
|
2075
|
+
onFieldBlur(event) {
|
|
2076
|
+
if (this.isInsideField(event.relatedTarget)) return;
|
|
2077
|
+
this.commitText();
|
|
2078
|
+
this.onTouched();
|
|
2079
|
+
this.blurred.emit();
|
|
2080
|
+
}
|
|
2081
|
+
onFieldKeydown(event) {
|
|
2082
|
+
if (event.key === "ArrowDown" && event.altKey) {
|
|
2083
|
+
event.preventDefault();
|
|
2084
|
+
this.open();
|
|
2085
|
+
} else if (event.key === "Enter") this.commitText();
|
|
2086
|
+
else if (event.key === "Escape" && this.isOpen()) {
|
|
2087
|
+
event.preventDefault();
|
|
2088
|
+
event.stopPropagation();
|
|
2089
|
+
this.close(true);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
onToggleClick() {
|
|
2093
|
+
if (this.isOpen()) this.close(true);
|
|
2094
|
+
else this.open();
|
|
2095
|
+
}
|
|
2096
|
+
onDatePicked(day) {
|
|
2097
|
+
const previous = this.current();
|
|
2098
|
+
const value = new Date(day.getFullYear(), day.getMonth(), day.getDate());
|
|
2099
|
+
if (this.mode() === "datetime") {
|
|
2100
|
+
const time = parseTimeText(this.timeText());
|
|
2101
|
+
value.setHours(time?.hours ?? previous?.getHours() ?? 0, time?.minutes ?? previous?.getMinutes() ?? 0);
|
|
2102
|
+
}
|
|
2103
|
+
this.setValue(value);
|
|
2104
|
+
this.onTouched();
|
|
2105
|
+
this.close(true);
|
|
2106
|
+
}
|
|
2107
|
+
onCalendarCancelled() {
|
|
2108
|
+
this.close(true);
|
|
2109
|
+
}
|
|
2110
|
+
open() {
|
|
2111
|
+
const container = this.container()?.nativeElement;
|
|
2112
|
+
const template = this.calendarTemplate();
|
|
2113
|
+
if (this.isOpen() || this.isDisabled() || this.readOnly() || !container || !template) return;
|
|
2114
|
+
this.commitText();
|
|
2115
|
+
this.overlayRef = this.overlay.create({
|
|
2116
|
+
hasBackdrop: true,
|
|
2117
|
+
backdropClass: "cdk-overlay-transparent-backdrop",
|
|
2118
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
2119
|
+
positionStrategy: this.overlay.position().flexibleConnectedTo(container).withPush(true).withViewportMargin(8).withPositions([
|
|
2120
|
+
{
|
|
2121
|
+
originX: "start",
|
|
2122
|
+
originY: "bottom",
|
|
2123
|
+
overlayX: "start",
|
|
2124
|
+
overlayY: "top",
|
|
2125
|
+
offsetY: 4
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
originX: "start",
|
|
2129
|
+
originY: "top",
|
|
2130
|
+
overlayX: "start",
|
|
2131
|
+
overlayY: "bottom",
|
|
2132
|
+
offsetY: -4
|
|
2133
|
+
},
|
|
2134
|
+
{
|
|
2135
|
+
originX: "end",
|
|
2136
|
+
originY: "bottom",
|
|
2137
|
+
overlayX: "end",
|
|
2138
|
+
overlayY: "top",
|
|
2139
|
+
offsetY: 4
|
|
2140
|
+
}
|
|
2141
|
+
])
|
|
2142
|
+
});
|
|
2143
|
+
this.overlayRef.backdropClick().subscribe(() => this.close(false));
|
|
2144
|
+
this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));
|
|
2145
|
+
this.isOpen.set(true);
|
|
2146
|
+
const overlayElement = this.overlayRef.overlayElement;
|
|
2147
|
+
afterNextRender(() => overlayElement.querySelector(".calendar-day[tabindex=\"0\"]")?.focus(), { injector: this.injector });
|
|
2148
|
+
}
|
|
2149
|
+
close(returnFocus) {
|
|
2150
|
+
if (!this.isOpen()) return;
|
|
2151
|
+
this.disposeOverlay();
|
|
2152
|
+
this.isOpen.set(false);
|
|
2153
|
+
if (returnFocus) this.dateField()?.nativeElement.focus();
|
|
2154
|
+
}
|
|
2155
|
+
isInsideField(target) {
|
|
2156
|
+
return target instanceof Node && !!this.container()?.nativeElement.contains(target);
|
|
2157
|
+
}
|
|
2158
|
+
commitText() {
|
|
2159
|
+
const dateText = this.dateText().trim();
|
|
2160
|
+
const timeText = this.timeText().trim();
|
|
2161
|
+
const isDateTime = this.mode() === "datetime";
|
|
2162
|
+
if (dateText === "" && (!isDateTime || timeText === "")) {
|
|
2163
|
+
this.setValue(null);
|
|
2164
|
+
return;
|
|
2165
|
+
}
|
|
2166
|
+
const day = parseDateText(dateText, this.locale());
|
|
2167
|
+
const time = isDateTime && timeText !== "" ? parseTimeText(timeText) : null;
|
|
2168
|
+
if (!day || isDateTime && timeText !== "" && !time) {
|
|
2169
|
+
const hadValue = this.current() !== null;
|
|
2170
|
+
this.hasTypingError.set(true);
|
|
2171
|
+
this.current.set(null);
|
|
2172
|
+
this.dateText.set(dateText);
|
|
2173
|
+
this.timeText.set(timeText);
|
|
2174
|
+
if (hadValue) this.onChange(null);
|
|
2175
|
+
this.onValidatorChange();
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
if (time) day.setHours(time.hours, time.minutes);
|
|
2179
|
+
this.setValue(day);
|
|
2180
|
+
}
|
|
2181
|
+
setValue(value) {
|
|
2182
|
+
const hadTypingError = this.hasTypingError();
|
|
2183
|
+
this.hasTypingError.set(false);
|
|
2184
|
+
const previous = this.serialize(this.current());
|
|
2185
|
+
this.current.set(value);
|
|
2186
|
+
const next = this.serialize(value);
|
|
2187
|
+
if (next !== previous) this.onChange(next);
|
|
2188
|
+
else if (hadTypingError) this.onValidatorChange();
|
|
2189
|
+
}
|
|
2190
|
+
serialize(value) {
|
|
2191
|
+
if (!value) return null;
|
|
2192
|
+
return this.mode() === "datetime" ? toIsoDateTime(value) : toIsoDate(value);
|
|
2193
|
+
}
|
|
2194
|
+
disposeOverlay() {
|
|
2195
|
+
this.overlayRef?.dispose();
|
|
2196
|
+
this.overlayRef = void 0;
|
|
2197
|
+
}
|
|
2198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2199
|
+
minVersion: "12.0.0",
|
|
2200
|
+
version: "22.2.0",
|
|
2201
|
+
ngImport: i0,
|
|
2202
|
+
type: DateInputComponent,
|
|
2203
|
+
deps: [],
|
|
2204
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2205
|
+
});
|
|
2206
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2207
|
+
minVersion: "17.0.0",
|
|
2208
|
+
version: "22.2.0",
|
|
2209
|
+
type: DateInputComponent,
|
|
2210
|
+
isStandalone: true,
|
|
2211
|
+
selector: "lib-date-input",
|
|
2212
|
+
inputs: {
|
|
2213
|
+
mode: {
|
|
2214
|
+
classPropertyName: "mode",
|
|
2215
|
+
publicName: "mode",
|
|
2216
|
+
isSignal: true,
|
|
2217
|
+
isRequired: false,
|
|
2218
|
+
transformFunction: null
|
|
2219
|
+
},
|
|
2220
|
+
min: {
|
|
2221
|
+
classPropertyName: "min",
|
|
2222
|
+
publicName: "min",
|
|
2223
|
+
isSignal: true,
|
|
2224
|
+
isRequired: false,
|
|
2225
|
+
transformFunction: null
|
|
2226
|
+
},
|
|
2227
|
+
max: {
|
|
2228
|
+
classPropertyName: "max",
|
|
2229
|
+
publicName: "max",
|
|
2230
|
+
isSignal: true,
|
|
2231
|
+
isRequired: false,
|
|
2232
|
+
transformFunction: null
|
|
2233
|
+
},
|
|
2234
|
+
readOnly: {
|
|
2235
|
+
classPropertyName: "readOnly",
|
|
2236
|
+
publicName: "readOnly",
|
|
2237
|
+
isSignal: true,
|
|
2238
|
+
isRequired: false,
|
|
2239
|
+
transformFunction: null
|
|
2240
|
+
},
|
|
2241
|
+
invalid: {
|
|
2242
|
+
classPropertyName: "invalid",
|
|
2243
|
+
publicName: "invalid",
|
|
2244
|
+
isSignal: true,
|
|
2245
|
+
isRequired: false,
|
|
2246
|
+
transformFunction: null
|
|
2247
|
+
},
|
|
2248
|
+
ariaLabel: {
|
|
2249
|
+
classPropertyName: "ariaLabel",
|
|
2250
|
+
publicName: "ariaLabel",
|
|
2251
|
+
isSignal: true,
|
|
2252
|
+
isRequired: false,
|
|
2253
|
+
transformFunction: null
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
outputs: {
|
|
2257
|
+
blurred: "blurred",
|
|
2258
|
+
focused: "focused",
|
|
2259
|
+
inputChanged: "inputChanged"
|
|
2260
|
+
},
|
|
2261
|
+
host: { classAttribute: "lib-date-input" },
|
|
2262
|
+
providers: [{
|
|
2263
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2264
|
+
useExisting: forwardRef(() => DateInputComponent),
|
|
2265
|
+
multi: true
|
|
2266
|
+
}, {
|
|
2267
|
+
provide: NG_VALIDATORS,
|
|
2268
|
+
useExisting: forwardRef(() => DateInputComponent),
|
|
2269
|
+
multi: true
|
|
2270
|
+
}],
|
|
2271
|
+
viewQueries: [
|
|
2272
|
+
{
|
|
2273
|
+
propertyName: "container",
|
|
2274
|
+
first: true,
|
|
2275
|
+
predicate: ["container"],
|
|
2276
|
+
descendants: true,
|
|
2277
|
+
isSignal: true
|
|
2278
|
+
},
|
|
2279
|
+
{
|
|
2280
|
+
propertyName: "dateField",
|
|
2281
|
+
first: true,
|
|
2282
|
+
predicate: ["dateField"],
|
|
2283
|
+
descendants: true,
|
|
2284
|
+
isSignal: true
|
|
2285
|
+
},
|
|
2286
|
+
{
|
|
2287
|
+
propertyName: "calendarTemplate",
|
|
2288
|
+
first: true,
|
|
2289
|
+
predicate: ["calendarTemplate"],
|
|
2290
|
+
descendants: true,
|
|
2291
|
+
isSignal: true
|
|
2292
|
+
}
|
|
2293
|
+
],
|
|
2294
|
+
ngImport: i0,
|
|
2295
|
+
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",
|
|
2296
|
+
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"],
|
|
2297
|
+
dependencies: [{
|
|
2298
|
+
kind: "component",
|
|
2299
|
+
type: CalendarComponent,
|
|
2300
|
+
selector: "lib-calendar",
|
|
2301
|
+
inputs: [
|
|
2302
|
+
"selected",
|
|
2303
|
+
"min",
|
|
2304
|
+
"max",
|
|
2305
|
+
"locale"
|
|
2306
|
+
],
|
|
2307
|
+
outputs: ["dateSelected", "cancelled"]
|
|
2308
|
+
}]
|
|
2309
|
+
});
|
|
2310
|
+
};
|
|
2311
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2312
|
+
minVersion: "12.0.0",
|
|
2313
|
+
version: "22.2.0",
|
|
2314
|
+
ngImport: i0,
|
|
2315
|
+
type: DateInputComponent,
|
|
2316
|
+
decorators: [{
|
|
2317
|
+
type: Component,
|
|
2318
|
+
args: [{
|
|
2319
|
+
selector: "lib-date-input",
|
|
2320
|
+
imports: [CalendarComponent],
|
|
2321
|
+
providers: [{
|
|
2322
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2323
|
+
useExisting: forwardRef(() => DateInputComponent),
|
|
2324
|
+
multi: true
|
|
2325
|
+
}, {
|
|
2326
|
+
provide: NG_VALIDATORS,
|
|
2327
|
+
useExisting: forwardRef(() => DateInputComponent),
|
|
2328
|
+
multi: true
|
|
2329
|
+
}],
|
|
2330
|
+
host: { class: "lib-date-input" },
|
|
2331
|
+
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",
|
|
2332
|
+
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"]
|
|
2333
|
+
}]
|
|
2334
|
+
}],
|
|
2335
|
+
ctorParameters: () => [],
|
|
2336
|
+
propDecorators: {
|
|
2337
|
+
mode: [{
|
|
2338
|
+
type: i0.Input,
|
|
2339
|
+
args: [{
|
|
2340
|
+
isSignal: true,
|
|
2341
|
+
alias: "mode",
|
|
2342
|
+
required: false
|
|
2343
|
+
}]
|
|
2344
|
+
}],
|
|
2345
|
+
min: [{
|
|
2346
|
+
type: i0.Input,
|
|
2347
|
+
args: [{
|
|
2348
|
+
isSignal: true,
|
|
2349
|
+
alias: "min",
|
|
2350
|
+
required: false
|
|
2351
|
+
}]
|
|
2352
|
+
}],
|
|
2353
|
+
max: [{
|
|
2354
|
+
type: i0.Input,
|
|
2355
|
+
args: [{
|
|
2356
|
+
isSignal: true,
|
|
2357
|
+
alias: "max",
|
|
2358
|
+
required: false
|
|
2359
|
+
}]
|
|
2360
|
+
}],
|
|
2361
|
+
readOnly: [{
|
|
2362
|
+
type: i0.Input,
|
|
2363
|
+
args: [{
|
|
2364
|
+
isSignal: true,
|
|
2365
|
+
alias: "readOnly",
|
|
2366
|
+
required: false
|
|
2367
|
+
}]
|
|
2368
|
+
}],
|
|
2369
|
+
invalid: [{
|
|
2370
|
+
type: i0.Input,
|
|
2371
|
+
args: [{
|
|
2372
|
+
isSignal: true,
|
|
2373
|
+
alias: "invalid",
|
|
2374
|
+
required: false
|
|
2375
|
+
}]
|
|
2376
|
+
}],
|
|
2377
|
+
ariaLabel: [{
|
|
2378
|
+
type: i0.Input,
|
|
2379
|
+
args: [{
|
|
2380
|
+
isSignal: true,
|
|
2381
|
+
alias: "ariaLabel",
|
|
2382
|
+
required: false
|
|
2383
|
+
}]
|
|
2384
|
+
}],
|
|
2385
|
+
blurred: [{
|
|
2386
|
+
type: i0.Output,
|
|
2387
|
+
args: ["blurred"]
|
|
2388
|
+
}],
|
|
2389
|
+
focused: [{
|
|
2390
|
+
type: i0.Output,
|
|
2391
|
+
args: ["focused"]
|
|
2392
|
+
}],
|
|
2393
|
+
inputChanged: [{
|
|
2394
|
+
type: i0.Output,
|
|
2395
|
+
args: ["inputChanged"]
|
|
2396
|
+
}],
|
|
2397
|
+
container: [{
|
|
2398
|
+
type: i0.ViewChild,
|
|
2399
|
+
args: ["container", { isSignal: true }]
|
|
2400
|
+
}],
|
|
2401
|
+
dateField: [{
|
|
2402
|
+
type: i0.ViewChild,
|
|
2403
|
+
args: ["dateField", { isSignal: true }]
|
|
2404
|
+
}],
|
|
2405
|
+
calendarTemplate: [{
|
|
2406
|
+
type: i0.ViewChild,
|
|
2407
|
+
args: ["calendarTemplate", { isSignal: true }]
|
|
2408
|
+
}]
|
|
2409
|
+
}
|
|
2410
|
+
});
|
|
2411
|
+
function limitKey(limit) {
|
|
2412
|
+
const date = parseIsoValue(limit);
|
|
2413
|
+
return date ? toIsoDate(date) : null;
|
|
2414
|
+
}
|
|
2415
|
+
var NumberInputComponent = class NumberInputComponent {
|
|
2416
|
+
min = input(...ngDevMode ? [void 0, { debugName: "min" }] : /* istanbul ignore next */ []);
|
|
2417
|
+
max = input(...ngDevMode ? [void 0, { debugName: "max" }] : /* istanbul ignore next */ []);
|
|
2418
|
+
step = input(1, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
|
|
2419
|
+
decimals = input(...ngDevMode ? [void 0, { debugName: "decimals" }] : /* istanbul ignore next */ []);
|
|
2420
|
+
minDecimals = input(...ngDevMode ? [void 0, { debugName: "minDecimals" }] : /* istanbul ignore next */ []);
|
|
2421
|
+
grouping = input(true, ...ngDevMode ? [{ debugName: "grouping" }] : /* istanbul ignore next */ []);
|
|
2422
|
+
prefix = input(...ngDevMode ? [void 0, { debugName: "prefix" }] : /* istanbul ignore next */ []);
|
|
2423
|
+
suffix = input(...ngDevMode ? [void 0, { debugName: "suffix" }] : /* istanbul ignore next */ []);
|
|
2424
|
+
currency = input(...ngDevMode ? [void 0, { debugName: "currency" }] : /* istanbul ignore next */ []);
|
|
2425
|
+
readOnly = input(false, ...ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []);
|
|
2426
|
+
invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
|
|
2427
|
+
ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
2428
|
+
blurred = output();
|
|
2429
|
+
focused = output();
|
|
2430
|
+
inputChanged = output();
|
|
2431
|
+
localeService = inject(LocaleService);
|
|
2432
|
+
onChange = () => void 0;
|
|
2433
|
+
onTouched = () => void 0;
|
|
2434
|
+
onValidatorChange = () => void 0;
|
|
2435
|
+
current = signal(null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
2436
|
+
hasTypingError = signal(false, ...ngDevMode ? [{ debugName: "hasTypingError" }] : /* istanbul ignore next */ []);
|
|
2437
|
+
hasFocus = signal(false, ...ngDevMode ? [{ debugName: "hasFocus" }] : /* istanbul ignore next */ []);
|
|
2438
|
+
wasEdited = false;
|
|
2439
|
+
isDisabled = signal(false, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
2440
|
+
locale = computed(() => this.localeService.locale(), ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
2441
|
+
currencyAffix = computed(() => {
|
|
2442
|
+
const currency = this.currency();
|
|
2443
|
+
if (!currency) return null;
|
|
2444
|
+
try {
|
|
2445
|
+
const format = new Intl.NumberFormat(this.locale(), {
|
|
2446
|
+
style: "currency",
|
|
2447
|
+
currency
|
|
2448
|
+
});
|
|
2449
|
+
const parts = format.formatToParts(1);
|
|
2450
|
+
const symbolIndex = parts.findIndex((part) => part.type === "currency");
|
|
2451
|
+
const integerIndex = parts.findIndex((part) => part.type === "integer");
|
|
2452
|
+
return {
|
|
2453
|
+
symbol: parts[symbolIndex]?.value ?? currency,
|
|
2454
|
+
position: symbolIndex > integerIndex ? "suffix" : "prefix",
|
|
2455
|
+
fractionDigits: format.resolvedOptions().maximumFractionDigits ?? 2
|
|
2456
|
+
};
|
|
2457
|
+
} catch {
|
|
2458
|
+
return null;
|
|
2459
|
+
}
|
|
2460
|
+
}, ...ngDevMode ? [{ debugName: "currencyAffix" }] : /* istanbul ignore next */ []);
|
|
2461
|
+
prefixText = computed(() => {
|
|
2462
|
+
const affix = this.currencyAffix();
|
|
2463
|
+
return this.prefix() ?? (affix?.position === "prefix" ? affix.symbol : void 0);
|
|
2464
|
+
}, ...ngDevMode ? [{ debugName: "prefixText" }] : /* istanbul ignore next */ []);
|
|
2465
|
+
suffixText = computed(() => {
|
|
2466
|
+
const affix = this.currencyAffix();
|
|
2467
|
+
return this.suffix() ?? (affix?.position === "suffix" ? affix.symbol : void 0);
|
|
2468
|
+
}, ...ngDevMode ? [{ debugName: "suffixText" }] : /* istanbul ignore next */ []);
|
|
2469
|
+
maxDecimals = computed(() => this.decimals() ?? this.currencyAffix()?.fractionDigits ?? 3, ...ngDevMode ? [{ debugName: "maxDecimals" }] : /* istanbul ignore next */ []);
|
|
2470
|
+
fixedDecimals = computed(() => Math.min(this.minDecimals() ?? this.currencyAffix()?.fractionDigits ?? 0, this.maxDecimals()), ...ngDevMode ? [{ debugName: "fixedDecimals" }] : /* istanbul ignore next */ []);
|
|
2471
|
+
text = linkedSignal(() => {
|
|
2472
|
+
const value = this.current();
|
|
2473
|
+
if (value === null) return "";
|
|
2474
|
+
const isEditing = this.hasFocus();
|
|
2475
|
+
return formatLocaleNumber(value, this.locale(), {
|
|
2476
|
+
minFractionDigits: isEditing ? 0 : this.fixedDecimals(),
|
|
2477
|
+
maxFractionDigits: isEditing ? 20 : this.maxDecimals(),
|
|
2478
|
+
grouping: !isEditing && this.grouping()
|
|
1291
2479
|
});
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
2480
|
+
}, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
2481
|
+
inputMode = computed(() => this.maxDecimals() > 0 ? "decimal" : "numeric", ...ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []);
|
|
2482
|
+
isFieldInvalid = computed(() => this.invalid() || this.hasTypingError(), ...ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []);
|
|
2483
|
+
constructor() {
|
|
2484
|
+
let previous;
|
|
2485
|
+
effect(() => {
|
|
2486
|
+
const limits = JSON.stringify([this.min(), this.max()]);
|
|
2487
|
+
if (previous !== void 0 && previous !== limits) this.onValidatorChange();
|
|
2488
|
+
previous = limits;
|
|
2489
|
+
});
|
|
2490
|
+
}
|
|
2491
|
+
writeValue(value) {
|
|
2492
|
+
this.hasTypingError.set(false);
|
|
2493
|
+
if (value === null || value === void 0 || value === "") {
|
|
2494
|
+
this.current.set(null);
|
|
2495
|
+
return;
|
|
1295
2496
|
}
|
|
2497
|
+
const number = typeof value === "number" ? value : Number(value);
|
|
2498
|
+
this.current.set(Number.isFinite(number) ? number : null);
|
|
2499
|
+
}
|
|
2500
|
+
registerOnChange(fn) {
|
|
2501
|
+
this.onChange = fn;
|
|
2502
|
+
}
|
|
2503
|
+
registerOnTouched(fn) {
|
|
2504
|
+
this.onTouched = fn;
|
|
2505
|
+
}
|
|
2506
|
+
setDisabledState(isDisabled) {
|
|
2507
|
+
this.isDisabled.set(isDisabled);
|
|
2508
|
+
}
|
|
2509
|
+
validate(_control) {
|
|
2510
|
+
if (this.hasTypingError()) return { numberInvalid: true };
|
|
2511
|
+
const value = this.current();
|
|
2512
|
+
if (value === null) return null;
|
|
2513
|
+
const min = this.min();
|
|
2514
|
+
const max = this.max();
|
|
2515
|
+
if (min !== null && min !== void 0 && value < min) return { min: {
|
|
2516
|
+
min,
|
|
2517
|
+
actual: value
|
|
2518
|
+
} };
|
|
2519
|
+
if (max !== null && max !== void 0 && value > max) return { max: {
|
|
2520
|
+
max,
|
|
2521
|
+
actual: value
|
|
2522
|
+
} };
|
|
2523
|
+
return null;
|
|
1296
2524
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
2525
|
+
registerOnValidatorChange(fn) {
|
|
2526
|
+
this.onValidatorChange = fn;
|
|
2527
|
+
}
|
|
2528
|
+
onFocus() {
|
|
2529
|
+
this.hasFocus.set(true);
|
|
2530
|
+
this.wasEdited = false;
|
|
2531
|
+
this.focused.emit();
|
|
2532
|
+
}
|
|
2533
|
+
onBlur() {
|
|
2534
|
+
this.hasFocus.set(false);
|
|
2535
|
+
const value = this.current();
|
|
2536
|
+
if (this.wasEdited && !this.hasTypingError() && value !== null) this.setValue(this.round(value));
|
|
2537
|
+
this.wasEdited = false;
|
|
2538
|
+
this.onTouched();
|
|
2539
|
+
this.blurred.emit();
|
|
2540
|
+
}
|
|
2541
|
+
onTyped(event) {
|
|
2542
|
+
const text = event.target.value;
|
|
2543
|
+
this.wasEdited = true;
|
|
2544
|
+
this.inputChanged.emit();
|
|
2545
|
+
const parsed = parseLocaleNumber(text, this.locale());
|
|
2546
|
+
if (parsed !== null && Number.isNaN(parsed)) {
|
|
2547
|
+
const hadValue = this.current() !== null;
|
|
2548
|
+
this.hasTypingError.set(true);
|
|
2549
|
+
this.current.set(null);
|
|
2550
|
+
if (hadValue) this.onChange(null);
|
|
2551
|
+
this.onValidatorChange();
|
|
2552
|
+
} else this.setValue(parsed);
|
|
2553
|
+
this.text.set(text);
|
|
2554
|
+
}
|
|
2555
|
+
onKeydown(event) {
|
|
2556
|
+
if (this.readOnly()) return;
|
|
2557
|
+
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
2558
|
+
event.preventDefault();
|
|
2559
|
+
const direction = event.key === "ArrowUp" ? 1 : -1;
|
|
2560
|
+
this.setValue(this.clamp(this.round((this.current() ?? 0) + direction * this.step())));
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
if (event.code === "NumpadDecimal" || event.key === "Decimal") {
|
|
2564
|
+
event.preventDefault();
|
|
2565
|
+
this.insertText(event.target, getNumberSeparators(this.locale()).decimal);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
setValue(value) {
|
|
2569
|
+
const hadTypingError = this.hasTypingError();
|
|
2570
|
+
this.hasTypingError.set(false);
|
|
2571
|
+
if (value !== this.current()) {
|
|
2572
|
+
this.current.set(value);
|
|
2573
|
+
this.onChange(value);
|
|
2574
|
+
} else if (hadTypingError) this.onValidatorChange();
|
|
2575
|
+
}
|
|
2576
|
+
round(value) {
|
|
2577
|
+
const decimals = this.maxDecimals();
|
|
2578
|
+
const shifted = Math.round(Number(`${value}e${decimals}`));
|
|
2579
|
+
const rounded = Number(`${shifted}e-${decimals}`);
|
|
2580
|
+
return Number.isFinite(rounded) ? rounded : value;
|
|
2581
|
+
}
|
|
2582
|
+
clamp(value) {
|
|
2583
|
+
const min = this.min();
|
|
2584
|
+
const max = this.max();
|
|
2585
|
+
if (min !== null && min !== void 0 && value < min) return min;
|
|
2586
|
+
if (max !== null && max !== void 0 && value > max) return max;
|
|
2587
|
+
return value;
|
|
2588
|
+
}
|
|
2589
|
+
insertText(field, text) {
|
|
2590
|
+
const start = field.selectionStart ?? field.value.length;
|
|
2591
|
+
const end = field.selectionEnd ?? field.value.length;
|
|
2592
|
+
field.setRangeText(text, start, end, "end");
|
|
2593
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
1301
2594
|
}
|
|
1302
2595
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1303
2596
|
minVersion: "12.0.0",
|
|
1304
2597
|
version: "22.2.0",
|
|
1305
2598
|
ngImport: i0,
|
|
1306
|
-
type:
|
|
2599
|
+
type: NumberInputComponent,
|
|
1307
2600
|
deps: [],
|
|
1308
|
-
target: i0.ɵɵFactoryTarget.
|
|
2601
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1309
2602
|
});
|
|
1310
|
-
static
|
|
1311
|
-
minVersion: "
|
|
2603
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2604
|
+
minVersion: "17.0.0",
|
|
1312
2605
|
version: "22.2.0",
|
|
2606
|
+
type: NumberInputComponent,
|
|
2607
|
+
isStandalone: true,
|
|
2608
|
+
selector: "lib-number-input",
|
|
2609
|
+
inputs: {
|
|
2610
|
+
min: {
|
|
2611
|
+
classPropertyName: "min",
|
|
2612
|
+
publicName: "min",
|
|
2613
|
+
isSignal: true,
|
|
2614
|
+
isRequired: false,
|
|
2615
|
+
transformFunction: null
|
|
2616
|
+
},
|
|
2617
|
+
max: {
|
|
2618
|
+
classPropertyName: "max",
|
|
2619
|
+
publicName: "max",
|
|
2620
|
+
isSignal: true,
|
|
2621
|
+
isRequired: false,
|
|
2622
|
+
transformFunction: null
|
|
2623
|
+
},
|
|
2624
|
+
step: {
|
|
2625
|
+
classPropertyName: "step",
|
|
2626
|
+
publicName: "step",
|
|
2627
|
+
isSignal: true,
|
|
2628
|
+
isRequired: false,
|
|
2629
|
+
transformFunction: null
|
|
2630
|
+
},
|
|
2631
|
+
decimals: {
|
|
2632
|
+
classPropertyName: "decimals",
|
|
2633
|
+
publicName: "decimals",
|
|
2634
|
+
isSignal: true,
|
|
2635
|
+
isRequired: false,
|
|
2636
|
+
transformFunction: null
|
|
2637
|
+
},
|
|
2638
|
+
minDecimals: {
|
|
2639
|
+
classPropertyName: "minDecimals",
|
|
2640
|
+
publicName: "minDecimals",
|
|
2641
|
+
isSignal: true,
|
|
2642
|
+
isRequired: false,
|
|
2643
|
+
transformFunction: null
|
|
2644
|
+
},
|
|
2645
|
+
grouping: {
|
|
2646
|
+
classPropertyName: "grouping",
|
|
2647
|
+
publicName: "grouping",
|
|
2648
|
+
isSignal: true,
|
|
2649
|
+
isRequired: false,
|
|
2650
|
+
transformFunction: null
|
|
2651
|
+
},
|
|
2652
|
+
prefix: {
|
|
2653
|
+
classPropertyName: "prefix",
|
|
2654
|
+
publicName: "prefix",
|
|
2655
|
+
isSignal: true,
|
|
2656
|
+
isRequired: false,
|
|
2657
|
+
transformFunction: null
|
|
2658
|
+
},
|
|
2659
|
+
suffix: {
|
|
2660
|
+
classPropertyName: "suffix",
|
|
2661
|
+
publicName: "suffix",
|
|
2662
|
+
isSignal: true,
|
|
2663
|
+
isRequired: false,
|
|
2664
|
+
transformFunction: null
|
|
2665
|
+
},
|
|
2666
|
+
currency: {
|
|
2667
|
+
classPropertyName: "currency",
|
|
2668
|
+
publicName: "currency",
|
|
2669
|
+
isSignal: true,
|
|
2670
|
+
isRequired: false,
|
|
2671
|
+
transformFunction: null
|
|
2672
|
+
},
|
|
2673
|
+
readOnly: {
|
|
2674
|
+
classPropertyName: "readOnly",
|
|
2675
|
+
publicName: "readOnly",
|
|
2676
|
+
isSignal: true,
|
|
2677
|
+
isRequired: false,
|
|
2678
|
+
transformFunction: null
|
|
2679
|
+
},
|
|
2680
|
+
invalid: {
|
|
2681
|
+
classPropertyName: "invalid",
|
|
2682
|
+
publicName: "invalid",
|
|
2683
|
+
isSignal: true,
|
|
2684
|
+
isRequired: false,
|
|
2685
|
+
transformFunction: null
|
|
2686
|
+
},
|
|
2687
|
+
ariaLabel: {
|
|
2688
|
+
classPropertyName: "ariaLabel",
|
|
2689
|
+
publicName: "ariaLabel",
|
|
2690
|
+
isSignal: true,
|
|
2691
|
+
isRequired: false,
|
|
2692
|
+
transformFunction: null
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
outputs: {
|
|
2696
|
+
blurred: "blurred",
|
|
2697
|
+
focused: "focused",
|
|
2698
|
+
inputChanged: "inputChanged"
|
|
2699
|
+
},
|
|
2700
|
+
host: { classAttribute: "lib-number-input" },
|
|
2701
|
+
providers: [{
|
|
2702
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2703
|
+
useExisting: forwardRef(() => NumberInputComponent),
|
|
2704
|
+
multi: true
|
|
2705
|
+
}, {
|
|
2706
|
+
provide: NG_VALIDATORS,
|
|
2707
|
+
useExisting: forwardRef(() => NumberInputComponent),
|
|
2708
|
+
multi: true
|
|
2709
|
+
}],
|
|
1313
2710
|
ngImport: i0,
|
|
1314
|
-
type:
|
|
1315
|
-
|
|
2711
|
+
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",
|
|
2712
|
+
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
2713
|
});
|
|
1317
2714
|
};
|
|
1318
2715
|
i0.ɵɵngDeclareClassMetadata({
|
|
1319
2716
|
minVersion: "12.0.0",
|
|
1320
2717
|
version: "22.2.0",
|
|
1321
2718
|
ngImport: i0,
|
|
1322
|
-
type:
|
|
2719
|
+
type: NumberInputComponent,
|
|
1323
2720
|
decorators: [{
|
|
1324
|
-
type:
|
|
1325
|
-
args: [{
|
|
1326
|
-
|
|
2721
|
+
type: Component,
|
|
2722
|
+
args: [{
|
|
2723
|
+
selector: "lib-number-input",
|
|
2724
|
+
providers: [{
|
|
2725
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2726
|
+
useExisting: forwardRef(() => NumberInputComponent),
|
|
2727
|
+
multi: true
|
|
2728
|
+
}, {
|
|
2729
|
+
provide: NG_VALIDATORS,
|
|
2730
|
+
useExisting: forwardRef(() => NumberInputComponent),
|
|
2731
|
+
multi: true
|
|
2732
|
+
}],
|
|
2733
|
+
host: { class: "lib-number-input" },
|
|
2734
|
+
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",
|
|
2735
|
+
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"]
|
|
2736
|
+
}]
|
|
2737
|
+
}],
|
|
2738
|
+
ctorParameters: () => [],
|
|
2739
|
+
propDecorators: {
|
|
2740
|
+
min: [{
|
|
2741
|
+
type: i0.Input,
|
|
2742
|
+
args: [{
|
|
2743
|
+
isSignal: true,
|
|
2744
|
+
alias: "min",
|
|
2745
|
+
required: false
|
|
2746
|
+
}]
|
|
2747
|
+
}],
|
|
2748
|
+
max: [{
|
|
2749
|
+
type: i0.Input,
|
|
2750
|
+
args: [{
|
|
2751
|
+
isSignal: true,
|
|
2752
|
+
alias: "max",
|
|
2753
|
+
required: false
|
|
2754
|
+
}]
|
|
2755
|
+
}],
|
|
2756
|
+
step: [{
|
|
2757
|
+
type: i0.Input,
|
|
2758
|
+
args: [{
|
|
2759
|
+
isSignal: true,
|
|
2760
|
+
alias: "step",
|
|
2761
|
+
required: false
|
|
2762
|
+
}]
|
|
2763
|
+
}],
|
|
2764
|
+
decimals: [{
|
|
2765
|
+
type: i0.Input,
|
|
2766
|
+
args: [{
|
|
2767
|
+
isSignal: true,
|
|
2768
|
+
alias: "decimals",
|
|
2769
|
+
required: false
|
|
2770
|
+
}]
|
|
2771
|
+
}],
|
|
2772
|
+
minDecimals: [{
|
|
2773
|
+
type: i0.Input,
|
|
2774
|
+
args: [{
|
|
2775
|
+
isSignal: true,
|
|
2776
|
+
alias: "minDecimals",
|
|
2777
|
+
required: false
|
|
2778
|
+
}]
|
|
2779
|
+
}],
|
|
2780
|
+
grouping: [{
|
|
2781
|
+
type: i0.Input,
|
|
2782
|
+
args: [{
|
|
2783
|
+
isSignal: true,
|
|
2784
|
+
alias: "grouping",
|
|
2785
|
+
required: false
|
|
2786
|
+
}]
|
|
2787
|
+
}],
|
|
2788
|
+
prefix: [{
|
|
2789
|
+
type: i0.Input,
|
|
2790
|
+
args: [{
|
|
2791
|
+
isSignal: true,
|
|
2792
|
+
alias: "prefix",
|
|
2793
|
+
required: false
|
|
2794
|
+
}]
|
|
2795
|
+
}],
|
|
2796
|
+
suffix: [{
|
|
2797
|
+
type: i0.Input,
|
|
2798
|
+
args: [{
|
|
2799
|
+
isSignal: true,
|
|
2800
|
+
alias: "suffix",
|
|
2801
|
+
required: false
|
|
2802
|
+
}]
|
|
2803
|
+
}],
|
|
2804
|
+
currency: [{
|
|
2805
|
+
type: i0.Input,
|
|
2806
|
+
args: [{
|
|
2807
|
+
isSignal: true,
|
|
2808
|
+
alias: "currency",
|
|
2809
|
+
required: false
|
|
2810
|
+
}]
|
|
2811
|
+
}],
|
|
2812
|
+
readOnly: [{
|
|
2813
|
+
type: i0.Input,
|
|
2814
|
+
args: [{
|
|
2815
|
+
isSignal: true,
|
|
2816
|
+
alias: "readOnly",
|
|
2817
|
+
required: false
|
|
2818
|
+
}]
|
|
2819
|
+
}],
|
|
2820
|
+
invalid: [{
|
|
2821
|
+
type: i0.Input,
|
|
2822
|
+
args: [{
|
|
2823
|
+
isSignal: true,
|
|
2824
|
+
alias: "invalid",
|
|
2825
|
+
required: false
|
|
2826
|
+
}]
|
|
2827
|
+
}],
|
|
2828
|
+
ariaLabel: [{
|
|
2829
|
+
type: i0.Input,
|
|
2830
|
+
args: [{
|
|
2831
|
+
isSignal: true,
|
|
2832
|
+
alias: "ariaLabel",
|
|
2833
|
+
required: false
|
|
2834
|
+
}]
|
|
2835
|
+
}],
|
|
2836
|
+
blurred: [{
|
|
2837
|
+
type: i0.Output,
|
|
2838
|
+
args: ["blurred"]
|
|
2839
|
+
}],
|
|
2840
|
+
focused: [{
|
|
2841
|
+
type: i0.Output,
|
|
2842
|
+
args: ["focused"]
|
|
2843
|
+
}],
|
|
2844
|
+
inputChanged: [{
|
|
2845
|
+
type: i0.Output,
|
|
2846
|
+
args: ["inputChanged"]
|
|
2847
|
+
}]
|
|
2848
|
+
}
|
|
1327
2849
|
});
|
|
1328
2850
|
var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
1329
2851
|
autofocus = input(false, ...ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []);
|
|
@@ -1349,6 +2871,8 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1349
2871
|
formGroupDirective = inject(FormGroupDirective);
|
|
1350
2872
|
formGroupName = inject(FormGroupName, { optional: true });
|
|
1351
2873
|
formService = inject(FormService);
|
|
2874
|
+
angularLocale = inject(LOCALE_ID);
|
|
2875
|
+
localeService = inject(LocaleService);
|
|
1352
2876
|
formChanged = signal(0, ...ngDevMode ? [{ debugName: "formChanged" }] : /* istanbul ignore next */ []);
|
|
1353
2877
|
isEditable = computed(() => {
|
|
1354
2878
|
this.formChanged();
|
|
@@ -1360,6 +2884,12 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1360
2884
|
this.formChanged();
|
|
1361
2885
|
return this.fixedValue() ?? this.formGroupDirective.form?.get(this.disabledControlName() ?? this.controlName())?.value;
|
|
1362
2886
|
}, ...ngDevMode ? [{ debugName: "shownValue" }] : /* istanbul ignore next */ []);
|
|
2887
|
+
shownText = computed(() => this.toDisplayText(this.shownValue()), ...ngDevMode ? [{ debugName: "shownText" }] : /* istanbul ignore next */ []);
|
|
2888
|
+
fixedText = computed(() => this.toDisplayText(this.fixedValue()), ...ngDevMode ? [{ debugName: "fixedText" }] : /* istanbul ignore next */ []);
|
|
2889
|
+
numberDigits = computed(() => parseDigitsInfo(this.format()) ?? {
|
|
2890
|
+
minFractionDigits: 0,
|
|
2891
|
+
maxFractionDigits: 3
|
|
2892
|
+
}, ...ngDevMode ? [{ debugName: "numberDigits" }] : /* istanbul ignore next */ []);
|
|
1363
2893
|
get formControl() {
|
|
1364
2894
|
return this.controlName() ? this.formGroup.get(this.controlName()) : null;
|
|
1365
2895
|
}
|
|
@@ -1396,15 +2926,13 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1396
2926
|
if (value !== null && value === "") this.formControl?.setValue(null);
|
|
1397
2927
|
});
|
|
1398
2928
|
break;
|
|
1399
|
-
case "date":
|
|
1400
|
-
if (
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
2929
|
+
case "date": if (this.formControl) this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value) => {
|
|
2930
|
+
if (value !== null) try {
|
|
2931
|
+
if (value !== formatDate(value, "yyyy-MM-dd", "en")) this.formControl?.setValue(formatDate(value, "yyyy-MM-dd", "en"), { emitEvent: false });
|
|
2932
|
+
} catch {
|
|
2933
|
+
this.formControl?.setValue(null, { emitEvent: false });
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
1408
2936
|
}
|
|
1409
2937
|
}
|
|
1410
2938
|
onBlur() {
|
|
@@ -1423,6 +2951,26 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1423
2951
|
this.fixedValue.set(newText);
|
|
1424
2952
|
this.fixedValueChanged.emit(newText);
|
|
1425
2953
|
}
|
|
2954
|
+
toDisplayText(value) {
|
|
2955
|
+
if (value === null || value === void 0 || value === "") return "";
|
|
2956
|
+
const locale = this.localeService.locale();
|
|
2957
|
+
const format = this.format();
|
|
2958
|
+
switch (this.type()) {
|
|
2959
|
+
case "date":
|
|
2960
|
+
case "datetime-local": {
|
|
2961
|
+
const date = parseIsoValue(value);
|
|
2962
|
+
if (!date) return String(value);
|
|
2963
|
+
if (format) return formatDate(date, format, this.angularLocale);
|
|
2964
|
+
const day = formatDateText(date, locale);
|
|
2965
|
+
return this.type() === "date" ? day : `${day} ${formatTimeText(date, locale)}`;
|
|
2966
|
+
}
|
|
2967
|
+
case "number": {
|
|
2968
|
+
const number = typeof value === "number" ? value : Number(value);
|
|
2969
|
+
return Number.isFinite(number) ? formatLocaleNumber(number, locale, this.numberDigits()) : String(value);
|
|
2970
|
+
}
|
|
2971
|
+
default: return String(value);
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
1426
2974
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1427
2975
|
minVersion: "12.0.0",
|
|
1428
2976
|
version: "22.2.0",
|
|
@@ -1559,7 +3107,7 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1559
3107
|
} },
|
|
1560
3108
|
usesInheritance: true,
|
|
1561
3109
|
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]=\"
|
|
3110
|
+
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
3111
|
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
3112
|
dependencies: [
|
|
1565
3113
|
{
|
|
@@ -1572,6 +3120,34 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1572
3120
|
selector: "[ngClass]",
|
|
1573
3121
|
inputs: ["class", "ngClass"]
|
|
1574
3122
|
},
|
|
3123
|
+
{
|
|
3124
|
+
kind: "directive",
|
|
3125
|
+
type: i1$1.NgTemplateOutlet,
|
|
3126
|
+
selector: "[ngTemplateOutlet]",
|
|
3127
|
+
inputs: [
|
|
3128
|
+
"ngTemplateOutletContext",
|
|
3129
|
+
"ngTemplateOutlet",
|
|
3130
|
+
"ngTemplateOutletInjector"
|
|
3131
|
+
]
|
|
3132
|
+
},
|
|
3133
|
+
{
|
|
3134
|
+
kind: "component",
|
|
3135
|
+
type: DateInputComponent,
|
|
3136
|
+
selector: "lib-date-input",
|
|
3137
|
+
inputs: [
|
|
3138
|
+
"mode",
|
|
3139
|
+
"min",
|
|
3140
|
+
"max",
|
|
3141
|
+
"readOnly",
|
|
3142
|
+
"invalid",
|
|
3143
|
+
"ariaLabel"
|
|
3144
|
+
],
|
|
3145
|
+
outputs: [
|
|
3146
|
+
"blurred",
|
|
3147
|
+
"focused",
|
|
3148
|
+
"inputChanged"
|
|
3149
|
+
]
|
|
3150
|
+
},
|
|
1575
3151
|
{
|
|
1576
3152
|
kind: "ngmodule",
|
|
1577
3153
|
type: FormsModule
|
|
@@ -1604,6 +3180,30 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1604
3180
|
outputs: ["ngModelChange"],
|
|
1605
3181
|
exportAs: ["ngModel"]
|
|
1606
3182
|
},
|
|
3183
|
+
{
|
|
3184
|
+
kind: "component",
|
|
3185
|
+
type: NumberInputComponent,
|
|
3186
|
+
selector: "lib-number-input",
|
|
3187
|
+
inputs: [
|
|
3188
|
+
"min",
|
|
3189
|
+
"max",
|
|
3190
|
+
"step",
|
|
3191
|
+
"decimals",
|
|
3192
|
+
"minDecimals",
|
|
3193
|
+
"grouping",
|
|
3194
|
+
"prefix",
|
|
3195
|
+
"suffix",
|
|
3196
|
+
"currency",
|
|
3197
|
+
"readOnly",
|
|
3198
|
+
"invalid",
|
|
3199
|
+
"ariaLabel"
|
|
3200
|
+
],
|
|
3201
|
+
outputs: [
|
|
3202
|
+
"blurred",
|
|
3203
|
+
"focused",
|
|
3204
|
+
"inputChanged"
|
|
3205
|
+
]
|
|
3206
|
+
},
|
|
1607
3207
|
{
|
|
1608
3208
|
kind: "ngmodule",
|
|
1609
3209
|
type: ReactiveFormsModule
|
|
@@ -1618,16 +3218,6 @@ var FormInputComponent = class FormInputComponent extends BaseComponent {
|
|
|
1618
3218
|
"ngModel"
|
|
1619
3219
|
],
|
|
1620
3220
|
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
3221
|
}
|
|
1632
3222
|
],
|
|
1633
3223
|
viewProviders: [{
|
|
@@ -1647,7 +3237,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1647
3237
|
selector: "lib-form-input",
|
|
1648
3238
|
imports: [
|
|
1649
3239
|
CommonModule,
|
|
3240
|
+
DateInputComponent,
|
|
1650
3241
|
FormsModule,
|
|
3242
|
+
NumberInputComponent,
|
|
1651
3243
|
ReactiveFormsModule
|
|
1652
3244
|
],
|
|
1653
3245
|
viewProviders: [{
|
|
@@ -1658,7 +3250,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1658
3250
|
"[class.full-height]": "isFullHeight()",
|
|
1659
3251
|
"[attr.type]": "null"
|
|
1660
3252
|
},
|
|
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]=\"
|
|
3253
|
+
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
3254
|
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
3255
|
}]
|
|
1664
3256
|
}],
|
|
@@ -1812,6 +3404,129 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1812
3404
|
}]
|
|
1813
3405
|
}
|
|
1814
3406
|
});
|
|
3407
|
+
var SkeletonComponent = class SkeletonComponent {
|
|
3408
|
+
shape = input("text", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
3409
|
+
lines = input(1, ...ngDevMode ? [{ debugName: "lines" }] : /* istanbul ignore next */ []);
|
|
3410
|
+
width = input(...ngDevMode ? [void 0, { debugName: "width" }] : /* istanbul ignore next */ []);
|
|
3411
|
+
height = input(...ngDevMode ? [void 0, { debugName: "height" }] : /* istanbul ignore next */ []);
|
|
3412
|
+
lineIndexes = computed(() => Array.from({ length: Math.max(1, Math.floor(this.lines() || 1)) }, (_, index) => index), ...ngDevMode ? [{ debugName: "lineIndexes" }] : /* istanbul ignore next */ []);
|
|
3413
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3414
|
+
minVersion: "12.0.0",
|
|
3415
|
+
version: "22.2.0",
|
|
3416
|
+
ngImport: i0,
|
|
3417
|
+
type: SkeletonComponent,
|
|
3418
|
+
deps: [],
|
|
3419
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3420
|
+
});
|
|
3421
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3422
|
+
minVersion: "17.0.0",
|
|
3423
|
+
version: "22.2.0",
|
|
3424
|
+
type: SkeletonComponent,
|
|
3425
|
+
isStandalone: true,
|
|
3426
|
+
selector: "lib-skeleton",
|
|
3427
|
+
inputs: {
|
|
3428
|
+
shape: {
|
|
3429
|
+
classPropertyName: "shape",
|
|
3430
|
+
publicName: "shape",
|
|
3431
|
+
isSignal: true,
|
|
3432
|
+
isRequired: false,
|
|
3433
|
+
transformFunction: null
|
|
3434
|
+
},
|
|
3435
|
+
lines: {
|
|
3436
|
+
classPropertyName: "lines",
|
|
3437
|
+
publicName: "lines",
|
|
3438
|
+
isSignal: true,
|
|
3439
|
+
isRequired: false,
|
|
3440
|
+
transformFunction: null
|
|
3441
|
+
},
|
|
3442
|
+
width: {
|
|
3443
|
+
classPropertyName: "width",
|
|
3444
|
+
publicName: "width",
|
|
3445
|
+
isSignal: true,
|
|
3446
|
+
isRequired: false,
|
|
3447
|
+
transformFunction: null
|
|
3448
|
+
},
|
|
3449
|
+
height: {
|
|
3450
|
+
classPropertyName: "height",
|
|
3451
|
+
publicName: "height",
|
|
3452
|
+
isSignal: true,
|
|
3453
|
+
isRequired: false,
|
|
3454
|
+
transformFunction: null
|
|
3455
|
+
}
|
|
3456
|
+
},
|
|
3457
|
+
host: {
|
|
3458
|
+
attributes: { "aria-hidden": "true" },
|
|
3459
|
+
properties: {
|
|
3460
|
+
"class.shape-text": "shape() === 'text'",
|
|
3461
|
+
"class.shape-block": "shape() === 'block'",
|
|
3462
|
+
"class.shape-circle": "shape() === 'circle'",
|
|
3463
|
+
"style.width": "width() ?? null",
|
|
3464
|
+
"style.height": "shape() === 'text' ? null : (height() ?? null)"
|
|
3465
|
+
},
|
|
3466
|
+
classAttribute: "lib-skeleton"
|
|
3467
|
+
},
|
|
3468
|
+
ngImport: i0,
|
|
3469
|
+
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",
|
|
3470
|
+
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"]
|
|
3471
|
+
});
|
|
3472
|
+
};
|
|
3473
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3474
|
+
minVersion: "12.0.0",
|
|
3475
|
+
version: "22.2.0",
|
|
3476
|
+
ngImport: i0,
|
|
3477
|
+
type: SkeletonComponent,
|
|
3478
|
+
decorators: [{
|
|
3479
|
+
type: Component,
|
|
3480
|
+
args: [{
|
|
3481
|
+
selector: "lib-skeleton",
|
|
3482
|
+
host: {
|
|
3483
|
+
class: "lib-skeleton",
|
|
3484
|
+
"aria-hidden": "true",
|
|
3485
|
+
"[class.shape-text]": "shape() === 'text'",
|
|
3486
|
+
"[class.shape-block]": "shape() === 'block'",
|
|
3487
|
+
"[class.shape-circle]": "shape() === 'circle'",
|
|
3488
|
+
"[style.width]": "width() ?? null",
|
|
3489
|
+
"[style.height]": "shape() === 'text' ? null : (height() ?? null)"
|
|
3490
|
+
},
|
|
3491
|
+
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",
|
|
3492
|
+
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"]
|
|
3493
|
+
}]
|
|
3494
|
+
}],
|
|
3495
|
+
propDecorators: {
|
|
3496
|
+
shape: [{
|
|
3497
|
+
type: i0.Input,
|
|
3498
|
+
args: [{
|
|
3499
|
+
isSignal: true,
|
|
3500
|
+
alias: "shape",
|
|
3501
|
+
required: false
|
|
3502
|
+
}]
|
|
3503
|
+
}],
|
|
3504
|
+
lines: [{
|
|
3505
|
+
type: i0.Input,
|
|
3506
|
+
args: [{
|
|
3507
|
+
isSignal: true,
|
|
3508
|
+
alias: "lines",
|
|
3509
|
+
required: false
|
|
3510
|
+
}]
|
|
3511
|
+
}],
|
|
3512
|
+
width: [{
|
|
3513
|
+
type: i0.Input,
|
|
3514
|
+
args: [{
|
|
3515
|
+
isSignal: true,
|
|
3516
|
+
alias: "width",
|
|
3517
|
+
required: false
|
|
3518
|
+
}]
|
|
3519
|
+
}],
|
|
3520
|
+
height: [{
|
|
3521
|
+
type: i0.Input,
|
|
3522
|
+
args: [{
|
|
3523
|
+
isSignal: true,
|
|
3524
|
+
alias: "height",
|
|
3525
|
+
required: false
|
|
3526
|
+
}]
|
|
3527
|
+
}]
|
|
3528
|
+
}
|
|
3529
|
+
});
|
|
1815
3530
|
var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponent {
|
|
1816
3531
|
autofocus = input(false, ...ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []);
|
|
1817
3532
|
alignContent = input("center", ...ngDevMode ? [{ debugName: "alignContent" }] : /* istanbul ignore next */ []);
|
|
@@ -2028,8 +3743,8 @@ var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponen
|
|
|
2028
3743
|
} },
|
|
2029
3744
|
usesInheritance: true,
|
|
2030
3745
|
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 <
|
|
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)
|
|
3746
|
+
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",
|
|
3747
|
+
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
3748
|
dependencies: [
|
|
2034
3749
|
{
|
|
2035
3750
|
kind: "component",
|
|
@@ -2078,6 +3793,17 @@ var FormInputGroupComponent = class FormInputGroupComponent extends BaseComponen
|
|
|
2078
3793
|
"ngTemplateOutletInjector"
|
|
2079
3794
|
]
|
|
2080
3795
|
},
|
|
3796
|
+
{
|
|
3797
|
+
kind: "component",
|
|
3798
|
+
type: SkeletonComponent,
|
|
3799
|
+
selector: "lib-skeleton",
|
|
3800
|
+
inputs: [
|
|
3801
|
+
"shape",
|
|
3802
|
+
"lines",
|
|
3803
|
+
"width",
|
|
3804
|
+
"height"
|
|
3805
|
+
]
|
|
3806
|
+
},
|
|
2081
3807
|
{
|
|
2082
3808
|
kind: "pipe",
|
|
2083
3809
|
type: KeyValuePipe,
|
|
@@ -2105,14 +3831,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2105
3831
|
KeyValuePipe,
|
|
2106
3832
|
NgStyle,
|
|
2107
3833
|
NgTemplateOutlet,
|
|
3834
|
+
SkeletonComponent,
|
|
2108
3835
|
TranslatePipe
|
|
2109
3836
|
],
|
|
2110
3837
|
host: {
|
|
2111
3838
|
"[class.full-height]": "isFullHeight()",
|
|
2112
3839
|
"[attr.type]": "null"
|
|
2113
3840
|
},
|
|
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 <
|
|
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)
|
|
3841
|
+
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",
|
|
3842
|
+
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
3843
|
}]
|
|
2117
3844
|
}],
|
|
2118
3845
|
ctorParameters: () => [],
|
|
@@ -3334,7 +5061,7 @@ var DataGridComponent = class DataGridComponent extends BaseComponent {
|
|
|
3334
5061
|
return this.dataGridDataset?.configs?.messageOnFailed ?? "";
|
|
3335
5062
|
}
|
|
3336
5063
|
get selectionColWidth() {
|
|
3337
|
-
return this.selectionColRealSize ? `${this.selectionColRealSize}px` : this.configs.multiSelectSize ?? "
|
|
5064
|
+
return this.selectionColRealSize ? `${this.selectionColRealSize}px` : this.configs.multiSelectSize ?? "min-content";
|
|
3338
5065
|
}
|
|
3339
5066
|
get shouldDisplayMessageWhenEmpty() {
|
|
3340
5067
|
return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;
|
|
@@ -5761,6 +7488,410 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5761
7488
|
label: [{ type: Input }]
|
|
5762
7489
|
}
|
|
5763
7490
|
});
|
|
7491
|
+
var TooltipComponent = class TooltipComponent {
|
|
7492
|
+
text = input("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
7493
|
+
tooltipId = input(...ngDevMode ? [void 0, { debugName: "tooltipId" }] : /* istanbul ignore next */ []);
|
|
7494
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7495
|
+
minVersion: "12.0.0",
|
|
7496
|
+
version: "22.2.0",
|
|
7497
|
+
ngImport: i0,
|
|
7498
|
+
type: TooltipComponent,
|
|
7499
|
+
deps: [],
|
|
7500
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
7501
|
+
});
|
|
7502
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
7503
|
+
minVersion: "17.1.0",
|
|
7504
|
+
version: "22.2.0",
|
|
7505
|
+
type: TooltipComponent,
|
|
7506
|
+
isStandalone: true,
|
|
7507
|
+
selector: "lib-tooltip",
|
|
7508
|
+
inputs: {
|
|
7509
|
+
text: {
|
|
7510
|
+
classPropertyName: "text",
|
|
7511
|
+
publicName: "text",
|
|
7512
|
+
isSignal: true,
|
|
7513
|
+
isRequired: false,
|
|
7514
|
+
transformFunction: null
|
|
7515
|
+
},
|
|
7516
|
+
tooltipId: {
|
|
7517
|
+
classPropertyName: "tooltipId",
|
|
7518
|
+
publicName: "tooltipId",
|
|
7519
|
+
isSignal: true,
|
|
7520
|
+
isRequired: false,
|
|
7521
|
+
transformFunction: null
|
|
7522
|
+
}
|
|
7523
|
+
},
|
|
7524
|
+
host: {
|
|
7525
|
+
attributes: { "role": "tooltip" },
|
|
7526
|
+
properties: { "attr.id": "tooltipId()" },
|
|
7527
|
+
classAttribute: "lib-tooltip"
|
|
7528
|
+
},
|
|
7529
|
+
ngImport: i0,
|
|
7530
|
+
template: `{{ text() | translate }}`,
|
|
7531
|
+
isInline: true,
|
|
7532
|
+
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"],
|
|
7533
|
+
dependencies: [{
|
|
7534
|
+
kind: "pipe",
|
|
7535
|
+
type: TranslatePipe,
|
|
7536
|
+
name: "translate"
|
|
7537
|
+
}]
|
|
7538
|
+
});
|
|
7539
|
+
};
|
|
7540
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
7541
|
+
minVersion: "12.0.0",
|
|
7542
|
+
version: "22.2.0",
|
|
7543
|
+
ngImport: i0,
|
|
7544
|
+
type: TooltipComponent,
|
|
7545
|
+
decorators: [{
|
|
7546
|
+
type: Component,
|
|
7547
|
+
args: [{
|
|
7548
|
+
selector: "lib-tooltip",
|
|
7549
|
+
template: `{{ text() | translate }}`,
|
|
7550
|
+
host: {
|
|
7551
|
+
class: "lib-tooltip",
|
|
7552
|
+
role: "tooltip",
|
|
7553
|
+
"[attr.id]": "tooltipId()"
|
|
7554
|
+
},
|
|
7555
|
+
imports: [TranslatePipe],
|
|
7556
|
+
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"]
|
|
7557
|
+
}]
|
|
7558
|
+
}],
|
|
7559
|
+
propDecorators: {
|
|
7560
|
+
text: [{
|
|
7561
|
+
type: i0.Input,
|
|
7562
|
+
args: [{
|
|
7563
|
+
isSignal: true,
|
|
7564
|
+
alias: "text",
|
|
7565
|
+
required: false
|
|
7566
|
+
}]
|
|
7567
|
+
}],
|
|
7568
|
+
tooltipId: [{
|
|
7569
|
+
type: i0.Input,
|
|
7570
|
+
args: [{
|
|
7571
|
+
isSignal: true,
|
|
7572
|
+
alias: "tooltipId",
|
|
7573
|
+
required: false
|
|
7574
|
+
}]
|
|
7575
|
+
}]
|
|
7576
|
+
}
|
|
7577
|
+
});
|
|
7578
|
+
const OFFSET = 6;
|
|
7579
|
+
const HIDE_GRACE_MS = 100;
|
|
7580
|
+
const LONG_PRESS_MS = 500;
|
|
7581
|
+
const TOUCH_LINGER_MS = 1500;
|
|
7582
|
+
const EMULATED_MOUSE_WINDOW_MS = 800;
|
|
7583
|
+
const FOCUSABLE = "button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
|
|
7584
|
+
let hideOpenTooltip;
|
|
7585
|
+
const ABOVE = {
|
|
7586
|
+
originX: "center",
|
|
7587
|
+
originY: "top",
|
|
7588
|
+
overlayX: "center",
|
|
7589
|
+
overlayY: "bottom",
|
|
7590
|
+
offsetY: -6
|
|
7591
|
+
};
|
|
7592
|
+
const BELOW = {
|
|
7593
|
+
originX: "center",
|
|
7594
|
+
originY: "bottom",
|
|
7595
|
+
overlayX: "center",
|
|
7596
|
+
overlayY: "top",
|
|
7597
|
+
offsetY: OFFSET
|
|
7598
|
+
};
|
|
7599
|
+
const BEFORE = {
|
|
7600
|
+
originX: "start",
|
|
7601
|
+
originY: "center",
|
|
7602
|
+
overlayX: "end",
|
|
7603
|
+
overlayY: "center",
|
|
7604
|
+
offsetX: -6
|
|
7605
|
+
};
|
|
7606
|
+
const AFTER = {
|
|
7607
|
+
originX: "end",
|
|
7608
|
+
originY: "center",
|
|
7609
|
+
overlayX: "start",
|
|
7610
|
+
overlayY: "center",
|
|
7611
|
+
offsetX: OFFSET
|
|
7612
|
+
};
|
|
7613
|
+
const POSITIONS = {
|
|
7614
|
+
top: [
|
|
7615
|
+
ABOVE,
|
|
7616
|
+
BELOW,
|
|
7617
|
+
AFTER,
|
|
7618
|
+
BEFORE
|
|
7619
|
+
],
|
|
7620
|
+
bottom: [
|
|
7621
|
+
BELOW,
|
|
7622
|
+
ABOVE,
|
|
7623
|
+
AFTER,
|
|
7624
|
+
BEFORE
|
|
7625
|
+
],
|
|
7626
|
+
start: [
|
|
7627
|
+
BEFORE,
|
|
7628
|
+
AFTER,
|
|
7629
|
+
ABOVE,
|
|
7630
|
+
BELOW
|
|
7631
|
+
],
|
|
7632
|
+
end: [
|
|
7633
|
+
AFTER,
|
|
7634
|
+
BEFORE,
|
|
7635
|
+
ABOVE,
|
|
7636
|
+
BELOW
|
|
7637
|
+
]
|
|
7638
|
+
};
|
|
7639
|
+
var TooltipDirective = class TooltipDirective {
|
|
7640
|
+
text = input("", {
|
|
7641
|
+
...ngDevMode ? { debugName: "text" } : /* istanbul ignore next */ {},
|
|
7642
|
+
alias: "libTooltip"
|
|
7643
|
+
});
|
|
7644
|
+
tooltipPosition = input("top", ...ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []);
|
|
7645
|
+
tooltipDisabled = input(false, ...ngDevMode ? [{ debugName: "tooltipDisabled" }] : /* istanbul ignore next */ []);
|
|
7646
|
+
tooltipDelay = input(300, ...ngDevMode ? [{ debugName: "tooltipDelay" }] : /* istanbul ignore next */ []);
|
|
7647
|
+
static instances = 0;
|
|
7648
|
+
tooltipId = `lib-tooltip-${TooltipDirective.instances++}`;
|
|
7649
|
+
host = inject(ElementRef);
|
|
7650
|
+
overlay = inject(Overlay);
|
|
7651
|
+
renderer = inject(Renderer2);
|
|
7652
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
7653
|
+
overlayRef;
|
|
7654
|
+
tooltipRef;
|
|
7655
|
+
removeListeners = [];
|
|
7656
|
+
describedElement;
|
|
7657
|
+
previousDescribedBy = null;
|
|
7658
|
+
showTimer;
|
|
7659
|
+
hideTimer;
|
|
7660
|
+
lastTouch = 0;
|
|
7661
|
+
hideThis = () => this.hide();
|
|
7662
|
+
isHostHovered = false;
|
|
7663
|
+
isTooltipHovered = false;
|
|
7664
|
+
isFocused = false;
|
|
7665
|
+
constructor() {
|
|
7666
|
+
effect(() => {
|
|
7667
|
+
const text = this.text() ?? "";
|
|
7668
|
+
if (this.tooltipDisabled() || !text) this.hide();
|
|
7669
|
+
else this.tooltipRef?.setInput("text", text);
|
|
7670
|
+
});
|
|
7671
|
+
inject(DestroyRef).onDestroy(() => this.hide());
|
|
7672
|
+
}
|
|
7673
|
+
onMouseEnter() {
|
|
7674
|
+
if (this.isEmulatedMouse()) return;
|
|
7675
|
+
this.isHostHovered = true;
|
|
7676
|
+
this.scheduleShow(this.tooltipDelay());
|
|
7677
|
+
}
|
|
7678
|
+
onMouseLeave() {
|
|
7679
|
+
this.isHostHovered = false;
|
|
7680
|
+
this.scheduleHideIfIdle();
|
|
7681
|
+
}
|
|
7682
|
+
onFocusIn() {
|
|
7683
|
+
if (this.isEmulatedMouse()) return;
|
|
7684
|
+
this.isFocused = true;
|
|
7685
|
+
this.scheduleShow(this.tooltipDelay());
|
|
7686
|
+
}
|
|
7687
|
+
onFocusOut() {
|
|
7688
|
+
this.isFocused = false;
|
|
7689
|
+
this.scheduleHideIfIdle();
|
|
7690
|
+
}
|
|
7691
|
+
onTouchStart() {
|
|
7692
|
+
this.lastTouch = Date.now();
|
|
7693
|
+
this.scheduleShow(LONG_PRESS_MS);
|
|
7694
|
+
}
|
|
7695
|
+
onTouchEnd() {
|
|
7696
|
+
this.lastTouch = Date.now();
|
|
7697
|
+
this.clearShowTimer();
|
|
7698
|
+
if (this.overlayRef) {
|
|
7699
|
+
this.clearHideTimer();
|
|
7700
|
+
this.hideTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);
|
|
7701
|
+
}
|
|
7702
|
+
}
|
|
7703
|
+
show() {
|
|
7704
|
+
this.clearShowTimer();
|
|
7705
|
+
this.clearHideTimer();
|
|
7706
|
+
if (this.overlayRef || this.tooltipDisabled() || !this.text()) return;
|
|
7707
|
+
if (hideOpenTooltip && hideOpenTooltip !== this.hideThis) hideOpenTooltip();
|
|
7708
|
+
hideOpenTooltip = this.hideThis;
|
|
7709
|
+
const host = this.host.nativeElement;
|
|
7710
|
+
this.overlayRef = this.overlay.create({
|
|
7711
|
+
positionStrategy: this.overlay.position().flexibleConnectedTo(host).withPositions(POSITIONS[this.tooltipPosition()]).withFlexibleDimensions(false).withViewportMargin(8),
|
|
7712
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
7713
|
+
panelClass: "lib-tooltip-pane"
|
|
7714
|
+
});
|
|
7715
|
+
this.tooltipRef = this.overlayRef.attach(new ComponentPortal(TooltipComponent, this.viewContainerRef));
|
|
7716
|
+
this.tooltipRef.setInput("text", this.text());
|
|
7717
|
+
this.tooltipRef.setInput("tooltipId", this.tooltipId);
|
|
7718
|
+
const pane = this.overlayRef.overlayElement;
|
|
7719
|
+
this.removeListeners = [
|
|
7720
|
+
this.renderer.listen(pane, "mouseenter", () => {
|
|
7721
|
+
this.isTooltipHovered = true;
|
|
7722
|
+
this.clearHideTimer();
|
|
7723
|
+
}),
|
|
7724
|
+
this.renderer.listen(pane, "mouseleave", () => {
|
|
7725
|
+
this.isTooltipHovered = false;
|
|
7726
|
+
this.scheduleHideIfIdle();
|
|
7727
|
+
}),
|
|
7728
|
+
this.renderer.listen("window", "keydown", (event) => {
|
|
7729
|
+
if (event.key === "Escape") {
|
|
7730
|
+
if (this.isFocused) event.stopPropagation();
|
|
7731
|
+
this.hide();
|
|
7732
|
+
}
|
|
7733
|
+
}, { capture: true })
|
|
7734
|
+
];
|
|
7735
|
+
this.describedElement = this.findDescribedElement();
|
|
7736
|
+
this.previousDescribedBy = this.describedElement.getAttribute("aria-describedby");
|
|
7737
|
+
const describedBy = [this.previousDescribedBy, this.tooltipId].filter(Boolean).join(" ");
|
|
7738
|
+
this.describedElement.setAttribute("aria-describedby", describedBy);
|
|
7739
|
+
}
|
|
7740
|
+
hide() {
|
|
7741
|
+
this.clearShowTimer();
|
|
7742
|
+
this.clearHideTimer();
|
|
7743
|
+
this.isTooltipHovered = false;
|
|
7744
|
+
if (!this.overlayRef) return;
|
|
7745
|
+
if (hideOpenTooltip === this.hideThis) hideOpenTooltip = void 0;
|
|
7746
|
+
this.removeListeners.forEach((remove) => remove());
|
|
7747
|
+
this.removeListeners = [];
|
|
7748
|
+
this.overlayRef.dispose();
|
|
7749
|
+
this.overlayRef = void 0;
|
|
7750
|
+
this.tooltipRef = void 0;
|
|
7751
|
+
if (this.previousDescribedBy) this.describedElement?.setAttribute("aria-describedby", this.previousDescribedBy);
|
|
7752
|
+
else this.describedElement?.removeAttribute("aria-describedby");
|
|
7753
|
+
this.describedElement = void 0;
|
|
7754
|
+
this.previousDescribedBy = null;
|
|
7755
|
+
}
|
|
7756
|
+
scheduleShow(delay) {
|
|
7757
|
+
this.clearHideTimer();
|
|
7758
|
+
if (this.overlayRef || this.showTimer || this.tooltipDisabled() || !this.text()) return;
|
|
7759
|
+
this.showTimer = setTimeout(() => this.show(), Math.max(0, delay));
|
|
7760
|
+
}
|
|
7761
|
+
scheduleHideIfIdle() {
|
|
7762
|
+
if (this.isHostHovered || this.isTooltipHovered || this.isFocused) return;
|
|
7763
|
+
this.clearShowTimer();
|
|
7764
|
+
this.clearHideTimer();
|
|
7765
|
+
if (this.overlayRef) this.hideTimer = setTimeout(() => this.hide(), HIDE_GRACE_MS);
|
|
7766
|
+
}
|
|
7767
|
+
findDescribedElement() {
|
|
7768
|
+
const host = this.host.nativeElement;
|
|
7769
|
+
if (host.matches(FOCUSABLE)) return host;
|
|
7770
|
+
return host.querySelector(FOCUSABLE) ?? host;
|
|
7771
|
+
}
|
|
7772
|
+
isEmulatedMouse() {
|
|
7773
|
+
return Date.now() - this.lastTouch < EMULATED_MOUSE_WINDOW_MS;
|
|
7774
|
+
}
|
|
7775
|
+
clearShowTimer() {
|
|
7776
|
+
clearTimeout(this.showTimer);
|
|
7777
|
+
this.showTimer = void 0;
|
|
7778
|
+
}
|
|
7779
|
+
clearHideTimer() {
|
|
7780
|
+
clearTimeout(this.hideTimer);
|
|
7781
|
+
this.hideTimer = void 0;
|
|
7782
|
+
}
|
|
7783
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7784
|
+
minVersion: "12.0.0",
|
|
7785
|
+
version: "22.2.0",
|
|
7786
|
+
ngImport: i0,
|
|
7787
|
+
type: TooltipDirective,
|
|
7788
|
+
deps: [],
|
|
7789
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
7790
|
+
});
|
|
7791
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
7792
|
+
minVersion: "17.1.0",
|
|
7793
|
+
version: "22.2.0",
|
|
7794
|
+
type: TooltipDirective,
|
|
7795
|
+
isStandalone: true,
|
|
7796
|
+
selector: "[libTooltip]",
|
|
7797
|
+
inputs: {
|
|
7798
|
+
text: {
|
|
7799
|
+
classPropertyName: "text",
|
|
7800
|
+
publicName: "libTooltip",
|
|
7801
|
+
isSignal: true,
|
|
7802
|
+
isRequired: false,
|
|
7803
|
+
transformFunction: null
|
|
7804
|
+
},
|
|
7805
|
+
tooltipPosition: {
|
|
7806
|
+
classPropertyName: "tooltipPosition",
|
|
7807
|
+
publicName: "tooltipPosition",
|
|
7808
|
+
isSignal: true,
|
|
7809
|
+
isRequired: false,
|
|
7810
|
+
transformFunction: null
|
|
7811
|
+
},
|
|
7812
|
+
tooltipDisabled: {
|
|
7813
|
+
classPropertyName: "tooltipDisabled",
|
|
7814
|
+
publicName: "tooltipDisabled",
|
|
7815
|
+
isSignal: true,
|
|
7816
|
+
isRequired: false,
|
|
7817
|
+
transformFunction: null
|
|
7818
|
+
},
|
|
7819
|
+
tooltipDelay: {
|
|
7820
|
+
classPropertyName: "tooltipDelay",
|
|
7821
|
+
publicName: "tooltipDelay",
|
|
7822
|
+
isSignal: true,
|
|
7823
|
+
isRequired: false,
|
|
7824
|
+
transformFunction: null
|
|
7825
|
+
}
|
|
7826
|
+
},
|
|
7827
|
+
host: { listeners: {
|
|
7828
|
+
"mouseenter": "onMouseEnter()",
|
|
7829
|
+
"mouseleave": "onMouseLeave()",
|
|
7830
|
+
"focusin": "onFocusIn()",
|
|
7831
|
+
"focusout": "onFocusOut()",
|
|
7832
|
+
"touchstart": "onTouchStart()",
|
|
7833
|
+
"touchend": "onTouchEnd()",
|
|
7834
|
+
"touchcancel": "onTouchEnd()"
|
|
7835
|
+
} },
|
|
7836
|
+
ngImport: i0
|
|
7837
|
+
});
|
|
7838
|
+
};
|
|
7839
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
7840
|
+
minVersion: "12.0.0",
|
|
7841
|
+
version: "22.2.0",
|
|
7842
|
+
ngImport: i0,
|
|
7843
|
+
type: TooltipDirective,
|
|
7844
|
+
decorators: [{
|
|
7845
|
+
type: Directive,
|
|
7846
|
+
args: [{
|
|
7847
|
+
selector: "[libTooltip]",
|
|
7848
|
+
host: {
|
|
7849
|
+
"(mouseenter)": "onMouseEnter()",
|
|
7850
|
+
"(mouseleave)": "onMouseLeave()",
|
|
7851
|
+
"(focusin)": "onFocusIn()",
|
|
7852
|
+
"(focusout)": "onFocusOut()",
|
|
7853
|
+
"(touchstart)": "onTouchStart()",
|
|
7854
|
+
"(touchend)": "onTouchEnd()",
|
|
7855
|
+
"(touchcancel)": "onTouchEnd()"
|
|
7856
|
+
}
|
|
7857
|
+
}]
|
|
7858
|
+
}],
|
|
7859
|
+
ctorParameters: () => [],
|
|
7860
|
+
propDecorators: {
|
|
7861
|
+
text: [{
|
|
7862
|
+
type: i0.Input,
|
|
7863
|
+
args: [{
|
|
7864
|
+
isSignal: true,
|
|
7865
|
+
alias: "libTooltip",
|
|
7866
|
+
required: false
|
|
7867
|
+
}]
|
|
7868
|
+
}],
|
|
7869
|
+
tooltipPosition: [{
|
|
7870
|
+
type: i0.Input,
|
|
7871
|
+
args: [{
|
|
7872
|
+
isSignal: true,
|
|
7873
|
+
alias: "tooltipPosition",
|
|
7874
|
+
required: false
|
|
7875
|
+
}]
|
|
7876
|
+
}],
|
|
7877
|
+
tooltipDisabled: [{
|
|
7878
|
+
type: i0.Input,
|
|
7879
|
+
args: [{
|
|
7880
|
+
isSignal: true,
|
|
7881
|
+
alias: "tooltipDisabled",
|
|
7882
|
+
required: false
|
|
7883
|
+
}]
|
|
7884
|
+
}],
|
|
7885
|
+
tooltipDelay: [{
|
|
7886
|
+
type: i0.Input,
|
|
7887
|
+
args: [{
|
|
7888
|
+
isSignal: true,
|
|
7889
|
+
alias: "tooltipDelay",
|
|
7890
|
+
required: false
|
|
7891
|
+
}]
|
|
7892
|
+
}]
|
|
7893
|
+
}
|
|
7894
|
+
});
|
|
5764
7895
|
var EnumTranslatePipe = class EnumTranslatePipe {
|
|
5765
7896
|
translate = inject(TranslateService);
|
|
5766
7897
|
transform(enumType) {
|
|
@@ -6001,7 +8132,7 @@ var DataGridConfigsProvider = class DataGridConfigsProvider extends GridConfigsP
|
|
|
6001
8132
|
this._configs = {
|
|
6002
8133
|
...this._configs,
|
|
6003
8134
|
multiSelect: false,
|
|
6004
|
-
multiSelectSize: "
|
|
8135
|
+
multiSelectSize: "min-content"
|
|
6005
8136
|
};
|
|
6006
8137
|
}
|
|
6007
8138
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -6089,6 +8220,6 @@ var DateValidators = class {
|
|
|
6089
8220
|
};
|
|
6090
8221
|
}
|
|
6091
8222
|
};
|
|
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 };
|
|
8223
|
+
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
8224
|
|
|
6094
8225
|
//# sourceMappingURL=zambon-dev-ui-library.mjs.map
|