/*!
 *
 * carbon-angular v0.0.5 | clickable-tile.component.js
 *
 * Copyright 2014, 2019 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import { Component, Input, Output, EventEmitter, Optional } from "@angular/core";
import { Router } from "@angular/router";
/**
 * Build application's clickable tiles using this component.
 *
 * ## Basic usage
 *
 * ```html
 * <ibm-clickable-tile>
 * 		tile content
 * </ibm-clickable-tile>
 * ```
 */
var ClickableTile = /** @class */ (function () {
    function ClickableTile(router) {
        this.router = router;
        /**
         * Sets the `href` attribute on the `ibm-clickable-tile` element.
         */
        this.href = "#";
        /**
         * Set to `true` to disable the clickable tile.
         */
        this.disabled = false;
        /**
         * Emits the navigation status promise when the link is activated
         */
        this.navigation = new EventEmitter();
    }
    ClickableTile.prototype.navigate = function (event) {
        if (this.router && this.route) {
            event.preventDefault();
            var status_1 = this.router.navigate(this.route, this.routeExtras);
            this.navigation.emit(status_1);
        }
    };
    ClickableTile.decorators = [
        { type: Component, args: [{
                    selector: "ibm-clickable-tile",
                    template: "\n\t<a\n\t\tibmLink\n\t\tclass=\"bx--tile bx--tile--clickable\"\n\t\ttabindex=\"0\"\n\t\t(click)=\"navigate($event)\"\n\t\t[href]=\"href\"\n\t\t[attr.target]=\"target\"\n\t\t[attr.aria-disabled]=\"disabled\">\n\t\t<ng-content></ng-content>\n\t</a>"
                },] },
    ];
    /** @nocollapse */
    ClickableTile.ctorParameters = function () { return [
        { type: Router, decorators: [{ type: Optional }] }
    ]; };
    ClickableTile.propDecorators = {
        href: [{ type: Input }],
        target: [{ type: Input }],
        disabled: [{ type: Input }],
        route: [{ type: Input }],
        routeExtras: [{ type: Input }],
        navigation: [{ type: Output }]
    };
    return ClickableTile;
}());
export { ClickableTile };
//# sourceMappingURL=clickable-tile.component.js.map