/**
 * @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;
        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 class=\"clr-form-control\" [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                    [ngClass]=\"{ 'clr-checkbox': isCheckbox, 'clr-toggle': !isCheckbox }\"\n                    [formControl]=\"formControl\"\n                />\n                <label class=\"clr-control-label right-label\" [for]=\"id\">\n                    <clr-icon *ngIf=\"iconShape\" [attr.shape]=\"iconShape\"></clr-icon>\n                    {{ text }}\n                </label>\n            </div>\n            <span class=\"clr-subtext\" *ngIf=\"showErrors\">\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\">\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"
                }] }
    ];
    /** @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 }]
    };
    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;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jaGVja2JveC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmNkL3VpLWNvbXBvbmVudHMvIiwic291cmNlcyI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