/**
 * @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 class=\"clr-form-control\" vcdResponsiveInput [ngClass]=\"{ 'clr-form-control-disabled': disabled }\">\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                    <button type=\"button\" class=\"btn-blank\" clrSignpostTrigger>\n                        <clr-icon shape=\"info-circle\" size=\"24\"></clr-icon>\n                    </button>\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: ["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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jaGVja2JveC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI6WyJmb3JtL2Zvcm0tY2hlY2tib3gvZm9ybS1jaGVja2JveC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBS0EsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsUUFBUSxFQUFFLElBQUksRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6RSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNCQUFzQixDQUFDOztBQUV2RCxNQUFZLGVBQWU7SUFDdkIsUUFBUSxZQUFhO0lBQ3JCLFlBQVksaUJBQWtCO0VBQ2pDOzs7Ozs7Ozs7Ozs7O0FBa0JELE1BQU0sT0FBTyxxQkFBc0IsU0FBUSxlQUFlOzs7O0lBbUN0RCxZQUFnQyxnQkFBMkI7UUFDdkQsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7Ozs7UUEzQm5CLFlBQU8sR0FBb0IsZUFBZSxDQUFDLFFBQVEsQ0FBQzs7OztRQUtwRCxlQUFVLEdBQUcsS0FBSyxDQUFDOzs7O1FBVW5CLGlCQUFZLEdBQUcsVUFBVSxDQUFDO0l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