/**
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, HostBinding, Input } from '@angular/core';
import { convertToBoolProperty } from '../helpers';
/**
 * Action item, display a link with an icon, or any other content provided instead.
 */
var ElActionComponent = /** @class */ (function () {
    function ElActionComponent() {
        /**
         * Optional title for mouseover
         * @type string
         */
        this.title = '';
        this._disabled = false;
    }
    Object.defineProperty(ElActionComponent.prototype, "disabled", {
        /**
         * Visually disables the item
         * @type boolean
         */
        get: function () {
            return this._disabled;
        },
        set: function (value) {
            this._disabled = convertToBoolProperty(value);
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "link", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "href", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "title", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], ElActionComponent.prototype, "icon", void 0);
    __decorate([
        Input(),
        HostBinding('class.disabled'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], ElActionComponent.prototype, "disabled", null);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "badgeText", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "badgeStatus", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], ElActionComponent.prototype, "badgePosition", void 0);
    ElActionComponent = __decorate([
        Component({
            selector: 'el-action',
            template: "\n    <ng-container *ngIf=\"icon; else projectedContent\">\n      <a class=\"icon-container\"\n         [routerLink]=\"link\"\n         [title]=\"title\"\n         *ngIf=\"link\">\n        <el-icon [config]=\"icon\"></el-icon>\n      </a>\n      <a class=\"icon-container\"\n         [href]=\"href\"\n         [title]=\"title\"\n         *ngIf=\"href && !link\">\n        <el-icon [config]=\"icon\"></el-icon>\n      </a>\n      <a class=\"icon-container\"\n         href=\"#\"\n         [title]=\"title\"\n         *ngIf=\"!href && !link\"\n         (click)=\"$event.preventDefault()\">\n        <el-icon [config]=\"icon\"></el-icon>\n      </a>\n    </ng-container>\n\n    <ng-template #projectedContent>\n      <ng-content></ng-content>\n    </ng-template>\n\n    <el-badge *ngIf=\"badgeText\"\n              [text]=\"badgeText\"\n              [status]=\"badgeStatus\"\n              [position]=\"badgePosition\">\n    </el-badge>\n  ",
            styles: [":host{background:transparent;display:flex;align-items:center;position:relative}:host(.disabled){cursor:not-allowed}:host(.disabled) a,:host(.disabled) el-icon{cursor:not-allowed}:host-context(el-actions.full-width){justify-content:center;width:100%}a.icon-container:hover,a.icon-container:focus{text-decoration:none}el-icon:hover{cursor:pointer}\n"]
        })
    ], ElActionComponent);
    return ElActionComponent;
}());
export { ElActionComponent };
/**
 * Shows a horizontal list of actions, available in multiple sizes.
 * Aligns items vertically.
 *
 * @stacked-example(Showcase, action/action-showcase.component)
 *
 * Basic actions setup:
 * ```html
 * <el-actions size="small">
 *   <el-action icon="el-search"></el-action>
 *   <el-action icon="el-power-circled"></el-action>
 *   <el-action icon="el-person"></el-action>
 * </el-actions>
 * ```
 * ### Installation
 *
 * Import `ElActionsModule` to your feature module.
 * ```ts
 * @NgModule({
 *   imports: [
 *     // ...
 *     ElActionsModule,
 *   ],
 * })
 * export class PageModule { }
 * ```
 * ### Usage
 *
 * Multiple sizes example:
 * @stacked-example(Multiple Sizes, action/action-sizes.component)
 *
 * It is also possible to specify a `badge` value:
 *
 * @stacked-example(Action Badge, action/action-badge.component)
 *
 * and we can set it to full a width of a parent component
 * @stacked-example(Full Width, action/action-width.component)
 *
 * @styles
 *
 * actions-background-color:
 * actions-divider-color:
 * actions-divider-style:
 * actions-divider-width:
 * actions-icon-color:
 * actions-text-color:
 * actions-text-font-family:
 * actions-text-font-weight:
 * actions-text-line-height:
 * actions-disabled-icon-color:
 * actions-disabled-text-color:
 * actions-tiny-height:
 * actions-tiny-icon-height:
 * actions-tiny-padding:
 * actions-tiny-text-font-size:
 * actions-small-height:
 * actions-small-icon-height:
 * actions-small-padding:
 * actions-small-text-font-size:
 * actions-medium-height:
 * actions-medium-icon-height:
 * actions-medium-padding:
 * actions-medium-text-font-size:
 * actions-large-height:
 * actions-large-icon-height:
 * actions-large-padding:
 * actions-large-text-font-size:
 * actions-giant-height:
 * actions-giant-icon-height:
 * actions-giant-padding:
 * actions-giant-text-font-size:
 */
var ElActionsComponent = /** @class */ (function () {
    function ElActionsComponent() {
        this._size = 'small';
        this._fullWidth = false;
    }
    Object.defineProperty(ElActionsComponent.prototype, "size", {
        /**
         * Size of the component: 'tiny', 'small' (default), 'medium', 'large', 'giant'
         */
        get: function () {
            return this._size;
        },
        set: function (value) {
            this._size = value;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "fullWidth", {
        /**
         * Component will fill full width of the container
         */
        get: function () {
            return this._fullWidth;
        },
        set: function (value) {
            this._fullWidth = convertToBoolProperty(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "tiny", {
        get: function () {
            return this.size === 'tiny';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "small", {
        get: function () {
            return this.size === 'small';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "medium", {
        get: function () {
            return this.size === 'medium';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "large", {
        get: function () {
            return this.size === 'large';
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ElActionsComponent.prototype, "giant", {
        get: function () {
            return this.size === 'giant';
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        Input(),
        __metadata("design:type", String),
        __metadata("design:paramtypes", [String])
    ], ElActionsComponent.prototype, "size", null);
    __decorate([
        Input(),
        HostBinding('class.full-width'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [Boolean])
    ], ElActionsComponent.prototype, "fullWidth", null);
    __decorate([
        HostBinding('class.size-tiny'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], ElActionsComponent.prototype, "tiny", null);
    __decorate([
        HostBinding('class.size-small'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], ElActionsComponent.prototype, "small", null);
    __decorate([
        HostBinding('class.size-medium'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], ElActionsComponent.prototype, "medium", null);
    __decorate([
        HostBinding('class.size-large'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], ElActionsComponent.prototype, "large", null);
    __decorate([
        HostBinding('class.size-giant'),
        __metadata("design:type", Boolean),
        __metadata("design:paramtypes", [])
    ], ElActionsComponent.prototype, "giant", null);
    ElActionsComponent = __decorate([
        Component({
            selector: 'el-actions',
            template: "\n    <ng-content select=\"el-action\"></ng-content>\n  ",
            styles: [":host{display:flex;align-items:center}\n"]
        })
    ], ElActionsComponent);
    return ElActionsComponent;
}());
export { ElActionsComponent };
//# sourceMappingURL=actions.component.js.map