/**
 * @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';
var OptionComponent = /** @class */ (function () {
    function OptionComponent(elementRef, selectService) {
        this.elementRef = elementRef;
        this.selectService = selectService;
        this.value = '';
        this.checked = new EventEmitter();
    }
    Object.defineProperty(OptionComponent.prototype, "disabled", {
        get: /**
         * @return {?}
         */
        function () {
            var /** @type {?} */ isDisabled = (/** @type {?} */ (this)).hasOwnProperty('_disabled');
            return isDisabled && this._disabled !== false;
        },
        set: /**
         * @param {?} isDisabled
         * @return {?}
         */
        function (isDisabled) {
            this._disabled = isDisabled;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OptionComponent.prototype, "selected", {
        get: /**
         * @return {?}
         */
        function () {
            var /** @type {?} */ isSelected = (/** @type {?} */ (this)).hasOwnProperty('_selected');
            return isSelected && this._selected !== false;
        },
        set: /**
         * @param {?} isSelected
         * @return {?}
         */
        function (isSelected) {
            this._selected = isSelected;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    OptionComponent.prototype.click = /**
     * @return {?}
     */
    function () {
        if (!this.disabled) {
            this.selectService.checked(this);
            this.checked.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 = {
        "value": [{ type: Input },],
        "disabled": [{ type: Input }, { type: HostBinding, args: ['class.ui-disabled',] },],
        "selected": [{ type: Input }, { type: HostBinding, args: ['class.ui-selected',] },],
        "checked": [{ type: Output },],
        "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.value;
    /** @type {?} */
    OptionComponent.prototype.checked;
    /** @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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YW5iby91aS1uYXRpdmUvIiwic291cmNlcyI6WyJsaWIvZm9ybXMvb3B0aW9uL29wdGlvbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsS0FBSyxFQUNMLE1BQU0sRUFDTixZQUFZLEVBQ1osVUFBVSxFQUVWLFdBQVcsRUFDWCxZQUFZLEVBQ2IsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLDBCQUEwQixDQUFDOztJQXVDdkQseUJBQW9CLFVBQXNCLEVBQ3RCO1FBREEsZUFBVSxHQUFWLFVBQVUsQ0FBWTtRQUN0QixrQkFBYSxHQUFiLGFBQWE7cUJBaENqQixFQUFFO3VCQXlCUixJQUFJLFlBQVksRUFBbUI7S0FRNUM7MEJBN0JHLHFDQUFROzs7O1FBSVo7WUFDR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