/**
 * @fileoverview added by tsickle
 * Generated from: form/form-checkbox/form-checkbox.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Input, Optional, Self } from '@angular/core';
import { NgControl } from '@angular/forms';
import { BaseFormControl } from '../base-form-control';
/** @enum {string} */
const CheckBoxStyling = {
    CHECKBOX: "checkbox",
    TOGGLESWITCH: "toggle-switch",
};
export { CheckBoxStyling };
/**
 * {\@link FormControl} wrapper around a input HTML element of checkbox type. The label input from
 * {\@link BaseFormControl} is used for displaying a label on the left of a form field and the text input is used for
 * displaying label on the right of checkbox. Use the 'styling' property with a value of 'checkbox' or 'toggle-switch'
 * to display a checkbox or toggle switch on the UI.
 *
 * Example:
 *      <vcd-form-checkbox [formControlName]="Fields.port" [label]="'enabled'|translate"
 *                         [text]="'feature.enabled'|translate">
 *      </vcd-form-checkbox>
 */
export class FormCheckboxComponent extends BaseFormControl {
    /**
     * @param {?} controlDirective
     */
    constructor(controlDirective) {
        super(controlDirective);
        /**
         * Styling for the checkbox.
         */
        this.styling = CheckBoxStyling.CHECKBOX;
        /**
         * Put the label text on the right.
         */
        this.rightLabel = false;
        /**
         * The direction for displaying the hint
         */
        this.hintPosition = 'top-left';
    }
    /**
     * @return {?}
     */
    get isCheckbox() {
        return this.styling === CheckBoxStyling.CHECKBOX;
    }
}
FormCheckboxComponent.decorators = [
    { type: Component, args: [{
                selector: 'vcd-form-checkbox',
                template: "<div class=\"form-group\">\n    <div\n        class=\"clr-form-control\"\n        [vcdResponsiveInput]=\"{ disabled: !isResponsive }\"\n        [ngClass]=\"{ 'clr-form-control-disabled': disabled }\"\n    >\n        <label class=\"clr-control-label\" [for]=\"id\" *ngIf=\"label\">{{ label }}</label>\n        <div class=\"clr-control-container\" [ngClass]=\"{ 'clr-error': showErrors }\">\n            <div [ngClass]=\"{ 'clr-checkbox-wrapper': isCheckbox, 'clr-toggle-wrapper': !isCheckbox }\">\n                <input\n                    type=\"checkbox\"\n                    [id]=\"id\"\n                    [attr.aria-describedby]=\"showErrors ? errorsId : descriptionId\"\n                    [ngClass]=\"{ 'clr-checkbox': isCheckbox, 'clr-toggle': !isCheckbox }\"\n                    [formControl]=\"formControl\"\n                />\n                <label class=\"clr-control-label\" [for]=\"id\">\n                    <clr-icon *ngIf=\"iconShape\" [attr.shape]=\"iconShape\"></clr-icon>\n                    {{ text }}\n                </label>\n                <clr-signpost *ngIf=\"hint\">\n                    <clr-signpost-content [clrPosition]=\"hintPosition\" *clrIfOpen>\n                        <p>{{ hint }}</p>\n                    </clr-signpost-content>\n                </clr-signpost>\n            </div>\n            <span class=\"clr-subtext\" *ngIf=\"showErrors\" [id]=\"errorsId\">\n                <div *ngFor=\"let key of errorKeys\">\n                    <div>{{ key | translate: formControl.value }}</div>\n                </div>\n            </span>\n            <span class=\"clr-subtext\" *ngIf=\"!showErrors && description\" [id]=\"descriptionId\">\n                {{ description }}\n            </span>\n        </div>\n    </div>\n    <span class=\"clr-subtext\">\n        <ng-content select=\"footer\"></ng-content>\n    </span>\n</div>\n",
                styles: [".required-field:after{content:\"*\";color:red;padding-left:5px}.form-group ::ng-deep aside{display:inline-block}clr-signpost-content p:first-child{margin-top:0;white-space:pre-line}", "label.clr-control-label{display:inline-block}.clr-checkbox-wrapper,.clr-toggle-wrapper{display:flex;align-items:center}.btn-blank{background-color:transparent;border:none;padding:0;cursor:pointer}"]
            }] }
];
/** @nocollapse */
FormCheckboxComponent.ctorParameters = () => [
    { type: NgControl, decorators: [{ type: Self }, { type: Optional }] }
];
FormCheckboxComponent.propDecorators = {
    text: [{ type: Input }],
    styling: [{ type: Input }],
    rightLabel: [{ type: Input }],
    iconShape: [{ type: Input }],
    hintPosition: [{ type: Input }],
    hint: [{ type: Input }]
};
if (false) {
    /**
     * The label that appears next to the control
     * @type {?}
     */
    FormCheckboxComponent.prototype.text;
    /**
     * Styling for the checkbox.
     * @type {?}
     */
    FormCheckboxComponent.prototype.styling;
    /**
     * Put the label text on the right.
     * @type {?}
     */
    FormCheckboxComponent.prototype.rightLabel;
    /**
     * A shape for the icon that appears next to the checkbox.
     * @type {?}
     */
    FormCheckboxComponent.prototype.iconShape;
    /**
     * The direction for displaying the hint
     * @type {?}
     */
    FormCheckboxComponent.prototype.hintPosition;
    /**
     * Hint to display in the content of a signpost
     * @type {?}
     */
    FormCheckboxComponent.prototype.hint;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jaGVja2JveC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI6WyJmb3JtL2Zvcm0tY2hlY2tib3gvZm9ybS1jaGVja2JveC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBS0EsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsUUFBUSxFQUFFLElBQUksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6RSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNCQUFzQixDQUFDOztBQUV2RCxNQUFZLGVBQWU7SUFDdkIsUUFBUSxZQUFhO0lBQ3JCLFlBQVksaUJBQWtCO0VBQ2pDOzs7Ozs7Ozs7Ozs7O0FBa0JELE1BQU0sT0FBTyxxQkFBc0IsU0FBUSxlQUFlOzs7O0lBbUN0RCxZQUFnQyxnQkFBMkI7UUFDdkQsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7Ozs7UUEzQm5CLFlBQU8sR0FBb0IsZUFBZSxDQUFDLFFBQVEsQ0FBQzs7OztRQUtwRCxlQUFVLEdBQUcsS0FBSyxDQUFDOzs7O1FBV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