/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { NzModalService } from 'ng-zorro-antd';
export class KengicDashboardItemComponent {
    /**
     * @param {?} nzModalService
     */
    constructor(nzModalService) {
        this.nzModalService = nzModalService;
        this.item = {
            x: 0,
            y: 0,
            cols: 1,
            rows: 1,
            title: '',
        };
        this.i18n = {};
        this.view = new EventEmitter();
        this.edit = new EventEmitter();
        this.remove = new EventEmitter();
    }
    /**
     * View the item
     * @param {?} item The item
     * @return {?}
     */
    handleView(item) {
        this.view.emit(item);
    }
    /**
     * Edit the item
     * @param {?} item The item
     * @return {?}
     */
    handleEdit(item) {
        this.edit.emit(item);
    }
    /**
     * Remove the item
     * @param {?} item The item
     * @return {?}
     */
    handleRemove(item) {
        this.nzModalService.confirm({
            nzTitle: 'Confirm',
            nzContent: 'Do you want to delete this panel?',
            nzOnOk: (/**
             * @return {?}
             */
            () => {
                this.remove.emit(item);
            }),
        });
    }
}
KengicDashboardItemComponent.decorators = [
    { type: Component, args: [{
                selector: 'kengic-dashboard-item',
                template: "<nz-card [nzTitle]=\"header\">\r\n  <ng-content></ng-content>\r\n</nz-card>\r\n\r\n<ng-template #header>\r\n  <div\r\n    [nzDropdownMenu]=\"menuTpl\"\r\n    [nzOverlayStyle]=\"{\r\n      userSelect: 'none',\r\n      width: '100px',\r\n      float: 'right'\r\n    }\"\r\n    nz-dropdown\r\n    nzPlacement=\"bottomRight\"\r\n    nzTrigger=\"click\"\r\n  >\r\n    {{ item.title }}\r\n    <i nz-icon nzTheme=\"outline\" nzType=\"caret-down\"></i>\r\n  </div>\r\n\r\n  <nz-dropdown-menu #menuTpl=\"nzDropdownMenu\">\r\n    <ul nz-menu>\r\n      <li (click)=\"handleView(item)\" nz-menu-item>\r\n        <i nz-icon nzTheme=\"outline\" nzType=\"eye\"></i>\r\n        {{ i18n?.view || 'View' }}\r\n      </li>\r\n      <li (click)=\"handleEdit(item)\" nz-menu-item>\r\n        <i nz-icon nzTheme=\"outline\" nzType=\"form\"></i>\r\n        {{ i18n?.edit || 'Edit' }}\r\n      </li>\r\n      <li nz-menu-divider></li>\r\n      <li (click)=\"handleRemove(item)\" nz-menu-item>\r\n        <i nz-icon nzTheme=\"outline\" nzType=\"delete\"></i>\r\n        {{ i18n?.remove || 'Remove' }}\r\n      </li>\r\n    </ul>\r\n  </nz-dropdown-menu>\r\n</ng-template>\r\n",
                styles: [":host ::ng-deep .ant-card{margin:0;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host ::ng-deep .ant-card .ant-card-head{cursor:move;text-align:center;min-height:32px;padding:0}:host ::ng-deep .ant-card .ant-card-head .ant-card-head-title{padding:0}:host ::ng-deep .ant-card .ant-card-head .ant-card-head-title div[nz-dropdown]{padding:5px 16px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host ::ng-deep .ant-card .ant-card-head .ant-card-head-title div[nz-dropdown] .anticon{visibility:hidden}:host ::ng-deep .ant-card .ant-card-head .ant-card-head-title div[nz-dropdown]:hover .anticon{visibility:initial}:host ::ng-deep .ant-card .ant-card-body{padding:10px;height:calc(100% - 34px)}"]
            }] }
];
/** @nocollapse */
KengicDashboardItemComponent.ctorParameters = () => [
    { type: NzModalService }
];
KengicDashboardItemComponent.propDecorators = {
    item: [{ type: Input }],
    i18n: [{ type: Input }],
    view: [{ type: Output }],
    edit: [{ type: Output }],
    remove: [{ type: Output }]
};
if (false) {
    /** @type {?} */
    KengicDashboardItemComponent.prototype.item;
    /** @type {?} */
    KengicDashboardItemComponent.prototype.i18n;
    /** @type {?} */
    KengicDashboardItemComponent.prototype.view;
    /** @type {?} */
    KengicDashboardItemComponent.prototype.edit;
    /** @type {?} */
    KengicDashboardItemComponent.prototype.remove;
    /**
     * @type {?}
     * @private
     */
    KengicDashboardItemComponent.prototype.nzModalService;
}
//# sourceMappingURL=data:application/json;base64, 