@thalassic/ui 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui.mjs +46 -46
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +10 -10
- package/features/button/button.scss +0 -15
- package/features/divider/divider.scss +0 -91
- package/features/form/checkbox/checkbox.scss +0 -95
- package/features/form/input/input.scss +0 -9
- package/features/form/password/password.scss +0 -25
- package/features/form/radio-button/radio-button.scss +0 -103
- package/features/form/switch/switch-color.scss +0 -36
- package/features/form/switch/switch.scss +0 -82
- package/features/form-item/form-item.scss +0 -79
- package/features/icon/icon.scss +0 -15
- package/styles/components/_index.scss +0 -2
- package/styles/components/button/_button-appearance.scss +0 -136
- package/styles/components/button/_button-color.scss +0 -41
- package/styles/components/button/_button-size.scss +0 -52
- package/styles/components/button/_button.scss +0 -53
- package/styles/components/button/_index.scss +0 -4
- package/styles/components/form/_form-control-addon.scss +0 -2
- package/styles/components/form/_form-control-group-size.scss +0 -46
- package/styles/components/form/_form-control-group.scss +0 -58
- package/styles/components/form/_form-control-size.scss +0 -46
- package/styles/components/form/_form-control.scss +0 -45
- package/styles/components/form/_index.scss +0 -5
- package/styles/index.scss +0 -1
- package/styles/mixins/_index.scss +0 -1
- package/styles/mixins/focus-ring.scss +0 -4
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { inject, Injectable, InjectionToken, input, computed, Component, booleanAttribute, Directive, model, contentChild, forwardRef, DOCUMENT, RendererFactory2, PLATFORM_ID, signal, effect, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
|
|
4
4
|
import { RouterLink } from '@angular/router';
|
|
5
5
|
import { rxResource } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { HttpClient } from '@angular/common/http';
|
|
7
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
8
|
import { throwError, map, shareReplay } from 'rxjs';
|
|
9
9
|
|
|
10
|
-
const DEFAULT_ICON_CONFIG = {
|
|
11
|
-
allowedSources: [],
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const ICON_CONFIG = new InjectionToken('ICON_CONFIG', {
|
|
15
|
-
factory: () => DEFAULT_ICON_CONFIG,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
10
|
class IconService {
|
|
19
11
|
_http = inject(HttpClient);
|
|
20
12
|
_sanitizer = inject(DomSanitizer);
|
|
@@ -65,6 +57,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
65
57
|
args: [{ providedIn: 'root' }]
|
|
66
58
|
}] });
|
|
67
59
|
|
|
60
|
+
const DEFAULT_ICON_CONFIG = {
|
|
61
|
+
allowedSources: [],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const ICON_CONFIG = new InjectionToken('ICON_CONFIG', {
|
|
65
|
+
factory: () => DEFAULT_ICON_CONFIG,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
68
|
class Icon {
|
|
69
69
|
// Injections
|
|
70
70
|
_iconService = inject(IconService);
|
|
@@ -89,16 +89,16 @@ class Icon {
|
|
|
89
89
|
return this._svgContentResource.value.asReadonly();
|
|
90
90
|
}
|
|
91
91
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
92
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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 } }, 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"
|
|
92
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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" });
|
|
93
93
|
}
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Icon, decorators: [{
|
|
95
95
|
type: Component,
|
|
96
|
-
args: [{ selector: 'tls-icon', imports: [], 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"
|
|
96
|
+
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" }]
|
|
97
97
|
}], 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 }] }] } });
|
|
98
98
|
|
|
99
99
|
const DEFAULT_BUTTON_CONFIG = {
|
|
100
100
|
color: 'primary',
|
|
101
|
-
|
|
101
|
+
variant: 'filled',
|
|
102
102
|
size: 'md',
|
|
103
103
|
type: 'button',
|
|
104
104
|
fluid: false,
|
|
@@ -114,7 +114,7 @@ class ButtonBase {
|
|
|
114
114
|
APPLY_HOST_CLASSES = true;
|
|
115
115
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
116
116
|
color = input(this._config.color, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
117
|
-
|
|
117
|
+
variant = input(this._config.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
118
118
|
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
119
119
|
/** Whether the button stretches to fill its container's width. */
|
|
120
120
|
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : {}), transform: booleanAttribute });
|
|
@@ -122,7 +122,7 @@ class ButtonBase {
|
|
|
122
122
|
const className = 'tls-button';
|
|
123
123
|
const array = [className];
|
|
124
124
|
array.push(`${className}--${this.color()}`);
|
|
125
|
-
array.push(`${className}--${this.
|
|
125
|
+
array.push(`${className}--${this.variant()}`);
|
|
126
126
|
array.push(`${className}--${this.size()}`);
|
|
127
127
|
if (this.disabled())
|
|
128
128
|
array.push(`${className}--disabled`);
|
|
@@ -133,7 +133,7 @@ class ButtonBase {
|
|
|
133
133
|
return array;
|
|
134
134
|
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
135
135
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ButtonBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
136
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: ButtonBase, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null },
|
|
136
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: ButtonBase, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", 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 }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "APPLY_HOST_CLASSES ? classes() : null" } }, ngImport: i0 });
|
|
137
137
|
}
|
|
138
138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ButtonBase, decorators: [{
|
|
139
139
|
type: Directive,
|
|
@@ -142,7 +142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
142
142
|
'[class]': 'APPLY_HOST_CLASSES ? classes() : null',
|
|
143
143
|
},
|
|
144
144
|
}]
|
|
145
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }],
|
|
145
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }] } });
|
|
146
146
|
|
|
147
147
|
class Button extends ButtonBase {
|
|
148
148
|
// Injections
|
|
@@ -228,7 +228,7 @@ class Divider {
|
|
|
228
228
|
return array;
|
|
229
229
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
230
230
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Divider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
231
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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"
|
|
231
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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" });
|
|
232
232
|
}
|
|
233
233
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Divider, decorators: [{
|
|
234
234
|
type: Component,
|
|
@@ -236,7 +236,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
236
236
|
role: 'separator',
|
|
237
237
|
'[aria-orientation]': 'orientation()',
|
|
238
238
|
'[class]': 'hostClasses()',
|
|
239
|
-
}, 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"
|
|
239
|
+
}, 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" }]
|
|
240
240
|
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], flush: [{ type: i0.Input, args: [{ isSignal: true, alias: "flush", required: false }] }] } });
|
|
241
241
|
|
|
242
242
|
const DEFAULT_FORM_ITEM_ERROR_MESSAGES = {
|
|
@@ -347,7 +347,7 @@ class FormItem {
|
|
|
347
347
|
isRequired = computed(() => {
|
|
348
348
|
return Boolean(this.control()?.required());
|
|
349
349
|
}, ...(ngDevMode ? [{ debugName: "isRequired" }] : []));
|
|
350
|
-
|
|
350
|
+
hostClasses = computed(() => {
|
|
351
351
|
const className = 'tls-form-item';
|
|
352
352
|
const array = [className];
|
|
353
353
|
if (this.isInvalid())
|
|
@@ -357,7 +357,7 @@ class FormItem {
|
|
|
357
357
|
if (this.reserveErrorSpace())
|
|
358
358
|
array.push(`${className}--error-space-reserved`);
|
|
359
359
|
return array;
|
|
360
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
360
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
361
361
|
errorMessages = computed(() => {
|
|
362
362
|
const errors = this.control()?.errors();
|
|
363
363
|
if (errors)
|
|
@@ -383,11 +383,11 @@ class FormItem {
|
|
|
383
383
|
return array;
|
|
384
384
|
}
|
|
385
385
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
386
|
-
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 }, displayErrors: { classPropertyName: "displayErrors", publicName: "displayErrors", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "
|
|
386
|
+
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 }, 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: "<label for=\"\" class=\"form-item-label\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n <span class=\"form-item-label__required\">*</span>\n</label>\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" });
|
|
387
387
|
}
|
|
388
388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormItem, decorators: [{
|
|
389
389
|
type: Component,
|
|
390
|
-
args: [{ selector: 'tls-form-item', imports: [], host: { '[class]': '
|
|
390
|
+
args: [{ selector: 'tls-form-item', imports: [], host: { '[class]': 'hostClasses()' }, template: "<label for=\"\" class=\"form-item-label\">\n <span class=\"form-item-label__text\">{{ label() }}</span>\n <span class=\"form-item-label__required\">*</span>\n</label>\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" }]
|
|
391
391
|
}], 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 }] }], displayErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayErrors", required: false }] }] } });
|
|
392
392
|
|
|
393
393
|
const DEFAULT_CHECKBOX_CONFIG = {};
|
|
@@ -403,13 +403,13 @@ class Checkbox extends CheckboxFormControl {
|
|
|
403
403
|
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
404
404
|
inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : []));
|
|
405
405
|
tabindex = input(0, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
|
|
406
|
-
|
|
406
|
+
hostClasses = computed(() => {
|
|
407
407
|
const className = this.CLASS_NAME;
|
|
408
408
|
const array = [className];
|
|
409
409
|
if (this.indeterminate())
|
|
410
410
|
array.push(`${className}--indeterminate`);
|
|
411
411
|
return array.concat(this.controlClasses());
|
|
412
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
412
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
413
413
|
// Protected methods
|
|
414
414
|
toggle() {
|
|
415
415
|
if (this.notInteractive())
|
|
@@ -421,15 +421,15 @@ class Checkbox extends CheckboxFormControl {
|
|
|
421
421
|
this.toggle();
|
|
422
422
|
}
|
|
423
423
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Checkbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
424
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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": "
|
|
424
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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 [id]=\"inputId()\"\n [name]=\"name()\"\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" });
|
|
425
425
|
}
|
|
426
426
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Checkbox, decorators: [{
|
|
427
427
|
type: Component,
|
|
428
428
|
args: [{ selector: 'tls-checkbox', imports: [], host: {
|
|
429
429
|
role: 'checkbox',
|
|
430
|
-
'[class]': '
|
|
430
|
+
'[class]': 'hostClasses()',
|
|
431
431
|
'[tabindex]': '-1',
|
|
432
|
-
}, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\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"
|
|
432
|
+
}, template: "<input\n type=\"checkbox\"\n class=\"tls-checkbox-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\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" }]
|
|
433
433
|
}], 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"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
434
434
|
|
|
435
435
|
const DEFAULT_INPUT_CONFIG = {
|
|
@@ -479,23 +479,23 @@ class InputDirective {
|
|
|
479
479
|
_config = inject(INPUT_CONFIG);
|
|
480
480
|
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
481
481
|
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : {}), transform: booleanAttribute });
|
|
482
|
-
|
|
482
|
+
hostClasses = computed(() => {
|
|
483
483
|
const className = 'tls-form-control';
|
|
484
484
|
const array = [className];
|
|
485
485
|
array.push(`${className}--${this.size()}`);
|
|
486
486
|
if (this.fluid())
|
|
487
487
|
array.push(`${className}--fluid`);
|
|
488
488
|
return array;
|
|
489
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
489
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
490
490
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
491
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", 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": "
|
|
491
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", 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 });
|
|
492
492
|
}
|
|
493
493
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputDirective, decorators: [{
|
|
494
494
|
type: Directive,
|
|
495
495
|
args: [{
|
|
496
496
|
selector: '[tlsInput]',
|
|
497
497
|
host: {
|
|
498
|
-
'[class]': '
|
|
498
|
+
'[class]': 'hostClasses()',
|
|
499
499
|
},
|
|
500
500
|
}]
|
|
501
501
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }] } });
|
|
@@ -518,14 +518,14 @@ class Password extends ValueFormControl {
|
|
|
518
518
|
placeholder = input(this._config.placeholder, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
519
519
|
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
520
520
|
fluid = input(this._config.fluid, { ...(ngDevMode ? { debugName: "fluid" } : {}), transform: booleanAttribute });
|
|
521
|
-
|
|
521
|
+
hostClasses = computed(() => {
|
|
522
522
|
const className = 'tls-form-control-group';
|
|
523
523
|
const array = [className];
|
|
524
524
|
array.push(`${className}--${this.size()}`);
|
|
525
525
|
if (this.fluid())
|
|
526
526
|
array.push(`${className}--fluid`);
|
|
527
527
|
return array;
|
|
528
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
528
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
529
529
|
type = computed(() => (this.visible() ? 'text' : 'password'), ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
530
530
|
// Protected methods
|
|
531
531
|
onInput(event) {
|
|
@@ -538,13 +538,13 @@ class Password extends ValueFormControl {
|
|
|
538
538
|
this.visible.update(prev => !prev);
|
|
539
539
|
}
|
|
540
540
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Password, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
541
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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: { properties: { "class": "
|
|
541
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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: { properties: { "class": "hostClasses()" } }, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], usesInheritance: true, ngImport: i0, template: "<input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"inputId()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n/>\n<button class=\"tls-password-toggle tls-form-control-addon\" type=\"button\" (click)=\"toggle()\">\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n <span class=\"text-label-md\">Show</span>\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n <span class=\"text-label-md\">Hide</span>\n </span>\n</button>\n", styles: [":host{display:inline-flex}:host .tls-password-toggle{display:grid;align-items:center}:host .tls-password-toggle__item{grid-area:1/1;text-align:center}:host .tls-password-toggle__item--hidden{visibility:hidden}\n"] });
|
|
542
542
|
}
|
|
543
543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Password, decorators: [{
|
|
544
544
|
type: Component,
|
|
545
545
|
args: [{ selector: 'tls-password', host: {
|
|
546
|
-
'[class]': '
|
|
547
|
-
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], template: "<input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"inputId()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n/>\n<button class=\"tls-password-toggle tls-form-control-addon\" (click)=\"toggle()\">\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n <span class=\"text-label-md\">Show</span>\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n <span class=\"text-label-md\">Hide</span>\n </span>\n</button>\n", styles: [":host{display:inline-flex}:host .tls-password-toggle{display:grid;align-items:center}:host .tls-password-
|
|
546
|
+
'[class]': 'hostClasses()',
|
|
547
|
+
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Password) }], template: "<input\n [type]=\"type()\"\n [name]=\"name()\"\n [class]=\"controlClasses()\"\n [attr.id]=\"inputId()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n/>\n<button class=\"tls-password-toggle tls-form-control-addon\" type=\"button\" (click)=\"toggle()\">\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\n <span class=\"text-label-md\">Show</span>\n </span>\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\n <span class=\"text-label-md\">Hide</span>\n </span>\n</button>\n", styles: [":host{display:inline-flex}:host .tls-password-toggle{display:grid;align-items:center}:host .tls-password-toggle__item{grid-area:1/1;text-align:center}:host .tls-password-toggle__item--hidden{visibility:hidden}\n"] }]
|
|
548
548
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", 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 }] }] } });
|
|
549
549
|
|
|
550
550
|
const DEFAULT_RADIO_BUTTON_CONFIG = {};
|
|
@@ -561,13 +561,13 @@ class RadioButton extends ValueFormControl {
|
|
|
561
561
|
inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : []));
|
|
562
562
|
tabindex = input(0, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
|
|
563
563
|
checked = computed(() => this.radioValue() === this.value(), ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
564
|
-
|
|
564
|
+
hostClasses = computed(() => {
|
|
565
565
|
const className = this.CLASS_NAME;
|
|
566
566
|
const array = [className];
|
|
567
567
|
if (this.checked())
|
|
568
568
|
array.push(`${className}--checked`);
|
|
569
569
|
return array.concat(this.controlClasses());
|
|
570
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
570
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
571
571
|
// Protected methods
|
|
572
572
|
check() {
|
|
573
573
|
if (this.notInteractive())
|
|
@@ -575,14 +575,14 @@ class RadioButton extends ValueFormControl {
|
|
|
575
575
|
this.value.set(this.radioValue());
|
|
576
576
|
}
|
|
577
577
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RadioButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
578
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "
|
|
578
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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 [id]=\"inputId()\"\n [name]=\"name()\"\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" });
|
|
579
579
|
}
|
|
580
580
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: RadioButton, decorators: [{
|
|
581
581
|
type: Component,
|
|
582
582
|
args: [{ selector: 'tls-radio-button', imports: [], host: {
|
|
583
|
-
'[class]': '
|
|
583
|
+
'[class]': 'hostClasses()',
|
|
584
584
|
'[tabindex]': '-1',
|
|
585
|
-
}, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\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"
|
|
585
|
+
}, template: "<input\n type=\"radio\"\n class=\"tls-radio-button-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\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" }]
|
|
586
586
|
}], propDecorators: { radioValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "radioValue", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
587
587
|
|
|
588
588
|
const DEFAULT_SWITCH_CONFIG = {
|
|
@@ -600,12 +600,12 @@ class Switch extends CheckboxFormControl {
|
|
|
600
600
|
inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : []));
|
|
601
601
|
color = input(this._config.color, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
602
602
|
tabindex = input(0, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
|
|
603
|
-
|
|
603
|
+
hostClasses = computed(() => {
|
|
604
604
|
const className = this.CLASS_NAME;
|
|
605
605
|
const array = [className];
|
|
606
606
|
array.push(`${className}--${this.color()}`);
|
|
607
607
|
return array.concat(this.controlClasses());
|
|
608
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
608
|
+
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : []));
|
|
609
609
|
// Protected methods
|
|
610
610
|
toggle() {
|
|
611
611
|
if (this.notInteractive())
|
|
@@ -617,13 +617,13 @@ class Switch extends CheckboxFormControl {
|
|
|
617
617
|
this.toggle();
|
|
618
618
|
}
|
|
619
619
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
620
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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": "
|
|
620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", 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 [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" });
|
|
621
621
|
}
|
|
622
622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Switch, decorators: [{
|
|
623
623
|
type: Component,
|
|
624
624
|
args: [{ selector: 'tls-switch', host: {
|
|
625
625
|
role: 'switch',
|
|
626
|
-
'[class]': '
|
|
626
|
+
'[class]': 'hostClasses()',
|
|
627
627
|
'[tabindex]': 'disabled() ? -1 : tabindex()',
|
|
628
628
|
'[attr.aria-checked]': 'checked()',
|
|
629
629
|
'[attr.aria-disabled]': 'disabled()',
|
|
@@ -632,7 +632,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
632
632
|
'(blur)': 'touched.set(true)',
|
|
633
633
|
'(keydown.space)': 'onKeyboardToggle($event)',
|
|
634
634
|
'(keydown.enter)': 'onKeyboardToggle($event)',
|
|
635
|
-
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], template: "<input\n type=\"checkbox\"\n class=\"tls-switch-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n"
|
|
635
|
+
}, providers: [{ provide: FORM_CONTROL, useExisting: forwardRef(() => Switch) }], template: "<input\n type=\"checkbox\"\n class=\"tls-switch-input\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [checked]=\"checked()\"\n/>\n<div class=\"tls-switch-handle\"></div>\n" }]
|
|
636
636
|
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
637
637
|
|
|
638
638
|
const LIGHT_THEME_CLASS = 'tls-light';
|