@thalassic/ui 22.13.0 → 22.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui.mjs +564 -249
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +163 -21
|
@@ -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,
|
|
2
|
+
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, contentChild, Component, Injectable, makeEnvironmentProviders, TemplateRef, forwardRef, PLATFORM_ID, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked, 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,
|
|
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
|
-
|
|
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
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
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' });
|
|
@@ -1067,8 +1139,15 @@ class Breadcrumbs {
|
|
|
1067
1139
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1068
1140
|
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
1069
1141
|
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1142
|
+
// Content
|
|
1143
|
+
// Optional projected template for an item's inner content (label/icon),
|
|
1144
|
+
// rendered in place of the built-in label. The list structure, links,
|
|
1145
|
+
// separators, and `aria-current` stay owned by the component. Bind the item
|
|
1146
|
+
// with `<ng-template let-item>`; see BreadcrumbItemContext for the full context.
|
|
1147
|
+
itemTemplate = contentChild(TemplateRef, /* @ts-ignore */
|
|
1148
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
1070
1149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1071
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Breadcrumbs, isStandalone: true, selector: "tls-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separatorIcon: { classPropertyName: "separatorIcon", publicName: "separatorIcon", 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 } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabelledby() ? null : ariaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null" }, classAttribute: "tls-breadcrumbs" }, ngImport: i0, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item>\n @if (item.icon) {\n
|
|
1150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Breadcrumbs, isStandalone: true, selector: "tls-breadcrumbs", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, separatorIcon: { classPropertyName: "separatorIcon", publicName: "separatorIcon", 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 } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "ariaLabelledby() ? null : ariaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null" }, classAttribute: "tls-breadcrumbs" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let index = $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item let-index=\"index\" let-last=\"last\">\n @if (itemTemplate(); as customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: last }\"\n />\n } @else {\n @if (item.icon) {\n <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
1072
1151
|
}
|
|
1073
1152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, decorators: [{
|
|
1074
1153
|
type: Component,
|
|
@@ -1077,8 +1156,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1077
1156
|
class: 'tls-breadcrumbs',
|
|
1078
1157
|
'[attr.aria-label]': 'ariaLabelledby() ? null : ariaLabel()',
|
|
1079
1158
|
'[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
|
|
1080
|
-
}, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item>\n @if (item.icon) {\n
|
|
1081
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separatorIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorIcon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }] } });
|
|
1159
|
+
}, template: "<ol class=\"tls-breadcrumbs__list\">\n @for (item of items(); track $index; let index = $index; let isLastItem = $last) {\n <li class=\"tls-breadcrumbs__item\">\n @if (item.link !== undefined) {\n <a\n class=\"tls-breadcrumbs__link\"\n [routerLink]=\"item.link\"\n [attr.aria-current]=\"isLastItem ? 'page' : null\"\n >\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </a>\n } @else {\n <span class=\"tls-breadcrumbs__text\" [attr.aria-current]=\"isLastItem ? 'page' : null\">\n <ng-container\n [ngTemplateOutlet]=\"itemContent\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: isLastItem }\"\n />\n </span>\n }\n\n @if (!isLastItem) {\n <span class=\"tls-breadcrumbs__separator\" aria-hidden=\"true\">\n <tls-icon [name]=\"separatorIcon()\" />\n </span>\n }\n </li>\n }\n</ol>\n\n<ng-template #itemContent let-item let-index=\"index\" let-last=\"last\">\n @if (itemTemplate(); as customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"customTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: index, last: last }\"\n />\n } @else {\n @if (item.icon) {\n <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\n }\n</ng-template>\n" }]
|
|
1160
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], separatorIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorIcon", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
1082
1161
|
|
|
1083
1162
|
const DEFAULT_BUTTON_CONFIG = {
|
|
1084
1163
|
color: 'primary',
|
|
@@ -1455,6 +1534,25 @@ const buildOverlayPositions = (position, offset) => {
|
|
|
1455
1534
|
}));
|
|
1456
1535
|
};
|
|
1457
1536
|
|
|
1537
|
+
/**
|
|
1538
|
+
* A signal of the current time, refreshed every `intervalMs` (browser only), so
|
|
1539
|
+
* time-dependent computed's — a current-time indicator, a "today" highlight —
|
|
1540
|
+
* stay correct while the view is left open instead of freezing at first render.
|
|
1541
|
+
*
|
|
1542
|
+
* Must be called from an injection context (a field initializer or
|
|
1543
|
+
* constructor); the refresh interval is cleared when that context is destroyed.
|
|
1544
|
+
* On the server the signal holds the construction time and never ticks.
|
|
1545
|
+
*/
|
|
1546
|
+
const createNowSignal = (intervalMs) => {
|
|
1547
|
+
const now = signal(new Date(), /* @ts-ignore */
|
|
1548
|
+
...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
1549
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
1550
|
+
const handle = setInterval(() => now.set(new Date()), intervalMs);
|
|
1551
|
+
inject(DestroyRef).onDestroy(() => clearInterval(handle));
|
|
1552
|
+
}
|
|
1553
|
+
return now.asReadonly();
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1458
1556
|
/** Escapes RegExp metacharacters so the string matches literally inside a pattern. */
|
|
1459
1557
|
const escapeRegularExpression = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1460
1558
|
|
|
@@ -1490,6 +1588,8 @@ const HOUR_LABEL_FORMAT = 'h a';
|
|
|
1490
1588
|
const AGENDA_WEEKDAY_FORMAT = 'EEEE';
|
|
1491
1589
|
/** `date-fns` format token for an agenda day's date, e.g. "Jul 22". */
|
|
1492
1590
|
const AGENDA_DATE_FORMAT = 'MMM d';
|
|
1591
|
+
/** How often the calendar's notion of "now" refreshes (current-time line, today highlight). */
|
|
1592
|
+
const NOW_REFRESH_INTERVAL_MS = 60_000;
|
|
1493
1593
|
/** Views that prefix an event chip with its start time; the month grid shows the title alone. */
|
|
1494
1594
|
const TIME_AWARE_VIEWS = ['week', 'day', 'agenda'];
|
|
1495
1595
|
/** View switcher order; labels are resolved from the calendar config for localization. */
|
|
@@ -1623,16 +1723,19 @@ class CalendarAgendaView {
|
|
|
1623
1723
|
// State
|
|
1624
1724
|
noEventsLabel = this._config.labels.noEvents;
|
|
1625
1725
|
_dateOptions = localeFormatOptions(this._locale);
|
|
1726
|
+
/** Ticking current time, so the today marker tracks the clock across midnight. */
|
|
1727
|
+
_now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
|
|
1626
1728
|
// Computed
|
|
1627
1729
|
days = computed(() => {
|
|
1628
1730
|
const activeDate = this.activeDate();
|
|
1629
1731
|
const events = this.events();
|
|
1732
|
+
const now = this._now();
|
|
1630
1733
|
return eachDayOfInterval({ start: startOfMonth(activeDate), end: endOfMonth(activeDate) })
|
|
1631
1734
|
.map(date => ({
|
|
1632
1735
|
date,
|
|
1633
1736
|
weekday: format(date, AGENDA_WEEKDAY_FORMAT, this._dateOptions),
|
|
1634
1737
|
dateLabel: format(date, AGENDA_DATE_FORMAT, this._dateOptions),
|
|
1635
|
-
isToday:
|
|
1738
|
+
isToday: isSameDay(date, now),
|
|
1636
1739
|
events: eventsForDay(date, events),
|
|
1637
1740
|
}))
|
|
1638
1741
|
.filter(day => day.events.length > 0);
|
|
@@ -1734,6 +1837,8 @@ class CalendarMonthView {
|
|
|
1734
1837
|
eventSelect = output();
|
|
1735
1838
|
// State
|
|
1736
1839
|
_dateOptions = localeFormatOptions(this._locale);
|
|
1840
|
+
/** Ticking current time, so the today highlight tracks the clock across midnight. */
|
|
1841
|
+
_now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
|
|
1737
1842
|
// Computed
|
|
1738
1843
|
weekdayHeaders = computed(() => rotateWeekDays(this.weekDays(), this.weekStartsOn()), /* @ts-ignore */
|
|
1739
1844
|
...(ngDevMode ? [{ debugName: "weekdayHeaders" }] : /* istanbul ignore next */ []));
|
|
@@ -1741,6 +1846,7 @@ class CalendarMonthView {
|
|
|
1741
1846
|
const activeDate = this.activeDate();
|
|
1742
1847
|
const maxLanes = this.maxEventsPerDay();
|
|
1743
1848
|
const events = this.events();
|
|
1849
|
+
const now = this._now();
|
|
1744
1850
|
// A fixed 6-week window keeps the grid height from reflowing between months.
|
|
1745
1851
|
const days = buildMonthDays(activeDate, this.weekStartsOn(), MONTH_GRID_ROWS);
|
|
1746
1852
|
const weeks = [];
|
|
@@ -1769,7 +1875,7 @@ class CalendarMonthView {
|
|
|
1769
1875
|
date,
|
|
1770
1876
|
dayNumber: format(date, DAY_NUMBER_FORMAT, this._dateOptions),
|
|
1771
1877
|
inCurrentMonth: isSameMonth(date, activeDate),
|
|
1772
|
-
isToday:
|
|
1878
|
+
isToday: isSameDay(date, now),
|
|
1773
1879
|
hiddenCount: hiddenPerColumn[column],
|
|
1774
1880
|
}));
|
|
1775
1881
|
weeks.push({ days: cells, bars });
|
|
@@ -1878,6 +1984,8 @@ class CalendarTimeGrid {
|
|
|
1878
1984
|
hourHeight = HOUR_HEIGHT;
|
|
1879
1985
|
allDayLabel = this._config.labels.allDay;
|
|
1880
1986
|
_dateOptions = localeFormatOptions(this._locale);
|
|
1987
|
+
/** Ticking current time, so the now line and today highlight track the clock. */
|
|
1988
|
+
_now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
|
|
1881
1989
|
// Computed
|
|
1882
1990
|
hours = computed(() => {
|
|
1883
1991
|
const hours = [];
|
|
@@ -1890,13 +1998,14 @@ class CalendarTimeGrid {
|
|
|
1890
1998
|
const events = this.events();
|
|
1891
1999
|
const hourStart = this.hourStart();
|
|
1892
2000
|
const hourEnd = this.hourEnd();
|
|
2001
|
+
const now = this._now();
|
|
1893
2002
|
return this.days().map(day => {
|
|
1894
2003
|
const dayStart = startOfDay(day);
|
|
1895
2004
|
const windowStart = addHours(dayStart, hourStart);
|
|
1896
2005
|
const windowEnd = addHours(dayStart, hourEnd);
|
|
1897
2006
|
const dayEvents = events.filter(event => eventCoversDay(event, dayStart));
|
|
1898
2007
|
const allDayEvents = dayEvents.filter(event => this._isAllDay(event));
|
|
1899
|
-
const timed = dayEvents.filter(event => !this._isAllDay(event));
|
|
2008
|
+
const timed = dayEvents.filter(event => !this._isAllDay(event) && this._overlapsWindow(event, windowStart, windowEnd));
|
|
1900
2009
|
const timedEvents = assignEventLanes(timed).map(laid => {
|
|
1901
2010
|
const start = this._clamp(laid.event.start, windowStart, windowEnd);
|
|
1902
2011
|
const end = this._clamp(laid.event.end ?? laid.event.start, windowStart, windowEnd);
|
|
@@ -1908,15 +2017,15 @@ class CalendarTimeGrid {
|
|
|
1908
2017
|
height: Math.max(MIN_EVENT_HEIGHT, differenceInMinutes(end, start) * PX_PER_MINUTE),
|
|
1909
2018
|
};
|
|
1910
2019
|
});
|
|
1911
|
-
return { date: day, isToday:
|
|
2020
|
+
return { date: day, isToday: isSameDay(day, now), heading: format(day, TIME_GRID_HEADING_FORMAT, this._dateOptions), allDayEvents, timedEvents };
|
|
1912
2021
|
});
|
|
1913
2022
|
}, /* @ts-ignore */
|
|
1914
2023
|
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1915
2024
|
/** Vertical offset (px) of the current-time line, or null when now is off-screen. */
|
|
1916
2025
|
nowOffset = computed(() => {
|
|
1917
|
-
|
|
2026
|
+
const now = this._now();
|
|
2027
|
+
if (!this.days().some(day => isSameDay(day, now)))
|
|
1918
2028
|
return null;
|
|
1919
|
-
const now = new Date();
|
|
1920
2029
|
const dayStart = startOfDay(now);
|
|
1921
2030
|
const windowStart = addHours(dayStart, this.hourStart());
|
|
1922
2031
|
const windowEnd = addHours(dayStart, this.hourEnd());
|
|
@@ -1939,6 +2048,19 @@ class CalendarTimeGrid {
|
|
|
1939
2048
|
_isAllDay(event) {
|
|
1940
2049
|
return event.allDay === true || !isSameDay(event.start, event.end ?? event.start);
|
|
1941
2050
|
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Whether the event has any visible span inside the rendered hour window.
|
|
2053
|
+
* Events entirely before `hourStart` or after `hourEnd` are excluded — clamping
|
|
2054
|
+
* them would paint a zero-length sliver pinned to the window edge. An instant
|
|
2055
|
+
* (zero-duration) event counts while its start sits inside the window.
|
|
2056
|
+
*/
|
|
2057
|
+
_overlapsWindow(event, windowStart, windowEnd) {
|
|
2058
|
+
const start = event.start;
|
|
2059
|
+
const end = event.end ?? event.start;
|
|
2060
|
+
if (end.getTime() === start.getTime())
|
|
2061
|
+
return start >= windowStart && start < windowEnd;
|
|
2062
|
+
return end > windowStart && start < windowEnd;
|
|
2063
|
+
}
|
|
1942
2064
|
_clamp(date, min, max) {
|
|
1943
2065
|
return new Date(Math.min(Math.max(date.getTime(), min.getTime()), max.getTime()));
|
|
1944
2066
|
}
|
|
@@ -1994,6 +2116,8 @@ class Calendar {
|
|
|
1994
2116
|
eventTemplate = contentChild('eventTemplate', /* @ts-ignore */
|
|
1995
2117
|
...(ngDevMode ? [{ debugName: "eventTemplate" }] : /* istanbul ignore next */ []));
|
|
1996
2118
|
_dateOptions = localeFormatOptions(this._locale);
|
|
2119
|
+
/** Ticking current time, so the "Today" affordance stays correct across midnight. */
|
|
2120
|
+
_now = createNowSignal(NOW_REFRESH_INTERVAL_MS);
|
|
1997
2121
|
// Computed
|
|
1998
2122
|
hostClasses = computed(() => [
|
|
1999
2123
|
'tls-calendar',
|
|
@@ -2003,7 +2127,7 @@ class Calendar {
|
|
|
2003
2127
|
/** Whether the active period already includes today, so "Today" would be a no-op. */
|
|
2004
2128
|
isViewingToday = computed(() => {
|
|
2005
2129
|
const activeDate = this.activeDate();
|
|
2006
|
-
const now =
|
|
2130
|
+
const now = this._now();
|
|
2007
2131
|
switch (this.view()) {
|
|
2008
2132
|
case 'week':
|
|
2009
2133
|
return isSameWeek(activeDate, now, { weekStartsOn: this.weekStartsOn() });
|
|
@@ -2549,10 +2673,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2549
2673
|
}]
|
|
2550
2674
|
}], 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
2675
|
|
|
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
2676
|
// Dimmed backdrop behind a centered modal confirm. Shared with `tls-dialog` so
|
|
2557
2677
|
// the two modal surfaces render an identical scrim.
|
|
2558
2678
|
const MODAL_BACKDROP_CLASS = 'tls-dialog-backdrop';
|
|
@@ -2655,22 +2775,7 @@ class ConfirmService {
|
|
|
2655
2775
|
// then disposes the pane once that animation finishes.
|
|
2656
2776
|
_dismiss(overlayRef) {
|
|
2657
2777
|
overlayRef.detach();
|
|
2658
|
-
|
|
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);
|
|
2778
|
+
disposeAfterLeaveAnimation(overlayRef);
|
|
2674
2779
|
}
|
|
2675
2780
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2676
2781
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, providedIn: 'root' });
|
|
@@ -2792,7 +2897,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
2792
2897
|
// its slide-out (`--leave`) animation can finish before disposal. The `animationend`
|
|
2793
2898
|
// listener disposes early; this fallback covers the case where no exit animation
|
|
2794
2899
|
// runs (e.g. the `none` motion level, where nothing is emitted).
|
|
2795
|
-
const LEAVE_ANIMATION_FALLBACK_MS
|
|
2900
|
+
const LEAVE_ANIMATION_FALLBACK_MS = 500;
|
|
2796
2901
|
// Named size tokens, used to tell a preset apart from a custom CSS-length string.
|
|
2797
2902
|
const DRAWER_NAMED_SIZES = ['sm', 'md', 'lg', 'full'];
|
|
2798
2903
|
|
|
@@ -2884,7 +2989,7 @@ class Drawer extends CdkDialogContainer {
|
|
|
2884
2989
|
};
|
|
2885
2990
|
element.addEventListener('animationend', onAnimationEnd);
|
|
2886
2991
|
// Safety net if `animationend` never arrives (e.g. the pane is torn down early).
|
|
2887
|
-
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS
|
|
2992
|
+
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
|
|
2888
2993
|
// The `--leave` class applies on the next change detection; on the following
|
|
2889
2994
|
// frame, close at once if no animation is running. When motion is enabled the
|
|
2890
2995
|
// computed `animationName` is never `none`, so this cannot finalize early.
|
|
@@ -3092,6 +3197,12 @@ const DEFAULT_FORM_ITEM_ERROR_MESSAGES = {
|
|
|
3092
3197
|
},
|
|
3093
3198
|
pattern: () => 'Invalid format',
|
|
3094
3199
|
};
|
|
3200
|
+
/**
|
|
3201
|
+
* Message rendered for a validation error whose `kind` has no entry in the
|
|
3202
|
+
* configured {@link ErrorMessageMap} and that carries no `message` of its own
|
|
3203
|
+
* (e.g. a custom validator).
|
|
3204
|
+
*/
|
|
3205
|
+
const DEFAULT_FORM_ITEM_UNKNOWN_ERROR_MESSAGE = () => 'Invalid value';
|
|
3095
3206
|
|
|
3096
3207
|
const DEFAULT_FORM_ITEM_CONFIG = {
|
|
3097
3208
|
reserveErrorSpace: true,
|
|
@@ -3099,6 +3210,7 @@ const DEFAULT_FORM_ITEM_CONFIG = {
|
|
|
3099
3210
|
displayErrors: true,
|
|
3100
3211
|
showRequiredMarker: true,
|
|
3101
3212
|
errorMessages: DEFAULT_FORM_ITEM_ERROR_MESSAGES,
|
|
3213
|
+
unknownErrorMessage: DEFAULT_FORM_ITEM_UNKNOWN_ERROR_MESSAGE,
|
|
3102
3214
|
};
|
|
3103
3215
|
|
|
3104
3216
|
const FORM_ITEM_CONFIG = new InjectionToken('FORM_ITEM_CONFIG', {
|
|
@@ -3223,10 +3335,14 @@ class FormItem {
|
|
|
3223
3335
|
_getErrorMessages(errors) {
|
|
3224
3336
|
const array = [];
|
|
3225
3337
|
for (const error of errors) {
|
|
3226
|
-
if (error.message)
|
|
3338
|
+
if (error.message) {
|
|
3227
3339
|
array.push(error.message);
|
|
3228
|
-
|
|
3229
|
-
|
|
3340
|
+
continue;
|
|
3341
|
+
}
|
|
3342
|
+
// A custom validator's kind may have no configured message; fall back to
|
|
3343
|
+
// the generic one rather than failing on the missing entry.
|
|
3344
|
+
const messageFunction = this._config.errorMessages[error.kind] ?? this._config.unknownErrorMessage;
|
|
3345
|
+
array.push(messageFunction(error.fieldTree));
|
|
3230
3346
|
}
|
|
3231
3347
|
return array;
|
|
3232
3348
|
}
|
|
@@ -3387,6 +3503,9 @@ class Autocomplete extends AbstractSelect {
|
|
|
3387
3503
|
this.value.set(option.value);
|
|
3388
3504
|
this.close();
|
|
3389
3505
|
}
|
|
3506
|
+
isOptionSelected(option) {
|
|
3507
|
+
return option.value === this.value();
|
|
3508
|
+
}
|
|
3390
3509
|
onInput(event) {
|
|
3391
3510
|
const target = event.target;
|
|
3392
3511
|
this.query.set(target.value);
|
|
@@ -3466,13 +3585,13 @@ class Autocomplete extends AbstractSelect {
|
|
|
3466
3585
|
this.select(option);
|
|
3467
3586
|
}
|
|
3468
3587
|
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 (
|
|
3588
|
+
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
3589
|
}
|
|
3471
3590
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Autocomplete, decorators: [{
|
|
3472
3591
|
type: Component,
|
|
3473
|
-
args: [{ selector: 'tls-autocomplete', imports: [Loader, Icon], host: {
|
|
3592
|
+
args: [{ selector: 'tls-autocomplete', imports: [Loader, Icon, NgTemplateOutlet], host: {
|
|
3474
3593
|
'[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 (
|
|
3594
|
+
}, 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
3595
|
}], 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
3596
|
|
|
3478
3597
|
const DEFAULT_CHECKBOX_CONFIG = {};
|
|
@@ -3500,9 +3619,19 @@ class Checkbox extends CheckboxFormControl {
|
|
|
3500
3619
|
}, /* @ts-ignore */
|
|
3501
3620
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3502
3621
|
// Protected methods
|
|
3503
|
-
toggle() {
|
|
3504
|
-
if (this.notInteractive())
|
|
3622
|
+
toggle(event) {
|
|
3623
|
+
if (this.notInteractive()) {
|
|
3624
|
+
// Keep the native input from flipping its own checked state.
|
|
3625
|
+
if (event)
|
|
3626
|
+
event.preventDefault();
|
|
3505
3627
|
return;
|
|
3628
|
+
}
|
|
3629
|
+
// Activating an indeterminate checkbox resolves it to checked.
|
|
3630
|
+
if (this.indeterminate()) {
|
|
3631
|
+
this.indeterminate.set(false);
|
|
3632
|
+
this.checked.set(true);
|
|
3633
|
+
return;
|
|
3634
|
+
}
|
|
3506
3635
|
this.checked.update(prev => !prev);
|
|
3507
3636
|
}
|
|
3508
3637
|
onKeyboardToggle(event) {
|
|
@@ -3510,15 +3639,13 @@ class Checkbox extends CheckboxFormControl {
|
|
|
3510
3639
|
this.toggle();
|
|
3511
3640
|
}
|
|
3512
3641
|
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: {
|
|
3642
|
+
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
3643
|
}
|
|
3515
3644
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Checkbox, decorators: [{
|
|
3516
3645
|
type: Component,
|
|
3517
3646
|
args: [{ selector: 'tls-checkbox', imports: [Icon], host: {
|
|
3518
|
-
role: 'checkbox',
|
|
3519
3647
|
'[class]': 'hostClasses()',
|
|
3520
|
-
|
|
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" }]
|
|
3648
|
+
}, 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
3649
|
}], 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
3650
|
|
|
3524
3651
|
const DEFAULT_POPOVER_CONFIG = {
|
|
@@ -3605,6 +3732,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
3605
3732
|
}], 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
3733
|
|
|
3607
3734
|
class DatePickerCalendar {
|
|
3735
|
+
// Injections
|
|
3736
|
+
_locale = inject(LOCALE_CONFIG);
|
|
3737
|
+
_dateOptions = localeFormatOptions(this._locale);
|
|
3608
3738
|
// Inputs
|
|
3609
3739
|
viewDate = input.required(/* @ts-ignore */
|
|
3610
3740
|
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
@@ -3621,7 +3751,7 @@ class DatePickerCalendar {
|
|
|
3621
3751
|
// Computed
|
|
3622
3752
|
displayedWeekDays = computed(() => rotateWeekDays(this.weekDays(), this.weekStartsOn()), /* @ts-ignore */
|
|
3623
3753
|
...(ngDevMode ? [{ debugName: "displayedWeekDays" }] : /* istanbul ignore next */ []));
|
|
3624
|
-
headerLabel = computed(() => format(this.viewDate(), 'MMMM yyyy'), /* @ts-ignore */
|
|
3754
|
+
headerLabel = computed(() => format(this.viewDate(), 'MMMM yyyy', this._dateOptions), /* @ts-ignore */
|
|
3625
3755
|
...(ngDevMode ? [{ debugName: "headerLabel" }] : /* istanbul ignore next */ []));
|
|
3626
3756
|
days = computed(() => buildMonthDays(this.viewDate(), this.weekStartsOn()), /* @ts-ignore */
|
|
3627
3757
|
...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
@@ -3633,7 +3763,7 @@ class DatePickerCalendar {
|
|
|
3633
3763
|
this.viewDateChange.emit(addMonths(this.viewDate(), 1));
|
|
3634
3764
|
}
|
|
3635
3765
|
getDayLabel(day) {
|
|
3636
|
-
return format(day, 'd');
|
|
3766
|
+
return format(day, 'd', this._dateOptions);
|
|
3637
3767
|
}
|
|
3638
3768
|
isSelectedDay(day) {
|
|
3639
3769
|
const selected = this.selectedDate();
|
|
@@ -3667,6 +3797,9 @@ const DATE_TIME_PICKER_CONFIG = new InjectionToken('DATE_TIME_PICKER_CONFIG', {
|
|
|
3667
3797
|
|
|
3668
3798
|
const MONTH_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
3669
3799
|
class MonthPicker {
|
|
3800
|
+
// Injections
|
|
3801
|
+
_locale = inject(LOCALE_CONFIG);
|
|
3802
|
+
_dateOptions = localeFormatOptions(this._locale);
|
|
3670
3803
|
// Inputs
|
|
3671
3804
|
viewDate = input.required(/* @ts-ignore */
|
|
3672
3805
|
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
@@ -3678,11 +3811,11 @@ class MonthPicker {
|
|
|
3678
3811
|
navigateUp = output();
|
|
3679
3812
|
// Computed
|
|
3680
3813
|
months = MONTH_INDEXES;
|
|
3681
|
-
yearLabel = computed(() => format(this.viewDate(), 'yyyy'), /* @ts-ignore */
|
|
3814
|
+
yearLabel = computed(() => format(this.viewDate(), 'yyyy', this._dateOptions), /* @ts-ignore */
|
|
3682
3815
|
...(ngDevMode ? [{ debugName: "yearLabel" }] : /* istanbul ignore next */ []));
|
|
3683
3816
|
// Protected methods
|
|
3684
3817
|
getMonthLabel(monthIndex) {
|
|
3685
|
-
return format(setMonth(new Date(2000, 0, 1), monthIndex), 'MMM');
|
|
3818
|
+
return format(setMonth(new Date(2000, 0, 1), monthIndex), 'MMM', this._dateOptions);
|
|
3686
3819
|
}
|
|
3687
3820
|
prevYear() {
|
|
3688
3821
|
this.viewDateChange.emit(subYears(this.viewDate(), 1));
|
|
@@ -3808,6 +3941,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
3808
3941
|
class DateTimePicker extends ValueFormControl {
|
|
3809
3942
|
// Injections
|
|
3810
3943
|
config = inject(DATE_TIME_PICKER_CONFIG);
|
|
3944
|
+
_locale = inject(LOCALE_CONFIG);
|
|
3945
|
+
_dateOptions = localeFormatOptions(this._locale);
|
|
3811
3946
|
// View children
|
|
3812
3947
|
popoverComponent = viewChild('popoverRef', /* @ts-ignore */
|
|
3813
3948
|
...(ngDevMode ? [{ debugName: "popoverComponent" }] : /* istanbul ignore next */ []));
|
|
@@ -3851,14 +3986,14 @@ class DateTimePicker extends ValueFormControl {
|
|
|
3851
3986
|
return this.placeholder();
|
|
3852
3987
|
const mode = this.mode();
|
|
3853
3988
|
if (mode === 'calendar')
|
|
3854
|
-
return format(value, 'MMM d, yyyy');
|
|
3989
|
+
return format(value, 'MMM d, yyyy', this._dateOptions);
|
|
3855
3990
|
if (mode === 'month-picker')
|
|
3856
|
-
return format(value, 'MMMM yyyy');
|
|
3991
|
+
return format(value, 'MMMM yyyy', this._dateOptions);
|
|
3857
3992
|
if (mode === 'year-picker')
|
|
3858
|
-
return format(value, 'yyyy');
|
|
3993
|
+
return format(value, 'yyyy', this._dateOptions);
|
|
3859
3994
|
if (mode === 'time-picker')
|
|
3860
|
-
return format(value, 'HH:mm');
|
|
3861
|
-
return format(value, 'MMM d, yyyy HH:mm');
|
|
3995
|
+
return format(value, 'HH:mm', this._dateOptions);
|
|
3996
|
+
return format(value, 'MMM d, yyyy HH:mm', this._dateOptions);
|
|
3862
3997
|
}, /* @ts-ignore */
|
|
3863
3998
|
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
3864
3999
|
constructor() {
|
|
@@ -4089,6 +4224,10 @@ const DEFAULT_FILE_INPUT_CONFIG = {
|
|
|
4089
4224
|
accept: '',
|
|
4090
4225
|
fluid: false,
|
|
4091
4226
|
hideFileList: false,
|
|
4227
|
+
chooseFileLabel: 'Choose file',
|
|
4228
|
+
chooseFilesLabel: 'Choose files',
|
|
4229
|
+
dropZoneFileLabel: 'Upload file',
|
|
4230
|
+
dropZoneFilesLabel: 'Upload files',
|
|
4092
4231
|
};
|
|
4093
4232
|
|
|
4094
4233
|
const FILE_INPUT_CONFIG = new InjectionToken('FILE_INPUT_CONFIG', {
|
|
@@ -4117,6 +4256,8 @@ class FileInput extends ValueFormControl {
|
|
|
4117
4256
|
nativeInput = viewChild.required('nativeInput');
|
|
4118
4257
|
dragState = signal('idle', /* @ts-ignore */
|
|
4119
4258
|
...(ngDevMode ? [{ debugName: "dragState" }] : /* istanbul ignore next */ []));
|
|
4259
|
+
/** Nesting depth of the active drag: dragenter/dragleave pairs fired by the drop zone's children. */
|
|
4260
|
+
_dragDepth = 0;
|
|
4120
4261
|
dropZoneTemplate = contentChild('dropZone', /* @ts-ignore */
|
|
4121
4262
|
...(ngDevMode ? [{ debugName: "dropZoneTemplate" }] : /* istanbul ignore next */ []));
|
|
4122
4263
|
fileTemplate = contentChild('file', /* @ts-ignore */
|
|
@@ -4130,8 +4271,16 @@ class FileInput extends ValueFormControl {
|
|
|
4130
4271
|
return array.concat(this.controlClasses());
|
|
4131
4272
|
}, /* @ts-ignore */
|
|
4132
4273
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
4133
|
-
triggerLabel = computed(() => this.multiple() ?
|
|
4274
|
+
triggerLabel = computed(() => this.multiple() ? this._config.chooseFilesLabel : this._config.chooseFileLabel, /* @ts-ignore */
|
|
4134
4275
|
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
4276
|
+
/** Accessible name for the drop zone: the consumer's, or the configured fallback. */
|
|
4277
|
+
dropZoneLabel = computed(() => {
|
|
4278
|
+
const consumerLabel = this.ariaLabel();
|
|
4279
|
+
if (consumerLabel)
|
|
4280
|
+
return consumerLabel;
|
|
4281
|
+
return this.multiple() ? this._config.dropZoneFilesLabel : this._config.dropZoneFileLabel;
|
|
4282
|
+
}, /* @ts-ignore */
|
|
4283
|
+
...(ngDevMode ? [{ debugName: "dropZoneLabel" }] : /* istanbul ignore next */ []));
|
|
4135
4284
|
acceptHint = computed(() => {
|
|
4136
4285
|
const accept = this.accept().trim();
|
|
4137
4286
|
if (!accept)
|
|
@@ -4163,6 +4312,9 @@ class FileInput extends ValueFormControl {
|
|
|
4163
4312
|
event.preventDefault();
|
|
4164
4313
|
this.openFilePicker();
|
|
4165
4314
|
}
|
|
4315
|
+
onDragEnter() {
|
|
4316
|
+
this._dragDepth++;
|
|
4317
|
+
}
|
|
4166
4318
|
onDragOver(event) {
|
|
4167
4319
|
event.preventDefault();
|
|
4168
4320
|
if (this.notInteractive() || !event.dataTransfer)
|
|
@@ -4172,11 +4324,16 @@ class FileInput extends ValueFormControl {
|
|
|
4172
4324
|
event.dataTransfer.dropEffect = rejected ? 'none' : 'copy';
|
|
4173
4325
|
this.dragState.set(rejected ? 'invalid' : 'valid');
|
|
4174
4326
|
}
|
|
4327
|
+
// `dragleave` also fires when the pointer crosses onto a child of the drop
|
|
4328
|
+
// zone; only a leave that balances every enter means the drag actually left.
|
|
4175
4329
|
onDragLeave() {
|
|
4176
|
-
this.
|
|
4330
|
+
this._dragDepth = Math.max(0, this._dragDepth - 1);
|
|
4331
|
+
if (this._dragDepth === 0)
|
|
4332
|
+
this.dragState.set('idle');
|
|
4177
4333
|
}
|
|
4178
4334
|
onDrop(event) {
|
|
4179
4335
|
event.preventDefault();
|
|
4336
|
+
this._dragDepth = 0;
|
|
4180
4337
|
this.dragState.set('idle');
|
|
4181
4338
|
if (this.notInteractive() || !event.dataTransfer)
|
|
4182
4339
|
return;
|
|
@@ -4253,11 +4410,11 @@ class FileInput extends ValueFormControl {
|
|
|
4253
4410
|
return !matches;
|
|
4254
4411
|
}
|
|
4255
4412
|
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]=\"
|
|
4413
|
+
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
4414
|
}
|
|
4258
4415
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FileInput, decorators: [{
|
|
4259
4416
|
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]=\"
|
|
4417
|
+
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
4418
|
}], 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
4419
|
|
|
4263
4420
|
const DEFAULT_INPUT_CONFIG = {
|
|
@@ -4381,12 +4538,33 @@ class InputNumber extends ValueFormControl {
|
|
|
4381
4538
|
const parsed = target.valueAsNumber;
|
|
4382
4539
|
this.value.set(isNaN(parsed) ? null : parsed);
|
|
4383
4540
|
}
|
|
4541
|
+
/**
|
|
4542
|
+
* Clamps a typed value into `[min, max]` once editing is committed (`change`
|
|
4543
|
+
* fires on blur/Enter). The spinner arrows already honor the bounds natively;
|
|
4544
|
+
* clamping only here keeps mid-typing values ("1" on the way to "10") intact.
|
|
4545
|
+
*/
|
|
4546
|
+
onChange(event) {
|
|
4547
|
+
const current = this.value();
|
|
4548
|
+
if (current === null)
|
|
4549
|
+
return;
|
|
4550
|
+
const min = this.min();
|
|
4551
|
+
const max = this.max();
|
|
4552
|
+
let clamped = current;
|
|
4553
|
+
if (min !== undefined && clamped < min)
|
|
4554
|
+
clamped = min;
|
|
4555
|
+
if (max !== undefined && clamped > max)
|
|
4556
|
+
clamped = max;
|
|
4557
|
+
if (clamped === current)
|
|
4558
|
+
return;
|
|
4559
|
+
this.value.set(clamped);
|
|
4560
|
+
event.target.value = String(clamped);
|
|
4561
|
+
}
|
|
4384
4562
|
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"] }] });
|
|
4563
|
+
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
4564
|
}
|
|
4387
4565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputNumber, decorators: [{
|
|
4388
4566
|
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"] }]
|
|
4567
|
+
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
4568
|
}], 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
4569
|
|
|
4392
4570
|
// Token characters recognised inside a mask pattern; every other character is a
|
|
@@ -4620,13 +4798,13 @@ class Password extends ValueFormControl {
|
|
|
4620
4798
|
this.visible.update(prev => !prev);
|
|
4621
4799
|
}
|
|
4622
4800
|
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
|
|
4801
|
+
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
4802
|
}
|
|
4625
4803
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, decorators: [{
|
|
4626
4804
|
type: Component,
|
|
4627
4805
|
args: [{ selector: 'tls-password', imports: [FormControlGroup, NgTemplateOutlet, Loader], host: {
|
|
4628
4806
|
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
|
|
4807
|
+
}, 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
4808
|
}], 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
4809
|
|
|
4632
4810
|
// Matches strings containing only numeric digits (0–9).
|
|
@@ -4711,22 +4889,28 @@ class PinInput extends ValueFormControl {
|
|
|
4711
4889
|
}
|
|
4712
4890
|
onPaste(event, index) {
|
|
4713
4891
|
event.preventDefault();
|
|
4892
|
+
if (this.notInteractive())
|
|
4893
|
+
return;
|
|
4714
4894
|
const clipboardData = event.clipboardData;
|
|
4715
4895
|
if (!clipboardData)
|
|
4716
4896
|
return;
|
|
4717
|
-
|
|
4897
|
+
// Keep only the characters the input accepts, so text copied with
|
|
4898
|
+
// separators ("123 456", "123-456") pastes as its usable digits.
|
|
4718
4899
|
const allowedRegExp = this._getAllowedRegularExpression();
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4900
|
+
const chars = clipboardData
|
|
4901
|
+
.getData('text')
|
|
4902
|
+
.split('')
|
|
4903
|
+
.filter(char => allowedRegExp.test(char))
|
|
4904
|
+
.slice(0, this.length() - index);
|
|
4722
4905
|
if (!chars.length)
|
|
4723
4906
|
return;
|
|
4907
|
+
// Overwrite from the focused cell onward.
|
|
4724
4908
|
const array = this._getValueArray();
|
|
4725
|
-
for (let
|
|
4726
|
-
array[index +
|
|
4909
|
+
for (let offset = 0; offset < chars.length; offset++) {
|
|
4910
|
+
array[index + offset] = chars[offset];
|
|
4727
4911
|
}
|
|
4728
4912
|
this._commitArray(array);
|
|
4729
|
-
this._focusCell(
|
|
4913
|
+
this._focusCell(index + chars.length);
|
|
4730
4914
|
}
|
|
4731
4915
|
onFocus(event) {
|
|
4732
4916
|
event.target.select();
|
|
@@ -4784,6 +4968,12 @@ const RADIO_BUTTON_CONFIG = new InjectionToken('RADIO_BUTTON_CONFIG', {
|
|
|
4784
4968
|
factory: () => DEFAULT_RADIO_BUTTON_CONFIG,
|
|
4785
4969
|
});
|
|
4786
4970
|
|
|
4971
|
+
/**
|
|
4972
|
+
* A single radio option bound to a shared `value` model; the option whose
|
|
4973
|
+
* `radioValue` equals the model is checked. When several radio buttons form one
|
|
4974
|
+
* group, wrap each in its own `tls-form-item` (the item's label names that
|
|
4975
|
+
* option), rather than one item around the whole group.
|
|
4976
|
+
*/
|
|
4787
4977
|
class RadioButton extends ValueFormControl {
|
|
4788
4978
|
_config = inject(RADIO_BUTTON_CONFIG);
|
|
4789
4979
|
CLASS_NAME = 'tls-radio-button';
|
|
@@ -4811,14 +5001,14 @@ class RadioButton extends ValueFormControl {
|
|
|
4811
5001
|
this.value.set(this.radioValue());
|
|
4812
5002
|
}
|
|
4813
5003
|
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" });
|
|
5004
|
+
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
5005
|
}
|
|
4816
5006
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioButton, decorators: [{
|
|
4817
5007
|
type: Component,
|
|
4818
5008
|
args: [{ selector: 'tls-radio-button', imports: [], host: {
|
|
4819
5009
|
'[class]': 'hostClasses()',
|
|
4820
5010
|
'[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" }]
|
|
5011
|
+
}, 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
5012
|
}], 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
5013
|
|
|
4824
5014
|
const DEFAULT_MULTI_SELECT_CONFIG = {
|
|
@@ -4828,6 +5018,7 @@ const DEFAULT_MULTI_SELECT_CONFIG = {
|
|
|
4828
5018
|
clearable: false,
|
|
4829
5019
|
maxLabels: 2,
|
|
4830
5020
|
clearLabel: 'Clear',
|
|
5021
|
+
selectedCountLabel: count => `${count} selected`,
|
|
4831
5022
|
};
|
|
4832
5023
|
|
|
4833
5024
|
const MULTI_SELECT_CONFIG = new InjectionToken('MULTI_SELECT_CONFIG', {
|
|
@@ -4863,7 +5054,7 @@ class MultiSelect extends AbstractSelect {
|
|
|
4863
5054
|
return '';
|
|
4864
5055
|
const max = this.maxLabels();
|
|
4865
5056
|
if (selected.length > max)
|
|
4866
|
-
return
|
|
5057
|
+
return this._config.selectedCountLabel(selected.length);
|
|
4867
5058
|
const optionMap = new Map(this.normalizedOptions().map(option => [option.value, option.label]));
|
|
4868
5059
|
return selected.map(value => optionMap.get(value) ?? String(value)).join(', ');
|
|
4869
5060
|
}, /* @ts-ignore */
|
|
@@ -4871,6 +5062,9 @@ class MultiSelect extends AbstractSelect {
|
|
|
4871
5062
|
isSelected(option) {
|
|
4872
5063
|
return this.selectedValues().has(option.value);
|
|
4873
5064
|
}
|
|
5065
|
+
isOptionSelected(option) {
|
|
5066
|
+
return this.isSelected(option);
|
|
5067
|
+
}
|
|
4874
5068
|
toggleOption(option) {
|
|
4875
5069
|
if (option.disabled)
|
|
4876
5070
|
return;
|
|
@@ -4896,13 +5090,13 @@ class MultiSelect extends AbstractSelect {
|
|
|
4896
5090
|
this.toggleOption(option);
|
|
4897
5091
|
}
|
|
4898
5092
|
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 (
|
|
5093
|
+
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
5094
|
}
|
|
4901
5095
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MultiSelect, decorators: [{
|
|
4902
5096
|
type: Component,
|
|
4903
|
-
args: [{ selector: 'tls-multi-select', imports: [Loader, Icon], host: {
|
|
5097
|
+
args: [{ selector: 'tls-multi-select', imports: [Loader, Icon, NgTemplateOutlet], host: {
|
|
4904
5098
|
'[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 (
|
|
5099
|
+
}, 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
5100
|
}], 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
5101
|
|
|
4908
5102
|
const DEFAULT_SELECT_CONFIG = {
|
|
@@ -4954,23 +5148,32 @@ class Select extends AbstractSelect {
|
|
|
4954
5148
|
this.value.set(option.value);
|
|
4955
5149
|
this.close();
|
|
4956
5150
|
}
|
|
5151
|
+
isOptionSelected(option) {
|
|
5152
|
+
return option.value === this.value();
|
|
5153
|
+
}
|
|
4957
5154
|
clear() {
|
|
4958
5155
|
this.value.set(null);
|
|
4959
5156
|
}
|
|
4960
5157
|
getInitialActiveIndex() {
|
|
4961
|
-
|
|
5158
|
+
const options = this.visibleOptions();
|
|
5159
|
+
const selectedIndex = options.findIndex(option => !option.disabled && option.value === this.value());
|
|
5160
|
+
if (selectedIndex !== -1)
|
|
5161
|
+
return selectedIndex;
|
|
5162
|
+
// No selection: start on the first enabled option, matching the other
|
|
5163
|
+
// listbox controls, so the panel opens with a visible active option.
|
|
5164
|
+
return options.findIndex(option => !option.disabled);
|
|
4962
5165
|
}
|
|
4963
5166
|
commitActiveOption(option) {
|
|
4964
5167
|
this.select(option);
|
|
4965
5168
|
}
|
|
4966
5169
|
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 (
|
|
5170
|
+
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
5171
|
}
|
|
4969
5172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Select, decorators: [{
|
|
4970
5173
|
type: Component,
|
|
4971
|
-
args: [{ selector: 'tls-select', imports: [Loader, Icon], host: {
|
|
5174
|
+
args: [{ selector: 'tls-select', imports: [Loader, Icon, NgTemplateOutlet], host: {
|
|
4972
5175
|
'[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 (
|
|
5176
|
+
}, 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
5177
|
}], 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
5178
|
|
|
4976
5179
|
const DEFAULT_SWITCH_CONFIG = {
|
|
@@ -4999,9 +5202,13 @@ class Switch extends CheckboxFormControl {
|
|
|
4999
5202
|
}, /* @ts-ignore */
|
|
5000
5203
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
5001
5204
|
// Protected methods
|
|
5002
|
-
toggle() {
|
|
5003
|
-
if (this.notInteractive())
|
|
5205
|
+
toggle(event) {
|
|
5206
|
+
if (this.notInteractive()) {
|
|
5207
|
+
// Keep the native input from flipping its own checked state.
|
|
5208
|
+
if (event)
|
|
5209
|
+
event.preventDefault();
|
|
5004
5210
|
return;
|
|
5211
|
+
}
|
|
5005
5212
|
this.checked.update(prev => !prev);
|
|
5006
5213
|
}
|
|
5007
5214
|
onKeyboardToggle(event) {
|
|
@@ -5009,22 +5216,14 @@ class Switch extends CheckboxFormControl {
|
|
|
5009
5216
|
this.toggle();
|
|
5010
5217
|
}
|
|
5011
5218
|
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: {
|
|
5219
|
+
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
5220
|
}
|
|
5014
5221
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, decorators: [{
|
|
5015
5222
|
type: Component,
|
|
5016
5223
|
args: [{ selector: 'tls-switch', host: {
|
|
5017
|
-
role: 'switch',
|
|
5018
5224
|
'[class]': 'hostClasses()',
|
|
5019
|
-
'
|
|
5020
|
-
|
|
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" }]
|
|
5225
|
+
'(click)': 'toggle($event)',
|
|
5226
|
+
}, 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
5227
|
}], 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
5228
|
|
|
5030
5229
|
const DEFAULT_TEXTAREA_CONFIG = {
|
|
@@ -5956,13 +6155,29 @@ class Pagination {
|
|
|
5956
6155
|
labels = this._config.labels;
|
|
5957
6156
|
pageCount = computed(() => Math.ceil(this.total() / this.pageSize()), /* @ts-ignore */
|
|
5958
6157
|
...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
|
|
6158
|
+
/** Last valid page; at least 1 so the current page never leaves the 1-based range. */
|
|
6159
|
+
lastValidPage = computed(() => Math.max(1, this.pageCount()), /* @ts-ignore */
|
|
6160
|
+
...(ngDevMode ? [{ debugName: "lastValidPage" }] : /* istanbul ignore next */ []));
|
|
5959
6161
|
visiblePages = computed(() => this._buildPages(this.pageCount(), this.value(), this.siblings(), this.boundaries()), /* @ts-ignore */
|
|
5960
6162
|
...(ngDevMode ? [{ debugName: "visiblePages" }] : /* istanbul ignore next */ []));
|
|
5961
6163
|
classes = computed(() => ['tls-pagination', `tls-pagination--${this.size()}`], /* @ts-ignore */
|
|
5962
6164
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
6165
|
+
constructor() {
|
|
6166
|
+
// Normalize an out-of-range page — a shrinking `total`, or an external set
|
|
6167
|
+
// (e.g. a query-param restore) beyond the last page — back into range. While
|
|
6168
|
+
// `total` is 0 the range is unknown (it usually arrives async), so a
|
|
6169
|
+
// restored page is left alone rather than clamped against nothing.
|
|
6170
|
+
effect(() => {
|
|
6171
|
+
if (this.pageCount() < 1)
|
|
6172
|
+
return;
|
|
6173
|
+
const clamped = this._clamp(this.value());
|
|
6174
|
+
if (clamped !== this.value())
|
|
6175
|
+
this.value.set(clamped);
|
|
6176
|
+
});
|
|
6177
|
+
}
|
|
5963
6178
|
// Protected methods
|
|
5964
6179
|
setPage(page) {
|
|
5965
|
-
this.value.set(page);
|
|
6180
|
+
this.value.set(this._clamp(page));
|
|
5966
6181
|
}
|
|
5967
6182
|
firstPage() {
|
|
5968
6183
|
this.value.set(1);
|
|
@@ -5971,12 +6186,15 @@ class Pagination {
|
|
|
5971
6186
|
this.value.update(page => Math.max(1, page - 1));
|
|
5972
6187
|
}
|
|
5973
6188
|
nextPage() {
|
|
5974
|
-
this.value.update(page => Math.min(this.
|
|
6189
|
+
this.value.update(page => Math.min(this.lastValidPage(), page + 1));
|
|
5975
6190
|
}
|
|
5976
6191
|
lastPage() {
|
|
5977
|
-
this.value.set(this.
|
|
6192
|
+
this.value.set(this.lastValidPage());
|
|
5978
6193
|
}
|
|
5979
6194
|
// Private methods
|
|
6195
|
+
_clamp(page) {
|
|
6196
|
+
return Math.min(Math.max(1, page), this.lastValidPage());
|
|
6197
|
+
}
|
|
5980
6198
|
/** Returns an inclusive array of integers from start to end. Returns [] if end < start. */
|
|
5981
6199
|
_range(start, end) {
|
|
5982
6200
|
const length = end - start + 1;
|
|
@@ -6022,7 +6240,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
6022
6240
|
'[attr.aria-label]': 'ariaLabelledby() ? null : ariaLabel()',
|
|
6023
6241
|
'[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
|
|
6024
6242
|
}, 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 }] }] } });
|
|
6243
|
+
}], 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
6244
|
|
|
6027
6245
|
const DEFAULT_PAGINATION_QUERY_SYNC_CONFIG = {
|
|
6028
6246
|
paramKey: 'page',
|
|
@@ -6030,6 +6248,12 @@ const DEFAULT_PAGINATION_QUERY_SYNC_CONFIG = {
|
|
|
6030
6248
|
|
|
6031
6249
|
const PAGINATION_QUERY_SYNC_CONFIG = new InjectionToken('PAGINATION_QUERY_SYNC_CONFIG', { factory: () => DEFAULT_PAGINATION_QUERY_SYNC_CONFIG });
|
|
6032
6250
|
|
|
6251
|
+
/**
|
|
6252
|
+
* Mirrors the current page into a URL query param. The param is only written
|
|
6253
|
+
* once the page actually changes — the initial page (the default, or the one
|
|
6254
|
+
* restored from the URL) never stamps the param, so a freshly loaded page
|
|
6255
|
+
* keeps its URL untouched.
|
|
6256
|
+
*/
|
|
6033
6257
|
class PaginationQuerySyncDirective extends QuerySyncDirective {
|
|
6034
6258
|
_pagination = inject(Pagination);
|
|
6035
6259
|
_config = inject(PAGINATION_QUERY_SYNC_CONFIG);
|
|
@@ -6037,11 +6261,23 @@ class PaginationQuerySyncDirective extends QuerySyncDirective {
|
|
|
6037
6261
|
// The selector doubles as the input, so a valueless `tlsPaginationQuerySync` binds `''`.
|
|
6038
6262
|
// Coerce an empty value back to the configured default param key.
|
|
6039
6263
|
tlsPaginationQuerySync = input(this._config.paramKey, { ...(ngDevMode ? { debugName: "tlsPaginationQuerySync" } : /* istanbul ignore next */ {}), transform: (value) => value || this._config.paramKey });
|
|
6264
|
+
// State
|
|
6265
|
+
/** Last page mirrored to the URL; `null` until the initial page settles. */
|
|
6266
|
+
_lastSynced = null;
|
|
6040
6267
|
constructor() {
|
|
6041
6268
|
super();
|
|
6042
6269
|
effect(() => {
|
|
6043
6270
|
const page = this._pagination.value();
|
|
6044
6271
|
const param = this.tlsPaginationQuerySync();
|
|
6272
|
+
// The first settled page is the page's initial state; recording it would
|
|
6273
|
+
// stamp the URL on load without any user interaction.
|
|
6274
|
+
if (this._lastSynced === null) {
|
|
6275
|
+
this._lastSynced = page;
|
|
6276
|
+
return;
|
|
6277
|
+
}
|
|
6278
|
+
if (page === this._lastSynced)
|
|
6279
|
+
return;
|
|
6280
|
+
this._lastSynced = page;
|
|
6045
6281
|
this.syncToUrl(param, page);
|
|
6046
6282
|
});
|
|
6047
6283
|
}
|
|
@@ -6962,6 +7198,20 @@ class Tabs {
|
|
|
6962
7198
|
this.selected.set(firstEnabledTab.value());
|
|
6963
7199
|
});
|
|
6964
7200
|
}
|
|
7201
|
+
// Public methods
|
|
7202
|
+
/**
|
|
7203
|
+
* Resolves serialized text (e.g. a URL query param) back to the matching
|
|
7204
|
+
* tab's actual value, so a numeric tab value round-trips with its own type
|
|
7205
|
+
* instead of a string that would never match. Returns `undefined` when no tab
|
|
7206
|
+
* matches — including while the projected tabs have not resolved yet, so a
|
|
7207
|
+
* reactive caller can retry once they have.
|
|
7208
|
+
*/
|
|
7209
|
+
findTabValue(text) {
|
|
7210
|
+
const match = this.tabs().find(tab => String(tab.value()) === text);
|
|
7211
|
+
if (!match)
|
|
7212
|
+
return undefined;
|
|
7213
|
+
return match.value();
|
|
7214
|
+
}
|
|
6965
7215
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6966
7216
|
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
7217
|
}
|
|
@@ -6980,6 +7230,12 @@ const TABS_QUERY_SYNC_CONFIG = new InjectionToken('TABS_QUERY_SYNC_CONFIG', {
|
|
|
6980
7230
|
factory: () => DEFAULT_TABS_QUERY_SYNC_CONFIG,
|
|
6981
7231
|
});
|
|
6982
7232
|
|
|
7233
|
+
/**
|
|
7234
|
+
* Mirrors the selected tab into a URL query param. The param is only written
|
|
7235
|
+
* once the selection actually changes — the initial selection (the default
|
|
7236
|
+
* first tab, or the one restored from the URL) never stamps the param, so a
|
|
7237
|
+
* freshly loaded page keeps its URL untouched.
|
|
7238
|
+
*/
|
|
6983
7239
|
class TabsQuerySyncDirective extends QuerySyncDirective {
|
|
6984
7240
|
_tabs = inject(Tabs);
|
|
6985
7241
|
_config = inject(TABS_QUERY_SYNC_CONFIG);
|
|
@@ -6987,22 +7243,47 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
|
|
|
6987
7243
|
// The selector doubles as the input, so a valueless `tlsTabsQuerySync` binds `''`.
|
|
6988
7244
|
// Coerce an empty value back to the configured default param key.
|
|
6989
7245
|
tlsTabsQuerySync = input(this._config.paramKey, { ...(ngDevMode ? { debugName: "tlsTabsQuerySync" } : /* istanbul ignore next */ {}), transform: (value) => value || this._config.paramKey });
|
|
7246
|
+
// State
|
|
7247
|
+
/** Param value captured once at startup, pending until a matching tab resolves. */
|
|
7248
|
+
_pendingRestore = null;
|
|
7249
|
+
_restoreRead = false;
|
|
7250
|
+
/** Last selection mirrored to the URL; `undefined` until the initial selection settles. */
|
|
7251
|
+
_lastSynced;
|
|
6990
7252
|
constructor() {
|
|
6991
7253
|
super();
|
|
7254
|
+
// Restore the selection from the URL. Tab values may be numbers, so the
|
|
7255
|
+
// param is matched against each tab's serialized value; projected tabs
|
|
7256
|
+
// resolve after init, so this retries until a match appears.
|
|
7257
|
+
effect(() => {
|
|
7258
|
+
if (!this._restoreRead) {
|
|
7259
|
+
this._restoreRead = true;
|
|
7260
|
+
this._pendingRestore = this.readParam(this.tlsTabsQuerySync());
|
|
7261
|
+
}
|
|
7262
|
+
if (this._pendingRestore === null)
|
|
7263
|
+
return;
|
|
7264
|
+
const value = this._tabs.findTabValue(this._pendingRestore);
|
|
7265
|
+
if (value === undefined)
|
|
7266
|
+
return;
|
|
7267
|
+
this._pendingRestore = null;
|
|
7268
|
+
this._tabs.selected.set(value);
|
|
7269
|
+
});
|
|
6992
7270
|
effect(() => {
|
|
6993
7271
|
const selected = this._tabs.selected();
|
|
6994
7272
|
const param = this.tlsTabsQuerySync();
|
|
6995
7273
|
if (selected === undefined)
|
|
6996
7274
|
return;
|
|
7275
|
+
// The first settled selection is the page's initial state; recording it
|
|
7276
|
+
// would stamp the URL on load without any user interaction.
|
|
7277
|
+
if (this._lastSynced === undefined) {
|
|
7278
|
+
this._lastSynced = selected;
|
|
7279
|
+
return;
|
|
7280
|
+
}
|
|
7281
|
+
if (selected === this._lastSynced)
|
|
7282
|
+
return;
|
|
7283
|
+
this._lastSynced = selected;
|
|
6997
7284
|
this.syncToUrl(param, selected);
|
|
6998
7285
|
});
|
|
6999
7286
|
}
|
|
7000
|
-
// Lifecycle
|
|
7001
|
-
ngOnInit() {
|
|
7002
|
-
const value = this.readParam(this.tlsTabsQuerySync());
|
|
7003
|
-
if (value !== null)
|
|
7004
|
-
this._tabs.selected.set(value);
|
|
7005
|
-
}
|
|
7006
7287
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7007
7288
|
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
7289
|
}
|
|
@@ -7117,11 +7398,6 @@ const TOAST_COLLAPSED_VISIBLE_DEPTH = 3;
|
|
|
7117
7398
|
// in sync with `--spacing-3` in `_toast.scss`; it is a transform offset computed
|
|
7118
7399
|
// in TypeScript, so it lives here as a number rather than a spacing token.
|
|
7119
7400
|
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
7401
|
|
|
7126
7402
|
const DEFAULT_TOAST_CONFIG = {
|
|
7127
7403
|
position: 'top-end',
|
|
@@ -7296,6 +7572,7 @@ class ToastOutlet {
|
|
|
7296
7572
|
// Injections
|
|
7297
7573
|
_service = inject(ToastService);
|
|
7298
7574
|
_destroyRef = inject(DestroyRef);
|
|
7575
|
+
_elementRef = inject(ElementRef);
|
|
7299
7576
|
// State
|
|
7300
7577
|
toasts = this._service.toasts;
|
|
7301
7578
|
_pointerInside = signal(false, /* @ts-ignore */
|
|
@@ -7399,6 +7676,15 @@ class ToastOutlet {
|
|
|
7399
7676
|
this._service.resume();
|
|
7400
7677
|
}
|
|
7401
7678
|
});
|
|
7679
|
+
// An emptied stack ends the interaction: without this, a touch-expanded
|
|
7680
|
+
// pile would still count as "interacting" when the next toast arrives,
|
|
7681
|
+
// freezing its auto-dismiss timer from the start.
|
|
7682
|
+
effect(() => {
|
|
7683
|
+
if (this.toasts().length > 0)
|
|
7684
|
+
return;
|
|
7685
|
+
this._pointerInside.set(false);
|
|
7686
|
+
this._focusInside.set(false);
|
|
7687
|
+
});
|
|
7402
7688
|
this._destroyRef.onDestroy(() => {
|
|
7403
7689
|
if (this._resizeObserver)
|
|
7404
7690
|
this._resizeObserver.disconnect();
|
|
@@ -7416,7 +7702,20 @@ class ToastOutlet {
|
|
|
7416
7702
|
onPointerEnter() {
|
|
7417
7703
|
this._pointerInside.set(true);
|
|
7418
7704
|
}
|
|
7419
|
-
onPointerLeave() {
|
|
7705
|
+
onPointerLeave(event) {
|
|
7706
|
+
// A tap retires its pointer immediately, firing `pointerleave` within the
|
|
7707
|
+
// same gesture — collapsing here would undo the expansion the tap just
|
|
7708
|
+
// made. A touch-expanded pile stays open; it collapses once its toasts are
|
|
7709
|
+
// dismissed (or with focus, via `focusout`).
|
|
7710
|
+
if (event.pointerType === 'touch')
|
|
7711
|
+
return;
|
|
7712
|
+
this._pointerInside.set(false);
|
|
7713
|
+
}
|
|
7714
|
+
onDocumentPointerDown(event) {
|
|
7715
|
+
if (event.pointerType !== 'touch' || !this._pointerInside())
|
|
7716
|
+
return;
|
|
7717
|
+
if (this._elementRef.nativeElement.contains(event.target))
|
|
7718
|
+
return;
|
|
7420
7719
|
this._pointerInside.set(false);
|
|
7421
7720
|
}
|
|
7422
7721
|
onFocusIn() {
|
|
@@ -7430,11 +7729,16 @@ class ToastOutlet {
|
|
|
7430
7729
|
this._heights.set(this._toastElements().map(element => element.nativeElement.offsetHeight));
|
|
7431
7730
|
}
|
|
7432
7731
|
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 (
|
|
7732
|
+
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
7733
|
}
|
|
7435
7734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToastOutlet, decorators: [{
|
|
7436
7735
|
type: Component,
|
|
7437
|
-
args: [{ selector: 'tls-toast-outlet', imports: [Toast], host: {
|
|
7736
|
+
args: [{ selector: 'tls-toast-outlet', imports: [Toast], host: {
|
|
7737
|
+
class: 'tls-toast-outlet',
|
|
7738
|
+
// Touch has no hover-out; a tap outside the stack is what collapses a
|
|
7739
|
+
// touch-expanded pile (and resumes the auto-dismiss timers).
|
|
7740
|
+
'(document:pointerdown)': 'onDocumentPointerDown($event)',
|
|
7741
|
+
}, 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
7742
|
}], ctorParameters: () => [], propDecorators: { _toastElements: [{ type: i0.ViewChildren, args: ['toastEl', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
7439
7743
|
|
|
7440
7744
|
class Tooltip {
|
|
@@ -7498,11 +7802,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
7498
7802
|
}]
|
|
7499
7803
|
}], 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
7804
|
|
|
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
7805
|
class TooltipService {
|
|
7507
7806
|
_overlay = inject(Overlay);
|
|
7508
7807
|
_overlayRef = null;
|
|
@@ -7537,7 +7836,7 @@ class TooltipService {
|
|
|
7537
7836
|
const overlayRef = this._overlayRef;
|
|
7538
7837
|
this._overlayRef = null;
|
|
7539
7838
|
overlayRef.detach();
|
|
7540
|
-
|
|
7839
|
+
disposeAfterLeaveAnimation(overlayRef);
|
|
7541
7840
|
}
|
|
7542
7841
|
dispose() {
|
|
7543
7842
|
if (!this._overlayRef)
|
|
@@ -7545,27 +7844,6 @@ class TooltipService {
|
|
|
7545
7844
|
this._overlayRef.dispose();
|
|
7546
7845
|
this._overlayRef = null;
|
|
7547
7846
|
}
|
|
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
7847
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7570
7848
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService });
|
|
7571
7849
|
}
|
|
@@ -7585,12 +7863,22 @@ const TOOLTIP_CONFIG = new InjectionToken('TOOLTIP_CONFIG', {
|
|
|
7585
7863
|
factory: () => DEFAULT_TOOLTIP_CONFIG,
|
|
7586
7864
|
});
|
|
7587
7865
|
|
|
7866
|
+
/**
|
|
7867
|
+
* Attaches a tooltip to the host element. Shows on hover and on keyboard focus,
|
|
7868
|
+
* toggles on touch, and dismisses on Escape without moving the pointer or focus
|
|
7869
|
+
* (WCAG 1.4.13). The tooltip is linked to the host via `aria-describedby` while
|
|
7870
|
+
* visible.
|
|
7871
|
+
*
|
|
7872
|
+
* Interaction is driven by pointer events, branching on `pointerType`: mouse
|
|
7873
|
+
* and pen get hover semantics, touch gets tap-to-toggle. A single stream avoids
|
|
7874
|
+
* the synthesized mouse events browsers replay after a tap.
|
|
7875
|
+
*/
|
|
7588
7876
|
class TooltipDirective {
|
|
7589
7877
|
_tooltipService = inject(TooltipService);
|
|
7590
7878
|
_elementRef = inject(ElementRef);
|
|
7591
7879
|
_renderer = inject(Renderer2);
|
|
7592
7880
|
_config = inject(TOOLTIP_CONFIG);
|
|
7593
|
-
content = input('
|
|
7881
|
+
content = input('', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
|
|
7594
7882
|
data = input(null, /* @ts-ignore */
|
|
7595
7883
|
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
7596
7884
|
tooltipDisabled = input(false, /* @ts-ignore */
|
|
@@ -7615,42 +7903,66 @@ class TooltipDirective {
|
|
|
7615
7903
|
}, /* @ts-ignore */
|
|
7616
7904
|
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
7617
7905
|
// Protected methods
|
|
7618
|
-
|
|
7619
|
-
|
|
7906
|
+
onPointerEnter(event) {
|
|
7907
|
+
// A touch "enter" is a tap, not a hover — toggle instead. The default is
|
|
7908
|
+
// not prevented, so the tap still activates an interactive host.
|
|
7909
|
+
if (event.pointerType === 'touch') {
|
|
7910
|
+
if (this._visible()) {
|
|
7911
|
+
this._hide();
|
|
7912
|
+
}
|
|
7913
|
+
else {
|
|
7914
|
+
this._show();
|
|
7915
|
+
}
|
|
7916
|
+
return;
|
|
7917
|
+
}
|
|
7918
|
+
this._show({ x: event.clientX, y: event.clientY });
|
|
7620
7919
|
}
|
|
7621
|
-
|
|
7920
|
+
onPointerMove(event) {
|
|
7921
|
+
if (event.pointerType === 'touch')
|
|
7922
|
+
return;
|
|
7622
7923
|
if (this.tooltipOrigin() === 'cursor') {
|
|
7623
7924
|
this._tooltipService.move({ x: event.clientX, y: event.clientY }, this._positions());
|
|
7624
7925
|
}
|
|
7625
7926
|
}
|
|
7626
|
-
|
|
7927
|
+
onPointerLeave(event) {
|
|
7928
|
+
// A tap retires its pointer immediately, firing `pointerleave` within the
|
|
7929
|
+
// same gesture; hiding here would undo the toggle the tap just made.
|
|
7930
|
+
if (event.pointerType === 'touch')
|
|
7931
|
+
return;
|
|
7627
7932
|
this._hide();
|
|
7628
7933
|
}
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7934
|
+
onFocus() {
|
|
7935
|
+
// No cursor to anchor to; a focus-triggered tooltip always anchors to the element.
|
|
7936
|
+
this._show();
|
|
7937
|
+
}
|
|
7938
|
+
onBlur() {
|
|
7939
|
+
this._hide();
|
|
7940
|
+
}
|
|
7941
|
+
/** Dismisses the tooltip without moving the pointer or focus (WCAG 1.4.13). */
|
|
7942
|
+
onEscape() {
|
|
7943
|
+
if (this._visible())
|
|
7632
7944
|
this._hide();
|
|
7633
|
-
}
|
|
7634
|
-
else {
|
|
7635
|
-
this._show(event.touches[0]);
|
|
7636
|
-
}
|
|
7637
7945
|
}
|
|
7638
7946
|
// Private methods
|
|
7639
|
-
_show(
|
|
7640
|
-
if (this.tooltipDisabled())
|
|
7947
|
+
_show(point) {
|
|
7948
|
+
if (this.tooltipDisabled() || this._visible())
|
|
7949
|
+
return;
|
|
7950
|
+
// Nothing to render — an empty string would show a bare bubble.
|
|
7951
|
+
const content = this.content();
|
|
7952
|
+
if (content === '')
|
|
7641
7953
|
return;
|
|
7642
7954
|
this._visible.set(true);
|
|
7643
7955
|
const tooltipPortal = new ComponentPortal(Tooltip);
|
|
7644
|
-
const origin = this.tooltipOrigin() === 'cursor'
|
|
7645
|
-
? { x: event.clientX, y: event.clientY }
|
|
7646
|
-
: this._elementRef.nativeElement;
|
|
7956
|
+
const origin = this.tooltipOrigin() === 'cursor' && point ? point : this._elementRef.nativeElement;
|
|
7647
7957
|
const tooltipRef = this._tooltipService.show(origin, this._positions(), tooltipPortal);
|
|
7648
|
-
tooltipRef.instance.content.set(
|
|
7958
|
+
tooltipRef.instance.content.set(content);
|
|
7649
7959
|
tooltipRef.instance.templateData.set(this.data());
|
|
7650
7960
|
tooltipRef.instance.color.set(this.tooltipColor());
|
|
7651
7961
|
this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipRef.instance.id);
|
|
7652
7962
|
}
|
|
7653
7963
|
_hide() {
|
|
7964
|
+
if (!this._visible())
|
|
7965
|
+
return;
|
|
7654
7966
|
this._tooltipService.hide();
|
|
7655
7967
|
this._visible.set(false);
|
|
7656
7968
|
this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
|
|
@@ -7661,7 +7973,7 @@ class TooltipDirective {
|
|
|
7661
7973
|
this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
|
|
7662
7974
|
}
|
|
7663
7975
|
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: { "
|
|
7976
|
+
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
7977
|
}
|
|
7666
7978
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
7667
7979
|
type: Directive,
|
|
@@ -7669,21 +7981,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
7669
7981
|
selector: '[tlsTooltip]',
|
|
7670
7982
|
providers: [TooltipService],
|
|
7671
7983
|
host: {
|
|
7672
|
-
'(
|
|
7673
|
-
'(
|
|
7674
|
-
'(
|
|
7675
|
-
'(
|
|
7984
|
+
'(pointerenter)': 'onPointerEnter($event)',
|
|
7985
|
+
'(pointermove)': 'onPointerMove($event)',
|
|
7986
|
+
'(pointerleave)': 'onPointerLeave($event)',
|
|
7987
|
+
'(focus)': 'onFocus()',
|
|
7988
|
+
'(blur)': 'onBlur()',
|
|
7989
|
+
'(document:keydown.escape)': 'onEscape()',
|
|
7676
7990
|
},
|
|
7677
7991
|
}]
|
|
7678
7992
|
}], 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
7993
|
|
|
7680
7994
|
// Features
|
|
7681
7995
|
|
|
7682
|
-
const provideThalassicUIConfig = (config) => {
|
|
7996
|
+
const provideThalassicUIConfig = (config = {}) => {
|
|
7997
|
+
const components = config.components ?? {};
|
|
7683
7998
|
// Query-sync configs nest under their parent feature in the public API but resolve to their own
|
|
7684
7999
|
// separate DI tokens, so split the nested `querySync` off from the component's own config.
|
|
7685
|
-
const { querySync: paginationQuerySync, ...pagination } =
|
|
7686
|
-
const { querySync: tabsQuerySync, ...tabs } =
|
|
8000
|
+
const { querySync: paginationQuerySync, ...pagination } = components.pagination ?? {};
|
|
8001
|
+
const { querySync: tabsQuerySync, ...tabs } = components.tabs ?? {};
|
|
7687
8002
|
const accessibility = deepMerge(DEFAULT_ACCESSIBILITY_CONFIG, config.accessibility);
|
|
7688
8003
|
return makeEnvironmentProviders([
|
|
7689
8004
|
// Cross-cutting accessibility policy
|
|
@@ -7711,82 +8026,82 @@ const provideThalassicUIConfig = (config) => {
|
|
|
7711
8026
|
// Components
|
|
7712
8027
|
{
|
|
7713
8028
|
provide: ALERT_CONFIG,
|
|
7714
|
-
useValue: deepMerge(DEFAULT_ALERT_CONFIG,
|
|
8029
|
+
useValue: deepMerge(DEFAULT_ALERT_CONFIG, components.alert),
|
|
7715
8030
|
},
|
|
7716
8031
|
{
|
|
7717
8032
|
provide: AUTOCOMPLETE_CONFIG,
|
|
7718
|
-
useValue: deepMerge(DEFAULT_AUTOCOMPLETE_CONFIG,
|
|
8033
|
+
useValue: deepMerge(DEFAULT_AUTOCOMPLETE_CONFIG, components.autocomplete),
|
|
7719
8034
|
},
|
|
7720
8035
|
{
|
|
7721
8036
|
provide: BUTTON_CONFIG,
|
|
7722
|
-
useValue: deepMerge(DEFAULT_BUTTON_CONFIG,
|
|
8037
|
+
useValue: deepMerge(DEFAULT_BUTTON_CONFIG, components.button),
|
|
7723
8038
|
},
|
|
7724
8039
|
{
|
|
7725
8040
|
provide: CALENDAR_CONFIG,
|
|
7726
8041
|
// `labels` is a deep-partial override; deepMerge merges it recursively, but its
|
|
7727
8042
|
// `Partial<T>` signature only models a shallow partial, so cast to it.
|
|
7728
|
-
useValue: deepMerge(DEFAULT_CALENDAR_CONFIG,
|
|
8043
|
+
useValue: deepMerge(DEFAULT_CALENDAR_CONFIG, components.calendar),
|
|
7729
8044
|
},
|
|
7730
8045
|
{
|
|
7731
8046
|
provide: CHECKBOX_CONFIG,
|
|
7732
|
-
useValue: deepMerge(DEFAULT_CHECKBOX_CONFIG,
|
|
8047
|
+
useValue: deepMerge(DEFAULT_CHECKBOX_CONFIG, components.checkbox),
|
|
7733
8048
|
},
|
|
7734
|
-
{ provide: CHIP_CONFIG, useValue: deepMerge(DEFAULT_CHIP_CONFIG,
|
|
8049
|
+
{ provide: CHIP_CONFIG, useValue: deepMerge(DEFAULT_CHIP_CONFIG, components.chip) },
|
|
7735
8050
|
{
|
|
7736
8051
|
provide: CHIP_CONTROL_CONFIG,
|
|
7737
|
-
useValue: deepMerge(DEFAULT_CHIP_CONTROL_CONFIG,
|
|
8052
|
+
useValue: deepMerge(DEFAULT_CHIP_CONTROL_CONFIG, components.chipControl),
|
|
7738
8053
|
},
|
|
7739
8054
|
{
|
|
7740
8055
|
provide: CHIP_GROUP_CONFIG,
|
|
7741
|
-
useValue: deepMerge(DEFAULT_CHIP_GROUP_CONFIG,
|
|
8056
|
+
useValue: deepMerge(DEFAULT_CHIP_GROUP_CONFIG, components.chipGroup),
|
|
7742
8057
|
},
|
|
7743
8058
|
{
|
|
7744
8059
|
provide: CHIP_INPUT_CONFIG,
|
|
7745
|
-
useValue: deepMerge(DEFAULT_CHIP_INPUT_CONFIG,
|
|
8060
|
+
useValue: deepMerge(DEFAULT_CHIP_INPUT_CONFIG, components.chipInput),
|
|
7746
8061
|
},
|
|
7747
8062
|
{
|
|
7748
8063
|
provide: DATE_TIME_PICKER_CONFIG,
|
|
7749
|
-
useValue: deepMerge(DEFAULT_DATE_TIME_PICKER_CONFIG,
|
|
8064
|
+
useValue: deepMerge(DEFAULT_DATE_TIME_PICKER_CONFIG, components.dateTimePicker),
|
|
7750
8065
|
},
|
|
7751
8066
|
{
|
|
7752
8067
|
provide: DIALOG_CONFIG,
|
|
7753
|
-
useValue: deepMerge(DEFAULT_DIALOG_CONFIG,
|
|
8068
|
+
useValue: deepMerge(DEFAULT_DIALOG_CONFIG, components.dialog),
|
|
7754
8069
|
},
|
|
7755
8070
|
{
|
|
7756
8071
|
provide: DIVIDER_CONFIG,
|
|
7757
|
-
useValue: deepMerge(DEFAULT_DIVIDER_CONFIG,
|
|
8072
|
+
useValue: deepMerge(DEFAULT_DIVIDER_CONFIG, components.divider),
|
|
7758
8073
|
},
|
|
7759
8074
|
{
|
|
7760
8075
|
provide: FILE_INPUT_CONFIG,
|
|
7761
|
-
useValue: deepMerge(DEFAULT_FILE_INPUT_CONFIG,
|
|
8076
|
+
useValue: deepMerge(DEFAULT_FILE_INPUT_CONFIG, components.fileInput),
|
|
7762
8077
|
},
|
|
7763
8078
|
{
|
|
7764
8079
|
provide: FORM_CONTROL_GROUP_CONFIG,
|
|
7765
|
-
useValue: deepMerge(DEFAULT_FORM_CONTROL_GROUP_CONFIG,
|
|
8080
|
+
useValue: deepMerge(DEFAULT_FORM_CONTROL_GROUP_CONFIG, components.formControlGroup),
|
|
7766
8081
|
},
|
|
7767
8082
|
{
|
|
7768
8083
|
provide: FORM_ITEM_CONFIG,
|
|
7769
|
-
useValue: deepMerge(DEFAULT_FORM_ITEM_CONFIG,
|
|
8084
|
+
useValue: deepMerge(DEFAULT_FORM_ITEM_CONFIG, components.formItem),
|
|
7770
8085
|
},
|
|
7771
8086
|
{
|
|
7772
8087
|
provide: HIGHLIGHT_CONFIG,
|
|
7773
|
-
useValue: deepMerge(DEFAULT_HIGHLIGHT_CONFIG,
|
|
8088
|
+
useValue: deepMerge(DEFAULT_HIGHLIGHT_CONFIG, components.highlight),
|
|
7774
8089
|
},
|
|
7775
|
-
{ provide: ICON_CONFIG, useValue: deepMerge(DEFAULT_ICON_CONFIG,
|
|
8090
|
+
{ provide: ICON_CONFIG, useValue: deepMerge(DEFAULT_ICON_CONFIG, components.icon) },
|
|
7776
8091
|
{
|
|
7777
8092
|
provide: IMAGE_COMPARE_CONFIG,
|
|
7778
|
-
useValue: deepMerge(DEFAULT_IMAGE_COMPARE_CONFIG,
|
|
8093
|
+
useValue: deepMerge(DEFAULT_IMAGE_COMPARE_CONFIG, components.imageCompare),
|
|
7779
8094
|
},
|
|
7780
|
-
{ provide: INPUT_CONFIG, useValue: deepMerge(DEFAULT_INPUT_CONFIG,
|
|
8095
|
+
{ provide: INPUT_CONFIG, useValue: deepMerge(DEFAULT_INPUT_CONFIG, components.input) },
|
|
7781
8096
|
{
|
|
7782
8097
|
provide: LOADER_CONFIG,
|
|
7783
|
-
useValue: deepMerge(DEFAULT_LOADER_CONFIG,
|
|
8098
|
+
useValue: deepMerge(DEFAULT_LOADER_CONFIG, components.loader),
|
|
7784
8099
|
},
|
|
7785
|
-
{ provide: MARK_CONFIG, useValue: deepMerge(DEFAULT_MARK_CONFIG,
|
|
7786
|
-
{ provide: MENU_CONFIG, useValue: deepMerge(DEFAULT_MENU_CONFIG,
|
|
8100
|
+
{ provide: MARK_CONFIG, useValue: deepMerge(DEFAULT_MARK_CONFIG, components.mark) },
|
|
8101
|
+
{ provide: MENU_CONFIG, useValue: deepMerge(DEFAULT_MENU_CONFIG, components.menu) },
|
|
7787
8102
|
{
|
|
7788
8103
|
provide: MULTI_SELECT_CONFIG,
|
|
7789
|
-
useValue: deepMerge(DEFAULT_MULTI_SELECT_CONFIG,
|
|
8104
|
+
useValue: deepMerge(DEFAULT_MULTI_SELECT_CONFIG, components.multiSelect),
|
|
7790
8105
|
},
|
|
7791
8106
|
{
|
|
7792
8107
|
provide: PAGINATION_CONFIG,
|
|
@@ -7800,44 +8115,44 @@ const provideThalassicUIConfig = (config) => {
|
|
|
7800
8115
|
},
|
|
7801
8116
|
{
|
|
7802
8117
|
provide: PASSWORD_CONFIG,
|
|
7803
|
-
useValue: deepMerge(DEFAULT_PASSWORD_CONFIG,
|
|
8118
|
+
useValue: deepMerge(DEFAULT_PASSWORD_CONFIG, components.password),
|
|
7804
8119
|
},
|
|
7805
8120
|
{
|
|
7806
8121
|
provide: PIN_INPUT_CONFIG,
|
|
7807
|
-
useValue: deepMerge(DEFAULT_PIN_INPUT_CONFIG,
|
|
8122
|
+
useValue: deepMerge(DEFAULT_PIN_INPUT_CONFIG, components.pinInput),
|
|
7808
8123
|
},
|
|
7809
8124
|
{
|
|
7810
8125
|
provide: POPOVER_CONFIG,
|
|
7811
|
-
useValue: deepMerge(DEFAULT_POPOVER_CONFIG,
|
|
8126
|
+
useValue: deepMerge(DEFAULT_POPOVER_CONFIG, components.popover),
|
|
7812
8127
|
},
|
|
7813
8128
|
{
|
|
7814
8129
|
provide: RADIO_BUTTON_CONFIG,
|
|
7815
|
-
useValue: deepMerge(DEFAULT_RADIO_BUTTON_CONFIG,
|
|
8130
|
+
useValue: deepMerge(DEFAULT_RADIO_BUTTON_CONFIG, components.radioButton),
|
|
7816
8131
|
},
|
|
7817
8132
|
{
|
|
7818
8133
|
provide: SELECT_CONFIG,
|
|
7819
|
-
useValue: deepMerge(DEFAULT_SELECT_CONFIG,
|
|
8134
|
+
useValue: deepMerge(DEFAULT_SELECT_CONFIG, components.select),
|
|
7820
8135
|
},
|
|
7821
8136
|
{
|
|
7822
8137
|
provide: SKELETON_CONFIG,
|
|
7823
|
-
useValue: deepMerge(DEFAULT_SKELETON_CONFIG,
|
|
8138
|
+
useValue: deepMerge(DEFAULT_SKELETON_CONFIG, components.skeleton),
|
|
7824
8139
|
},
|
|
7825
8140
|
{
|
|
7826
8141
|
provide: SPLITTER_CONFIG,
|
|
7827
|
-
useValue: deepMerge(DEFAULT_SPLITTER_CONFIG,
|
|
8142
|
+
useValue: deepMerge(DEFAULT_SPLITTER_CONFIG, components.splitter),
|
|
7828
8143
|
},
|
|
7829
8144
|
{
|
|
7830
8145
|
provide: STEPPER_CONFIG,
|
|
7831
|
-
useValue: deepMerge(DEFAULT_STEPPER_CONFIG,
|
|
8146
|
+
useValue: deepMerge(DEFAULT_STEPPER_CONFIG, components.stepper),
|
|
7832
8147
|
},
|
|
7833
8148
|
{
|
|
7834
8149
|
provide: SWITCH_CONFIG,
|
|
7835
|
-
useValue: deepMerge(DEFAULT_SWITCH_CONFIG,
|
|
8150
|
+
useValue: deepMerge(DEFAULT_SWITCH_CONFIG, components.switch),
|
|
7836
8151
|
},
|
|
7837
|
-
{ provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG,
|
|
8152
|
+
{ provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG, components.table) },
|
|
7838
8153
|
{
|
|
7839
8154
|
provide: TAB_NAV_CONFIG,
|
|
7840
|
-
useValue: deepMerge(DEFAULT_TAB_NAV_CONFIG,
|
|
8155
|
+
useValue: deepMerge(DEFAULT_TAB_NAV_CONFIG, components.tabNav),
|
|
7841
8156
|
},
|
|
7842
8157
|
{ provide: TABS_CONFIG, useValue: deepMerge(DEFAULT_TABS_CONFIG, tabs) },
|
|
7843
8158
|
{
|
|
@@ -7846,21 +8161,21 @@ const provideThalassicUIConfig = (config) => {
|
|
|
7846
8161
|
},
|
|
7847
8162
|
{
|
|
7848
8163
|
provide: TEXTAREA_CONFIG,
|
|
7849
|
-
useValue: deepMerge(DEFAULT_TEXTAREA_CONFIG,
|
|
8164
|
+
useValue: deepMerge(DEFAULT_TEXTAREA_CONFIG, components.textarea),
|
|
7850
8165
|
},
|
|
7851
8166
|
{
|
|
7852
8167
|
provide: TOAST_CONFIG,
|
|
7853
8168
|
// `severityColors` is a deep-partial override; deepMerge merges it recursively,
|
|
7854
8169
|
// but its `Partial<T>` signature only models a shallow partial, so cast to it.
|
|
7855
|
-
useValue: deepMerge(DEFAULT_TOAST_CONFIG,
|
|
8170
|
+
useValue: deepMerge(DEFAULT_TOAST_CONFIG, components.toast),
|
|
7856
8171
|
},
|
|
7857
8172
|
{
|
|
7858
8173
|
provide: TOGGLE_GROUP_CONFIG,
|
|
7859
|
-
useValue: deepMerge(DEFAULT_TOGGLE_GROUP_CONFIG,
|
|
8174
|
+
useValue: deepMerge(DEFAULT_TOGGLE_GROUP_CONFIG, components.toggleGroup),
|
|
7860
8175
|
},
|
|
7861
8176
|
{
|
|
7862
8177
|
provide: TOOLTIP_CONFIG,
|
|
7863
|
-
useValue: deepMerge(DEFAULT_TOOLTIP_CONFIG,
|
|
8178
|
+
useValue: deepMerge(DEFAULT_TOOLTIP_CONFIG, components.tooltip),
|
|
7864
8179
|
},
|
|
7865
8180
|
]);
|
|
7866
8181
|
};
|