ud-components 0.8.1 → 0.8.3

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,22 +1,27 @@
1
- import * as i1$2 from '@angular/common';
2
- import { CommonModule, formatDate, NgTemplateOutlet, DOCUMENT, AsyncPipe, NgClass, NgStyle, DatePipe } from '@angular/common';
3
1
  import * as i0 from '@angular/core';
4
- import { ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, Component, inject, EventEmitter, forwardRef, Output, HostBinding, signal, Inject, Pipe, input, computed, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, ViewContainerRef, effect, Directive, Optional, Injectable, DestroyRef, LOCALE_ID, isSignal, ContentChild, ContentChildren, output, viewChild, ViewChildren, HostListener } from '@angular/core';
2
+ import { Pipe, input, computed, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, ElementRef, ViewContainerRef, effect, Directive, NgZone, DestroyRef, viewChild, signal, HostListener, ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, forwardRef, Output, HostBinding, Inject, Optional, Injectable, LOCALE_ID, isSignal, ContentChild, ContentChildren, output, ViewChildren } from '@angular/core';
3
+ import * as i2$1 from '@angular/material/button';
4
+ import { MatIconButton, MatButtonModule } from '@angular/material/button';
5
+ import * as i3 from '@angular/material/icon';
6
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
7
+ import { MatDrawer, MatDrawerContainer, MatDrawerContent } from '@angular/material/sidenav';
8
+ import { MatToolbar } from '@angular/material/toolbar';
9
+ import * as i1$2 from '@angular/common';
10
+ import { formatDate, NgTemplateOutlet, DOCUMENT, AsyncPipe, CommonModule, NgClass, NgStyle, DatePipe } from '@angular/common';
11
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
12
+ import { Router, NavigationEnd, RouterLink } from '@angular/router';
13
+ import { isObservable, of, filter, map, Subject, startWith, takeUntil, interval, debounceTime, distinctUntilChanged } from 'rxjs';
14
+ import { Overlay } from '@angular/cdk/overlay';
15
+ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
5
16
  import * as i1 from '@angular/forms';
6
17
  import { ControlContainer, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormControl, FormGroupDirective, FormGroup, Validators } from '@angular/forms';
7
- import { Subject, startWith, takeUntil, interval, isObservable, of, debounceTime, distinctUntilChanged, filter, map as map$1 } from 'rxjs';
8
18
  import * as i1$1 from '@angular/material/snack-bar';
9
19
  import { MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
10
20
  import { trigger, state, style, transition, animate } from '@angular/animations';
11
21
  import { SelectionModel } from '@angular/cdk/collections';
12
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
- import * as i2$1 from '@angular/material/button';
14
- import { MatButtonModule, MatIconButton } from '@angular/material/button';
15
22
  import { MatCardContent, MatCardHeader, MatCard } from '@angular/material/card';
16
23
  import * as i2 from '@angular/material/datepicker';
17
24
  import { MatDatepickerModule } from '@angular/material/datepicker';
18
- import * as i3 from '@angular/material/icon';
19
- import { MatIcon, MatIconModule } from '@angular/material/icon';
20
25
  import { MatFormField, MatPrefix, MatSuffix, MatLabel, MatInput, MatError } from '@angular/material/input';
21
26
  import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
22
27
  import { MatPaginator } from '@angular/material/paginator';
@@ -24,9 +29,6 @@ import * as i4 from '@angular/material/progress-spinner';
24
29
  import { MatProgressSpinnerModule, MatProgressSpinner } from '@angular/material/progress-spinner';
25
30
  import { MatChip, MatChipSet, MatChipGrid, MatChipInput, MatChipRow, MatChipRemove } from '@angular/material/chips';
26
31
  import { MatSelect, MatSelectTrigger, MatOption } from '@angular/material/select';
27
- import { Overlay } from '@angular/cdk/overlay';
28
- import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
29
- import { RouterLink } from '@angular/router';
30
32
  import { MatSort } from '@angular/material/sort';
31
33
  import { MatRow, MatHeaderRow, MatCell, MatColumnDef, MatHeaderCell, MatCellDef, MatHeaderCellDef, MatTable, MatHeaderRowDef, MatRowDef, MatNoDataRow } from '@angular/material/table';
32
34
  import * as i1$4 from '@ngx-translate/core';
@@ -35,7 +37,7 @@ import * as i1$3 from '@angular/material/dialog';
35
37
  import { MAT_DIALOG_DATA, MatDialogContent, MatDialog, MatDialogConfig } from '@angular/material/dialog';
36
38
  import * as i2$2 from '@angular/material/autocomplete';
37
39
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
38
- import { map } from 'rxjs/operators';
40
+ import { map as map$1 } from 'rxjs/operators';
39
41
  import * as i2$3 from '@angular/cdk/text-field';
40
42
  import { TextFieldModule } from '@angular/cdk/text-field';
41
43
  import * as i2$4 from '@angular/material/timepicker';
@@ -53,6 +55,559 @@ import { MatFormField as MatFormField$1 } from '@angular/material/form-field';
53
55
  import { ENTER, COMMA } from '@angular/cdk/keycodes';
54
56
  import { signalStoreFeature, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
55
57
 
58
+ const capitalize = (word) => word ? word.charAt(0).toUpperCase() + word.slice(1) : word;
59
+ const pluralize = (word) => /(?<!e)y\b/.test(word) ? word.replace(/(?<!e)y\b/, 'ies') : `${word}s`;
60
+ const spaceCase = (word) => word.replace(/[-_]+/g, ' ');
61
+ const inListValidator = (list) => {
62
+ return (control) => {
63
+ const value = String(control.value);
64
+ return list.includes(value) ? { inList: true } : null;
65
+ };
66
+ };
67
+ const updateArray = (items, item, propertyId = 'id', addToEnd = true) => items.some(i => i[propertyId] === item[propertyId])
68
+ ? items.map(i => (i[propertyId] === item[propertyId] ? item : i))
69
+ : addToEnd
70
+ ? [...items, item]
71
+ : [item, ...items];
72
+ const formatPhoneNumber = (value) => {
73
+ // Remove all non-digits
74
+ const digitsOnly = value.replace(/\D/g, '');
75
+ // Format based on length
76
+ let formattedValue = '';
77
+ if (digitsOnly.length >= 10) {
78
+ // Format as (XXX) XXX-XXXX for 10+ digits
79
+ const match = digitsOnly.match(/^(\d{3})(\d{3})(\d{4})(\d*)$/);
80
+ if (match) {
81
+ formattedValue = `(${match[1]}) ${match[2]}-${match[3]}`;
82
+ if (match[4]) {
83
+ formattedValue += ` ext. ${match[4]}`;
84
+ }
85
+ }
86
+ else {
87
+ // Fallback for different lengths
88
+ formattedValue = digitsOnly.replace(/^(\d{3})(\d{3})(\d{0,4}).*/, '($1) $2-$3');
89
+ }
90
+ }
91
+ else if (digitsOnly.length >= 7) {
92
+ // Format as XXX-XXXX for 7-9 digits
93
+ formattedValue = digitsOnly.replace(/^(\d{3})(\d{0,4})/, '$1-$2');
94
+ }
95
+ else if (digitsOnly.length >= 4) {
96
+ // Format as XXX-X for 4-6 digits
97
+ formattedValue = digitsOnly.replace(/^(\d{3})(\d{0,3})/, '$1-$2');
98
+ }
99
+ else {
100
+ // Keep as is for less than 4 digits
101
+ formattedValue = digitsOnly;
102
+ }
103
+ return formattedValue;
104
+ };
105
+ // Parse local date string to Date object without time zone offset
106
+ function parseLocalDate(dateString) {
107
+ const [year, month, day] = dateString.split('-');
108
+ return new Date(Number(year), Number(month) - 1, Number(day));
109
+ }
110
+ // Format Date to Day Month Year HH:mm (LocalDateTime)
111
+ // Example: Tue Feb 12 2022 12:00 without commas
112
+ function formatLocalDateTimeLongForm(date) {
113
+ return date
114
+ .toLocaleString('en-US', {
115
+ weekday: 'short',
116
+ month: 'short',
117
+ day: '2-digit',
118
+ year: 'numeric',
119
+ hour: '2-digit',
120
+ minute: '2-digit',
121
+ })
122
+ .replace(',', '');
123
+ }
124
+ // Format Date to YYYY-MM-DDTHH:mm:ss (LocalDateTime)
125
+ function formatLocalDateTime(date) {
126
+ const year = date.getFullYear();
127
+ const month = String(date.getMonth() + 1).padStart(2, '0');
128
+ const day = String(date.getDate()).padStart(2, '0');
129
+ const hours = String(date.getHours()).padStart(2, '0');
130
+ const minutes = String(date.getMinutes()).padStart(2, '0');
131
+ const seconds = String(date.getSeconds()).padStart(2, '0');
132
+ return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
133
+ }
134
+ // Format Date to HH:mm:ss (LocalTime)
135
+ function formatLocalTime(date) {
136
+ const hours = String(date.getHours()).padStart(2, '0');
137
+ const minutes = String(date.getMinutes()).padStart(2, '0');
138
+ const seconds = String(date.getSeconds()).padStart(2, '0');
139
+ return `${hours}:${minutes}:${seconds}`;
140
+ }
141
+ // Format Date to HH:mm (LocalTime)
142
+ function formatLocalTimeWithMinutes(date) {
143
+ const hours = String(date.getHours()).padStart(2, '0');
144
+ const minutes = String(date.getMinutes()).padStart(2, '0');
145
+ return `${hours}:${minutes}`;
146
+ }
147
+ // Format Date to HH:mm with AM/PM format (LocalTime)
148
+ function formatLocalTimeWithMinutesAmPm(date) {
149
+ const hours = Number.parseInt(String(date.getHours()));
150
+ const minutes = String(date.getMinutes()).padStart(2, '0');
151
+ const ampm = hours >= 12 ? 'PM' : 'AM';
152
+ const normalizedHour = hours % 12 === 0 ? 12 : hours % 12;
153
+ return `${normalizedHour.toString().padStart(2, '0')}:${minutes} ${ampm}`;
154
+ }
155
+ // Format Date to YYYY-MM-DD (LocalDate)
156
+ function formatLocalDate(date) {
157
+ const year = date.getFullYear();
158
+ const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based
159
+ const day = String(date.getDate()).padStart(2, '0');
160
+ return `${year}-${month}-${day}`;
161
+ }
162
+ /**
163
+ * Formats an ISO date string to a readable format
164
+ * @param isoString - Date string in ISO format (e.g., "2025-09-12T21:30:00")
165
+ * @returns Formatted date string (e.g., "September 12, 2025, 9:30 PM")
166
+ */
167
+ function formatStringDateTime(isoString) {
168
+ const date = new Date(isoString);
169
+ // Check if date is valid
170
+ if (isNaN(date.getTime())) {
171
+ throw new Error('Invalid date string provided');
172
+ }
173
+ const options = {
174
+ year: 'numeric',
175
+ month: 'long',
176
+ day: 'numeric',
177
+ hour: 'numeric',
178
+ minute: '2-digit',
179
+ hour12: true,
180
+ };
181
+ return date.toLocaleDateString('en-US', options);
182
+ }
183
+ /**
184
+ * Formats an ISO date string to a readable format
185
+ * @param isoString - Date string in ISO format (e.g., "2025-09-12")
186
+ * @returns Formatted date string (e.g., "September 12, 2025")
187
+ */
188
+ function formatStringDate(isoString) {
189
+ const date = new Date(isoString);
190
+ // Check if date is valid
191
+ if (isNaN(date.getTime())) {
192
+ throw new Error('Invalid date string provided');
193
+ }
194
+ const options = {
195
+ year: 'numeric',
196
+ month: 'long',
197
+ day: 'numeric',
198
+ };
199
+ return date.toLocaleDateString('en-US', options);
200
+ }
201
+ /**
202
+ * Format YYYY-MM to localized month year format
203
+ * @param dateStr Format: "2025-11"
204
+ * @param locale Language indicator
205
+ * @returns Format: "Nov 2025" (or localized equivalent)
206
+ */
207
+ function formatMonthYear(dateStr, locale) {
208
+ const [year, month] = dateStr.split('-');
209
+ // Create date as first day of the month
210
+ const date = new Date(parseInt(year), parseInt(month) - 1, 1);
211
+ // Use Angular's formatDate with current locale
212
+ // 'MMM yyyy' format gives "Nov 2025", "déc. 2025" for French, etc.
213
+ return formatDate(date, 'MMM yyyy', locale);
214
+ }
215
+
216
+ class CapitalizePipe {
217
+ transform(value) {
218
+ return value ? capitalize(value) : '';
219
+ }
220
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
221
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, isStandalone: true, name: "capitalize" });
222
+ }
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, decorators: [{
224
+ type: Pipe,
225
+ args: [{
226
+ name: 'capitalize',
227
+ }]
228
+ }] });
229
+
230
+ class ToObservablePipe {
231
+ transform(value) {
232
+ return isObservable(value) ? value : of(value);
233
+ }
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
235
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, isStandalone: true, name: "toObservable" });
236
+ }
237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, decorators: [{
238
+ type: Pipe,
239
+ args: [{
240
+ name: 'toObservable',
241
+ }]
242
+ }] });
243
+
244
+ /**
245
+ * The panel `udTooltip` attaches to the overlay. Not meant to be used on its
246
+ * own. Unencapsulated so the `.ud-tooltip-title` / `.ud-tooltip-meta` helper
247
+ * classes reach rich content that comes from the consumer's template.
248
+ */
249
+ class UdTooltipComponent {
250
+ content = input(null);
251
+ tooltipId = input.required();
252
+ placement = input('top');
253
+ template = computed(() => {
254
+ const content = this.content();
255
+ return content instanceof TemplateRef ? content : null;
256
+ });
257
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
258
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: UdTooltipComponent, isStandalone: true, selector: "ud-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, tooltipId: { classPropertyName: "tooltipId", publicName: "tooltipId", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"ud-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId()\"\n [attr.data-placement]=\"placement()\">\n @if (template(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ content() }}\n }\n</div>\n", styles: [".ud-tooltip{--ud-tooltip-bg: #1b2535;--ud-tooltip-ink: #f5f6f7;--ud-tooltip-muted: rgba(245, 246, 247, .68);--ud-tooltip-accent: #4a7fe8;--ud-tooltip-shift: 3px;position:relative;box-sizing:border-box;max-width:260px;padding:7px 10px;border-radius:6px;background:var(--ud-tooltip-bg);color:var(--ud-tooltip-ink);box-shadow:0 0 0 1px #ffffff14,0 6px 18px #1b253538;font-family:DM Sans,system-ui,sans-serif;font-size:12.5px;font-weight:500;line-height:1.45;text-align:left;overflow-wrap:anywhere;pointer-events:none;animation:ud-tooltip-in .11s ease-out both}.ud-tooltip:before{content:\"\";position:absolute;background:var(--ud-tooltip-accent);border-radius:2px}.ud-tooltip[data-placement=top]:before,.ud-tooltip[data-placement=bottom]:before{left:50%;width:14px;height:2px;margin-left:-7px}.ud-tooltip[data-placement=top]:before{bottom:0}.ud-tooltip[data-placement=bottom]:before{top:0}.ud-tooltip[data-placement=left]:before,.ud-tooltip[data-placement=right]:before{top:50%;width:2px;height:14px;margin-top:-7px}.ud-tooltip[data-placement=left]:before{right:0}.ud-tooltip[data-placement=right]:before{left:0}.ud-tooltip[data-placement=top]{--ud-tooltip-from: 0 var(--ud-tooltip-shift)}.ud-tooltip[data-placement=bottom]{--ud-tooltip-from: 0 calc(var(--ud-tooltip-shift) * -1)}.ud-tooltip[data-placement=left]{--ud-tooltip-from: var(--ud-tooltip-shift) 0}.ud-tooltip[data-placement=right]{--ud-tooltip-from: calc(var(--ud-tooltip-shift) * -1) 0}@keyframes ud-tooltip-in{0%{opacity:0;translate:var(--ud-tooltip-from, 0 0)}to{opacity:1;translate:0 0}}.ud-tooltip-title{display:block;font-weight:600}.ud-tooltip-meta{display:block;margin-top:2px;color:var(--ud-tooltip-muted);font-weight:400}@media (prefers-reduced-motion: reduce){.ud-tooltip{--ud-tooltip-shift: 0px}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
259
+ }
260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipComponent, decorators: [{
261
+ type: Component,
262
+ args: [{ selector: 'ud-tooltip', standalone: true, imports: [NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"ud-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId()\"\n [attr.data-placement]=\"placement()\">\n @if (template(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ content() }}\n }\n</div>\n", styles: [".ud-tooltip{--ud-tooltip-bg: #1b2535;--ud-tooltip-ink: #f5f6f7;--ud-tooltip-muted: rgba(245, 246, 247, .68);--ud-tooltip-accent: #4a7fe8;--ud-tooltip-shift: 3px;position:relative;box-sizing:border-box;max-width:260px;padding:7px 10px;border-radius:6px;background:var(--ud-tooltip-bg);color:var(--ud-tooltip-ink);box-shadow:0 0 0 1px #ffffff14,0 6px 18px #1b253538;font-family:DM Sans,system-ui,sans-serif;font-size:12.5px;font-weight:500;line-height:1.45;text-align:left;overflow-wrap:anywhere;pointer-events:none;animation:ud-tooltip-in .11s ease-out both}.ud-tooltip:before{content:\"\";position:absolute;background:var(--ud-tooltip-accent);border-radius:2px}.ud-tooltip[data-placement=top]:before,.ud-tooltip[data-placement=bottom]:before{left:50%;width:14px;height:2px;margin-left:-7px}.ud-tooltip[data-placement=top]:before{bottom:0}.ud-tooltip[data-placement=bottom]:before{top:0}.ud-tooltip[data-placement=left]:before,.ud-tooltip[data-placement=right]:before{top:50%;width:2px;height:14px;margin-top:-7px}.ud-tooltip[data-placement=left]:before{right:0}.ud-tooltip[data-placement=right]:before{left:0}.ud-tooltip[data-placement=top]{--ud-tooltip-from: 0 var(--ud-tooltip-shift)}.ud-tooltip[data-placement=bottom]{--ud-tooltip-from: 0 calc(var(--ud-tooltip-shift) * -1)}.ud-tooltip[data-placement=left]{--ud-tooltip-from: var(--ud-tooltip-shift) 0}.ud-tooltip[data-placement=right]{--ud-tooltip-from: calc(var(--ud-tooltip-shift) * -1) 0}@keyframes ud-tooltip-in{0%{opacity:0;translate:var(--ud-tooltip-from, 0 0)}to{opacity:1;translate:0 0}}.ud-tooltip-title{display:block;font-weight:600}.ud-tooltip-meta{display:block;margin-top:2px;color:var(--ud-tooltip-muted);font-weight:400}@media (prefers-reduced-motion: reduce){.ud-tooltip{--ud-tooltip-shift: 0px}}\n"] }]
263
+ }] });
264
+
265
+ const GAP = 8;
266
+ const POSITIONS = {
267
+ top: {
268
+ originX: 'center',
269
+ originY: 'top',
270
+ overlayX: 'center',
271
+ overlayY: 'bottom',
272
+ offsetY: -GAP,
273
+ },
274
+ bottom: {
275
+ originX: 'center',
276
+ originY: 'bottom',
277
+ overlayX: 'center',
278
+ overlayY: 'top',
279
+ offsetY: GAP,
280
+ },
281
+ left: {
282
+ originX: 'start',
283
+ originY: 'center',
284
+ overlayX: 'end',
285
+ overlayY: 'center',
286
+ offsetX: -GAP,
287
+ },
288
+ right: {
289
+ originX: 'end',
290
+ originY: 'center',
291
+ overlayX: 'start',
292
+ overlayY: 'center',
293
+ offsetX: GAP,
294
+ },
295
+ };
296
+ const OPPOSITE = {
297
+ top: 'bottom',
298
+ bottom: 'top',
299
+ left: 'right',
300
+ right: 'left',
301
+ };
302
+ /** A long press shows the tooltip on touch; lifting the finger hides it this long after. */
303
+ const TOUCH_HOLD_MS = 500;
304
+ const TOUCH_LINGER_MS = 1500;
305
+ /**
306
+ * Moving from one tooltipped element to the next within this window shows the
307
+ * next tooltip at once, the way a toolbar should feel. Shared by every
308
+ * instance on purpose.
309
+ */
310
+ const WARM_MS = 400;
311
+ let lastHiddenAt = 0;
312
+ let nextId = 0;
313
+ function placementOf(pair) {
314
+ if (pair.originY === 'top' && pair.overlayY === 'bottom')
315
+ return 'top';
316
+ if (pair.originY === 'bottom' && pair.overlayY === 'top')
317
+ return 'bottom';
318
+ if (pair.overlayX === 'end')
319
+ return 'left';
320
+ return 'right';
321
+ }
322
+ /**
323
+ * The library's tooltip (UC-19), replacing both native `title` hints and
324
+ * `matTooltip`: `<ud-button udTooltip="Export as CSV">`.
325
+ *
326
+ * Shows on hover, on keyboard focus (focus-visible only, so a mouse click does
327
+ * not leave one hanging) and on a long press; hides on leave, blur, Escape,
328
+ * press, and scroll. Flips to the opposite side when there is no room. While
329
+ * shown, the host's `aria-describedby` names it.
330
+ */
331
+ class UdTooltipDirective {
332
+ /** Text, or a template for rich content. Empty shows nothing. */
333
+ udTooltip = input();
334
+ udTooltipPosition = input('top');
335
+ udTooltipDisabled = input(false);
336
+ udTooltipShowDelay = input(300);
337
+ overlay = inject(Overlay);
338
+ host = inject(ElementRef);
339
+ viewContainerRef = inject(ViewContainerRef);
340
+ document = inject(DOCUMENT);
341
+ id = `ud-tooltip-${nextId++}`;
342
+ overlayRef = null;
343
+ panel = null;
344
+ positionSub = null;
345
+ showTimer = null;
346
+ touchTimer = null;
347
+ onEscape = (event) => {
348
+ if (event.key === 'Escape') {
349
+ this.hide();
350
+ }
351
+ };
352
+ constructor() {
353
+ // Content or the disabled flag changing while shown.
354
+ effect(() => {
355
+ const content = this.udTooltip();
356
+ const disabled = this.udTooltipDisabled();
357
+ if (!this.panel) {
358
+ return;
359
+ }
360
+ if (disabled || !content) {
361
+ this.hide();
362
+ }
363
+ else {
364
+ this.panel.setInput('content', content);
365
+ }
366
+ });
367
+ }
368
+ scheduleShow() {
369
+ this.clearTimers();
370
+ const sinceLast = Date.now() - lastHiddenAt;
371
+ const delay = sinceLast >= 0 && sinceLast < WARM_MS ? 0 : this.udTooltipShowDelay();
372
+ if (delay === 0) {
373
+ this.show();
374
+ }
375
+ else {
376
+ this.showTimer = setTimeout(() => this.show(), delay);
377
+ }
378
+ }
379
+ onFocusIn() {
380
+ // The host may be a wrapper (ud-button) whose inner element takes focus.
381
+ const el = this.host.nativeElement;
382
+ if (el.matches(':focus-visible') || el.querySelector(':focus-visible')) {
383
+ this.scheduleShow();
384
+ }
385
+ }
386
+ onTouchStart() {
387
+ this.clearTimers();
388
+ this.touchTimer = setTimeout(() => this.show(), TOUCH_HOLD_MS);
389
+ }
390
+ onTouchEnd() {
391
+ if (this.touchTimer) {
392
+ clearTimeout(this.touchTimer);
393
+ this.touchTimer = null;
394
+ }
395
+ if (this.panel) {
396
+ this.touchTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);
397
+ }
398
+ }
399
+ show() {
400
+ this.clearTimers();
401
+ const content = this.udTooltip();
402
+ if (this.udTooltipDisabled() || !content || this.panel) {
403
+ return;
404
+ }
405
+ const preferred = this.udTooltipPosition();
406
+ const strategy = this.overlay
407
+ .position()
408
+ .flexibleConnectedTo(this.host)
409
+ .withPositions([POSITIONS[preferred], POSITIONS[OPPOSITE[preferred]]])
410
+ .withFlexibleDimensions(false)
411
+ .withPush(false)
412
+ .withViewportMargin(8);
413
+ this.overlayRef = this.overlay.create({
414
+ positionStrategy: strategy,
415
+ scrollStrategy: this.overlay.scrollStrategies.close(),
416
+ panelClass: 'ud-tooltip-pane',
417
+ });
418
+ this.panel = this.overlayRef.attach(new ComponentPortal(UdTooltipComponent, this.viewContainerRef));
419
+ this.panel.setInput('content', content);
420
+ this.panel.setInput('tooltipId', this.id);
421
+ this.panel.setInput('placement', preferred);
422
+ this.positionSub = strategy.positionChanges.subscribe(change => {
423
+ this.panel?.setInput('placement', placementOf(change.connectionPair));
424
+ this.panel?.changeDetectorRef.detectChanges();
425
+ });
426
+ this.overlayRef.detachments().subscribe(() => this.dispose());
427
+ this.describe(true);
428
+ this.document.addEventListener('keydown', this.onEscape, true);
429
+ }
430
+ hide() {
431
+ this.clearTimers();
432
+ if (!this.overlayRef) {
433
+ return;
434
+ }
435
+ this.overlayRef.detach();
436
+ }
437
+ ngOnDestroy() {
438
+ this.hide();
439
+ }
440
+ /** Tear-down for every way a tooltip goes away, including the scroll strategy closing it. */
441
+ dispose() {
442
+ lastHiddenAt = Date.now();
443
+ this.document.removeEventListener('keydown', this.onEscape, true);
444
+ this.describe(false);
445
+ this.positionSub?.unsubscribe();
446
+ this.positionSub = null;
447
+ const ref = this.overlayRef;
448
+ this.overlayRef = null;
449
+ this.panel = null;
450
+ ref?.dispose();
451
+ }
452
+ /** Adds or removes this tooltip's id in the host's aria-describedby, keeping any other ids. */
453
+ describe(on) {
454
+ const el = this.host.nativeElement;
455
+ const ids = (el.getAttribute('aria-describedby') ?? '')
456
+ .split(/\s+/)
457
+ .filter(id => id && id !== this.id);
458
+ if (on) {
459
+ ids.push(this.id);
460
+ }
461
+ if (ids.length) {
462
+ el.setAttribute('aria-describedby', ids.join(' '));
463
+ }
464
+ else {
465
+ el.removeAttribute('aria-describedby');
466
+ }
467
+ }
468
+ clearTimers() {
469
+ if (this.showTimer) {
470
+ clearTimeout(this.showTimer);
471
+ this.showTimer = null;
472
+ }
473
+ if (this.touchTimer) {
474
+ clearTimeout(this.touchTimer);
475
+ this.touchTimer = null;
476
+ }
477
+ }
478
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
479
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.19", type: UdTooltipDirective, isStandalone: true, selector: "[udTooltip]", inputs: { udTooltip: { classPropertyName: "udTooltip", publicName: "udTooltip", isSignal: true, isRequired: false, transformFunction: null }, udTooltipPosition: { classPropertyName: "udTooltipPosition", publicName: "udTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, udTooltipDisabled: { classPropertyName: "udTooltipDisabled", publicName: "udTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, udTooltipShowDelay: { classPropertyName: "udTooltipShowDelay", publicName: "udTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "scheduleShow()", "mouseleave": "hide()", "focusin": "onFocusIn()", "focusout": "hide()", "mousedown": "hide()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()", "touchcancel": "hide()" } }, ngImport: i0 });
480
+ }
481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, decorators: [{
482
+ type: Directive,
483
+ args: [{
484
+ selector: '[udTooltip]',
485
+ standalone: true,
486
+ host: {
487
+ '(mouseenter)': 'scheduleShow()',
488
+ '(mouseleave)': 'hide()',
489
+ '(focusin)': 'onFocusIn()',
490
+ '(focusout)': 'hide()',
491
+ '(mousedown)': 'hide()',
492
+ '(touchstart)': 'onTouchStart()',
493
+ '(touchend)': 'onTouchEnd()',
494
+ '(touchcancel)': 'hide()',
495
+ },
496
+ }]
497
+ }], ctorParameters: () => [] });
498
+
499
+ const SIDENAV_LOGO = 'assets/brand/wordmark/udorm-wordmark-reverse.png';
500
+ const SIDENAV_LOGO_COLLAPSED = 'assets/brand/appicon/udorm-glyph-ud-reverse.png';
501
+ /**
502
+ * The navy app drawer: brand, scrolling sections, pinned footer. It renders
503
+ * the groups it is given; filtering by role or feature flag is the app's job.
504
+ */
505
+ class SidenavComponent {
506
+ groups = input.required();
507
+ /** Icon-only rail: headers become dividers, labels move to tooltips. */
508
+ collapsed = input(false);
509
+ brandRoute = input('/');
510
+ logo = input(SIDENAV_LOGO);
511
+ logoCollapsed = input(SIDENAV_LOGO_COLLAPSED);
512
+ router = inject(Router);
513
+ zone = inject(NgZone);
514
+ destroyRef = inject(DestroyRef);
515
+ sections = viewChild.required('sections');
516
+ sectionsList = viewChild.required('sectionsList');
517
+ // Whether part of the list sits below the visible area; drives the fade.
518
+ $moreBelow = signal(false);
519
+ $navGroups = computed(() => this.groups().filter(group => !group.footer && group.children.length));
520
+ $footerGroups = computed(() => this.groups().filter(group => group.footer && group.children.length));
521
+ // Seeded from router.url: the first NavigationEnd after login can fire
522
+ // before this component exists, which left the landing page unhighlighted.
523
+ $currentUrl = toSignal(this.router.events.pipe(filter((event) => event instanceof NavigationEnd), map(event => event.urlAfterRedirects)), { initialValue: this.router.url });
524
+ $activeRoute = computed(() => activeNavRoute(this.$currentUrl(), this.groups().flatMap(group => group.children.map(child => child.route))));
525
+ ngAfterViewInit() {
526
+ // The frame resizes with the window and the drawer; the list with the
527
+ // groups and language. Either can push items past the fold or back.
528
+ const observer = new ResizeObserver(() => this.zone.run(() => this.updateMoreBelow()));
529
+ observer.observe(this.sections().nativeElement);
530
+ observer.observe(this.sectionsList().nativeElement);
531
+ this.destroyRef.onDestroy(() => observer.disconnect());
532
+ }
533
+ updateMoreBelow() {
534
+ const { scrollTop, clientHeight, scrollHeight } = this.sections().nativeElement;
535
+ this.$moreBelow.set(scrollTop + clientHeight < scrollHeight - 1);
536
+ }
537
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
538
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: SidenavComponent, isStandalone: true, selector: "ud-sidenav", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, brandRoute: { classPropertyName: "brandRoute", publicName: "brandRoute", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoCollapsed: { classPropertyName: "logoCollapsed", publicName: "logoCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sections", first: true, predicate: ["sections"], descendants: true, isSignal: true }, { propertyName: "sectionsList", first: true, predicate: ["sectionsList"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"sidenav\" [class.collapsed]=\"collapsed()\">\n <a class=\"brand\" [routerLink]=\"brandRoute()\">\n @if (collapsed()) {\n <img [src]=\"logoCollapsed()\" alt=\"UDorm\" class=\"logo-glyph\" />\n } @else {\n <img [src]=\"logo()\" alt=\"UDorm\" class=\"logo-wordmark\" />\n }\n </a>\n <!-- The frame carries the fade, so it stays put while the list scrolls. -->\n <div class=\"sections-frame\" [class.more-below]=\"$moreBelow()\">\n <div class=\"sections\" #sections (scroll)=\"updateMoreBelow()\">\n <div class=\"sections-list\" #sectionsList>\n @for (group of $navGroups(); track group.key) {\n <div class=\"nav-group\">\n <!-- Same height expanded and collapsed, so icons keep their\n place when the drawer toggles. -->\n @if (group.category) {\n @if (collapsed()) {\n <div class=\"divider\" aria-hidden=\"true\"></div>\n } @else {\n <p class=\"category\">\n {{ group.category | toObservable | async }}\n </p>\n }\n }\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if ($footerGroups().length) {\n <div class=\"footer\">\n @for (group of $footerGroups(); track group.key) {\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n }\n </div>\n }\n</nav>\n\n<ng-template #navItem let-child>\n @let label = child.label | toObservable | async | capitalize;\n <a\n class=\"nav-item\"\n [routerLink]=\"child.route\"\n [class.active]=\"child.route === $activeRoute()\"\n [attr.aria-current]=\"child.route === $activeRoute() ? 'page' : null\"\n [attr.aria-label]=\"collapsed() ? label : null\"\n udTooltipPosition=\"right\"\n [udTooltip]=\"collapsed() ? (label ?? '') : ''\">\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\">\n {{ child.icon }}\n </mat-icon>\n @if (!collapsed()) {\n <span class=\"label\">{{ label }}</span>\n }\n @if (child.badge) {\n <span class=\"count\">{{ child.badge }}</span>\n }\n </a>\n</ng-template>\n", styles: [":host{display:block;height:100%}.sidenav{display:flex;flex-direction:column;height:100%;background:var(--primary-color);font-family:Sora,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sections-frame{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.sections-frame:after{content:\"\";position:absolute;inset:auto 0 0;height:40px;background:linear-gradient(transparent,var(--primary-color));pointer-events:none;opacity:0;transition:opacity .15s ease}.sections-frame.more-below:after{opacity:1}.sections{flex:1;min-height:0;padding:4px 8px 8px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.sections::-webkit-scrollbar{width:6px}.sections::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.sections-list{display:flex;flex-direction:column;gap:12px}.footer{flex:none;padding:6px 8px;border-top:1px solid rgba(255,255,255,.1)}.brand{flex:none;display:flex;align-items:center;height:56px;margin:0 8px;padding-left:10px;border-radius:6px}.brand:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.logo-wordmark{height:24px;width:auto}.logo-glyph{height:28px;width:28px;object-fit:contain}.nav-group{display:flex;flex-direction:column;gap:2px}.category{display:flex;align-items:flex-end;min-height:22px;margin:0;padding:0 10px 6px;font-size:11px;font-weight:600;line-height:1.25;letter-spacing:.08em;text-transform:uppercase;color:#8a93a8}.divider{display:flex;align-items:center;justify-content:center;height:22px}.divider:before{content:\"\";width:20px;height:1px;background:#ffffff1a}.nav-item{position:relative;display:flex;align-items:center;gap:10px;height:30px;padding:0 10px;border-radius:6px;color:#dcdfe8;font-size:13.5px;line-height:1;letter-spacing:0;text-decoration:none;white-space:nowrap;transition:background-color .15s ease}.nav-item mat-icon{flex:none;width:18px;height:18px;font-size:18px;color:#939cb2}.nav-item:hover{background:#ffffff0f;color:#f5f6f7}.nav-item:hover mat-icon{color:#dcdfe8}.nav-item.active{background:#2a3768;color:#fff;font-weight:500}.nav-item.active mat-icon{color:#aeb8ff}.nav-item:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.label{overflow:hidden;text-overflow:ellipsis;line-height:1.35}.count{margin-left:auto;min-width:22px;height:18px;padding:0 5px;border-radius:9px;background:#ef6547;color:#1b2535;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}.collapsed .brand{justify-content:center;padding-left:0}.collapsed .nav-item{justify-content:center;padding:0}.collapsed .count{position:absolute;top:-2px;right:3px;min-width:16px;height:15px;padding:0 4px;font-size:9.5px;line-height:15px;box-shadow:0 0 0 2px var(--primary-color)}@media (prefers-reduced-motion: reduce){.nav-item,.sections-frame:after{transition:none}}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: ToObservablePipe, name: "toObservable" }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
539
+ }
540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SidenavComponent, decorators: [{
541
+ type: Component,
542
+ args: [{ selector: 'ud-sidenav', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
543
+ AsyncPipe,
544
+ CapitalizePipe,
545
+ MatIcon,
546
+ NgTemplateOutlet,
547
+ RouterLink,
548
+ ToObservablePipe,
549
+ UdTooltipDirective,
550
+ ], template: "<nav class=\"sidenav\" [class.collapsed]=\"collapsed()\">\n <a class=\"brand\" [routerLink]=\"brandRoute()\">\n @if (collapsed()) {\n <img [src]=\"logoCollapsed()\" alt=\"UDorm\" class=\"logo-glyph\" />\n } @else {\n <img [src]=\"logo()\" alt=\"UDorm\" class=\"logo-wordmark\" />\n }\n </a>\n <!-- The frame carries the fade, so it stays put while the list scrolls. -->\n <div class=\"sections-frame\" [class.more-below]=\"$moreBelow()\">\n <div class=\"sections\" #sections (scroll)=\"updateMoreBelow()\">\n <div class=\"sections-list\" #sectionsList>\n @for (group of $navGroups(); track group.key) {\n <div class=\"nav-group\">\n <!-- Same height expanded and collapsed, so icons keep their\n place when the drawer toggles. -->\n @if (group.category) {\n @if (collapsed()) {\n <div class=\"divider\" aria-hidden=\"true\"></div>\n } @else {\n <p class=\"category\">\n {{ group.category | toObservable | async }}\n </p>\n }\n }\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if ($footerGroups().length) {\n <div class=\"footer\">\n @for (group of $footerGroups(); track group.key) {\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n }\n </div>\n }\n</nav>\n\n<ng-template #navItem let-child>\n @let label = child.label | toObservable | async | capitalize;\n <a\n class=\"nav-item\"\n [routerLink]=\"child.route\"\n [class.active]=\"child.route === $activeRoute()\"\n [attr.aria-current]=\"child.route === $activeRoute() ? 'page' : null\"\n [attr.aria-label]=\"collapsed() ? label : null\"\n udTooltipPosition=\"right\"\n [udTooltip]=\"collapsed() ? (label ?? '') : ''\">\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\">\n {{ child.icon }}\n </mat-icon>\n @if (!collapsed()) {\n <span class=\"label\">{{ label }}</span>\n }\n @if (child.badge) {\n <span class=\"count\">{{ child.badge }}</span>\n }\n </a>\n</ng-template>\n", styles: [":host{display:block;height:100%}.sidenav{display:flex;flex-direction:column;height:100%;background:var(--primary-color);font-family:Sora,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sections-frame{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.sections-frame:after{content:\"\";position:absolute;inset:auto 0 0;height:40px;background:linear-gradient(transparent,var(--primary-color));pointer-events:none;opacity:0;transition:opacity .15s ease}.sections-frame.more-below:after{opacity:1}.sections{flex:1;min-height:0;padding:4px 8px 8px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.sections::-webkit-scrollbar{width:6px}.sections::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.sections-list{display:flex;flex-direction:column;gap:12px}.footer{flex:none;padding:6px 8px;border-top:1px solid rgba(255,255,255,.1)}.brand{flex:none;display:flex;align-items:center;height:56px;margin:0 8px;padding-left:10px;border-radius:6px}.brand:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.logo-wordmark{height:24px;width:auto}.logo-glyph{height:28px;width:28px;object-fit:contain}.nav-group{display:flex;flex-direction:column;gap:2px}.category{display:flex;align-items:flex-end;min-height:22px;margin:0;padding:0 10px 6px;font-size:11px;font-weight:600;line-height:1.25;letter-spacing:.08em;text-transform:uppercase;color:#8a93a8}.divider{display:flex;align-items:center;justify-content:center;height:22px}.divider:before{content:\"\";width:20px;height:1px;background:#ffffff1a}.nav-item{position:relative;display:flex;align-items:center;gap:10px;height:30px;padding:0 10px;border-radius:6px;color:#dcdfe8;font-size:13.5px;line-height:1;letter-spacing:0;text-decoration:none;white-space:nowrap;transition:background-color .15s ease}.nav-item mat-icon{flex:none;width:18px;height:18px;font-size:18px;color:#939cb2}.nav-item:hover{background:#ffffff0f;color:#f5f6f7}.nav-item:hover mat-icon{color:#dcdfe8}.nav-item.active{background:#2a3768;color:#fff;font-weight:500}.nav-item.active mat-icon{color:#aeb8ff}.nav-item:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.label{overflow:hidden;text-overflow:ellipsis;line-height:1.35}.count{margin-left:auto;min-width:22px;height:18px;padding:0 5px;border-radius:9px;background:#ef6547;color:#1b2535;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}.collapsed .brand{justify-content:center;padding-left:0}.collapsed .nav-item{justify-content:center;padding:0}.collapsed .count{position:absolute;top:-2px;right:3px;min-width:16px;height:15px;padding:0 4px;font-size:9.5px;line-height:15px;box-shadow:0 0 0 2px var(--primary-color)}@media (prefers-reduced-motion: reduce){.nav-item,.sections-frame:after{transition:none}}\n"] }]
551
+ }] });
552
+ /**
553
+ * The nav route to highlight for `url`. An exact match wins; otherwise the
554
+ * item in the same top-level section, so detail and add pages (`/users/123`,
555
+ * `/users/add-user`) keep their section lit. When a section has several items
556
+ * (`/document-compliance/send` and `/list`), its list page wins.
557
+ */
558
+ function activeNavRoute(url, routes) {
559
+ const path = url.split(/[?#;]/)[0];
560
+ if (routes.includes(path)) {
561
+ return path;
562
+ }
563
+ const section = (route) => route.split('/')[1];
564
+ const inSection = routes.filter(route => section(route) === section(path));
565
+ return inSection.find(route => route.endsWith('/list')) ?? inSection[0];
566
+ }
567
+
568
+ // Bootstrap's medium breakpoint: at or below it the drawer stays an icon rail.
569
+ const CAN_OPEN_MIN_WIDTH = 768;
570
+ /**
571
+ * The app frame: `ud-sidenav` in a drawer, a sticky toolbar with the drawer
572
+ * toggle, and the page. Project `[toolbar-start]` (e.g. a breadcrumb),
573
+ * `[toolbar-end]` (e.g. the user menu) and the page itself.
574
+ */
575
+ class AppShellComponent {
576
+ groups = input.required();
577
+ brandRoute = input('/');
578
+ logo = input(SIDENAV_LOGO);
579
+ logoCollapsed = input(SIDENAV_LOGO_COLLAPSED);
580
+ $canOpen = signal(this.wideEnough());
581
+ $isOpen = signal(true);
582
+ $collapsed = computed(() => !(this.$canOpen() && this.$isOpen()));
583
+ onResize() {
584
+ this.$canOpen.set(this.wideEnough());
585
+ }
586
+ toggle() {
587
+ this.$isOpen.update(open => !open);
588
+ }
589
+ wideEnough() {
590
+ return document.body.clientWidth > CAN_OPEN_MIN_WIDTH;
591
+ }
592
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: AppShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
593
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: AppShellComponent, isStandalone: true, selector: "ud-app-shell", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, brandRoute: { classPropertyName: "brandRoute", publicName: "brandRoute", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoCollapsed: { classPropertyName: "logoCollapsed", publicName: "logoCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:resize": "onResize()" } }, ngImport: i0, template: "<mat-drawer-container class=\"drawer-container\">\n <mat-drawer class=\"drawer\" mode=\"side\" [opened]=\"!$collapsed()\">\n <ud-sidenav\n [groups]=\"groups()\"\n [collapsed]=\"$collapsed()\"\n [brandRoute]=\"brandRoute()\"\n [logo]=\"logo()\"\n [logoCollapsed]=\"logoCollapsed()\" />\n </mat-drawer>\n <mat-drawer-content class=\"drawer-content\" [class.half-closed]=\"$collapsed()\">\n <mat-toolbar class=\"toolbar\">\n <div class=\"toolbar-start\">\n @if ($canOpen()) {\n <button\n mat-icon-button\n class=\"toggle\"\n aria-label=\"Toggle navigation\"\n [attr.aria-expanded]=\"!$collapsed()\"\n (click)=\"toggle()\">\n <mat-icon>menu</mat-icon>\n </button>\n }\n <ng-content select=\"[toolbar-start]\" />\n </div>\n <div class=\"toolbar-end\">\n <ng-content select=\"[toolbar-end]\" />\n </div>\n </mat-toolbar>\n <div class=\"page\">\n <ng-content />\n </div>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [":host{display:block}.drawer-container{height:100vh}.drawer{width:248px;background:var(--primary-color);border-right:none}.drawer.mat-drawer-side{z-index:1}.drawer:not(.mat-drawer-opened){visibility:visible!important;display:block!important;transform:none!important;width:64px}.drawer-content{border:1px solid var(--accent-lightest-color);border-top:none;border-bottom:none;background-color:var(--background-color)}.drawer-content.half-closed{margin-left:64px!important}.drawer-content:not(.half-closed){margin-left:248px!important}.toolbar{position:sticky;top:0;z-index:1000;display:flex;justify-content:space-between;gap:16px;box-sizing:border-box;height:auto;min-height:56px;padding:0 16px 0 8px;background:#fff;color:#373f4c;border-bottom:1px solid var(--accent-lightest-color);font-size:14px}.toolbar-start,.toolbar-end{display:flex;align-items:center;gap:8px;min-width:0}.page{margin:1.5rem 0}@media (min-width: 768px){.page{margin:1.5rem 3rem}}@media print{.drawer{display:none!important}.drawer-content,.drawer-content.half-closed,.drawer-content:not(.half-closed){margin-left:0!important;overflow:visible!important;height:auto!important}.drawer-container{height:auto;overflow:visible}.toolbar{display:none!important}}\n"], dependencies: [{ kind: "component", type: MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: SidenavComponent, selector: "ud-sidenav", inputs: ["groups", "collapsed", "brandRoute", "logo", "logoCollapsed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
594
+ }
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: AppShellComponent, decorators: [{
596
+ type: Component,
597
+ args: [{ selector: 'ud-app-shell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
598
+ MatDrawer,
599
+ MatDrawerContainer,
600
+ MatDrawerContent,
601
+ MatIcon,
602
+ MatIconButton,
603
+ MatToolbar,
604
+ SidenavComponent,
605
+ ], template: "<mat-drawer-container class=\"drawer-container\">\n <mat-drawer class=\"drawer\" mode=\"side\" [opened]=\"!$collapsed()\">\n <ud-sidenav\n [groups]=\"groups()\"\n [collapsed]=\"$collapsed()\"\n [brandRoute]=\"brandRoute()\"\n [logo]=\"logo()\"\n [logoCollapsed]=\"logoCollapsed()\" />\n </mat-drawer>\n <mat-drawer-content class=\"drawer-content\" [class.half-closed]=\"$collapsed()\">\n <mat-toolbar class=\"toolbar\">\n <div class=\"toolbar-start\">\n @if ($canOpen()) {\n <button\n mat-icon-button\n class=\"toggle\"\n aria-label=\"Toggle navigation\"\n [attr.aria-expanded]=\"!$collapsed()\"\n (click)=\"toggle()\">\n <mat-icon>menu</mat-icon>\n </button>\n }\n <ng-content select=\"[toolbar-start]\" />\n </div>\n <div class=\"toolbar-end\">\n <ng-content select=\"[toolbar-end]\" />\n </div>\n </mat-toolbar>\n <div class=\"page\">\n <ng-content />\n </div>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [":host{display:block}.drawer-container{height:100vh}.drawer{width:248px;background:var(--primary-color);border-right:none}.drawer.mat-drawer-side{z-index:1}.drawer:not(.mat-drawer-opened){visibility:visible!important;display:block!important;transform:none!important;width:64px}.drawer-content{border:1px solid var(--accent-lightest-color);border-top:none;border-bottom:none;background-color:var(--background-color)}.drawer-content.half-closed{margin-left:64px!important}.drawer-content:not(.half-closed){margin-left:248px!important}.toolbar{position:sticky;top:0;z-index:1000;display:flex;justify-content:space-between;gap:16px;box-sizing:border-box;height:auto;min-height:56px;padding:0 16px 0 8px;background:#fff;color:#373f4c;border-bottom:1px solid var(--accent-lightest-color);font-size:14px}.toolbar-start,.toolbar-end{display:flex;align-items:center;gap:8px;min-width:0}.page{margin:1.5rem 0}@media (min-width: 768px){.page{margin:1.5rem 3rem}}@media print{.drawer{display:none!important}.drawer-content,.drawer-content.half-closed,.drawer-content:not(.half-closed){margin-left:0!important;overflow:visible!important;height:auto!important}.drawer-container{height:auto;overflow:visible}.toolbar{display:none!important}}\n"] }]
606
+ }], propDecorators: { onResize: [{
607
+ type: HostListener,
608
+ args: ['window:resize']
609
+ }] } });
610
+
56
611
  class CarouselComponent {
57
612
  pictures = [];
58
613
  height = 300;
@@ -448,178 +1003,6 @@ var TableDisplayColumnType;
448
1003
  TableDisplayColumnType["PILL"] = "PILL";
449
1004
  })(TableDisplayColumnType || (TableDisplayColumnType = {}));
450
1005
 
451
- const capitalize = (word) => word ? word.charAt(0).toUpperCase() + word.slice(1) : word;
452
- const pluralize = (word) => /(?<!e)y\b/.test(word) ? word.replace(/(?<!e)y\b/, 'ies') : `${word}s`;
453
- const spaceCase = (word) => word.replace(/[-_]+/g, ' ');
454
- const inListValidator = (list) => {
455
- return (control) => {
456
- const value = String(control.value);
457
- return list.includes(value) ? { inList: true } : null;
458
- };
459
- };
460
- const updateArray = (items, item, propertyId = 'id', addToEnd = true) => items.some(i => i[propertyId] === item[propertyId])
461
- ? items.map(i => (i[propertyId] === item[propertyId] ? item : i))
462
- : addToEnd
463
- ? [...items, item]
464
- : [item, ...items];
465
- const formatPhoneNumber = (value) => {
466
- // Remove all non-digits
467
- const digitsOnly = value.replace(/\D/g, '');
468
- // Format based on length
469
- let formattedValue = '';
470
- if (digitsOnly.length >= 10) {
471
- // Format as (XXX) XXX-XXXX for 10+ digits
472
- const match = digitsOnly.match(/^(\d{3})(\d{3})(\d{4})(\d*)$/);
473
- if (match) {
474
- formattedValue = `(${match[1]}) ${match[2]}-${match[3]}`;
475
- if (match[4]) {
476
- formattedValue += ` ext. ${match[4]}`;
477
- }
478
- }
479
- else {
480
- // Fallback for different lengths
481
- formattedValue = digitsOnly.replace(/^(\d{3})(\d{3})(\d{0,4}).*/, '($1) $2-$3');
482
- }
483
- }
484
- else if (digitsOnly.length >= 7) {
485
- // Format as XXX-XXXX for 7-9 digits
486
- formattedValue = digitsOnly.replace(/^(\d{3})(\d{0,4})/, '$1-$2');
487
- }
488
- else if (digitsOnly.length >= 4) {
489
- // Format as XXX-X for 4-6 digits
490
- formattedValue = digitsOnly.replace(/^(\d{3})(\d{0,3})/, '$1-$2');
491
- }
492
- else {
493
- // Keep as is for less than 4 digits
494
- formattedValue = digitsOnly;
495
- }
496
- return formattedValue;
497
- };
498
- // Parse local date string to Date object without time zone offset
499
- function parseLocalDate(dateString) {
500
- const [year, month, day] = dateString.split('-');
501
- return new Date(Number(year), Number(month) - 1, Number(day));
502
- }
503
- // Format Date to Day Month Year HH:mm (LocalDateTime)
504
- // Example: Tue Feb 12 2022 12:00 without commas
505
- function formatLocalDateTimeLongForm(date) {
506
- return date
507
- .toLocaleString('en-US', {
508
- weekday: 'short',
509
- month: 'short',
510
- day: '2-digit',
511
- year: 'numeric',
512
- hour: '2-digit',
513
- minute: '2-digit',
514
- })
515
- .replace(',', '');
516
- }
517
- // Format Date to YYYY-MM-DDTHH:mm:ss (LocalDateTime)
518
- function formatLocalDateTime(date) {
519
- const year = date.getFullYear();
520
- const month = String(date.getMonth() + 1).padStart(2, '0');
521
- const day = String(date.getDate()).padStart(2, '0');
522
- const hours = String(date.getHours()).padStart(2, '0');
523
- const minutes = String(date.getMinutes()).padStart(2, '0');
524
- const seconds = String(date.getSeconds()).padStart(2, '0');
525
- return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
526
- }
527
- // Format Date to HH:mm:ss (LocalTime)
528
- function formatLocalTime(date) {
529
- const hours = String(date.getHours()).padStart(2, '0');
530
- const minutes = String(date.getMinutes()).padStart(2, '0');
531
- const seconds = String(date.getSeconds()).padStart(2, '0');
532
- return `${hours}:${minutes}:${seconds}`;
533
- }
534
- // Format Date to HH:mm (LocalTime)
535
- function formatLocalTimeWithMinutes(date) {
536
- const hours = String(date.getHours()).padStart(2, '0');
537
- const minutes = String(date.getMinutes()).padStart(2, '0');
538
- return `${hours}:${minutes}`;
539
- }
540
- // Format Date to HH:mm with AM/PM format (LocalTime)
541
- function formatLocalTimeWithMinutesAmPm(date) {
542
- const hours = Number.parseInt(String(date.getHours()));
543
- const minutes = String(date.getMinutes()).padStart(2, '0');
544
- const ampm = hours >= 12 ? 'PM' : 'AM';
545
- const normalizedHour = hours % 12 === 0 ? 12 : hours % 12;
546
- return `${normalizedHour.toString().padStart(2, '0')}:${minutes} ${ampm}`;
547
- }
548
- // Format Date to YYYY-MM-DD (LocalDate)
549
- function formatLocalDate(date) {
550
- const year = date.getFullYear();
551
- const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based
552
- const day = String(date.getDate()).padStart(2, '0');
553
- return `${year}-${month}-${day}`;
554
- }
555
- /**
556
- * Formats an ISO date string to a readable format
557
- * @param isoString - Date string in ISO format (e.g., "2025-09-12T21:30:00")
558
- * @returns Formatted date string (e.g., "September 12, 2025, 9:30 PM")
559
- */
560
- function formatStringDateTime(isoString) {
561
- const date = new Date(isoString);
562
- // Check if date is valid
563
- if (isNaN(date.getTime())) {
564
- throw new Error('Invalid date string provided');
565
- }
566
- const options = {
567
- year: 'numeric',
568
- month: 'long',
569
- day: 'numeric',
570
- hour: 'numeric',
571
- minute: '2-digit',
572
- hour12: true,
573
- };
574
- return date.toLocaleDateString('en-US', options);
575
- }
576
- /**
577
- * Formats an ISO date string to a readable format
578
- * @param isoString - Date string in ISO format (e.g., "2025-09-12")
579
- * @returns Formatted date string (e.g., "September 12, 2025")
580
- */
581
- function formatStringDate(isoString) {
582
- const date = new Date(isoString);
583
- // Check if date is valid
584
- if (isNaN(date.getTime())) {
585
- throw new Error('Invalid date string provided');
586
- }
587
- const options = {
588
- year: 'numeric',
589
- month: 'long',
590
- day: 'numeric',
591
- };
592
- return date.toLocaleDateString('en-US', options);
593
- }
594
- /**
595
- * Format YYYY-MM to localized month year format
596
- * @param dateStr Format: "2025-11"
597
- * @param locale Language indicator
598
- * @returns Format: "Nov 2025" (or localized equivalent)
599
- */
600
- function formatMonthYear(dateStr, locale) {
601
- const [year, month] = dateStr.split('-');
602
- // Create date as first day of the month
603
- const date = new Date(parseInt(year), parseInt(month) - 1, 1);
604
- // Use Angular's formatDate with current locale
605
- // 'MMM yyyy' format gives "Nov 2025", "déc. 2025" for French, etc.
606
- return formatDate(date, 'MMM yyyy', locale);
607
- }
608
-
609
- class CapitalizePipe {
610
- transform(value) {
611
- return value ? capitalize(value) : '';
612
- }
613
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
614
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, isStandalone: true, name: "capitalize" });
615
- }
616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CapitalizePipe, decorators: [{
617
- type: Pipe,
618
- args: [{
619
- name: 'capitalize',
620
- }]
621
- }] });
622
-
623
1006
  class PluralizePipe {
624
1007
  transform(value) {
625
1008
  return value
@@ -634,21 +1017,7 @@ class PluralizePipe {
634
1017
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: PluralizePipe, decorators: [{
635
1018
  type: Pipe,
636
1019
  args: [{
637
- name: 'pluralize',
638
- }]
639
- }] });
640
-
641
- class ToObservablePipe {
642
- transform(value) {
643
- return isObservable(value) ? value : of(value);
644
- }
645
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
646
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, isStandalone: true, name: "toObservable" });
647
- }
648
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ToObservablePipe, decorators: [{
649
- type: Pipe,
650
- args: [{
651
- name: 'toObservable',
1020
+ name: 'pluralize',
652
1021
  }]
653
1022
  }] });
654
1023
 
@@ -827,261 +1196,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
827
1196
  type: Input
828
1197
  }] } });
829
1198
 
830
- /**
831
- * The panel `udTooltip` attaches to the overlay. Not meant to be used on its
832
- * own. Unencapsulated so the `.ud-tooltip-title` / `.ud-tooltip-meta` helper
833
- * classes reach rich content that comes from the consumer's template.
834
- */
835
- class UdTooltipComponent {
836
- content = input(null);
837
- tooltipId = input.required();
838
- placement = input('top');
839
- template = computed(() => {
840
- const content = this.content();
841
- return content instanceof TemplateRef ? content : null;
842
- });
843
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
844
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: UdTooltipComponent, isStandalone: true, selector: "ud-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, tooltipId: { classPropertyName: "tooltipId", publicName: "tooltipId", isSignal: true, isRequired: true, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"ud-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId()\"\n [attr.data-placement]=\"placement()\">\n @if (template(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ content() }}\n }\n</div>\n", styles: [".ud-tooltip{--ud-tooltip-bg: #1b2535;--ud-tooltip-ink: #f5f6f7;--ud-tooltip-muted: rgba(245, 246, 247, .68);--ud-tooltip-accent: #4a7fe8;--ud-tooltip-shift: 3px;position:relative;box-sizing:border-box;max-width:260px;padding:7px 10px;border-radius:6px;background:var(--ud-tooltip-bg);color:var(--ud-tooltip-ink);box-shadow:0 0 0 1px #ffffff14,0 6px 18px #1b253538;font-family:DM Sans,system-ui,sans-serif;font-size:12.5px;font-weight:500;line-height:1.45;text-align:left;overflow-wrap:anywhere;pointer-events:none;animation:ud-tooltip-in .11s ease-out both}.ud-tooltip:before{content:\"\";position:absolute;background:var(--ud-tooltip-accent);border-radius:2px}.ud-tooltip[data-placement=top]:before,.ud-tooltip[data-placement=bottom]:before{left:50%;width:14px;height:2px;margin-left:-7px}.ud-tooltip[data-placement=top]:before{bottom:0}.ud-tooltip[data-placement=bottom]:before{top:0}.ud-tooltip[data-placement=left]:before,.ud-tooltip[data-placement=right]:before{top:50%;width:2px;height:14px;margin-top:-7px}.ud-tooltip[data-placement=left]:before{right:0}.ud-tooltip[data-placement=right]:before{left:0}.ud-tooltip[data-placement=top]{--ud-tooltip-from: 0 var(--ud-tooltip-shift)}.ud-tooltip[data-placement=bottom]{--ud-tooltip-from: 0 calc(var(--ud-tooltip-shift) * -1)}.ud-tooltip[data-placement=left]{--ud-tooltip-from: var(--ud-tooltip-shift) 0}.ud-tooltip[data-placement=right]{--ud-tooltip-from: calc(var(--ud-tooltip-shift) * -1) 0}@keyframes ud-tooltip-in{0%{opacity:0;translate:var(--ud-tooltip-from, 0 0)}to{opacity:1;translate:0 0}}.ud-tooltip-title{display:block;font-weight:600}.ud-tooltip-meta{display:block;margin-top:2px;color:var(--ud-tooltip-muted);font-weight:400}@media (prefers-reduced-motion: reduce){.ud-tooltip{--ud-tooltip-shift: 0px}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
845
- }
846
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipComponent, decorators: [{
847
- type: Component,
848
- args: [{ selector: 'ud-tooltip', standalone: true, imports: [NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"ud-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId()\"\n [attr.data-placement]=\"placement()\">\n @if (template(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n {{ content() }}\n }\n</div>\n", styles: [".ud-tooltip{--ud-tooltip-bg: #1b2535;--ud-tooltip-ink: #f5f6f7;--ud-tooltip-muted: rgba(245, 246, 247, .68);--ud-tooltip-accent: #4a7fe8;--ud-tooltip-shift: 3px;position:relative;box-sizing:border-box;max-width:260px;padding:7px 10px;border-radius:6px;background:var(--ud-tooltip-bg);color:var(--ud-tooltip-ink);box-shadow:0 0 0 1px #ffffff14,0 6px 18px #1b253538;font-family:DM Sans,system-ui,sans-serif;font-size:12.5px;font-weight:500;line-height:1.45;text-align:left;overflow-wrap:anywhere;pointer-events:none;animation:ud-tooltip-in .11s ease-out both}.ud-tooltip:before{content:\"\";position:absolute;background:var(--ud-tooltip-accent);border-radius:2px}.ud-tooltip[data-placement=top]:before,.ud-tooltip[data-placement=bottom]:before{left:50%;width:14px;height:2px;margin-left:-7px}.ud-tooltip[data-placement=top]:before{bottom:0}.ud-tooltip[data-placement=bottom]:before{top:0}.ud-tooltip[data-placement=left]:before,.ud-tooltip[data-placement=right]:before{top:50%;width:2px;height:14px;margin-top:-7px}.ud-tooltip[data-placement=left]:before{right:0}.ud-tooltip[data-placement=right]:before{left:0}.ud-tooltip[data-placement=top]{--ud-tooltip-from: 0 var(--ud-tooltip-shift)}.ud-tooltip[data-placement=bottom]{--ud-tooltip-from: 0 calc(var(--ud-tooltip-shift) * -1)}.ud-tooltip[data-placement=left]{--ud-tooltip-from: var(--ud-tooltip-shift) 0}.ud-tooltip[data-placement=right]{--ud-tooltip-from: calc(var(--ud-tooltip-shift) * -1) 0}@keyframes ud-tooltip-in{0%{opacity:0;translate:var(--ud-tooltip-from, 0 0)}to{opacity:1;translate:0 0}}.ud-tooltip-title{display:block;font-weight:600}.ud-tooltip-meta{display:block;margin-top:2px;color:var(--ud-tooltip-muted);font-weight:400}@media (prefers-reduced-motion: reduce){.ud-tooltip{--ud-tooltip-shift: 0px}}\n"] }]
849
- }] });
850
-
851
- const GAP = 8;
852
- const POSITIONS = {
853
- top: {
854
- originX: 'center',
855
- originY: 'top',
856
- overlayX: 'center',
857
- overlayY: 'bottom',
858
- offsetY: -GAP,
859
- },
860
- bottom: {
861
- originX: 'center',
862
- originY: 'bottom',
863
- overlayX: 'center',
864
- overlayY: 'top',
865
- offsetY: GAP,
866
- },
867
- left: {
868
- originX: 'start',
869
- originY: 'center',
870
- overlayX: 'end',
871
- overlayY: 'center',
872
- offsetX: -GAP,
873
- },
874
- right: {
875
- originX: 'end',
876
- originY: 'center',
877
- overlayX: 'start',
878
- overlayY: 'center',
879
- offsetX: GAP,
880
- },
881
- };
882
- const OPPOSITE = {
883
- top: 'bottom',
884
- bottom: 'top',
885
- left: 'right',
886
- right: 'left',
887
- };
888
- /** A long press shows the tooltip on touch; lifting the finger hides it this long after. */
889
- const TOUCH_HOLD_MS = 500;
890
- const TOUCH_LINGER_MS = 1500;
891
- /**
892
- * Moving from one tooltipped element to the next within this window shows the
893
- * next tooltip at once, the way a toolbar should feel. Shared by every
894
- * instance on purpose.
895
- */
896
- const WARM_MS = 400;
897
- let lastHiddenAt = 0;
898
- let nextId = 0;
899
- function placementOf(pair) {
900
- if (pair.originY === 'top' && pair.overlayY === 'bottom')
901
- return 'top';
902
- if (pair.originY === 'bottom' && pair.overlayY === 'top')
903
- return 'bottom';
904
- if (pair.overlayX === 'end')
905
- return 'left';
906
- return 'right';
907
- }
908
- /**
909
- * The library's tooltip (UC-19), replacing both native `title` hints and
910
- * `matTooltip`: `<ud-button udTooltip="Export as CSV">`.
911
- *
912
- * Shows on hover, on keyboard focus (focus-visible only, so a mouse click does
913
- * not leave one hanging) and on a long press; hides on leave, blur, Escape,
914
- * press, and scroll. Flips to the opposite side when there is no room. While
915
- * shown, the host's `aria-describedby` names it.
916
- */
917
- class UdTooltipDirective {
918
- /** Text, or a template for rich content. Empty shows nothing. */
919
- udTooltip = input();
920
- udTooltipPosition = input('top');
921
- udTooltipDisabled = input(false);
922
- udTooltipShowDelay = input(300);
923
- overlay = inject(Overlay);
924
- host = inject(ElementRef);
925
- viewContainerRef = inject(ViewContainerRef);
926
- document = inject(DOCUMENT);
927
- id = `ud-tooltip-${nextId++}`;
928
- overlayRef = null;
929
- panel = null;
930
- positionSub = null;
931
- showTimer = null;
932
- touchTimer = null;
933
- onEscape = (event) => {
934
- if (event.key === 'Escape') {
935
- this.hide();
936
- }
937
- };
938
- constructor() {
939
- // Content or the disabled flag changing while shown.
940
- effect(() => {
941
- const content = this.udTooltip();
942
- const disabled = this.udTooltipDisabled();
943
- if (!this.panel) {
944
- return;
945
- }
946
- if (disabled || !content) {
947
- this.hide();
948
- }
949
- else {
950
- this.panel.setInput('content', content);
951
- }
952
- });
953
- }
954
- scheduleShow() {
955
- this.clearTimers();
956
- const sinceLast = Date.now() - lastHiddenAt;
957
- const delay = sinceLast >= 0 && sinceLast < WARM_MS ? 0 : this.udTooltipShowDelay();
958
- if (delay === 0) {
959
- this.show();
960
- }
961
- else {
962
- this.showTimer = setTimeout(() => this.show(), delay);
963
- }
964
- }
965
- onFocusIn() {
966
- // The host may be a wrapper (ud-button) whose inner element takes focus.
967
- const el = this.host.nativeElement;
968
- if (el.matches(':focus-visible') || el.querySelector(':focus-visible')) {
969
- this.scheduleShow();
970
- }
971
- }
972
- onTouchStart() {
973
- this.clearTimers();
974
- this.touchTimer = setTimeout(() => this.show(), TOUCH_HOLD_MS);
975
- }
976
- onTouchEnd() {
977
- if (this.touchTimer) {
978
- clearTimeout(this.touchTimer);
979
- this.touchTimer = null;
980
- }
981
- if (this.panel) {
982
- this.touchTimer = setTimeout(() => this.hide(), TOUCH_LINGER_MS);
983
- }
984
- }
985
- show() {
986
- this.clearTimers();
987
- const content = this.udTooltip();
988
- if (this.udTooltipDisabled() || !content || this.panel) {
989
- return;
990
- }
991
- const preferred = this.udTooltipPosition();
992
- const strategy = this.overlay
993
- .position()
994
- .flexibleConnectedTo(this.host)
995
- .withPositions([POSITIONS[preferred], POSITIONS[OPPOSITE[preferred]]])
996
- .withFlexibleDimensions(false)
997
- .withPush(false)
998
- .withViewportMargin(8);
999
- this.overlayRef = this.overlay.create({
1000
- positionStrategy: strategy,
1001
- scrollStrategy: this.overlay.scrollStrategies.close(),
1002
- panelClass: 'ud-tooltip-pane',
1003
- });
1004
- this.panel = this.overlayRef.attach(new ComponentPortal(UdTooltipComponent, this.viewContainerRef));
1005
- this.panel.setInput('content', content);
1006
- this.panel.setInput('tooltipId', this.id);
1007
- this.panel.setInput('placement', preferred);
1008
- this.positionSub = strategy.positionChanges.subscribe(change => {
1009
- this.panel?.setInput('placement', placementOf(change.connectionPair));
1010
- this.panel?.changeDetectorRef.detectChanges();
1011
- });
1012
- this.overlayRef.detachments().subscribe(() => this.dispose());
1013
- this.describe(true);
1014
- this.document.addEventListener('keydown', this.onEscape, true);
1015
- }
1016
- hide() {
1017
- this.clearTimers();
1018
- if (!this.overlayRef) {
1019
- return;
1020
- }
1021
- this.overlayRef.detach();
1022
- }
1023
- ngOnDestroy() {
1024
- this.hide();
1025
- }
1026
- /** Tear-down for every way a tooltip goes away, including the scroll strategy closing it. */
1027
- dispose() {
1028
- lastHiddenAt = Date.now();
1029
- this.document.removeEventListener('keydown', this.onEscape, true);
1030
- this.describe(false);
1031
- this.positionSub?.unsubscribe();
1032
- this.positionSub = null;
1033
- const ref = this.overlayRef;
1034
- this.overlayRef = null;
1035
- this.panel = null;
1036
- ref?.dispose();
1037
- }
1038
- /** Adds or removes this tooltip's id in the host's aria-describedby, keeping any other ids. */
1039
- describe(on) {
1040
- const el = this.host.nativeElement;
1041
- const ids = (el.getAttribute('aria-describedby') ?? '')
1042
- .split(/\s+/)
1043
- .filter(id => id && id !== this.id);
1044
- if (on) {
1045
- ids.push(this.id);
1046
- }
1047
- if (ids.length) {
1048
- el.setAttribute('aria-describedby', ids.join(' '));
1049
- }
1050
- else {
1051
- el.removeAttribute('aria-describedby');
1052
- }
1053
- }
1054
- clearTimers() {
1055
- if (this.showTimer) {
1056
- clearTimeout(this.showTimer);
1057
- this.showTimer = null;
1058
- }
1059
- if (this.touchTimer) {
1060
- clearTimeout(this.touchTimer);
1061
- this.touchTimer = null;
1062
- }
1063
- }
1064
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1065
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.19", type: UdTooltipDirective, isStandalone: true, selector: "[udTooltip]", inputs: { udTooltip: { classPropertyName: "udTooltip", publicName: "udTooltip", isSignal: true, isRequired: false, transformFunction: null }, udTooltipPosition: { classPropertyName: "udTooltipPosition", publicName: "udTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, udTooltipDisabled: { classPropertyName: "udTooltipDisabled", publicName: "udTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, udTooltipShowDelay: { classPropertyName: "udTooltipShowDelay", publicName: "udTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "scheduleShow()", "mouseleave": "hide()", "focusin": "onFocusIn()", "focusout": "hide()", "mousedown": "hide()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()", "touchcancel": "hide()" } }, ngImport: i0 });
1066
- }
1067
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, decorators: [{
1068
- type: Directive,
1069
- args: [{
1070
- selector: '[udTooltip]',
1071
- standalone: true,
1072
- host: {
1073
- '(mouseenter)': 'scheduleShow()',
1074
- '(mouseleave)': 'hide()',
1075
- '(focusin)': 'onFocusIn()',
1076
- '(focusout)': 'hide()',
1077
- '(mousedown)': 'hide()',
1078
- '(touchstart)': 'onTouchStart()',
1079
- '(touchend)': 'onTouchEnd()',
1080
- '(touchcancel)': 'hide()',
1081
- },
1082
- }]
1083
- }], ctorParameters: () => [] });
1084
-
1085
1199
  /**
1086
1200
  * Styled multi-select with a chip trigger that participates in the parent FormGroup.
1087
1201
  *
@@ -1848,7 +1962,7 @@ class AutocompleteComponent {
1848
1962
  }
1849
1963
  // Filter options as the user types
1850
1964
  this.searchControl.valueChanges
1851
- .pipe(startWith(this.searchControl.value ?? ''), map(term => this.filter(term ?? '')), takeUntil(this.destroy$))
1965
+ .pipe(startWith(this.searchControl.value ?? ''), map$1(term => this.filter(term ?? '')), takeUntil(this.destroy$))
1852
1966
  .subscribe(filtered => (this.filteredOptions = filtered));
1853
1967
  // Emit searchChange after debounce so parents can drive async option lists
1854
1968
  this.searchControl.valueChanges
@@ -2535,7 +2649,7 @@ class TranslateWrapperService {
2535
2649
  this.translateService = translateService;
2536
2650
  }
2537
2651
  get(translation, count, params) {
2538
- return this.translateService.stream(translation, params).pipe(map$1(v => {
2652
+ return this.translateService.stream(translation, params).pipe(map(v => {
2539
2653
  if (v.includes('|')) {
2540
2654
  return v.split('|')[count && count > 1 ? 1 : 0].trim();
2541
2655
  }
@@ -2760,7 +2874,7 @@ class CustomTableComponent {
2760
2874
  this.applyFilterByColumn();
2761
2875
  }
2762
2876
  this.filterByColumnFormGroup.valueChanges
2763
- .pipe(debounceTime(400), map(formValue => {
2877
+ .pipe(debounceTime(400), map$1(formValue => {
2764
2878
  return Object.entries(formValue)
2765
2879
  .filter(([_key, value]) => !this.isEmptyFilterValue(value))
2766
2880
  .reduce((acc, [key, value]) => {
@@ -7326,7 +7440,7 @@ function withUdComponentsTranslations(appLoader) {
7326
7440
  return {
7327
7441
  getTranslation(lang) {
7328
7442
  const base = udComponentsTranslationsFor(lang);
7329
- return appLoader.getTranslation(lang).pipe(map(appTranslations => mergeDeep(base, appTranslations ?? {})));
7443
+ return appLoader.getTranslation(lang).pipe(map$1(appTranslations => mergeDeep(base, appTranslations ?? {})));
7330
7444
  },
7331
7445
  };
7332
7446
  }
@@ -7434,5 +7548,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
7434
7548
  * Generated bundle index. Do not edit.
7435
7549
  */
7436
7550
 
7437
- export { ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
7551
+ export { AppShellComponent, ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SIDENAV_LOGO, SIDENAV_LOGO_COLLAPSED, SafePipe, SidenavComponent, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, activeNavRoute, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
7438
7552
  //# sourceMappingURL=ud-components.mjs.map