{"version":3,"file":"angular-react-fabric-lib-components-checkbox.mjs","sources":["../../../libs/fabric/lib/components/checkbox/checkbox.component.ts","../../../libs/fabric/lib/components/checkbox/checkbox.module.ts","../../../libs/fabric/lib/components/checkbox/public-api.ts","../../../libs/fabric/lib/components/checkbox/angular-react-fabric-lib-components-checkbox.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { InputRendererOptions, JsxRenderFunc, ReactWrapperComponent } from '@angular-react/core';\r\nimport {\r\n  ChangeDetectionStrategy,\r\n  ChangeDetectorRef,\r\n  Component,\r\n  ElementRef,\r\n  EventEmitter,\r\n  Input,\r\n  NgZone,\r\n  OnInit,\r\n  Output,\r\n  Renderer2,\r\n  ViewChild,\r\n} from '@angular/core';\r\nimport { ICheckboxProps } from '@fluentui/react/lib/Checkbox';\r\nimport { FormEvent } from 'react';\r\nimport { Styled } from '@angular-react/fabric/lib/utils';\r\nimport { AngularReact } from '@angular-react/core';\r\n\r\n@AngularReact()\r\n@Styled('FabCheckboxComponent')\r\n@Component({\r\n  selector: 'fab-checkbox',\r\n  exportAs: 'fabCheckbox',\r\n  template: `\r\n    <Checkbox\r\n      #reactNode\r\n      [componentRef]=\"componentRef\"\r\n      [className]=\"className\"\r\n      [checked]=\"checked\"\r\n      [defaultChecked]=\"defaultChecked\"\r\n      [label]=\"label\"\r\n      [disabled]=\"disabled\"\r\n      [inputProps]=\"inputProps\"\r\n      [boxSide]=\"boxSide\"\r\n      [theme]=\"theme\"\r\n      [ariaLabel]=\"ariaLabel\"\r\n      [ariaLabelledBy]=\"ariaLabelledBy\"\r\n      [ariaDescribedBy]=\"ariaDescribedBy\"\r\n      [ariaPositionInSet]=\"ariaPositionInSet\"\r\n      [ariaSetSize]=\"ariaSetSize\"\r\n      [checkmarkIconProps]=\"checkmarkIconProps\"\r\n      [styles]=\"styles\"\r\n      [RenderLabel]=\"renderLabel && onRenderLabel\"\r\n      [Change]=\"onChangeHandler\"\r\n    >\r\n    </Checkbox>\r\n  `,\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class FabCheckboxComponent extends ReactWrapperComponent<ICheckboxProps> implements OnInit {\r\n  @ViewChild('reactNode', { static: true }) protected reactNodeRef: ElementRef;\r\n\r\n  @Input() componentRef?: ICheckboxProps['componentRef'];\r\n  @Input() className?: ICheckboxProps['className'];\r\n  @Input() checked?: ICheckboxProps['checked'];\r\n  @Input() defaultChecked?: ICheckboxProps['defaultChecked'];\r\n  @Input() label?: ICheckboxProps['label'];\r\n  @Input() disabled?: ICheckboxProps['disabled'];\r\n  @Input() inputProps?: React.ButtonHTMLAttributes<HTMLElement | HTMLButtonElement>;\r\n  @Input() boxSide?: ICheckboxProps['boxSide'];\r\n  @Input() theme?: ICheckboxProps['theme'];\r\n  @Input() ariaLabel?: ICheckboxProps['ariaLabel'];\r\n  @Input() ariaLabelledBy?: ICheckboxProps['ariaLabelledBy'];\r\n  @Input() ariaDescribedBy?: ICheckboxProps['ariaDescribedBy'];\r\n  @Input() ariaPositionInSet?: ICheckboxProps['ariaPositionInSet'];\r\n  @Input() ariaSetSize?: ICheckboxProps['ariaSetSize'];\r\n  @Input() checkmarkIconProps?: ICheckboxProps['checkmarkIconProps'];\r\n  @Input() styles?: ICheckboxProps['styles'];\r\n\r\n  @Input() renderLabel?: InputRendererOptions<ICheckboxProps>;\r\n\r\n  @Output() readonly onChange = new EventEmitter<{ ev?: Event; checked?: boolean }>();\r\n\r\n  /* Non-React props, more native support for Angular */\r\n  // support for two-way data binding for `@Input() checked`.\r\n  @Output() readonly checkedChange = new EventEmitter<boolean>();\r\n\r\n  onRenderLabel: (props?: ICheckboxProps, defaultRender?: JsxRenderFunc<ICheckboxProps>) => JSX.Element;\r\n\r\n  constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef, renderer: Renderer2, ngZone: NgZone) {\r\n    super(elementRef, changeDetectorRef, renderer, { ngZone });\r\n\r\n    // coming from React context - we need to bind to this so we can access the Angular Component properties\r\n    this.onChangeHandler = this.onChangeHandler.bind(this);\r\n  }\r\n\r\n  ngOnInit() {\r\n    this.onRenderLabel = this.createRenderPropHandler(this.renderLabel);\r\n  }\r\n\r\n  onChangeHandler(ev?: FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) {\r\n    this.onChange.emit({\r\n      ev: ev && ev.nativeEvent,\r\n      checked,\r\n    });\r\n\r\n    this.checkedChange.emit(checked);\r\n  }\r\n}\r\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { registerElement } from '@angular-react/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';\r\nimport { Checkbox } from '@fluentui/react/lib/Checkbox';\r\nimport { FabCheckboxComponent } from './checkbox.component';\r\n\r\nconst components = [FabCheckboxComponent];\r\n\r\n@NgModule({\r\n  imports: [CommonModule],\r\n  declarations: components,\r\n  exports: components,\r\n  schemas: [NO_ERRORS_SCHEMA],\r\n})\r\nexport class FabCheckboxModule {\r\n  constructor() {\r\n    // Add any React elements to the registry (used by the renderer).\r\n    registerElement('Checkbox', () => Checkbox);\r\n  }\r\n}\r\n","// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport * from './checkbox.component';\r\nexport * from './checkbox.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAqDO,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,qBAAqC,CAAA;AA8B7E,IAAA,WAAA,CAAY,UAAsB,EAAE,iBAAoC,EAAE,QAAmB,EAAE,MAAc,EAAA;QAC3G,KAAK,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAT1C,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAAqC,CAAC;;;AAIjE,QA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