@thalassic/ui 0.17.0 → 0.18.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.
@@ -3,10 +3,11 @@ import { model, input, signal, computed, booleanAttribute, Directive, InjectionT
3
3
  import { Overlay } from '@angular/cdk/overlay';
4
4
  import { TemplatePortal, CdkPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
5
5
  import { takeUntilDestroyed, rxResource, toObservable } from '@angular/core/rxjs-interop';
6
- import { filter, throwError, map, shareReplay } from 'rxjs';
6
+ import { filter, takeUntil, throwError, map, shareReplay } from 'rxjs';
7
+ import { Router, ActivatedRoute, RouterLink } from '@angular/router';
7
8
  import { LocationStrategy, NgTemplateOutlet } from '@angular/common';
8
- import { RouterLink, Router } from '@angular/router';
9
9
  import { CdkDialogContainer, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
10
+ import { Directionality } from '@angular/cdk/bidi';
10
11
  import { format, startOfMonth, endOfMonth, eachDayOfInterval, endOfWeek, startOfWeek, subMonths, addMonths, isSameDay, isSameMonth, isToday, setMonth, subYears, addYears, getYear, getMonth, getHours, getMinutes, startOfDay, setHours, setMinutes, setYear } from 'date-fns';
11
12
  import { HttpClient } from '@angular/common/http';
12
13
  import { DomSanitizer } from '@angular/platform-browser';
@@ -224,7 +225,7 @@ const TRANSPARENT_BACKDROP_CLASS = 'cdk-overlay-transparent-backdrop';
224
225
  // Upper bound for how long to keep a non-reused pane alive after detach so the
225
226
  // panel's `animate.leave` can finish. Disposes on `animationend`; this only
226
227
  // fires when no exit animation runs (e.g. the `none` motion level).
227
- const LEAVE_ANIMATION_FALLBACK_MS = 500;
228
+ const LEAVE_ANIMATION_FALLBACK_MS$2 = 500;
228
229
  /**
229
230
  * Owns the CDK-Overlay lifecycle shared by the library's connected overlay
230
231
  * components (popover, menu, select): create/attach, dismissal wiring
@@ -366,7 +367,7 @@ class OverlayManager {
366
367
  overlayRef.dispose();
367
368
  };
368
369
  paneElement.addEventListener('animationend', finalize);
369
- const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
370
+ const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$2);
370
371
  }
371
372
  _dispose() {
372
373
  this._overlayRef?.dispose();
@@ -560,6 +561,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
560
561
 
561
562
  // Form control base classes
562
563
 
564
+ class QuerySyncDirective {
565
+ _router = inject(Router);
566
+ _route = inject(ActivatedRoute);
567
+ syncToUrl(param, value) {
568
+ void this._router.navigate([], {
569
+ relativeTo: this._route,
570
+ queryParams: { [param]: value },
571
+ queryParamsHandling: 'merge',
572
+ replaceUrl: true,
573
+ });
574
+ }
575
+ readParam(param) {
576
+ return this._route.snapshot.queryParamMap.get(param);
577
+ }
578
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: QuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
579
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.1", type: QuerySyncDirective, isStandalone: true, ngImport: i0 });
580
+ }
581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: QuerySyncDirective, decorators: [{
582
+ type: Directive
583
+ }] });
584
+
563
585
  const DEFAULT_ALERT_CONFIG = {
564
586
  color: 'primary',
565
587
  label: {
@@ -984,6 +1006,231 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
984
1006
  }, template: "<span class=\"tls-divider-line tls-divider-line--start\"></span>\n<div class=\"tls-divider-content\">\n <ng-content></ng-content>\n</div>\n<span class=\"tls-divider-line tls-divider-line--end\"></span>\n" }]
985
1007
  }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], flush: [{ type: i0.Input, args: [{ isSignal: true, alias: "flush", required: false }] }] } });
986
1008
 
1009
+ // Upper bound for how long to keep the drawer alive after a close is requested so
1010
+ // its slide-out (`--leave`) animation can finish before disposal. The `animationend`
1011
+ // listener disposes early; this fallback covers the case where no exit animation
1012
+ // runs (e.g. the `none` motion level, where nothing is emitted).
1013
+ const LEAVE_ANIMATION_FALLBACK_MS$1 = 500;
1014
+ // Named size tokens, used to tell a preset apart from a custom CSS-length string.
1015
+ const DRAWER_NAMED_SIZES = ['sm', 'md', 'lg', 'full'];
1016
+
1017
+ const DEFAULT_DRAWER_CONFIG = {
1018
+ side: 'end',
1019
+ size: 'md',
1020
+ closeable: true,
1021
+ backdropClose: true,
1022
+ rounded: false,
1023
+ };
1024
+
1025
+ const DRAWER_CONFIG = new InjectionToken('DRAWER_CONFIG', {
1026
+ factory: () => DEFAULT_DRAWER_CONFIG,
1027
+ });
1028
+
1029
+ class Drawer extends CdkDialogContainer {
1030
+ // Injections
1031
+ _tlsConfig = inject(DRAWER_CONFIG);
1032
+ _dialogRef = inject(DialogRef);
1033
+ // State
1034
+ _state = signal('enter', ...(ngDevMode ? [{ debugName: "_state" }] : []));
1035
+ _closing = false;
1036
+ // Computed
1037
+ hostClasses = computed(() => {
1038
+ const classes = [
1039
+ 'tls-drawer',
1040
+ `tls-drawer--${this._tlsConfig.side}`,
1041
+ `tls-drawer--${this._sizeClass()}`,
1042
+ `tls-drawer--${this._state()}`,
1043
+ ];
1044
+ if (this._tlsConfig.rounded)
1045
+ classes.push('tls-drawer--rounded');
1046
+ return classes;
1047
+ }, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
1048
+ // Accessors
1049
+ get config() {
1050
+ return this._tlsConfig;
1051
+ }
1052
+ // The custom CSS length applied inline when `size` is not a named token, else
1053
+ // `null` so the attribute is omitted and the size modifier class takes over.
1054
+ get customSize() {
1055
+ return this._isNamedSize(this._tlsConfig.size) ? null : this._tlsConfig.size;
1056
+ }
1057
+ // Public methods
1058
+ // Plays the slide-out animation, then disposes the overlay once it finishes.
1059
+ // Routed through here for every dismissal path (close button, backdrop, Escape)
1060
+ // because `DialogRef.close()` disposes synchronously, which would skip the exit.
1061
+ animatedClose(result) {
1062
+ if (this._closing)
1063
+ return;
1064
+ this._closing = true;
1065
+ this._state.set('leave');
1066
+ this._afterLeaveAnimation(() => this._dialogRef.close(result));
1067
+ }
1068
+ // Protected methods
1069
+ close() {
1070
+ this.animatedClose();
1071
+ }
1072
+ // Private methods
1073
+ _sizeClass() {
1074
+ const size = this._tlsConfig.size;
1075
+ return this._isNamedSize(size) ? size : 'custom';
1076
+ }
1077
+ _isNamedSize(size) {
1078
+ return DRAWER_NAMED_SIZES.includes(size);
1079
+ }
1080
+ // Invokes `onDone` when the leave animation ends, disposing immediately when no
1081
+ // slide-out actually runs (e.g. the `none` motion level, where the motion mixin
1082
+ // emits nothing) so reduced-motion users don't wait out the fallback timeout.
1083
+ _afterLeaveAnimation(onDone) {
1084
+ const element = this._elementRef.nativeElement;
1085
+ let settled = false;
1086
+ const finalize = () => {
1087
+ if (settled)
1088
+ return;
1089
+ settled = true;
1090
+ window.clearTimeout(timeoutId);
1091
+ element.removeEventListener('animationend', onAnimationEnd);
1092
+ onDone();
1093
+ };
1094
+ // Only the host's own slide-out finalizes; ignore `animationend` bubbling up
1095
+ // from animated content inside the drawer.
1096
+ const onAnimationEnd = (event) => {
1097
+ if (event.target === element)
1098
+ finalize();
1099
+ };
1100
+ element.addEventListener('animationend', onAnimationEnd);
1101
+ // Safety net if `animationend` never arrives (e.g. the pane is torn down early).
1102
+ const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$1);
1103
+ // The `--leave` class applies on the next change detection; on the following
1104
+ // frame, close at once if no animation is running. When motion is enabled the
1105
+ // computed `animationName` is never `none`, so this cannot finalize early.
1106
+ requestAnimationFrame(() => {
1107
+ if (getComputedStyle(element).animationName === 'none')
1108
+ finalize();
1109
+ });
1110
+ }
1111
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Drawer, deps: null, target: i0.ɵɵFactoryTarget.Component });
1112
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: Drawer, isStandalone: true, selector: "tls-drawer", host: { properties: { "class": "hostClasses()", "style.--tls-drawer-size": "customSize" } }, usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet />\n@if (config.closeable) {\n <button class=\"tls-drawer__close\" type=\"button\" aria-label=\"Close drawer\" (click)=\"close()\">\n <svg viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L9 9M9 1L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n", dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] });
1113
+ }
1114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Drawer, decorators: [{
1115
+ type: Component,
1116
+ args: [{ selector: 'tls-drawer', imports: [CdkPortalOutlet], host: {
1117
+ '[class]': 'hostClasses()',
1118
+ '[style.--tls-drawer-size]': 'customSize',
1119
+ }, template: "<ng-template cdkPortalOutlet />\n@if (config.closeable) {\n <button class=\"tls-drawer__close\" type=\"button\" aria-label=\"Close drawer\" (click)=\"close()\">\n <svg viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L9 9M9 1L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n" }]
1120
+ }] });
1121
+
1122
+ /**
1123
+ * Handle to an open drawer. Provided to the drawer's content component (inject it
1124
+ * instead of the CDK `DialogRef`) and returned from {@link DrawerService.open}.
1125
+ *
1126
+ * `close` routes through the container so the slide-out animation plays before the
1127
+ * overlay is disposed, unlike the CDK `DialogRef` which disposes synchronously.
1128
+ */
1129
+ class DrawerRef {
1130
+ _dialogRef;
1131
+ _container;
1132
+ closed;
1133
+ constructor(_dialogRef, _container) {
1134
+ this._dialogRef = _dialogRef;
1135
+ this._container = _container;
1136
+ this.closed = _dialogRef.closed;
1137
+ }
1138
+ get componentInstance() {
1139
+ return this._dialogRef.componentInstance;
1140
+ }
1141
+ close(result) {
1142
+ this._container.animatedClose(result);
1143
+ }
1144
+ }
1145
+
1146
+ class DrawerService {
1147
+ _dialog = inject(Dialog$1);
1148
+ _overlay = inject(Overlay);
1149
+ _directionality = inject(Directionality);
1150
+ _config = inject(DRAWER_CONFIG);
1151
+ // Currently-open drawers, tracked so `closeAll` can play each slide-out and so it
1152
+ // closes drawers only (the CDK `Dialog` is shared with `tls-dialog`).
1153
+ _openDrawers = new Set();
1154
+ open(component, config) {
1155
+ const resolvedConfig = {
1156
+ side: config?.side ?? this._config.side,
1157
+ size: config?.size ?? this._config.size,
1158
+ closeable: config?.closeable ?? this._config.closeable,
1159
+ backdropClose: config?.backdropClose ?? this._config.backdropClose,
1160
+ rounded: config?.rounded ?? this._config.rounded,
1161
+ };
1162
+ let drawerRef;
1163
+ const dialogRef = this._dialog.open(component, {
1164
+ container: {
1165
+ type: Drawer,
1166
+ providers: () => [{ provide: DRAWER_CONFIG, useValue: resolvedConfig }],
1167
+ },
1168
+ // Built against the content injector so the drawer's content can `inject(DrawerRef)`
1169
+ // to close itself. The same instance is returned to the caller below.
1170
+ providers: (cdkRef, _cdkConfig, container) => {
1171
+ drawerRef = new DrawerRef(cdkRef, container);
1172
+ return [{ provide: DrawerRef, useValue: drawerRef }];
1173
+ },
1174
+ positionStrategy: this._buildPositionStrategy(resolvedConfig.side),
1175
+ direction: this._directionality.value,
1176
+ hasBackdrop: true,
1177
+ backdropClass: 'tls-drawer-backdrop',
1178
+ // Suppress CDK's synchronous auto-close so every dismissal routes through
1179
+ // `DrawerRef.close`, which plays the slide-out before disposal.
1180
+ disableClose: true,
1181
+ role: config?.role ?? 'dialog',
1182
+ ariaLabel: config?.ariaLabel ?? null,
1183
+ ariaLabelledBy: config?.ariaLabelledBy ?? null,
1184
+ ariaDescribedBy: config?.ariaDescribedBy ?? null,
1185
+ data: config?.data,
1186
+ });
1187
+ const trackedRef = drawerRef;
1188
+ this._openDrawers.add(trackedRef);
1189
+ dialogRef.closed.subscribe(() => this._openDrawers.delete(trackedRef));
1190
+ this._wireDismissal(dialogRef, drawerRef, resolvedConfig);
1191
+ return drawerRef;
1192
+ }
1193
+ closeAll() {
1194
+ // Iterating a snapshot: `close` is animated, so removal happens later (on
1195
+ // `closed`), but guard against any synchronous mutation regardless.
1196
+ for (const drawerRef of [...this._openDrawers])
1197
+ drawerRef.close();
1198
+ }
1199
+ // Private
1200
+ _buildPositionStrategy(side) {
1201
+ const position = this._overlay.position().global();
1202
+ const isRtl = this._directionality.value === 'rtl';
1203
+ switch (side) {
1204
+ case 'top':
1205
+ return position.top('0').left('0');
1206
+ case 'bottom':
1207
+ return position.bottom('0').left('0');
1208
+ // `start`/`end` are logical: `start` pins to the leading edge (left in LTR,
1209
+ // right in RTL), `end` to the trailing edge.
1210
+ case 'start':
1211
+ return isRtl ? position.top('0').right('0') : position.top('0').left('0');
1212
+ case 'end':
1213
+ return isRtl ? position.top('0').left('0') : position.top('0').right('0');
1214
+ }
1215
+ }
1216
+ _wireDismissal(dialogRef, drawerRef, config) {
1217
+ if (!config.backdropClose)
1218
+ return;
1219
+ dialogRef.backdropClick
1220
+ .pipe(takeUntil(dialogRef.closed))
1221
+ .subscribe(() => drawerRef.close());
1222
+ dialogRef.keydownEvents
1223
+ .pipe(takeUntil(dialogRef.closed), filter(event => event.key === 'Escape'))
1224
+ .subscribe(() => drawerRef.close());
1225
+ }
1226
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1227
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DrawerService, providedIn: 'root' });
1228
+ }
1229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: DrawerService, decorators: [{
1230
+ type: Injectable,
1231
+ args: [{ providedIn: 'root' }]
1232
+ }] });
1233
+
987
1234
  class FormControlAddon {
988
1235
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormControlAddon, deps: [], target: i0.ɵɵFactoryTarget.Component });
989
1236
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: FormControlAddon, isStandalone: true, selector: "tls-form-control-addon", host: { classAttribute: "tls-form-control-addon" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
@@ -2059,11 +2306,11 @@ class Input extends ValueFormControl {
2059
2306
  this.value.set(target.value);
2060
2307
  }
2061
2308
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Input, deps: null, target: i0.ɵɵFactoryTarget.Component });
2062
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Input, isStandalone: true, selector: "tls-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, 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 } }, outputs: { value: "valueChange" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Input) }], usesInheritance: true, ngImport: i0, template: "<input\n [type]=\"type()\"\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-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", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] });
2309
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Input, isStandalone: true, selector: "tls-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, 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 } }, outputs: { value: "valueChange" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Input) }], usesInheritance: true, ngImport: i0, template: "<input\n [type]=\"type()\"\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-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", styles: [":host{--tls-input-width: 200px;display:inline-block;width:var(--tls-input-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-input-width: 100%}\n"] });
2063
2310
  }
2064
2311
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Input, decorators: [{
2065
2312
  type: Component,
2066
- args: [{ selector: 'tls-input', providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Input) }], template: "<input\n [type]=\"type()\"\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-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", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] }]
2313
+ args: [{ selector: 'tls-input', providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Input) }], template: "<input\n [type]=\"type()\"\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-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", styles: [":host{--tls-input-width: 200px;display:inline-block;width:var(--tls-input-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-input-width: 100%}\n"] }]
2067
2314
  }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], 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 }] }] } });
2068
2315
 
2069
2316
  class InputDirective {
@@ -2134,11 +2381,11 @@ class InputNumber extends ValueFormControl {
2134
2381
  this.value.set(isNaN(parsed) ? null : parsed);
2135
2382
  }
2136
2383
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputNumber, deps: null, target: i0.ɵɵFactoryTarget.Component });
2137
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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-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", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] });
2384
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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-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", styles: [":host{--tls-input-number-width: 200px;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"] });
2138
2385
  }
2139
2386
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputNumber, decorators: [{
2140
2387
  type: Component,
2141
- args: [{ selector: 'tls-input-number', 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-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", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] }]
2388
+ args: [{ selector: 'tls-input-number', 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-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", styles: [":host{--tls-input-number-width: 200px;display:inline-block;width:var(--tls-input-number-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-input-number-width: 100%}\n"] }]
2142
2389
  }], 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 }] }] } });
2143
2390
 
2144
2391
  const DEFAULT_PASSWORD_CONFIG = {
@@ -2202,6 +2449,7 @@ const PIN_INPUT_CONFIG = new InjectionToken('PIN_INPUT_CONFIG', {
2202
2449
 
2203
2450
  class PinInput extends ValueFormControl {
2204
2451
  _config = inject(PIN_INPUT_CONFIG);
2452
+ _directionality = inject(Directionality);
2205
2453
  _inputs = viewChildren('cell', ...(ngDevMode ? [{ debugName: "_inputs" }] : []));
2206
2454
  // Inputs
2207
2455
  value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
@@ -2245,13 +2493,12 @@ class PinInput extends ValueFormControl {
2245
2493
  this._focusCell(index - 1);
2246
2494
  }
2247
2495
  }
2248
- else if (event.key === 'ArrowLeft') {
2496
+ else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
2249
2497
  event.preventDefault();
2250
- this._focusCell(index - 1);
2251
- }
2252
- else if (event.key === 'ArrowRight') {
2253
- event.preventDefault();
2254
- this._focusCell(index + 1);
2498
+ // Arrows are physical; map them to previous/next cell per layout direction.
2499
+ const isRtl = this._directionality.value === 'rtl';
2500
+ const goToPrevious = isRtl ? event.key === 'ArrowRight' : event.key === 'ArrowLeft';
2501
+ this._focusCell(goToPrevious ? index - 1 : index + 1);
2255
2502
  }
2256
2503
  element.value = this.getCellValue(index);
2257
2504
  }
@@ -2580,11 +2827,11 @@ class Textarea extends ValueFormControl {
2580
2827
  this.value.set(target.value);
2581
2828
  }
2582
2829
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Textarea, deps: null, target: i0.ɵɵFactoryTarget.Component });
2583
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Textarea, isStandalone: true, selector: "tls-textarea", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "tls-textarea" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Textarea) }], usesInheritance: true, ngImport: i0, template: "<textarea\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-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rows]=\"rows()\"\n [style.resize]=\"resize()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n></textarea>\n", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] });
2830
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Textarea, isStandalone: true, selector: "tls-textarea", 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 }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { classAttribute: "tls-textarea" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Textarea) }], usesInheritance: true, ngImport: i0, template: "<textarea\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-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rows]=\"rows()\"\n [style.resize]=\"resize()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n></textarea>\n", styles: [":host{--tls-textarea-width: 200px;display:inline-block;width:var(--tls-textarea-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-textarea-width: 100%}\n"] });
2584
2831
  }
2585
2832
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Textarea, decorators: [{
2586
2833
  type: Component,
2587
- args: [{ selector: 'tls-textarea', host: { class: 'tls-textarea' }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Textarea) }], template: "<textarea\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-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rows]=\"rows()\"\n [style.resize]=\"resize()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n></textarea>\n", styles: [":host{width:auto;display:inline-block}:host:has(.tls-form-control.tls-form-control--fluid){width:100%}\n"] }]
2834
+ args: [{ selector: 'tls-textarea', host: { class: 'tls-textarea' }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Textarea) }], template: "<textarea\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-describedby]=\"describedBy()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rows]=\"rows()\"\n [style.resize]=\"resize()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n></textarea>\n", styles: [":host{--tls-textarea-width: 200px;display:inline-block;width:var(--tls-textarea-width)}:host .tls-form-control{width:100%}:host:has(.tls-form-control--fluid){--tls-textarea-width: 100%}\n"] }]
2588
2835
  }], 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 }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }] } });
2589
2836
 
2590
2837
  const DEFAULT_TOGGLE_GROUP_CONFIG = {
@@ -3055,6 +3302,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
3055
3302
  }, template: "@if (showFirstButton()) {\n <button\n id=\"tls-pagination-first\"\n class=\"tls-pagination__button\"\n [disabled]=\"value() === 1\"\n (click)=\"firstPage()\"\n >\n <span class=\"tls-pagination__button-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <polyline points=\"11 17 6 12 11 7\" />\n <polyline points=\"18 17 13 12 18 7\" />\n </svg>\n </span>\n </button>\n}\n\n<button\n id=\"tls-pagination-prev\"\n class=\"tls-pagination__button\"\n [disabled]=\"value() === 1\"\n (click)=\"prevPage()\"\n>\n <span class=\"tls-pagination__button-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\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 (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 [disabled]=\"value() === pageCount()\"\n (click)=\"nextPage()\"\n>\n <span class=\"tls-pagination__button-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n </span>\n</button>\n\n@if (showLastButton()) {\n <button\n id=\"tls-pagination-last\"\n class=\"tls-pagination__button\"\n [disabled]=\"value() === pageCount()\"\n (click)=\"lastPage()\"\n >\n <span class=\"tls-pagination__button-icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <polyline points=\"13 17 18 12 13 7\" />\n <polyline points=\"6 17 11 12 6 7\" />\n </svg>\n </span>\n </button>\n}\n" }]
3056
3303
  }], 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 }] }] } });
3057
3304
 
3305
+ const DEFAULT_PAGINATION_QUERY_SYNC_CONFIG = {
3306
+ paramKey: 'page',
3307
+ };
3308
+
3309
+ const PAGINATION_QUERY_SYNC_CONFIG = new InjectionToken('PAGINATION_QUERY_SYNC_CONFIG', { factory: () => DEFAULT_PAGINATION_QUERY_SYNC_CONFIG });
3310
+
3311
+ class PaginationQuerySyncDirective extends QuerySyncDirective {
3312
+ _pagination = inject(Pagination);
3313
+ _config = inject(PAGINATION_QUERY_SYNC_CONFIG);
3314
+ // Inputs
3315
+ tlsPaginationQuerySync = input(this._config.paramKey, ...(ngDevMode ? [{ debugName: "tlsPaginationQuerySync" }] : []));
3316
+ constructor() {
3317
+ super();
3318
+ effect(() => {
3319
+ const page = this._pagination.value();
3320
+ const param = this.tlsPaginationQuerySync();
3321
+ this.syncToUrl(param, page);
3322
+ });
3323
+ }
3324
+ // Lifecycle
3325
+ ngOnInit() {
3326
+ const raw = this.readParam(this.tlsPaginationQuerySync());
3327
+ if (raw === null)
3328
+ return;
3329
+ const page = Number(raw);
3330
+ if (!Number.isNaN(page) && page >= 1)
3331
+ this._pagination.value.set(page);
3332
+ }
3333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PaginationQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3334
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: PaginationQuerySyncDirective, isStandalone: true, selector: "tls-pagination[tlsPaginationQuerySync]", inputs: { tlsPaginationQuerySync: { classPropertyName: "tlsPaginationQuerySync", publicName: "tlsPaginationQuerySync", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
3335
+ }
3336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: PaginationQuerySyncDirective, decorators: [{
3337
+ type: Directive,
3338
+ args: [{
3339
+ selector: 'tls-pagination[tlsPaginationQuerySync]',
3340
+ }]
3341
+ }], ctorParameters: () => [], propDecorators: { tlsPaginationQuerySync: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsPaginationQuerySync", required: false }] }] } });
3342
+
3058
3343
  const DEFAULT_SKELETON_CONFIG = {
3059
3344
  size: null,
3060
3345
  width: null,
@@ -3181,6 +3466,7 @@ class Stepper {
3181
3466
  panelId = `tls-stepper-panel-${++Stepper._counter}`;
3182
3467
  _config = inject(STEPPER_CONFIG);
3183
3468
  _stepperService = inject(StepperService);
3469
+ _directionality = inject(Directionality);
3184
3470
  steps = contentChildren(Step, ...(ngDevMode ? [{ debugName: "steps" }] : []));
3185
3471
  completedTemplateRef = contentChild('completedTemplate', ...(ngDevMode ? [{ debugName: "completedTemplateRef" }] : []));
3186
3472
  completedIconTemplateRef = contentChild('stepCompletedIcon', ...(ngDevMode ? [{ debugName: "completedIconTemplateRef" }] : []));
@@ -3220,8 +3506,12 @@ class Stepper {
3220
3506
  }
3221
3507
  onKeydown(event, index) {
3222
3508
  const orientation = this.orientation();
3223
- const keyNext = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';
3224
- const keyPrev = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';
3509
+ // Horizontal arrows are physical; swap them in RTL so Next still advances.
3510
+ const isRtl = this._directionality.value === 'rtl';
3511
+ const horizontalNext = isRtl ? 'ArrowLeft' : 'ArrowRight';
3512
+ const horizontalPrev = isRtl ? 'ArrowRight' : 'ArrowLeft';
3513
+ const keyNext = orientation === 'horizontal' ? horizontalNext : 'ArrowDown';
3514
+ const keyPrev = orientation === 'horizontal' ? horizontalPrev : 'ArrowUp';
3225
3515
  let target = null;
3226
3516
  switch (event.key) {
3227
3517
  case keyNext:
@@ -3470,6 +3760,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
3470
3760
  }, providers: [TabsService], template: "<ul\n class=\"tls-tabs-header\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (tab of tabs(); track tab) {\n <li\n class=\"tls-tabs-header__item\"\n [class.tls-tabs-header__item--active]=\"tab.value() === selected()\"\n >\n <button\n class=\"tls-tabs-header__item-button\"\n role=\"tab\"\n (click)=\"selected.set(tab.value())\"\n [attr.aria-selected]=\"tab.value() === selected()\"\n >\n {{ tab.label() }}\n </button>\n </li>\n }\n</ul>\n<div class=\"tls-tabs-content\">\n <ng-content></ng-content>\n</div>\n" }]
3471
3761
  }], ctorParameters: () => [], propDecorators: { tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => Tab), { isSignal: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }] } });
3472
3762
 
3763
+ const DEFAULT_TABS_QUERY_SYNC_CONFIG = {
3764
+ paramKey: 'tab',
3765
+ };
3766
+
3767
+ const TABS_QUERY_SYNC_CONFIG = new InjectionToken('TABS_QUERY_SYNC_CONFIG', {
3768
+ factory: () => DEFAULT_TABS_QUERY_SYNC_CONFIG,
3769
+ });
3770
+
3771
+ class TabsQuerySyncDirective extends QuerySyncDirective {
3772
+ _tabs = inject(Tabs);
3773
+ _config = inject(TABS_QUERY_SYNC_CONFIG);
3774
+ // Inputs
3775
+ tlsTabsQuerySync = input(this._config.paramKey, ...(ngDevMode ? [{ debugName: "tlsTabsQuerySync" }] : []));
3776
+ constructor() {
3777
+ super();
3778
+ effect(() => {
3779
+ const selected = this._tabs.selected();
3780
+ const param = this.tlsTabsQuerySync();
3781
+ if (selected === null)
3782
+ return;
3783
+ this.syncToUrl(param, selected);
3784
+ });
3785
+ }
3786
+ // Lifecycle
3787
+ ngOnInit() {
3788
+ const value = this.readParam(this.tlsTabsQuerySync());
3789
+ if (value !== null)
3790
+ this._tabs.selected.set(value);
3791
+ }
3792
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: TabsQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3793
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: TabsQuerySyncDirective, isStandalone: true, selector: "tls-tabs[tlsTabsQuerySync]", inputs: { tlsTabsQuerySync: { classPropertyName: "tlsTabsQuerySync", publicName: "tlsTabsQuerySync", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
3794
+ }
3795
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: TabsQuerySyncDirective, decorators: [{
3796
+ type: Directive,
3797
+ args: [{
3798
+ selector: 'tls-tabs[tlsTabsQuerySync]',
3799
+ }]
3800
+ }], ctorParameters: () => [], propDecorators: { tlsTabsQuerySync: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsTabsQuerySync", required: false }] }] } });
3801
+
3473
3802
  class Tooltip {
3474
3803
  static _counter = 0;
3475
3804
  id = `tls-tooltip-${++Tooltip._counter}`;
@@ -3489,7 +3818,7 @@ class Tooltip {
3489
3818
  return array;
3490
3819
  }, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
3491
3820
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
3492
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: Tooltip, isStandalone: true, selector: "tls-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, templateData: { classPropertyName: "templateData", publicName: "templateData", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { content: "contentChange", templateData: "templateDataChange", color: "colorChange" }, host: { attributes: { "role": "tooltip" }, properties: { "class": "hostClasses()", "id": "id" } }, ngImport: i0, template: `
3821
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: Tooltip, isStandalone: true, selector: "tls-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, templateData: { classPropertyName: "templateData", publicName: "templateData", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { content: "contentChange", templateData: "templateDataChange", color: "colorChange" }, host: { attributes: { "role": "tooltip", "animate.enter": "tls-tooltip--enter", "animate.leave": "tls-tooltip--leave" }, properties: { "class": "hostClasses()", "id": "id" } }, ngImport: i0, template: `
3493
3822
  @if (isString()) {
3494
3823
  {{ content() }}
3495
3824
  } @else {
@@ -3519,10 +3848,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
3519
3848
  '[class]': 'hostClasses()',
3520
3849
  'role': 'tooltip',
3521
3850
  '[id]': 'id',
3851
+ 'animate.enter': 'tls-tooltip--enter',
3852
+ 'animate.leave': 'tls-tooltip--leave',
3522
3853
  },
3523
3854
  }]
3524
3855
  }], 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"] }] } });
3525
3856
 
3857
+ // Upper bound for how long to keep a detached tooltip pane alive so its
3858
+ // `animate.leave` can finish. Disposes on `animationend`; this timeout only
3859
+ // fires when no exit animation runs (e.g. the `none` motion level).
3860
+ const LEAVE_ANIMATION_FALLBACK_MS = 500;
3861
+
3526
3862
  class TooltipService {
3527
3863
  _overlay = inject(Overlay);
3528
3864
  _overlayRef = null;
@@ -3548,12 +3884,44 @@ class TooltipService {
3548
3884
  this._overlayRef.updatePositionStrategy(positionStrategy);
3549
3885
  }
3550
3886
  }
3887
+ // Detaches the tooltip so Angular's `animate.leave` plays the exit animation,
3888
+ // then disposes the pane once that animation finishes. The pane is kept alive
3889
+ // in the meantime so it is not torn down mid-animation.
3890
+ hide() {
3891
+ if (!this._overlayRef)
3892
+ return;
3893
+ const overlayRef = this._overlayRef;
3894
+ this._overlayRef = null;
3895
+ overlayRef.detach();
3896
+ this._disposeAfterAnimation(overlayRef);
3897
+ }
3551
3898
  dispose() {
3552
3899
  if (!this._overlayRef)
3553
3900
  return;
3554
3901
  this._overlayRef.dispose();
3555
3902
  this._overlayRef = null;
3556
3903
  }
3904
+ // Private methods
3905
+ // Disposes a detached overlay once the tooltip's exit animation has finished.
3906
+ // Falls back to a timeout when no animation runs (e.g. the `none` motion level).
3907
+ _disposeAfterAnimation(overlayRef) {
3908
+ const paneElement = overlayRef.overlayElement;
3909
+ if (!paneElement) {
3910
+ overlayRef.dispose();
3911
+ return;
3912
+ }
3913
+ let settled = false;
3914
+ const finalize = () => {
3915
+ if (settled)
3916
+ return;
3917
+ settled = true;
3918
+ window.clearTimeout(timeoutId);
3919
+ paneElement.removeEventListener('animationend', finalize);
3920
+ overlayRef.dispose();
3921
+ };
3922
+ paneElement.addEventListener('animationend', finalize);
3923
+ const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
3924
+ }
3557
3925
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3558
3926
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: TooltipService });
3559
3927
  }
@@ -3603,7 +3971,7 @@ class TooltipDirective {
3603
3971
  }
3604
3972
  }
3605
3973
  onMouseLeave() {
3606
- this._tooltipService.dispose();
3974
+ this._hide();
3607
3975
  }
3608
3976
  onTouchStart(event) {
3609
3977
  event.preventDefault();
@@ -3630,7 +3998,7 @@ class TooltipDirective {
3630
3998
  this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipRef.instance.id);
3631
3999
  }
3632
4000
  _hide() {
3633
- this._tooltipService.dispose();
4001
+ this._tooltipService.hide();
3634
4002
  this._visible.set(false);
3635
4003
  this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
3636
4004
  }
@@ -3725,6 +4093,10 @@ const provideThalassicUIConfig = (config) => {
3725
4093
  provide: PAGINATION_CONFIG,
3726
4094
  useValue: deepMerge(DEFAULT_PAGINATION_CONFIG, config.components.pagination),
3727
4095
  },
4096
+ {
4097
+ provide: PAGINATION_QUERY_SYNC_CONFIG,
4098
+ useValue: deepMerge(DEFAULT_PAGINATION_QUERY_SYNC_CONFIG, config.components.paginationQuerySync),
4099
+ },
3728
4100
  {
3729
4101
  provide: PASSWORD_CONFIG,
3730
4102
  useValue: deepMerge(DEFAULT_PASSWORD_CONFIG, config.components.password),
@@ -3759,6 +4131,10 @@ const provideThalassicUIConfig = (config) => {
3759
4131
  },
3760
4132
  { provide: TABLE_CONFIG, useValue: deepMerge(DEFAULT_TABLE_CONFIG, config.components.table) },
3761
4133
  { provide: TABS_CONFIG, useValue: deepMerge(DEFAULT_TABS_CONFIG, config.components.tabs) },
4134
+ {
4135
+ provide: TABS_QUERY_SYNC_CONFIG,
4136
+ useValue: deepMerge(DEFAULT_TABS_QUERY_SYNC_CONFIG, config.components.tabsQuerySync),
4137
+ },
3762
4138
  {
3763
4139
  provide: TEXTAREA_CONFIG,
3764
4140
  useValue: deepMerge(DEFAULT_TEXTAREA_CONFIG, config.components.textarea),
@@ -3778,5 +4154,5 @@ const provideThalassicUIConfig = (config) => {
3778
4154
  * Generated bundle index. Do not edit.
3779
4155
  */
3780
4156
 
3781
- export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FILE_UPLOADER_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FILE_UPLOADER_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileUploader, FormControl, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, Input, InputDirective, InputNumber, LOADER_CONFIG, Loader, MENU_CONFIG, MULTI_SELECT_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, PAGINATION_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TEXTAREA_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, Textarea, ToggleGroup, TooltipDirective, ValueFormControl, provideThalassicUIConfig };
4157
+ export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_DRAWER_CONFIG, DEFAULT_FILE_UPLOADER_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_INPUT_NUMBER_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_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_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TABS_QUERY_SYNC_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DRAWER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, Drawer, DrawerRef, DrawerService, FILE_UPLOADER_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileUploader, FormControl, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, INPUT_CONFIG, INPUT_NUMBER_CONFIG, Icon, Input, InputDirective, InputNumber, LOADER_CONFIG, Loader, MENU_CONFIG, MULTI_SELECT_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, 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, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TABS_QUERY_SYNC_CONFIG, TEXTAREA_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, TabsQuerySyncDirective, Textarea, ToggleGroup, TooltipDirective, ValueFormControl, provideThalassicUIConfig };
3782
4158
  //# sourceMappingURL=thalassic-ui.mjs.map