/**
 * @fileoverview added by tsickle
 * Generated from: form/form-checkbox/form-checkbox.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __extends } from "tslib";
/*!
 * 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} */
var 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>
 */
var FormCheckboxComponent = /** @class */ (function (_super) {
    __extends(FormCheckboxComponent, _super);
    function FormCheckboxComponent(controlDirective) {
        var _this = _super.call(this, controlDirective) || this;
        /**
         * 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 _this;
    }
    Object.defineProperty(FormCheckboxComponent.prototype, "isCheckbox", {
        get: /**
         * @return {?}
         */
        function () {
            return this.styling === CheckBoxStyling.CHECKBOX;
        },
        enumerable: true,
        configurable: true
    });
    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 = function () { return [
        { 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 }]
    };
    return FormCheckboxComponent;
}(BaseFormControl));
export { FormCheckboxComponent };
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, 