/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Component, Input, Output, EventEmitter, ElementRef, HostBinding, HostListener } from '@angular/core';
import { SelectService } from '../select/select.service';
import { inputAttrToBoolean } from '../helper';
var OptionComponent = /** @class */ (function () {
    function OptionComponent(elementRef, selectService) {
        this.elementRef = elementRef;
        this.selectService = selectService;
        this.uiChecked = new EventEmitter();
        this.value = '';
        this._disabled = false;
        this._selected = false;
    }
    Object.defineProperty(OptionComponent.prototype, "disabled", {
        get: /**
         * @return {?}
         */
        function () {
            return this._disabled;
        },
        set: /**
         * @param {?} isDisabled
         * @return {?}
         */
        function (isDisabled) {
            this._disabled = inputAttrToBoolean(isDisabled);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OptionComponent.prototype, "selected", {
        get: /**
         * @return {?}
         */
        function () {
            return this._selected;
        },
        set: /**
         * @param {?} isSelected
         * @return {?}
         */
        function (isSelected) {
            this._selected = inputAttrToBoolean(isSelected);
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    OptionComponent.prototype.click = /**
     * @return {?}
     */
    function () {
        if (!this.disabled) {
            this.selectService.checked(this);
            this.uiChecked.emit(this);
        }
    };
    /**
     * @return {?}
     */
    OptionComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        this.nativeElement = this.elementRef.nativeElement;
    };
    OptionComponent.decorators = [
        { type: Component, args: [{
                    selector: 'ui-option',
                    template: "<ng-content></ng-content>"
                },] },
    ];
    /** @nocollapse */
    OptionComponent.ctorParameters = function () { return [
        { type: ElementRef, },
        { type: SelectService, },
    ]; };
    OptionComponent.propDecorators = {
        "uiChecked": [{ type: Output },],
        "value": [{ type: Input },],
        "disabled": [{ type: Input }, { type: HostBinding, args: ['class.ui-disabled',] },],
        "selected": [{ type: Input }, { type: HostBinding, args: ['class.ui-selected',] },],
        "click": [{ type: HostListener, args: ['click',] },],
    };
    return OptionComponent;
}());
export { OptionComponent };
function OptionComponent_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    OptionComponent.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    OptionComponent.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    OptionComponent.propDecorators;
    /** @type {?} */
    OptionComponent.prototype.uiChecked;
    /** @type {?} */
    OptionComponent.prototype.value;
    /** @type {?} */
    OptionComponent.prototype.nativeElement;
    /** @type {?} */
    OptionComponent.prototype._disabled;
    /** @type {?} */
    OptionComponent.prototype._selected;
    /** @type {?} */
    OptionComponent.prototype.elementRef;
    /** @type {?} */
    OptionComponent.prototype.selectService;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YW5iby91aS1uYXRpdmUvIiwic291cmNlcyI6WyJsaWIvZm9ybXMvb3B0aW9uL29wdGlvbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsS0FBSyxFQUNMLE1BQU0sRUFDTixZQUFZLEVBQ1osVUFBVSxFQUVWLFdBQVcsRUFDWCxZQUFZLEVBQ2IsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ3pELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLFdBQVcsQ0FBQzs7SUFtQzdDLHlCQUFvQixVQUFzQixFQUN0QjtRQURBLGVBQVUsR0FBVixVQUFVLENBQVk7UUFDdEIsa0JBQWEsR0FBYixhQUFhO3lCQTdCWCxJQUFJLFlBQVksRUFBbUI7cUJBQ2hDLEVBQUU7eUJBd0JFLEtBQUs7e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