@thalassic/ui 0.15.2 → 0.16.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.
|
@@ -163,6 +163,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
163
163
|
}], 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 }] }] } });
|
|
164
164
|
|
|
165
165
|
const TRANSPARENT_BACKDROP_CLASS = 'cdk-overlay-transparent-backdrop';
|
|
166
|
+
// Upper bound for how long to keep a non-reused pane alive after detach so the
|
|
167
|
+
// panel's `animate.leave` can finish. Disposes on `animationend`; this only
|
|
168
|
+
// fires when no exit animation runs (e.g. the `none` motion level).
|
|
169
|
+
const LEAVE_ANIMATION_FALLBACK_MS = 500;
|
|
166
170
|
/**
|
|
167
171
|
* Owns the CDK-Overlay lifecycle shared by the library's connected overlay
|
|
168
172
|
* components (popover, menu, select): create/attach, dismissal wiring
|
|
@@ -180,6 +184,13 @@ class OverlayManager {
|
|
|
180
184
|
_overlayRef = null;
|
|
181
185
|
_config = null;
|
|
182
186
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : []));
|
|
187
|
+
// Armed by `ignoreTrailingAuxClick` on open: swallow the first outside
|
|
188
|
+
// `auxclick` so the right-click gesture that opened a context menu doesn't
|
|
189
|
+
// immediately dismiss it. Consumed one-shot (not on a timer) because the user
|
|
190
|
+
// may hold the button arbitrarily long before releasing — the `auxclick`
|
|
191
|
+
// fires on release — so the guard must survive until that first `auxclick`
|
|
192
|
+
// actually arrives. Later outside pointers still dismiss.
|
|
193
|
+
_ignoreTrailingAuxClick = false;
|
|
183
194
|
isOpen = this._isOpen.asReadonly();
|
|
184
195
|
// Dispose the overlay with the host. Registered in a field initializer so no
|
|
185
196
|
// constructor is needed.
|
|
@@ -200,24 +211,39 @@ class OverlayManager {
|
|
|
200
211
|
});
|
|
201
212
|
this._wireDismissal(this._overlayRef, config);
|
|
202
213
|
}
|
|
214
|
+
else {
|
|
215
|
+
// Reused ref (`reuse: true`): re-apply the position strategy so a new
|
|
216
|
+
// origin/point takes effect instead of reopening at the previous spot.
|
|
217
|
+
this._overlayRef.updatePositionStrategy(this._buildPositionStrategy(config));
|
|
218
|
+
}
|
|
203
219
|
if (config.minWidth != null) {
|
|
204
220
|
this._overlayRef.updateSize({ minWidth: config.minWidth });
|
|
205
221
|
}
|
|
206
222
|
this._overlayRef.attach(new TemplatePortal(config.content, this._viewContainerRef));
|
|
207
223
|
this._isOpen.set(true);
|
|
224
|
+
this._ignoreTrailingAuxClick = Boolean(config.ignoreTrailingAuxClick);
|
|
208
225
|
}
|
|
209
226
|
close() {
|
|
210
227
|
if (!this._isOpen())
|
|
211
228
|
return;
|
|
212
|
-
if (this._config?.reuse) {
|
|
213
|
-
this._overlayRef?.detach();
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
this._overlayRef?.dispose();
|
|
217
|
-
this._overlayRef = null;
|
|
218
|
-
}
|
|
219
229
|
this._isOpen.set(false);
|
|
220
|
-
this.
|
|
230
|
+
this._ignoreTrailingAuxClick = false;
|
|
231
|
+
const overlayRef = this._overlayRef;
|
|
232
|
+
const config = this._config;
|
|
233
|
+
if (overlayRef) {
|
|
234
|
+
// Detach (not dispose) so the pane survives while Angular's `animate.leave`
|
|
235
|
+
// plays the panel's exit animation. A reused overlay keeps its ref for the
|
|
236
|
+
// next open; a one-off overlay is disposed once the animation has finished,
|
|
237
|
+
// so the pane is never torn down mid-animation.
|
|
238
|
+
overlayRef.detach();
|
|
239
|
+
const reuse = Boolean(config && config.reuse);
|
|
240
|
+
if (!reuse) {
|
|
241
|
+
this._overlayRef = null;
|
|
242
|
+
this._disposeAfterAnimation(overlayRef);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (config && config.onClose)
|
|
246
|
+
config.onClose();
|
|
221
247
|
}
|
|
222
248
|
// Private
|
|
223
249
|
_buildPositionStrategy(config) {
|
|
@@ -242,7 +268,16 @@ class OverlayManager {
|
|
|
242
268
|
if (config.closeOnOutsidePointer ?? !hasBackdrop) {
|
|
243
269
|
overlayRef
|
|
244
270
|
.outsidePointerEvents()
|
|
245
|
-
.pipe(takeUntilDestroyed(this._destroyRef), filter(event => event.type === 'click' || event.type === 'auxclick')
|
|
271
|
+
.pipe(takeUntilDestroyed(this._destroyRef), filter(event => event.type === 'click' || event.type === 'auxclick'), filter(event => {
|
|
272
|
+
// Swallow exactly the first outside `auxclick` after an armed open —
|
|
273
|
+
// the release of the right-click that opened a context menu — then
|
|
274
|
+
// let every later outside pointer dismiss as usual.
|
|
275
|
+
if (this._ignoreTrailingAuxClick && event.type === 'auxclick') {
|
|
276
|
+
this._ignoreTrailingAuxClick = false;
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
return true;
|
|
280
|
+
}))
|
|
246
281
|
.subscribe(() => this.close());
|
|
247
282
|
}
|
|
248
283
|
if (config.closeOnEscape ?? true) {
|
|
@@ -252,6 +287,29 @@ class OverlayManager {
|
|
|
252
287
|
.subscribe(() => this.close());
|
|
253
288
|
}
|
|
254
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Disposes a detached overlay once the panel's exit animation has finished, so
|
|
292
|
+
* the pane is not torn down while `animate.leave` is still playing. Falls back
|
|
293
|
+
* to a timeout when no animation runs (e.g. the `none` motion level).
|
|
294
|
+
*/
|
|
295
|
+
_disposeAfterAnimation(overlayRef) {
|
|
296
|
+
const paneElement = overlayRef.overlayElement;
|
|
297
|
+
if (!paneElement) {
|
|
298
|
+
overlayRef.dispose();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
let settled = false;
|
|
302
|
+
const finalize = () => {
|
|
303
|
+
if (settled)
|
|
304
|
+
return;
|
|
305
|
+
settled = true;
|
|
306
|
+
window.clearTimeout(timeoutId);
|
|
307
|
+
paneElement.removeEventListener('animationend', finalize);
|
|
308
|
+
overlayRef.dispose();
|
|
309
|
+
};
|
|
310
|
+
paneElement.addEventListener('animationend', finalize);
|
|
311
|
+
const timeoutId = window.setTimeout(finalize, LEAVE_ANIMATION_FALLBACK_MS);
|
|
312
|
+
}
|
|
255
313
|
_dispose() {
|
|
256
314
|
this._overlayRef?.dispose();
|
|
257
315
|
this._overlayRef = null;
|
|
@@ -936,6 +994,7 @@ const DEFAULT_FORM_ITEM_CONFIG = {
|
|
|
936
994
|
reserveErrorSpace: true,
|
|
937
995
|
reserveLabelSpace: false,
|
|
938
996
|
displayErrors: true,
|
|
997
|
+
showRequiredMarker: true,
|
|
939
998
|
errorMessages: DEFAULT_FORM_ITEM_ERROR_MESSAGES,
|
|
940
999
|
};
|
|
941
1000
|
|
|
@@ -952,25 +1011,33 @@ class FormItem {
|
|
|
952
1011
|
reserveErrorSpace = input(this._config.reserveErrorSpace, ...(ngDevMode ? [{ debugName: "reserveErrorSpace" }] : []));
|
|
953
1012
|
reserveLabelSpace = input(this._config.reserveLabelSpace, ...(ngDevMode ? [{ debugName: "reserveLabelSpace" }] : []));
|
|
954
1013
|
displayErrors = input(this._config.displayErrors, ...(ngDevMode ? [{ debugName: "displayErrors" }] : []));
|
|
1014
|
+
showRequiredMarker = input(this._config.showRequiredMarker, ...(ngDevMode ? [{ debugName: "showRequiredMarker" }] : []));
|
|
1015
|
+
optionalText = input(this._config.optionalText, ...(ngDevMode ? [{ debugName: "optionalText" }] : []));
|
|
955
1016
|
isInvalid = computed(() => {
|
|
956
1017
|
const control = this.control();
|
|
957
1018
|
if (!control)
|
|
958
1019
|
return false;
|
|
959
1020
|
return control.invalid() && control.touched();
|
|
960
1021
|
}, ...(ngDevMode ? [{ debugName: "isInvalid" }] : []));
|
|
961
|
-
|
|
1022
|
+
showRequired = computed(() => {
|
|
962
1023
|
const control = this.control();
|
|
963
1024
|
if (!control)
|
|
964
1025
|
return false;
|
|
965
|
-
return control.required();
|
|
966
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
1026
|
+
return this.showRequiredMarker() && control.required();
|
|
1027
|
+
}, ...(ngDevMode ? [{ debugName: "showRequired" }] : []));
|
|
1028
|
+
showOptional = computed(() => {
|
|
1029
|
+
const control = this.control();
|
|
1030
|
+
if (!control)
|
|
1031
|
+
return false;
|
|
1032
|
+
if (!this.optionalText())
|
|
1033
|
+
return false;
|
|
1034
|
+
return !control.required();
|
|
1035
|
+
}, ...(ngDevMode ? [{ debugName: "showOptional" }] : []));
|
|
967
1036
|
hostClasses = computed(() => {
|
|
968
1037
|
const className = 'tls-form-item';
|
|
969
1038
|
const array = [className];
|
|
970
1039
|
if (this.isInvalid())
|
|
971
1040
|
array.push(`${className}--invalid`);
|
|
972
|
-
if (this.isRequired())
|
|
973
|
-
array.push(`${className}--required`);
|
|
974
1041
|
if (this.reserveErrorSpace())
|
|
975
1042
|
array.push(`${className}--error-space-reserved`);
|
|
976
1043
|
if (this.reserveLabelSpace())
|
|
@@ -1001,12 +1068,12 @@ class FormItem {
|
|
|
1001
1068
|
return array;
|
|
1002
1069
|
}
|
|
1003
1070
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1004
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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 } }, 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\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n <span class=\"form-item-label__required\">*</span>\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\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" });
|
|
1071
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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\">\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\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" });
|
|
1005
1072
|
}
|
|
1006
1073
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormItem, decorators: [{
|
|
1007
1074
|
type: Component,
|
|
1008
|
-
args: [{ selector: 'tls-form-item', imports: [], host: { '[class]': 'hostClasses()' }, template: "@if (label() || reserveLabelSpace()) {\n <label class=\"form-item-label\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n <span class=\"form-item-label__required\">*</span>\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\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" }]
|
|
1009
|
-
}], 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 }] }] } });
|
|
1075
|
+
args: [{ selector: 'tls-form-item', imports: [], host: { '[class]': 'hostClasses()' }, template: "@if (label() || reserveLabelSpace()) {\n <label class=\"form-item-label\">\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\">\n {{ firstErrorMessage() }}\n </span>\n }\n </small>\n}\n" }]
|
|
1076
|
+
}], 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 }] }] } });
|
|
1010
1077
|
|
|
1011
1078
|
const DEFAULT_CHECKBOX_CONFIG = {};
|
|
1012
1079
|
|
|
@@ -1237,6 +1304,8 @@ class Popover {
|
|
|
1237
1304
|
<ng-template #content>
|
|
1238
1305
|
<div
|
|
1239
1306
|
class="tls-popover"
|
|
1307
|
+
animate.enter="tls-popover--enter"
|
|
1308
|
+
animate.leave="tls-popover--leave"
|
|
1240
1309
|
[id]="id"
|
|
1241
1310
|
role="dialog"
|
|
1242
1311
|
aria-modal="false"
|
|
@@ -1255,6 +1324,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
1255
1324
|
<ng-template #content>
|
|
1256
1325
|
<div
|
|
1257
1326
|
class="tls-popover"
|
|
1327
|
+
animate.enter="tls-popover--enter"
|
|
1328
|
+
animate.leave="tls-popover--leave"
|
|
1258
1329
|
[id]="id"
|
|
1259
1330
|
role="dialog"
|
|
1260
1331
|
aria-modal="false"
|
|
@@ -2195,13 +2266,13 @@ class MultiSelect extends AbstractSelect {
|
|
|
2195
2266
|
this.toggleOption(option);
|
|
2196
2267
|
}
|
|
2197
2268
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: MultiSelect, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2198
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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]=\"inputId()\"\n [attr.name]=\"name()\"\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
|
|
2269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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]=\"inputId()\"\n [attr.name]=\"name()\"\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" });
|
|
2199
2270
|
}
|
|
2200
2271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: MultiSelect, decorators: [{
|
|
2201
2272
|
type: Component,
|
|
2202
2273
|
args: [{ selector: 'tls-multi-select', host: {
|
|
2203
2274
|
'[class]': 'hostClasses()',
|
|
2204
|
-
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"inputId()\"\n [attr.name]=\"name()\"\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
|
|
2275
|
+
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => MultiSelect) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-multi-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"inputId()\"\n [attr.name]=\"name()\"\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" }]
|
|
2205
2276
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], maxLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLabels", required: false }] }] } });
|
|
2206
2277
|
|
|
2207
2278
|
const DEFAULT_SELECT_CONFIG = {
|
|
@@ -2254,13 +2325,13 @@ class Select extends AbstractSelect {
|
|
|
2254
2325
|
this.select(option);
|
|
2255
2326
|
}
|
|
2256
2327
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Select, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2257
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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]=\"inputId()\"\n [attr.name]=\"name()\"\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
|
|
2328
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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]=\"inputId()\"\n [attr.name]=\"name()\"\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" });
|
|
2258
2329
|
}
|
|
2259
2330
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Select, decorators: [{
|
|
2260
2331
|
type: Component,
|
|
2261
2332
|
args: [{ selector: 'tls-select', host: {
|
|
2262
2333
|
'[class]': 'hostClasses()',
|
|
2263
|
-
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"inputId()\"\n [attr.name]=\"name()\"\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
|
|
2334
|
+
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Select) }], template: "<button\n #trigger\n type=\"button\"\n class=\"tls-select__trigger\"\n role=\"combobox\"\n [attr.id]=\"inputId()\"\n [attr.name]=\"name()\"\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" }]
|
|
2264
2335
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }] } });
|
|
2265
2336
|
|
|
2266
2337
|
const DEFAULT_SWITCH_CONFIG = {
|
|
@@ -2653,6 +2724,7 @@ class Menu {
|
|
|
2653
2724
|
positions: this._positions(),
|
|
2654
2725
|
scrollStrategy: 'close',
|
|
2655
2726
|
hasBackdrop: false,
|
|
2727
|
+
ignoreTrailingAuxClick: true,
|
|
2656
2728
|
});
|
|
2657
2729
|
}
|
|
2658
2730
|
close() {
|
|
@@ -2672,11 +2744,11 @@ class Menu {
|
|
|
2672
2744
|
this.close();
|
|
2673
2745
|
}
|
|
2674
2746
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Menu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2675
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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 [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", "routerLink"] }] });
|
|
2747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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", "routerLink"] }] });
|
|
2676
2748
|
}
|
|
2677
2749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Menu, decorators: [{
|
|
2678
2750
|
type: Component,
|
|
2679
|
-
args: [{ selector: 'tls-menu', imports: [NgTemplateOutlet, Icon, RouterLink], template: "<ng-template #panel>\n <div\n class=\"tls-menu\"\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" }]
|
|
2751
|
+
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" }]
|
|
2680
2752
|
}], 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 }] }] } });
|
|
2681
2753
|
|
|
2682
2754
|
class MenuTriggerDirective {
|