igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
1 lines • 6.91 kB
Source Map (JSON)
{"version":3,"file":"igniteui-angular-switch.mjs","sources":["../../../projects/igniteui-angular/switch/src/switch/switch.component.ts","../../../projects/igniteui-angular/switch/src/switch/switch.component.html","../../../projects/igniteui-angular/switch/src/switch/switch.module.ts","../../../projects/igniteui-angular/switch/src/igniteui-angular-switch.ts"],"sourcesContent":["import {\n Component,\n HostBinding,\n Input,\n AfterViewInit,\n booleanAttribute\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { CheckboxBaseDirective, IgxRippleDirective } from 'igniteui-angular/directives';\nimport { EditorProvider, EDITOR_PROVIDER } from 'igniteui-angular/core';\n\n/**\n *\n * The Switch component is a binary choice selection component.\n *\n * @igxModule IgxSwitchModule\n *\n * @igxTheme igx-switch-theme, igx-tooltip-theme\n *\n * @igxKeywords switch, states, tooltip\n *\n * @igxGroup Data Entry & Display\n * @remarks\n *\n * The Ignite UI Switch lets the user toggle between on/off or true/false states.\n *\n * @example\n * ```html\n * <igx-switch [checked]=\"true\">\n * Simple switch\n * </igx-switch>\n * ```\n */\n@Component({\n providers: [{\n provide: EDITOR_PROVIDER,\n useExisting: IgxSwitchComponent,\n multi: true\n }],\n selector: 'igx-switch',\n templateUrl: 'switch.component.html',\n imports: [IgxRippleDirective]\n})\nexport class IgxSwitchComponent\n extends CheckboxBaseDirective\n implements ControlValueAccessor, EditorProvider, AfterViewInit {\n /**\n * Returns the class of the switch component.\n *\n * @example\n * ```typescript\n * let switchClass = this.switch.cssClass;\n * ```\n */\n @HostBinding('class.igx-switch')\n public override cssClass = 'igx-switch';\n /**\n * Sets/gets whether the switch is on or off.\n * Default value is 'false'.\n *\n * @example\n * ```html\n * <igx-switch [checked]=\"true\"></igx-switch>\n * ```\n */\n @HostBinding('class.igx-switch--checked')\n @Input()\n public override set checked(value: boolean) {\n super.checked = value;\n }\n public override get checked() {\n return super.checked;\n }\n /**\n * Sets/gets the `disabled` attribute.\n * Default value is `false`.\n *\n * @example\n * ```html\n * <igx-switch disabled><igx-switch>\n * ```\n */\n @HostBinding('class.igx-switch--disabled')\n @Input({ transform: booleanAttribute })\n public override disabled = false;\n\n /**\n * Sets/gets whether the switch component is invalid.\n * Default value is `false`.\n *\n * @example\n * ```html\n * <igx-switch invalid></igx-switch>\n * ```\n * ```typescript\n * let isInvalid = this.switch.invalid;\n * ```\n */\n @HostBinding('class.igx-switch--invalid')\n @Input({ transform: booleanAttribute })\n public override invalid = false;\n\n /**\n * Sets/gets whether the switch component is on focus.\n * Default value is `false`.\n *\n * @example\n * ```typescript\n * this.switch.focused = true;\n * ```\n */\n @HostBinding('class.igx-switch--focused')\n public override focused = false;\n}\n","<input #checkbox class=\"igx-switch__input\" type=\"checkbox\"\n [id]=\"inputId\"\n [name]=\"name\"\n [value]=\"value\"\n [tabindex]=\"tabindex\"\n [disabled]=\"disabled\"\n [checked]=\"checked\"\n [required]=\"required\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n [attr.aria-checked]=\"checked\"\n [attr.aria-labelledby]=\"ariaLabel ? null : ariaLabelledBy\"\n [attr.aria-label]=\"ariaLabel\"\n (change)=\"_onCheckboxChange($event)\"\n (blur)=\"onBlur()\" />\n\n<span #label class=\"igx-switch__composite\"\n igxRipple\n igxRippleTarget=\".igx-switch__ripple\"\n [igxRippleDisabled]=\"disableRipple\"\n [igxRippleCentered]=\"true\"\n [igxRippleDuration]=\"300\">\n <div class=\"igx-switch__composite-thumb\">\n <div class=\"igx-switch__ripple\"></div>\n <div class=\"igx-switch__thumb\"></div>\n </div>\n</span>\n\n<span #placeholderLabel\n [class]=\"labelClass\"\n [id]=\"labelId\">\n <ng-content></ng-content>\n</span>\n","import { NgModule } from '@angular/core';\nimport { IgxSwitchComponent } from './switch.component';\n\n/**\n * @hidden\n * @deprecated\n * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components\n */\n@NgModule({\n imports: [\n IgxSwitchComponent\n ],\n exports: [\n IgxSwitchComponent\n ]\n})\nexport class IgxSwitchModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAWA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAWG,MAAO,kBACT,SAAQ,qBAAqB,CAAA;AAXjC,IAAA,WAAA,GAAA;;AAaI;;;;;;;AAOG;QAEa,IAAA,CAAA,QAAQ,GAAG,YAAY;AAkBvC;;;;;;;;AAQG;QAGa,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEhC;;;;;;;;;;;AAWG;QAGa,IAAA,CAAA,OAAO,GAAG,KAAK;AAE/B;;;;;;;;AAQG;QAEa,IAAA,CAAA,OAAO,GAAG,KAAK;AAClC,IAAA;AAzDG;;;;;;;;AAQG;IACH,IAEoB,OAAO,CAAC,KAAc,EAAA;AACtC,QAAA,KAAK,CAAC,OAAO,GAAG,KAAK;IACzB;AACA,IAAA,IAAoB,OAAO,GAAA;QACvB,OAAO,KAAK,CAAC,OAAO;IACxB;8GA7BS,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,UAAA,EAAA,UAAA,EAwCP,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAgBhB,gBAAgB,qQAjEzB,CAAC;AACR,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,WAAW,EAAE,kBAAkB;AAC/B,gBAAA,KAAK,EAAE;aACV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