@thalassic/ui 22.13.0 → 22.14.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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, Component, Injectable, makeEnvironmentProviders, contentChild, forwardRef, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked, TemplateRef, provideEnvironmentInitializer, PLATFORM_ID, DOCUMENT } from '@angular/core';
2
+ import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild, Component, Injectable, makeEnvironmentProviders, forwardRef, PLATFORM_ID, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked, TemplateRef, provideEnvironmentInitializer, DOCUMENT } from '@angular/core';
3
3
  import { Overlay } from '@angular/cdk/overlay';
4
4
  import { TemplatePortal, ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
5
5
  import { takeUntilDestroyed, rxResource, toSignal, toObservable } from '@angular/core/rxjs-interop';
@@ -8,7 +8,7 @@ import { Router, ActivatedRoute, RouterLink, NavigationStart, RouterLinkActive }
8
8
  import { NgComponentOutlet, NgTemplateOutlet, LocationStrategy, isPlatformBrowser } from '@angular/common';
9
9
  import { HttpClient } from '@angular/common/http';
10
10
  import { DomSanitizer } from '@angular/platform-browser';
11
- import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, format, startOfDay, isBefore, isAfter, isToday, differenceInCalendarDays, isSameMonth, addHours, differenceInMinutes, isSameDay, isSameWeek, addMonths, addWeeks, subMonths, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
11
+ import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, format, startOfDay, isBefore, isAfter, isSameDay, differenceInCalendarDays, isSameMonth, addHours, differenceInMinutes, isSameWeek, addMonths, addWeeks, subMonths, isToday, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
12
12
  import { Grid, GridRow, GridCell } from '@angular/aria/grid';
13
13
  import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
14
14
  import { filter as filter$1 } from 'rxjs/operators';
@@ -284,11 +284,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
284
284
  type: Directive
285
285
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }] } });
286
286
 
287
+ // Upper bound for how long to keep a detached pane alive so the panel's
288
+ // `animate.leave` can finish. Disposal happens on `animationend`; the timeout
289
+ // only fires when no exit animation runs (e.g. the `none` motion level).
290
+ const LEAVE_ANIMATION_FALLBACK_MS$1 = 500;
291
+ /**
292
+ * Disposes a detached overlay once the panel's exit animation has finished, so
293
+ * the pane is not torn down while `animate.leave` is still playing. Falls back
294
+ * to a timeout when no animation runs (e.g. the `none` motion level).
295
+ *
296
+ * Shared by every surface that detaches a pane to let the exit animation play
297
+ * (connected overlays, confirm, tooltip).
298
+ */
299
+ function disposeAfterLeaveAnimation(overlayRef) {
300
+ const paneElement = overlayRef.overlayElement;
301
+ if (!paneElement) {
302
+ overlayRef.dispose();
303
+ return;
304
+ }
305
+ let settled = false;
306
+ const finalize = () => {
307
+ if (settled)
308
+ return;
309
+ settled = true;
310
+ window.clearTimeout(timeoutId);
311
+ paneElement.removeEventListener('animationend', finalize);
312
+ overlayRef.dispose();
313
+ };
314
+ paneElement.addEventListener('animationend', finalize);
315
+ const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$1);
316
+ }
317
+
287
318
  const TRANSPARENT_BACKDROP_CLASS = 'cdk-overlay-transparent-backdrop';
288
- // Upper bound for how long to keep a non-reused pane alive after detach so the
289
- // panel's `animate.leave` can finish. Disposes on `animationend`; this only
290
- // fires when no exit animation runs (e.g. the `none` motion level).
291
- const LEAVE_ANIMATION_FALLBACK_MS$3 = 500;
292
319
  /**
293
320
  * Owns the CDK-Overlay lifecycle shared by the library's connected overlay
294
321
  * components (popover, menu, select): create/attach, dismissal wiring
@@ -362,7 +389,7 @@ class OverlayManager {
362
389
  const reuse = Boolean(config && config.reuse);
363
390
  if (!reuse) {
364
391
  this._overlayRef = null;
365
- this._disposeAfterAnimation(overlayRef);
392
+ disposeAfterLeaveAnimation(overlayRef);
366
393
  }
367
394
  }
368
395
  if (config && config.onClose)
@@ -410,29 +437,6 @@ class OverlayManager {
410
437
  .subscribe(() => this.close());
411
438
  }
412
439
  }
413
- /**
414
- * Disposes a detached overlay once the panel's exit animation has finished, so
415
- * the pane is not torn down while `animate.leave` is still playing. Falls back
416
- * to a timeout when no animation runs (e.g. the `none` motion level).
417
- */
418
- _disposeAfterAnimation(overlayRef) {
419
- const paneElement = overlayRef.overlayElement;
420
- if (!paneElement) {
421
- overlayRef.dispose();
422
- return;
423
- }
424
- let settled = false;
425
- const finalize = () => {
426
- if (settled)
427
- return;
428
- settled = true;
429
- window.clearTimeout(timeoutId);
430
- paneElement.removeEventListener('animationend', finalize);
431
- overlayRef.dispose();
432
- };
433
- paneElement.addEventListener('animationend', finalize);
434
- const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$3);
435
- }
436
440
  _dispose() {
437
441
  this._overlayRef?.dispose();
438
442
  this._overlayRef = null;
@@ -460,6 +464,14 @@ class AbstractSelect extends ValueFormControl {
460
464
  ...(ngDevMode ? [{ debugName: "triggerElement" }] : /* istanbul ignore next */ []));
461
465
  panelTemplate = viewChild('panel', /* @ts-ignore */
462
466
  ...(ngDevMode ? [{ debugName: "panelTemplate" }] : /* istanbul ignore next */ []));
467
+ /**
468
+ * Consumer template rendered inside each option button in place of the plain
469
+ * label (`<ng-template #option let-context>`). The button itself — and with it
470
+ * the option's ARIA, activation, and hover behavior — stays owned by the
471
+ * control; the template only customizes the visual content.
472
+ */
473
+ optionTemplate = contentChild('option', /* @ts-ignore */
474
+ ...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
463
475
  // Shared inputs (config-independent)
464
476
  options = input([], /* @ts-ignore */
465
477
  ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
@@ -559,7 +571,11 @@ class AbstractSelect extends ValueFormControl {
559
571
  this.open();
560
572
  }
561
573
  }
562
- onOptionHover(index, disabled) {
574
+ onOptionHover(event, index, disabled) {
575
+ // A touch "enter" is a tap in progress, not a hover; the click that follows
576
+ // commits the option, so the active index has nothing to track.
577
+ if (event.pointerType === 'touch')
578
+ return;
563
579
  if (!disabled)
564
580
  this.activeIndex.set(index);
565
581
  }
@@ -623,6 +639,20 @@ class AbstractSelect extends ValueFormControl {
623
639
  optionId(index) {
624
640
  return `${this.uniqueId}-option-${index}`;
625
641
  }
642
+ /** Context handed to the consumer's option template for the option at `index`. */
643
+ optionContext(option, index) {
644
+ return {
645
+ $implicit: {
646
+ option: option.source,
647
+ value: option.value,
648
+ label: option.label,
649
+ index,
650
+ selected: this.isOptionSelected(option),
651
+ active: index === this.activeIndex(),
652
+ disabled: option.disabled,
653
+ },
654
+ };
655
+ }
626
656
  moveActive(direction) {
627
657
  const options = this.visibleOptions();
628
658
  let next = this.activeIndex() + direction;
@@ -647,11 +677,11 @@ class AbstractSelect extends ValueFormControl {
647
677
  }
648
678
  }
649
679
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AbstractSelect, deps: null, target: i0.ɵɵFactoryTarget.Directive });
650
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.5", type: AbstractSelect, isStandalone: true, inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "triggerElement", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTemplate", first: true, predicate: ["panel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
680
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.5", type: AbstractSelect, isStandalone: true, inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "optionTemplate", first: true, predicate: ["option"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerElement", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTemplate", first: true, predicate: ["panel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
651
681
  }
652
682
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AbstractSelect, decorators: [{
653
683
  type: Directive
654
- }], propDecorators: { triggerElement: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTemplate: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
684
+ }], propDecorators: { triggerElement: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTemplate: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], optionTemplate: [{ type: i0.ContentChild, args: ['option', { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
655
685
 
656
686
  // Form control base classes
657
687
 
@@ -899,6 +929,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
899
929
  args: [{ providedIn: 'root' }]
900
930
  }] });
901
931
 
932
+ // Elements removed from fetched SVG markup: script execution, nested browsing
933
+ // contexts, and foreignObject (which can embed arbitrary HTML).
934
+ const DISALLOWED_ELEMENTS = ['script', 'foreignobject', 'iframe', 'object', 'embed', 'link', 'meta'];
935
+ // Attribute URLs must be same-document references (`#id`); anything else —
936
+ // external resources, `javascript:`, `data:` — is stripped.
937
+ const URL_ATTRIBUTES = ['href', 'xlink:href', 'src'];
902
938
  class IconService {
903
939
  _http = inject(HttpClient);
904
940
  _sanitizer = inject(DomSanitizer);
@@ -926,23 +962,59 @@ class IconService {
926
962
  const safeSvg = this._makeSafe(svg);
927
963
  return this._sanitizer.bypassSecurityTrustHtml(safeSvg);
928
964
  }
965
+ /**
966
+ * Sanitizes SVG markup by parsing it into a DOM tree and stripping dangerous
967
+ * nodes and attributes, so obfuscated markup (unquoted attributes, entity
968
+ * tricks) cannot slip through the way it could with pattern matching on the
969
+ * raw text. The cleaned tree is serialized back to markup.
970
+ *
971
+ * Without a DOM parser (server-side rendering), the markup is dropped rather
972
+ * than passed through unsanitized; the icon renders once the browser takes
973
+ * over.
974
+ */
929
975
  _makeSafe(svg) {
930
- return (svg
931
- // Remove script tags
932
- .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
933
- // Remove event handlers (onclick, onload, onmouseover, etc.)
934
- .replace(/on\w+\s*=\s*["'][^"']*["']/gi, '')
935
- // Remove external xlink:href (keep internal references starting with #)
936
- .replace(/xlink:href\s*=\s*["'](?!#)[^"']*["']/gi, '')
937
- // Remove external href in <use>, <image>, <a> tags (keep internal #refs)
938
- .replace(/href\s*=\s*["'](?!#)[^"']*["']/gi, '')
939
- // Remove data URIs with HTML content
940
- .replace(/href\s*=\s*["']data:text\/html[^"']*["']/gi, '')
941
- .replace(/src\s*=\s*["']data:text\/html[^"']*["']/gi, '')
942
- // Remove javascript: protocol
943
- .replace(/javascript:/gi, '')
944
- // Remove import statements in style
945
- .replace(/@import/gi, ''));
976
+ if (typeof DOMParser === 'undefined')
977
+ return '';
978
+ const parsed = new DOMParser().parseFromString(svg, 'image/svg+xml');
979
+ if (parsed.querySelector('parsererror'))
980
+ return '';
981
+ const root = parsed.documentElement;
982
+ this._sanitizeElement(root);
983
+ return new XMLSerializer().serializeToString(root);
984
+ }
985
+ _sanitizeElement(element) {
986
+ // Snapshot: children are removed while iterating.
987
+ for (const child of Array.from(element.children)) {
988
+ if (DISALLOWED_ELEMENTS.includes(child.localName.toLowerCase())) {
989
+ child.remove();
990
+ continue;
991
+ }
992
+ this._sanitizeElement(child);
993
+ }
994
+ for (const attribute of Array.from(element.attributes)) {
995
+ if (this._isAttributeDisallowed(attribute.name, attribute.value)) {
996
+ element.removeAttribute(attribute.name);
997
+ }
998
+ }
999
+ // `<style>` text can pull external resources; keep local rules only.
1000
+ if (element.localName.toLowerCase() === 'style' && element.textContent) {
1001
+ element.textContent = element.textContent
1002
+ .replace(/@import[^;]*;?/gi, '')
1003
+ .replace(/url\s*\(\s*(?!\s*["']?#)[^)]*\)/gi, 'none');
1004
+ }
1005
+ }
1006
+ _isAttributeDisallowed(name, value) {
1007
+ const attributeName = name.toLowerCase();
1008
+ // Event handlers (onclick, onload, …) regardless of quoting or casing.
1009
+ if (attributeName.startsWith('on'))
1010
+ return true;
1011
+ // URL-bearing attributes may only reference into the same document.
1012
+ if (URL_ATTRIBUTES.includes(attributeName))
1013
+ return !value.trim().startsWith('#');
1014
+ // Inline style may not pull external resources.
1015
+ if (attributeName === 'style')
1016
+ return /url\s*\(\s*(?!\s*["']?#)/i.test(value) || /@import/i.test(value);
1017
+ return false;
946
1018
  }
947
1019
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
948
1020
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, providedIn: 'root' });
@@ -1455,6 +1527,25 @@ const buildOverlayPositions = (position, offset) => {
1455
1527
  }));
1456
1528
  };
1457
1529
 
1530
+ /**
1531
+ * A signal of the current time, refreshed every `intervalMs` (browser only), so
1532
+ * time-dependent computed's — a current-time indicator, a "today" highlight —
1533
+ * stay correct while the view is left open instead of freezing at first render.
1534
+ *
1535
+ * Must be called from an injection context (a field initializer or
1536
+ * constructor); the refresh interval is cleared when that context is destroyed.
1537
+ * On the server the signal holds the construction time and never ticks.
1538
+ */
1539
+ const createNowSignal = (intervalMs) => {
1540
+ const now = signal(new Date(), /* @ts-ignore */
1541
+ ...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
1542
+ if (isPlatformBrowser(inject(PLATFORM_ID))) {
1543
+ const handle = setInterval(() => now.set(new Date()), intervalMs);
1544
+ inject(DestroyRef).onDestroy(() => clearInterval(handle));
1545
+ }
1546
+ return now.asReadonly();
1547
+ };
1548
+
1458
1549
  /** Escapes RegExp metacharacters so the string matches literally inside a pattern. */
1459
1550
  const escapeRegularExpression = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1460
1551
 
@@ -1490,6 +1581,8 @@ const HOUR_LABEL_FORMAT = 'h a';
1490
1581
  const AGENDA_WEEKDAY_FORMAT = 'EEEE';
1491
1582
  /** `date-fns` format token for an agenda day's date, e.g. "Jul 22". */
1492
1583
  const AGENDA_DATE_FORMAT = 'MMM d';
1584
+ /** How often the calendar's notion of "now" refreshes (current-time line, today highlight). */
1585
+ const NOW_REFRESH_INTERVAL_MS = 60_000;
1493
1586
  /** Views that prefix an event chip with its start time; the month grid shows the title alone. */
1494
1587
  const TIME_AWARE_VIEWS = ['week', 'day', 'agenda'];
1495
1588
  /** View switcher order; labels are resolved from the calendar config for localization. */
@@ -1623,16 +1716,19 @@ class CalendarAgendaView {
1623
1716
  // State
1624
1717
  noEventsLabel = this._config.labels.noEvents;
1625
1718
  _dateOptions = localeFormatOptions(this._locale);
1719
+ /** Ticking current time, so the today marker tracks the clock across midnight. */
1720
+ _now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
1626
1721
  // Computed
1627
1722
  days = computed(() => {
1628
1723
  const activeDate = this.activeDate();
1629
1724
  const events = this.events();
1725
+ const now = this._now();
1630
1726
  return eachDayOfInterval({ start: startOfMonth(activeDate), end: endOfMonth(activeDate) })
1631
1727
  .map(date => ({
1632
1728
  date,
1633
1729
  weekday: format(date, AGENDA_WEEKDAY_FORMAT, this._dateOptions),
1634
1730
  dateLabel: format(date, AGENDA_DATE_FORMAT, this._dateOptions),
1635
- isToday: isToday(date),
1731
+ isToday: isSameDay(date, now),
1636
1732
  events: eventsForDay(date, events),
1637
1733
  }))
1638
1734
  .filter(day => day.events.length > 0);
@@ -1734,6 +1830,8 @@ class CalendarMonthView {
1734
1830
  eventSelect = output();
1735
1831
  // State
1736
1832
  _dateOptions = localeFormatOptions(this._locale);
1833
+ /** Ticking current time, so the today highlight tracks the clock across midnight. */
1834
+ _now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
1737
1835
  // Computed
1738
1836
  weekdayHeaders = computed(() => rotateWeekDays(this.weekDays(), this.weekStartsOn()), /* @ts-ignore */
1739
1837
  ...(ngDevMode ? [{ debugName: "weekdayHeaders" }] : /* istanbul ignore next */ []));
@@ -1741,6 +1839,7 @@ class CalendarMonthView {
1741
1839
  const activeDate = this.activeDate();
1742
1840
  const maxLanes = this.maxEventsPerDay();
1743
1841
  const events = this.events();
1842
+ const now = this._now();
1744
1843
  // A fixed 6-week window keeps the grid height from reflowing between months.
1745
1844
  const days = buildMonthDays(activeDate, this.weekStartsOn(), MONTH_GRID_ROWS);
1746
1845
  const weeks = [];
@@ -1769,7 +1868,7 @@ class CalendarMonthView {
1769
1868
  date,
1770
1869
  dayNumber: format(date, DAY_NUMBER_FORMAT, this._dateOptions),
1771
1870
  inCurrentMonth: isSameMonth(date, activeDate),
1772
- isToday: isToday(date),
1871
+ isToday: isSameDay(date, now),
1773
1872
  hiddenCount: hiddenPerColumn[column],
1774
1873
  }));
1775
1874
  weeks.push({ days: cells, bars });
@@ -1878,6 +1977,8 @@ class CalendarTimeGrid {
1878
1977
  hourHeight = HOUR_HEIGHT;
1879
1978
  allDayLabel = this._config.labels.allDay;
1880
1979
  _dateOptions = localeFormatOptions(this._locale);
1980
+ /** Ticking current time, so the now line and today highlight track the clock. */
1981
+ _now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
1881
1982
  // Computed
1882
1983
  hours = computed(() => {
1883
1984
  const hours = [];
@@ -1890,13 +1991,14 @@ class CalendarTimeGrid {
1890
1991
  const events = this.events();
1891
1992
  const hourStart = this.hourStart();
1892
1993
  const hourEnd = this.hourEnd();
1994
+ const now = this._now();
1893
1995
  return this.days().map(day => {
1894
1996
  const dayStart = startOfDay(day);
1895
1997
  const windowStart = addHours(dayStart, hourStart);
1896
1998
  const windowEnd = addHours(dayStart, hourEnd);
1897
1999
  const dayEvents = events.filter(event => eventCoversDay(event, dayStart));
1898
2000
  const allDayEvents = dayEvents.filter(event => this._isAllDay(event));
1899
- const timed = dayEvents.filter(event => !this._isAllDay(event));
2001
+ const timed = dayEvents.filter(event => !this._isAllDay(event) && this._overlapsWindow(event, windowStart, windowEnd));
1900
2002
  const timedEvents = assignEventLanes(timed).map(laid => {
1901
2003
  const start = this._clamp(laid.event.start, windowStart, windowEnd);
1902
2004
  const end = this._clamp(laid.event.end ?? laid.event.start, windowStart, windowEnd);
@@ -1908,15 +2010,15 @@ class CalendarTimeGrid {
1908
2010
  height: Math.max(MIN_EVENT_HEIGHT, differenceInMinutes(end, start) * PX_PER_MINUTE),
1909
2011
  };
1910
2012
  });
1911
- return { date: day, isToday: isToday(day), heading: format(day, TIME_GRID_HEADING_FORMAT, this._dateOptions), allDayEvents, timedEvents };
2013
+ return { date: day, isToday: isSameDay(day, now), heading: format(day, TIME_GRID_HEADING_FORMAT, this._dateOptions), allDayEvents, timedEvents };
1912
2014
  });
1913
2015
  }, /* @ts-ignore */
1914
2016
  ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
1915
2017
  /** Vertical offset (px) of the current-time line, or null when now is off-screen. */
1916
2018
  nowOffset = computed(() => {
1917
- if (!this.days().some(day => isToday(day)))
2019
+ const now = this._now();
2020
+ if (!this.days().some(day => isSameDay(day, now)))
1918
2021
  return null;
1919
- const now = new Date();
1920
2022
  const dayStart = startOfDay(now);
1921
2023
  const windowStart = addHours(dayStart, this.hourStart());
1922
2024
  const windowEnd = addHours(dayStart, this.hourEnd());
@@ -1939,6 +2041,19 @@ class CalendarTimeGrid {
1939
2041
  _isAllDay(event) {
1940
2042
  return event.allDay === true || !isSameDay(event.start, event.end ?? event.start);
1941
2043
  }
2044
+ /**
2045
+ * Whether the event has any visible span inside the rendered hour window.
2046
+ * Events entirely before `hourStart` or after `hourEnd` are excluded — clamping
2047
+ * them would paint a zero-length sliver pinned to the window edge. An instant
2048
+ * (zero-duration) event counts while its start sits inside the window.
2049
+ */
2050
+ _overlapsWindow(event, windowStart, windowEnd) {
2051
+ const start = event.start;
2052
+ const end = event.end ?? event.start;
2053
+ if (end.getTime() === start.getTime())
2054
+ return start >= windowStart && start < windowEnd;
2055
+ return end > windowStart && start < windowEnd;
2056
+ }
1942
2057
  _clamp(date, min, max) {
1943
2058
  return new Date(Math.min(Math.max(date.getTime(), min.getTime()), max.getTime()));
1944
2059
  }
@@ -1994,6 +2109,8 @@ class Calendar {
1994
2109
  eventTemplate = contentChild('eventTemplate', /* @ts-ignore */
1995
2110
  ...(ngDevMode ? [{ debugName: "eventTemplate" }] : /* istanbul ignore next */ []));
1996
2111
  _dateOptions = localeFormatOptions(this._locale);
2112
+ /** Ticking current time, so the "Today" affordance stays correct across midnight. */
2113
+ _now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
1997
2114
  // Computed
1998
2115
  hostClasses = computed(() => [
1999
2116
  'tls-calendar',
@@ -2003,7 +2120,7 @@ class Calendar {
2003
2120
  /** Whether the active period already includes today, so "Today" would be a no-op. */
2004
2121
  isViewingToday = computed(() => {
2005
2122
  const activeDate = this.activeDate();
2006
- const now = new Date();
2123
+ const now = this._now();
2007
2124
  switch (this.view()) {
2008
2125
  case 'week':
2009
2126
  return isSameWeek(activeDate, now, { weekStartsOn: this.weekStartsOn() });
@@ -2549,10 +2666,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
2549
2666
  }]
2550
2667
  }], propDecorators: { _templateRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], confirm: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirm", required: false }] }], cancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancel", required: false }] }], actionsAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAlign", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
2551
2668
 
2552
- // Upper bound for how long to keep a detached confirm pane alive so its
2553
- // `animate.leave` can finish. Disposes on `animationend`; this timeout only
2554
- // fires when no exit animation runs (e.g. the `none` motion level).
2555
- const LEAVE_ANIMATION_FALLBACK_MS$2 = 500;
2556
2669
  // Dimmed backdrop behind a centered modal confirm. Shared with `tls-dialog` so
2557
2670
  // the two modal surfaces render an identical scrim.
2558
2671
  const MODAL_BACKDROP_CLASS = 'tls-dialog-backdrop';
@@ -2655,22 +2768,7 @@ class ConfirmService {
2655
2768
  // then disposes the pane once that animation finishes.
2656
2769
  _dismiss(overlayRef) {
2657
2770
  overlayRef.detach();
2658
- const paneElement = overlayRef.overlayElement;
2659
- if (!paneElement) {
2660
- overlayRef.dispose();
2661
- return;
2662
- }
2663
- let settled = false;
2664
- const finalize = () => {
2665
- if (settled)
2666
- return;
2667
- settled = true;
2668
- window.clearTimeout(timeoutId);
2669
- paneElement.removeEventListener('animationend', finalize);
2670
- overlayRef.dispose();
2671
- };
2672
- paneElement.addEventListener('animationend', finalize);
2673
- const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$2);
2771
+ disposeAfterLeaveAnimation(overlayRef);
2674
2772
  }
2675
2773
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2676
2774
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, providedIn: 'root' });
@@ -2792,7 +2890,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
2792
2890
  // its slide-out (`--leave`) animation can finish before disposal. The `animationend`
2793
2891
  // listener disposes early; this fallback covers the case where no exit animation
2794
2892
  // runs (e.g. the `none` motion level, where nothing is emitted).
2795
- const LEAVE_ANIMATION_FALLBACK_MS$1 = 500;
2893
+ const LEAVE_ANIMATION_FALLBACK_MS = 500;
2796
2894
  // Named size tokens, used to tell a preset apart from a custom CSS-length string.
2797
2895
  const DRAWER_NAMED_SIZES = ['sm', 'md', 'lg', 'full'];
2798
2896
 
@@ -2884,7 +2982,7 @@ class Drawer extends CdkDialogContainer {
2884
2982
  };
2885
2983
  element.addEventListener('animationend', onAnimationEnd);
2886
2984
  // Safety net if `animationend` never arrives (e.g. the pane is torn down early).
2887
- const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$1);
2985
+ const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
2888
2986
  // The `--leave` class applies on the next change detection; on the following
2889
2987
  // frame, close at once if no animation is running. When motion is enabled the
2890
2988
  // computed `animationName` is never `none`, so this cannot finalize early.
@@ -3092,6 +3190,12 @@ const DEFAULT_FORM_ITEM_ERROR_MESSAGES = {
3092
3190
  },
3093
3191
  pattern: () => 'Invalid format',
3094
3192
  };
3193
+ /**
3194
+ * Message rendered for a validation error whose `kind` has no entry in the
3195
+ * configured {@link ErrorMessageMap} and that carries no `message` of its own
3196
+ * (e.g. a custom validator).
3197
+ */
3198
+ const DEFAULT_FORM_ITEM_UNKNOWN_ERROR_MESSAGE = () => 'Invalid value';
3095
3199
 
3096
3200
  const DEFAULT_FORM_ITEM_CONFIG = {
3097
3201
  reserveErrorSpace: true,
@@ -3099,6 +3203,7 @@ const DEFAULT_FORM_ITEM_CONFIG = {
3099
3203
  displayErrors: true,
3100
3204
  showRequiredMarker: true,
3101
3205
  errorMessages: DEFAULT_FORM_ITEM_ERROR_MESSAGES,
3206
+ unknownErrorMessage: DEFAULT_FORM_ITEM_UNKNOWN_ERROR_MESSAGE,
3102
3207
  };
3103
3208
 
3104
3209
  const FORM_ITEM_CONFIG = new InjectionToken('FORM_ITEM_CONFIG', {
@@ -3223,10 +3328,14 @@ class FormItem {
3223
3328
  _getErrorMessages(errors) {
3224
3329
  const array = [];
3225
3330
  for (const error of errors) {
3226
- if (error.message)
3331
+ if (error.message) {
3227
3332
  array.push(error.message);
3228
- else
3229
- array.push(this._config.errorMessages[error.kind](error.fieldTree));
3333
+ continue;
3334
+ }
3335
+ // A custom validator's kind may have no configured message; fall back to
3336
+ // the generic one rather than failing on the missing entry.
3337
+ const messageFunction = this._config.errorMessages[error.kind] ?? this._config.unknownErrorMessage;
3338
+ array.push(messageFunction(error.fieldTree));
3230
3339
  }
3231
3340
  return array;
3232
3341
  }
@@ -3387,6 +3496,9 @@ class Autocomplete extends AbstractSelect {
3387
3496
  this.value.set(option.value);
3388
3497
  this.close();
3389
3498
  }
3499
+ isOptionSelected(option) {
3500
+ return option.value === this.value();
3501
+ }
3390
3502
  onInput(event) {
3391
3503
  const target = event.target;
3392
3504
  this.query.set(target.value);
@@ -3466,13 +3578,13 @@ class Autocomplete extends AbstractSelect {
3466
3578
  this.select(option);
3467
3579
  }
3468
3580
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Autocomplete, deps: null, target: i0.ɵɵFactoryTarget.Component });
3469
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Autocomplete, isStandalone: true, selector: "tls-autocomplete", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Autocomplete) }], usesInheritance: true, ngImport: i0, template: "<input\n #trigger\n type=\"text\"\n class=\"tls-autocomplete__trigger\"\n role=\"combobox\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [attr.aria-expanded]=\"isOpen()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [value]=\"query()\"\n (input)=\"onInput($event)\"\n (click)=\"open()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n/>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-autocomplete__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-autocomplete__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-autocomplete__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-autocomplete__panel\"\n animate.enter=\"tls-autocomplete__panel--enter\"\n animate.leave=\"tls-autocomplete__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-autocomplete__option\"\n [class.tls-autocomplete__option--selected]=\"option.value === value()\"\n [class.tls-autocomplete__option--active]=\"index === activeIndex()\"\n [class.tls-autocomplete__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-autocomplete__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >{{ option.label }}\n </button>\n </li>\n } @empty {\n <li class=\"tls-autocomplete__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }] });
3581
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Autocomplete, isStandalone: true, selector: "tls-autocomplete", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "filterMode", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Autocomplete) }], usesInheritance: true, ngImport: i0, template: "<input\n #trigger\n type=\"text\"\n class=\"tls-autocomplete__trigger\"\n role=\"combobox\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [attr.aria-expanded]=\"isOpen()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [value]=\"query()\"\n (input)=\"onInput($event)\"\n (click)=\"open()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n/>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-autocomplete__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-autocomplete__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-autocomplete__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-autocomplete__panel\"\n animate.enter=\"tls-autocomplete__panel--enter\"\n animate.leave=\"tls-autocomplete__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-autocomplete__option\"\n [class.tls-autocomplete__option--selected]=\"option.value === value()\"\n [class.tls-autocomplete__option--active]=\"index === activeIndex()\"\n [class.tls-autocomplete__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-autocomplete__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n </li>\n } @empty {\n <li class=\"tls-autocomplete__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
3470
3582
  }
3471
3583
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Autocomplete, decorators: [{
3472
3584
  type: Component,
3473
- args: [{ selector: 'tls-autocomplete', imports: [Loader, Icon], host: {
3585
+ args: [{ selector: 'tls-autocomplete', imports: [Loader, Icon, NgTemplateOutlet], host: {
3474
3586
  '[class]': 'hostClasses()',
3475
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Autocomplete) }], template: "<input\n #trigger\n type=\"text\"\n class=\"tls-autocomplete__trigger\"\n role=\"combobox\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [attr.aria-expanded]=\"isOpen()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [value]=\"query()\"\n (input)=\"onInput($event)\"\n (click)=\"open()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n/>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-autocomplete__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-autocomplete__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-autocomplete__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-autocomplete__panel\"\n animate.enter=\"tls-autocomplete__panel--enter\"\n animate.leave=\"tls-autocomplete__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-autocomplete__option\"\n [class.tls-autocomplete__option--selected]=\"option.value === value()\"\n [class.tls-autocomplete__option--active]=\"index === activeIndex()\"\n [class.tls-autocomplete__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-autocomplete__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >{{ option.label }}\n </button>\n </li>\n } @empty {\n <li class=\"tls-autocomplete__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\n }\n </ul>\n</ng-template>\n" }]
3587
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Autocomplete) }], template: "<input\n #trigger\n type=\"text\"\n class=\"tls-autocomplete__trigger\"\n role=\"combobox\"\n autocomplete=\"off\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [attr.aria-expanded]=\"isOpen()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [value]=\"query()\"\n (input)=\"onInput($event)\"\n (click)=\"open()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n/>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-autocomplete__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-autocomplete__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-autocomplete__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-autocomplete__panel\"\n animate.enter=\"tls-autocomplete__panel--enter\"\n animate.leave=\"tls-autocomplete__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-autocomplete__option\"\n [class.tls-autocomplete__option--selected]=\"option.value === value()\"\n [class.tls-autocomplete__option--active]=\"index === activeIndex()\"\n [class.tls-autocomplete__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-autocomplete__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n </li>\n } @empty {\n <li class=\"tls-autocomplete__empty\" role=\"presentation\">{{ emptyMessage() }}</li>\n }\n </ul>\n</ng-template>\n" }]
3476
3588
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterMode", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }] } });
3477
3589
 
3478
3590
  const DEFAULT_CHECKBOX_CONFIG = {};
@@ -3500,9 +3612,19 @@ class Checkbox extends CheckboxFormControl {
3500
3612
  }, /* @ts-ignore */
3501
3613
  ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
3502
3614
  // Protected methods
3503
- toggle() {
3504
- if (this.notInteractive())
3615
+ toggle(event) {
3616
+ if (this.notInteractive()) {
3617
+ // Keep the native input from flipping its own checked state.
3618
+ if (event)
3619
+ event.preventDefault();
3620
+ return;
3621
+ }
3622
+ // Activating an indeterminate checkbox resolves it to checked.
3623
+ if (this.indeterminate()) {
3624
+ this.indeterminate.set(false);
3625
+ this.checked.set(true);
3505
3626
  return;
3627
+ }
3506
3628
  this.checked.update(prev => !prev);
3507
3629
  }
3508
3630
  onKeyboardToggle(event) {
@@ -3510,15 +3632,13 @@ class Checkbox extends CheckboxFormControl {
3510
3632
  this.toggle();
3511
3633
  }
3512
3634
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Checkbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
3513
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Checkbox, isStandalone: true, selector: "tls-checkbox", inputs: { indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { indeterminate: "indeterminateChange", checked: "checkedChange" }, host: { attributes: { "role": "checkbox" }, properties: { "class": "hostClasses()", "tabindex": "-1" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Checkbox) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<tls-icon\n class=\"tls-checkbox-icon\"\n [name]=\"indeterminate() ? 'indeterminate' : 'check'\"\n aria-hidden=\"true\"\n/>\n", dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }] });
3635
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Checkbox, isStandalone: true, selector: "tls-checkbox", inputs: { indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { indeterminate: "indeterminateChange", checked: "checkedChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Checkbox) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n (click)=\"toggle($event)\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<tls-icon\n class=\"tls-checkbox-icon\"\n [name]=\"indeterminate() ? 'indeterminate' : 'check'\"\n aria-hidden=\"true\"\n/>\n", dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }] });
3514
3636
  }
3515
3637
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Checkbox, decorators: [{
3516
3638
  type: Component,
3517
3639
  args: [{ selector: 'tls-checkbox', imports: [Icon], host: {
3518
- role: 'checkbox',
3519
3640
  '[class]': 'hostClasses()',
3520
- '[tabindex]': '-1',
3521
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Checkbox) }], template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<tls-icon\n class=\"tls-checkbox-icon\"\n [name]=\"indeterminate() ? 'indeterminate' : 'check'\"\n aria-hidden=\"true\"\n/>\n" }]
3641
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Checkbox) }], template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n (click)=\"toggle($event)\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<tls-icon\n class=\"tls-checkbox-icon\"\n [name]=\"indeterminate() ? 'indeterminate' : 'check'\"\n aria-hidden=\"true\"\n/>\n" }]
3522
3642
  }], propDecorators: { indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
3523
3643
 
3524
3644
  const DEFAULT_POPOVER_CONFIG = {
@@ -3605,6 +3725,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
3605
3725
  }], propDecorators: { _templateRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
3606
3726
 
3607
3727
  class DatePickerCalendar {
3728
+ // Injections
3729
+ _locale = inject(LOCALE_CONFIG);
3730
+ _dateOptions = localeFormatOptions(this._locale);
3608
3731
  // Inputs
3609
3732
  viewDate = input.required(/* @ts-ignore */
3610
3733
  ...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
@@ -3621,7 +3744,7 @@ class DatePickerCalendar {
3621
3744
  // Computed
3622
3745
  displayedWeekDays = computed(() => rotateWeekDays(this.weekDays(), this.weekStartsOn()), /* @ts-ignore */
3623
3746
  ...(ngDevMode ? [{ debugName: "displayedWeekDays" }] : /* istanbul ignore next */ []));
3624
- headerLabel = computed(() => format(this.viewDate(), 'MMMM yyyy'), /* @ts-ignore */
3747
+ headerLabel = computed(() => format(this.viewDate(), 'MMMM yyyy', this._dateOptions), /* @ts-ignore */
3625
3748
  ...(ngDevMode ? [{ debugName: "headerLabel" }] : /* istanbul ignore next */ []));
3626
3749
  days = computed(() => buildMonthDays(this.viewDate(), this.weekStartsOn()), /* @ts-ignore */
3627
3750
  ...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
@@ -3633,7 +3756,7 @@ class DatePickerCalendar {
3633
3756
  this.viewDateChange.emit(addMonths(this.viewDate(), 1));
3634
3757
  }
3635
3758
  getDayLabel(day) {
3636
- return format(day, 'd');
3759
+ return format(day, 'd', this._dateOptions);
3637
3760
  }
3638
3761
  isSelectedDay(day) {
3639
3762
  const selected = this.selectedDate();
@@ -3667,6 +3790,9 @@ const DATE_TIME_PICKER_CONFIG = new InjectionToken('DATE_TIME_PICKER_CONFIG', {
3667
3790
 
3668
3791
  const MONTH_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
3669
3792
  class MonthPicker {
3793
+ // Injections
3794
+ _locale = inject(LOCALE_CONFIG);
3795
+ _dateOptions = localeFormatOptions(this._locale);
3670
3796
  // Inputs
3671
3797
  viewDate = input.required(/* @ts-ignore */
3672
3798
  ...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
@@ -3678,11 +3804,11 @@ class MonthPicker {
3678
3804
  navigateUp = output();
3679
3805
  // Computed
3680
3806
  months = MONTH_INDEXES;
3681
- yearLabel = computed(() => format(this.viewDate(), 'yyyy'), /* @ts-ignore */
3807
+ yearLabel = computed(() => format(this.viewDate(), 'yyyy', this._dateOptions), /* @ts-ignore */
3682
3808
  ...(ngDevMode ? [{ debugName: "yearLabel" }] : /* istanbul ignore next */ []));
3683
3809
  // Protected methods
3684
3810
  getMonthLabel(monthIndex) {
3685
- return format(setMonth(new Date(2000, 0, 1), monthIndex), 'MMM');
3811
+ return format(setMonth(new Date(2000, 0, 1), monthIndex), 'MMM', this._dateOptions);
3686
3812
  }
3687
3813
  prevYear() {
3688
3814
  this.viewDateChange.emit(subYears(this.viewDate(), 1));
@@ -3808,6 +3934,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
3808
3934
  class DateTimePicker extends ValueFormControl {
3809
3935
  // Injections
3810
3936
  config = inject(DATE_TIME_PICKER_CONFIG);
3937
+ _locale = inject(LOCALE_CONFIG);
3938
+ _dateOptions = localeFormatOptions(this._locale);
3811
3939
  // View children
3812
3940
  popoverComponent = viewChild('popoverRef', /* @ts-ignore */
3813
3941
  ...(ngDevMode ? [{ debugName: "popoverComponent" }] : /* istanbul ignore next */ []));
@@ -3851,14 +3979,14 @@ class DateTimePicker extends ValueFormControl {
3851
3979
  return this.placeholder();
3852
3980
  const mode = this.mode();
3853
3981
  if (mode === 'calendar')
3854
- return format(value, 'MMM d, yyyy');
3982
+ return format(value, 'MMM d, yyyy', this._dateOptions);
3855
3983
  if (mode === 'month-picker')
3856
- return format(value, 'MMMM yyyy');
3984
+ return format(value, 'MMMM yyyy', this._dateOptions);
3857
3985
  if (mode === 'year-picker')
3858
- return format(value, 'yyyy');
3986
+ return format(value, 'yyyy', this._dateOptions);
3859
3987
  if (mode === 'time-picker')
3860
- return format(value, 'HH:mm');
3861
- return format(value, 'MMM d, yyyy HH:mm');
3988
+ return format(value, 'HH:mm', this._dateOptions);
3989
+ return format(value, 'MMM d, yyyy HH:mm', this._dateOptions);
3862
3990
  }, /* @ts-ignore */
3863
3991
  ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
3864
3992
  constructor() {
@@ -4089,6 +4217,10 @@ const DEFAULT_FILE_INPUT_CONFIG = {
4089
4217
  accept: '',
4090
4218
  fluid: false,
4091
4219
  hideFileList: false,
4220
+ chooseFileLabel: 'Choose file',
4221
+ chooseFilesLabel: 'Choose files',
4222
+ dropZoneFileLabel: 'Upload file',
4223
+ dropZoneFilesLabel: 'Upload files',
4092
4224
  };
4093
4225
 
4094
4226
  const FILE_INPUT_CONFIG = new InjectionToken('FILE_INPUT_CONFIG', {
@@ -4117,6 +4249,8 @@ class FileInput extends ValueFormControl {
4117
4249
  nativeInput = viewChild.required('nativeInput');
4118
4250
  dragState = signal('idle', /* @ts-ignore */
4119
4251
  ...(ngDevMode ? [{ debugName: "dragState" }] : /* istanbul ignore next */ []));
4252
+ /** Nesting depth of the active drag: dragenter/dragleave pairs fired by the drop zone's children. */
4253
+ _dragDepth = 0;
4120
4254
  dropZoneTemplate = contentChild('dropZone', /* @ts-ignore */
4121
4255
  ...(ngDevMode ? [{ debugName: "dropZoneTemplate" }] : /* istanbul ignore next */ []));
4122
4256
  fileTemplate = contentChild('file', /* @ts-ignore */
@@ -4130,8 +4264,16 @@ class FileInput extends ValueFormControl {
4130
4264
  return array.concat(this.controlClasses());
4131
4265
  }, /* @ts-ignore */
4132
4266
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
4133
- triggerLabel = computed(() => this.multiple() ? 'Choose files' : 'Choose file', /* @ts-ignore */
4267
+ triggerLabel = computed(() => this.multiple() ? this._config.chooseFilesLabel : this._config.chooseFileLabel, /* @ts-ignore */
4134
4268
  ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
4269
+ /** Accessible name for the drop zone: the consumer's, or the configured fallback. */
4270
+ dropZoneLabel = computed(() => {
4271
+ const consumerLabel = this.ariaLabel();
4272
+ if (consumerLabel)
4273
+ return consumerLabel;
4274
+ return this.multiple() ? this._config.dropZoneFilesLabel : this._config.dropZoneFileLabel;
4275
+ }, /* @ts-ignore */
4276
+ ...(ngDevMode ? [{ debugName: "dropZoneLabel" }] : /* istanbul ignore next */ []));
4135
4277
  acceptHint = computed(() => {
4136
4278
  const accept = this.accept().trim();
4137
4279
  if (!accept)
@@ -4163,6 +4305,9 @@ class FileInput extends ValueFormControl {
4163
4305
  event.preventDefault();
4164
4306
  this.openFilePicker();
4165
4307
  }
4308
+ onDragEnter() {
4309
+ this._dragDepth++;
4310
+ }
4166
4311
  onDragOver(event) {
4167
4312
  event.preventDefault();
4168
4313
  if (this.notInteractive() || !event.dataTransfer)
@@ -4172,11 +4317,16 @@ class FileInput extends ValueFormControl {
4172
4317
  event.dataTransfer.dropEffect = rejected ? 'none' : 'copy';
4173
4318
  this.dragState.set(rejected ? 'invalid' : 'valid');
4174
4319
  }
4320
+ // `dragleave` also fires when the pointer crosses onto a child of the drop
4321
+ // zone; only a leave that balances every enter means the drag actually left.
4175
4322
  onDragLeave() {
4176
- this.dragState.set('idle');
4323
+ this._dragDepth = Math.max(0, this._dragDepth - 1);
4324
+ if (this._dragDepth === 0)
4325
+ this.dragState.set('idle');
4177
4326
  }
4178
4327
  onDrop(event) {
4179
4328
  event.preventDefault();
4329
+ this._dragDepth = 0;
4180
4330
  this.dragState.set('idle');
4181
4331
  if (this.notInteractive() || !event.dataTransfer)
4182
4332
  return;
@@ -4253,11 +4403,11 @@ class FileInput extends ValueFormControl {
4253
4403
  return !matches;
4254
4404
  }
4255
4405
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FileInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
4256
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: FileInput, isStandalone: true, selector: "tls-file-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, hideFileList: { classPropertyName: "hideFileList", publicName: "hideFileList", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileInput) }], queries: [{ propertyName: "dropZoneTemplate", first: true, predicate: ["dropZone"], descendants: true, isSignal: true }, { propertyName: "fileTemplate", first: true, predicate: ["file"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "nativeInput", first: true, predicate: ["nativeInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n #nativeInput\n class=\"tls-file-input__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n@if (variant() === 'button') {\n <button\n type=\"button\"\n tlsButton\n variant=\"outlined\"\n [size]=\"size()\"\n [disabled]=\"notInteractive()\"\n [attr.disabled]=\"notInteractive() ? '' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"openFilePicker()\"\n >\n {{ triggerLabel() }}\n </button>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n} @else {\n <div\n class=\"tls-file-input__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() ?? (multiple() ? 'Upload files' : 'Upload file')\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-input__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-input__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-input__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n >\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-input__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n </div>\n}\n@if (value().length && !hideFileList()) {\n <ul class=\"tls-file-input__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-input__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-input__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-input__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ButtonDirective, selector: "[tlsButton]" }] });
4406
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: FileInput, isStandalone: true, selector: "tls-file-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, hideFileList: { classPropertyName: "hideFileList", publicName: "hideFileList", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileInput) }], queries: [{ propertyName: "dropZoneTemplate", first: true, predicate: ["dropZone"], descendants: true, isSignal: true }, { propertyName: "fileTemplate", first: true, predicate: ["file"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "nativeInput", first: true, predicate: ["nativeInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n #nativeInput\n class=\"tls-file-input__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n@if (variant() === 'button') {\n <button\n type=\"button\"\n tlsButton\n variant=\"outlined\"\n [size]=\"size()\"\n [disabled]=\"notInteractive()\"\n [attr.disabled]=\"notInteractive() ? '' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"openFilePicker()\"\n >\n {{ triggerLabel() }}\n </button>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n} @else {\n <div\n class=\"tls-file-input__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"dropZoneLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-input__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-input__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-input__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragenter)=\"onDragEnter()\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n >\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-input__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n </div>\n}\n@if (value().length && !hideFileList()) {\n <ul class=\"tls-file-input__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-input__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-input__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-input__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ButtonDirective, selector: "[tlsButton]" }] });
4257
4407
  }
4258
4408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FileInput, decorators: [{
4259
4409
  type: Component,
4260
- args: [{ selector: 'tls-file-input', imports: [NgTemplateOutlet, ButtonDirective], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileInput) }], host: { '[class]': 'classes()' }, template: "<input\n #nativeInput\n class=\"tls-file-input__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n@if (variant() === 'button') {\n <button\n type=\"button\"\n tlsButton\n variant=\"outlined\"\n [size]=\"size()\"\n [disabled]=\"notInteractive()\"\n [attr.disabled]=\"notInteractive() ? '' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"openFilePicker()\"\n >\n {{ triggerLabel() }}\n </button>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n} @else {\n <div\n class=\"tls-file-input__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() ?? (multiple() ? 'Upload files' : 'Upload file')\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-input__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-input__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-input__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n >\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-input__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n </div>\n}\n@if (value().length && !hideFileList()) {\n <ul class=\"tls-file-input__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-input__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-input__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-input__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n" }]
4410
+ args: [{ selector: 'tls-file-input', imports: [NgTemplateOutlet, ButtonDirective], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileInput) }], host: { '[class]': 'classes()' }, template: "<input\n #nativeInput\n class=\"tls-file-input__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n@if (variant() === 'button') {\n <button\n type=\"button\"\n tlsButton\n variant=\"outlined\"\n [size]=\"size()\"\n [disabled]=\"notInteractive()\"\n [attr.disabled]=\"notInteractive() ? '' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n (click)=\"openFilePicker()\"\n >\n {{ triggerLabel() }}\n </button>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n} @else {\n <div\n class=\"tls-file-input__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"dropZoneLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-input__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-input__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-input__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragenter)=\"onDragEnter()\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n >\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-input__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-input__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n </div>\n}\n@if (value().length && !hideFileList()) {\n <ul class=\"tls-file-input__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-input__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-input__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-input__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n" }]
4261
4411
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], hideFileList: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFileList", required: false }] }], nativeInput: [{ type: i0.ViewChild, args: ['nativeInput', { isSignal: true }] }], dropZoneTemplate: [{ type: i0.ContentChild, args: ['dropZone', { isSignal: true }] }], fileTemplate: [{ type: i0.ContentChild, args: ['file', { isSignal: true }] }] } });
4262
4412
 
4263
4413
  const DEFAULT_INPUT_CONFIG = {
@@ -4381,12 +4531,33 @@ class InputNumber extends ValueFormControl {
4381
4531
  const parsed = target.valueAsNumber;
4382
4532
  this.value.set(isNaN(parsed) ? null : parsed);
4383
4533
  }
4534
+ /**
4535
+ * Clamps a typed value into `[min, max]` once editing is committed (`change`
4536
+ * fires on blur/Enter). The spinner arrows already honor the bounds natively;
4537
+ * clamping only here keeps mid-typing values ("1" on the way to "10") intact.
4538
+ */
4539
+ onChange(event) {
4540
+ const current = this.value();
4541
+ if (current === null)
4542
+ return;
4543
+ const min = this.min();
4544
+ const max = this.max();
4545
+ let clamped = current;
4546
+ if (min !== undefined && clamped < min)
4547
+ clamped = min;
4548
+ if (max !== undefined && clamped > max)
4549
+ clamped = max;
4550
+ if (clamped === current)
4551
+ return;
4552
+ this.value.set(clamped);
4553
+ event.target.value = String(clamped);
4554
+ }
4384
4555
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputNumber, deps: null, target: i0.ɵɵFactoryTarget.Component });
4385
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: InputNumber, isStandalone: true, selector: "tls-input-number", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hideArrows: { classPropertyName: "hideArrows", publicName: "hideArrows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => InputNumber) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"number\"\n [name]=\"name()\"\n [class]=\"classes()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value() ?? ''\"\n [attr.min]=\"min() ?? null\"\n [attr.max]=\"max() ?? null\"\n [step]=\"step()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n/>\n@if (pending()) {\n <tls-loader class=\"tls-form-control__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n", styles: [":host{--tls-input-number-width: 200px;position:relative;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host .tls-form-control__spinner{position:absolute;inset-block:0;inset-inline-end:var(--spacing-3);margin-block:auto;pointer-events:none}:host .tls-form-control--pending{padding-inline-end:var(--spacing-8)}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"], dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
4556
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: InputNumber, isStandalone: true, selector: "tls-input-number", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hideArrows: { classPropertyName: "hideArrows", publicName: "hideArrows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => InputNumber) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"number\"\n [name]=\"name()\"\n [class]=\"classes()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value() ?? ''\"\n [attr.min]=\"min() ?? null\"\n [attr.max]=\"max() ?? null\"\n [step]=\"step()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (blur)=\"touched.set(true)\"\n/>\n@if (pending()) {\n <tls-loader class=\"tls-form-control__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n", styles: [":host{--tls-input-number-width: 200px;position:relative;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host .tls-form-control__spinner{position:absolute;inset-block:0;inset-inline-end:var(--spacing-3);margin-block:auto;pointer-events:none}:host .tls-form-control--pending{padding-inline-end:var(--spacing-8)}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"], dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
4386
4557
  }
4387
4558
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputNumber, decorators: [{
4388
4559
  type: Component,
4389
- args: [{ selector: 'tls-input-number', imports: [Loader], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => InputNumber) }], template: "<input\n type=\"number\"\n [name]=\"name()\"\n [class]=\"classes()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value() ?? ''\"\n [attr.min]=\"min() ?? null\"\n [attr.max]=\"max() ?? null\"\n [step]=\"step()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n/>\n@if (pending()) {\n <tls-loader class=\"tls-form-control__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n", styles: [":host{--tls-input-number-width: 200px;position:relative;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host .tls-form-control__spinner{position:absolute;inset-block:0;inset-inline-end:var(--spacing-3);margin-block:auto;pointer-events:none}:host .tls-form-control--pending{padding-inline-end:var(--spacing-8)}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"] }]
4560
+ args: [{ selector: 'tls-input-number', imports: [Loader], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => InputNumber) }], template: "<input\n type=\"number\"\n [name]=\"name()\"\n [class]=\"classes()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value() ?? ''\"\n [attr.min]=\"min() ?? null\"\n [attr.max]=\"max() ?? null\"\n [step]=\"step()\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (blur)=\"touched.set(true)\"\n/>\n@if (pending()) {\n <tls-loader class=\"tls-form-control__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n", styles: [":host{--tls-input-number-width: 200px;position:relative;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host .tls-form-control__spinner{position:absolute;inset-block:0;inset-inline-end:var(--spacing-3);margin-block:auto;pointer-events:none}:host .tls-form-control--pending{padding-inline-end:var(--spacing-8)}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"] }]
4390
4561
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hideArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideArrows", required: false }] }] } });
4391
4562
 
4392
4563
  // Token characters recognised inside a mask pattern; every other character is a
@@ -4620,13 +4791,13 @@ class Password extends ValueFormControl {
4620
4791
  this.visible.update(prev => !prev);
4621
4792
  }
4622
4793
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, deps: null, target: i0.ɵɵFactoryTarget.Component });
4623
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Password, isStandalone: true, selector: "tls-password", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", visible: "visibleChange" }, host: { classAttribute: "tls-password" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], queries: [{ propertyName: "startIconTemplate", first: true, predicate: ["startIcon"], descendants: true, isSignal: true }, { propertyName: "showIconTemplate", first: true, predicate: ["showIcon"], descendants: true, isSignal: true }, { propertyName: "hideIconTemplate", first: true, predicate: ["hideIcon"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<tls-form-control-group [size]=\"size()\" [fluid]=\"fluid()\">\n @if (startIconTemplate(); as icon) {\n <span class=\"tls-form-control-addon\" aria-hidden=\"true\">\n <ng-container [ngTemplateOutlet]=\"icon\" />\n </span>\n }\n <input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (pending()) {\n <tls-loader class=\"tls-form-control-addon\" size=\"xs\" aria-hidden=\"true\" />\n }\n <button\n class=\"tls-password-toggle tls-form-control-addon\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel()\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">{{ showLabel }}</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">{{ hideLabel }}</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n", dependencies: [{ kind: "component", type: FormControlGroup, selector: "tls-form-control-group", inputs: ["size", "fluid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
4794
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Password, isStandalone: true, selector: "tls-password", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", visible: "visibleChange" }, host: { classAttribute: "tls-password" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], queries: [{ propertyName: "startIconTemplate", first: true, predicate: ["startIcon"], descendants: true, isSignal: true }, { propertyName: "showIconTemplate", first: true, predicate: ["showIcon"], descendants: true, isSignal: true }, { propertyName: "hideIconTemplate", first: true, predicate: ["hideIcon"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<tls-form-control-group [size]=\"size()\" [fluid]=\"fluid()\">\n @if (startIconTemplate(); as icon) {\n <span class=\"tls-form-control-addon\" aria-hidden=\"true\">\n <ng-container [ngTemplateOutlet]=\"icon\" />\n </span>\n }\n <input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (pending()) {\n <tls-loader class=\"tls-form-control-addon\" size=\"xs\" aria-hidden=\"true\" />\n }\n <button\n class=\"tls-password-toggle tls-form-control-addon\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel()\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n {{ showLabel }}\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n {{ hideLabel }}\n }\n </span>\n </button>\n</tls-form-control-group>\n", dependencies: [{ kind: "component", type: FormControlGroup, selector: "tls-form-control-group", inputs: ["size", "fluid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
4624
4795
  }
4625
4796
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, decorators: [{
4626
4797
  type: Component,
4627
4798
  args: [{ selector: 'tls-password', imports: [FormControlGroup, NgTemplateOutlet, Loader], host: {
4628
4799
  class: 'tls-password',
4629
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], template: "<tls-form-control-group [size]=\"size()\" [fluid]=\"fluid()\">\n @if (startIconTemplate(); as icon) {\n <span class=\"tls-form-control-addon\" aria-hidden=\"true\">\n <ng-container [ngTemplateOutlet]=\"icon\" />\n </span>\n }\n <input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (pending()) {\n <tls-loader class=\"tls-form-control-addon\" size=\"xs\" aria-hidden=\"true\" />\n }\n <button\n class=\"tls-password-toggle tls-form-control-addon\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel()\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">{{ showLabel }}</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">{{ hideLabel }}</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n" }]
4800
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], template: "<tls-form-control-group [size]=\"size()\" [fluid]=\"fluid()\">\n @if (startIconTemplate(); as icon) {\n <span class=\"tls-form-control-addon\" aria-hidden=\"true\">\n <ng-container [ngTemplateOutlet]=\"icon\" />\n </span>\n }\n <input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (pending()) {\n <tls-loader class=\"tls-form-control-addon\" size=\"xs\" aria-hidden=\"true\" />\n }\n <button\n class=\"tls-password-toggle tls-form-control-addon\"\n type=\"button\"\n [attr.aria-label]=\"toggleAriaLabel()\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n {{ showLabel }}\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n {{ hideLabel }}\n }\n </span>\n </button>\n</tls-form-control-group>\n" }]
4630
4801
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], startIconTemplate: [{ type: i0.ContentChild, args: ['startIcon', { isSignal: true }] }], showIconTemplate: [{ type: i0.ContentChild, args: ['showIcon', { isSignal: true }] }], hideIconTemplate: [{ type: i0.ContentChild, args: ['hideIcon', { isSignal: true }] }] } });
4631
4802
 
4632
4803
  // Matches strings containing only numeric digits (0–9).
@@ -4711,22 +4882,28 @@ class PinInput extends ValueFormControl {
4711
4882
  }
4712
4883
  onPaste(event, index) {
4713
4884
  event.preventDefault();
4885
+ if (this.notInteractive())
4886
+ return;
4714
4887
  const clipboardData = event.clipboardData;
4715
4888
  if (!clipboardData)
4716
4889
  return;
4717
- const text = clipboardData.getData('text');
4890
+ // Keep only the characters the input accepts, so text copied with
4891
+ // separators ("123 456", "123-456") pastes as its usable digits.
4718
4892
  const allowedRegExp = this._getAllowedRegularExpression();
4719
- if (!allowedRegExp.test(text))
4720
- return;
4721
- const chars = text.slice(0, this.length() - this.value().length).split('');
4893
+ const chars = clipboardData
4894
+ .getData('text')
4895
+ .split('')
4896
+ .filter(char => allowedRegExp.test(char))
4897
+ .slice(0, this.length() - index);
4722
4898
  if (!chars.length)
4723
4899
  return;
4900
+ // Overwrite from the focused cell onward.
4724
4901
  const array = this._getValueArray();
4725
- for (let i = 0; i < chars.length; i++) {
4726
- array[index + i] = chars[i];
4902
+ for (let offset = 0; offset < chars.length; offset++) {
4903
+ array[index + offset] = chars[offset];
4727
4904
  }
4728
4905
  this._commitArray(array);
4729
- this._focusCell(Math.min(this.value().length, this.length()));
4906
+ this._focusCell(index + chars.length);
4730
4907
  }
4731
4908
  onFocus(event) {
4732
4909
  event.target.select();
@@ -4784,6 +4961,12 @@ const RADIO_BUTTON_CONFIG = new InjectionToken('RADIO_BUTTON_CONFIG', {
4784
4961
  factory: () => DEFAULT_RADIO_BUTTON_CONFIG,
4785
4962
  });
4786
4963
 
4964
+ /**
4965
+ * A single radio option bound to a shared `value` model; the option whose
4966
+ * `radioValue` equals the model is checked. When several radio buttons form one
4967
+ * group, wrap each in its own `tls-form-item` (the item's label names that
4968
+ * option), rather than one item around the whole group.
4969
+ */
4787
4970
  class RadioButton extends ValueFormControl {
4788
4971
  _config = inject(RADIO_BUTTON_CONFIG);
4789
4972
  CLASS_NAME = 'tls-radio-button';
@@ -4811,14 +4994,14 @@ class RadioButton extends ValueFormControl {
4811
4994
  this.value.set(this.radioValue());
4812
4995
  }
4813
4996
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
4814
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: RadioButton, isStandalone: true, selector: "tls-radio-button", inputs: { radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()", "tabindex": "-1" } }, usesInheritance: true, ngImport: i0, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [value]=\"radioValue()\"\n (change)=\"check()\"\n (blur)=\"touched.set(true)\"\n/>\n<div class=\"tls-radio-button-circle\"></div>\n" });
4997
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: RadioButton, isStandalone: true, selector: "tls-radio-button", inputs: { radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()", "tabindex": "-1" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => RadioButton) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [value]=\"radioValue()\"\n (change)=\"check()\"\n (blur)=\"touched.set(true)\"\n/>\n<div class=\"tls-radio-button-circle\"></div>\n" });
4815
4998
  }
4816
4999
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioButton, decorators: [{
4817
5000
  type: Component,
4818
5001
  args: [{ selector: 'tls-radio-button', imports: [], host: {
4819
5002
  '[class]': 'hostClasses()',
4820
5003
  '[tabindex]': '-1',
4821
- }, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [value]=\"radioValue()\"\n (change)=\"check()\"\n (blur)=\"touched.set(true)\"\n/>\n<div class=\"tls-radio-button-circle\"></div>\n" }]
5004
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => RadioButton) }], template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [value]=\"radioValue()\"\n (change)=\"check()\"\n (blur)=\"touched.set(true)\"\n/>\n<div class=\"tls-radio-button-circle\"></div>\n" }]
4822
5005
  }], propDecorators: { radioValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "radioValue", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
4823
5006
 
4824
5007
  const DEFAULT_MULTI_SELECT_CONFIG = {
@@ -4828,6 +5011,7 @@ const DEFAULT_MULTI_SELECT_CONFIG = {
4828
5011
  clearable: false,
4829
5012
  maxLabels: 2,
4830
5013
  clearLabel: 'Clear',
5014
+ selectedCountLabel: count => `${count} selected`,
4831
5015
  };
4832
5016
 
4833
5017
  const MULTI_SELECT_CONFIG = new InjectionToken('MULTI_SELECT_CONFIG', {
@@ -4863,7 +5047,7 @@ class MultiSelect extends AbstractSelect {
4863
5047
  return '';
4864
5048
  const max = this.maxLabels();
4865
5049
  if (selected.length > max)
4866
- return `${selected.length} selected`;
5050
+ return this._config.selectedCountLabel(selected.length);
4867
5051
  const optionMap = new Map(this.normalizedOptions().map(option => [option.value, option.label]));
4868
5052
  return selected.map(value => optionMap.get(value) ?? String(value)).join(', ');
4869
5053
  }, /* @ts-ignore */
@@ -4871,6 +5055,9 @@ class MultiSelect extends AbstractSelect {
4871
5055
  isSelected(option) {
4872
5056
  return this.selectedValues().has(option.value);
4873
5057
  }
5058
+ isOptionSelected(option) {
5059
+ return this.isSelected(option);
5060
+ }
4874
5061
  toggleOption(option) {
4875
5062
  if (option.disabled)
4876
5063
  return;
@@ -4896,13 +5083,13 @@ class MultiSelect extends AbstractSelect {
4896
5083
  this.toggleOption(option);
4897
5084
  }
4898
5085
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MultiSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
4899
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: MultiSelect, isStandalone: true, selector: "tls-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, maxLabels: { classPropertyName: "maxLabels", publicName: "maxLabels", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-multi-select__value\" [class.tls-form-control__placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholder() }}\n </span>\n <div class=\"tls-multi-select__icon\" aria-hidden=\"true\" [class.tls-multi-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-multi-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-multi-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-multi-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-multi-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-multi-select__panel\"\n animate.enter=\"tls-multi-select__panel--enter\"\n animate.leave=\"tls-multi-select__panel--leave\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-multi-select__option\"\n [class.tls-multi-select__option--selected]=\"isSelected(option)\"\n [class.tls-multi-select__option--active]=\"index === activeIndex()\"\n [class.tls-multi-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-multi-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"toggleOption(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >\n <span class=\"tls-multi-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option)) {\n <tls-icon class=\"tls-multi-select__option-check\" name=\"check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }] });
5086
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: MultiSelect, isStandalone: true, selector: "tls-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, maxLabels: { classPropertyName: "maxLabels", publicName: "maxLabels", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-multi-select__value\" [class.tls-form-control__placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholder() }}\n </span>\n <div class=\"tls-multi-select__icon\" aria-hidden=\"true\" [class.tls-multi-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-multi-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-multi-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-multi-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-multi-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-multi-select__panel\"\n animate.enter=\"tls-multi-select__panel--enter\"\n animate.leave=\"tls-multi-select__panel--leave\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-multi-select__option\"\n [class.tls-multi-select__option--selected]=\"isSelected(option)\"\n [class.tls-multi-select__option--active]=\"index === activeIndex()\"\n [class.tls-multi-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-multi-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"toggleOption(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n <span class=\"tls-multi-select__option-label\">\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </span>\n @if (isSelected(option)) {\n <tls-icon class=\"tls-multi-select__option-check\" name=\"check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
4900
5087
  }
4901
5088
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MultiSelect, decorators: [{
4902
5089
  type: Component,
4903
- args: [{ selector: 'tls-multi-select', imports: [Loader, Icon], host: {
5090
+ args: [{ selector: 'tls-multi-select', imports: [Loader, Icon, NgTemplateOutlet], host: {
4904
5091
  '[class]': 'hostClasses()',
4905
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-multi-select__value\" [class.tls-form-control__placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholder() }}\n </span>\n <div class=\"tls-multi-select__icon\" aria-hidden=\"true\" [class.tls-multi-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-multi-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-multi-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-multi-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-multi-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-multi-select__panel\"\n animate.enter=\"tls-multi-select__panel--enter\"\n animate.leave=\"tls-multi-select__panel--leave\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-multi-select__option\"\n [class.tls-multi-select__option--selected]=\"isSelected(option)\"\n [class.tls-multi-select__option--active]=\"index === activeIndex()\"\n [class.tls-multi-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-multi-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"toggleOption(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >\n <span class=\"tls-multi-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option)) {\n <tls-icon class=\"tls-multi-select__option-check\" name=\"check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" }]
5092
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-multi-select__value\" [class.tls-form-control__placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholder() }}\n </span>\n <div class=\"tls-multi-select__icon\" aria-hidden=\"true\" [class.tls-multi-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-multi-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-multi-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-multi-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-multi-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-multi-select__panel\"\n animate.enter=\"tls-multi-select__panel--enter\"\n animate.leave=\"tls-multi-select__panel--leave\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-multi-select__option\"\n [class.tls-multi-select__option--selected]=\"isSelected(option)\"\n [class.tls-multi-select__option--active]=\"index === activeIndex()\"\n [class.tls-multi-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-multi-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"toggleOption(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n <span class=\"tls-multi-select__option-label\">\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </span>\n @if (isSelected(option)) {\n <tls-icon class=\"tls-multi-select__option-check\" name=\"check\" aria-hidden=\"true\" />\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" }]
4906
5093
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], maxLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLabels", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }] } });
4907
5094
 
4908
5095
  const DEFAULT_SELECT_CONFIG = {
@@ -4954,23 +5141,32 @@ class Select extends AbstractSelect {
4954
5141
  this.value.set(option.value);
4955
5142
  this.close();
4956
5143
  }
5144
+ isOptionSelected(option) {
5145
+ return option.value === this.value();
5146
+ }
4957
5147
  clear() {
4958
5148
  this.value.set(null);
4959
5149
  }
4960
5150
  getInitialActiveIndex() {
4961
- return this.visibleOptions().findIndex(option => option.value === this.value());
5151
+ const options = this.visibleOptions();
5152
+ const selectedIndex = options.findIndex(option => !option.disabled && option.value === this.value());
5153
+ if (selectedIndex !== -1)
5154
+ return selectedIndex;
5155
+ // No selection: start on the first enabled option, matching the other
5156
+ // listbox controls, so the panel opens with a visible active option.
5157
+ return options.findIndex(option => !option.disabled);
4962
5158
  }
4963
5159
  commitActiveOption(option) {
4964
5160
  this.select(option);
4965
5161
  }
4966
5162
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Select, deps: null, target: i0.ɵɵFactoryTarget.Component });
4967
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Select, isStandalone: true, selector: "tls-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-select__value\" [class.tls-form-control__placeholder]=\"!selectedLabel()\">\n {{ selectedLabel() || placeholder() }}\n </span>\n <div class=\"tls-select__icon\" aria-hidden=\"true\" [class.tls-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-select__panel\"\n animate.enter=\"tls-select__panel--enter\"\n animate.leave=\"tls-select__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-select__option\"\n [class.tls-select__option--selected]=\"option.value === value()\"\n [class.tls-select__option--active]=\"index === activeIndex()\"\n [class.tls-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >{{ option.label }}\n </button>\n </li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }] });
5163
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Select, isStandalone: true, selector: "tls-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, clearLabel: { classPropertyName: "clearLabel", publicName: "clearLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-select__value\" [class.tls-form-control__placeholder]=\"!selectedLabel()\">\n {{ selectedLabel() || placeholder() }}\n </span>\n <div class=\"tls-select__icon\" aria-hidden=\"true\" [class.tls-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-select__panel\"\n animate.enter=\"tls-select__panel--enter\"\n animate.leave=\"tls-select__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-select__option\"\n [class.tls-select__option--selected]=\"option.value === value()\"\n [class.tls-select__option--active]=\"index === activeIndex()\"\n [class.tls-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n", dependencies: [{ kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
4968
5164
  }
4969
5165
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Select, decorators: [{
4970
5166
  type: Component,
4971
- args: [{ selector: 'tls-select', imports: [Loader, Icon], host: {
5167
+ args: [{ selector: 'tls-select', imports: [Loader, Icon, NgTemplateOutlet], host: {
4972
5168
  '[class]': 'hostClasses()',
4973
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-select__value\" [class.tls-form-control__placeholder]=\"!selectedLabel()\">\n {{ selectedLabel() || placeholder() }}\n </span>\n <div class=\"tls-select__icon\" aria-hidden=\"true\" [class.tls-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-select__panel\"\n animate.enter=\"tls-select__panel--enter\"\n animate.leave=\"tls-select__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-select__option\"\n [class.tls-select__option--selected]=\"option.value === value()\"\n [class.tls-select__option--active]=\"index === activeIndex()\"\n [class.tls-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >{{ option.label }}\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" }]
5169
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-busy]=\"pending() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-select__value\" [class.tls-form-control__placeholder]=\"!selectedLabel()\">\n {{ selectedLabel() || placeholder() }}\n </span>\n <div class=\"tls-select__icon\" aria-hidden=\"true\" [class.tls-select__icon--hidden]=\"pending()\">\n <tls-icon class=\"tls-select__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-select__clear\"\n tabindex=\"-1\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear()\"\n >\n <tls-icon class=\"tls-select__clear-icon\" name=\"close\" aria-hidden=\"true\" />\n </button>\n}\n@if (pending()) {\n <tls-loader class=\"tls-select__spinner\" size=\"xs\" aria-hidden=\"true\" />\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-select__panel\"\n animate.enter=\"tls-select__panel--enter\"\n animate.leave=\"tls-select__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of visibleOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-select__option\"\n [class.tls-select__option--selected]=\"option.value === value()\"\n [class.tls-select__option--active]=\"index === activeIndex()\"\n [class.tls-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (pointerenter)=\"onOptionHover($event, index, option.disabled)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" }]
4974
5170
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], clearLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabel", required: false }] }] } });
4975
5171
 
4976
5172
  const DEFAULT_SWITCH_CONFIG = {
@@ -4999,9 +5195,13 @@ class Switch extends CheckboxFormControl {
4999
5195
  }, /* @ts-ignore */
5000
5196
  ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
5001
5197
  // Protected methods
5002
- toggle() {
5003
- if (this.notInteractive())
5198
+ toggle(event) {
5199
+ if (this.notInteractive()) {
5200
+ // Keep the native input from flipping its own checked state.
5201
+ if (event)
5202
+ event.preventDefault();
5004
5203
  return;
5204
+ }
5005
5205
  this.checked.update(prev => !prev);
5006
5206
  }
5007
5207
  onKeyboardToggle(event) {
@@ -5009,22 +5209,14 @@ class Switch extends CheckboxFormControl {
5009
5209
  this.toggle();
5010
5210
  }
5011
5211
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
5012
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "role": "switch" }, listeners: { "click": "toggle()", "blur": "touched.set(true)", "keydown.space": "onKeyboardToggle($event)", "keydown.enter": "onKeyboardToggle($event)" }, properties: { "class": "hostClasses()", "tabindex": "disabled() ? -1 : tabindex()", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled()", "attr.aria-readonly": "readonly()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"tls-switch-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" });
5212
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { listeners: { "click": "toggle($event)" }, properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n role=\"switch\"\n class=\"tls-switch-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (blur)=\"touched.set(true)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" });
5013
5213
  }
5014
5214
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, decorators: [{
5015
5215
  type: Component,
5016
5216
  args: [{ selector: 'tls-switch', host: {
5017
- role: 'switch',
5018
5217
  '[class]': 'hostClasses()',
5019
- '[tabindex]': 'disabled() ? -1 : tabindex()',
5020
- '[attr.aria-checked]': 'checked()',
5021
- '[attr.aria-disabled]': 'disabled()',
5022
- '[attr.aria-readonly]': 'readonly()',
5023
- '(click)': 'toggle()',
5024
- '(blur)': 'touched.set(true)',
5025
- '(keydown.space)': 'onKeyboardToggle($event)',
5026
- '(keydown.enter)': 'onKeyboardToggle($event)',
5027
- }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], template: "<input\n type=\"checkbox\"\n class=\"tls-switch-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" }]
5218
+ '(click)': 'toggle($event)',
5219
+ }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], template: "<input\n type=\"checkbox\"\n role=\"switch\"\n class=\"tls-switch-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (blur)=\"touched.set(true)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" }]
5028
5220
  }], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
5029
5221
 
5030
5222
  const DEFAULT_TEXTAREA_CONFIG = {
@@ -5956,13 +6148,29 @@ class Pagination {
5956
6148
  labels = this._config.labels;
5957
6149
  pageCount = computed(() => Math.ceil(this.total() / this.pageSize()), /* @ts-ignore */
5958
6150
  ...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
6151
+ /** Last valid page; at least 1 so the current page never leaves the 1-based range. */
6152
+ lastValidPage = computed(() => Math.max(1, this.pageCount()), /* @ts-ignore */
6153
+ ...(ngDevMode ? [{ debugName: "lastValidPage" }] : /* istanbul ignore next */ []));
5959
6154
  visiblePages = computed(() => this._buildPages(this.pageCount(), this.value(), this.siblings(), this.boundaries()), /* @ts-ignore */
5960
6155
  ...(ngDevMode ? [{ debugName: "visiblePages" }] : /* istanbul ignore next */ []));
5961
6156
  classes = computed(() => ['tls-pagination', `tls-pagination--${this.size()}`], /* @ts-ignore */
5962
6157
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
6158
+ constructor() {
6159
+ // Normalize an out-of-range page — a shrinking `total`, or an external set
6160
+ // (e.g. a query-param restore) beyond the last page — back into range. While
6161
+ // `total` is 0 the range is unknown (it usually arrives async), so a
6162
+ // restored page is left alone rather than clamped against nothing.
6163
+ effect(() => {
6164
+ if (this.pageCount() < 1)
6165
+ return;
6166
+ const clamped = this._clamp(this.value());
6167
+ if (clamped !== this.value())
6168
+ this.value.set(clamped);
6169
+ });
6170
+ }
5963
6171
  // Protected methods
5964
6172
  setPage(page) {
5965
- this.value.set(page);
6173
+ this.value.set(this._clamp(page));
5966
6174
  }
5967
6175
  firstPage() {
5968
6176
  this.value.set(1);
@@ -5971,12 +6179,15 @@ class Pagination {
5971
6179
  this.value.update(page => Math.max(1, page - 1));
5972
6180
  }
5973
6181
  nextPage() {
5974
- this.value.update(page => Math.min(this.pageCount(), page + 1));
6182
+ this.value.update(page => Math.min(this.lastValidPage(), page + 1));
5975
6183
  }
5976
6184
  lastPage() {
5977
- this.value.set(this.pageCount());
6185
+ this.value.set(this.lastValidPage());
5978
6186
  }
5979
6187
  // Private methods
6188
+ _clamp(page) {
6189
+ return Math.min(Math.max(1, page), this.lastValidPage());
6190
+ }
5980
6191
  /** Returns an inclusive array of integers from start to end. Returns [] if end < start. */
5981
6192
  _range(start, end) {
5982
6193
  const length = end - start + 1;
@@ -6022,7 +6233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
6022
6233
  '[attr.aria-label]': 'ariaLabelledby() ? null : ariaLabel()',
6023
6234
  '[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
6024
6235
  }, template: "@if (showFirstButton()) {\n <button\n id=\"tls-pagination-first\"\n class=\"tls-pagination__button\"\n [attr.aria-label]=\"labels.first\"\n [disabled]=\"value() === 1\"\n (click)=\"firstPage()\"\n >\n <span class=\"tls-pagination__button-icon\">\n <tls-icon name=\"chevrons-left\" aria-hidden=\"true\" />\n </span>\n </button>\n}\n\n<button\n id=\"tls-pagination-prev\"\n class=\"tls-pagination__button\"\n [attr.aria-label]=\"labels.previous\"\n [disabled]=\"value() === 1\"\n (click)=\"prevPage()\"\n>\n <span class=\"tls-pagination__button-icon\">\n <tls-icon name=\"chevron-left\" aria-hidden=\"true\" />\n </span>\n</button>\n\n<ul class=\"tls-pagination__list\">\n @for (item of visiblePages(); track $index) {\n <li class=\"tls-pagination__item\">\n @if (item === 'gap') {\n <span class=\"tls-pagination__gap\">...</span>\n } @else {\n <button\n class=\"tls-pagination__item-button\"\n [class.tls-pagination__item-button--active]=\"value() === item\"\n [attr.aria-label]=\"labels.page(item)\"\n [attr.aria-current]=\"value() === item ? 'page' : null\"\n (click)=\"setPage(item)\"\n >\n {{ item }}\n </button>\n }\n </li>\n }\n</ul>\n\n<button\n id=\"tls-pagination-next\"\n class=\"tls-pagination__button\"\n [attr.aria-label]=\"labels.next\"\n [disabled]=\"value() === pageCount()\"\n (click)=\"nextPage()\"\n>\n <span class=\"tls-pagination__button-icon\">\n <tls-icon name=\"chevron-right\" aria-hidden=\"true\" />\n </span>\n</button>\n\n@if (showLastButton()) {\n <button\n id=\"tls-pagination-last\"\n class=\"tls-pagination__button\"\n [attr.aria-label]=\"labels.last\"\n [disabled]=\"value() === pageCount()\"\n (click)=\"lastPage()\"\n >\n <span class=\"tls-pagination__button-icon\">\n <tls-icon name=\"chevrons-right\" aria-hidden=\"true\" />\n </span>\n </button>\n}\n" }]
6025
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], boundaries: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundaries", required: false }] }], siblings: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblings", required: false }] }], showFirstButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstButton", required: false }] }], showLastButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLastButton", required: false }] }] } });
6236
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], boundaries: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundaries", required: false }] }], siblings: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblings", required: false }] }], showFirstButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstButton", required: false }] }], showLastButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLastButton", required: false }] }] } });
6026
6237
 
6027
6238
  const DEFAULT_PAGINATION_QUERY_SYNC_CONFIG = {
6028
6239
  paramKey: 'page',
@@ -6030,6 +6241,12 @@ const DEFAULT_PAGINATION_QUERY_SYNC_CONFIG = {
6030
6241
 
6031
6242
  const PAGINATION_QUERY_SYNC_CONFIG = new InjectionToken('PAGINATION_QUERY_SYNC_CONFIG', { factory: () => DEFAULT_PAGINATION_QUERY_SYNC_CONFIG });
6032
6243
 
6244
+ /**
6245
+ * Mirrors the current page into a URL query param. The param is only written
6246
+ * once the page actually changes — the initial page (the default, or the one
6247
+ * restored from the URL) never stamps the param, so a freshly loaded page
6248
+ * keeps its URL untouched.
6249
+ */
6033
6250
  class PaginationQuerySyncDirective extends QuerySyncDirective {
6034
6251
  _pagination = inject(Pagination);
6035
6252
  _config = inject(PAGINATION_QUERY_SYNC_CONFIG);
@@ -6037,11 +6254,23 @@ class PaginationQuerySyncDirective extends QuerySyncDirective {
6037
6254
  // The selector doubles as the input, so a valueless `tlsPaginationQuerySync` binds `''`.
6038
6255
  // Coerce an empty value back to the configured default param key.
6039
6256
  tlsPaginationQuerySync = input(this._config.paramKey, { ...(ngDevMode ? { debugName: "tlsPaginationQuerySync" } : /* istanbul ignore next */ {}), transform: (value) => value || this._config.paramKey });
6257
+ // State
6258
+ /** Last page mirrored to the URL; `null` until the initial page settles. */
6259
+ _lastSynced = null;
6040
6260
  constructor() {
6041
6261
  super();
6042
6262
  effect(() => {
6043
6263
  const page = this._pagination.value();
6044
6264
  const param = this.tlsPaginationQuerySync();
6265
+ // The first settled page is the page's initial state; recording it would
6266
+ // stamp the URL on load without any user interaction.
6267
+ if (this._lastSynced === null) {
6268
+ this._lastSynced = page;
6269
+ return;
6270
+ }
6271
+ if (page === this._lastSynced)
6272
+ return;
6273
+ this._lastSynced = page;
6045
6274
  this.syncToUrl(param, page);
6046
6275
  });
6047
6276
  }
@@ -6962,6 +7191,20 @@ class Tabs {
6962
7191
  this.selected.set(firstEnabledTab.value());
6963
7192
  });
6964
7193
  }
7194
+ // Public methods
7195
+ /**
7196
+ * Resolves serialized text (e.g. a URL query param) back to the matching
7197
+ * tab's actual value, so a numeric tab value round-trips with its own type
7198
+ * instead of a string that would never match. Returns `undefined` when no tab
7199
+ * matches — including while the projected tabs have not resolved yet, so a
7200
+ * reactive caller can retry once they have.
7201
+ */
7202
+ findTabValue(text) {
7203
+ const match = this.tabs().find(tab => String(tab.value()) === text);
7204
+ if (!match)
7205
+ return undefined;
7206
+ return match.value();
7207
+ }
6965
7208
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
6966
7209
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tabs, isStandalone: true, selector: "tls-tabs", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, headerPosition: { classPropertyName: "headerPosition", publicName: "headerPosition", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "tabs", predicate: Tab, isSignal: true }], hostDirectives: [{ directive: i1.Tabs }], ngImport: i0, template: "<ul\n ngTabList\n [class]=\"headerClasses()\"\n [orientation]=\"orientation()\"\n [softDisabled]=\"false\"\n [(selectedTab)]=\"selected\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (tab of tabs(); track tab) {\n <li\n role=\"presentation\"\n class=\"tls-tab-header__item\"\n [class.tls-tab-header__item--active]=\"ariaTab.selected()\"\n [class.tls-tab-header__item--disabled]=\"tab.disabled()\"\n >\n <button\n #ariaTab=\"ngTab\"\n ngTab\n class=\"tls-tab-header__item-control\"\n type=\"button\"\n [value]=\"tab.value()\"\n [disabled]=\"tab.disabled()\"\n [attr.aria-label]=\"tab.headerTemplateRef() ? tab.label() : null\"\n >\n @if (tab.headerTemplateRef(); as headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"headerTemplateRef\"></ng-container>\n } @else {\n {{ tab.label() }}\n }\n </button>\n </li>\n }\n</ul>\n<div class=\"tls-tabs-content\">\n @for (tab of tabs(); track tab) {\n <div ngTabPanel class=\"tls-tab\" [value]=\"tab.value()\" [preserveContent]=\"true\">\n <ng-template ngTabContent>\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplateRef()\"></ng-container>\n </ng-template>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: TabList, selector: "[ngTabList]", inputs: ["orientation", "wrap", "softDisabled", "focusMode", "selectionMode", "selectedTab", "disabled"], outputs: ["selectedTabChange"], exportAs: ["ngTabList"] }, { kind: "directive", type: Tab$1, selector: "[ngTab]", inputs: ["id", "disabled", "value"], exportAs: ["ngTab"] }, { kind: "directive", type: TabPanel, selector: "[ngTabPanel]", inputs: ["id", "value"], exportAs: ["ngTabPanel"] }, { kind: "directive", type: TabContent, selector: "ng-template[ngTabContent]", exportAs: ["ngTabContent"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
6967
7210
  }
@@ -6980,6 +7223,12 @@ const TABS_QUERY_SYNC_CONFIG = new InjectionToken('TABS_QUERY_SYNC_CONFIG', {
6980
7223
  factory: () => DEFAULT_TABS_QUERY_SYNC_CONFIG,
6981
7224
  });
6982
7225
 
7226
+ /**
7227
+ * Mirrors the selected tab into a URL query param. The param is only written
7228
+ * once the selection actually changes — the initial selection (the default
7229
+ * first tab, or the one restored from the URL) never stamps the param, so a
7230
+ * freshly loaded page keeps its URL untouched.
7231
+ */
6983
7232
  class TabsQuerySyncDirective extends QuerySyncDirective {
6984
7233
  _tabs = inject(Tabs);
6985
7234
  _config = inject(TABS_QUERY_SYNC_CONFIG);
@@ -6987,22 +7236,47 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
6987
7236
  // The selector doubles as the input, so a valueless `tlsTabsQuerySync` binds `''`.
6988
7237
  // Coerce an empty value back to the configured default param key.
6989
7238
  tlsTabsQuerySync = input(this._config.paramKey, { ...(ngDevMode ? { debugName: "tlsTabsQuerySync" } : /* istanbul ignore next */ {}), transform: (value) => value || this._config.paramKey });
7239
+ // State
7240
+ /** Param value captured once at startup, pending until a matching tab resolves. */
7241
+ _pendingRestore = null;
7242
+ _restoreRead = false;
7243
+ /** Last selection mirrored to the URL; `undefined` until the initial selection settles. */
7244
+ _lastSynced;
6990
7245
  constructor() {
6991
7246
  super();
7247
+ // Restore the selection from the URL. Tab values may be numbers, so the
7248
+ // param is matched against each tab's serialized value; projected tabs
7249
+ // resolve after init, so this retries until a match appears.
7250
+ effect(() => {
7251
+ if (!this._restoreRead) {
7252
+ this._restoreRead = true;
7253
+ this._pendingRestore = this.readParam(this.tlsTabsQuerySync());
7254
+ }
7255
+ if (this._pendingRestore === null)
7256
+ return;
7257
+ const value = this._tabs.findTabValue(this._pendingRestore);
7258
+ if (value === undefined)
7259
+ return;
7260
+ this._pendingRestore = null;
7261
+ this._tabs.selected.set(value);
7262
+ });
6992
7263
  effect(() => {
6993
7264
  const selected = this._tabs.selected();
6994
7265
  const param = this.tlsTabsQuerySync();
6995
7266
  if (selected === undefined)
6996
7267
  return;
7268
+ // The first settled selection is the page's initial state; recording it
7269
+ // would stamp the URL on load without any user interaction.
7270
+ if (this._lastSynced === undefined) {
7271
+ this._lastSynced = selected;
7272
+ return;
7273
+ }
7274
+ if (selected === this._lastSynced)
7275
+ return;
7276
+ this._lastSynced = selected;
6997
7277
  this.syncToUrl(param, selected);
6998
7278
  });
6999
7279
  }
7000
- // Lifecycle
7001
- ngOnInit() {
7002
- const value = this.readParam(this.tlsTabsQuerySync());
7003
- if (value !== null)
7004
- this._tabs.selected.set(value);
7005
- }
7006
7280
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
7007
7281
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TabsQuerySyncDirective, isStandalone: true, selector: "tls-tabs[tlsTabsQuerySync]", inputs: { tlsTabsQuerySync: { classPropertyName: "tlsTabsQuerySync", publicName: "tlsTabsQuerySync", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
7008
7282
  }
@@ -7117,11 +7391,6 @@ const TOAST_COLLAPSED_VISIBLE_DEPTH = 3;
7117
7391
  // in sync with `--spacing-3` in `_toast.scss`; it is a transform offset computed
7118
7392
  // in TypeScript, so it lives here as a number rather than a spacing token.
7119
7393
  const TOAST_EXPANDED_GAP = 12;
7120
- // Upper bound for how long to keep the outlet overlay's pane alive after a toast
7121
- // starts leaving, so Angular's `animate.leave` can finish. Disposal happens on
7122
- // `animationend`; this only fires when no exit animation runs (e.g. the `none`
7123
- // motion level).
7124
- const TOAST_LEAVE_ANIMATION_FALLBACK_MS = 500;
7125
7394
 
7126
7395
  const DEFAULT_TOAST_CONFIG = {
7127
7396
  position: 'top-end',
@@ -7296,6 +7565,7 @@ class ToastOutlet {
7296
7565
  // Injections
7297
7566
  _service = inject(ToastService);
7298
7567
  _destroyRef = inject(DestroyRef);
7568
+ _elementRef = inject(ElementRef);
7299
7569
  // State
7300
7570
  toasts = this._service.toasts;
7301
7571
  _pointerInside = signal(false, /* @ts-ignore */
@@ -7399,6 +7669,15 @@ class ToastOutlet {
7399
7669
  this._service.resume();
7400
7670
  }
7401
7671
  });
7672
+ // An emptied stack ends the interaction: without this, a touch-expanded
7673
+ // pile would still count as "interacting" when the next toast arrives,
7674
+ // freezing its auto-dismiss timer from the start.
7675
+ effect(() => {
7676
+ if (this.toasts().length > 0)
7677
+ return;
7678
+ this._pointerInside.set(false);
7679
+ this._focusInside.set(false);
7680
+ });
7402
7681
  this._destroyRef.onDestroy(() => {
7403
7682
  if (this._resizeObserver)
7404
7683
  this._resizeObserver.disconnect();
@@ -7416,7 +7695,20 @@ class ToastOutlet {
7416
7695
  onPointerEnter() {
7417
7696
  this._pointerInside.set(true);
7418
7697
  }
7419
- onPointerLeave() {
7698
+ onPointerLeave(event) {
7699
+ // A tap retires its pointer immediately, firing `pointerleave` within the
7700
+ // same gesture — collapsing here would undo the expansion the tap just
7701
+ // made. A touch-expanded pile stays open; it collapses once its toasts are
7702
+ // dismissed (or with focus, via `focusout`).
7703
+ if (event.pointerType === 'touch')
7704
+ return;
7705
+ this._pointerInside.set(false);
7706
+ }
7707
+ onDocumentPointerDown(event) {
7708
+ if (event.pointerType !== 'touch' || !this._pointerInside())
7709
+ return;
7710
+ if (this._elementRef.nativeElement.contains(event.target))
7711
+ return;
7420
7712
  this._pointerInside.set(false);
7421
7713
  }
7422
7714
  onFocusIn() {
@@ -7430,11 +7722,16 @@ class ToastOutlet {
7430
7722
  this._heights.set(this._toastElements().map(element => element.nativeElement.offsetHeight));
7431
7723
  }
7432
7724
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToastOutlet, deps: [], target: i0.ɵɵFactoryTarget.Component });
7433
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ToastOutlet, isStandalone: true, selector: "tls-toast-outlet", host: { classAttribute: "tls-toast-outlet" }, viewQueries: [{ propertyName: "_toastElements", predicate: ["toastEl"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"regionClasses()\"\n role=\"region\"\n [attr.aria-label]=\"regionLabel()\"\n [style.height.px]=\"regionHeight()\"\n (mouseenter)=\"onPointerEnter()\"\n (mouseleave)=\"onPointerLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n @for (toast of toasts(); track toast.id; let index = $index) {\n <tls-toast\n #toastEl\n [style.transform]=\"layouts()[index].transform\"\n [style.z-index]=\"layouts()[index].zIndex\"\n [style.--tls-toast-depth-opacity]=\"layouts()[index].depthOpacity\"\n [message]=\"toast.message\"\n [title]=\"toast.title\"\n [color]=\"toast.color\"\n [duration]=\"toast.duration\"\n [paused]=\"paused()\"\n [closable]=\"toast.closable\"\n [showIcon]=\"toast.showIcon\"\n [showProgress]=\"toast.showProgress\"\n [action]=\"toast.action\"\n [ariaLabel]=\"toast.ariaLabel\"\n [dismissLabel]=\"dismissLabel()\"\n (dismissed)=\"onDismiss(toast.id)\"\n (actionTriggered)=\"onAction(toast)\"\n ></tls-toast>\n }\n</div>\n", dependencies: [{ kind: "component", type: Toast, selector: "tls-toast", inputs: ["message", "title", "color", "closable", "showIcon", "showProgress", "duration", "paused", "action", "ariaLabel", "dismissLabel"], outputs: ["dismissed", "actionTriggered"] }] });
7725
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ToastOutlet, isStandalone: true, selector: "tls-toast-outlet", host: { listeners: { "document:pointerdown": "onDocumentPointerDown($event)" }, classAttribute: "tls-toast-outlet" }, viewQueries: [{ propertyName: "_toastElements", predicate: ["toastEl"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"regionClasses()\"\n role=\"region\"\n [attr.aria-label]=\"regionLabel()\"\n [style.height.px]=\"regionHeight()\"\n (pointerenter)=\"onPointerEnter()\"\n (pointerleave)=\"onPointerLeave($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n @for (toast of toasts(); track toast.id; let index = $index) {\n <tls-toast\n #toastEl\n [style.transform]=\"layouts()[index].transform\"\n [style.z-index]=\"layouts()[index].zIndex\"\n [style.--tls-toast-depth-opacity]=\"layouts()[index].depthOpacity\"\n [message]=\"toast.message\"\n [title]=\"toast.title\"\n [color]=\"toast.color\"\n [duration]=\"toast.duration\"\n [paused]=\"paused()\"\n [closable]=\"toast.closable\"\n [showIcon]=\"toast.showIcon\"\n [showProgress]=\"toast.showProgress\"\n [action]=\"toast.action\"\n [ariaLabel]=\"toast.ariaLabel\"\n [dismissLabel]=\"dismissLabel()\"\n (dismissed)=\"onDismiss(toast.id)\"\n (actionTriggered)=\"onAction(toast)\"\n ></tls-toast>\n }\n</div>\n", dependencies: [{ kind: "component", type: Toast, selector: "tls-toast", inputs: ["message", "title", "color", "closable", "showIcon", "showProgress", "duration", "paused", "action", "ariaLabel", "dismissLabel"], outputs: ["dismissed", "actionTriggered"] }] });
7434
7726
  }
7435
7727
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToastOutlet, decorators: [{
7436
7728
  type: Component,
7437
- args: [{ selector: 'tls-toast-outlet', imports: [Toast], host: { class: 'tls-toast-outlet' }, template: "<div\n [class]=\"regionClasses()\"\n role=\"region\"\n [attr.aria-label]=\"regionLabel()\"\n [style.height.px]=\"regionHeight()\"\n (mouseenter)=\"onPointerEnter()\"\n (mouseleave)=\"onPointerLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n @for (toast of toasts(); track toast.id; let index = $index) {\n <tls-toast\n #toastEl\n [style.transform]=\"layouts()[index].transform\"\n [style.z-index]=\"layouts()[index].zIndex\"\n [style.--tls-toast-depth-opacity]=\"layouts()[index].depthOpacity\"\n [message]=\"toast.message\"\n [title]=\"toast.title\"\n [color]=\"toast.color\"\n [duration]=\"toast.duration\"\n [paused]=\"paused()\"\n [closable]=\"toast.closable\"\n [showIcon]=\"toast.showIcon\"\n [showProgress]=\"toast.showProgress\"\n [action]=\"toast.action\"\n [ariaLabel]=\"toast.ariaLabel\"\n [dismissLabel]=\"dismissLabel()\"\n (dismissed)=\"onDismiss(toast.id)\"\n (actionTriggered)=\"onAction(toast)\"\n ></tls-toast>\n }\n</div>\n" }]
7729
+ args: [{ selector: 'tls-toast-outlet', imports: [Toast], host: {
7730
+ class: 'tls-toast-outlet',
7731
+ // Touch has no hover-out; a tap outside the stack is what collapses a
7732
+ // touch-expanded pile (and resumes the auto-dismiss timers).
7733
+ '(document:pointerdown)': 'onDocumentPointerDown($event)',
7734
+ }, template: "<div\n [class]=\"regionClasses()\"\n role=\"region\"\n [attr.aria-label]=\"regionLabel()\"\n [style.height.px]=\"regionHeight()\"\n (pointerenter)=\"onPointerEnter()\"\n (pointerleave)=\"onPointerLeave($event)\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut()\"\n>\n @for (toast of toasts(); track toast.id; let index = $index) {\n <tls-toast\n #toastEl\n [style.transform]=\"layouts()[index].transform\"\n [style.z-index]=\"layouts()[index].zIndex\"\n [style.--tls-toast-depth-opacity]=\"layouts()[index].depthOpacity\"\n [message]=\"toast.message\"\n [title]=\"toast.title\"\n [color]=\"toast.color\"\n [duration]=\"toast.duration\"\n [paused]=\"paused()\"\n [closable]=\"toast.closable\"\n [showIcon]=\"toast.showIcon\"\n [showProgress]=\"toast.showProgress\"\n [action]=\"toast.action\"\n [ariaLabel]=\"toast.ariaLabel\"\n [dismissLabel]=\"dismissLabel()\"\n (dismissed)=\"onDismiss(toast.id)\"\n (actionTriggered)=\"onAction(toast)\"\n ></tls-toast>\n }\n</div>\n" }]
7438
7735
  }], ctorParameters: () => [], propDecorators: { _toastElements: [{ type: i0.ViewChildren, args: ['toastEl', { ...{ read: ElementRef }, isSignal: true }] }] } });
7439
7736
 
7440
7737
  class Tooltip {
@@ -7498,11 +7795,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
7498
7795
  }]
7499
7796
  }], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }, { type: i0.Output, args: ["contentChange"] }], templateData: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateData", required: false }] }, { type: i0.Output, args: ["templateDataChange"] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: true }] }, { type: i0.Output, args: ["colorChange"] }] } });
7500
7797
 
7501
- // Upper bound for how long to keep a detached tooltip pane alive so its
7502
- // `animate.leave` can finish. Disposes on `animationend`; this timeout only
7503
- // fires when no exit animation runs (e.g. the `none` motion level).
7504
- const LEAVE_ANIMATION_FALLBACK_MS = 500;
7505
-
7506
7798
  class TooltipService {
7507
7799
  _overlay = inject(Overlay);
7508
7800
  _overlayRef = null;
@@ -7537,7 +7829,7 @@ class TooltipService {
7537
7829
  const overlayRef = this._overlayRef;
7538
7830
  this._overlayRef = null;
7539
7831
  overlayRef.detach();
7540
- this._disposeAfterAnimation(overlayRef);
7832
+ disposeAfterLeaveAnimation(overlayRef);
7541
7833
  }
7542
7834
  dispose() {
7543
7835
  if (!this._overlayRef)
@@ -7545,27 +7837,6 @@ class TooltipService {
7545
7837
  this._overlayRef.dispose();
7546
7838
  this._overlayRef = null;
7547
7839
  }
7548
- // Private methods
7549
- // Disposes a detached overlay once the tooltip's exit animation has finished.
7550
- // Falls back to a timeout when no animation runs (e.g. the `none` motion level).
7551
- _disposeAfterAnimation(overlayRef) {
7552
- const paneElement = overlayRef.overlayElement;
7553
- if (!paneElement) {
7554
- overlayRef.dispose();
7555
- return;
7556
- }
7557
- let settled = false;
7558
- const finalize = () => {
7559
- if (settled)
7560
- return;
7561
- settled = true;
7562
- window.clearTimeout(timeoutId);
7563
- paneElement.removeEventListener('animationend', finalize);
7564
- overlayRef.dispose();
7565
- };
7566
- paneElement.addEventListener('animationend', finalize);
7567
- const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
7568
- }
7569
7840
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
7570
7841
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService });
7571
7842
  }
@@ -7585,12 +7856,22 @@ const TOOLTIP_CONFIG = new InjectionToken('TOOLTIP_CONFIG', {
7585
7856
  factory: () => DEFAULT_TOOLTIP_CONFIG,
7586
7857
  });
7587
7858
 
7859
+ /**
7860
+ * Attaches a tooltip to the host element. Shows on hover and on keyboard focus,
7861
+ * toggles on touch, and dismisses on Escape without moving the pointer or focus
7862
+ * (WCAG 1.4.13). The tooltip is linked to the host via `aria-describedby` while
7863
+ * visible.
7864
+ *
7865
+ * Interaction is driven by pointer events, branching on `pointerType`: mouse
7866
+ * and pen get hover semantics, touch gets tap-to-toggle. A single stream avoids
7867
+ * the synthesized mouse events browsers replay after a tap.
7868
+ */
7588
7869
  class TooltipDirective {
7589
7870
  _tooltipService = inject(TooltipService);
7590
7871
  _elementRef = inject(ElementRef);
7591
7872
  _renderer = inject(Renderer2);
7592
7873
  _config = inject(TOOLTIP_CONFIG);
7593
- content = input('Hello', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
7874
+ content = input('', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
7594
7875
  data = input(null, /* @ts-ignore */
7595
7876
  ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
7596
7877
  tooltipDisabled = input(false, /* @ts-ignore */
@@ -7615,42 +7896,66 @@ class TooltipDirective {
7615
7896
  }, /* @ts-ignore */
7616
7897
  ...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
7617
7898
  // Protected methods
7618
- onMouseEnter(event) {
7619
- this._show(event);
7899
+ onPointerEnter(event) {
7900
+ // A touch "enter" is a tap, not a hover — toggle instead. The default is
7901
+ // not prevented, so the tap still activates an interactive host.
7902
+ if (event.pointerType === 'touch') {
7903
+ if (this._visible()) {
7904
+ this._hide();
7905
+ }
7906
+ else {
7907
+ this._show();
7908
+ }
7909
+ return;
7910
+ }
7911
+ this._show({ x: event.clientX, y: event.clientY });
7620
7912
  }
7621
- onMouseMove(event) {
7913
+ onPointerMove(event) {
7914
+ if (event.pointerType === 'touch')
7915
+ return;
7622
7916
  if (this.tooltipOrigin() === 'cursor') {
7623
7917
  this._tooltipService.move({ x: event.clientX, y: event.clientY }, this._positions());
7624
7918
  }
7625
7919
  }
7626
- onMouseLeave() {
7920
+ onPointerLeave(event) {
7921
+ // A tap retires its pointer immediately, firing `pointerleave` within the
7922
+ // same gesture; hiding here would undo the toggle the tap just made.
7923
+ if (event.pointerType === 'touch')
7924
+ return;
7627
7925
  this._hide();
7628
7926
  }
7629
- onTouchStart(event) {
7630
- event.preventDefault();
7631
- if (this._visible()) {
7927
+ onFocus() {
7928
+ // No cursor to anchor to; a focus-triggered tooltip always anchors to the element.
7929
+ this._show();
7930
+ }
7931
+ onBlur() {
7932
+ this._hide();
7933
+ }
7934
+ /** Dismisses the tooltip without moving the pointer or focus (WCAG 1.4.13). */
7935
+ onEscape() {
7936
+ if (this._visible())
7632
7937
  this._hide();
7633
- }
7634
- else {
7635
- this._show(event.touches[0]);
7636
- }
7637
7938
  }
7638
7939
  // Private methods
7639
- _show(event) {
7640
- if (this.tooltipDisabled())
7940
+ _show(point) {
7941
+ if (this.tooltipDisabled() || this._visible())
7942
+ return;
7943
+ // Nothing to render — an empty string would show a bare bubble.
7944
+ const content = this.content();
7945
+ if (content === '')
7641
7946
  return;
7642
7947
  this._visible.set(true);
7643
7948
  const tooltipPortal = new ComponentPortal(Tooltip);
7644
- const origin = this.tooltipOrigin() === 'cursor'
7645
- ? { x: event.clientX, y: event.clientY }
7646
- : this._elementRef.nativeElement;
7949
+ const origin = this.tooltipOrigin() === 'cursor' && point ? point : this._elementRef.nativeElement;
7647
7950
  const tooltipRef = this._tooltipService.show(origin, this._positions(), tooltipPortal);
7648
- tooltipRef.instance.content.set(this.content());
7951
+ tooltipRef.instance.content.set(content);
7649
7952
  tooltipRef.instance.templateData.set(this.data());
7650
7953
  tooltipRef.instance.color.set(this.tooltipColor());
7651
7954
  this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipRef.instance.id);
7652
7955
  }
7653
7956
  _hide() {
7957
+ if (!this._visible())
7958
+ return;
7654
7959
  this._tooltipService.hide();
7655
7960
  this._visible.set(false);
7656
7961
  this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
@@ -7661,7 +7966,7 @@ class TooltipDirective {
7661
7966
  this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
7662
7967
  }
7663
7968
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
7664
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDirective, isStandalone: true, selector: "[tlsTooltip]", inputs: { content: { classPropertyName: "content", publicName: "tlsTooltip", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrigin: { classPropertyName: "tooltipOrigin", publicName: "tooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, tooltipPositions: { classPropertyName: "tooltipPositions", publicName: "tooltipPositions", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, tooltipColor: { classPropertyName: "tooltipColor", publicName: "tooltipColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter($event)", "mousemove": "onMouseMove($event)", "mouseleave": "onMouseLeave()", "touchstart": "onTouchStart($event)" } }, providers: [TooltipService], ngImport: i0 });
7969
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDirective, isStandalone: true, selector: "[tlsTooltip]", inputs: { content: { classPropertyName: "content", publicName: "tlsTooltip", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrigin: { classPropertyName: "tooltipOrigin", publicName: "tooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, tooltipPositions: { classPropertyName: "tooltipPositions", publicName: "tooltipPositions", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, tooltipColor: { classPropertyName: "tooltipColor", publicName: "tooltipColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerenter": "onPointerEnter($event)", "pointermove": "onPointerMove($event)", "pointerleave": "onPointerLeave($event)", "focus": "onFocus()", "blur": "onBlur()", "document:keydown.escape": "onEscape()" } }, providers: [TooltipService], ngImport: i0 });
7665
7970
  }
7666
7971
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
7667
7972
  type: Directive,
@@ -7669,21 +7974,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
7669
7974
  selector: '[tlsTooltip]',
7670
7975
  providers: [TooltipService],
7671
7976
  host: {
7672
- '(mouseenter)': 'onMouseEnter($event)',
7673
- '(mousemove)': 'onMouseMove($event)',
7674
- '(mouseleave)': 'onMouseLeave()',
7675
- '(touchstart)': 'onTouchStart($event)',
7977
+ '(pointerenter)': 'onPointerEnter($event)',
7978
+ '(pointermove)': 'onPointerMove($event)',
7979
+ '(pointerleave)': 'onPointerLeave($event)',
7980
+ '(focus)': 'onFocus()',
7981
+ '(blur)': 'onBlur()',
7982
+ '(document:keydown.escape)': 'onEscape()',
7676
7983
  },
7677
7984
  }]
7678
7985
  }], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsTooltip", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], tooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipDisabled", required: false }] }], tooltipOrigin: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOrigin", required: false }] }], tooltipPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPositions", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], tooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipOffset", required: false }] }], tooltipColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipColor", required: false }] }] } });
7679
7986
 
7680
7987
  // Features
7681
7988
 
7682
- const provideThalassicUIConfig = (config) => {
7989
+ const provideThalassicUIConfig = (config = {}) => {
7990
+ const components = config.components ?? {};
7683
7991
  // Query-sync configs nest under their parent feature in the public API but resolve to their own
7684
7992
  // separate DI tokens, so split the nested `querySync` off from the component's own config.
7685
- const { querySync: paginationQuerySync, ...pagination } = config.components.pagination ?? {};
7686
- const { querySync: tabsQuerySync, ...tabs } = config.components.tabs ?? {};
7993
+ const { querySync: paginationQuerySync, ...pagination } = components.pagination ?? {};
7994
+ const { querySync: tabsQuerySync, ...tabs } = components.tabs ?? {};
7687
7995
  const accessibility = deepMerge(DEFAULT_ACCESSIBILITY_CONFIG, config.accessibility);
7688
7996
  return makeEnvironmentProviders([
7689
7997
  // Cross-cutting accessibility policy
@@ -7711,82 +8019,82 @@ const provideThalassicUIConfig = (config) => {
7711
8019
  // Components
7712
8020
  {
7713
8021
  provide: ALERT_CONFIG,
7714
- useValue: deepMerge(DEFAULT_ALERT_CONFIG, config.components.alert),
8022
+ useValue: deepMerge(DEFAULT_ALERT_CONFIG, components.alert),
7715
8023
  },
7716
8024
  {
7717
8025
  provide: AUTOCOMPLETE_CONFIG,
7718
- useValue: deepMerge(DEFAULT_AUTOCOMPLETE_CONFIG, config.components.autocomplete),
8026
+ useValue: deepMerge(DEFAULT_AUTOCOMPLETE_CONFIG, components.autocomplete),
7719
8027
  },
7720
8028
  {
7721
8029
  provide: BUTTON_CONFIG,
7722
- useValue: deepMerge(DEFAULT_BUTTON_CONFIG, config.components.button),
8030
+ useValue: deepMerge(DEFAULT_BUTTON_CONFIG, components.button),
7723
8031
  },
7724
8032
  {
7725
8033
  provide: CALENDAR_CONFIG,
7726
8034
  // `labels` is a deep-partial override; deepMerge merges it recursively, but its
7727
8035
  // `Partial<T>` signature only models a shallow partial, so cast to it.
7728
- useValue: deepMerge(DEFAULT_CALENDAR_CONFIG, config.components.calendar),
8036
+ useValue: deepMerge(DEFAULT_CALENDAR_CONFIG, components.calendar),
7729
8037
  },
7730
8038
  {
7731
8039
  provide: CHECKBOX_CONFIG,
7732
- useValue: deepMerge(DEFAULT_CHECKBOX_CONFIG, config.components.checkbox),
8040
+ useValue: deepMerge(DEFAULT_CHECKBOX_CONFIG, components.checkbox),
7733
8041
  },
7734
- { provide: CHIP_CONFIG, useValue: deepMerge(DEFAULT_CHIP_CONFIG, config.components.chip) },
8042
+ { provide: CHIP_CONFIG, useValue: deepMerge(DEFAULT_CHIP_CONFIG, components.chip) },
7735
8043
  {
7736
8044
  provide: CHIP_CONTROL_CONFIG,
7737
- useValue: deepMerge(DEFAULT_CHIP_CONTROL_CONFIG, config.components.chipControl),
8045
+ useValue: deepMerge(DEFAULT_CHIP_CONTROL_CONFIG, components.chipControl),
7738
8046
  },
7739
8047
  {
7740
8048
  provide: CHIP_GROUP_CONFIG,
7741
- useValue: deepMerge(DEFAULT_CHIP_GROUP_CONFIG, config.components.chipGroup),
8049
+ useValue: deepMerge(DEFAULT_CHIP_GROUP_CONFIG, components.chipGroup),
7742
8050
  },
7743
8051
  {
7744
8052
  provide: CHIP_INPUT_CONFIG,
7745
- useValue: deepMerge(DEFAULT_CHIP_INPUT_CONFIG, config.components.chipInput),
8053
+ useValue: deepMerge(DEFAULT_CHIP_INPUT_CONFIG, components.chipInput),
7746
8054
  },
7747
8055
  {
7748
8056
  provide: DATE_TIME_PICKER_CONFIG,
7749
- useValue: deepMerge(DEFAULT_DATE_TIME_PICKER_CONFIG, config.components.dateTimePicker),
8057
+ useValue: deepMerge(DEFAULT_DATE_TIME_PICKER_CONFIG, components.dateTimePicker),
7750
8058
  },
7751
8059
  {
7752
8060
  provide: DIALOG_CONFIG,
7753
- useValue: deepMerge(DEFAULT_DIALOG_CONFIG, config.components.dialog),
8061
+ useValue: deepMerge(DEFAULT_DIALOG_CONFIG, components.dialog),
7754
8062
  },
7755
8063
  {
7756
8064
  provide: DIVIDER_CONFIG,
7757
- useValue: deepMerge(DEFAULT_DIVIDER_CONFIG, config.components.divider),
8065
+ useValue: deepMerge(DEFAULT_DIVIDER_CONFIG, components.divider),
7758
8066
  },
7759
8067
  {
7760
8068
  provide: FILE_INPUT_CONFIG,
7761
- useValue: deepMerge(DEFAULT_FILE_INPUT_CONFIG, config.components.fileInput),
8069
+ useValue: deepMerge(DEFAULT_FILE_INPUT_CONFIG, components.fileInput),
7762
8070
  },
7763
8071
  {
7764
8072
  provide: FORM_CONTROL_GROUP_CONFIG,
7765
- useValue: deepMerge(DEFAULT_FORM_CONTROL_GROUP_CONFIG, config.components.formControlGroup),
8073
+ useValue: deepMerge(DEFAULT_FORM_CONTROL_GROUP_CONFIG, components.formControlGroup),
7766
8074
  },
7767
8075
  {
7768
8076
  provide: FORM_ITEM_CONFIG,
7769
- useValue: deepMerge(DEFAULT_FORM_ITEM_CONFIG, config.components.formItem),
8077
+ useValue: deepMerge(DEFAULT_FORM_ITEM_CONFIG, components.formItem),
7770
8078
  },
7771
8079
  {
7772
8080
  provide: HIGHLIGHT_CONFIG,
7773
- useValue: deepMerge(DEFAULT_HIGHLIGHT_CONFIG, config.components.highlight),
8081
+ useValue: deepMerge(DEFAULT_HIGHLIGHT_CONFIG, components.highlight),
7774
8082
  },
7775
- { provide: ICON_CONFIG, useValue: deepMerge(DEFAULT_ICON_CONFIG, config.components.icon) },
8083
+ { provide: ICON_CONFIG, useValue: deepMerge(DEFAULT_ICON_CONFIG, components.icon) },
7776
8084
  {
7777
8085
  provide: IMAGE_COMPARE_CONFIG,
7778
- useValue: deepMerge(DEFAULT_IMAGE_COMPARE_CONFIG, config.components.imageCompare),
8086
+ useValue: deepMerge(DEFAULT_IMAGE_COMPARE_CONFIG, components.imageCompare),
7779
8087
  },
7780
- { provide: INPUT_CONFIG, useValue: deepMerge(DEFAULT_INPUT_CONFIG, config.components.input) },
8088
+ { provide: INPUT_CONFIG, useValue: deepMerge(DEFAULT_INPUT_CONFIG, components.input) },
7781
8089
  {
7782
8090
  provide: LOADER_CONFIG,
7783
- useValue: deepMerge(DEFAULT_LOADER_CONFIG, config.components.loader),
8091
+ useValue: deepMerge(DEFAULT_LOADER_CONFIG, components.loader),
7784
8092
  },
7785
- { provide: MARK_CONFIG, useValue: deepMerge(DEFAULT_MARK_CONFIG, config.components.mark) },
7786
- { provide: MENU_CONFIG, useValue: deepMerge(DEFAULT_MENU_CONFIG, config.components.menu) },
8093
+ { provide: MARK_CONFIG, useValue: deepMerge(DEFAULT_MARK_CONFIG, components.mark) },
8094
+ { provide: MENU_CONFIG, useValue: deepMerge(DEFAULT_MENU_CONFIG, components.menu) },
7787
8095
  {
7788
8096
  provide: MULTI_SELECT_CONFIG,
7789
- useValue: deepMerge(DEFAULT_MULTI_SELECT_CONFIG, config.components.multiSelect),
8097
+ useValue: deepMerge(DEFAULT_MULTI_SELECT_CONFIG, components.multiSelect),
7790
8098
  },
7791
8099
  {
7792
8100
  provide: PAGINATION_CONFIG,
@@ -7800,44 +8108,44 @@ const provideThalassicUIConfig = (config) => {
7800
8108
  },
7801
8109
  {
7802
8110
  provide: PASSWORD_CONFIG,
7803
- useValue: deepMerge(DEFAULT_PASSWORD_CONFIG, config.components.password),
8111
+ useValue: deepMerge(DEFAULT_PASSWORD_CONFIG, components.password),
7804
8112
  },
7805
8113
  {
7806
8114
  provide: PIN_INPUT_CONFIG,
7807
- useValue: deepMerge(DEFAULT_PIN_INPUT_CONFIG, config.components.pinInput),
8115
+ useValue: deepMerge(DEFAULT_PIN_INPUT_CONFIG, components.pinInput),
7808
8116
  },
7809
8117
  {
7810
8118
  provide: POPOVER_CONFIG,
7811
- useValue: deepMerge(DEFAULT_POPOVER_CONFIG, config.components.popover),
8119
+ useValue: deepMerge(DEFAULT_POPOVER_CONFIG, components.popover),
7812
8120
  },
7813
8121
  {
7814
8122
  provide: RADIO_BUTTON_CONFIG,
7815
- useValue: deepMerge(DEFAULT_RADIO_BUTTON_CONFIG, config.components.radioButton),
8123
+ useValue: deepMerge(DEFAULT_RADIO_BUTTON_CONFIG, components.radioButton),
7816
8124
  },
7817
8125
  {
7818
8126
  provide: SELECT_CONFIG,
7819
- useValue: deepMerge(DEFAULT_SELECT_CONFIG, config.components.select),
8127
+ useValue: deepMerge(DEFAULT_SELECT_CONFIG, components.select),
7820
8128
  },
7821
8129
  {
7822
8130
  provide: SKELETON_CONFIG,
7823
- useValue: deepMerge(DEFAULT_SKELETON_CONFIG, config.components.skeleton),
8131
+ useValue: deepMerge(DEFAULT_SKELETON_CONFIG, components.skeleton),
7824
8132
  },
7825
8133
  {
7826
8134
  provide: SPLITTER_CONFIG,
7827
- useValue: deepMerge(DEFAULT_SPLITTER_CONFIG, config.components.splitter),
8135
+ useValue: deepMerge(DEFAULT_SPLITTER_CONFIG, components.splitter),
7828
8136
  },
7829
8137
  {
7830
8138
  provide: STEPPER_CONFIG,
7831
- useValue: deepMerge(DEFAULT_STEPPER_CONFIG, config.components.stepper),
8139
+ useValue: deepMerge(DEFAULT_STEPPER_CONFIG, components.stepper),
7832
8140
  },
7833
8141
  {
7834
8142
  provide: SWITCH_CONFIG,
7835
- useValue: deepMerge(DEFAULT_SWITCH_CONFIG, config.components.switch),
8143
+ useValue: deepMerge(DEFAULT_SWITCH_CONFIG, components.switch),
7836
8144
  },
7837
- { provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG, config.components.table) },
8145
+ { provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG, components.table) },
7838
8146
  {
7839
8147
  provide: TAB_NAV_CONFIG,
7840
- useValue: deepMerge(DEFAULT_TAB_NAV_CONFIG, config.components.tabNav),
8148
+ useValue: deepMerge(DEFAULT_TAB_NAV_CONFIG, components.tabNav),
7841
8149
  },
7842
8150
  { provide: TABS_CONFIG, useValue: deepMerge(DEFAULT_TABS_CONFIG, tabs) },
7843
8151
  {
@@ -7846,21 +8154,21 @@ const provideThalassicUIConfig = (config) => {
7846
8154
  },
7847
8155
  {
7848
8156
  provide: TEXTAREA_CONFIG,
7849
- useValue: deepMerge(DEFAULT_TEXTAREA_CONFIG, config.components.textarea),
8157
+ useValue: deepMerge(DEFAULT_TEXTAREA_CONFIG, components.textarea),
7850
8158
  },
7851
8159
  {
7852
8160
  provide: TOAST_CONFIG,
7853
8161
  // `severityColors` is a deep-partial override; deepMerge merges it recursively,
7854
8162
  // but its `Partial<T>` signature only models a shallow partial, so cast to it.
7855
- useValue: deepMerge(DEFAULT_TOAST_CONFIG, config.components.toast),
8163
+ useValue: deepMerge(DEFAULT_TOAST_CONFIG, components.toast),
7856
8164
  },
7857
8165
  {
7858
8166
  provide: TOGGLE_GROUP_CONFIG,
7859
- useValue: deepMerge(DEFAULT_TOGGLE_GROUP_CONFIG, config.components.toggleGroup),
8167
+ useValue: deepMerge(DEFAULT_TOGGLE_GROUP_CONFIG, components.toggleGroup),
7860
8168
  },
7861
8169
  {
7862
8170
  provide: TOOLTIP_CONFIG,
7863
- useValue: deepMerge(DEFAULT_TOOLTIP_CONFIG, config.components.tooltip),
8171
+ useValue: deepMerge(DEFAULT_TOOLTIP_CONFIG, components.tooltip),
7864
8172
  },
7865
8173
  ]);
7866
8174
  };