@testgorilla/tgo-ui 11.22.2 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
- package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1789
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
- package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/mcp/catalog.json +1 -1
- package/package.json +16 -17
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-filled.svg +3 -0
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Sequences-in-line.svg +3 -0
- package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
- package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
- package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
- package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
- package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
- package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
- package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
- package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
- package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
- package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
- package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
- package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
- package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
- package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
- package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
- package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
- package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
- package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
- package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
- package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
- package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
- package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
- package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
- package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
- package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
- package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
- package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
- package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
- package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
- package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
- package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
- package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
- package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
- package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
- package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
- package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
- package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
- package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
- package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
- package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
- package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
- package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
- package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
- package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
- package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
- package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
- package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
- package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
- package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
- package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
- package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
- package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
- package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
- package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
- package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
- package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
- package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
- package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
- package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
- package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
- package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
- package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
- package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
- package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
- package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
- package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
- package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
- package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
- package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
- package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
- package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
- package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
- package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
- package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
- package/types/testgorilla-tgo-ui.d.ts +52 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-toggle.mjs","sources":["../../../components/toggle/toggle.component.ts","../../../components/toggle/toggle.component.html","../../../components/toggle/toggle.component.module.ts","../../../components/toggle/testgorilla-tgo-ui-components-toggle.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n HostBinding,\n Inject,\n inject,\n Input,\n OnChanges,\n OnInit,\n Optional,\n Output,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { MatTooltip } from '@angular/material/tooltip';\n\nimport { ApplicationTheme, IKeyboardEvent, EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponent } from '@testgorilla/tgo-ui/components/spinner';\n\nimport { RegisterFn } from './toggle.model';\n\n@Component({\n selector: 'ui-toggle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './toggle.component.html',\n styleUrls: ['./toggle.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleComponent),\n multi: true,\n },\n ],\n imports: [NgClass, EllipseTextDirective, MatTooltip, IconComponentModule, SpinnerComponent],\n})\nexport class ToggleComponent implements ControlValueAccessor, OnChanges, OnInit {\n /**\n * The `selected` property determines the current state of the toggle switch.\n *\n * @type {boolean}\n * @default false\n * @memberof ToggleComponent\n */\n @Input() selected = false;\n\n /**\n * The `disabled` property determines whether the toggle switch is disabled.\n *\n * @type {boolean}\n * @default false\n * @memberof ToggleComponent\n */\n @Input() disabled = false;\n\n /**\n * Toggle label\n *\n * @type {string}\n * @default ''\n * @memberof ToggleComponent\n */\n @Input() label = '';\n\n /**\n * Message\n *\n * @type {string}\n * @default ''\n * @memberof ToggleComponent\n */\n @Input() message = '';\n\n /**\n * Max width of the toggle container\n *\n * @type {number}\n * @memberof ToggleComponent\n */\n @HostBinding('style.--max-width')\n @Input()\n maxWidth: number | undefined;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ToggleComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * The `toggle` event is triggered when the state of the toggle switch changes. It returns the new state.\n *\n * @type {event}\n * @memberof ToggleComponent\n */\n // eslint-disable-next-line @angular-eslint/no-output-native -- output shadows a native event; rename is breaking, deferred to the breaking-change MAJOR (see plan)\n @Output() toggle = new EventEmitter<boolean>();\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof ToggleComponent\n */\n @Input() ariaLabel: string;\n\n @Input() testId: string | null = null;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * disable/enable click on toggle\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() preventClick = false;\n\n /**\n * The loading state\n *\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() loading = false;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof ToggleComponent\n */\n @Input() ariaDescribedby = '';\n\n protected showLabelTooltip = false;\n protected classes: string;\n\n private static nextInstanceId = 0;\n\n // Shared ids would point every toggle's `aria-labelledby` at the first toggle's label.\n protected readonly labelId = `ui-toggle-label-${++ToggleComponent.nextInstanceId}`;\n protected readonly describedbyId = `ui-toggle-describedby-${ToggleComponent.nextInstanceId}`;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n ngOnChanges(): void {\n this.setClasses();\n }\n\n ngOnInit(): void {\n this.setClasses();\n }\n\n onToggle(): void {\n if (this.preventClick) {\n this.toggle.emit(this.selected);\n }\n if (!this.disabled && !this.preventClick) {\n this.selected = !this.selected;\n this.toggle.emit(this.selected);\n this.onChange(this.selected);\n }\n }\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n writeValue(state: boolean): void {\n if (state) {\n this.selected = state;\n }\n // The forms API calls this from outside the component's own change\n // detection — under OnPush the view must be marked explicitly.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: RegisterFn): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: RegisterFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n // Recompute the root [ngClass] — it's otherwise only built in\n // ngOnInit/ngOnChanges, so the `disabled` class never applied when\n // disabling through the forms API.\n this.setClasses();\n this.cdr.markForCheck();\n }\n\n changeTextState(state: boolean): void {\n this.showLabelTooltip = state;\n }\n\n onKeydown($event: KeyboardEvent) {\n if ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string)) {\n $event.stopPropagation();\n $event.preventDefault();\n this.onToggle();\n }\n }\n\n private onChange: RegisterFn = () => {};\n private onTouched: RegisterFn = () => {};\n\n private setClasses(): void {\n this.classes = `${this.disabled ? 'disabled' : ''} ${this.applicationTheme} ${this.loading ? 'loading' : ''} ${!this.label ? 'small-toggle' : ''}`;\n }\n}\n","<div class=\"toggle\" [ngClass]=\"classes\">\n <div\n [style.--max-width]=\"maxWidth + 'px'\"\n tabindex=\"0\"\n class=\"toggle-container\"\n [ngClass]=\"{ active: selected }\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n (keydown)=\"onKeydown($event)\"\n role=\"switch\"\n [attr.aria-labelledby]=\"label ? labelId : null\"\n [attr.aria-describedby]=\"ariaDescribedby ? describedbyId : null\"\n [attr.aria-checked]=\"selected\"\n [attr.data-testid]=\"testId\"\n >\n <span [style.display]=\"'none'\" [id]=\"describedbyId\">{{ ariaDescribedby }}</span>\n <div\n class=\"label\"\n uiEllipseText\n [matTooltipShowDelay]=\"800\"\n [matTooltip]=\"showLabelTooltip ? label : ''\"\n (onChangeTextState)=\"changeTextState($event)\"\n [id]=\"labelId\"\n >\n {{ label }}\n </div>\n @if (!loading) {\n <div class=\"knob\" [ngClass]=\"{ selected }\">\n @if (selected && !label) {\n <ui-icon [color]=\"disabled ? 'grey' : 'white'\" [size]=\"'16'\" [name]=\"'Check-round-filled'\"></ui-icon>\n }\n </div>\n } @else {\n <ui-spinner [isLoader]=\"false\" [size]=\"'small'\" [applicationTheme]=\"'dark'\"></ui-spinner>\n }\n </div>\n @if (message && selected) {\n <div class=\"message\">{{ message }}</div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { EllipseTextDirective, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';\n\nimport { ToggleComponent } from './toggle.component';\n\n@NgModule({\n imports: [\n CommonModule,\n MatTooltipModule,\n EllipseTextDirective,\n MatInputModule,\n UiTranslatePipe,\n IconComponentModule,\n SpinnerComponentModule,\n ToggleComponent,\n ],\n exports: [ToggleComponent],\n})\nexport class ToggleComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAuCa,eAAe,CAAA;aA6GX,IAAA,CAAA,cAAc,GAAG,CAAH,CAAK;AAMlC,IAAA,WAAA,CAC6E,eAAiC,EAAA;QAAjC,IAAA,CAAA,eAAe,GAAf,eAAe;AAnH5F;;;;;;AAMG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEzB;;;;;;AAMG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEzB;;;;;;AAMG;QACM,IAAA,CAAA,KAAK,GAAG,EAAE;AAEnB;;;;;;AAMG;QACM,IAAA,CAAA,OAAO,GAAG,EAAE;AAYrB;;;;;;AAMG;QACM,IAAA,CAAA,gBAAgB,GAAqB,OAAO;AAErD;;;;;AAKG;;AAEO,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAAW;QAUrC,IAAA,CAAA,MAAM,GAAkB,IAAI;AAErC;;;;;AAKG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK;AAE7B;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK;AAE7B;;;;;AAKG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK;AAExB;;;;;AAKG;QACM,IAAA,CAAA,eAAe,GAAG,EAAE;QAEnB,IAAA,CAAA,gBAAgB,GAAG,KAAK;;AAMf,QAAA,IAAA,CAAA,OAAO,GAAG,CAAA,gBAAA,EAAmB,EAAE,eAAe,CAAC,cAAc,EAAE;AAC/D,QAAA,IAAA,CAAA,aAAa,GAAG,CAAA,sBAAA,EAAyB,eAAe,CAAC,cAAc,EAAE;AA6B3E,QAAA,IAAA,CAA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EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAX9B,YAAY;YACZ,gBAAgB;YAChB,oBAAoB;YACpB,cAAc;YACd,eAAe;YACf,mBAAmB;YACnB,sBAAsB;AACtB,YAAA,eAAe,aAEP,eAAe,CAAA,EAAA,CAAA,CAAA;AAEd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAX9B,YAAY;YACZ,gBAAgB;YAEhB,cAAc;YAEd,mBAAmB;YACnB,sBAAsB;YACtB,eAAe,CAAA,EAAA,CAAA,CAAA;;4FAIN,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,oBAAoB;wBACpB,cAAc;wBACd,eAAe;wBACf,mBAAmB;wBACnB,sBAAsB;wBACtB,eAAe;AAChB,qBAAA;oBACD,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA;;;ACvBD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-toggle.mjs","names":[],"sources":["../../../components/toggle/toggle.component.ts","../../../components/toggle/toggle.component.html","../../../components/toggle/toggle.component.module.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n forwardRef,\n HostBinding,\n Inject,\n inject,\n Input,\n OnChanges,\n OnInit,\n Optional,\n Output,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { MatTooltip } from '@angular/material/tooltip';\n\nimport { ApplicationTheme, IKeyboardEvent, EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponent } from '@testgorilla/tgo-ui/components/spinner';\n\nimport { RegisterFn } from './toggle.model';\n\n@Component({\n selector: 'ui-toggle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './toggle.component.html',\n styleUrls: ['./toggle.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleComponent),\n multi: true,\n },\n ],\n imports: [NgClass, EllipseTextDirective, MatTooltip, IconComponentModule, SpinnerComponent],\n})\nexport class ToggleComponent implements ControlValueAccessor, OnChanges, OnInit {\n /**\n * The `selected` property determines the current state of the toggle switch.\n *\n * @type {boolean}\n * @default false\n * @memberof ToggleComponent\n */\n @Input() selected = false;\n\n /**\n * The `disabled` property determines whether the toggle switch is disabled.\n *\n * @type {boolean}\n * @default false\n * @memberof ToggleComponent\n */\n @Input() disabled = false;\n\n /**\n * Toggle label\n *\n * @type {string}\n * @default ''\n * @memberof ToggleComponent\n */\n @Input() label = '';\n\n /**\n * Message\n *\n * @type {string}\n * @default ''\n * @memberof ToggleComponent\n */\n @Input() message = '';\n\n /**\n * Max width of the toggle container\n *\n * @type {number}\n * @memberof ToggleComponent\n */\n @HostBinding('style.--max-width')\n @Input()\n maxWidth: number | undefined;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ToggleComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * The `toggle` event is triggered when the state of the toggle switch changes. It returns the new state.\n *\n * @type {event}\n * @memberof ToggleComponent\n */\n // eslint-disable-next-line @angular-eslint/no-output-native -- output shadows a native event; rename is breaking, deferred to the breaking-change MAJOR (see plan)\n @Output() toggle = new EventEmitter<boolean>();\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof ToggleComponent\n */\n @Input() ariaLabel: string;\n\n @Input() testId: string | null = null;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * disable/enable click on toggle\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() preventClick = false;\n\n /**\n * The loading state\n *\n * @type {boolean}\n * @memberof ToggleComponent\n */\n @Input() loading = false;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {string}\n * @memberof ToggleComponent\n */\n @Input() ariaDescribedby = '';\n\n protected showLabelTooltip = false;\n protected classes: string;\n\n private static nextInstanceId = 0;\n\n // Shared ids would point every toggle's `aria-labelledby` at the first toggle's label.\n protected readonly labelId = `ui-toggle-label-${++ToggleComponent.nextInstanceId}`;\n protected readonly describedbyId = `ui-toggle-describedby-${ToggleComponent.nextInstanceId}`;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n ngOnChanges(): void {\n this.setClasses();\n }\n\n ngOnInit(): void {\n this.setClasses();\n }\n\n onToggle(): void {\n if (this.preventClick) {\n this.toggle.emit(this.selected);\n }\n if (!this.disabled && !this.preventClick) {\n this.selected = !this.selected;\n this.toggle.emit(this.selected);\n this.onChange(this.selected);\n }\n }\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n writeValue(state: boolean): void {\n if (state) {\n this.selected = state;\n }\n // The forms API calls this from outside the component's own change\n // detection — under OnPush the view must be marked explicitly.\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: RegisterFn): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: RegisterFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n // Recompute the root [ngClass] — it's otherwise only built in\n // ngOnInit/ngOnChanges, so the `disabled` class never applied when\n // disabling through the forms API.\n this.setClasses();\n this.cdr.markForCheck();\n }\n\n changeTextState(state: boolean): void {\n this.showLabelTooltip = state;\n }\n\n onKeydown($event: KeyboardEvent) {\n if ($event.key === (IKeyboardEvent.ENTER as string) || $event.key === (IKeyboardEvent.SPACE as string)) {\n $event.stopPropagation();\n $event.preventDefault();\n this.onToggle();\n }\n }\n\n private onChange: RegisterFn = () => {};\n private onTouched: RegisterFn = () => {};\n\n private setClasses(): void {\n this.classes = `${this.disabled ? 'disabled' : ''} ${this.applicationTheme} ${this.loading ? 'loading' : ''} ${!this.label ? 'small-toggle' : ''}`;\n }\n}\n","<div class=\"toggle\" [ngClass]=\"classes\">\n <div\n [style.--max-width]=\"maxWidth + 'px'\"\n tabindex=\"0\"\n class=\"toggle-container\"\n [ngClass]=\"{ active: selected }\"\n (click)=\"onToggle()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-required]=\"ariaRequired\"\n (keydown)=\"onKeydown($event)\"\n role=\"switch\"\n [attr.aria-labelledby]=\"label ? labelId : null\"\n [attr.aria-describedby]=\"ariaDescribedby ? describedbyId : null\"\n [attr.aria-checked]=\"selected\"\n [attr.data-testid]=\"testId\"\n >\n <span [style.display]=\"'none'\" [id]=\"describedbyId\">{{ ariaDescribedby }}</span>\n <div\n class=\"label\"\n uiEllipseText\n [matTooltipShowDelay]=\"800\"\n [matTooltip]=\"showLabelTooltip ? label : ''\"\n (onChangeTextState)=\"changeTextState($event)\"\n [id]=\"labelId\"\n >\n {{ label }}\n </div>\n @if (!loading) {\n <div class=\"knob\" [ngClass]=\"{ selected }\">\n @if (selected && !label) {\n <ui-icon [color]=\"disabled ? 'grey' : 'white'\" [size]=\"'16'\" [name]=\"'Check-round-filled'\"></ui-icon>\n }\n </div>\n } @else {\n <ui-spinner [isLoader]=\"false\" [size]=\"'small'\" [applicationTheme]=\"'dark'\"></ui-spinner>\n }\n </div>\n @if (message && selected) {\n <div class=\"message\">{{ message }}</div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { EllipseTextDirective, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { SpinnerComponentModule } from '@testgorilla/tgo-ui/components/spinner';\n\nimport { ToggleComponent } from './toggle.component';\n\n@NgModule({\n imports: [\n CommonModule,\n MatTooltipModule,\n EllipseTextDirective,\n MatInputModule,\n UiTranslatePipe,\n IconComponentModule,\n SpinnerComponentModule,\n ToggleComponent,\n ],\n exports: [ToggleComponent],\n})\nexport class ToggleComponentModule {}\n"],"mappings":";;;;;;;;;;AAuCA,IAAa,kBAAb,MAAa,gBAAe;CA6GX;EAAA,KAAA,iBAAiB;CAAE;CAMlC,YAC6E,iBAAiC;EAAjC,KAAA,kBAAA;EA5GpE,KAAA,WAAW;EASX,KAAA,WAAW;EASX,KAAA,QAAQ;EASR,KAAA,UAAU;EAmBV,KAAA,mBAAqC;EASpC,KAAA,SAAS,IAAI,aAAY;EAU1B,KAAA,SAAwB;EAQxB,KAAA,eAAe;EAOf,KAAA,eAAe;EAQf,KAAA,UAAU;EAQV,KAAA,kBAAkB;EAEjB,KAAA,mBAAmB;EAMV,KAAA,UAAU,mBAAmB,EAAE,gBAAgB;EAC/C,KAAA,gBAAgB,yBAAyB,gBAAgB;EA6B3D,KAAA,MAAM,OAAO,iBAAiB;EAwCvC,KAAA,iBAA4B,CAAE;EAC9B,KAAA,kBAA6B,CAAE;EAjErC,IAAI,iBACF,KAAK,mBAAmB;CAE5B;CAEA,cAAW;EACT,KAAK,WAAU;CACjB;CAEA,WAAQ;EACN,KAAK,WAAU;CACjB;CAEA,WAAQ;EACN,IAAI,KAAK,cACP,KAAK,OAAO,KAAK,KAAK,QAAQ;EAEhC,IAAI,CAAC,KAAK,YAAY,CAAC,KAAK,cAAc;GACxC,KAAK,WAAW,CAAC,KAAK;GACtB,KAAK,OAAO,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