@zambon-dev/ui 1.6.1 → 1.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"zambon-dev-ui-library.mjs","names":[],"sources":["../../../../libs/ui/src/library/components/badge/badge.component.ts","../../../../libs/ui/src/library/components/badge/badge.component.html","../../../../libs/ui/src/library/components/base.component.ts","../../../../libs/ui/src/library/components/button/button.component.ts","../../../../libs/ui/src/library/components/button/button.component.html","../../../../libs/ui/src/library/helpers/locale-format.ts","../../../../libs/ui/src/library/services/locale.service.ts","../../../../libs/ui/src/library/components/calendar/calendar.component.ts","../../../../libs/ui/src/library/components/calendar/calendar.component.html","../../../../libs/ui/src/library/helpers/date-helpers.ts","../../../../libs/ui/src/library/helpers/display-controls.ts","../../../../libs/ui/src/library/helpers/guid-helper.ts","../../../../libs/ui/src/library/helpers/route-formatter.ts","../../../../libs/ui/src/library/services/catalog.service.ts","../../../../libs/ui/src/library/services/data-providers/data-provider.service.ts","../../../../libs/ui/src/library/services/datasets/base.dataset.ts","../../../../libs/ui/src/library/services/configs-providers/grid-configs.provider.ts","../../../../libs/ui/src/library/services/datasets/grid.dataset.ts","../../../../libs/ui/src/library/services/datasets/data-grid.dataset.ts","../../../../libs/ui/src/library/services/datasets/multi-editor.dataset.ts","../../../../libs/ui/src/library/services/datasets/multi-select-result.dataset.ts","../../../../libs/ui/src/library/services/form-group.service.ts","../../../../libs/ui/src/library/services/form.service.ts","../../../../libs/ui/src/library/models/ribbon-group-child.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-configs.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-menu.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-menu-open-mode.ts","../../../../libs/ui/src/library/services/sidebar.service.ts","../../../../libs/ui/src/library/components/date-input/date-input.component.ts","../../../../libs/ui/src/library/components/date-input/date-input.component.html","../../../../libs/ui/src/library/components/number-input/number-input.component.ts","../../../../libs/ui/src/library/components/number-input/number-input.component.html","../../../../libs/ui/src/library/components/form-input/form-input.component.ts","../../../../libs/ui/src/library/components/form-input/form-input.component.html","../../../../libs/ui/src/library/components/skeleton/skeleton.component.ts","../../../../libs/ui/src/library/components/skeleton/skeleton.component.html","../../../../libs/ui/src/library/components/form-input-group/form-input-group.component.ts","../../../../libs/ui/src/library/components/form-input-group/form-input-group.component.html","../../../../libs/ui/src/library/components/catalog-select/catalog-select.component.ts","../../../../libs/ui/src/library/components/catalog-select/catalog-select.component.html","../../../../libs/ui/src/library/components/data-grid-row/data-grid-row.component.ts","../../../../libs/ui/src/library/components/data-grid-row/data-grid-row.component.html","../../../../libs/ui/src/library/components/data-grid/data-grid.component.ts","../../../../libs/ui/src/library/components/data-grid/data-grid.component.html","../../../../libs/ui/src/library/components/form-group/form-group.component.ts","../../../../libs/ui/src/library/components/form-group/form-group.component.html","../../../../libs/ui/src/library/components/group-accordion/group-accordion.component.ts","../../../../libs/ui/src/library/components/group-accordion/group-accordion.component.html","../../../../libs/ui/src/library/directives/scroll-spy.directive.ts","../../../../libs/ui/src/library/components/group-container/group-container.component.ts","../../../../libs/ui/src/library/components/group-container/group-container.component.html","../../../../libs/ui/src/library/components/group-scroll-spy/group-scroll-spy.component.ts","../../../../libs/ui/src/library/components/group-scroll-spy/group-scroll-spy.component.html","../../../../libs/ui/src/library/components/modal/modal.component.ts","../../../../libs/ui/src/library/components/modal/modal.component.html","../../../../libs/ui/src/library/components/multi-editor/multi-editor.component.ts","../../../../libs/ui/src/library/components/multi-editor/multi-editor.component.html","../../../../libs/ui/src/library/components/multi-select/result-grid/result-grid.component.ts","../../../../libs/ui/src/library/components/multi-select/result-grid/result-grid.component.html","../../../../libs/ui/src/library/components/multi-select/multi-select.component.ts","../../../../libs/ui/src/library/components/multi-select/multi-select.component.html","../../../../libs/ui/src/library/components/sidebar-item/sidebar-item.component.ts","../../../../libs/ui/src/library/components/sidebar-item/sidebar-item.component.html","../../../../libs/ui/src/library/components/sidebar/sidebar.component.ts","../../../../libs/ui/src/library/components/sidebar/sidebar.component.html","../../../../libs/ui/src/library/components/ribbon-button/ribbon-button.component.ts","../../../../libs/ui/src/library/components/ribbon-button/ribbon-button.component.html","../../../../libs/ui/src/library/components/ribbon/ribbon.component.ts","../../../../libs/ui/src/library/components/ribbon/ribbon.component.html","../../../../libs/ui/src/library/components/ribbon-group/ribbon-group.component.ts","../../../../libs/ui/src/library/components/ribbon-group/ribbon-group.component.html","../../../../libs/ui/src/library/components/tooltip/tooltip.component.ts","../../../../libs/ui/src/library/components/tooltip/tooltip.directive.ts","../../../../libs/ui/src/library/pipes/enum.ts","../../../../libs/ui/src/library/pipes/replace-many.pipe.ts","../../../../libs/ui/src/library/pipes/replace.pipe.ts","../../../../libs/ui/src/library/library.module.ts","../../../../libs/ui/src/library/services/configs-providers/data-grid-configs.provider.ts","../../../../libs/ui/src/library/validators/date.validators.ts"],"sourcesContent":["import { Component, input, InputSignal } from '@angular/core';\n\n/** What the status means, which decides the badge colour. */\nexport type BadgeIntent = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'accent';\n\n/**\n * A small coloured label for a status, such as \"Active\" or \"Pending\", in a grid cell or a details\n * view. The text is the projected content.\n *\n * The badge is not interactive. Its text carries the meaning; the colour, icon and dot only\n * support it, so a colour-blind reader loses nothing.\n */\n@Component({\n selector: 'lib-badge',\n templateUrl: './badge.component.html',\n styleUrls: ['./badge.component.scss'],\n host: {\n class: 'lib-badge',\n '[class]': \"'intent-' + intent()\",\n '[class.has-dot]': 'dot()',\n },\n})\nexport class BadgeComponent {\n //#region Inputs\n /** What the status means. Governs the fill and text colour. Defaults to `neutral`. */\n public readonly intent: InputSignal<BadgeIntent> = input<BadgeIntent>('neutral');\n\n /** Font Awesome classes for a leading icon, e.g. `fa-solid fa-check`. The icon is hidden from screen readers. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n\n /** Shows a small dot in the intent colour before the text. Defaults to `false`. */\n public readonly dot: InputSignal<boolean> = input(false);\n //#endregion\n}\n","@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","import { Component, OnDestroy } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n// No strategy on purpose: Angular never inherits `changeDetection`, so one declared here would\n// describe a class that is never instantiated, while every subclass compiles to whatever it\n// declares -- which in v22 means OnPush. Correctness comes from the state below notifying\n// Angular, never from this decorator. See docs/guides/reactivity.md.\n/**\n * Abstract base for the library's components. Gives subclasses a `destroy$` subject that emits\n * and completes when the component is destroyed, for ending subscriptions with `takeUntil`.\n */\n@Component({ template: '' })\nexport abstract class BaseComponent implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { ChangeDetectionStrategy, Component, computed, input, InputSignal, Signal } from '@angular/core';\n\n/** What the button is for, which is what decides how loud it looks. */\nexport type ButtonIntent = 'primary' | 'secondary' | 'danger' | 'ghost';\n\n/**\n * The one button.\n *\n * It replaces the global `.btn` classes, which generated 154 variants by interpolating Tailwind\n * colour names -- `btn blue-500`, `btn red-700` -- in a `@for` loop. Those named a palette entry\n * rather than a purpose, so a screen's buttons were a colour decision taken 154 times, and none of\n * them could follow a theme. An intent says what the button is for and lets the theme decide what\n * that looks like.\n *\n * `lib-ribbon-button` is deliberately not folded in here. It is a different shape -- icon above\n * label, large hit area, an options menu -- and merging the two would produce one component with\n * two personalities. They share the tokens instead.\n *\n * There is no click output: the inner element is a real `<button>`, so a `(click)` bound on\n * `<lib-button>` receives the bubbled event, and a disabled button emits nothing to bubble. For the\n * same reason `type=\"submit\"` works from inside a form with no wiring.\n */\n@Component({\n selector: 'lib-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonComponent {\n //#region Inputs\n /** What the button is for. Governs fill and text colour. */\n public readonly intent: InputSignal<ButtonIntent> = input<ButtonIntent>('secondary');\n\n /** Native button type. `submit` works because the rendered button is inside the host's form. */\n public readonly type: InputSignal<'button' | 'submit' | 'reset'> = input<'button' | 'submit' | 'reset'>('button');\n\n /** Disables the native button, so it cannot be clicked or focused. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n\n /** Shows a spinner, announces `aria-busy` and blocks activation -- by the keyboard too. */\n public readonly loading: InputSignal<boolean> = input(false);\n\n /** Transient confirmation. Blocks activation so the action cannot be fired twice. */\n public readonly success: InputSignal<boolean> = input(false);\n\n /** Transient failure. Leaves the button usable so the action can be retried. */\n public readonly error: InputSignal<boolean> = input(false);\n\n /** Font Awesome classes for a leading icon, e.g. `fa-solid fa-floppy-disk`. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n\n /** Required when the button has an icon and no text. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n //#endregion\n\n //#region Properties\n /** Loading and success both stand for \"this action is settled\"; error is retryable. */\n protected readonly isBlocked: Signal<boolean> = computed(() => this.disabled() || this.loading() || this.success());\n //#endregion\n}\n","<button\n class=\"lib-button\"\n [class]=\"'intent-' + intent()\"\n [class.is-loading]=\"loading()\"\n [class.is-success]=\"success()\"\n [class.is-error]=\"error()\"\n [type]=\"type()\"\n [disabled]=\"isBlocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n>\n @if (loading()) {\n <span class=\"lib-button-spinner\" aria-hidden=\"true\"></span>\n } @else if (success()) {\n <i class=\"fa-solid fa-check fa-fw\" aria-hidden=\"true\"></i>\n } @else if (error()) {\n <i class=\"fa-solid fa-times fa-fw\" aria-hidden=\"true\"></i>\n } @else if (icon()) {\n <i class=\"fa-fw\" [class]=\"icon()\" aria-hidden=\"true\"></i>\n }\n\n <span class=\"lib-button-label\"><ng-content></ng-content></span>\n</button>\n","/**\n * Formatting and parsing of dates and numbers for a given locale, built on the browser's `Intl`.\n *\n * `Intl` knows every locale the browser knows, so nothing here needs Angular's locale data to be\n * registered. That is what lets a field follow the language the application chose rather than the\n * one the operating system is set to.\n */\n\n/** A date part, in the order a locale writes it. */\nexport type DatePart = 'day' | 'month' | 'year';\n\n/** How a locale writes a short numeric date: the part order and the separator between parts. */\nexport interface DatePattern {\n /** Parts in the order the locale writes them, e.g. `['day', 'month', 'year']` for `pt-BR`. */\n order: DatePart[];\n /** Text between parts, e.g. `/` or `.`. */\n separator: string;\n}\n\n/** Decimal and grouping separators of a locale. */\nexport interface NumberSeparators {\n /** Decimal separator, e.g. `,` for `pt-BR`. */\n decimal: string;\n /** Grouping separator, e.g. `.` for `pt-BR`. May be a non-breaking space. */\n group: string;\n}\n\n/** Options for {@link formatLocaleNumber}. */\nexport interface LocaleNumberOptions {\n /** Fewest digits after the decimal separator. Defaults to `0`. */\n minFractionDigits?: number;\n /** Most digits after the decimal separator. Defaults to `3`. */\n maxFractionDigits?: number;\n /** Whether to group thousands. Defaults to `true`. */\n grouping?: boolean;\n}\n\n/** Regions that start the week on Sunday, for browsers without `Intl.Locale` week info. */\nconst SUNDAY_FIRST_REGIONS: ReadonlySet<string> = new Set([\n 'BR',\n 'CA',\n 'HK',\n 'IL',\n 'IN',\n 'JP',\n 'KR',\n 'MX',\n 'PH',\n 'PT',\n 'TW',\n 'US',\n 'ZA',\n]);\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst ISO_DATE_TIME = /^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.\\d+)?)?$/;\n\n/** Whether `locale` is a tag `Intl` accepts. */\nexport function isValidLocale(locale: unknown): locale is string {\n if (typeof locale !== 'string' || locale.trim() === '') {\n return false;\n }\n try {\n return Intl.getCanonicalLocales(locale).length > 0;\n } catch {\n return false;\n }\n}\n\n/** The order and separator of a short numeric date in `locale`. */\nexport function getDatePattern(locale: string): DatePattern {\n const parts: Intl.DateTimeFormatPart[] = new Intl.DateTimeFormat(locale, {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n }).formatToParts(new Date(2001, 10, 22));\n\n const order: DatePart[] = parts\n .map((part: Intl.DateTimeFormatPart) => part.type)\n .filter((type: string): type is DatePart => type === 'day' || type === 'month' || type === 'year');\n const literal: Intl.DateTimeFormatPart | undefined = parts.find(\n (part: Intl.DateTimeFormatPart) => part.type === 'literal',\n );\n\n return { order, separator: literal?.value.trim() || '/' };\n}\n\n/** A short numeric date in `locale`, e.g. `05/12/2026` in `pt-BR` and `12/05/2026` in `en-US`. */\nexport function formatDateText(date: Date, locale: string): string {\n // Built from the pattern rather than formatted directly: some locales add marks around the\n // parts (`2026. 12. 05.` in Korean) that the parser would then have to strip again.\n const { order, separator }: DatePattern = getDatePattern(locale);\n const values: Record<DatePart, string> = {\n day: String(date.getDate()).padStart(2, '0'),\n month: String(date.getMonth() + 1).padStart(2, '0'),\n year: String(date.getFullYear()).padStart(4, '0'),\n };\n return order.map((part: DatePart) => values[part]).join(separator);\n}\n\n/**\n * Reads a date typed in `locale`'s order. Accepts any non-digit separator, digits only\n * (`05122026`), a two-digit year (read as 20xx), and an ISO date (`2026-12-05`). Returns `null`\n * for empty text and for text that is not a real date.\n */\nexport function parseDateText(text: string, locale: string): Date | null {\n const trimmed: string = text.trim();\n if (trimmed === '') {\n return null;\n }\n\n const iso: RegExpMatchArray | null = trimmed.match(ISO_DATE);\n if (iso) {\n return buildDate(Number(iso[1]), Number(iso[2]), Number(iso[3]));\n }\n\n const { order }: DatePattern = getDatePattern(locale);\n let pieces: string[] = trimmed.split(/\\D+/).filter((piece: string) => piece !== '');\n\n if (pieces.length === 1 && (pieces[0].length === 8 || pieces[0].length === 6)) {\n const digits: string = pieces[0];\n const yearLength: number = digits.length === 8 ? 4 : 2;\n pieces = [];\n let index = 0;\n for (const part of order) {\n const length: number = part === 'year' ? yearLength : 2;\n pieces.push(digits.slice(index, index + length));\n index += length;\n }\n }\n\n if (pieces.length !== 3) {\n return null;\n }\n\n const values: Partial<Record<DatePart, string>> = {};\n order.forEach((part: DatePart, index: number) => (values[part] = pieces[index]));\n\n const yearText: string = values.year ?? '';\n if (yearText.length !== 2 && yearText.length !== 4) {\n return null;\n }\n const year: number = yearText.length === 2 ? 2000 + Number(yearText) : Number(yearText);\n\n return buildDate(year, Number(values.month), Number(values.day));\n}\n\n/** Whether `locale` shows the time on a 12-hour clock. */\nexport function uses12HourClock(locale: string): boolean {\n const hourCycle: string | undefined = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).resolvedOptions()\n .hourCycle;\n return hourCycle === 'h11' || hourCycle === 'h12';\n}\n\n/** A time of day in `locale`, e.g. `14:30` in `pt-BR` and `02:30 PM` in `en-US`. */\nexport function formatTimeText(date: Date, locale: string): string {\n return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit' }).format(date);\n}\n\n/**\n * Reads a typed time: `14:30`, `1430`, `9`, `2:30 pm`, `2:30 p.m.`. Returns the hours (0-23) and\n * minutes, or `null` for empty or invalid text.\n */\nexport function parseTimeText(text: string): { hours: number; minutes: number } | null {\n const match: RegExpMatchArray | null = text\n .trim()\n .toLowerCase()\n .replace(/[\\u00a0\\u202f]/g, ' ')\n .match(/^(\\d{1,2})(?:[:.h]?(\\d{2}))?\\s*(?:([ap])\\.?\\s*m?\\.?)?$/);\n if (!match) {\n return null;\n }\n\n let hours = Number(match[1]);\n const minutes: number = match[2] ? Number(match[2]) : 0;\n const meridiem: string | undefined = match[3];\n\n if (minutes > 59) {\n return null;\n }\n if (meridiem) {\n if (hours < 1 || hours > 12) {\n return null;\n }\n hours = (hours % 12) + (meridiem === 'p' ? 12 : 0);\n } else if (hours > 23) {\n return null;\n }\n\n return { hours, minutes };\n}\n\n/** A date written the way the API and the native date input write it: `yyyy-MM-dd`. */\nexport function toIsoDate(date: Date): string {\n return [\n String(date.getFullYear()).padStart(4, '0'),\n String(date.getMonth() + 1).padStart(2, '0'),\n String(date.getDate()).padStart(2, '0'),\n ].join('-');\n}\n\n/** A local date and time written the way the native `datetime-local` input writes it: `yyyy-MM-ddTHH:mm`. */\nexport function toIsoDateTime(date: Date): string {\n return `${toIsoDate(date)}T${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;\n}\n\n/**\n * Reads a value a form control may hold: a `Date`, `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm[:ss]`, or any\n * other string `Date` can parse. A date or date-time with no zone is read as local time, as the\n * native inputs do. Returns `null` for empty or invalid values.\n */\nexport function parseIsoValue(value: unknown): Date | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n if (value instanceof Date) {\n return Number.isNaN(value.getTime()) ? null : new Date(value.getTime());\n }\n if (typeof value !== 'string') {\n return null;\n }\n\n const date: RegExpMatchArray | null = value.match(ISO_DATE);\n if (date) {\n return buildDate(Number(date[1]), Number(date[2]), Number(date[3]));\n }\n const dateTime: RegExpMatchArray | null = value.match(ISO_DATE_TIME);\n if (dateTime) {\n const result: Date | null = buildDate(Number(dateTime[1]), Number(dateTime[2]), Number(dateTime[3]));\n result?.setHours(Number(dateTime[4]), Number(dateTime[5]), Number(dateTime[6] ?? 0), 0);\n return result;\n }\n\n const parsed: Date = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed;\n}\n\n/** The first day of the week in `locale`, as `Date.getDay()` numbers it: `0` is Sunday. */\nexport function getFirstDayOfWeek(locale: string): number {\n try {\n const intlLocale: Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n } = new Intl.Locale(locale);\n const firstDay: number | undefined = intlLocale.getWeekInfo?.().firstDay ?? intlLocale.weekInfo?.firstDay;\n if (firstDay !== undefined) {\n // Intl numbers the days 1 (Monday) to 7 (Sunday).\n return firstDay % 7;\n }\n const region: string | undefined = intlLocale.maximize().region;\n return region && SUNDAY_FIRST_REGIONS.has(region) ? 0 : 1;\n } catch {\n return 0;\n }\n}\n\n/** The decimal and grouping separators of `locale`. */\nexport function getNumberSeparators(locale: string): NumberSeparators {\n const parts: Intl.NumberFormatPart[] = new Intl.NumberFormat(locale).formatToParts(12345.6);\n return {\n decimal: parts.find((part: Intl.NumberFormatPart) => part.type === 'decimal')?.value ?? '.',\n group: parts.find((part: Intl.NumberFormatPart) => part.type === 'group')?.value ?? ',',\n };\n}\n\n/** A number in `locale`, e.g. `1.234,5` in `pt-BR`. */\nexport function formatLocaleNumber(value: number, locale: string, options: LocaleNumberOptions = {}): string {\n const minimumFractionDigits: number = options.minFractionDigits ?? 0;\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits,\n maximumFractionDigits: Math.max(options.maxFractionDigits ?? 3, minimumFractionDigits),\n useGrouping: options.grouping ?? true,\n }).format(value);\n}\n\n/**\n * Reads a number typed in `locale`. Spaces are ignored. Grouping separators are accepted only\n * between groups of three digits, so `1.5` in `pt-BR` is not a number rather than 15. The decimal\n * separator is the locale's. Returns `null` for empty text and `NaN` for text that is not a number.\n */\nexport function parseLocaleNumber(text: string, locale: string): number | null {\n const { decimal, group }: NumberSeparators = getNumberSeparators(locale);\n let normalized: string = text.replace(/[\\s\\u00a0\\u202f]/g, '');\n if (normalized === '') {\n return null;\n }\n\n if (group.trim() !== '' && normalized.includes(group)) {\n // A grouping separator must sit between groups of three digits. Without this check `1.5` in\n // `pt-BR`, where `.` groups thousands, would silently read as 15.\n const integerPart: string = normalized.split(decimal)[0].replace(/^[-\\u2212]/, '');\n const groups: string[] = integerPart.split(group);\n const isGrouped: boolean =\n /^\\d{1,3}$/.test(groups[0]) && groups.slice(1).every((piece: string) => /^\\d{3}$/.test(piece));\n if (!isGrouped) {\n return Number.NaN;\n }\n normalized = normalized.split(group).join('');\n }\n if (decimal !== '.') {\n if (normalized.includes('.')) {\n return Number.NaN;\n }\n normalized = normalized.replace(decimal, '.');\n }\n // Unicode minus, which some locales format with.\n normalized = normalized.replace(/^\\u2212/, '-');\n\n return /^-?(\\d+\\.?\\d*|\\.\\d+)$/.test(normalized) ? Number(normalized) : Number.NaN;\n}\n\n/**\n * Reads an Angular `DecimalPipe` digits string, `{minInt}.{minFrac}-{maxFrac}`, into fraction-digit\n * limits. Returns `undefined` when `digitsInfo` is empty or malformed.\n */\nexport function parseDigitsInfo(\n digitsInfo: string | undefined,\n): { minFractionDigits: number; maxFractionDigits: number } | undefined {\n const match: RegExpMatchArray | null | undefined = digitsInfo?.match(/^(\\d+)?\\.(\\d+)?(?:-(\\d+))?$/);\n if (!match) {\n return undefined;\n }\n const minFractionDigits: number = match[2] !== undefined ? Number(match[2]) : 0;\n const maxFractionDigits: number = match[3] !== undefined ? Number(match[3]) : Math.max(minFractionDigits, 3);\n return { minFractionDigits, maxFractionDigits: Math.max(minFractionDigits, maxFractionDigits) };\n}\n\nfunction buildDate(year: number, month: number, day: number): Date | null {\n if (!Number.isInteger(year) || month < 1 || month > 12 || day < 1 || day > 31) {\n return null;\n }\n const date: Date = new Date(year, month - 1, day);\n // Years 0-99 map to 1900-1999 in the constructor; set it again to keep the year typed.\n date.setFullYear(year);\n // new Date(2026, 1, 31) rolls over to March; a date that rolled over was not a real date.\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n return date;\n}\n","import { computed, inject, Injectable, LOCALE_ID, Signal, signal, WritableSignal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { TranslateService } from '@ngx-translate/core';\nimport { merge } from 'rxjs';\nimport { isValidLocale } from '../helpers/locale-format';\n\n/**\n * The locale of the language the application shows, as a signal.\n *\n * Angular's `LOCALE_ID` is fixed when the application starts, but the language can change at run\n * time through ngx-translate. Date and number fields read this service instead, so they follow the\n * language the user picked rather than the browser's or the start-up one.\n *\n * The locale comes from, in order:\n *\n * 1. The `locale` translation key of the current language (the framework files ship `en-US` and\n * `pt-BR`).\n * 2. The current ngx-translate language code, when it is a valid locale tag.\n * 3. Angular's `LOCALE_ID`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class LocaleService {\n //#region Variables\n private readonly fallbackLocale: string = inject(LOCALE_ID);\n private readonly translate: TranslateService | null = inject(TranslateService, { optional: true });\n\n /** Bumped whenever the language or its translations change, so `locale` reads them again. */\n private readonly languageChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n /** The current locale tag, such as `pt-BR`. Updates when the application language changes. */\n public readonly locale: Signal<string> = computed(() => {\n this.languageChanged();\n return this.resolveLocale();\n });\n //#endregion\n\n //#region Constructor\n constructor() {\n if (this.translate) {\n merge(this.translate.onLangChange, this.translate.onTranslationChange, this.translate.onDefaultLangChange)\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.languageChanged.update((count: number) => count + 1));\n }\n }\n //#endregion\n\n //#region Private methods\n private resolveLocale(): string {\n if (this.translate) {\n const fromKey: unknown = this.translate.currentLang ? this.translate.instant('locale') : undefined;\n if (fromKey !== 'locale' && isValidLocale(fromKey)) {\n return fromKey;\n }\n\n const language: string | undefined = this.translate.currentLang || this.translate.defaultLang;\n if (isValidLocale(language)) {\n return language;\n }\n }\n return this.fallbackLocale;\n }\n //#endregion\n}\n","import {\n afterNextRender,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n InputSignal,\n linkedSignal,\n output,\n OutputEmitterRef,\n Signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { getFirstDayOfWeek, parseIsoValue } from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\n\n/** One day cell of the month grid. */\ninterface CalendarDay {\n date: Date;\n key: string;\n label: string;\n fullLabel: string;\n isOutsideMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n isActive: boolean;\n isDisabled: boolean;\n}\n\n/** One weekday column heading. */\ninterface CalendarWeekday {\n short: string;\n long: string;\n}\n\n/**\n * A month calendar for picking a day.\n *\n * Month names, weekday names, the first day of the week and every label come from `Intl` in the\n * application's language (see `LocaleService`), so the calendar needs no translation keys.\n *\n * `lib-date-input` opens it in a popup. It can also sit inline on a page.\n *\n * Keyboard: the arrow keys move by day and week, Home and End go to the start and end of the week,\n * Page Up and Page Down change the month (with Shift, the year), Enter or Space picks the day, and\n * Escape emits `cancelled`.\n */\n@Component({\n selector: 'lib-calendar',\n templateUrl: './calendar.component.html',\n styleUrls: ['./calendar.component.scss'],\n host: {\n class: 'lib-calendar',\n },\n})\nexport class CalendarComponent {\n //#region Inputs and outputs\n /** The chosen day: a `Date` or a `yyyy-MM-dd` string. Defaults to none. */\n public readonly selected: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Earliest day that can be picked: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly min: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Latest day that can be picked: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly max: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Locale to show the calendar in. Defaults to the application's language. */\n public readonly locale: InputSignal<string | undefined> = input<string>();\n\n /** Emits the day the user picked, at midnight local time. */\n public readonly dateSelected: OutputEmitterRef<Date> = output<Date>();\n /** Emits when the user presses Escape. */\n public readonly cancelled: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly injector: Injector = inject(Injector);\n private readonly localeService: LocaleService = inject(LocaleService);\n private readonly grid: Signal<ElementRef<HTMLElement> | undefined> = viewChild<ElementRef<HTMLElement>>('grid');\n //#endregion\n\n //#region Properties\n protected readonly currentLocale: Signal<string> = computed(() => this.locale() || this.localeService.locale());\n\n protected readonly selectedDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.selected())));\n protected readonly minDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.min())));\n protected readonly maxDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.max())));\n\n /** The day that holds keyboard focus. Starts at the chosen day, else today, kept within the limits. */\n protected readonly activeDate: WritableSignal<Date> = linkedSignal(() => this.clamp(this.selectedDate() ?? today()));\n\n protected readonly monthLabel: Signal<string> = computed(() => this.monthName(this.activeDate()));\n protected readonly previousMonthLabel: Signal<string> = computed(() => this.monthName(this.monthStart(-1)));\n protected readonly nextMonthLabel: Signal<string> = computed(() => this.monthName(this.monthStart(1)));\n\n protected readonly todayLabel: Signal<string> = computed(() => {\n const text: string = new Intl.RelativeTimeFormat(this.currentLocale(), { numeric: 'auto' }).format(0, 'day');\n return text.charAt(0).toLocaleUpperCase(this.currentLocale()) + text.slice(1);\n });\n\n protected readonly isTodayDisabled: Signal<boolean> = computed(() => this.isDisabled(today()));\n protected readonly isPreviousDisabled: Signal<boolean> = computed(() => {\n const min: Date | null = this.minDate();\n return !!min && endOfMonth(this.monthStart(-1)) < min;\n });\n protected readonly isNextDisabled: Signal<boolean> = computed(() => {\n const max: Date | null = this.maxDate();\n return !!max && this.monthStart(1) > max;\n });\n\n protected readonly weekdays: Signal<CalendarWeekday[]> = computed(() => {\n const locale: string = this.currentLocale();\n const firstDay: number = getFirstDayOfWeek(locale);\n const short: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { weekday: 'narrow' });\n const long: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { weekday: 'long' });\n // 4 January 1970 was a Sunday.\n return Array.from({ length: 7 }, (_: unknown, index: number) => {\n const day: Date = new Date(1970, 0, 4 + ((firstDay + index) % 7));\n return { short: short.format(day), long: long.format(day) };\n });\n });\n\n protected readonly weeks: Signal<CalendarDay[][]> = computed(() => {\n const locale: string = this.currentLocale();\n const active: Date = this.activeDate();\n const selected: Date | null = this.selectedDate();\n const now: Date = today();\n const firstDay: number = getFirstDayOfWeek(locale);\n const fullFormat: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { dateStyle: 'full' });\n\n const offset: number = (new Date(active.getFullYear(), active.getMonth(), 1).getDay() - firstDay + 7) % 7;\n\n const weeks: CalendarDay[][] = [];\n for (let week = 0; week < 6; week++) {\n const days: CalendarDay[] = [];\n for (let weekday = 0; weekday < 7; weekday++) {\n const date: Date = new Date(active.getFullYear(), active.getMonth(), 1 - offset + week * 7 + weekday);\n days.push({\n date,\n key: date.toDateString(),\n label: String(date.getDate()),\n fullLabel: fullFormat.format(date),\n isOutsideMonth: date.getMonth() !== active.getMonth(),\n isToday: isSameDay(date, now),\n isSelected: !!selected && isSameDay(date, selected),\n isActive: isSameDay(date, active),\n isDisabled: this.isDisabled(date),\n });\n }\n weeks.push(days);\n }\n return weeks;\n });\n //#endregion\n\n //#region Event handlers\n protected onDayClick(day: CalendarDay): void {\n if (!day.isDisabled) {\n this.activeDate.set(day.date);\n this.dateSelected.emit(day.date);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const active: Date = this.activeDate();\n const weekdayIndex: number = (active.getDay() - getFirstDayOfWeek(this.currentLocale()) + 7) % 7;\n let next: Date | undefined;\n\n switch (event.key) {\n case 'ArrowLeft':\n next = addDays(active, -1);\n break;\n case 'ArrowRight':\n next = addDays(active, 1);\n break;\n case 'ArrowUp':\n next = addDays(active, -7);\n break;\n case 'ArrowDown':\n next = addDays(active, 7);\n break;\n case 'Home':\n next = addDays(active, -weekdayIndex);\n break;\n case 'End':\n next = addDays(active, 6 - weekdayIndex);\n break;\n case 'PageUp':\n next = addMonthsKeepingDay(active, event.shiftKey ? -12 : -1);\n break;\n case 'PageDown':\n next = addMonthsKeepingDay(active, event.shiftKey ? 12 : 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (!this.isDisabled(active)) {\n this.dateSelected.emit(active);\n }\n return;\n case 'Escape':\n event.preventDefault();\n event.stopPropagation();\n this.cancelled.emit();\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.activeDate.set(this.clamp(next));\n this.focusActiveDay();\n }\n\n protected onPreviousMonth(): void {\n this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), -1)));\n }\n\n protected onNextMonth(): void {\n this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), 1)));\n }\n\n protected onToday(): void {\n const now: Date = today();\n if (!this.isDisabled(now)) {\n this.activeDate.set(now);\n this.dateSelected.emit(now);\n }\n }\n\n protected onEscape(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.cancelled.emit();\n }\n //#endregion\n\n //#region Public methods\n /** Moves keyboard focus to the active day, after the next render. */\n public focusActiveDay(): void {\n afterNextRender(\n () => this.grid()?.nativeElement.querySelector<HTMLButtonElement>('button[tabindex=\"0\"]')?.focus(),\n { injector: this.injector },\n );\n }\n //#endregion\n\n //#region Private methods\n private monthStart(months: number): Date {\n const active: Date = this.activeDate();\n return new Date(active.getFullYear(), active.getMonth() + months, 1);\n }\n\n private clamp(date: Date): Date {\n const min: Date | null = this.minDate();\n const max: Date | null = this.maxDate();\n if (min && date < min) {\n return min;\n }\n if (max && date > max) {\n return max;\n }\n return date;\n }\n\n private isDisabled(date: Date): boolean {\n const min: Date | null = this.minDate();\n const max: Date | null = this.maxDate();\n return (!!min && date < min) || (!!max && date > max);\n }\n\n private monthName(date: Date): string {\n return new Intl.DateTimeFormat(this.currentLocale(), { month: 'long', year: 'numeric' }).format(date);\n }\n //#endregion\n}\n\nfunction today(): Date {\n const now: Date = new Date();\n return new Date(now.getFullYear(), now.getMonth(), now.getDate());\n}\n\nfunction startOfDay(date: Date | null): Date | null {\n return date ? new Date(date.getFullYear(), date.getMonth(), date.getDate()) : null;\n}\n\nfunction endOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0);\n}\n\nfunction addDays(date: Date, days: number): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\n/** Moves by whole months and keeps the day, or the month's last day when it is shorter. */\nfunction addMonthsKeepingDay(date: Date, months: number): Date {\n const target: Date = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay: number = endOfMonth(target).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));\n}\n\nfunction isSameDay(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n}\n","<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","export class DateHelpers {\n //#region Public methods\n public static diffDays(initialDate: Date, finalDate: Date): number {\n const initialDateOnly: Date = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());\n const finalDateOnly: Date = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());\n\n const diff: number = initialDateOnly.getTime() - finalDateOnly.getTime();\n return Math.floor(diff / (1000 * 60 * 60 * 24));\n }\n //#endregion\n}\n","import { AbstractControl } from '@angular/forms';\n\n/**\n * Tracks the form controls that exist only to show a catalog selection's label.\n *\n * `lib-catalog-select` works in pairs: the control named by `controlName` holds the identifier, and\n * the one named by `displayControlName` holds the text the user reads. The second is created by the\n * component itself when a screen does not declare it, so a form ends up carrying controls nobody\n * wrote down — and a filters form then submits them alongside the real filters.\n *\n * The mark lives in a `WeakSet` keyed by the control instance rather than by its name. That is the\n * only scope that is actually correct: two forms may each have an `employeeName`, and only the one\n * a catalog select drives is a display control. It also keeps nothing alive.\n */\nexport class DisplayControls {\n //#region Variables\n private static readonly marked: WeakSet<AbstractControl> = new WeakSet<AbstractControl>();\n //#endregion\n\n //#region Public methods\n /**\n * Whether the control exists only to display a catalog selection's label.\n *\n * @param control The control, which may be absent.\n * @returns `true` when a catalog select drives it as its display control.\n */\n public static isDisplayControl(control: AbstractControl | null | undefined): boolean {\n return !!control && DisplayControls.marked.has(control);\n }\n\n /**\n * Marks the control as existing only to display a catalog selection's label.\n *\n * @param control The control, which may be absent.\n */\n public static markAsDisplayControl(control: AbstractControl | null | undefined): void {\n if (control) {\n DisplayControls.marked.add(control);\n }\n }\n //#endregion\n}\n","export class GuidHelper {\n public static generateGUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c: string) => {\n const r: number = (Math.random() * 16) | 0;\n const v: number = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nexport abstract class RouterFormatter {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public static getURL(route: ActivatedRouteSnapshot): string {\n let parentRoute = '';\n if (route.parent) {\n parentRoute = this.getURL(route.parent);\n }\n\n let path = route.routeConfig?.path ?? '';\n route.paramMap.keys.forEach((k) => {\n path = path.replace(':' + k, k === 'view' ? '' : (route.paramMap.get(k) ?? ''));\n });\n\n if (!route.parent || (parentRoute !== '' && parentRoute !== '/' && route.routeConfig?.path && path)) {\n parentRoute += '/';\n }\n\n return parentRoute + path;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { ICatalogResult } from '../models/catalog-result';\n\n/**\n * Searches a catalog endpoint for `lib-catalog-select`. Sends a POST of\n * `{ maxResults, criteria, filters }` and returns the matching entries.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CatalogService {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n private http: HttpClient = inject(HttpClient);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public search(\n endpoint: string,\n maxResults: number,\n criteria?: string,\n filters: { [key: string]: string } | null = null,\n ): Observable<ICatalogResult> {\n return this.http.post<ICatalogResult>(`${endpoint}`, { maxResults, criteria, filters });\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable, OnDestroy, signal, WritableSignal } from '@angular/core';\nimport { ActivatedRoute, ParamMap } from '@angular/router';\nimport { Observable, ReplaySubject, Subject, take } from 'rxjs';\n\n/**\n * Base for a service that loads, caches and saves one entity for a details view. It reads the\n * record id from the route's `id` parameter; extend it and implement `loadModel`, `saveModel`\n * and `getTitle`.\n */\n@Injectable()\nexport abstract class DataProviderService<TEntityModel> implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n protected activatedRoute: ActivatedRoute = inject(ActivatedRoute);\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n protected shouldLazyLoad = false;\n\n // A signal rather than a field: `hasEntityID` is read from templates -- the New and Edit\n // buttons are only shown once a record exists -- and the route resolving or a save assigning\n // an id told Angular nothing. The accessors below keep their old shape.\n private readonly _entityID: WritableSignal<number | undefined> = signal(undefined);\n private errorSubject: Subject<HttpErrorResponse> = new Subject<HttpErrorResponse>();\n private isLoading = false;\n private isModelLoaded = false;\n private modelCache: ReplaySubject<TEntityModel | null> = new ReplaySubject<TEntityModel | null>(1);\n //#endregion\n\n //#region Properties\n public get entityID(): number | undefined {\n return this._entityID();\n }\n\n public get hasEntityID(): boolean {\n return !!this.entityID;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this.activatedRoute.paramMap.pipe(take(1)).subscribe((paramMap: ParamMap) => {\n const newID = Number(paramMap.get('id'));\n if (newID !== this.entityID) {\n this._entityID.set(newID);\n\n // Need to wait for the data-provider to be initialized.\n queueMicrotask(() => {\n // When lazy loading, the model should be loaded by the consuming component.\n if (!this.shouldLazyLoad) {\n this.refreshModel();\n }\n });\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public getError$(): Observable<HttpErrorResponse> {\n return this.errorSubject.asObservable();\n }\n\n public abstract getTitle(entity: TEntityModel): string;\n\n public getModel$(): Observable<TEntityModel | null> {\n if (!this.isModelLoaded && !this.shouldLazyLoad) {\n this.refreshModel();\n }\n return this.modelCache.asObservable();\n }\n\n public refreshModel(): void {\n if (this.isLoading) {\n return;\n }\n\n this.isLoading = true;\n\n this.loadModel(this.entityID)\n .pipe(take(1))\n .subscribe({\n next: (model: TEntityModel | null) => {\n this.isLoading = false;\n this.updateModel(model);\n },\n error: (error: HttpErrorResponse) => {\n this.isLoading = false;\n this.isModelLoaded = true;\n this.modelCache.next(null);\n this.errorSubject.next(error);\n },\n });\n }\n\n public resetForNewEntity(): void {\n this._entityID.set(undefined);\n this.isModelLoaded = false;\n this.modelCache.next(null);\n }\n\n public abstract saveModel(model: any): Observable<TEntityModel>;\n\n public updateModel(model: any): void {\n this.isModelLoaded = true;\n\n // Update entity ID if changed.\n if (model && (model as any).id !== this.entityID) {\n this._entityID.set((model as any).id);\n }\n\n this.modelCache.next(model);\n }\n //#endregion\n\n //#region Private methods\n protected abstract loadModel(entityID?: number): Observable<TEntityModel | null>;\n //#endregion\n}\n","import { inject, Injectable, OnDestroy, signal, WritableSignal } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { DataProviderService } from '../data-providers';\n\n@Injectable()\nexport abstract class BaseDataset implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n /**\n * Bumped by every write to dataset state, and read by every accessor below it.\n *\n * A dataset is rows, keys and selections mutated in place -- pushed, spliced, reassigned -- so a\n * signal holding the array could not see the change. This counter stands in for one: the read\n * inside each accessor is what makes a template using it re-render. It is a bridge for mutable\n * collections, not a pattern to copy into a component; there the state itself is the signal.\n * See docs/guides/reactivity.md.\n */\n private readonly revision: WritableSignal<number> = signal(0);\n\n protected dataProvider: DataProviderService<any> | null;\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n\n // TODO: Remove.\n private _parentEntityId?: any;\n //#endregion\n\n //#region Properties\n // TODO: Remove.\n public get parentEntityId(): any {\n return this._parentEntityId;\n }\n public set parentEntityId(value: any) {\n this._parentEntityId = value;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this.dataProvider = inject(DataProviderService, { optional: true });\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Protected methods\n // Both are guarded: the logic specs build datasets with Object.create(), which runs no field\n // initialiser, so `revision` is genuinely absent there. Nothing to notify and nothing to track\n // in that case, which is correct -- those specs assert state, not rendering.\n\n /** Announces that dataset state changed, so views reading it re-render. */\n protected touched(): void {\n this.revision?.update((revision: number) => revision + 1);\n }\n\n /** Takes a tracked dependency on the dataset's state. Call it first in any accessor. */\n protected tracked(): void {\n this.revision?.();\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Injectable } from '@angular/core';\nimport { GridConfigs } from '../../models/configs/grid-configs';\n\n@Injectable()\nexport class GridConfigsProvider<TGridConfigs extends GridConfigs = GridConfigs> {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n protected _configs: TGridConfigs;\n //#endregion\n\n //#region Properties\n public get configs(): TGridConfigs {\n return this._configs;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this._configs = {\n loadingDisplayText: 'Loading...',\n messageOnEmpty: 'No results',\n messageOnFailed: 'The records could not be loaded.',\n recordBlockSize: 100,\n rowHeight: 41.6,\n rowsToDisplay: 6,\n } as TGridConfigs;\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { EventEmitter, inject, Injectable } from '@angular/core';\nimport { Observable, take } from 'rxjs';\nimport { GuidHelper } from '../../helpers';\nimport { GridConfigs } from '../../models/configs/grid-configs';\nimport { GridConfigsProvider } from '../configs-providers/grid-configs.provider';\nimport { BaseDataset } from './base.dataset';\n\nconst KEY_FIELD = '_key';\n\n@Injectable()\nexport abstract class GridDataset extends BaseDataset {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n public configs: GridConfigs;\n public filtersChanged: EventEmitter<{ [key: string]: string }> = new EventEmitter<{ [key: string]: string }>();\n private _isLoading = false;\n private _loadedLastRow = false;\n private _totalRows?: number;\n public loadFinished: EventEmitter<boolean> = new EventEmitter<boolean>();\n public loadStarted: EventEmitter<void> = new EventEmitter<void>();\n\n protected compareProperty = 'id';\n protected configsProvider: GridConfigsProvider;\n protected focusedRow: string | null = null;\n protected recordBlock = 0;\n\n private _hasBeenLoaded = false;\n private _loadedKeys?: string[];\n private _loadedRows?: any[];\n private queryFilters?: { [key: string]: string };\n //#endregion\n\n //#region Properties\n public get isLoading(): boolean {\n this.tracked();\n return this._isLoading;\n }\n public set isLoading(value: boolean) {\n this._isLoading = value;\n this.touched();\n }\n\n public get loadedLastRow(): boolean {\n this.tracked();\n return this._loadedLastRow;\n }\n public set loadedLastRow(value: boolean) {\n this._loadedLastRow = value;\n this.touched();\n }\n\n public get totalRows(): number | undefined {\n this.tracked();\n return this._totalRows;\n }\n public set totalRows(value: number | undefined) {\n this._totalRows = value;\n this.touched();\n }\n\n public get filters(): { [key: string]: string } | undefined {\n this.tracked();\n return this.queryFilters;\n }\n\n public get hasBeenLoaded(): boolean {\n this.tracked();\n return this._hasBeenLoaded;\n }\n\n public get hasLoadedRows(): boolean {\n this.tracked();\n return !!this._loadedRows && this._loadedRows.length > 0;\n }\n\n public get keyProperty(): string {\n return this.compareProperty;\n }\n\n public get loadedKeys(): string[] | undefined {\n this.tracked();\n return this._loadedKeys;\n }\n\n public get loadedRows(): any[] | undefined {\n this.tracked();\n return this._loadedRows;\n }\n\n public override get parentEntityId(): any {\n return super.parentEntityId;\n }\n\n public override set parentEntityId(value: any) {\n super.parentEntityId = value;\n if (this.loadedRows) {\n this.refresh();\n }\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.configsProvider = inject(GridConfigsProvider);\n this.configs = JSON.parse(JSON.stringify(this.configsProvider.configs));\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public addNewRow(row: any): void {\n this.updateLoadedRows([row]);\n }\n\n /** The key of the currently focused row, or null. Read by DataGridRowComponent's host binding. */\n public get focusedRowKey(): string | null {\n this.tracked();\n return this.focusedRow;\n }\n\n public clearFocusedRow(): void {\n this.focusedRow = null;\n this.touched();\n }\n\n public getRowData(key: string): any | null {\n if (this.hasLoadedRows) {\n const index: number = this._loadedKeys!.indexOf(key);\n return this.loadedRows![index];\n }\n return null;\n }\n\n public getRowID(key: string): any {\n const row: any = this.getRowData(key);\n\n return this.compareProperty.split('.').reduce((row: any, property: string) => row[property], row);\n }\n\n public getRowInternalKey(row: any): string {\n return row[KEY_FIELD];\n }\n\n public hasRowWithID(id: any): boolean {\n if (!this.hasLoadedRows) {\n return false;\n }\n\n const loadedIDs: any[] = this.compareProperty\n .split('.')\n .reduce(\n (loadedRows: any[], property: string) => loadedRows.map((row: any) => row[property]),\n this._loadedRows ?? [],\n )\n .map((row: any) => (typeof id === 'string' ? `${row}` : typeof id === 'number' ? parseInt(`${row}`) : row));\n\n return loadedIDs.indexOf(id) >= 0;\n }\n\n public isKeyExists(key: string): boolean {\n return this.hasLoadedRows && this._loadedKeys!.some((x: string) => x === key);\n }\n\n public loadRows(): void {\n if (this.isLoading) {\n return;\n }\n\n this.isLoading = true;\n this.loadStarted.emit();\n\n const parameters: any = {\n endRow: this.configsProvider.configs.recordBlockSize,\n filters: this.queryFilters,\n startRow: this.recordBlock,\n };\n\n this.getData(parameters)\n .pipe(take(1))\n .subscribe({\n next: (response: any[] | { items: any[]; totalRows: number }) => {\n let rows: any[];\n if (Array.isArray(response)) {\n rows = response;\n } else {\n rows = response?.items ?? [];\n this.totalRows = response?.totalRows;\n }\n\n this.updateLoadedRows(rows ?? []);\n\n this.isLoading = false;\n this._hasBeenLoaded = true;\n this.touched();\n this.loadFinished.emit(true);\n },\n error: (_: any) => {\n this.isLoading = false;\n this.loadFinished.emit(false);\n },\n });\n }\n\n public refresh(): void {\n if (this.focusedRow) {\n this.clearFocusedRow();\n }\n this.clearLoadedRows();\n this.loadRows();\n }\n\n public removeKeys(keys: string[]): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n keys.forEach((key: string) => {\n if (this.focusedRow === key) {\n this.clearFocusedRow();\n }\n\n const indexToRemove: number = this._loadedKeys!.indexOf(key);\n\n if (indexToRemove >= 0) {\n // Need to set again the array values to trigger the change detection.\n this._loadedKeys = this._loadedKeys!.filter((_, index) => index !== indexToRemove);\n this.touched();\n this._loadedRows = this._loadedRows!.filter((_, index) => index !== indexToRemove);\n this.touched();\n }\n });\n }\n\n public setFilters(filters?: { [key: string]: string }): void {\n this.queryFilters = filters;\n this.filtersChanged.emit(filters);\n this.refresh();\n }\n\n public setFocusedRow(key: string): void {\n this.focusedRow = key;\n this.touched();\n }\n\n public updateRow(key: string, newRowData: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n const index: number = this._loadedKeys!.indexOf(key);\n if (index >= 0) {\n // Need to set the KEY_FIELD value into the new data, to make sure this information is not lost.\n newRowData[KEY_FIELD] = key;\n\n this._loadedRows![index] = newRowData;\n\n // Need to update loaded rows to force displayed rows to refresh.\n this.updateLoadedRows([]);\n }\n }\n //#endregion\n\n //#region Private methods\n protected clearLoadedRows(): void {\n this._hasBeenLoaded = false;\n this.touched();\n this._loadedRows = undefined;\n this.touched();\n this._loadedKeys = undefined;\n this.touched();\n this.recordBlock = 0;\n this.loadedLastRow = false;\n this.totalRows = undefined;\n }\n\n protected updateLoadedRows(rows: any[]): void {\n // Assign individual key to each row.\n rows.forEach((row: any) => {\n row[KEY_FIELD] = GuidHelper.generateGUID();\n });\n\n this._loadedRows = [...(this._loadedRows ?? []), ...rows];\n this.touched();\n this._loadedKeys = [...(this._loadedKeys ?? []), ...rows.map((row: any) => row[KEY_FIELD])];\n this.touched();\n\n this.recordBlock += rows.length;\n if (rows.length < this.configsProvider.configs.recordBlockSize) {\n this.loadedLastRow = true;\n }\n }\n //#endregion\n\n //#region Abstract methods\n abstract getData(params?: any): Observable<any[] | { items: any[]; totalRows: number }>;\n //#endregion\n}\n","import { HttpResponse } from '@angular/common/http';\nimport { EventEmitter, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { DataGridConfigs } from '../../models/configs/data-grid-configs';\nimport { IListParameters } from '../../models/data-grid-parameters';\nimport { IGridColumn } from '../../models/grid-column';\nimport { GridDataset } from './grid.dataset';\n\n@Injectable()\nexport abstract class DataGridDataset extends GridDataset {\n //#region ViewChilds, Inputs, Outputs\n public selectedRowsChanged: EventEmitter<{ [id: string]: { rowData: any; selected: boolean } }> = new EventEmitter<{\n [id: string]: { rowData: any; selected: boolean };\n }>();\n //#endregion\n\n //#region Variables\n public override configs: DataGridConfigs;\n\n public columns!: IGridColumn[];\n\n private _selectedRowKeys: string[] = [];\n //#endregion\n\n //#region Properties\n public get selectedRowKeys(): string[] {\n this.tracked();\n return this._selectedRowKeys;\n }\n public set selectedRowKeys(value: string[]) {\n this._selectedRowKeys = value;\n this.touched();\n }\n\n public get columnsSize(): string {\n const sizes: string[] = [];\n\n if (this.configs.multiSelect) {\n sizes.push(this.configs.multiSelectSize ?? 'min-content');\n }\n\n sizes.push(...this.columns.map((col: IGridColumn) => col.size ?? 'minmax(0,1fr)'));\n\n return sizes.join(' ');\n }\n\n public get hasSelectedRows(): boolean {\n return this.selectedRowKeys.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.configs = JSON.parse(JSON.stringify(this.configsProvider.configs));\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public clearSelection(): void {\n if (!this.hasLoadedRows || !this.hasSelectedRows) {\n return;\n }\n\n const selectedKeys: string[] = this.selectedRowKeys;\n\n this.selectedRowKeys = [];\n this.clearFocusedRow();\n this.selectedRowsChanged.emit(\n selectedKeys.reduce((keys: { [id: string]: { rowData: any; selected: boolean } }, key: string) => {\n keys[key] = {\n rowData: this.getRowData(key),\n selected: false,\n };\n return keys;\n }, {}),\n );\n }\n\n public export(_format: string, _parameters: IListParameters): Observable<HttpResponse<Blob>> {\n return throwError(() => new Error(`Export is not implemented for ${this.constructor.name}.`));\n }\n\n public deselectRow(key: string): void {\n if (!this.hasLoadedRows || !this.isKeySelected(key)) {\n return;\n }\n\n this.removeSelectedRow(key);\n\n this.selectedRowsChanged.emit({\n [key]: {\n rowData: this.getRowData(key),\n selected: false,\n },\n });\n }\n\n public deselectRowID(id: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n const index: number = this.loadedKeys!.map((key: string) => this.getRowID(key)).indexOf(id);\n\n const key: string = this.loadedKeys![index];\n this.deselectRow(key);\n }\n\n public getSelectedRowsData(): any[] {\n if (!this.hasLoadedRows || !this.hasSelectedRows) {\n return [];\n }\n\n return this.selectedRowKeys\n .map((key: string) => this.loadedKeys!.indexOf(key))\n .filter((index: number) => index >= 0)\n .map((index: number) => this.loadedRows![index]);\n }\n\n public isKeySelected(key: any): boolean {\n return this.selectedRowKeys.indexOf(key) >= 0;\n }\n\n public override refresh(): void {\n if (this.hasSelectedRows) {\n this.clearSelection();\n }\n super.refresh();\n }\n\n public override removeKeys(keys: string[]): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (this.hasSelectedRows) {\n keys\n .filter((key: string) => this.isKeySelected(key))\n .forEach((key: string) => {\n this.removeSelectedRow(key);\n });\n }\n\n super.removeKeys(keys);\n }\n\n public selectRow(key: string): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (!this.configs.multiSelect) {\n if (this.isKeySelected(key)) {\n return;\n }\n // Clear current selected row.\n this.removeSelectedRow(this.selectedRowKeys[0]);\n }\n\n if (!this.isKeySelected(key)) {\n this._selectedRowKeys.push(key);\n this.touched();\n this.selectedRowsChanged.emit({\n [key]: {\n rowData: this.getRowData(key),\n selected: true,\n },\n });\n }\n }\n\n public selectRowID(id: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (this.hasRowWithID(id)) {\n const rowIndex: number = this.loadedRows!.findIndex((row: any) => row[this.compareProperty] === id);\n\n if (rowIndex < 0) {\n return;\n }\n\n const key: string | undefined = this.loadedKeys![rowIndex];\n if (key) {\n this.selectRow(key);\n }\n }\n }\n\n public selectRows(keys: string[]): void {\n if (!this.hasLoadedRows || !this.configs.multiSelect) {\n return;\n }\n\n // Filter only the keys that are not selected yet.\n const keysNotSelected: string[] = keys.filter((key: string) => !this.isKeySelected(key));\n\n if (keysNotSelected.length > 0) {\n this._selectedRowKeys.push(...keysNotSelected);\n this.touched();\n this.selectedRowsChanged.emit(\n keys.reduce((keys: { [id: string]: { rowData: any; selected: boolean } }, key: string) => {\n keys[key] = {\n rowData: this.getRowData(key),\n selected: true,\n };\n return keys;\n }, {}),\n );\n }\n }\n\n public override setFocusedRow(key: any): void {\n super.setFocusedRow(key);\n\n if (!this.configs.multiSelect) {\n this.selectRow(key);\n } else if (this.configs.selectOnClick ?? true) {\n if (this.isKeySelected(key)) {\n this.deselectRow(key);\n } else {\n this.selectRow(key);\n }\n }\n }\n //#endregion\n\n //#region Private methods\n protected removeSelectedRow(key: string): void {\n const index: number = this.selectedRowKeys.indexOf(key);\n if (index >= 0) {\n this._selectedRowKeys.splice(index, 1);\n this.touched();\n }\n }\n //#endregion\n}\n","import { EventEmitter, inject, Injectable } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { IBatchUpdate } from '../../models/batch-update';\nimport { IMultiEditorChanges } from '../../models/multi-editor-changes';\nimport { BaseDataset } from './base.dataset';\nimport { DataGridDataset } from './data-grid.dataset';\n\n@Injectable()\nexport abstract class MultiEditorDataset extends BaseDataset {\n //#region ViewChilds, Inputs, Outputs\n public savedChanges: EventEmitter<void> = new EventEmitter();\n //#endregion\n\n //#region Variables\n protected readonly dataGridDataset: DataGridDataset;\n\n private fakeIDsGenerated: any[] = [];\n private modifiedValues: IMultiEditorChanges = {\n changed: {},\n removed: [],\n };\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.dataGridDataset = inject(DataGridDataset);\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public clearChangedValues(): void {\n this.fakeIDsGenerated = [];\n\n this.modifiedValues = {\n changed: {},\n removed: [],\n };\n }\n\n public removeValue(key: string): void {\n if (this.modifiedValues.changed[key]) {\n delete this.modifiedValues.changed[key];\n }\n\n const id: any = this.dataGridDataset.getRowID(key);\n this.dataGridDataset.removeKeys([key]);\n\n if (!id) {\n return;\n }\n\n if (this.fakeIDsGenerated.indexOf(id) < 0) {\n this.modifiedValues.removed.push(id);\n } else {\n this.fakeIDsGenerated.splice(this.fakeIDsGenerated.indexOf(id), 1);\n }\n }\n\n public saveChanges(): Observable<any> {\n const batchUpdate: IBatchUpdate<any, any> = {\n entitiesToInsertOrUpdate: Object.entries(this.modifiedValues.changed).map(([_, v]: [string, string]) => v),\n entitiesToDelete: this.modifiedValues.removed,\n };\n\n return this.saveData(batchUpdate).pipe(tap(() => this.savedChanges.emit()));\n }\n\n public storeFakeIDGenerated(id: any): void {\n if (this.fakeIDsGenerated.indexOf(id) >= 0) {\n return;\n }\n\n this.fakeIDsGenerated.push(id);\n }\n\n public updateValues(key: string, newRowData: any): void {\n this.modifiedValues.changed[key] = newRowData;\n\n this.dataGridDataset.updateRow(key, newRowData);\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n\n //#region Abstract methods\n public abstract newData(id: any): any;\n\n public abstract saveData(batchUpdate: IBatchUpdate<any, any>): Observable<any>;\n //#endregion\n}\n","import { EventEmitter, Injectable } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { IMultiSelectorChanges } from '../../models/multi-selector-changes';\nimport { GridDataset } from './grid.dataset';\n\n@Injectable()\nexport abstract class MultiSelectResultDataset extends GridDataset {\n //#region ViewChilds, Inputs, Outputs\n public savedChanges: EventEmitter<void> = new EventEmitter();\n //#endregion\n\n //#region Variables\n private _displayedIDs: any[] = [];\n private _displayedRows: any[] = [];\n\n private _idsToAdd: any[] = [];\n private _idsToRemove: any[] = [];\n private addedRowData: any[] = [];\n //#endregion\n\n //#region Properties\n public get displayedIDs(): any[] {\n this.tracked();\n return this._displayedIDs;\n }\n\n public get displayedRows(): any[] {\n this.tracked();\n return this._displayedRows;\n }\n\n public get idsToAdd(): any[] {\n this.tracked();\n return this._idsToAdd;\n }\n\n public get idsToRemove(): any[] {\n this.tracked();\n return this._idsToRemove;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public override refresh(): void {\n this.clearSelection();\n super.refresh();\n }\n\n public saveChanges(): Observable<any> {\n const changes: IMultiSelectorChanges = {\n idsToAdd: this.idsToAdd,\n idsToRemove: this.idsToRemove,\n };\n\n return this.saveData(changes).pipe(\n tap(() => {\n this.savedChanges.emit();\n this.clearSelection();\n this.clearLoadedRows();\n }),\n );\n }\n\n /**\n * Records that an entry is to be added, if it is not already recorded or already saved.\n *\n * Idempotent: the same entry can be reported more than once, because a click on the grid and a\n * click in the panel both land here through different paths.\n */\n public setIDToAdd(idToAdd: any, rowData: any): void {\n const index: number = this._idsToRemove.indexOf(idToAdd);\n if (index >= 0) {\n this._idsToRemove.splice(index, 1);\n this.touched();\n } else if (!this.isExistingID(idToAdd) && this._idsToAdd.indexOf(idToAdd) < 0) {\n this._idsToAdd.push(idToAdd);\n this.touched();\n this.addedRowData.push(rowData);\n }\n this.updateDisplayedRows();\n }\n\n /** Idempotent, for the same reason as {@link setIDToAdd}. */\n public setIDToRemove(idToRemove: any): void {\n const index: number = this._idsToAdd.indexOf(idToRemove);\n if (index >= 0) {\n this._idsToAdd.splice(index, 1);\n this.touched();\n this.addedRowData.splice(index, 1);\n } else if (this.isExistingID(idToRemove) && this._idsToRemove.indexOf(idToRemove) < 0) {\n this._idsToRemove.push(idToRemove);\n this.touched();\n }\n this.updateDisplayedRows();\n }\n\n protected override updateLoadedRows(rows: any[]): void {\n super.updateLoadedRows(rows);\n this.updateDisplayedRows();\n }\n //#endregion\n\n //#region Private methods\n private clearSelection(): void {\n this._idsToAdd = [];\n this._idsToRemove = [];\n this.addedRowData = [];\n\n this.updateDisplayedRows();\n }\n\n private isExistingID(id: any): boolean {\n return (this.loadedKeys ?? []).map((key: string) => this.getRowID(key)).indexOf(id) >= 0;\n }\n\n private updateDisplayedRows() {\n const loadedKeys: string[] = (this.loadedKeys ?? []).filter(\n (key: string) => this.idsToRemove.indexOf(this.getRowID(key)) < 0,\n );\n\n this._displayedIDs = loadedKeys.map((key: string) => this.getRowID(key));\n this.touched();\n this._displayedIDs.push(...this._idsToAdd);\n this.touched();\n\n this._displayedRows = loadedKeys.map((key: string) => this.getRowData(key));\n this.touched();\n this._displayedRows.push(...this.addedRowData);\n this.touched();\n }\n //#endregion\n\n //#region Abstract methods\n protected abstract saveData(changedIds: IMultiSelectorChanges): Observable<any>;\n //#endregion\n}\n","import { EventEmitter, Injectable } from '@angular/core';\n\n/** An empty service with no members. Nothing in the package uses it. */\n@Injectable()\nexport class FormGroupService {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n //#region Variables\n //#endregion\n //#region Properties\n //#endregion\n //#region Constructor and Angular life cycle methods\n //#endregion\n //#region Event handlers\n //#endregion\n //#region Public methods\n //#endregion\n //#region Private methods\n //#endregion\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { EventEmitter, Injectable, signal, WritableSignal } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { Observable, Subject, Subscription } from 'rxjs';\n\n/**\n * Holds the state of one form view: the form group, the loaded model, view or edit mode and the\n * loading flag. Provide it on the view; the library's form fields read it to decide whether to\n * show inputs or read-only values.\n */\n@Injectable()\nexport class FormService {\n //#region ViewChilds, Inputs, Outputs\n public fieldRefreshed = new EventEmitter<{ fieldName: string; value?: any; loading?: boolean }>();\n public modelRefreshed = new EventEmitter<any | null>();\n //#endregion\n\n //#region Variables\n // Signals rather than fields: these are read from templates through the accessors below, and a\n // plain assignment told Angular nothing. The accessors keep their old shape, so nothing that\n // reads or writes them has to change.\n private readonly _loading: WritableSignal<boolean> = signal(false);\n private readonly _model: WritableSignal<any | null> = signal(null);\n private readonly currentMode: WritableSignal<'edit' | 'view'> = signal('view');\n\n // A FormGroup's validity is not a signal and never notifies one, so its status is mirrored here\n // and `isValid` reads this. Without it a save button bound to isValid keeps its first answer.\n private readonly formStatus: WritableSignal<string | undefined> = signal(undefined);\n\n private editCanceled$: Subject<void> = new Subject<void>();\n private form?: FormGroup;\n // Held rather than tied to a DestroyRef: this service is also built directly in specs, outside\n // any injection context, and re-initialising with another form has to drop the old subscription.\n private formStatusSubscription?: Subscription;\n private initialValue?: any;\n //#endregion\n\n //#region Properties\n public get editCanceled(): Observable<void> {\n return this.editCanceled$.asObservable();\n }\n\n public get isEditMode(): boolean {\n return this.currentMode() === 'edit';\n }\n\n public get isValid(): boolean {\n this.formStatus();\n return this.form?.valid ?? false;\n }\n\n public get loading(): boolean {\n return this._loading();\n }\n\n public set loading(value: boolean) {\n if (this._loading() !== value) {\n this._loading.set(value);\n if (value) {\n this.form?.disable();\n } else if (this.isEditMode) {\n this.form?.enable();\n }\n }\n }\n\n public get model(): any | null {\n return this._model();\n }\n\n public set model(value: any | null) {\n if (this._model() !== value) {\n this._model.set(value);\n this.modelRefreshed.emit(value);\n }\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public beginEdit(): void {\n this.currentMode.set('edit');\n this.form?.enable();\n }\n\n public beginFieldLoading(fieldName: string) {\n this.fieldRefreshed.emit({\n fieldName,\n loading: true,\n });\n }\n\n public cancelEdit(): void {\n this.currentMode.set('view');\n this.form?.disable();\n this.resetForm();\n this.editCanceled$.next();\n }\n\n public disableForm(): void {\n this.form?.disable();\n }\n\n public enableForm(): void {\n if (this.isEditMode) {\n this.form?.enable();\n }\n }\n\n public getModelFromForm(): any {\n return this.form?.getRawValue();\n }\n\n public initializeForm(form: FormGroup): void {\n this.form = form;\n this.initialValue = form.getRawValue();\n\n this.formStatusSubscription?.unsubscribe();\n this.formStatus.set(form.status);\n this.formStatusSubscription = form.statusChanges.subscribe((status: string) => this.formStatus.set(status));\n\n if (this.currentMode() === 'view') {\n this.form.disable();\n }\n }\n\n public markAllAsTouched(): void {\n if (!this.form) {\n return;\n }\n\n this.form.markAllAsTouched();\n }\n\n public resetForm(): void {\n if (!this.form) {\n return;\n }\n\n this.form.reset();\n\n if (this.model) {\n this.form.patchValue(this.model);\n } else if (this.initialValue) {\n this.form.patchValue(this.initialValue);\n }\n\n this.form.updateValueAndValidity();\n }\n\n public setFieldValue(fieldName: string, value: any): void {\n this.fieldRefreshed.emit({\n fieldName,\n loading: false,\n value,\n });\n }\n\n public setValidationErrorsFromHttpResponse(errorResponse: HttpErrorResponse): void {\n if (!errorResponse || !this.form) {\n return;\n }\n\n // Error 400 = Validation issues\n if (errorResponse.status === 400 && errorResponse.error && errorResponse.error.errors) {\n const errors: { [id: string]: string[] } = <{ [id: string]: string[] }>errorResponse.error.errors;\n\n Object.keys(errors)\n .map((x: string) => {\n return { key: x, field: x.substring(0, 1).toLocaleLowerCase() + x.substring(1, x.length) };\n })\n .forEach((err: { key: string; field: string }) => {\n setTimeout(() => {\n const field: FormControl = <FormControl>this.form!.get(err.field);\n field?.setErrors({ [errors[err.key][0]]: true });\n field?.markAsTouched();\n });\n });\n }\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Signal } from '@angular/core';\n\n/**\n * A child that decides whether its ribbon group is shown at all.\n *\n * `isVisible` is a signal rather than a plain field because `RibbonGroupComponent` reads it from\n * a host binding, and Angular evaluates a component's host bindings during its PARENT's pass. A\n * child assigning a field could not reach that pass at all: nothing marked it, and writing it\n * afterwards raised NG0100. A signal read inside the group's binding is tracked, so flipping it\n * refreshes the group whatever strategy the host application uses.\n */\nexport abstract class RibbonGroupChild {\n abstract readonly isVisible: Signal<boolean>;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const SIDEBAR_CONFIGS: InjectionToken<SidebarConfigs> = new InjectionToken<SidebarConfigs>('', {\n providedIn: 'root',\n factory: () => new SidebarConfigs(),\n});\n\nexport class SidebarConfigs {\n public errorText = 'Error';\n /** Tooltip for items that open in a new browser tab. Rendered as-is, like {@link errorText}. */\n public externalLinkText = 'Opens in a new browser tab';\n public loadingText = 'Loading';\n /**\n * Derive region headers from the menu tree instead of from {@link SidebarMenu.region}.\n *\n * With this on, a top-level menu that has children and no URL stops being a collapsible node\n * and becomes an area header, with its children rendered flat beneath it as top-level items --\n * icons included. The area is then a real menu row, so it carries its own translated label and\n * its own order, and no `region` label has to be repeated across every item that belongs to it.\n *\n * Off by default: without it a top-level parent stays the collapsible group it has always been.\n */\n public shouldDeriveAreasFromRootMenus = false;\n public logoCollapsedPath?: string;\n public logoExpandedPath?: string;\n\n constructor(options: Partial<SidebarConfigs> = {}) {\n Object.assign(this, options);\n }\n}\n","import { SidebarMenuOpenMode } from './sidebar-menu-open-mode';\n\nexport class SidebarMenu {\n public childCount = 0;\n public children: SidebarMenu[] = [];\n public height?: number;\n public icon?: string;\n public id = 0;\n public label = '';\n public isSelected = false;\n /**\n * How {@link url} is opened. An absent value means {@link SidebarMenuOpenMode.Internal}.\n *\n * Left optional and without an initializer on purpose: the constructor is an `Object.assign`,\n * which would overwrite a default with the `null` a nullable backend column serializes to.\n * Read it through `toSidebarMenuOpenMode(menu.openMode)` instead of comparing it directly.\n */\n public openMode?: SidebarMenuOpenMode;\n public parent: SidebarMenu | null = null;\n public region?: string;\n public url?: string;\n\n constructor(options: Partial<SidebarMenu> = {}) {\n Object.assign(this, options);\n }\n}\n","/**\n * How a {@link SidebarMenu}'s `url` is opened when the item is clicked.\n *\n * Read the value off a menu through {@link toSidebarMenuOpenMode} rather than comparing the\n * field directly: it crosses HTTP, so it can arrive as a string, as a number, as `null`, or not\n * at all.\n */\nexport enum SidebarMenuOpenMode {\n /** `url` is an internal Angular route and opens an application tab. The default. */\n Internal = 'internal',\n\n /** `url` is an absolute http(s) address and opens in a new browser tab. */\n ExternalNewTab = 'externalNewTab',\n\n /** `url` is an absolute http(s) address and opens embedded in an application tab. */\n ExternalEmbedded = 'externalEmbedded',\n}\n\n/** Ordinals matching the mode column stored by the backend, for a numeric payload. */\nconst ORDINAL_MODES: SidebarMenuOpenMode[] = [\n SidebarMenuOpenMode.Internal,\n SidebarMenuOpenMode.ExternalNewTab,\n SidebarMenuOpenMode.ExternalEmbedded,\n];\n\n/**\n * Parses the wire value of `SidebarMenu.openMode`.\n *\n * Deliberately a parser rather than a `?? Internal` fallback, because the field is deserialized\n * straight from each application's menu endpoint and its shape is not guaranteed:\n *\n * - a **number** is read as the backend's enum ordinal, which is what an ASP.NET Core enum\n * property serializes to unless that backend registers a string converter;\n * - a **string** is matched case-insensitively, so `'externalNewTab'` and `'ExternalNewTab'`\n * both work;\n * - anything else — an omitted field from a backend that predates this feature, `null`, or a\n * mode introduced by a newer one — degrades to {@link SidebarMenuOpenMode.Internal}.\n *\n * Degrading to `Internal` keeps an unrecognized mode behaving the way menus behaved before\n * external destinations existed, instead of producing an item that does nothing when clicked.\n */\nexport function toSidebarMenuOpenMode(value: unknown): SidebarMenuOpenMode {\n if (typeof value === 'number') {\n return ORDINAL_MODES[value] ?? SidebarMenuOpenMode.Internal;\n }\n\n if (typeof value === 'string') {\n const normalized: string = value.toLowerCase();\n\n return (\n ORDINAL_MODES.find((mode: SidebarMenuOpenMode) => mode.toLowerCase() === normalized) ??\n SidebarMenuOpenMode.Internal\n );\n }\n\n return SidebarMenuOpenMode.Internal;\n}\n","import { EventEmitter, Injectable, signal, WritableSignal } from '@angular/core';\nimport { map, Observable, take, tap } from 'rxjs';\nimport { ISidebarProfile, SidebarMenu, SidebarMenuOpenMode, toSidebarMenuOpenMode } from '../models';\nimport { HttpErrorResponse } from '@angular/common/http';\n\n/**\n * Loads and tracks the menus of `lib-sidebar`: the tree, the selected item and the collapsed and\n * open states. Extend it and implement `loadMenus`, `getMenuFromUrl` and `getUserProfile`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport abstract class SidebarService {\n //#region ViewChilds, Inputs, Outputs\n public childrenFailed: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenLoaded: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenLoading: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenInitialized: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public menuExternalUrlSelected: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public menuUrlSelected: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public selectionChanged: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n //#endregion\n\n //#region Variables\n // Signals rather than plain fields: a sidebar component reads these through a getter in its\n // template, and a signal read there is tracked, so flipping one renders the sidebar whatever\n // change-detection strategy the host application uses. A plain assignment told Angular nothing,\n // which is why the sidebar could sit on a stale frame until the user clicked something.\n private readonly _isActive: WritableSignal<boolean> = signal(false);\n private readonly _isCollapsed: WritableSignal<boolean> = signal(false);\n private readonly _shouldActivate: WritableSignal<boolean> = signal(false);\n\n private menus: SidebarMenu[] = [];\n private selectedMenu: SidebarMenu | null = null;\n //#endregion\n\n //#region Properties\n /** Whether the collapsed sidebar is currently held open. */\n public get isActive(): boolean {\n return this._isActive();\n }\n public set isActive(value: boolean) {\n this._isActive.set(value);\n }\n\n public get isCollapsed(): boolean {\n return this._isCollapsed();\n }\n public set isCollapsed(value: boolean) {\n this._isCollapsed.set(value);\n }\n\n /** Whether a click should hold the sidebar open, which depends on width and collapsed state. */\n public get shouldActivate(): boolean {\n return this._shouldActivate();\n }\n public set shouldActivate(value: boolean) {\n this._shouldActivate.set(value);\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Public methods\n public deselectAll(): void {\n this.menus\n .filter((menu: SidebarMenu) => menu.isSelected)\n .forEach((menu: SidebarMenu) => {\n this.deselectMenu(menu);\n });\n }\n\n public loadChildren(parentMenu: SidebarMenu): void {\n this.childrenLoading.emit(parentMenu);\n\n this.loadChildrenFor(parentMenu).subscribe({\n error: (exception: HttpErrorResponse) => {\n this.childrenFailed.emit(parentMenu);\n throw exception;\n },\n });\n }\n\n /**\n * Loads a parent's children and hands them back, for callers that need them before the user\n * clicks -- a sidebar rendering areas flat has to have them up front. {@link loadChildren} is\n * the fire-and-forget variant that also raises the loading and failure events.\n */\n public loadChildrenFor(parentMenu: SidebarMenu): Observable<SidebarMenu[]> {\n return this.loadMenus(parentMenu).pipe(\n take(1),\n map((menus: SidebarMenu[]) => menus.map((menu: SidebarMenu) => new SidebarMenu(menu))),\n tap((childrenMenus: SidebarMenu[]) => {\n parentMenu.children = childrenMenus;\n childrenMenus.forEach((childMenu: SidebarMenu) => (childMenu.parent = parentMenu));\n\n // children is a plain field: the item that asked for them has to be told they arrived.\n this.childrenLoaded.emit(parentMenu);\n }),\n );\n }\n\n public loadRoot(): Observable<SidebarMenu[]> {\n return this.loadMenus(null).pipe(\n take(1),\n map((menus: SidebarMenu[]) => menus.map((menu: SidebarMenu) => new SidebarMenu(menu))),\n tap((menus: SidebarMenu[]) => (this.menus = menus)),\n );\n }\n\n public select(menu: SidebarMenu): void {\n if (menu.childCount > 0 && (menu.children?.length ?? 0) === 0) {\n this.loadChildren(menu);\n }\n\n const hasUrl: boolean = (menu.url?.length ?? 0) > 0;\n const openMode: SidebarMenuOpenMode = toSidebarMenuOpenMode(menu.openMode);\n const isExternal: boolean = hasUrl && openMode !== SidebarMenuOpenMode.Internal;\n\n // External destinations are announced on their own emitter, so a consumer that only knows\n // menuUrlSelected never receives an absolute URL it would hand to the Angular router.\n const urlSelected: EventEmitter<SidebarMenu> = isExternal ? this.menuExternalUrlSelected : this.menuUrlSelected;\n\n // Opening a new browser tab is an action, not a destination: the user stays on the view\n // already on screen, so the item must neither take the selection nor clear that view's.\n // Parents still fall through, so a parent that carries a URL keeps expanding instead of\n // becoming impossible to open.\n if (isExternal && openMode === SidebarMenuOpenMode.ExternalNewTab && menu.childCount === 0) {\n urlSelected.emit(menu);\n return;\n }\n\n // In case we're deselecting the menu because a child was selected, we need to keep track of the original selection state.\n const isSelected: boolean = menu.isSelected;\n\n if (!!this.selectedMenu && this.selectedMenu !== menu) {\n this.deselectAll();\n }\n\n if (!isSelected) {\n this.selectedMenu = menu;\n this.selectMenu(menu);\n\n if (hasUrl) {\n urlSelected.emit(menu);\n }\n } else if (hasUrl) {\n // Menu with a URL is already selected — navigate again instead of toggling off.\n urlSelected.emit(menu);\n } else {\n this.selectedMenu = null;\n this.deselectMenu(menu);\n }\n }\n //#endregion\n\n //#region Private methods\n private deselectMenu(menu: SidebarMenu, shouldUpdateParents = true): void {\n if (!menu.isSelected) {\n return;\n }\n\n menu.isSelected = false;\n this.selectionChanged.emit(menu);\n\n if ((menu.children?.length ?? 0) > 0) {\n menu.children\n .filter((child: SidebarMenu) => child.isSelected)\n .forEach((child: SidebarMenu) => {\n const shouldUpdateParents = false;\n this.deselectMenu(child, shouldUpdateParents);\n });\n }\n\n if (!!menu.parent && shouldUpdateParents) {\n while (menu.parent) {\n this.selectionChanged.emit(menu.parent);\n menu = menu.parent;\n }\n }\n }\n\n private selectMenu(menu: SidebarMenu): void {\n menu.isSelected = true;\n this.selectionChanged.emit(menu);\n\n if (menu.parent) {\n this.selectMenu(menu.parent);\n }\n }\n //#endregion\n\n //#region Abstract methods\n public abstract getMenuFromUrl(url: string): Observable<SidebarMenu>;\n\n public abstract getUserProfile(): ISidebarProfile | undefined;\n\n protected abstract loadMenus(parentMenuID: SidebarMenu | null): Observable<SidebarMenu[]>;\n //#endregion\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n afterNextRender,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n InputSignal,\n linkedSignal,\n OnDestroy,\n output,\n OutputEmitterRef,\n signal,\n Signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport {\n DatePart,\n formatDateText,\n formatTimeText,\n getDatePattern,\n parseDateText,\n parseIsoValue,\n parseTimeText,\n toIsoDate,\n toIsoDateTime,\n} from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\nimport { CalendarComponent } from '../calendar/calendar.component';\n\nlet nextCalendarId = 0;\n\n/** What a `lib-date-input` holds: a day, or a day and a time. */\nexport type DateInputMode = 'date' | 'datetime';\n\n/**\n * A date field, or a date and time field, that follows the application's language.\n *\n * The native `<input type=\"date\">` shows dates in the operating system's format, whatever language\n * the application is in. This field shows and reads dates in the language the application chose\n * (see `LocaleService`): `05/12/2026` in Portuguese, `12/05/2026` in English. The user can type the\n * date or pick it from a calendar (the calendar button, or Alt+Down in the field).\n *\n * It is a form control. The value has the same shape the native inputs give, so it can replace them\n * without changing what the form holds:\n *\n * - `date` mode: a `yyyy-MM-dd` string, such as `2026-12-05`.\n * - `datetime` mode: a local `yyyy-MM-ddTHH:mm` string, such as `2026-12-05T14:30`.\n * - `null` when the field is empty or the text is not a valid date.\n *\n * It also accepts a `Date` as the value. It adds these validation errors: `dateInvalid` when the\n * text is not a date, `dateMin` and `dateMax` when the date is outside `min` and `max`.\n */\n@Component({\n selector: 'lib-date-input',\n templateUrl: './date-input.component.html',\n styleUrls: ['./date-input.component.scss'],\n imports: [CalendarComponent],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateInputComponent), multi: true },\n ],\n host: {\n class: 'lib-date-input',\n },\n})\nexport class DateInputComponent implements ControlValueAccessor, Validator, OnDestroy {\n //#region Inputs and outputs\n /** Whether the field holds a day (`date`) or a day and a time (`datetime`). Defaults to `date`. */\n public readonly mode: InputSignal<DateInputMode> = input<DateInputMode>('date');\n /** Earliest allowed day: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly min: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Latest allowed day: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly max: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Lets the user see and focus the value but not change it. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Shows the field as invalid, for example when the form was touched. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Accessible name of the date text field, when no visible label names it. Defaults to none. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n\n /** Emits when a text field of the input loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits when a text field of the input gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every keystroke in a text field. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly injector: Injector = inject(Injector);\n private readonly localeService: LocaleService = inject(LocaleService);\n private readonly overlay: Overlay = inject(Overlay);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n private readonly container: Signal<ElementRef<HTMLElement> | undefined> =\n viewChild<ElementRef<HTMLElement>>('container');\n private readonly dateField: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('dateField');\n private readonly calendarTemplate: Signal<TemplateRef<unknown> | undefined> =\n viewChild<TemplateRef<unknown>>('calendarTemplate');\n\n private overlayRef?: OverlayRef;\n private onChange: (value: string | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n private onValidatorChange: () => void = () => undefined;\n\n /** The current value as a date, or `null`. */\n private readonly current: WritableSignal<Date | null> = signal(null);\n /** Set when the typed text could not be read as a date or time. */\n private readonly hasTypingError: WritableSignal<boolean> = signal(false);\n //#endregion\n\n //#region Properties\n /** The calendar's id, which the date field points at with `aria-controls` while it is open. */\n protected readonly calendarId: string = `lib-date-input-calendar-${nextCalendarId++}`;\n protected readonly isDisabled: WritableSignal<boolean> = signal(false);\n protected readonly isOpen: WritableSignal<boolean> = signal(false);\n\n protected readonly locale: Signal<string> = computed(() => this.localeService.locale());\n\n /** The text in the date field. Follows the value and the language, and the user's typing in between. */\n protected readonly dateText: WritableSignal<string> = linkedSignal(() => {\n const value: Date | null = this.current();\n return value ? formatDateText(value, this.locale()) : '';\n });\n\n /** The text in the time field. Follows the value and the language, and the user's typing in between. */\n protected readonly timeText: WritableSignal<string> = linkedSignal(() => {\n const value: Date | null = this.current();\n return value ? formatTimeText(value, this.locale()) : '';\n });\n\n /** The date order in the language's own words, such as `dia/mês/ano`. */\n protected readonly datePlaceholder: Signal<string> = computed(() => {\n const locale: string = this.locale();\n const { order, separator } = getDatePattern(locale);\n try {\n const names: Intl.DisplayNames = new Intl.DisplayNames(locale, { type: 'dateTimeField' });\n return order.map((part: DatePart) => names.of(part) ?? part).join(separator);\n } catch {\n return order.join(separator);\n }\n });\n\n /**\n * Accessible name of the time field: the field's name, if any, then the word for \"hour\" in the\n * application's language, from `Intl` so the library needs no translation key.\n */\n protected readonly timeLabel: Signal<string> = computed(() => {\n let hour = 'Time';\n try {\n hour = new Intl.DisplayNames(this.locale(), { type: 'dateTimeField' }).of('hour') ?? hour;\n } catch {\n // Keep the fallback.\n }\n return [this.ariaLabel(), hour].filter(Boolean).join(', ');\n });\n\n protected readonly calendarSelection: Signal<Date | null> = computed(() => this.current());\n protected readonly isFieldInvalid: Signal<boolean> = computed(() => this.invalid() || this.hasTypingError());\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n // A new `min` or `max` changes the errors, so the form must validate again, for example the\n // end of a date range whose `min` is the start's value. The first run only records the limits.\n let previous: string | undefined;\n effect(() => {\n const limits: string = JSON.stringify([limitKey(this.min()), limitKey(this.max())]);\n if (previous !== undefined && previous !== limits) {\n this.onValidatorChange();\n }\n previous = limits;\n });\n }\n\n public ngOnDestroy(): void {\n this.disposeOverlay();\n }\n //#endregion\n\n //#region ControlValueAccessor and Validator\n /** Sets the value from the form. Accepts a `Date`, `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm` or `null`. */\n public writeValue(value: unknown): void {\n this.hasTypingError.set(false);\n this.current.set(parseIsoValue(value));\n }\n\n /** Registers the form's change callback. */\n public registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /** Registers the form's touched callback. */\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** Enables or disables the field from the form. */\n public setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\n if (isDisabled) {\n this.close(false);\n }\n }\n\n /** Reports `dateInvalid`, `dateMin` and `dateMax`. */\n public validate(_control: AbstractControl): ValidationErrors | null {\n if (this.hasTypingError()) {\n return { dateInvalid: true };\n }\n const value: Date | null = this.current();\n if (!value) {\n return null;\n }\n const day: Date = new Date(value.getFullYear(), value.getMonth(), value.getDate());\n const min: Date | null = parseIsoValue(this.min());\n const max: Date | null = parseIsoValue(this.max());\n if (min && day < new Date(min.getFullYear(), min.getMonth(), min.getDate())) {\n return { dateMin: { min: toIsoDate(min), actual: toIsoDate(day) } };\n }\n if (max && day > new Date(max.getFullYear(), max.getMonth(), max.getDate())) {\n return { dateMax: { max: toIsoDate(max), actual: toIsoDate(day) } };\n }\n return null;\n }\n\n /** Registers the callback that re-runs validation. */\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n //#endregion\n\n //#region Event handlers\n protected onDateTyped(event: Event): void {\n this.dateText.set((<HTMLInputElement>event.target).value);\n this.inputChanged.emit();\n }\n\n protected onTimeTyped(event: Event): void {\n this.timeText.set((<HTMLInputElement>event.target).value);\n this.inputChanged.emit();\n }\n\n protected onFieldFocus(event: FocusEvent): void {\n // Moving between the date and the time box stays inside the field.\n if (!this.isInsideField(event.relatedTarget)) {\n this.focused.emit();\n }\n }\n\n protected onFieldBlur(event: FocusEvent): void {\n // The value is read when focus leaves the whole field, not the date box alone: in datetime\n // mode, committing on the way to the time box saved midnight and filled the time in.\n if (this.isInsideField(event.relatedTarget)) {\n return;\n }\n this.commitText();\n this.onTouched();\n this.blurred.emit();\n }\n\n protected onFieldKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n this.open();\n } else if (event.key === 'Enter') {\n this.commitText();\n } else if (event.key === 'Escape' && this.isOpen()) {\n // Closing the calendar must not also close a modal the field sits in.\n event.preventDefault();\n event.stopPropagation();\n this.close(true);\n }\n }\n\n protected onToggleClick(): void {\n if (this.isOpen()) {\n this.close(true);\n } else {\n this.open();\n }\n }\n\n protected onDatePicked(day: Date): void {\n const previous: Date | null = this.current();\n const value: Date = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n if (this.mode() === 'datetime') {\n const time: { hours: number; minutes: number } | null = parseTimeText(this.timeText());\n value.setHours(time?.hours ?? previous?.getHours() ?? 0, time?.minutes ?? previous?.getMinutes() ?? 0);\n }\n this.setValue(value);\n this.onTouched();\n this.close(true);\n }\n\n protected onCalendarCancelled(): void {\n this.close(true);\n }\n //#endregion\n\n //#region Public methods\n /** Opens the calendar, unless the field is disabled or read-only. */\n public open(): void {\n const container: HTMLElement | undefined = this.container()?.nativeElement;\n const template: TemplateRef<unknown> | undefined = this.calendarTemplate();\n if (this.isOpen() || this.isDisabled() || this.readOnly() || !container || !template) {\n return;\n }\n\n // Read what was typed first. Focus moving to the calendar button stays inside the field, so no\n // blur saved it: the calendar would open on the old date, and a click outside would leave the\n // form holding the old value while the box showed the new one.\n this.commitText();\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(container)\n .withPush(true)\n .withViewportMargin(8)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n ]),\n });\n this.overlayRef.backdropClick().subscribe(() => this.close(false));\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.isOpen.set(true);\n const overlayElement: HTMLElement = this.overlayRef.overlayElement;\n afterNextRender(() => overlayElement.querySelector<HTMLButtonElement>('.calendar-day[tabindex=\"0\"]')?.focus(), {\n injector: this.injector,\n });\n }\n\n /** Closes the calendar. With `returnFocus`, focus goes back to the date field. */\n public close(returnFocus: boolean): void {\n if (!this.isOpen()) {\n return;\n }\n this.disposeOverlay();\n this.isOpen.set(false);\n if (returnFocus) {\n this.dateField()?.nativeElement.focus();\n }\n }\n //#endregion\n\n //#region Private methods\n private isInsideField(target: EventTarget | null): boolean {\n return target instanceof Node && !!this.container()?.nativeElement.contains(target);\n }\n\n /** Reads what the user typed and turns it into the value. */\n private commitText(): void {\n const dateText: string = this.dateText().trim();\n const timeText: string = this.timeText().trim();\n const isDateTime: boolean = this.mode() === 'datetime';\n\n if (dateText === '' && (!isDateTime || timeText === '')) {\n this.setValue(null);\n return;\n }\n\n const day: Date | null = parseDateText(dateText, this.locale());\n const time: { hours: number; minutes: number } | null =\n isDateTime && timeText !== '' ? parseTimeText(timeText) : null;\n if (!day || (isDateTime && timeText !== '' && !time)) {\n const hadValue: boolean = this.current() !== null;\n this.hasTypingError.set(true);\n this.current.set(null);\n // The text stays as typed, so the user can correct it.\n this.dateText.set(dateText);\n this.timeText.set(timeText);\n if (hadValue) {\n this.onChange(null);\n }\n this.onValidatorChange();\n return;\n }\n\n if (time) {\n day.setHours(time.hours, time.minutes);\n }\n this.setValue(day);\n }\n\n private setValue(value: Date | null): void {\n const hadTypingError: boolean = this.hasTypingError();\n this.hasTypingError.set(false);\n const previous: string | null = this.serialize(this.current());\n this.current.set(value);\n const next: string | null = this.serialize(value);\n if (next !== previous) {\n this.onChange(next);\n } else if (hadTypingError) {\n this.onValidatorChange();\n }\n }\n\n private serialize(value: Date | null): string | null {\n if (!value) {\n return null;\n }\n return this.mode() === 'datetime' ? toIsoDateTime(value) : toIsoDate(value);\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n }\n //#endregion\n}\n\n/** A limit as a comparable key: its day, or `null`. */\nfunction limitKey(limit: Date | string | null | undefined): string | null {\n const date: Date | null = parseIsoValue(limit);\n return date ? toIsoDate(date) : null;\n}\n","<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","import {\n Component,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n InputSignal,\n linkedSignal,\n output,\n OutputEmitterRef,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport { formatLocaleNumber, getNumberSeparators, parseLocaleNumber } from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\n\n/** The symbol a currency shows and the side it sits on, in one locale. */\ninterface CurrencyAffix {\n symbol: string;\n position: 'prefix' | 'suffix';\n fractionDigits: number;\n}\n\n/**\n * A number field that follows the application's language.\n *\n * The native `<input type=\"number\">` reads the decimal separator from the browser, so a user whose\n * browser is in English types `1.5` in an application shown in Portuguese, where `1,5` is expected.\n * This field reads and writes numbers in the language the application chose (see `LocaleService`):\n * `1.234,56` in Portuguese and `1,234.56` in English.\n *\n * While the field has focus it shows the number without thousands separators, to make editing easy.\n * When it loses focus it rounds to `decimals` and shows the separators again.\n *\n * It is a form control. The value is a `number`, or `null` when the field is empty or the text is\n * not a number. It adds these validation errors: `numberInvalid` when the text is not a number,\n * and `min` and `max`, with the same shape as Angular's own validators.\n *\n * The decimal key of the numeric keypad types the language's decimal separator. The arrow keys\n * add or subtract `step`.\n */\n@Component({\n selector: 'lib-number-input',\n templateUrl: './number-input.component.html',\n styleUrls: ['./number-input.component.scss'],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NumberInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NumberInputComponent), multi: true },\n ],\n host: {\n class: 'lib-number-input',\n },\n})\nexport class NumberInputComponent implements ControlValueAccessor, Validator {\n //#region Inputs and outputs\n /** Smallest allowed value. Defaults to no limit. */\n public readonly min: InputSignal<number | null | undefined> = input<number | null>();\n /** Largest allowed value. Defaults to no limit. */\n public readonly max: InputSignal<number | null | undefined> = input<number | null>();\n /** How much the arrow keys add or subtract. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /**\n * Most digits after the decimal separator; the value is rounded to it when the field loses\n * focus. `0` makes an integer field. Defaults to `3`, or to the currency's digits with `currency`.\n */\n public readonly decimals: InputSignal<number | undefined> = input<number>();\n /**\n * Fewest digits shown after the decimal separator, such as `2` to show `10,00`. Defaults to `0`,\n * or to the currency's digits with `currency`.\n */\n public readonly minDecimals: InputSignal<number | undefined> = input<number>();\n /** Whether to show thousands separators when the field does not have focus. Defaults to `true`. */\n public readonly grouping: InputSignal<boolean> = input(true);\n /** Text shown before the number, such as `R$`. Overrides the currency symbol. Defaults to none. */\n public readonly prefix: InputSignal<string | undefined> = input<string>();\n /** Text shown after the number, such as `%` or `kg`. Overrides the currency symbol. Defaults to none. */\n public readonly suffix: InputSignal<string | undefined> = input<string>();\n /**\n * ISO 4217 currency code, such as `BRL` or `USD`. Shows the currency symbol on the side the\n * language puts it, and sets the decimals the currency uses. The value stays a plain number.\n * Defaults to none.\n */\n public readonly currency: InputSignal<string | undefined> = input<string>();\n /** Lets the user see and focus the value but not change it. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Shows the field as invalid, for example when the form was touched. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Accessible name of the field, when no visible label names it. Defaults to none. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n\n /** Emits when the field loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits when the field gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every keystroke. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly localeService: LocaleService = inject(LocaleService);\n\n private onChange: (value: number | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n private onValidatorChange: () => void = () => undefined;\n\n private readonly current: WritableSignal<number | null> = signal(null);\n private readonly hasTypingError: WritableSignal<boolean> = signal(false);\n private readonly hasFocus: WritableSignal<boolean> = signal(false);\n /** Whether the user typed since the field gained focus. Only typed values are rounded. */\n private wasEdited = false;\n //#endregion\n\n //#region Properties\n protected readonly isDisabled: WritableSignal<boolean> = signal(false);\n protected readonly locale: Signal<string> = computed(() => this.localeService.locale());\n\n protected readonly currencyAffix: Signal<CurrencyAffix | null> = computed(() => {\n const currency: string | undefined = this.currency();\n if (!currency) {\n return null;\n }\n try {\n const format: Intl.NumberFormat = new Intl.NumberFormat(this.locale(), { style: 'currency', currency });\n const parts: Intl.NumberFormatPart[] = format.formatToParts(1);\n const symbolIndex: number = parts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const integerIndex: number = parts.findIndex((part: Intl.NumberFormatPart) => part.type === 'integer');\n return {\n symbol: parts[symbolIndex]?.value ?? currency,\n position: symbolIndex > integerIndex ? 'suffix' : 'prefix',\n fractionDigits: format.resolvedOptions().maximumFractionDigits ?? 2,\n };\n } catch {\n return null;\n }\n });\n\n protected readonly prefixText: Signal<string | undefined> = computed(() => {\n const affix: CurrencyAffix | null = this.currencyAffix();\n return this.prefix() ?? (affix?.position === 'prefix' ? affix.symbol : undefined);\n });\n\n protected readonly suffixText: Signal<string | undefined> = computed(() => {\n const affix: CurrencyAffix | null = this.currencyAffix();\n return this.suffix() ?? (affix?.position === 'suffix' ? affix.symbol : undefined);\n });\n\n protected readonly maxDecimals: Signal<number> = computed(\n () => this.decimals() ?? this.currencyAffix()?.fractionDigits ?? 3,\n );\n protected readonly fixedDecimals: Signal<number> = computed(() =>\n Math.min(this.minDecimals() ?? this.currencyAffix()?.fractionDigits ?? 0, this.maxDecimals()),\n );\n\n /** The text in the field. Follows the value, the language and focus, and the user's typing in between. */\n protected readonly text: WritableSignal<string> = linkedSignal(() => {\n const value: number | null = this.current();\n if (value === null) {\n return '';\n }\n const isEditing: boolean = this.hasFocus();\n return formatLocaleNumber(value, this.locale(), {\n minFractionDigits: isEditing ? 0 : this.fixedDecimals(),\n maxFractionDigits: isEditing ? 20 : this.maxDecimals(),\n grouping: !isEditing && this.grouping(),\n });\n });\n\n protected readonly inputMode: Signal<string> = computed(() => (this.maxDecimals() > 0 ? 'decimal' : 'numeric'));\n protected readonly isFieldInvalid: Signal<boolean> = computed(() => this.invalid() || this.hasTypingError());\n //#endregion\n\n //#region Constructor\n constructor() {\n // A new `min` or `max` changes the errors, so the form must validate again. The first run\n // only records the starting limits: the form validates on its own when it attaches.\n let previous: string | undefined;\n effect(() => {\n const limits: string = JSON.stringify([this.min(), this.max()]);\n if (previous !== undefined && previous !== limits) {\n this.onValidatorChange();\n }\n previous = limits;\n });\n }\n //#endregion\n\n //#region ControlValueAccessor and Validator\n /** Sets the value from the form. Accepts a number, a numeric string such as `\"12.5\"`, or `null`. */\n public writeValue(value: unknown): void {\n this.hasTypingError.set(false);\n if (value === null || value === undefined || value === '') {\n this.current.set(null);\n return;\n }\n const number: number = typeof value === 'number' ? value : Number(value);\n this.current.set(Number.isFinite(number) ? number : null);\n }\n\n /** Registers the form's change callback. */\n public registerOnChange(fn: (value: number | null) => void): void {\n this.onChange = fn;\n }\n\n /** Registers the form's touched callback. */\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** Enables or disables the field from the form. */\n public setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\n }\n\n /** Reports `numberInvalid`, `min` and `max`. */\n public validate(_control: AbstractControl): ValidationErrors | null {\n if (this.hasTypingError()) {\n return { numberInvalid: true };\n }\n const value: number | null = this.current();\n if (value === null) {\n return null;\n }\n const min: number | null | undefined = this.min();\n const max: number | null | undefined = this.max();\n if (min !== null && min !== undefined && value < min) {\n return { min: { min, actual: value } };\n }\n if (max !== null && max !== undefined && value > max) {\n return { max: { max, actual: value } };\n }\n return null;\n }\n\n /** Registers the callback that re-runs validation. */\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n //#endregion\n\n //#region Event handlers\n protected onFocus(): void {\n this.hasFocus.set(true);\n this.wasEdited = false;\n this.focused.emit();\n }\n\n protected onBlur(): void {\n // Leaving focus re-derives the text from the value, with separators. Only a value the user\n // typed is rounded: tabbing through a field must not change what the form holds.\n this.hasFocus.set(false);\n const value: number | null = this.current();\n if (this.wasEdited && !this.hasTypingError() && value !== null) {\n this.setValue(this.round(value));\n }\n this.wasEdited = false;\n this.onTouched();\n this.blurred.emit();\n }\n\n protected onTyped(event: Event): void {\n const text: string = (<HTMLInputElement>event.target).value;\n this.wasEdited = true;\n this.inputChanged.emit();\n\n const parsed: number | null = parseLocaleNumber(text, this.locale());\n if (parsed !== null && Number.isNaN(parsed)) {\n const hadValue: boolean = this.current() !== null;\n this.hasTypingError.set(true);\n this.current.set(null);\n if (hadValue) {\n this.onChange(null);\n }\n this.onValidatorChange();\n } else {\n this.setValue(parsed);\n }\n\n // Keep what the user typed on screen while the value follows it.\n this.text.set(text);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.readOnly()) {\n return;\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const direction: number = event.key === 'ArrowUp' ? 1 : -1;\n this.setValue(this.clamp(this.round((this.current() ?? 0) + direction * this.step())));\n return;\n }\n\n // The keypad's decimal key types \".\" on many layouts, whatever the language uses.\n if (event.code === 'NumpadDecimal' || event.key === 'Decimal') {\n event.preventDefault();\n this.insertText(<HTMLInputElement>event.target, getNumberSeparators(this.locale()).decimal);\n }\n }\n //#endregion\n\n //#region Private methods\n private setValue(value: number | null): void {\n const hadTypingError: boolean = this.hasTypingError();\n this.hasTypingError.set(false);\n if (value !== this.current()) {\n this.current.set(value);\n this.onChange(value);\n } else if (hadTypingError) {\n this.onValidatorChange();\n }\n }\n\n private round(value: number): number {\n // Shift by the exponent, not by multiplying: 1.005 * 100 is 100.49999999999999 in binary\n // floating point, so the product rounded 1.005 down to 1 at two decimals.\n const decimals: number = this.maxDecimals();\n const shifted: number = Math.round(Number(`${value}e${decimals}`));\n const rounded = Number(`${shifted}e-${decimals}`);\n return Number.isFinite(rounded) ? rounded : value;\n }\n\n private clamp(value: number): number {\n const min: number | null | undefined = this.min();\n const max: number | null | undefined = this.max();\n if (min !== null && min !== undefined && value < min) {\n return min;\n }\n if (max !== null && max !== undefined && value > max) {\n return max;\n }\n return value;\n }\n\n private insertText(field: HTMLInputElement, text: string): void {\n const start: number = field.selectionStart ?? field.value.length;\n const end: number = field.selectionEnd ?? field.value.length;\n field.setRangeText(text, start, end, 'end');\n field.dispatchEvent(new Event('input', { bubbles: true }));\n }\n //#endregion\n}\n","<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","import { CommonModule, formatDate } from '@angular/common';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n LOCALE_ID,\n model,\n ModelSignal,\n OnInit,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport {\n ControlContainer,\n FormControl,\n FormGroup,\n FormGroupDirective,\n FormGroupName,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport {\n formatDateText,\n formatLocaleNumber,\n formatTimeText,\n parseDigitsInfo,\n parseIsoValue,\n} from '../../helpers/locale-format';\nimport { FormService } from '../../services';\nimport { LocaleService } from '../../services/locale.service';\nimport { BaseComponent } from '../base.component';\nimport { DateInputComponent } from '../date-input/date-input.component';\nimport { NumberInputComponent } from '../number-input/number-input.component';\n\n/**\n * A single form field without a label. It edits a control of the surrounding `[formGroup]` named by\n * `controlName`, or shows `fixedValue` when there is no control. While the form is disabled and\n * the `FormService` is not in edit mode, it shows the value as text instead of an input.\n */\n@Component({\n selector: 'lib-form-input',\n templateUrl: './form-input.component.html',\n styleUrls: ['./form-input.component.scss'],\n imports: [CommonModule, DateInputComponent, FormsModule, NumberInputComponent, ReactiveFormsModule],\n viewProviders: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class.full-height]': 'isFullHeight()',\n // Clears a stray `type` attribute for the same reason as FormInputGroupComponent — see the\n // comment there. Applies when a consumer sets `type` on `lib-form-input` directly.\n '[attr.type]': 'null',\n },\n})\nexport class FormInputComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Accepted for parity with `lib-form-input-group`, but this component's template does not apply it. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Name of the control in the surrounding form group to edit. Leave empty to show `fixedValue` instead. */\n public readonly controlName: InputSignal<string> = input('');\n /** Control whose value is shown in read-only mode instead of `controlName`'s, for example a display name next to an ID. */\n public readonly disabledControlName: InputSignal<string | undefined> = input<string>();\n /** Styles a read-only input like a disabled one. Defaults to `true`. */\n public readonly displayReadOnlyAsDisabled: InputSignal<boolean> = input(true);\n /** Shows the field in its error style. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Disables the input when it shows `fixedValue` (no `controlName`). Has no effect on a form control. Defaults to `true`. */\n public readonly isDisabled: InputSignal<boolean> = input(true);\n /** Lets the field grow to the full height of its container, for example a tall textarea. Defaults to `false`. */\n public readonly isFullHeight: InputSignal<boolean> = input(false);\n /** Maximum number of characters for text inputs and textareas. No limit by default. */\n public readonly maxLength: InputSignal<number | undefined> = input<number>();\n /** Minimum value for a `number` field. No minimum by default. */\n public readonly min: InputSignal<number | undefined> = input<number>();\n /** Makes a control-bound text-like input read-only while it stays focusable. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Visible number of lines for a `textarea` field. */\n public readonly rows: InputSignal<number | undefined> = input<number>();\n /** Increment for a `number` field. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /**\n * Kind of field: `textarea`, `checkbox` (shown as a switch), or any native input type such as\n * `text`, `number`, `date` or `datetime-local`. Defaults to `text`.\n *\n * `date` and `datetime-local` render `lib-date-input`, and `number` renders `lib-number-input`, so\n * dates and numbers show and are typed in the application's language. The control's value keeps\n * the native shape: `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm` or a number.\n */\n public readonly type: InputSignal<string> = input('text');\n\n // Both are written by this component as well as bound by a parent, so they are models rather\n // than inputs: `fixedValue` is two-way bound through ngModel, and `format` is part of the public\n // two-way contract.\n /** Value shown and edited when there is no `controlName`. Supports two-way binding. */\n public readonly fixedValue: ModelSignal<any> = model<any>();\n /**\n * Display format for the read-only value: a `DatePipe` pattern for date types, or a\n * `DecimalPipe` digits string for `number`, such as `1.2-2`. Without it, dates show in the\n * application's language (`05/12/2026` in Portuguese) and numbers with up to three decimals.\n */\n public readonly format: ModelSignal<string | undefined> = model<string>();\n\n // Deliberately NOT named blur/change/input/focus. <lib-form-input> is a real DOM\n // element, so an output sharing a native event name fires the consumer's handler\n // twice for the bubbling events and shadows the native one for the rest.\n /** Emits when the input loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits the native `change` event of a checkbox that shows `fixedValue`. */\n public readonly changed: OutputEmitterRef<any> = output<any>();\n /** Emits the new value when the user edits `fixedValue`. */\n public readonly fixedValueChanged: OutputEmitterRef<string> = output<string>();\n /** Emits when the input gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every native `input` event, that is, each time the user types or toggles. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected readonly formGroupDirective: FormGroupDirective = inject(FormGroupDirective);\n protected readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n protected readonly formService: FormService = inject(FormService);\n private readonly angularLocale: string = inject(LOCALE_ID);\n private readonly localeService: LocaleService = inject(LocaleService);\n\n /**\n * Bumped on every event the form emits -- a status change, a value change, a reset.\n *\n * A FormGroup is not a signal, so the template could not track whether the form is enabled or\n * what a control holds. Angular's own `NgControlStatus` notified this view by accident, but only\n * while an input was on screen and only when that control's own status moved. So the field never\n * turned into an input when a multi-editor enabled its form, and a control kept disabled through\n * an edit stayed an input after the edit was cancelled.\n *\n * A change made with `emitEvent: false` emits nothing, and still reaches no one.\n */\n private readonly formChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n /**\n * Whether the field is an input rather than a read-only value. Both halves are read every time:\n * with `||` the edit-mode signal went untracked whenever the form happened to be enabled.\n */\n protected readonly isEditable: Signal<boolean> = computed(() => {\n this.formChanged();\n const isFormEnabled: boolean = this.formGroupDirective.form?.enabled ?? false;\n const isEditMode: boolean = this.formService.isEditMode;\n return isFormEnabled || isEditMode;\n });\n\n /** What the read-only face shows: the fixed value, or else the control's current value. */\n protected readonly shownValue: Signal<any> = computed(() => {\n this.formChanged();\n return (\n this.fixedValue() ?? this.formGroupDirective.form?.get(this.disabledControlName() ?? this.controlName())?.value\n );\n });\n\n /** The read-only face's text, in the application's language. */\n protected readonly shownText: Signal<string> = computed(() => this.toDisplayText(this.shownValue()));\n\n /** The text of the disabled input that shows `fixedValue`, in the application's language. */\n protected readonly fixedText: Signal<string> = computed(() => this.toDisplayText(this.fixedValue()));\n\n /** Fraction digits for a number field, read from `format`. */\n protected readonly numberDigits: Signal<{ minFractionDigits: number; maxFractionDigits: number }> = computed(\n () => parseDigitsInfo(this.format()) ?? { minFractionDigits: 0, maxFractionDigits: 3 },\n );\n\n protected get formControl(): FormControl<any> | null {\n return this.controlName() ? <FormControl>this.formGroup.get(this.controlName()) : null;\n }\n\n protected get formControlName(): string {\n return [...this.parentGroups, this.controlName()].join('.');\n }\n\n protected get formGroup(): FormGroup {\n let formGroup: FormGroup = this.formGroupDirective.form;\n for (const group of this.parentGroups) {\n formGroup = <FormGroup>formGroup.get(group);\n }\n return formGroup;\n }\n\n protected get isFormControl(): boolean {\n return !!this.controlName() && this.controlName().length > 0;\n }\n\n protected get parentGroups(): string[] {\n return this.formGroupName?.path ?? [];\n }\n\n protected get stepAttributeValue(): number | null {\n if (this.type() === 'number') {\n return this.step();\n }\n return null;\n }\n\n protected get minAttributeValue(): number | null {\n if (this.type() === 'number') {\n return this.min() ?? null;\n }\n return null;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.formGroupDirective.form?.events\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.formChanged.update((count: number) => count + 1));\n\n switch (this.type()) {\n case 'number':\n if (this.formControl) {\n this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n if (value !== null && value === '') {\n this.formControl?.setValue(null);\n }\n });\n }\n break;\n\n case 'date':\n if (this.formControl) {\n this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n if (value !== null) {\n try {\n if (value !== formatDate(value, 'yyyy-MM-dd', 'en')) {\n this.formControl?.setValue(formatDate(value, 'yyyy-MM-dd', 'en'), { emitEvent: false });\n }\n } catch {\n this.formControl?.setValue(null, { emitEvent: false });\n }\n }\n });\n }\n break;\n }\n }\n //#endregion\n\n //#region Event handlers\n protected onBlur(): void {\n this.blurred.emit();\n }\n\n protected onChange(value: any): void {\n this.changed.emit(value);\n }\n\n protected onFocus(): void {\n this.focused.emit();\n }\n\n protected onInput(): void {\n this.inputChanged.emit();\n }\n\n protected onValueChanged(newText: string): void {\n this.fixedValue.set(newText);\n this.fixedValueChanged.emit(newText);\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n /**\n * Formats a value for the read-only face. Dates and numbers follow the application's language\n * (`LocaleService`). An explicit `format` on a date field is still a `DatePipe` pattern; on a\n * number field it is a `DecimalPipe` digits string, applied in the application's language.\n */\n private toDisplayText(value: any): string {\n if (value === null || value === undefined || value === '') {\n return '';\n }\n const locale: string = this.localeService.locale();\n const format: string | undefined = this.format();\n\n switch (this.type()) {\n case 'date':\n case 'datetime-local': {\n const date: Date | null = parseIsoValue(value);\n if (!date) {\n return String(value);\n }\n if (format) {\n return formatDate(date, format, this.angularLocale);\n }\n const day: string = formatDateText(date, locale);\n return this.type() === 'date' ? day : `${day} ${formatTimeText(date, locale)}`;\n }\n case 'number': {\n const number: number = typeof value === 'number' ? value : Number(value);\n return Number.isFinite(number) ? formatLocaleNumber(number, locale, this.numberDigits()) : String(value);\n }\n default:\n return String(value);\n }\n }\n //#endregion\n}\n","@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","import { Component, computed, input, InputSignal, Signal } from '@angular/core';\n\n/** The outline a skeleton stands in for. */\nexport type SkeletonShape = 'text' | 'block' | 'circle';\n\n/**\n * A pulsing placeholder shown while content loads.\n *\n * The skeleton is decorative and hidden from screen readers. Mark the container that is loading\n * with `aria-busy=\"true\"` instead, and clear it when the content arrives.\n *\n * The pulse stops when the user asks for reduced motion.\n */\n@Component({\n selector: 'lib-skeleton',\n templateUrl: './skeleton.component.html',\n styleUrls: ['./skeleton.component.scss'],\n host: {\n class: 'lib-skeleton',\n 'aria-hidden': 'true',\n '[class.shape-text]': \"shape() === 'text'\",\n '[class.shape-block]': \"shape() === 'block'\",\n '[class.shape-circle]': \"shape() === 'circle'\",\n '[style.width]': 'width() ?? null',\n '[style.height]': \"shape() === 'text' ? null : (height() ?? null)\",\n },\n})\nexport class SkeletonComponent {\n //#region Inputs\n /**\n * The outline to draw: `text` for lines of text, `block` for an image or a card, `circle` for an\n * avatar. Defaults to `text`.\n */\n public readonly shape: InputSignal<SkeletonShape> = input<SkeletonShape>('text');\n\n /**\n * Number of text lines. The last one is shorter when there is more than one, as a paragraph's\n * is. Only used by the `text` shape. Defaults to `1`.\n */\n public readonly lines: InputSignal<number> = input(1);\n\n /**\n * Width as a CSS length, e.g. `12rem` or `50%`. Defaults to the full width for `text` and\n * `block`, and to `2.5rem` for `circle`.\n */\n public readonly width: InputSignal<string | undefined> = input<string>();\n\n /**\n * Height as a CSS length. For `text` it is the thickness of each line, `0.625rem` by default.\n * For `block` it defaults to `4rem`; a `circle` is as tall as it is wide.\n */\n public readonly height: InputSignal<string | undefined> = input<string>();\n //#endregion\n\n //#region Properties\n /** One entry per text line, at least one. */\n protected readonly lineIndexes: Signal<number[]> = computed(() =>\n Array.from({ length: Math.max(1, Math.floor(this.lines() || 1)) }, (_: unknown, index: number) => index),\n );\n //#endregion\n}\n","@if (shape() === 'text') {\n @for (line of lineIndexes(); track line) {\n <span class=\"lib-skeleton-line\" [style.height]=\"height() ?? null\"></span>\n }\n}\n","import { KeyValuePipe, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n WritableSignal,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormGroupDirective, FormGroupName, ValidationErrors } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { filter, takeUntil } from 'rxjs';\nimport { FormService } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { FormInputComponent } from '../form-input/form-input.component';\nimport { SkeletonComponent } from '../skeleton/skeleton.component';\n\n/**\n * A labelled form field: a label, a `lib-form-input` (or your own template), its validation\n * messages and optional notes. It shows a placeholder while the field or the form is loading.\n */\n@Component({\n selector: 'lib-form-input-group',\n templateUrl: './form-input-group.component.html',\n styleUrls: ['./form-input-group.component.scss'],\n imports: [FormInputComponent, KeyValuePipe, NgStyle, NgTemplateOutlet, SkeletonComponent, TranslatePipe],\n host: {\n '[class.full-height]': 'isFullHeight()',\n // Angular keeps static attributes in the DOM even when a directive consumes them as an\n // @Input(), so `type=\"checkbox\"` would linger on this host element — where\n // @tailwindcss/forms' tag-agnostic `[type=\"checkbox\"]` base rules style the host itself as\n // a checkbox (1px border, white fill, height:1rem). Clearing the attribute removes the\n // stray box for every type while leaving the `type` @Input() untouched.\n '[attr.type]': 'null',\n },\n})\nexport class FormInputGroupComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Passed to the inner `lib-form-input`, which does not apply it yet. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Vertical alignment of the field in its cell: `start`, `center` or `end`. Defaults to `center`. */\n public readonly alignContent: InputSignal<'center' | 'end' | 'start'> = input<'center' | 'end' | 'start'>('center');\n /** Name of the control in the surrounding form group. Its errors and loading state drive the messages. Required. */\n public readonly controlName: InputSignal<string> = input.required<string>();\n /** Value passed to the inner `lib-form-input` as its `fixedValue`. */\n public readonly fixedValue: InputSignal<any> = input<any>();\n /** Display format passed to the inner `lib-form-input`: a date pattern or a number digits string. */\n public readonly format: InputSignal<string | undefined> = input<string>();\n /** Text of the label, as a translation key. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Passed to the inner `lib-form-input`; disables it only when it shows a fixed value. Defaults to `true`. */\n public readonly isDisabled: InputSignal<boolean> = input(true);\n /** Lets the field grow to the full height of its container. Defaults to `false`. */\n public readonly isFullHeight: InputSignal<boolean> = input(false);\n /** Maximum number of characters for text inputs and textareas. No limit by default. */\n public readonly maxLength: InputSignal<number | undefined> = input<number>();\n /** Minimum value for a `number` field. No minimum by default. */\n public readonly min: InputSignal<number | undefined> = input<number>();\n /** Hint shown in small italics under the field, as a translation key. Defaults to empty. */\n public readonly notes: InputSignal<string> = input('');\n /** Makes the input read-only while it stays focusable. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Visible number of lines for a `textarea` field. */\n public readonly rows: InputSignal<number | undefined> = input<number>();\n /** Shows the label column. When `false`, the field spans the full width. Defaults to `true`. */\n public readonly showLabel: InputSignal<boolean> = input(true);\n /** Increment for a `number` field. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /** Your own template to render in place of the default `lib-form-input`. */\n public readonly template: InputSignal<TemplateRef<any> | undefined> = input<TemplateRef<any>>();\n /** Kind of field, passed to the inner `lib-form-input`, for example `text`, `number`, `date`, `checkbox` or `textarea`. Defaults to `text`. */\n public readonly type: InputSignal<string> = input('text');\n /**\n * Messages per validation error key, as translation keys, for example\n * `{ required: 'Validation-Required' }`. Only errors listed here show a message, once the control is touched.\n */\n public readonly validations: InputSignal<{ [id: string]: string }> = input<{ [id: string]: string }>({});\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected readonly formGroupDirective: FormGroupDirective = inject(FormGroupDirective);\n protected readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n protected formService: FormService = inject(FormService);\n protected readonly loadingField: WritableSignal<boolean> = signal(false);\n\n /**\n * Bumped on every event the control emits -- a value, status or touched change.\n *\n * A FormControl is not a signal, so the template could not track the control's errors or whether\n * it was touched. A change the field made itself redrew it, but one made from outside did not: the\n * server's errors after a save turned the input red and left the message hidden until the user\n * typed again, and a save marking every field as touched showed no required message at all.\n */\n private readonly controlChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n protected readonly errors: Signal<ValidationErrors | null> = computed(() => {\n this.controlChanged();\n return this.formControl?.errors ?? null;\n });\n\n protected readonly isInvalid: Signal<boolean> = computed(() => {\n this.controlChanged();\n return this.formControl?.invalid ?? false;\n });\n\n protected readonly isTouched: Signal<boolean> = computed(() => {\n this.controlChanged();\n return this.formControl?.touched ?? false;\n });\n\n protected get formControl(): FormControl<any> | null {\n return this.controlName() ? <FormControl>this.formGroup.get(this.controlName()) : null;\n }\n\n protected get formGroup(): FormGroup {\n let formGroup: FormGroup = this.formGroupDirective.form;\n for (const group of this.parentGroups) {\n formGroup = <FormGroup>formGroup.get(group);\n }\n return formGroup;\n }\n\n protected get hasNotes(): boolean {\n return !!this.notes() && this.notes().length > 0;\n }\n\n protected get parentGroups(): string[] {\n return this.formGroupName?.path ?? [];\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.formControl?.events\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.controlChanged.update((count: number) => count + 1));\n\n this.formControl?.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loadingField.set(false);\n });\n\n this.formControl?.valueChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loadingField.set(false);\n });\n\n this.formService.fieldRefreshed\n .pipe(\n takeUntil(this.destroy$),\n filter(\n (field: { fieldName?: string; value?: any; loading?: boolean }) => field.fieldName === this.controlName(),\n ),\n )\n .subscribe((field: { fieldName?: string; value?: any; loading?: boolean }) => {\n this.loadingField.set(field.loading ?? false);\n });\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n protected hasValidation(errorKey: string): boolean {\n return Object.keys(this.validations()).indexOf(errorKey) >= 0;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","@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","import { FlexibleConnectedPositionStrategy, Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\n\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n Input,\n InputSignal,\n KeyValueChanges,\n KeyValueDiffer,\n KeyValueDiffers,\n OnDestroy,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormGroupDirective, FormGroupName } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport {\n debounceTime,\n forkJoin,\n Observable,\n of,\n pairwise,\n startWith,\n Subject,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs';\nimport { DisplayControls } from '../../helpers';\nimport { ICatalogEntry, ICatalogResult } from '../../models';\nimport { CatalogService, DataGridDataset } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { FormInputGroupComponent } from '../form-input-group/form-input-group.component';\nimport { FormInputComponent } from '../form-input/form-input.component';\n\n/**\n * A labelled field that picks one entry from a catalog. It works in one of two modes:\n *\n * - **Fixed list.** Pass the entries in `entriesList`, such as the members of an enum or\n * Yes/No/Maybe. No backend call is made. For a short list, set `searchable` to `false` and the\n * field becomes a plain picker.\n * - **Search endpoint.** Set `searchEndpoint`, and the entries are searched on your API as the\n * user types.\n *\n * Either way it writes the chosen value to `controlName` and its text to `displayControlName` in\n * the surrounding form group.\n */\n@Component({\n selector: 'lib-catalog-select',\n templateUrl: './catalog-select.component.html',\n styleUrls: ['./catalog-select.component.scss'],\n imports: [FormInputComponent, FormInputGroupComponent, TranslatePipe],\n})\nexport class CatalogSelectComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {\n //#region HostListeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n const target: HTMLElement = <HTMLElement>event.target;\n if (this.isDropDownShown() && !target.closest('.catalog-container.show')) {\n this.wasClickedOutside = (event.button === 0 && !target.closest('.dropdown-container')) ?? false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.isDropDownShown() && this.wasClickedOutside) {\n this.closeDropdownOverlay();\n this.wasClickedOutside = false;\n }\n }\n //#endregion\n\n //#region ViewChilds, Inputs, Outputs\n private readonly dropdownTemplate: Signal<TemplateRef<any> | undefined> = viewChild('dropdownTemplate', {\n read: TemplateRef,\n });\n private readonly inputElement: Signal<ElementRef<HTMLDivElement> | undefined> = viewChild('input', {\n read: ElementRef,\n });\n\n /** Passed to the inner `lib-form-input`, which does not apply it yet. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Control in the surrounding form group that receives the chosen entry's value. Required. */\n public readonly controlName: InputSignal<string> = input.required<string>();\n /** Control in the surrounding form group that receives the chosen entry's text, which the input shows. Required. */\n public readonly displayControlName: InputSignal<string> = input.required<string>();\n /** Property of each `entriesList` item that holds its text. Defaults to `display`. */\n public readonly displayProperty: InputSignal<string> = input('display');\n /**\n * The entries of the fixed-list mode, used when there is no `searchEndpoint`. No backend call is\n * made for them. Each item's text and value\n * are read from `displayProperty` and `valueProperty`; the text may be an observable, such as\n * a translation. Setting a new list refreshes the dropdown.\n */\n @Input() public set entriesList(\n value: any[] | { key: number; value: Observable<any> | string }[] | null | undefined,\n ) {\n if (this._entriesList !== value) {\n this._entriesList = value;\n if (this.isSubscriptionInitialized) {\n this.entriesDataSource = [];\n this.initializeEntriesDataSource();\n this.refreshSearch();\n }\n }\n }\n /**\n * Extra filters sent to `searchEndpoint` with every search. A changed filter set runs the search\n * again. Defaults to none.\n */\n @Input() public set filters(value: { [id: string]: any }) {\n if (this._filters !== value) {\n this._filters = value;\n this.updateFilters();\n }\n }\n /** Text of the label, as a translation key. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Maximum number of entries requested from `searchEndpoint`. Defaults to `100`. */\n public readonly maxEntries: InputSignal<number> = input(100);\n /**\n * Characters the user must type before a search runs, when the endpoint asks for search\n * criteria. Defaults to `3`.\n */\n public readonly minimumLengthSearch: InputSignal<number> = input(3);\n /** Hint shown in small italics under the field, as a translation key. Defaults to empty. */\n public readonly notes: InputSignal<string> = input('');\n /**\n * Blocks typing, hides the clear button and stops the dropdown opening on focus; a click still\n * opens it. Defaults to `false`.\n */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /**\n * Whether the field accepts typing to narrow the list.\n *\n * A catalog of a handful of entries is a picker, not a search: typing only gets in the way, and\n * the minimum-length rule would hide the very entries the user opened the field to choose from.\n * Turning this off leaves the input read-only to the keyboard while the dropdown still opens on\n * click and the clear button still works -- unlike {@link readOnly}, which means the value\n * cannot be changed at all.\n *\n * It does not suit an endpoint that answers shouldUseCriteria: that endpoint returns nothing\n * until it is given criteria, and there would be no way left to type any.\n */\n public readonly searchable: InputSignal<boolean> = input(true);\n /**\n * URL of the search-endpoint mode. The entries are searched there with a POST of\n * `{ maxResults, criteria, filters }`. When empty, the field uses the fixed `entriesList` and\n * calls no backend. Changing it starts the search over.\n */\n @Input() public set searchEndpoint(value: string | undefined) {\n if (this._searchEndpoint === value) {\n return;\n }\n\n this._searchEndpoint = value;\n\n // A screen that reads the endpoint off a model it loads over HTTP binds an empty string first,\n // and this component initializes against that: no endpoint takes the static-list path, finds an\n // empty list and latches \"no results\". Nothing re-ran the search when the real endpoint landed,\n // so the field stayed empty until the user typed something and cleared it again.\n //\n // Re-initializing rather than merely refreshing, because a different endpoint is a different\n // catalog: what the previous one reported about needing criteria cannot be carried over.\n if (this.isSubscriptionInitialized) {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n }\n /** Messages per validation error key of `controlName`, as translation keys. Defaults to none. */\n public readonly validations: InputSignal<{ [id: string]: string }> = input<{ [id: string]: string }>({});\n /** Property of each `entriesList` item that holds its value. Defaults to `value`. */\n public readonly valueProperty: InputSignal<string> = input('value');\n //#endregion\n\n //#region Variables\n // The three setter inputs below -- entriesList, filters and searchEndpoint -- stay decorator\n // inputs on purpose. They are imperative configuration that re-initialises the search, no\n // template reads them, and converting them would move that side effect into an effect() for\n // no gain in what reaches the screen.\n protected readonly displayedEntries: WritableSignal<ICatalogEntry[]> = signal<ICatalogEntry[]>([]);\n protected readonly focusedIndex: WritableSignal<number> = signal(-1);\n protected readonly isDropDownShown: WritableSignal<boolean> = signal(false);\n protected readonly isFocused: WritableSignal<boolean> = signal(false);\n protected readonly isLoading: WritableSignal<boolean> = signal(false);\n protected readonly selectedValue: WritableSignal<any> = signal(undefined);\n protected readonly shouldUseCriteria: WritableSignal<boolean> = signal(false);\n protected readonly showFailureMessage: WritableSignal<boolean> = signal(false);\n protected readonly showMinimumCharactersMessage: WritableSignal<boolean> = signal(false);\n protected readonly showNoResultsMessage: WritableSignal<boolean> = signal(false);\n\n private static instanceCounter = 0;\n private _entriesList?: any[] | { key: number; value: Observable<any> | string }[] | null;\n private _filters: { [id: string]: any } = {};\n private _searchEndpoint?: string;\n private catalogService: CatalogService = inject(CatalogService);\n private dataGridDataset: DataGridDataset = inject(DataGridDataset, { optional: true })!;\n private entriesDataSource: ICatalogEntry[] = [];\n private filterDiffer?: KeyValueDiffer<string, any>;\n private readonly formGroup: FormGroupDirective = inject(FormGroupDirective);\n private readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n private instanceId: number;\n private isDataInitialized = false;\n private isSubscriptionInitialized = false;\n private keyValueDiffers: KeyValueDiffers = inject(KeyValueDiffers);\n private lastCriteriaUsed: string | null = null;\n private overlay: Overlay = inject(Overlay);\n private overlayRef?: OverlayRef;\n private positionBuilder: OverlayPositionBuilder = inject(OverlayPositionBuilder);\n private searchSubject: Subject<string | null> = new Subject<string | null>();\n private viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n private wasClickedOutside = false;\n //#endregion\n\n //#region Properties\n /** The static entries to choose from. */\n public get entriesList(): any[] | { key: number; value: Observable<any> | string }[] | null | undefined {\n return this._entriesList;\n }\n\n /** The filters sent to `searchEndpoint`. */\n public get filters(): { [id: string]: any } | undefined {\n return this._filters;\n }\n\n /** The URL the entries are searched from. */\n public get searchEndpoint(): string | undefined {\n return this._searchEndpoint;\n }\n\n protected get activeDescendantId(): string | null {\n if (this.focusedIndex() >= 0 && this.focusedIndex() < this.displayedEntries().length) {\n return `catalog-select-${this.instanceId}-option-${this.focusedIndex()}`;\n }\n return null;\n }\n\n protected get displayControl(): FormControl {\n return <FormControl>this.formGroup.form.get(this.formDisplayControlName);\n }\n\n protected get formControl(): FormControl {\n return <FormControl>this.formGroup.form.get(this.formControlName);\n }\n\n protected get formControlName(): string {\n return [...(this.formGroupName?.path ?? []), this.controlName()].join('.');\n }\n\n protected get formDisplayControlName(): string {\n return [...(this.formGroupName?.path ?? []), this.displayControlName()].join('.');\n }\n\n protected get isInvalid(): boolean {\n return this.formControl.invalid;\n }\n\n protected get isTouched(): boolean {\n return this.formControl.touched;\n }\n\n protected get listboxId(): string {\n return `catalog-select-${this.instanceId}-listbox`;\n }\n\n /**\n * Whether the button that empties the field is offered.\n *\n * It asks the form control, not {@link selectedValue}. The latter is only written when this\n * component sees the value arrive -- from a pick in the dropdown, or from the initial sync in\n * ngOnInit. A value patched in afterwards without an event, which is how a saved filter is\n * restored into a form this component has already initialised, reaches the control and the\n * display without ever reaching {@link selectedValue}. Keying the button off it left the field\n * showing a value with no way to remove it.\n */\n protected get showClearButton(): boolean {\n return this.formControl?.value != null && !this.readOnly() && (this.formControl?.enabled ?? false);\n }\n\n private get hasSearchEndpoint(): boolean {\n return !!this.searchEndpoint && this.searchEndpoint.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n this.instanceId = CatalogSelectComponent.instanceCounter++;\n }\n\n public ngAfterViewInit(): void {\n this.setInputAriaAttributes();\n }\n\n public override ngOnDestroy(): void {\n this.closeDropdownOverlay();\n super.ngOnDestroy();\n }\n\n public ngOnInit(): void {\n // Check and add the display control, if it does not exist.\n const wasFormDisabled: boolean = this.formGroup.form.disabled;\n this.checkAndAddDisplayControl();\n if (wasFormDisabled) {\n this.formGroup.form.disable();\n }\n\n // Initialize the entries data source from the entries list, if provided.\n this.initializeEntriesDataSource();\n\n // Initialize the search functionality.\n this.initializeSearch();\n\n // Subscribe to changes in the display control to apply search criteria.\n this.displayControl?.valueChanges\n .pipe(\n takeUntil(this.destroy$),\n tap(() => {\n if (!this.isFocused()) {\n return;\n }\n this.isLoading.set(true);\n this.resetMessages();\n }),\n debounceTime(500),\n startWith(null),\n pairwise(),\n )\n .subscribe(([previous, current]: string[]) => {\n if (!this.isFocused() || previous === current) {\n this.isLoading.set(false);\n return;\n }\n this.applySearchCriteria(current);\n });\n\n this.filterDiffer = this.keyValueDiffers.find(this._filters).create();\n\n // Subscribe to changes in the form control to update the selected value and display control states.\n this.syncFormControlsEnabledDisabled();\n\n this.formControl?.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n this.syncFormControlsEnabledDisabled();\n\n if (!this.shouldRefreshDisplay(value)) {\n return;\n }\n\n this.selectedValue.set(value);\n if (this.hasSearchEndpoint) {\n if (!value) {\n this.displayControl?.reset(null, { emitEvent: false });\n }\n } else {\n this.displayControl?.setValue(this.resolveDisplay(value), { emitEvent: false });\n }\n });\n\n // Initial sync: if the form control already has a value (e.g., the model was loaded\n // before this component initialized), sync the display control immediately.\n this.syncDisplayFromCurrentValue();\n }\n //#endregion\n\n //#region Event handlers\n protected onContainerBlur(): void {\n this.isFocused.set(false);\n }\n\n protected onContainerClick(): void {\n if (\n (!this.isDropDownShown() || this.readOnly()) &&\n (this.formGroup.form?.enabled ?? false) &&\n (this.formGroup.form?.get(this.formControlName)?.enabled ?? false)\n ) {\n this.openDropdownOverlay();\n }\n }\n\n protected onContainerFocus(): void {\n this.isFocused.set(true);\n if (\n !this.isDropDownShown() &&\n !this.readOnly() &&\n (this.formGroup.form?.enabled ?? false) &&\n (this.formGroup.form?.get(this.formControlName)?.enabled ?? false)\n ) {\n this.openDropdownOverlay();\n }\n }\n\n protected onClearClick(event: MouseEvent): void {\n event.stopPropagation();\n\n if (this.formControl) {\n this.formControl.setValue(null);\n this.formControl.markAsDirty();\n this.formControl.markAsTouched();\n }\n\n if (this.displayControl) {\n this.displayControl.setValue('', { emitEvent: false });\n this.displayControl.markAsDirty();\n this.displayControl.markAsTouched();\n }\n\n this.selectedValue.set(null);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.isDropDownShown()) {\n this.openDropdownOverlay();\n }\n if (this.displayedEntries().length > 0) {\n this.focusedIndex.set(Math.min(this.focusedIndex() + 1, this.displayedEntries().length - 1));\n this.scrollFocusedItemIntoView();\n }\n this.updateInputAriaActiveDescendant();\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n if (this.isDropDownShown() && this.displayedEntries().length > 0) {\n this.focusedIndex.set(Math.max(this.focusedIndex() - 1, 0));\n this.scrollFocusedItemIntoView();\n }\n this.updateInputAriaActiveDescendant();\n break;\n\n case 'Enter':\n event.preventDefault();\n if (\n this.isDropDownShown() &&\n this.focusedIndex() >= 0 &&\n this.focusedIndex() < this.displayedEntries().length\n ) {\n this.onDropDownItemClick(this.displayedEntries()[this.focusedIndex()]);\n }\n break;\n\n case 'Escape':\n if (this.isDropDownShown()) {\n event.preventDefault();\n this.closeDropdownOverlay();\n }\n break;\n\n case 'Tab':\n if (this.isDropDownShown()) {\n this.closeDropdownOverlay();\n }\n break;\n }\n }\n\n protected onDropDownErrorClick(): void {\n this.refreshSearch();\n }\n\n protected onDropDownItemClick(entry: ICatalogEntry): void {\n if (this.displayControl) {\n this.displayControl.markAsDirty();\n this.displayControl.markAllAsTouched();\n this.displayControl.setValue(entry.display, { emitEvent: false });\n }\n\n if (this.formControl) {\n this.formControl.markAsDirty();\n this.formControl.markAsTouched();\n this.formControl.setValue(entry.value);\n }\n\n this.closeDropdownOverlay();\n }\n\n //#endregion\n\n //#region Public methods\n protected getOptionId(index: number): string {\n return `catalog-select-${this.instanceId}-option-${index}`;\n }\n\n /**\n * Re-reads the catalog from its endpoint.\n *\n * The entries are fetched once, when the field initializes, so a screen that changes the data\n * behind the catalog -- granting a role, moving an employee, anything that alters what the\n * endpoint would now answer -- otherwise keeps offering the list it read before the change.\n *\n * It re-reads rather than merely re-runs the last request, because the number of entries may\n * have crossed the threshold that decides whether the endpoint requires search criteria.\n */\n public refresh(): void {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n //#endregion\n\n //#region Private methods\n private applySearchCriteria(criteria: string | null): void {\n this.isLoading.set(true);\n this.resetMessages();\n\n this.searchSubject.next(criteria);\n }\n\n private checkAndAddDisplayControl(): void {\n let parent: FormGroup = this.formGroup.form;\n const controlNames: string[] = this.formDisplayControlName.split('.');\n\n controlNames.forEach((name, index) => {\n if (index < controlNames.length - 1) {\n parent = <FormGroup>parent.get(name);\n } else {\n if (!parent.get(name)) {\n parent.addControl(name, new FormControl(''));\n }\n\n // Marked whether this component created it or the screen declared it: what makes a control\n // a display control is being driven as one, not who wrote it down. A filters form reads the\n // mark to keep it out of what it submits.\n DisplayControls.markAsDisplayControl(parent.get(name));\n }\n });\n }\n\n private closeDropdownOverlay(): void {\n this.isDropDownShown.set(false);\n this.focusedIndex.set(-1);\n this.updateInputAriaActiveDescendant();\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n }\n\n private initializeEntriesDataSource(): void {\n if (this.hasSearchEndpoint || !this._entriesList || this._entriesList.length === 0) {\n return;\n }\n\n const observables: Observable<string>[] = [];\n\n this._entriesList.forEach((entry: any | { key: number; value: Observable<any> }) => {\n const value: number = entry[this.valueProperty()];\n const display: string | Observable<any> = entry[this.displayProperty()];\n\n if (display instanceof Observable) {\n this.entriesDataSource.push({ value: value, display: 'Loading...' });\n\n observables.push(\n display.pipe(\n take(1),\n tap((v) => {\n this.entriesDataSource.filter((x) => x.value === value)[0].display = v;\n if (this.selectedValue() === value) {\n this.displayControl.setValue(v);\n }\n }),\n ),\n );\n } else {\n this.entriesDataSource.push({ value, display });\n }\n });\n\n // Subscribed only to run the requests; the emitted values are not needed here.\n forkJoin(observables).pipe(take(1)).subscribe();\n }\n\n private initializeSearch(): void {\n this.searchSubject\n .pipe(\n takeUntil(this.destroy$),\n switchMap((criteria: string | null) => {\n this.lastCriteriaUsed = criteria;\n\n if (!this.hasSearchEndpoint) {\n if (this.entriesDataSource.length === 0) {\n return of(null).pipe(take(1));\n }\n return of(\n this.entriesDataSource.filter(\n (entry: ICatalogEntry) => entry.display.toLowerCase().indexOf(criteria?.toLowerCase() ?? '') > -1,\n ),\n ).pipe(take(1));\n }\n\n this.updateMinimumCharactersMessageVisibility(criteria ?? '');\n if (this.showMinimumCharactersMessage()) {\n return of(null).pipe(take(1));\n }\n\n return this.catalogService\n .search(this.searchEndpoint!, this.maxEntries(), criteria ?? '', this.filters)\n .pipe(take(1));\n }),\n )\n .subscribe({\n next: (result: ICatalogResult | any[] | null | undefined) => {\n this.isLoading.set(false);\n this.displayedEntries.set([]);\n\n if (Array.isArray(result) && result.length > 0) {\n this.displayedEntries.set(result);\n } else if (result?.entries && Array.isArray(result.entries)) {\n const catalogResult: ICatalogResult = result as ICatalogResult;\n if (!catalogResult) {\n return;\n }\n\n this.displayedEntries.set(catalogResult.entries);\n\n if (!this.isDataInitialized) {\n // The shouldUseCriteria is only set from the initialization.\n this.isDataInitialized = true;\n this.shouldUseCriteria.set(catalogResult.shouldUseCriteria ?? false);\n this.showMinimumCharactersMessage.set(this.searchable() && this.displayedEntries().length === 0);\n }\n }\n\n // Try to filter out already loaded rows from the data grid dataset.\n if (this.displayedEntries().length > 0 && this.dataGridDataset) {\n this.displayedEntries.set(this.tryFilterFromDataset(this.displayedEntries()));\n }\n\n if (!this.showMinimumCharactersMessage() && this.displayedEntries().length === 0) {\n this.showNoResultsMessage.set(true);\n }\n },\n error: (_: any) => {\n this.isLoading.set(false);\n this.displayedEntries.set([]);\n this.showFailureMessage.set(true);\n\n // Set a new subscription to allow retrying the search later.\n this.initializeSearch();\n },\n });\n\n if (!this.isSubscriptionInitialized) {\n this.isSubscriptionInitialized = true;\n this.applySearchCriteria(null);\n }\n }\n\n private openDropdownOverlay(): void {\n // Defensive cleanup of any stale overlay before creating a new one.\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n\n const positionStrategy: FlexibleConnectedPositionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.inputElement()!)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: false,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n\n // Set overlay width to match input field\n const inputRect: DOMRect = this.inputElement()!.nativeElement.getBoundingClientRect();\n this.overlayRef.updateSize({ width: inputRect.width });\n\n const portal: TemplatePortal = new TemplatePortal(this.dropdownTemplate()!, this.viewContainerRef);\n this.overlayRef.attach(portal);\n this.isDropDownShown.set(true);\n this.focusedIndex.set(\n this.selectedValue() != null\n ? this.displayedEntries().findIndex((entry: ICatalogEntry) => entry.value === this.selectedValue())\n : -1,\n );\n this.updateInputAriaActiveDescendant();\n\n // Re-evaluate minimum characters message visibility when opening the dropdown,\n // in case it was incorrectly reset by a programmatic value change.\n if (this.shouldUseCriteria() && !this.isLoading()) {\n this.updateMinimumCharactersMessageVisibility(this.displayControl?.value ?? '');\n }\n\n // Scroll the selected item into view after the overlay renders.\n if (this.focusedIndex() >= 0) {\n requestAnimationFrame(() => this.scrollFocusedItemIntoView());\n }\n }\n\n private refreshSearch(reInitialize = false): void {\n if (reInitialize) {\n // Both are written together when a catalog first answers, so both have to go together.\n // Leaving shouldUseCriteria behind let the previous catalog gate the new one: the\n // minimum-length check short-circuited the very request that would have corrected it.\n this.isDataInitialized = false;\n this.shouldUseCriteria.set(false);\n }\n\n this.applySearchCriteria(this.lastCriteriaUsed);\n }\n\n private resetMessages(): void {\n this.showFailureMessage.set(false);\n this.showNoResultsMessage.set(false);\n this.showMinimumCharactersMessage.set(false);\n }\n\n private resolveDisplay(value: any): string {\n return this.entriesDataSource.filter((entry: ICatalogEntry) => entry.value === value)[0]?.display ?? '';\n }\n\n private syncDisplayFromCurrentValue(): void {\n const currentValue: any = this.formControl?.value;\n if (currentValue == null || !this.shouldRefreshDisplay(currentValue)) {\n return;\n }\n\n this.selectedValue.set(currentValue);\n if (!this.hasSearchEndpoint) {\n this.displayControl?.setValue(this.resolveDisplay(currentValue), { emitEvent: false });\n }\n }\n\n /**\n * Decides whether the display control has to be written again.\n *\n * The value on its own is not enough. Resetting a form clears the display control and then\n * patches the same value back, so an unchanged value can still leave the display empty. That\n * only happens when the stored value equals the control's initial value, which is why it used\n * to show up on the default entry alone.\n */\n private shouldRefreshDisplay(value: any): boolean {\n if (this.selectedValue() !== value) {\n return true;\n }\n\n if (this.hasSearchEndpoint) {\n return false;\n }\n\n const display: string = this.resolveDisplay(value);\n return display.length > 0 && this.displayControl?.value !== display;\n }\n\n private syncFormControlsEnabledDisabled(): void {\n if (this.formControl.enabled !== this.displayControl.enabled) {\n if (this.formControl.disabled) {\n this.displayControl.disable({ emitEvent: false });\n } else {\n this.displayControl.enable({ emitEvent: false });\n }\n }\n }\n\n private tryFilterFromDataset(results: ICatalogEntry[]): ICatalogEntry[] {\n if (\n this.dataGridDataset &&\n this.controlName() === this.dataGridDataset?.keyProperty &&\n this.dataGridDataset.hasLoadedRows\n ) {\n // If the control name is matching the ID property of the data grid dataset, filter out the loaded rows to remove duplicated IDs.\n const loadedIDs: any[] = this.dataGridDataset.loadedKeys!.map((key: string) =>\n this.dataGridDataset.getRowID(key),\n );\n return results.filter((result: ICatalogEntry) => loadedIDs.indexOf(result.value) < 0);\n }\n return results;\n }\n\n private updateFilters(): void {\n if (!this.filterDiffer || !this.filters) {\n return;\n }\n\n const changes: KeyValueChanges<string, any> | null = this.filterDiffer.diff(this.filters);\n if (changes) {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n }\n\n private updateMinimumCharactersMessageVisibility(criteria: string): void {\n this.showMinimumCharactersMessage.set(\n this.searchable() &&\n this.shouldUseCriteria() &&\n this.minimumLengthSearch() > 0 &&\n (criteria?.length ?? 0) < this.minimumLengthSearch(),\n );\n }\n\n private getNativeInput(): HTMLInputElement | null {\n return this.inputElement()?.nativeElement?.querySelector('input') ?? null;\n }\n\n private scrollFocusedItemIntoView(): void {\n if (!this.overlayRef || this.focusedIndex() < 0) {\n return;\n }\n const optionId: string = this.getOptionId(this.focusedIndex());\n const element: HTMLElement | null = this.overlayRef.overlayElement.querySelector('#' + optionId);\n if (element) {\n element.scrollIntoView({ block: 'nearest' });\n }\n }\n\n private setInputAriaAttributes(): void {\n const input: HTMLInputElement | null = this.getNativeInput();\n if (!input) {\n return;\n }\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-expanded', String(this.isDropDownShown()));\n input.setAttribute('aria-haspopup', 'listbox');\n input.setAttribute('aria-owns', this.listboxId);\n }\n\n private updateInputAriaActiveDescendant(): void {\n const input: HTMLInputElement | null = this.getNativeInput();\n if (!input) {\n return;\n }\n input.setAttribute('aria-expanded', String(this.isDropDownShown()));\n const descendantId: string | null = this.activeDescendantId;\n if (descendantId) {\n input.setAttribute('aria-activedescendant', descendantId);\n } else {\n input.removeAttribute('aria-activedescendant');\n }\n }\n //#endregion\n}\n","<lib-form-input-group\n [controlName]=\"controlName()\"\n [label]=\"label()\"\n [notes]=\"notes()\"\n [template]=\"template\"\n [validations]=\"validations()\"\n>\n</lib-form-input-group>\n\n<ng-template #template>\n <div class=\"catalog-container\" [class.show]=\"isDropDownShown()\">\n <lib-form-input\n #input\n [class.fixed-content]=\"readOnly() && !shouldUseCriteria()\"\n [autofocus]=\"autofocus()\"\n [controlName]=\"displayControlName()\"\n [displayReadOnlyAsDisabled]=\"readOnly()\"\n [invalid]=\"isInvalid && isTouched\"\n [readOnly]=\"readOnly() || !searchable()\"\n (blurred)=\"onContainerBlur()\"\n (click)=\"onContainerClick()\"\n (focused)=\"onContainerFocus()\"\n (keydown)=\"onKeyDown($event)\"\n >\n </lib-form-input>\n @if (showClearButton) {\n <button class=\"clear-button\" type=\"button\" tabindex=\"-1\" (click)=\"onClearClick($event)\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <div class=\"dropdown-container\">\n <ul class=\"dropdown\" role=\"listbox\" [attr.id]=\"listboxId\">\n <!-- Status rows are not options: role=\"presentation\" keeps them out of the\n listbox's option set, and they carry no click handler. The dropdown already\n closes on Escape, on blur and on an outside click. -->\n @if (isLoading()) {\n <li role=\"presentation\" aria-live=\"polite\">\n {{ 'CatalogSelect-Loading' | translate }}\n </li>\n }\n @if (shouldUseCriteria() && showMinimumCharactersMessage()) {\n <li\n role=\"presentation\"\n aria-live=\"polite\"\n title=\"{{ 'CatalogSelect-MinimumLengthSearch' | translate: { minimumLengthSearch: minimumLengthSearch() } }}\"\n >\n {{ 'CatalogSelect-MinimumLengthSearch' | translate: { minimumLengthSearch: minimumLengthSearch() } }}\n </li>\n }\n @if (showNoResultsMessage()) {\n <li role=\"presentation\" aria-live=\"polite\" title=\"{{ 'CatalogSelect-NoResultsFound' | translate }}\">\n {{ 'CatalogSelect-NoResultsFound' | translate }}\n </li>\n }\n\n <!-- Retrying is a real action, so it is a real button and reachable by keyboard. -->\n @if (showFailureMessage()) {\n <li class=\"error\" role=\"presentation\">\n <button\n class=\"retry\"\n type=\"button\"\n title=\"{{ 'CatalogSelect-FailureMessage' | translate }}\"\n (click)=\"onDropDownErrorClick()\"\n >\n {{ 'CatalogSelect-FailureMessage' | translate }}\n </button>\n </li>\n }\n\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus --\n Options in a combobox listbox are deliberately not focusable. Keyboard\n interaction lives on the input, which owns ArrowUp/ArrowDown/Enter/Escape and\n points at the active option through aria-activedescendant. Giving each option\n its own tabindex and key handlers would break that pattern. -->\n @for (entry of displayedEntries(); track entry; let i = $index) {\n <li\n class=\"dropdown-item\"\n role=\"option\"\n [attr.id]=\"getOptionId(i)\"\n [attr.aria-selected]=\"selectedValue() === entry.value\"\n [class.focused]=\"focusedIndex() === i\"\n [class.selected]=\"selectedValue() === entry.value\"\n (click)=\"onDropDownItemClick(entry)\"\n >\n {{ entry.display }}\n </li>\n }\n <!-- eslint-enable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n </ul>\n </div>\n</ng-template>\n","import { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n input,\n Input,\n InputSignal,\n OnInit,\n Output,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { NgxResizeObserverModule } from 'ngx-resize-observer';\nimport { takeUntil } from 'rxjs';\nimport { IGridColumn } from '../../models';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { BaseComponent } from '../base.component';\n\n/**\n * One row of `lib-data-grid`. Renders a cell per dataset column, using the column's template when\n * it has one, plus a selection checkbox when the grid allows multiple selection.\n */\n@Component({\n selector: 'lib-data-grid-row',\n templateUrl: './data-grid-row.component.html',\n host: {\n '[class.focused]': 'dataGridDataset.focusedRowKey === rowData',\n '[class.selected]': 'dataGridDataset.isKeySelected(rowKey)',\n '[class.striped]': 'rowIndex() % 2 === 1',\n },\n styleUrls: ['./data-grid-row.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, NgClass, NgTemplateOutlet, NgxResizeObserverModule],\n})\nexport class DataGridRowComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Disables the row, so clicking it neither focuses nor selects it. Defaults to `false`. */\n @Input() public disabled = false;\n /** Marks the first rendered row, which measures the column widths for the header. Defaults to `false`. */\n @Input() public isFirstRow = false;\n /** The record this row shows. Setting it refreshes the row's selected state. */\n @Input() public set rowData(value: any) {\n this._rowData = value;\n this.refreshSelection();\n }\n\n /**\n * The row's index in the data, which is what the zebra stripe follows. Its position among the\n * rendered rows would not do: the virtual scroll renders a moving window, and a stripe keyed on\n * the DOM swapped on every row whenever that window moved by an odd number of rows.\n */\n public readonly rowIndex: InputSignal<number> = input(0);\n\n /** Emits the width in pixels of the selection checkbox cell whenever it changes. */\n @Output() public selectionResized: EventEmitter<number> = new EventEmitter<number>();\n //#endregion\n\n //#region Host listeners\n /**\n * Makes this row the dataset's focused row. In a multi-select grid that selects on click, it\n * also syncs the checkbox. Runs on a click on the row; does nothing while disabled.\n */\n @HostListener('click')\n public setFocus(): void {\n if (!this.disabled) {\n this.dataGridDataset.setFocusedRow(this.rowKey);\n\n if (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) {\n this.selected.set(this.isRowDataSelected);\n }\n }\n }\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n\n // A signal rather than a field: the grid announces a selection change from a subscription,\n // and the checkbox below is bound to this. It used to be a plain field refreshed by calling\n // detectChanges() on this component -- which renders, but renders because it was forced\n // rather than because anything was notified. See docs/guides/reactivity.md.\n protected readonly selected: WritableSignal<boolean> = signal(false);\n\n private _rowData!: any;\n private elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n //#endregion\n\n //#region Properties\n /** The record this row shows. */\n public get rowData(): any {\n return this._rowData;\n }\n\n protected get columns(): IGridColumn[] {\n return this.dataGridDataset.columns;\n }\n\n private get isLaidOut(): boolean {\n return (this.elementRef.nativeElement?.getBoundingClientRect().width ?? 0) > 0;\n }\n\n private get isRowDataSelected(): boolean {\n return this.dataGridDataset.isKeySelected(this.rowKey);\n }\n\n protected get rowKey(): string {\n return this.dataGridDataset.getRowInternalKey(this.rowData);\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.selected.set(this.isRowDataSelected);\n\n this.dataGridDataset.selectedRowsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe((selectionChanges: { [id: string]: { rowData: any; selected: boolean } }) => {\n if (this.rowKey in selectionChanges) {\n this.selected.set(selectionChanges[this.rowKey].selected);\n }\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onResize(colIndex: number, event: ResizeObserverEntry): void {\n const width: number = event.contentRect.width;\n\n // A zero means one of two very different things. Before the grid is laid out every column\n // reports zero, and taking that at face value would pin every heading at zero. Once the row\n // itself has a width the layout is live, and a zero is then the real thing: a 1fr column\n // collapsed for want of room, whose heading has to collapse with it or every column to its\n // right sits under the wrong one. Asking the row -- rather than remembering whether this\n // column once measured something -- also covers a column that is born collapsed and never\n // measures anything else.\n if (width <= 0 && !this.isLaidOut) {\n return;\n }\n\n // Reported on every change, not just the first. The body lays the columns out as a CSS grid of\n // minmax(x, min-content), so a column is only as wide as the content currently rendered --\n // which virtual scrolling keeps changing. Measuring once and latching left the header copying\n // a width the body no longer had, and with many columns that drift accumulated into cells\n // sitting under the wrong heading.\n if (this.columns[colIndex].realSize !== width) {\n this.columns[colIndex].realSize = width;\n }\n }\n\n protected onResizeSelection(event: ResizeObserverEntry): void {\n const width: number = event.contentRect.width;\n this.selectionResized.emit(width);\n }\n\n protected onToggleSelection(): void {\n if (\n this.disabled ||\n (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true))\n ) {\n return;\n }\n\n this.selected.update((isSelected: boolean) => !isSelected);\n\n if (this.selected()) {\n this.dataGridDataset.selectRow(this.rowKey);\n } else {\n this.dataGridDataset.deselectRow(this.rowKey);\n }\n }\n //#endregion\n\n //#region Public methods\n protected getValue(field: string): any {\n // A null step in a dot path, such as `customer.name` with no customer, shows an empty cell\n // rather than throwing and breaking the row.\n return field.split('.').reduce((value: any, field: string) => value?.[field], this.rowData);\n }\n //#endregion\n\n //#region Private methods\n private refreshSelection(): void {\n this.selected.set(this.isRowDataSelected);\n }\n //#endregion\n}\n","<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div #cell class=\"cell\" [class.disabled]=\"disabled\" [ngClass]=\"column.customClass\">\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<ng-template #simpleTemplate let-rowData=\"rowData\" let-column=\"column\">\n <span>{{ getValue(column.field) }}</span>\n</ng-template>\n","import { ListRange } from '@angular/cdk/collections';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { NgStyle } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n inject,\n input,\n InputSignal,\n NgZone,\n OnDestroy,\n OnInit,\n Signal,\n signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { debounceTime, filter, fromEvent, Subject, takeUntil } from 'rxjs';\nimport { IGridColumn } from '../../models';\nimport { DataGridConfigs } from '../../models/configs';\nimport { DataGridDataset } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { DataGridRowComponent } from '../data-grid-row/data-grid-row.component';\n\n/**\n * A virtual-scrolling grid driven by the `DataGridDataset` provided around it. The dataset holds\n * the columns, rows, paging and selection; the grid renders them, loads the next page as the user\n * scrolls, and shows loading, empty and error messages.\n */\n@Component({\n selector: 'lib-data-grid',\n templateUrl: './data-grid.component.html',\n styleUrls: ['./data-grid.component.scss'],\n host: {\n '[class.no-borders]': 'showButtons()',\n '[class.hide-borders]': 'configs.hideBorders === true',\n },\n imports: [DataGridRowComponent, NgStyle, ScrollingModule, TranslatePipe],\n})\nexport class DataGridComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n private readonly bodyElement: Signal<ElementRef<HTMLDivElement> | undefined> =\n viewChild<ElementRef<HTMLDivElement>>('body');\n private readonly viewport: Signal<CdkVirtualScrollViewport | undefined> = viewChild(CdkVirtualScrollViewport);\n\n /** Disables the rows, so they cannot be focused or selected. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n /**\n * When `true`, the grid does not load rows on init and shows a prompt until something else\n * loads the dataset, such as a search. Defaults to `false`.\n */\n public readonly lazyLoadRows: InputSignal<boolean> = input(false);\n /**\n * Shows a bar above the header for content projected with the `buttons` attribute, and drops\n * the grid's borders. Defaults to `false`.\n */\n public readonly showButtons: InputSignal<boolean> = input(false);\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly headerRightMargin: WritableSignal<number> = signal(0);\n protected readonly headerScrollLeft: WritableSignal<number> = signal(0);\n protected readonly loading: WritableSignal<boolean> = signal(false);\n\n private bodyResized$: Subject<void> = new Subject<void>();\n private bodyResizeObserver?: ResizeObserver;\n private gridRoute = '';\n private isGridCurrentUrl = false;\n private lastPosition = 0;\n private ngZone: NgZone = inject(NgZone);\n private router: Router = inject(Router);\n private selectionColRealSize?: number;\n //#endregion\n\n //#region Properties\n protected get bodyMinHeight(): number {\n let rowsToDisplay: number = this.configs.rowsToDisplay ?? 3;\n\n let rowsCount: number = this.dataGridDataset.loadedRows?.length ?? 0;\n if (rowsCount === 0) {\n rowsCount = 1;\n }\n\n if (rowsCount < rowsToDisplay) {\n rowsToDisplay = rowsCount;\n }\n\n return rowsToDisplay * this.configs.rowHeight;\n }\n\n protected get columns(): IGridColumn[] {\n return this.dataGridDataset.columns;\n }\n\n protected get configs(): DataGridConfigs {\n return this.dataGridDataset.configs;\n }\n\n protected get gridColumns(): string {\n return this.dataGridDataset.columnsSize;\n }\n\n protected get hasBeenLoaded(): boolean {\n return this.dataGridDataset.hasBeenLoaded;\n }\n\n protected get hasLoadedRows(): boolean {\n return (this.dataGridDataset.loadedRows?.length ?? 0) > 0;\n }\n\n protected get hasMessageToDisplayWhenEmpty(): boolean {\n return this.messageToDisplayWhenEmpty.length > 0;\n }\n\n protected get isHideColumns(): boolean {\n return this.dataGridDataset.configs.hideColumnHeaders ?? false;\n }\n\n protected get isShowMultiSelect(): boolean {\n return this.dataGridDataset.configs.multiSelect ?? false;\n }\n\n protected get messageToDisplayWhenEmpty(): string {\n return this.dataGridDataset?.configs?.messageOnEmpty ?? '';\n }\n\n protected get messageToDisplayWhenLazyLoad(): string {\n return this.dataGridDataset?.configs?.messageOnLazyLoad ?? '';\n }\n\n protected get messageToDisplayWhenFailed(): string {\n return this.dataGridDataset?.configs?.messageOnFailed ?? '';\n }\n\n protected get selectionColWidth(): string {\n return this.selectionColRealSize\n ? `${this.selectionColRealSize}px`\n : (this.configs.multiSelectSize ?? 'min-content');\n }\n\n protected get shouldDisplayMessageWhenEmpty(): boolean {\n return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;\n }\n\n /**\n * Whether the grid is in the document, which it is not while the route-reuse strategy holds its\n * view detached -- the list a tab keeps in its history while the user is on a record.\n *\n * Nothing may measure the CDK viewport then. The body leaving the document is itself a resize,\n * to nothing, and measuring makes the viewport work out its rendered range from a scroll offset\n * of 0 and write that out while detached, which leaves its own change-detection flag stuck until\n * the view renders again. Reattached and scrolled back, the viewport then computes the right\n * range but cannot write the content offset out: the rows are rendered, translated to the top,\n * and the viewport shows the place the user had scrolled to -- an empty list. Coming back is a\n * resize as well, from nothing to the panel, so the measurement still happens, on the way in.\n */\n private get isBodyAttached(): boolean {\n return this.bodyElement()?.nativeElement?.isConnected ?? false;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.gridRoute = this.router.url;\n this.isGridCurrentUrl = true;\n\n this.router.events\n .pipe(\n takeUntil(this.destroy$),\n filter((events: any) => events instanceof NavigationStart || events instanceof NavigationEnd),\n )\n .subscribe((event: NavigationStart | NavigationEnd) => {\n if (event instanceof NavigationStart && this.isGridCurrentUrl) {\n this.lastPosition = this.viewport()?.measureScrollOffset() ?? 0;\n this.isGridCurrentUrl = false;\n } else if (event instanceof NavigationEnd && event.url === this.gridRoute) {\n this.viewport()?.scrollTo({ top: this.lastPosition });\n this.viewport()?.checkViewportSize();\n this.isGridCurrentUrl = true;\n }\n });\n\n this.dataGridDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loading.set(true);\n });\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe((isSuccess: boolean) => {\n this.loading.set(false);\n this.hasFailed.set(!isSuccess);\n\n setTimeout(() => {\n const viewportWidth: number = this.viewport()?.measureViewportSize('horizontal') ?? 0;\n if (viewportWidth > 0) {\n this.headerRightMargin.set(this.bodyElement()!.nativeElement.clientWidth - viewportWidth);\n }\n }, 100);\n\n // A load can finish after the user has left the list -- a record opened while the next page\n // was still coming in -- and a detached grid must not be measured. See isBodyAttached.\n setTimeout(() => {\n if (this.isBodyAttached) {\n this.viewport()?.checkViewportSize();\n }\n });\n });\n\n if (!this.lazyLoadRows()) {\n if (!this.dataGridDataset.loadedRows) {\n this.loading.set(true);\n }\n this.dataGridDataset.loadRows();\n } else if (this.dataGridDataset.isLoading) {\n this.loading.set(true);\n }\n }\n\n public ngAfterViewInit(): void {\n // The rows scroll sideways inside the CDK viewport while the header sits outside it, so the\n // header has to be moved by hand or the headings stay behind as the cells travel. Read outside\n // Angular and written back inside it, because this fires for every frame of a scroll.\n const viewportElement: HTMLElement | undefined = this.viewport()?.elementRef?.nativeElement;\n\n if (viewportElement) {\n this.ngZone.runOutsideAngular(() => {\n fromEvent(viewportElement, 'scroll')\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n const scrollLeft: number = viewportElement.scrollLeft;\n if (this.headerScrollLeft() === scrollLeft) {\n return;\n }\n\n this.headerScrollLeft.set(scrollLeft);\n });\n });\n }\n\n this.viewport()\n ?.renderedRangeStream.pipe(takeUntil(this.destroy$))\n .subscribe((listRange: ListRange) => {\n const loadedRows: number = this.dataGridDataset.loadedRows?.length ?? 0;\n if (\n this.hasLoadedRows &&\n !this.loading() &&\n listRange.end >= loadedRows &&\n !this.dataGridDataset.loadedLastRow\n ) {\n this.loading.set(true);\n this.dataGridDataset.loadRows();\n }\n });\n\n this.bodyResized$.pipe(debounceTime(150), takeUntil(this.destroy$)).subscribe(() => {\n // Leaving the document is a resize too. A detached grid has nothing to measure, and measuring\n // it is what left the list empty when it came back; see isBodyAttached.\n if (!this.isBodyAttached) {\n return;\n }\n\n const viewportWidth: number = this.viewport()?.measureViewportSize('horizontal') ?? 0;\n if (viewportWidth > 0) {\n this.headerRightMargin.set(this.bodyElement()!.nativeElement.clientWidth - viewportWidth);\n }\n this.viewport()?.checkViewportSize();\n this.syncHeaderScroll();\n });\n\n this.ngZone.runOutsideAngular(() => {\n this.bodyResizeObserver = new ResizeObserver(() => {\n this.bodyResized$.next();\n });\n this.bodyResizeObserver.observe(this.bodyElement()!.nativeElement);\n });\n }\n\n public override ngOnDestroy(): void {\n this.bodyResizeObserver?.disconnect();\n super.ngOnDestroy();\n }\n //#endregion\n\n //#region Event handlers\n protected onSelectionResized(newSize: number): void {\n if (this.selectionColRealSize != newSize) {\n this.selectionColRealSize = newSize;\n }\n }\n //#endregion\n\n //#region Public methods\n protected isFirstVisibleRow(rowIndex: number): boolean {\n const renderedRange: ListRange | undefined = this.viewport()?.getRenderedRange();\n if (renderedRange) {\n return rowIndex === renderedRange.start;\n }\n return false;\n }\n //#endregion\n\n //#region Private methods\n private syncHeaderScroll(): void {\n // Re-inserting the viewport into the DOM -- which is what re-activating a detached tab does --\n // puts its scroll position back to zero without firing a scroll event, so nothing tells the\n // header to come back with it and the headings sit at an offset the body no longer has.\n const scrollLeft: number = this.viewport()?.elementRef?.nativeElement?.scrollLeft ?? 0;\n\n if (this.headerScrollLeft() !== scrollLeft) {\n this.headerScrollLeft.set(scrollLeft);\n }\n }\n\n protected trackByFn(index: number, item: any): number {\n return item.key;\n }\n //#endregion\n}\n","@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n/**\n * Groups related form fields under an optional heading. Project the fields as content.\n */\n@Component({\n selector: 'lib-form-group',\n templateUrl: './form-group.component.html',\n styleUrls: ['./form-group.component.scss'],\n imports: [TranslatePipe],\n host: {\n '[class.expand]': 'shouldExpand',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormGroupComponent {\n //#region ViewChilds, Inputs, Outputs\n /** Adds the `expand` class to the host so the group grows to fill the available space. Defaults to `false`. */\n @Input() public shouldExpand = false;\n /** Heading shown above the fields, as a translation key. No heading is shown when empty. */\n @Input() public label!: string;\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n protected get hasTitle(): boolean {\n return !!this.label;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","@if (hasTitle) {\n <h3 class=\"title\">\n {{ label | translate }}\n </h3>\n}\n\n<div class=\"content\" [class.has-title]=\"hasTitle\">\n <ng-content></ng-content>\n</div>\n","import { NgStyle } from '@angular/common';\nimport { Component, ElementRef, input, InputSignal, Signal, signal, viewChild, WritableSignal } from '@angular/core';\n\n/**\n * A titled section whose content the user can collapse and expand by clicking the title or\n * pressing Enter or Space on it. Starts expanded.\n */\n@Component({\n selector: 'lib-group-accordion',\n templateUrl: './group-accordion.component.html',\n styleUrls: ['./group-accordion.component.scss'],\n host: { '[class.collapsed]': 'collapsed()' },\n imports: [NgStyle],\n})\nexport class GroupAccordionComponent {\n //#region ViewChilds, Inputs, Outputs\n private readonly containerElementRef: Signal<ElementRef<HTMLDivElement> | undefined> =\n viewChild<ElementRef<HTMLDivElement>>('container');\n\n /** Title of the section, shown as given. Required. */\n public readonly label: InputSignal<string> = input.required<string>();\n //#endregion\n\n //#region Variables\n private readonly _maxHeight: WritableSignal<number> = signal(-1);\n protected readonly collapsed: WritableSignal<boolean> = signal(false);\n //#endregion\n\n //#region Properties\n /** Height in pixels pinned on the content during the collapse animation, or `-1` when none is set. */\n public readonly maxHeight: Signal<number> = this._maxHeight.asReadonly();\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n protected onToggle(): void {\n // Before collapsing, we set the max height style for the closing effect.\n if (!this.collapsed()) {\n this.setMaxHeight();\n }\n\n setTimeout(() => {\n this.collapsed.update((collapsed: boolean) => !collapsed);\n\n // After expanding, we wait the transition to end and remove the max height.\n if (!this.collapsed()) {\n this.clearMaxHeight();\n }\n });\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n private clearMaxHeight(): void {\n setTimeout(() => {\n this._maxHeight.set(-1);\n }, 150);\n }\n private setMaxHeight(): void {\n this._maxHeight.set(this.containerElementRef()?.nativeElement?.offsetHeight ?? 0);\n }\n //#endregion\n}\n","<div class=\"title\">\n <h6\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"onToggle()\"\n (keydown.enter)=\"onToggle()\"\n (keydown.space)=\"onToggle(); $event.preventDefault()\"\n >\n <i class=\"fas fa-chevron-down fa-sm\"></i>{{ label() }}\n </h6>\n</div>\n\n<div\n #container\n class=\"content animate\"\n [ngStyle]=\"\n (maxHeight() >= 0 && {\n 'height.px': maxHeight(),\n 'max-height.px': maxHeight(),\n }) ||\n null\n \"\n>\n <div #maxHeighContainer>\n <ng-content></ng-content>\n </div>\n</div>\n","import { AfterViewInit, Directive, ElementRef, EventEmitter, HostListener, inject, Input, Output } from '@angular/core';\n\n/**\n * Tracks which section of a scrollable element is in view. Put it on the scrolling container;\n * it finds the descendant elements whose tag is listed in `spiedTags` and reports the index of\n * the current one as the user scrolls.\n */\n@Directive({\n selector: '[libScrollSpy]',\n})\nexport class ScrollSpyDirective implements AfterViewInit {\n //#region ViewChilds, Inputs, Outputs\n /**\n * Tag names (case-insensitive) of the elements that count as sections, for example\n * `['lib-group-accordion']`. Read once after the view initialises. Defaults to none.\n */\n @Input() public spiedTags: Array<string> = [];\n\n /** Emits the zero-based index of the section in view whenever it changes. */\n @Output() public activeSectionChange: EventEmitter<number> = new EventEmitter<number>();\n //#endregion\n\n //#region Variables\n private _el: ElementRef<HTMLElement> = inject(ElementRef);\n private activeSection: number | null = null;\n private sections: Array<Element> = new Array<Element>();\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngAfterViewInit(): void {\n this.updateSections(Array.from(this._el.nativeElement.children));\n }\n //#endregion\n\n //#region Event handlers\n /** Handles the host's `scroll` event and selects the section at the current scroll position. */\n @HostListener('scroll', ['$event'])\n public onScroll(event: any): void {\n const scrollTop: number = event.target.scrollTop;\n const scrollHeight: number = event.target.scrollHeight;\n const maxScroll: number = Math.round(event.target.scrollHeight - event.target.getBoundingClientRect().height);\n\n const currentScroll: number = Math.round((scrollTop * scrollHeight) / maxScroll);\n\n if (currentScroll >= scrollHeight) {\n this.select(this.sections.length - 1);\n return;\n }\n\n const elements: Element[] = this.sections.filter((el) => (el as HTMLElement).offsetTop <= currentScroll);\n\n this.select(elements.length > 0 ? elements.length - 1 : 0);\n }\n //#endregion\n\n //#region Public methods\n /** Scrolls the host so the section at the given zero-based index is at the top. */\n public scrollTo(section: number): void {\n this._el.nativeElement.scrollTop = (this.sections[section] as HTMLElement).offsetTop;\n }\n\n /**\n * Marks the section at the given zero-based index as active and emits `activeSectionChange`\n * when it differs from the current one. Does not scroll.\n */\n public select(section: number): void {\n if (section !== this.activeSection) {\n this.activeSection = section;\n this.activeSectionChange.emit(section);\n }\n }\n //#endregion\n\n //#region Private methods\n private updateSections(children: Element[]): void {\n children.forEach((el) => {\n if (this.spiedTags.some((spiedTag) => spiedTag.toUpperCase() === el.tagName.toUpperCase())) {\n this.sections.push(el);\n } else {\n this.updateSections(Array.from(el.children));\n }\n });\n }\n //#endregion\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ContentChildren, Input, QueryList, ViewChild } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ScrollSpyDirective } from '../../directives/scroll-spy.directive';\nimport { GroupAccordionComponent } from '../group-accordion/group-accordion.component';\n\n/**\n * A panel with a title bar, an optional icon and projected content. While `title` is empty the\n * title bar shows a loading spinner instead.\n */\n@Component({\n selector: 'lib-group-container',\n templateUrl: './group-container.component.html',\n styleUrls: ['./group-container.component.scss'],\n imports: [NgClass, TranslatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GroupContainerComponent {\n /** A scroll-spy directive in the view. The current template has none, so this stays unset. */\n @ViewChild(ScrollSpyDirective) scrollSpy!: ScrollSpyDirective;\n /** The `lib-group-accordion` sections projected into the panel, at any depth. */\n @ContentChildren(GroupAccordionComponent, { descendants: true }) sections!: QueryList<GroupAccordionComponent>;\n\n /** The labels of the projected sections, in document order. */\n public get titles(): string[] {\n return this.sections?.map((x) => x.label()) ?? [];\n }\n\n /** Zero-based index of the active section. Starts at `0`. */\n public activeSection = 0;\n\n /** Panel title, as a translation key. While empty, a loading spinner is shown in its place. */\n @Input() title?: string;\n\n /** Font Awesome icon class shown before the title, for example `fa-user`. Shown only with a title. */\n @Input() icon?: string;\n\n /** Sets the active section to the given zero-based index. */\n activeSectionChanged(index: number): void {\n this.activeSection = index;\n }\n\n /** Scrolls to the section at the given zero-based index. Needs `scrollSpy`, which the template does not provide. */\n scrollTo(section: number) {\n this.scrollSpy.scrollTo(section);\n }\n}\n","<div class=\"title\">\n @if (!!title && !!icon) {\n <i class=\"fas fa-fw\" [ngClass]=\"icon\"></i>\n }\n @if (!!title) {\n <h4>{{ title | translate }}</h4>\n }\n @if (!title) {\n <svg [ngClass]=\"''\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n }\n</div>\n\n<div class=\"content-container\">\n <ng-content></ng-content>\n</div>\n","import { Component, computed, contentChildren, Signal, signal, viewChild, WritableSignal } from '@angular/core';\nimport { ScrollSpyDirective } from '../../directives/scroll-spy.directive';\nimport { GroupAccordionComponent } from '../group-accordion/group-accordion.component';\n\n/**\n * A scrollable container with a strip of links, one per projected `lib-group-accordion`. The link\n * of the section in view is highlighted, and clicking a link scrolls to its section.\n */\n@Component({\n selector: 'lib-group-scroll-spy',\n templateUrl: './group-scroll-spy.component.html',\n styleUrls: ['./group-scroll-spy.component.scss'],\n imports: [ScrollSpyDirective],\n})\nexport class GroupScrollSpyComponent {\n /** The scroll-spy directive on the scrolling content area. */\n public readonly scrollSpy: Signal<ScrollSpyDirective | undefined> = viewChild(ScrollSpyDirective);\n /** The `lib-group-accordion` sections projected into the container, at any depth. */\n public readonly sections: Signal<readonly GroupAccordionComponent[]> = contentChildren(GroupAccordionComponent, {\n descendants: true,\n });\n\n // Reads each section's own label signal, so a section renaming itself refreshes the strip too.\n /** The section labels shown as links, in document order. */\n public readonly titles: Signal<string[]> = computed(() =>\n this.sections().map((section: GroupAccordionComponent) => section.label()),\n );\n\n /** Zero-based index of the section in view. Starts at `0`. */\n public readonly activeSection: WritableSignal<number> = signal(0);\n\n /** Sets the section in view to the given zero-based index. Called by the scroll spy. */\n public activeSectionChanged(index: number): void {\n this.activeSection.set(index);\n }\n\n /** Scrolls the content so the section at the given zero-based index is at the top. */\n public scrollTo(section: number): void {\n this.scrollSpy()?.scrollTo(section);\n }\n}\n","<div class=\"scroll-spy\">\n @for (title of titles(); track title; let i = $index) {\n <a\n class=\"item\"\n [class.active]=\"i === activeSection()\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-current]=\"i === activeSection()\"\n (click)=\"scrollTo(i)\"\n (keydown.enter)=\"scrollTo(i)\"\n (keydown.space)=\"scrollTo(i); $event.preventDefault()\"\n >{{ title }}</a\n >\n }\n</div>\n\n<div\n class=\"content\"\n libScrollSpy\n [class.no-scroll-spy]=\"titles().length === 0\"\n [spiedTags]=\"['lib-group-accordion']\"\n (activeSectionChange)=\"activeSectionChanged($event)\"\n>\n <ng-content></ng-content>\n</div>\n","import {\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n InputSignal,\n model,\n ModelSignal,\n OnInit,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { IModal, ModalSize } from '../../models';\nimport { BaseComponent } from '../base.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal dialog with a header, a body and a footer. Project content with the `body` and `footer`\n * attributes, and open or close it through `toggleModal()` from a template reference or a view\n * query. The dialog is moved to `<body>` so it always renders above the rest of the app.\n */\n@Component({\n selector: 'lib-modal',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n host: {\n title: '', // This is to ensure that the title input does not conflict with the native HTML title attribute.\n '[class.show]': 'isOpen()',\n },\n imports: [ButtonComponent],\n})\nexport class ModalComponent extends BaseComponent implements IModal, OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Text of the footer's close button, shown as given. Defaults to `Close`. */\n public readonly closeButtonText: ModelSignal<string> = model('Close');\n /**\n * When `true`, a click on the backdrop outside the dialog closes it. Escape and the close\n * buttons work either way. Defaults to `true`.\n */\n public readonly dialog: InputSignal<boolean> = input(true);\n /**\n * Marks the dialog as busy. While `true` the close button is disabled and Escape and backdrop\n * clicks are ignored. Defaults to `false`.\n */\n public readonly modalProcessing: ModelSignal<boolean> = model(false);\n /** Where the dialog sits on screen: `top`, `left`, `right`, `bottom` or `center`. Defaults to `center`. */\n public readonly position: InputSignal<'top' | 'left' | 'right' | 'bottom' | 'center'> = input<\n 'top' | 'left' | 'right' | 'bottom' | 'center'\n >('center');\n /** Width of the dialog. Defaults to `auto`, which fits the content. */\n public readonly size: InputSignal<ModalSize> = input<ModalSize>('auto');\n /** Heading of the dialog, shown as given. Without a title the header and its close icon are not shown. */\n public readonly title: InputSignal<string | undefined> = input<string>();\n\n /** Emits after the dialog closes, however it was closed. */\n public readonly closed: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly _isOpen: WritableSignal<boolean> = signal(false);\n private clickedOutside = false;\n private elementRef: ElementRef;\n //#endregion\n\n //#region Properties\n /** Whether the dialog is open. */\n public readonly isOpen: Signal<boolean> = this._isOpen.asReadonly();\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.elementRef = inject(ElementRef);\n }\n\n /**\n * Moves the host to `<body>`.\n *\n * The host is `fixed` at `z-index: 50`, which ought to put it over everything. It did not: a\n * modal opened from a view rendered *under* the navigation, and the tab strip stayed visible and\n * clickable behind it. z-index only ranks siblings inside one stacking context, and the panel\n * these views render in is its own — it has to be, so the glass layer behind it can sit at -1\n * without falling through the app backdrop. Inside that context the modal's 50 counts for\n * nothing against the sidebar's 20 outside it, and it can never reach over the strip either.\n *\n * A bigger number cannot fix that, and dropping the isolation breaks the glass. Leaving the\n * context is the fix, and the body is the one place with nothing above it.\n *\n * Angular keeps rendering into this element wherever it sits, and injection does not care where\n * the node ends up — the forms and datasets these modals reach for still resolve through the\n * component tree.\n */\n public ngOnInit(): void {\n // Guarded because the logic specs build these components with Object.create() and never give\n // them a host; there is nothing to move then, and nothing to do.\n const host: HTMLElement | undefined = this.elementRef?.nativeElement;\n host?.ownerDocument.body.appendChild(host);\n }\n\n /** Angular drops the view but not the node, now that the host is no longer where it was created. */\n public override ngOnDestroy(): void {\n (<HTMLElement | undefined>this.elementRef?.nativeElement)?.remove();\n\n super.ngOnDestroy();\n }\n //#endregion\n\n //#region Event handlers\n protected onCloseClick(): void {\n if (!this.modalProcessing() && this.isOpen()) {\n this.closeModal();\n }\n }\n\n /**\n * Refuses the native submission of the form the content sits in.\n *\n * A submit button in here -- framework-button-filters' Confirm is one, and any <button> without a\n * type is another -- makes the browser submit this form once the button's own click handler has\n * run: a GET to the current URL, which reloads the whole application. Before the host moved to\n * <body> the submit bubbled through the consumer, and the FormGroupDirective of its [formGroup]\n * binding cancelled it; that was never this component's doing, and it stopped when the event\n * stopped passing through the consumer. A modal is never meant to submit natively, so the form\n * says so itself, wherever the host lives.\n *\n * Only the default is prevented. The event still bubbles, and the click that caused it has already\n * done its work.\n */\n protected onFormSubmit(event: Event): void {\n event.preventDefault();\n }\n //#endregion\n\n //#region Public methods\n /** Closes the dialog if it is open. Does nothing otherwise. */\n public closeModal(): void {\n if (this.isOpen()) {\n this.toggleModal();\n }\n }\n\n /**\n * Opens the dialog when closed and closes it when open. Opening focuses the first element with\n * `autofocus`; closing emits `closed`.\n */\n public toggleModal(): void {\n const wasOpen: boolean = this._isOpen();\n\n const body: HTMLBodyElement | null = document.querySelector('body');\n body?.classList.toggle('modal-active');\n\n this._isOpen.set(body?.classList.contains('modal-active') ?? false);\n\n if (this.isOpen()) {\n this.clickedOutside = false;\n\n const autofocus: any = this.elementRef.nativeElement.querySelector('[autofocus]');\n if (autofocus && !!autofocus.focus) {\n autofocus.focus();\n }\n } else if (wasOpen) {\n this.closed.emit();\n }\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n if (this.dialog() && this.isOpen()) {\n const target: HTMLElement = <HTMLElement>event.target;\n\n this.clickedOutside =\n (!this.modalProcessing() &&\n event.button === 0 &&\n target.closest('lib-modal') &&\n !target.closest('.modal-content')) ??\n false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.dialog() && this.isOpen()) {\n if (this.clickedOutside && !this.modalProcessing()) {\n this.toggleModal();\n }\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected documentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscape: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (!this.modalProcessing() && this.isOpen() && isEscape && document.body.classList.contains('modal-active')) {\n this.toggleModal();\n }\n }\n //#endregion\n}\n","<div class=\"modal-overlay\"></div>\n\n<div class=\"modal-container size-{{ size() }} {{ position() }}\">\n <form class=\"modal-content\" (submit)=\"onFormSubmit($event)\">\n @if (title()) {\n <div class=\"modal-header\">\n <p class=\"text-2xl font-bold\">{{ title() }}</p>\n <button type=\"button\" class=\"modal-close\" (click)=\"toggleModal()\">\n <svg\n class=\"fill-current text-black\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n >\n <path\n d=\"M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z\"\n ></path>\n </svg>\n </button>\n </div>\n }\n\n <div class=\"modal-body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n\n <div class=\"modal-footer\">\n <lib-button intent=\"secondary\" [disabled]=\"modalProcessing()\" (click)=\"onCloseClick()\">\n {{ closeButtonText() }}\n </lib-button>\n\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </form>\n</div>\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { AbstractControl, FormArray, FormGroup } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { take, takeUntil } from 'rxjs';\nimport { FormService } from '../../services';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { MultiEditorDataset } from '../../services/datasets/multi-editor.dataset';\nimport { DataGridComponent } from '../data-grid/data-grid.component';\nimport { FormGroupComponent } from '../form-group/form-group.component';\nimport { ModalComponent } from '../modal/modal.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal for editing many records in one go: a grid of rows on one side and a form for the\n * selected row on the other. Project the form fields as content, bound to `formGroup`; changes\n * are kept per row and saved together through the provided `MultiEditorDataset` on Confirm.\n */\n@Component({\n selector: 'lib-multi-editor',\n templateUrl: './multi-editor.component.html',\n styleUrls: ['./multi-editor.component.scss'],\n imports: [ButtonComponent, DataGridComponent, ModalComponent, FormGroupComponent, TranslatePipe],\n})\nexport class MultiEditorComponent extends ModalComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n private readonly modal: Signal<ModalComponent | undefined> = viewChild(ModalComponent);\n\n /** Text of the button that adds a new row, shown as given. Defaults to `Add row`. */\n public readonly addButtonLabel: InputSignal<string> = input('Add row');\n /**\n * The form the projected fields are bound to. It is filled from the selected row, disabled while\n * no row is selected, and must be valid before the user can move to another row. Required.\n */\n public readonly formGroup: InputSignal<FormGroup<any>> = input.required<FormGroup<any>>();\n /** Text of the button that removes the selected row, shown as given. Defaults to `Remove row`. */\n public readonly removeButtonLabel: InputSignal<string> = input('Remove row');\n /** Shows the button that adds a new row. Defaults to `true`. */\n public readonly showAddButton: InputSignal<boolean> = input(true);\n /** Shows the button that removes the selected row; it appears only while a row is selected. Defaults to `true`. */\n public readonly showDeleteButton: InputSignal<boolean> = input(true);\n //#endregion\n\n //#region Variables\n protected readonly gridLoading: WritableSignal<boolean> = signal(false);\n\n private dataGridDataset: DataGridDataset = inject(DataGridDataset);\n private formService: FormService = inject(FormService);\n private multiEditorDataset: MultiEditorDataset = inject(MultiEditorDataset);\n private readonly selectedKey: WritableSignal<string | undefined> = signal(undefined);\n private selectedValue?: any;\n //#endregion\n\n //#region Properties\n protected get formLoading(): boolean {\n return this.formService.loading;\n }\n\n protected readonly hasSelectedKey: Signal<boolean> = computed(() => !!this.selectedKey());\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public override ngOnInit(): void {\n // ModalComponent moves the host to <body> here. Without this call the dialog stays inside the\n // tab panel's stacking context and renders under the navigation.\n super.ngOnInit();\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.multiEditorDataset.clearChangedValues();\n\n this.gridLoading.set(false);\n this.selectedKey.set(undefined);\n this.selectedValue = undefined;\n });\n\n this.dataGridDataset.selectedRowsChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {\n if (this.gridLoading() || !this.dataGridDataset.hasLoadedRows || !this.dataGridDataset.hasSelectedRows) {\n return;\n }\n\n if (this.formGroup().disabled) {\n this.formGroup().enable();\n }\n\n const selectedRowKey: string = this.dataGridDataset.selectedRowKeys[0];\n if (\n !!this.selectedKey() &&\n this.formGroup().enabled &&\n !this.formGroup().valid &&\n this.selectedKey() !== selectedRowKey\n ) {\n // If the form is invalid, need to stay in the same selected row.\n this.dataGridDataset.selectRow(this.selectedKey()!);\n this.formGroup().markAllAsTouched();\n } else {\n this.selectedKey.set(selectedRowKey);\n this.selectedValue = this.dataGridDataset.getRowData(selectedRowKey);\n this.formService.model = this.selectedValue;\n\n this.formGroup().reset();\n this.formGroup().patchValue(this.selectedValue);\n }\n });\n\n this.formGroup()\n .valueChanges.pipe(takeUntil(this.destroy$))\n .subscribe((_: any) => {\n if (this.selectedKey() && this.formGroup().dirty) {\n this.multiEditorDataset.updateValues(this.selectedKey()!, this.formGroup().getRawValue());\n }\n });\n\n // Start with an empty form and, since there is no selected row, disable the form.\n this.disableFormQuietly();\n }\n //#endregion\n\n //#region Event handlers\n protected onDeleteClick(): void {\n if (!this.selectedKey()) {\n return;\n }\n\n this.multiEditorDataset.removeValue(this.selectedKey()!);\n\n this.selectedKey.set(undefined);\n this.formGroup().reset({ emitEvent: false });\n this.clearAllFormArrays(this.formGroup());\n\n this.disableFormQuietly();\n }\n\n protected onNewClick(): void {\n const fakeNewID: number = (Math.floor(Math.random() * (999999 - 100000)) + 100000) * -1;\n const newModel: any = this.multiEditorDataset.newData(fakeNewID);\n\n if (newModel) {\n // Read before addNewRow: it stamps the grid's internal key onto the row, so afterwards even a\n // `{}` model reports one own key and the check below would never skip.\n const hasPrefilledValues: boolean = Object.keys(newModel).length > 0;\n\n this.multiEditorDataset.storeFakeIDGenerated(fakeNewID);\n\n this.dataGridDataset.addNewRow(newModel);\n\n const newKey: string = this.dataGridDataset.loadedKeys![this.dataGridDataset.loadedKeys!.length - 1];\n\n // Record whatever `newData` pre-filled. `selectRow` below reaches the form through\n // reset() + patchValue(), which leaves it pristine, and the `valueChanges` handler is gated on\n // `formGroup.dirty` — so a row the user never types into is never recorded. Without this, values\n // returned by `newData` show up in the grid but are dropped from the save batch, and adding\n // several rows while only editing the last silently discards the earlier ones.\n //\n // Skipped for a value-less model (`{}`, the blank-row convention) so implementations that\n // pre-fill nothing keep sending nothing for a row that was added and never touched.\n if (hasPrefilledValues) {\n this.multiEditorDataset.updateValues(newKey, newModel);\n }\n\n this.dataGridDataset.selectRow(newKey);\n }\n }\n\n protected onSaveClick(): void {\n if (this.selectedKey()) {\n this.formGroup().markAllAsTouched();\n }\n\n if (!this.selectedKey() || this.formGroup().valid) {\n this.modalProcessing.set(true);\n this.formGroup().disable();\n\n this.multiEditorDataset\n .saveChanges()\n .pipe(take(1))\n .subscribe({\n next: (_: any) => {\n this.modalProcessing.set(false);\n this.toggleModal();\n },\n error: (e: HttpErrorResponse) => {\n this.modalProcessing.set(false);\n this.formGroup().enable();\n\n if (e.status === 400 && e.error.errors) {\n this.dataGridDataset.selectRowID(e.error.entityKey);\n\n this.formService.setValidationErrorsFromHttpResponse(e);\n }\n },\n });\n }\n }\n //#endregion\n\n //#region Public methods\n /** Closes the modal if it is open, without saving. */\n public override closeModal(): void {\n this.modal()?.closeModal();\n }\n\n /** Opens or closes the modal. Opening reloads the grid and clears and disables the form. */\n public override toggleModal(): void {\n this.modal()?.toggleModal();\n\n if (this.modal()?.isOpen()) {\n this.gridLoading.set(true);\n this.dataGridDataset.refresh();\n\n this.selectedKey.set(undefined);\n this.formGroup().reset({ emitEvent: false });\n this.clearAllFormArrays(this.formGroup());\n this.disableFormQuietly();\n }\n }\n //#endregion\n\n //#region Private methods\n private clearAllFormArrays(form: FormGroup): void {\n Object.keys(form.controls).forEach((key: string) => {\n const control: AbstractControl | null = form.get(key);\n if (control instanceof FormArray) {\n control.clear({ emitEvent: false });\n }\n\n // Check for nested FormArrays.\n if (control instanceof FormGroup) {\n this.clearAllFormArrays(control);\n }\n });\n }\n\n /**\n * Disables the form without telling anything subscribed to its controls, then announces the new\n * status once, from the form itself.\n *\n * The fields in the editor read the form's state from its events. A form disabled without one\n * left them showing inputs for a form that no longer accepted any.\n */\n private disableFormQuietly(): void {\n this.formGroup().disable({ emitEvent: false });\n this.formGroup().updateValueAndValidity({ onlySelf: true });\n }\n //#endregion\n}\n","<lib-modal\n [closeButtonText]=\"closeButtonText() | translate\"\n [dialog]=\"dialog()\"\n [modalProcessing]=\"modalProcessing()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [title]=\"title() ?? ''\"\n>\n <!-- `.body-content` exists to be the query container and nothing else; `.panes` is the grid it\n controls. A grid cannot query itself, and the host is `display: contents` so it has no box\n of its own to contain anything. -->\n <div body class=\"body-content\">\n <div class=\"panes\">\n <div class=\"data-grid\">\n <lib-data-grid [disabled]=\"modalProcessing()\" [lazyLoadRows]=\"true\"></lib-data-grid>\n </div>\n\n <div class=\"data\">\n <div class=\"buttons\">\n @if (showAddButton()) {\n <lib-button\n intent=\"secondary\"\n [disabled]=\"modalProcessing() || gridLoading() || formLoading || formGroup().invalid\"\n (click)=\"onNewClick()\"\n >\n {{ addButtonLabel() }}\n </lib-button>\n }\n @if (showDeleteButton() && hasSelectedKey()) {\n <lib-button\n intent=\"danger\"\n [disabled]=\"modalProcessing() || gridLoading() || formLoading\"\n (click)=\"onDeleteClick()\"\n >\n {{ removeButtonLabel() }}\n </lib-button>\n }\n </div>\n\n <lib-form-group>\n <ng-content></ng-content>\n </lib-form-group>\n </div>\n </div>\n </div>\n\n <div footer>\n <lib-button\n intent=\"primary\"\n [disabled]=\"gridLoading() || formLoading\"\n [loading]=\"modalProcessing()\"\n (click)=\"onSaveClick()\"\n >\n {{ 'Button-Modal-MultiEditor-Confirm' | translate }}\n </lib-button>\n </div>\n</lib-modal>\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, InputSignal, OnInit, signal, TemplateRef, WritableSignal } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { takeUntil } from 'rxjs';\nimport { MultiSelectResultDataset } from '../../../services/datasets/multi-select-result.dataset';\nimport { BaseComponent } from '../../base.component';\nimport { DataGridDataset } from '../../../services';\n\n/**\n * The selection list inside `lib-multi-select`. Shows the records of the `MultiSelectResultDataset`\n * with a remove button on each, and loads more rows as the user scrolls to the end.\n */\n@Component({\n selector: 'lib-multi-select-result-grid',\n templateUrl: './result-grid.component.html',\n styleUrls: ['./result-grid.component.scss'],\n host: {\n class: 'flex-grow',\n },\n imports: [CommonModule, TranslatePipe],\n})\nexport class MultiSelectResultGridComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Disables the remove buttons. Defaults to `false`. */\n public readonly isDisabled: InputSignal<boolean> = input(false);\n /** Template that renders one record. It receives the record as `rowData`. */\n public readonly template: InputSignal<TemplateRef<any> | undefined> = input<TemplateRef<any>>();\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n protected readonly isLoading: WritableSignal<boolean> = signal(true);\n protected resultDataset: MultiSelectResultDataset = inject(MultiSelectResultDataset);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.resultDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isLoading.set(true);\n });\n\n this.resultDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isLoading.set(false);\n });\n }\n //#endregion\n\n //#region Event handlers\n /** Marks the record at the given displayed row index for removal and unticks it in the search grid. */\n public onItemRemoved(rowIndex: number): void {\n const id: any = this.resultDataset.displayedIDs[rowIndex];\n\n // Removing used to go only through the grid on the left, which knows nothing about a row it\n // has not loaded -- and this panel lists entries the search may never have shown. The click\n // then did nothing at all. The dataset is told directly, and the grid is still told too so a\n // row that does happen to be loaded keeps its checkbox in step.\n this.resultDataset.setIDToRemove(id);\n this.dataGridDataset.deselectRowID(id);\n }\n\n protected onScrolled(event: any): void {\n const currentScroll: number = event.target.scrollTop + event.target.clientHeight;\n const scrollHeight: number = event.target.scrollHeight - event.target.clientHeight;\n\n if (currentScroll > scrollHeight && !this.isLoading() && !this.resultDataset.loadedLastRow) {\n this.isLoading.set(true);\n this.resultDataset.loadRows();\n }\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","<div class=\"body\" (scroll)=\"onScrolled($event)\">\n @for (row of resultDataset.displayedRows; track row; let i = $index) {\n <div class=\"row\">\n <div class=\"cell\">\n <button\n class=\"remove\"\n type=\"button\"\n [class.disabled]=\"isDisabled()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onItemRemoved(i)\"\n >\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"cell\">\n <div>\n <ng-container *ngTemplateOutlet=\"template()!; context: { rowData: row }\"> </ng-container>\n </div>\n </div>\n </div>\n }\n @if (isLoading()) {\n <div class=\"loading\">\n <svg [ngClass]=\"''\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ resultDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n</div>\n","import {\n Component,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { take, takeUntil } from 'rxjs';\nimport { IGridColumn } from '../../models';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { MultiSelectResultDataset } from '../../services/datasets/multi-select-result.dataset';\nimport { DataGridComponent } from '../data-grid/data-grid.component';\nimport { ModalComponent } from '../modal/modal.component';\nimport { MultiSelectResultGridComponent } from './result-grid/result-grid.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal for picking many records at once: a searchable grid on one side and the current\n * selection on the other. It reads both lists from the `DataGridDataset` and\n * `MultiSelectResultDataset` provided around it, and saves through the result dataset on Confirm.\n */\n@Component({\n selector: 'lib-multi-select',\n templateUrl: './multi-select.component.html',\n styleUrls: ['./multi-select.component.scss'],\n imports: [\n ButtonComponent,\n DataGridComponent,\n FormsModule,\n ModalComponent,\n MultiSelectResultGridComponent,\n TranslatePipe,\n ],\n})\nexport class MultiSelectComponent extends ModalComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n private readonly modal: Signal<ModalComponent | undefined> = viewChild(ModalComponent);\n\n /** Template that renders one selected record in the selection list. It receives the record as `rowData`. */\n public readonly itemTemplate: InputSignal<TemplateRef<unknown> | undefined> = input<TemplateRef<unknown>>();\n //#endregion\n\n //#region Variables\n protected readonly isResultGridLoading: WritableSignal<boolean> = signal(false);\n protected readonly isSearchGridLoading: WritableSignal<boolean> = signal(false);\n protected resultDataset: MultiSelectResultDataset = inject(MultiSelectResultDataset);\n protected readonly searchCriteria: WritableSignal<string> = signal('');\n\n private _searchColumn = '';\n private dataGridDataset: DataGridDataset = inject(DataGridDataset);\n //#endregion\n\n //#region Properties\n private get searchColumn(): string {\n if (this._searchColumn.length === 0) {\n let columnName =\n this.dataGridDataset.columns.filter((col: IGridColumn) => col.field !== '')[0]?.field ?? 'Search';\n columnName = columnName.charAt(0).toUpperCase() + columnName.slice(1);\n this._searchColumn = columnName;\n }\n return this._searchColumn;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.dataGridDataset.configs.multiSelect = true;\n this.closeButtonText.set('Button-Modal-Cancel');\n }\n\n public override ngOnInit(): void {\n // ModalComponent moves the host to <body> here. Without this call the dialog stays inside the\n // tab panel's stacking context and renders under the navigation.\n super.ngOnInit();\n\n this.dataGridDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isSearchGridLoading.set(true);\n });\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isSearchGridLoading.set(false);\n this.updateSelectedItems();\n });\n\n this.resultDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isResultGridLoading.set(false);\n this.updateSelectedItems();\n });\n\n this.dataGridDataset.selectedRowsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe((selectionChanges: { [id: string]: { rowData: any; selected: boolean } }) => {\n if (this.isSearchGridLoading() || this.isResultGridLoading()) {\n return;\n }\n\n Object.keys(selectionChanges).forEach((key: string) => {\n const selection: { rowData: any; selected: boolean } = selectionChanges[key];\n const id: any = this.dataGridDataset.getRowID(key);\n\n if (selection.selected) {\n this.resultDataset.setIDToAdd(id, selection.rowData);\n } else {\n this.resultDataset.setIDToRemove(id);\n }\n });\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onSave(): void {\n this.modalProcessing.set(true);\n this.resultDataset\n .saveChanges()\n .pipe(take(1))\n .subscribe(() => {\n this.modalProcessing.set(false);\n this.toggleModal();\n });\n }\n\n /**\n * Runs the search.\n *\n * The input lives inside the modal's form, so Enter would submit it. Submitting reaches the\n * footer and saves changes the user has not finished making -- pressing Enter after typing a\n * name means \"find this\", never \"confirm everything\". The event is stopped here rather than in\n * the template so the reason travels with the code.\n */\n protected onSearch(event?: Event): void {\n event?.preventDefault();\n event?.stopPropagation();\n\n const filters: { [key: string]: string } = this.dataGridDataset.filters ?? {};\n\n this.isSearchGridLoading.set(true);\n if (this.searchCriteria().length > 0) {\n filters[this.searchColumn] = this.searchCriteria();\n this.dataGridDataset.setFilters(filters);\n } else if (Object.keys(filters).includes(this.searchColumn)) {\n this.clearSearch();\n }\n }\n //#endregion\n\n //#region Public methods\n /** Closes the modal if it is open, without saving. */\n public override closeModal(): void {\n this.modal()?.closeModal();\n }\n\n /** Opens or closes the modal. Opening clears the search and reloads the current selection. */\n public override toggleModal(): void {\n this.modal()?.toggleModal();\n\n if (this.modal()?.isOpen()) {\n this.searchCriteria.set('');\n this.clearSearch();\n\n this.isResultGridLoading.set(true);\n this.resultDataset.refresh();\n }\n }\n //#endregion\n\n //#regiosn Private methods\n private clearSearch(): void {\n const filters: { [key: string]: string } = this.dataGridDataset.filters ?? {};\n if (Object.keys(filters).includes(this.searchColumn)) {\n delete filters[this.searchColumn];\n }\n this.dataGridDataset.setFilters(filters);\n }\n private updateSelectedItems(): void {\n if (this.isSearchGridLoading() || this.isResultGridLoading()) {\n return;\n }\n\n // Filter by the results that are not marked to be removed.\n const idsFromResult: any[] = (this.resultDataset.loadedKeys ?? [])\n .map((key: string) => this.resultDataset.getRowID(key))\n .filter((id: any) => this.resultDataset.idsToRemove.indexOf(id) < 0);\n\n idsFromResult.push(...this.resultDataset.idsToAdd);\n\n // Get each corresponding key from the data grid.\n const keysToSelect: string[] = (this.dataGridDataset.loadedKeys ?? []).filter(\n (key: string) => idsFromResult.indexOf(this.dataGridDataset.getRowID(key)) >= 0,\n );\n\n this.dataGridDataset.selectRows(keysToSelect);\n }\n //#endregion\n}\n","<lib-modal\n [closeButtonText]=\"closeButtonText() | translate\"\n [dialog]=\"dialog()\"\n [modalProcessing]=\"modalProcessing()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [title]=\"title() ?? ''\"\n>\n <!-- `.body-content` exists to be the query container and nothing else; `.panes` is the grid it\n controls. A grid cannot query itself, and the host is `display: contents` so it has no box\n of its own to contain anything. -->\n <div body class=\"body-content\">\n <div class=\"panes\">\n <div class=\"search-grid\">\n <div class=\"search\">\n <input\n class=\"form-input\"\n placeholder=\"Search...\"\n type=\"text\"\n [(ngModel)]=\"searchCriteria\"\n [disabled]=\"modalProcessing() || isSearchGridLoading()\"\n (keydown.enter)=\"onSearch($event)\"\n />\n </div>\n\n <lib-data-grid\n [disabled]=\"modalProcessing() || isSearchGridLoading() || isResultGridLoading()\"\n [lazyLoadRows]=\"true\"\n >\n </lib-data-grid>\n </div>\n\n <lib-multi-select-result-grid\n [isDisabled]=\"modalProcessing() || isSearchGridLoading() || isResultGridLoading()\"\n [template]=\"itemTemplate()!\"\n >\n </lib-multi-select-result-grid>\n </div>\n </div>\n\n <div footer>\n <lib-button intent=\"primary\" [loading]=\"modalProcessing()\" (click)=\"onSave()\">\n {{ 'Button-Modal-MultiSelect-Confirm' | translate }}\n </lib-button>\n </div>\n</lib-modal>\n","import { NgStyle } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n inject,\n Input,\n OnInit,\n signal,\n ViewChild,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { delay, filter, takeUntil } from 'rxjs';\nimport { SIDEBAR_CONFIGS, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, toSidebarMenuOpenMode } from '../../models';\nimport { SidebarService } from '../../services';\nimport { BaseComponent } from '../base.component';\n\n@Component({\n selector: 'lib-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n imports: [NgStyle, TranslatePipe],\n host: {\n '[class.active]': 'isActive',\n '[class.expanded]': '!isCollapsed',\n '[class.first-level]': 'level === 0',\n '[class.last-child]': 'isLast',\n '[class.selected]': 'isSelected()',\n },\n})\nexport class SidebarItemComponent extends BaseComponent implements OnInit, AfterViewInit {\n //#region ViewChilds, Inputs, Outputs\n @ViewChild('menuContainer') private menuContainer!: ElementRef<HTMLAnchorElement>;\n\n @Input() public isLast = false;\n @Input() public level = 0;\n @Input() public menu!: SidebarMenu;\n //#endregion\n\n //#region Variables\n // Signals, not fields. Three of these are read from host bindings, which Angular evaluates in\n // the PARENT's pass -- so `changeDetectorRef.detectChanges()` on this component could never\n // refresh them, and writing them after that pass raised NG0100 instead. A signal write marks\n // this view and every ancestor, which is the only notification that reaches a host binding.\n protected readonly children: WritableSignal<SidebarMenu[]> = signal([]);\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly isLoading: WritableSignal<boolean> = signal(false);\n protected readonly isSelected: WritableSignal<boolean> = signal(false);\n\n private readonly _childHeight: WritableSignal<number> = signal(0);\n private sidebarConfigs: SidebarConfigs = inject(SIDEBAR_CONFIGS);\n private sidebarService: SidebarService = inject(SidebarService);\n //#endregion\n\n //#region Properties\n public get childHeight(): number {\n return this._childHeight();\n }\n\n protected get areChildrenLoaded(): boolean {\n return this.isParent && this.children().length > 0;\n }\n\n protected get externalLinkText(): string {\n return this.sidebarConfigs.externalLinkText;\n }\n\n protected get isActive(): boolean {\n return this.sidebarService.isActive;\n }\n\n protected get isCollapsed(): boolean {\n return this.sidebarService.isCollapsed;\n }\n\n protected get isParent(): boolean {\n return this.menu.childCount > 0;\n }\n\n protected get opensInNewBrowserTab(): boolean {\n return (\n (this.menu.url?.length ?? 0) > 0 &&\n toSidebarMenuOpenMode(this.menu.openMode) === SidebarMenuOpenMode.ExternalNewTab\n );\n }\n\n protected get hasIcon(): boolean {\n return !!this.menu.icon && this.menu.icon.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngAfterViewInit(): void {\n if (!!this.menu && !!this.menu.parent) {\n this.menu.height = this.menuContainer?.nativeElement?.offsetHeight ?? 0;\n this.sidebarService.childrenInitialized.emit(this.menu.parent);\n }\n }\n\n public ngOnInit(): void {\n if (this.isParent) {\n this.sidebarService.childrenFailed\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n delay(1000),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.hasFailed.set(true);\n this.isLoading.set(false);\n this.isSelected.set(false);\n this.menu.isSelected = false;\n });\n\n // The service hands the children over in a plain field, which tells this item nothing. Copying\n // them into a signal is what renders the child items, and only their childrenInitialized ends\n // the loading state -- without it the item stayed on \"loading\" after a successful answer.\n this.children.set(this.menu.children ?? []);\n this.sidebarService.childrenLoaded\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((menu: SidebarMenu) => this.children.set(menu.children ?? []));\n\n this.sidebarService.childrenLoading\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.hasFailed.set(false);\n this.isLoading.set(true);\n });\n\n this.sidebarService.childrenInitialized\n .pipe(\n takeUntil(this.destroy$),\n filter(\n (menu: SidebarMenu) =>\n menu.id === this.menu.id && this.menu.children.every((child: SidebarMenu) => (child.height ?? 0) > 0),\n ),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.isLoading.set(false);\n this.hasFailed.set(false);\n this.updateSubMenuHeight();\n\n if (this.menu.parent) {\n this.sidebarService.childrenInitialized.emit(this.menu.parent);\n }\n });\n }\n\n this.sidebarService.selectionChanged\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((menu: SidebarMenu) => {\n this.isSelected.set(menu.isSelected);\n this.updateSubMenuHeight();\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onSelectItem(): void {\n if (this.sidebarService.shouldActivate) {\n this.sidebarService.isActive = true;\n }\n\n this.sidebarService.select(this.menu);\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n protected trackByFn(_index: number, item: SidebarMenu): number {\n return item.id;\n }\n\n private getChildHeight(menu: SidebarMenu): number {\n if (menu.isSelected) {\n return menu.children.reduce(\n (height: number, childMenu: SidebarMenu) => height + (childMenu.height ?? 0) + this.getChildHeight(childMenu),\n 0,\n );\n }\n return 0;\n }\n\n private updateSubMenuHeight(): void {\n this._childHeight.set(this.getChildHeight(this.menu));\n }\n //#endregion\n}\n","<li>\n <div\n #menuContainer\n [class.external]=\"opensInNewBrowserTab\"\n [class.failed]=\"hasFailed()\"\n [class.loading]=\"isLoading()\"\n [class.parent]=\"isParent\"\n [class.selected]=\"isSelected()\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-current]=\"isSelected()\"\n (click)=\"onSelectItem()\"\n (keydown.enter)=\"onSelectItem()\"\n (keydown.space)=\"onSelectItem(); $event.preventDefault()\"\n >\n <a [attr.title]=\"opensInNewBrowserTab ? externalLinkText : null\">\n @if (hasIcon && level === 0) {\n <i class=\"fa-solid fa-fw {{ menu.icon }}\"></i>\n }\n <span>{{ menu.label | translate }}</span>\n </a>\n\n @if (isParent) {\n <div class=\"loading\">\n <svg class=\"animate-spin text-white\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n </div>\n }\n </div>\n\n @if (isParent) {\n <ul\n [class.open]=\"isSelected()\"\n [ngStyle]=\"{\n 'height.px': childHeight,\n 'max-height.px': childHeight,\n }\"\n >\n @for (child of children(); track trackByFn($index, child); let last = $last) {\n <lib-sidebar-item [menu]=\"child\" [level]=\"level + 1\" [isLast]=\"last\"> </lib-sidebar-item>\n }\n </ul>\n }\n</li>\n","import {\n AfterViewInit,\n Component,\n computed,\n HostListener,\n inject,\n OnInit,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { forkJoin, map, merge, Observable, of, switchMap, take, takeUntil } from 'rxjs';\nimport { SIDEBAR_CONFIGS, SidebarConfigs, SidebarMenu, SidebarRegion } from '../../models';\nimport { SidebarService } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { SidebarItemComponent } from '../sidebar-item/sidebar-item.component';\n\n/**\n * The application's navigation sidebar. Loads its menus through `SidebarService`, groups them\n * into regions and closes itself on navigation, Escape or a click outside it on small screens.\n */\n@Component({\n selector: 'lib-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n imports: [SidebarItemComponent, TranslatePipe],\n host: {\n '[class.active]': 'isActive',\n '[class.expanded]': '!isCollapsed',\n },\n})\nexport class SidebarComponent extends BaseComponent implements AfterViewInit, OnInit {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected onBodyMouseDown(event: MouseEvent): void {\n if (this.isActive && event.target) {\n const target: HTMLElement = <HTMLElement>event.target;\n this.wasClickedOutside = (event.button === 0 && !target.closest('lib-sidebar')) ?? false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected onBodyMouseUp(_event: MouseEvent): void {\n if (this.wasClickedOutside) {\n this.wasClickedOutside = false;\n this.deactivate();\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected onDocumentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscapeKey: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (isEscapeKey) {\n this.deactivate();\n }\n }\n\n @HostListener('window:resize', ['$event'])\n protected onResize(_event: Event): void {\n this.updateShouldActivate();\n }\n //#endregion\n\n //#region Variables\n private sidebarConfigs: SidebarConfigs = inject(SIDEBAR_CONFIGS);\n\n protected configErrorText: string = this.sidebarConfigs.errorText;\n protected configLoadingText: string = this.sidebarConfigs.loadingText;\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly menus: WritableSignal<SidebarMenu[]> = signal<SidebarMenu[]>([]);\n protected readonly regions: WritableSignal<SidebarRegion[]> = signal<SidebarRegion[]>([]);\n\n private sidebarService: SidebarService = inject(SidebarService);\n private wasClickedOutside = false;\n //#endregion\n\n //#region Properties\n protected get isActive(): boolean {\n return this.sidebarService.isActive;\n }\n\n protected get isCollapsed(): boolean {\n return this.sidebarService.isCollapsed;\n }\n\n protected readonly isLoading: Signal<boolean> = computed(() => this.menus().length === 0);\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngAfterViewInit(): void {\n this.updateShouldActivate();\n }\n\n public ngOnInit(): void {\n merge(this.sidebarService.menuUrlSelected, this.sidebarService.menuExternalUrlSelected)\n .pipe(takeUntil(this.destroy$))\n .subscribe((_menu: SidebarMenu) => this.deactivate());\n\n this.sidebarService\n .loadRoot()\n .pipe(\n take(1),\n switchMap((menus: SidebarMenu[]) => this.loadAreaChildren(menus)),\n )\n .subscribe({\n next: (menus: SidebarMenu[]) => {\n this.menus.set(menus);\n this.regions.set(this.groupIntoRegions(menus));\n },\n error: () => this.hasFailed.set(true),\n });\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n /** Toggles the sidebar between collapsed and expanded. Collapsing also clears the selected menus. */\n public collapse(): void {\n this.sidebarService.isCollapsed = !this.sidebarService.isCollapsed;\n this.sidebarService.isActive = false;\n\n if (this.sidebarService.isCollapsed) {\n this.sidebarService.deselectAll();\n }\n\n this.updateShouldActivate();\n }\n //#endregion\n\n //#region Private methods\n protected trackByFn(_index: number, item: SidebarMenu): number {\n return item.id;\n }\n\n protected trackByRegion(_index: number, region: SidebarRegion): string {\n return region.name ?? '';\n }\n\n /** Whether this top-level menu stands for an area rather than a destination of its own. */\n private isArea(menu: SidebarMenu): boolean {\n return menu.childCount > 0 && (menu.url?.length ?? 0) === 0;\n }\n\n // Group top-level menus into regions by their optional `region` label, preserving\n // first-appearance order. Ungrouped menus fall into a single header-less region.\n private groupByRegionLabel(menus: SidebarMenu[]): SidebarRegion[] {\n const regions: SidebarRegion[] = [];\n const byName: Map<string | undefined, SidebarRegion> = new Map<string | undefined, SidebarRegion>();\n\n menus.forEach((menu: SidebarMenu) => {\n let region: SidebarRegion | undefined = byName.get(menu.region);\n if (!region) {\n region = { name: menu.region, items: [] };\n byName.set(menu.region, region);\n regions.push(region);\n }\n region.items.push(menu);\n });\n\n return regions;\n }\n\n // Derive the regions from the tree: an area menu becomes a header and lends the group its own\n // children, so the area carries one translated label and one order instead of a string repeated\n // across every item. Anything that is not an area keeps falling into a header-less region, which\n // is created where the first such item appears so the original ordering still holds.\n private groupByRootMenus(menus: SidebarMenu[]): SidebarRegion[] {\n const regions: SidebarRegion[] = [];\n let ungrouped: SidebarRegion | undefined;\n\n menus.forEach((menu: SidebarMenu) => {\n if (this.isArea(menu)) {\n regions.push({ name: menu.label, items: menu.children });\n return;\n }\n\n if (!ungrouped) {\n ungrouped = { name: undefined, items: [] };\n regions.push(ungrouped);\n }\n\n ungrouped.items.push(menu);\n });\n\n return regions;\n }\n\n private groupIntoRegions(menus: SidebarMenu[]): SidebarRegion[] {\n return this.sidebarConfigs.shouldDeriveAreasFromRootMenus\n ? this.groupByRootMenus(menus)\n : this.groupByRegionLabel(menus);\n }\n\n /**\n * Fetches the children of every area up front, because they are rendered flat rather than\n * behind a click, so the lazy load a collapsible parent relies on would never be triggered.\n */\n private loadAreaChildren(menus: SidebarMenu[]): Observable<SidebarMenu[]> {\n if (!this.sidebarConfigs.shouldDeriveAreasFromRootMenus) {\n return of(menus);\n }\n\n const areas: SidebarMenu[] = menus.filter((menu: SidebarMenu) => this.isArea(menu));\n\n // forkJoin never emits on an empty array, so a menu with no areas has to short-circuit.\n if (areas.length === 0) {\n return of(menus);\n }\n\n return forkJoin(areas.map((area: SidebarMenu) => this.sidebarService.loadChildrenFor(area))).pipe(map(() => menus));\n }\n\n private deactivate(): void {\n if (this.sidebarService.isActive) {\n this.sidebarService.isActive = false;\n this.sidebarService.deselectAll();\n }\n }\n\n private updateShouldActivate(): void {\n this.sidebarService.shouldActivate =\n (window.innerWidth <= 767 && !this.sidebarService.isCollapsed) || this.sidebarService.isCollapsed;\n }\n //#endregion\n}\n","<div class=\"sidebar-toolbar\">\n <button type=\"button\" class=\"sidebar-toggle\" (click)=\"collapse()\" aria-label=\"Toggle navigation\">\n <i class=\"fa-solid fa-angle-left\" [class.is-collapsed]=\"isCollapsed\"></i>\n </button>\n</div>\n\n<nav>\n @if (!isLoading()) {\n <ul>\n @for (region of regions(); track trackByRegion($index, region)) {\n @if (region.name) {\n <li class=\"sidebar-region-header\">\n <span>{{ region.name | translate }}</span>\n </li>\n }\n @for (menu of region.items; track trackByFn($index, menu)) {\n <lib-sidebar-item [menu]=\"menu\"> </lib-sidebar-item>\n }\n }\n @if (hasFailed()) {\n <div class=\"error\">\n <div>\n <i class=\"fa-solid fa-fw fa-triangle-exclamation\"></i>\n <span>{{ configErrorText }}</span>\n </div>\n </div>\n }\n </ul>\n } @else {\n <div class=\"loading\">\n <div>\n <svg class=\"animate-spin text-white\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>{{ configLoadingText }}</span>\n </div>\n </div>\n }\n</nav>\n\n<div class=\"sidebar-footer\"><ng-content></ng-content></div>\n","import { FlexibleConnectedPositionStrategy, Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { NgClass } from '@angular/common';\nimport {\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n InputSignal,\n model,\n ModelSignal,\n OnDestroy,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IRibbonButtonOption } from '../../models/ribbon-button-option';\n\n/**\n * A large icon button for a `lib-ribbon-group`. With `options` it becomes a split button whose\n * chevron opens a dropdown list; it can also show a spinner and a brief success, warning or\n * failure state.\n */\n@Component({\n selector: 'lib-ribbon-button',\n templateUrl: './ribbon-button.component.html',\n host: {\n '[class.dropdown]': 'options().length > 0',\n '[class.show]': 'showDropdown()',\n },\n styleUrls: ['./ribbon-button.component.scss'],\n imports: [NgClass, TranslatePipe],\n})\nexport class RibbonButtonComponent implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n private readonly buttonContainer: Signal<ElementRef<HTMLElement> | undefined> =\n viewChild<ElementRef<HTMLElement>>('buttonContainer');\n private readonly optionsDropdown: Signal<TemplateRef<unknown> | undefined> =\n viewChild<TemplateRef<unknown>>('optionsDropdown');\n\n /** CSS class that colours the icon, the spinner and the chevron. Defaults to `text-primary-500`. */\n public readonly color: InputSignal<string> = input('text-primary-500');\n /**\n * Index of the option the main button triggers directly when `options` is set. With `-1`, the\n * default, the main button opens the dropdown instead.\n */\n public readonly defaultOption: InputSignal<number> = input(-1);\n /** Disables the button and its dropdown. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n /** Font Awesome icon class, for example `fa-save`. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n /** Size of the icon: `small` or `large`. Defaults to `large`. */\n public readonly iconSize: InputSignal<'small' | 'large'> = input<'small' | 'large'>('large');\n /** Text under the icon, as a translation key. Hidden when the ribbon is narrow. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Shows a spinner in place of the icon and blocks clicks while `true`. Defaults to `false`. */\n public readonly loading: ModelSignal<boolean> = model(false);\n /**\n * Entries of the dropdown list. When set, the button gets a chevron that opens the list. The\n * button is disabled when none of the options is visible. Defaults to none.\n */\n public readonly options: InputSignal<IRibbonButtonOption[]> = input<IRibbonButtonOption[]>([]);\n /**\n * Hover text, shown as given; the translated label is shown on hover when it is empty. Also\n * names the button for screen readers, translated, when there is no label. Defaults to empty.\n */\n public readonly tooltip: InputSignal<string> = input('');\n\n /**\n * Emits when the button is activated. Carries the `id` of the chosen option, or `undefined` for\n * a button without options.\n */\n public readonly action: OutputEmitterRef<string | undefined> = output<string | undefined>();\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n if (this.showDropdown()) {\n const target: HTMLElement = <HTMLElement>event.target;\n\n const button: HTMLElement | null | undefined = target.closest('.button-container')?.parentElement;\n\n this.clickedOutside =\n event.button === 0 &&\n !target.closest('.options-dropdown') &&\n (!button || (!button?.classList.contains('dropdown') && !button?.classList.contains('open')));\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.showDropdown() && this.clickedOutside) {\n this.closeDropdown();\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected documentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscape: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (this.showDropdown() && isEscape) {\n this.closeDropdown();\n }\n }\n //#endregion\n\n //#region Variables\n protected readonly showDropdown: WritableSignal<boolean> = signal(false);\n protected readonly status: WritableSignal<null | 'failure' | 'warning' | 'success'> = signal(null);\n\n // Stable per instance, so the chevron has something to point `aria-labelledby` at. Same shape\n // as TabsComponent and CatalogSelectComponent, which is where this pattern already lives.\n private static instances = 0;\n private readonly instanceId: string = `ribbon-button-${RibbonButtonComponent.instances++}`;\n\n private clickedOutside = false;\n private overlay: Overlay = inject(Overlay);\n private overlayRef?: OverlayRef;\n private positionBuilder: OverlayPositionBuilder = inject(OverlayPositionBuilder);\n private viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n //#endregion\n\n //#region Properties\n /**\n * What this button is called, whether or not its label is on screen. Compact mode hides the\n * label below 36rem of ribbon width, and an icon with no accessible name is unusable with a\n * screen reader. The tooltip is the fallback because a consumer who gives one and no label has\n * already said what the button does; with neither there is nothing to invent.\n */\n protected get accessibleName(): string {\n return this.label() || this.tooltip();\n }\n\n /** Id of the label element, so the dropdown chevron can borrow this button's name. */\n protected get labelId(): string {\n return `${this.instanceId}-label`;\n }\n\n /**\n * The chevron borrows the button's name by reference, but only when there is a label element\n * with text in it. A reference to an empty span names the control *nothing at all*, which is\n * worse than leaving it unnamed: it suppresses the fallback a screen reader would otherwise\n * use. An icon-only button with a tooltip is the case that exposes this.\n */\n protected get chevronLabelledBy(): string | null {\n return this.label() ? this.labelId : null;\n }\n\n /** The chevron's name when there is no label element to point at. */\n protected get chevronAriaLabel(): string | null {\n return this.label() ? null : this.tooltip() || null;\n }\n\n protected get buttonIcon(): string {\n switch (this.status()) {\n case 'success':\n return 'fa-check';\n case 'failure':\n return 'fa-times';\n case 'warning':\n return 'fa-exclamation';\n default:\n return this.icon() ?? '';\n }\n }\n\n protected get isButtonDisabled(): boolean {\n return (\n this.disabled() ||\n this.loading() ||\n (this.options().length > 0 && !this.options().some((option: IRibbonButtonOption) => this.isOptionVisible(option)))\n );\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngOnDestroy(): void {\n this.closeDropdown();\n }\n //#endregion\n\n //#region Event handlers\n protected onButtonClicked(): void {\n if (this.options().length > 0) {\n if (this.defaultOption() >= 0 && this.defaultOption() < this.options().length) {\n this.closeDropdown();\n this.action.emit(this.options()[this.defaultOption()].id);\n } else {\n this.onShowHideDropdown();\n }\n } else {\n this.action.emit(undefined);\n }\n }\n\n protected onOptionClicked(option: IRibbonButtonOption) {\n this.closeDropdown();\n this.action.emit(option.id);\n }\n\n protected onShowHideDropdown(): void {\n if (this.showDropdown()) {\n this.closeDropdown();\n } else {\n this.openDropdown();\n }\n }\n //#endregion\n\n //#region Public methods\n /** Ends the loading state and shows the given result on the button for one second. */\n public finishLoading(status: 'failure' | 'warning' | 'success'): void {\n this.loading.set(false);\n this.status.set(status);\n\n setTimeout(() => {\n this.status.set(null);\n }, 1000);\n }\n\n /** Puts the button in its loading state, the same as setting `loading` to `true`. */\n public startLoading(): void {\n this.loading.set(true);\n }\n\n protected isOptionDisabled(option: IRibbonButtonOption): boolean {\n return option.isDisabled || ((option.allowedActions?.length ?? 0) > 0 && option.isAccessAllowed === undefined);\n }\n\n protected isOptionVisible(option: IRibbonButtonOption): boolean {\n return (\n (option.isVisible ?? true) &&\n (option.allowedActions === undefined ||\n option.allowedActions.length === 0 ||\n option.isAccessAllowed === true ||\n (option.isAccessAllowed == undefined && option.allowedActions?.length > 0))\n );\n }\n //#endregion\n\n //#region Private methods\n private closeDropdown(): void {\n this.showDropdown.set(false);\n\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n }\n\n /**\n * Opens the options list in an overlay attached to the document rather than inside this button.\n *\n * The list is absolutely positioned and used to live in the button's own subtree, which works\n * only while nothing between it and the page clips. `lib-data-grid` does: it is\n * `overflow: hidden`, its buttons bar is its first child, and a child list's grid is only a few\n * rows tall -- so the export button's options opened downwards into the grid and had their lower\n * part cut off. Measured in Storybook at 129px of list against 65px of room, 64px lost.\n *\n * Nothing smaller fixes it. The grid's clipping is load-bearing -- the rows scroll inside it and\n * its corners are rounded -- and no z-index lifts content out of an ancestor's overflow. Leaving\n * the subtree is the fix, and it is what `lib-catalog-select` already does for its own dropdown.\n *\n * `reposition()` rather than `close()`: the button can move while the list is open, and the list\n * should follow it rather than disappear.\n */\n private openDropdown(): void {\n if (!this.optionsDropdown()) {\n return;\n }\n\n this.closeDropdown();\n\n const positionStrategy: FlexibleConnectedPositionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.buttonContainer()!)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },\n ]);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: false,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n\n this.overlayRef.attach(new TemplatePortal(this.optionsDropdown()!, this.viewContainerRef));\n this.showDropdown.set(true);\n }\n //#endregion\n}\n","<!-- The title falls back to the label so a button that gives no tooltip still explains itself on\n hover once compact mode has taken its label away. -->\n<div #buttonContainer class=\"button-container\" [attr.title]=\"tooltip() || (label() | translate) || null\">\n <!-- aria-label is carried whether or not the label is on screen, because compact mode hides it\n below 36rem of ribbon width and the icon alone names nothing. Null rather than an empty\n string when there is neither label nor tooltip: an empty aria-label names the control\n nothing at all, which suppresses the fallback a screen reader would otherwise use. -->\n <a\n class=\"button\"\n role=\"button\"\n [attr.tabindex]=\"isButtonDisabled ? -1 : 0\"\n [attr.aria-disabled]=\"isButtonDisabled\"\n [attr.aria-label]=\"accessibleName ? (accessibleName | translate) : null\"\n [class.disabled]=\"isButtonDisabled\"\n [class.success]=\"status() === 'success'\"\n [class.warning]=\"status() === 'warning'\"\n [class.failure]=\"status() === 'failure'\"\n [class.small]=\"iconSize() === 'small'\"\n (click)=\"onButtonClicked()\"\n (keydown.enter)=\"onButtonClicked()\"\n (keydown.space)=\"onButtonClicked(); $event.preventDefault()\"\n >\n <span class=\"icon\" [class.loading]=\"loading()\">\n <i class=\"fas fa-fw\" [ngClass]=\"[buttonIcon, color()]\"></i>\n\n <svg [ngClass]=\"[color()]\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n </span>\n\n <span class=\"label\" [id]=\"labelId\" [class.text-white]=\"status() !== null\">\n {{ label() | translate }}\n </span>\n </a>\n\n @if (options().length > 0) {\n <a\n class=\"button-dropdown\"\n role=\"button\"\n [attr.tabindex]=\"isButtonDisabled ? -1 : 0\"\n [attr.aria-disabled]=\"isButtonDisabled\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"showDropdown()\"\n [attr.aria-labelledby]=\"chevronLabelledBy\"\n [attr.aria-label]=\"chevronAriaLabel ? (chevronAriaLabel | translate) : null\"\n [class.disabled]=\"isButtonDisabled\"\n [class.success]=\"status() === 'success'\"\n [class.warning]=\"status() === 'warning'\"\n [class.failure]=\"status() === 'failure'\"\n [class.small]=\"iconSize() === 'small'\"\n (click)=\"onShowHideDropdown()\"\n (keydown.enter)=\"onShowHideDropdown()\"\n (keydown.space)=\"onShowHideDropdown(); $event.preventDefault()\"\n >\n <i class=\"fas fa-chevron-down\" [ngClass]=\"[color()]\"></i>\n </a>\n }\n</div>\n\n<!-- Rendered into a CDK overlay rather than here, so the list is not cut off by an ancestor that\n clips -- lib-data-grid does, and its buttons bar sits at the top of it. The `open` class is\n what the styles key on now that the list is no longer inside this component's `.show` host. -->\n<ng-template #optionsDropdown>\n <ul class=\"options-dropdown open\" role=\"menu\">\n @for (option of options(); track option; let i = $index) {\n <li\n role=\"menuitem\"\n [attr.tabindex]=\"isOptionDisabled(option) || !isOptionVisible(option) ? -1 : 0\"\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\n [class.default-option]=\"i === defaultOption()\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [class.hidden]=\"!isOptionVisible(option)\"\n (click)=\"onOptionClicked(option)\"\n (keydown.enter)=\"onOptionClicked(option)\"\n (keydown.space)=\"onOptionClicked(option); $event.preventDefault()\"\n >\n @if (!!option.icon) {\n <i class=\"fas fa-fw\" [ngClass]=\"[option.icon, color()]\"></i>\n }\n {{ option.label | translate }}\n </li>\n }\n </ul>\n</ng-template>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * The toolbar strip at the top of a view. Project `lib-ribbon-group` elements as content; content\n * marked with the `right` attribute is placed at the far end.\n */\n@Component({\n selector: 'lib-ribbon',\n templateUrl: './ribbon.component.html',\n styleUrls: ['./ribbon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RibbonComponent {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n //#region Host listeners\n //#endregion\n //#region Variables\n //#endregion\n //#region Properties\n //#endregion\n //#region Constructor and Angular life cycle methods\n //#endregion\n //#region Event handlers\n //#endregion\n //#region Public methods\n //#endregion\n //#region Private methods\n //#endregion\n}\n","<div>\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[right]\"></ng-content>\n","import { Component, computed, contentChildren, Input, Signal } from '@angular/core';\n\nimport { RibbonGroupChild } from '../../models/ribbon-group-child';\n\n/**\n * A labelled group of buttons inside a `lib-ribbon`. The group hides itself when it holds no\n * visible `RibbonGroupChild`, such as the framework ribbon buttons. A plain `lib-ribbon-button` is\n * not one, so a group holding only those stays hidden.\n */\n@Component({\n selector: 'lib-ribbon-group',\n templateUrl: './ribbon-group.component.html',\n styleUrls: ['./ribbon-group.component.scss'],\n host: { '[class.hidden]': '!hasChildren()' },\n})\nexport class RibbonGroupComponent {\n //#region ViewChilds, Inputs, Outputs\n // A signal query, so a child arriving or leaving re-runs `hasChildren` on its own.\n /** The `RibbonGroupChild` elements projected into the group, at any depth. */\n public readonly children: Signal<readonly RibbonGroupChild[]> = contentChildren(RibbonGroupChild, {\n descendants: true,\n });\n\n /** Caption shown under the group's buttons. Shown as given, not translated. Defaults to empty. */\n @Input() public label = '';\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n protected readonly hasChildren: Signal<boolean> = computed(() =>\n this.children().some((child: RibbonGroupChild) => child.isVisible()),\n );\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"label\">\n <span>{{ label }}</span>\n</div>\n","import { Component, input, InputSignal } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n/**\n * The bubble that `libTooltip` shows. The directive creates it in an overlay; you do not place it\n * in a template yourself.\n *\n * The text goes through the `translate` pipe, so a translation key shows its translation and plain\n * text shows as given. It also follows a language change while the tooltip is open.\n */\n@Component({\n selector: 'lib-tooltip',\n template: `{{ text() | translate }}`,\n styleUrls: ['./tooltip.component.scss'],\n host: {\n class: 'lib-tooltip',\n role: 'tooltip',\n '[attr.id]': 'tooltipId()',\n },\n imports: [TranslatePipe],\n})\nexport class TooltipComponent {\n //#region Inputs\n /** The hint to show, as a translation key or plain text. Defaults to empty. */\n public readonly text: InputSignal<string> = input('');\n\n /** Id of the tooltip element, which the trigger points `aria-describedby` at. */\n public readonly tooltipId: InputSignal<string | undefined> = input<string>();\n //#endregion\n}\n","import { ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n InputSignal,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport { TooltipComponent } from './tooltip.component';\n\n/** Side of the trigger the tooltip prefers. `start` and `end` follow the text direction. */\nexport type TooltipPosition = 'top' | 'bottom' | 'start' | 'end';\n\n/** Gap between the trigger and the tooltip, in pixels. */\nconst OFFSET = 6;\n\n/** How long the tooltip waits before it hides, so the pointer can cross the gap onto it. */\nconst HIDE_GRACE_MS = 100;\n\n/** How long a finger must stay down before the tooltip shows. */\nconst LONG_PRESS_MS = 500;\n\n/** How long the tooltip stays after a long press ends. */\nconst TOUCH_LINGER_MS = 1500;\n\n/** Mouse events a browser emulates after a touch arrive within this window and are ignored. */\nconst EMULATED_MOUSE_WINDOW_MS = 800;\n\n/** Elements that take focus, used to find the control inside a wrapper. */\nconst FOCUSABLE = 'button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Hides the tooltip on screen, if any. Only one shows at a time: hovering one control while another has\n * keyboard focus would otherwise stack two hints over each other.\n */\nlet hideOpenTooltip: (() => void) | undefined;\n\nconst ABOVE: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -OFFSET,\n};\nconst BELOW: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: OFFSET,\n};\nconst BEFORE: ConnectedPosition = {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -OFFSET,\n};\nconst AFTER: ConnectedPosition = {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: OFFSET,\n};\n\n/** The preferred side first, then its opposite, then the other axis. */\nconst POSITIONS: Record<TooltipPosition, ConnectedPosition[]> = {\n top: [ABOVE, BELOW, AFTER, BEFORE],\n bottom: [BELOW, ABOVE, AFTER, BEFORE],\n start: [BEFORE, AFTER, ABOVE, BELOW],\n end: [AFTER, BEFORE, ABOVE, BELOW],\n};\n\n/**\n * Shows a short themed hint next to an element, on hover and on keyboard focus.\n *\n * Use it instead of the native `title` attribute. `title` shows late, cannot be styled or themed,\n * never shows on keyboard focus and does nothing on touch.\n *\n * The tooltip follows WCAG 1.4.13. Escape dismisses it. The pointer can move onto it without\n * closing it. It stays until the pointer and focus leave, or Escape is pressed. On touch, a long\n * press shows it, and it hides shortly after the finger lifts.\n *\n * While the tooltip is open the trigger's `aria-describedby` points at it. When the directive sits\n * on a wrapper such as `lib-button`, the first focusable element inside gets the attribute\n * instead. Any id already there is kept, and the attribute is restored when the tooltip hides. A tooltip\n * describes; it does not name. An icon-only button still needs its own accessible name.\n */\n@Directive({\n selector: '[libTooltip]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut()',\n '(touchstart)': 'onTouchStart()',\n '(touchend)': 'onTouchEnd()',\n '(touchcancel)': 'onTouchEnd()',\n },\n})\nexport class TooltipDirective {\n //#region Inputs\n /** The hint, as a translation key or plain text. An empty value shows no tooltip. */\n public readonly text: InputSignal<string | null | undefined> = input<string | null | undefined>('', {\n alias: 'libTooltip',\n });\n\n /**\n * Side of the trigger the tooltip prefers: `top`, `bottom`, `start` or `end`. It flips to another\n * side when there is no room. Defaults to `top`.\n */\n public readonly tooltipPosition: InputSignal<TooltipPosition> = input<TooltipPosition>('top');\n\n /** Stops the tooltip from showing, and hides it if it is open. Defaults to `false`. */\n public readonly tooltipDisabled: InputSignal<boolean> = input(false);\n\n /** Milliseconds between hover or focus and the tooltip showing. Defaults to `300`. */\n public readonly tooltipDelay: InputSignal<number> = input(300);\n //#endregion\n\n //#region Variables\n private static instances = 0;\n private readonly tooltipId: string = `lib-tooltip-${TooltipDirective.instances++}`;\n\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly overlay: Overlay = inject(Overlay);\n private readonly renderer: Renderer2 = inject(Renderer2);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n private overlayRef?: OverlayRef;\n private tooltipRef?: ComponentRef<TooltipComponent>;\n private removeListeners: Array<() => void> = [];\n private describedElement?: HTMLElement;\n private previousDescribedBy: string | null = null;\n\n private showTimer?: ReturnType<typeof setTimeout>;\n private hideTimer?: ReturnType<typeof setTimeout>;\n private lastTouch = 0;\n /** Hides this tooltip; also how another tooltip closes it, through `hideOpenTooltip`. */\n private readonly hideThis = (): void => this.hide();\n\n private isHostHovered = false;\n private isTooltipHovered = false;\n private isFocused = false;\n //#endregion\n\n //#region Constructor\n public constructor() {\n // Keep an open tooltip in step with its inputs.\n effect(() => {\n const text: string = this.text() ?? '';\n\n if (this.tooltipDisabled() || !text) {\n this.hide();\n } else {\n this.tooltipRef?.setInput('text', text);\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.hide());\n }\n //#endregion\n\n //#region Event handlers\n protected onMouseEnter(): void {\n if (this.isEmulatedMouse()) {\n return;\n }\n\n this.isHostHovered = true;\n this.scheduleShow(this.tooltipDelay());\n }\n\n protected onMouseLeave(): void {\n this.isHostHovered = false;\n this.scheduleHideIfIdle();\n }\n\n protected onFocusIn(): void {\n if (this.isEmulatedMouse()) {\n return;\n }\n\n this.isFocused = true;\n this.scheduleShow(this.tooltipDelay());\n }\n\n protected onFocusOut(): void {\n this.isFocused = false;\n this.scheduleHideIfIdle();\n }\n\n protected onTouchStart(): void {\n this.lastTouch = Date.now();\n this.scheduleShow(LONG_PRESS_MS);\n }\n\n protected onTouchEnd(): void {\n this.lastTouch = Date.now();\n this.clearShowTimer();\n\n if (this.overlayRef) {\n this.clearHideTimer();\n this.hideTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);\n }\n }\n //#endregion\n\n //#region Public methods\n /** Shows the tooltip now, without the delay. Does nothing when disabled or empty. */\n public show(): void {\n this.clearShowTimer();\n this.clearHideTimer();\n\n if (this.overlayRef || this.tooltipDisabled() || !this.text()) {\n return;\n }\n\n if (hideOpenTooltip && hideOpenTooltip !== this.hideThis) {\n hideOpenTooltip();\n }\n hideOpenTooltip = this.hideThis;\n\n const host: HTMLElement = this.host.nativeElement;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(host)\n .withPositions(POSITIONS[this.tooltipPosition()])\n .withFlexibleDimensions(false)\n .withViewportMargin(8),\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n panelClass: 'lib-tooltip-pane',\n });\n\n this.tooltipRef = this.overlayRef.attach(new ComponentPortal(TooltipComponent, this.viewContainerRef));\n this.tooltipRef.setInput('text', this.text());\n this.tooltipRef.setInput('tooltipId', this.tooltipId);\n\n const pane: HTMLElement = this.overlayRef.overlayElement;\n this.removeListeners = [\n this.renderer.listen(pane, 'mouseenter', () => {\n this.isTooltipHovered = true;\n this.clearHideTimer();\n }),\n this.renderer.listen(pane, 'mouseleave', () => {\n this.isTooltipHovered = false;\n this.scheduleHideIfIdle();\n }),\n // Captured on the window, before any document listener. When the tooltip belongs to the\n // focused control, the Escape is its own and stops there, so it does not also close the modal\n // around it. A tooltip shown by hover only closes and lets the Escape reach what has focus,\n // such as an open calendar.\n this.renderer.listen(\n 'window',\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n if (this.isFocused) {\n event.stopPropagation();\n }\n this.hide();\n }\n },\n { capture: true },\n ),\n ];\n\n this.describedElement = this.findDescribedElement();\n this.previousDescribedBy = this.describedElement.getAttribute('aria-describedby');\n const describedBy: string = [this.previousDescribedBy, this.tooltipId].filter(Boolean).join(' ');\n this.describedElement.setAttribute('aria-describedby', describedBy);\n }\n\n /** Hides the tooltip now and gives the trigger back its own `aria-describedby`. */\n public hide(): void {\n this.clearShowTimer();\n this.clearHideTimer();\n this.isTooltipHovered = false;\n\n if (!this.overlayRef) {\n return;\n }\n if (hideOpenTooltip === this.hideThis) {\n hideOpenTooltip = undefined;\n }\n\n this.removeListeners.forEach((remove: () => void) => remove());\n this.removeListeners = [];\n\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n this.tooltipRef = undefined;\n\n if (this.previousDescribedBy) {\n this.describedElement?.setAttribute('aria-describedby', this.previousDescribedBy);\n } else {\n this.describedElement?.removeAttribute('aria-describedby');\n }\n this.describedElement = undefined;\n this.previousDescribedBy = null;\n }\n //#endregion\n\n //#region Private methods\n private scheduleShow(delay: number): void {\n this.clearHideTimer();\n\n if (this.overlayRef || this.showTimer || this.tooltipDisabled() || !this.text()) {\n return;\n }\n\n this.showTimer = setTimeout(() => this.show(), Math.max(0, delay));\n }\n\n /** Hides after a short grace, unless the pointer or focus is still on the trigger or the tooltip. */\n private scheduleHideIfIdle(): void {\n if (this.isHostHovered || this.isTooltipHovered || this.isFocused) {\n return;\n }\n\n this.clearShowTimer();\n this.clearHideTimer();\n\n if (this.overlayRef) {\n this.hideTimer = setTimeout(() => this.hide(), HIDE_GRACE_MS);\n }\n }\n\n /**\n * The element a screen reader announces on focus. On a wrapper such as `lib-button` that is the\n * native control inside it, not the wrapper itself.\n */\n private findDescribedElement(): HTMLElement {\n const host: HTMLElement = this.host.nativeElement;\n\n if (host.matches(FOCUSABLE)) {\n return host;\n }\n\n return host.querySelector<HTMLElement>(FOCUSABLE) ?? host;\n }\n\n private isEmulatedMouse(): boolean {\n return Date.now() - this.lastTouch < EMULATED_MOUSE_WINDOW_MS;\n }\n\n private clearShowTimer(): void {\n clearTimeout(this.showTimer);\n this.showTimer = undefined;\n }\n\n private clearHideTimer(): void {\n clearTimeout(this.hideTimer);\n this.hideTimer = undefined;\n }\n //#endregion\n}\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\n\n/**\n * Turns a TypeScript enum into a list of `{ value, display }` options, where `display` is an\n * observable of the translated enum key. Use it to fill a select from an enum.\n */\n@Pipe({\n name: 'enumTranslate',\n})\nexport class EnumTranslatePipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n private translate: TranslateService = inject(TranslateService);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(enumType: any): Array<{ value: any; display: Observable<any> }> {\n return Object.keys(enumType)\n .filter((key) => isNaN(Number(key)))\n .map((key) => ({\n value: enumType[key],\n display: this.translate.get(key),\n }));\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Replaces several placeholders in a string, for example\n * `'Hello {name}' | replaceMany: { '{name}': user.name }`. Only the first occurrence of each key\n * is replaced; a `null` or `undefined` value becomes an empty string.\n */\n@Pipe({\n name: 'replaceMany',\n})\nexport class ReplaceManyPipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(message: string, replaceArgs?: { [id: string]: string | null | undefined }): string {\n if (replaceArgs) {\n for (const [key, value] of Object.entries(replaceArgs)) {\n message = message.replace(key, value ?? '');\n }\n }\n return message;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Replaces one substring in a string, for example `label | replace: '{0}': count`. Only the first\n * occurrence is replaced; a `null` or `undefined` replacement becomes an empty string.\n */\n@Pipe({\n name: 'replace',\n})\nexport class ReplacePipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(message: string, searchValue: string, replaceValue?: string | null): string {\n return message.replace(searchValue, replaceValue ?? '');\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { NgModule } from '@angular/core';\nimport * as c from './components';\nimport * as d from './directives';\nimport * as p from './pipes';\n\n@NgModule({\n declarations: [],\n imports: [\n c.CatalogSelectComponent,\n c.DataGridComponent,\n c.DataGridRowComponent,\n c.FormInputComponent,\n c.FormInputGroupComponent,\n c.FormGroupComponent,\n c.GroupAccordionComponent,\n c.GroupContainerComponent,\n c.GroupScrollSpyComponent,\n c.SidebarComponent,\n c.ModalComponent,\n c.MultiEditorComponent,\n c.MultiSelectComponent,\n c.MultiSelectResultGridComponent,\n c.RibbonComponent,\n c.RibbonButtonComponent,\n c.RibbonGroupComponent,\n\n d.ScrollSpyDirective,\n\n p.EnumTranslatePipe,\n p.ReplacePipe,\n p.ReplaceManyPipe,\n ],\n exports: [\n c.CatalogSelectComponent,\n c.DataGridComponent,\n c.DataGridRowComponent,\n c.FormInputComponent,\n c.FormInputGroupComponent,\n c.FormGroupComponent,\n c.GroupAccordionComponent,\n c.GroupContainerComponent,\n c.GroupScrollSpyComponent,\n c.SidebarComponent,\n c.ModalComponent,\n c.MultiEditorComponent,\n c.MultiSelectComponent,\n c.MultiSelectResultGridComponent,\n c.RibbonComponent,\n c.RibbonButtonComponent,\n c.RibbonGroupComponent,\n\n d.ScrollSpyDirective,\n\n p.EnumTranslatePipe,\n p.ReplacePipe,\n p.ReplaceManyPipe,\n ],\n})\n/**\n * @deprecated Use standalone component imports instead of LibraryModule.\n * Import individual components directly in your component's `imports` array.\n */\nexport class LibraryModule {}\n","import { Injectable } from '@angular/core';\nimport { DataGridConfigs } from '../../models/configs/data-grid-configs';\nimport { GridConfigsProvider } from './grid-configs.provider';\n\n@Injectable()\nexport class DataGridConfigsProvider extends GridConfigsProvider<DataGridConfigs> {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this._configs = {\n ...this._configs,\n multiSelect: false,\n multiSelectSize: 'min-content',\n } as DataGridConfigs;\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport class DateValidators {\n //#region Public methods\n public static greaterThanControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) <= new Date(compareControl?.value)) {\n return { greaterThanControl: true };\n }\n return null;\n };\n }\n\n public static greaterThanOrEqualControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) < new Date(compareControl?.value)) {\n return { greaterThanOrEqualControl: true };\n }\n return null;\n };\n }\n\n public static greaterThanOrEqualToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) < today) {\n return { greaterThanOrEqualToday: true };\n }\n return null;\n }\n\n public static greaterThanToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) <= today) {\n return { greaterThanToday: true };\n }\n return null;\n }\n\n public static lessThanControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) >= new Date(compareControl?.value)) {\n return { lessThanControl: true };\n }\n return null;\n };\n }\n\n public static lessThanOrEqualControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) > new Date(compareControl?.value)) {\n return { lessThanOrEqualControl: true };\n }\n return null;\n };\n }\n\n public static lessThanOrEqualToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) > today) {\n return { lessThanOrEqualToday: true };\n }\n return null;\n }\n\n public static lessThanToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) >= today) {\n return { lessThanToday: true };\n }\n return null;\n }\n\n public static maxDate(maxDate: Date): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!!control.value && new Date(control.value) > maxDate) {\n return { maxDate: true };\n }\n return null;\n };\n }\n\n public static minDate(minDate: Date): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!!control.value && new Date(control.value) < minDate) {\n return { minDate: true };\n }\n return null;\n };\n }\n //#endregion\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,iBAAb,MAAa,eAAc;CAGT,SAAmC,MAAmB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAGhE,OAAwC,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGvD,MAA4B,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAT7C,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA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wB,KAAI;GAEvC,OAAO;EACT;CACF;CAEO,OAAO,qBAAqB,SAAwB;EACzD,MAAM,wBAAc,IAAI,KAAI;EAC5B,IAAI,CAAC,CAAC,QAAQ,SAAS,IAAI,KAAK,QAAQ,KAAK,IAAI,OAC/C,OAAO,EAAE,sBAAsB,KAAI;EAErC,OAAO;CACT;CAEO,OAAO,cAAc,SAAwB;EAClD,MAAM,wBAAc,IAAI,KAAI;EAC5B,IAAI,CAAC,CAAC,QAAQ,SAAS,IAAI,KAAK,QAAQ,KAAK,KAAK,OAChD,OAAO,EAAE,eAAe,KAAI;EAE9B,OAAO;CACT;CAEO,OAAO,QAAQ,SAAa;EACjC,QAAQ,YAAqD;GAC3D,IAAI,CAAC,CAAC,QAAQ,SAAS,IAAI,KAAK,QAAQ,KAAK,IAAI,SAC/C,OAAO,EAAE,SAAS,KAAI;GAExB,OAAO;EACT;CACF;CAEO,OAAO,QAAQ,SAAa;EACjC,QAAQ,YAAqD;GAC3D,IAAI,CAAC,CAAC,QAAQ,SAAS,IAAI,KAAK,QAAQ,KAAK,IAAI,SAC/C,OAAO,EAAE,SAAS,KAAI;GAExB,OAAO;EACT;CACF;AAED"}
1
+ {"version":3,"file":"zambon-dev-ui-library.mjs","names":[],"sources":["../../../../libs/ui/src/library/components/badge/badge.component.ts","../../../../libs/ui/src/library/components/badge/badge.component.html","../../../../libs/ui/src/library/components/base.component.ts","../../../../libs/ui/src/library/components/button/button.component.ts","../../../../libs/ui/src/library/components/button/button.component.html","../../../../libs/ui/src/library/helpers/locale-format.ts","../../../../libs/ui/src/library/services/locale.service.ts","../../../../libs/ui/src/library/components/calendar/calendar.component.ts","../../../../libs/ui/src/library/components/calendar/calendar.component.html","../../../../libs/ui/src/library/helpers/date-helpers.ts","../../../../libs/ui/src/library/helpers/display-controls.ts","../../../../libs/ui/src/library/helpers/guid-helper.ts","../../../../libs/ui/src/library/helpers/route-formatter.ts","../../../../libs/ui/src/library/helpers/grid-cell-format.ts","../../../../libs/ui/src/library/services/catalog.service.ts","../../../../libs/ui/src/library/services/data-providers/data-provider.service.ts","../../../../libs/ui/src/library/services/datasets/base.dataset.ts","../../../../libs/ui/src/library/services/configs-providers/grid-configs.provider.ts","../../../../libs/ui/src/library/services/datasets/grid.dataset.ts","../../../../libs/ui/src/library/services/datasets/data-grid.dataset.ts","../../../../libs/ui/src/library/services/datasets/multi-editor.dataset.ts","../../../../libs/ui/src/library/services/datasets/multi-select-result.dataset.ts","../../../../libs/ui/src/library/services/form-group.service.ts","../../../../libs/ui/src/library/services/form.service.ts","../../../../libs/ui/src/library/models/ribbon-group-child.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-configs.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-menu.ts","../../../../libs/ui/src/library/models/sidebar/sidebar-menu-open-mode.ts","../../../../libs/ui/src/library/services/sidebar.service.ts","../../../../libs/ui/src/library/components/date-input/date-input.component.ts","../../../../libs/ui/src/library/components/date-input/date-input.component.html","../../../../libs/ui/src/library/components/number-input/number-input.component.ts","../../../../libs/ui/src/library/components/number-input/number-input.component.html","../../../../libs/ui/src/library/components/form-input/form-input.component.ts","../../../../libs/ui/src/library/components/form-input/form-input.component.html","../../../../libs/ui/src/library/components/skeleton/skeleton.component.ts","../../../../libs/ui/src/library/components/skeleton/skeleton.component.html","../../../../libs/ui/src/library/components/form-input-group/form-input-group.component.ts","../../../../libs/ui/src/library/components/form-input-group/form-input-group.component.html","../../../../libs/ui/src/library/components/catalog-select/catalog-select.component.ts","../../../../libs/ui/src/library/components/catalog-select/catalog-select.component.html","../../../../libs/ui/src/library/components/data-grid-row/data-grid-row.component.ts","../../../../libs/ui/src/library/components/data-grid-row/data-grid-row.component.html","../../../../libs/ui/src/library/components/data-grid/data-grid.component.ts","../../../../libs/ui/src/library/components/data-grid/data-grid.component.html","../../../../libs/ui/src/library/components/form-group/form-group.component.ts","../../../../libs/ui/src/library/components/form-group/form-group.component.html","../../../../libs/ui/src/library/components/group-accordion/group-accordion.component.ts","../../../../libs/ui/src/library/components/group-accordion/group-accordion.component.html","../../../../libs/ui/src/library/directives/scroll-spy.directive.ts","../../../../libs/ui/src/library/components/group-container/group-container.component.ts","../../../../libs/ui/src/library/components/group-container/group-container.component.html","../../../../libs/ui/src/library/components/group-scroll-spy/group-scroll-spy.component.ts","../../../../libs/ui/src/library/components/group-scroll-spy/group-scroll-spy.component.html","../../../../libs/ui/src/library/components/modal/modal.component.ts","../../../../libs/ui/src/library/components/modal/modal.component.html","../../../../libs/ui/src/library/components/multi-editor/multi-editor.component.ts","../../../../libs/ui/src/library/components/multi-editor/multi-editor.component.html","../../../../libs/ui/src/library/components/multi-select/result-grid/result-grid.component.ts","../../../../libs/ui/src/library/components/multi-select/result-grid/result-grid.component.html","../../../../libs/ui/src/library/components/multi-select/multi-select.component.ts","../../../../libs/ui/src/library/components/multi-select/multi-select.component.html","../../../../libs/ui/src/library/components/sidebar-item/sidebar-item.component.ts","../../../../libs/ui/src/library/components/sidebar-item/sidebar-item.component.html","../../../../libs/ui/src/library/components/sidebar/sidebar.component.ts","../../../../libs/ui/src/library/components/sidebar/sidebar.component.html","../../../../libs/ui/src/library/components/ribbon-button/ribbon-button.component.ts","../../../../libs/ui/src/library/components/ribbon-button/ribbon-button.component.html","../../../../libs/ui/src/library/components/ribbon/ribbon.component.ts","../../../../libs/ui/src/library/components/ribbon/ribbon.component.html","../../../../libs/ui/src/library/components/ribbon-group/ribbon-group.component.ts","../../../../libs/ui/src/library/components/ribbon-group/ribbon-group.component.html","../../../../libs/ui/src/library/components/tooltip/tooltip.component.ts","../../../../libs/ui/src/library/components/tooltip/tooltip.directive.ts","../../../../libs/ui/src/library/pipes/enum.ts","../../../../libs/ui/src/library/pipes/replace-many.pipe.ts","../../../../libs/ui/src/library/pipes/replace.pipe.ts","../../../../libs/ui/src/library/library.module.ts","../../../../libs/ui/src/library/services/configs-providers/data-grid-configs.provider.ts","../../../../libs/ui/src/library/validators/date.validators.ts"],"sourcesContent":["import { Component, input, InputSignal } from '@angular/core';\n\n/** What the status means, which decides the badge colour. */\nexport type BadgeIntent = 'neutral' | 'success' | 'warning' | 'danger' | 'info' | 'accent';\n\n/**\n * A small coloured label for a status, such as \"Active\" or \"Pending\", in a grid cell or a details\n * view. The text is the projected content.\n *\n * The badge is not interactive. Its text carries the meaning; the colour, icon and dot only\n * support it, so a colour-blind reader loses nothing.\n */\n@Component({\n selector: 'lib-badge',\n templateUrl: './badge.component.html',\n styleUrls: ['./badge.component.scss'],\n host: {\n class: 'lib-badge',\n '[class]': \"'intent-' + intent()\",\n '[class.has-dot]': 'dot()',\n },\n})\nexport class BadgeComponent {\n //#region Inputs\n /** What the status means. Governs the fill and text colour. Defaults to `neutral`. */\n public readonly intent: InputSignal<BadgeIntent> = input<BadgeIntent>('neutral');\n\n /** Font Awesome classes for a leading icon, e.g. `fa-solid fa-check`. The icon is hidden from screen readers. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n\n /** Shows a small dot in the intent colour before the text. Defaults to `false`. */\n public readonly dot: InputSignal<boolean> = input(false);\n //#endregion\n}\n","@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","import { Component, OnDestroy } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n// No strategy on purpose: Angular never inherits `changeDetection`, so one declared here would\n// describe a class that is never instantiated, while every subclass compiles to whatever it\n// declares -- which in v22 means OnPush. Correctness comes from the state below notifying\n// Angular, never from this decorator. See docs/guides/reactivity.md.\n/**\n * Abstract base for the library's components. Gives subclasses a `destroy$` subject that emits\n * and completes when the component is destroyed, for ending subscriptions with `takeUntil`.\n */\n@Component({ template: '' })\nexport abstract class BaseComponent implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { ChangeDetectionStrategy, Component, computed, input, InputSignal, Signal } from '@angular/core';\n\n/** What the button is for, which is what decides how loud it looks. */\nexport type ButtonIntent = 'primary' | 'secondary' | 'danger' | 'ghost';\n\n/**\n * The one button.\n *\n * It replaces the global `.btn` classes, which generated 154 variants by interpolating Tailwind\n * colour names -- `btn blue-500`, `btn red-700` -- in a `@for` loop. Those named a palette entry\n * rather than a purpose, so a screen's buttons were a colour decision taken 154 times, and none of\n * them could follow a theme. An intent says what the button is for and lets the theme decide what\n * that looks like.\n *\n * `lib-ribbon-button` is deliberately not folded in here. It is a different shape -- icon above\n * label, large hit area, an options menu -- and merging the two would produce one component with\n * two personalities. They share the tokens instead.\n *\n * There is no click output: the inner element is a real `<button>`, so a `(click)` bound on\n * `<lib-button>` receives the bubbled event, and a disabled button emits nothing to bubble. For the\n * same reason `type=\"submit\"` works from inside a form with no wiring.\n */\n@Component({\n selector: 'lib-button',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ButtonComponent {\n //#region Inputs\n /** What the button is for. Governs fill and text colour. */\n public readonly intent: InputSignal<ButtonIntent> = input<ButtonIntent>('secondary');\n\n /** Native button type. `submit` works because the rendered button is inside the host's form. */\n public readonly type: InputSignal<'button' | 'submit' | 'reset'> = input<'button' | 'submit' | 'reset'>('button');\n\n /** Disables the native button, so it cannot be clicked or focused. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n\n /** Shows a spinner, announces `aria-busy` and blocks activation -- by the keyboard too. */\n public readonly loading: InputSignal<boolean> = input(false);\n\n /** Transient confirmation. Blocks activation so the action cannot be fired twice. */\n public readonly success: InputSignal<boolean> = input(false);\n\n /** Transient failure. Leaves the button usable so the action can be retried. */\n public readonly error: InputSignal<boolean> = input(false);\n\n /** Font Awesome classes for a leading icon, e.g. `fa-solid fa-floppy-disk`. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n\n /** Required when the button has an icon and no text. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n //#endregion\n\n //#region Properties\n /** Loading and success both stand for \"this action is settled\"; error is retryable. */\n protected readonly isBlocked: Signal<boolean> = computed(() => this.disabled() || this.loading() || this.success());\n //#endregion\n}\n","<button\n class=\"lib-button\"\n [class]=\"'intent-' + intent()\"\n [class.is-loading]=\"loading()\"\n [class.is-success]=\"success()\"\n [class.is-error]=\"error()\"\n [type]=\"type()\"\n [disabled]=\"isBlocked()\"\n [attr.aria-busy]=\"loading() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n>\n @if (loading()) {\n <span class=\"lib-button-spinner\" aria-hidden=\"true\"></span>\n } @else if (success()) {\n <i class=\"fa-solid fa-check fa-fw\" aria-hidden=\"true\"></i>\n } @else if (error()) {\n <i class=\"fa-solid fa-times fa-fw\" aria-hidden=\"true\"></i>\n } @else if (icon()) {\n <i class=\"fa-fw\" [class]=\"icon()\" aria-hidden=\"true\"></i>\n }\n\n <span class=\"lib-button-label\"><ng-content></ng-content></span>\n</button>\n","/**\n * Formatting and parsing of dates and numbers for a given locale, built on the browser's `Intl`.\n *\n * `Intl` knows every locale the browser knows, so nothing here needs Angular's locale data to be\n * registered. That is what lets a field follow the language the application chose rather than the\n * one the operating system is set to.\n */\n\n/** A date part, in the order a locale writes it. */\nexport type DatePart = 'day' | 'month' | 'year';\n\n/** How a locale writes a short numeric date: the part order and the separator between parts. */\nexport interface DatePattern {\n /** Parts in the order the locale writes them, e.g. `['day', 'month', 'year']` for `pt-BR`. */\n order: DatePart[];\n /** Text between parts, e.g. `/` or `.`. */\n separator: string;\n}\n\n/** Decimal and grouping separators of a locale. */\nexport interface NumberSeparators {\n /** Decimal separator, e.g. `,` for `pt-BR`. */\n decimal: string;\n /** Grouping separator, e.g. `.` for `pt-BR`. May be a non-breaking space. */\n group: string;\n}\n\n/** Options for {@link formatLocaleNumber}. */\nexport interface LocaleNumberOptions {\n /** Fewest digits after the decimal separator. Defaults to `0`. */\n minFractionDigits?: number;\n /** Most digits after the decimal separator. Defaults to `3`. */\n maxFractionDigits?: number;\n /** Whether to group thousands. Defaults to `true`. */\n grouping?: boolean;\n}\n\n/** Regions that start the week on Sunday, for browsers without `Intl.Locale` week info. */\nconst SUNDAY_FIRST_REGIONS: ReadonlySet<string> = new Set([\n 'BR',\n 'CA',\n 'HK',\n 'IL',\n 'IN',\n 'JP',\n 'KR',\n 'MX',\n 'PH',\n 'PT',\n 'TW',\n 'US',\n 'ZA',\n]);\n\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst ISO_DATE_TIME = /^(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.\\d+)?)?$/;\n\n/** Whether `locale` is a tag `Intl` accepts. */\nexport function isValidLocale(locale: unknown): locale is string {\n if (typeof locale !== 'string' || locale.trim() === '') {\n return false;\n }\n try {\n return Intl.getCanonicalLocales(locale).length > 0;\n } catch {\n return false;\n }\n}\n\n/** The order and separator of a short numeric date in `locale`. */\nexport function getDatePattern(locale: string): DatePattern {\n const parts: Intl.DateTimeFormatPart[] = new Intl.DateTimeFormat(locale, {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n }).formatToParts(new Date(2001, 10, 22));\n\n const order: DatePart[] = parts\n .map((part: Intl.DateTimeFormatPart) => part.type)\n .filter((type: string): type is DatePart => type === 'day' || type === 'month' || type === 'year');\n const literal: Intl.DateTimeFormatPart | undefined = parts.find(\n (part: Intl.DateTimeFormatPart) => part.type === 'literal',\n );\n\n return { order, separator: literal?.value.trim() || '/' };\n}\n\n/** A short numeric date in `locale`, e.g. `05/12/2026` in `pt-BR` and `12/05/2026` in `en-US`. */\nexport function formatDateText(date: Date, locale: string): string {\n // Built from the pattern rather than formatted directly: some locales add marks around the\n // parts (`2026. 12. 05.` in Korean) that the parser would then have to strip again.\n const { order, separator }: DatePattern = getDatePattern(locale);\n const values: Record<DatePart, string> = {\n day: String(date.getDate()).padStart(2, '0'),\n month: String(date.getMonth() + 1).padStart(2, '0'),\n year: String(date.getFullYear()).padStart(4, '0'),\n };\n return order.map((part: DatePart) => values[part]).join(separator);\n}\n\n/**\n * Reads a date typed in `locale`'s order. Accepts any non-digit separator, digits only\n * (`05122026`), a two-digit year (read as 20xx), and an ISO date (`2026-12-05`). Returns `null`\n * for empty text and for text that is not a real date.\n */\nexport function parseDateText(text: string, locale: string): Date | null {\n const trimmed: string = text.trim();\n if (trimmed === '') {\n return null;\n }\n\n const iso: RegExpMatchArray | null = trimmed.match(ISO_DATE);\n if (iso) {\n return buildDate(Number(iso[1]), Number(iso[2]), Number(iso[3]));\n }\n\n const { order }: DatePattern = getDatePattern(locale);\n let pieces: string[] = trimmed.split(/\\D+/).filter((piece: string) => piece !== '');\n\n if (pieces.length === 1 && (pieces[0].length === 8 || pieces[0].length === 6)) {\n const digits: string = pieces[0];\n const yearLength: number = digits.length === 8 ? 4 : 2;\n pieces = [];\n let index = 0;\n for (const part of order) {\n const length: number = part === 'year' ? yearLength : 2;\n pieces.push(digits.slice(index, index + length));\n index += length;\n }\n }\n\n if (pieces.length !== 3) {\n return null;\n }\n\n const values: Partial<Record<DatePart, string>> = {};\n order.forEach((part: DatePart, index: number) => (values[part] = pieces[index]));\n\n const yearText: string = values.year ?? '';\n if (yearText.length !== 2 && yearText.length !== 4) {\n return null;\n }\n const year: number = yearText.length === 2 ? 2000 + Number(yearText) : Number(yearText);\n\n return buildDate(year, Number(values.month), Number(values.day));\n}\n\n/** Whether `locale` shows the time on a 12-hour clock. */\nexport function uses12HourClock(locale: string): boolean {\n const hourCycle: string | undefined = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).resolvedOptions()\n .hourCycle;\n return hourCycle === 'h11' || hourCycle === 'h12';\n}\n\n/** A time of day in `locale`, e.g. `14:30` in `pt-BR` and `02:30 PM` in `en-US`. */\nexport function formatTimeText(date: Date, locale: string): string {\n return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit' }).format(date);\n}\n\n/**\n * Reads a typed time: `14:30`, `1430`, `9`, `2:30 pm`, `2:30 p.m.`. Returns the hours (0-23) and\n * minutes, or `null` for empty or invalid text.\n */\nexport function parseTimeText(text: string): { hours: number; minutes: number } | null {\n const match: RegExpMatchArray | null = text\n .trim()\n .toLowerCase()\n .replace(/[\\u00a0\\u202f]/g, ' ')\n .match(/^(\\d{1,2})(?:[:.h]?(\\d{2}))?\\s*(?:([ap])\\.?\\s*m?\\.?)?$/);\n if (!match) {\n return null;\n }\n\n let hours = Number(match[1]);\n const minutes: number = match[2] ? Number(match[2]) : 0;\n const meridiem: string | undefined = match[3];\n\n if (minutes > 59) {\n return null;\n }\n if (meridiem) {\n if (hours < 1 || hours > 12) {\n return null;\n }\n hours = (hours % 12) + (meridiem === 'p' ? 12 : 0);\n } else if (hours > 23) {\n return null;\n }\n\n return { hours, minutes };\n}\n\n/** A date written the way the API and the native date input write it: `yyyy-MM-dd`. */\nexport function toIsoDate(date: Date): string {\n return [\n String(date.getFullYear()).padStart(4, '0'),\n String(date.getMonth() + 1).padStart(2, '0'),\n String(date.getDate()).padStart(2, '0'),\n ].join('-');\n}\n\n/** A local date and time written the way the native `datetime-local` input writes it: `yyyy-MM-ddTHH:mm`. */\nexport function toIsoDateTime(date: Date): string {\n return `${toIsoDate(date)}T${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;\n}\n\n/**\n * Reads a value a form control may hold: a `Date`, `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm[:ss]`, or any\n * other string `Date` can parse. A date or date-time with no zone is read as local time, as the\n * native inputs do. Returns `null` for empty or invalid values.\n */\nexport function parseIsoValue(value: unknown): Date | null {\n if (value === null || value === undefined || value === '') {\n return null;\n }\n if (value instanceof Date) {\n return Number.isNaN(value.getTime()) ? null : new Date(value.getTime());\n }\n if (typeof value !== 'string') {\n return null;\n }\n\n const date: RegExpMatchArray | null = value.match(ISO_DATE);\n if (date) {\n return buildDate(Number(date[1]), Number(date[2]), Number(date[3]));\n }\n const dateTime: RegExpMatchArray | null = value.match(ISO_DATE_TIME);\n if (dateTime) {\n const result: Date | null = buildDate(Number(dateTime[1]), Number(dateTime[2]), Number(dateTime[3]));\n result?.setHours(Number(dateTime[4]), Number(dateTime[5]), Number(dateTime[6] ?? 0), 0);\n return result;\n }\n\n const parsed: Date = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed;\n}\n\n/** The first day of the week in `locale`, as `Date.getDay()` numbers it: `0` is Sunday. */\nexport function getFirstDayOfWeek(locale: string): number {\n try {\n const intlLocale: Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n } = new Intl.Locale(locale);\n const firstDay: number | undefined = intlLocale.getWeekInfo?.().firstDay ?? intlLocale.weekInfo?.firstDay;\n if (firstDay !== undefined) {\n // Intl numbers the days 1 (Monday) to 7 (Sunday).\n return firstDay % 7;\n }\n const region: string | undefined = intlLocale.maximize().region;\n return region && SUNDAY_FIRST_REGIONS.has(region) ? 0 : 1;\n } catch {\n return 0;\n }\n}\n\n/** The decimal and grouping separators of `locale`. */\nexport function getNumberSeparators(locale: string): NumberSeparators {\n const parts: Intl.NumberFormatPart[] = new Intl.NumberFormat(locale).formatToParts(12345.6);\n return {\n decimal: parts.find((part: Intl.NumberFormatPart) => part.type === 'decimal')?.value ?? '.',\n group: parts.find((part: Intl.NumberFormatPart) => part.type === 'group')?.value ?? ',',\n };\n}\n\n/** A number in `locale`, e.g. `1.234,5` in `pt-BR`. */\nexport function formatLocaleNumber(value: number, locale: string, options: LocaleNumberOptions = {}): string {\n const minimumFractionDigits: number = options.minFractionDigits ?? 0;\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits,\n maximumFractionDigits: Math.max(options.maxFractionDigits ?? 3, minimumFractionDigits),\n useGrouping: options.grouping ?? true,\n }).format(value);\n}\n\n/**\n * Reads a number typed in `locale`. Spaces are ignored. Grouping separators are accepted only\n * between groups of three digits, so `1.5` in `pt-BR` is not a number rather than 15. The decimal\n * separator is the locale's. Returns `null` for empty text and `NaN` for text that is not a number.\n */\nexport function parseLocaleNumber(text: string, locale: string): number | null {\n const { decimal, group }: NumberSeparators = getNumberSeparators(locale);\n let normalized: string = text.replace(/[\\s\\u00a0\\u202f]/g, '');\n if (normalized === '') {\n return null;\n }\n\n if (group.trim() !== '' && normalized.includes(group)) {\n // A grouping separator must sit between groups of three digits. Without this check `1.5` in\n // `pt-BR`, where `.` groups thousands, would silently read as 15.\n const integerPart: string = normalized.split(decimal)[0].replace(/^[-\\u2212]/, '');\n const groups: string[] = integerPart.split(group);\n const isGrouped: boolean =\n /^\\d{1,3}$/.test(groups[0]) && groups.slice(1).every((piece: string) => /^\\d{3}$/.test(piece));\n if (!isGrouped) {\n return Number.NaN;\n }\n normalized = normalized.split(group).join('');\n }\n if (decimal !== '.') {\n if (normalized.includes('.')) {\n return Number.NaN;\n }\n normalized = normalized.replace(decimal, '.');\n }\n // Unicode minus, which some locales format with.\n normalized = normalized.replace(/^\\u2212/, '-');\n\n return /^-?(\\d+\\.?\\d*|\\.\\d+)$/.test(normalized) ? Number(normalized) : Number.NaN;\n}\n\n/**\n * Reads an Angular `DecimalPipe` digits string, `{minInt}.{minFrac}-{maxFrac}`, into fraction-digit\n * limits. Returns `undefined` when `digitsInfo` is empty or malformed.\n */\nexport function parseDigitsInfo(\n digitsInfo: string | undefined,\n): { minFractionDigits: number; maxFractionDigits: number } | undefined {\n const match: RegExpMatchArray | null | undefined = digitsInfo?.match(/^(\\d+)?\\.(\\d+)?(?:-(\\d+))?$/);\n if (!match) {\n return undefined;\n }\n const minFractionDigits: number = match[2] !== undefined ? Number(match[2]) : 0;\n const maxFractionDigits: number = match[3] !== undefined ? Number(match[3]) : Math.max(minFractionDigits, 3);\n return { minFractionDigits, maxFractionDigits: Math.max(minFractionDigits, maxFractionDigits) };\n}\n\nfunction buildDate(year: number, month: number, day: number): Date | null {\n if (!Number.isInteger(year) || month < 1 || month > 12 || day < 1 || day > 31) {\n return null;\n }\n const date: Date = new Date(year, month - 1, day);\n // Years 0-99 map to 1900-1999 in the constructor; set it again to keep the year typed.\n date.setFullYear(year);\n // new Date(2026, 1, 31) rolls over to March; a date that rolled over was not a real date.\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null;\n }\n return date;\n}\n","import { computed, inject, Injectable, LOCALE_ID, Signal, signal, WritableSignal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { TranslateService } from '@ngx-translate/core';\nimport { merge } from 'rxjs';\nimport { isValidLocale } from '../helpers/locale-format';\n\n/**\n * The locale of the language the application shows, as a signal.\n *\n * Angular's `LOCALE_ID` is fixed when the application starts, but the language can change at run\n * time through ngx-translate. Date and number fields read this service instead, so they follow the\n * language the user picked rather than the browser's or the start-up one.\n *\n * The locale comes from, in order:\n *\n * 1. The `locale` translation key of the current language (the framework files ship `en-US` and\n * `pt-BR`).\n * 2. The current ngx-translate language code, when it is a valid locale tag.\n * 3. Angular's `LOCALE_ID`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class LocaleService {\n //#region Variables\n private readonly fallbackLocale: string = inject(LOCALE_ID);\n private readonly translate: TranslateService | null = inject(TranslateService, { optional: true });\n\n /** Bumped whenever the language or its translations change, so `locale` reads them again. */\n private readonly languageChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n /** The current locale tag, such as `pt-BR`. Updates when the application language changes. */\n public readonly locale: Signal<string> = computed(() => {\n this.languageChanged();\n return this.resolveLocale();\n });\n //#endregion\n\n //#region Constructor\n constructor() {\n if (this.translate) {\n merge(this.translate.onLangChange, this.translate.onTranslationChange, this.translate.onDefaultLangChange)\n .pipe(takeUntilDestroyed())\n .subscribe(() => this.languageChanged.update((count: number) => count + 1));\n }\n }\n //#endregion\n\n //#region Private methods\n private resolveLocale(): string {\n if (this.translate) {\n const fromKey: unknown = this.translate.currentLang ? this.translate.instant('locale') : undefined;\n if (fromKey !== 'locale' && isValidLocale(fromKey)) {\n return fromKey;\n }\n\n const language: string | undefined = this.translate.currentLang || this.translate.defaultLang;\n if (isValidLocale(language)) {\n return language;\n }\n }\n return this.fallbackLocale;\n }\n //#endregion\n}\n","import {\n afterNextRender,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n InputSignal,\n linkedSignal,\n output,\n OutputEmitterRef,\n Signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { getFirstDayOfWeek, parseIsoValue } from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\n\n/** One day cell of the month grid. */\ninterface CalendarDay {\n date: Date;\n key: string;\n label: string;\n fullLabel: string;\n isOutsideMonth: boolean;\n isToday: boolean;\n isSelected: boolean;\n isActive: boolean;\n isDisabled: boolean;\n}\n\n/** One weekday column heading. */\ninterface CalendarWeekday {\n short: string;\n long: string;\n}\n\n/**\n * A month calendar for picking a day.\n *\n * Month names, weekday names, the first day of the week and every label come from `Intl` in the\n * application's language (see `LocaleService`), so the calendar needs no translation keys.\n *\n * `lib-date-input` opens it in a popup. It can also sit inline on a page.\n *\n * Keyboard: the arrow keys move by day and week, Home and End go to the start and end of the week,\n * Page Up and Page Down change the month (with Shift, the year), Enter or Space picks the day, and\n * Escape emits `cancelled`.\n */\n@Component({\n selector: 'lib-calendar',\n templateUrl: './calendar.component.html',\n styleUrls: ['./calendar.component.scss'],\n host: {\n class: 'lib-calendar',\n },\n})\nexport class CalendarComponent {\n //#region Inputs and outputs\n /** The chosen day: a `Date` or a `yyyy-MM-dd` string. Defaults to none. */\n public readonly selected: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Earliest day that can be picked: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly min: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Latest day that can be picked: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly max: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Locale to show the calendar in. Defaults to the application's language. */\n public readonly locale: InputSignal<string | undefined> = input<string>();\n\n /** Emits the day the user picked, at midnight local time. */\n public readonly dateSelected: OutputEmitterRef<Date> = output<Date>();\n /** Emits when the user presses Escape. */\n public readonly cancelled: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly injector: Injector = inject(Injector);\n private readonly localeService: LocaleService = inject(LocaleService);\n private readonly grid: Signal<ElementRef<HTMLElement> | undefined> = viewChild<ElementRef<HTMLElement>>('grid');\n //#endregion\n\n //#region Properties\n protected readonly currentLocale: Signal<string> = computed(() => this.locale() || this.localeService.locale());\n\n protected readonly selectedDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.selected())));\n protected readonly minDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.min())));\n protected readonly maxDate: Signal<Date | null> = computed(() => startOfDay(parseIsoValue(this.max())));\n\n /** The day that holds keyboard focus. Starts at the chosen day, else today, kept within the limits. */\n protected readonly activeDate: WritableSignal<Date> = linkedSignal(() => this.clamp(this.selectedDate() ?? today()));\n\n protected readonly monthLabel: Signal<string> = computed(() => this.monthName(this.activeDate()));\n protected readonly previousMonthLabel: Signal<string> = computed(() => this.monthName(this.monthStart(-1)));\n protected readonly nextMonthLabel: Signal<string> = computed(() => this.monthName(this.monthStart(1)));\n\n protected readonly todayLabel: Signal<string> = computed(() => {\n const text: string = new Intl.RelativeTimeFormat(this.currentLocale(), { numeric: 'auto' }).format(0, 'day');\n return text.charAt(0).toLocaleUpperCase(this.currentLocale()) + text.slice(1);\n });\n\n protected readonly isTodayDisabled: Signal<boolean> = computed(() => this.isDisabled(today()));\n protected readonly isPreviousDisabled: Signal<boolean> = computed(() => {\n const min: Date | null = this.minDate();\n return !!min && endOfMonth(this.monthStart(-1)) < min;\n });\n protected readonly isNextDisabled: Signal<boolean> = computed(() => {\n const max: Date | null = this.maxDate();\n return !!max && this.monthStart(1) > max;\n });\n\n protected readonly weekdays: Signal<CalendarWeekday[]> = computed(() => {\n const locale: string = this.currentLocale();\n const firstDay: number = getFirstDayOfWeek(locale);\n const short: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { weekday: 'narrow' });\n const long: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { weekday: 'long' });\n // 4 January 1970 was a Sunday.\n return Array.from({ length: 7 }, (_: unknown, index: number) => {\n const day: Date = new Date(1970, 0, 4 + ((firstDay + index) % 7));\n return { short: short.format(day), long: long.format(day) };\n });\n });\n\n protected readonly weeks: Signal<CalendarDay[][]> = computed(() => {\n const locale: string = this.currentLocale();\n const active: Date = this.activeDate();\n const selected: Date | null = this.selectedDate();\n const now: Date = today();\n const firstDay: number = getFirstDayOfWeek(locale);\n const fullFormat: Intl.DateTimeFormat = new Intl.DateTimeFormat(locale, { dateStyle: 'full' });\n\n const offset: number = (new Date(active.getFullYear(), active.getMonth(), 1).getDay() - firstDay + 7) % 7;\n\n const weeks: CalendarDay[][] = [];\n for (let week = 0; week < 6; week++) {\n const days: CalendarDay[] = [];\n for (let weekday = 0; weekday < 7; weekday++) {\n const date: Date = new Date(active.getFullYear(), active.getMonth(), 1 - offset + week * 7 + weekday);\n days.push({\n date,\n key: date.toDateString(),\n label: String(date.getDate()),\n fullLabel: fullFormat.format(date),\n isOutsideMonth: date.getMonth() !== active.getMonth(),\n isToday: isSameDay(date, now),\n isSelected: !!selected && isSameDay(date, selected),\n isActive: isSameDay(date, active),\n isDisabled: this.isDisabled(date),\n });\n }\n weeks.push(days);\n }\n return weeks;\n });\n //#endregion\n\n //#region Event handlers\n protected onDayClick(day: CalendarDay): void {\n if (!day.isDisabled) {\n this.activeDate.set(day.date);\n this.dateSelected.emit(day.date);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n const active: Date = this.activeDate();\n const weekdayIndex: number = (active.getDay() - getFirstDayOfWeek(this.currentLocale()) + 7) % 7;\n let next: Date | undefined;\n\n switch (event.key) {\n case 'ArrowLeft':\n next = addDays(active, -1);\n break;\n case 'ArrowRight':\n next = addDays(active, 1);\n break;\n case 'ArrowUp':\n next = addDays(active, -7);\n break;\n case 'ArrowDown':\n next = addDays(active, 7);\n break;\n case 'Home':\n next = addDays(active, -weekdayIndex);\n break;\n case 'End':\n next = addDays(active, 6 - weekdayIndex);\n break;\n case 'PageUp':\n next = addMonthsKeepingDay(active, event.shiftKey ? -12 : -1);\n break;\n case 'PageDown':\n next = addMonthsKeepingDay(active, event.shiftKey ? 12 : 1);\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n if (!this.isDisabled(active)) {\n this.dateSelected.emit(active);\n }\n return;\n case 'Escape':\n event.preventDefault();\n event.stopPropagation();\n this.cancelled.emit();\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.activeDate.set(this.clamp(next));\n this.focusActiveDay();\n }\n\n protected onPreviousMonth(): void {\n this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), -1)));\n }\n\n protected onNextMonth(): void {\n this.activeDate.set(this.clamp(addMonthsKeepingDay(this.activeDate(), 1)));\n }\n\n protected onToday(): void {\n const now: Date = today();\n if (!this.isDisabled(now)) {\n this.activeDate.set(now);\n this.dateSelected.emit(now);\n }\n }\n\n protected onEscape(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.cancelled.emit();\n }\n //#endregion\n\n //#region Public methods\n /** Moves keyboard focus to the active day, after the next render. */\n public focusActiveDay(): void {\n afterNextRender(\n () => this.grid()?.nativeElement.querySelector<HTMLButtonElement>('button[tabindex=\"0\"]')?.focus(),\n { injector: this.injector },\n );\n }\n //#endregion\n\n //#region Private methods\n private monthStart(months: number): Date {\n const active: Date = this.activeDate();\n return new Date(active.getFullYear(), active.getMonth() + months, 1);\n }\n\n private clamp(date: Date): Date {\n const min: Date | null = this.minDate();\n const max: Date | null = this.maxDate();\n if (min && date < min) {\n return min;\n }\n if (max && date > max) {\n return max;\n }\n return date;\n }\n\n private isDisabled(date: Date): boolean {\n const min: Date | null = this.minDate();\n const max: Date | null = this.maxDate();\n return (!!min && date < min) || (!!max && date > max);\n }\n\n private monthName(date: Date): string {\n return new Intl.DateTimeFormat(this.currentLocale(), { month: 'long', year: 'numeric' }).format(date);\n }\n //#endregion\n}\n\nfunction today(): Date {\n const now: Date = new Date();\n return new Date(now.getFullYear(), now.getMonth(), now.getDate());\n}\n\nfunction startOfDay(date: Date | null): Date | null {\n return date ? new Date(date.getFullYear(), date.getMonth(), date.getDate()) : null;\n}\n\nfunction endOfMonth(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0);\n}\n\nfunction addDays(date: Date, days: number): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\n/** Moves by whole months and keeps the day, or the month's last day when it is shorter. */\nfunction addMonthsKeepingDay(date: Date, months: number): Date {\n const target: Date = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const lastDay: number = endOfMonth(target).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(date.getDate(), lastDay));\n}\n\nfunction isSameDay(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n}\n","<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","export class DateHelpers {\n //#region Public methods\n public static diffDays(initialDate: Date, finalDate: Date): number {\n const initialDateOnly: Date = new Date(initialDate.getFullYear(), initialDate.getMonth(), initialDate.getDate());\n const finalDateOnly: Date = new Date(finalDate.getFullYear(), finalDate.getMonth(), finalDate.getDate());\n\n const diff: number = initialDateOnly.getTime() - finalDateOnly.getTime();\n return Math.floor(diff / (1000 * 60 * 60 * 24));\n }\n //#endregion\n}\n","import { AbstractControl } from '@angular/forms';\n\n/**\n * Tracks the form controls that exist only to show a catalog selection's label.\n *\n * `lib-catalog-select` works in pairs: the control named by `controlName` holds the identifier, and\n * the one named by `displayControlName` holds the text the user reads. The second is created by the\n * component itself when a screen does not declare it, so a form ends up carrying controls nobody\n * wrote down — and a filters form then submits them alongside the real filters.\n *\n * The mark lives in a `WeakSet` keyed by the control instance rather than by its name. That is the\n * only scope that is actually correct: two forms may each have an `employeeName`, and only the one\n * a catalog select drives is a display control. It also keeps nothing alive.\n */\nexport class DisplayControls {\n //#region Variables\n private static readonly marked: WeakSet<AbstractControl> = new WeakSet<AbstractControl>();\n //#endregion\n\n //#region Public methods\n /**\n * Whether the control exists only to display a catalog selection's label.\n *\n * @param control The control, which may be absent.\n * @returns `true` when a catalog select drives it as its display control.\n */\n public static isDisplayControl(control: AbstractControl | null | undefined): boolean {\n return !!control && DisplayControls.marked.has(control);\n }\n\n /**\n * Marks the control as existing only to display a catalog selection's label.\n *\n * @param control The control, which may be absent.\n */\n public static markAsDisplayControl(control: AbstractControl | null | undefined): void {\n if (control) {\n DisplayControls.marked.add(control);\n }\n }\n //#endregion\n}\n","export class GuidHelper {\n public static generateGUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c: string) => {\n const r: number = (Math.random() * 16) | 0;\n const v: number = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nexport abstract class RouterFormatter {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public static getURL(route: ActivatedRouteSnapshot): string {\n let parentRoute = '';\n if (route.parent) {\n parentRoute = this.getURL(route.parent);\n }\n\n let path = route.routeConfig?.path ?? '';\n route.paramMap.keys.forEach((k) => {\n path = path.replace(':' + k, k === 'view' ? '' : (route.paramMap.get(k) ?? ''));\n });\n\n if (!route.parent || (parentRoute !== '' && parentRoute !== '/' && route.routeConfig?.path && path)) {\n parentRoute += '/';\n }\n\n return parentRoute + path;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import type { BadgeIntent } from '../components/badge/badge.component';\nimport type { GridColumnAlign, IGridColumn } from '../models/grid-column';\nimport { formatDateText, formatLocaleNumber, formatTimeText, parseIsoValue } from './locale-format';\n\n/** What a typed grid cell shows, worked out by {@link formatGridCellValue}. */\nexport interface GridCellDisplay {\n /** How the row renders the cell: plain text, a check icon, or a badge. */\n kind: 'text' | 'boolean' | 'badge';\n /**\n * The text to show. When `translate` is `true` it is a translation key: an `enumValues` entry, or\n * the `trueText`/`falseText` of a boolean column. For a boolean cell it is the hidden text for\n * screen readers, and empty when the column gives none.\n */\n text: string;\n /** Whether `text` is a translation key that still has to go through the translate pipe. */\n translate: boolean;\n /** For a boolean cell, whether the value is true and the check icon shows. */\n checked?: boolean;\n /** For a badge cell, the badge intent. */\n intent?: BadgeIntent;\n}\n\n/** Texts a boolean cell falls back to when its column names none: the grid's settings. */\nexport interface GridCellTextDefaults {\n /** Hidden text for a true value, as a translation key or plain text. */\n trueText?: string;\n /** Hidden text for a false value, as a translation key or plain text. */\n falseText?: string;\n}\n\n/** A date with no time, `yyyy-MM-dd`: a calendar day, not an instant. */\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\n/** A trailing `Z` or `+hh:mm` offset: the value already names its zone. */\nconst TIME_ZONE_MARKER = /(?:Z|[+-]\\d{2}:?\\d{2})$/i;\n\n/** The alignment a column's cells and header take: the column's own, or the default for its type. */\nexport function getGridColumnAlign(column: IGridColumn): GridColumnAlign {\n if (column.align) {\n return column.align;\n }\n switch (column.type) {\n case 'number':\n case 'currency':\n case 'percent':\n return 'end';\n case 'boolean':\n return 'center';\n default:\n return 'start';\n }\n}\n\n/** Whether a column holds numbers, which are set in tabular figures so the digits line up. */\nexport function isNumericGridColumn(column: IGridColumn): boolean {\n return column.type === 'number' || column.type === 'currency' || column.type === 'percent';\n}\n\n/**\n * Formats a cell value by its column's `type`, in `locale`. A column with no type shows the value as\n * it is. `null`, `undefined` and `''` give an empty cell. A value the type cannot read, such as text\n * in a number column, falls back to the raw text. A boolean column with no `trueText`/`falseText`\n * uses `defaults`, so screen readers always hear something.\n */\nexport function formatGridCellValue(\n value: unknown,\n column: IGridColumn,\n locale: string,\n defaults: GridCellTextDefaults = {},\n): GridCellDisplay {\n if (value === null || value === undefined || value === '') {\n return text('');\n }\n\n try {\n switch (column.type) {\n case 'number':\n return formatNumber(value, column, locale);\n case 'currency':\n return formatCurrency(value, column, locale);\n case 'percent':\n return formatPercent(value, column, locale);\n case 'date':\n case 'datetime':\n return formatDate(value, column, locale);\n case 'boolean':\n return formatBoolean(value, column, defaults);\n case 'enum':\n case 'badge':\n return formatEnum(value, column);\n default:\n return text(String(value));\n }\n } catch {\n // An unknown currency code or an out-of-range digit count makes Intl throw.\n return text(String(value));\n }\n}\n\nfunction text(value: string): GridCellDisplay {\n return { kind: 'text', text: value, translate: false };\n}\n\nfunction toNumber(value: unknown): number | null {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : null;\n }\n if (typeof value === 'string' && value.trim() !== '') {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : null;\n }\n return null;\n}\n\n/**\n * Fraction digits for `Intl.NumberFormat`. Only what the column sets is passed on, so a currency\n * keeps its own digits and a percent its whole numbers unless the column says otherwise.\n */\nfunction fractionDigits(\n column: IGridColumn,\n defaultMin: (decimals: number) => number,\n): { minimumFractionDigits?: number; maximumFractionDigits?: number } {\n const digits: { minimumFractionDigits?: number; maximumFractionDigits?: number } = {};\n if (column.decimals !== undefined) {\n digits.minimumFractionDigits = column.minDecimals ?? defaultMin(column.decimals);\n digits.maximumFractionDigits = Math.max(column.decimals, digits.minimumFractionDigits);\n } else if (column.minDecimals !== undefined) {\n digits.minimumFractionDigits = column.minDecimals;\n }\n return digits;\n}\n\nfunction formatNumber(value: unknown, column: IGridColumn, locale: string): GridCellDisplay {\n const number: number | null = toNumber(value);\n if (number === null) {\n return text(String(value));\n }\n return text(\n formatLocaleNumber(number, locale, {\n minFractionDigits: column.minDecimals ?? 0,\n maxFractionDigits: column.decimals ?? 2,\n }),\n );\n}\n\nfunction formatCurrency(value: unknown, column: IGridColumn, locale: string): GridCellDisplay {\n const number: number | null = toNumber(value);\n if (number === null) {\n return text(String(value));\n }\n if (!column.currency) {\n // Without a currency there is no symbol to show; the amount still reads as money.\n return text(formatLocaleNumber(number, locale, { minFractionDigits: 2, maxFractionDigits: 2 }));\n }\n // With `decimals`, a currency shows exactly that many digits, as amounts usually do.\n return text(\n new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: column.currency,\n ...fractionDigits(column, (decimals: number) => decimals),\n }).format(number),\n );\n}\n\nfunction formatPercent(value: unknown, column: IGridColumn, locale: string): GridCellDisplay {\n const number: number | null = toNumber(value);\n if (number === null) {\n return text(String(value));\n }\n return text(new Intl.NumberFormat(locale, { style: 'percent', ...fractionDigits(column, () => 0) }).format(number));\n}\n\nfunction parseCellDate(value: unknown, utc: boolean): Date | null {\n if (!utc || typeof value !== 'string') {\n return parseIsoValue(value);\n }\n\n const trimmed: string = value.trim();\n const parsed: Date | null = parseIsoValue(trimmed);\n // A date with no time is a calendar day, not an instant: shifting it would show the day before\n // anywhere west of Greenwich, such as in Brazil.\n if (!parsed || DATE_ONLY.test(trimmed) || TIME_ZONE_MARKER.test(trimmed)) {\n // A value that declares its zone has already been parsed as the right instant.\n return parsed;\n }\n // The API sends UTC values without a zone marker, so they were read as local time. Shifting by\n // the offset reads those parts as UTC, the same as the shared layer's UtcDatePipe.\n return new Date(parsed.getTime() - parsed.getTimezoneOffset() * 60000);\n}\n\nfunction formatDate(value: unknown, column: IGridColumn, locale: string): GridCellDisplay {\n const date: Date | null = parseCellDate(value, column.utc ?? false);\n if (!date) {\n return text(String(value));\n }\n const dateText: string = formatDateText(date, locale);\n return text(column.type === 'datetime' ? `${dateText} ${formatTimeText(date, locale)}` : dateText);\n}\n\nfunction formatBoolean(value: unknown, column: IGridColumn, defaults: GridCellTextDefaults): GridCellDisplay {\n let checked: boolean;\n if (value === true || (typeof value === 'string' && value.toLowerCase() === 'true')) {\n checked = true;\n } else if (value === false || (typeof value === 'string' && value.toLowerCase() === 'false')) {\n checked = false;\n } else {\n return text(String(value));\n }\n\n const hiddenText: string =\n (checked ? (column.trueText ?? defaults.trueText) : (column.falseText ?? defaults.falseText)) ?? '';\n return { kind: 'boolean', text: hiddenText, translate: hiddenText !== '', checked };\n}\n\nfunction formatEnum(value: unknown, column: IGridColumn): GridCellDisplay {\n const key = String(value);\n const translationKey: string | undefined =\n column.enumValues && Object.prototype.hasOwnProperty.call(column.enumValues, key)\n ? column.enumValues[key]\n : undefined;\n const display: GridCellDisplay =\n translationKey !== undefined ? { kind: 'text', text: translationKey, translate: true } : text(key);\n\n if (column.type === 'badge') {\n display.kind = 'badge';\n display.intent = column.badgeIntents?.[key] ?? 'neutral';\n }\n return display;\n}\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { ICatalogResult } from '../models/catalog-result';\n\n/**\n * Searches a catalog endpoint for `lib-catalog-select`. Sends a POST of\n * `{ maxResults, criteria, filters }` and returns the matching entries.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CatalogService {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n private http: HttpClient = inject(HttpClient);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public search(\n endpoint: string,\n maxResults: number,\n criteria?: string,\n filters: { [key: string]: string } | null = null,\n ): Observable<ICatalogResult> {\n return this.http.post<ICatalogResult>(`${endpoint}`, { maxResults, criteria, filters });\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable, OnDestroy, signal, WritableSignal } from '@angular/core';\nimport { ActivatedRoute, ParamMap } from '@angular/router';\nimport { Observable, ReplaySubject, Subject, take } from 'rxjs';\n\n/**\n * Base for a service that loads, caches and saves one entity for a details view. It reads the\n * record id from the route's `id` parameter; extend it and implement `loadModel`, `saveModel`\n * and `getTitle`.\n */\n@Injectable()\nexport abstract class DataProviderService<TEntityModel> implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n protected activatedRoute: ActivatedRoute = inject(ActivatedRoute);\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n protected shouldLazyLoad = false;\n\n // A signal rather than a field: `hasEntityID` is read from templates -- the New and Edit\n // buttons are only shown once a record exists -- and the route resolving or a save assigning\n // an id told Angular nothing. The accessors below keep their old shape.\n private readonly _entityID: WritableSignal<number | undefined> = signal(undefined);\n private errorSubject: Subject<HttpErrorResponse> = new Subject<HttpErrorResponse>();\n private isLoading = false;\n private isModelLoaded = false;\n private modelCache: ReplaySubject<TEntityModel | null> = new ReplaySubject<TEntityModel | null>(1);\n //#endregion\n\n //#region Properties\n public get entityID(): number | undefined {\n return this._entityID();\n }\n\n public get hasEntityID(): boolean {\n return !!this.entityID;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this.activatedRoute.paramMap.pipe(take(1)).subscribe((paramMap: ParamMap) => {\n const newID = Number(paramMap.get('id'));\n if (newID !== this.entityID) {\n this._entityID.set(newID);\n\n // Need to wait for the data-provider to be initialized.\n queueMicrotask(() => {\n // When lazy loading, the model should be loaded by the consuming component.\n if (!this.shouldLazyLoad) {\n this.refreshModel();\n }\n });\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public getError$(): Observable<HttpErrorResponse> {\n return this.errorSubject.asObservable();\n }\n\n public abstract getTitle(entity: TEntityModel): string;\n\n public getModel$(): Observable<TEntityModel | null> {\n if (!this.isModelLoaded && !this.shouldLazyLoad) {\n this.refreshModel();\n }\n return this.modelCache.asObservable();\n }\n\n public refreshModel(): void {\n if (this.isLoading) {\n return;\n }\n\n this.isLoading = true;\n\n this.loadModel(this.entityID)\n .pipe(take(1))\n .subscribe({\n next: (model: TEntityModel | null) => {\n this.isLoading = false;\n this.updateModel(model);\n },\n error: (error: HttpErrorResponse) => {\n this.isLoading = false;\n this.isModelLoaded = true;\n this.modelCache.next(null);\n this.errorSubject.next(error);\n },\n });\n }\n\n public resetForNewEntity(): void {\n this._entityID.set(undefined);\n this.isModelLoaded = false;\n this.modelCache.next(null);\n }\n\n public abstract saveModel(model: any): Observable<TEntityModel>;\n\n public updateModel(model: any): void {\n this.isModelLoaded = true;\n\n // Update entity ID if changed.\n if (model && (model as any).id !== this.entityID) {\n this._entityID.set((model as any).id);\n }\n\n this.modelCache.next(model);\n }\n //#endregion\n\n //#region Private methods\n protected abstract loadModel(entityID?: number): Observable<TEntityModel | null>;\n //#endregion\n}\n","import { inject, Injectable, OnDestroy, signal, WritableSignal } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { DataProviderService } from '../data-providers';\n\n@Injectable()\nexport abstract class BaseDataset implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n /**\n * Bumped by every write to dataset state, and read by every accessor below it.\n *\n * A dataset is rows, keys and selections mutated in place -- pushed, spliced, reassigned -- so a\n * signal holding the array could not see the change. This counter stands in for one: the read\n * inside each accessor is what makes a template using it re-render. It is a bridge for mutable\n * collections, not a pattern to copy into a component; there the state itself is the signal.\n * See docs/guides/reactivity.md.\n */\n private readonly revision: WritableSignal<number> = signal(0);\n\n protected dataProvider: DataProviderService<any> | null;\n protected destroy$: Subject<boolean> = new Subject<boolean>();\n\n // TODO: Remove.\n private _parentEntityId?: any;\n //#endregion\n\n //#region Properties\n // TODO: Remove.\n public get parentEntityId(): any {\n return this._parentEntityId;\n }\n public set parentEntityId(value: any) {\n this._parentEntityId = value;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this.dataProvider = inject(DataProviderService, { optional: true });\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Protected methods\n // Both are guarded: the logic specs build datasets with Object.create(), which runs no field\n // initialiser, so `revision` is genuinely absent there. Nothing to notify and nothing to track\n // in that case, which is correct -- those specs assert state, not rendering.\n\n /** Announces that dataset state changed, so views reading it re-render. */\n protected touched(): void {\n this.revision?.update((revision: number) => revision + 1);\n }\n\n /** Takes a tracked dependency on the dataset's state. Call it first in any accessor. */\n protected tracked(): void {\n this.revision?.();\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Injectable } from '@angular/core';\nimport { GridConfigs } from '../../models/configs/grid-configs';\n\n@Injectable()\nexport class GridConfigsProvider<TGridConfigs extends GridConfigs = GridConfigs> {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n protected _configs: TGridConfigs;\n //#endregion\n\n //#region Properties\n public get configs(): TGridConfigs {\n return this._configs;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n this._configs = {\n loadingDisplayText: 'Loading...',\n messageOnEmpty: 'No results',\n messageOnFailed: 'The records could not be loaded.',\n recordBlockSize: 100,\n rowHeight: 41.6,\n rowsToDisplay: 6,\n } as TGridConfigs;\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { EventEmitter, inject, Injectable } from '@angular/core';\nimport { Observable, take } from 'rxjs';\nimport { GuidHelper } from '../../helpers';\nimport { GridConfigs } from '../../models/configs/grid-configs';\nimport { GridConfigsProvider } from '../configs-providers/grid-configs.provider';\nimport { BaseDataset } from './base.dataset';\n\nconst KEY_FIELD = '_key';\n\n@Injectable()\nexport abstract class GridDataset extends BaseDataset {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n public configs: GridConfigs;\n public filtersChanged: EventEmitter<{ [key: string]: string }> = new EventEmitter<{ [key: string]: string }>();\n private _isLoading = false;\n private _loadedLastRow = false;\n private _totalRows?: number;\n public loadFinished: EventEmitter<boolean> = new EventEmitter<boolean>();\n public loadStarted: EventEmitter<void> = new EventEmitter<void>();\n\n protected compareProperty = 'id';\n protected configsProvider: GridConfigsProvider;\n protected focusedRow: string | null = null;\n protected recordBlock = 0;\n\n private _hasBeenLoaded = false;\n private _loadedKeys?: string[];\n private _loadedRows?: any[];\n private queryFilters?: { [key: string]: string };\n //#endregion\n\n //#region Properties\n public get isLoading(): boolean {\n this.tracked();\n return this._isLoading;\n }\n public set isLoading(value: boolean) {\n this._isLoading = value;\n this.touched();\n }\n\n public get loadedLastRow(): boolean {\n this.tracked();\n return this._loadedLastRow;\n }\n public set loadedLastRow(value: boolean) {\n this._loadedLastRow = value;\n this.touched();\n }\n\n public get totalRows(): number | undefined {\n this.tracked();\n return this._totalRows;\n }\n public set totalRows(value: number | undefined) {\n this._totalRows = value;\n this.touched();\n }\n\n public get filters(): { [key: string]: string } | undefined {\n this.tracked();\n return this.queryFilters;\n }\n\n public get hasBeenLoaded(): boolean {\n this.tracked();\n return this._hasBeenLoaded;\n }\n\n public get hasLoadedRows(): boolean {\n this.tracked();\n return !!this._loadedRows && this._loadedRows.length > 0;\n }\n\n public get keyProperty(): string {\n return this.compareProperty;\n }\n\n public get loadedKeys(): string[] | undefined {\n this.tracked();\n return this._loadedKeys;\n }\n\n public get loadedRows(): any[] | undefined {\n this.tracked();\n return this._loadedRows;\n }\n\n public override get parentEntityId(): any {\n return super.parentEntityId;\n }\n\n public override set parentEntityId(value: any) {\n super.parentEntityId = value;\n if (this.loadedRows) {\n this.refresh();\n }\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.configsProvider = inject(GridConfigsProvider);\n this.configs = JSON.parse(JSON.stringify(this.configsProvider.configs));\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public addNewRow(row: any): void {\n this.updateLoadedRows([row]);\n }\n\n /** The key of the currently focused row, or null. Read by DataGridRowComponent's host binding. */\n public get focusedRowKey(): string | null {\n this.tracked();\n return this.focusedRow;\n }\n\n public clearFocusedRow(): void {\n this.focusedRow = null;\n this.touched();\n }\n\n public getRowData(key: string): any | null {\n if (this.hasLoadedRows) {\n const index: number = this._loadedKeys!.indexOf(key);\n return this.loadedRows![index];\n }\n return null;\n }\n\n public getRowID(key: string): any {\n const row: any = this.getRowData(key);\n\n return this.compareProperty.split('.').reduce((row: any, property: string) => row[property], row);\n }\n\n public getRowInternalKey(row: any): string {\n return row[KEY_FIELD];\n }\n\n public hasRowWithID(id: any): boolean {\n if (!this.hasLoadedRows) {\n return false;\n }\n\n const loadedIDs: any[] = this.compareProperty\n .split('.')\n .reduce(\n (loadedRows: any[], property: string) => loadedRows.map((row: any) => row[property]),\n this._loadedRows ?? [],\n )\n .map((row: any) => (typeof id === 'string' ? `${row}` : typeof id === 'number' ? parseInt(`${row}`) : row));\n\n return loadedIDs.indexOf(id) >= 0;\n }\n\n public isKeyExists(key: string): boolean {\n return this.hasLoadedRows && this._loadedKeys!.some((x: string) => x === key);\n }\n\n public loadRows(): void {\n if (this.isLoading) {\n return;\n }\n\n this.isLoading = true;\n this.loadStarted.emit();\n\n const parameters: any = {\n endRow: this.configsProvider.configs.recordBlockSize,\n filters: this.queryFilters,\n startRow: this.recordBlock,\n };\n\n this.getData(parameters)\n .pipe(take(1))\n .subscribe({\n next: (response: any[] | { items: any[]; totalRows: number }) => {\n let rows: any[];\n if (Array.isArray(response)) {\n rows = response;\n } else {\n rows = response?.items ?? [];\n this.totalRows = response?.totalRows;\n }\n\n this.updateLoadedRows(rows ?? []);\n\n this.isLoading = false;\n this._hasBeenLoaded = true;\n this.touched();\n this.loadFinished.emit(true);\n },\n error: (_: any) => {\n this.isLoading = false;\n this.loadFinished.emit(false);\n },\n });\n }\n\n public refresh(): void {\n if (this.focusedRow) {\n this.clearFocusedRow();\n }\n this.clearLoadedRows();\n this.loadRows();\n }\n\n public removeKeys(keys: string[]): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n keys.forEach((key: string) => {\n if (this.focusedRow === key) {\n this.clearFocusedRow();\n }\n\n const indexToRemove: number = this._loadedKeys!.indexOf(key);\n\n if (indexToRemove >= 0) {\n // Need to set again the array values to trigger the change detection.\n this._loadedKeys = this._loadedKeys!.filter((_, index) => index !== indexToRemove);\n this.touched();\n this._loadedRows = this._loadedRows!.filter((_, index) => index !== indexToRemove);\n this.touched();\n }\n });\n }\n\n public setFilters(filters?: { [key: string]: string }): void {\n this.queryFilters = filters;\n this.filtersChanged.emit(filters);\n this.refresh();\n }\n\n public setFocusedRow(key: string): void {\n this.focusedRow = key;\n this.touched();\n }\n\n public updateRow(key: string, newRowData: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n const index: number = this._loadedKeys!.indexOf(key);\n if (index >= 0) {\n // Need to set the KEY_FIELD value into the new data, to make sure this information is not lost.\n newRowData[KEY_FIELD] = key;\n\n this._loadedRows![index] = newRowData;\n\n // Need to update loaded rows to force displayed rows to refresh.\n this.updateLoadedRows([]);\n }\n }\n //#endregion\n\n //#region Private methods\n protected clearLoadedRows(): void {\n this._hasBeenLoaded = false;\n this.touched();\n this._loadedRows = undefined;\n this.touched();\n this._loadedKeys = undefined;\n this.touched();\n this.recordBlock = 0;\n this.loadedLastRow = false;\n this.totalRows = undefined;\n }\n\n protected updateLoadedRows(rows: any[]): void {\n // Assign individual key to each row.\n rows.forEach((row: any) => {\n row[KEY_FIELD] = GuidHelper.generateGUID();\n });\n\n this._loadedRows = [...(this._loadedRows ?? []), ...rows];\n this.touched();\n this._loadedKeys = [...(this._loadedKeys ?? []), ...rows.map((row: any) => row[KEY_FIELD])];\n this.touched();\n\n this.recordBlock += rows.length;\n if (rows.length < this.configsProvider.configs.recordBlockSize) {\n this.loadedLastRow = true;\n }\n }\n //#endregion\n\n //#region Abstract methods\n abstract getData(params?: any): Observable<any[] | { items: any[]; totalRows: number }>;\n //#endregion\n}\n","import { HttpResponse } from '@angular/common/http';\nimport { EventEmitter, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { DataGridConfigs } from '../../models/configs/data-grid-configs';\nimport { IListParameters } from '../../models/data-grid-parameters';\nimport { IGridColumn } from '../../models/grid-column';\nimport { GridDataset } from './grid.dataset';\n\n@Injectable()\nexport abstract class DataGridDataset extends GridDataset {\n //#region ViewChilds, Inputs, Outputs\n public selectedRowsChanged: EventEmitter<{ [id: string]: { rowData: any; selected: boolean } }> = new EventEmitter<{\n [id: string]: { rowData: any; selected: boolean };\n }>();\n //#endregion\n\n //#region Variables\n public override configs: DataGridConfigs;\n\n public columns!: IGridColumn[];\n\n private _selectedRowKeys: string[] = [];\n //#endregion\n\n //#region Properties\n public get selectedRowKeys(): string[] {\n this.tracked();\n return this._selectedRowKeys;\n }\n public set selectedRowKeys(value: string[]) {\n this._selectedRowKeys = value;\n this.touched();\n }\n\n public get columnsSize(): string {\n const sizes: string[] = [];\n\n if (this.configs.multiSelect) {\n sizes.push(this.configs.multiSelectSize ?? 'min-content');\n }\n\n sizes.push(...this.columns.map((col: IGridColumn) => col.size ?? 'minmax(0,1fr)'));\n\n return sizes.join(' ');\n }\n\n public get hasSelectedRows(): boolean {\n return this.selectedRowKeys.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.configs = JSON.parse(JSON.stringify(this.configsProvider.configs));\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public clearSelection(): void {\n if (!this.hasLoadedRows || !this.hasSelectedRows) {\n return;\n }\n\n const selectedKeys: string[] = this.selectedRowKeys;\n\n this.selectedRowKeys = [];\n this.clearFocusedRow();\n this.selectedRowsChanged.emit(\n selectedKeys.reduce((keys: { [id: string]: { rowData: any; selected: boolean } }, key: string) => {\n keys[key] = {\n rowData: this.getRowData(key),\n selected: false,\n };\n return keys;\n }, {}),\n );\n }\n\n public export(_format: string, _parameters: IListParameters): Observable<HttpResponse<Blob>> {\n return throwError(() => new Error(`Export is not implemented for ${this.constructor.name}.`));\n }\n\n public deselectRow(key: string): void {\n if (!this.hasLoadedRows || !this.isKeySelected(key)) {\n return;\n }\n\n this.removeSelectedRow(key);\n\n this.selectedRowsChanged.emit({\n [key]: {\n rowData: this.getRowData(key),\n selected: false,\n },\n });\n }\n\n public deselectRowID(id: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n const index: number = this.loadedKeys!.map((key: string) => this.getRowID(key)).indexOf(id);\n\n const key: string = this.loadedKeys![index];\n this.deselectRow(key);\n }\n\n public getSelectedRowsData(): any[] {\n if (!this.hasLoadedRows || !this.hasSelectedRows) {\n return [];\n }\n\n return this.selectedRowKeys\n .map((key: string) => this.loadedKeys!.indexOf(key))\n .filter((index: number) => index >= 0)\n .map((index: number) => this.loadedRows![index]);\n }\n\n public isKeySelected(key: any): boolean {\n return this.selectedRowKeys.indexOf(key) >= 0;\n }\n\n public override refresh(): void {\n if (this.hasSelectedRows) {\n this.clearSelection();\n }\n super.refresh();\n }\n\n public override removeKeys(keys: string[]): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (this.hasSelectedRows) {\n keys\n .filter((key: string) => this.isKeySelected(key))\n .forEach((key: string) => {\n this.removeSelectedRow(key);\n });\n }\n\n super.removeKeys(keys);\n }\n\n public selectRow(key: string): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (!this.configs.multiSelect) {\n if (this.isKeySelected(key)) {\n return;\n }\n // Clear current selected row.\n this.removeSelectedRow(this.selectedRowKeys[0]);\n }\n\n if (!this.isKeySelected(key)) {\n this._selectedRowKeys.push(key);\n this.touched();\n this.selectedRowsChanged.emit({\n [key]: {\n rowData: this.getRowData(key),\n selected: true,\n },\n });\n }\n }\n\n public selectRowID(id: any): void {\n if (!this.hasLoadedRows) {\n return;\n }\n\n if (this.hasRowWithID(id)) {\n const rowIndex: number = this.loadedRows!.findIndex((row: any) => row[this.compareProperty] === id);\n\n if (rowIndex < 0) {\n return;\n }\n\n const key: string | undefined = this.loadedKeys![rowIndex];\n if (key) {\n this.selectRow(key);\n }\n }\n }\n\n public selectRows(keys: string[]): void {\n if (!this.hasLoadedRows || !this.configs.multiSelect) {\n return;\n }\n\n // Filter only the keys that are not selected yet.\n const keysNotSelected: string[] = keys.filter((key: string) => !this.isKeySelected(key));\n\n if (keysNotSelected.length > 0) {\n this._selectedRowKeys.push(...keysNotSelected);\n this.touched();\n this.selectedRowsChanged.emit(\n keys.reduce((keys: { [id: string]: { rowData: any; selected: boolean } }, key: string) => {\n keys[key] = {\n rowData: this.getRowData(key),\n selected: true,\n };\n return keys;\n }, {}),\n );\n }\n }\n\n public override setFocusedRow(key: any): void {\n super.setFocusedRow(key);\n\n if (!this.configs.multiSelect) {\n this.selectRow(key);\n } else if (this.configs.selectOnClick ?? true) {\n if (this.isKeySelected(key)) {\n this.deselectRow(key);\n } else {\n this.selectRow(key);\n }\n }\n }\n //#endregion\n\n //#region Private methods\n protected removeSelectedRow(key: string): void {\n const index: number = this.selectedRowKeys.indexOf(key);\n if (index >= 0) {\n this._selectedRowKeys.splice(index, 1);\n this.touched();\n }\n }\n //#endregion\n}\n","import { EventEmitter, inject, Injectable } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { IBatchUpdate } from '../../models/batch-update';\nimport { IMultiEditorChanges } from '../../models/multi-editor-changes';\nimport { BaseDataset } from './base.dataset';\nimport { DataGridDataset } from './data-grid.dataset';\n\n@Injectable()\nexport abstract class MultiEditorDataset extends BaseDataset {\n //#region ViewChilds, Inputs, Outputs\n public savedChanges: EventEmitter<void> = new EventEmitter();\n //#endregion\n\n //#region Variables\n protected readonly dataGridDataset: DataGridDataset;\n\n private fakeIDsGenerated: any[] = [];\n private modifiedValues: IMultiEditorChanges = {\n changed: {},\n removed: [],\n };\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.dataGridDataset = inject(DataGridDataset);\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public clearChangedValues(): void {\n this.fakeIDsGenerated = [];\n\n this.modifiedValues = {\n changed: {},\n removed: [],\n };\n }\n\n public removeValue(key: string): void {\n if (this.modifiedValues.changed[key]) {\n delete this.modifiedValues.changed[key];\n }\n\n const id: any = this.dataGridDataset.getRowID(key);\n this.dataGridDataset.removeKeys([key]);\n\n if (!id) {\n return;\n }\n\n if (this.fakeIDsGenerated.indexOf(id) < 0) {\n this.modifiedValues.removed.push(id);\n } else {\n this.fakeIDsGenerated.splice(this.fakeIDsGenerated.indexOf(id), 1);\n }\n }\n\n public saveChanges(): Observable<any> {\n const batchUpdate: IBatchUpdate<any, any> = {\n entitiesToInsertOrUpdate: Object.entries(this.modifiedValues.changed).map(([_, v]: [string, string]) => v),\n entitiesToDelete: this.modifiedValues.removed,\n };\n\n return this.saveData(batchUpdate).pipe(tap(() => this.savedChanges.emit()));\n }\n\n public storeFakeIDGenerated(id: any): void {\n if (this.fakeIDsGenerated.indexOf(id) >= 0) {\n return;\n }\n\n this.fakeIDsGenerated.push(id);\n }\n\n public updateValues(key: string, newRowData: any): void {\n this.modifiedValues.changed[key] = newRowData;\n\n this.dataGridDataset.updateRow(key, newRowData);\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n\n //#region Abstract methods\n public abstract newData(id: any): any;\n\n public abstract saveData(batchUpdate: IBatchUpdate<any, any>): Observable<any>;\n //#endregion\n}\n","import { EventEmitter, Injectable } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { IMultiSelectorChanges } from '../../models/multi-selector-changes';\nimport { GridDataset } from './grid.dataset';\n\n@Injectable()\nexport abstract class MultiSelectResultDataset extends GridDataset {\n //#region ViewChilds, Inputs, Outputs\n public savedChanges: EventEmitter<void> = new EventEmitter();\n //#endregion\n\n //#region Variables\n private _displayedIDs: any[] = [];\n private _displayedRows: any[] = [];\n\n private _idsToAdd: any[] = [];\n private _idsToRemove: any[] = [];\n private addedRowData: any[] = [];\n //#endregion\n\n //#region Properties\n public get displayedIDs(): any[] {\n this.tracked();\n return this._displayedIDs;\n }\n\n public get displayedRows(): any[] {\n this.tracked();\n return this._displayedRows;\n }\n\n public get idsToAdd(): any[] {\n this.tracked();\n return this._idsToAdd;\n }\n\n public get idsToRemove(): any[] {\n this.tracked();\n return this._idsToRemove;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public override refresh(): void {\n this.clearSelection();\n super.refresh();\n }\n\n public saveChanges(): Observable<any> {\n const changes: IMultiSelectorChanges = {\n idsToAdd: this.idsToAdd,\n idsToRemove: this.idsToRemove,\n };\n\n return this.saveData(changes).pipe(\n tap(() => {\n this.savedChanges.emit();\n this.clearSelection();\n this.clearLoadedRows();\n }),\n );\n }\n\n /**\n * Records that an entry is to be added, if it is not already recorded or already saved.\n *\n * Idempotent: the same entry can be reported more than once, because a click on the grid and a\n * click in the panel both land here through different paths.\n */\n public setIDToAdd(idToAdd: any, rowData: any): void {\n const index: number = this._idsToRemove.indexOf(idToAdd);\n if (index >= 0) {\n this._idsToRemove.splice(index, 1);\n this.touched();\n } else if (!this.isExistingID(idToAdd) && this._idsToAdd.indexOf(idToAdd) < 0) {\n this._idsToAdd.push(idToAdd);\n this.touched();\n this.addedRowData.push(rowData);\n }\n this.updateDisplayedRows();\n }\n\n /** Idempotent, for the same reason as {@link setIDToAdd}. */\n public setIDToRemove(idToRemove: any): void {\n const index: number = this._idsToAdd.indexOf(idToRemove);\n if (index >= 0) {\n this._idsToAdd.splice(index, 1);\n this.touched();\n this.addedRowData.splice(index, 1);\n } else if (this.isExistingID(idToRemove) && this._idsToRemove.indexOf(idToRemove) < 0) {\n this._idsToRemove.push(idToRemove);\n this.touched();\n }\n this.updateDisplayedRows();\n }\n\n protected override updateLoadedRows(rows: any[]): void {\n super.updateLoadedRows(rows);\n this.updateDisplayedRows();\n }\n //#endregion\n\n //#region Private methods\n private clearSelection(): void {\n this._idsToAdd = [];\n this._idsToRemove = [];\n this.addedRowData = [];\n\n this.updateDisplayedRows();\n }\n\n private isExistingID(id: any): boolean {\n return (this.loadedKeys ?? []).map((key: string) => this.getRowID(key)).indexOf(id) >= 0;\n }\n\n private updateDisplayedRows() {\n const loadedKeys: string[] = (this.loadedKeys ?? []).filter(\n (key: string) => this.idsToRemove.indexOf(this.getRowID(key)) < 0,\n );\n\n this._displayedIDs = loadedKeys.map((key: string) => this.getRowID(key));\n this.touched();\n this._displayedIDs.push(...this._idsToAdd);\n this.touched();\n\n this._displayedRows = loadedKeys.map((key: string) => this.getRowData(key));\n this.touched();\n this._displayedRows.push(...this.addedRowData);\n this.touched();\n }\n //#endregion\n\n //#region Abstract methods\n protected abstract saveData(changedIds: IMultiSelectorChanges): Observable<any>;\n //#endregion\n}\n","import { EventEmitter, Injectable } from '@angular/core';\n\n/** An empty service with no members. Nothing in the package uses it. */\n@Injectable()\nexport class FormGroupService {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n //#region Variables\n //#endregion\n //#region Properties\n //#endregion\n //#region Constructor and Angular life cycle methods\n //#endregion\n //#region Event handlers\n //#endregion\n //#region Public methods\n //#endregion\n //#region Private methods\n //#endregion\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { EventEmitter, Injectable, signal, WritableSignal } from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { Observable, Subject, Subscription } from 'rxjs';\n\n/**\n * Holds the state of one form view: the form group, the loaded model, view or edit mode and the\n * loading flag. Provide it on the view; the library's form fields read it to decide whether to\n * show inputs or read-only values.\n */\n@Injectable()\nexport class FormService {\n //#region ViewChilds, Inputs, Outputs\n public fieldRefreshed = new EventEmitter<{ fieldName: string; value?: any; loading?: boolean }>();\n public modelRefreshed = new EventEmitter<any | null>();\n //#endregion\n\n //#region Variables\n // Signals rather than fields: these are read from templates through the accessors below, and a\n // plain assignment told Angular nothing. The accessors keep their old shape, so nothing that\n // reads or writes them has to change.\n private readonly _loading: WritableSignal<boolean> = signal(false);\n private readonly _model: WritableSignal<any | null> = signal(null);\n private readonly currentMode: WritableSignal<'edit' | 'view'> = signal('view');\n\n // A FormGroup's validity is not a signal and never notifies one, so its status is mirrored here\n // and `isValid` reads this. Without it a save button bound to isValid keeps its first answer.\n private readonly formStatus: WritableSignal<string | undefined> = signal(undefined);\n\n private editCanceled$: Subject<void> = new Subject<void>();\n private form?: FormGroup;\n // Held rather than tied to a DestroyRef: this service is also built directly in specs, outside\n // any injection context, and re-initialising with another form has to drop the old subscription.\n private formStatusSubscription?: Subscription;\n private initialValue?: any;\n //#endregion\n\n //#region Properties\n public get editCanceled(): Observable<void> {\n return this.editCanceled$.asObservable();\n }\n\n public get isEditMode(): boolean {\n return this.currentMode() === 'edit';\n }\n\n public get isValid(): boolean {\n this.formStatus();\n return this.form?.valid ?? false;\n }\n\n public get loading(): boolean {\n return this._loading();\n }\n\n public set loading(value: boolean) {\n if (this._loading() !== value) {\n this._loading.set(value);\n if (value) {\n this.form?.disable();\n } else if (this.isEditMode) {\n this.form?.enable();\n }\n }\n }\n\n public get model(): any | null {\n return this._model();\n }\n\n public set model(value: any | null) {\n if (this._model() !== value) {\n this._model.set(value);\n this.modelRefreshed.emit(value);\n }\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public beginEdit(): void {\n this.currentMode.set('edit');\n this.form?.enable();\n }\n\n public beginFieldLoading(fieldName: string) {\n this.fieldRefreshed.emit({\n fieldName,\n loading: true,\n });\n }\n\n public cancelEdit(): void {\n this.currentMode.set('view');\n this.form?.disable();\n this.resetForm();\n this.editCanceled$.next();\n }\n\n public disableForm(): void {\n this.form?.disable();\n }\n\n public enableForm(): void {\n if (this.isEditMode) {\n this.form?.enable();\n }\n }\n\n public getModelFromForm(): any {\n return this.form?.getRawValue();\n }\n\n public initializeForm(form: FormGroup): void {\n this.form = form;\n this.initialValue = form.getRawValue();\n\n this.formStatusSubscription?.unsubscribe();\n this.formStatus.set(form.status);\n this.formStatusSubscription = form.statusChanges.subscribe((status: string) => this.formStatus.set(status));\n\n if (this.currentMode() === 'view') {\n this.form.disable();\n }\n }\n\n public markAllAsTouched(): void {\n if (!this.form) {\n return;\n }\n\n this.form.markAllAsTouched();\n }\n\n public resetForm(): void {\n if (!this.form) {\n return;\n }\n\n this.form.reset();\n\n if (this.model) {\n this.form.patchValue(this.model);\n } else if (this.initialValue) {\n this.form.patchValue(this.initialValue);\n }\n\n this.form.updateValueAndValidity();\n }\n\n public setFieldValue(fieldName: string, value: any): void {\n this.fieldRefreshed.emit({\n fieldName,\n loading: false,\n value,\n });\n }\n\n public setValidationErrorsFromHttpResponse(errorResponse: HttpErrorResponse): void {\n if (!errorResponse || !this.form) {\n return;\n }\n\n // Error 400 = Validation issues\n if (errorResponse.status === 400 && errorResponse.error && errorResponse.error.errors) {\n const errors: { [id: string]: string[] } = <{ [id: string]: string[] }>errorResponse.error.errors;\n\n Object.keys(errors)\n .map((x: string) => {\n return { key: x, field: x.substring(0, 1).toLocaleLowerCase() + x.substring(1, x.length) };\n })\n .forEach((err: { key: string; field: string }) => {\n setTimeout(() => {\n const field: FormControl = <FormControl>this.form!.get(err.field);\n field?.setErrors({ [errors[err.key][0]]: true });\n field?.markAsTouched();\n });\n });\n }\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Signal } from '@angular/core';\n\n/**\n * A child that decides whether its ribbon group is shown at all.\n *\n * `isVisible` is a signal rather than a plain field because `RibbonGroupComponent` reads it from\n * a host binding, and Angular evaluates a component's host bindings during its PARENT's pass. A\n * child assigning a field could not reach that pass at all: nothing marked it, and writing it\n * afterwards raised NG0100. A signal read inside the group's binding is tracked, so flipping it\n * refreshes the group whatever strategy the host application uses.\n */\nexport abstract class RibbonGroupChild {\n abstract readonly isVisible: Signal<boolean>;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const SIDEBAR_CONFIGS: InjectionToken<SidebarConfigs> = new InjectionToken<SidebarConfigs>('', {\n providedIn: 'root',\n factory: () => new SidebarConfigs(),\n});\n\nexport class SidebarConfigs {\n public errorText = 'Error';\n /** Tooltip for items that open in a new browser tab. Rendered as-is, like {@link errorText}. */\n public externalLinkText = 'Opens in a new browser tab';\n public loadingText = 'Loading';\n /**\n * Derive region headers from the menu tree instead of from {@link SidebarMenu.region}.\n *\n * With this on, a top-level menu that has children and no URL stops being a collapsible node\n * and becomes an area header, with its children rendered flat beneath it as top-level items --\n * icons included. The area is then a real menu row, so it carries its own translated label and\n * its own order, and no `region` label has to be repeated across every item that belongs to it.\n *\n * Off by default: without it a top-level parent stays the collapsible group it has always been.\n */\n public shouldDeriveAreasFromRootMenus = false;\n public logoCollapsedPath?: string;\n public logoExpandedPath?: string;\n\n constructor(options: Partial<SidebarConfigs> = {}) {\n Object.assign(this, options);\n }\n}\n","import { SidebarMenuOpenMode } from './sidebar-menu-open-mode';\n\nexport class SidebarMenu {\n public childCount = 0;\n public children: SidebarMenu[] = [];\n public height?: number;\n public icon?: string;\n public id = 0;\n public label = '';\n public isSelected = false;\n /**\n * How {@link url} is opened. An absent value means {@link SidebarMenuOpenMode.Internal}.\n *\n * Left optional and without an initializer on purpose: the constructor is an `Object.assign`,\n * which would overwrite a default with the `null` a nullable backend column serializes to.\n * Read it through `toSidebarMenuOpenMode(menu.openMode)` instead of comparing it directly.\n */\n public openMode?: SidebarMenuOpenMode;\n public parent: SidebarMenu | null = null;\n public region?: string;\n public url?: string;\n\n constructor(options: Partial<SidebarMenu> = {}) {\n Object.assign(this, options);\n }\n}\n","/**\n * How a {@link SidebarMenu}'s `url` is opened when the item is clicked.\n *\n * Read the value off a menu through {@link toSidebarMenuOpenMode} rather than comparing the\n * field directly: it crosses HTTP, so it can arrive as a string, as a number, as `null`, or not\n * at all.\n */\nexport enum SidebarMenuOpenMode {\n /** `url` is an internal Angular route and opens an application tab. The default. */\n Internal = 'internal',\n\n /** `url` is an absolute http(s) address and opens in a new browser tab. */\n ExternalNewTab = 'externalNewTab',\n\n /** `url` is an absolute http(s) address and opens embedded in an application tab. */\n ExternalEmbedded = 'externalEmbedded',\n}\n\n/** Ordinals matching the mode column stored by the backend, for a numeric payload. */\nconst ORDINAL_MODES: SidebarMenuOpenMode[] = [\n SidebarMenuOpenMode.Internal,\n SidebarMenuOpenMode.ExternalNewTab,\n SidebarMenuOpenMode.ExternalEmbedded,\n];\n\n/**\n * Parses the wire value of `SidebarMenu.openMode`.\n *\n * Deliberately a parser rather than a `?? Internal` fallback, because the field is deserialized\n * straight from each application's menu endpoint and its shape is not guaranteed:\n *\n * - a **number** is read as the backend's enum ordinal, which is what an ASP.NET Core enum\n * property serializes to unless that backend registers a string converter;\n * - a **string** is matched case-insensitively, so `'externalNewTab'` and `'ExternalNewTab'`\n * both work;\n * - anything else — an omitted field from a backend that predates this feature, `null`, or a\n * mode introduced by a newer one — degrades to {@link SidebarMenuOpenMode.Internal}.\n *\n * Degrading to `Internal` keeps an unrecognized mode behaving the way menus behaved before\n * external destinations existed, instead of producing an item that does nothing when clicked.\n */\nexport function toSidebarMenuOpenMode(value: unknown): SidebarMenuOpenMode {\n if (typeof value === 'number') {\n return ORDINAL_MODES[value] ?? SidebarMenuOpenMode.Internal;\n }\n\n if (typeof value === 'string') {\n const normalized: string = value.toLowerCase();\n\n return (\n ORDINAL_MODES.find((mode: SidebarMenuOpenMode) => mode.toLowerCase() === normalized) ??\n SidebarMenuOpenMode.Internal\n );\n }\n\n return SidebarMenuOpenMode.Internal;\n}\n","import { EventEmitter, Injectable, signal, WritableSignal } from '@angular/core';\nimport { map, Observable, take, tap } from 'rxjs';\nimport { ISidebarProfile, SidebarMenu, SidebarMenuOpenMode, toSidebarMenuOpenMode } from '../models';\nimport { HttpErrorResponse } from '@angular/common/http';\n\n/**\n * Loads and tracks the menus of `lib-sidebar`: the tree, the selected item and the collapsed and\n * open states. Extend it and implement `loadMenus`, `getMenuFromUrl` and `getUserProfile`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport abstract class SidebarService {\n //#region ViewChilds, Inputs, Outputs\n public childrenFailed: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenLoaded: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenLoading: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public childrenInitialized: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public menuExternalUrlSelected: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public menuUrlSelected: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n public selectionChanged: EventEmitter<SidebarMenu> = new EventEmitter<SidebarMenu>();\n //#endregion\n\n //#region Variables\n // Signals rather than plain fields: a sidebar component reads these through a getter in its\n // template, and a signal read there is tracked, so flipping one renders the sidebar whatever\n // change-detection strategy the host application uses. A plain assignment told Angular nothing,\n // which is why the sidebar could sit on a stale frame until the user clicked something.\n private readonly _isActive: WritableSignal<boolean> = signal(false);\n private readonly _isCollapsed: WritableSignal<boolean> = signal(false);\n private readonly _shouldActivate: WritableSignal<boolean> = signal(false);\n\n private menus: SidebarMenu[] = [];\n private selectedMenu: SidebarMenu | null = null;\n //#endregion\n\n //#region Properties\n /** Whether the collapsed sidebar is currently held open. */\n public get isActive(): boolean {\n return this._isActive();\n }\n public set isActive(value: boolean) {\n this._isActive.set(value);\n }\n\n public get isCollapsed(): boolean {\n return this._isCollapsed();\n }\n public set isCollapsed(value: boolean) {\n this._isCollapsed.set(value);\n }\n\n /** Whether a click should hold the sidebar open, which depends on width and collapsed state. */\n public get shouldActivate(): boolean {\n return this._shouldActivate();\n }\n public set shouldActivate(value: boolean) {\n this._shouldActivate.set(value);\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Public methods\n public deselectAll(): void {\n this.menus\n .filter((menu: SidebarMenu) => menu.isSelected)\n .forEach((menu: SidebarMenu) => {\n this.deselectMenu(menu);\n });\n }\n\n public loadChildren(parentMenu: SidebarMenu): void {\n this.childrenLoading.emit(parentMenu);\n\n this.loadChildrenFor(parentMenu).subscribe({\n error: (exception: HttpErrorResponse) => {\n this.childrenFailed.emit(parentMenu);\n throw exception;\n },\n });\n }\n\n /**\n * Loads a parent's children and hands them back, for callers that need them before the user\n * clicks -- a sidebar rendering areas flat has to have them up front. {@link loadChildren} is\n * the fire-and-forget variant that also raises the loading and failure events.\n */\n public loadChildrenFor(parentMenu: SidebarMenu): Observable<SidebarMenu[]> {\n return this.loadMenus(parentMenu).pipe(\n take(1),\n map((menus: SidebarMenu[]) => menus.map((menu: SidebarMenu) => new SidebarMenu(menu))),\n tap((childrenMenus: SidebarMenu[]) => {\n parentMenu.children = childrenMenus;\n childrenMenus.forEach((childMenu: SidebarMenu) => (childMenu.parent = parentMenu));\n\n // children is a plain field: the item that asked for them has to be told they arrived.\n this.childrenLoaded.emit(parentMenu);\n }),\n );\n }\n\n public loadRoot(): Observable<SidebarMenu[]> {\n return this.loadMenus(null).pipe(\n take(1),\n map((menus: SidebarMenu[]) => menus.map((menu: SidebarMenu) => new SidebarMenu(menu))),\n tap((menus: SidebarMenu[]) => (this.menus = menus)),\n );\n }\n\n public select(menu: SidebarMenu): void {\n if (menu.childCount > 0 && (menu.children?.length ?? 0) === 0) {\n this.loadChildren(menu);\n }\n\n const hasUrl: boolean = (menu.url?.length ?? 0) > 0;\n const openMode: SidebarMenuOpenMode = toSidebarMenuOpenMode(menu.openMode);\n const isExternal: boolean = hasUrl && openMode !== SidebarMenuOpenMode.Internal;\n\n // External destinations are announced on their own emitter, so a consumer that only knows\n // menuUrlSelected never receives an absolute URL it would hand to the Angular router.\n const urlSelected: EventEmitter<SidebarMenu> = isExternal ? this.menuExternalUrlSelected : this.menuUrlSelected;\n\n // Opening a new browser tab is an action, not a destination: the user stays on the view\n // already on screen, so the item must neither take the selection nor clear that view's.\n // Parents still fall through, so a parent that carries a URL keeps expanding instead of\n // becoming impossible to open.\n if (isExternal && openMode === SidebarMenuOpenMode.ExternalNewTab && menu.childCount === 0) {\n urlSelected.emit(menu);\n return;\n }\n\n // In case we're deselecting the menu because a child was selected, we need to keep track of the original selection state.\n const isSelected: boolean = menu.isSelected;\n\n if (!!this.selectedMenu && this.selectedMenu !== menu) {\n this.deselectAll();\n }\n\n if (!isSelected) {\n this.selectedMenu = menu;\n this.selectMenu(menu);\n\n if (hasUrl) {\n urlSelected.emit(menu);\n }\n } else if (hasUrl) {\n // Menu with a URL is already selected — navigate again instead of toggling off.\n urlSelected.emit(menu);\n } else {\n this.selectedMenu = null;\n this.deselectMenu(menu);\n }\n }\n //#endregion\n\n //#region Private methods\n private deselectMenu(menu: SidebarMenu, shouldUpdateParents = true): void {\n if (!menu.isSelected) {\n return;\n }\n\n menu.isSelected = false;\n this.selectionChanged.emit(menu);\n\n if ((menu.children?.length ?? 0) > 0) {\n menu.children\n .filter((child: SidebarMenu) => child.isSelected)\n .forEach((child: SidebarMenu) => {\n const shouldUpdateParents = false;\n this.deselectMenu(child, shouldUpdateParents);\n });\n }\n\n if (!!menu.parent && shouldUpdateParents) {\n while (menu.parent) {\n this.selectionChanged.emit(menu.parent);\n menu = menu.parent;\n }\n }\n }\n\n private selectMenu(menu: SidebarMenu): void {\n menu.isSelected = true;\n this.selectionChanged.emit(menu);\n\n if (menu.parent) {\n this.selectMenu(menu.parent);\n }\n }\n //#endregion\n\n //#region Abstract methods\n public abstract getMenuFromUrl(url: string): Observable<SidebarMenu>;\n\n public abstract getUserProfile(): ISidebarProfile | undefined;\n\n protected abstract loadMenus(parentMenuID: SidebarMenu | null): Observable<SidebarMenu[]>;\n //#endregion\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n afterNextRender,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n Injector,\n input,\n InputSignal,\n linkedSignal,\n OnDestroy,\n output,\n OutputEmitterRef,\n signal,\n Signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport {\n DatePart,\n formatDateText,\n formatTimeText,\n getDatePattern,\n parseDateText,\n parseIsoValue,\n parseTimeText,\n toIsoDate,\n toIsoDateTime,\n} from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\nimport { CalendarComponent } from '../calendar/calendar.component';\n\nlet nextCalendarId = 0;\n\n/** What a `lib-date-input` holds: a day, or a day and a time. */\nexport type DateInputMode = 'date' | 'datetime';\n\n/**\n * A date field, or a date and time field, that follows the application's language.\n *\n * The native `<input type=\"date\">` shows dates in the operating system's format, whatever language\n * the application is in. This field shows and reads dates in the language the application chose\n * (see `LocaleService`): `05/12/2026` in Portuguese, `12/05/2026` in English. The user can type the\n * date or pick it from a calendar (the calendar button, or Alt+Down in the field).\n *\n * It is a form control. The value has the same shape the native inputs give, so it can replace them\n * without changing what the form holds:\n *\n * - `date` mode: a `yyyy-MM-dd` string, such as `2026-12-05`.\n * - `datetime` mode: a local `yyyy-MM-ddTHH:mm` string, such as `2026-12-05T14:30`.\n * - `null` when the field is empty or the text is not a valid date.\n *\n * It also accepts a `Date` as the value. It adds these validation errors: `dateInvalid` when the\n * text is not a date, `dateMin` and `dateMax` when the date is outside `min` and `max`.\n */\n@Component({\n selector: 'lib-date-input',\n templateUrl: './date-input.component.html',\n styleUrls: ['./date-input.component.scss'],\n imports: [CalendarComponent],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DateInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => DateInputComponent), multi: true },\n ],\n host: {\n class: 'lib-date-input',\n },\n})\nexport class DateInputComponent implements ControlValueAccessor, Validator, OnDestroy {\n //#region Inputs and outputs\n /** Whether the field holds a day (`date`) or a day and a time (`datetime`). Defaults to `date`. */\n public readonly mode: InputSignal<DateInputMode> = input<DateInputMode>('date');\n /** Earliest allowed day: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly min: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Latest allowed day: a `Date` or a `yyyy-MM-dd` string. Defaults to no limit. */\n public readonly max: InputSignal<Date | string | null | undefined> = input<Date | string | null>();\n /** Lets the user see and focus the value but not change it. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Shows the field as invalid, for example when the form was touched. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Accessible name of the date text field, when no visible label names it. Defaults to none. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n\n /** Emits when a text field of the input loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits when a text field of the input gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every keystroke in a text field. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly injector: Injector = inject(Injector);\n private readonly localeService: LocaleService = inject(LocaleService);\n private readonly overlay: Overlay = inject(Overlay);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n private readonly container: Signal<ElementRef<HTMLElement> | undefined> =\n viewChild<ElementRef<HTMLElement>>('container');\n private readonly dateField: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('dateField');\n private readonly calendarTemplate: Signal<TemplateRef<unknown> | undefined> =\n viewChild<TemplateRef<unknown>>('calendarTemplate');\n\n private overlayRef?: OverlayRef;\n private onChange: (value: string | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n private onValidatorChange: () => void = () => undefined;\n\n /** The current value as a date, or `null`. */\n private readonly current: WritableSignal<Date | null> = signal(null);\n /** Set when the typed text could not be read as a date or time. */\n private readonly hasTypingError: WritableSignal<boolean> = signal(false);\n //#endregion\n\n //#region Properties\n /** The calendar's id, which the date field points at with `aria-controls` while it is open. */\n protected readonly calendarId: string = `lib-date-input-calendar-${nextCalendarId++}`;\n protected readonly isDisabled: WritableSignal<boolean> = signal(false);\n protected readonly isOpen: WritableSignal<boolean> = signal(false);\n\n protected readonly locale: Signal<string> = computed(() => this.localeService.locale());\n\n /** The text in the date field. Follows the value and the language, and the user's typing in between. */\n protected readonly dateText: WritableSignal<string> = linkedSignal(() => {\n const value: Date | null = this.current();\n return value ? formatDateText(value, this.locale()) : '';\n });\n\n /** The text in the time field. Follows the value and the language, and the user's typing in between. */\n protected readonly timeText: WritableSignal<string> = linkedSignal(() => {\n const value: Date | null = this.current();\n return value ? formatTimeText(value, this.locale()) : '';\n });\n\n /** The date order in the language's own words, such as `dia/mês/ano`. */\n protected readonly datePlaceholder: Signal<string> = computed(() => {\n const locale: string = this.locale();\n const { order, separator } = getDatePattern(locale);\n try {\n const names: Intl.DisplayNames = new Intl.DisplayNames(locale, { type: 'dateTimeField' });\n return order.map((part: DatePart) => names.of(part) ?? part).join(separator);\n } catch {\n return order.join(separator);\n }\n });\n\n /**\n * Accessible name of the time field: the field's name, if any, then the word for \"hour\" in the\n * application's language, from `Intl` so the library needs no translation key.\n */\n protected readonly timeLabel: Signal<string> = computed(() => {\n let hour = 'Time';\n try {\n hour = new Intl.DisplayNames(this.locale(), { type: 'dateTimeField' }).of('hour') ?? hour;\n } catch {\n // Keep the fallback.\n }\n return [this.ariaLabel(), hour].filter(Boolean).join(', ');\n });\n\n protected readonly calendarSelection: Signal<Date | null> = computed(() => this.current());\n protected readonly isFieldInvalid: Signal<boolean> = computed(() => this.invalid() || this.hasTypingError());\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n // A new `min` or `max` changes the errors, so the form must validate again, for example the\n // end of a date range whose `min` is the start's value. The first run only records the limits.\n let previous: string | undefined;\n effect(() => {\n const limits: string = JSON.stringify([limitKey(this.min()), limitKey(this.max())]);\n if (previous !== undefined && previous !== limits) {\n this.onValidatorChange();\n }\n previous = limits;\n });\n }\n\n public ngOnDestroy(): void {\n this.disposeOverlay();\n }\n //#endregion\n\n //#region ControlValueAccessor and Validator\n /** Sets the value from the form. Accepts a `Date`, `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm` or `null`. */\n public writeValue(value: unknown): void {\n this.hasTypingError.set(false);\n this.current.set(parseIsoValue(value));\n }\n\n /** Registers the form's change callback. */\n public registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /** Registers the form's touched callback. */\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** Enables or disables the field from the form. */\n public setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\n if (isDisabled) {\n this.close(false);\n }\n }\n\n /** Reports `dateInvalid`, `dateMin` and `dateMax`. */\n public validate(_control: AbstractControl): ValidationErrors | null {\n if (this.hasTypingError()) {\n return { dateInvalid: true };\n }\n const value: Date | null = this.current();\n if (!value) {\n return null;\n }\n const day: Date = new Date(value.getFullYear(), value.getMonth(), value.getDate());\n const min: Date | null = parseIsoValue(this.min());\n const max: Date | null = parseIsoValue(this.max());\n if (min && day < new Date(min.getFullYear(), min.getMonth(), min.getDate())) {\n return { dateMin: { min: toIsoDate(min), actual: toIsoDate(day) } };\n }\n if (max && day > new Date(max.getFullYear(), max.getMonth(), max.getDate())) {\n return { dateMax: { max: toIsoDate(max), actual: toIsoDate(day) } };\n }\n return null;\n }\n\n /** Registers the callback that re-runs validation. */\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n //#endregion\n\n //#region Event handlers\n protected onDateTyped(event: Event): void {\n this.dateText.set((<HTMLInputElement>event.target).value);\n this.inputChanged.emit();\n }\n\n protected onTimeTyped(event: Event): void {\n this.timeText.set((<HTMLInputElement>event.target).value);\n this.inputChanged.emit();\n }\n\n protected onFieldFocus(event: FocusEvent): void {\n // Moving between the date and the time box stays inside the field.\n if (!this.isInsideField(event.relatedTarget)) {\n this.focused.emit();\n }\n }\n\n protected onFieldBlur(event: FocusEvent): void {\n // The value is read when focus leaves the whole field, not the date box alone: in datetime\n // mode, committing on the way to the time box saved midnight and filled the time in.\n if (this.isInsideField(event.relatedTarget)) {\n return;\n }\n this.commitText();\n this.onTouched();\n this.blurred.emit();\n }\n\n protected onFieldKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' && event.altKey) {\n event.preventDefault();\n this.open();\n } else if (event.key === 'Enter') {\n this.commitText();\n } else if (event.key === 'Escape' && this.isOpen()) {\n // Closing the calendar must not also close a modal the field sits in.\n event.preventDefault();\n event.stopPropagation();\n this.close(true);\n }\n }\n\n protected onToggleClick(): void {\n if (this.isOpen()) {\n this.close(true);\n } else {\n this.open();\n }\n }\n\n protected onDatePicked(day: Date): void {\n const previous: Date | null = this.current();\n const value: Date = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n if (this.mode() === 'datetime') {\n const time: { hours: number; minutes: number } | null = parseTimeText(this.timeText());\n value.setHours(time?.hours ?? previous?.getHours() ?? 0, time?.minutes ?? previous?.getMinutes() ?? 0);\n }\n this.setValue(value);\n this.onTouched();\n this.close(true);\n }\n\n protected onCalendarCancelled(): void {\n this.close(true);\n }\n //#endregion\n\n //#region Public methods\n /** Opens the calendar, unless the field is disabled or read-only. */\n public open(): void {\n const container: HTMLElement | undefined = this.container()?.nativeElement;\n const template: TemplateRef<unknown> | undefined = this.calendarTemplate();\n if (this.isOpen() || this.isDisabled() || this.readOnly() || !container || !template) {\n return;\n }\n\n // Read what was typed first. Focus moving to the calendar button stays inside the field, so no\n // blur saved it: the calendar would open on the old date, and a click outside would leave the\n // form holding the old value while the box showed the new one.\n this.commitText();\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'cdk-overlay-transparent-backdrop',\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(container)\n .withPush(true)\n .withViewportMargin(8)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\n ]),\n });\n this.overlayRef.backdropClick().subscribe(() => this.close(false));\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.isOpen.set(true);\n const overlayElement: HTMLElement = this.overlayRef.overlayElement;\n afterNextRender(() => overlayElement.querySelector<HTMLButtonElement>('.calendar-day[tabindex=\"0\"]')?.focus(), {\n injector: this.injector,\n });\n }\n\n /** Closes the calendar. With `returnFocus`, focus goes back to the date field. */\n public close(returnFocus: boolean): void {\n if (!this.isOpen()) {\n return;\n }\n this.disposeOverlay();\n this.isOpen.set(false);\n if (returnFocus) {\n this.dateField()?.nativeElement.focus();\n }\n }\n //#endregion\n\n //#region Private methods\n private isInsideField(target: EventTarget | null): boolean {\n return target instanceof Node && !!this.container()?.nativeElement.contains(target);\n }\n\n /** Reads what the user typed and turns it into the value. */\n private commitText(): void {\n const dateText: string = this.dateText().trim();\n const timeText: string = this.timeText().trim();\n const isDateTime: boolean = this.mode() === 'datetime';\n\n if (dateText === '' && (!isDateTime || timeText === '')) {\n this.setValue(null);\n return;\n }\n\n const day: Date | null = parseDateText(dateText, this.locale());\n const time: { hours: number; minutes: number } | null =\n isDateTime && timeText !== '' ? parseTimeText(timeText) : null;\n if (!day || (isDateTime && timeText !== '' && !time)) {\n const hadValue: boolean = this.current() !== null;\n this.hasTypingError.set(true);\n this.current.set(null);\n // The text stays as typed, so the user can correct it.\n this.dateText.set(dateText);\n this.timeText.set(timeText);\n if (hadValue) {\n this.onChange(null);\n }\n this.onValidatorChange();\n return;\n }\n\n if (time) {\n day.setHours(time.hours, time.minutes);\n }\n this.setValue(day);\n }\n\n private setValue(value: Date | null): void {\n const hadTypingError: boolean = this.hasTypingError();\n this.hasTypingError.set(false);\n const previous: string | null = this.serialize(this.current());\n this.current.set(value);\n const next: string | null = this.serialize(value);\n if (next !== previous) {\n this.onChange(next);\n } else if (hadTypingError) {\n this.onValidatorChange();\n }\n }\n\n private serialize(value: Date | null): string | null {\n if (!value) {\n return null;\n }\n return this.mode() === 'datetime' ? toIsoDateTime(value) : toIsoDate(value);\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n }\n //#endregion\n}\n\n/** A limit as a comparable key: its day, or `null`. */\nfunction limitKey(limit: Date | string | null | undefined): string | null {\n const date: Date | null = parseIsoValue(limit);\n return date ? toIsoDate(date) : null;\n}\n","<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","import {\n Component,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n InputSignal,\n linkedSignal,\n output,\n OutputEmitterRef,\n signal,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\nimport { formatLocaleNumber, getNumberSeparators, parseLocaleNumber } from '../../helpers/locale-format';\nimport { LocaleService } from '../../services/locale.service';\n\n/** The symbol a currency shows and the side it sits on, in one locale. */\ninterface CurrencyAffix {\n symbol: string;\n position: 'prefix' | 'suffix';\n fractionDigits: number;\n}\n\n/**\n * A number field that follows the application's language.\n *\n * The native `<input type=\"number\">` reads the decimal separator from the browser, so a user whose\n * browser is in English types `1.5` in an application shown in Portuguese, where `1,5` is expected.\n * This field reads and writes numbers in the language the application chose (see `LocaleService`):\n * `1.234,56` in Portuguese and `1,234.56` in English.\n *\n * While the field has focus it shows the number without thousands separators, to make editing easy.\n * When it loses focus it rounds to `decimals` and shows the separators again.\n *\n * It is a form control. The value is a `number`, or `null` when the field is empty or the text is\n * not a number. It adds these validation errors: `numberInvalid` when the text is not a number,\n * and `min` and `max`, with the same shape as Angular's own validators.\n *\n * The decimal key of the numeric keypad types the language's decimal separator. The arrow keys\n * add or subtract `step`.\n */\n@Component({\n selector: 'lib-number-input',\n templateUrl: './number-input.component.html',\n styleUrls: ['./number-input.component.scss'],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NumberInputComponent), multi: true },\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NumberInputComponent), multi: true },\n ],\n host: {\n class: 'lib-number-input',\n },\n})\nexport class NumberInputComponent implements ControlValueAccessor, Validator {\n //#region Inputs and outputs\n /** Smallest allowed value. Defaults to no limit. */\n public readonly min: InputSignal<number | null | undefined> = input<number | null>();\n /** Largest allowed value. Defaults to no limit. */\n public readonly max: InputSignal<number | null | undefined> = input<number | null>();\n /** How much the arrow keys add or subtract. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /**\n * Most digits after the decimal separator; the value is rounded to it when the field loses\n * focus. `0` makes an integer field. Defaults to `3`, or to the currency's digits with `currency`.\n */\n public readonly decimals: InputSignal<number | undefined> = input<number>();\n /**\n * Fewest digits shown after the decimal separator, such as `2` to show `10,00`. Defaults to `0`,\n * or to the currency's digits with `currency`.\n */\n public readonly minDecimals: InputSignal<number | undefined> = input<number>();\n /** Whether to show thousands separators when the field does not have focus. Defaults to `true`. */\n public readonly grouping: InputSignal<boolean> = input(true);\n /** Text shown before the number, such as `R$`. Overrides the currency symbol. Defaults to none. */\n public readonly prefix: InputSignal<string | undefined> = input<string>();\n /** Text shown after the number, such as `%` or `kg`. Overrides the currency symbol. Defaults to none. */\n public readonly suffix: InputSignal<string | undefined> = input<string>();\n /**\n * ISO 4217 currency code, such as `BRL` or `USD`. Shows the currency symbol on the side the\n * language puts it, and sets the decimals the currency uses. The value stays a plain number.\n * Defaults to none.\n */\n public readonly currency: InputSignal<string | undefined> = input<string>();\n /** Lets the user see and focus the value but not change it. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Shows the field as invalid, for example when the form was touched. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Accessible name of the field, when no visible label names it. Defaults to none. */\n public readonly ariaLabel: InputSignal<string | undefined> = input<string>();\n\n /** Emits when the field loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits when the field gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every keystroke. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly localeService: LocaleService = inject(LocaleService);\n\n private onChange: (value: number | null) => void = () => undefined;\n private onTouched: () => void = () => undefined;\n private onValidatorChange: () => void = () => undefined;\n\n private readonly current: WritableSignal<number | null> = signal(null);\n private readonly hasTypingError: WritableSignal<boolean> = signal(false);\n private readonly hasFocus: WritableSignal<boolean> = signal(false);\n /** Whether the user typed since the field gained focus. Only typed values are rounded. */\n private wasEdited = false;\n //#endregion\n\n //#region Properties\n protected readonly isDisabled: WritableSignal<boolean> = signal(false);\n protected readonly locale: Signal<string> = computed(() => this.localeService.locale());\n\n protected readonly currencyAffix: Signal<CurrencyAffix | null> = computed(() => {\n const currency: string | undefined = this.currency();\n if (!currency) {\n return null;\n }\n try {\n const format: Intl.NumberFormat = new Intl.NumberFormat(this.locale(), { style: 'currency', currency });\n const parts: Intl.NumberFormatPart[] = format.formatToParts(1);\n const symbolIndex: number = parts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const integerIndex: number = parts.findIndex((part: Intl.NumberFormatPart) => part.type === 'integer');\n return {\n symbol: parts[symbolIndex]?.value ?? currency,\n position: symbolIndex > integerIndex ? 'suffix' : 'prefix',\n fractionDigits: format.resolvedOptions().maximumFractionDigits ?? 2,\n };\n } catch {\n return null;\n }\n });\n\n protected readonly prefixText: Signal<string | undefined> = computed(() => {\n const affix: CurrencyAffix | null = this.currencyAffix();\n return this.prefix() ?? (affix?.position === 'prefix' ? affix.symbol : undefined);\n });\n\n protected readonly suffixText: Signal<string | undefined> = computed(() => {\n const affix: CurrencyAffix | null = this.currencyAffix();\n return this.suffix() ?? (affix?.position === 'suffix' ? affix.symbol : undefined);\n });\n\n protected readonly maxDecimals: Signal<number> = computed(\n () => this.decimals() ?? this.currencyAffix()?.fractionDigits ?? 3,\n );\n protected readonly fixedDecimals: Signal<number> = computed(() =>\n Math.min(this.minDecimals() ?? this.currencyAffix()?.fractionDigits ?? 0, this.maxDecimals()),\n );\n\n /** The text in the field. Follows the value, the language and focus, and the user's typing in between. */\n protected readonly text: WritableSignal<string> = linkedSignal(() => {\n const value: number | null = this.current();\n if (value === null) {\n return '';\n }\n const isEditing: boolean = this.hasFocus();\n return formatLocaleNumber(value, this.locale(), {\n minFractionDigits: isEditing ? 0 : this.fixedDecimals(),\n maxFractionDigits: isEditing ? 20 : this.maxDecimals(),\n grouping: !isEditing && this.grouping(),\n });\n });\n\n protected readonly inputMode: Signal<string> = computed(() => (this.maxDecimals() > 0 ? 'decimal' : 'numeric'));\n protected readonly isFieldInvalid: Signal<boolean> = computed(() => this.invalid() || this.hasTypingError());\n //#endregion\n\n //#region Constructor\n constructor() {\n // A new `min` or `max` changes the errors, so the form must validate again. The first run\n // only records the starting limits: the form validates on its own when it attaches.\n let previous: string | undefined;\n effect(() => {\n const limits: string = JSON.stringify([this.min(), this.max()]);\n if (previous !== undefined && previous !== limits) {\n this.onValidatorChange();\n }\n previous = limits;\n });\n }\n //#endregion\n\n //#region ControlValueAccessor and Validator\n /** Sets the value from the form. Accepts a number, a numeric string such as `\"12.5\"`, or `null`. */\n public writeValue(value: unknown): void {\n this.hasTypingError.set(false);\n if (value === null || value === undefined || value === '') {\n this.current.set(null);\n return;\n }\n const number: number = typeof value === 'number' ? value : Number(value);\n this.current.set(Number.isFinite(number) ? number : null);\n }\n\n /** Registers the form's change callback. */\n public registerOnChange(fn: (value: number | null) => void): void {\n this.onChange = fn;\n }\n\n /** Registers the form's touched callback. */\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** Enables or disables the field from the form. */\n public setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(isDisabled);\n }\n\n /** Reports `numberInvalid`, `min` and `max`. */\n public validate(_control: AbstractControl): ValidationErrors | null {\n if (this.hasTypingError()) {\n return { numberInvalid: true };\n }\n const value: number | null = this.current();\n if (value === null) {\n return null;\n }\n const min: number | null | undefined = this.min();\n const max: number | null | undefined = this.max();\n if (min !== null && min !== undefined && value < min) {\n return { min: { min, actual: value } };\n }\n if (max !== null && max !== undefined && value > max) {\n return { max: { max, actual: value } };\n }\n return null;\n }\n\n /** Registers the callback that re-runs validation. */\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n //#endregion\n\n //#region Event handlers\n protected onFocus(): void {\n this.hasFocus.set(true);\n this.wasEdited = false;\n this.focused.emit();\n }\n\n protected onBlur(): void {\n // Leaving focus re-derives the text from the value, with separators. Only a value the user\n // typed is rounded: tabbing through a field must not change what the form holds.\n this.hasFocus.set(false);\n const value: number | null = this.current();\n if (this.wasEdited && !this.hasTypingError() && value !== null) {\n this.setValue(this.round(value));\n }\n this.wasEdited = false;\n this.onTouched();\n this.blurred.emit();\n }\n\n protected onTyped(event: Event): void {\n const text: string = (<HTMLInputElement>event.target).value;\n this.wasEdited = true;\n this.inputChanged.emit();\n\n const parsed: number | null = parseLocaleNumber(text, this.locale());\n if (parsed !== null && Number.isNaN(parsed)) {\n const hadValue: boolean = this.current() !== null;\n this.hasTypingError.set(true);\n this.current.set(null);\n if (hadValue) {\n this.onChange(null);\n }\n this.onValidatorChange();\n } else {\n this.setValue(parsed);\n }\n\n // Keep what the user typed on screen while the value follows it.\n this.text.set(text);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.readOnly()) {\n return;\n }\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const direction: number = event.key === 'ArrowUp' ? 1 : -1;\n this.setValue(this.clamp(this.round((this.current() ?? 0) + direction * this.step())));\n return;\n }\n\n // The keypad's decimal key types \".\" on many layouts, whatever the language uses.\n if (event.code === 'NumpadDecimal' || event.key === 'Decimal') {\n event.preventDefault();\n this.insertText(<HTMLInputElement>event.target, getNumberSeparators(this.locale()).decimal);\n }\n }\n //#endregion\n\n //#region Private methods\n private setValue(value: number | null): void {\n const hadTypingError: boolean = this.hasTypingError();\n this.hasTypingError.set(false);\n if (value !== this.current()) {\n this.current.set(value);\n this.onChange(value);\n } else if (hadTypingError) {\n this.onValidatorChange();\n }\n }\n\n private round(value: number): number {\n // Shift by the exponent, not by multiplying: 1.005 * 100 is 100.49999999999999 in binary\n // floating point, so the product rounded 1.005 down to 1 at two decimals.\n const decimals: number = this.maxDecimals();\n const shifted: number = Math.round(Number(`${value}e${decimals}`));\n const rounded = Number(`${shifted}e-${decimals}`);\n return Number.isFinite(rounded) ? rounded : value;\n }\n\n private clamp(value: number): number {\n const min: number | null | undefined = this.min();\n const max: number | null | undefined = this.max();\n if (min !== null && min !== undefined && value < min) {\n return min;\n }\n if (max !== null && max !== undefined && value > max) {\n return max;\n }\n return value;\n }\n\n private insertText(field: HTMLInputElement, text: string): void {\n const start: number = field.selectionStart ?? field.value.length;\n const end: number = field.selectionEnd ?? field.value.length;\n field.setRangeText(text, start, end, 'end');\n field.dispatchEvent(new Event('input', { bubbles: true }));\n }\n //#endregion\n}\n","<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","import { CommonModule, formatDate } from '@angular/common';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n LOCALE_ID,\n model,\n ModelSignal,\n OnInit,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport {\n ControlContainer,\n FormControl,\n FormGroup,\n FormGroupDirective,\n FormGroupName,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport {\n formatDateText,\n formatLocaleNumber,\n formatTimeText,\n parseDigitsInfo,\n parseIsoValue,\n} from '../../helpers/locale-format';\nimport { FormService } from '../../services';\nimport { LocaleService } from '../../services/locale.service';\nimport { BaseComponent } from '../base.component';\nimport { DateInputComponent } from '../date-input/date-input.component';\nimport { NumberInputComponent } from '../number-input/number-input.component';\n\n/**\n * A single form field without a label. It edits a control of the surrounding `[formGroup]` named by\n * `controlName`, or shows `fixedValue` when there is no control. While the form is disabled and\n * the `FormService` is not in edit mode, it shows the value as text instead of an input.\n */\n@Component({\n selector: 'lib-form-input',\n templateUrl: './form-input.component.html',\n styleUrls: ['./form-input.component.scss'],\n imports: [CommonModule, DateInputComponent, FormsModule, NumberInputComponent, ReactiveFormsModule],\n viewProviders: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class.full-height]': 'isFullHeight()',\n // Clears a stray `type` attribute for the same reason as FormInputGroupComponent — see the\n // comment there. Applies when a consumer sets `type` on `lib-form-input` directly.\n '[attr.type]': 'null',\n },\n})\nexport class FormInputComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Accepted for parity with `lib-form-input-group`, but this component's template does not apply it. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Name of the control in the surrounding form group to edit. Leave empty to show `fixedValue` instead. */\n public readonly controlName: InputSignal<string> = input('');\n /** Control whose value is shown in read-only mode instead of `controlName`'s, for example a display name next to an ID. */\n public readonly disabledControlName: InputSignal<string | undefined> = input<string>();\n /** Styles a read-only input like a disabled one. Defaults to `true`. */\n public readonly displayReadOnlyAsDisabled: InputSignal<boolean> = input(true);\n /** Shows the field in its error style. Defaults to `false`. */\n public readonly invalid: InputSignal<boolean> = input(false);\n /** Disables the input when it shows `fixedValue` (no `controlName`). Has no effect on a form control. Defaults to `true`. */\n public readonly isDisabled: InputSignal<boolean> = input(true);\n /** Lets the field grow to the full height of its container, for example a tall textarea. Defaults to `false`. */\n public readonly isFullHeight: InputSignal<boolean> = input(false);\n /** Maximum number of characters for text inputs and textareas. No limit by default. */\n public readonly maxLength: InputSignal<number | undefined> = input<number>();\n /** Minimum value for a `number` field. No minimum by default. */\n public readonly min: InputSignal<number | undefined> = input<number>();\n /** Makes a control-bound text-like input read-only while it stays focusable. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Visible number of lines for a `textarea` field. */\n public readonly rows: InputSignal<number | undefined> = input<number>();\n /** Increment for a `number` field. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /**\n * Kind of field: `textarea`, `checkbox` (shown as a switch), or any native input type such as\n * `text`, `number`, `date` or `datetime-local`. Defaults to `text`.\n *\n * `date` and `datetime-local` render `lib-date-input`, and `number` renders `lib-number-input`, so\n * dates and numbers show and are typed in the application's language. The control's value keeps\n * the native shape: `yyyy-MM-dd`, `yyyy-MM-ddTHH:mm` or a number.\n */\n public readonly type: InputSignal<string> = input('text');\n\n // Both are written by this component as well as bound by a parent, so they are models rather\n // than inputs: `fixedValue` is two-way bound through ngModel, and `format` is part of the public\n // two-way contract.\n /** Value shown and edited when there is no `controlName`. Supports two-way binding. */\n public readonly fixedValue: ModelSignal<any> = model<any>();\n /**\n * Display format for the read-only value: a `DatePipe` pattern for date types, or a\n * `DecimalPipe` digits string for `number`, such as `1.2-2`. Without it, dates show in the\n * application's language (`05/12/2026` in Portuguese) and numbers with up to three decimals.\n */\n public readonly format: ModelSignal<string | undefined> = model<string>();\n\n // Deliberately NOT named blur/change/input/focus. <lib-form-input> is a real DOM\n // element, so an output sharing a native event name fires the consumer's handler\n // twice for the bubbling events and shadows the native one for the rest.\n /** Emits when the input loses focus. */\n public readonly blurred: OutputEmitterRef<void> = output<void>();\n /** Emits the native `change` event of a checkbox that shows `fixedValue`. */\n public readonly changed: OutputEmitterRef<any> = output<any>();\n /** Emits the new value when the user edits `fixedValue`. */\n public readonly fixedValueChanged: OutputEmitterRef<string> = output<string>();\n /** Emits when the input gains focus. */\n public readonly focused: OutputEmitterRef<void> = output<void>();\n /** Emits on every native `input` event, that is, each time the user types or toggles. */\n public readonly inputChanged: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected readonly formGroupDirective: FormGroupDirective = inject(FormGroupDirective);\n protected readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n protected readonly formService: FormService = inject(FormService);\n private readonly angularLocale: string = inject(LOCALE_ID);\n private readonly localeService: LocaleService = inject(LocaleService);\n\n /**\n * Bumped on every event the form emits -- a status change, a value change, a reset.\n *\n * A FormGroup is not a signal, so the template could not track whether the form is enabled or\n * what a control holds. Angular's own `NgControlStatus` notified this view by accident, but only\n * while an input was on screen and only when that control's own status moved. So the field never\n * turned into an input when a multi-editor enabled its form, and a control kept disabled through\n * an edit stayed an input after the edit was cancelled.\n *\n * A change made with `emitEvent: false` emits nothing, and still reaches no one.\n */\n private readonly formChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n /**\n * Whether the field is an input rather than a read-only value. Both halves are read every time:\n * with `||` the edit-mode signal went untracked whenever the form happened to be enabled.\n */\n protected readonly isEditable: Signal<boolean> = computed(() => {\n this.formChanged();\n const isFormEnabled: boolean = this.formGroupDirective.form?.enabled ?? false;\n const isEditMode: boolean = this.formService.isEditMode;\n return isFormEnabled || isEditMode;\n });\n\n /** What the read-only face shows: the fixed value, or else the control's current value. */\n protected readonly shownValue: Signal<any> = computed(() => {\n this.formChanged();\n return (\n this.fixedValue() ?? this.formGroupDirective.form?.get(this.disabledControlName() ?? this.controlName())?.value\n );\n });\n\n /** The read-only face's text, in the application's language. */\n protected readonly shownText: Signal<string> = computed(() => this.toDisplayText(this.shownValue()));\n\n /** The text of the disabled input that shows `fixedValue`, in the application's language. */\n protected readonly fixedText: Signal<string> = computed(() => this.toDisplayText(this.fixedValue()));\n\n /** Fraction digits for a number field, read from `format`. */\n protected readonly numberDigits: Signal<{ minFractionDigits: number; maxFractionDigits: number }> = computed(\n () => parseDigitsInfo(this.format()) ?? { minFractionDigits: 0, maxFractionDigits: 3 },\n );\n\n protected get formControl(): FormControl<any> | null {\n return this.controlName() ? <FormControl>this.formGroup.get(this.controlName()) : null;\n }\n\n protected get formControlName(): string {\n return [...this.parentGroups, this.controlName()].join('.');\n }\n\n protected get formGroup(): FormGroup {\n let formGroup: FormGroup = this.formGroupDirective.form;\n for (const group of this.parentGroups) {\n formGroup = <FormGroup>formGroup.get(group);\n }\n return formGroup;\n }\n\n protected get isFormControl(): boolean {\n return !!this.controlName() && this.controlName().length > 0;\n }\n\n protected get parentGroups(): string[] {\n return this.formGroupName?.path ?? [];\n }\n\n protected get stepAttributeValue(): number | null {\n if (this.type() === 'number') {\n return this.step();\n }\n return null;\n }\n\n protected get minAttributeValue(): number | null {\n if (this.type() === 'number') {\n return this.min() ?? null;\n }\n return null;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.formGroupDirective.form?.events\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.formChanged.update((count: number) => count + 1));\n\n switch (this.type()) {\n case 'number':\n if (this.formControl) {\n this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n if (value !== null && value === '') {\n this.formControl?.setValue(null);\n }\n });\n }\n break;\n\n case 'date':\n if (this.formControl) {\n this.formControl.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n if (value !== null) {\n try {\n if (value !== formatDate(value, 'yyyy-MM-dd', 'en')) {\n this.formControl?.setValue(formatDate(value, 'yyyy-MM-dd', 'en'), { emitEvent: false });\n }\n } catch {\n this.formControl?.setValue(null, { emitEvent: false });\n }\n }\n });\n }\n break;\n }\n }\n //#endregion\n\n //#region Event handlers\n protected onBlur(): void {\n this.blurred.emit();\n }\n\n protected onChange(value: any): void {\n this.changed.emit(value);\n }\n\n protected onFocus(): void {\n this.focused.emit();\n }\n\n protected onInput(): void {\n this.inputChanged.emit();\n }\n\n protected onValueChanged(newText: string): void {\n this.fixedValue.set(newText);\n this.fixedValueChanged.emit(newText);\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n /**\n * Formats a value for the read-only face. Dates and numbers follow the application's language\n * (`LocaleService`). An explicit `format` on a date field is still a `DatePipe` pattern; on a\n * number field it is a `DecimalPipe` digits string, applied in the application's language.\n */\n private toDisplayText(value: any): string {\n if (value === null || value === undefined || value === '') {\n return '';\n }\n const locale: string = this.localeService.locale();\n const format: string | undefined = this.format();\n\n switch (this.type()) {\n case 'date':\n case 'datetime-local': {\n const date: Date | null = parseIsoValue(value);\n if (!date) {\n return String(value);\n }\n if (format) {\n return formatDate(date, format, this.angularLocale);\n }\n const day: string = formatDateText(date, locale);\n return this.type() === 'date' ? day : `${day} ${formatTimeText(date, locale)}`;\n }\n case 'number': {\n const number: number = typeof value === 'number' ? value : Number(value);\n return Number.isFinite(number) ? formatLocaleNumber(number, locale, this.numberDigits()) : String(value);\n }\n default:\n return String(value);\n }\n }\n //#endregion\n}\n","@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","import { Component, computed, input, InputSignal, Signal } from '@angular/core';\n\n/** The outline a skeleton stands in for. */\nexport type SkeletonShape = 'text' | 'block' | 'circle';\n\n/**\n * A pulsing placeholder shown while content loads.\n *\n * The skeleton is decorative and hidden from screen readers. Mark the container that is loading\n * with `aria-busy=\"true\"` instead, and clear it when the content arrives.\n *\n * The pulse stops when the user asks for reduced motion.\n */\n@Component({\n selector: 'lib-skeleton',\n templateUrl: './skeleton.component.html',\n styleUrls: ['./skeleton.component.scss'],\n host: {\n class: 'lib-skeleton',\n 'aria-hidden': 'true',\n '[class.shape-text]': \"shape() === 'text'\",\n '[class.shape-block]': \"shape() === 'block'\",\n '[class.shape-circle]': \"shape() === 'circle'\",\n '[style.width]': 'width() ?? null',\n '[style.height]': \"shape() === 'text' ? null : (height() ?? null)\",\n },\n})\nexport class SkeletonComponent {\n //#region Inputs\n /**\n * The outline to draw: `text` for lines of text, `block` for an image or a card, `circle` for an\n * avatar. Defaults to `text`.\n */\n public readonly shape: InputSignal<SkeletonShape> = input<SkeletonShape>('text');\n\n /**\n * Number of text lines. The last one is shorter when there is more than one, as a paragraph's\n * is. Only used by the `text` shape. Defaults to `1`.\n */\n public readonly lines: InputSignal<number> = input(1);\n\n /**\n * Width as a CSS length, e.g. `12rem` or `50%`. Defaults to the full width for `text` and\n * `block`, and to `2.5rem` for `circle`.\n */\n public readonly width: InputSignal<string | undefined> = input<string>();\n\n /**\n * Height as a CSS length. For `text` it is the thickness of each line, `0.625rem` by default.\n * For `block` it defaults to `4rem`; a `circle` is as tall as it is wide.\n */\n public readonly height: InputSignal<string | undefined> = input<string>();\n //#endregion\n\n //#region Properties\n /** One entry per text line, at least one. */\n protected readonly lineIndexes: Signal<number[]> = computed(() =>\n Array.from({ length: Math.max(1, Math.floor(this.lines() || 1)) }, (_: unknown, index: number) => index),\n );\n //#endregion\n}\n","@if (shape() === 'text') {\n @for (line of lineIndexes(); track line) {\n <span class=\"lib-skeleton-line\" [style.height]=\"height() ?? null\"></span>\n }\n}\n","import { KeyValuePipe, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n WritableSignal,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormGroupDirective, FormGroupName, ValidationErrors } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { filter, takeUntil } from 'rxjs';\nimport { FormService } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { FormInputComponent } from '../form-input/form-input.component';\nimport { SkeletonComponent } from '../skeleton/skeleton.component';\n\n/**\n * A labelled form field: a label, a `lib-form-input` (or your own template), its validation\n * messages and optional notes. It shows a placeholder while the field or the form is loading.\n */\n@Component({\n selector: 'lib-form-input-group',\n templateUrl: './form-input-group.component.html',\n styleUrls: ['./form-input-group.component.scss'],\n imports: [FormInputComponent, KeyValuePipe, NgStyle, NgTemplateOutlet, SkeletonComponent, TranslatePipe],\n host: {\n '[class.full-height]': 'isFullHeight()',\n // Angular keeps static attributes in the DOM even when a directive consumes them as an\n // @Input(), so `type=\"checkbox\"` would linger on this host element — where\n // @tailwindcss/forms' tag-agnostic `[type=\"checkbox\"]` base rules style the host itself as\n // a checkbox (1px border, white fill, height:1rem). Clearing the attribute removes the\n // stray box for every type while leaving the `type` @Input() untouched.\n '[attr.type]': 'null',\n },\n})\nexport class FormInputGroupComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Passed to the inner `lib-form-input`, which does not apply it yet. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Vertical alignment of the field in its cell: `start`, `center` or `end`. Defaults to `center`. */\n public readonly alignContent: InputSignal<'center' | 'end' | 'start'> = input<'center' | 'end' | 'start'>('center');\n /** Name of the control in the surrounding form group. Its errors and loading state drive the messages. Required. */\n public readonly controlName: InputSignal<string> = input.required<string>();\n /** Value passed to the inner `lib-form-input` as its `fixedValue`. */\n public readonly fixedValue: InputSignal<any> = input<any>();\n /** Display format passed to the inner `lib-form-input`: a date pattern or a number digits string. */\n public readonly format: InputSignal<string | undefined> = input<string>();\n /** Text of the label, as a translation key. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Passed to the inner `lib-form-input`; disables it only when it shows a fixed value. Defaults to `true`. */\n public readonly isDisabled: InputSignal<boolean> = input(true);\n /** Lets the field grow to the full height of its container. Defaults to `false`. */\n public readonly isFullHeight: InputSignal<boolean> = input(false);\n /** Maximum number of characters for text inputs and textareas. No limit by default. */\n public readonly maxLength: InputSignal<number | undefined> = input<number>();\n /** Minimum value for a `number` field. No minimum by default. */\n public readonly min: InputSignal<number | undefined> = input<number>();\n /** Hint shown in small italics under the field, as a translation key. Defaults to empty. */\n public readonly notes: InputSignal<string> = input('');\n /** Makes the input read-only while it stays focusable. Defaults to `false`. */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /** Visible number of lines for a `textarea` field. */\n public readonly rows: InputSignal<number | undefined> = input<number>();\n /** Shows the label column. When `false`, the field spans the full width. Defaults to `true`. */\n public readonly showLabel: InputSignal<boolean> = input(true);\n /** Increment for a `number` field. Defaults to `1`. */\n public readonly step: InputSignal<number> = input(1);\n /** Your own template to render in place of the default `lib-form-input`. */\n public readonly template: InputSignal<TemplateRef<any> | undefined> = input<TemplateRef<any>>();\n /** Kind of field, passed to the inner `lib-form-input`, for example `text`, `number`, `date`, `checkbox` or `textarea`. Defaults to `text`. */\n public readonly type: InputSignal<string> = input('text');\n /**\n * Messages per validation error key, as translation keys, for example\n * `{ required: 'Validation-Required' }`. Only errors listed here show a message, once the control is touched.\n */\n public readonly validations: InputSignal<{ [id: string]: string }> = input<{ [id: string]: string }>({});\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n protected readonly formGroupDirective: FormGroupDirective = inject(FormGroupDirective);\n protected readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n protected formService: FormService = inject(FormService);\n protected readonly loadingField: WritableSignal<boolean> = signal(false);\n\n /**\n * Bumped on every event the control emits -- a value, status or touched change.\n *\n * A FormControl is not a signal, so the template could not track the control's errors or whether\n * it was touched. A change the field made itself redrew it, but one made from outside did not: the\n * server's errors after a save turned the input red and left the message hidden until the user\n * typed again, and a save marking every field as touched showed no required message at all.\n */\n private readonly controlChanged: WritableSignal<number> = signal(0);\n //#endregion\n\n //#region Properties\n protected readonly errors: Signal<ValidationErrors | null> = computed(() => {\n this.controlChanged();\n return this.formControl?.errors ?? null;\n });\n\n protected readonly isInvalid: Signal<boolean> = computed(() => {\n this.controlChanged();\n return this.formControl?.invalid ?? false;\n });\n\n protected readonly isTouched: Signal<boolean> = computed(() => {\n this.controlChanged();\n return this.formControl?.touched ?? false;\n });\n\n protected get formControl(): FormControl<any> | null {\n return this.controlName() ? <FormControl>this.formGroup.get(this.controlName()) : null;\n }\n\n protected get formGroup(): FormGroup {\n let formGroup: FormGroup = this.formGroupDirective.form;\n for (const group of this.parentGroups) {\n formGroup = <FormGroup>formGroup.get(group);\n }\n return formGroup;\n }\n\n protected get hasNotes(): boolean {\n return !!this.notes() && this.notes().length > 0;\n }\n\n protected get parentGroups(): string[] {\n return this.formGroupName?.path ?? [];\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.formControl?.events\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.controlChanged.update((count: number) => count + 1));\n\n this.formControl?.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loadingField.set(false);\n });\n\n this.formControl?.valueChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loadingField.set(false);\n });\n\n this.formService.fieldRefreshed\n .pipe(\n takeUntil(this.destroy$),\n filter(\n (field: { fieldName?: string; value?: any; loading?: boolean }) => field.fieldName === this.controlName(),\n ),\n )\n .subscribe((field: { fieldName?: string; value?: any; loading?: boolean }) => {\n this.loadingField.set(field.loading ?? false);\n });\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n protected hasValidation(errorKey: string): boolean {\n return Object.keys(this.validations()).indexOf(errorKey) >= 0;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","@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","import { FlexibleConnectedPositionStrategy, Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\n\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n Input,\n InputSignal,\n KeyValueChanges,\n KeyValueDiffer,\n KeyValueDiffers,\n OnDestroy,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { FormControl, FormGroup, FormGroupDirective, FormGroupName } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport {\n debounceTime,\n forkJoin,\n Observable,\n of,\n pairwise,\n startWith,\n Subject,\n switchMap,\n take,\n takeUntil,\n tap,\n} from 'rxjs';\nimport { DisplayControls } from '../../helpers';\nimport { ICatalogEntry, ICatalogResult } from '../../models';\nimport { CatalogService, DataGridDataset } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { FormInputGroupComponent } from '../form-input-group/form-input-group.component';\nimport { FormInputComponent } from '../form-input/form-input.component';\n\n/**\n * A labelled field that picks one entry from a catalog. It works in one of two modes:\n *\n * - **Fixed list.** Pass the entries in `entriesList`, such as the members of an enum or\n * Yes/No/Maybe. No backend call is made. For a short list, set `searchable` to `false` and the\n * field becomes a plain picker.\n * - **Search endpoint.** Set `searchEndpoint`, and the entries are searched on your API as the\n * user types.\n *\n * Either way it writes the chosen value to `controlName` and its text to `displayControlName` in\n * the surrounding form group.\n */\n@Component({\n selector: 'lib-catalog-select',\n templateUrl: './catalog-select.component.html',\n styleUrls: ['./catalog-select.component.scss'],\n imports: [FormInputComponent, FormInputGroupComponent, TranslatePipe],\n})\nexport class CatalogSelectComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {\n //#region HostListeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n const target: HTMLElement = <HTMLElement>event.target;\n if (this.isDropDownShown() && !target.closest('.catalog-container.show')) {\n this.wasClickedOutside = (event.button === 0 && !target.closest('.dropdown-container')) ?? false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.isDropDownShown() && this.wasClickedOutside) {\n this.closeDropdownOverlay();\n this.wasClickedOutside = false;\n }\n }\n //#endregion\n\n //#region ViewChilds, Inputs, Outputs\n private readonly dropdownTemplate: Signal<TemplateRef<any> | undefined> = viewChild('dropdownTemplate', {\n read: TemplateRef,\n });\n private readonly inputElement: Signal<ElementRef<HTMLDivElement> | undefined> = viewChild('input', {\n read: ElementRef,\n });\n\n /** Passed to the inner `lib-form-input`, which does not apply it yet. Defaults to `false`. */\n public readonly autofocus: InputSignal<boolean> = input(false);\n /** Control in the surrounding form group that receives the chosen entry's value. Required. */\n public readonly controlName: InputSignal<string> = input.required<string>();\n /** Control in the surrounding form group that receives the chosen entry's text, which the input shows. Required. */\n public readonly displayControlName: InputSignal<string> = input.required<string>();\n /** Property of each `entriesList` item that holds its text. Defaults to `display`. */\n public readonly displayProperty: InputSignal<string> = input('display');\n /**\n * The entries of the fixed-list mode, used when there is no `searchEndpoint`. No backend call is\n * made for them. Each item's text and value\n * are read from `displayProperty` and `valueProperty`; the text may be an observable, such as\n * a translation. Setting a new list refreshes the dropdown.\n */\n @Input() public set entriesList(\n value: any[] | { key: number; value: Observable<any> | string }[] | null | undefined,\n ) {\n if (this._entriesList !== value) {\n this._entriesList = value;\n if (this.isSubscriptionInitialized) {\n this.entriesDataSource = [];\n this.initializeEntriesDataSource();\n this.refreshSearch();\n }\n }\n }\n /**\n * Extra filters sent to `searchEndpoint` with every search. A changed filter set runs the search\n * again. Defaults to none.\n */\n @Input() public set filters(value: { [id: string]: any }) {\n if (this._filters !== value) {\n this._filters = value;\n this.updateFilters();\n }\n }\n /** Text of the label, as a translation key. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Maximum number of entries requested from `searchEndpoint`. Defaults to `100`. */\n public readonly maxEntries: InputSignal<number> = input(100);\n /**\n * Characters the user must type before a search runs, when the endpoint asks for search\n * criteria. Defaults to `3`.\n */\n public readonly minimumLengthSearch: InputSignal<number> = input(3);\n /** Hint shown in small italics under the field, as a translation key. Defaults to empty. */\n public readonly notes: InputSignal<string> = input('');\n /**\n * Blocks typing, hides the clear button and stops the dropdown opening on focus; a click still\n * opens it. Defaults to `false`.\n */\n public readonly readOnly: InputSignal<boolean> = input(false);\n /**\n * Whether the field accepts typing to narrow the list.\n *\n * A catalog of a handful of entries is a picker, not a search: typing only gets in the way, and\n * the minimum-length rule would hide the very entries the user opened the field to choose from.\n * Turning this off leaves the input read-only to the keyboard while the dropdown still opens on\n * click and the clear button still works -- unlike {@link readOnly}, which means the value\n * cannot be changed at all.\n *\n * It does not suit an endpoint that answers shouldUseCriteria: that endpoint returns nothing\n * until it is given criteria, and there would be no way left to type any.\n */\n public readonly searchable: InputSignal<boolean> = input(true);\n /**\n * URL of the search-endpoint mode. The entries are searched there with a POST of\n * `{ maxResults, criteria, filters }`. When empty, the field uses the fixed `entriesList` and\n * calls no backend. Changing it starts the search over.\n */\n @Input() public set searchEndpoint(value: string | undefined) {\n if (this._searchEndpoint === value) {\n return;\n }\n\n this._searchEndpoint = value;\n\n // A screen that reads the endpoint off a model it loads over HTTP binds an empty string first,\n // and this component initializes against that: no endpoint takes the static-list path, finds an\n // empty list and latches \"no results\". Nothing re-ran the search when the real endpoint landed,\n // so the field stayed empty until the user typed something and cleared it again.\n //\n // Re-initializing rather than merely refreshing, because a different endpoint is a different\n // catalog: what the previous one reported about needing criteria cannot be carried over.\n if (this.isSubscriptionInitialized) {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n }\n /** Messages per validation error key of `controlName`, as translation keys. Defaults to none. */\n public readonly validations: InputSignal<{ [id: string]: string }> = input<{ [id: string]: string }>({});\n /** Property of each `entriesList` item that holds its value. Defaults to `value`. */\n public readonly valueProperty: InputSignal<string> = input('value');\n //#endregion\n\n //#region Variables\n // The three setter inputs below -- entriesList, filters and searchEndpoint -- stay decorator\n // inputs on purpose. They are imperative configuration that re-initialises the search, no\n // template reads them, and converting them would move that side effect into an effect() for\n // no gain in what reaches the screen.\n protected readonly displayedEntries: WritableSignal<ICatalogEntry[]> = signal<ICatalogEntry[]>([]);\n protected readonly focusedIndex: WritableSignal<number> = signal(-1);\n protected readonly isDropDownShown: WritableSignal<boolean> = signal(false);\n protected readonly isFocused: WritableSignal<boolean> = signal(false);\n protected readonly isLoading: WritableSignal<boolean> = signal(false);\n protected readonly selectedValue: WritableSignal<any> = signal(undefined);\n protected readonly shouldUseCriteria: WritableSignal<boolean> = signal(false);\n protected readonly showFailureMessage: WritableSignal<boolean> = signal(false);\n protected readonly showMinimumCharactersMessage: WritableSignal<boolean> = signal(false);\n protected readonly showNoResultsMessage: WritableSignal<boolean> = signal(false);\n\n private static instanceCounter = 0;\n private _entriesList?: any[] | { key: number; value: Observable<any> | string }[] | null;\n private _filters: { [id: string]: any } = {};\n private _searchEndpoint?: string;\n private catalogService: CatalogService = inject(CatalogService);\n private dataGridDataset: DataGridDataset = inject(DataGridDataset, { optional: true })!;\n private entriesDataSource: ICatalogEntry[] = [];\n private filterDiffer?: KeyValueDiffer<string, any>;\n private readonly formGroup: FormGroupDirective = inject(FormGroupDirective);\n private readonly formGroupName: FormGroupName = inject(FormGroupName, { optional: true })!;\n private instanceId: number;\n private isDataInitialized = false;\n private isSubscriptionInitialized = false;\n private keyValueDiffers: KeyValueDiffers = inject(KeyValueDiffers);\n private lastCriteriaUsed: string | null = null;\n private overlay: Overlay = inject(Overlay);\n private overlayRef?: OverlayRef;\n private positionBuilder: OverlayPositionBuilder = inject(OverlayPositionBuilder);\n private searchSubject: Subject<string | null> = new Subject<string | null>();\n private viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n private wasClickedOutside = false;\n //#endregion\n\n //#region Properties\n /** The static entries to choose from. */\n public get entriesList(): any[] | { key: number; value: Observable<any> | string }[] | null | undefined {\n return this._entriesList;\n }\n\n /** The filters sent to `searchEndpoint`. */\n public get filters(): { [id: string]: any } | undefined {\n return this._filters;\n }\n\n /** The URL the entries are searched from. */\n public get searchEndpoint(): string | undefined {\n return this._searchEndpoint;\n }\n\n protected get activeDescendantId(): string | null {\n if (this.focusedIndex() >= 0 && this.focusedIndex() < this.displayedEntries().length) {\n return `catalog-select-${this.instanceId}-option-${this.focusedIndex()}`;\n }\n return null;\n }\n\n protected get displayControl(): FormControl {\n return <FormControl>this.formGroup.form.get(this.formDisplayControlName);\n }\n\n protected get formControl(): FormControl {\n return <FormControl>this.formGroup.form.get(this.formControlName);\n }\n\n protected get formControlName(): string {\n return [...(this.formGroupName?.path ?? []), this.controlName()].join('.');\n }\n\n protected get formDisplayControlName(): string {\n return [...(this.formGroupName?.path ?? []), this.displayControlName()].join('.');\n }\n\n protected get isInvalid(): boolean {\n return this.formControl.invalid;\n }\n\n protected get isTouched(): boolean {\n return this.formControl.touched;\n }\n\n protected get listboxId(): string {\n return `catalog-select-${this.instanceId}-listbox`;\n }\n\n /**\n * Whether the button that empties the field is offered.\n *\n * It asks the form control, not {@link selectedValue}. The latter is only written when this\n * component sees the value arrive -- from a pick in the dropdown, or from the initial sync in\n * ngOnInit. A value patched in afterwards without an event, which is how a saved filter is\n * restored into a form this component has already initialised, reaches the control and the\n * display without ever reaching {@link selectedValue}. Keying the button off it left the field\n * showing a value with no way to remove it.\n */\n protected get showClearButton(): boolean {\n return this.formControl?.value != null && !this.readOnly() && (this.formControl?.enabled ?? false);\n }\n\n private get hasSearchEndpoint(): boolean {\n return !!this.searchEndpoint && this.searchEndpoint.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n this.instanceId = CatalogSelectComponent.instanceCounter++;\n }\n\n public ngAfterViewInit(): void {\n this.setInputAriaAttributes();\n }\n\n public override ngOnDestroy(): void {\n this.closeDropdownOverlay();\n super.ngOnDestroy();\n }\n\n public ngOnInit(): void {\n // Check and add the display control, if it does not exist.\n const wasFormDisabled: boolean = this.formGroup.form.disabled;\n this.checkAndAddDisplayControl();\n if (wasFormDisabled) {\n this.formGroup.form.disable();\n }\n\n // Initialize the entries data source from the entries list, if provided.\n this.initializeEntriesDataSource();\n\n // Initialize the search functionality.\n this.initializeSearch();\n\n // Subscribe to changes in the display control to apply search criteria.\n this.displayControl?.valueChanges\n .pipe(\n takeUntil(this.destroy$),\n tap(() => {\n if (!this.isFocused()) {\n return;\n }\n this.isLoading.set(true);\n this.resetMessages();\n }),\n debounceTime(500),\n startWith(null),\n pairwise(),\n )\n .subscribe(([previous, current]: string[]) => {\n if (!this.isFocused() || previous === current) {\n this.isLoading.set(false);\n return;\n }\n this.applySearchCriteria(current);\n });\n\n this.filterDiffer = this.keyValueDiffers.find(this._filters).create();\n\n // Subscribe to changes in the form control to update the selected value and display control states.\n this.syncFormControlsEnabledDisabled();\n\n this.formControl?.valueChanges.pipe(takeUntil(this.destroy$)).subscribe((value: any) => {\n this.syncFormControlsEnabledDisabled();\n\n if (!this.shouldRefreshDisplay(value)) {\n return;\n }\n\n this.selectedValue.set(value);\n if (this.hasSearchEndpoint) {\n if (!value) {\n this.displayControl?.reset(null, { emitEvent: false });\n }\n } else {\n this.displayControl?.setValue(this.resolveDisplay(value), { emitEvent: false });\n }\n });\n\n // Initial sync: if the form control already has a value (e.g., the model was loaded\n // before this component initialized), sync the display control immediately.\n this.syncDisplayFromCurrentValue();\n }\n //#endregion\n\n //#region Event handlers\n protected onContainerBlur(): void {\n this.isFocused.set(false);\n }\n\n protected onContainerClick(): void {\n if (\n (!this.isDropDownShown() || this.readOnly()) &&\n (this.formGroup.form?.enabled ?? false) &&\n (this.formGroup.form?.get(this.formControlName)?.enabled ?? false)\n ) {\n this.openDropdownOverlay();\n }\n }\n\n protected onContainerFocus(): void {\n this.isFocused.set(true);\n if (\n !this.isDropDownShown() &&\n !this.readOnly() &&\n (this.formGroup.form?.enabled ?? false) &&\n (this.formGroup.form?.get(this.formControlName)?.enabled ?? false)\n ) {\n this.openDropdownOverlay();\n }\n }\n\n protected onClearClick(event: MouseEvent): void {\n event.stopPropagation();\n\n if (this.formControl) {\n this.formControl.setValue(null);\n this.formControl.markAsDirty();\n this.formControl.markAsTouched();\n }\n\n if (this.displayControl) {\n this.displayControl.setValue('', { emitEvent: false });\n this.displayControl.markAsDirty();\n this.displayControl.markAsTouched();\n }\n\n this.selectedValue.set(null);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.isDropDownShown()) {\n this.openDropdownOverlay();\n }\n if (this.displayedEntries().length > 0) {\n this.focusedIndex.set(Math.min(this.focusedIndex() + 1, this.displayedEntries().length - 1));\n this.scrollFocusedItemIntoView();\n }\n this.updateInputAriaActiveDescendant();\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n if (this.isDropDownShown() && this.displayedEntries().length > 0) {\n this.focusedIndex.set(Math.max(this.focusedIndex() - 1, 0));\n this.scrollFocusedItemIntoView();\n }\n this.updateInputAriaActiveDescendant();\n break;\n\n case 'Enter':\n event.preventDefault();\n if (\n this.isDropDownShown() &&\n this.focusedIndex() >= 0 &&\n this.focusedIndex() < this.displayedEntries().length\n ) {\n this.onDropDownItemClick(this.displayedEntries()[this.focusedIndex()]);\n }\n break;\n\n case 'Escape':\n if (this.isDropDownShown()) {\n event.preventDefault();\n this.closeDropdownOverlay();\n }\n break;\n\n case 'Tab':\n if (this.isDropDownShown()) {\n this.closeDropdownOverlay();\n }\n break;\n }\n }\n\n protected onDropDownErrorClick(): void {\n this.refreshSearch();\n }\n\n protected onDropDownItemClick(entry: ICatalogEntry): void {\n if (this.displayControl) {\n this.displayControl.markAsDirty();\n this.displayControl.markAllAsTouched();\n this.displayControl.setValue(entry.display, { emitEvent: false });\n }\n\n if (this.formControl) {\n this.formControl.markAsDirty();\n this.formControl.markAsTouched();\n this.formControl.setValue(entry.value);\n }\n\n this.closeDropdownOverlay();\n }\n\n //#endregion\n\n //#region Public methods\n protected getOptionId(index: number): string {\n return `catalog-select-${this.instanceId}-option-${index}`;\n }\n\n /**\n * Re-reads the catalog from its endpoint.\n *\n * The entries are fetched once, when the field initializes, so a screen that changes the data\n * behind the catalog -- granting a role, moving an employee, anything that alters what the\n * endpoint would now answer -- otherwise keeps offering the list it read before the change.\n *\n * It re-reads rather than merely re-runs the last request, because the number of entries may\n * have crossed the threshold that decides whether the endpoint requires search criteria.\n */\n public refresh(): void {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n //#endregion\n\n //#region Private methods\n private applySearchCriteria(criteria: string | null): void {\n this.isLoading.set(true);\n this.resetMessages();\n\n this.searchSubject.next(criteria);\n }\n\n private checkAndAddDisplayControl(): void {\n let parent: FormGroup = this.formGroup.form;\n const controlNames: string[] = this.formDisplayControlName.split('.');\n\n controlNames.forEach((name, index) => {\n if (index < controlNames.length - 1) {\n parent = <FormGroup>parent.get(name);\n } else {\n if (!parent.get(name)) {\n parent.addControl(name, new FormControl(''));\n }\n\n // Marked whether this component created it or the screen declared it: what makes a control\n // a display control is being driven as one, not who wrote it down. A filters form reads the\n // mark to keep it out of what it submits.\n DisplayControls.markAsDisplayControl(parent.get(name));\n }\n });\n }\n\n private closeDropdownOverlay(): void {\n this.isDropDownShown.set(false);\n this.focusedIndex.set(-1);\n this.updateInputAriaActiveDescendant();\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n }\n\n private initializeEntriesDataSource(): void {\n if (this.hasSearchEndpoint || !this._entriesList || this._entriesList.length === 0) {\n return;\n }\n\n const observables: Observable<string>[] = [];\n\n this._entriesList.forEach((entry: any | { key: number; value: Observable<any> }) => {\n const value: number = entry[this.valueProperty()];\n const display: string | Observable<any> = entry[this.displayProperty()];\n\n if (display instanceof Observable) {\n this.entriesDataSource.push({ value: value, display: 'Loading...' });\n\n observables.push(\n display.pipe(\n take(1),\n tap((v) => {\n this.entriesDataSource.filter((x) => x.value === value)[0].display = v;\n if (this.selectedValue() === value) {\n this.displayControl.setValue(v);\n }\n }),\n ),\n );\n } else {\n this.entriesDataSource.push({ value, display });\n }\n });\n\n // Subscribed only to run the requests; the emitted values are not needed here.\n forkJoin(observables).pipe(take(1)).subscribe();\n }\n\n private initializeSearch(): void {\n this.searchSubject\n .pipe(\n takeUntil(this.destroy$),\n switchMap((criteria: string | null) => {\n this.lastCriteriaUsed = criteria;\n\n if (!this.hasSearchEndpoint) {\n if (this.entriesDataSource.length === 0) {\n return of(null).pipe(take(1));\n }\n return of(\n this.entriesDataSource.filter(\n (entry: ICatalogEntry) => entry.display.toLowerCase().indexOf(criteria?.toLowerCase() ?? '') > -1,\n ),\n ).pipe(take(1));\n }\n\n this.updateMinimumCharactersMessageVisibility(criteria ?? '');\n if (this.showMinimumCharactersMessage()) {\n return of(null).pipe(take(1));\n }\n\n return this.catalogService\n .search(this.searchEndpoint!, this.maxEntries(), criteria ?? '', this.filters)\n .pipe(take(1));\n }),\n )\n .subscribe({\n next: (result: ICatalogResult | any[] | null | undefined) => {\n this.isLoading.set(false);\n this.displayedEntries.set([]);\n\n if (Array.isArray(result) && result.length > 0) {\n this.displayedEntries.set(result);\n } else if (result?.entries && Array.isArray(result.entries)) {\n const catalogResult: ICatalogResult = result as ICatalogResult;\n if (!catalogResult) {\n return;\n }\n\n this.displayedEntries.set(catalogResult.entries);\n\n if (!this.isDataInitialized) {\n // The shouldUseCriteria is only set from the initialization.\n this.isDataInitialized = true;\n this.shouldUseCriteria.set(catalogResult.shouldUseCriteria ?? false);\n this.showMinimumCharactersMessage.set(this.searchable() && this.displayedEntries().length === 0);\n }\n }\n\n // Try to filter out already loaded rows from the data grid dataset.\n if (this.displayedEntries().length > 0 && this.dataGridDataset) {\n this.displayedEntries.set(this.tryFilterFromDataset(this.displayedEntries()));\n }\n\n if (!this.showMinimumCharactersMessage() && this.displayedEntries().length === 0) {\n this.showNoResultsMessage.set(true);\n }\n },\n error: (_: any) => {\n this.isLoading.set(false);\n this.displayedEntries.set([]);\n this.showFailureMessage.set(true);\n\n // Set a new subscription to allow retrying the search later.\n this.initializeSearch();\n },\n });\n\n if (!this.isSubscriptionInitialized) {\n this.isSubscriptionInitialized = true;\n this.applySearchCriteria(null);\n }\n }\n\n private openDropdownOverlay(): void {\n // Defensive cleanup of any stale overlay before creating a new one.\n if (this.overlayRef) {\n this.overlayRef.detach();\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n }\n\n const positionStrategy: FlexibleConnectedPositionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.inputElement()!)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n },\n ]);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: false,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n\n // Set overlay width to match input field\n const inputRect: DOMRect = this.inputElement()!.nativeElement.getBoundingClientRect();\n this.overlayRef.updateSize({ width: inputRect.width });\n\n const portal: TemplatePortal = new TemplatePortal(this.dropdownTemplate()!, this.viewContainerRef);\n this.overlayRef.attach(portal);\n this.isDropDownShown.set(true);\n this.focusedIndex.set(\n this.selectedValue() != null\n ? this.displayedEntries().findIndex((entry: ICatalogEntry) => entry.value === this.selectedValue())\n : -1,\n );\n this.updateInputAriaActiveDescendant();\n\n // Re-evaluate minimum characters message visibility when opening the dropdown,\n // in case it was incorrectly reset by a programmatic value change.\n if (this.shouldUseCriteria() && !this.isLoading()) {\n this.updateMinimumCharactersMessageVisibility(this.displayControl?.value ?? '');\n }\n\n // Scroll the selected item into view after the overlay renders.\n if (this.focusedIndex() >= 0) {\n requestAnimationFrame(() => this.scrollFocusedItemIntoView());\n }\n }\n\n private refreshSearch(reInitialize = false): void {\n if (reInitialize) {\n // Both are written together when a catalog first answers, so both have to go together.\n // Leaving shouldUseCriteria behind let the previous catalog gate the new one: the\n // minimum-length check short-circuited the very request that would have corrected it.\n this.isDataInitialized = false;\n this.shouldUseCriteria.set(false);\n }\n\n this.applySearchCriteria(this.lastCriteriaUsed);\n }\n\n private resetMessages(): void {\n this.showFailureMessage.set(false);\n this.showNoResultsMessage.set(false);\n this.showMinimumCharactersMessage.set(false);\n }\n\n private resolveDisplay(value: any): string {\n return this.entriesDataSource.filter((entry: ICatalogEntry) => entry.value === value)[0]?.display ?? '';\n }\n\n private syncDisplayFromCurrentValue(): void {\n const currentValue: any = this.formControl?.value;\n if (currentValue == null || !this.shouldRefreshDisplay(currentValue)) {\n return;\n }\n\n this.selectedValue.set(currentValue);\n if (!this.hasSearchEndpoint) {\n this.displayControl?.setValue(this.resolveDisplay(currentValue), { emitEvent: false });\n }\n }\n\n /**\n * Decides whether the display control has to be written again.\n *\n * The value on its own is not enough. Resetting a form clears the display control and then\n * patches the same value back, so an unchanged value can still leave the display empty. That\n * only happens when the stored value equals the control's initial value, which is why it used\n * to show up on the default entry alone.\n */\n private shouldRefreshDisplay(value: any): boolean {\n if (this.selectedValue() !== value) {\n return true;\n }\n\n if (this.hasSearchEndpoint) {\n return false;\n }\n\n const display: string = this.resolveDisplay(value);\n return display.length > 0 && this.displayControl?.value !== display;\n }\n\n private syncFormControlsEnabledDisabled(): void {\n if (this.formControl.enabled !== this.displayControl.enabled) {\n if (this.formControl.disabled) {\n this.displayControl.disable({ emitEvent: false });\n } else {\n this.displayControl.enable({ emitEvent: false });\n }\n }\n }\n\n private tryFilterFromDataset(results: ICatalogEntry[]): ICatalogEntry[] {\n if (\n this.dataGridDataset &&\n this.controlName() === this.dataGridDataset?.keyProperty &&\n this.dataGridDataset.hasLoadedRows\n ) {\n // If the control name is matching the ID property of the data grid dataset, filter out the loaded rows to remove duplicated IDs.\n const loadedIDs: any[] = this.dataGridDataset.loadedKeys!.map((key: string) =>\n this.dataGridDataset.getRowID(key),\n );\n return results.filter((result: ICatalogEntry) => loadedIDs.indexOf(result.value) < 0);\n }\n return results;\n }\n\n private updateFilters(): void {\n if (!this.filterDiffer || !this.filters) {\n return;\n }\n\n const changes: KeyValueChanges<string, any> | null = this.filterDiffer.diff(this.filters);\n if (changes) {\n const reInitialize = true;\n this.refreshSearch(reInitialize);\n }\n }\n\n private updateMinimumCharactersMessageVisibility(criteria: string): void {\n this.showMinimumCharactersMessage.set(\n this.searchable() &&\n this.shouldUseCriteria() &&\n this.minimumLengthSearch() > 0 &&\n (criteria?.length ?? 0) < this.minimumLengthSearch(),\n );\n }\n\n private getNativeInput(): HTMLInputElement | null {\n return this.inputElement()?.nativeElement?.querySelector('input') ?? null;\n }\n\n private scrollFocusedItemIntoView(): void {\n if (!this.overlayRef || this.focusedIndex() < 0) {\n return;\n }\n const optionId: string = this.getOptionId(this.focusedIndex());\n const element: HTMLElement | null = this.overlayRef.overlayElement.querySelector('#' + optionId);\n if (element) {\n element.scrollIntoView({ block: 'nearest' });\n }\n }\n\n private setInputAriaAttributes(): void {\n const input: HTMLInputElement | null = this.getNativeInput();\n if (!input) {\n return;\n }\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-expanded', String(this.isDropDownShown()));\n input.setAttribute('aria-haspopup', 'listbox');\n input.setAttribute('aria-owns', this.listboxId);\n }\n\n private updateInputAriaActiveDescendant(): void {\n const input: HTMLInputElement | null = this.getNativeInput();\n if (!input) {\n return;\n }\n input.setAttribute('aria-expanded', String(this.isDropDownShown()));\n const descendantId: string | null = this.activeDescendantId;\n if (descendantId) {\n input.setAttribute('aria-activedescendant', descendantId);\n } else {\n input.removeAttribute('aria-activedescendant');\n }\n }\n //#endregion\n}\n","<lib-form-input-group\n [controlName]=\"controlName()\"\n [label]=\"label()\"\n [notes]=\"notes()\"\n [template]=\"template\"\n [validations]=\"validations()\"\n>\n</lib-form-input-group>\n\n<ng-template #template>\n <div class=\"catalog-container\" [class.show]=\"isDropDownShown()\">\n <lib-form-input\n #input\n [class.fixed-content]=\"readOnly() && !shouldUseCriteria()\"\n [autofocus]=\"autofocus()\"\n [controlName]=\"displayControlName()\"\n [displayReadOnlyAsDisabled]=\"readOnly()\"\n [invalid]=\"isInvalid && isTouched\"\n [readOnly]=\"readOnly() || !searchable()\"\n (blurred)=\"onContainerBlur()\"\n (click)=\"onContainerClick()\"\n (focused)=\"onContainerFocus()\"\n (keydown)=\"onKeyDown($event)\"\n >\n </lib-form-input>\n @if (showClearButton) {\n <button class=\"clear-button\" type=\"button\" tabindex=\"-1\" (click)=\"onClearClick($event)\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <div class=\"dropdown-container\">\n <ul class=\"dropdown\" role=\"listbox\" [attr.id]=\"listboxId\">\n <!-- Status rows are not options: role=\"presentation\" keeps them out of the\n listbox's option set, and they carry no click handler. The dropdown already\n closes on Escape, on blur and on an outside click. -->\n @if (isLoading()) {\n <li role=\"presentation\" aria-live=\"polite\">\n {{ 'CatalogSelect-Loading' | translate }}\n </li>\n }\n @if (shouldUseCriteria() && showMinimumCharactersMessage()) {\n <li\n role=\"presentation\"\n aria-live=\"polite\"\n title=\"{{ 'CatalogSelect-MinimumLengthSearch' | translate: { minimumLengthSearch: minimumLengthSearch() } }}\"\n >\n {{ 'CatalogSelect-MinimumLengthSearch' | translate: { minimumLengthSearch: minimumLengthSearch() } }}\n </li>\n }\n @if (showNoResultsMessage()) {\n <li role=\"presentation\" aria-live=\"polite\" title=\"{{ 'CatalogSelect-NoResultsFound' | translate }}\">\n {{ 'CatalogSelect-NoResultsFound' | translate }}\n </li>\n }\n\n <!-- Retrying is a real action, so it is a real button and reachable by keyboard. -->\n @if (showFailureMessage()) {\n <li class=\"error\" role=\"presentation\">\n <button\n class=\"retry\"\n type=\"button\"\n title=\"{{ 'CatalogSelect-FailureMessage' | translate }}\"\n (click)=\"onDropDownErrorClick()\"\n >\n {{ 'CatalogSelect-FailureMessage' | translate }}\n </button>\n </li>\n }\n\n <!-- eslint-disable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus --\n Options in a combobox listbox are deliberately not focusable. Keyboard\n interaction lives on the input, which owns ArrowUp/ArrowDown/Enter/Escape and\n points at the active option through aria-activedescendant. Giving each option\n its own tabindex and key handlers would break that pattern. -->\n @for (entry of displayedEntries(); track entry; let i = $index) {\n <li\n class=\"dropdown-item\"\n role=\"option\"\n [attr.id]=\"getOptionId(i)\"\n [attr.aria-selected]=\"selectedValue() === entry.value\"\n [class.focused]=\"focusedIndex() === i\"\n [class.selected]=\"selectedValue() === entry.value\"\n (click)=\"onDropDownItemClick(entry)\"\n >\n {{ entry.display }}\n </li>\n }\n <!-- eslint-enable @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n </ul>\n </div>\n</ng-template>\n","import { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n input,\n Input,\n InputSignal,\n OnInit,\n Output,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { NgxResizeObserverModule } from 'ngx-resize-observer';\nimport { takeUntil } from 'rxjs';\nimport {\n formatGridCellValue,\n getGridColumnAlign,\n GridCellDisplay,\n isNumericGridColumn,\n} from '../../helpers/grid-cell-format';\nimport { GridColumnAlign, IGridColumn } from '../../models';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { LocaleService } from '../../services/locale.service';\nimport { BadgeComponent } from '../badge/badge.component';\nimport { BaseComponent } from '../base.component';\n\n/**\n * One row of `lib-data-grid`. Renders a cell per dataset column, using the column's template when\n * it has one, plus a selection checkbox when the grid allows multiple selection.\n */\n@Component({\n selector: 'lib-data-grid-row',\n templateUrl: './data-grid-row.component.html',\n host: {\n '[class.focused]': 'dataGridDataset.focusedRowKey === rowData',\n '[class.selected]': 'dataGridDataset.isKeySelected(rowKey)',\n '[class.striped]': 'rowIndex() % 2 === 1',\n },\n styleUrls: ['./data-grid-row.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [BadgeComponent, FormsModule, NgClass, NgTemplateOutlet, NgxResizeObserverModule, TranslatePipe],\n})\nexport class DataGridRowComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Disables the row, so clicking it neither focuses nor selects it. Defaults to `false`. */\n @Input() public disabled = false;\n /** Marks the first rendered row, which measures the column widths for the header. Defaults to `false`. */\n @Input() public isFirstRow = false;\n /** The record this row shows. Setting it refreshes the row's selected state. */\n @Input() public set rowData(value: any) {\n this._rowData = value;\n this.refreshSelection();\n }\n\n /**\n * The row's index in the data, which is what the zebra stripe follows. Its position among the\n * rendered rows would not do: the virtual scroll renders a moving window, and a stripe keyed on\n * the DOM swapped on every row whenever that window moved by an odd number of rows.\n */\n public readonly rowIndex: InputSignal<number> = input(0);\n\n /** Emits the width in pixels of the selection checkbox cell whenever it changes. */\n @Output() public selectionResized: EventEmitter<number> = new EventEmitter<number>();\n //#endregion\n\n //#region Host listeners\n /**\n * Makes this row the dataset's focused row. In a multi-select grid that selects on click, it\n * also syncs the checkbox. Runs on a click on the row; does nothing while disabled.\n */\n @HostListener('click')\n public setFocus(): void {\n if (!this.disabled) {\n this.dataGridDataset.setFocusedRow(this.rowKey);\n\n if (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true)) {\n this.selected.set(this.isRowDataSelected);\n }\n }\n }\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n\n // A signal rather than a field: the grid announces a selection change from a subscription,\n // and the checkbox below is bound to this. It used to be a plain field refreshed by calling\n // detectChanges() on this component -- which renders, but renders because it was forced\n // rather than because anything was notified. See docs/guides/reactivity.md.\n protected readonly selected: WritableSignal<boolean> = signal(false);\n\n private _rowData!: any;\n private elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly localeService: LocaleService = inject(LocaleService);\n //#endregion\n\n //#region Properties\n /** The record this row shows. */\n public get rowData(): any {\n return this._rowData;\n }\n\n protected get columns(): IGridColumn[] {\n return this.dataGridDataset.columns;\n }\n\n private get isLaidOut(): boolean {\n return (this.elementRef.nativeElement?.getBoundingClientRect().width ?? 0) > 0;\n }\n\n private get isRowDataSelected(): boolean {\n return this.dataGridDataset.isKeySelected(this.rowKey);\n }\n\n protected get rowKey(): string {\n return this.dataGridDataset.getRowInternalKey(this.rowData);\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.selected.set(this.isRowDataSelected);\n\n this.dataGridDataset.selectedRowsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe((selectionChanges: { [id: string]: { rowData: any; selected: boolean } }) => {\n if (this.rowKey in selectionChanges) {\n this.selected.set(selectionChanges[this.rowKey].selected);\n }\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onResize(colIndex: number, event: ResizeObserverEntry): void {\n const width: number = event.contentRect.width;\n\n // A zero means one of two very different things. Before the grid is laid out every column\n // reports zero, and taking that at face value would pin every heading at zero. Once the row\n // itself has a width the layout is live, and a zero is then the real thing: a 1fr column\n // collapsed for want of room, whose heading has to collapse with it or every column to its\n // right sits under the wrong one. Asking the row -- rather than remembering whether this\n // column once measured something -- also covers a column that is born collapsed and never\n // measures anything else.\n if (width <= 0 && !this.isLaidOut) {\n return;\n }\n\n // Reported on every change, not just the first. The body lays the columns out as a CSS grid of\n // minmax(x, min-content), so a column is only as wide as the content currently rendered --\n // which virtual scrolling keeps changing. Measuring once and latching left the header copying\n // a width the body no longer had, and with many columns that drift accumulated into cells\n // sitting under the wrong heading.\n if (this.columns[colIndex].realSize !== width) {\n this.columns[colIndex].realSize = width;\n }\n }\n\n protected onResizeSelection(event: ResizeObserverEntry): void {\n const width: number = event.contentRect.width;\n this.selectionResized.emit(width);\n }\n\n protected onToggleSelection(): void {\n if (\n this.disabled ||\n (this.dataGridDataset.configs.multiSelect && (this.dataGridDataset.configs.selectOnClick ?? true))\n ) {\n return;\n }\n\n this.selected.update((isSelected: boolean) => !isSelected);\n\n if (this.selected()) {\n this.dataGridDataset.selectRow(this.rowKey);\n } else {\n this.dataGridDataset.deselectRow(this.rowKey);\n }\n }\n //#endregion\n\n //#region Public methods\n protected alignOf(column: IGridColumn): GridColumnAlign {\n return getGridColumnAlign(column);\n }\n\n /**\n * The cell of a column without a template, formatted by the column's type. Reads the locale\n * signal, so the row renders again when the application language changes.\n */\n protected formatCell(column: IGridColumn): GridCellDisplay {\n const configs = this.dataGridDataset.configs;\n return formatGridCellValue(this.getValue(column.field), column, this.localeService.locale(), {\n trueText: configs.booleanTrueText ?? 'Yes',\n falseText: configs.booleanFalseText ?? 'No',\n });\n }\n\n protected isNumeric(column: IGridColumn): boolean {\n return isNumericGridColumn(column);\n }\n\n protected getValue(field: string): any {\n // A null step in a dot path, such as `customer.name` with no customer, shows an empty cell\n // rather than throwing and breaking the row.\n return field.split('.').reduce((value: any, field: string) => value?.[field], this.rowData);\n }\n //#endregion\n\n //#region Private methods\n private refreshSelection(): void {\n this.selected.set(this.isRowDataSelected);\n }\n //#endregion\n}\n","<!-- A <label> rather than a clickable <div>: clicking anywhere in the cell still\nreaches the checkbox, natively. The click handler is a mouse-only convenience;\nthe keyboard path is the nested checkbox, which is focusable and toggles with\nSpace on its own. -->\n@if (dataGridDataset.configs.multiSelect) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <label class=\"cell selection\" (click)=\"onToggleSelection()\" (onResize)=\"onResizeSelection($event)\">\n <!-- Null, not false: an attribute binding writes disabled=\"false\" for false, and any value at\n all disables a control, so every checkbox rendered disabled and faded. -->\n <input class=\"form-input\" type=\"checkbox\" [attr.disabled]=\"disabled ? true : null\" [(ngModel)]=\"selected\" />\n </label>\n}\n@for (column of columns; track column; let i = $index) {\n <div\n #cell\n class=\"cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [class.disabled]=\"disabled\"\n [class.numeric]=\"isNumeric(column)\"\n [ngClass]=\"column.customClass\"\n >\n @if (isFirstRow) {\n <div class=\"spacer\" (onResize)=\"onResize(i, $event)\"></div>\n }\n <ng-container\n *ngTemplateOutlet=\"\n column.template ? column.template : simpleTemplate;\n context: { rowData: rowData, column: column }\n \"\n >\n </ng-container>\n </div>\n}\n\n<!-- A column without a template. The column's type decides the formatting; with no type the\nvalue shows as it is. The translate pipe sits only in the branches that hold a translation key, so a\nplain cell renders as it always did. -->\n<ng-template #simpleTemplate let-column=\"column\">\n @let cell = formatCell(column);\n @switch (cell.kind) {\n @case ('boolean') {\n @if (cell.checked) {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n }\n @if (cell.translate) {\n <span class=\"visually-hidden\">{{ cell.text | translate }}</span>\n }\n }\n @case ('badge') {\n <lib-badge [intent]=\"cell.intent ?? 'neutral'\">\n @if (cell.translate) {\n {{ cell.text | translate }}\n } @else {\n {{ cell.text }}\n }\n </lib-badge>\n }\n @default {\n @if (cell.translate) {\n <span>{{ cell.text | translate }}</span>\n } @else {\n <span>{{ cell.text }}</span>\n }\n }\n }\n</ng-template>\n","import { ListRange } from '@angular/cdk/collections';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { NgStyle } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n inject,\n input,\n InputSignal,\n NgZone,\n OnDestroy,\n OnInit,\n Signal,\n signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { NavigationEnd, NavigationStart, Router } from '@angular/router';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { debounceTime, filter, fromEvent, Subject, takeUntil } from 'rxjs';\nimport { getGridColumnAlign } from '../../helpers/grid-cell-format';\nimport { formatLocaleNumber } from '../../helpers/locale-format';\nimport { GridColumnAlign, IGridColumn } from '../../models';\nimport { DataGridConfigs } from '../../models/configs';\nimport { DataGridDataset } from '../../services';\nimport { LocaleService } from '../../services/locale.service';\nimport { BaseComponent } from '../base.component';\nimport { DataGridRowComponent } from '../data-grid-row/data-grid-row.component';\n\n/** The footer text when the configs give none. */\nconst DEFAULT_TOTAL_ROWS_TEXT = '{{ count }} records';\nconst DEFAULT_TOTAL_ROW_TEXT = '{{ count }} record';\n\n/**\n * A virtual-scrolling grid driven by the `DataGridDataset` provided around it. The dataset holds\n * the columns, rows, paging and selection; the grid renders them, loads the next page as the user\n * scrolls, and shows loading, empty and error messages.\n */\n@Component({\n selector: 'lib-data-grid',\n templateUrl: './data-grid.component.html',\n styleUrls: ['./data-grid.component.scss'],\n host: {\n '[class.no-borders]': 'showButtons()',\n '[class.hide-borders]': 'configs.hideBorders === true',\n },\n imports: [DataGridRowComponent, NgStyle, ScrollingModule, TranslatePipe],\n})\nexport class DataGridComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n private readonly bodyElement: Signal<ElementRef<HTMLDivElement> | undefined> =\n viewChild<ElementRef<HTMLDivElement>>('body');\n private readonly viewport: Signal<CdkVirtualScrollViewport | undefined> = viewChild(CdkVirtualScrollViewport);\n\n /** Disables the rows, so they cannot be focused or selected. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n /**\n * When `true`, the grid does not load rows on init and shows a prompt until something else\n * loads the dataset, such as a search. Defaults to `false`.\n */\n public readonly lazyLoadRows: InputSignal<boolean> = input(false);\n /**\n * Shows a bar above the header for content projected with the `buttons` attribute, and drops\n * the grid's borders. Defaults to `false`.\n */\n public readonly showButtons: InputSignal<boolean> = input(false);\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly headerRightMargin: WritableSignal<number> = signal(0);\n protected readonly headerScrollLeft: WritableSignal<number> = signal(0);\n protected readonly loading: WritableSignal<boolean> = signal(false);\n\n private bodyResized$: Subject<void> = new Subject<void>();\n private bodyResizeObserver?: ResizeObserver;\n private gridRoute = '';\n private isGridCurrentUrl = false;\n private lastPosition = 0;\n private readonly localeService: LocaleService = inject(LocaleService);\n private ngZone: NgZone = inject(NgZone);\n private router: Router = inject(Router);\n private selectionColRealSize?: number;\n //#endregion\n\n //#region Properties\n protected get bodyMinHeight(): number {\n let rowsToDisplay: number = this.configs.rowsToDisplay ?? 3;\n\n let rowsCount: number = this.dataGridDataset.loadedRows?.length ?? 0;\n if (rowsCount === 0) {\n rowsCount = 1;\n }\n\n if (rowsCount < rowsToDisplay) {\n rowsToDisplay = rowsCount;\n }\n\n return rowsToDisplay * this.configs.rowHeight;\n }\n\n protected get columns(): IGridColumn[] {\n return this.dataGridDataset.columns;\n }\n\n protected get configs(): DataGridConfigs {\n return this.dataGridDataset.configs;\n }\n\n protected get gridColumns(): string {\n return this.dataGridDataset.columnsSize;\n }\n\n protected get hasBeenLoaded(): boolean {\n return this.dataGridDataset.hasBeenLoaded;\n }\n\n protected get hasLoadedRows(): boolean {\n return (this.dataGridDataset.loadedRows?.length ?? 0) > 0;\n }\n\n protected get hasMessageToDisplayWhenEmpty(): boolean {\n return this.messageToDisplayWhenEmpty.length > 0;\n }\n\n protected get isHideColumns(): boolean {\n return this.dataGridDataset.configs.hideColumnHeaders ?? false;\n }\n\n protected get isShowMultiSelect(): boolean {\n return this.dataGridDataset.configs.multiSelect ?? false;\n }\n\n protected get messageToDisplayWhenEmpty(): string {\n return this.dataGridDataset?.configs?.messageOnEmpty ?? '';\n }\n\n protected get messageToDisplayWhenLazyLoad(): string {\n return this.dataGridDataset?.configs?.messageOnLazyLoad ?? '';\n }\n\n protected get messageToDisplayWhenFailed(): string {\n return this.dataGridDataset?.configs?.messageOnFailed ?? '';\n }\n\n protected get selectionColWidth(): string {\n return this.selectionColRealSize\n ? `${this.selectionColRealSize}px`\n : (this.configs.multiSelectSize ?? 'min-content');\n }\n\n /**\n * Whether the total-rows footer shows: the configs ask for it and the last load returned\n * `{ items, totalRows }`. The dataset's `totalRows` is tracked, so the footer follows each load.\n */\n protected get shouldShowTotalRows(): boolean {\n const totalRows: number | undefined = this.dataGridDataset.totalRows;\n return (this.configs.showTotalRows ?? false) && typeof totalRows === 'number';\n }\n\n /** The total number of records, in the application's language. Reads the locale signal. */\n protected get formattedTotalRows(): string {\n return formatLocaleNumber(this.dataGridDataset.totalRows ?? 0, this.localeService.locale(), {\n maxFractionDigits: 0,\n });\n }\n\n /** The footer text, singular for a total of exactly 1. */\n protected get totalRowsText(): string {\n if (this.dataGridDataset.totalRows === 1) {\n return this.configs.totalRowText ?? DEFAULT_TOTAL_ROW_TEXT;\n }\n return this.configs.totalRowsText ?? DEFAULT_TOTAL_ROWS_TEXT;\n }\n\n protected get shouldDisplayMessageWhenEmpty(): boolean {\n return this.dataGridDataset?.configs?.showMessageOnEmpty ?? true;\n }\n\n /**\n * Whether the grid is in the document, which it is not while the route-reuse strategy holds its\n * view detached -- the list a tab keeps in its history while the user is on a record.\n *\n * Nothing may measure the CDK viewport then. The body leaving the document is itself a resize,\n * to nothing, and measuring makes the viewport work out its rendered range from a scroll offset\n * of 0 and write that out while detached, which leaves its own change-detection flag stuck until\n * the view renders again. Reattached and scrolled back, the viewport then computes the right\n * range but cannot write the content offset out: the rows are rendered, translated to the top,\n * and the viewport shows the place the user had scrolled to -- an empty list. Coming back is a\n * resize as well, from nothing to the panel, so the measurement still happens, on the way in.\n */\n private get isBodyAttached(): boolean {\n return this.bodyElement()?.nativeElement?.isConnected ?? false;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.gridRoute = this.router.url;\n this.isGridCurrentUrl = true;\n\n this.router.events\n .pipe(\n takeUntil(this.destroy$),\n filter((events: any) => events instanceof NavigationStart || events instanceof NavigationEnd),\n )\n .subscribe((event: NavigationStart | NavigationEnd) => {\n if (event instanceof NavigationStart && this.isGridCurrentUrl) {\n this.lastPosition = this.viewport()?.measureScrollOffset() ?? 0;\n this.isGridCurrentUrl = false;\n } else if (event instanceof NavigationEnd && event.url === this.gridRoute) {\n this.viewport()?.scrollTo({ top: this.lastPosition });\n this.viewport()?.checkViewportSize();\n this.isGridCurrentUrl = true;\n }\n });\n\n this.dataGridDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.loading.set(true);\n });\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe((isSuccess: boolean) => {\n this.loading.set(false);\n this.hasFailed.set(!isSuccess);\n\n setTimeout(() => {\n const viewportWidth: number = this.viewport()?.measureViewportSize('horizontal') ?? 0;\n if (viewportWidth > 0) {\n this.headerRightMargin.set(this.bodyElement()!.nativeElement.clientWidth - viewportWidth);\n }\n }, 100);\n\n // A load can finish after the user has left the list -- a record opened while the next page\n // was still coming in -- and a detached grid must not be measured. See isBodyAttached.\n setTimeout(() => {\n if (this.isBodyAttached) {\n this.viewport()?.checkViewportSize();\n }\n });\n });\n\n if (!this.lazyLoadRows()) {\n if (!this.dataGridDataset.loadedRows) {\n this.loading.set(true);\n }\n this.dataGridDataset.loadRows();\n } else if (this.dataGridDataset.isLoading) {\n this.loading.set(true);\n }\n }\n\n public ngAfterViewInit(): void {\n // The rows scroll sideways inside the CDK viewport while the header sits outside it, so the\n // header has to be moved by hand or the headings stay behind as the cells travel. Read outside\n // Angular and written back inside it, because this fires for every frame of a scroll.\n const viewportElement: HTMLElement | undefined = this.viewport()?.elementRef?.nativeElement;\n\n if (viewportElement) {\n this.ngZone.runOutsideAngular(() => {\n fromEvent(viewportElement, 'scroll')\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n const scrollLeft: number = viewportElement.scrollLeft;\n if (this.headerScrollLeft() === scrollLeft) {\n return;\n }\n\n this.headerScrollLeft.set(scrollLeft);\n });\n });\n }\n\n this.viewport()\n ?.renderedRangeStream.pipe(takeUntil(this.destroy$))\n .subscribe((listRange: ListRange) => {\n const loadedRows: number = this.dataGridDataset.loadedRows?.length ?? 0;\n if (\n this.hasLoadedRows &&\n !this.loading() &&\n listRange.end >= loadedRows &&\n !this.dataGridDataset.loadedLastRow\n ) {\n this.loading.set(true);\n this.dataGridDataset.loadRows();\n }\n });\n\n this.bodyResized$.pipe(debounceTime(150), takeUntil(this.destroy$)).subscribe(() => {\n // Leaving the document is a resize too. A detached grid has nothing to measure, and measuring\n // it is what left the list empty when it came back; see isBodyAttached.\n if (!this.isBodyAttached) {\n return;\n }\n\n const viewportWidth: number = this.viewport()?.measureViewportSize('horizontal') ?? 0;\n if (viewportWidth > 0) {\n this.headerRightMargin.set(this.bodyElement()!.nativeElement.clientWidth - viewportWidth);\n }\n this.viewport()?.checkViewportSize();\n this.syncHeaderScroll();\n });\n\n this.ngZone.runOutsideAngular(() => {\n this.bodyResizeObserver = new ResizeObserver(() => {\n this.bodyResized$.next();\n });\n this.bodyResizeObserver.observe(this.bodyElement()!.nativeElement);\n });\n }\n\n public override ngOnDestroy(): void {\n this.bodyResizeObserver?.disconnect();\n super.ngOnDestroy();\n }\n //#endregion\n\n //#region Event handlers\n protected onSelectionResized(newSize: number): void {\n if (this.selectionColRealSize != newSize) {\n this.selectionColRealSize = newSize;\n }\n }\n //#endregion\n\n //#region Public methods\n protected alignOf(column: IGridColumn): GridColumnAlign {\n return getGridColumnAlign(column);\n }\n\n /**\n * Puts the count into the footer text. The translate pipe fills `{{ count }}` for a known\n * key, but returns plain text such as the library default untouched, placeholder and all.\n */\n protected fillCount(text: string): string {\n return text.replace(/\\{\\{\\s*count\\s*\\}\\}/g, this.formattedTotalRows);\n }\n\n protected isFirstVisibleRow(rowIndex: number): boolean {\n const renderedRange: ListRange | undefined = this.viewport()?.getRenderedRange();\n if (renderedRange) {\n return rowIndex === renderedRange.start;\n }\n return false;\n }\n //#endregion\n\n //#region Private methods\n private syncHeaderScroll(): void {\n // Re-inserting the viewport into the DOM -- which is what re-activating a detached tab does --\n // puts its scroll position back to zero without firing a scroll event, so nothing tells the\n // header to come back with it and the headings sit at an offset the body no longer has.\n const scrollLeft: number = this.viewport()?.elementRef?.nativeElement?.scrollLeft ?? 0;\n\n if (this.headerScrollLeft() !== scrollLeft) {\n this.headerScrollLeft.set(scrollLeft);\n }\n }\n\n protected trackByFn(index: number, item: any): number {\n return item.key;\n }\n //#endregion\n}\n","@if (showButtons()) {\n <div class=\"buttons\">\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n}\n\n<div class=\"header\" [class.hide]=\"isHideColumns\" [style.padding-right.px]=\"headerRightMargin()\">\n <!-- Translated by however far the body is scrolled sideways. The rows scroll inside the CDK\n viewport and the header sits outside it, so without this the headings simply stay put\n while the cells move away from them. -->\n <div class=\"header-row\" [style.transform]=\"headerScrollLeft() ? 'translateX(-' + headerScrollLeft() + 'px)' : null\">\n @if (isShowMultiSelect) {\n <div\n class=\"header-cell selection\"\n [ngStyle]=\"{\n width: selectionColWidth ? selectionColWidth : null,\n }\"\n >\n &nbsp;\n </div>\n }\n\n <!-- A measured zero is a width, not the absence of one: it is a 1fr column that collapsed,\n and its heading has to collapse too.\n\n Such a heading is removed rather than merely made zero wide, because a flex item still\n takes a gap on each side while the body grid allows the collapsed track only one, and\n that spare gap pushed every heading to its right out by 16px. -->\n @for (column of columns; track column) {\n <div\n class=\"header-cell\"\n [class.align-center]=\"alignOf(column) === 'center'\"\n [class.align-end]=\"alignOf(column) === 'end'\"\n [ngStyle]=\"{\n display: column.realSize === 0 ? 'none' : null,\n 'width.px': column.realSize ?? null,\n }\"\n >\n <span>{{ column.headerName | translate }}</span>\n </div>\n }\n </div>\n</div>\n\n<div #body class=\"body\" [style.min-height.px]=\"bodyMinHeight\">\n <cdk-virtual-scroll-viewport [itemSize]=\"configs.rowHeight\" [style.grid-template-columns]=\"gridColumns\">\n <lib-data-grid-row\n #row\n *cdkVirtualFor=\"let row of dataGridDataset.loadedRows; index as i; trackBy: trackByFn\"\n [disabled]=\"disabled()\"\n [isFirstRow]=\"isFirstVisibleRow(i)\"\n [rowData]=\"row\"\n [rowIndex]=\"i\"\n [style.height.px]=\"configs.rowHeight\"\n (selectionResized)=\"onSelectionResized($event)\"\n >\n </lib-data-grid-row>\n\n @if (loading()) {\n <div class=\"loading\" [style.height.px]=\"configs.rowHeight\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ dataGridDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n @if (!loading() && !hasBeenLoaded && !hasFailed() && lazyLoadRows()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenLazyLoad | translate }}\n </span>\n </div>\n }\n <!-- A failed load shows its message even when no load has succeeded yet: the first one failing\n used to leave the grid blank. -->\n @if (!loading() && (hasFailed() || (hasBeenLoaded && !hasLoadedRows))) {\n @if (!hasFailed() && !hasLoadedRows && hasMessageToDisplayWhenEmpty && shouldDisplayMessageWhenEmpty) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n {{ messageToDisplayWhenEmpty | translate }}\n </span>\n </div>\n }\n @if (hasFailed()) {\n <div class=\"message\" [style.height.px]=\"configs.rowHeight\">\n <span>\n <i class=\"fas fa-exclamation-triangle mr-2 text-yellow-600\"></i>{{ messageToDisplayWhenFailed | translate }}\n </span>\n </div>\n }\n }\n </cdk-virtual-scroll-viewport>\n</div>\n\n@if (shouldShowTotalRows) {\n <div class=\"footer\">\n {{ fillCount(totalRowsText | translate: { count: formattedTotalRows }) }}\n </div>\n}\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n/**\n * Groups related form fields under an optional heading. Project the fields as content.\n */\n@Component({\n selector: 'lib-form-group',\n templateUrl: './form-group.component.html',\n styleUrls: ['./form-group.component.scss'],\n imports: [TranslatePipe],\n host: {\n '[class.expand]': 'shouldExpand',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormGroupComponent {\n //#region ViewChilds, Inputs, Outputs\n /** Adds the `expand` class to the host so the group grows to fill the available space. Defaults to `false`. */\n @Input() public shouldExpand = false;\n /** Heading shown above the fields, as a translation key. No heading is shown when empty. */\n @Input() public label!: string;\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n protected get hasTitle(): boolean {\n return !!this.label;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","@if (hasTitle) {\n <h3 class=\"title\">\n {{ label | translate }}\n </h3>\n}\n\n<div class=\"content\" [class.has-title]=\"hasTitle\">\n <ng-content></ng-content>\n</div>\n","import { NgStyle } from '@angular/common';\nimport { Component, ElementRef, input, InputSignal, Signal, signal, viewChild, WritableSignal } from '@angular/core';\n\n/**\n * A titled section whose content the user can collapse and expand by clicking the title or\n * pressing Enter or Space on it. Starts expanded.\n */\n@Component({\n selector: 'lib-group-accordion',\n templateUrl: './group-accordion.component.html',\n styleUrls: ['./group-accordion.component.scss'],\n host: { '[class.collapsed]': 'collapsed()' },\n imports: [NgStyle],\n})\nexport class GroupAccordionComponent {\n //#region ViewChilds, Inputs, Outputs\n private readonly containerElementRef: Signal<ElementRef<HTMLDivElement> | undefined> =\n viewChild<ElementRef<HTMLDivElement>>('container');\n\n /** Title of the section, shown as given. Required. */\n public readonly label: InputSignal<string> = input.required<string>();\n //#endregion\n\n //#region Variables\n private readonly _maxHeight: WritableSignal<number> = signal(-1);\n protected readonly collapsed: WritableSignal<boolean> = signal(false);\n //#endregion\n\n //#region Properties\n /** Height in pixels pinned on the content during the collapse animation, or `-1` when none is set. */\n public readonly maxHeight: Signal<number> = this._maxHeight.asReadonly();\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n protected onToggle(): void {\n // Before collapsing, we set the max height style for the closing effect.\n if (!this.collapsed()) {\n this.setMaxHeight();\n }\n\n setTimeout(() => {\n this.collapsed.update((collapsed: boolean) => !collapsed);\n\n // After expanding, we wait the transition to end and remove the max height.\n if (!this.collapsed()) {\n this.clearMaxHeight();\n }\n });\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n private clearMaxHeight(): void {\n setTimeout(() => {\n this._maxHeight.set(-1);\n }, 150);\n }\n private setMaxHeight(): void {\n this._maxHeight.set(this.containerElementRef()?.nativeElement?.offsetHeight ?? 0);\n }\n //#endregion\n}\n","<div class=\"title\">\n <h6\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-expanded]=\"!collapsed()\"\n (click)=\"onToggle()\"\n (keydown.enter)=\"onToggle()\"\n (keydown.space)=\"onToggle(); $event.preventDefault()\"\n >\n <i class=\"fas fa-chevron-down fa-sm\"></i>{{ label() }}\n </h6>\n</div>\n\n<div\n #container\n class=\"content animate\"\n [ngStyle]=\"\n (maxHeight() >= 0 && {\n 'height.px': maxHeight(),\n 'max-height.px': maxHeight(),\n }) ||\n null\n \"\n>\n <div #maxHeighContainer>\n <ng-content></ng-content>\n </div>\n</div>\n","import { AfterViewInit, Directive, ElementRef, EventEmitter, HostListener, inject, Input, Output } from '@angular/core';\n\n/**\n * Tracks which section of a scrollable element is in view. Put it on the scrolling container;\n * it finds the descendant elements whose tag is listed in `spiedTags` and reports the index of\n * the current one as the user scrolls.\n */\n@Directive({\n selector: '[libScrollSpy]',\n})\nexport class ScrollSpyDirective implements AfterViewInit {\n //#region ViewChilds, Inputs, Outputs\n /**\n * Tag names (case-insensitive) of the elements that count as sections, for example\n * `['lib-group-accordion']`. Read once after the view initialises. Defaults to none.\n */\n @Input() public spiedTags: Array<string> = [];\n\n /** Emits the zero-based index of the section in view whenever it changes. */\n @Output() public activeSectionChange: EventEmitter<number> = new EventEmitter<number>();\n //#endregion\n\n //#region Variables\n private _el: ElementRef<HTMLElement> = inject(ElementRef);\n private activeSection: number | null = null;\n private sections: Array<Element> = new Array<Element>();\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngAfterViewInit(): void {\n this.updateSections(Array.from(this._el.nativeElement.children));\n }\n //#endregion\n\n //#region Event handlers\n /** Handles the host's `scroll` event and selects the section at the current scroll position. */\n @HostListener('scroll', ['$event'])\n public onScroll(event: any): void {\n const scrollTop: number = event.target.scrollTop;\n const scrollHeight: number = event.target.scrollHeight;\n const maxScroll: number = Math.round(event.target.scrollHeight - event.target.getBoundingClientRect().height);\n\n const currentScroll: number = Math.round((scrollTop * scrollHeight) / maxScroll);\n\n if (currentScroll >= scrollHeight) {\n this.select(this.sections.length - 1);\n return;\n }\n\n const elements: Element[] = this.sections.filter((el) => (el as HTMLElement).offsetTop <= currentScroll);\n\n this.select(elements.length > 0 ? elements.length - 1 : 0);\n }\n //#endregion\n\n //#region Public methods\n /** Scrolls the host so the section at the given zero-based index is at the top. */\n public scrollTo(section: number): void {\n this._el.nativeElement.scrollTop = (this.sections[section] as HTMLElement).offsetTop;\n }\n\n /**\n * Marks the section at the given zero-based index as active and emits `activeSectionChange`\n * when it differs from the current one. Does not scroll.\n */\n public select(section: number): void {\n if (section !== this.activeSection) {\n this.activeSection = section;\n this.activeSectionChange.emit(section);\n }\n }\n //#endregion\n\n //#region Private methods\n private updateSections(children: Element[]): void {\n children.forEach((el) => {\n if (this.spiedTags.some((spiedTag) => spiedTag.toUpperCase() === el.tagName.toUpperCase())) {\n this.sections.push(el);\n } else {\n this.updateSections(Array.from(el.children));\n }\n });\n }\n //#endregion\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ContentChildren, Input, QueryList, ViewChild } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { ScrollSpyDirective } from '../../directives/scroll-spy.directive';\nimport { GroupAccordionComponent } from '../group-accordion/group-accordion.component';\n\n/**\n * A panel with a title bar, an optional icon and projected content. While `title` is empty the\n * title bar shows a loading spinner instead.\n */\n@Component({\n selector: 'lib-group-container',\n templateUrl: './group-container.component.html',\n styleUrls: ['./group-container.component.scss'],\n imports: [NgClass, TranslatePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GroupContainerComponent {\n /** A scroll-spy directive in the view. The current template has none, so this stays unset. */\n @ViewChild(ScrollSpyDirective) scrollSpy!: ScrollSpyDirective;\n /** The `lib-group-accordion` sections projected into the panel, at any depth. */\n @ContentChildren(GroupAccordionComponent, { descendants: true }) sections!: QueryList<GroupAccordionComponent>;\n\n /** The labels of the projected sections, in document order. */\n public get titles(): string[] {\n return this.sections?.map((x) => x.label()) ?? [];\n }\n\n /** Zero-based index of the active section. Starts at `0`. */\n public activeSection = 0;\n\n /** Panel title, as a translation key. While empty, a loading spinner is shown in its place. */\n @Input() title?: string;\n\n /** Font Awesome icon class shown before the title, for example `fa-user`. Shown only with a title. */\n @Input() icon?: string;\n\n /** Sets the active section to the given zero-based index. */\n activeSectionChanged(index: number): void {\n this.activeSection = index;\n }\n\n /** Scrolls to the section at the given zero-based index. Needs `scrollSpy`, which the template does not provide. */\n scrollTo(section: number) {\n this.scrollSpy.scrollTo(section);\n }\n}\n","<div class=\"title\">\n @if (!!title && !!icon) {\n <i class=\"fas fa-fw\" [ngClass]=\"icon\"></i>\n }\n @if (!!title) {\n <h4>{{ title | translate }}</h4>\n }\n @if (!title) {\n <svg [ngClass]=\"''\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n }\n</div>\n\n<div class=\"content-container\">\n <ng-content></ng-content>\n</div>\n","import { Component, computed, contentChildren, Signal, signal, viewChild, WritableSignal } from '@angular/core';\nimport { ScrollSpyDirective } from '../../directives/scroll-spy.directive';\nimport { GroupAccordionComponent } from '../group-accordion/group-accordion.component';\n\n/**\n * A scrollable container with a strip of links, one per projected `lib-group-accordion`. The link\n * of the section in view is highlighted, and clicking a link scrolls to its section.\n */\n@Component({\n selector: 'lib-group-scroll-spy',\n templateUrl: './group-scroll-spy.component.html',\n styleUrls: ['./group-scroll-spy.component.scss'],\n imports: [ScrollSpyDirective],\n})\nexport class GroupScrollSpyComponent {\n /** The scroll-spy directive on the scrolling content area. */\n public readonly scrollSpy: Signal<ScrollSpyDirective | undefined> = viewChild(ScrollSpyDirective);\n /** The `lib-group-accordion` sections projected into the container, at any depth. */\n public readonly sections: Signal<readonly GroupAccordionComponent[]> = contentChildren(GroupAccordionComponent, {\n descendants: true,\n });\n\n // Reads each section's own label signal, so a section renaming itself refreshes the strip too.\n /** The section labels shown as links, in document order. */\n public readonly titles: Signal<string[]> = computed(() =>\n this.sections().map((section: GroupAccordionComponent) => section.label()),\n );\n\n /** Zero-based index of the section in view. Starts at `0`. */\n public readonly activeSection: WritableSignal<number> = signal(0);\n\n /** Sets the section in view to the given zero-based index. Called by the scroll spy. */\n public activeSectionChanged(index: number): void {\n this.activeSection.set(index);\n }\n\n /** Scrolls the content so the section at the given zero-based index is at the top. */\n public scrollTo(section: number): void {\n this.scrollSpy()?.scrollTo(section);\n }\n}\n","<div class=\"scroll-spy\">\n @for (title of titles(); track title; let i = $index) {\n <a\n class=\"item\"\n [class.active]=\"i === activeSection()\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-current]=\"i === activeSection()\"\n (click)=\"scrollTo(i)\"\n (keydown.enter)=\"scrollTo(i)\"\n (keydown.space)=\"scrollTo(i); $event.preventDefault()\"\n >{{ title }}</a\n >\n }\n</div>\n\n<div\n class=\"content\"\n libScrollSpy\n [class.no-scroll-spy]=\"titles().length === 0\"\n [spiedTags]=\"['lib-group-accordion']\"\n (activeSectionChange)=\"activeSectionChanged($event)\"\n>\n <ng-content></ng-content>\n</div>\n","import {\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n InputSignal,\n model,\n ModelSignal,\n OnInit,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { IModal, ModalSize } from '../../models';\nimport { BaseComponent } from '../base.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal dialog with a header, a body and a footer. Project content with the `body` and `footer`\n * attributes, and open or close it through `toggleModal()` from a template reference or a view\n * query. The dialog is moved to `<body>` so it always renders above the rest of the app.\n */\n@Component({\n selector: 'lib-modal',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n host: {\n title: '', // This is to ensure that the title input does not conflict with the native HTML title attribute.\n '[class.show]': 'isOpen()',\n },\n imports: [ButtonComponent],\n})\nexport class ModalComponent extends BaseComponent implements IModal, OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Text of the footer's close button, shown as given. Defaults to `Close`. */\n public readonly closeButtonText: ModelSignal<string> = model('Close');\n /**\n * When `true`, a click on the backdrop outside the dialog closes it. Escape and the close\n * buttons work either way. Defaults to `true`.\n */\n public readonly dialog: InputSignal<boolean> = input(true);\n /**\n * Marks the dialog as busy. While `true` the close button is disabled and Escape and backdrop\n * clicks are ignored. Defaults to `false`.\n */\n public readonly modalProcessing: ModelSignal<boolean> = model(false);\n /** Where the dialog sits on screen: `top`, `left`, `right`, `bottom` or `center`. Defaults to `center`. */\n public readonly position: InputSignal<'top' | 'left' | 'right' | 'bottom' | 'center'> = input<\n 'top' | 'left' | 'right' | 'bottom' | 'center'\n >('center');\n /** Width of the dialog. Defaults to `auto`, which fits the content. */\n public readonly size: InputSignal<ModalSize> = input<ModalSize>('auto');\n /** Heading of the dialog, shown as given. Without a title the header and its close icon are not shown. */\n public readonly title: InputSignal<string | undefined> = input<string>();\n\n /** Emits after the dialog closes, however it was closed. */\n public readonly closed: OutputEmitterRef<void> = output<void>();\n //#endregion\n\n //#region Variables\n private readonly _isOpen: WritableSignal<boolean> = signal(false);\n private clickedOutside = false;\n private elementRef: ElementRef;\n //#endregion\n\n //#region Properties\n /** Whether the dialog is open. */\n public readonly isOpen: Signal<boolean> = this._isOpen.asReadonly();\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.elementRef = inject(ElementRef);\n }\n\n /**\n * Moves the host to `<body>`.\n *\n * The host is `fixed` at `z-index: 50`, which ought to put it over everything. It did not: a\n * modal opened from a view rendered *under* the navigation, and the tab strip stayed visible and\n * clickable behind it. z-index only ranks siblings inside one stacking context, and the panel\n * these views render in is its own — it has to be, so the glass layer behind it can sit at -1\n * without falling through the app backdrop. Inside that context the modal's 50 counts for\n * nothing against the sidebar's 20 outside it, and it can never reach over the strip either.\n *\n * A bigger number cannot fix that, and dropping the isolation breaks the glass. Leaving the\n * context is the fix, and the body is the one place with nothing above it.\n *\n * Angular keeps rendering into this element wherever it sits, and injection does not care where\n * the node ends up — the forms and datasets these modals reach for still resolve through the\n * component tree.\n */\n public ngOnInit(): void {\n // Guarded because the logic specs build these components with Object.create() and never give\n // them a host; there is nothing to move then, and nothing to do.\n const host: HTMLElement | undefined = this.elementRef?.nativeElement;\n host?.ownerDocument.body.appendChild(host);\n }\n\n /** Angular drops the view but not the node, now that the host is no longer where it was created. */\n public override ngOnDestroy(): void {\n (<HTMLElement | undefined>this.elementRef?.nativeElement)?.remove();\n\n super.ngOnDestroy();\n }\n //#endregion\n\n //#region Event handlers\n protected onCloseClick(): void {\n if (!this.modalProcessing() && this.isOpen()) {\n this.closeModal();\n }\n }\n\n /**\n * Refuses the native submission of the form the content sits in.\n *\n * A submit button in here -- framework-button-filters' Confirm is one, and any <button> without a\n * type is another -- makes the browser submit this form once the button's own click handler has\n * run: a GET to the current URL, which reloads the whole application. Before the host moved to\n * <body> the submit bubbled through the consumer, and the FormGroupDirective of its [formGroup]\n * binding cancelled it; that was never this component's doing, and it stopped when the event\n * stopped passing through the consumer. A modal is never meant to submit natively, so the form\n * says so itself, wherever the host lives.\n *\n * Only the default is prevented. The event still bubbles, and the click that caused it has already\n * done its work.\n */\n protected onFormSubmit(event: Event): void {\n event.preventDefault();\n }\n //#endregion\n\n //#region Public methods\n /** Closes the dialog if it is open. Does nothing otherwise. */\n public closeModal(): void {\n if (this.isOpen()) {\n this.toggleModal();\n }\n }\n\n /**\n * Opens the dialog when closed and closes it when open. Opening focuses the first element with\n * `autofocus`; closing emits `closed`.\n */\n public toggleModal(): void {\n const wasOpen: boolean = this._isOpen();\n\n const body: HTMLBodyElement | null = document.querySelector('body');\n body?.classList.toggle('modal-active');\n\n this._isOpen.set(body?.classList.contains('modal-active') ?? false);\n\n if (this.isOpen()) {\n this.clickedOutside = false;\n\n const autofocus: any = this.elementRef.nativeElement.querySelector('[autofocus]');\n if (autofocus && !!autofocus.focus) {\n autofocus.focus();\n }\n } else if (wasOpen) {\n this.closed.emit();\n }\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n if (this.dialog() && this.isOpen()) {\n const target: HTMLElement = <HTMLElement>event.target;\n\n this.clickedOutside =\n (!this.modalProcessing() &&\n event.button === 0 &&\n target.closest('lib-modal') &&\n !target.closest('.modal-content')) ??\n false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.dialog() && this.isOpen()) {\n if (this.clickedOutside && !this.modalProcessing()) {\n this.toggleModal();\n }\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected documentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscape: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (!this.modalProcessing() && this.isOpen() && isEscape && document.body.classList.contains('modal-active')) {\n this.toggleModal();\n }\n }\n //#endregion\n}\n","<div class=\"modal-overlay\"></div>\n\n<div class=\"modal-container size-{{ size() }} {{ position() }}\">\n <form class=\"modal-content\" (submit)=\"onFormSubmit($event)\">\n @if (title()) {\n <div class=\"modal-header\">\n <p class=\"text-2xl font-bold\">{{ title() }}</p>\n <button type=\"button\" class=\"modal-close\" (click)=\"toggleModal()\">\n <svg\n class=\"fill-current text-black\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 18 18\"\n >\n <path\n d=\"M14.53 4.53l-1.06-1.06L9 7.94 4.53 3.47 3.47 4.53 7.94 9l-4.47 4.47 1.06 1.06L9 10.06l4.47 4.47 1.06-1.06L10.06 9z\"\n ></path>\n </svg>\n </button>\n </div>\n }\n\n <div class=\"modal-body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n\n <div class=\"modal-footer\">\n <lib-button intent=\"secondary\" [disabled]=\"modalProcessing()\" (click)=\"onCloseClick()\">\n {{ closeButtonText() }}\n </lib-button>\n\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </form>\n</div>\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n Component,\n computed,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { AbstractControl, FormArray, FormGroup } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { take, takeUntil } from 'rxjs';\nimport { FormService } from '../../services';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { MultiEditorDataset } from '../../services/datasets/multi-editor.dataset';\nimport { DataGridComponent } from '../data-grid/data-grid.component';\nimport { FormGroupComponent } from '../form-group/form-group.component';\nimport { ModalComponent } from '../modal/modal.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal for editing many records in one go: a grid of rows on one side and a form for the\n * selected row on the other. Project the form fields as content, bound to `formGroup`; changes\n * are kept per row and saved together through the provided `MultiEditorDataset` on Confirm.\n */\n@Component({\n selector: 'lib-multi-editor',\n templateUrl: './multi-editor.component.html',\n styleUrls: ['./multi-editor.component.scss'],\n imports: [ButtonComponent, DataGridComponent, ModalComponent, FormGroupComponent, TranslatePipe],\n})\nexport class MultiEditorComponent extends ModalComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n private readonly modal: Signal<ModalComponent | undefined> = viewChild(ModalComponent);\n\n /** Text of the button that adds a new row, shown as given. Defaults to `Add row`. */\n public readonly addButtonLabel: InputSignal<string> = input('Add row');\n /**\n * The form the projected fields are bound to. It is filled from the selected row, disabled while\n * no row is selected, and must be valid before the user can move to another row. Required.\n */\n public readonly formGroup: InputSignal<FormGroup<any>> = input.required<FormGroup<any>>();\n /** Text of the button that removes the selected row, shown as given. Defaults to `Remove row`. */\n public readonly removeButtonLabel: InputSignal<string> = input('Remove row');\n /** Shows the button that adds a new row. Defaults to `true`. */\n public readonly showAddButton: InputSignal<boolean> = input(true);\n /** Shows the button that removes the selected row; it appears only while a row is selected. Defaults to `true`. */\n public readonly showDeleteButton: InputSignal<boolean> = input(true);\n //#endregion\n\n //#region Variables\n protected readonly gridLoading: WritableSignal<boolean> = signal(false);\n\n private dataGridDataset: DataGridDataset = inject(DataGridDataset);\n private formService: FormService = inject(FormService);\n private multiEditorDataset: MultiEditorDataset = inject(MultiEditorDataset);\n private readonly selectedKey: WritableSignal<string | undefined> = signal(undefined);\n private selectedValue?: any;\n //#endregion\n\n //#region Properties\n protected get formLoading(): boolean {\n return this.formService.loading;\n }\n\n protected readonly hasSelectedKey: Signal<boolean> = computed(() => !!this.selectedKey());\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public override ngOnInit(): void {\n // ModalComponent moves the host to <body> here. Without this call the dialog stays inside the\n // tab panel's stacking context and renders under the navigation.\n super.ngOnInit();\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.multiEditorDataset.clearChangedValues();\n\n this.gridLoading.set(false);\n this.selectedKey.set(undefined);\n this.selectedValue = undefined;\n });\n\n this.dataGridDataset.selectedRowsChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {\n if (this.gridLoading() || !this.dataGridDataset.hasLoadedRows || !this.dataGridDataset.hasSelectedRows) {\n return;\n }\n\n if (this.formGroup().disabled) {\n this.formGroup().enable();\n }\n\n const selectedRowKey: string = this.dataGridDataset.selectedRowKeys[0];\n if (\n !!this.selectedKey() &&\n this.formGroup().enabled &&\n !this.formGroup().valid &&\n this.selectedKey() !== selectedRowKey\n ) {\n // If the form is invalid, need to stay in the same selected row.\n this.dataGridDataset.selectRow(this.selectedKey()!);\n this.formGroup().markAllAsTouched();\n } else {\n this.selectedKey.set(selectedRowKey);\n this.selectedValue = this.dataGridDataset.getRowData(selectedRowKey);\n this.formService.model = this.selectedValue;\n\n this.formGroup().reset();\n this.formGroup().patchValue(this.selectedValue);\n }\n });\n\n this.formGroup()\n .valueChanges.pipe(takeUntil(this.destroy$))\n .subscribe((_: any) => {\n if (this.selectedKey() && this.formGroup().dirty) {\n this.multiEditorDataset.updateValues(this.selectedKey()!, this.formGroup().getRawValue());\n }\n });\n\n // Start with an empty form and, since there is no selected row, disable the form.\n this.disableFormQuietly();\n }\n //#endregion\n\n //#region Event handlers\n protected onDeleteClick(): void {\n if (!this.selectedKey()) {\n return;\n }\n\n this.multiEditorDataset.removeValue(this.selectedKey()!);\n\n this.selectedKey.set(undefined);\n this.formGroup().reset({ emitEvent: false });\n this.clearAllFormArrays(this.formGroup());\n\n this.disableFormQuietly();\n }\n\n protected onNewClick(): void {\n const fakeNewID: number = (Math.floor(Math.random() * (999999 - 100000)) + 100000) * -1;\n const newModel: any = this.multiEditorDataset.newData(fakeNewID);\n\n if (newModel) {\n // Read before addNewRow: it stamps the grid's internal key onto the row, so afterwards even a\n // `{}` model reports one own key and the check below would never skip.\n const hasPrefilledValues: boolean = Object.keys(newModel).length > 0;\n\n this.multiEditorDataset.storeFakeIDGenerated(fakeNewID);\n\n this.dataGridDataset.addNewRow(newModel);\n\n const newKey: string = this.dataGridDataset.loadedKeys![this.dataGridDataset.loadedKeys!.length - 1];\n\n // Record whatever `newData` pre-filled. `selectRow` below reaches the form through\n // reset() + patchValue(), which leaves it pristine, and the `valueChanges` handler is gated on\n // `formGroup.dirty` — so a row the user never types into is never recorded. Without this, values\n // returned by `newData` show up in the grid but are dropped from the save batch, and adding\n // several rows while only editing the last silently discards the earlier ones.\n //\n // Skipped for a value-less model (`{}`, the blank-row convention) so implementations that\n // pre-fill nothing keep sending nothing for a row that was added and never touched.\n if (hasPrefilledValues) {\n this.multiEditorDataset.updateValues(newKey, newModel);\n }\n\n this.dataGridDataset.selectRow(newKey);\n }\n }\n\n protected onSaveClick(): void {\n if (this.selectedKey()) {\n this.formGroup().markAllAsTouched();\n }\n\n if (!this.selectedKey() || this.formGroup().valid) {\n this.modalProcessing.set(true);\n this.formGroup().disable();\n\n this.multiEditorDataset\n .saveChanges()\n .pipe(take(1))\n .subscribe({\n next: (_: any) => {\n this.modalProcessing.set(false);\n this.toggleModal();\n },\n error: (e: HttpErrorResponse) => {\n this.modalProcessing.set(false);\n this.formGroup().enable();\n\n if (e.status === 400 && e.error.errors) {\n this.dataGridDataset.selectRowID(e.error.entityKey);\n\n this.formService.setValidationErrorsFromHttpResponse(e);\n }\n },\n });\n }\n }\n //#endregion\n\n //#region Public methods\n /** Closes the modal if it is open, without saving. */\n public override closeModal(): void {\n this.modal()?.closeModal();\n }\n\n /** Opens or closes the modal. Opening reloads the grid and clears and disables the form. */\n public override toggleModal(): void {\n this.modal()?.toggleModal();\n\n if (this.modal()?.isOpen()) {\n this.gridLoading.set(true);\n this.dataGridDataset.refresh();\n\n this.selectedKey.set(undefined);\n this.formGroup().reset({ emitEvent: false });\n this.clearAllFormArrays(this.formGroup());\n this.disableFormQuietly();\n }\n }\n //#endregion\n\n //#region Private methods\n private clearAllFormArrays(form: FormGroup): void {\n Object.keys(form.controls).forEach((key: string) => {\n const control: AbstractControl | null = form.get(key);\n if (control instanceof FormArray) {\n control.clear({ emitEvent: false });\n }\n\n // Check for nested FormArrays.\n if (control instanceof FormGroup) {\n this.clearAllFormArrays(control);\n }\n });\n }\n\n /**\n * Disables the form without telling anything subscribed to its controls, then announces the new\n * status once, from the form itself.\n *\n * The fields in the editor read the form's state from its events. A form disabled without one\n * left them showing inputs for a form that no longer accepted any.\n */\n private disableFormQuietly(): void {\n this.formGroup().disable({ emitEvent: false });\n this.formGroup().updateValueAndValidity({ onlySelf: true });\n }\n //#endregion\n}\n","<lib-modal\n [closeButtonText]=\"closeButtonText() | translate\"\n [dialog]=\"dialog()\"\n [modalProcessing]=\"modalProcessing()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [title]=\"title() ?? ''\"\n>\n <!-- `.body-content` exists to be the query container and nothing else; `.panes` is the grid it\n controls. A grid cannot query itself, and the host is `display: contents` so it has no box\n of its own to contain anything. -->\n <div body class=\"body-content\">\n <div class=\"panes\">\n <div class=\"data-grid\">\n <lib-data-grid [disabled]=\"modalProcessing()\" [lazyLoadRows]=\"true\"></lib-data-grid>\n </div>\n\n <div class=\"data\">\n <div class=\"buttons\">\n @if (showAddButton()) {\n <lib-button\n intent=\"secondary\"\n [disabled]=\"modalProcessing() || gridLoading() || formLoading || formGroup().invalid\"\n (click)=\"onNewClick()\"\n >\n {{ addButtonLabel() }}\n </lib-button>\n }\n @if (showDeleteButton() && hasSelectedKey()) {\n <lib-button\n intent=\"danger\"\n [disabled]=\"modalProcessing() || gridLoading() || formLoading\"\n (click)=\"onDeleteClick()\"\n >\n {{ removeButtonLabel() }}\n </lib-button>\n }\n </div>\n\n <lib-form-group>\n <ng-content></ng-content>\n </lib-form-group>\n </div>\n </div>\n </div>\n\n <div footer>\n <lib-button\n intent=\"primary\"\n [disabled]=\"gridLoading() || formLoading\"\n [loading]=\"modalProcessing()\"\n (click)=\"onSaveClick()\"\n >\n {{ 'Button-Modal-MultiEditor-Confirm' | translate }}\n </lib-button>\n </div>\n</lib-modal>\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, input, InputSignal, OnInit, signal, TemplateRef, WritableSignal } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { takeUntil } from 'rxjs';\nimport { MultiSelectResultDataset } from '../../../services/datasets/multi-select-result.dataset';\nimport { BaseComponent } from '../../base.component';\nimport { DataGridDataset } from '../../../services';\n\n/**\n * The selection list inside `lib-multi-select`. Shows the records of the `MultiSelectResultDataset`\n * with a remove button on each, and loads more rows as the user scrolls to the end.\n */\n@Component({\n selector: 'lib-multi-select-result-grid',\n templateUrl: './result-grid.component.html',\n styleUrls: ['./result-grid.component.scss'],\n host: {\n class: 'flex-grow',\n },\n imports: [CommonModule, TranslatePipe],\n})\nexport class MultiSelectResultGridComponent extends BaseComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n /** Disables the remove buttons. Defaults to `false`. */\n public readonly isDisabled: InputSignal<boolean> = input(false);\n /** Template that renders one record. It receives the record as `rowData`. */\n public readonly template: InputSignal<TemplateRef<any> | undefined> = input<TemplateRef<any>>();\n //#endregion\n\n //#region Variables\n protected dataGridDataset: DataGridDataset = inject(DataGridDataset);\n protected readonly isLoading: WritableSignal<boolean> = signal(true);\n protected resultDataset: MultiSelectResultDataset = inject(MultiSelectResultDataset);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngOnInit(): void {\n this.resultDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isLoading.set(true);\n });\n\n this.resultDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isLoading.set(false);\n });\n }\n //#endregion\n\n //#region Event handlers\n /** Marks the record at the given displayed row index for removal and unticks it in the search grid. */\n public onItemRemoved(rowIndex: number): void {\n const id: any = this.resultDataset.displayedIDs[rowIndex];\n\n // Removing used to go only through the grid on the left, which knows nothing about a row it\n // has not loaded -- and this panel lists entries the search may never have shown. The click\n // then did nothing at all. The dataset is told directly, and the grid is still told too so a\n // row that does happen to be loaded keeps its checkbox in step.\n this.resultDataset.setIDToRemove(id);\n this.dataGridDataset.deselectRowID(id);\n }\n\n protected onScrolled(event: any): void {\n const currentScroll: number = event.target.scrollTop + event.target.clientHeight;\n const scrollHeight: number = event.target.scrollHeight - event.target.clientHeight;\n\n if (currentScroll > scrollHeight && !this.isLoading() && !this.resultDataset.loadedLastRow) {\n this.isLoading.set(true);\n this.resultDataset.loadRows();\n }\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","<div class=\"body\" (scroll)=\"onScrolled($event)\">\n @for (row of resultDataset.displayedRows; track row; let i = $index) {\n <div class=\"row\">\n <div class=\"cell\">\n <button\n class=\"remove\"\n type=\"button\"\n [class.disabled]=\"isDisabled()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onItemRemoved(i)\"\n >\n <i class=\"fas fa-times\"></i>\n </button>\n </div>\n <div class=\"cell\">\n <div>\n <ng-container *ngTemplateOutlet=\"template()!; context: { rowData: row }\"> </ng-container>\n </div>\n </div>\n </div>\n }\n @if (isLoading()) {\n <div class=\"loading\">\n <svg [ngClass]=\"''\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>\n {{ resultDataset.configs.loadingDisplayText ?? '' | translate }}\n </span>\n </div>\n }\n</div>\n","import {\n Component,\n inject,\n input,\n InputSignal,\n OnInit,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n WritableSignal,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { take, takeUntil } from 'rxjs';\nimport { IGridColumn } from '../../models';\nimport { DataGridDataset } from '../../services/datasets/data-grid.dataset';\nimport { MultiSelectResultDataset } from '../../services/datasets/multi-select-result.dataset';\nimport { DataGridComponent } from '../data-grid/data-grid.component';\nimport { ModalComponent } from '../modal/modal.component';\nimport { MultiSelectResultGridComponent } from './result-grid/result-grid.component';\nimport { ButtonComponent } from '../button/button.component';\n\n/**\n * A modal for picking many records at once: a searchable grid on one side and the current\n * selection on the other. It reads both lists from the `DataGridDataset` and\n * `MultiSelectResultDataset` provided around it, and saves through the result dataset on Confirm.\n */\n@Component({\n selector: 'lib-multi-select',\n templateUrl: './multi-select.component.html',\n styleUrls: ['./multi-select.component.scss'],\n imports: [\n ButtonComponent,\n DataGridComponent,\n FormsModule,\n ModalComponent,\n MultiSelectResultGridComponent,\n TranslatePipe,\n ],\n})\nexport class MultiSelectComponent extends ModalComponent implements OnInit {\n //#region ViewChilds, Inputs, Outputs\n private readonly modal: Signal<ModalComponent | undefined> = viewChild(ModalComponent);\n\n /** Template that renders one selected record in the selection list. It receives the record as `rowData`. */\n public readonly itemTemplate: InputSignal<TemplateRef<unknown> | undefined> = input<TemplateRef<unknown>>();\n //#endregion\n\n //#region Variables\n protected readonly isResultGridLoading: WritableSignal<boolean> = signal(false);\n protected readonly isSearchGridLoading: WritableSignal<boolean> = signal(false);\n protected resultDataset: MultiSelectResultDataset = inject(MultiSelectResultDataset);\n protected readonly searchCriteria: WritableSignal<string> = signal('');\n\n private _searchColumn = '';\n private dataGridDataset: DataGridDataset = inject(DataGridDataset);\n //#endregion\n\n //#region Properties\n private get searchColumn(): string {\n if (this._searchColumn.length === 0) {\n let columnName =\n this.dataGridDataset.columns.filter((col: IGridColumn) => col.field !== '')[0]?.field ?? 'Search';\n columnName = columnName.charAt(0).toUpperCase() + columnName.slice(1);\n this._searchColumn = columnName;\n }\n return this._searchColumn;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this.dataGridDataset.configs.multiSelect = true;\n this.closeButtonText.set('Button-Modal-Cancel');\n }\n\n public override ngOnInit(): void {\n // ModalComponent moves the host to <body> here. Without this call the dialog stays inside the\n // tab panel's stacking context and renders under the navigation.\n super.ngOnInit();\n\n this.dataGridDataset.loadStarted.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isSearchGridLoading.set(true);\n });\n\n this.dataGridDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isSearchGridLoading.set(false);\n this.updateSelectedItems();\n });\n\n this.resultDataset.loadFinished.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.isResultGridLoading.set(false);\n this.updateSelectedItems();\n });\n\n this.dataGridDataset.selectedRowsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe((selectionChanges: { [id: string]: { rowData: any; selected: boolean } }) => {\n if (this.isSearchGridLoading() || this.isResultGridLoading()) {\n return;\n }\n\n Object.keys(selectionChanges).forEach((key: string) => {\n const selection: { rowData: any; selected: boolean } = selectionChanges[key];\n const id: any = this.dataGridDataset.getRowID(key);\n\n if (selection.selected) {\n this.resultDataset.setIDToAdd(id, selection.rowData);\n } else {\n this.resultDataset.setIDToRemove(id);\n }\n });\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onSave(): void {\n this.modalProcessing.set(true);\n this.resultDataset\n .saveChanges()\n .pipe(take(1))\n .subscribe(() => {\n this.modalProcessing.set(false);\n this.toggleModal();\n });\n }\n\n /**\n * Runs the search.\n *\n * The input lives inside the modal's form, so Enter would submit it. Submitting reaches the\n * footer and saves changes the user has not finished making -- pressing Enter after typing a\n * name means \"find this\", never \"confirm everything\". The event is stopped here rather than in\n * the template so the reason travels with the code.\n */\n protected onSearch(event?: Event): void {\n event?.preventDefault();\n event?.stopPropagation();\n\n const filters: { [key: string]: string } = this.dataGridDataset.filters ?? {};\n\n this.isSearchGridLoading.set(true);\n if (this.searchCriteria().length > 0) {\n filters[this.searchColumn] = this.searchCriteria();\n this.dataGridDataset.setFilters(filters);\n } else if (Object.keys(filters).includes(this.searchColumn)) {\n this.clearSearch();\n }\n }\n //#endregion\n\n //#region Public methods\n /** Closes the modal if it is open, without saving. */\n public override closeModal(): void {\n this.modal()?.closeModal();\n }\n\n /** Opens or closes the modal. Opening clears the search and reloads the current selection. */\n public override toggleModal(): void {\n this.modal()?.toggleModal();\n\n if (this.modal()?.isOpen()) {\n this.searchCriteria.set('');\n this.clearSearch();\n\n this.isResultGridLoading.set(true);\n this.resultDataset.refresh();\n }\n }\n //#endregion\n\n //#regiosn Private methods\n private clearSearch(): void {\n const filters: { [key: string]: string } = this.dataGridDataset.filters ?? {};\n if (Object.keys(filters).includes(this.searchColumn)) {\n delete filters[this.searchColumn];\n }\n this.dataGridDataset.setFilters(filters);\n }\n private updateSelectedItems(): void {\n if (this.isSearchGridLoading() || this.isResultGridLoading()) {\n return;\n }\n\n // Filter by the results that are not marked to be removed.\n const idsFromResult: any[] = (this.resultDataset.loadedKeys ?? [])\n .map((key: string) => this.resultDataset.getRowID(key))\n .filter((id: any) => this.resultDataset.idsToRemove.indexOf(id) < 0);\n\n idsFromResult.push(...this.resultDataset.idsToAdd);\n\n // Get each corresponding key from the data grid.\n const keysToSelect: string[] = (this.dataGridDataset.loadedKeys ?? []).filter(\n (key: string) => idsFromResult.indexOf(this.dataGridDataset.getRowID(key)) >= 0,\n );\n\n this.dataGridDataset.selectRows(keysToSelect);\n }\n //#endregion\n}\n","<lib-modal\n [closeButtonText]=\"closeButtonText() | translate\"\n [dialog]=\"dialog()\"\n [modalProcessing]=\"modalProcessing()\"\n [position]=\"position()\"\n [size]=\"size()\"\n [title]=\"title() ?? ''\"\n>\n <!-- `.body-content` exists to be the query container and nothing else; `.panes` is the grid it\n controls. A grid cannot query itself, and the host is `display: contents` so it has no box\n of its own to contain anything. -->\n <div body class=\"body-content\">\n <div class=\"panes\">\n <div class=\"search-grid\">\n <div class=\"search\">\n <input\n class=\"form-input\"\n placeholder=\"Search...\"\n type=\"text\"\n [(ngModel)]=\"searchCriteria\"\n [disabled]=\"modalProcessing() || isSearchGridLoading()\"\n (keydown.enter)=\"onSearch($event)\"\n />\n </div>\n\n <lib-data-grid\n [disabled]=\"modalProcessing() || isSearchGridLoading() || isResultGridLoading()\"\n [lazyLoadRows]=\"true\"\n >\n </lib-data-grid>\n </div>\n\n <lib-multi-select-result-grid\n [isDisabled]=\"modalProcessing() || isSearchGridLoading() || isResultGridLoading()\"\n [template]=\"itemTemplate()!\"\n >\n </lib-multi-select-result-grid>\n </div>\n </div>\n\n <div footer>\n <lib-button intent=\"primary\" [loading]=\"modalProcessing()\" (click)=\"onSave()\">\n {{ 'Button-Modal-MultiSelect-Confirm' | translate }}\n </lib-button>\n </div>\n</lib-modal>\n","import { NgStyle } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n inject,\n Input,\n OnInit,\n signal,\n ViewChild,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { delay, filter, takeUntil } from 'rxjs';\nimport { SIDEBAR_CONFIGS, SidebarConfigs, SidebarMenu, SidebarMenuOpenMode, toSidebarMenuOpenMode } from '../../models';\nimport { SidebarService } from '../../services';\nimport { BaseComponent } from '../base.component';\n\n@Component({\n selector: 'lib-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n imports: [NgStyle, TranslatePipe],\n host: {\n '[class.active]': 'isActive',\n '[class.expanded]': '!isCollapsed',\n '[class.first-level]': 'level === 0',\n '[class.last-child]': 'isLast',\n '[class.selected]': 'isSelected()',\n },\n})\nexport class SidebarItemComponent extends BaseComponent implements OnInit, AfterViewInit {\n //#region ViewChilds, Inputs, Outputs\n @ViewChild('menuContainer') private menuContainer!: ElementRef<HTMLAnchorElement>;\n\n @Input() public isLast = false;\n @Input() public level = 0;\n @Input() public menu!: SidebarMenu;\n //#endregion\n\n //#region Variables\n // Signals, not fields. Three of these are read from host bindings, which Angular evaluates in\n // the PARENT's pass -- so `changeDetectorRef.detectChanges()` on this component could never\n // refresh them, and writing them after that pass raised NG0100 instead. A signal write marks\n // this view and every ancestor, which is the only notification that reaches a host binding.\n protected readonly children: WritableSignal<SidebarMenu[]> = signal([]);\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly isLoading: WritableSignal<boolean> = signal(false);\n protected readonly isSelected: WritableSignal<boolean> = signal(false);\n\n private readonly _childHeight: WritableSignal<number> = signal(0);\n private sidebarConfigs: SidebarConfigs = inject(SIDEBAR_CONFIGS);\n private sidebarService: SidebarService = inject(SidebarService);\n //#endregion\n\n //#region Properties\n public get childHeight(): number {\n return this._childHeight();\n }\n\n protected get areChildrenLoaded(): boolean {\n return this.isParent && this.children().length > 0;\n }\n\n protected get externalLinkText(): string {\n return this.sidebarConfigs.externalLinkText;\n }\n\n protected get isActive(): boolean {\n return this.sidebarService.isActive;\n }\n\n protected get isCollapsed(): boolean {\n return this.sidebarService.isCollapsed;\n }\n\n protected get isParent(): boolean {\n return this.menu.childCount > 0;\n }\n\n protected get opensInNewBrowserTab(): boolean {\n return (\n (this.menu.url?.length ?? 0) > 0 &&\n toSidebarMenuOpenMode(this.menu.openMode) === SidebarMenuOpenMode.ExternalNewTab\n );\n }\n\n protected get hasIcon(): boolean {\n return !!this.menu.icon && this.menu.icon.length > 0;\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngAfterViewInit(): void {\n if (!!this.menu && !!this.menu.parent) {\n this.menu.height = this.menuContainer?.nativeElement?.offsetHeight ?? 0;\n this.sidebarService.childrenInitialized.emit(this.menu.parent);\n }\n }\n\n public ngOnInit(): void {\n if (this.isParent) {\n this.sidebarService.childrenFailed\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n delay(1000),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.hasFailed.set(true);\n this.isLoading.set(false);\n this.isSelected.set(false);\n this.menu.isSelected = false;\n });\n\n // The service hands the children over in a plain field, which tells this item nothing. Copying\n // them into a signal is what renders the child items, and only their childrenInitialized ends\n // the loading state -- without it the item stayed on \"loading\" after a successful answer.\n this.children.set(this.menu.children ?? []);\n this.sidebarService.childrenLoaded\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((menu: SidebarMenu) => this.children.set(menu.children ?? []));\n\n this.sidebarService.childrenLoading\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.hasFailed.set(false);\n this.isLoading.set(true);\n });\n\n this.sidebarService.childrenInitialized\n .pipe(\n takeUntil(this.destroy$),\n filter(\n (menu: SidebarMenu) =>\n menu.id === this.menu.id && this.menu.children.every((child: SidebarMenu) => (child.height ?? 0) > 0),\n ),\n )\n .subscribe((_menu: SidebarMenu) => {\n this.isLoading.set(false);\n this.hasFailed.set(false);\n this.updateSubMenuHeight();\n\n if (this.menu.parent) {\n this.sidebarService.childrenInitialized.emit(this.menu.parent);\n }\n });\n }\n\n this.sidebarService.selectionChanged\n .pipe(\n takeUntil(this.destroy$),\n filter((menu: SidebarMenu) => menu.id === this.menu.id),\n )\n .subscribe((menu: SidebarMenu) => {\n this.isSelected.set(menu.isSelected);\n this.updateSubMenuHeight();\n });\n }\n //#endregion\n\n //#region Event handlers\n protected onSelectItem(): void {\n if (this.sidebarService.shouldActivate) {\n this.sidebarService.isActive = true;\n }\n\n this.sidebarService.select(this.menu);\n }\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n protected trackByFn(_index: number, item: SidebarMenu): number {\n return item.id;\n }\n\n private getChildHeight(menu: SidebarMenu): number {\n if (menu.isSelected) {\n return menu.children.reduce(\n (height: number, childMenu: SidebarMenu) => height + (childMenu.height ?? 0) + this.getChildHeight(childMenu),\n 0,\n );\n }\n return 0;\n }\n\n private updateSubMenuHeight(): void {\n this._childHeight.set(this.getChildHeight(this.menu));\n }\n //#endregion\n}\n","<li>\n <div\n #menuContainer\n [class.external]=\"opensInNewBrowserTab\"\n [class.failed]=\"hasFailed()\"\n [class.loading]=\"isLoading()\"\n [class.parent]=\"isParent\"\n [class.selected]=\"isSelected()\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-current]=\"isSelected()\"\n (click)=\"onSelectItem()\"\n (keydown.enter)=\"onSelectItem()\"\n (keydown.space)=\"onSelectItem(); $event.preventDefault()\"\n >\n <a [attr.title]=\"opensInNewBrowserTab ? externalLinkText : null\">\n @if (hasIcon && level === 0) {\n <i class=\"fa-solid fa-fw {{ menu.icon }}\"></i>\n }\n <span>{{ menu.label | translate }}</span>\n </a>\n\n @if (isParent) {\n <div class=\"loading\">\n <svg class=\"animate-spin text-white\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n </div>\n }\n </div>\n\n @if (isParent) {\n <ul\n [class.open]=\"isSelected()\"\n [ngStyle]=\"{\n 'height.px': childHeight,\n 'max-height.px': childHeight,\n }\"\n >\n @for (child of children(); track trackByFn($index, child); let last = $last) {\n <lib-sidebar-item [menu]=\"child\" [level]=\"level + 1\" [isLast]=\"last\"> </lib-sidebar-item>\n }\n </ul>\n }\n</li>\n","import {\n AfterViewInit,\n Component,\n computed,\n HostListener,\n inject,\n OnInit,\n Signal,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { forkJoin, map, merge, Observable, of, switchMap, take, takeUntil } from 'rxjs';\nimport { SIDEBAR_CONFIGS, SidebarConfigs, SidebarMenu, SidebarRegion } from '../../models';\nimport { SidebarService } from '../../services';\nimport { BaseComponent } from '../base.component';\nimport { SidebarItemComponent } from '../sidebar-item/sidebar-item.component';\n\n/**\n * The application's navigation sidebar. Loads its menus through `SidebarService`, groups them\n * into regions and closes itself on navigation, Escape or a click outside it on small screens.\n */\n@Component({\n selector: 'lib-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n imports: [SidebarItemComponent, TranslatePipe],\n host: {\n '[class.active]': 'isActive',\n '[class.expanded]': '!isCollapsed',\n },\n})\nexport class SidebarComponent extends BaseComponent implements AfterViewInit, OnInit {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected onBodyMouseDown(event: MouseEvent): void {\n if (this.isActive && event.target) {\n const target: HTMLElement = <HTMLElement>event.target;\n this.wasClickedOutside = (event.button === 0 && !target.closest('lib-sidebar')) ?? false;\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected onBodyMouseUp(_event: MouseEvent): void {\n if (this.wasClickedOutside) {\n this.wasClickedOutside = false;\n this.deactivate();\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected onDocumentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscapeKey: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (isEscapeKey) {\n this.deactivate();\n }\n }\n\n @HostListener('window:resize', ['$event'])\n protected onResize(_event: Event): void {\n this.updateShouldActivate();\n }\n //#endregion\n\n //#region Variables\n private sidebarConfigs: SidebarConfigs = inject(SIDEBAR_CONFIGS);\n\n protected configErrorText: string = this.sidebarConfigs.errorText;\n protected configLoadingText: string = this.sidebarConfigs.loadingText;\n protected readonly hasFailed: WritableSignal<boolean> = signal(false);\n protected readonly menus: WritableSignal<SidebarMenu[]> = signal<SidebarMenu[]>([]);\n protected readonly regions: WritableSignal<SidebarRegion[]> = signal<SidebarRegion[]>([]);\n\n private sidebarService: SidebarService = inject(SidebarService);\n private wasClickedOutside = false;\n //#endregion\n\n //#region Properties\n protected get isActive(): boolean {\n return this.sidebarService.isActive;\n }\n\n protected get isCollapsed(): boolean {\n return this.sidebarService.isCollapsed;\n }\n\n protected readonly isLoading: Signal<boolean> = computed(() => this.menus().length === 0);\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n }\n\n public ngAfterViewInit(): void {\n this.updateShouldActivate();\n }\n\n public ngOnInit(): void {\n merge(this.sidebarService.menuUrlSelected, this.sidebarService.menuExternalUrlSelected)\n .pipe(takeUntil(this.destroy$))\n .subscribe((_menu: SidebarMenu) => this.deactivate());\n\n this.sidebarService\n .loadRoot()\n .pipe(\n take(1),\n switchMap((menus: SidebarMenu[]) => this.loadAreaChildren(menus)),\n )\n .subscribe({\n next: (menus: SidebarMenu[]) => {\n this.menus.set(menus);\n this.regions.set(this.groupIntoRegions(menus));\n },\n error: () => this.hasFailed.set(true),\n });\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n /** Toggles the sidebar between collapsed and expanded. Collapsing also clears the selected menus. */\n public collapse(): void {\n this.sidebarService.isCollapsed = !this.sidebarService.isCollapsed;\n this.sidebarService.isActive = false;\n\n if (this.sidebarService.isCollapsed) {\n this.sidebarService.deselectAll();\n }\n\n this.updateShouldActivate();\n }\n //#endregion\n\n //#region Private methods\n protected trackByFn(_index: number, item: SidebarMenu): number {\n return item.id;\n }\n\n protected trackByRegion(_index: number, region: SidebarRegion): string {\n return region.name ?? '';\n }\n\n /** Whether this top-level menu stands for an area rather than a destination of its own. */\n private isArea(menu: SidebarMenu): boolean {\n return menu.childCount > 0 && (menu.url?.length ?? 0) === 0;\n }\n\n // Group top-level menus into regions by their optional `region` label, preserving\n // first-appearance order. Ungrouped menus fall into a single header-less region.\n private groupByRegionLabel(menus: SidebarMenu[]): SidebarRegion[] {\n const regions: SidebarRegion[] = [];\n const byName: Map<string | undefined, SidebarRegion> = new Map<string | undefined, SidebarRegion>();\n\n menus.forEach((menu: SidebarMenu) => {\n let region: SidebarRegion | undefined = byName.get(menu.region);\n if (!region) {\n region = { name: menu.region, items: [] };\n byName.set(menu.region, region);\n regions.push(region);\n }\n region.items.push(menu);\n });\n\n return regions;\n }\n\n // Derive the regions from the tree: an area menu becomes a header and lends the group its own\n // children, so the area carries one translated label and one order instead of a string repeated\n // across every item. Anything that is not an area keeps falling into a header-less region, which\n // is created where the first such item appears so the original ordering still holds.\n private groupByRootMenus(menus: SidebarMenu[]): SidebarRegion[] {\n const regions: SidebarRegion[] = [];\n let ungrouped: SidebarRegion | undefined;\n\n menus.forEach((menu: SidebarMenu) => {\n if (this.isArea(menu)) {\n regions.push({ name: menu.label, items: menu.children });\n return;\n }\n\n if (!ungrouped) {\n ungrouped = { name: undefined, items: [] };\n regions.push(ungrouped);\n }\n\n ungrouped.items.push(menu);\n });\n\n return regions;\n }\n\n private groupIntoRegions(menus: SidebarMenu[]): SidebarRegion[] {\n return this.sidebarConfigs.shouldDeriveAreasFromRootMenus\n ? this.groupByRootMenus(menus)\n : this.groupByRegionLabel(menus);\n }\n\n /**\n * Fetches the children of every area up front, because they are rendered flat rather than\n * behind a click, so the lazy load a collapsible parent relies on would never be triggered.\n */\n private loadAreaChildren(menus: SidebarMenu[]): Observable<SidebarMenu[]> {\n if (!this.sidebarConfigs.shouldDeriveAreasFromRootMenus) {\n return of(menus);\n }\n\n const areas: SidebarMenu[] = menus.filter((menu: SidebarMenu) => this.isArea(menu));\n\n // forkJoin never emits on an empty array, so a menu with no areas has to short-circuit.\n if (areas.length === 0) {\n return of(menus);\n }\n\n return forkJoin(areas.map((area: SidebarMenu) => this.sidebarService.loadChildrenFor(area))).pipe(map(() => menus));\n }\n\n private deactivate(): void {\n if (this.sidebarService.isActive) {\n this.sidebarService.isActive = false;\n this.sidebarService.deselectAll();\n }\n }\n\n private updateShouldActivate(): void {\n this.sidebarService.shouldActivate =\n (window.innerWidth <= 767 && !this.sidebarService.isCollapsed) || this.sidebarService.isCollapsed;\n }\n //#endregion\n}\n","<div class=\"sidebar-toolbar\">\n <button type=\"button\" class=\"sidebar-toggle\" (click)=\"collapse()\" aria-label=\"Toggle navigation\">\n <i class=\"fa-solid fa-angle-left\" [class.is-collapsed]=\"isCollapsed\"></i>\n </button>\n</div>\n\n<nav>\n @if (!isLoading()) {\n <ul>\n @for (region of regions(); track trackByRegion($index, region)) {\n @if (region.name) {\n <li class=\"sidebar-region-header\">\n <span>{{ region.name | translate }}</span>\n </li>\n }\n @for (menu of region.items; track trackByFn($index, menu)) {\n <lib-sidebar-item [menu]=\"menu\"> </lib-sidebar-item>\n }\n }\n @if (hasFailed()) {\n <div class=\"error\">\n <div>\n <i class=\"fa-solid fa-fw fa-triangle-exclamation\"></i>\n <span>{{ configErrorText }}</span>\n </div>\n </div>\n }\n </ul>\n } @else {\n <div class=\"loading\">\n <div>\n <svg class=\"animate-spin text-white\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n <span>{{ configLoadingText }}</span>\n </div>\n </div>\n }\n</nav>\n\n<div class=\"sidebar-footer\"><ng-content></ng-content></div>\n","import { FlexibleConnectedPositionStrategy, Overlay, OverlayPositionBuilder, OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { NgClass } from '@angular/common';\nimport {\n Component,\n ElementRef,\n HostListener,\n inject,\n input,\n InputSignal,\n model,\n ModelSignal,\n OnDestroy,\n output,\n OutputEmitterRef,\n Signal,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n WritableSignal,\n} from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IRibbonButtonOption } from '../../models/ribbon-button-option';\n\n/**\n * A large icon button for a `lib-ribbon-group`. With `options` it becomes a split button whose\n * chevron opens a dropdown list; it can also show a spinner and a brief success, warning or\n * failure state.\n */\n@Component({\n selector: 'lib-ribbon-button',\n templateUrl: './ribbon-button.component.html',\n host: {\n '[class.dropdown]': 'options().length > 0',\n '[class.show]': 'showDropdown()',\n },\n styleUrls: ['./ribbon-button.component.scss'],\n imports: [NgClass, TranslatePipe],\n})\nexport class RibbonButtonComponent implements OnDestroy {\n //#region ViewChilds, Inputs, Outputs\n private readonly buttonContainer: Signal<ElementRef<HTMLElement> | undefined> =\n viewChild<ElementRef<HTMLElement>>('buttonContainer');\n private readonly optionsDropdown: Signal<TemplateRef<unknown> | undefined> =\n viewChild<TemplateRef<unknown>>('optionsDropdown');\n\n /** CSS class that colours the icon, the spinner and the chevron. Defaults to `text-primary-500`. */\n public readonly color: InputSignal<string> = input('text-primary-500');\n /**\n * Index of the option the main button triggers directly when `options` is set. With `-1`, the\n * default, the main button opens the dropdown instead.\n */\n public readonly defaultOption: InputSignal<number> = input(-1);\n /** Disables the button and its dropdown. Defaults to `false`. */\n public readonly disabled: InputSignal<boolean> = input(false);\n /** Font Awesome icon class, for example `fa-save`. */\n public readonly icon: InputSignal<string | undefined> = input<string>();\n /** Size of the icon: `small` or `large`. Defaults to `large`. */\n public readonly iconSize: InputSignal<'small' | 'large'> = input<'small' | 'large'>('large');\n /** Text under the icon, as a translation key. Hidden when the ribbon is narrow. Defaults to empty. */\n public readonly label: InputSignal<string> = input('');\n /** Shows a spinner in place of the icon and blocks clicks while `true`. Defaults to `false`. */\n public readonly loading: ModelSignal<boolean> = model(false);\n /**\n * Entries of the dropdown list. When set, the button gets a chevron that opens the list. The\n * button is disabled when none of the options is visible. Defaults to none.\n */\n public readonly options: InputSignal<IRibbonButtonOption[]> = input<IRibbonButtonOption[]>([]);\n /**\n * Hover text, shown as given; the translated label is shown on hover when it is empty. Also\n * names the button for screen readers, translated, when there is no label. Defaults to empty.\n */\n public readonly tooltip: InputSignal<string> = input('');\n\n /**\n * Emits when the button is activated. Carries the `id` of the chosen option, or `undefined` for\n * a button without options.\n */\n public readonly action: OutputEmitterRef<string | undefined> = output<string | undefined>();\n //#endregion\n\n //#region Host listeners\n @HostListener('body:mousedown', ['$event'])\n protected bodyMouseDown(event: MouseEvent): void {\n if (this.showDropdown()) {\n const target: HTMLElement = <HTMLElement>event.target;\n\n const button: HTMLElement | null | undefined = target.closest('.button-container')?.parentElement;\n\n this.clickedOutside =\n event.button === 0 &&\n !target.closest('.options-dropdown') &&\n (!button || (!button?.classList.contains('dropdown') && !button?.classList.contains('open')));\n }\n }\n\n @HostListener('body:mouseup', ['$event'])\n protected bodyMouseUp(event: MouseEvent): void {\n if (this.showDropdown() && this.clickedOutside) {\n this.closeDropdown();\n }\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n protected documentKeyDown(event: Event): void {\n event = event || window.event;\n\n // keyCode is the fallback for engines predating KeyboardEvent.key.\n const isEscape: boolean =\n 'key' in event ? event.key === 'Escape' || event.key === 'Esc' : (<KeyboardEvent>event).keyCode === 27;\n\n if (this.showDropdown() && isEscape) {\n this.closeDropdown();\n }\n }\n //#endregion\n\n //#region Variables\n protected readonly showDropdown: WritableSignal<boolean> = signal(false);\n protected readonly status: WritableSignal<null | 'failure' | 'warning' | 'success'> = signal(null);\n\n // Stable per instance, so the chevron has something to point `aria-labelledby` at. Same shape\n // as TabsComponent and CatalogSelectComponent, which is where this pattern already lives.\n private static instances = 0;\n private readonly instanceId: string = `ribbon-button-${RibbonButtonComponent.instances++}`;\n\n private clickedOutside = false;\n private overlay: Overlay = inject(Overlay);\n private overlayRef?: OverlayRef;\n private positionBuilder: OverlayPositionBuilder = inject(OverlayPositionBuilder);\n private viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n //#endregion\n\n //#region Properties\n /**\n * What this button is called, whether or not its label is on screen. Compact mode hides the\n * label below 36rem of ribbon width, and an icon with no accessible name is unusable with a\n * screen reader. The tooltip is the fallback because a consumer who gives one and no label has\n * already said what the button does; with neither there is nothing to invent.\n */\n protected get accessibleName(): string {\n return this.label() || this.tooltip();\n }\n\n /** Id of the label element, so the dropdown chevron can borrow this button's name. */\n protected get labelId(): string {\n return `${this.instanceId}-label`;\n }\n\n /**\n * The chevron borrows the button's name by reference, but only when there is a label element\n * with text in it. A reference to an empty span names the control *nothing at all*, which is\n * worse than leaving it unnamed: it suppresses the fallback a screen reader would otherwise\n * use. An icon-only button with a tooltip is the case that exposes this.\n */\n protected get chevronLabelledBy(): string | null {\n return this.label() ? this.labelId : null;\n }\n\n /** The chevron's name when there is no label element to point at. */\n protected get chevronAriaLabel(): string | null {\n return this.label() ? null : this.tooltip() || null;\n }\n\n protected get buttonIcon(): string {\n switch (this.status()) {\n case 'success':\n return 'fa-check';\n case 'failure':\n return 'fa-times';\n case 'warning':\n return 'fa-exclamation';\n default:\n return this.icon() ?? '';\n }\n }\n\n protected get isButtonDisabled(): boolean {\n return (\n this.disabled() ||\n this.loading() ||\n (this.options().length > 0 && !this.options().some((option: IRibbonButtonOption) => this.isOptionVisible(option)))\n );\n }\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n public ngOnDestroy(): void {\n this.closeDropdown();\n }\n //#endregion\n\n //#region Event handlers\n protected onButtonClicked(): void {\n if (this.options().length > 0) {\n if (this.defaultOption() >= 0 && this.defaultOption() < this.options().length) {\n this.closeDropdown();\n this.action.emit(this.options()[this.defaultOption()].id);\n } else {\n this.onShowHideDropdown();\n }\n } else {\n this.action.emit(undefined);\n }\n }\n\n protected onOptionClicked(option: IRibbonButtonOption) {\n this.closeDropdown();\n this.action.emit(option.id);\n }\n\n protected onShowHideDropdown(): void {\n if (this.showDropdown()) {\n this.closeDropdown();\n } else {\n this.openDropdown();\n }\n }\n //#endregion\n\n //#region Public methods\n /** Ends the loading state and shows the given result on the button for one second. */\n public finishLoading(status: 'failure' | 'warning' | 'success'): void {\n this.loading.set(false);\n this.status.set(status);\n\n setTimeout(() => {\n this.status.set(null);\n }, 1000);\n }\n\n /** Puts the button in its loading state, the same as setting `loading` to `true`. */\n public startLoading(): void {\n this.loading.set(true);\n }\n\n protected isOptionDisabled(option: IRibbonButtonOption): boolean {\n return option.isDisabled || ((option.allowedActions?.length ?? 0) > 0 && option.isAccessAllowed === undefined);\n }\n\n protected isOptionVisible(option: IRibbonButtonOption): boolean {\n return (\n (option.isVisible ?? true) &&\n (option.allowedActions === undefined ||\n option.allowedActions.length === 0 ||\n option.isAccessAllowed === true ||\n (option.isAccessAllowed == undefined && option.allowedActions?.length > 0))\n );\n }\n //#endregion\n\n //#region Private methods\n private closeDropdown(): void {\n this.showDropdown.set(false);\n\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n this.overlayRef = undefined;\n }\n\n /**\n * Opens the options list in an overlay attached to the document rather than inside this button.\n *\n * The list is absolutely positioned and used to live in the button's own subtree, which works\n * only while nothing between it and the page clips. `lib-data-grid` does: it is\n * `overflow: hidden`, its buttons bar is its first child, and a child list's grid is only a few\n * rows tall -- so the export button's options opened downwards into the grid and had their lower\n * part cut off. Measured in Storybook at 129px of list against 65px of room, 64px lost.\n *\n * Nothing smaller fixes it. The grid's clipping is load-bearing -- the rows scroll inside it and\n * its corners are rounded -- and no z-index lifts content out of an ancestor's overflow. Leaving\n * the subtree is the fix, and it is what `lib-catalog-select` already does for its own dropdown.\n *\n * `reposition()` rather than `close()`: the button can move while the list is open, and the list\n * should follow it rather than disappear.\n */\n private openDropdown(): void {\n if (!this.optionsDropdown()) {\n return;\n }\n\n this.closeDropdown();\n\n const positionStrategy: FlexibleConnectedPositionStrategy = this.positionBuilder\n .flexibleConnectedTo(this.buttonContainer()!)\n .withPositions([\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },\n ]);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n hasBackdrop: false,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n });\n\n this.overlayRef.attach(new TemplatePortal(this.optionsDropdown()!, this.viewContainerRef));\n this.showDropdown.set(true);\n }\n //#endregion\n}\n","<!-- The title falls back to the label so a button that gives no tooltip still explains itself on\n hover once compact mode has taken its label away. -->\n<div #buttonContainer class=\"button-container\" [attr.title]=\"tooltip() || (label() | translate) || null\">\n <!-- aria-label is carried whether or not the label is on screen, because compact mode hides it\n below 36rem of ribbon width and the icon alone names nothing. Null rather than an empty\n string when there is neither label nor tooltip: an empty aria-label names the control\n nothing at all, which suppresses the fallback a screen reader would otherwise use. -->\n <a\n class=\"button\"\n role=\"button\"\n [attr.tabindex]=\"isButtonDisabled ? -1 : 0\"\n [attr.aria-disabled]=\"isButtonDisabled\"\n [attr.aria-label]=\"accessibleName ? (accessibleName | translate) : null\"\n [class.disabled]=\"isButtonDisabled\"\n [class.success]=\"status() === 'success'\"\n [class.warning]=\"status() === 'warning'\"\n [class.failure]=\"status() === 'failure'\"\n [class.small]=\"iconSize() === 'small'\"\n (click)=\"onButtonClicked()\"\n (keydown.enter)=\"onButtonClicked()\"\n (keydown.space)=\"onButtonClicked(); $event.preventDefault()\"\n >\n <span class=\"icon\" [class.loading]=\"loading()\">\n <i class=\"fas fa-fw\" [ngClass]=\"[buttonIcon, color()]\"></i>\n\n <svg [ngClass]=\"[color()]\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n </span>\n\n <span class=\"label\" [id]=\"labelId\" [class.text-white]=\"status() !== null\">\n {{ label() | translate }}\n </span>\n </a>\n\n @if (options().length > 0) {\n <a\n class=\"button-dropdown\"\n role=\"button\"\n [attr.tabindex]=\"isButtonDisabled ? -1 : 0\"\n [attr.aria-disabled]=\"isButtonDisabled\"\n aria-haspopup=\"menu\"\n [attr.aria-expanded]=\"showDropdown()\"\n [attr.aria-labelledby]=\"chevronLabelledBy\"\n [attr.aria-label]=\"chevronAriaLabel ? (chevronAriaLabel | translate) : null\"\n [class.disabled]=\"isButtonDisabled\"\n [class.success]=\"status() === 'success'\"\n [class.warning]=\"status() === 'warning'\"\n [class.failure]=\"status() === 'failure'\"\n [class.small]=\"iconSize() === 'small'\"\n (click)=\"onShowHideDropdown()\"\n (keydown.enter)=\"onShowHideDropdown()\"\n (keydown.space)=\"onShowHideDropdown(); $event.preventDefault()\"\n >\n <i class=\"fas fa-chevron-down\" [ngClass]=\"[color()]\"></i>\n </a>\n }\n</div>\n\n<!-- Rendered into a CDK overlay rather than here, so the list is not cut off by an ancestor that\n clips -- lib-data-grid does, and its buttons bar sits at the top of it. The `open` class is\n what the styles key on now that the list is no longer inside this component's `.show` host. -->\n<ng-template #optionsDropdown>\n <ul class=\"options-dropdown open\" role=\"menu\">\n @for (option of options(); track option; let i = $index) {\n <li\n role=\"menuitem\"\n [attr.tabindex]=\"isOptionDisabled(option) || !isOptionVisible(option) ? -1 : 0\"\n [attr.aria-disabled]=\"isOptionDisabled(option)\"\n [class.default-option]=\"i === defaultOption()\"\n [class.disabled]=\"isOptionDisabled(option)\"\n [class.hidden]=\"!isOptionVisible(option)\"\n (click)=\"onOptionClicked(option)\"\n (keydown.enter)=\"onOptionClicked(option)\"\n (keydown.space)=\"onOptionClicked(option); $event.preventDefault()\"\n >\n @if (!!option.icon) {\n <i class=\"fas fa-fw\" [ngClass]=\"[option.icon, color()]\"></i>\n }\n {{ option.label | translate }}\n </li>\n }\n </ul>\n</ng-template>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * The toolbar strip at the top of a view. Project `lib-ribbon-group` elements as content; content\n * marked with the `right` attribute is placed at the far end.\n */\n@Component({\n selector: 'lib-ribbon',\n templateUrl: './ribbon.component.html',\n styleUrls: ['./ribbon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RibbonComponent {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n //#region Host listeners\n //#endregion\n //#region Variables\n //#endregion\n //#region Properties\n //#endregion\n //#region Constructor and Angular life cycle methods\n //#endregion\n //#region Event handlers\n //#endregion\n //#region Public methods\n //#endregion\n //#region Private methods\n //#endregion\n}\n","<div>\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"[right]\"></ng-content>\n","import { Component, computed, contentChildren, Input, Signal } from '@angular/core';\n\nimport { RibbonGroupChild } from '../../models/ribbon-group-child';\n\n/**\n * A labelled group of buttons inside a `lib-ribbon`. The group hides itself when it holds no\n * visible `RibbonGroupChild`, such as the framework ribbon buttons. A plain `lib-ribbon-button` is\n * not one, so a group holding only those stays hidden.\n */\n@Component({\n selector: 'lib-ribbon-group',\n templateUrl: './ribbon-group.component.html',\n styleUrls: ['./ribbon-group.component.scss'],\n host: { '[class.hidden]': '!hasChildren()' },\n})\nexport class RibbonGroupComponent {\n //#region ViewChilds, Inputs, Outputs\n // A signal query, so a child arriving or leaving re-runs `hasChildren` on its own.\n /** The `RibbonGroupChild` elements projected into the group, at any depth. */\n public readonly children: Signal<readonly RibbonGroupChild[]> = contentChildren(RibbonGroupChild, {\n descendants: true,\n });\n\n /** Caption shown under the group's buttons. Shown as given, not translated. Defaults to empty. */\n @Input() public label = '';\n //#endregion\n\n //#region Host listeners\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n protected readonly hasChildren: Signal<boolean> = computed(() =>\n this.children().some((child: RibbonGroupChild) => child.isVisible()),\n );\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","<div class=\"content\">\n <ng-content></ng-content>\n</div>\n\n<div class=\"label\">\n <span>{{ label }}</span>\n</div>\n","import { Component, input, InputSignal } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n/**\n * The bubble that `libTooltip` shows. The directive creates it in an overlay; you do not place it\n * in a template yourself.\n *\n * The text goes through the `translate` pipe, so a translation key shows its translation and plain\n * text shows as given. It also follows a language change while the tooltip is open.\n */\n@Component({\n selector: 'lib-tooltip',\n template: `{{ text() | translate }}`,\n styleUrls: ['./tooltip.component.scss'],\n host: {\n class: 'lib-tooltip',\n role: 'tooltip',\n '[attr.id]': 'tooltipId()',\n },\n imports: [TranslatePipe],\n})\nexport class TooltipComponent {\n //#region Inputs\n /** The hint to show, as a translation key or plain text. Defaults to empty. */\n public readonly text: InputSignal<string> = input('');\n\n /** Id of the tooltip element, which the trigger points `aria-describedby` at. */\n public readonly tooltipId: InputSignal<string | undefined> = input<string>();\n //#endregion\n}\n","import { ConnectedPosition, Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ComponentRef,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n InputSignal,\n Renderer2,\n ViewContainerRef,\n} from '@angular/core';\nimport { TooltipComponent } from './tooltip.component';\n\n/** Side of the trigger the tooltip prefers. `start` and `end` follow the text direction. */\nexport type TooltipPosition = 'top' | 'bottom' | 'start' | 'end';\n\n/** Gap between the trigger and the tooltip, in pixels. */\nconst OFFSET = 6;\n\n/** How long the tooltip waits before it hides, so the pointer can cross the gap onto it. */\nconst HIDE_GRACE_MS = 100;\n\n/** How long a finger must stay down before the tooltip shows. */\nconst LONG_PRESS_MS = 500;\n\n/** How long the tooltip stays after a long press ends. */\nconst TOUCH_LINGER_MS = 1500;\n\n/** Mouse events a browser emulates after a touch arrive within this window and are ignored. */\nconst EMULATED_MOUSE_WINDOW_MS = 800;\n\n/** Elements that take focus, used to find the control inside a wrapper. */\nconst FOCUSABLE = 'button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Hides the tooltip on screen, if any. Only one shows at a time: hovering one control while another has\n * keyboard focus would otherwise stack two hints over each other.\n */\nlet hideOpenTooltip: (() => void) | undefined;\n\nconst ABOVE: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -OFFSET,\n};\nconst BELOW: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: OFFSET,\n};\nconst BEFORE: ConnectedPosition = {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -OFFSET,\n};\nconst AFTER: ConnectedPosition = {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: OFFSET,\n};\n\n/** The preferred side first, then its opposite, then the other axis. */\nconst POSITIONS: Record<TooltipPosition, ConnectedPosition[]> = {\n top: [ABOVE, BELOW, AFTER, BEFORE],\n bottom: [BELOW, ABOVE, AFTER, BEFORE],\n start: [BEFORE, AFTER, ABOVE, BELOW],\n end: [AFTER, BEFORE, ABOVE, BELOW],\n};\n\n/**\n * Shows a short themed hint next to an element, on hover and on keyboard focus.\n *\n * Use it instead of the native `title` attribute. `title` shows late, cannot be styled or themed,\n * never shows on keyboard focus and does nothing on touch.\n *\n * The tooltip follows WCAG 1.4.13. Escape dismisses it. The pointer can move onto it without\n * closing it. It stays until the pointer and focus leave, or Escape is pressed. On touch, a long\n * press shows it, and it hides shortly after the finger lifts.\n *\n * While the tooltip is open the trigger's `aria-describedby` points at it. When the directive sits\n * on a wrapper such as `lib-button`, the first focusable element inside gets the attribute\n * instead. Any id already there is kept, and the attribute is restored when the tooltip hides. A tooltip\n * describes; it does not name. An icon-only button still needs its own accessible name.\n */\n@Directive({\n selector: '[libTooltip]',\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut()',\n '(touchstart)': 'onTouchStart()',\n '(touchend)': 'onTouchEnd()',\n '(touchcancel)': 'onTouchEnd()',\n },\n})\nexport class TooltipDirective {\n //#region Inputs\n /** The hint, as a translation key or plain text. An empty value shows no tooltip. */\n public readonly text: InputSignal<string | null | undefined> = input<string | null | undefined>('', {\n alias: 'libTooltip',\n });\n\n /**\n * Side of the trigger the tooltip prefers: `top`, `bottom`, `start` or `end`. It flips to another\n * side when there is no room. Defaults to `top`.\n */\n public readonly tooltipPosition: InputSignal<TooltipPosition> = input<TooltipPosition>('top');\n\n /** Stops the tooltip from showing, and hides it if it is open. Defaults to `false`. */\n public readonly tooltipDisabled: InputSignal<boolean> = input(false);\n\n /** Milliseconds between hover or focus and the tooltip showing. Defaults to `300`. */\n public readonly tooltipDelay: InputSignal<number> = input(300);\n //#endregion\n\n //#region Variables\n private static instances = 0;\n private readonly tooltipId: string = `lib-tooltip-${TooltipDirective.instances++}`;\n\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly overlay: Overlay = inject(Overlay);\n private readonly renderer: Renderer2 = inject(Renderer2);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n\n private overlayRef?: OverlayRef;\n private tooltipRef?: ComponentRef<TooltipComponent>;\n private removeListeners: Array<() => void> = [];\n private describedElement?: HTMLElement;\n private previousDescribedBy: string | null = null;\n\n private showTimer?: ReturnType<typeof setTimeout>;\n private hideTimer?: ReturnType<typeof setTimeout>;\n private lastTouch = 0;\n /** Hides this tooltip; also how another tooltip closes it, through `hideOpenTooltip`. */\n private readonly hideThis = (): void => this.hide();\n\n private isHostHovered = false;\n private isTooltipHovered = false;\n private isFocused = false;\n //#endregion\n\n //#region Constructor\n public constructor() {\n // Keep an open tooltip in step with its inputs.\n effect(() => {\n const text: string = this.text() ?? '';\n\n if (this.tooltipDisabled() || !text) {\n this.hide();\n } else {\n this.tooltipRef?.setInput('text', text);\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.hide());\n }\n //#endregion\n\n //#region Event handlers\n protected onMouseEnter(): void {\n if (this.isEmulatedMouse()) {\n return;\n }\n\n this.isHostHovered = true;\n this.scheduleShow(this.tooltipDelay());\n }\n\n protected onMouseLeave(): void {\n this.isHostHovered = false;\n this.scheduleHideIfIdle();\n }\n\n protected onFocusIn(): void {\n if (this.isEmulatedMouse()) {\n return;\n }\n\n this.isFocused = true;\n this.scheduleShow(this.tooltipDelay());\n }\n\n protected onFocusOut(): void {\n this.isFocused = false;\n this.scheduleHideIfIdle();\n }\n\n protected onTouchStart(): void {\n this.lastTouch = Date.now();\n this.scheduleShow(LONG_PRESS_MS);\n }\n\n protected onTouchEnd(): void {\n this.lastTouch = Date.now();\n this.clearShowTimer();\n\n if (this.overlayRef) {\n this.clearHideTimer();\n this.hideTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);\n }\n }\n //#endregion\n\n //#region Public methods\n /** Shows the tooltip now, without the delay. Does nothing when disabled or empty. */\n public show(): void {\n this.clearShowTimer();\n this.clearHideTimer();\n\n if (this.overlayRef || this.tooltipDisabled() || !this.text()) {\n return;\n }\n\n if (hideOpenTooltip && hideOpenTooltip !== this.hideThis) {\n hideOpenTooltip();\n }\n hideOpenTooltip = this.hideThis;\n\n const host: HTMLElement = this.host.nativeElement;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.overlay\n .position()\n .flexibleConnectedTo(host)\n .withPositions(POSITIONS[this.tooltipPosition()])\n .withFlexibleDimensions(false)\n .withViewportMargin(8),\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n panelClass: 'lib-tooltip-pane',\n });\n\n this.tooltipRef = this.overlayRef.attach(new ComponentPortal(TooltipComponent, this.viewContainerRef));\n this.tooltipRef.setInput('text', this.text());\n this.tooltipRef.setInput('tooltipId', this.tooltipId);\n\n const pane: HTMLElement = this.overlayRef.overlayElement;\n this.removeListeners = [\n this.renderer.listen(pane, 'mouseenter', () => {\n this.isTooltipHovered = true;\n this.clearHideTimer();\n }),\n this.renderer.listen(pane, 'mouseleave', () => {\n this.isTooltipHovered = false;\n this.scheduleHideIfIdle();\n }),\n // Captured on the window, before any document listener. When the tooltip belongs to the\n // focused control, the Escape is its own and stops there, so it does not also close the modal\n // around it. A tooltip shown by hover only closes and lets the Escape reach what has focus,\n // such as an open calendar.\n this.renderer.listen(\n 'window',\n 'keydown',\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n if (this.isFocused) {\n event.stopPropagation();\n }\n this.hide();\n }\n },\n { capture: true },\n ),\n ];\n\n this.describedElement = this.findDescribedElement();\n this.previousDescribedBy = this.describedElement.getAttribute('aria-describedby');\n const describedBy: string = [this.previousDescribedBy, this.tooltipId].filter(Boolean).join(' ');\n this.describedElement.setAttribute('aria-describedby', describedBy);\n }\n\n /** Hides the tooltip now and gives the trigger back its own `aria-describedby`. */\n public hide(): void {\n this.clearShowTimer();\n this.clearHideTimer();\n this.isTooltipHovered = false;\n\n if (!this.overlayRef) {\n return;\n }\n if (hideOpenTooltip === this.hideThis) {\n hideOpenTooltip = undefined;\n }\n\n this.removeListeners.forEach((remove: () => void) => remove());\n this.removeListeners = [];\n\n this.overlayRef.dispose();\n this.overlayRef = undefined;\n this.tooltipRef = undefined;\n\n if (this.previousDescribedBy) {\n this.describedElement?.setAttribute('aria-describedby', this.previousDescribedBy);\n } else {\n this.describedElement?.removeAttribute('aria-describedby');\n }\n this.describedElement = undefined;\n this.previousDescribedBy = null;\n }\n //#endregion\n\n //#region Private methods\n private scheduleShow(delay: number): void {\n this.clearHideTimer();\n\n if (this.overlayRef || this.showTimer || this.tooltipDisabled() || !this.text()) {\n return;\n }\n\n this.showTimer = setTimeout(() => this.show(), Math.max(0, delay));\n }\n\n /** Hides after a short grace, unless the pointer or focus is still on the trigger or the tooltip. */\n private scheduleHideIfIdle(): void {\n if (this.isHostHovered || this.isTooltipHovered || this.isFocused) {\n return;\n }\n\n this.clearShowTimer();\n this.clearHideTimer();\n\n if (this.overlayRef) {\n this.hideTimer = setTimeout(() => this.hide(), HIDE_GRACE_MS);\n }\n }\n\n /**\n * The element a screen reader announces on focus. On a wrapper such as `lib-button` that is the\n * native control inside it, not the wrapper itself.\n */\n private findDescribedElement(): HTMLElement {\n const host: HTMLElement = this.host.nativeElement;\n\n if (host.matches(FOCUSABLE)) {\n return host;\n }\n\n return host.querySelector<HTMLElement>(FOCUSABLE) ?? host;\n }\n\n private isEmulatedMouse(): boolean {\n return Date.now() - this.lastTouch < EMULATED_MOUSE_WINDOW_MS;\n }\n\n private clearShowTimer(): void {\n clearTimeout(this.showTimer);\n this.showTimer = undefined;\n }\n\n private clearHideTimer(): void {\n clearTimeout(this.hideTimer);\n this.hideTimer = undefined;\n }\n //#endregion\n}\n","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\n\n/**\n * Turns a TypeScript enum into a list of `{ value, display }` options, where `display` is an\n * observable of the translated enum key. Use it to fill a select from an enum.\n */\n@Pipe({\n name: 'enumTranslate',\n})\nexport class EnumTranslatePipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n private translate: TranslateService = inject(TranslateService);\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(enumType: any): Array<{ value: any; display: Observable<any> }> {\n return Object.keys(enumType)\n .filter((key) => isNaN(Number(key)))\n .map((key) => ({\n value: enumType[key],\n display: this.translate.get(key),\n }));\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Replaces several placeholders in a string, for example\n * `'Hello {name}' | replaceMany: { '{name}': user.name }`. Only the first occurrence of each key\n * is replaced; a `null` or `undefined` value becomes an empty string.\n */\n@Pipe({\n name: 'replaceMany',\n})\nexport class ReplaceManyPipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(message: string, replaceArgs?: { [id: string]: string | null | undefined }): string {\n if (replaceArgs) {\n for (const [key, value] of Object.entries(replaceArgs)) {\n message = message.replace(key, value ?? '');\n }\n }\n return message;\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Replaces one substring in a string, for example `label | replace: '{0}': count`. Only the first\n * occurrence is replaced; a `null` or `undefined` replacement becomes an empty string.\n */\n@Pipe({\n name: 'replace',\n})\nexport class ReplacePipe implements PipeTransform {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n public transform(message: string, searchValue: string, replaceValue?: string | null): string {\n return message.replace(searchValue, replaceValue ?? '');\n }\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { NgModule } from '@angular/core';\nimport * as c from './components';\nimport * as d from './directives';\nimport * as p from './pipes';\n\n@NgModule({\n declarations: [],\n imports: [\n c.CatalogSelectComponent,\n c.DataGridComponent,\n c.DataGridRowComponent,\n c.FormInputComponent,\n c.FormInputGroupComponent,\n c.FormGroupComponent,\n c.GroupAccordionComponent,\n c.GroupContainerComponent,\n c.GroupScrollSpyComponent,\n c.SidebarComponent,\n c.ModalComponent,\n c.MultiEditorComponent,\n c.MultiSelectComponent,\n c.MultiSelectResultGridComponent,\n c.RibbonComponent,\n c.RibbonButtonComponent,\n c.RibbonGroupComponent,\n\n d.ScrollSpyDirective,\n\n p.EnumTranslatePipe,\n p.ReplacePipe,\n p.ReplaceManyPipe,\n ],\n exports: [\n c.CatalogSelectComponent,\n c.DataGridComponent,\n c.DataGridRowComponent,\n c.FormInputComponent,\n c.FormInputGroupComponent,\n c.FormGroupComponent,\n c.GroupAccordionComponent,\n c.GroupContainerComponent,\n c.GroupScrollSpyComponent,\n c.SidebarComponent,\n c.ModalComponent,\n c.MultiEditorComponent,\n c.MultiSelectComponent,\n c.MultiSelectResultGridComponent,\n c.RibbonComponent,\n c.RibbonButtonComponent,\n c.RibbonGroupComponent,\n\n d.ScrollSpyDirective,\n\n p.EnumTranslatePipe,\n p.ReplacePipe,\n p.ReplaceManyPipe,\n ],\n})\n/**\n * @deprecated Use standalone component imports instead of LibraryModule.\n * Import individual components directly in your component's `imports` array.\n */\nexport class LibraryModule {}\n","import { Injectable } from '@angular/core';\nimport { DataGridConfigs } from '../../models/configs/data-grid-configs';\nimport { GridConfigsProvider } from './grid-configs.provider';\n\n@Injectable()\nexport class DataGridConfigsProvider extends GridConfigsProvider<DataGridConfigs> {\n //#region ViewChilds, Inputs, Outputs\n //#endregion\n\n //#region Variables\n //#endregion\n\n //#region Properties\n //#endregion\n\n //#region Constructor and Angular life cycle methods\n constructor() {\n super();\n\n this._configs = {\n ...this._configs,\n multiSelect: false,\n multiSelectSize: 'min-content',\n showTotalRows: false,\n totalRowsText: '{{ count }} records',\n totalRowText: '{{ count }} record',\n booleanTrueText: 'Yes',\n booleanFalseText: 'No',\n } as DataGridConfigs;\n }\n //#endregion\n\n //#region Event handlers\n //#endregion\n\n //#region Public methods\n //#endregion\n\n //#region Private methods\n //#endregion\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\nexport class DateValidators {\n //#region Public methods\n public static greaterThanControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) <= new Date(compareControl?.value)) {\n return { greaterThanControl: true };\n }\n return null;\n };\n }\n\n public static greaterThanOrEqualControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) < new Date(compareControl?.value)) {\n return { greaterThanOrEqualControl: true };\n }\n return null;\n };\n }\n\n public static greaterThanOrEqualToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) < today) {\n return { greaterThanOrEqualToday: true };\n }\n return null;\n }\n\n public static greaterThanToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) <= today) {\n return { greaterThanToday: true };\n }\n return null;\n }\n\n public static lessThanControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) >= new Date(compareControl?.value)) {\n return { lessThanControl: true };\n }\n return null;\n };\n }\n\n public static lessThanOrEqualControl(controlName: string): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n const compareControl: AbstractControl | null | undefined = control.parent?.get(controlName);\n if (!!control.value && !!compareControl?.value && new Date(control.value) > new Date(compareControl?.value)) {\n return { lessThanOrEqualControl: true };\n }\n return null;\n };\n }\n\n public static lessThanOrEqualToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) > today) {\n return { lessThanOrEqualToday: true };\n }\n return null;\n }\n\n public static lessThanToday(control: AbstractControl): ValidationErrors | null {\n const today: Date = new Date();\n if (!!control.value && new Date(control.value) >= today) {\n return { lessThanToday: true };\n }\n return null;\n }\n\n public static maxDate(maxDate: Date): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!!control.value && new Date(control.value) > maxDate) {\n return { maxDate: true };\n }\n return null;\n };\n }\n\n public static minDate(minDate: Date): ValidatorFn {\n return (control: AbstractControl): ValidationErrors | null => {\n if (!!control.value && new Date(control.value) < minDate) {\n return { minDate: true };\n }\n return null;\n };\n }\n //#endregion\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,iBAAb,MAAa,eAAc;CAGT,SAAmC,MAAmB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAGhE,OAAwC,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGvD,MAA4B,MAAM,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAT7C,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAc,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAd,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAc,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,SAAA;IAAA,iBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UCtB3B;EAOA,QAAA,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