{"version":3,"file":"csiro-geoanalytics-angular-switchery-ios.mjs","sources":["../../../projects/ng-switchery-ios/src/lib/ng-switchery-ios.component.ts","../../../projects/ng-switchery-ios/src/lib/ng-switchery-ios.module.ts","../../../projects/ng-switchery-ios/src/public-api.ts","../../../projects/ng-switchery-ios/src/csiro-geoanalytics-angular-switchery-ios.ts"],"sourcesContent":["import {\n  Component,\n  forwardRef,\n  HostBinding,\n  Input,\n  ViewEncapsulation,\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\n@Component({\n  selector: \"ng-switchery\",\n  template: ` <div\n    class=\"checkbox {{ customClasses }}\"\n    [ngClass]=\"{\n      disabled: disabled,\n      'checkbox-double': offLabel && offLabel.length > 0,\n      'checkbox-right': sticked\n    }\"\n  >\n    <label>\n      {{ offLabel }}\n      <input\n        type=\"checkbox\"\n        class=\"switchery\"\n        [disabled]=\"disabled\"\n        [value]=\"value\"\n        (change)=\"onChange()\"\n        [checked]=\"value\"\n      />\n      <span class=\"switchery {{ color }} {{ size }}\"> <small></small> </span>\n      {{ onLabel }}\n    </label>\n  </div>`,\n  styleUrls: [\"./ng-switchery-ios.component.css\"],\n  encapsulation: ViewEncapsulation.None,\n  providers: [\n    {\n      provide: NG_VALUE_ACCESSOR,\n      useExisting: forwardRef(() => NgSwitcheryComponent),\n      multi: true,\n    },\n  ],\n})\nexport class NgSwitcheryComponent implements ControlValueAccessor {\n  @Input()\n  value!: boolean;\n\n  @Input() onLabel?: string;\n  @Input() offLabel?: string;\n  @Input() color?: string;\n  @Input() size?: string;\n  @Input() sticked?: boolean;\n  @Input() customClasses?: string;\n\n  // Allow the input to be disabled, and when it is make it somewhat transparent.\n  @Input() disabled = false;\n  @HostBinding(\"style.opacity\")\n  get opacity() {\n    return this.disabled ? 0.25 : 1;\n  }\n\n  // Allows Angular to update the model\n  // Update the model and changes needed for the view here.\n  writeValue(value: any) {\n    this.value = value;\n  }\n\n  // Allows Angular to register a function to call when the model changes.\n  // Save the function as a property to call later here.\n  registerOnChange(fn: any) {\n    this.propagateChange = fn;\n  }\n\n  // Allows Angular to register a function to call when the input has been touched.\n  // Save the function as a property to call later here.\n  registerOnTouched() {}\n\n  // Change event from Switchery Toggle\n  onChange() {\n    this.value = !this.value;\n    // update the form\n    this.propagateChange(this.value);\n  }\n\n  // Allows Angular to disable the input.\n  setDisabledState(isDisabled: boolean): void {\n    this.disabled = isDisabled;\n  }\n\n  // the method set in registerOnChange to emit changes back to the form\n  propagateChange = (_: any) => {};\n}\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { NgSwitcheryComponent } from \"./ng-switchery-ios.component\";\n\n@NgModule({\n  declarations: [NgSwitcheryComponent],\n  imports: [FormsModule, CommonModule],\n  exports: [NgSwitcheryComponent],\n})\nexport class NgSwitcheryModule {}\n","/*\n * Public API Surface of angular-switchery-ios\n */\n\nexport * from \"./lib/ng-switchery-ios.component\";\nexport * from \"./lib/ng-switchery-ios.module\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MA2Ca,oBAAoB,CAAA;AAlCjC,IAAA,WAAA,GAAA;;AA8CW,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAmC1B,IAAA,CAAA,eAAe,GAAG,CAAC,CAAM,KAAM,GAAC,CAAC;KAClC;AAnCC,IAAA,IACI,OAAO,GAAA;QACT,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC;KACjC;;;AAID,IAAA,UAAU,CAAC,KAAU,EAAA;AACnB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;KACpB;;;AAID,IAAA,gBAAgB,CAAC,EAAO,EAAA;AACtB,QAAA,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;KAC3B;;;AAID,IAAA,iBAAiB,MAAK;;IAGtB,QAAQ,GAAA;AACN,QA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