@thalassic/ui 0.18.0 → 22.0.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-charts.mjs +48 -41
- package/fesm2022/thalassic-ui-charts.mjs.map +1 -1
- package/fesm2022/thalassic-ui.mjs +1670 -703
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +5 -4
- package/types/thalassic-ui-charts.d.ts +4 -5
- package/types/thalassic-ui.d.ts +226 -11
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, signal, computed, booleanAttribute, Directive, InjectionToken, inject, ViewContainerRef, DestroyRef, viewChild, Component, contentChild, effect, forwardRef,
|
|
2
|
+
import { model, input, signal, computed, booleanAttribute, Directive, InjectionToken, inject, ViewContainerRef, DestroyRef, viewChild, Component, contentChild, effect, forwardRef, ElementRef, output, afterNextRender, Injectable, numberAttribute, viewChildren, contentChildren, isDevMode, untracked, TemplateRef, Renderer2, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { Overlay } from '@angular/cdk/overlay';
|
|
4
|
-
import { TemplatePortal,
|
|
4
|
+
import { TemplatePortal, ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal';
|
|
5
5
|
import { takeUntilDestroyed, rxResource, toObservable } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { filter, takeUntil, throwError, map, shareReplay } from 'rxjs';
|
|
7
|
-
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
|
|
6
|
+
import { filter, Subscription, takeUntil, throwError, map, shareReplay } from 'rxjs';
|
|
7
|
+
import { Router, ActivatedRoute, RouterLink, NavigationStart } from '@angular/router';
|
|
8
8
|
import { LocationStrategy, NgTemplateOutlet } from '@angular/common';
|
|
9
|
+
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
|
|
10
|
+
import { filter as filter$1 } from 'rxjs/operators';
|
|
9
11
|
import { CdkDialogContainer, DialogRef, Dialog as Dialog$1 } from '@angular/cdk/dialog';
|
|
10
12
|
import { Directionality } from '@angular/cdk/bidi';
|
|
11
13
|
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';
|
|
14
|
+
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
|
12
15
|
import { HttpClient } from '@angular/common/http';
|
|
13
16
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
14
17
|
import { CdkTable, CdkHeaderCell, CdkCell, CdkCellDef, CdkHeaderCellDef, CdkColumnDef, CdkHeaderRow, CdkHeaderRowDef, CdkRow, CdkRowDef } from '@angular/cdk/table';
|
|
@@ -16,41 +19,50 @@ import { deepMerge } from '@thalassic/core';
|
|
|
16
19
|
|
|
17
20
|
class FormControl {
|
|
18
21
|
// Models
|
|
19
|
-
touched = model(false,
|
|
22
|
+
touched = model(false, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
20
24
|
// Inputs
|
|
21
|
-
name = input('',
|
|
25
|
+
name = input('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
22
27
|
/**
|
|
23
28
|
* Accessible name forwarded to the inner native control (`<input>`/`<textarea>`/trigger),
|
|
24
29
|
* for controls used without an associated visible `<label>`. Placed on the inner control
|
|
25
30
|
* because the host element is a non-interactive wrapper.
|
|
26
31
|
*/
|
|
27
|
-
ariaLabel = input(undefined,
|
|
32
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
28
34
|
/**
|
|
29
35
|
* `id` of an element whose text names the inner native control, for when the accessible
|
|
30
36
|
* name already exists as visible text. Takes precedence over `ariaLabel` per the ARIA spec.
|
|
31
37
|
*/
|
|
32
|
-
ariaLabelledby = input(undefined,
|
|
38
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
33
40
|
/** `id`(s) of element(s) describing the control (help text, hint), forwarded to `aria-describedby`. */
|
|
34
|
-
ariaDescribedby = input(undefined,
|
|
41
|
+
ariaDescribedby = input(undefined, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
|
|
35
43
|
/** Consumer-provided `id` for the inner native control element (e.g. to wire up an external label). */
|
|
36
|
-
inputId = input(null,
|
|
44
|
+
inputId = input(null, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
37
46
|
/**
|
|
38
47
|
* `id` of the validation-error element, set by an enclosing `tls-form-item` while it renders an
|
|
39
48
|
* error. Merged with `ariaDescribedby` so the control's `aria-describedby` points at both the
|
|
40
49
|
* consumer's description and the live error message.
|
|
41
50
|
*/
|
|
42
|
-
errorMessageId = signal(null,
|
|
51
|
+
errorMessageId = signal(null, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "errorMessageId" }] : /* istanbul ignore next */ []));
|
|
43
53
|
/**
|
|
44
54
|
* `id` of the visible `<label>` element rendered by an enclosing `tls-form-item`. Merged with
|
|
45
55
|
* `ariaLabelledby` so the control's `aria-labelledby` points at the form-item label while still
|
|
46
56
|
* honouring any consumer-supplied labelling.
|
|
47
57
|
*/
|
|
48
|
-
labelId = signal(null,
|
|
58
|
+
labelId = signal(null, /* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [{ debugName: "labelId" }] : /* istanbul ignore next */ []));
|
|
49
60
|
/**
|
|
50
61
|
* `id` assigned to the native control element by an enclosing `tls-form-item`, so the label's
|
|
51
62
|
* `for` attribute can point at the control. Consumer's `inputId` takes precedence.
|
|
52
63
|
*/
|
|
53
|
-
formItemInputId = signal(null,
|
|
64
|
+
formItemInputId = signal(null, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "formItemInputId" }] : /* istanbul ignore next */ []));
|
|
54
66
|
/** Whether this control has a single native labelable element that a `<label for>` can target. */
|
|
55
67
|
supportsLabelFor = false;
|
|
56
68
|
/** Combined `aria-describedby` value (consumer description + form-item error), or null when empty. */
|
|
@@ -63,7 +75,8 @@ class FormControl {
|
|
|
63
75
|
if (errorId)
|
|
64
76
|
ids.push(errorId);
|
|
65
77
|
return ids.length > 0 ? ids.join(' ') : null;
|
|
66
|
-
},
|
|
78
|
+
}, /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
67
80
|
/** Combined `aria-labelledby` value (consumer label id + form-item label), or null when empty. */
|
|
68
81
|
labelledBy = computed(() => {
|
|
69
82
|
const ids = [];
|
|
@@ -74,20 +87,25 @@ class FormControl {
|
|
|
74
87
|
if (formItemLabelId)
|
|
75
88
|
ids.push(formItemLabelId);
|
|
76
89
|
return ids.length > 0 ? ids.join(' ') : null;
|
|
77
|
-
},
|
|
90
|
+
}, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "labelledBy" }] : /* istanbul ignore next */ []));
|
|
78
92
|
/** Resolved `id` for the native control element: consumer's `inputId` first, then form-item's assigned id. */
|
|
79
|
-
effectiveInputId = computed(() => this.inputId() ?? this.formItemInputId(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
effectiveInputId = computed(() => this.inputId() ?? this.formItemInputId(), /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "effectiveInputId" }] : /* istanbul ignore next */ []));
|
|
95
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
96
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
97
|
+
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
98
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
99
|
+
pending = input(false, { ...(ngDevMode ? { debugName: "pending" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
100
|
+
dirty = input(false, { ...(ngDevMode ? { debugName: "dirty" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
101
|
+
errors = input([], /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
103
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
88
104
|
CLASS_NAME = 'tls-form-control';
|
|
89
|
-
notInteractive = computed(() => this.disabled() || this.readonly(),
|
|
90
|
-
|
|
105
|
+
notInteractive = computed(() => this.disabled() || this.readonly(), /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "notInteractive" }] : /* istanbul ignore next */ []));
|
|
107
|
+
controlClasses = computed(() => this.baseControlClasses(), /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "controlClasses" }] : /* istanbul ignore next */ []));
|
|
91
109
|
// Protected methods
|
|
92
110
|
baseControlClasses() {
|
|
93
111
|
const className = this.CLASS_NAME;
|
|
@@ -106,20 +124,20 @@ class FormControl {
|
|
|
106
124
|
array.push(`${className}--dirty`);
|
|
107
125
|
return array;
|
|
108
126
|
}
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
110
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
128
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: FormControl, isStandalone: true, inputs: { touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", 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 }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, pending: { classPropertyName: "pending", publicName: "pending", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touched: "touchedChange" }, ngImport: i0 });
|
|
111
129
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControl, decorators: [{
|
|
113
131
|
type: Directive
|
|
114
132
|
}], propDecorators: { touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], pending: [{ type: i0.Input, args: [{ isSignal: true, alias: "pending", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
|
|
115
133
|
|
|
116
134
|
const FORM_CONTROL = new InjectionToken('FORM_CONTROL');
|
|
117
135
|
|
|
118
136
|
class ValueFormControl extends FormControl {
|
|
119
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
120
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ValueFormControl, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
138
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: ValueFormControl, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
121
139
|
}
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ValueFormControl, decorators: [{
|
|
123
141
|
type: Directive
|
|
124
142
|
}] });
|
|
125
143
|
|
|
@@ -129,11 +147,12 @@ class CheckboxFormControl extends FormControl {
|
|
|
129
147
|
if (this.checked())
|
|
130
148
|
classes.push(`${this.CLASS_NAME}--checked`);
|
|
131
149
|
return classes;
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
static
|
|
150
|
+
}, /* @ts-ignore */
|
|
151
|
+
...(ngDevMode ? [{ debugName: "controlClasses" }] : /* istanbul ignore next */ []));
|
|
152
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxFormControl, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
153
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CheckboxFormControl, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
135
154
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CheckboxFormControl, decorators: [{
|
|
137
156
|
type: Directive
|
|
138
157
|
}] });
|
|
139
158
|
|
|
@@ -169,16 +188,22 @@ function normalizeOptions(options, keys) {
|
|
|
169
188
|
* a runtime-dependent `V | V[]`.
|
|
170
189
|
*/
|
|
171
190
|
class SelectionGroup extends ValueFormControl {
|
|
172
|
-
value = model([],
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
191
|
+
value = model([], /* @ts-ignore */
|
|
192
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
193
|
+
options = input([], /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
195
|
+
optionLabel = input(undefined, /* @ts-ignore */
|
|
196
|
+
...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
197
|
+
optionValue = input(undefined, /* @ts-ignore */
|
|
198
|
+
...(ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
199
|
+
optionDisabled = input(undefined, /* @ts-ignore */
|
|
200
|
+
...(ngDevMode ? [{ debugName: "optionDisabled" }] : /* istanbul ignore next */ []));
|
|
177
201
|
normalizedOptions = computed(() => normalizeOptions(this.options(), {
|
|
178
202
|
label: this.optionLabel(),
|
|
179
203
|
value: this.optionValue(),
|
|
180
204
|
disabled: this.optionDisabled(),
|
|
181
|
-
}),
|
|
205
|
+
}), /* @ts-ignore */
|
|
206
|
+
...(ngDevMode ? [{ debugName: "normalizedOptions" }] : /* istanbul ignore next */ []));
|
|
182
207
|
isSelected(optionValue) {
|
|
183
208
|
return this.value().includes(optionValue);
|
|
184
209
|
}
|
|
@@ -214,10 +239,10 @@ class SelectionGroup extends ValueFormControl {
|
|
|
214
239
|
},
|
|
215
240
|
};
|
|
216
241
|
}
|
|
217
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
218
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
242
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectionGroup, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
243
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: SelectionGroup, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0 });
|
|
219
244
|
}
|
|
220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SelectionGroup, decorators: [{
|
|
221
246
|
type: Directive
|
|
222
247
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }] } });
|
|
223
248
|
|
|
@@ -225,7 +250,7 @@ const TRANSPARENT_BACKDROP_CLASS = 'cdk-overlay-transparent-backdrop';
|
|
|
225
250
|
// Upper bound for how long to keep a non-reused pane alive after detach so the
|
|
226
251
|
// panel's `animate.leave` can finish. Disposes on `animationend`; this only
|
|
227
252
|
// fires when no exit animation runs (e.g. the `none` motion level).
|
|
228
|
-
const LEAVE_ANIMATION_FALLBACK_MS$
|
|
253
|
+
const LEAVE_ANIMATION_FALLBACK_MS$3 = 500;
|
|
229
254
|
/**
|
|
230
255
|
* Owns the CDK-Overlay lifecycle shared by the library's connected overlay
|
|
231
256
|
* components (popover, menu, select): create/attach, dismissal wiring
|
|
@@ -242,7 +267,8 @@ class OverlayManager {
|
|
|
242
267
|
_destroyRef = inject(DestroyRef);
|
|
243
268
|
_overlayRef = null;
|
|
244
269
|
_config = null;
|
|
245
|
-
_isOpen = signal(false,
|
|
270
|
+
_isOpen = signal(false, /* @ts-ignore */
|
|
271
|
+
...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
246
272
|
// Armed by `ignoreTrailingAuxClick` on open: swallow the first outside
|
|
247
273
|
// `auxclick` so the right-click gesture that opened a context menu doesn't
|
|
248
274
|
// immediately dismiss it. Consumed one-shot (not on a timer) because the user
|
|
@@ -367,7 +393,7 @@ class OverlayManager {
|
|
|
367
393
|
overlayRef.dispose();
|
|
368
394
|
};
|
|
369
395
|
paneElement.addEventListener('animationend', finalize);
|
|
370
|
-
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$
|
|
396
|
+
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$3);
|
|
371
397
|
}
|
|
372
398
|
_dispose() {
|
|
373
399
|
this._overlayRef?.dispose();
|
|
@@ -392,27 +418,37 @@ function createOverlayManager() {
|
|
|
392
418
|
*/
|
|
393
419
|
class AbstractSelect extends ValueFormControl {
|
|
394
420
|
overlay = createOverlayManager();
|
|
395
|
-
triggerElement = viewChild('trigger',
|
|
396
|
-
|
|
421
|
+
triggerElement = viewChild('trigger', /* @ts-ignore */
|
|
422
|
+
...(ngDevMode ? [{ debugName: "triggerElement" }] : /* istanbul ignore next */ []));
|
|
423
|
+
panelTemplate = viewChild('panel', /* @ts-ignore */
|
|
424
|
+
...(ngDevMode ? [{ debugName: "panelTemplate" }] : /* istanbul ignore next */ []));
|
|
397
425
|
// Shared inputs (config-independent)
|
|
398
|
-
options = input([],
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
426
|
+
options = input([], /* @ts-ignore */
|
|
427
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
428
|
+
optionLabel = input(undefined, /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
430
|
+
optionValue = input(undefined, /* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
432
|
+
optionDisabled = input(undefined, /* @ts-ignore */
|
|
433
|
+
...(ngDevMode ? [{ debugName: "optionDisabled" }] : /* istanbul ignore next */ []));
|
|
434
|
+
tabindex = input(0, /* @ts-ignore */
|
|
435
|
+
...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
403
436
|
isOpen = this.overlay.isOpen;
|
|
404
|
-
activeIndex = signal(-1,
|
|
437
|
+
activeIndex = signal(-1, /* @ts-ignore */
|
|
438
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
405
439
|
normalizedOptions = computed(() => normalizeOptions(this.options(), {
|
|
406
440
|
label: this.optionLabel(),
|
|
407
441
|
value: this.optionValue(),
|
|
408
442
|
disabled: this.optionDisabled(),
|
|
409
|
-
}),
|
|
443
|
+
}), /* @ts-ignore */
|
|
444
|
+
...(ngDevMode ? [{ debugName: "normalizedOptions" }] : /* istanbul ignore next */ []));
|
|
410
445
|
activeDescendantId = computed(() => {
|
|
411
446
|
const index = this.activeIndex();
|
|
412
447
|
if (index < 0)
|
|
413
448
|
return null;
|
|
414
449
|
return this.optionId(index);
|
|
415
|
-
},
|
|
450
|
+
}, /* @ts-ignore */
|
|
451
|
+
...(ngDevMode ? [{ debugName: "activeDescendantId" }] : /* istanbul ignore next */ []));
|
|
416
452
|
hostClasses = computed(() => {
|
|
417
453
|
const array = [this.hostClassBase];
|
|
418
454
|
if (this.isOpen())
|
|
@@ -421,7 +457,8 @@ class AbstractSelect extends ValueFormControl {
|
|
|
421
457
|
if (this.fluid())
|
|
422
458
|
array.push(`${this.CLASS_NAME}--fluid`);
|
|
423
459
|
return array.concat(this.controlClasses());
|
|
424
|
-
},
|
|
460
|
+
}, /* @ts-ignore */
|
|
461
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
425
462
|
get listboxId() {
|
|
426
463
|
return `${this.uniqueId}-listbox`;
|
|
427
464
|
}
|
|
@@ -552,10 +589,10 @@ class AbstractSelect extends ValueFormControl {
|
|
|
552
589
|
next += direction;
|
|
553
590
|
}
|
|
554
591
|
}
|
|
555
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
556
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "
|
|
592
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AbstractSelect, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
593
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.5", type: AbstractSelect, isStandalone: true, inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "triggerElement", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelTemplate", first: true, predicate: ["panel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
557
594
|
}
|
|
558
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AbstractSelect, decorators: [{
|
|
559
596
|
type: Directive
|
|
560
597
|
}], propDecorators: { triggerElement: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelTemplate: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
561
598
|
|
|
@@ -575,10 +612,10 @@ class QuerySyncDirective {
|
|
|
575
612
|
readParam(param) {
|
|
576
613
|
return this._route.snapshot.queryParamMap.get(param);
|
|
577
614
|
}
|
|
578
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
579
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
615
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: QuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
616
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: QuerySyncDirective, isStandalone: true, ngImport: i0 });
|
|
580
617
|
}
|
|
581
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
618
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: QuerySyncDirective, decorators: [{
|
|
582
619
|
type: Directive
|
|
583
620
|
}] });
|
|
584
621
|
|
|
@@ -602,9 +639,11 @@ const ALERT_CONFIG = new InjectionToken('ALERT_CONFIG', {
|
|
|
602
639
|
|
|
603
640
|
class Alert {
|
|
604
641
|
_config = inject(ALERT_CONFIG);
|
|
605
|
-
color = input(this._config.color,
|
|
606
|
-
|
|
607
|
-
|
|
642
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
643
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
644
|
+
label = input(typeof this._config.label === 'string' ? this._config.label : null, /* @ts-ignore */
|
|
645
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
646
|
+
hideLabel = input(this._config.hideLabel, { ...(ngDevMode ? { debugName: "hideLabel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
608
647
|
displayLabel = computed(() => {
|
|
609
648
|
const label = this.label();
|
|
610
649
|
if (label)
|
|
@@ -613,21 +652,24 @@ class Alert {
|
|
|
613
652
|
return this._config.label[this.color()];
|
|
614
653
|
}
|
|
615
654
|
return '';
|
|
616
|
-
},
|
|
655
|
+
}, /* @ts-ignore */
|
|
656
|
+
...(ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []));
|
|
617
657
|
hostClasses = computed(() => {
|
|
618
658
|
const className = 'tls-alert';
|
|
619
659
|
const array = [className];
|
|
620
660
|
array.push(`${className}--${this.color()}`);
|
|
621
661
|
return array;
|
|
622
|
-
},
|
|
662
|
+
}, /* @ts-ignore */
|
|
663
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
623
664
|
hostRole = computed(() => {
|
|
624
665
|
const urgent = ['danger', 'warning'];
|
|
625
666
|
return urgent.includes(this.color()) ? 'alert' : 'note';
|
|
626
|
-
},
|
|
627
|
-
|
|
628
|
-
static
|
|
667
|
+
}, /* @ts-ignore */
|
|
668
|
+
...(ngDevMode ? [{ debugName: "hostRole" }] : /* istanbul ignore next */ []));
|
|
669
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Alert, isStandalone: true, selector: "tls-alert", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.role": "hostRole()", "attr.aria-label": "hideLabel() ? displayLabel() : null" } }, ngImport: i0, template: "<div class=\"tls-alert-icon\"></div>\n<div class=\"tls-alert-body\">\n @if (!hideLabel()) {\n <span class=\"tls-alert-body__label\">{{ displayLabel() }}</span>\n }\n <span class=\"tls-alert-body__content\">\n <ng-content></ng-content>\n </span>\n</div>\n" });
|
|
629
671
|
}
|
|
630
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Alert, decorators: [{
|
|
631
673
|
type: Component,
|
|
632
674
|
args: [{ selector: 'tls-alert', imports: [], host: {
|
|
633
675
|
'[class]': 'hostClasses()',
|
|
@@ -652,14 +694,17 @@ class ButtonBase {
|
|
|
652
694
|
// Injections
|
|
653
695
|
_config = inject(BUTTON_CONFIG);
|
|
654
696
|
APPLY_HOST_CLASSES = true;
|
|
655
|
-
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
656
|
-
icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : {}), transform: booleanAttribute });
|
|
657
|
-
color = input(this._config.color,
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
697
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
698
|
+
icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
699
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
700
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
701
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
702
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
703
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
704
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
705
|
+
rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
661
706
|
/** Whether the button stretches to fill its container's width. */
|
|
662
|
-
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : {}), transform: booleanAttribute });
|
|
707
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
663
708
|
classes = computed(() => {
|
|
664
709
|
const className = 'tls-button';
|
|
665
710
|
const array = [className];
|
|
@@ -675,11 +720,12 @@ class ButtonBase {
|
|
|
675
720
|
if (this.rounded())
|
|
676
721
|
array.push(`${className}--rounded`);
|
|
677
722
|
return array;
|
|
678
|
-
},
|
|
679
|
-
|
|
680
|
-
static
|
|
723
|
+
}, /* @ts-ignore */
|
|
724
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ButtonBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
726
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: ButtonBase, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "APPLY_HOST_CLASSES ? classes() : null" } }, ngImport: i0 });
|
|
681
727
|
}
|
|
682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
728
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ButtonBase, decorators: [{
|
|
683
729
|
type: Directive,
|
|
684
730
|
args: [{
|
|
685
731
|
host: {
|
|
@@ -696,24 +742,31 @@ class Button extends ButtonBase {
|
|
|
696
742
|
APPLY_HOST_CLASSES = false;
|
|
697
743
|
// Inputs
|
|
698
744
|
/** The text label displayed inside the button. Takes priority over projected content. */
|
|
699
|
-
label = input(
|
|
745
|
+
label = input(/* @ts-ignore */
|
|
746
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
700
747
|
/**
|
|
701
748
|
* Accessible name forwarded to the inner `<button>`/`<a>`. Required for icon-only buttons,
|
|
702
749
|
* where there is no visible text for screen readers to announce. Placed on the inner control
|
|
703
750
|
* because the host `tls-button` element is a non-interactive wrapper.
|
|
704
751
|
*/
|
|
705
|
-
ariaLabel = input(undefined,
|
|
752
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
753
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
706
754
|
/**
|
|
707
755
|
* `id` of an element whose text names the inner `<button>`/`<a>`, for when the accessible
|
|
708
756
|
* name already exists as visible text. Takes precedence over `ariaLabel` per the ARIA spec.
|
|
709
757
|
*/
|
|
710
|
-
ariaLabelledby = input(undefined,
|
|
711
|
-
|
|
758
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
759
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
760
|
+
type = input(this._config.type, /* @ts-ignore */
|
|
761
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
712
762
|
/** An optional URL that causes the button to render as an anchor link. */
|
|
713
|
-
href = input(null,
|
|
714
|
-
|
|
763
|
+
href = input(null, /* @ts-ignore */
|
|
764
|
+
...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
765
|
+
tabindex = input('0', /* @ts-ignore */
|
|
766
|
+
...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
715
767
|
// Computed
|
|
716
|
-
isLink = computed(() => Boolean(this._routerLink || this.href()),
|
|
768
|
+
isLink = computed(() => Boolean(this._routerLink || this.href()), /* @ts-ignore */
|
|
769
|
+
...(ngDevMode ? [{ debugName: "isLink" }] : /* istanbul ignore next */ []));
|
|
717
770
|
/**
|
|
718
771
|
* Resolved URL placed on the inner anchor so the browser treats it as a real link
|
|
719
772
|
* (enables "Open in new tab", middle-click, status-bar preview, etc.). An explicit
|
|
@@ -730,7 +783,8 @@ class Button extends ButtonBase {
|
|
|
730
783
|
return null;
|
|
731
784
|
const serialized = this._router.serializeUrl(urlTree);
|
|
732
785
|
return this._locationStrategy?.prepareExternalUrl(serialized) ?? serialized;
|
|
733
|
-
},
|
|
786
|
+
}, /* @ts-ignore */
|
|
787
|
+
...(ngDevMode ? [{ debugName: "linkHref" }] : /* istanbul ignore next */ []));
|
|
734
788
|
// Protected methods
|
|
735
789
|
/**
|
|
736
790
|
* Keeps navigation correct when the host carries a `routerLink` while the inner anchor
|
|
@@ -755,10 +809,10 @@ class Button extends ButtonBase {
|
|
|
755
809
|
}
|
|
756
810
|
event.preventDefault();
|
|
757
811
|
}
|
|
758
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
759
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
812
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Button, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
813
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Button, isStandalone: true, selector: "tls-button", inputs: { label: { classPropertyName: "label", publicName: "label", 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 }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "tabindex": "-1" } }, usesInheritance: true, ngImport: i0, template: "@if (isLink()) {\n <a\n role=\"link\"\n [class]=\"classes()\"\n [attr.href]=\"linkHref()\"\n [tabindex]=\"tabindex()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n [attr.aria-disabled]=\"disabled()\"\n (click)=\"onLinkClick($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </a>\n} @else {\n <button\n role=\"button\"\n [class]=\"classes()\"\n [type]=\"type()\"\n [tabindex]=\"tabindex()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n [disabled]=\"disabled()\"\n [attr.aria-disabled]=\"disabled()\"\n >\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </button>\n}\n\n<!-- Content -->\n<ng-template #contentTemplate>\n @if (label() && !icon()) {\n {{ label() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\n }\n</ng-template>\n\n<ng-template #projectedContentTemplate>\n <ng-content></ng-content>\n</ng-template>\n", styles: [":host{width:fit-content;display:inline-block}:host:focus-visible{outline:none}:host:has(.tls-button.tls-button--fluid){width:100%}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
760
814
|
}
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Button, decorators: [{
|
|
762
816
|
type: Component,
|
|
763
817
|
args: [{ selector: 'tls-button', imports: [NgTemplateOutlet], host: {
|
|
764
818
|
'[tabindex]': '-1',
|
|
@@ -766,10 +820,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
766
820
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
767
821
|
|
|
768
822
|
class ButtonDirective extends ButtonBase {
|
|
769
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
770
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
823
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ButtonDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
824
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: ButtonDirective, isStandalone: true, selector: "[tlsButton]", usesInheritance: true, ngImport: i0 });
|
|
771
825
|
}
|
|
772
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
826
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
773
827
|
type: Directive,
|
|
774
828
|
args: [{
|
|
775
829
|
selector: '[tlsButton]',
|
|
@@ -788,13 +842,17 @@ const CHIP_CONFIG = new InjectionToken('CHIP_CONFIG', {
|
|
|
788
842
|
|
|
789
843
|
class Chip {
|
|
790
844
|
_config = inject(CHIP_CONFIG);
|
|
791
|
-
label = input(
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
845
|
+
label = input(/* @ts-ignore */
|
|
846
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
847
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
848
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
849
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
850
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
851
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
852
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
853
|
+
rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
854
|
+
icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
855
|
+
fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
798
856
|
context = signal({
|
|
799
857
|
checked: false,
|
|
800
858
|
disabled: false,
|
|
@@ -803,9 +861,12 @@ class Chip {
|
|
|
803
861
|
dirty: false,
|
|
804
862
|
invalid: false,
|
|
805
863
|
pending: false,
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
|
|
864
|
+
}, /* @ts-ignore */
|
|
865
|
+
...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
866
|
+
startIconTemplate = contentChild('startIcon', /* @ts-ignore */
|
|
867
|
+
...(ngDevMode ? [{ debugName: "startIconTemplate" }] : /* istanbul ignore next */ []));
|
|
868
|
+
endIconTemplate = contentChild('endIcon', /* @ts-ignore */
|
|
869
|
+
...(ngDevMode ? [{ debugName: "endIconTemplate" }] : /* istanbul ignore next */ []));
|
|
809
870
|
classes = computed(() => {
|
|
810
871
|
const className = 'tls-chip';
|
|
811
872
|
const array = [className];
|
|
@@ -819,11 +880,12 @@ class Chip {
|
|
|
819
880
|
if (this.fluid())
|
|
820
881
|
array.push(`${className}--fluid`);
|
|
821
882
|
return array;
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
static
|
|
883
|
+
}, /* @ts-ignore */
|
|
884
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
885
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Chip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
886
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Chip, isStandalone: true, selector: "tls-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, queries: [{ propertyName: "startIconTemplate", first: true, predicate: ["startIcon"], descendants: true, isSignal: true }, { propertyName: "endIconTemplate", first: true, predicate: ["endIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (startIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n}\n\n@if (label()) {\n {{ label() }}\n} @else {\n <ng-content></ng-content>\n}\n\n@if (endIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: context() }\" />\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
825
887
|
}
|
|
826
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
888
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Chip, decorators: [{
|
|
827
889
|
type: Component,
|
|
828
890
|
args: [{ selector: 'tls-chip', imports: [NgTemplateOutlet], host: {
|
|
829
891
|
'[class]': 'classes()',
|
|
@@ -843,9 +905,12 @@ class ChipControl extends CheckboxFormControl {
|
|
|
843
905
|
CLASS_NAME = 'tls-chip';
|
|
844
906
|
_config = inject(CHIP_CONTROL_CONFIG);
|
|
845
907
|
_chip = inject(Chip);
|
|
846
|
-
checked = model(false,
|
|
847
|
-
|
|
848
|
-
|
|
908
|
+
checked = model(false, /* @ts-ignore */
|
|
909
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
910
|
+
checkedColor = input(this._config.checkedColor, /* @ts-ignore */
|
|
911
|
+
...(ngDevMode ? [{ debugName: "checkedColor" }] : /* istanbul ignore next */ []));
|
|
912
|
+
checkedVariant = input(this._config.checkedVariant, /* @ts-ignore */
|
|
913
|
+
...(ngDevMode ? [{ debugName: "checkedVariant" }] : /* istanbul ignore next */ []));
|
|
849
914
|
hostClasses = computed(() => {
|
|
850
915
|
const classes = ['tls-chip--control'];
|
|
851
916
|
if (this.checked()) {
|
|
@@ -860,7 +925,8 @@ class ChipControl extends CheckboxFormControl {
|
|
|
860
925
|
if (this.disabled())
|
|
861
926
|
classes.push('tls-chip--disabled');
|
|
862
927
|
return classes;
|
|
863
|
-
},
|
|
928
|
+
}, /* @ts-ignore */
|
|
929
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
864
930
|
constructor() {
|
|
865
931
|
super();
|
|
866
932
|
effect(() => this._chip.context.set({
|
|
@@ -882,10 +948,10 @@ class ChipControl extends CheckboxFormControl {
|
|
|
882
948
|
event.preventDefault();
|
|
883
949
|
this.toggle();
|
|
884
950
|
}
|
|
885
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
886
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
951
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
952
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: ChipControl, isStandalone: true, selector: "tls-chip[tlsChipControl]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, checkedColor: { classPropertyName: "checkedColor", publicName: "checkedColor", isSignal: true, isRequired: false, transformFunction: null }, checkedVariant: { classPropertyName: "checkedVariant", publicName: "checkedVariant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "role": "checkbox" }, listeners: { "click": "toggle()", "blur": "touched.set(true)", "keydown.space": "onKeyboardToggle($event)", "keydown.enter": "onKeyboardToggle($event)" }, properties: { "class": "hostClasses()", "tabindex": "disabled() ? -1 : 0", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ChipControl) }], usesInheritance: true, ngImport: i0 });
|
|
887
953
|
}
|
|
888
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipControl, decorators: [{
|
|
889
955
|
type: Directive,
|
|
890
956
|
args: [{
|
|
891
957
|
selector: 'tls-chip[tlsChipControl]',
|
|
@@ -904,6 +970,573 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
904
970
|
}]
|
|
905
971
|
}], ctorParameters: () => [], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], checkedColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkedColor", required: false }] }], checkedVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkedVariant", required: false }] }] } });
|
|
906
972
|
|
|
973
|
+
const OVERLAY_POSITION_MAP = {
|
|
974
|
+
top: {
|
|
975
|
+
originX: 'center',
|
|
976
|
+
originY: 'top',
|
|
977
|
+
overlayX: 'center',
|
|
978
|
+
overlayY: 'bottom',
|
|
979
|
+
offsetX: 0,
|
|
980
|
+
offsetY: -1,
|
|
981
|
+
},
|
|
982
|
+
right: {
|
|
983
|
+
originX: 'end',
|
|
984
|
+
originY: 'center',
|
|
985
|
+
overlayX: 'start',
|
|
986
|
+
overlayY: 'center',
|
|
987
|
+
offsetX: 1,
|
|
988
|
+
offsetY: 0,
|
|
989
|
+
},
|
|
990
|
+
bottom: {
|
|
991
|
+
originX: 'center',
|
|
992
|
+
originY: 'bottom',
|
|
993
|
+
overlayX: 'center',
|
|
994
|
+
overlayY: 'top',
|
|
995
|
+
offsetX: 1,
|
|
996
|
+
offsetY: 1,
|
|
997
|
+
},
|
|
998
|
+
left: {
|
|
999
|
+
originX: 'start',
|
|
1000
|
+
originY: 'center',
|
|
1001
|
+
overlayX: 'end',
|
|
1002
|
+
overlayY: 'center',
|
|
1003
|
+
offsetX: -1,
|
|
1004
|
+
offsetY: 0,
|
|
1005
|
+
},
|
|
1006
|
+
'top-start': {
|
|
1007
|
+
originX: 'start',
|
|
1008
|
+
originY: 'top',
|
|
1009
|
+
overlayX: 'start',
|
|
1010
|
+
overlayY: 'bottom',
|
|
1011
|
+
offsetX: 0,
|
|
1012
|
+
offsetY: -1,
|
|
1013
|
+
},
|
|
1014
|
+
'top-end': {
|
|
1015
|
+
originX: 'end',
|
|
1016
|
+
originY: 'top',
|
|
1017
|
+
overlayX: 'end',
|
|
1018
|
+
overlayY: 'bottom',
|
|
1019
|
+
offsetX: 0,
|
|
1020
|
+
offsetY: -1,
|
|
1021
|
+
},
|
|
1022
|
+
'right-start': {
|
|
1023
|
+
originX: 'end',
|
|
1024
|
+
originY: 'top',
|
|
1025
|
+
overlayX: 'start',
|
|
1026
|
+
overlayY: 'top',
|
|
1027
|
+
offsetX: 1,
|
|
1028
|
+
offsetY: 0,
|
|
1029
|
+
},
|
|
1030
|
+
'right-end': {
|
|
1031
|
+
originX: 'end',
|
|
1032
|
+
originY: 'bottom',
|
|
1033
|
+
overlayX: 'start',
|
|
1034
|
+
overlayY: 'bottom',
|
|
1035
|
+
offsetX: 1,
|
|
1036
|
+
offsetY: 0,
|
|
1037
|
+
},
|
|
1038
|
+
'bottom-start': {
|
|
1039
|
+
originX: 'start',
|
|
1040
|
+
originY: 'bottom',
|
|
1041
|
+
overlayX: 'start',
|
|
1042
|
+
overlayY: 'top',
|
|
1043
|
+
offsetX: 0,
|
|
1044
|
+
offsetY: 1,
|
|
1045
|
+
},
|
|
1046
|
+
'bottom-end': {
|
|
1047
|
+
originX: 'end',
|
|
1048
|
+
originY: 'bottom',
|
|
1049
|
+
overlayX: 'end',
|
|
1050
|
+
overlayY: 'top',
|
|
1051
|
+
offsetX: 0,
|
|
1052
|
+
offsetY: 1,
|
|
1053
|
+
},
|
|
1054
|
+
'left-start': {
|
|
1055
|
+
originX: 'start',
|
|
1056
|
+
originY: 'top',
|
|
1057
|
+
overlayX: 'end',
|
|
1058
|
+
overlayY: 'top',
|
|
1059
|
+
offsetX: -1,
|
|
1060
|
+
offsetY: 0,
|
|
1061
|
+
},
|
|
1062
|
+
'left-end': {
|
|
1063
|
+
originX: 'start',
|
|
1064
|
+
originY: 'bottom',
|
|
1065
|
+
overlayX: 'end',
|
|
1066
|
+
overlayY: 'bottom',
|
|
1067
|
+
offsetX: -1,
|
|
1068
|
+
offsetY: 0,
|
|
1069
|
+
},
|
|
1070
|
+
'top-left': {
|
|
1071
|
+
originX: 'start',
|
|
1072
|
+
originY: 'top',
|
|
1073
|
+
overlayX: 'end',
|
|
1074
|
+
overlayY: 'bottom',
|
|
1075
|
+
offsetX: -1,
|
|
1076
|
+
offsetY: -1,
|
|
1077
|
+
},
|
|
1078
|
+
'top-right': {
|
|
1079
|
+
originX: 'end',
|
|
1080
|
+
originY: 'top',
|
|
1081
|
+
overlayX: 'start',
|
|
1082
|
+
overlayY: 'bottom',
|
|
1083
|
+
offsetX: 1,
|
|
1084
|
+
offsetY: -1,
|
|
1085
|
+
},
|
|
1086
|
+
'bottom-left': {
|
|
1087
|
+
originX: 'start',
|
|
1088
|
+
originY: 'bottom',
|
|
1089
|
+
overlayX: 'end',
|
|
1090
|
+
overlayY: 'top',
|
|
1091
|
+
offsetX: -1,
|
|
1092
|
+
offsetY: 1,
|
|
1093
|
+
},
|
|
1094
|
+
'bottom-right': {
|
|
1095
|
+
originX: 'end',
|
|
1096
|
+
originY: 'bottom',
|
|
1097
|
+
overlayX: 'start',
|
|
1098
|
+
overlayY: 'top',
|
|
1099
|
+
offsetX: 1,
|
|
1100
|
+
offsetY: 1,
|
|
1101
|
+
},
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
const buildOverlayPositions = (position, offset) => {
|
|
1105
|
+
const preferred = OVERLAY_POSITION_MAP[position];
|
|
1106
|
+
const rest = Object.values(OVERLAY_POSITION_MAP).filter(p => p !== preferred);
|
|
1107
|
+
const positions = [preferred, ...rest];
|
|
1108
|
+
return positions.map(position => ({
|
|
1109
|
+
...position,
|
|
1110
|
+
offsetX: Math.sign(position.offsetX ?? 0) * offset.x,
|
|
1111
|
+
offsetY: Math.sign(position.offsetY ?? 0) * offset.y,
|
|
1112
|
+
}));
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
const DEFAULT_CONFIRM_CONFIG = {
|
|
1116
|
+
position: 'bottom',
|
|
1117
|
+
offset: { x: 0, y: 4 },
|
|
1118
|
+
confirmButton: { label: 'Confirm' },
|
|
1119
|
+
cancelButton: { label: 'Cancel', variant: 'text' },
|
|
1120
|
+
actionsAlign: 'end',
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
const CONFIRM_CONFIG = new InjectionToken('CONFIRM_CONFIG', {
|
|
1124
|
+
factory: () => DEFAULT_CONFIRM_CONFIG,
|
|
1125
|
+
});
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Presentational contents of a confirm dialog: an optional title, a message,
|
|
1129
|
+
* and cancel / confirm action buttons. Shared by the declarative `tls-confirm`
|
|
1130
|
+
* component and the imperative `ConfirmService`; it renders the UI and emits
|
|
1131
|
+
* `confirmed` / `cancelled`, but owns no overlay lifecycle.
|
|
1132
|
+
*/
|
|
1133
|
+
class ConfirmPanel {
|
|
1134
|
+
static _counter = 0;
|
|
1135
|
+
// Injections
|
|
1136
|
+
_elementRef = inject(ElementRef);
|
|
1137
|
+
_config = inject(CONFIRM_CONFIG);
|
|
1138
|
+
_buttonConfig = inject(BUTTON_CONFIG);
|
|
1139
|
+
// Inputs
|
|
1140
|
+
title = input(undefined, /* @ts-ignore */
|
|
1141
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1142
|
+
message = input.required(/* @ts-ignore */
|
|
1143
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1144
|
+
confirm = input(undefined, /* @ts-ignore */
|
|
1145
|
+
...(ngDevMode ? [{ debugName: "confirm" }] : /* istanbul ignore next */ []));
|
|
1146
|
+
cancel = input(undefined, /* @ts-ignore */
|
|
1147
|
+
...(ngDevMode ? [{ debugName: "cancel" }] : /* istanbul ignore next */ []));
|
|
1148
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
1149
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1150
|
+
/** Whether the panel is a focus-trapped modal (`aria-modal="true"`) rather than an anchored popover. */
|
|
1151
|
+
modal = input(false, /* @ts-ignore */
|
|
1152
|
+
...(ngDevMode ? [{ debugName: "modal" }] : /* istanbul ignore next */ []));
|
|
1153
|
+
actionsAlign = input(this._config.actionsAlign, /* @ts-ignore */
|
|
1154
|
+
...(ngDevMode ? [{ debugName: "actionsAlign" }] : /* istanbul ignore next */ []));
|
|
1155
|
+
// Outputs
|
|
1156
|
+
confirmed = output();
|
|
1157
|
+
cancelled = output();
|
|
1158
|
+
// State
|
|
1159
|
+
id = `tls-confirm-${++ConfirmPanel._counter}`;
|
|
1160
|
+
titleId = `${this.id}-title`;
|
|
1161
|
+
messageId = `${this.id}-message`;
|
|
1162
|
+
// Computed
|
|
1163
|
+
resolvedConfirm = computed(() => this._resolve(this.confirm(), this._config.confirmButton), /* @ts-ignore */
|
|
1164
|
+
...(ngDevMode ? [{ debugName: "resolvedConfirm" }] : /* istanbul ignore next */ []));
|
|
1165
|
+
resolvedCancel = computed(() => this._resolve(this.cancel(), this._config.cancelButton), /* @ts-ignore */
|
|
1166
|
+
...(ngDevMode ? [{ debugName: "resolvedCancel" }] : /* istanbul ignore next */ []));
|
|
1167
|
+
actionsClasses = computed(() => [
|
|
1168
|
+
'tls-confirm__actions',
|
|
1169
|
+
`tls-confirm__actions--${this.actionsAlign()}`,
|
|
1170
|
+
], /* @ts-ignore */
|
|
1171
|
+
...(ngDevMode ? [{ debugName: "actionsClasses" }] : /* istanbul ignore next */ []));
|
|
1172
|
+
// Constructor
|
|
1173
|
+
constructor() {
|
|
1174
|
+
// Move focus to the primary action once the panel has rendered, so the
|
|
1175
|
+
// dialog is immediately operable from the keyboard.
|
|
1176
|
+
afterNextRender(() => this._focusConfirm());
|
|
1177
|
+
}
|
|
1178
|
+
// Private methods
|
|
1179
|
+
_resolve(button, slotDefault) {
|
|
1180
|
+
const source = button ?? {};
|
|
1181
|
+
return {
|
|
1182
|
+
label: source.label ?? slotDefault.label,
|
|
1183
|
+
color: source.color ?? slotDefault.color ?? this._buttonConfig.color,
|
|
1184
|
+
variant: source.variant ?? slotDefault.variant ?? this._buttonConfig.variant,
|
|
1185
|
+
size: source.size ?? slotDefault.size ?? this._buttonConfig.size,
|
|
1186
|
+
icon: source.icon ?? slotDefault.icon ?? false,
|
|
1187
|
+
rounded: source.rounded ?? slotDefault.rounded ?? false,
|
|
1188
|
+
fluid: source.fluid ?? slotDefault.fluid ?? false,
|
|
1189
|
+
disabled: source.disabled ?? slotDefault.disabled ?? false,
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
_focusConfirm() {
|
|
1193
|
+
const host = this._elementRef.nativeElement;
|
|
1194
|
+
const buttons = host.querySelectorAll('button');
|
|
1195
|
+
const confirmButton = buttons.item(buttons.length - 1);
|
|
1196
|
+
if (confirmButton)
|
|
1197
|
+
confirmButton.focus();
|
|
1198
|
+
}
|
|
1199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ConfirmPanel, isStandalone: true, selector: "tls-confirm-panel", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, confirm: { classPropertyName: "confirm", publicName: "confirm", isSignal: true, isRequired: false, transformFunction: null }, cancel: { classPropertyName: "cancel", publicName: "cancel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, actionsAlign: { classPropertyName: "actionsAlign", publicName: "actionsAlign", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, host: { attributes: { "role": "alertdialog", "animate.enter": "tls-confirm--enter", "animate.leave": "tls-confirm--leave" }, properties: { "attr.aria-modal": "modal() ? \"true\" : \"false\"", "id": "id", "attr.aria-labelledby": "title() ? titleId : null", "attr.aria-describedby": "messageId", "attr.aria-label": "ariaLabel() ?? null" }, classAttribute: "tls-confirm" }, ngImport: i0, template: `
|
|
1201
|
+
@if (title()) {
|
|
1202
|
+
<h2 class="tls-confirm__title" [id]="titleId">{{ title() }}</h2>
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
<p class="tls-confirm__message" [id]="messageId">{{ message() }}</p>
|
|
1206
|
+
|
|
1207
|
+
<div [class]="actionsClasses()">
|
|
1208
|
+
<tls-button
|
|
1209
|
+
[label]="resolvedCancel().label"
|
|
1210
|
+
[color]="resolvedCancel().color"
|
|
1211
|
+
[variant]="resolvedCancel().variant"
|
|
1212
|
+
[size]="resolvedCancel().size"
|
|
1213
|
+
[icon]="resolvedCancel().icon"
|
|
1214
|
+
[rounded]="resolvedCancel().rounded"
|
|
1215
|
+
[fluid]="resolvedCancel().fluid"
|
|
1216
|
+
[disabled]="resolvedCancel().disabled"
|
|
1217
|
+
(click)="cancelled.emit()"
|
|
1218
|
+
></tls-button>
|
|
1219
|
+
|
|
1220
|
+
<tls-button
|
|
1221
|
+
[label]="resolvedConfirm().label"
|
|
1222
|
+
[color]="resolvedConfirm().color"
|
|
1223
|
+
[variant]="resolvedConfirm().variant"
|
|
1224
|
+
[size]="resolvedConfirm().size"
|
|
1225
|
+
[icon]="resolvedConfirm().icon"
|
|
1226
|
+
[rounded]="resolvedConfirm().rounded"
|
|
1227
|
+
[fluid]="resolvedConfirm().fluid"
|
|
1228
|
+
[disabled]="resolvedConfirm().disabled"
|
|
1229
|
+
(click)="confirmed.emit()"
|
|
1230
|
+
></tls-button>
|
|
1231
|
+
</div>
|
|
1232
|
+
`, isInline: true, dependencies: [{ kind: "component", type: Button, selector: "tls-button", inputs: ["label", "ariaLabel", "ariaLabelledby", "type", "href", "tabindex"] }] });
|
|
1233
|
+
}
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmPanel, decorators: [{
|
|
1235
|
+
type: Component,
|
|
1236
|
+
args: [{
|
|
1237
|
+
selector: 'tls-confirm-panel',
|
|
1238
|
+
imports: [Button],
|
|
1239
|
+
template: `
|
|
1240
|
+
@if (title()) {
|
|
1241
|
+
<h2 class="tls-confirm__title" [id]="titleId">{{ title() }}</h2>
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
<p class="tls-confirm__message" [id]="messageId">{{ message() }}</p>
|
|
1245
|
+
|
|
1246
|
+
<div [class]="actionsClasses()">
|
|
1247
|
+
<tls-button
|
|
1248
|
+
[label]="resolvedCancel().label"
|
|
1249
|
+
[color]="resolvedCancel().color"
|
|
1250
|
+
[variant]="resolvedCancel().variant"
|
|
1251
|
+
[size]="resolvedCancel().size"
|
|
1252
|
+
[icon]="resolvedCancel().icon"
|
|
1253
|
+
[rounded]="resolvedCancel().rounded"
|
|
1254
|
+
[fluid]="resolvedCancel().fluid"
|
|
1255
|
+
[disabled]="resolvedCancel().disabled"
|
|
1256
|
+
(click)="cancelled.emit()"
|
|
1257
|
+
></tls-button>
|
|
1258
|
+
|
|
1259
|
+
<tls-button
|
|
1260
|
+
[label]="resolvedConfirm().label"
|
|
1261
|
+
[color]="resolvedConfirm().color"
|
|
1262
|
+
[variant]="resolvedConfirm().variant"
|
|
1263
|
+
[size]="resolvedConfirm().size"
|
|
1264
|
+
[icon]="resolvedConfirm().icon"
|
|
1265
|
+
[rounded]="resolvedConfirm().rounded"
|
|
1266
|
+
[fluid]="resolvedConfirm().fluid"
|
|
1267
|
+
[disabled]="resolvedConfirm().disabled"
|
|
1268
|
+
(click)="confirmed.emit()"
|
|
1269
|
+
></tls-button>
|
|
1270
|
+
</div>
|
|
1271
|
+
`,
|
|
1272
|
+
host: {
|
|
1273
|
+
class: 'tls-confirm',
|
|
1274
|
+
role: 'alertdialog',
|
|
1275
|
+
'[attr.aria-modal]': 'modal() ? "true" : "false"',
|
|
1276
|
+
'[id]': 'id',
|
|
1277
|
+
'[attr.aria-labelledby]': 'title() ? titleId : null',
|
|
1278
|
+
'[attr.aria-describedby]': 'messageId',
|
|
1279
|
+
'[attr.aria-label]': 'ariaLabel() ?? null',
|
|
1280
|
+
'animate.enter': 'tls-confirm--enter',
|
|
1281
|
+
'animate.leave': 'tls-confirm--leave',
|
|
1282
|
+
},
|
|
1283
|
+
}]
|
|
1284
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], confirm: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirm", required: false }] }], cancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], actionsAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAlign", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Declarative confirm dialog anchored to a trigger. Sits in the template
|
|
1288
|
+
* alongside its trigger and is driven imperatively via {@link open} /
|
|
1289
|
+
* {@link toggle}; resolves through the `confirmed` / `cancelled` outputs.
|
|
1290
|
+
* Dismissing via backdrop or Escape counts as `cancelled`. For promise-based
|
|
1291
|
+
* flows in TypeScript, use `ConfirmService` instead.
|
|
1292
|
+
*/
|
|
1293
|
+
class Confirm {
|
|
1294
|
+
// Injections
|
|
1295
|
+
_config = inject(CONFIRM_CONFIG);
|
|
1296
|
+
_overlay = createOverlayManager();
|
|
1297
|
+
_templateRef = viewChild.required('content');
|
|
1298
|
+
// Inputs
|
|
1299
|
+
title = input(undefined, /* @ts-ignore */
|
|
1300
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1301
|
+
message = input.required(/* @ts-ignore */
|
|
1302
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1303
|
+
confirm = input(undefined, /* @ts-ignore */
|
|
1304
|
+
...(ngDevMode ? [{ debugName: "confirm" }] : /* istanbul ignore next */ []));
|
|
1305
|
+
cancel = input(undefined, /* @ts-ignore */
|
|
1306
|
+
...(ngDevMode ? [{ debugName: "cancel" }] : /* istanbul ignore next */ []));
|
|
1307
|
+
actionsAlign = input(this._config.actionsAlign, /* @ts-ignore */
|
|
1308
|
+
...(ngDevMode ? [{ debugName: "actionsAlign" }] : /* istanbul ignore next */ []));
|
|
1309
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
1310
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1311
|
+
position = input(this._config.position, /* @ts-ignore */
|
|
1312
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1313
|
+
offset = input(this._config.offset, /* @ts-ignore */
|
|
1314
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
1315
|
+
// Outputs
|
|
1316
|
+
confirmed = output();
|
|
1317
|
+
cancelled = output();
|
|
1318
|
+
// State
|
|
1319
|
+
isOpen = this._overlay.isOpen;
|
|
1320
|
+
// Tracks whether the current session ended through an explicit action, so a
|
|
1321
|
+
// backdrop / Escape dismissal is reported as a cancellation exactly once.
|
|
1322
|
+
_resolved = false;
|
|
1323
|
+
// Element focused before opening, restored on close so keyboard focus returns
|
|
1324
|
+
// to the trigger rather than being lost when the panel is removed.
|
|
1325
|
+
_previouslyFocused = null;
|
|
1326
|
+
// Computed
|
|
1327
|
+
_positions = computed(() => buildOverlayPositions(this.position(), this.offset()), /* @ts-ignore */
|
|
1328
|
+
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
1329
|
+
// Public methods
|
|
1330
|
+
open(trigger) {
|
|
1331
|
+
const origin = trigger instanceof MouseEvent ? trigger.currentTarget : trigger;
|
|
1332
|
+
this._resolved = false;
|
|
1333
|
+
this._previouslyFocused = document.activeElement;
|
|
1334
|
+
this._overlay.open({
|
|
1335
|
+
content: this._templateRef(),
|
|
1336
|
+
origin,
|
|
1337
|
+
positions: this._positions(),
|
|
1338
|
+
onClose: () => this._onClose(),
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
close() {
|
|
1342
|
+
this._overlay.close();
|
|
1343
|
+
}
|
|
1344
|
+
toggle(trigger) {
|
|
1345
|
+
if (this.isOpen()) {
|
|
1346
|
+
this.close();
|
|
1347
|
+
}
|
|
1348
|
+
else {
|
|
1349
|
+
this.open(trigger);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
// Protected methods
|
|
1353
|
+
onConfirm() {
|
|
1354
|
+
this._resolved = true;
|
|
1355
|
+
this.confirmed.emit();
|
|
1356
|
+
this.close();
|
|
1357
|
+
}
|
|
1358
|
+
onCancel() {
|
|
1359
|
+
this._resolved = true;
|
|
1360
|
+
this.cancelled.emit();
|
|
1361
|
+
this.close();
|
|
1362
|
+
}
|
|
1363
|
+
// Private methods
|
|
1364
|
+
_onClose() {
|
|
1365
|
+
if (this._previouslyFocused)
|
|
1366
|
+
this._previouslyFocused.focus();
|
|
1367
|
+
if (this._resolved)
|
|
1368
|
+
return;
|
|
1369
|
+
this.cancelled.emit();
|
|
1370
|
+
}
|
|
1371
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Confirm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1372
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: Confirm, isStandalone: true, selector: "tls-confirm", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, confirm: { classPropertyName: "confirm", publicName: "confirm", isSignal: true, isRequired: false, transformFunction: null }, cancel: { classPropertyName: "cancel", publicName: "cancel", isSignal: true, isRequired: false, transformFunction: null }, actionsAlign: { classPropertyName: "actionsAlign", publicName: "actionsAlign", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, viewQueries: [{ propertyName: "_templateRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1373
|
+
<ng-template #content>
|
|
1374
|
+
<tls-confirm-panel
|
|
1375
|
+
[title]="title()"
|
|
1376
|
+
[message]="message()"
|
|
1377
|
+
[confirm]="confirm()"
|
|
1378
|
+
[cancel]="cancel()"
|
|
1379
|
+
[actionsAlign]="actionsAlign()"
|
|
1380
|
+
[ariaLabel]="ariaLabel()"
|
|
1381
|
+
(confirmed)="onConfirm()"
|
|
1382
|
+
(cancelled)="onCancel()"
|
|
1383
|
+
></tls-confirm-panel>
|
|
1384
|
+
</ng-template>
|
|
1385
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ConfirmPanel, selector: "tls-confirm-panel", inputs: ["title", "message", "confirm", "cancel", "ariaLabel", "modal", "actionsAlign"], outputs: ["confirmed", "cancelled"] }] });
|
|
1386
|
+
}
|
|
1387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Confirm, decorators: [{
|
|
1388
|
+
type: Component,
|
|
1389
|
+
args: [{
|
|
1390
|
+
selector: 'tls-confirm',
|
|
1391
|
+
imports: [ConfirmPanel],
|
|
1392
|
+
template: `
|
|
1393
|
+
<ng-template #content>
|
|
1394
|
+
<tls-confirm-panel
|
|
1395
|
+
[title]="title()"
|
|
1396
|
+
[message]="message()"
|
|
1397
|
+
[confirm]="confirm()"
|
|
1398
|
+
[cancel]="cancel()"
|
|
1399
|
+
[actionsAlign]="actionsAlign()"
|
|
1400
|
+
[ariaLabel]="ariaLabel()"
|
|
1401
|
+
(confirmed)="onConfirm()"
|
|
1402
|
+
(cancelled)="onCancel()"
|
|
1403
|
+
></tls-confirm-panel>
|
|
1404
|
+
</ng-template>
|
|
1405
|
+
`,
|
|
1406
|
+
}]
|
|
1407
|
+
}], propDecorators: { _templateRef: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], confirm: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirm", required: false }] }], cancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancel", required: false }] }], actionsAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsAlign", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
1408
|
+
|
|
1409
|
+
// Upper bound for how long to keep a detached confirm pane alive so its
|
|
1410
|
+
// `animate.leave` can finish. Disposes on `animationend`; this timeout only
|
|
1411
|
+
// fires when no exit animation runs (e.g. the `none` motion level).
|
|
1412
|
+
const LEAVE_ANIMATION_FALLBACK_MS$2 = 500;
|
|
1413
|
+
// Dimmed backdrop behind a centered modal confirm. Shared with `tls-dialog` so
|
|
1414
|
+
// the two modal surfaces render an identical scrim.
|
|
1415
|
+
const MODAL_BACKDROP_CLASS = 'tls-dialog-backdrop';
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Imperative confirm dialog for `await`-style flows: opens a dialog and resolves
|
|
1419
|
+
* `true` on confirm, `false` on cancel / backdrop / Escape. Anchors to the
|
|
1420
|
+
* `trigger` when given, otherwise opens as a centered modal. For a template-driven
|
|
1421
|
+
* anchored equivalent, use the `tls-confirm` component.
|
|
1422
|
+
*/
|
|
1423
|
+
class ConfirmService {
|
|
1424
|
+
// Injections
|
|
1425
|
+
_overlay = inject(Overlay);
|
|
1426
|
+
_focusTrapFactory = inject(ConfigurableFocusTrapFactory);
|
|
1427
|
+
_router = inject(Router, { optional: true });
|
|
1428
|
+
_config = inject(CONFIRM_CONFIG);
|
|
1429
|
+
// Public methods
|
|
1430
|
+
confirm(options) {
|
|
1431
|
+
const trigger = options.trigger;
|
|
1432
|
+
const modal = !trigger;
|
|
1433
|
+
const overlayRef = modal
|
|
1434
|
+
? this._createModalOverlay()
|
|
1435
|
+
: this._createAnchoredOverlay(trigger, options);
|
|
1436
|
+
const panelRef = overlayRef.attach(new ComponentPortal(ConfirmPanel));
|
|
1437
|
+
this._applyOptions(panelRef, options, modal);
|
|
1438
|
+
return this._wire(overlayRef, panelRef, modal);
|
|
1439
|
+
}
|
|
1440
|
+
// Private methods
|
|
1441
|
+
_createAnchoredOverlay(trigger, options) {
|
|
1442
|
+
const origin = trigger instanceof MouseEvent ? trigger.currentTarget : trigger;
|
|
1443
|
+
const positionStrategy = this._overlay
|
|
1444
|
+
.position()
|
|
1445
|
+
.flexibleConnectedTo(origin)
|
|
1446
|
+
.withPositions(buildOverlayPositions(options.position ?? this._config.position, options.offset ?? this._config.offset));
|
|
1447
|
+
return this._overlay.create({
|
|
1448
|
+
positionStrategy,
|
|
1449
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition(),
|
|
1450
|
+
hasBackdrop: true,
|
|
1451
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
_createModalOverlay() {
|
|
1455
|
+
const positionStrategy = this._overlay
|
|
1456
|
+
.position()
|
|
1457
|
+
.global()
|
|
1458
|
+
.centerHorizontally()
|
|
1459
|
+
.centerVertically();
|
|
1460
|
+
return this._overlay.create({
|
|
1461
|
+
positionStrategy,
|
|
1462
|
+
scrollStrategy: this._overlay.scrollStrategies.block(),
|
|
1463
|
+
hasBackdrop: true,
|
|
1464
|
+
backdropClass: MODAL_BACKDROP_CLASS,
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
_applyOptions(panelRef, options, modal) {
|
|
1468
|
+
panelRef.setInput('message', options.message);
|
|
1469
|
+
panelRef.setInput('title', options.title);
|
|
1470
|
+
panelRef.setInput('confirm', options.confirm);
|
|
1471
|
+
panelRef.setInput('cancel', options.cancel);
|
|
1472
|
+
panelRef.setInput('actionsAlign', options.actionsAlign ?? this._config.actionsAlign);
|
|
1473
|
+
panelRef.setInput('ariaLabel', options.ariaLabel);
|
|
1474
|
+
panelRef.setInput('modal', modal);
|
|
1475
|
+
}
|
|
1476
|
+
_wire(overlayRef, panelRef, modal) {
|
|
1477
|
+
// Capture the pre-open focus so it can be restored on dismissal. The panel
|
|
1478
|
+
// moves initial focus to the primary action; a modal additionally traps
|
|
1479
|
+
// focus for its lifetime, so the trap only constrains tabbing.
|
|
1480
|
+
const previouslyFocused = document.activeElement;
|
|
1481
|
+
const focusTrap = modal
|
|
1482
|
+
? this._focusTrapFactory.create(overlayRef.overlayElement)
|
|
1483
|
+
: null;
|
|
1484
|
+
return new Promise(resolve => {
|
|
1485
|
+
const subscriptions = new Subscription();
|
|
1486
|
+
const settle = (result) => {
|
|
1487
|
+
subscriptions.unsubscribe();
|
|
1488
|
+
if (focusTrap)
|
|
1489
|
+
focusTrap.destroy();
|
|
1490
|
+
this._dismiss(overlayRef);
|
|
1491
|
+
if (previouslyFocused)
|
|
1492
|
+
previouslyFocused.focus();
|
|
1493
|
+
resolve(result);
|
|
1494
|
+
};
|
|
1495
|
+
subscriptions.add(panelRef.instance.confirmed.subscribe(() => settle(true)));
|
|
1496
|
+
subscriptions.add(panelRef.instance.cancelled.subscribe(() => settle(false)));
|
|
1497
|
+
subscriptions.add(overlayRef.backdropClick().subscribe(() => settle(false)));
|
|
1498
|
+
subscriptions.add(overlayRef
|
|
1499
|
+
.keydownEvents()
|
|
1500
|
+
.pipe(filter$1(event => event.key === 'Escape'))
|
|
1501
|
+
.subscribe(() => settle(false)));
|
|
1502
|
+
// The overlay is not tied to a component, so a route change would leave it
|
|
1503
|
+
// orphaned over the next page; dismiss it (as a cancellation) on navigation.
|
|
1504
|
+
if (this._router) {
|
|
1505
|
+
subscriptions.add(this._router.events
|
|
1506
|
+
.pipe(filter$1(event => event instanceof NavigationStart))
|
|
1507
|
+
.subscribe(() => settle(false)));
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
// Detaches the overlay so Angular's `animate.leave` plays the exit animation,
|
|
1512
|
+
// then disposes the pane once that animation finishes.
|
|
1513
|
+
_dismiss(overlayRef) {
|
|
1514
|
+
overlayRef.detach();
|
|
1515
|
+
const paneElement = overlayRef.overlayElement;
|
|
1516
|
+
if (!paneElement) {
|
|
1517
|
+
overlayRef.dispose();
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
let settled = false;
|
|
1521
|
+
const finalize = () => {
|
|
1522
|
+
if (settled)
|
|
1523
|
+
return;
|
|
1524
|
+
settled = true;
|
|
1525
|
+
window.clearTimeout(timeoutId);
|
|
1526
|
+
paneElement.removeEventListener('animationend', finalize);
|
|
1527
|
+
overlayRef.dispose();
|
|
1528
|
+
};
|
|
1529
|
+
paneElement.addEventListener('animationend', finalize);
|
|
1530
|
+
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS$2);
|
|
1531
|
+
}
|
|
1532
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1533
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, providedIn: 'root' });
|
|
1534
|
+
}
|
|
1535
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConfirmService, decorators: [{
|
|
1536
|
+
type: Injectable,
|
|
1537
|
+
args: [{ providedIn: 'root' }]
|
|
1538
|
+
}] });
|
|
1539
|
+
|
|
907
1540
|
const DEFAULT_DIALOG_CONFIG = {
|
|
908
1541
|
size: 'md',
|
|
909
1542
|
closeable: true,
|
|
@@ -924,10 +1557,10 @@ class Dialog extends CdkDialogContainer {
|
|
|
924
1557
|
close() {
|
|
925
1558
|
this._dialogRef.close();
|
|
926
1559
|
}
|
|
927
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
928
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1560
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Dialog, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1561
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Dialog, isStandalone: true, selector: "tls-dialog", host: { properties: { "class": "hostClasses" } }, usesInheritance: true, ngImport: i0, template: "<ng-template cdkPortalOutlet />\n@if (config.closeable) {\n <button class=\"tls-dialog__close\" type=\"button\" aria-label=\"Close dialog\" (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"] }] });
|
|
929
1562
|
}
|
|
930
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1563
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Dialog, decorators: [{
|
|
931
1564
|
type: Component,
|
|
932
1565
|
args: [{ selector: 'tls-dialog', imports: [CdkPortalOutlet], host: { '[class]': 'hostClasses' }, template: "<ng-template cdkPortalOutlet />\n@if (config.closeable) {\n <button class=\"tls-dialog__close\" type=\"button\" aria-label=\"Close dialog\" (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" }]
|
|
933
1566
|
}] });
|
|
@@ -959,10 +1592,10 @@ class DialogService {
|
|
|
959
1592
|
closeAll() {
|
|
960
1593
|
this._dialog.closeAll();
|
|
961
1594
|
}
|
|
962
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
963
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1596
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogService, providedIn: 'root' });
|
|
964
1597
|
}
|
|
965
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DialogService, decorators: [{
|
|
966
1599
|
type: Injectable,
|
|
967
1600
|
args: [{ providedIn: 'root' }]
|
|
968
1601
|
}] });
|
|
@@ -980,10 +1613,13 @@ const DIVIDER_CONFIG = new InjectionToken('DIVIDER_CONFIG', {
|
|
|
980
1613
|
|
|
981
1614
|
class Divider {
|
|
982
1615
|
_config = inject(DIVIDER_CONFIG);
|
|
983
|
-
orientation = input(this._config.orientation,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1616
|
+
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
1617
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
1618
|
+
position = input(this._config.position, /* @ts-ignore */
|
|
1619
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
1620
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
1621
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1622
|
+
flush = input(this._config.flush, { ...(ngDevMode ? { debugName: "flush" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
987
1623
|
hostClasses = computed(() => {
|
|
988
1624
|
const className = 'tls-divider';
|
|
989
1625
|
const array = [className];
|
|
@@ -993,11 +1629,12 @@ class Divider {
|
|
|
993
1629
|
if (this.flush())
|
|
994
1630
|
array.push(`${className}--flush`);
|
|
995
1631
|
return array;
|
|
996
|
-
},
|
|
997
|
-
|
|
998
|
-
static
|
|
1632
|
+
}, /* @ts-ignore */
|
|
1633
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1634
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Divider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1635
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Divider, isStandalone: true, selector: "tls-divider", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, flush: { classPropertyName: "flush", publicName: "flush", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "separator" }, properties: { "aria-orientation": "orientation()", "class": "hostClasses()" } }, ngImport: i0, 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" });
|
|
999
1636
|
}
|
|
1000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Divider, decorators: [{
|
|
1001
1638
|
type: Component,
|
|
1002
1639
|
args: [{ selector: 'tls-divider', imports: [], host: {
|
|
1003
1640
|
role: 'separator',
|
|
@@ -1031,7 +1668,8 @@ class Drawer extends CdkDialogContainer {
|
|
|
1031
1668
|
_tlsConfig = inject(DRAWER_CONFIG);
|
|
1032
1669
|
_dialogRef = inject(DialogRef);
|
|
1033
1670
|
// State
|
|
1034
|
-
_state = signal('enter',
|
|
1671
|
+
_state = signal('enter', /* @ts-ignore */
|
|
1672
|
+
...(ngDevMode ? [{ debugName: "_state" }] : /* istanbul ignore next */ []));
|
|
1035
1673
|
_closing = false;
|
|
1036
1674
|
// Computed
|
|
1037
1675
|
hostClasses = computed(() => {
|
|
@@ -1044,7 +1682,8 @@ class Drawer extends CdkDialogContainer {
|
|
|
1044
1682
|
if (this._tlsConfig.rounded)
|
|
1045
1683
|
classes.push('tls-drawer--rounded');
|
|
1046
1684
|
return classes;
|
|
1047
|
-
},
|
|
1685
|
+
}, /* @ts-ignore */
|
|
1686
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1048
1687
|
// Accessors
|
|
1049
1688
|
get config() {
|
|
1050
1689
|
return this._tlsConfig;
|
|
@@ -1108,10 +1747,10 @@ class Drawer extends CdkDialogContainer {
|
|
|
1108
1747
|
finalize();
|
|
1109
1748
|
});
|
|
1110
1749
|
}
|
|
1111
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1112
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1750
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Drawer, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1751
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", 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
1752
|
}
|
|
1114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Drawer, decorators: [{
|
|
1115
1754
|
type: Component,
|
|
1116
1755
|
args: [{ selector: 'tls-drawer', imports: [CdkPortalOutlet], host: {
|
|
1117
1756
|
'[class]': 'hostClasses()',
|
|
@@ -1223,19 +1862,19 @@ class DrawerService {
|
|
|
1223
1862
|
.pipe(takeUntil(dialogRef.closed), filter(event => event.key === 'Escape'))
|
|
1224
1863
|
.subscribe(() => drawerRef.close());
|
|
1225
1864
|
}
|
|
1226
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1227
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1865
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1866
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DrawerService, providedIn: 'root' });
|
|
1228
1867
|
}
|
|
1229
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DrawerService, decorators: [{
|
|
1230
1869
|
type: Injectable,
|
|
1231
1870
|
args: [{ providedIn: 'root' }]
|
|
1232
1871
|
}] });
|
|
1233
1872
|
|
|
1234
1873
|
class FormControlAddon {
|
|
1235
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1236
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1874
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControlAddon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1875
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: FormControlAddon, isStandalone: true, selector: "tls-form-control-addon", host: { classAttribute: "tls-form-control-addon" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
1237
1876
|
}
|
|
1238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1877
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControlAddon, decorators: [{
|
|
1239
1878
|
type: Component,
|
|
1240
1879
|
args: [{
|
|
1241
1880
|
selector: 'tls-form-control-addon',
|
|
@@ -1258,8 +1897,9 @@ const FORM_CONTROL_GROUP_CONFIG = new InjectionToken('FORM_CONTROL_GROUP_CONFIG'
|
|
|
1258
1897
|
|
|
1259
1898
|
class FormControlGroup {
|
|
1260
1899
|
_config = inject(FORM_CONTROL_GROUP_CONFIG);
|
|
1261
|
-
size = input(this._config.size,
|
|
1262
|
-
|
|
1900
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
1901
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1902
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1263
1903
|
hostClasses = computed(() => {
|
|
1264
1904
|
const className = 'tls-form-control-group';
|
|
1265
1905
|
const array = [className];
|
|
@@ -1267,11 +1907,12 @@ class FormControlGroup {
|
|
|
1267
1907
|
if (this.fluid())
|
|
1268
1908
|
array.push(`${className}--fluid`);
|
|
1269
1909
|
return array;
|
|
1270
|
-
},
|
|
1271
|
-
|
|
1272
|
-
static
|
|
1910
|
+
}, /* @ts-ignore */
|
|
1911
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1912
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControlGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1913
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: FormControlGroup, isStandalone: true, selector: "tls-form-control-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
1273
1914
|
}
|
|
1274
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormControlGroup, decorators: [{
|
|
1275
1916
|
type: Component,
|
|
1276
1917
|
args: [{
|
|
1277
1918
|
selector: 'tls-form-control-group',
|
|
@@ -1321,7 +1962,8 @@ class FormItem {
|
|
|
1321
1962
|
// Injections
|
|
1322
1963
|
static _counter = 0;
|
|
1323
1964
|
_config = inject(FORM_ITEM_CONFIG);
|
|
1324
|
-
control = contentChild(FORM_CONTROL,
|
|
1965
|
+
control = contentChild(FORM_CONTROL, /* @ts-ignore */
|
|
1966
|
+
...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
1325
1967
|
/** Stable id for the label element, linked to the control via `aria-labelledby`. */
|
|
1326
1968
|
labelId = `tls-form-item-label-${FormItem._counter}`;
|
|
1327
1969
|
/** Stable id assigned to the native control element, linked from the label via `for`. */
|
|
@@ -1329,24 +1971,32 @@ class FormItem {
|
|
|
1329
1971
|
/** Stable id for the error element, linked to the control via `aria-describedby`. */
|
|
1330
1972
|
errorId = `tls-form-item-error-${FormItem._counter++}`;
|
|
1331
1973
|
// Inputs
|
|
1332
|
-
label = input(
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1974
|
+
label = input(/* @ts-ignore */
|
|
1975
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1976
|
+
reserveErrorSpace = input(this._config.reserveErrorSpace, /* @ts-ignore */
|
|
1977
|
+
...(ngDevMode ? [{ debugName: "reserveErrorSpace" }] : /* istanbul ignore next */ []));
|
|
1978
|
+
reserveLabelSpace = input(this._config.reserveLabelSpace, /* @ts-ignore */
|
|
1979
|
+
...(ngDevMode ? [{ debugName: "reserveLabelSpace" }] : /* istanbul ignore next */ []));
|
|
1980
|
+
displayErrors = input(this._config.displayErrors, /* @ts-ignore */
|
|
1981
|
+
...(ngDevMode ? [{ debugName: "displayErrors" }] : /* istanbul ignore next */ []));
|
|
1982
|
+
showRequiredMarker = input(this._config.showRequiredMarker, /* @ts-ignore */
|
|
1983
|
+
...(ngDevMode ? [{ debugName: "showRequiredMarker" }] : /* istanbul ignore next */ []));
|
|
1984
|
+
optionalText = input(this._config.optionalText, /* @ts-ignore */
|
|
1985
|
+
...(ngDevMode ? [{ debugName: "optionalText" }] : /* istanbul ignore next */ []));
|
|
1338
1986
|
isInvalid = computed(() => {
|
|
1339
1987
|
const control = this.control();
|
|
1340
1988
|
if (!control)
|
|
1341
1989
|
return false;
|
|
1342
1990
|
return control.invalid() && control.touched();
|
|
1343
|
-
},
|
|
1991
|
+
}, /* @ts-ignore */
|
|
1992
|
+
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
1344
1993
|
showRequired = computed(() => {
|
|
1345
1994
|
const control = this.control();
|
|
1346
1995
|
if (!control)
|
|
1347
1996
|
return false;
|
|
1348
1997
|
return this.showRequiredMarker() && control.required();
|
|
1349
|
-
},
|
|
1998
|
+
}, /* @ts-ignore */
|
|
1999
|
+
...(ngDevMode ? [{ debugName: "showRequired" }] : /* istanbul ignore next */ []));
|
|
1350
2000
|
showOptional = computed(() => {
|
|
1351
2001
|
const control = this.control();
|
|
1352
2002
|
if (!control)
|
|
@@ -1354,13 +2004,15 @@ class FormItem {
|
|
|
1354
2004
|
if (!this.optionalText())
|
|
1355
2005
|
return false;
|
|
1356
2006
|
return !control.required();
|
|
1357
|
-
},
|
|
2007
|
+
}, /* @ts-ignore */
|
|
2008
|
+
...(ngDevMode ? [{ debugName: "showOptional" }] : /* istanbul ignore next */ []));
|
|
1358
2009
|
labelFor = computed(() => {
|
|
1359
2010
|
const control = this.control();
|
|
1360
2011
|
if (!control || !control.supportsLabelFor)
|
|
1361
2012
|
return null;
|
|
1362
2013
|
return control.effectiveInputId();
|
|
1363
|
-
},
|
|
2014
|
+
}, /* @ts-ignore */
|
|
2015
|
+
...(ngDevMode ? [{ debugName: "labelFor" }] : /* istanbul ignore next */ []));
|
|
1364
2016
|
hostClasses = computed(() => {
|
|
1365
2017
|
const className = 'tls-form-item';
|
|
1366
2018
|
const array = [className];
|
|
@@ -1371,19 +2023,22 @@ class FormItem {
|
|
|
1371
2023
|
if (this.reserveLabelSpace())
|
|
1372
2024
|
array.push(`${className}--label-space-reserved`);
|
|
1373
2025
|
return array;
|
|
1374
|
-
},
|
|
2026
|
+
}, /* @ts-ignore */
|
|
2027
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1375
2028
|
errorMessages = computed(() => {
|
|
1376
2029
|
const control = this.control();
|
|
1377
2030
|
if (!control)
|
|
1378
2031
|
return [];
|
|
1379
2032
|
return this._getErrorMessages(control.errors());
|
|
1380
|
-
},
|
|
2033
|
+
}, /* @ts-ignore */
|
|
2034
|
+
...(ngDevMode ? [{ debugName: "errorMessages" }] : /* istanbul ignore next */ []));
|
|
1381
2035
|
firstErrorMessage = computed(() => {
|
|
1382
2036
|
if (this.errorMessages().length > 0)
|
|
1383
2037
|
return this.errorMessages()[0];
|
|
1384
2038
|
else
|
|
1385
2039
|
return null;
|
|
1386
|
-
},
|
|
2040
|
+
}, /* @ts-ignore */
|
|
2041
|
+
...(ngDevMode ? [{ debugName: "firstErrorMessage" }] : /* istanbul ignore next */ []));
|
|
1387
2042
|
// constructor
|
|
1388
2043
|
constructor() {
|
|
1389
2044
|
effect(() => {
|
|
@@ -1412,10 +2067,10 @@ class FormItem {
|
|
|
1412
2067
|
}
|
|
1413
2068
|
return array;
|
|
1414
2069
|
}
|
|
1415
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1416
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2070
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2071
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: FormItem, isStandalone: true, selector: "tls-form-item", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, reserveErrorSpace: { classPropertyName: "reserveErrorSpace", publicName: "reserveErrorSpace", isSignal: true, isRequired: false, transformFunction: null }, reserveLabelSpace: { classPropertyName: "reserveLabelSpace", publicName: "reserveLabelSpace", isSignal: true, isRequired: false, transformFunction: null }, displayErrors: { classPropertyName: "displayErrors", publicName: "displayErrors", isSignal: true, isRequired: false, transformFunction: null }, showRequiredMarker: { classPropertyName: "showRequiredMarker", publicName: "showRequiredMarker", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "control", first: true, predicate: FORM_CONTROL, descendants: true, isSignal: true }], ngImport: i0, template: "@if (label() || reserveLabelSpace()) {\n <label class=\"form-item-label\" [id]=\"labelId\" [attr.for]=\"labelFor()\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n @if (showRequired()) {\n <span class=\"form-item-label__required\">*</span>\n } @else if (showOptional()) {\n <span class=\"form-item-label__optional\">{{ optionalText() }}</span>\n }\n </label>\n}\n<div class=\"form-item-control\">\n <ng-content></ng-content>\n</div>\n@if (displayErrors()) {\n <small class=\"form-item-error\">\n @if (isInvalid()) {\n <span class=\"form-item-error__text\" [id]=\"errorId\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" });
|
|
1417
2072
|
}
|
|
1418
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormItem, decorators: [{
|
|
1419
2074
|
type: Component,
|
|
1420
2075
|
args: [{ selector: 'tls-form-item', imports: [], host: { '[class]': 'hostClasses()' }, template: "@if (label() || reserveLabelSpace()) {\n <label class=\"form-item-label\" [id]=\"labelId\" [attr.for]=\"labelFor()\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n @if (showRequired()) {\n <span class=\"form-item-label__required\">*</span>\n } @else if (showOptional()) {\n <span class=\"form-item-label__optional\">{{ optionalText() }}</span>\n }\n </label>\n}\n<div class=\"form-item-control\">\n <ng-content></ng-content>\n</div>\n@if (displayErrors()) {\n <small class=\"form-item-error\">\n @if (isInvalid()) {\n <span class=\"form-item-error__text\" [id]=\"errorId\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" }]
|
|
1421
2076
|
}], ctorParameters: () => [], propDecorators: { control: [{ type: i0.ContentChild, args: [i0.forwardRef(() => FORM_CONTROL), { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], reserveErrorSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "reserveErrorSpace", required: false }] }], reserveLabelSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "reserveLabelSpace", required: false }] }], displayErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayErrors", required: false }] }], showRequiredMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRequiredMarker", required: false }] }], optionalText: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionalText", required: false }] }] } });
|
|
@@ -1430,16 +2085,20 @@ class Checkbox extends CheckboxFormControl {
|
|
|
1430
2085
|
_config = inject(CHECKBOX_CONFIG);
|
|
1431
2086
|
CLASS_NAME = 'tls-checkbox';
|
|
1432
2087
|
supportsLabelFor = true;
|
|
1433
|
-
indeterminate = model(false,
|
|
1434
|
-
|
|
1435
|
-
|
|
2088
|
+
indeterminate = model(false, /* @ts-ignore */
|
|
2089
|
+
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
2090
|
+
checked = model(false, /* @ts-ignore */
|
|
2091
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
2092
|
+
tabindex = input(0, /* @ts-ignore */
|
|
2093
|
+
...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
1436
2094
|
hostClasses = computed(() => {
|
|
1437
2095
|
const className = this.CLASS_NAME;
|
|
1438
2096
|
const array = [className];
|
|
1439
2097
|
if (this.indeterminate())
|
|
1440
2098
|
array.push(`${className}--indeterminate`);
|
|
1441
2099
|
return array.concat(this.controlClasses());
|
|
1442
|
-
},
|
|
2100
|
+
}, /* @ts-ignore */
|
|
2101
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1443
2102
|
// Protected methods
|
|
1444
2103
|
toggle() {
|
|
1445
2104
|
if (this.notInteractive())
|
|
@@ -1450,10 +2109,10 @@ class Checkbox extends CheckboxFormControl {
|
|
|
1450
2109
|
event.preventDefault();
|
|
1451
2110
|
this.toggle();
|
|
1452
2111
|
}
|
|
1453
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1454
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Checkbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Checkbox, isStandalone: true, selector: "tls-checkbox", inputs: { indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { indeterminate: "indeterminateChange", checked: "checkedChange" }, host: { attributes: { "role": "checkbox" }, properties: { "class": "hostClasses()", "tabindex": "-1" } }, usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<div class=\"tls-checkbox-icon\">\n @if (indeterminate()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"20px\"\n viewBox=\"0 -960 960 960\"\n width=\"20px\"\n fill=\"currentColor\"\n >\n <path d=\"M288-444v-72h384v72H288Z\" />\n </svg>\n } @else {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"20px\"\n viewBox=\"0 -960 960 960\"\n width=\"20px\"\n fill=\"currentColor\"\n >\n <path d=\"M400-301 240-461l51-51 109 109 269-269 51 51-320 320Z\" />\n </svg>\n }\n</div>\n" });
|
|
1455
2114
|
}
|
|
1456
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Checkbox, decorators: [{
|
|
1457
2116
|
type: Component,
|
|
1458
2117
|
args: [{ selector: 'tls-checkbox', imports: [], host: {
|
|
1459
2118
|
role: 'checkbox',
|
|
@@ -1462,148 +2121,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
1462
2121
|
}, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardToggle($event)\"\n (keydown.enter)=\"onKeyboardToggle($event)\"\n/>\n<div class=\"tls-checkbox-icon\">\n @if (indeterminate()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"20px\"\n viewBox=\"0 -960 960 960\"\n width=\"20px\"\n fill=\"currentColor\"\n >\n <path d=\"M288-444v-72h384v72H288Z\" />\n </svg>\n } @else {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"20px\"\n viewBox=\"0 -960 960 960\"\n width=\"20px\"\n fill=\"currentColor\"\n >\n <path d=\"M400-301 240-461l51-51 109 109 269-269 51 51-320 320Z\" />\n </svg>\n }\n</div>\n" }]
|
|
1463
2122
|
}], propDecorators: { indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
1464
2123
|
|
|
1465
|
-
const OVERLAY_POSITION_MAP = {
|
|
1466
|
-
top: {
|
|
1467
|
-
originX: 'center',
|
|
1468
|
-
originY: 'top',
|
|
1469
|
-
overlayX: 'center',
|
|
1470
|
-
overlayY: 'bottom',
|
|
1471
|
-
offsetX: 0,
|
|
1472
|
-
offsetY: -1,
|
|
1473
|
-
},
|
|
1474
|
-
right: {
|
|
1475
|
-
originX: 'end',
|
|
1476
|
-
originY: 'center',
|
|
1477
|
-
overlayX: 'start',
|
|
1478
|
-
overlayY: 'center',
|
|
1479
|
-
offsetX: 1,
|
|
1480
|
-
offsetY: 0,
|
|
1481
|
-
},
|
|
1482
|
-
bottom: {
|
|
1483
|
-
originX: 'center',
|
|
1484
|
-
originY: 'bottom',
|
|
1485
|
-
overlayX: 'center',
|
|
1486
|
-
overlayY: 'top',
|
|
1487
|
-
offsetX: 1,
|
|
1488
|
-
offsetY: 1,
|
|
1489
|
-
},
|
|
1490
|
-
left: {
|
|
1491
|
-
originX: 'start',
|
|
1492
|
-
originY: 'center',
|
|
1493
|
-
overlayX: 'end',
|
|
1494
|
-
overlayY: 'center',
|
|
1495
|
-
offsetX: -1,
|
|
1496
|
-
offsetY: 0,
|
|
1497
|
-
},
|
|
1498
|
-
'top-start': {
|
|
1499
|
-
originX: 'start',
|
|
1500
|
-
originY: 'top',
|
|
1501
|
-
overlayX: 'start',
|
|
1502
|
-
overlayY: 'bottom',
|
|
1503
|
-
offsetX: 0,
|
|
1504
|
-
offsetY: -1,
|
|
1505
|
-
},
|
|
1506
|
-
'top-end': {
|
|
1507
|
-
originX: 'end',
|
|
1508
|
-
originY: 'top',
|
|
1509
|
-
overlayX: 'end',
|
|
1510
|
-
overlayY: 'bottom',
|
|
1511
|
-
offsetX: 0,
|
|
1512
|
-
offsetY: -1,
|
|
1513
|
-
},
|
|
1514
|
-
'right-start': {
|
|
1515
|
-
originX: 'end',
|
|
1516
|
-
originY: 'top',
|
|
1517
|
-
overlayX: 'start',
|
|
1518
|
-
overlayY: 'top',
|
|
1519
|
-
offsetX: 1,
|
|
1520
|
-
offsetY: 0,
|
|
1521
|
-
},
|
|
1522
|
-
'right-end': {
|
|
1523
|
-
originX: 'end',
|
|
1524
|
-
originY: 'bottom',
|
|
1525
|
-
overlayX: 'start',
|
|
1526
|
-
overlayY: 'bottom',
|
|
1527
|
-
offsetX: 1,
|
|
1528
|
-
offsetY: 0,
|
|
1529
|
-
},
|
|
1530
|
-
'bottom-start': {
|
|
1531
|
-
originX: 'start',
|
|
1532
|
-
originY: 'bottom',
|
|
1533
|
-
overlayX: 'start',
|
|
1534
|
-
overlayY: 'top',
|
|
1535
|
-
offsetX: 0,
|
|
1536
|
-
offsetY: 1,
|
|
1537
|
-
},
|
|
1538
|
-
'bottom-end': {
|
|
1539
|
-
originX: 'end',
|
|
1540
|
-
originY: 'bottom',
|
|
1541
|
-
overlayX: 'end',
|
|
1542
|
-
overlayY: 'top',
|
|
1543
|
-
offsetX: 0,
|
|
1544
|
-
offsetY: 1,
|
|
1545
|
-
},
|
|
1546
|
-
'left-start': {
|
|
1547
|
-
originX: 'start',
|
|
1548
|
-
originY: 'top',
|
|
1549
|
-
overlayX: 'end',
|
|
1550
|
-
overlayY: 'top',
|
|
1551
|
-
offsetX: -1,
|
|
1552
|
-
offsetY: 0,
|
|
1553
|
-
},
|
|
1554
|
-
'left-end': {
|
|
1555
|
-
originX: 'start',
|
|
1556
|
-
originY: 'bottom',
|
|
1557
|
-
overlayX: 'end',
|
|
1558
|
-
overlayY: 'bottom',
|
|
1559
|
-
offsetX: -1,
|
|
1560
|
-
offsetY: 0,
|
|
1561
|
-
},
|
|
1562
|
-
'top-left': {
|
|
1563
|
-
originX: 'start',
|
|
1564
|
-
originY: 'top',
|
|
1565
|
-
overlayX: 'end',
|
|
1566
|
-
overlayY: 'bottom',
|
|
1567
|
-
offsetX: -1,
|
|
1568
|
-
offsetY: -1,
|
|
1569
|
-
},
|
|
1570
|
-
'top-right': {
|
|
1571
|
-
originX: 'end',
|
|
1572
|
-
originY: 'top',
|
|
1573
|
-
overlayX: 'start',
|
|
1574
|
-
overlayY: 'bottom',
|
|
1575
|
-
offsetX: 1,
|
|
1576
|
-
offsetY: -1,
|
|
1577
|
-
},
|
|
1578
|
-
'bottom-left': {
|
|
1579
|
-
originX: 'start',
|
|
1580
|
-
originY: 'bottom',
|
|
1581
|
-
overlayX: 'end',
|
|
1582
|
-
overlayY: 'top',
|
|
1583
|
-
offsetX: -1,
|
|
1584
|
-
offsetY: 1,
|
|
1585
|
-
},
|
|
1586
|
-
'bottom-right': {
|
|
1587
|
-
originX: 'end',
|
|
1588
|
-
originY: 'bottom',
|
|
1589
|
-
overlayX: 'start',
|
|
1590
|
-
overlayY: 'top',
|
|
1591
|
-
offsetX: 1,
|
|
1592
|
-
offsetY: 1,
|
|
1593
|
-
},
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
const buildOverlayPositions = (position, offset) => {
|
|
1597
|
-
const preferred = OVERLAY_POSITION_MAP[position];
|
|
1598
|
-
const rest = Object.values(OVERLAY_POSITION_MAP).filter(p => p !== preferred);
|
|
1599
|
-
const positions = [preferred, ...rest];
|
|
1600
|
-
return positions.map(position => ({
|
|
1601
|
-
...position,
|
|
1602
|
-
offsetX: Math.sign(position.offsetX ?? 0) * offset.x,
|
|
1603
|
-
offsetY: Math.sign(position.offsetY ?? 0) * offset.y,
|
|
1604
|
-
}));
|
|
1605
|
-
};
|
|
1606
|
-
|
|
1607
2124
|
const DEFAULT_POPOVER_CONFIG = {
|
|
1608
2125
|
position: 'bottom',
|
|
1609
2126
|
offset: { x: 0, y: 4 },
|
|
@@ -1620,10 +2137,14 @@ class Popover {
|
|
|
1620
2137
|
_templateRef = viewChild.required('content');
|
|
1621
2138
|
id = `tls-popover-${++Popover._counter}`;
|
|
1622
2139
|
isOpen = this._overlay.isOpen;
|
|
1623
|
-
position = input(this._config.position,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
2140
|
+
position = input(this._config.position, /* @ts-ignore */
|
|
2141
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
2142
|
+
offset = input(this._config.offset, /* @ts-ignore */
|
|
2143
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
2144
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
2145
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2146
|
+
_positions = computed(() => buildOverlayPositions(this.position(), this.offset()), /* @ts-ignore */
|
|
2147
|
+
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
1627
2148
|
// Public methods
|
|
1628
2149
|
open(trigger) {
|
|
1629
2150
|
const origin = trigger instanceof MouseEvent ? trigger.currentTarget : trigger;
|
|
@@ -1644,8 +2165,8 @@ class Popover {
|
|
|
1644
2165
|
this.open(trigger);
|
|
1645
2166
|
}
|
|
1646
2167
|
}
|
|
1647
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1648
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
2168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Popover, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2169
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: Popover, isStandalone: true, selector: "tls-popover", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_templateRef", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1649
2170
|
<ng-template #content>
|
|
1650
2171
|
<div
|
|
1651
2172
|
class="tls-popover"
|
|
@@ -1661,7 +2182,7 @@ class Popover {
|
|
|
1661
2182
|
</ng-template>
|
|
1662
2183
|
`, isInline: true });
|
|
1663
2184
|
}
|
|
1664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Popover, decorators: [{
|
|
1665
2186
|
type: Component,
|
|
1666
2187
|
args: [{
|
|
1667
2188
|
selector: 'tls-popover',
|
|
@@ -1685,10 +2206,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
1685
2206
|
|
|
1686
2207
|
class Calendar {
|
|
1687
2208
|
// Inputs
|
|
1688
|
-
viewDate = input.required(
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
2209
|
+
viewDate = input.required(/* @ts-ignore */
|
|
2210
|
+
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
2211
|
+
selectedDate = input.required(/* @ts-ignore */
|
|
2212
|
+
...(ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []));
|
|
2213
|
+
weekStartsOn = input.required(/* @ts-ignore */
|
|
2214
|
+
...(ngDevMode ? [{ debugName: "weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
2215
|
+
weekDays = input.required(/* @ts-ignore */
|
|
2216
|
+
...(ngDevMode ? [{ debugName: "weekDays" }] : /* istanbul ignore next */ []));
|
|
1692
2217
|
// Outputs
|
|
1693
2218
|
daySelect = output();
|
|
1694
2219
|
viewDateChange = output();
|
|
@@ -1698,8 +2223,10 @@ class Calendar {
|
|
|
1698
2223
|
const startDay = this.weekStartsOn();
|
|
1699
2224
|
const days = this.weekDays();
|
|
1700
2225
|
return [...days.slice(startDay), ...days.slice(0, startDay)];
|
|
1701
|
-
},
|
|
1702
|
-
|
|
2226
|
+
}, /* @ts-ignore */
|
|
2227
|
+
...(ngDevMode ? [{ debugName: "displayedWeekDays" }] : /* istanbul ignore next */ []));
|
|
2228
|
+
headerLabel = computed(() => format(this.viewDate(), 'MMMM yyyy'), /* @ts-ignore */
|
|
2229
|
+
...(ngDevMode ? [{ debugName: "headerLabel" }] : /* istanbul ignore next */ []));
|
|
1703
2230
|
days = computed(() => {
|
|
1704
2231
|
const monthStart = startOfMonth(this.viewDate());
|
|
1705
2232
|
const monthEnd = endOfMonth(this.viewDate());
|
|
@@ -1708,7 +2235,8 @@ class Calendar {
|
|
|
1708
2235
|
start: startOfWeek(monthStart, { weekStartsOn }),
|
|
1709
2236
|
end: endOfWeek(monthEnd, { weekStartsOn }),
|
|
1710
2237
|
});
|
|
1711
|
-
},
|
|
2238
|
+
}, /* @ts-ignore */
|
|
2239
|
+
...(ngDevMode ? [{ debugName: "days" }] : /* istanbul ignore next */ []));
|
|
1712
2240
|
// Protected methods
|
|
1713
2241
|
prevMonth() {
|
|
1714
2242
|
this.viewDateChange.emit(subMonths(this.viewDate(), 1));
|
|
@@ -1729,10 +2257,10 @@ class Calendar {
|
|
|
1729
2257
|
isTodayDay(day) {
|
|
1730
2258
|
return isToday(day);
|
|
1731
2259
|
}
|
|
1732
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1733
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Calendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Calendar, isStandalone: true, selector: "tls-calendar", inputs: { viewDate: { classPropertyName: "viewDate", publicName: "viewDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: true, transformFunction: null }, weekDays: { classPropertyName: "weekDays", publicName: "weekDays", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { daySelect: "daySelect", viewDateChange: "viewDateChange", navigateUp: "navigateUp" }, host: { classAttribute: "tls-calendar" }, ngImport: i0, template: "<div class=\"tls-calendar__header\">\n <button type=\"button\" class=\"tls-calendar__nav\" (click)=\"prevMonth()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <button type=\"button\" class=\"tls-calendar__header-button\" (click)=\"navigateUp.emit()\">\n {{ headerLabel() }}\n </button>\n <button type=\"button\" class=\"tls-calendar__nav\" (click)=\"nextMonth()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n<div class=\"tls-calendar__grid\">\n @for (day of displayedWeekDays(); track day) {\n <span class=\"tls-calendar__weekday\">{{ day }}</span>\n }\n @for (day of days(); track day.getTime()) {\n <button\n type=\"button\"\n class=\"tls-calendar__day\"\n [class.tls-calendar__day--outside]=\"!isInCurrentMonth(day)\"\n [class.tls-calendar__day--today]=\"isTodayDay(day)\"\n [class.tls-calendar__day--selected]=\"isSelectedDay(day)\"\n (click)=\"daySelect.emit(day)\"\n >\n {{ getDayLabel(day) }}\n </button>\n }\n</div>\n" });
|
|
1734
2262
|
}
|
|
1735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Calendar, decorators: [{
|
|
1736
2264
|
type: Component,
|
|
1737
2265
|
args: [{ selector: 'tls-calendar', imports: [], host: { class: 'tls-calendar' }, template: "<div class=\"tls-calendar__header\">\n <button type=\"button\" class=\"tls-calendar__nav\" (click)=\"prevMonth()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <button type=\"button\" class=\"tls-calendar__header-button\" (click)=\"navigateUp.emit()\">\n {{ headerLabel() }}\n </button>\n <button type=\"button\" class=\"tls-calendar__nav\" (click)=\"nextMonth()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n<div class=\"tls-calendar__grid\">\n @for (day of displayedWeekDays(); track day) {\n <span class=\"tls-calendar__weekday\">{{ day }}</span>\n }\n @for (day of days(); track day.getTime()) {\n <button\n type=\"button\"\n class=\"tls-calendar__day\"\n [class.tls-calendar__day--outside]=\"!isInCurrentMonth(day)\"\n [class.tls-calendar__day--today]=\"isTodayDay(day)\"\n [class.tls-calendar__day--selected]=\"isSelectedDay(day)\"\n (click)=\"daySelect.emit(day)\"\n >\n {{ getDayLabel(day) }}\n </button>\n }\n</div>\n" }]
|
|
1738
2266
|
}], propDecorators: { viewDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewDate", required: true }] }], selectedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedDate", required: true }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: true }] }], weekDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekDays", required: true }] }], daySelect: [{ type: i0.Output, args: ["daySelect"] }], viewDateChange: [{ type: i0.Output, args: ["viewDateChange"] }], navigateUp: [{ type: i0.Output, args: ["navigateUp"] }] } });
|
|
@@ -1752,15 +2280,18 @@ const DATE_TIME_PICKER_CONFIG = new InjectionToken('DATE_TIME_PICKER_CONFIG', {
|
|
|
1752
2280
|
const MONTH_INDEXES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1753
2281
|
class MonthPicker {
|
|
1754
2282
|
// Inputs
|
|
1755
|
-
viewDate = input.required(
|
|
1756
|
-
|
|
2283
|
+
viewDate = input.required(/* @ts-ignore */
|
|
2284
|
+
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
2285
|
+
selectedDate = input.required(/* @ts-ignore */
|
|
2286
|
+
...(ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []));
|
|
1757
2287
|
// Outputs
|
|
1758
2288
|
monthSelect = output();
|
|
1759
2289
|
viewDateChange = output();
|
|
1760
2290
|
navigateUp = output();
|
|
1761
2291
|
// Computed
|
|
1762
2292
|
months = MONTH_INDEXES;
|
|
1763
|
-
yearLabel = computed(() => format(this.viewDate(), 'yyyy'),
|
|
2293
|
+
yearLabel = computed(() => format(this.viewDate(), 'yyyy'), /* @ts-ignore */
|
|
2294
|
+
...(ngDevMode ? [{ debugName: "yearLabel" }] : /* istanbul ignore next */ []));
|
|
1764
2295
|
// Protected methods
|
|
1765
2296
|
getMonthLabel(monthIndex) {
|
|
1766
2297
|
return format(setMonth(new Date(2000, 0, 1), monthIndex), 'MMM');
|
|
@@ -1783,30 +2314,35 @@ class MonthPicker {
|
|
|
1783
2314
|
isCurrentMonth(monthIndex) {
|
|
1784
2315
|
return isSameMonth(new Date(), setMonth(this.viewDate(), monthIndex));
|
|
1785
2316
|
}
|
|
1786
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1787
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MonthPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2318
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: MonthPicker, isStandalone: true, selector: "tls-month-picker", inputs: { viewDate: { classPropertyName: "viewDate", publicName: "viewDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { monthSelect: "monthSelect", viewDateChange: "viewDateChange", navigateUp: "navigateUp" }, host: { classAttribute: "tls-month-picker" }, ngImport: i0, template: "<div class=\"tls-month-picker__header\">\n <button type=\"button\" class=\"tls-month-picker__nav\" (click)=\"prevYear()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <button type=\"button\" class=\"tls-month-picker__header-button\" (click)=\"navigateUp.emit()\">\n {{ yearLabel() }}\n </button>\n <button type=\"button\" class=\"tls-month-picker__nav\" (click)=\"nextYear()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n<div class=\"tls-month-picker__grid\">\n @for (month of months; track month) {\n <button\n type=\"button\"\n class=\"tls-month-picker__cell\"\n [class.tls-month-picker__cell--selected]=\"isSelectedMonth(month)\"\n [class.tls-month-picker__cell--current]=\"isCurrentMonth(month)\"\n (click)=\"selectMonth(month)\"\n >\n {{ getMonthLabel(month) }}\n </button>\n }\n</div>\n" });
|
|
1788
2319
|
}
|
|
1789
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MonthPicker, decorators: [{
|
|
1790
2321
|
type: Component,
|
|
1791
2322
|
args: [{ selector: 'tls-month-picker', imports: [], host: { class: 'tls-month-picker' }, template: "<div class=\"tls-month-picker__header\">\n <button type=\"button\" class=\"tls-month-picker__nav\" (click)=\"prevYear()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <button type=\"button\" class=\"tls-month-picker__header-button\" (click)=\"navigateUp.emit()\">\n {{ yearLabel() }}\n </button>\n <button type=\"button\" class=\"tls-month-picker__nav\" (click)=\"nextYear()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n<div class=\"tls-month-picker__grid\">\n @for (month of months; track month) {\n <button\n type=\"button\"\n class=\"tls-month-picker__cell\"\n [class.tls-month-picker__cell--selected]=\"isSelectedMonth(month)\"\n [class.tls-month-picker__cell--current]=\"isCurrentMonth(month)\"\n (click)=\"selectMonth(month)\"\n >\n {{ getMonthLabel(month) }}\n </button>\n }\n</div>\n" }]
|
|
1792
2323
|
}], propDecorators: { viewDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewDate", required: true }] }], selectedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedDate", required: true }] }], monthSelect: [{ type: i0.Output, args: ["monthSelect"] }], viewDateChange: [{ type: i0.Output, args: ["viewDateChange"] }], navigateUp: [{ type: i0.Output, args: ["navigateUp"] }] } });
|
|
1793
2324
|
|
|
1794
2325
|
class TimePicker {
|
|
1795
2326
|
// Inputs
|
|
1796
|
-
value = input.required(
|
|
2327
|
+
value = input.required(/* @ts-ignore */
|
|
2328
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1797
2329
|
// Outputs
|
|
1798
2330
|
timeChange = output();
|
|
1799
2331
|
// Computed
|
|
1800
2332
|
hours = computed(() => {
|
|
1801
2333
|
const date = this.value();
|
|
1802
2334
|
return date ? getHours(date) : 0;
|
|
1803
|
-
},
|
|
2335
|
+
}, /* @ts-ignore */
|
|
2336
|
+
...(ngDevMode ? [{ debugName: "hours" }] : /* istanbul ignore next */ []));
|
|
1804
2337
|
minutes = computed(() => {
|
|
1805
2338
|
const date = this.value();
|
|
1806
2339
|
return date ? getMinutes(date) : 0;
|
|
1807
|
-
},
|
|
1808
|
-
|
|
1809
|
-
|
|
2340
|
+
}, /* @ts-ignore */
|
|
2341
|
+
...(ngDevMode ? [{ debugName: "minutes" }] : /* istanbul ignore next */ []));
|
|
2342
|
+
hoursLabel = computed(() => String(this.hours()).padStart(2, '0'), /* @ts-ignore */
|
|
2343
|
+
...(ngDevMode ? [{ debugName: "hoursLabel" }] : /* istanbul ignore next */ []));
|
|
2344
|
+
minutesLabel = computed(() => String(this.minutes()).padStart(2, '0'), /* @ts-ignore */
|
|
2345
|
+
...(ngDevMode ? [{ debugName: "minutesLabel" }] : /* istanbul ignore next */ []));
|
|
1810
2346
|
// Private accessors
|
|
1811
2347
|
get _baseDate() {
|
|
1812
2348
|
return this.value() ?? startOfDay(new Date());
|
|
@@ -1824,19 +2360,22 @@ class TimePicker {
|
|
|
1824
2360
|
decrementMinutes() {
|
|
1825
2361
|
this.timeChange.emit(setMinutes(this._baseDate, (this.minutes() + 59) % 60));
|
|
1826
2362
|
}
|
|
1827
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1828
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
2363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2364
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: TimePicker, isStandalone: true, selector: "tls-time-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { timeChange: "timeChange" }, host: { classAttribute: "tls-time-picker" }, ngImport: i0, template: "<div class=\"tls-time-picker__column\">\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"incrementHours()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 7L7 1L13 7\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-time-picker__value\">{{ hoursLabel() }}</span>\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"decrementHours()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L13 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n<span class=\"tls-time-picker__separator\">:</span>\n\n<div class=\"tls-time-picker__column\">\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"incrementMinutes()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 7L7 1L13 7\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-time-picker__value\">{{ minutesLabel() }}</span>\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"decrementMinutes()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L13 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n" });
|
|
1829
2365
|
}
|
|
1830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TimePicker, decorators: [{
|
|
1831
2367
|
type: Component,
|
|
1832
2368
|
args: [{ selector: 'tls-time-picker', imports: [], host: { class: 'tls-time-picker' }, template: "<div class=\"tls-time-picker__column\">\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"incrementHours()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 7L7 1L13 7\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-time-picker__value\">{{ hoursLabel() }}</span>\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"decrementHours()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L13 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n<span class=\"tls-time-picker__separator\">:</span>\n\n<div class=\"tls-time-picker__column\">\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"incrementMinutes()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 7L7 1L13 7\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-time-picker__value\">{{ minutesLabel() }}</span>\n <button type=\"button\" class=\"tls-time-picker__arrow\" (click)=\"decrementMinutes()\">\n <svg viewBox=\"0 0 14 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L13 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n" }]
|
|
1833
2369
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], timeChange: [{ type: i0.Output, args: ["timeChange"] }] } });
|
|
1834
2370
|
|
|
1835
2371
|
class YearPicker {
|
|
1836
2372
|
// Inputs
|
|
1837
|
-
viewDate = input.required(
|
|
1838
|
-
|
|
1839
|
-
|
|
2373
|
+
viewDate = input.required(/* @ts-ignore */
|
|
2374
|
+
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
2375
|
+
selectedDate = input.required(/* @ts-ignore */
|
|
2376
|
+
...(ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []));
|
|
2377
|
+
yearsPerPage = input.required(/* @ts-ignore */
|
|
2378
|
+
...(ngDevMode ? [{ debugName: "yearsPerPage" }] : /* istanbul ignore next */ []));
|
|
1840
2379
|
// Outputs
|
|
1841
2380
|
yearSelect = output();
|
|
1842
2381
|
viewDateChange = output();
|
|
@@ -1846,11 +2385,13 @@ class YearPicker {
|
|
|
1846
2385
|
const perPage = this.yearsPerPage();
|
|
1847
2386
|
const start = Math.floor(year / perPage) * perPage;
|
|
1848
2387
|
return Array.from({ length: perPage }, (_, index) => start + index);
|
|
1849
|
-
},
|
|
2388
|
+
}, /* @ts-ignore */
|
|
2389
|
+
...(ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []));
|
|
1850
2390
|
rangeLabel = computed(() => {
|
|
1851
2391
|
const yearsArray = this.years();
|
|
1852
2392
|
return `${yearsArray[0]} – ${yearsArray[yearsArray.length - 1]}`;
|
|
1853
|
-
},
|
|
2393
|
+
}, /* @ts-ignore */
|
|
2394
|
+
...(ngDevMode ? [{ debugName: "rangeLabel" }] : /* istanbul ignore next */ []));
|
|
1854
2395
|
// Protected methods
|
|
1855
2396
|
prevPage() {
|
|
1856
2397
|
this.viewDateChange.emit(subYears(this.viewDate(), this.yearsPerPage()));
|
|
@@ -1868,10 +2409,10 @@ class YearPicker {
|
|
|
1868
2409
|
isCurrentYear(year) {
|
|
1869
2410
|
return getYear(new Date()) === year;
|
|
1870
2411
|
}
|
|
1871
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1872
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2412
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: YearPicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2413
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: YearPicker, isStandalone: true, selector: "tls-year-picker", inputs: { viewDate: { classPropertyName: "viewDate", publicName: "viewDate", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, yearsPerPage: { classPropertyName: "yearsPerPage", publicName: "yearsPerPage", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { yearSelect: "yearSelect", viewDateChange: "viewDateChange" }, host: { classAttribute: "tls-year-picker" }, ngImport: i0, template: "<div class=\"tls-year-picker__header\">\n <button type=\"button\" class=\"tls-year-picker__nav\" (click)=\"prevPage()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-year-picker__range\">{{ rangeLabel() }}</span>\n <button type=\"button\" class=\"tls-year-picker__nav\" (click)=\"nextPage()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n<div class=\"tls-year-picker__grid\">\n @for (year of years(); track year) {\n <button\n type=\"button\"\n class=\"tls-year-picker__cell\"\n [class.tls-year-picker__cell--selected]=\"isSelectedYear(year)\"\n [class.tls-year-picker__cell--current]=\"isCurrentYear(year)\"\n (click)=\"selectYear(year)\"\n >\n {{ year }}\n </button>\n }\n</div>\n" });
|
|
1873
2414
|
}
|
|
1874
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: YearPicker, decorators: [{
|
|
1875
2416
|
type: Component,
|
|
1876
2417
|
args: [{ selector: 'tls-year-picker', imports: [], host: { class: 'tls-year-picker' }, template: "<div class=\"tls-year-picker__header\">\n <button type=\"button\" class=\"tls-year-picker__nav\" (click)=\"prevPage()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M7 1L1 7L7 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n <span class=\"tls-year-picker__range\">{{ rangeLabel() }}</span>\n <button type=\"button\" class=\"tls-year-picker__nav\" (click)=\"nextPage()\">\n <svg viewBox=\"0 0 8 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 1L7 7L1 13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n<div class=\"tls-year-picker__grid\">\n @for (year of years(); track year) {\n <button\n type=\"button\"\n class=\"tls-year-picker__cell\"\n [class.tls-year-picker__cell--selected]=\"isSelectedYear(year)\"\n [class.tls-year-picker__cell--current]=\"isCurrentYear(year)\"\n (click)=\"selectYear(year)\"\n >\n {{ year }}\n </button>\n }\n</div>\n" }]
|
|
1877
2418
|
}], propDecorators: { viewDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewDate", required: true }] }], selectedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedDate", required: true }] }], yearsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "yearsPerPage", required: true }] }], yearSelect: [{ type: i0.Output, args: ["yearSelect"] }], viewDateChange: [{ type: i0.Output, args: ["viewDateChange"] }] } });
|
|
@@ -1880,20 +2421,30 @@ class DateTimePicker extends ValueFormControl {
|
|
|
1880
2421
|
// Injections
|
|
1881
2422
|
config = inject(DATE_TIME_PICKER_CONFIG);
|
|
1882
2423
|
// View children
|
|
1883
|
-
popoverComponent = viewChild('popoverRef',
|
|
2424
|
+
popoverComponent = viewChild('popoverRef', /* @ts-ignore */
|
|
2425
|
+
...(ngDevMode ? [{ debugName: "popoverComponent" }] : /* istanbul ignore next */ []));
|
|
1884
2426
|
// Inputs
|
|
1885
|
-
value = model(null,
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
2427
|
+
value = model(null, /* @ts-ignore */
|
|
2428
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2429
|
+
mode = input(this.config.mode, /* @ts-ignore */
|
|
2430
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
2431
|
+
inline = input(this.config.inline, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2432
|
+
placeholder = input(this.config.placeholder, /* @ts-ignore */
|
|
2433
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2434
|
+
size = input(this.config.size, /* @ts-ignore */
|
|
2435
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2436
|
+
fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2437
|
+
yearsPerPage = input(this.config.yearsPerPage, /* @ts-ignore */
|
|
2438
|
+
...(ngDevMode ? [{ debugName: "yearsPerPage" }] : /* istanbul ignore next */ []));
|
|
2439
|
+
weekStartsOn = input(this.config.weekStartsOn, /* @ts-ignore */
|
|
2440
|
+
...(ngDevMode ? [{ debugName: "weekStartsOn" }] : /* istanbul ignore next */ []));
|
|
2441
|
+
weekDays = input(this.config.weekDays, /* @ts-ignore */
|
|
2442
|
+
...(ngDevMode ? [{ debugName: "weekDays" }] : /* istanbul ignore next */ []));
|
|
1894
2443
|
// State
|
|
1895
|
-
viewDate = signal(new Date(),
|
|
1896
|
-
|
|
2444
|
+
viewDate = signal(new Date(), /* @ts-ignore */
|
|
2445
|
+
...(ngDevMode ? [{ debugName: "viewDate" }] : /* istanbul ignore next */ []));
|
|
2446
|
+
activeView = signal(this.config.mode, /* @ts-ignore */
|
|
2447
|
+
...(ngDevMode ? [{ debugName: "activeView" }] : /* istanbul ignore next */ []));
|
|
1897
2448
|
// Computed
|
|
1898
2449
|
hostClasses = computed(() => {
|
|
1899
2450
|
const classes = ['tls-date-time-picker'];
|
|
@@ -1904,7 +2455,8 @@ class DateTimePicker extends ValueFormControl {
|
|
|
1904
2455
|
return classes.concat(this.controlClasses());
|
|
1905
2456
|
}
|
|
1906
2457
|
return classes;
|
|
1907
|
-
},
|
|
2458
|
+
}, /* @ts-ignore */
|
|
2459
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
1908
2460
|
triggerLabel = computed(() => {
|
|
1909
2461
|
const value = this.value();
|
|
1910
2462
|
if (!value)
|
|
@@ -1919,7 +2471,8 @@ class DateTimePicker extends ValueFormControl {
|
|
|
1919
2471
|
if (mode === 'time-picker')
|
|
1920
2472
|
return format(value, 'HH:mm');
|
|
1921
2473
|
return format(value, 'MMM d, yyyy HH:mm');
|
|
1922
|
-
},
|
|
2474
|
+
}, /* @ts-ignore */
|
|
2475
|
+
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
1923
2476
|
constructor() {
|
|
1924
2477
|
super();
|
|
1925
2478
|
effect(() => {
|
|
@@ -1970,10 +2523,10 @@ class DateTimePicker extends ValueFormControl {
|
|
|
1970
2523
|
return;
|
|
1971
2524
|
this.value.set(date);
|
|
1972
2525
|
}
|
|
1973
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1974
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2526
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DateTimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2527
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: DateTimePicker, isStandalone: true, selector: "tls-date-time-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", 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 }, yearsPerPage: { classPropertyName: "yearsPerPage", publicName: "yearsPerPage", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, weekDays: { classPropertyName: "weekDays", publicName: "weekDays", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => DateTimePicker) }], viewQueries: [{ propertyName: "popoverComponent", first: true, predicate: ["popoverRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #pickerTemplate>\n @switch (activeView()) {\n @case ('calendar') {\n <tls-calendar\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [weekStartsOn]=\"weekStartsOn()\"\n [weekDays]=\"weekDays()\"\n (daySelect)=\"onDaySelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('month-picker')\"\n />\n }\n @case ('month-picker') {\n <tls-month-picker\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n (monthSelect)=\"onMonthSelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('year-picker')\"\n />\n }\n @case ('year-picker') {\n <tls-year-picker\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [yearsPerPage]=\"yearsPerPage()\"\n (yearSelect)=\"onYearSelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n />\n }\n @case ('time-picker') {\n <tls-time-picker\n [value]=\"value()\"\n (timeChange)=\"onTimeChange($event)\"\n />\n }\n @case ('date-time') {\n <tls-calendar\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [weekStartsOn]=\"weekStartsOn()\"\n [weekDays]=\"weekDays()\"\n (daySelect)=\"onDaySelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('month-picker')\"\n />\n <tls-time-picker\n [value]=\"value()\"\n (timeChange)=\"onTimeChange($event)\"\n />\n }\n }\n</ng-template>\n\n@if (inline()) {\n <div\n class=\"tls-date-time-picker__panel\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-date-time-picker__panel--disabled]=\"disabled()\"\n [class.tls-date-time-picker__panel--readonly]=\"readonly()\"\n [class.tls-date-time-picker__panel--invalid]=\"invalid()\"\n >\n <ng-container [ngTemplateOutlet]=\"pickerTemplate\" />\n </div>\n} @else {\n <button\n type=\"button\"\n class=\"tls-date-time-picker__trigger\"\n aria-haspopup=\"dialog\"\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 [attr.aria-expanded]=\"popoverRef.isOpen()\"\n [disabled]=\"disabled()\"\n (click)=\"popoverRef.toggle($event)\"\n (blur)=\"touched.set(true)\"\n >\n <span [class.tls-form-control__placeholder]=\"!value()\">{{ triggerLabel() }}</span>\n </button>\n <tls-popover #popoverRef position=\"bottom-start\">\n <ng-container [ngTemplateOutlet]=\"pickerTemplate\" />\n </tls-popover>\n}\n", dependencies: [{ kind: "component", type: Calendar, selector: "tls-calendar", inputs: ["viewDate", "selectedDate", "weekStartsOn", "weekDays"], outputs: ["daySelect", "viewDateChange", "navigateUp"] }, { kind: "component", type: MonthPicker, selector: "tls-month-picker", inputs: ["viewDate", "selectedDate"], outputs: ["monthSelect", "viewDateChange", "navigateUp"] }, { kind: "component", type: YearPicker, selector: "tls-year-picker", inputs: ["viewDate", "selectedDate", "yearsPerPage"], outputs: ["yearSelect", "viewDateChange"] }, { kind: "component", type: TimePicker, selector: "tls-time-picker", inputs: ["value"], outputs: ["timeChange"] }, { kind: "component", type: Popover, selector: "tls-popover", inputs: ["position", "offset", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1975
2528
|
}
|
|
1976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: DateTimePicker, decorators: [{
|
|
1977
2530
|
type: Component,
|
|
1978
2531
|
args: [{ selector: 'tls-date-time-picker', imports: [Calendar, MonthPicker, YearPicker, TimePicker, Popover, NgTemplateOutlet], host: { '[class]': 'hostClasses()' }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => DateTimePicker) }], template: "<ng-template #pickerTemplate>\n @switch (activeView()) {\n @case ('calendar') {\n <tls-calendar\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [weekStartsOn]=\"weekStartsOn()\"\n [weekDays]=\"weekDays()\"\n (daySelect)=\"onDaySelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('month-picker')\"\n />\n }\n @case ('month-picker') {\n <tls-month-picker\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n (monthSelect)=\"onMonthSelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('year-picker')\"\n />\n }\n @case ('year-picker') {\n <tls-year-picker\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [yearsPerPage]=\"yearsPerPage()\"\n (yearSelect)=\"onYearSelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n />\n }\n @case ('time-picker') {\n <tls-time-picker\n [value]=\"value()\"\n (timeChange)=\"onTimeChange($event)\"\n />\n }\n @case ('date-time') {\n <tls-calendar\n [viewDate]=\"viewDate()\"\n [selectedDate]=\"value()\"\n [weekStartsOn]=\"weekStartsOn()\"\n [weekDays]=\"weekDays()\"\n (daySelect)=\"onDaySelect($event)\"\n (viewDateChange)=\"onViewDateChange($event)\"\n (navigateUp)=\"activeView.set('month-picker')\"\n />\n <tls-time-picker\n [value]=\"value()\"\n (timeChange)=\"onTimeChange($event)\"\n />\n }\n }\n</ng-template>\n\n@if (inline()) {\n <div\n class=\"tls-date-time-picker__panel\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-date-time-picker__panel--disabled]=\"disabled()\"\n [class.tls-date-time-picker__panel--readonly]=\"readonly()\"\n [class.tls-date-time-picker__panel--invalid]=\"invalid()\"\n >\n <ng-container [ngTemplateOutlet]=\"pickerTemplate\" />\n </div>\n} @else {\n <button\n type=\"button\"\n class=\"tls-date-time-picker__trigger\"\n aria-haspopup=\"dialog\"\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 [attr.aria-expanded]=\"popoverRef.isOpen()\"\n [disabled]=\"disabled()\"\n (click)=\"popoverRef.toggle($event)\"\n (blur)=\"touched.set(true)\"\n >\n <span [class.tls-form-control__placeholder]=\"!value()\">{{ triggerLabel() }}</span>\n </button>\n <tls-popover #popoverRef position=\"bottom-start\">\n <ng-container [ngTemplateOutlet]=\"pickerTemplate\" />\n </tls-popover>\n}\n" }]
|
|
1979
2532
|
}], ctorParameters: () => [], propDecorators: { popoverComponent: [{ type: i0.ViewChild, args: ['popoverRef', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], 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 }] }], yearsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "yearsPerPage", required: false }] }], weekStartsOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStartsOn", required: false }] }], weekDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekDays", required: false }] }] } });
|
|
@@ -2002,26 +2555,36 @@ const CHIP_GROUP_CONFIG = new InjectionToken('CHIP_GROUP_CONFIG', {
|
|
|
2002
2555
|
class ChipGroup extends SelectionGroup {
|
|
2003
2556
|
_config = inject(CHIP_GROUP_CONFIG);
|
|
2004
2557
|
CLASS_NAME = 'tls-chip-group';
|
|
2005
|
-
multiple = input(this._config.multiple, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
2006
|
-
unselectable = input(this._config.unselectable, { ...(ngDevMode ? { debugName: "unselectable" } : {}), transform: booleanAttribute });
|
|
2007
|
-
size = input(this._config.size,
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2558
|
+
multiple = input(this._config.multiple, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2559
|
+
unselectable = input(this._config.unselectable, { ...(ngDevMode ? { debugName: "unselectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2560
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2561
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2562
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
2563
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
2564
|
+
checkedColor = input(this._config.checkedColor, /* @ts-ignore */
|
|
2565
|
+
...(ngDevMode ? [{ debugName: "checkedColor" }] : /* istanbul ignore next */ []));
|
|
2566
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
2567
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2568
|
+
checkedVariant = input(this._config.checkedVariant, /* @ts-ignore */
|
|
2569
|
+
...(ngDevMode ? [{ debugName: "checkedVariant" }] : /* istanbul ignore next */ []));
|
|
2570
|
+
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
2571
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
2572
|
+
rounded = input(this._config.rounded, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2573
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2574
|
+
startIconTemplate = contentChild('startIcon', /* @ts-ignore */
|
|
2575
|
+
...(ngDevMode ? [{ debugName: "startIconTemplate" }] : /* istanbul ignore next */ []));
|
|
2576
|
+
endIconTemplate = contentChild('endIcon', /* @ts-ignore */
|
|
2577
|
+
...(ngDevMode ? [{ debugName: "endIconTemplate" }] : /* istanbul ignore next */ []));
|
|
2578
|
+
labelTemplate = contentChild('label', /* @ts-ignore */
|
|
2579
|
+
...(ngDevMode ? [{ debugName: "labelTemplate" }] : /* istanbul ignore next */ []));
|
|
2018
2580
|
classes = computed(() => {
|
|
2019
2581
|
const className = this.CLASS_NAME;
|
|
2020
2582
|
const array = [className, `${className}--${this.orientation()}`];
|
|
2021
2583
|
if (this.fluid())
|
|
2022
2584
|
array.push(`${className}--fluid`);
|
|
2023
2585
|
return array.concat(this.controlClasses());
|
|
2024
|
-
},
|
|
2586
|
+
}, /* @ts-ignore */
|
|
2587
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2025
2588
|
isDisabled(option) {
|
|
2026
2589
|
return this.disabled() || option.disabled;
|
|
2027
2590
|
}
|
|
@@ -2040,10 +2603,10 @@ class ChipGroup extends SelectionGroup {
|
|
|
2040
2603
|
classes.push('tls-chip--disabled');
|
|
2041
2604
|
return classes;
|
|
2042
2605
|
}
|
|
2043
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2044
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2606
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2607
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ChipGroup, isStandalone: true, selector: "tls-chip-group", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, unselectable: { classPropertyName: "unselectable", publicName: "unselectable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, checkedColor: { classPropertyName: "checkedColor", publicName: "checkedColor", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, checkedVariant: { classPropertyName: "checkedVariant", publicName: "checkedVariant", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "labelledBy()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalid() ? 'true' : null" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ChipGroup) }], queries: [{ propertyName: "startIconTemplate", first: true, predicate: ["startIcon"], descendants: true, isSignal: true }, { propertyName: "endIconTemplate", first: true, predicate: ["endIcon"], descendants: true, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: ["label"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (option of normalizedOptions(); track option.value; let index = $index) {\n <tls-chip\n [color]=\"color()\"\n [variant]=\"variant()\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [fluid]=\"fluid()\"\n [class]=\"optionClasses(option)\"\n role=\"checkbox\"\n [attr.aria-checked]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"isDisabled(option)\"\n [tabindex]=\"isDisabled(option) ? -1 : 0\"\n (click)=\"select(option)\"\n (blur)=\"touched.set(true)\"\n (keydown.space)=\"onKeyboardSelect($event, option)\"\n (keydown.enter)=\"onKeyboardSelect($event, option)\"\n >\n @if (startIconTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContext(option, index)\"\n />\n }\n\n @if (labelTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContext(option, index)\"\n />\n } @else {\n {{ option.label }}\n }\n\n @if (endIconTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"optionContext(option, index)\"\n />\n }\n </tls-chip>\n}\n\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Chip, selector: "tls-chip", inputs: ["label", "color", "variant", "size", "rounded", "icon", "fluid"] }] });
|
|
2045
2608
|
}
|
|
2046
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2609
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipGroup, decorators: [{
|
|
2047
2610
|
type: Component,
|
|
2048
2611
|
args: [{ selector: 'tls-chip-group', imports: [NgTemplateOutlet, Chip], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ChipGroup) }], host: {
|
|
2049
2612
|
role: 'group',
|
|
@@ -2068,19 +2631,25 @@ const CHIP_INPUT_CONFIG = new InjectionToken('CHIP_INPUT_CONFIG', {
|
|
|
2068
2631
|
|
|
2069
2632
|
class ChipInput extends ValueFormControl {
|
|
2070
2633
|
_config = inject(CHIP_INPUT_CONFIG);
|
|
2071
|
-
value = model([],
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2634
|
+
value = model([], /* @ts-ignore */
|
|
2635
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2636
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
2637
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2638
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2639
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2640
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2641
|
+
separator = input(this._config.separator, /* @ts-ignore */
|
|
2642
|
+
...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
2643
|
+
inputValue = signal('', /* @ts-ignore */
|
|
2644
|
+
...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
|
|
2077
2645
|
classes = computed(() => {
|
|
2078
2646
|
const className = this.CLASS_NAME;
|
|
2079
2647
|
const array = [className, `${className}--${this.size()}`];
|
|
2080
2648
|
if (this.fluid())
|
|
2081
2649
|
array.push(`${className}--fluid`);
|
|
2082
2650
|
return array.concat(this.controlClasses());
|
|
2083
|
-
},
|
|
2651
|
+
}, /* @ts-ignore */
|
|
2652
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2084
2653
|
onInput(event) {
|
|
2085
2654
|
const target = event.target;
|
|
2086
2655
|
this.inputValue.set(target.value);
|
|
@@ -2109,10 +2678,10 @@ class ChipInput extends ValueFormControl {
|
|
|
2109
2678
|
this.value.update(chips => [...chips, text]);
|
|
2110
2679
|
this.inputValue.set('');
|
|
2111
2680
|
}
|
|
2112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2113
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2682
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ChipInput, isStandalone: true, selector: "tls-chip-input", 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 }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ChipInput) }], usesInheritance: true, ngImport: i0, template: "@for (chip of value(); track $index; let index = $index) {\n <tls-chip size=\"sm\" variant=\"filled\" color=\"primary\" [label]=\"chip\">\n <ng-template #endIcon>\n <button\n type=\"button\"\n class=\"tls-chip-input__remove\"\n [attr.aria-label]=\"'Remove ' + chip\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeChip(index)\"\n >\u00D7</button>\n </ng-template>\n </tls-chip>\n}\n<input\n class=\"tls-chip-input__field\"\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]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"touched.set(true)\"\n/>\n", dependencies: [{ kind: "component", type: Chip, selector: "tls-chip", inputs: ["label", "color", "variant", "size", "rounded", "icon", "fluid"] }] });
|
|
2114
2683
|
}
|
|
2115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ChipInput, decorators: [{
|
|
2116
2685
|
type: Component,
|
|
2117
2686
|
args: [{ selector: 'tls-chip-input', imports: [Chip], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ChipInput) }], host: { '[class]': 'classes()' }, template: "@for (chip of value(); track $index; let index = $index) {\n <tls-chip size=\"sm\" variant=\"filled\" color=\"primary\" [label]=\"chip\">\n <ng-template #endIcon>\n <button\n type=\"button\"\n class=\"tls-chip-input__remove\"\n [attr.aria-label]=\"'Remove ' + chip\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeChip(index)\"\n >\u00D7</button>\n </ng-template>\n </tls-chip>\n}\n<input\n class=\"tls-chip-input__field\"\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]=\"inputValue()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (blur)=\"touched.set(true)\"\n/>\n" }]
|
|
2118
2687
|
}], 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 }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }] } });
|
|
@@ -2131,21 +2700,26 @@ function normalizeAccept(value) {
|
|
|
2131
2700
|
class FileUploader extends ValueFormControl {
|
|
2132
2701
|
_config = inject(FILE_UPLOADER_CONFIG);
|
|
2133
2702
|
CLASS_NAME = 'tls-file-uploader';
|
|
2134
|
-
value = model([],
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2703
|
+
value = model([], /* @ts-ignore */
|
|
2704
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2705
|
+
multiple = input(this._config.multiple, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2706
|
+
accept = input(normalizeAccept(this._config.accept), { ...(ngDevMode ? { debugName: "accept" } : /* istanbul ignore next */ {}), transform: normalizeAccept });
|
|
2707
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2138
2708
|
fileInput = viewChild.required('fileInput');
|
|
2139
|
-
dragState = signal('idle',
|
|
2140
|
-
|
|
2141
|
-
|
|
2709
|
+
dragState = signal('idle', /* @ts-ignore */
|
|
2710
|
+
...(ngDevMode ? [{ debugName: "dragState" }] : /* istanbul ignore next */ []));
|
|
2711
|
+
dropZoneTemplate = contentChild('dropZone', /* @ts-ignore */
|
|
2712
|
+
...(ngDevMode ? [{ debugName: "dropZoneTemplate" }] : /* istanbul ignore next */ []));
|
|
2713
|
+
fileTemplate = contentChild('file', /* @ts-ignore */
|
|
2714
|
+
...(ngDevMode ? [{ debugName: "fileTemplate" }] : /* istanbul ignore next */ []));
|
|
2142
2715
|
classes = computed(() => {
|
|
2143
2716
|
const className = this.CLASS_NAME;
|
|
2144
2717
|
const array = [className];
|
|
2145
2718
|
if (this.fluid())
|
|
2146
2719
|
array.push(`${className}--fluid`);
|
|
2147
2720
|
return array.concat(this.controlClasses());
|
|
2148
|
-
},
|
|
2721
|
+
}, /* @ts-ignore */
|
|
2722
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2149
2723
|
acceptHint = computed(() => {
|
|
2150
2724
|
const accept = this.accept().trim();
|
|
2151
2725
|
if (!accept)
|
|
@@ -2156,7 +2730,8 @@ class FileUploader extends ValueFormControl {
|
|
|
2156
2730
|
.filter(Boolean)
|
|
2157
2731
|
.map(rule => this._formatAcceptRule(rule));
|
|
2158
2732
|
return [...new Set(labels)].join(', ');
|
|
2159
|
-
},
|
|
2733
|
+
}, /* @ts-ignore */
|
|
2734
|
+
...(ngDevMode ? [{ debugName: "acceptHint" }] : /* istanbul ignore next */ []));
|
|
2160
2735
|
openFilePicker() {
|
|
2161
2736
|
if (this.notInteractive())
|
|
2162
2737
|
return;
|
|
@@ -2264,10 +2839,10 @@ class FileUploader extends ValueFormControl {
|
|
|
2264
2839
|
const matches = rules.some(rule => rule.endsWith('/*') ? fileType.startsWith(rule.slice(0, -1)) : fileType === rule);
|
|
2265
2840
|
return !matches;
|
|
2266
2841
|
}
|
|
2267
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2268
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2842
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FileUploader, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2843
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: FileUploader, isStandalone: true, selector: "tls-file-uploader", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileUploader) }], queries: [{ propertyName: "dropZoneTemplate", first: true, predicate: ["dropZone"], descendants: true, isSignal: true }, { propertyName: "fileTemplate", first: true, predicate: ["file"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n #fileInput\n class=\"tls-file-uploader__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n<div\n class=\"tls-file-uploader__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() ?? (multiple() ? 'Upload files' : 'Upload file')\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-uploader__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-uploader__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-uploader__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n>\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-uploader__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-uploader__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n</div>\n@if (value().length) {\n <ul class=\"tls-file-uploader__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-uploader__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-uploader__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-uploader__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2269
2844
|
}
|
|
2270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2845
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FileUploader, decorators: [{
|
|
2271
2846
|
type: Component,
|
|
2272
2847
|
args: [{ selector: 'tls-file-uploader', imports: [NgTemplateOutlet], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => FileUploader) }], host: { '[class]': 'classes()' }, template: "<input\n #fileInput\n class=\"tls-file-uploader__input\"\n type=\"file\"\n [accept]=\"accept()\"\n [multiple]=\"multiple()\"\n [disabled]=\"disabled()\"\n (change)=\"onFilesSelected($event)\"\n/>\n<div\n class=\"tls-file-uploader__drop-zone\"\n role=\"button\"\n [attr.tabindex]=\"notInteractive() ? -1 : 0\"\n [attr.aria-label]=\"ariaLabel() ?? (multiple() ? 'Upload files' : 'Upload file')\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [class.tls-file-uploader__drop-zone--dragging]=\"dragState() === 'valid'\"\n [class.tls-file-uploader__drop-zone--rejected]=\"dragState() === 'invalid'\"\n [class.tls-file-uploader__drop-zone--disabled]=\"notInteractive()\"\n (click)=\"openFilePicker()\"\n (keydown)=\"onDropZoneKeydown($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n>\n @if (dropZoneTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: dragState(), accept: acceptHint() }\"\n />\n } @else {\n <span class=\"tls-file-uploader__label\">\n @if (dragState() === 'invalid') {\n File type not allowed\n } @else {\n Drop files here or <strong>browse</strong>\n }\n </span>\n @if (acceptHint()) {\n <span class=\"tls-file-uploader__hint\">Allowed: {{ acceptHint() }}</span>\n }\n }\n</div>\n@if (value().length) {\n <ul class=\"tls-file-uploader__file-list\">\n @for (file of value(); track file; let fileIndex = $index) {\n <li class=\"tls-file-uploader__file\">\n @if (fileTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ $implicit: file, index: fileIndex, remove: removeFile }\"\n />\n } @else {\n <span class=\"tls-file-uploader__file-name\">{{ file.name }}</span>\n <button\n type=\"button\"\n class=\"tls-file-uploader__file-remove\"\n [attr.aria-label]=\"'Remove ' + file.name\"\n [disabled]=\"notInteractive()\"\n (click)=\"removeFile(fileIndex)\"\n >\u00D7</button>\n }\n </li>\n }\n </ul>\n}\n" }]
|
|
2273
2848
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], dropZoneTemplate: [{ type: i0.ContentChild, args: ['dropZone', { isSignal: true }] }], fileTemplate: [{ type: i0.ContentChild, args: ['file', { isSignal: true }] }] } });
|
|
@@ -2288,27 +2863,32 @@ class Input extends ValueFormControl {
|
|
|
2288
2863
|
_config = inject(INPUT_CONFIG);
|
|
2289
2864
|
supportsLabelFor = true;
|
|
2290
2865
|
// Inputs
|
|
2291
|
-
type = input(this._config.type,
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2866
|
+
type = input(this._config.type, /* @ts-ignore */
|
|
2867
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2868
|
+
value = model('', /* @ts-ignore */
|
|
2869
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2870
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
2871
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2872
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2873
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2874
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2296
2875
|
classes = computed(() => {
|
|
2297
2876
|
const array = [this.CLASS_NAME];
|
|
2298
2877
|
array.push(`${this.CLASS_NAME}--${this.size()}`);
|
|
2299
2878
|
if (this.fluid())
|
|
2300
2879
|
array.push(`${this.CLASS_NAME}--fluid`);
|
|
2301
2880
|
return array.concat(this.controlClasses());
|
|
2302
|
-
},
|
|
2881
|
+
}, /* @ts-ignore */
|
|
2882
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2303
2883
|
// Protected methods
|
|
2304
2884
|
onInput(event) {
|
|
2305
2885
|
const target = event.target;
|
|
2306
2886
|
this.value.set(target.value);
|
|
2307
2887
|
}
|
|
2308
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2309
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
2888
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Input, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2889
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", 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"] });
|
|
2310
2890
|
}
|
|
2311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Input, decorators: [{
|
|
2312
2892
|
type: Component,
|
|
2313
2893
|
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"] }]
|
|
2314
2894
|
}], 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 }] }] } });
|
|
@@ -2316,8 +2896,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
2316
2896
|
class InputDirective {
|
|
2317
2897
|
// Injections
|
|
2318
2898
|
_config = inject(INPUT_CONFIG);
|
|
2319
|
-
size = input(this._config.size,
|
|
2320
|
-
|
|
2899
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2900
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2901
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2321
2902
|
hostClasses = computed(() => {
|
|
2322
2903
|
const className = 'tls-form-control';
|
|
2323
2904
|
const array = [className];
|
|
@@ -2325,11 +2906,12 @@ class InputDirective {
|
|
|
2325
2906
|
if (this.fluid())
|
|
2326
2907
|
array.push(`${className}--fluid`);
|
|
2327
2908
|
return array;
|
|
2328
|
-
},
|
|
2329
|
-
|
|
2330
|
-
static
|
|
2909
|
+
}, /* @ts-ignore */
|
|
2910
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2911
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2912
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: InputDirective, isStandalone: true, selector: "[tlsInput]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0 });
|
|
2331
2913
|
}
|
|
2332
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputDirective, decorators: [{
|
|
2333
2915
|
type: Directive,
|
|
2334
2916
|
args: [{
|
|
2335
2917
|
selector: '[tlsInput]',
|
|
@@ -2356,14 +2938,19 @@ class InputNumber extends ValueFormControl {
|
|
|
2356
2938
|
_config = inject(INPUT_NUMBER_CONFIG);
|
|
2357
2939
|
supportsLabelFor = true;
|
|
2358
2940
|
// Inputs
|
|
2359
|
-
value = model(null,
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2941
|
+
value = model(null, /* @ts-ignore */
|
|
2942
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2943
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
2944
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2945
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2946
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2947
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2948
|
+
min = input(undefined, /* @ts-ignore */
|
|
2949
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
2950
|
+
max = input(undefined, /* @ts-ignore */
|
|
2951
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
2952
|
+
step = input(this._config.step, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2953
|
+
hideArrows = input(this._config.hideArrows, { ...(ngDevMode ? { debugName: "hideArrows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2367
2954
|
// Computed
|
|
2368
2955
|
classes = computed(() => {
|
|
2369
2956
|
const array = [this.CLASS_NAME, 'tls-input-number'];
|
|
@@ -2373,17 +2960,18 @@ class InputNumber extends ValueFormControl {
|
|
|
2373
2960
|
if (this.hideArrows())
|
|
2374
2961
|
array.push('tls-input-number--no-arrows');
|
|
2375
2962
|
return array.concat(this.controlClasses());
|
|
2376
|
-
},
|
|
2963
|
+
}, /* @ts-ignore */
|
|
2964
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
2377
2965
|
// Protected methods
|
|
2378
2966
|
onInput(event) {
|
|
2379
2967
|
const target = event.target;
|
|
2380
2968
|
const parsed = target.valueAsNumber;
|
|
2381
2969
|
this.value.set(isNaN(parsed) ? null : parsed);
|
|
2382
2970
|
}
|
|
2383
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2384
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
2971
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputNumber, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2972
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: InputNumber, isStandalone: true, selector: "tls-input-number", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hideArrows: { classPropertyName: "hideArrows", publicName: "hideArrows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => InputNumber) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"number\"\n [name]=\"name()\"\n [class]=\"classes()\"\n [attr.id]=\"effectiveInputId()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-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"] });
|
|
2385
2973
|
}
|
|
2386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: InputNumber, decorators: [{
|
|
2387
2975
|
type: Component,
|
|
2388
2976
|
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"] }]
|
|
2389
2977
|
}], 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 }] }] } });
|
|
@@ -2401,14 +2989,21 @@ const PASSWORD_CONFIG = new InjectionToken('PASSWORD_CONFIG', {
|
|
|
2401
2989
|
class Password extends ValueFormControl {
|
|
2402
2990
|
_config = inject(PASSWORD_CONFIG);
|
|
2403
2991
|
supportsLabelFor = true;
|
|
2404
|
-
value = model('',
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2992
|
+
value = model('', /* @ts-ignore */
|
|
2993
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2994
|
+
visible = model(false, /* @ts-ignore */
|
|
2995
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
2996
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
2997
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2998
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
2999
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3000
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3001
|
+
showIconTemplate = contentChild('showIcon', /* @ts-ignore */
|
|
3002
|
+
...(ngDevMode ? [{ debugName: "showIconTemplate" }] : /* istanbul ignore next */ []));
|
|
3003
|
+
hideIconTemplate = contentChild('hideIcon', /* @ts-ignore */
|
|
3004
|
+
...(ngDevMode ? [{ debugName: "hideIconTemplate" }] : /* istanbul ignore next */ []));
|
|
3005
|
+
type = computed(() => (this.visible() ? 'text' : 'password'), /* @ts-ignore */
|
|
3006
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2412
3007
|
// Protected methods
|
|
2413
3008
|
onInput(event) {
|
|
2414
3009
|
const target = event.target;
|
|
@@ -2419,10 +3014,10 @@ class Password extends ValueFormControl {
|
|
|
2419
3014
|
return;
|
|
2420
3015
|
this.visible.update(prev => !prev);
|
|
2421
3016
|
}
|
|
2422
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2423
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3017
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3018
|
+
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-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 <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"] }] });
|
|
2424
3019
|
}
|
|
2425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Password, decorators: [{
|
|
2426
3021
|
type: Component,
|
|
2427
3022
|
args: [{ selector: 'tls-password', imports: [FormControlGroup, NgTemplateOutlet], host: {
|
|
2428
3023
|
class: 'tls-password',
|
|
@@ -2450,20 +3045,27 @@ const PIN_INPUT_CONFIG = new InjectionToken('PIN_INPUT_CONFIG', {
|
|
|
2450
3045
|
class PinInput extends ValueFormControl {
|
|
2451
3046
|
_config = inject(PIN_INPUT_CONFIG);
|
|
2452
3047
|
_directionality = inject(Directionality);
|
|
2453
|
-
_inputs = viewChildren('cell',
|
|
3048
|
+
_inputs = viewChildren('cell', /* @ts-ignore */
|
|
3049
|
+
...(ngDevMode ? [{ debugName: "_inputs" }] : /* istanbul ignore next */ []));
|
|
2454
3050
|
// Inputs
|
|
2455
|
-
value = model('',
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
3051
|
+
value = model('', /* @ts-ignore */
|
|
3052
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3053
|
+
length = input(this._config.length, /* @ts-ignore */
|
|
3054
|
+
...(ngDevMode ? [{ debugName: "length" }] : /* istanbul ignore next */ []));
|
|
3055
|
+
type = input(this._config.type, /* @ts-ignore */
|
|
3056
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
3057
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
3058
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2459
3059
|
CLASS_NAME = 'tls-pin-input';
|
|
2460
3060
|
// Computed
|
|
2461
|
-
cells = computed(() => Array.from({ length: this.length() }, (_, index) => index),
|
|
3061
|
+
cells = computed(() => Array.from({ length: this.length() }, (_, index) => index), /* @ts-ignore */
|
|
3062
|
+
...(ngDevMode ? [{ debugName: "cells" }] : /* istanbul ignore next */ []));
|
|
2462
3063
|
hostClasses = computed(() => {
|
|
2463
3064
|
const className = this.CLASS_NAME;
|
|
2464
3065
|
const array = [className];
|
|
2465
3066
|
return array.concat(this.controlClasses());
|
|
2466
|
-
},
|
|
3067
|
+
}, /* @ts-ignore */
|
|
3068
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2467
3069
|
// Protected methods
|
|
2468
3070
|
getCellValue(index) {
|
|
2469
3071
|
return this.value()[index] ?? '';
|
|
@@ -2556,10 +3158,10 @@ class PinInput extends ValueFormControl {
|
|
|
2556
3158
|
_getValueArray() {
|
|
2557
3159
|
return Array.from({ length: this.length() }, (_, i) => this.value()[i] ?? '');
|
|
2558
3160
|
}
|
|
2559
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2560
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3161
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PinInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: PinInput, isStandalone: true, selector: "tls-pin-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "group" }, properties: { "class": "hostClasses()", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "labelledBy()", "attr.aria-invalid": "invalid() ? 'true' : null", "attr.aria-describedby": "describedBy()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => PinInput) }], viewQueries: [{ propertyName: "_inputs", predicate: ["cell"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (cell of cells(); track cell; let index = $index) {\n <input\n #cell\n class=\"tls-pin-input__cell\"\n type=\"text\"\n maxlength=\"2\"\n autocomplete=\"one-time-code\"\n [placeholder]=\"placeholder()\"\n [tabindex]=\"this.value().length === index ? '0' : '-1'\"\n [value]=\"getCellValue(cell)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [attr.inputmode]=\"type() === 'numeric' ? 'numeric' : 'text'\"\n (input)=\"onInput($event, cell)\"\n (keydown)=\"onKeydown($event, cell)\"\n (paste)=\"onPaste($event, cell)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"touched.set(true)\"\n />\n}\n\n" });
|
|
2561
3163
|
}
|
|
2562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PinInput, decorators: [{
|
|
2563
3165
|
type: Component,
|
|
2564
3166
|
args: [{ selector: 'tls-pin-input', imports: [], host: {
|
|
2565
3167
|
role: 'group',
|
|
@@ -2581,27 +3183,32 @@ class RadioButton extends ValueFormControl {
|
|
|
2581
3183
|
_config = inject(RADIO_BUTTON_CONFIG);
|
|
2582
3184
|
CLASS_NAME = 'tls-radio-button';
|
|
2583
3185
|
supportsLabelFor = true;
|
|
2584
|
-
radioValue = input.required(
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
3186
|
+
radioValue = input.required(/* @ts-ignore */
|
|
3187
|
+
...(ngDevMode ? [{ debugName: "radioValue" }] : /* istanbul ignore next */ []));
|
|
3188
|
+
value = model('', /* @ts-ignore */
|
|
3189
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3190
|
+
tabindex = input(0, /* @ts-ignore */
|
|
3191
|
+
...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
3192
|
+
checked = computed(() => this.radioValue() === this.value(), /* @ts-ignore */
|
|
3193
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
2588
3194
|
hostClasses = computed(() => {
|
|
2589
3195
|
const className = this.CLASS_NAME;
|
|
2590
3196
|
const array = [className];
|
|
2591
3197
|
if (this.checked())
|
|
2592
3198
|
array.push(`${className}--checked`);
|
|
2593
3199
|
return array.concat(this.controlClasses());
|
|
2594
|
-
},
|
|
3200
|
+
}, /* @ts-ignore */
|
|
3201
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2595
3202
|
// Protected methods
|
|
2596
3203
|
check() {
|
|
2597
3204
|
if (this.notInteractive())
|
|
2598
3205
|
return;
|
|
2599
3206
|
this.value.set(this.radioValue());
|
|
2600
3207
|
}
|
|
2601
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2602
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3208
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3209
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: RadioButton, isStandalone: true, selector: "tls-radio-button", inputs: { radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()", "tabindex": "-1" } }, usesInheritance: true, ngImport: i0, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [tabindex]=\"tabindex()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n [value]=\"radioValue()\"\n (change)=\"check()\"\n (blur)=\"touched.set(true)\"\n/>\n<div class=\"tls-radio-button-circle\"></div>\n" });
|
|
2603
3210
|
}
|
|
2604
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: RadioButton, decorators: [{
|
|
2605
3212
|
type: Component,
|
|
2606
3213
|
args: [{ selector: 'tls-radio-button', imports: [], host: {
|
|
2607
3214
|
'[class]': 'hostClasses()',
|
|
@@ -2628,14 +3235,20 @@ class MultiSelect extends AbstractSelect {
|
|
|
2628
3235
|
uniqueId = `tls-multi-select-${MultiSelect._nextUniqueId++}`;
|
|
2629
3236
|
hostClassBase = 'tls-multi-select';
|
|
2630
3237
|
panelClass = 'tls-multi-select-panel';
|
|
2631
|
-
value = model([],
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
3238
|
+
value = model([], /* @ts-ignore */
|
|
3239
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3240
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
3241
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
3242
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
3243
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3244
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3245
|
+
clearable = input(this._config.clearable, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3246
|
+
maxLabels = input(this._config.maxLabels, /* @ts-ignore */
|
|
3247
|
+
...(ngDevMode ? [{ debugName: "maxLabels" }] : /* istanbul ignore next */ []));
|
|
3248
|
+
hasValue = computed(() => this.value().length > 0, /* @ts-ignore */
|
|
3249
|
+
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
3250
|
+
selectedValues = computed(() => new Set(this.value()), /* @ts-ignore */
|
|
3251
|
+
...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
|
|
2639
3252
|
triggerLabel = computed(() => {
|
|
2640
3253
|
const selected = this.value();
|
|
2641
3254
|
if (selected.length === 0)
|
|
@@ -2645,7 +3258,8 @@ class MultiSelect extends AbstractSelect {
|
|
|
2645
3258
|
return `${selected.length} selected`;
|
|
2646
3259
|
const optionMap = new Map(this.normalizedOptions().map(option => [option.value, option.label]));
|
|
2647
3260
|
return selected.map(value => optionMap.get(value) ?? String(value)).join(', ');
|
|
2648
|
-
},
|
|
3261
|
+
}, /* @ts-ignore */
|
|
3262
|
+
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
2649
3263
|
isSelected(option) {
|
|
2650
3264
|
return this.selectedValues().has(option.value);
|
|
2651
3265
|
}
|
|
@@ -2673,10 +3287,10 @@ class MultiSelect extends AbstractSelect {
|
|
|
2673
3287
|
commitActiveOption(option) {
|
|
2674
3288
|
this.toggleOption(option);
|
|
2675
3289
|
}
|
|
2676
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2677
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MultiSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3291
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: MultiSelect, isStandalone: true, selector: "tls-multi-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, maxLabels: { classPropertyName: "maxLabels", publicName: "maxLabels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-multi-select__value\" [class.tls-form-control__placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholder() }}\n </span>\n <div class=\"tls-multi-select__icon\" aria-hidden=\"true\">\n <svg class=\"tls-multi-select__chevron\" viewBox=\"0 0 10 6\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1 1L5 5L9 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-multi-select__clear\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n (click)=\"clear()\"\n >\n <svg class=\"tls-multi-select__clear-icon\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1 1L9 9M9 1L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-multi-select__panel\"\n animate.enter=\"tls-multi-select__panel--enter\"\n animate.leave=\"tls-multi-select__panel--leave\"\n role=\"listbox\"\n aria-multiselectable=\"true\"\n [id]=\"listboxId\"\n >\n @for (option of normalizedOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-multi-select__option\"\n [class.tls-multi-select__option--selected]=\"isSelected(option)\"\n [class.tls-multi-select__option--active]=\"index === activeIndex()\"\n [class.tls-multi-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-multi-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"toggleOption(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >\n <span class=\"tls-multi-select__option-label\">{{ option.label }}</span>\n @if (isSelected(option)) {\n <svg class=\"tls-multi-select__option-check\" viewBox=\"0 0 10 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <path d=\"M1 4L3.5 6.5L9 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n }\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" });
|
|
2678
3292
|
}
|
|
2679
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MultiSelect, decorators: [{
|
|
2680
3294
|
type: Component,
|
|
2681
3295
|
args: [{ selector: 'tls-multi-select', host: {
|
|
2682
3296
|
'[class]': 'hostClasses()',
|
|
@@ -2701,15 +3315,19 @@ class Select extends AbstractSelect {
|
|
|
2701
3315
|
uniqueId = `tls-select-${Select._nextUniqueId++}`;
|
|
2702
3316
|
hostClassBase = 'tls-select';
|
|
2703
3317
|
panelClass = 'tls-select-panel';
|
|
2704
|
-
value = model(null,
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
3318
|
+
value = model(null, /* @ts-ignore */
|
|
3319
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3320
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
3321
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
3322
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
3323
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3324
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3325
|
+
clearable = input(this._config.clearable, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2709
3326
|
hasValue = computed(() => {
|
|
2710
3327
|
const value = this.value();
|
|
2711
3328
|
return value !== null && value !== undefined && value !== '';
|
|
2712
|
-
},
|
|
3329
|
+
}, /* @ts-ignore */
|
|
3330
|
+
...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
2713
3331
|
selectedLabel = computed(() => {
|
|
2714
3332
|
if (!this.hasValue())
|
|
2715
3333
|
return '';
|
|
@@ -2717,7 +3335,8 @@ class Select extends AbstractSelect {
|
|
|
2717
3335
|
if (!selected)
|
|
2718
3336
|
return '';
|
|
2719
3337
|
return selected.label;
|
|
2720
|
-
},
|
|
3338
|
+
}, /* @ts-ignore */
|
|
3339
|
+
...(ngDevMode ? [{ debugName: "selectedLabel" }] : /* istanbul ignore next */ []));
|
|
2721
3340
|
select(option) {
|
|
2722
3341
|
if (option.disabled)
|
|
2723
3342
|
return;
|
|
@@ -2733,10 +3352,10 @@ class Select extends AbstractSelect {
|
|
|
2733
3352
|
commitActiveOption(option) {
|
|
2734
3353
|
this.select(option);
|
|
2735
3354
|
}
|
|
2736
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2737
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3355
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Select, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3356
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Select, isStandalone: true, selector: "tls-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], usesInheritance: true, ngImport: i0, template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"effectiveInputId()\"\n [attr.name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"isOpen() ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [tabindex]=\"disabled() ? -1 : tabindex()\"\n [disabled]=\"disabled()\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\"\n (blur)=\"touched.set(true)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"tls-select__value\" [class.tls-form-control__placeholder]=\"!selectedLabel()\">\n {{ selectedLabel() || placeholder() }}\n </span>\n <div class=\"tls-select__icon\" aria-hidden=\"true\">\n <svg class=\"tls-select__chevron\" viewBox=\"0 0 10 6\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1 1L5 5L9 1\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </div>\n</button>\n@if (clearable() && hasValue()) {\n <button\n type=\"button\"\n class=\"tls-select__clear\"\n tabindex=\"-1\"\n aria-label=\"Clear\"\n (click)=\"clear()\"\n >\n <svg class=\"tls-select__clear-icon\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1 1L9 9M9 1L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n<ng-template #panel>\n <ul\n class=\"tls-select__panel\"\n animate.enter=\"tls-select__panel--enter\"\n animate.leave=\"tls-select__panel--leave\"\n role=\"listbox\"\n [id]=\"listboxId\"\n >\n @for (option of normalizedOptions(); track option.value; let index = $index) {\n <li\n class=\"tls-select__option\"\n [class.tls-select__option--selected]=\"option.value === value()\"\n [class.tls-select__option--active]=\"index === activeIndex()\"\n [class.tls-select__option--disabled]=\"option.disabled\"\n >\n <button\n class=\"tls-select__option-button\"\n role=\"option\"\n [id]=\"optionId(index)\"\n [disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.value === value()\"\n [attr.aria-disabled]=\"option.disabled\"\n (click)=\"select(option)\"\n (mouseenter)=\"onOptionHover(index, option.disabled)\"\n >{{ option.label }}\n </button>\n </li>\n }\n </ul>\n</ng-template>\n" });
|
|
2738
3357
|
}
|
|
2739
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Select, decorators: [{
|
|
2740
3359
|
type: Component,
|
|
2741
3360
|
args: [{ selector: 'tls-select', host: {
|
|
2742
3361
|
'[class]': 'hostClasses()',
|
|
@@ -2755,15 +3374,19 @@ class Switch extends CheckboxFormControl {
|
|
|
2755
3374
|
_config = inject(SWITCH_CONFIG);
|
|
2756
3375
|
CLASS_NAME = 'tls-switch';
|
|
2757
3376
|
supportsLabelFor = true;
|
|
2758
|
-
checked = model(false,
|
|
2759
|
-
|
|
2760
|
-
|
|
3377
|
+
checked = model(false, /* @ts-ignore */
|
|
3378
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3379
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
3380
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
3381
|
+
tabindex = input(0, /* @ts-ignore */
|
|
3382
|
+
...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
|
|
2761
3383
|
hostClasses = computed(() => {
|
|
2762
3384
|
const className = this.CLASS_NAME;
|
|
2763
3385
|
const array = [className];
|
|
2764
3386
|
array.push(`${className}--${this.color()}`);
|
|
2765
3387
|
return array.concat(this.controlClasses());
|
|
2766
|
-
},
|
|
3388
|
+
}, /* @ts-ignore */
|
|
3389
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
2767
3390
|
// Protected methods
|
|
2768
3391
|
toggle() {
|
|
2769
3392
|
if (this.notInteractive())
|
|
@@ -2774,10 +3397,10 @@ class Switch extends CheckboxFormControl {
|
|
|
2774
3397
|
event.preventDefault();
|
|
2775
3398
|
this.toggle();
|
|
2776
3399
|
}
|
|
2777
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2778
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3400
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3401
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "role": "switch" }, listeners: { "click": "toggle()", "blur": "touched.set(true)", "keydown.space": "onKeyboardToggle($event)", "keydown.enter": "onKeyboardToggle($event)" }, properties: { "class": "hostClasses()", "tabindex": "disabled() ? -1 : tabindex()", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled()", "attr.aria-readonly": "readonly()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], usesInheritance: true, ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"tls-switch-input\"\n [attr.id]=\"effectiveInputId()\"\n [name]=\"name()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" });
|
|
2779
3402
|
}
|
|
2780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Switch, decorators: [{
|
|
2781
3404
|
type: Component,
|
|
2782
3405
|
args: [{ selector: 'tls-switch', host: {
|
|
2783
3406
|
role: 'switch',
|
|
@@ -2799,6 +3422,9 @@ const DEFAULT_TEXTAREA_CONFIG = {
|
|
|
2799
3422
|
fluid: false,
|
|
2800
3423
|
rows: 3,
|
|
2801
3424
|
resize: 'vertical',
|
|
3425
|
+
autosize: false,
|
|
3426
|
+
// Row cap while autosizing. `0` means unbounded — the textarea grows freely.
|
|
3427
|
+
maxRows: 0,
|
|
2802
3428
|
};
|
|
2803
3429
|
|
|
2804
3430
|
const TEXTAREA_CONFIG = new InjectionToken('TEXTAREA_CONFIG', {
|
|
@@ -2806,33 +3432,47 @@ const TEXTAREA_CONFIG = new InjectionToken('TEXTAREA_CONFIG', {
|
|
|
2806
3432
|
});
|
|
2807
3433
|
|
|
2808
3434
|
class Textarea extends ValueFormControl {
|
|
3435
|
+
// Injections
|
|
2809
3436
|
_config = inject(TEXTAREA_CONFIG);
|
|
2810
3437
|
supportsLabelFor = true;
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
3438
|
+
// Inputs
|
|
3439
|
+
value = model('', /* @ts-ignore */
|
|
3440
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3441
|
+
placeholder = input(this._config.placeholder, /* @ts-ignore */
|
|
3442
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
3443
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
3444
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3445
|
+
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3446
|
+
rows = input(this._config.rows, { ...(ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
3447
|
+
resize = input(this._config.resize, /* @ts-ignore */
|
|
3448
|
+
...(ngDevMode ? [{ debugName: "resize" }] : /* istanbul ignore next */ []));
|
|
3449
|
+
autosize = input(this._config.autosize, { ...(ngDevMode ? { debugName: "autosize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3450
|
+
// Upper bound, in rows, on the autosized height. `0` grows without a cap.
|
|
3451
|
+
maxRows = input(this._config.maxRows, { ...(ngDevMode ? { debugName: "maxRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
3452
|
+
// Computed
|
|
2817
3453
|
classes = computed(() => {
|
|
2818
3454
|
const array = [this.CLASS_NAME];
|
|
2819
3455
|
array.push(`${this.CLASS_NAME}--${this.size()}`);
|
|
2820
3456
|
if (this.fluid())
|
|
2821
3457
|
array.push(`${this.CLASS_NAME}--fluid`);
|
|
2822
3458
|
return array.concat(this.controlClasses());
|
|
2823
|
-
},
|
|
3459
|
+
}, /* @ts-ignore */
|
|
3460
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
3461
|
+
// Autosize owns the height, so the manual resize handle is suppressed.
|
|
3462
|
+
effectiveResize = computed(() => this.autosize() ? 'none' : this.resize(), /* @ts-ignore */
|
|
3463
|
+
...(ngDevMode ? [{ debugName: "effectiveResize" }] : /* istanbul ignore next */ []));
|
|
2824
3464
|
// Protected methods
|
|
2825
3465
|
onInput(event) {
|
|
2826
3466
|
const target = event.target;
|
|
2827
3467
|
this.value.set(target.value);
|
|
2828
3468
|
}
|
|
2829
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2830
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3469
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Textarea, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3470
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", 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 }, autosize: { classPropertyName: "autosize", publicName: "autosize", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", 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]=\"effectiveResize()\"\n [value]=\"value()\"\n [cdkTextareaAutosize]=\"autosize()\"\n [cdkAutosizeMinRows]=\"rows()\"\n [cdkAutosizeMaxRows]=\"maxRows()\"\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"], dependencies: [{ kind: "directive", type: CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }] });
|
|
2831
3471
|
}
|
|
2832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Textarea, decorators: [{
|
|
2833
3473
|
type: Component,
|
|
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]=\"
|
|
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 }] }] } });
|
|
3474
|
+
args: [{ selector: 'tls-textarea', imports: [CdkTextareaAutosize], 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]=\"effectiveResize()\"\n [value]=\"value()\"\n [cdkTextareaAutosize]=\"autosize()\"\n [cdkAutosizeMinRows]=\"rows()\"\n [cdkAutosizeMaxRows]=\"maxRows()\"\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"] }]
|
|
3475
|
+
}], 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 }] }], autosize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autosize", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }] } });
|
|
2836
3476
|
|
|
2837
3477
|
const DEFAULT_TOGGLE_GROUP_CONFIG = {
|
|
2838
3478
|
size: 'md',
|
|
@@ -2853,12 +3493,16 @@ const TOGGLE_GROUP_CONFIG = new InjectionToken('TOGGLE_GROUP_CONFIG', {
|
|
|
2853
3493
|
class ToggleGroup extends SelectionGroup {
|
|
2854
3494
|
_config = inject(TOGGLE_GROUP_CONFIG);
|
|
2855
3495
|
CLASS_NAME = 'tls-toggle-group';
|
|
2856
|
-
multiple = input(this._config.multiple, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
|
|
2857
|
-
unselectable = input(this._config.unselectable, { ...(ngDevMode ? { debugName: "unselectable" } : {}), transform: booleanAttribute });
|
|
2858
|
-
size = input(this._config.size,
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
3496
|
+
multiple = input(this._config.multiple, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3497
|
+
unselectable = input(this._config.unselectable, { ...(ngDevMode ? { debugName: "unselectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3498
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
3499
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3500
|
+
color = input(this._config.color, /* @ts-ignore */
|
|
3501
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
3502
|
+
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
3503
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
3504
|
+
optionTemplate = contentChild('option', /* @ts-ignore */
|
|
3505
|
+
...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
|
|
2862
3506
|
classes = computed(() => {
|
|
2863
3507
|
const className = this.CLASS_NAME;
|
|
2864
3508
|
const array = [
|
|
@@ -2868,11 +3512,12 @@ class ToggleGroup extends SelectionGroup {
|
|
|
2868
3512
|
`${className}--${this.orientation()}`,
|
|
2869
3513
|
];
|
|
2870
3514
|
return array.concat(this.controlClasses());
|
|
2871
|
-
},
|
|
2872
|
-
|
|
2873
|
-
static
|
|
3515
|
+
}, /* @ts-ignore */
|
|
3516
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
3517
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3518
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: ToggleGroup, isStandalone: true, selector: "tls-toggle-group", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, unselectable: { classPropertyName: "unselectable", publicName: "unselectable", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "labelledBy()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalid() ? 'true' : null" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], queries: [{ propertyName: "optionTemplate", first: true, predicate: ["option"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, 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", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2874
3519
|
}
|
|
2875
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3520
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ToggleGroup, decorators: [{
|
|
2876
3521
|
type: Component,
|
|
2877
3522
|
args: [{ selector: 'tls-toggle-group', imports: [NgTemplateOutlet], providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => ToggleGroup) }], host: {
|
|
2878
3523
|
role: 'group',
|
|
@@ -2926,10 +3571,10 @@ class IconService {
|
|
|
2926
3571
|
// Remove import statements in style
|
|
2927
3572
|
.replace(/@import/gi, ''));
|
|
2928
3573
|
}
|
|
2929
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2930
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3574
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3575
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
2931
3576
|
}
|
|
2932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: IconService, decorators: [{
|
|
2933
3578
|
type: Injectable,
|
|
2934
3579
|
args: [{ providedIn: 'root' }]
|
|
2935
3580
|
}] });
|
|
@@ -2947,12 +3592,16 @@ class Icon {
|
|
|
2947
3592
|
_iconService = inject(IconService);
|
|
2948
3593
|
_config = inject(ICON_CONFIG);
|
|
2949
3594
|
// Inputs
|
|
2950
|
-
iconSrc = input.required(
|
|
2951
|
-
|
|
2952
|
-
|
|
3595
|
+
iconSrc = input.required(/* @ts-ignore */
|
|
3596
|
+
...(ngDevMode ? [{ debugName: "iconSrc" }] : /* istanbul ignore next */ []));
|
|
3597
|
+
alt = input('', /* @ts-ignore */
|
|
3598
|
+
...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
3599
|
+
allowedSources = input(this._config.allowedSources, /* @ts-ignore */
|
|
3600
|
+
...(ngDevMode ? [{ debugName: "allowedSources" }] : /* istanbul ignore next */ []));
|
|
2953
3601
|
isSvg = computed(() => {
|
|
2954
3602
|
return this.iconSrc().endsWith('.svg');
|
|
2955
|
-
},
|
|
3603
|
+
}, /* @ts-ignore */
|
|
3604
|
+
...(ngDevMode ? [{ debugName: "isSvg" }] : /* istanbul ignore next */ []));
|
|
2956
3605
|
_svgContentResource = rxResource({
|
|
2957
3606
|
defaultValue: '',
|
|
2958
3607
|
params: () => ({
|
|
@@ -2965,10 +3614,10 @@ class Icon {
|
|
|
2965
3614
|
get svgContent() {
|
|
2966
3615
|
return this._svgContentResource.value.asReadonly();
|
|
2967
3616
|
}
|
|
2968
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2969
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3617
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3618
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Icon, isStandalone: true, selector: "tls-icon", inputs: { iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: true, 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 (isSvg() && 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} @else {\n {{ iconSrc() }}\n}\n" });
|
|
2970
3619
|
}
|
|
2971
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3620
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Icon, decorators: [{
|
|
2972
3621
|
type: Component,
|
|
2973
3622
|
args: [{ selector: 'tls-icon', imports: [], host: { class: 'tls-icon' }, template: "@if (isSvg() && 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} @else {\n {{ iconSrc() }}\n}\n" }]
|
|
2974
3623
|
}], propDecorators: { iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], allowedSources: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedSources", required: false }] }] } });
|
|
@@ -3002,13 +3651,17 @@ const LOADER_CONFIG = new InjectionToken('LOADER_CONFIG', {
|
|
|
3002
3651
|
class Loader {
|
|
3003
3652
|
_config = inject(LOADER_CONFIG);
|
|
3004
3653
|
/** Predefined size token or custom pixel value. */
|
|
3005
|
-
size = input(this._config.size,
|
|
3654
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
3655
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3006
3656
|
/** Stroke width in pixels. Overrides the size-class default for both token and numeric sizes. */
|
|
3007
|
-
width = input(this._config.width,
|
|
3657
|
+
width = input(this._config.width, /* @ts-ignore */
|
|
3658
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
3008
3659
|
/** Divisor for auto stroke width when size is a number and width is null (`size / widthRatio`). */
|
|
3009
|
-
widthRatio = input(this._config.widthRatio,
|
|
3660
|
+
widthRatio = input(this._config.widthRatio, /* @ts-ignore */
|
|
3661
|
+
...(ngDevMode ? [{ debugName: "widthRatio" }] : /* istanbul ignore next */ []));
|
|
3010
3662
|
/** Text announced by screen readers via `aria-label`. */
|
|
3011
|
-
ariaLabel = input(this._config.ariaLabel,
|
|
3663
|
+
ariaLabel = input(this._config.ariaLabel, /* @ts-ignore */
|
|
3664
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3012
3665
|
hostClasses = computed(() => {
|
|
3013
3666
|
const className = 'tls-loader';
|
|
3014
3667
|
const size = this.size();
|
|
@@ -3017,7 +3670,8 @@ class Loader {
|
|
|
3017
3670
|
array.push(`${className}--${size}`);
|
|
3018
3671
|
}
|
|
3019
3672
|
return array;
|
|
3020
|
-
},
|
|
3673
|
+
}, /* @ts-ignore */
|
|
3674
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3021
3675
|
hostStyles = computed(() => {
|
|
3022
3676
|
const size = this.size();
|
|
3023
3677
|
const width = this.width();
|
|
@@ -3035,11 +3689,12 @@ class Loader {
|
|
|
3035
3689
|
styles['--tls-loader-width'] = `${size / this.widthRatio()}px`;
|
|
3036
3690
|
}
|
|
3037
3691
|
return styles;
|
|
3038
|
-
},
|
|
3039
|
-
|
|
3040
|
-
static
|
|
3692
|
+
}, /* @ts-ignore */
|
|
3693
|
+
...(ngDevMode ? [{ debugName: "hostStyles" }] : /* istanbul ignore next */ []));
|
|
3694
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Loader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3695
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Loader, isStandalone: true, selector: "tls-loader", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, widthRatio: { classPropertyName: "widthRatio", publicName: "widthRatio", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status" }, properties: { "class": "hostClasses()", "style": "hostStyles()", "attr.aria-label": "ariaLabel()" } }, ngImport: i0, template: '', isInline: true });
|
|
3041
3696
|
}
|
|
3042
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3697
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Loader, decorators: [{
|
|
3043
3698
|
type: Component,
|
|
3044
3699
|
args: [{
|
|
3045
3700
|
selector: 'tls-loader',
|
|
@@ -3055,12 +3710,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3055
3710
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], widthRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "widthRatio", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
3056
3711
|
|
|
3057
3712
|
class MenuItemComponent {
|
|
3058
|
-
key = input.required(
|
|
3713
|
+
key = input.required(/* @ts-ignore */
|
|
3714
|
+
...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
3059
3715
|
templateRef = viewChild.required('template');
|
|
3060
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3061
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
3716
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3717
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: MenuItemComponent, isStandalone: true, selector: "tls-menu-item", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: true, transformFunction: null } }, host: { styleAttribute: "display: none" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template #template><ng-content /></ng-template>`, isInline: true });
|
|
3062
3718
|
}
|
|
3063
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
3064
3720
|
type: Component,
|
|
3065
3721
|
args: [{
|
|
3066
3722
|
selector: 'tls-menu-item',
|
|
@@ -3083,28 +3739,40 @@ class Menu {
|
|
|
3083
3739
|
_config = inject(MENU_CONFIG);
|
|
3084
3740
|
_overlay = createOverlayManager();
|
|
3085
3741
|
_panelRef = viewChild.required('panel');
|
|
3086
|
-
_customItems = contentChildren(MenuItemComponent,
|
|
3742
|
+
_customItems = contentChildren(MenuItemComponent, /* @ts-ignore */
|
|
3743
|
+
...(ngDevMode ? [{ debugName: "_customItems" }] : /* istanbul ignore next */ []));
|
|
3087
3744
|
customTemplates = computed(() => {
|
|
3088
3745
|
const map = new Map();
|
|
3089
3746
|
for (const item of this._customItems()) {
|
|
3090
3747
|
map.set(item.key(), item.templateRef());
|
|
3091
3748
|
}
|
|
3092
3749
|
return map;
|
|
3093
|
-
},
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3750
|
+
}, /* @ts-ignore */
|
|
3751
|
+
...(ngDevMode ? [{ debugName: "customTemplates" }] : /* istanbul ignore next */ []));
|
|
3752
|
+
itemTemplate = contentChild('itemTemplate', /* @ts-ignore */
|
|
3753
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
3754
|
+
labelTemplate = contentChild('labelTemplate', /* @ts-ignore */
|
|
3755
|
+
...(ngDevMode ? [{ debugName: "labelTemplate" }] : /* istanbul ignore next */ []));
|
|
3756
|
+
dividerTemplate = contentChild('dividerTemplate', /* @ts-ignore */
|
|
3757
|
+
...(ngDevMode ? [{ debugName: "dividerTemplate" }] : /* istanbul ignore next */ []));
|
|
3758
|
+
iconTemplate = contentChild('iconTemplate', /* @ts-ignore */
|
|
3759
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
3098
3760
|
id = `tls-menu-${++Menu._counter}`;
|
|
3099
3761
|
// Inputs
|
|
3100
|
-
items = input([],
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3762
|
+
items = input([], /* @ts-ignore */
|
|
3763
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
3764
|
+
position = input(this._config.position, /* @ts-ignore */
|
|
3765
|
+
...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
3766
|
+
offset = input(this._config.offset, /* @ts-ignore */
|
|
3767
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
3768
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
3769
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3770
|
+
inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3771
|
+
_positions = computed(() => buildOverlayPositions(this.position(), this.offset()), /* @ts-ignore */
|
|
3772
|
+
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
3106
3773
|
// An inline menu is always "open" (rendered in place); otherwise reflect the overlay.
|
|
3107
|
-
isOpen = computed(() => this.inline() || this._overlay.isOpen(),
|
|
3774
|
+
isOpen = computed(() => this.inline() || this._overlay.isOpen(), /* @ts-ignore */
|
|
3775
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
3108
3776
|
constructor() {
|
|
3109
3777
|
if (isDevMode()) {
|
|
3110
3778
|
effect(() => {
|
|
@@ -3156,26 +3824,28 @@ class Menu {
|
|
|
3156
3824
|
item.action?.();
|
|
3157
3825
|
this.close();
|
|
3158
3826
|
}
|
|
3159
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3160
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3827
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Menu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3828
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Menu, isStandalone: true, selector: "tls-menu", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_customItems", predicate: MenuItemComponent, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: ["labelTemplate"], descendants: true, isSignal: true }, { propertyName: "dividerTemplate", first: true, predicate: ["dividerTemplate"], descendants: true, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: ["iconTemplate"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #panel>\n <div\n class=\"tls-menu\"\n animate.enter=\"tls-menu--enter\"\n animate.leave=\"tls-menu--leave\"\n [id]=\"id\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n >\n @for (item of items(); track $index) {\n @switch (item.type) {\n @case ('item') {\n @let actionItem = item;\n @if (itemTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n } @else if (actionItem.link) {\n <a\n role=\"menuitem\"\n class=\"tls-menu__item\"\n [routerLink]=\"actionItem.link\"\n [class.tls-menu__item--disabled]=\"actionItem.disabled ?? false\"\n (click)=\"onItemClick(actionItem)\"\n >\n <ng-container [ngTemplateOutlet]=\"actionItemContent\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n </a>\n } @else {\n <button\n role=\"menuitem\"\n class=\"tls-menu__item\"\n [disabled]=\"actionItem.disabled ?? false\"\n (click)=\"onItemClick(actionItem)\"\n >\n <ng-container [ngTemplateOutlet]=\"actionItemContent\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n </button>\n }\n\n <ng-template #actionItemContent let-actionItem>\n @if (actionItem.icon) {\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: actionItem.icon, data: actionItem }\" />\n } @else {\n <tls-icon class=\"tls-menu__item-icon\" [iconSrc]=\"actionItem.icon\" />\n }\n }\n <span class=\"tls-menu__item-label\">{{ actionItem.label }}</span>\n @if (actionItem.shortcut) {\n <kbd class=\"tls-menu__item-shortcut\">{{ actionItem.shortcut }}</kbd>\n }\n </ng-template>\n }\n @case ('label') {\n @let labelItem = item;\n @if (labelTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: labelItem }\" />\n } @else {\n <span class=\"tls-menu__label\" aria-hidden=\"true\">{{ labelItem.label }}</span>\n }\n }\n @case ('divider') {\n @if (dividerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <hr class=\"tls-menu__divider\" role=\"separator\" aria-hidden=\"true\" />\n }\n }\n @case ('custom') {\n @if (customTemplates().get(item.key); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n }\n }\n }\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panel\" />\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Icon, selector: "tls-icon", inputs: ["iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }] });
|
|
3161
3829
|
}
|
|
3162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Menu, decorators: [{
|
|
3163
3831
|
type: Component,
|
|
3164
3832
|
args: [{ selector: 'tls-menu', imports: [NgTemplateOutlet, Icon, RouterLink], template: "<ng-template #panel>\n <div\n class=\"tls-menu\"\n animate.enter=\"tls-menu--enter\"\n animate.leave=\"tls-menu--leave\"\n [id]=\"id\"\n role=\"menu\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n >\n @for (item of items(); track $index) {\n @switch (item.type) {\n @case ('item') {\n @let actionItem = item;\n @if (itemTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n } @else if (actionItem.link) {\n <a\n role=\"menuitem\"\n class=\"tls-menu__item\"\n [routerLink]=\"actionItem.link\"\n [class.tls-menu__item--disabled]=\"actionItem.disabled ?? false\"\n (click)=\"onItemClick(actionItem)\"\n >\n <ng-container [ngTemplateOutlet]=\"actionItemContent\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n </a>\n } @else {\n <button\n role=\"menuitem\"\n class=\"tls-menu__item\"\n [disabled]=\"actionItem.disabled ?? false\"\n (click)=\"onItemClick(actionItem)\"\n >\n <ng-container [ngTemplateOutlet]=\"actionItemContent\" [ngTemplateOutletContext]=\"{ $implicit: actionItem }\" />\n </button>\n }\n\n <ng-template #actionItemContent let-actionItem>\n @if (actionItem.icon) {\n @if (iconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: actionItem.icon, data: actionItem }\" />\n } @else {\n <tls-icon class=\"tls-menu__item-icon\" [iconSrc]=\"actionItem.icon\" />\n }\n }\n <span class=\"tls-menu__item-label\">{{ actionItem.label }}</span>\n @if (actionItem.shortcut) {\n <kbd class=\"tls-menu__item-shortcut\">{{ actionItem.shortcut }}</kbd>\n }\n </ng-template>\n }\n @case ('label') {\n @let labelItem = item;\n @if (labelTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: labelItem }\" />\n } @else {\n <span class=\"tls-menu__label\" aria-hidden=\"true\">{{ labelItem.label }}</span>\n }\n }\n @case ('divider') {\n @if (dividerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <hr class=\"tls-menu__divider\" role=\"separator\" aria-hidden=\"true\" />\n }\n }\n @case ('custom') {\n @if (customTemplates().get(item.key); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n }\n }\n }\n }\n </div>\n</ng-template>\n\n@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panel\" />\n}\n" }]
|
|
3165
3833
|
}], ctorParameters: () => [], propDecorators: { _panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], _customItems: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MenuItemComponent), { isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: ['itemTemplate', { isSignal: true }] }], labelTemplate: [{ type: i0.ContentChild, args: ['labelTemplate', { isSignal: true }] }], dividerTemplate: [{ type: i0.ContentChild, args: ['dividerTemplate', { isSignal: true }] }], iconTemplate: [{ type: i0.ContentChild, args: ['iconTemplate', { isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], offset: [{ type: i0.Input, args: [{ isSignal: true, alias: "offset", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }] } });
|
|
3166
3834
|
|
|
3167
3835
|
class MenuTriggerDirective {
|
|
3168
|
-
menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : {}), alias: 'tlsMenuTrigger' });
|
|
3169
|
-
isOpen = computed(() => this.menu().isOpen(),
|
|
3170
|
-
|
|
3836
|
+
menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : /* istanbul ignore next */ {}), alias: 'tlsMenuTrigger' });
|
|
3837
|
+
isOpen = computed(() => this.menu().isOpen(), /* @ts-ignore */
|
|
3838
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
3839
|
+
menuId = computed(() => this.menu().id, /* @ts-ignore */
|
|
3840
|
+
...(ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []));
|
|
3171
3841
|
// Protected methods
|
|
3172
3842
|
onClick(event) {
|
|
3173
3843
|
this.menu().toggle(event);
|
|
3174
3844
|
}
|
|
3175
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3176
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
3845
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3846
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: MenuTriggerDirective, isStandalone: true, selector: "[tlsMenuTrigger]", inputs: { menu: { classPropertyName: "menu", publicName: "tlsMenuTrigger", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.aria-haspopup": "\"menu\"", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "menuId()" } }, ngImport: i0 });
|
|
3177
3847
|
}
|
|
3178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: MenuTriggerDirective, decorators: [{
|
|
3179
3849
|
type: Directive,
|
|
3180
3850
|
args: [{
|
|
3181
3851
|
selector: '[tlsMenuTrigger]',
|
|
@@ -3189,17 +3859,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3189
3859
|
}], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsMenuTrigger", required: true }] }] } });
|
|
3190
3860
|
|
|
3191
3861
|
class ContextMenuDirective {
|
|
3192
|
-
menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : {}), alias: 'tlsContextMenu' });
|
|
3862
|
+
menu = input.required({ ...(ngDevMode ? { debugName: "menu" } : /* istanbul ignore next */ {}), alias: 'tlsContextMenu' });
|
|
3193
3863
|
// Protected methods
|
|
3194
3864
|
onContextMenu(event) {
|
|
3195
3865
|
event.preventDefault();
|
|
3196
3866
|
this.menu().close();
|
|
3197
3867
|
this.menu().openAtPoint(event.clientX, event.clientY);
|
|
3198
3868
|
}
|
|
3199
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3200
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
3869
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ContextMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3870
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: ContextMenuDirective, isStandalone: true, selector: "[tlsContextMenu]", inputs: { menu: { classPropertyName: "menu", publicName: "tlsContextMenu", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "contextmenu": "onContextMenu($event)" } }, ngImport: i0 });
|
|
3201
3871
|
}
|
|
3202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ContextMenuDirective, decorators: [{
|
|
3203
3873
|
type: Directive,
|
|
3204
3874
|
args: [{
|
|
3205
3875
|
selector: '[tlsContextMenu]',
|
|
@@ -3209,6 +3879,222 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3209
3879
|
}]
|
|
3210
3880
|
}], propDecorators: { menu: [{ type: i0.Input, args: [{ isSignal: true, alias: "tlsContextMenu", required: true }] }] } });
|
|
3211
3881
|
|
|
3882
|
+
// A single decimal wheel holds ten digits (0-9).
|
|
3883
|
+
const ODOMETER_DIGITS_PER_REPETITION = 10;
|
|
3884
|
+
// The wheel is rendered three times over so a roll always has a full repetition
|
|
3885
|
+
// of slack on either side of the visible digit. This is what lets the column
|
|
3886
|
+
// cross the 9→0 seam by traveling the short way instead of unwinding all the
|
|
3887
|
+
// way back through 8, 7, 6…
|
|
3888
|
+
const ODOMETER_DIGIT_REPETITIONS = 3;
|
|
3889
|
+
// Row offset of the middle repetition. Every roll re-centers here first, so the
|
|
3890
|
+
// travel afterward is at most five rows in either direction and never runs off
|
|
3891
|
+
// the rendered strip.
|
|
3892
|
+
const ODOMETER_CENTER_OFFSET = ODOMETER_DIGITS_PER_REPETITION;
|
|
3893
|
+
// The stacked digits of a column, from top to bottom: 0-9 repeated three times.
|
|
3894
|
+
const ODOMETER_STRIP = Array.from({ length: ODOMETER_DIGIT_REPETITIONS * ODOMETER_DIGITS_PER_REPETITION }, (_unused, index) => index % ODOMETER_DIGITS_PER_REPETITION);
|
|
3895
|
+
// Typographic minus (U+2212) reads better than a hyphen-minus for a numeric display.
|
|
3896
|
+
const ODOMETER_MINUS_SIGN = '−';
|
|
3897
|
+
|
|
3898
|
+
/**
|
|
3899
|
+
* A single rolling digit column of {@link Odometer}. Renders a vertical strip of
|
|
3900
|
+
* digits and translates it so the current value sits in the viewport; a change
|
|
3901
|
+
* animates the translation, so the digit appears to roll through the values
|
|
3902
|
+
* between the old and the new one — always by the shortest path around the
|
|
3903
|
+
* `0-9` wheel.
|
|
3904
|
+
*
|
|
3905
|
+
* Internal to {@link Odometer}; not part of the public component surface.
|
|
3906
|
+
*/
|
|
3907
|
+
class OdometerDigit {
|
|
3908
|
+
// Inputs
|
|
3909
|
+
digit = input.required(/* @ts-ignore */
|
|
3910
|
+
...(ngDevMode ? [{ debugName: "digit" }] : /* istanbul ignore next */ []));
|
|
3911
|
+
duration = input.required(/* @ts-ignore */
|
|
3912
|
+
...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
3913
|
+
// State
|
|
3914
|
+
strip = ODOMETER_STRIP;
|
|
3915
|
+
// Row the strip is translated to. Starts centred on the middle repetition.
|
|
3916
|
+
offset = signal(ODOMETER_CENTER_OFFSET, /* @ts-ignore */
|
|
3917
|
+
...(ngDevMode ? [{ debugName: "offset" }] : /* istanbul ignore next */ []));
|
|
3918
|
+
// Whether the translation transition is armed. Disabled while re-centring so
|
|
3919
|
+
// the invisible jump between repetitions never animates.
|
|
3920
|
+
animating = signal(false, /* @ts-ignore */
|
|
3921
|
+
...(ngDevMode ? [{ debugName: "animating" }] : /* istanbul ignore next */ []));
|
|
3922
|
+
// Digit currently settled in the viewport, tracked to derive the roll direction.
|
|
3923
|
+
_currentDigit = 0;
|
|
3924
|
+
_initialized = false;
|
|
3925
|
+
constructor() {
|
|
3926
|
+
effect(() => {
|
|
3927
|
+
const target = this.digit();
|
|
3928
|
+
untracked(() => this._roll(target));
|
|
3929
|
+
});
|
|
3930
|
+
}
|
|
3931
|
+
// Private methods
|
|
3932
|
+
_roll(target) {
|
|
3933
|
+
// First value paints in place, without a roll.
|
|
3934
|
+
if (!this._initialized) {
|
|
3935
|
+
this._currentDigit = target;
|
|
3936
|
+
this.offset.set(ODOMETER_CENTER_OFFSET + target);
|
|
3937
|
+
this._initialized = true;
|
|
3938
|
+
return;
|
|
3939
|
+
}
|
|
3940
|
+
if (target === this._currentDigit)
|
|
3941
|
+
return;
|
|
3942
|
+
const base = ODOMETER_CENTER_OFFSET + this._currentDigit;
|
|
3943
|
+
const delta = this._shortestDelta(this._currentDigit, target);
|
|
3944
|
+
this._currentDigit = target;
|
|
3945
|
+
// Re-centre onto the middle repetition without motion, then roll the short
|
|
3946
|
+
// way on the next frame. The re-centre keeps the same digit under the
|
|
3947
|
+
// viewport, so the jump is invisible while guaranteeing room to travel.
|
|
3948
|
+
this.animating.set(false);
|
|
3949
|
+
this.offset.set(base);
|
|
3950
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
3951
|
+
this.animating.set(true);
|
|
3952
|
+
this.offset.set(base + delta);
|
|
3953
|
+
}));
|
|
3954
|
+
}
|
|
3955
|
+
// Signed number of rows to travel from `from` to `to` around the `0-9` wheel,
|
|
3956
|
+
// taking the shorter arc (range `[-5, 5]`). Positive rolls up (9→0), negative
|
|
3957
|
+
// rolls down (0→9).
|
|
3958
|
+
_shortestDelta(from, to) {
|
|
3959
|
+
const half = ODOMETER_DIGITS_PER_REPETITION / 2;
|
|
3960
|
+
let delta = (to - from) % ODOMETER_DIGITS_PER_REPETITION;
|
|
3961
|
+
if (delta > half)
|
|
3962
|
+
delta -= ODOMETER_DIGITS_PER_REPETITION;
|
|
3963
|
+
if (delta < -half)
|
|
3964
|
+
delta += ODOMETER_DIGITS_PER_REPETITION;
|
|
3965
|
+
return delta;
|
|
3966
|
+
}
|
|
3967
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OdometerDigit, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3968
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: OdometerDigit, isStandalone: true, selector: "tls-odometer-digit", inputs: { digit: { classPropertyName: "digit", publicName: "digit", isSignal: true, isRequired: true, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.--tls-odometer-duration.ms": "duration()" }, classAttribute: "tls-odometer-digit" }, ngImport: i0, template: `
|
|
3969
|
+
<span
|
|
3970
|
+
class="tls-odometer-digit__strip"
|
|
3971
|
+
[class.tls-odometer-digit__strip--animate]="animating()"
|
|
3972
|
+
[style.--tls-odometer-offset]="offset()"
|
|
3973
|
+
>
|
|
3974
|
+
@for (value of strip; track $index) {
|
|
3975
|
+
<span class="tls-odometer-digit__cell">{{ value }}</span>
|
|
3976
|
+
}
|
|
3977
|
+
</span>
|
|
3978
|
+
`, isInline: true });
|
|
3979
|
+
}
|
|
3980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: OdometerDigit, decorators: [{
|
|
3981
|
+
type: Component,
|
|
3982
|
+
args: [{
|
|
3983
|
+
selector: 'tls-odometer-digit',
|
|
3984
|
+
imports: [],
|
|
3985
|
+
template: `
|
|
3986
|
+
<span
|
|
3987
|
+
class="tls-odometer-digit__strip"
|
|
3988
|
+
[class.tls-odometer-digit__strip--animate]="animating()"
|
|
3989
|
+
[style.--tls-odometer-offset]="offset()"
|
|
3990
|
+
>
|
|
3991
|
+
@for (value of strip; track $index) {
|
|
3992
|
+
<span class="tls-odometer-digit__cell">{{ value }}</span>
|
|
3993
|
+
}
|
|
3994
|
+
</span>
|
|
3995
|
+
`,
|
|
3996
|
+
host: {
|
|
3997
|
+
class: 'tls-odometer-digit',
|
|
3998
|
+
'[style.--tls-odometer-duration.ms]': 'duration()',
|
|
3999
|
+
},
|
|
4000
|
+
}]
|
|
4001
|
+
}], ctorParameters: () => [], propDecorators: { digit: [{ type: i0.Input, args: [{ isSignal: true, alias: "digit", required: true }] }], duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: true }] }] } });
|
|
4002
|
+
|
|
4003
|
+
const DEFAULT_ODOMETER_CONFIG = {
|
|
4004
|
+
duration: 600,
|
|
4005
|
+
minIntegerDigits: 1,
|
|
4006
|
+
fractionDigits: 0,
|
|
4007
|
+
decimalSeparator: '.',
|
|
4008
|
+
};
|
|
4009
|
+
|
|
4010
|
+
const ODOMETER_CONFIG = new InjectionToken('ODOMETER_CONFIG', {
|
|
4011
|
+
factory: () => DEFAULT_ODOMETER_CONFIG,
|
|
4012
|
+
});
|
|
4013
|
+
|
|
4014
|
+
/**
|
|
4015
|
+
* Animated number whose digits roll to the new value, like a mechanical
|
|
4016
|
+
* odometer. Each digit column rolls through the values between the old and the
|
|
4017
|
+
* new one by the shortest path, so counting up or down reads naturally.
|
|
4018
|
+
*
|
|
4019
|
+
* The value scales with the surrounding `font-size`. The roll is a functional
|
|
4020
|
+
* cue on the `essential` motion tier, so it is replaced by an instant swap when
|
|
4021
|
+
* the user has reduced motion.
|
|
4022
|
+
*
|
|
4023
|
+
* @example
|
|
4024
|
+
* <!-- a live score -->
|
|
4025
|
+
* <tls-odometer [value]="score()" />
|
|
4026
|
+
*
|
|
4027
|
+
* @example
|
|
4028
|
+
* <!-- fixed-width counter with two decimals -->
|
|
4029
|
+
* <tls-odometer [value]="balance()" [minIntegerDigits]="4" [fractionDigits]="2" />
|
|
4030
|
+
*/
|
|
4031
|
+
class Odometer {
|
|
4032
|
+
// Injections
|
|
4033
|
+
_config = inject(ODOMETER_CONFIG);
|
|
4034
|
+
// Inputs
|
|
4035
|
+
/** The number to display. Changes roll the affected digit columns. */
|
|
4036
|
+
value = input.required(/* @ts-ignore */
|
|
4037
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4038
|
+
/** Duration of a single-digit roll, in milliseconds. */
|
|
4039
|
+
duration = input(this._config.duration, /* @ts-ignore */
|
|
4040
|
+
...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
4041
|
+
/** Minimum number of integer digits, left-padded with zeros (`007`). */
|
|
4042
|
+
minIntegerDigits = input(this._config.minIntegerDigits, /* @ts-ignore */
|
|
4043
|
+
...(ngDevMode ? [{ debugName: "minIntegerDigits" }] : /* istanbul ignore next */ []));
|
|
4044
|
+
/** Number of fraction digits to display. `0` hides the decimal part. */
|
|
4045
|
+
fractionDigits = input(this._config.fractionDigits, /* @ts-ignore */
|
|
4046
|
+
...(ngDevMode ? [{ debugName: "fractionDigits" }] : /* istanbul ignore next */ []));
|
|
4047
|
+
/** Character rendered between the integer and fraction parts. */
|
|
4048
|
+
decimalSeparator = input(this._config.decimalSeparator, /* @ts-ignore */
|
|
4049
|
+
...(ngDevMode ? [{ debugName: "decimalSeparator" }] : /* istanbul ignore next */ []));
|
|
4050
|
+
/** Overrides the text announced to screen readers (defaults to the formatted value). */
|
|
4051
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
4052
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4053
|
+
// Computed
|
|
4054
|
+
tokens = computed(() => {
|
|
4055
|
+
const value = this.value();
|
|
4056
|
+
const fractionDigits = this.fractionDigits();
|
|
4057
|
+
const minIntegerDigits = this.minIntegerDigits();
|
|
4058
|
+
const isNegative = value < 0;
|
|
4059
|
+
const [integerText, fractionText = ''] = Math.abs(value).toFixed(fractionDigits).split('.');
|
|
4060
|
+
const paddedInteger = integerText.padStart(minIntegerDigits, '0');
|
|
4061
|
+
const tokens = [];
|
|
4062
|
+
if (isNegative)
|
|
4063
|
+
tokens.push({ key: 'sign', digit: null, symbol: ODOMETER_MINUS_SIGN });
|
|
4064
|
+
const integerLength = paddedInteger.length;
|
|
4065
|
+
for (let index = 0; index < integerLength; index++) {
|
|
4066
|
+
// Key by place value counting from the units digit, so a column keeps its
|
|
4067
|
+
// identity when the number gains or loses leading digits.
|
|
4068
|
+
const place = integerLength - index;
|
|
4069
|
+
tokens.push({ key: `integer-${place}`, digit: Number(paddedInteger[index]), symbol: null });
|
|
4070
|
+
}
|
|
4071
|
+
if (fractionDigits > 0) {
|
|
4072
|
+
tokens.push({ key: 'point', digit: null, symbol: this.decimalSeparator() });
|
|
4073
|
+
for (let index = 0; index < fractionText.length; index++) {
|
|
4074
|
+
tokens.push({
|
|
4075
|
+
key: `fraction-${index + 1}`,
|
|
4076
|
+
digit: Number(fractionText[index]),
|
|
4077
|
+
symbol: null,
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
return tokens;
|
|
4082
|
+
}, /* @ts-ignore */
|
|
4083
|
+
...(ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []));
|
|
4084
|
+
formattedValue = computed(() => this.tokens()
|
|
4085
|
+
.map(token => (token.digit === null ? token.symbol : String(token.digit)))
|
|
4086
|
+
.join(''), /* @ts-ignore */
|
|
4087
|
+
...(ngDevMode ? [{ debugName: "formattedValue" }] : /* istanbul ignore next */ []));
|
|
4088
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Odometer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4089
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Odometer, isStandalone: true, selector: "tls-odometer", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, minIntegerDigits: { classPropertyName: "minIntegerDigits", publicName: "minIntegerDigits", isSignal: true, isRequired: false, transformFunction: null }, fractionDigits: { classPropertyName: "fractionDigits", publicName: "fractionDigits", isSignal: true, isRequired: false, transformFunction: null }, decimalSeparator: { classPropertyName: "decimalSeparator", publicName: "decimalSeparator", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "tls-odometer" }, ngImport: i0, template: "<span class=\"tls-odometer__value\">{{ ariaLabel() ?? formattedValue() }}</span>\n\n<span class=\"tls-odometer__row\" aria-hidden=\"true\">\n @for (token of tokens(); track token.key) {\n @if (token.digit === null) {\n <span class=\"tls-odometer__symbol\">{{ token.symbol }}</span>\n } @else {\n <tls-odometer-digit class=\"tls-odometer__digit\" [digit]=\"token.digit\" [duration]=\"duration()\" />\n }\n }\n</span>\n", dependencies: [{ kind: "component", type: OdometerDigit, selector: "tls-odometer-digit", inputs: ["digit", "duration"] }] });
|
|
4090
|
+
}
|
|
4091
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Odometer, decorators: [{
|
|
4092
|
+
type: Component,
|
|
4093
|
+
args: [{ selector: 'tls-odometer', imports: [OdometerDigit], host: {
|
|
4094
|
+
class: 'tls-odometer',
|
|
4095
|
+
}, template: "<span class=\"tls-odometer__value\">{{ ariaLabel() ?? formattedValue() }}</span>\n\n<span class=\"tls-odometer__row\" aria-hidden=\"true\">\n @for (token of tokens(); track token.key) {\n @if (token.digit === null) {\n <span class=\"tls-odometer__symbol\">{{ token.symbol }}</span>\n } @else {\n <tls-odometer-digit class=\"tls-odometer__digit\" [digit]=\"token.digit\" [duration]=\"duration()\" />\n }\n }\n</span>\n" }]
|
|
4096
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: false }] }], minIntegerDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minIntegerDigits", required: false }] }], fractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "fractionDigits", required: false }] }], decimalSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimalSeparator", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
4097
|
+
|
|
3212
4098
|
const DEFAULT_PAGINATION_CONFIG = {
|
|
3213
4099
|
size: 'md',
|
|
3214
4100
|
pageSize: 10,
|
|
@@ -3224,20 +4110,31 @@ const PAGINATION_CONFIG = new InjectionToken('PAGINATION_CONFIG', {
|
|
|
3224
4110
|
|
|
3225
4111
|
class Pagination {
|
|
3226
4112
|
_config = inject(PAGINATION_CONFIG);
|
|
3227
|
-
value = model(1,
|
|
4113
|
+
value = model(1, /* @ts-ignore */
|
|
4114
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3228
4115
|
/** Accessible name for the pagination navigation landmark. */
|
|
3229
|
-
ariaLabel = input('Pagination',
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
4116
|
+
ariaLabel = input('Pagination', /* @ts-ignore */
|
|
4117
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4118
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
4119
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
4120
|
+
pageSize = input(this._config.pageSize, /* @ts-ignore */
|
|
4121
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
4122
|
+
total = input(0, /* @ts-ignore */
|
|
4123
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
4124
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
4125
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4126
|
+
boundaries = input(this._config.boundaries, /* @ts-ignore */
|
|
4127
|
+
...(ngDevMode ? [{ debugName: "boundaries" }] : /* istanbul ignore next */ []));
|
|
4128
|
+
siblings = input(this._config.siblings, /* @ts-ignore */
|
|
4129
|
+
...(ngDevMode ? [{ debugName: "siblings" }] : /* istanbul ignore next */ []));
|
|
4130
|
+
showFirstButton = input(this._config.showFirstButton, { ...(ngDevMode ? { debugName: "showFirstButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4131
|
+
showLastButton = input(this._config.showLastButton, { ...(ngDevMode ? { debugName: "showLastButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4132
|
+
pageCount = computed(() => Math.ceil(this.total() / this.pageSize()), /* @ts-ignore */
|
|
4133
|
+
...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
|
|
4134
|
+
visiblePages = computed(() => this._buildPages(this.pageCount(), this.value(), this.siblings(), this.boundaries()), /* @ts-ignore */
|
|
4135
|
+
...(ngDevMode ? [{ debugName: "visiblePages" }] : /* istanbul ignore next */ []));
|
|
4136
|
+
classes = computed(() => ['tls-pagination', `tls-pagination--${this.size()}`], /* @ts-ignore */
|
|
4137
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
3241
4138
|
// Protected methods
|
|
3242
4139
|
setPage(page) {
|
|
3243
4140
|
this.value.set(page);
|
|
@@ -3289,10 +4186,10 @@ class Pagination {
|
|
|
3289
4186
|
...endPages,
|
|
3290
4187
|
];
|
|
3291
4188
|
}
|
|
3292
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3293
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Pagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Pagination, isStandalone: true, selector: "tls-pagination", inputs: { value: { classPropertyName: "value", publicName: "value", 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 }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, boundaries: { classPropertyName: "boundaries", publicName: "boundaries", isSignal: true, isRequired: false, transformFunction: null }, siblings: { classPropertyName: "siblings", publicName: "siblings", isSignal: true, isRequired: false, transformFunction: null }, showFirstButton: { classPropertyName: "showFirstButton", publicName: "showFirstButton", isSignal: true, isRequired: false, transformFunction: null }, showLastButton: { classPropertyName: "showLastButton", publicName: "showLastButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "navigation" }, properties: { "class": "classes()", "attr.aria-label": "ariaLabelledby() ? null : ariaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null" } }, ngImport: i0, 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" });
|
|
3294
4191
|
}
|
|
3295
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Pagination, decorators: [{
|
|
3296
4193
|
type: Component,
|
|
3297
4194
|
args: [{ selector: 'tls-pagination', host: {
|
|
3298
4195
|
role: 'navigation',
|
|
@@ -3312,7 +4209,8 @@ class PaginationQuerySyncDirective extends QuerySyncDirective {
|
|
|
3312
4209
|
_pagination = inject(Pagination);
|
|
3313
4210
|
_config = inject(PAGINATION_QUERY_SYNC_CONFIG);
|
|
3314
4211
|
// Inputs
|
|
3315
|
-
tlsPaginationQuerySync = input(this._config.paramKey,
|
|
4212
|
+
tlsPaginationQuerySync = input(this._config.paramKey, /* @ts-ignore */
|
|
4213
|
+
...(ngDevMode ? [{ debugName: "tlsPaginationQuerySync" }] : /* istanbul ignore next */ []));
|
|
3316
4214
|
constructor() {
|
|
3317
4215
|
super();
|
|
3318
4216
|
effect(() => {
|
|
@@ -3330,10 +4228,10 @@ class PaginationQuerySyncDirective extends QuerySyncDirective {
|
|
|
3330
4228
|
if (!Number.isNaN(page) && page >= 1)
|
|
3331
4229
|
this._pagination.value.set(page);
|
|
3332
4230
|
}
|
|
3333
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3334
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
4231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PaginationQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4232
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", 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
4233
|
}
|
|
3336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: PaginationQuerySyncDirective, decorators: [{
|
|
3337
4235
|
type: Directive,
|
|
3338
4236
|
args: [{
|
|
3339
4237
|
selector: 'tls-pagination[tlsPaginationQuerySync]',
|
|
@@ -3356,13 +4254,18 @@ const SKELETON_CONFIG = new InjectionToken('SKELETON_CONFIG', {
|
|
|
3356
4254
|
|
|
3357
4255
|
class Skeleton {
|
|
3358
4256
|
_config = inject(SKELETON_CONFIG);
|
|
3359
|
-
size = input(this._config.size,
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
4257
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
4258
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4259
|
+
width = input(this._config.width, /* @ts-ignore */
|
|
4260
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
4261
|
+
height = input(this._config.height, /* @ts-ignore */
|
|
4262
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
4263
|
+
radius = input(this._config.radius, /* @ts-ignore */
|
|
4264
|
+
...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
4265
|
+
duration = input(this._config.duration, /* @ts-ignore */
|
|
4266
|
+
...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
4267
|
+
rounded = input(this._config.rounded, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4268
|
+
animate = input(this._config.animate, { ...(ngDevMode ? { debugName: "animate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3366
4269
|
hostClasses = computed(() => {
|
|
3367
4270
|
const className = 'tls-skeleton';
|
|
3368
4271
|
const array = [className];
|
|
@@ -3370,7 +4273,8 @@ class Skeleton {
|
|
|
3370
4273
|
array.push(`${className}--no-animate`);
|
|
3371
4274
|
}
|
|
3372
4275
|
return array;
|
|
3373
|
-
},
|
|
4276
|
+
}, /* @ts-ignore */
|
|
4277
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3374
4278
|
hostStyles = computed(() => {
|
|
3375
4279
|
const size = this.size();
|
|
3376
4280
|
const width = this.width() ?? size;
|
|
@@ -3383,7 +4287,8 @@ class Skeleton {
|
|
|
3383
4287
|
'--tls-skeleton-radius': rounded ? '50%' : `${radius}px`,
|
|
3384
4288
|
'--tls-skeleton-duration': `${this.duration()}ms`,
|
|
3385
4289
|
};
|
|
3386
|
-
},
|
|
4290
|
+
}, /* @ts-ignore */
|
|
4291
|
+
...(ngDevMode ? [{ debugName: "hostStyles" }] : /* istanbul ignore next */ []));
|
|
3387
4292
|
resolveDimension(value) {
|
|
3388
4293
|
if (value === null)
|
|
3389
4294
|
return '100%';
|
|
@@ -3391,10 +4296,10 @@ class Skeleton {
|
|
|
3391
4296
|
return value;
|
|
3392
4297
|
return `${value}px`;
|
|
3393
4298
|
}
|
|
3394
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3395
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
4299
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Skeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4300
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Skeleton, isStandalone: true, selector: "tls-skeleton", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class": "hostClasses()", "style": "hostStyles()" } }, ngImport: i0, template: '', isInline: true });
|
|
3396
4301
|
}
|
|
3397
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Skeleton, decorators: [{
|
|
3398
4303
|
type: Component,
|
|
3399
4304
|
args: [{
|
|
3400
4305
|
selector: 'tls-skeleton',
|
|
@@ -3410,10 +4315,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3410
4315
|
|
|
3411
4316
|
class StepperService {
|
|
3412
4317
|
active = null;
|
|
3413
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3414
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: StepperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4319
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: StepperService });
|
|
3415
4320
|
}
|
|
3416
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: StepperService, decorators: [{
|
|
3417
4322
|
type: Injectable
|
|
3418
4323
|
}] });
|
|
3419
4324
|
|
|
@@ -3433,15 +4338,23 @@ const STEPPER_CONFIG = new InjectionToken('STEPPER_CONFIG', {
|
|
|
3433
4338
|
class Step {
|
|
3434
4339
|
_config = inject(STEPPER_CONFIG);
|
|
3435
4340
|
_stepperService = inject(StepperService);
|
|
3436
|
-
iconTemplateRef = contentChild('stepIcon',
|
|
3437
|
-
|
|
4341
|
+
iconTemplateRef = contentChild('stepIcon', /* @ts-ignore */
|
|
4342
|
+
...(ngDevMode ? [{ debugName: "iconTemplateRef" }] : /* istanbul ignore next */ []));
|
|
4343
|
+
completedIconTemplateRef = contentChild('stepCompletedIcon', /* @ts-ignore */
|
|
4344
|
+
...(ngDevMode ? [{ debugName: "completedIconTemplateRef" }] : /* istanbul ignore next */ []));
|
|
3438
4345
|
// Inputs
|
|
3439
|
-
value = input.required(
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
4346
|
+
value = input.required(/* @ts-ignore */
|
|
4347
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4348
|
+
label = input(/* @ts-ignore */
|
|
4349
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4350
|
+
description = input(/* @ts-ignore */
|
|
4351
|
+
...(ngDevMode ? [undefined, { debugName: "description" }] : /* istanbul ignore next */ []));
|
|
4352
|
+
color = input(this._config.step.color, /* @ts-ignore */
|
|
4353
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4354
|
+
disabled = input(false, /* @ts-ignore */
|
|
4355
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4356
|
+
_active = computed(() => this._stepperService.active?.() === this.value(), /* @ts-ignore */
|
|
4357
|
+
...(ngDevMode ? [{ debugName: "_active" }] : /* istanbul ignore next */ []));
|
|
3445
4358
|
hostClasses = computed(() => {
|
|
3446
4359
|
const className = 'tls-step';
|
|
3447
4360
|
const array = [className];
|
|
@@ -3450,11 +4363,12 @@ class Step {
|
|
|
3450
4363
|
if (this.disabled())
|
|
3451
4364
|
array.push(`${className}--disabled`);
|
|
3452
4365
|
return array;
|
|
3453
|
-
},
|
|
3454
|
-
|
|
3455
|
-
static
|
|
4366
|
+
}, /* @ts-ignore */
|
|
4367
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
4368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Step, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: Step, isStandalone: true, selector: "tls-step", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "iconTemplateRef", first: true, predicate: ["stepIcon"], descendants: true, isSignal: true }, { propertyName: "completedIconTemplateRef", first: true, predicate: ["stepCompletedIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
3456
4370
|
}
|
|
3457
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Step, decorators: [{
|
|
3458
4372
|
type: Component,
|
|
3459
4373
|
args: [{ selector: 'tls-step', imports: [], host: {
|
|
3460
4374
|
'[class]': 'hostClasses()',
|
|
@@ -3467,17 +4381,27 @@ class Stepper {
|
|
|
3467
4381
|
_config = inject(STEPPER_CONFIG);
|
|
3468
4382
|
_stepperService = inject(StepperService);
|
|
3469
4383
|
_directionality = inject(Directionality);
|
|
3470
|
-
steps = contentChildren(Step,
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
4384
|
+
steps = contentChildren(Step, /* @ts-ignore */
|
|
4385
|
+
...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
|
|
4386
|
+
completedTemplateRef = contentChild('completedTemplate', /* @ts-ignore */
|
|
4387
|
+
...(ngDevMode ? [{ debugName: "completedTemplateRef" }] : /* istanbul ignore next */ []));
|
|
4388
|
+
completedIconTemplateRef = contentChild('stepCompletedIcon', /* @ts-ignore */
|
|
4389
|
+
...(ngDevMode ? [{ debugName: "completedIconTemplateRef" }] : /* istanbul ignore next */ []));
|
|
4390
|
+
_stepButtons = viewChildren('stepButton', /* @ts-ignore */
|
|
4391
|
+
...(ngDevMode ? [{ debugName: "_stepButtons" }] : /* istanbul ignore next */ []));
|
|
4392
|
+
active = model.required(/* @ts-ignore */
|
|
4393
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
4394
|
+
orientation = input(this._config.orientation, /* @ts-ignore */
|
|
4395
|
+
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
4396
|
+
completed = input(false, /* @ts-ignore */
|
|
4397
|
+
...(ngDevMode ? [{ debugName: "completed" }] : /* istanbul ignore next */ []));
|
|
4398
|
+
linear = input(this._config.linear, /* @ts-ignore */
|
|
4399
|
+
...(ngDevMode ? [{ debugName: "linear" }] : /* istanbul ignore next */ []));
|
|
3478
4400
|
/** Accessible name for the stepper tablist. */
|
|
3479
|
-
ariaLabel = input(undefined,
|
|
3480
|
-
|
|
4401
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
4402
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4403
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
4404
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
3481
4405
|
stepSelect = output();
|
|
3482
4406
|
hostClasses = computed(() => {
|
|
3483
4407
|
const className = 'tls-stepper';
|
|
@@ -3486,8 +4410,10 @@ class Stepper {
|
|
|
3486
4410
|
if (this.completed())
|
|
3487
4411
|
array.push(`${className}--completed`);
|
|
3488
4412
|
return array;
|
|
3489
|
-
},
|
|
3490
|
-
|
|
4413
|
+
}, /* @ts-ignore */
|
|
4414
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
4415
|
+
activeIndex = computed(() => this.steps().findIndex(step => step.value() === this.active()), /* @ts-ignore */
|
|
4416
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
3491
4417
|
constructor() {
|
|
3492
4418
|
this._stepperService.active = this.active.asReadonly();
|
|
3493
4419
|
}
|
|
@@ -3544,10 +4470,10 @@ class Stepper {
|
|
|
3544
4470
|
}
|
|
3545
4471
|
return null;
|
|
3546
4472
|
}
|
|
3547
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3548
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4473
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Stepper, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4474
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Stepper, isStandalone: true, selector: "tls-stepper", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: true, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, completed: { classPropertyName: "completed", publicName: "completed", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange", stepSelect: "stepSelect" }, host: { properties: { "class": "hostClasses()" } }, providers: [StepperService], queries: [{ propertyName: "steps", predicate: Step, isSignal: true }, { propertyName: "completedTemplateRef", first: true, predicate: ["completedTemplate"], descendants: true, isSignal: true }, { propertyName: "completedIconTemplateRef", first: true, predicate: ["stepCompletedIcon"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_stepButtons", predicate: ["stepButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<ul\n class=\"tls-stepper-header\"\n role=\"tablist\"\n [attr.aria-orientation]=\"orientation()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (step of steps(); track step.value(); let index = $index; let last = $last) {\n <li role=\"presentation\"\n class=\"tls-stepper-header__item\"\n [class]=\"`tls-stepper-header--${step.color()}`\"\n [class.tls-stepper-header__item--active]=\"step.value() === active()\"\n [class.tls-stepper-header__item--disabled]=\"step.disabled()\"\n [class.tls-stepper-header__item--unreachable]=\"linear() && index > activeIndex() + 1\"\n [class.tls-stepper-header__item--completed]=\"activeIndex() > index || completed()\">\n @let id = 'tls-stepper-tab-' + step.value();\n <button\n #stepButton\n class=\"tls-stepper-header-button\"\n role=\"tab\"\n type=\"button\"\n [attr.aria-controls]=\"panelId\"\n [id]=\"id\"\n [tabindex]=\"step.value() === active() ? 0 : -1\"\n [disabled]=\"step.disabled()\"\n [attr.aria-selected]=\"step.value() === active()\"\n (click)=\"onSelect(step, index)\"\n (keydown)=\"onKeydown($event, index)\"\n >\n <span class=\"tls-stepper-header-button__index\">\n @let isCompleted = activeIndex() > index || completed();\n @if (isCompleted && step.completedIconTemplateRef()) {\n <ng-container [ngTemplateOutlet]=\"step.completedIconTemplateRef() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: index }\"></ng-container>\n } @else if (isCompleted && completedIconTemplateRef()) {\n <ng-container [ngTemplateOutlet]=\"completedIconTemplateRef() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: index }\"></ng-container>\n } @else if (step.iconTemplateRef()) {\n <ng-container [ngTemplateOutlet]=\"step.iconTemplateRef() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: index }\"></ng-container>\n } @else {\n {{ index + 1 }}\n }\n </span>\n\n <span class=\"tls-stepper-header-button__text\">\n @if (step.label()) {\n <span class=\"tls-stepper-header-button__label\">{{ step.label() }}</span>\n }\n @if (step.description()) {\n <span class=\"tls-stepper-header-button__description\">{{ step.description() }}</span>\n }\n </span>\n </button>\n @if (!last) {\n <div class=\"tls-stepper-header__divider\"></div>\n }\n </li>\n }\n</ul>\n<div class=\"tls-stepper-content\"\n [id]=\"panelId\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"'tls-stepper-tab-' + active()\">\n <ng-content></ng-content>\n @if (completed() && completedTemplateRef()) {\n <div class=\"tls-stepper-content__template\">\n <ng-container [ngTemplateOutlet]=\"completedTemplateRef()\"></ng-container>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3549
4475
|
}
|
|
3550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Stepper, decorators: [{
|
|
3551
4477
|
type: Component,
|
|
3552
4478
|
args: [{ selector: 'tls-stepper', imports: [NgTemplateOutlet], host: {
|
|
3553
4479
|
'[class]': 'hostClasses()',
|
|
@@ -3555,16 +4481,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3555
4481
|
}], ctorParameters: () => [], propDecorators: { steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => Step), { isSignal: true }] }], completedTemplateRef: [{ type: i0.ContentChild, args: ['completedTemplate', { isSignal: true }] }], completedIconTemplateRef: [{ type: i0.ContentChild, args: ['stepCompletedIcon', { isSignal: true }] }], _stepButtons: [{ type: i0.ViewChildren, args: ['stepButton', { isSignal: true }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: true }] }, { type: i0.Output, args: ["activeChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], completed: [{ type: i0.Input, args: [{ isSignal: true, alias: "completed", required: false }] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], stepSelect: [{ type: i0.Output, args: ["stepSelect"] }] } });
|
|
3556
4482
|
|
|
3557
4483
|
class TableColumn {
|
|
3558
|
-
key = input.required(
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
4484
|
+
key = input.required(/* @ts-ignore */
|
|
4485
|
+
...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
4486
|
+
header = input(/* @ts-ignore */
|
|
4487
|
+
...(ngDevMode ? [undefined, { debugName: "header" }] : /* istanbul ignore next */ []));
|
|
4488
|
+
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4489
|
+
alignment = input(/* @ts-ignore */
|
|
4490
|
+
...(ngDevMode ? [undefined, { debugName: "alignment" }] : /* istanbul ignore next */ []));
|
|
4491
|
+
width = input(/* @ts-ignore */
|
|
4492
|
+
...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
|
|
4493
|
+
template = contentChild(TemplateRef, /* @ts-ignore */
|
|
4494
|
+
...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
4495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TableColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4496
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: TableColumn, isStandalone: true, selector: "tls-table-column", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: true, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true });
|
|
3566
4497
|
}
|
|
3567
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TableColumn, decorators: [{
|
|
3568
4499
|
type: Component,
|
|
3569
4500
|
args: [{
|
|
3570
4501
|
selector: 'tls-table-column',
|
|
@@ -3584,15 +4515,21 @@ const TABLE_CONFIG = new InjectionToken('TABLE_CONFIG', {
|
|
|
3584
4515
|
|
|
3585
4516
|
class Table {
|
|
3586
4517
|
_config = inject(TABLE_CONFIG);
|
|
3587
|
-
data = input.required(
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
4518
|
+
data = input.required(/* @ts-ignore */
|
|
4519
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
4520
|
+
columnDefinitions = input([], /* @ts-ignore */
|
|
4521
|
+
...(ngDevMode ? [{ debugName: "columnDefinitions" }] : /* istanbul ignore next */ []));
|
|
4522
|
+
hideHeader = input(this._config.hideHeader, { ...(ngDevMode ? { debugName: "hideHeader" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4523
|
+
striped = input(this._config.striped, { ...(ngDevMode ? { debugName: "striped" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4524
|
+
trackBy = input(/* @ts-ignore */
|
|
4525
|
+
...(ngDevMode ? [undefined, { debugName: "trackBy" }] : /* istanbul ignore next */ []));
|
|
3592
4526
|
/** Accessible name for the table, forwarded to the inner `<table>` element. */
|
|
3593
|
-
ariaLabel = input(undefined,
|
|
3594
|
-
|
|
3595
|
-
|
|
4527
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
4528
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4529
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
4530
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
4531
|
+
tableColumns = contentChildren(TableColumn, /* @ts-ignore */
|
|
4532
|
+
...(ngDevMode ? [{ debugName: "tableColumns" }] : /* istanbul ignore next */ []));
|
|
3596
4533
|
// Merges columnDefinitions input and tls-table-column content children into a single list.
|
|
3597
4534
|
// Input drives order; content children override matching keys and append unmatched columns at the end.
|
|
3598
4535
|
// Map keyed by content column key → O(1) lookup when applying overrides to each input column.
|
|
@@ -3613,12 +4550,14 @@ class Table {
|
|
|
3613
4550
|
}));
|
|
3614
4551
|
const extras = fromContent.filter(definition => !inputKeys.has(definition.key));
|
|
3615
4552
|
return [...merged, ...extras];
|
|
3616
|
-
},
|
|
4553
|
+
}, /* @ts-ignore */
|
|
4554
|
+
...(ngDevMode ? [{ debugName: "effectiveColumnDefinitions" }] : /* istanbul ignore next */ []));
|
|
3617
4555
|
columns = computed(() => this.effectiveColumnDefinitions().reduce((filtered, columnDefinition) => {
|
|
3618
4556
|
if (!columnDefinition.hidden)
|
|
3619
4557
|
filtered.push(columnDefinition.key);
|
|
3620
4558
|
return filtered;
|
|
3621
|
-
}, []),
|
|
4559
|
+
}, []), /* @ts-ignore */
|
|
4560
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
3622
4561
|
resolvedTrackBy = computed(() => {
|
|
3623
4562
|
const trackBy = this.trackBy();
|
|
3624
4563
|
if (trackBy === undefined)
|
|
@@ -3626,7 +4565,8 @@ class Table {
|
|
|
3626
4565
|
if (typeof trackBy === 'string')
|
|
3627
4566
|
return (_, row) => row[trackBy];
|
|
3628
4567
|
return trackBy;
|
|
3629
|
-
},
|
|
4568
|
+
}, /* @ts-ignore */
|
|
4569
|
+
...(ngDevMode ? [{ debugName: "resolvedTrackBy" }] : /* istanbul ignore next */ []));
|
|
3630
4570
|
classes = computed(() => {
|
|
3631
4571
|
const className = 'tls-table';
|
|
3632
4572
|
const array = [className];
|
|
@@ -3635,7 +4575,8 @@ class Table {
|
|
|
3635
4575
|
if (this.striped())
|
|
3636
4576
|
array.push(`${className}--striped`);
|
|
3637
4577
|
return array;
|
|
3638
|
-
},
|
|
4578
|
+
}, /* @ts-ignore */
|
|
4579
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
3639
4580
|
dataSource = {
|
|
3640
4581
|
connect: () => {
|
|
3641
4582
|
return toObservable(this.data);
|
|
@@ -3664,10 +4605,10 @@ class Table {
|
|
|
3664
4605
|
definition.template = template;
|
|
3665
4606
|
return definition;
|
|
3666
4607
|
}
|
|
3667
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3668
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4608
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Table, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4609
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Table, isStandalone: true, selector: "tls-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, columnDefinitions: { classPropertyName: "columnDefinitions", publicName: "columnDefinitions", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", 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 } }, queries: [{ propertyName: "tableColumns", predicate: TableColumn, isSignal: true }], ngImport: i0, template: "<table\n cdk-table\n [class]=\"classes()\"\n [dataSource]=\"dataSource\"\n [trackBy]=\"resolvedTrackBy()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n>\n @for (column of effectiveColumnDefinitions(); track column.key) {\n <ng-container [cdkColumnDef]=\"column.key\">\n <!-- Header cell -->\n <th cdk-header-cell *cdkHeaderCellDef class=\"tls-table__header-cell\" [style.width]=\"column.width + 'px'\">\n {{ column.header }}\n </th>\n\n <!-- Row cell -->\n <td\n cdk-cell\n *cdkCellDef=\"let data; let index = index; let count = count; let first = first; let last = last; let even = even; let odd = odd\"\n class=\"tls-table__cell\"\n [style.text-align]=\"column.alignment\"\n >\n @if (column.template) {\n <ng-container\n [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: data[column.key],\n data: data,\n index: index,\n count: count,\n first: first,\n last: last,\n even: even,\n odd: odd\n }\"\n />\n } @else {\n {{ data[column.key] }}\n }\n </td>\n </ng-container>\n }\n\n <tr cdk-header-row *cdkHeaderRowDef=\"columns()\" class=\"tls-table__header-row\"></tr>\n\n <tr *cdkRowDef=\"let row; columns: columns()\" cdk-row class=\"tls-table__row\"></tr>\n</table>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout", "recycleRows"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { kind: "directive", type: CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "directive", type: CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "component", type: CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { kind: "directive", type: CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "component", type: CdkRow, selector: "cdk-row, tr[cdk-row]" }, { kind: "directive", type: CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3669
4610
|
}
|
|
3670
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Table, decorators: [{
|
|
3671
4612
|
type: Component,
|
|
3672
4613
|
args: [{ selector: 'tls-table', imports: [
|
|
3673
4614
|
CdkTable,
|
|
@@ -3686,18 +4627,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3686
4627
|
|
|
3687
4628
|
class TabsService {
|
|
3688
4629
|
selected = null;
|
|
3689
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3690
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4630
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4631
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsService });
|
|
3691
4632
|
}
|
|
3692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsService, decorators: [{
|
|
3693
4634
|
type: Injectable
|
|
3694
4635
|
}] });
|
|
3695
4636
|
|
|
3696
4637
|
class Tab {
|
|
3697
4638
|
_tabsService = inject(TabsService);
|
|
3698
4639
|
// Inputs
|
|
3699
|
-
value = input.required(
|
|
3700
|
-
|
|
4640
|
+
value = input.required(/* @ts-ignore */
|
|
4641
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4642
|
+
label = input.required(/* @ts-ignore */
|
|
4643
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3701
4644
|
_active = computed(() => {
|
|
3702
4645
|
if (!this._tabsService.selected)
|
|
3703
4646
|
return false;
|
|
@@ -3706,18 +4649,20 @@ class Tab {
|
|
|
3706
4649
|
return this.value() === selected;
|
|
3707
4650
|
else
|
|
3708
4651
|
return false;
|
|
3709
|
-
},
|
|
4652
|
+
}, /* @ts-ignore */
|
|
4653
|
+
...(ngDevMode ? [{ debugName: "_active" }] : /* istanbul ignore next */ []));
|
|
3710
4654
|
hostClasses = computed(() => {
|
|
3711
4655
|
const className = 'tls-tab';
|
|
3712
4656
|
const array = [className];
|
|
3713
4657
|
if (this._active())
|
|
3714
4658
|
array.push(`${className}--active`);
|
|
3715
4659
|
return array;
|
|
3716
|
-
},
|
|
3717
|
-
|
|
3718
|
-
static
|
|
4660
|
+
}, /* @ts-ignore */
|
|
4661
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
4662
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4663
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: Tab, isStandalone: true, selector: "tls-tab", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
3719
4664
|
}
|
|
3720
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4665
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, decorators: [{
|
|
3721
4666
|
type: Component,
|
|
3722
4667
|
args: [{ selector: 'tls-tab', imports: [], host: {
|
|
3723
4668
|
'[class]': 'hostClasses()',
|
|
@@ -3735,25 +4680,31 @@ const TABS_CONFIG = new InjectionToken('TABS_CONFIG', {
|
|
|
3735
4680
|
class Tabs {
|
|
3736
4681
|
_config = inject(TABS_CONFIG);
|
|
3737
4682
|
_tabsService = inject(TabsService);
|
|
3738
|
-
tabs = contentChildren(Tab,
|
|
3739
|
-
|
|
3740
|
-
|
|
4683
|
+
tabs = contentChildren(Tab, /* @ts-ignore */
|
|
4684
|
+
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
4685
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
4686
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
4687
|
+
selected = model(null, /* @ts-ignore */
|
|
4688
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
3741
4689
|
/** Accessible name for the tablist. */
|
|
3742
|
-
ariaLabel = input(undefined,
|
|
3743
|
-
|
|
4690
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
4691
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4692
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
4693
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
3744
4694
|
hostClasses = computed(() => {
|
|
3745
4695
|
const className = 'tls-tabs';
|
|
3746
4696
|
const array = [className];
|
|
3747
4697
|
array.push(`${className}--${this.variant()}`);
|
|
3748
4698
|
return array;
|
|
3749
|
-
},
|
|
4699
|
+
}, /* @ts-ignore */
|
|
4700
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3750
4701
|
constructor() {
|
|
3751
4702
|
this._tabsService.selected = this.selected.asReadonly();
|
|
3752
4703
|
}
|
|
3753
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3754
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4704
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4705
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tabs, isStandalone: true, selector: "tls-tabs", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange" }, host: { properties: { "class": "hostClasses()" } }, providers: [TabsService], queries: [{ propertyName: "tabs", predicate: Tab, isSignal: true }], ngImport: i0, 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" });
|
|
3755
4706
|
}
|
|
3756
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tabs, decorators: [{
|
|
3757
4708
|
type: Component,
|
|
3758
4709
|
args: [{ selector: 'tls-tabs', imports: [], host: {
|
|
3759
4710
|
'[class]': 'hostClasses()',
|
|
@@ -3772,7 +4723,8 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
|
|
|
3772
4723
|
_tabs = inject(Tabs);
|
|
3773
4724
|
_config = inject(TABS_QUERY_SYNC_CONFIG);
|
|
3774
4725
|
// Inputs
|
|
3775
|
-
tlsTabsQuerySync = input(this._config.paramKey,
|
|
4726
|
+
tlsTabsQuerySync = input(this._config.paramKey, /* @ts-ignore */
|
|
4727
|
+
...(ngDevMode ? [{ debugName: "tlsTabsQuerySync" }] : /* istanbul ignore next */ []));
|
|
3776
4728
|
constructor() {
|
|
3777
4729
|
super();
|
|
3778
4730
|
effect(() => {
|
|
@@ -3789,10 +4741,10 @@ class TabsQuerySyncDirective extends QuerySyncDirective {
|
|
|
3789
4741
|
if (value !== null)
|
|
3790
4742
|
this._tabs.selected.set(value);
|
|
3791
4743
|
}
|
|
3792
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3793
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
4744
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsQuerySyncDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4745
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TabsQuerySyncDirective, isStandalone: true, selector: "tls-tabs[tlsTabsQuerySync]", inputs: { tlsTabsQuerySync: { classPropertyName: "tlsTabsQuerySync", publicName: "tlsTabsQuerySync", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
3794
4746
|
}
|
|
3795
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4747
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TabsQuerySyncDirective, decorators: [{
|
|
3796
4748
|
type: Directive,
|
|
3797
4749
|
args: [{
|
|
3798
4750
|
selector: 'tls-tabs[tlsTabsQuerySync]',
|
|
@@ -3802,23 +4754,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
3802
4754
|
class Tooltip {
|
|
3803
4755
|
static _counter = 0;
|
|
3804
4756
|
id = `tls-tooltip-${++Tooltip._counter}`;
|
|
3805
|
-
content = model.required(
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
4757
|
+
content = model.required(/* @ts-ignore */
|
|
4758
|
+
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
4759
|
+
templateData = model(null, /* @ts-ignore */
|
|
4760
|
+
...(ngDevMode ? [{ debugName: "templateData" }] : /* istanbul ignore next */ []));
|
|
4761
|
+
color = model.required(/* @ts-ignore */
|
|
4762
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4763
|
+
isString = computed(() => typeof this.content() === 'string', /* @ts-ignore */
|
|
4764
|
+
...(ngDevMode ? [{ debugName: "isString" }] : /* istanbul ignore next */ []));
|
|
3809
4765
|
templateRef = computed(() => {
|
|
3810
4766
|
if (this.isString())
|
|
3811
4767
|
return null;
|
|
3812
4768
|
return this.content();
|
|
3813
|
-
},
|
|
4769
|
+
}, /* @ts-ignore */
|
|
4770
|
+
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
3814
4771
|
hostClasses = computed(() => {
|
|
3815
4772
|
const className = 'tls-tooltip';
|
|
3816
4773
|
const array = [className];
|
|
3817
4774
|
array.push(`${className}--${this.color()}`);
|
|
3818
4775
|
return array;
|
|
3819
|
-
},
|
|
3820
|
-
|
|
3821
|
-
static
|
|
4776
|
+
}, /* @ts-ignore */
|
|
4777
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
4778
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4779
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", 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: `
|
|
3822
4780
|
@if (isString()) {
|
|
3823
4781
|
{{ content() }}
|
|
3824
4782
|
} @else {
|
|
@@ -3829,7 +4787,7 @@ class Tooltip {
|
|
|
3829
4787
|
}
|
|
3830
4788
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
3831
4789
|
}
|
|
3832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4790
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tooltip, decorators: [{
|
|
3833
4791
|
type: Component,
|
|
3834
4792
|
args: [{
|
|
3835
4793
|
selector: 'tls-tooltip',
|
|
@@ -3922,10 +4880,10 @@ class TooltipService {
|
|
|
3922
4880
|
paneElement.addEventListener('animationend', finalize);
|
|
3923
4881
|
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
|
|
3924
4882
|
}
|
|
3925
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3926
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4883
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4884
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService });
|
|
3927
4885
|
}
|
|
3928
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipService, decorators: [{
|
|
3929
4887
|
type: Injectable
|
|
3930
4888
|
}] });
|
|
3931
4889
|
|
|
@@ -3946,21 +4904,30 @@ class TooltipDirective {
|
|
|
3946
4904
|
_elementRef = inject(ElementRef);
|
|
3947
4905
|
_renderer = inject(Renderer2);
|
|
3948
4906
|
_config = inject(TOOLTIP_CONFIG);
|
|
3949
|
-
content = input('Hello', { ...(ngDevMode ? { debugName: "content" } : {}), alias: 'tlsTooltip' });
|
|
3950
|
-
data = input(null,
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
4907
|
+
content = input('Hello', { ...(ngDevMode ? { debugName: "content" } : /* istanbul ignore next */ {}), alias: 'tlsTooltip' });
|
|
4908
|
+
data = input(null, /* @ts-ignore */
|
|
4909
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
4910
|
+
tooltipDisabled = input(false, /* @ts-ignore */
|
|
4911
|
+
...(ngDevMode ? [{ debugName: "tooltipDisabled" }] : /* istanbul ignore next */ []));
|
|
4912
|
+
tooltipOrigin = input(this._config.origin, /* @ts-ignore */
|
|
4913
|
+
...(ngDevMode ? [{ debugName: "tooltipOrigin" }] : /* istanbul ignore next */ []));
|
|
4914
|
+
tooltipPositions = input(this._config.positions, /* @ts-ignore */
|
|
4915
|
+
...(ngDevMode ? [{ debugName: "tooltipPositions" }] : /* istanbul ignore next */ []));
|
|
4916
|
+
tooltipPosition = input(this._config.position, /* @ts-ignore */
|
|
4917
|
+
...(ngDevMode ? [{ debugName: "tooltipPosition" }] : /* istanbul ignore next */ []));
|
|
4918
|
+
tooltipOffset = input(this._config.offset, /* @ts-ignore */
|
|
4919
|
+
...(ngDevMode ? [{ debugName: "tooltipOffset" }] : /* istanbul ignore next */ []));
|
|
4920
|
+
tooltipColor = input(this._config.color, /* @ts-ignore */
|
|
4921
|
+
...(ngDevMode ? [{ debugName: "tooltipColor" }] : /* istanbul ignore next */ []));
|
|
4922
|
+
_visible = signal(false, /* @ts-ignore */
|
|
4923
|
+
...(ngDevMode ? [{ debugName: "_visible" }] : /* istanbul ignore next */ []));
|
|
3958
4924
|
_positions = computed(() => {
|
|
3959
4925
|
const positions = this.tooltipPositions();
|
|
3960
4926
|
if (positions)
|
|
3961
4927
|
return positions;
|
|
3962
4928
|
return buildOverlayPositions(this.tooltipPosition(), this.tooltipOffset());
|
|
3963
|
-
},
|
|
4929
|
+
}, /* @ts-ignore */
|
|
4930
|
+
...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
3964
4931
|
// Protected methods
|
|
3965
4932
|
onMouseEnter(event) {
|
|
3966
4933
|
this._show(event);
|
|
@@ -4007,10 +4974,10 @@ class TooltipDirective {
|
|
|
4007
4974
|
this._tooltipService.dispose();
|
|
4008
4975
|
this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
|
|
4009
4976
|
}
|
|
4010
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4011
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
4977
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4978
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: TooltipDirective, isStandalone: true, selector: "[tlsTooltip]", inputs: { content: { classPropertyName: "content", publicName: "tlsTooltip", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipOrigin: { classPropertyName: "tooltipOrigin", publicName: "tooltipOrigin", isSignal: true, isRequired: false, transformFunction: null }, tooltipPositions: { classPropertyName: "tooltipPositions", publicName: "tooltipPositions", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltipOffset", isSignal: true, isRequired: false, transformFunction: null }, tooltipColor: { classPropertyName: "tooltipColor", publicName: "tooltipColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "onMouseEnter($event)", "mousemove": "onMouseMove($event)", "mouseleave": "onMouseLeave()", "touchstart": "onTouchStart($event)" } }, providers: [TooltipService], ngImport: i0 });
|
|
4012
4979
|
}
|
|
4013
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
4014
4981
|
type: Directive,
|
|
4015
4982
|
args: [{
|
|
4016
4983
|
selector: '[tlsTooltip]',
|
|
@@ -4154,5 +5121,5 @@ const provideThalassicUIConfig = (config) => {
|
|
|
4154
5121
|
* Generated bundle index. Do not edit.
|
|
4155
5122
|
*/
|
|
4156
5123
|
|
|
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 };
|
|
5124
|
+
export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, CONFIRM_CONFIG, Checkbox, CheckboxFormControl, Chip, ChipControl, ChipGroup, ChipInput, Confirm, ConfirmPanel, ConfirmService, 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_CONFIRM_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_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_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, 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, 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 };
|
|
4158
5125
|
//# sourceMappingURL=thalassic-ui.mjs.map
|