@tectra-ng/ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +26 -2
- package/amount/README.md +28 -0
- package/autocomplete/README.md +82 -0
- package/avatar/README.md +43 -0
- package/badge/README.md +19 -0
- package/button/README.md +46 -0
- package/button-group/README.md +8 -0
- package/card/README.md +30 -0
- package/cascade-select/README.md +49 -0
- package/checkbox/README.md +64 -0
- package/chip/README.md +38 -0
- package/chips-input/README.md +47 -0
- package/color-picker/README.md +43 -0
- package/confirm/README.md +46 -0
- package/country/README.md +23 -0
- package/country-select/README.md +39 -0
- package/dialog/README.md +84 -0
- package/divider/README.md +24 -0
- package/drawer/README.md +54 -0
- package/email-suggestion/README.md +20 -0
- package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
- package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
- package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-button.mjs +725 -0
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-card.mjs +210 -0
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
- package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
- package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country.mjs +313 -0
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
- package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
- package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
- package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs +492 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
- package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
- package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
- package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input.mjs +260 -0
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-label.mjs +271 -0
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-link.mjs +699 -0
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-message.mjs +975 -0
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
- package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-password.mjs +871 -0
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
- package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
- package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
- package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
- package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
- package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
- package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
- package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
- package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
- package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui.mjs +4 -0
- package/fesm2022/tectra-ng-ui.mjs.map +1 -0
- package/field/README.md +43 -0
- package/fieldset/README.md +36 -0
- package/highlight-text/README.md +20 -0
- package/icon-field/README.md +30 -0
- package/input/README.md +22 -0
- package/input-group/README.md +21 -0
- package/input-mask/README.md +30 -0
- package/input-number/README.md +61 -0
- package/input-otp/README.md +44 -0
- package/key-filter/README.md +31 -0
- package/knob/README.md +50 -0
- package/label/README.md +29 -0
- package/link/README.md +47 -0
- package/listbox/README.md +68 -0
- package/mention-textarea/README.md +47 -0
- package/menu/README.md +65 -0
- package/message/README.md +58 -0
- package/multiselect/README.md +85 -0
- package/overlay-badge/README.md +30 -0
- package/package.json +301 -3
- package/paginator/README.md +60 -0
- package/panel/README.md +45 -0
- package/password/README.md +60 -0
- package/password-generator/README.md +34 -0
- package/pill/README.md +42 -0
- package/popover/README.md +67 -0
- package/progress-bar/README.md +32 -0
- package/progress-spinner/README.md +22 -0
- package/radio-button/README.md +54 -0
- package/rating/README.md +49 -0
- package/select/README.md +78 -0
- package/skeleton/README.md +27 -0
- package/slider/README.md +48 -0
- package/speed-dial/README.md +49 -0
- package/split-button/README.md +45 -0
- package/status-icon/README.md +22 -0
- package/table/README.md +178 -0
- package/tag/README.md +42 -0
- package/textarea/README.md +37 -0
- package/toast/README.md +52 -0
- package/toggle-button/README.md +34 -0
- package/toggle-switch/README.md +49 -0
- package/tooltip/README.md +60 -0
- package/tree-select/README.md +49 -0
- package/types/tectra-ng-ui-amount.d.ts +135 -0
- package/types/tectra-ng-ui-amount.d.ts.map +1 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
- package/types/tectra-ng-ui-avatar.d.ts +289 -0
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
- package/types/tectra-ng-ui-badge.d.ts +119 -0
- package/types/tectra-ng-ui-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-button-group.d.ts +6 -0
- package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-button.d.ts +466 -0
- package/types/tectra-ng-ui-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-card.d.ts +71 -0
- package/types/tectra-ng-ui-card.d.ts.map +1 -0
- package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-checkbox.d.ts +450 -0
- package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-chip.d.ts +106 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -0
- package/types/tectra-ng-ui-chips-input.d.ts +187 -0
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-color-picker.d.ts +237 -0
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
- package/types/tectra-ng-ui-confirm.d.ts +80 -0
- package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
- package/types/tectra-ng-ui-country-select.d.ts +235 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-country.d.ts +105 -0
- package/types/tectra-ng-ui-country.d.ts.map +1 -0
- package/types/tectra-ng-ui-dialog.d.ts +453 -0
- package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
- package/types/tectra-ng-ui-divider.d.ts +70 -0
- package/types/tectra-ng-ui-divider.d.ts.map +1 -0
- package/types/tectra-ng-ui-drawer.d.ts +188 -0
- package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
- package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
- package/types/tectra-ng-ui-field.d.ts +139 -0
- package/types/tectra-ng-ui-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +74 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
- package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
- package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
- package/types/tectra-ng-ui-icon-field.d.ts +77 -0
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-group.d.ts +18 -0
- package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-mask.d.ts +91 -0
- package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-number.d.ts +326 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
- package/types/tectra-ng-ui-input-otp.d.ts +173 -0
- package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
- package/types/tectra-ng-ui-input.d.ts +113 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -0
- package/types/tectra-ng-ui-key-filter.d.ts +43 -0
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
- package/types/tectra-ng-ui-knob.d.ts +207 -0
- package/types/tectra-ng-ui-knob.d.ts.map +1 -0
- package/types/tectra-ng-ui-label.d.ts +53 -0
- package/types/tectra-ng-ui-label.d.ts.map +1 -0
- package/types/tectra-ng-ui-link.d.ts +223 -0
- package/types/tectra-ng-ui-link.d.ts.map +1 -0
- package/types/tectra-ng-ui-listbox.d.ts +131 -0
- package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-menu.d.ts +512 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-message.d.ts +390 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -0
- package/types/tectra-ng-ui-multiselect.d.ts +216 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
- package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
- package/types/tectra-ng-ui-paginator.d.ts +293 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel.d.ts +133 -0
- package/types/tectra-ng-ui-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-password-generator.d.ts +80 -0
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
- package/types/tectra-ng-ui-password.d.ts +271 -0
- package/types/tectra-ng-ui-password.d.ts.map +1 -0
- package/types/tectra-ng-ui-pill.d.ts +167 -0
- package/types/tectra-ng-ui-pill.d.ts.map +1 -0
- package/types/tectra-ng-ui-popover.d.ts +244 -0
- package/types/tectra-ng-ui-popover.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
- package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
- package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
- package/types/tectra-ng-ui-radio-button.d.ts +380 -0
- package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-rating.d.ts +195 -0
- package/types/tectra-ng-ui-rating.d.ts.map +1 -0
- package/types/tectra-ng-ui-select.d.ts +761 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -0
- package/types/tectra-ng-ui-skeleton.d.ts +182 -0
- package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
- package/types/tectra-ng-ui-slider.d.ts +220 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -0
- package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
- package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
- package/types/tectra-ng-ui-split-button.d.ts +139 -0
- package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-status-icon.d.ts +105 -0
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +1301 -0
- package/types/tectra-ng-ui-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tag.d.ts +157 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +146 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
- package/types/tectra-ng-ui-toast.d.ts +268 -0
- package/types/tectra-ng-ui-toast.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
- package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
- package/types/tectra-ng-ui-tooltip.d.ts +275 -0
- package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-select.d.ts +339 -0
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
- package/types/tectra-ng-ui.d.ts +2 -0
- package/types/tectra-ng-ui.d.ts.map +1 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, booleanAttribute, computed, contentChild, forwardRef, inject, input, output, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
6
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
7
|
+
import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
8
|
+
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
9
|
+
import { TxIcon, TxIconRegistry } from "@tectra-ng/icons";
|
|
10
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
11
|
+
var TxToggleSwitchHandleTemplate = class TxToggleSwitchHandleTemplate {
|
|
12
|
+
templateRef = inject(TemplateRef);
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
14
|
+
minVersion: "12.0.0",
|
|
15
|
+
version: "22.2.3",
|
|
16
|
+
ngImport: i0,
|
|
17
|
+
type: TxToggleSwitchHandleTemplate,
|
|
18
|
+
deps: [],
|
|
19
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
20
|
+
});
|
|
21
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
22
|
+
minVersion: "14.0.0",
|
|
23
|
+
version: "22.2.3",
|
|
24
|
+
type: TxToggleSwitchHandleTemplate,
|
|
25
|
+
isStandalone: true,
|
|
26
|
+
selector: "ng-template[txToggleSwitchHandle]",
|
|
27
|
+
ngImport: i0
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
31
|
+
minVersion: "12.0.0",
|
|
32
|
+
version: "22.2.3",
|
|
33
|
+
ngImport: i0,
|
|
34
|
+
type: TxToggleSwitchHandleTemplate,
|
|
35
|
+
decorators: [{
|
|
36
|
+
type: Directive,
|
|
37
|
+
args: [{ selector: "ng-template[txToggleSwitchHandle]" }]
|
|
38
|
+
}]
|
|
39
|
+
});
|
|
40
|
+
var TxToggleSwitch = class TxToggleSwitch extends TxFormControlBase {
|
|
41
|
+
txIconRegistry = inject(TxIconRegistry);
|
|
42
|
+
generatedId = uniqueId("tx-toggle-switch");
|
|
43
|
+
label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
44
|
+
description = input(void 0, ...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
|
|
45
|
+
labelPosition = input("end", ...ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []);
|
|
46
|
+
trueValue = input(true, ...ngDevMode ? [{ debugName: "trueValue" }] : /* istanbul ignore next */ []);
|
|
47
|
+
falseValue = input(false, ...ngDevMode ? [{ debugName: "falseValue" }] : /* istanbul ignore next */ []);
|
|
48
|
+
onIcon = input(void 0, ...ngDevMode ? [{ debugName: "onIcon" }] : /* istanbul ignore next */ []);
|
|
49
|
+
offIcon = input(void 0, ...ngDevMode ? [{ debugName: "offIcon" }] : /* istanbul ignore next */ []);
|
|
50
|
+
size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
51
|
+
invalid = input(void 0, {
|
|
52
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
53
|
+
transform: optionalBoolean
|
|
54
|
+
});
|
|
55
|
+
disabledInput = input(false, {
|
|
56
|
+
...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
|
|
57
|
+
alias: "disabled",
|
|
58
|
+
transform: booleanAttribute
|
|
59
|
+
});
|
|
60
|
+
readonly = input(false, {
|
|
61
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
62
|
+
transform: booleanAttribute
|
|
63
|
+
});
|
|
64
|
+
required = input(false, {
|
|
65
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
66
|
+
transform: booleanAttribute
|
|
67
|
+
});
|
|
68
|
+
name = input(void 0, ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
69
|
+
inputId = input(void 0, ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
|
|
70
|
+
ariaLabel = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
71
|
+
ariaLabelledBy = input(void 0, ...ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
72
|
+
tabindex = input(void 0, {
|
|
73
|
+
...ngDevMode ? { debugName: "tabindex" } : /* istanbul ignore next */ {},
|
|
74
|
+
transform: optionalNumber
|
|
75
|
+
});
|
|
76
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
77
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
78
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
79
|
+
unstyled = input(void 0, {
|
|
80
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
81
|
+
transform: optionalBoolean
|
|
82
|
+
});
|
|
83
|
+
changed = output();
|
|
84
|
+
handleTemplate = contentChild(TxToggleSwitchHandleTemplate, ...ngDevMode ? [{ debugName: "handleTemplate" }] : /* istanbul ignore next */ []);
|
|
85
|
+
inputRef = viewChild.required("input", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
|
|
86
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
87
|
+
passThrough = injectPassThrough("toggleSwitch", this, this.pt, this.ptOptions);
|
|
88
|
+
isInvalid = injectFieldInvalid(this.invalid);
|
|
89
|
+
resolvedId = computed(() => this.inputId() ?? this.generatedId, ...ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []);
|
|
90
|
+
descriptionId = `${this.generatedId}-description`;
|
|
91
|
+
isDisabled = computed(() => this.disabled() || this.disabledInput(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
92
|
+
checked = computed(() => this.value() === this.trueValue(), ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
|
|
93
|
+
handleIcon = computed(() => this.checked() ? this.onIcon() : this.offIcon(), ...ngDevMode ? [{ debugName: "handleIcon" }] : /* istanbul ignore next */ []);
|
|
94
|
+
handleIconName = computed(() => {
|
|
95
|
+
const icon = this.handleIcon();
|
|
96
|
+
return icon && this.txIconRegistry.has(icon) ? icon : null;
|
|
97
|
+
}, ...ngDevMode ? [{ debugName: "handleIconName" }] : /* istanbul ignore next */ []);
|
|
98
|
+
hostStyle = computed(() => ({
|
|
99
|
+
...toStyleObject(this.dt(), "--tx-toggle-switch"),
|
|
100
|
+
...this.passThrough().root?.style
|
|
101
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
102
|
+
writeValue(value) {
|
|
103
|
+
super.writeValue(value === void 0 || value === null ? this.falseValue() : value);
|
|
104
|
+
}
|
|
105
|
+
focus() {
|
|
106
|
+
this.inputRef().nativeElement.focus();
|
|
107
|
+
}
|
|
108
|
+
onInputClick(event) {
|
|
109
|
+
if (this.readonly()) event.preventDefault();
|
|
110
|
+
}
|
|
111
|
+
onInputChange(event) {
|
|
112
|
+
const checked = event.target.checked;
|
|
113
|
+
const value = checked ? this.trueValue() : this.falseValue();
|
|
114
|
+
this.updateValue(value);
|
|
115
|
+
this.changed.emit({
|
|
116
|
+
checked,
|
|
117
|
+
value,
|
|
118
|
+
originalEvent: event
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
onBlur() {
|
|
122
|
+
this.markTouched();
|
|
123
|
+
}
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
125
|
+
minVersion: "12.0.0",
|
|
126
|
+
version: "22.2.3",
|
|
127
|
+
ngImport: i0,
|
|
128
|
+
type: TxToggleSwitch,
|
|
129
|
+
deps: null,
|
|
130
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
131
|
+
});
|
|
132
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
133
|
+
minVersion: "17.0.0",
|
|
134
|
+
version: "22.2.3",
|
|
135
|
+
type: TxToggleSwitch,
|
|
136
|
+
isStandalone: true,
|
|
137
|
+
selector: "tx-toggle-switch",
|
|
138
|
+
inputs: {
|
|
139
|
+
label: {
|
|
140
|
+
classPropertyName: "label",
|
|
141
|
+
publicName: "label",
|
|
142
|
+
isSignal: true,
|
|
143
|
+
isRequired: false,
|
|
144
|
+
transformFunction: null
|
|
145
|
+
},
|
|
146
|
+
description: {
|
|
147
|
+
classPropertyName: "description",
|
|
148
|
+
publicName: "description",
|
|
149
|
+
isSignal: true,
|
|
150
|
+
isRequired: false,
|
|
151
|
+
transformFunction: null
|
|
152
|
+
},
|
|
153
|
+
labelPosition: {
|
|
154
|
+
classPropertyName: "labelPosition",
|
|
155
|
+
publicName: "labelPosition",
|
|
156
|
+
isSignal: true,
|
|
157
|
+
isRequired: false,
|
|
158
|
+
transformFunction: null
|
|
159
|
+
},
|
|
160
|
+
trueValue: {
|
|
161
|
+
classPropertyName: "trueValue",
|
|
162
|
+
publicName: "trueValue",
|
|
163
|
+
isSignal: true,
|
|
164
|
+
isRequired: false,
|
|
165
|
+
transformFunction: null
|
|
166
|
+
},
|
|
167
|
+
falseValue: {
|
|
168
|
+
classPropertyName: "falseValue",
|
|
169
|
+
publicName: "falseValue",
|
|
170
|
+
isSignal: true,
|
|
171
|
+
isRequired: false,
|
|
172
|
+
transformFunction: null
|
|
173
|
+
},
|
|
174
|
+
onIcon: {
|
|
175
|
+
classPropertyName: "onIcon",
|
|
176
|
+
publicName: "onIcon",
|
|
177
|
+
isSignal: true,
|
|
178
|
+
isRequired: false,
|
|
179
|
+
transformFunction: null
|
|
180
|
+
},
|
|
181
|
+
offIcon: {
|
|
182
|
+
classPropertyName: "offIcon",
|
|
183
|
+
publicName: "offIcon",
|
|
184
|
+
isSignal: true,
|
|
185
|
+
isRequired: false,
|
|
186
|
+
transformFunction: null
|
|
187
|
+
},
|
|
188
|
+
size: {
|
|
189
|
+
classPropertyName: "size",
|
|
190
|
+
publicName: "size",
|
|
191
|
+
isSignal: true,
|
|
192
|
+
isRequired: false,
|
|
193
|
+
transformFunction: null
|
|
194
|
+
},
|
|
195
|
+
invalid: {
|
|
196
|
+
classPropertyName: "invalid",
|
|
197
|
+
publicName: "invalid",
|
|
198
|
+
isSignal: true,
|
|
199
|
+
isRequired: false,
|
|
200
|
+
transformFunction: null
|
|
201
|
+
},
|
|
202
|
+
disabledInput: {
|
|
203
|
+
classPropertyName: "disabledInput",
|
|
204
|
+
publicName: "disabled",
|
|
205
|
+
isSignal: true,
|
|
206
|
+
isRequired: false,
|
|
207
|
+
transformFunction: null
|
|
208
|
+
},
|
|
209
|
+
readonly: {
|
|
210
|
+
classPropertyName: "readonly",
|
|
211
|
+
publicName: "readonly",
|
|
212
|
+
isSignal: true,
|
|
213
|
+
isRequired: false,
|
|
214
|
+
transformFunction: null
|
|
215
|
+
},
|
|
216
|
+
required: {
|
|
217
|
+
classPropertyName: "required",
|
|
218
|
+
publicName: "required",
|
|
219
|
+
isSignal: true,
|
|
220
|
+
isRequired: false,
|
|
221
|
+
transformFunction: null
|
|
222
|
+
},
|
|
223
|
+
name: {
|
|
224
|
+
classPropertyName: "name",
|
|
225
|
+
publicName: "name",
|
|
226
|
+
isSignal: true,
|
|
227
|
+
isRequired: false,
|
|
228
|
+
transformFunction: null
|
|
229
|
+
},
|
|
230
|
+
inputId: {
|
|
231
|
+
classPropertyName: "inputId",
|
|
232
|
+
publicName: "inputId",
|
|
233
|
+
isSignal: true,
|
|
234
|
+
isRequired: false,
|
|
235
|
+
transformFunction: null
|
|
236
|
+
},
|
|
237
|
+
ariaLabel: {
|
|
238
|
+
classPropertyName: "ariaLabel",
|
|
239
|
+
publicName: "ariaLabel",
|
|
240
|
+
isSignal: true,
|
|
241
|
+
isRequired: false,
|
|
242
|
+
transformFunction: null
|
|
243
|
+
},
|
|
244
|
+
ariaLabelledBy: {
|
|
245
|
+
classPropertyName: "ariaLabelledBy",
|
|
246
|
+
publicName: "ariaLabelledBy",
|
|
247
|
+
isSignal: true,
|
|
248
|
+
isRequired: false,
|
|
249
|
+
transformFunction: null
|
|
250
|
+
},
|
|
251
|
+
tabindex: {
|
|
252
|
+
classPropertyName: "tabindex",
|
|
253
|
+
publicName: "tabindex",
|
|
254
|
+
isSignal: true,
|
|
255
|
+
isRequired: false,
|
|
256
|
+
transformFunction: null
|
|
257
|
+
},
|
|
258
|
+
dt: {
|
|
259
|
+
classPropertyName: "dt",
|
|
260
|
+
publicName: "dt",
|
|
261
|
+
isSignal: true,
|
|
262
|
+
isRequired: false,
|
|
263
|
+
transformFunction: null
|
|
264
|
+
},
|
|
265
|
+
pt: {
|
|
266
|
+
classPropertyName: "pt",
|
|
267
|
+
publicName: "pt",
|
|
268
|
+
isSignal: true,
|
|
269
|
+
isRequired: false,
|
|
270
|
+
transformFunction: null
|
|
271
|
+
},
|
|
272
|
+
ptOptions: {
|
|
273
|
+
classPropertyName: "ptOptions",
|
|
274
|
+
publicName: "ptOptions",
|
|
275
|
+
isSignal: true,
|
|
276
|
+
isRequired: false,
|
|
277
|
+
transformFunction: null
|
|
278
|
+
},
|
|
279
|
+
unstyled: {
|
|
280
|
+
classPropertyName: "unstyled",
|
|
281
|
+
publicName: "unstyled",
|
|
282
|
+
isSignal: true,
|
|
283
|
+
isRequired: false,
|
|
284
|
+
transformFunction: null
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
outputs: { changed: "changed" },
|
|
288
|
+
host: {
|
|
289
|
+
properties: {
|
|
290
|
+
"class": "passThrough().root?.class",
|
|
291
|
+
"style": "hostStyle()",
|
|
292
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
293
|
+
"attr.data-size": "size()",
|
|
294
|
+
"attr.data-label-position": "labelPosition()",
|
|
295
|
+
"class.tx-toggle-switch--checked": "checked()",
|
|
296
|
+
"class.tx-toggle-switch--disabled": "isDisabled()",
|
|
297
|
+
"class.tx-toggle-switch--readonly": "readonly()",
|
|
298
|
+
"class.tx-toggle-switch--invalid": "isInvalid()"
|
|
299
|
+
},
|
|
300
|
+
classAttribute: "tx-toggle-switch"
|
|
301
|
+
},
|
|
302
|
+
providers: [{
|
|
303
|
+
provide: NG_VALUE_ACCESSOR,
|
|
304
|
+
useExisting: forwardRef(() => TxToggleSwitch),
|
|
305
|
+
multi: true
|
|
306
|
+
}],
|
|
307
|
+
queries: [{
|
|
308
|
+
propertyName: "handleTemplate",
|
|
309
|
+
first: true,
|
|
310
|
+
predicate: TxToggleSwitchHandleTemplate,
|
|
311
|
+
descendants: true,
|
|
312
|
+
isSignal: true
|
|
313
|
+
}],
|
|
314
|
+
viewQueries: [{
|
|
315
|
+
propertyName: "inputRef",
|
|
316
|
+
first: true,
|
|
317
|
+
predicate: ["input"],
|
|
318
|
+
descendants: true,
|
|
319
|
+
isSignal: true
|
|
320
|
+
}],
|
|
321
|
+
usesInheritance: true,
|
|
322
|
+
ngImport: i0,
|
|
323
|
+
template: "<span class=\"tx-toggle-switch__track\" [class]=\"passThrough().track?.class\" [style]=\"passThrough().track?.style\">\n <input\n #input\n type=\"checkbox\"\n role=\"switch\"\n class=\"tx-toggle-switch__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.aria-checked]=\"checked()\"\n [attr.name]=\"name() ?? null\"\n [attr.tabindex]=\"tabindex() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"tx-toggle-switch__handle\" aria-hidden=\"true\" [class]=\"passThrough().handle?.class\" [style]=\"passThrough().handle?.style\">\n @if (handleTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: checked() }\" />\n } @else if (handleIcon(); as icon) {\n @if (handleIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n }\n </span>\n</span>\n<span class=\"tx-toggle-switch__text\">\n <label class=\"tx-toggle-switch__label\" [for]=\"resolvedId()\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\"\n >{{ label() }}<ng-content\n /></label>\n @if (description()) {\n <span\n class=\"tx-toggle-switch__description\"\n [id]=\"descriptionId\"\n [class]=\"passThrough().description?.class\"\n [style]=\"passThrough().description?.style\"\n >{{ description() }}</span\n >\n }\n</span>\n",
|
|
324
|
+
styles: [":host{display:inline-flex;align-items:flex-start;vertical-align:top}:host([data-label-position=start]){flex-direction:row-reverse}:host([data-styled]){--_width: var(--tx-toggle-switch-width);--_height: var(--tx-toggle-switch-height);--_handle: var(--tx-toggle-switch-handle-size);--_icon: var(--tx-toggle-switch-handle-icon-size);--_label-font-size: var(--tx-toggle-switch-label-font-size);gap:var(--tx-toggle-switch-gap);font-family:var(--tx-font-family)}:host([data-styled][data-size=small]){--_width: var(--tx-toggle-switch-sm-width);--_height: var(--tx-toggle-switch-sm-height);--_handle: var(--tx-toggle-switch-sm-handle-size);--_icon: var(--tx-toggle-switch-sm-icon-size);--_label-font-size: var(--tx-toggle-switch-sm-label-font-size)}:host([data-styled][data-size=large]){--_width: var(--tx-toggle-switch-lg-width);--_height: var(--tx-toggle-switch-lg-height);--_handle: var(--tx-toggle-switch-lg-handle-size);--_icon: var(--tx-toggle-switch-lg-icon-size);--_label-font-size: var(--tx-toggle-switch-lg-label-font-size)}.tx-toggle-switch__track{position:relative;display:inline-flex;flex-shrink:0}.tx-toggle-switch__input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.tx-toggle-switch__input:disabled{cursor:not-allowed}:host([data-styled]) .tx-toggle-switch__track{width:var(--_width);height:var(--_height);margin-top:max(0px,(var(--_label-font-size) * 1.5 - var(--_height)) / 2);border-radius:var(--tx-toggle-switch-border-radius);background:var(--tx-toggle-switch-background);transition:background-color var(--tx-toggle-switch-transition-duration)}:host([data-styled]) .tx-toggle-switch__handle{position:absolute;top:50%;left:var(--tx-toggle-switch-gutter);display:inline-flex;align-items:center;justify-content:center;width:var(--_handle);height:var(--_handle);border-radius:50%;background:var(--tx-toggle-switch-handle-background);box-shadow:var(--tx-toggle-switch-handle-shadow);color:var(--tx-toggle-switch-handle-icon-color);font-size:var(--_icon);transform:translateY(-50%);transition:left var(--tx-toggle-switch-transition-duration) cubic-bezier(.2,0,0,1),background-color var(--tx-toggle-switch-transition-duration),color var(--tx-toggle-switch-transition-duration)}:host([data-styled].tx-toggle-switch--checked) .tx-toggle-switch__track{background:var(--tx-toggle-switch-checked-background)}:host([data-styled].tx-toggle-switch--checked) .tx-toggle-switch__handle{left:calc(100% - var(--_handle) - var(--tx-toggle-switch-gutter));background:var(--tx-toggle-switch-handle-checked-background);color:var(--tx-toggle-switch-handle-checked-icon-color)}:host([data-styled]:not(.tx-toggle-switch--disabled):not(.tx-toggle-switch--readonly)) .tx-toggle-switch__track:hover{background:var(--tx-toggle-switch-hover-background)}:host([data-styled].tx-toggle-switch--checked:not(.tx-toggle-switch--disabled):not(.tx-toggle-switch--readonly)) .tx-toggle-switch__track:hover{background:var(--tx-toggle-switch-checked-hover-background)}:host([data-styled]) .tx-toggle-switch__track:has(.tx-toggle-switch__input:focus-visible){outline:var(--tx-toggle-switch-focus-ring-width) solid var(--tx-toggle-switch-focus-ring-color);outline-offset:var(--tx-toggle-switch-focus-ring-offset)}:host([data-styled].tx-toggle-switch--invalid) .tx-toggle-switch__track{box-shadow:0 0 0 1px var(--tx-toggle-switch-invalid-ring-color)}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__track{background:var(--tx-toggle-switch-disabled-background)}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__handle{background:var(--tx-toggle-switch-handle-disabled-background);box-shadow:none}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__label{color:var(--tx-toggle-switch-disabled-label-color);cursor:not-allowed}:host([data-styled].tx-toggle-switch--disabled.tx-toggle-switch--checked) .tx-toggle-switch__track{background:var(--tx-toggle-switch-disabled-checked-background)}:host(.tx-toggle-switch--readonly) .tx-toggle-switch__input,:host(.tx-toggle-switch--readonly) .tx-toggle-switch__label{cursor:default}.tx-toggle-switch__text{display:flex;flex-direction:column;min-width:0}.tx-toggle-switch__label:empty{display:none}:host([data-styled]) .tx-toggle-switch__label{color:var(--tx-toggle-switch-label-color);font-size:var(--_label-font-size);line-height:1.5;cursor:pointer}:host([data-styled]) .tx-toggle-switch__description{color:var(--tx-toggle-switch-description-color);font-size:var(--tx-toggle-switch-description-font-size);line-height:1.45}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-toggle-switch__track,:host([data-styled]) .tx-toggle-switch__handle{transition:none}}\n"],
|
|
325
|
+
dependencies: [{
|
|
326
|
+
kind: "directive",
|
|
327
|
+
type: NgTemplateOutlet,
|
|
328
|
+
selector: "[ngTemplateOutlet]",
|
|
329
|
+
inputs: [
|
|
330
|
+
"ngTemplateOutletContext",
|
|
331
|
+
"ngTemplateOutlet",
|
|
332
|
+
"ngTemplateOutletInjector"
|
|
333
|
+
]
|
|
334
|
+
}, {
|
|
335
|
+
kind: "component",
|
|
336
|
+
type: TxIcon,
|
|
337
|
+
selector: "tx-icon",
|
|
338
|
+
inputs: ["name"]
|
|
339
|
+
}],
|
|
340
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
344
|
+
minVersion: "12.0.0",
|
|
345
|
+
version: "22.2.3",
|
|
346
|
+
ngImport: i0,
|
|
347
|
+
type: TxToggleSwitch,
|
|
348
|
+
decorators: [{
|
|
349
|
+
type: Component,
|
|
350
|
+
args: [{
|
|
351
|
+
selector: "tx-toggle-switch",
|
|
352
|
+
imports: [NgTemplateOutlet, TxIcon],
|
|
353
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
354
|
+
providers: [{
|
|
355
|
+
provide: NG_VALUE_ACCESSOR,
|
|
356
|
+
useExisting: forwardRef(() => TxToggleSwitch),
|
|
357
|
+
multi: true
|
|
358
|
+
}],
|
|
359
|
+
host: {
|
|
360
|
+
class: "tx-toggle-switch",
|
|
361
|
+
"[class]": "passThrough().root?.class",
|
|
362
|
+
"[style]": "hostStyle()",
|
|
363
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
364
|
+
"[attr.data-size]": "size()",
|
|
365
|
+
"[attr.data-label-position]": "labelPosition()",
|
|
366
|
+
"[class.tx-toggle-switch--checked]": "checked()",
|
|
367
|
+
"[class.tx-toggle-switch--disabled]": "isDisabled()",
|
|
368
|
+
"[class.tx-toggle-switch--readonly]": "readonly()",
|
|
369
|
+
"[class.tx-toggle-switch--invalid]": "isInvalid()"
|
|
370
|
+
},
|
|
371
|
+
template: "<span class=\"tx-toggle-switch__track\" [class]=\"passThrough().track?.class\" [style]=\"passThrough().track?.style\">\n <input\n #input\n type=\"checkbox\"\n role=\"switch\"\n class=\"tx-toggle-switch__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.aria-checked]=\"checked()\"\n [attr.name]=\"name() ?? null\"\n [attr.tabindex]=\"tabindex() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"tx-toggle-switch__handle\" aria-hidden=\"true\" [class]=\"passThrough().handle?.class\" [style]=\"passThrough().handle?.style\">\n @if (handleTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: checked() }\" />\n } @else if (handleIcon(); as icon) {\n @if (handleIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n }\n </span>\n</span>\n<span class=\"tx-toggle-switch__text\">\n <label class=\"tx-toggle-switch__label\" [for]=\"resolvedId()\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\"\n >{{ label() }}<ng-content\n /></label>\n @if (description()) {\n <span\n class=\"tx-toggle-switch__description\"\n [id]=\"descriptionId\"\n [class]=\"passThrough().description?.class\"\n [style]=\"passThrough().description?.style\"\n >{{ description() }}</span\n >\n }\n</span>\n",
|
|
372
|
+
styles: [":host{display:inline-flex;align-items:flex-start;vertical-align:top}:host([data-label-position=start]){flex-direction:row-reverse}:host([data-styled]){--_width: var(--tx-toggle-switch-width);--_height: var(--tx-toggle-switch-height);--_handle: var(--tx-toggle-switch-handle-size);--_icon: var(--tx-toggle-switch-handle-icon-size);--_label-font-size: var(--tx-toggle-switch-label-font-size);gap:var(--tx-toggle-switch-gap);font-family:var(--tx-font-family)}:host([data-styled][data-size=small]){--_width: var(--tx-toggle-switch-sm-width);--_height: var(--tx-toggle-switch-sm-height);--_handle: var(--tx-toggle-switch-sm-handle-size);--_icon: var(--tx-toggle-switch-sm-icon-size);--_label-font-size: var(--tx-toggle-switch-sm-label-font-size)}:host([data-styled][data-size=large]){--_width: var(--tx-toggle-switch-lg-width);--_height: var(--tx-toggle-switch-lg-height);--_handle: var(--tx-toggle-switch-lg-handle-size);--_icon: var(--tx-toggle-switch-lg-icon-size);--_label-font-size: var(--tx-toggle-switch-lg-label-font-size)}.tx-toggle-switch__track{position:relative;display:inline-flex;flex-shrink:0}.tx-toggle-switch__input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.tx-toggle-switch__input:disabled{cursor:not-allowed}:host([data-styled]) .tx-toggle-switch__track{width:var(--_width);height:var(--_height);margin-top:max(0px,(var(--_label-font-size) * 1.5 - var(--_height)) / 2);border-radius:var(--tx-toggle-switch-border-radius);background:var(--tx-toggle-switch-background);transition:background-color var(--tx-toggle-switch-transition-duration)}:host([data-styled]) .tx-toggle-switch__handle{position:absolute;top:50%;left:var(--tx-toggle-switch-gutter);display:inline-flex;align-items:center;justify-content:center;width:var(--_handle);height:var(--_handle);border-radius:50%;background:var(--tx-toggle-switch-handle-background);box-shadow:var(--tx-toggle-switch-handle-shadow);color:var(--tx-toggle-switch-handle-icon-color);font-size:var(--_icon);transform:translateY(-50%);transition:left var(--tx-toggle-switch-transition-duration) cubic-bezier(.2,0,0,1),background-color var(--tx-toggle-switch-transition-duration),color var(--tx-toggle-switch-transition-duration)}:host([data-styled].tx-toggle-switch--checked) .tx-toggle-switch__track{background:var(--tx-toggle-switch-checked-background)}:host([data-styled].tx-toggle-switch--checked) .tx-toggle-switch__handle{left:calc(100% - var(--_handle) - var(--tx-toggle-switch-gutter));background:var(--tx-toggle-switch-handle-checked-background);color:var(--tx-toggle-switch-handle-checked-icon-color)}:host([data-styled]:not(.tx-toggle-switch--disabled):not(.tx-toggle-switch--readonly)) .tx-toggle-switch__track:hover{background:var(--tx-toggle-switch-hover-background)}:host([data-styled].tx-toggle-switch--checked:not(.tx-toggle-switch--disabled):not(.tx-toggle-switch--readonly)) .tx-toggle-switch__track:hover{background:var(--tx-toggle-switch-checked-hover-background)}:host([data-styled]) .tx-toggle-switch__track:has(.tx-toggle-switch__input:focus-visible){outline:var(--tx-toggle-switch-focus-ring-width) solid var(--tx-toggle-switch-focus-ring-color);outline-offset:var(--tx-toggle-switch-focus-ring-offset)}:host([data-styled].tx-toggle-switch--invalid) .tx-toggle-switch__track{box-shadow:0 0 0 1px var(--tx-toggle-switch-invalid-ring-color)}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__track{background:var(--tx-toggle-switch-disabled-background)}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__handle{background:var(--tx-toggle-switch-handle-disabled-background);box-shadow:none}:host([data-styled].tx-toggle-switch--disabled) .tx-toggle-switch__label{color:var(--tx-toggle-switch-disabled-label-color);cursor:not-allowed}:host([data-styled].tx-toggle-switch--disabled.tx-toggle-switch--checked) .tx-toggle-switch__track{background:var(--tx-toggle-switch-disabled-checked-background)}:host(.tx-toggle-switch--readonly) .tx-toggle-switch__input,:host(.tx-toggle-switch--readonly) .tx-toggle-switch__label{cursor:default}.tx-toggle-switch__text{display:flex;flex-direction:column;min-width:0}.tx-toggle-switch__label:empty{display:none}:host([data-styled]) .tx-toggle-switch__label{color:var(--tx-toggle-switch-label-color);font-size:var(--_label-font-size);line-height:1.5;cursor:pointer}:host([data-styled]) .tx-toggle-switch__description{color:var(--tx-toggle-switch-description-color);font-size:var(--tx-toggle-switch-description-font-size);line-height:1.45}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-toggle-switch__track,:host([data-styled]) .tx-toggle-switch__handle{transition:none}}\n"]
|
|
373
|
+
}]
|
|
374
|
+
}],
|
|
375
|
+
propDecorators: {
|
|
376
|
+
label: [{
|
|
377
|
+
type: i0.Input,
|
|
378
|
+
args: [{
|
|
379
|
+
isSignal: true,
|
|
380
|
+
alias: "label",
|
|
381
|
+
required: false
|
|
382
|
+
}]
|
|
383
|
+
}],
|
|
384
|
+
description: [{
|
|
385
|
+
type: i0.Input,
|
|
386
|
+
args: [{
|
|
387
|
+
isSignal: true,
|
|
388
|
+
alias: "description",
|
|
389
|
+
required: false
|
|
390
|
+
}]
|
|
391
|
+
}],
|
|
392
|
+
labelPosition: [{
|
|
393
|
+
type: i0.Input,
|
|
394
|
+
args: [{
|
|
395
|
+
isSignal: true,
|
|
396
|
+
alias: "labelPosition",
|
|
397
|
+
required: false
|
|
398
|
+
}]
|
|
399
|
+
}],
|
|
400
|
+
trueValue: [{
|
|
401
|
+
type: i0.Input,
|
|
402
|
+
args: [{
|
|
403
|
+
isSignal: true,
|
|
404
|
+
alias: "trueValue",
|
|
405
|
+
required: false
|
|
406
|
+
}]
|
|
407
|
+
}],
|
|
408
|
+
falseValue: [{
|
|
409
|
+
type: i0.Input,
|
|
410
|
+
args: [{
|
|
411
|
+
isSignal: true,
|
|
412
|
+
alias: "falseValue",
|
|
413
|
+
required: false
|
|
414
|
+
}]
|
|
415
|
+
}],
|
|
416
|
+
onIcon: [{
|
|
417
|
+
type: i0.Input,
|
|
418
|
+
args: [{
|
|
419
|
+
isSignal: true,
|
|
420
|
+
alias: "onIcon",
|
|
421
|
+
required: false
|
|
422
|
+
}]
|
|
423
|
+
}],
|
|
424
|
+
offIcon: [{
|
|
425
|
+
type: i0.Input,
|
|
426
|
+
args: [{
|
|
427
|
+
isSignal: true,
|
|
428
|
+
alias: "offIcon",
|
|
429
|
+
required: false
|
|
430
|
+
}]
|
|
431
|
+
}],
|
|
432
|
+
size: [{
|
|
433
|
+
type: i0.Input,
|
|
434
|
+
args: [{
|
|
435
|
+
isSignal: true,
|
|
436
|
+
alias: "size",
|
|
437
|
+
required: false
|
|
438
|
+
}]
|
|
439
|
+
}],
|
|
440
|
+
invalid: [{
|
|
441
|
+
type: i0.Input,
|
|
442
|
+
args: [{
|
|
443
|
+
isSignal: true,
|
|
444
|
+
alias: "invalid",
|
|
445
|
+
required: false
|
|
446
|
+
}]
|
|
447
|
+
}],
|
|
448
|
+
disabledInput: [{
|
|
449
|
+
type: i0.Input,
|
|
450
|
+
args: [{
|
|
451
|
+
isSignal: true,
|
|
452
|
+
alias: "disabled",
|
|
453
|
+
required: false
|
|
454
|
+
}]
|
|
455
|
+
}],
|
|
456
|
+
readonly: [{
|
|
457
|
+
type: i0.Input,
|
|
458
|
+
args: [{
|
|
459
|
+
isSignal: true,
|
|
460
|
+
alias: "readonly",
|
|
461
|
+
required: false
|
|
462
|
+
}]
|
|
463
|
+
}],
|
|
464
|
+
required: [{
|
|
465
|
+
type: i0.Input,
|
|
466
|
+
args: [{
|
|
467
|
+
isSignal: true,
|
|
468
|
+
alias: "required",
|
|
469
|
+
required: false
|
|
470
|
+
}]
|
|
471
|
+
}],
|
|
472
|
+
name: [{
|
|
473
|
+
type: i0.Input,
|
|
474
|
+
args: [{
|
|
475
|
+
isSignal: true,
|
|
476
|
+
alias: "name",
|
|
477
|
+
required: false
|
|
478
|
+
}]
|
|
479
|
+
}],
|
|
480
|
+
inputId: [{
|
|
481
|
+
type: i0.Input,
|
|
482
|
+
args: [{
|
|
483
|
+
isSignal: true,
|
|
484
|
+
alias: "inputId",
|
|
485
|
+
required: false
|
|
486
|
+
}]
|
|
487
|
+
}],
|
|
488
|
+
ariaLabel: [{
|
|
489
|
+
type: i0.Input,
|
|
490
|
+
args: [{
|
|
491
|
+
isSignal: true,
|
|
492
|
+
alias: "ariaLabel",
|
|
493
|
+
required: false
|
|
494
|
+
}]
|
|
495
|
+
}],
|
|
496
|
+
ariaLabelledBy: [{
|
|
497
|
+
type: i0.Input,
|
|
498
|
+
args: [{
|
|
499
|
+
isSignal: true,
|
|
500
|
+
alias: "ariaLabelledBy",
|
|
501
|
+
required: false
|
|
502
|
+
}]
|
|
503
|
+
}],
|
|
504
|
+
tabindex: [{
|
|
505
|
+
type: i0.Input,
|
|
506
|
+
args: [{
|
|
507
|
+
isSignal: true,
|
|
508
|
+
alias: "tabindex",
|
|
509
|
+
required: false
|
|
510
|
+
}]
|
|
511
|
+
}],
|
|
512
|
+
dt: [{
|
|
513
|
+
type: i0.Input,
|
|
514
|
+
args: [{
|
|
515
|
+
isSignal: true,
|
|
516
|
+
alias: "dt",
|
|
517
|
+
required: false
|
|
518
|
+
}]
|
|
519
|
+
}],
|
|
520
|
+
pt: [{
|
|
521
|
+
type: i0.Input,
|
|
522
|
+
args: [{
|
|
523
|
+
isSignal: true,
|
|
524
|
+
alias: "pt",
|
|
525
|
+
required: false
|
|
526
|
+
}]
|
|
527
|
+
}],
|
|
528
|
+
ptOptions: [{
|
|
529
|
+
type: i0.Input,
|
|
530
|
+
args: [{
|
|
531
|
+
isSignal: true,
|
|
532
|
+
alias: "ptOptions",
|
|
533
|
+
required: false
|
|
534
|
+
}]
|
|
535
|
+
}],
|
|
536
|
+
unstyled: [{
|
|
537
|
+
type: i0.Input,
|
|
538
|
+
args: [{
|
|
539
|
+
isSignal: true,
|
|
540
|
+
alias: "unstyled",
|
|
541
|
+
required: false
|
|
542
|
+
}]
|
|
543
|
+
}],
|
|
544
|
+
changed: [{
|
|
545
|
+
type: i0.Output,
|
|
546
|
+
args: ["changed"]
|
|
547
|
+
}],
|
|
548
|
+
handleTemplate: [{
|
|
549
|
+
type: i0.ContentChild,
|
|
550
|
+
args: [i0.forwardRef(() => TxToggleSwitchHandleTemplate), { isSignal: true }]
|
|
551
|
+
}],
|
|
552
|
+
inputRef: [{
|
|
553
|
+
type: i0.ViewChild,
|
|
554
|
+
args: ["input", { isSignal: true }]
|
|
555
|
+
}]
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
export { TxToggleSwitch, TxToggleSwitchHandleTemplate };
|
|
559
|
+
|
|
560
|
+
//# sourceMappingURL=tectra-ng-ui-toggle-switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-toggle-switch.mjs","names":[],"sources":["../../../../packages/ui/toggle-switch/src/toggle-switch-templates.directive.ts","../../../../packages/ui/toggle-switch/src/toggle-switch.component.ts","../../../../packages/ui/toggle-switch/src/toggle-switch.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxToggleSwitchHandleContext } from './toggle-switch.types';\n\n@Directive({ selector: 'ng-template[txToggleSwitchHandle]' })\nexport class TxToggleSwitchHandleTemplate {\n readonly templateRef = inject<TemplateRef<TxToggleSwitchHandleContext>>(TemplateRef);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n contentChild,\n forwardRef,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { TxFormControlBase, injectFieldInvalid } from '@tectra-ng/core/forms';\nimport { optionalBoolean, optionalNumber } from '@tectra-ng/core/utils';\nimport { TxIcon, TxIconName, TxIconRegistry } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraToggleSwitchTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxToggleSwitchHandleTemplate } from './toggle-switch-templates.directive';\nimport { TxToggleSwitchChangeEvent, TxToggleSwitchLabelPosition, TxToggleSwitchPart, TxToggleSwitchSize } from './toggle-switch.types';\n\n@Component({\n selector: 'tx-toggle-switch',\n imports: [NgTemplateOutlet, TxIcon],\n templateUrl: './toggle-switch.component.html',\n styleUrl: './toggle-switch.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TxToggleSwitch), multi: true }],\n host: {\n class: 'tx-toggle-switch',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-size]': 'size()',\n '[attr.data-label-position]': 'labelPosition()',\n '[class.tx-toggle-switch--checked]': 'checked()',\n '[class.tx-toggle-switch--disabled]': 'isDisabled()',\n '[class.tx-toggle-switch--readonly]': 'readonly()',\n '[class.tx-toggle-switch--invalid]': 'isInvalid()',\n },\n})\nexport class TxToggleSwitch extends TxFormControlBase<unknown> {\n private txIconRegistry = inject(TxIconRegistry);\n private generatedId = uniqueId('tx-toggle-switch');\n\n readonly label = input<string | undefined>(undefined);\n readonly description = input<string | undefined>(undefined);\n readonly labelPosition = input<TxToggleSwitchLabelPosition>('end');\n readonly trueValue = input<unknown>(true);\n readonly falseValue = input<unknown>(false);\n readonly onIcon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly offIcon = input<TxIconName | (string & {}) | undefined>(undefined);\n readonly size = input<TxToggleSwitchSize>('medium');\n readonly invalid = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n readonly disabledInput = input<boolean, unknown>(false, { alias: 'disabled', transform: booleanAttribute });\n readonly readonly = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly required = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly name = input<string | undefined>(undefined);\n readonly inputId = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly ariaLabelledBy = input<string | undefined>(undefined);\n readonly tabindex = input<number | undefined, unknown>(undefined, { transform: optionalNumber });\n readonly dt = input<TectraDeepPartial<TectraToggleSwitchTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxToggleSwitchPart, TxToggleSwitch> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly changed = output<TxToggleSwitchChangeEvent>();\n\n readonly handleTemplate = contentChild(TxToggleSwitchHandleTemplate);\n readonly inputRef = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('toggleSwitch', this, this.pt, this.ptOptions);\n readonly isInvalid = injectFieldInvalid(this.invalid);\n\n readonly resolvedId = computed(() => this.inputId() ?? this.generatedId);\n readonly descriptionId = `${this.generatedId}-description`;\n readonly isDisabled = computed(() => this.disabled() || this.disabledInput());\n readonly checked = computed(() => this.value() === this.trueValue());\n readonly handleIcon = computed(() => (this.checked() ? this.onIcon() : this.offIcon()));\n readonly handleIconName = computed(() => {\n const icon = this.handleIcon();\n return icon && this.txIconRegistry.has(icon) ? icon : null;\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-toggle-switch'), ...this.passThrough().root?.style }));\n\n override writeValue(value: unknown): void {\n super.writeValue(value === undefined || value === null ? this.falseValue() : value);\n }\n\n focus(): void {\n this.inputRef().nativeElement.focus();\n }\n\n onInputClick(event: MouseEvent): void {\n if (this.readonly()) {\n event.preventDefault();\n }\n }\n\n onInputChange(event: Event): void {\n const checked = (event.target as HTMLInputElement).checked;\n const value = checked ? this.trueValue() : this.falseValue();\n this.updateValue(value);\n this.changed.emit({ checked, value, originalEvent: event });\n }\n\n onBlur(): void {\n this.markTouched();\n }\n}\n","<span class=\"tx-toggle-switch__track\" [class]=\"passThrough().track?.class\" [style]=\"passThrough().track?.style\">\n <input\n #input\n type=\"checkbox\"\n role=\"switch\"\n class=\"tx-toggle-switch__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.aria-checked]=\"checked()\"\n [attr.name]=\"name() ?? null\"\n [attr.tabindex]=\"tabindex() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-readonly]=\"readonly() || null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n />\n <span class=\"tx-toggle-switch__handle\" aria-hidden=\"true\" [class]=\"passThrough().handle?.class\" [style]=\"passThrough().handle?.style\">\n @if (handleTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: checked() }\" />\n } @else if (handleIcon(); as icon) {\n @if (handleIconName(); as name) {\n <tx-icon [name]=\"name\" />\n } @else {\n <span [class]=\"icon\"></span>\n }\n }\n </span>\n</span>\n<span class=\"tx-toggle-switch__text\">\n <label class=\"tx-toggle-switch__label\" [for]=\"resolvedId()\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\"\n >{{ label() }}<ng-content\n /></label>\n @if (description()) {\n <span\n class=\"tx-toggle-switch__description\"\n [id]=\"descriptionId\"\n [class]=\"passThrough().description?.class\"\n [style]=\"passThrough().description?.style\"\n >{{ description() }}</span\n >\n }\n</span>\n"],"mappings":";;;;;;;;;;AAIA,IAAa,+BAAb,MAAa,6BAA4B;CAC9B,cAAc,OAAiD,WAAW;CADxE,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAA4B,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAA5B,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAA4B,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAA5B,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA4B,YAAA,CAAA;EADxC,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,oCAAmC,CAAE;;;ACyC5D,IAAa,iBAAb,MAAa,uBAAuB,kBAA0B;CACpD,iBAAiB,OAAO,cAAc;CACtC,cAAc,SAAS,kBAAkB;CAExC,QAAQ,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC5C,cAAc,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,gBAAgB,MAAmC,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CACzD,YAAY,MAAe,MAAK,G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