@thalassic/ui 22.9.0 → 22.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui.mjs +429 -213
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +194 -105
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, Component,
|
|
2
|
+
import { InjectionToken, inject, model, input, signal, computed, booleanAttribute, Directive, ViewContainerRef, DestroyRef, viewChild, Component, Injectable, makeEnvironmentProviders, contentChild, forwardRef, output, effect, ElementRef, afterNextRender, linkedSignal, numberAttribute, Renderer2, viewChildren, contentChildren, isDevMode, untracked, TemplateRef, provideEnvironmentInitializer, PLATFORM_ID, DOCUMENT } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
4
|
import { TemplatePortal, ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
5
5
|
import { takeUntilDestroyed, rxResource, toObservable } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { filter, throwError, map, shareReplay, of, Subscription, takeUntil } from 'rxjs';
|
|
7
7
|
import { Router, ActivatedRoute, RouterLink, NavigationStart } from '@angular/router';
|
|
8
|
-
import {
|
|
9
|
-
import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, format, startOfDay, isBefore, isAfter, isToday, differenceInCalendarDays, isSameMonth, addHours, differenceInMinutes, isSameDay, isSameWeek, addMonths, addWeeks, subMonths, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
|
|
8
|
+
import { NgComponentOutlet, NgTemplateOutlet, LocationStrategy, isPlatformBrowser } from '@angular/common';
|
|
10
9
|
import { HttpClient } from '@angular/common/http';
|
|
11
10
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
11
|
+
import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, addDays, eachDayOfInterval, format, startOfDay, isBefore, isAfter, isToday, differenceInCalendarDays, isSameMonth, addHours, differenceInMinutes, isSameDay, isSameWeek, addMonths, addWeeks, subMonths, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, setHours, setMinutes, setYear } from 'date-fns';
|
|
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';
|
|
@@ -827,6 +827,246 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
827
827
|
}, template: "<ng-content />\n\n@if (visible()) {\n <span\n class=\"tls-badge__indicator\"\n role=\"status\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-hidden]=\"decorative() ? 'true' : null\"\n animate.enter=\"tls-badge__indicator--enter\"\n animate.leave=\"tls-badge__indicator--leave\"\n >\n @if (!dot()) {\n {{ displayValue() }}\n }\n </span>\n}\n" }]
|
|
828
828
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], showZero: [{ type: i0.Input, args: [{ isSignal: true, alias: "showZero", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], inset: [{ type: i0.Input, args: [{ isSignal: true, alias: "inset", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
829
829
|
|
|
830
|
+
/**
|
|
831
|
+
* Built-in SVG for every {@link systemIcon}. A coherent 24×24 stroked set drawn
|
|
832
|
+
* with `currentColor`, no intrinsic width/height so each icon scales to its
|
|
833
|
+
* host box. Consumers override individual entries via `provideThalassicIcons`.
|
|
834
|
+
*/
|
|
835
|
+
const DEFAULT_ICONS = {
|
|
836
|
+
check: svg('<polyline points="20 6 9 17 4 12" />'),
|
|
837
|
+
indeterminate: svg('<line x1="5" y1="12" x2="19" y2="12" />'),
|
|
838
|
+
'chevron-up': svg('<polyline points="18 15 12 9 6 15" />'),
|
|
839
|
+
'chevron-down': svg('<polyline points="6 9 12 15 18 9" />'),
|
|
840
|
+
'chevron-left': svg('<polyline points="15 18 9 12 15 6" />'),
|
|
841
|
+
'chevron-right': svg('<polyline points="9 18 15 12 9 6" />'),
|
|
842
|
+
'chevrons-left': svg('<polyline points="11 17 6 12 11 7" /><polyline points="18 17 13 12 18 7" />'),
|
|
843
|
+
'chevrons-right': svg('<polyline points="13 17 18 12 13 7" /><polyline points="6 17 11 12 6 7" />'),
|
|
844
|
+
close: svg('<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />'),
|
|
845
|
+
success: svg('<circle cx="12" cy="12" r="10" /><polyline points="8 12 11 15 16 9" />'),
|
|
846
|
+
warning: svg('<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />' +
|
|
847
|
+
'<line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />'),
|
|
848
|
+
error: svg('<circle cx="12" cy="12" r="10" /><line x1="15" y1="9" x2="9" y2="15" /><line x1="9" y1="9" x2="15" y2="15" />'),
|
|
849
|
+
info: svg('<circle cx="12" cy="12" r="10" /><line x1="12" y1="16" x2="12" y2="12" /><line x1="12" y1="8" x2="12.01" y2="8" />'),
|
|
850
|
+
};
|
|
851
|
+
function svg(body) {
|
|
852
|
+
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" ' +
|
|
853
|
+
'stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
|
|
854
|
+
body +
|
|
855
|
+
'</svg>');
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Consumer-supplied overrides for the built-in {@link systemIcon} set, merged
|
|
860
|
+
* over {@link DEFAULT_ICONS} by {@link IconRegistry}. Provide it with
|
|
861
|
+
* `provideThalassicIcons`.
|
|
862
|
+
*/
|
|
863
|
+
const ICON_REGISTRY = new InjectionToken('ICON_REGISTRY');
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Resolves a {@link systemIcon} name to its {@link iconRenderer}, applying any
|
|
867
|
+
* consumer overrides from {@link ICON_REGISTRY} over {@link DEFAULT_ICONS}.
|
|
868
|
+
*/
|
|
869
|
+
class IconRegistry {
|
|
870
|
+
// Injections
|
|
871
|
+
_overrides = inject(ICON_REGISTRY, { optional: true });
|
|
872
|
+
// State
|
|
873
|
+
_icons = {
|
|
874
|
+
...DEFAULT_ICONS,
|
|
875
|
+
...this._overrides,
|
|
876
|
+
};
|
|
877
|
+
// Public methods
|
|
878
|
+
resolve(name) {
|
|
879
|
+
return this._icons[name];
|
|
880
|
+
}
|
|
881
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
882
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, providedIn: 'root' });
|
|
883
|
+
}
|
|
884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, decorators: [{
|
|
885
|
+
type: Injectable,
|
|
886
|
+
args: [{ providedIn: 'root' }]
|
|
887
|
+
}] });
|
|
888
|
+
|
|
889
|
+
class IconService {
|
|
890
|
+
_http = inject(HttpClient);
|
|
891
|
+
_sanitizer = inject(DomSanitizer);
|
|
892
|
+
_cache = new Map();
|
|
893
|
+
getSvgContent(url, allowedSources) {
|
|
894
|
+
if (allowedSources.length > 0 && !this._isUrlAllowed(url, allowedSources)) {
|
|
895
|
+
return throwError(() => new Error('SVG URL not from trusted source'));
|
|
896
|
+
}
|
|
897
|
+
const cache = this._cache.get(url);
|
|
898
|
+
if (!cache) {
|
|
899
|
+
const svg$ = this._http.get(url, { responseType: 'text' }).pipe(map(svg => this._sanitizeSvg(svg)), shareReplay(1));
|
|
900
|
+
this._cache.set(url, svg$);
|
|
901
|
+
return svg$;
|
|
902
|
+
}
|
|
903
|
+
return cache;
|
|
904
|
+
}
|
|
905
|
+
sanitizeSvg(svg) {
|
|
906
|
+
return this._sanitizeSvg(svg);
|
|
907
|
+
}
|
|
908
|
+
// Private methods
|
|
909
|
+
_isUrlAllowed(url, allowedSource) {
|
|
910
|
+
return allowedSource.some(source => url.startsWith(source));
|
|
911
|
+
}
|
|
912
|
+
_sanitizeSvg(svg) {
|
|
913
|
+
const safeSvg = this._makeSafe(svg);
|
|
914
|
+
return this._sanitizer.bypassSecurityTrustHtml(safeSvg);
|
|
915
|
+
}
|
|
916
|
+
_makeSafe(svg) {
|
|
917
|
+
return (svg
|
|
918
|
+
// Remove script tags
|
|
919
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
920
|
+
// Remove event handlers (onclick, onload, onmouseover, etc.)
|
|
921
|
+
.replace(/on\w+\s*=\s*["'][^"']*["']/gi, '')
|
|
922
|
+
// Remove external xlink:href (keep internal references starting with #)
|
|
923
|
+
.replace(/xlink:href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
924
|
+
// Remove external href in <use>, <image>, <a> tags (keep internal #refs)
|
|
925
|
+
.replace(/href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
926
|
+
// Remove data URIs with HTML content
|
|
927
|
+
.replace(/href\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
928
|
+
.replace(/src\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
929
|
+
// Remove javascript: protocol
|
|
930
|
+
.replace(/javascript:/gi, '')
|
|
931
|
+
// Remove import statements in style
|
|
932
|
+
.replace(/@import/gi, ''));
|
|
933
|
+
}
|
|
934
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
935
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
936
|
+
}
|
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, decorators: [{
|
|
938
|
+
type: Injectable,
|
|
939
|
+
args: [{ providedIn: 'root' }]
|
|
940
|
+
}] });
|
|
941
|
+
|
|
942
|
+
const DEFAULT_ICON_CONFIG = {
|
|
943
|
+
allowedSources: [],
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
const ICON_CONFIG = new InjectionToken('ICON_CONFIG', {
|
|
947
|
+
factory: () => DEFAULT_ICON_CONFIG,
|
|
948
|
+
});
|
|
949
|
+
|
|
950
|
+
class Icon {
|
|
951
|
+
// Injections
|
|
952
|
+
_iconService = inject(IconService);
|
|
953
|
+
_iconRegistry = inject(IconRegistry);
|
|
954
|
+
_config = inject(ICON_CONFIG);
|
|
955
|
+
// Inputs
|
|
956
|
+
/** A semantic icon from the registry — overridable via `provideThalassicIcons`. */
|
|
957
|
+
name = input(/* @ts-ignore */
|
|
958
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
959
|
+
/** A URL to an SVG or image for arbitrary content icons. Ignored when `name` is set. */
|
|
960
|
+
iconSrc = input(/* @ts-ignore */
|
|
961
|
+
...(ngDevMode ? [undefined, { debugName: "iconSrc" }] : /* istanbul ignore next */ []));
|
|
962
|
+
alt = input('', /* @ts-ignore */
|
|
963
|
+
...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
964
|
+
allowedSources = input(this._config.allowedSources, /* @ts-ignore */
|
|
965
|
+
...(ngDevMode ? [{ debugName: "allowedSources" }] : /* istanbul ignore next */ []));
|
|
966
|
+
// Computed
|
|
967
|
+
_renderer = computed(() => {
|
|
968
|
+
const name = this.name();
|
|
969
|
+
if (!name)
|
|
970
|
+
return undefined;
|
|
971
|
+
return this._iconRegistry.resolve(name);
|
|
972
|
+
}, /* @ts-ignore */
|
|
973
|
+
...(ngDevMode ? [{ debugName: "_renderer" }] : /* istanbul ignore next */ []));
|
|
974
|
+
registryComponent = computed(() => {
|
|
975
|
+
const renderer = this._renderer();
|
|
976
|
+
if (!renderer || typeof renderer === 'string')
|
|
977
|
+
return null;
|
|
978
|
+
return renderer;
|
|
979
|
+
}, /* @ts-ignore */
|
|
980
|
+
...(ngDevMode ? [{ debugName: "registryComponent" }] : /* istanbul ignore next */ []));
|
|
981
|
+
registrySvg = computed(() => {
|
|
982
|
+
const renderer = this._renderer();
|
|
983
|
+
if (typeof renderer !== 'string')
|
|
984
|
+
return null;
|
|
985
|
+
return this._iconService.sanitizeSvg(renderer);
|
|
986
|
+
}, /* @ts-ignore */
|
|
987
|
+
...(ngDevMode ? [{ debugName: "registrySvg" }] : /* istanbul ignore next */ []));
|
|
988
|
+
isSvgSrc = computed(() => {
|
|
989
|
+
const src = this.iconSrc();
|
|
990
|
+
if (!src)
|
|
991
|
+
return false;
|
|
992
|
+
return src.endsWith('.svg');
|
|
993
|
+
}, /* @ts-ignore */
|
|
994
|
+
...(ngDevMode ? [{ debugName: "isSvgSrc" }] : /* istanbul ignore next */ []));
|
|
995
|
+
_svgContentResource = rxResource({
|
|
996
|
+
defaultValue: '',
|
|
997
|
+
params: () => ({
|
|
998
|
+
iconSrc: this.iconSrc(),
|
|
999
|
+
name: this.name(),
|
|
1000
|
+
allowedSources: this.allowedSources(),
|
|
1001
|
+
}),
|
|
1002
|
+
stream: ({ params }) => {
|
|
1003
|
+
if (params.name || !params.iconSrc)
|
|
1004
|
+
return of('');
|
|
1005
|
+
return this._iconService.getSvgContent(params.iconSrc, params.allowedSources);
|
|
1006
|
+
},
|
|
1007
|
+
});
|
|
1008
|
+
// Accessors
|
|
1009
|
+
get svgContent() {
|
|
1010
|
+
return this._svgContentResource.value.asReadonly();
|
|
1011
|
+
}
|
|
1012
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1013
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Icon, isStandalone: true, selector: "tls-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, allowedSources: { classPropertyName: "allowedSources", publicName: "allowedSources", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "tls-icon" }, ngImport: i0, template: "@if (name()) {\n @if (registryComponent(); as iconComponent) {\n <ng-container [ngComponentOutlet]=\"iconComponent\" />\n } @else {\n <span [innerHTML]=\"registrySvg()\" class=\"tls-svg-icon\"></span>\n }\n} @else if (isSvgSrc() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n}\n", dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
|
|
1014
|
+
}
|
|
1015
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, decorators: [{
|
|
1016
|
+
type: Component,
|
|
1017
|
+
args: [{ selector: 'tls-icon', imports: [NgComponentOutlet], host: { class: 'tls-icon' }, template: "@if (name()) {\n @if (registryComponent(); as iconComponent) {\n <ng-container [ngComponentOutlet]=\"iconComponent\" />\n } @else {\n <span [innerHTML]=\"registrySvg()\" class=\"tls-svg-icon\"></span>\n }\n} @else if (isSvgSrc() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n}\n" }]
|
|
1018
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], allowedSources: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedSources", required: false }] }] } });
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* Override any of the library's built-in {@link systemIcon}s with your own kit.
|
|
1022
|
+
* Each entry is raw SVG markup or a component class; names left unset keep the
|
|
1023
|
+
* library defaults. Register once in the application config:
|
|
1024
|
+
*
|
|
1025
|
+
* ```ts
|
|
1026
|
+
* provideThalassicIcons({
|
|
1027
|
+
* close: '<svg>…</svg>',
|
|
1028
|
+
* 'chevron-down': MyChevronComponent,
|
|
1029
|
+
* })
|
|
1030
|
+
* ```
|
|
1031
|
+
*/
|
|
1032
|
+
function provideThalassicIcons(icons) {
|
|
1033
|
+
return makeEnvironmentProviders([{ provide: ICON_REGISTRY, useValue: icons }]);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
const DEFAULT_BREADCRUMBS_CONFIG = {
|
|
1037
|
+
separatorIcon: 'chevron-right',
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
const BREADCRUMBS_CONFIG = new InjectionToken('BREADCRUMBS_CONFIG', {
|
|
1041
|
+
factory: () => DEFAULT_BREADCRUMBS_CONFIG,
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
class Breadcrumbs {
|
|
1045
|
+
// Injections
|
|
1046
|
+
_config = inject(BREADCRUMBS_CONFIG);
|
|
1047
|
+
// Inputs
|
|
1048
|
+
items = input([], /* @ts-ignore */
|
|
1049
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1050
|
+
separatorIcon = input(this._config.separatorIcon, /* @ts-ignore */
|
|
1051
|
+
...(ngDevMode ? [{ debugName: "separatorIcon" }] : /* istanbul ignore next */ []));
|
|
1052
|
+
/** Accessible name for the breadcrumb navigation landmark. */
|
|
1053
|
+
ariaLabel = input('Breadcrumb', /* @ts-ignore */
|
|
1054
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1055
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
1056
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1058
|
+
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 <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\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"] }] });
|
|
1059
|
+
}
|
|
1060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Breadcrumbs, decorators: [{
|
|
1061
|
+
type: Component,
|
|
1062
|
+
args: [{ selector: 'tls-breadcrumbs', imports: [Icon, NgTemplateOutlet, RouterLink], host: {
|
|
1063
|
+
role: 'navigation',
|
|
1064
|
+
class: 'tls-breadcrumbs',
|
|
1065
|
+
'[attr.aria-label]': 'ariaLabelledby() ? null : ariaLabel()',
|
|
1066
|
+
'[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
|
|
1067
|
+
}, 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 <tls-icon class=\"tls-breadcrumbs__item-icon\" [iconSrc]=\"item.icon\" />\n }\n <span class=\"tls-breadcrumbs__label\">{{ item.label }}</span>\n</ng-template>\n" }]
|
|
1068
|
+
}], 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 }] }] } });
|
|
1069
|
+
|
|
830
1070
|
const DEFAULT_BUTTON_CONFIG = {
|
|
831
1071
|
color: 'primary',
|
|
832
1072
|
variant: 'filled',
|
|
@@ -1043,212 +1283,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1043
1283
|
}, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <button\n type=\"button\"\n class=\"tls-toggle-group__option\"\n [class.tls-toggle-group__option--selected]=\"isSelected(option.value)\"\n [class.tls-toggle-group__option--disabled]=\"option.disabled\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [disabled]=\"disabled() || option.disabled\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n >\n @if (optionTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"optionContext(option, index)\" />\n } @else {\n {{ option.label }}\n }\n </button>\n}\n" }]
|
|
1044
1284
|
}], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], unselectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "unselectable", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], optionTemplate: [{ type: i0.ContentChild, args: ['option', { isSignal: true }] }] } });
|
|
1045
1285
|
|
|
1046
|
-
/**
|
|
1047
|
-
* Built-in SVG for every {@link systemIcon}. A coherent 24×24 stroked set drawn
|
|
1048
|
-
* with `currentColor`, no intrinsic width/height so each icon scales to its
|
|
1049
|
-
* host box. Consumers override individual entries via `provideThalassicIcons`.
|
|
1050
|
-
*/
|
|
1051
|
-
const DEFAULT_ICONS = {
|
|
1052
|
-
check: svg('<polyline points="20 6 9 17 4 12" />'),
|
|
1053
|
-
indeterminate: svg('<line x1="5" y1="12" x2="19" y2="12" />'),
|
|
1054
|
-
'chevron-up': svg('<polyline points="18 15 12 9 6 15" />'),
|
|
1055
|
-
'chevron-down': svg('<polyline points="6 9 12 15 18 9" />'),
|
|
1056
|
-
'chevron-left': svg('<polyline points="15 18 9 12 15 6" />'),
|
|
1057
|
-
'chevron-right': svg('<polyline points="9 18 15 12 9 6" />'),
|
|
1058
|
-
'chevrons-left': svg('<polyline points="11 17 6 12 11 7" /><polyline points="18 17 13 12 18 7" />'),
|
|
1059
|
-
'chevrons-right': svg('<polyline points="13 17 18 12 13 7" /><polyline points="6 17 11 12 6 7" />'),
|
|
1060
|
-
close: svg('<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />'),
|
|
1061
|
-
success: svg('<circle cx="12" cy="12" r="10" /><polyline points="8 12 11 15 16 9" />'),
|
|
1062
|
-
warning: svg('<path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />' +
|
|
1063
|
-
'<line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />'),
|
|
1064
|
-
error: svg('<circle cx="12" cy="12" r="10" /><line x1="15" y1="9" x2="9" y2="15" /><line x1="9" y1="9" x2="15" y2="15" />'),
|
|
1065
|
-
info: svg('<circle cx="12" cy="12" r="10" /><line x1="12" y1="16" x2="12" y2="12" /><line x1="12" y1="8" x2="12.01" y2="8" />'),
|
|
1066
|
-
};
|
|
1067
|
-
function svg(body) {
|
|
1068
|
-
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" ' +
|
|
1069
|
-
'stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
|
|
1070
|
-
body +
|
|
1071
|
-
'</svg>');
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
/**
|
|
1075
|
-
* Consumer-supplied overrides for the built-in {@link systemIcon} set, merged
|
|
1076
|
-
* over {@link DEFAULT_ICONS} by {@link IconRegistry}. Provide it with
|
|
1077
|
-
* `provideThalassicIcons`.
|
|
1078
|
-
*/
|
|
1079
|
-
const ICON_REGISTRY = new InjectionToken('ICON_REGISTRY');
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* Resolves a {@link systemIcon} name to its {@link iconRenderer}, applying any
|
|
1083
|
-
* consumer overrides from {@link ICON_REGISTRY} over {@link DEFAULT_ICONS}.
|
|
1084
|
-
*/
|
|
1085
|
-
class IconRegistry {
|
|
1086
|
-
// Injections
|
|
1087
|
-
_overrides = inject(ICON_REGISTRY, { optional: true });
|
|
1088
|
-
// State
|
|
1089
|
-
_icons = {
|
|
1090
|
-
...DEFAULT_ICONS,
|
|
1091
|
-
...this._overrides,
|
|
1092
|
-
};
|
|
1093
|
-
// Public methods
|
|
1094
|
-
resolve(name) {
|
|
1095
|
-
return this._icons[name];
|
|
1096
|
-
}
|
|
1097
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1098
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, providedIn: 'root' });
|
|
1099
|
-
}
|
|
1100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconRegistry, decorators: [{
|
|
1101
|
-
type: Injectable,
|
|
1102
|
-
args: [{ providedIn: 'root' }]
|
|
1103
|
-
}] });
|
|
1104
|
-
|
|
1105
|
-
class IconService {
|
|
1106
|
-
_http = inject(HttpClient);
|
|
1107
|
-
_sanitizer = inject(DomSanitizer);
|
|
1108
|
-
_cache = new Map();
|
|
1109
|
-
getSvgContent(url, allowedSources) {
|
|
1110
|
-
if (allowedSources.length > 0 && !this._isUrlAllowed(url, allowedSources)) {
|
|
1111
|
-
return throwError(() => new Error('SVG URL not from trusted source'));
|
|
1112
|
-
}
|
|
1113
|
-
const cache = this._cache.get(url);
|
|
1114
|
-
if (!cache) {
|
|
1115
|
-
const svg$ = this._http.get(url, { responseType: 'text' }).pipe(map(svg => this._sanitizeSvg(svg)), shareReplay(1));
|
|
1116
|
-
this._cache.set(url, svg$);
|
|
1117
|
-
return svg$;
|
|
1118
|
-
}
|
|
1119
|
-
return cache;
|
|
1120
|
-
}
|
|
1121
|
-
sanitizeSvg(svg) {
|
|
1122
|
-
return this._sanitizeSvg(svg);
|
|
1123
|
-
}
|
|
1124
|
-
// Private methods
|
|
1125
|
-
_isUrlAllowed(url, allowedSource) {
|
|
1126
|
-
return allowedSource.some(source => url.startsWith(source));
|
|
1127
|
-
}
|
|
1128
|
-
_sanitizeSvg(svg) {
|
|
1129
|
-
const safeSvg = this._makeSafe(svg);
|
|
1130
|
-
return this._sanitizer.bypassSecurityTrustHtml(safeSvg);
|
|
1131
|
-
}
|
|
1132
|
-
_makeSafe(svg) {
|
|
1133
|
-
return (svg
|
|
1134
|
-
// Remove script tags
|
|
1135
|
-
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
1136
|
-
// Remove event handlers (onclick, onload, onmouseover, etc.)
|
|
1137
|
-
.replace(/on\w+\s*=\s*["'][^"']*["']/gi, '')
|
|
1138
|
-
// Remove external xlink:href (keep internal references starting with #)
|
|
1139
|
-
.replace(/xlink:href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
1140
|
-
// Remove external href in <use>, <image>, <a> tags (keep internal #refs)
|
|
1141
|
-
.replace(/href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
1142
|
-
// Remove data URIs with HTML content
|
|
1143
|
-
.replace(/href\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
1144
|
-
.replace(/src\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
1145
|
-
// Remove javascript: protocol
|
|
1146
|
-
.replace(/javascript:/gi, '')
|
|
1147
|
-
// Remove import statements in style
|
|
1148
|
-
.replace(/@import/gi, ''));
|
|
1149
|
-
}
|
|
1150
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1151
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
1152
|
-
}
|
|
1153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, decorators: [{
|
|
1154
|
-
type: Injectable,
|
|
1155
|
-
args: [{ providedIn: 'root' }]
|
|
1156
|
-
}] });
|
|
1157
|
-
|
|
1158
|
-
const DEFAULT_ICON_CONFIG = {
|
|
1159
|
-
allowedSources: [],
|
|
1160
|
-
};
|
|
1161
|
-
|
|
1162
|
-
const ICON_CONFIG = new InjectionToken('ICON_CONFIG', {
|
|
1163
|
-
factory: () => DEFAULT_ICON_CONFIG,
|
|
1164
|
-
});
|
|
1165
|
-
|
|
1166
|
-
class Icon {
|
|
1167
|
-
// Injections
|
|
1168
|
-
_iconService = inject(IconService);
|
|
1169
|
-
_iconRegistry = inject(IconRegistry);
|
|
1170
|
-
_config = inject(ICON_CONFIG);
|
|
1171
|
-
// Inputs
|
|
1172
|
-
/** A semantic icon from the registry — overridable via `provideThalassicIcons`. */
|
|
1173
|
-
name = input(/* @ts-ignore */
|
|
1174
|
-
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1175
|
-
/** A URL to an SVG or image for arbitrary content icons. Ignored when `name` is set. */
|
|
1176
|
-
iconSrc = input(/* @ts-ignore */
|
|
1177
|
-
...(ngDevMode ? [undefined, { debugName: "iconSrc" }] : /* istanbul ignore next */ []));
|
|
1178
|
-
alt = input('', /* @ts-ignore */
|
|
1179
|
-
...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
1180
|
-
allowedSources = input(this._config.allowedSources, /* @ts-ignore */
|
|
1181
|
-
...(ngDevMode ? [{ debugName: "allowedSources" }] : /* istanbul ignore next */ []));
|
|
1182
|
-
// Computed
|
|
1183
|
-
_renderer = computed(() => {
|
|
1184
|
-
const name = this.name();
|
|
1185
|
-
if (!name)
|
|
1186
|
-
return undefined;
|
|
1187
|
-
return this._iconRegistry.resolve(name);
|
|
1188
|
-
}, /* @ts-ignore */
|
|
1189
|
-
...(ngDevMode ? [{ debugName: "_renderer" }] : /* istanbul ignore next */ []));
|
|
1190
|
-
registryComponent = computed(() => {
|
|
1191
|
-
const renderer = this._renderer();
|
|
1192
|
-
if (!renderer || typeof renderer === 'string')
|
|
1193
|
-
return null;
|
|
1194
|
-
return renderer;
|
|
1195
|
-
}, /* @ts-ignore */
|
|
1196
|
-
...(ngDevMode ? [{ debugName: "registryComponent" }] : /* istanbul ignore next */ []));
|
|
1197
|
-
registrySvg = computed(() => {
|
|
1198
|
-
const renderer = this._renderer();
|
|
1199
|
-
if (typeof renderer !== 'string')
|
|
1200
|
-
return null;
|
|
1201
|
-
return this._iconService.sanitizeSvg(renderer);
|
|
1202
|
-
}, /* @ts-ignore */
|
|
1203
|
-
...(ngDevMode ? [{ debugName: "registrySvg" }] : /* istanbul ignore next */ []));
|
|
1204
|
-
isSvgSrc = computed(() => {
|
|
1205
|
-
const src = this.iconSrc();
|
|
1206
|
-
if (!src)
|
|
1207
|
-
return false;
|
|
1208
|
-
return src.endsWith('.svg');
|
|
1209
|
-
}, /* @ts-ignore */
|
|
1210
|
-
...(ngDevMode ? [{ debugName: "isSvgSrc" }] : /* istanbul ignore next */ []));
|
|
1211
|
-
_svgContentResource = rxResource({
|
|
1212
|
-
defaultValue: '',
|
|
1213
|
-
params: () => ({
|
|
1214
|
-
iconSrc: this.iconSrc(),
|
|
1215
|
-
name: this.name(),
|
|
1216
|
-
allowedSources: this.allowedSources(),
|
|
1217
|
-
}),
|
|
1218
|
-
stream: ({ params }) => {
|
|
1219
|
-
if (params.name || !params.iconSrc)
|
|
1220
|
-
return of('');
|
|
1221
|
-
return this._iconService.getSvgContent(params.iconSrc, params.allowedSources);
|
|
1222
|
-
},
|
|
1223
|
-
});
|
|
1224
|
-
// Accessors
|
|
1225
|
-
get svgContent() {
|
|
1226
|
-
return this._svgContentResource.value.asReadonly();
|
|
1227
|
-
}
|
|
1228
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1229
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Icon, isStandalone: true, selector: "tls-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, allowedSources: { classPropertyName: "allowedSources", publicName: "allowedSources", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "tls-icon" }, ngImport: i0, template: "@if (name()) {\n @if (registryComponent(); as iconComponent) {\n <ng-container [ngComponentOutlet]=\"iconComponent\" />\n } @else {\n <span [innerHTML]=\"registrySvg()\" class=\"tls-svg-icon\"></span>\n }\n} @else if (isSvgSrc() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n}\n", dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
|
|
1230
|
-
}
|
|
1231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, decorators: [{
|
|
1232
|
-
type: Component,
|
|
1233
|
-
args: [{ selector: 'tls-icon', imports: [NgComponentOutlet], host: { class: 'tls-icon' }, template: "@if (name()) {\n @if (registryComponent(); as iconComponent) {\n <ng-container [ngComponentOutlet]=\"iconComponent\" />\n } @else {\n <span [innerHTML]=\"registrySvg()\" class=\"tls-svg-icon\"></span>\n }\n} @else if (isSvgSrc() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n}\n" }]
|
|
1234
|
-
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], allowedSources: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedSources", required: false }] }] } });
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* Override any of the library's built-in {@link systemIcon}s with your own kit.
|
|
1238
|
-
* Each entry is raw SVG markup or a component class; names left unset keep the
|
|
1239
|
-
* library defaults. Register once in the application config:
|
|
1240
|
-
*
|
|
1241
|
-
* ```ts
|
|
1242
|
-
* provideThalassicIcons({
|
|
1243
|
-
* close: '<svg>…</svg>',
|
|
1244
|
-
* 'chevron-down': MyChevronComponent,
|
|
1245
|
-
* })
|
|
1246
|
-
* ```
|
|
1247
|
-
*/
|
|
1248
|
-
function provideThalassicIcons(icons) {
|
|
1249
|
-
return makeEnvironmentProviders([{ provide: ICON_REGISTRY, useValue: icons }]);
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
1286
|
const DAYS_IN_WEEK = 7;
|
|
1253
1287
|
/**
|
|
1254
1288
|
* Every day shown in a month grid for the month containing `anchor`, starting at the
|
|
@@ -4296,6 +4330,186 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
4296
4330
|
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"] }]
|
|
4297
4331
|
}], 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 }] }] } });
|
|
4298
4332
|
|
|
4333
|
+
// Token characters recognised inside a mask pattern; every other character is a
|
|
4334
|
+
// literal rendered verbatim. Each token maps to the RegExp a raw character must
|
|
4335
|
+
// satisfy to fill that slot.
|
|
4336
|
+
const MASK_TOKENS = {
|
|
4337
|
+
'0': /\d/, // digit
|
|
4338
|
+
A: /[a-zA-Z]/, // letter
|
|
4339
|
+
'*': /[a-zA-Z0-9]/, // alphanumeric
|
|
4340
|
+
};
|
|
4341
|
+
|
|
4342
|
+
/**
|
|
4343
|
+
* Formats `rawText` against a token `pattern` (`0` digit, `A` letter, `*`
|
|
4344
|
+
* alphanumeric; every other character is a literal) and computes where the caret
|
|
4345
|
+
* should land. `rawText` may itself already contain literals (the previously
|
|
4346
|
+
* masked value plus the latest keystroke) — literals are absorbed and any
|
|
4347
|
+
* character that does not satisfy the current slot's token is skipped.
|
|
4348
|
+
*
|
|
4349
|
+
* A separator is inserted only once the value character that follows it arrives,
|
|
4350
|
+
* so an in-progress value never shows a dangling separator. The caret is derived
|
|
4351
|
+
* by formatting only the portion of `rawText` before `caretPosition`.
|
|
4352
|
+
*/
|
|
4353
|
+
function applyMask(pattern, rawText, caretPosition) {
|
|
4354
|
+
const full = conform(pattern, rawText);
|
|
4355
|
+
const prefix = conform(pattern, rawText.slice(0, caretPosition));
|
|
4356
|
+
return {
|
|
4357
|
+
maskedValue: full.masked,
|
|
4358
|
+
unmaskedValue: full.unmasked,
|
|
4359
|
+
caret: prefix.masked.length,
|
|
4360
|
+
};
|
|
4361
|
+
}
|
|
4362
|
+
/** Walks `pattern` and `rawText` in parallel, emitting the masked and unmasked strings. */
|
|
4363
|
+
function conform(pattern, rawText) {
|
|
4364
|
+
let masked = '';
|
|
4365
|
+
let unmasked = '';
|
|
4366
|
+
let pendingLiterals = '';
|
|
4367
|
+
let rawIndex = 0;
|
|
4368
|
+
for (const patternChar of pattern) {
|
|
4369
|
+
const token = MASK_TOKENS[patternChar];
|
|
4370
|
+
if (token) {
|
|
4371
|
+
// Skip raw characters that don't satisfy this slot's token.
|
|
4372
|
+
while (rawIndex < rawText.length && !token.test(rawText[rawIndex]))
|
|
4373
|
+
rawIndex++;
|
|
4374
|
+
if (rawIndex >= rawText.length)
|
|
4375
|
+
break;
|
|
4376
|
+
// Flush literals only once a value character actually fills the slot after
|
|
4377
|
+
// them, so a rejected character never leaves a dangling separator behind.
|
|
4378
|
+
masked += pendingLiterals + rawText[rawIndex];
|
|
4379
|
+
pendingLiterals = '';
|
|
4380
|
+
unmasked += rawText[rawIndex];
|
|
4381
|
+
rawIndex++;
|
|
4382
|
+
}
|
|
4383
|
+
else if (rawIndex < rawText.length && rawText[rawIndex] === patternChar) {
|
|
4384
|
+
// Literal the user typed explicitly — absorb it rather than doubling it.
|
|
4385
|
+
masked += pendingLiterals + patternChar;
|
|
4386
|
+
pendingLiterals = '';
|
|
4387
|
+
rawIndex++;
|
|
4388
|
+
}
|
|
4389
|
+
else if (rawIndex < rawText.length) {
|
|
4390
|
+
// Hold the literal until the value character that follows it arrives.
|
|
4391
|
+
pendingLiterals += patternChar;
|
|
4392
|
+
}
|
|
4393
|
+
else {
|
|
4394
|
+
break;
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4397
|
+
return { masked, unmasked };
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
/**
|
|
4401
|
+
* Formats a native `<input>` as the user types against a token pattern
|
|
4402
|
+
* (`0` digit, `A` letter, `*` alphanumeric; any other character is a literal).
|
|
4403
|
+
*
|
|
4404
|
+
* Works both directly on a native `<input>` and on the `tls-input` component: it
|
|
4405
|
+
* operates purely at the DOM level, resolving the native control (the host, or
|
|
4406
|
+
* the `<input>` nested inside it) and re-dispatching a native `input` event so
|
|
4407
|
+
* the host's own value handling captures the masked string. Programmatic
|
|
4408
|
+
* `element.value = …` writes (a form `setValue`, a direct DOM assignment) are
|
|
4409
|
+
* intercepted and masked as well, and the value is reformatted whenever the
|
|
4410
|
+
* pattern changes at runtime. The field value therefore holds the masked text;
|
|
4411
|
+
* the separator-free value is exposed via the `unmasked` signal (through
|
|
4412
|
+
* `exportAs: 'tlsMask'`) and the `unmaskedChange` output.
|
|
4413
|
+
*
|
|
4414
|
+
* Deleting a separator is a no-op (the reformat re-inserts it); delete a value
|
|
4415
|
+
* character instead.
|
|
4416
|
+
*/
|
|
4417
|
+
class MaskDirective {
|
|
4418
|
+
// Injections
|
|
4419
|
+
_elementRef = inject(ElementRef);
|
|
4420
|
+
_renderer = inject(Renderer2);
|
|
4421
|
+
_destroyRef = inject(DestroyRef);
|
|
4422
|
+
// Inputs
|
|
4423
|
+
pattern = input('', { ...(ngDevMode ? { debugName: "pattern" } : /* istanbul ignore next */ {}), alias: 'tlsMask' });
|
|
4424
|
+
// Outputs
|
|
4425
|
+
unmaskedChange = output();
|
|
4426
|
+
// State
|
|
4427
|
+
_masked = signal('', /* @ts-ignore */
|
|
4428
|
+
...(ngDevMode ? [{ debugName: "_masked" }] : /* istanbul ignore next */ []));
|
|
4429
|
+
_unmasked = signal('', /* @ts-ignore */
|
|
4430
|
+
...(ngDevMode ? [{ debugName: "_unmasked" }] : /* istanbul ignore next */ []));
|
|
4431
|
+
masked = this._masked.asReadonly();
|
|
4432
|
+
unmasked = this._unmasked.asReadonly();
|
|
4433
|
+
_input = null;
|
|
4434
|
+
_isFormatting = false;
|
|
4435
|
+
// Constructor
|
|
4436
|
+
constructor() {
|
|
4437
|
+
afterNextRender(() => {
|
|
4438
|
+
const host = this._elementRef.nativeElement;
|
|
4439
|
+
this._input = host instanceof HTMLInputElement ? host : host.querySelector('input');
|
|
4440
|
+
if (!this._input)
|
|
4441
|
+
return;
|
|
4442
|
+
this._renderer.listen(this._input, 'input', () => this._format());
|
|
4443
|
+
this._interceptValueWrites(this._input);
|
|
4444
|
+
// Mask any value already present at mount (e.g. a pre-filled raw value).
|
|
4445
|
+
if (this._input.value)
|
|
4446
|
+
this._format();
|
|
4447
|
+
});
|
|
4448
|
+
// Reformat the current value whenever the pattern changes at runtime.
|
|
4449
|
+
effect(() => {
|
|
4450
|
+
this.pattern();
|
|
4451
|
+
if (this._input)
|
|
4452
|
+
this._format();
|
|
4453
|
+
});
|
|
4454
|
+
}
|
|
4455
|
+
// Private methods
|
|
4456
|
+
_format() {
|
|
4457
|
+
if (this._isFormatting)
|
|
4458
|
+
return;
|
|
4459
|
+
const element = this._input;
|
|
4460
|
+
if (!element)
|
|
4461
|
+
return;
|
|
4462
|
+
const caretPosition = element.selectionStart ?? element.value.length;
|
|
4463
|
+
const { maskedValue, unmaskedValue, caret } = applyMask(this.pattern(), element.value, caretPosition);
|
|
4464
|
+
this._isFormatting = true;
|
|
4465
|
+
if (element.value !== maskedValue) {
|
|
4466
|
+
element.value = maskedValue;
|
|
4467
|
+
element.setSelectionRange(caret, caret);
|
|
4468
|
+
// Re-dispatch so the host's own `input` handler (tls-input's `onInput`, or
|
|
4469
|
+
// a native signal-forms control) captures the masked value. The re-entry
|
|
4470
|
+
// is swallowed by the `_isFormatting` guard above.
|
|
4471
|
+
element.dispatchEvent(new Event('input', { bubbles: true }));
|
|
4472
|
+
}
|
|
4473
|
+
this._masked.set(maskedValue);
|
|
4474
|
+
if (unmaskedValue !== this._unmasked()) {
|
|
4475
|
+
this._unmasked.set(unmaskedValue);
|
|
4476
|
+
this.unmaskedChange.emit(unmaskedValue);
|
|
4477
|
+
}
|
|
4478
|
+
this._isFormatting = false;
|
|
4479
|
+
}
|
|
4480
|
+
/**
|
|
4481
|
+
* Programmatic `element.value = …` writes fire no `input` event, so masking
|
|
4482
|
+
* would otherwise be bypassed. Redefining the instance's `value` property
|
|
4483
|
+
* routes every write through the formatter; the instance override is removed
|
|
4484
|
+
* on destroy, falling back to the prototype accessor.
|
|
4485
|
+
*/
|
|
4486
|
+
_interceptValueWrites(element) {
|
|
4487
|
+
const descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
|
4488
|
+
if (!descriptor)
|
|
4489
|
+
return;
|
|
4490
|
+
const setter = descriptor.set;
|
|
4491
|
+
if (!setter)
|
|
4492
|
+
return;
|
|
4493
|
+
Object.defineProperty(element, 'value', {
|
|
4494
|
+
...descriptor,
|
|
4495
|
+
set: (value) => {
|
|
4496
|
+
setter.call(element, value);
|
|
4497
|
+
this._format();
|
|
4498
|
+
},
|
|
4499
|
+
});
|
|
4500
|
+
this._destroyRef.onDestroy(() => Reflect.deleteProperty(element, 'value'));
|
|
4501
|
+
}
|
|
4502
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4503
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: MaskDirective, isStandalone: true, selector: "[tlsMask]", inputs: { pattern: { classPropertyName: "pattern", publicName: "tlsMask", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { unmaskedChange: "unmaskedChange" }, exportAs: ["tlsMask"], ngImport: i0 });
|
|
4504
|
+
}
|
|
4505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MaskDirective, decorators: [{
|
|
4506
|
+
type: Directive,
|
|
4507
|
+
args: [{
|
|
4508
|
+
selector: '[tlsMask]',
|
|
4509
|
+
exportAs: 'tlsMask',
|
|
4510
|
+
}]
|
|
4511
|
+
}], ctorParameters: () => [], propDecorators: { pattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsMask", required: false }] }], unmaskedChange: [{ type: i0.Output, args: ["unmaskedChange"] }] } });
|
|
4512
|
+
|
|
4299
4513
|
const DEFAULT_PASSWORD_CONFIG = {
|
|
4300
4514
|
size: 'md',
|
|
4301
4515
|
placeholder: '',
|
|
@@ -4318,6 +4532,8 @@ class Password extends ValueFormControl {
|
|
|
4318
4532
|
size = input(this._config.size, /* @ts-ignore */
|
|
4319
4533
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4320
4534
|
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4535
|
+
startIconTemplate = contentChild('startIcon', /* @ts-ignore */
|
|
4536
|
+
...(ngDevMode ? [{ debugName: "startIconTemplate" }] : /* istanbul ignore next */ []));
|
|
4321
4537
|
showIconTemplate = contentChild('showIcon', /* @ts-ignore */
|
|
4322
4538
|
...(ngDevMode ? [{ debugName: "showIconTemplate" }] : /* istanbul ignore next */ []));
|
|
4323
4539
|
hideIconTemplate = contentChild('hideIcon', /* @ts-ignore */
|
|
@@ -4335,14 +4551,14 @@ class Password extends ValueFormControl {
|
|
|
4335
4551
|
this.visible.update(prev => !prev);
|
|
4336
4552
|
}
|
|
4337
4553
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4338
|
-
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: "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 <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]=\"visible() ? 'Hide password' : 'Show password'\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Show</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Hide</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n", dependencies: [{ kind: "component", type: FormControlGroup, selector: "tls-form-control-group", inputs: ["size", "fluid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
|
|
4554
|
+
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]=\"visible() ? 'Hide password' : 'Show password'\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Show</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Hide</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n", dependencies: [{ kind: "component", type: FormControlGroup, selector: "tls-form-control-group", inputs: ["size", "fluid"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }] });
|
|
4339
4555
|
}
|
|
4340
4556
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, decorators: [{
|
|
4341
4557
|
type: Component,
|
|
4342
4558
|
args: [{ selector: 'tls-password', imports: [FormControlGroup, NgTemplateOutlet, Loader], host: {
|
|
4343
4559
|
class: 'tls-password',
|
|
4344
|
-
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], template: "<tls-form-control-group [size]=\"size()\" [fluid]=\"fluid()\">\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]=\"visible() ? 'Hide password' : 'Show password'\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Show</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Hide</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n" }]
|
|
4345
|
-
}], 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 }] }], showIconTemplate: [{ type: i0.ContentChild, args: ['showIcon', { isSignal: true }] }], hideIconTemplate: [{ type: i0.ContentChild, args: ['hideIcon', { isSignal: true }] }] } });
|
|
4560
|
+
}, 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]=\"visible() ? 'Hide password' : 'Show password'\"\n [attr.aria-pressed]=\"visible()\"\n (click)=\"toggle()\"\n >\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n @if (showIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Show</span>\n }\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n @if (hideIconTemplate(); as icon) {\n <ng-container [ngTemplateOutlet]=\"icon\" />\n } @else {\n <span class=\"text-label-md\">Hide</span>\n }\n </span>\n </button>\n</tls-form-control-group>\n" }]
|
|
4561
|
+
}], 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 }] }] } });
|
|
4346
4562
|
|
|
4347
4563
|
// Matches strings containing only numeric digits (0–9).
|
|
4348
4564
|
// Ensures the entire input consists exclusively of numbers.
|
|
@@ -7331,5 +7547,5 @@ const provideThalassicUIConfig = (config) => {
|
|
|
7331
7547
|
* Generated bundle index. Do not edit.
|
|
7332
7548
|
*/
|
|
7333
7549
|
|
|
7334
|
-
export { ALERT_CONFIG, AUTOCOMPLETE_CONFIG, Alert, Autocomplete, BADGE_CONFIG, BUTTON_CONFIG, Badge, Button, ButtonDirective, CALENDAR_CONFIG, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, CONFIRM_CONFIG, Calendar, CalendarAgendaView, CalendarEventItem, CalendarMonthView, CalendarTimeGrid, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, Confirm, ConfirmPanel, ConfirmService, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_AUTOCOMPLETE_CONFIG, DEFAULT_BADGE_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CALENDAR_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_CONFIRM_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_DRAWER_CONFIG, DEFAULT_FILE_INPUT_CONFIG, DEFAULT_FORM_CONTROL_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICONS, DEFAULT_ICON_CONFIG, DEFAULT_IMAGE_COMPARE_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_KBD_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_ODOMETER_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PAGINATION_QUERY_SYNC_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_SPLITTER_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TABS_QUERY_SYNC_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOAST_CONFIG, DEFAULT_TOGGLE_BUTTON_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DRAWER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, Drawer, DrawerRef, DrawerService, FILE_INPUT_CONFIG, FORM_CONTROL_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileInput, FormControl, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, ICON_REGISTRY, IMAGE_COMPARE_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, IconRegistry, IconService, ImageCompare, Input, InputDirective, InputNumber, KBD_CONFIG, Kbd, LOADER_CONFIG, Loader, MENU_CONFIG, MULTI_SELECT_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, ODOMETER_CONFIG, Odometer, PAGINATION_CONFIG, PAGINATION_QUERY_SYNC_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, PaginationQuerySyncDirective, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, SPLITTER_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Splitter, SplitterPanel, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TABS_QUERY_SYNC_CONFIG, TEXTAREA_CONFIG, TOAST_CONFIG, TOGGLE_BUTTON_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, TabsQuerySyncDirective, Textarea, Toast, ToastOutlet, ToastService, ToggleButton, ToggleGroup, TooltipDirective, ValueFormControl, provideThalassicIcons, provideThalassicUIConfig };
|
|
7550
|
+
export { ALERT_CONFIG, AUTOCOMPLETE_CONFIG, Alert, Autocomplete, BADGE_CONFIG, BREADCRUMBS_CONFIG, BUTTON_CONFIG, Badge, Breadcrumbs, Button, ButtonDirective, CALENDAR_CONFIG, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, CONFIRM_CONFIG, Calendar, CalendarAgendaView, CalendarEventItem, CalendarMonthView, CalendarTimeGrid, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, Confirm, ConfirmPanel, ConfirmService, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_AUTOCOMPLETE_CONFIG, DEFAULT_BADGE_CONFIG, DEFAULT_BREADCRUMBS_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CALENDAR_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_CONFIRM_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_DRAWER_CONFIG, DEFAULT_FILE_INPUT_CONFIG, DEFAULT_FORM_CONTROL_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICONS, DEFAULT_ICON_CONFIG, DEFAULT_IMAGE_COMPARE_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_KBD_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_ODOMETER_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PAGINATION_QUERY_SYNC_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_SPLITTER_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TABS_QUERY_SYNC_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOAST_CONFIG, DEFAULT_TOGGLE_BUTTON_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DRAWER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, Drawer, DrawerRef, DrawerService, FILE_INPUT_CONFIG, FORM_CONTROL_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileInput, FormControl, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, ICON_REGISTRY, IMAGE_COMPARE_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, IconRegistry, IconService, ImageCompare, Input, InputDirective, InputNumber, KBD_CONFIG, Kbd, LOADER_CONFIG, Loader, MASK_TOKENS, MENU_CONFIG, MULTI_SELECT_CONFIG, MaskDirective, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, ODOMETER_CONFIG, Odometer, PAGINATION_CONFIG, PAGINATION_QUERY_SYNC_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, PaginationQuerySyncDirective, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, SPLITTER_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Splitter, SplitterPanel, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TABS_QUERY_SYNC_CONFIG, TEXTAREA_CONFIG, TOAST_CONFIG, TOGGLE_BUTTON_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, TabsQuerySyncDirective, Textarea, Toast, ToastOutlet, ToastService, ToggleButton, ToggleGroup, TooltipDirective, ValueFormControl, applyMask, provideThalassicIcons, provideThalassicUIConfig };
|
|
7335
7551
|
//# sourceMappingURL=thalassic-ui.mjs.map
|