import { Component } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "../../services/model.service";
import * as i2 from "../../services/sti-helper.service";
import * as i3 from "../../services/sti-form-events-service";
import * as i4 from "../../services/sti-localization.service";
import * as i5 from "../../services/sti-undo-service";
import * as i6 from "../../services/sti-clipboard-sevice";
import * as i7 from "@angular/common";
export class ContextMenuWindowComponent {
    constructor(model, helper, formEvents, loc, undoService, clipboardService) {
        this.model = model;
        this.helper = helper;
        this.formEvents = formEvents;
        this.loc = loc;
        this.undoService = undoService;
        this.clipboardService = clipboardService;
    }
    ngOnInit() { }
    pasteElement(event) {
        this.model.showContextMenu = false;
        this.clipboardService.pasteElement(event);
    }
    copyElement() {
        this.model.showContextMenu = false;
        this.clipboardService.copyElement();
    }
    cutElement() {
        this.model.showContextMenu = false;
        this.clipboardService.cutElement();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ContextMenuWindowComponent, deps: [{ token: i1.StiModelService }, { token: i2.StiHelperService }, { token: i3.FormEventsService }, { token: i4.StiLocalizationService }, { token: i5.StiUndoService }, { token: i6.StiClipboardService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ContextMenuWindowComponent, selector: "sti-context-menu-window", ngImport: i0, template: `
    <div [style.left.px]="model.contextMenuX" [style.top.px]="model.contextMenuY" class="context-menu">
      <div
        *ngIf="(model.selectedComponent || clipboardService.hasCopy) && !model.selectedPage"
        class="context-menu-container"
      >
        <div
          class="context-menu-item {{ undoService.undos.length < 2 ? 'disabled' : '' }}"
          (click)="undoService.undo(); model.showContextMenu = false"
        >
          <img [src]="model.getImage('images.Ribbon.Undo.png')" /><span>{{
            loc.get2("MainMenu", "menuEditUndo").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div
          class="context-menu-item {{ undoService.redos.length < 1 ? 'disabled' : '' }}"
          (click)="undoService.redo(); model.showContextMenu = false"
        >
          <img [src]="model.getImage('images.Ribbon.Redo.png')" /><span>{{
            loc.get2("MainMenu", "menuEditRedo").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div
          class="context-menu-item {{ !clipboardService.hasCopy ? 'disabled' : '' }}"
          (click)="pasteElement($event)"
        >
          <img [src]="model.getImage('images.Ribbon.Paste.png')" /><span>{{
            loc.get2("MainMenu", "menuEditPaste").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ clipboardService.canCopy ? 'disabled' : '' }}" (click)="copyElement()">
          <img [src]="model.getImage('images.Ribbon.Copy.png')" /><span>{{
            loc.get2("MainMenu", "menuEditCopy").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ clipboardService.canCopy ? 'disabled' : '' }}" (click)="cutElement()">
          <img [src]="model.getImage('images.Ribbon.Cut.png')" /><span>{{
            loc.get2("MainMenu", "menuEditCut").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.deleteComponent()">
          <img [src]="model.getImage('images.Ribbon.Delete.png')" /><span>{{ loc.get2("Buttons", "Delete") }}</span>
        </div>
      </div>

      <!-- //////////////////////////////////////////////////////////////////// -->

      <div *ngIf="model.selectedPage" class="context-menu-container">
        <div *ngIf="clipboardService.hasCopy" class="context-menu-item" (click)="pasteElement($event)">
          <img [src]="model.getImage('images.Ribbon.Paste.png')" /><span>{{
            loc.get2("MainMenu", "menuEditPaste").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canMoveUp ? 'disabled' : '' }}" (click)="formEvents.moveUp()">
          <img [src]="model.getImage('images.Page.MovePageUp.png')" /><span>{{
            loc.get2("QueryBuilder", "MoveUp")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canMoveDown ? 'disabled' : '' }}" (click)="formEvents.moveDown()">
          <img [src]="model.getImage('images.Page.MovePageDown.png')" /><span>{{
            loc.get2("QueryBuilder", "MoveDown")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.insertBefore()">
          <img [src]="model.getImage('images.Page.InsertPageBefore.png')" /><span>{{
            loc.get2("TableRibbon", "InsertAbove")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.insertAfter()">
          <img [src]="model.getImage('images.Page.InsertPageAfter.png')" /><span>{{
            loc.get2("TableRibbon", "InsertBelow")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canClear ? 'disabled' : '' }}" (click)="formEvents.clear()">
          <img [src]="model.getImage('images.Page.ClearContent.png')" /><span>{{
            loc.get2("MainMenu", "menuEditClearContents")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canDelete ? 'disabled' : '' }}" (click)="formEvents.delete()">
          <img [src]="model.getImage('images.Page.DeletePage.png')" /><span>{{
            loc.get2("FormViewer", "PageDelete")
          }}</span>
        </div>
      </div>
    </div>
  `, isInline: true, styles: [".context-menu{position:absolute;z-index:999999999999999;background-color:var(--back-color);min-height:20px;max-height:380px;min-width:200px;display:flex;border:1px solid #c6c6c6;color:#444;-moz-box-shadow:0px 0px 7px rgba(0,0,0,.6);-webkit-box-shadow:0px 0px 7px rgb(0 0 0 / 60%);box-shadow:0 0 7px #0000004d;cursor:default;font-family:Arial;font-size:12px;padding:1px}.context-menu-container{height:100%;width:100%;display:flex;flex-direction:column;-webkit-user-select:none}.context-menu-item{display:flex;width:100%;height:26px;align-items:center;border-radius:3px}.context-menu-item:hover{background-color:#dadada}.context-menu-item img{height:16px;width:16px;margin-left:10px;margin-right:10px}.context-menu-item span{margin-right:10px}.disabled{opacity:.5;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ContextMenuWindowComponent, decorators: [{
            type: Component,
            args: [{ selector: "sti-context-menu-window", template: `
    <div [style.left.px]="model.contextMenuX" [style.top.px]="model.contextMenuY" class="context-menu">
      <div
        *ngIf="(model.selectedComponent || clipboardService.hasCopy) && !model.selectedPage"
        class="context-menu-container"
      >
        <div
          class="context-menu-item {{ undoService.undos.length < 2 ? 'disabled' : '' }}"
          (click)="undoService.undo(); model.showContextMenu = false"
        >
          <img [src]="model.getImage('images.Ribbon.Undo.png')" /><span>{{
            loc.get2("MainMenu", "menuEditUndo").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div
          class="context-menu-item {{ undoService.redos.length < 1 ? 'disabled' : '' }}"
          (click)="undoService.redo(); model.showContextMenu = false"
        >
          <img [src]="model.getImage('images.Ribbon.Redo.png')" /><span>{{
            loc.get2("MainMenu", "menuEditRedo").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div
          class="context-menu-item {{ !clipboardService.hasCopy ? 'disabled' : '' }}"
          (click)="pasteElement($event)"
        >
          <img [src]="model.getImage('images.Ribbon.Paste.png')" /><span>{{
            loc.get2("MainMenu", "menuEditPaste").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ clipboardService.canCopy ? 'disabled' : '' }}" (click)="copyElement()">
          <img [src]="model.getImage('images.Ribbon.Copy.png')" /><span>{{
            loc.get2("MainMenu", "menuEditCopy").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ clipboardService.canCopy ? 'disabled' : '' }}" (click)="cutElement()">
          <img [src]="model.getImage('images.Ribbon.Cut.png')" /><span>{{
            loc.get2("MainMenu", "menuEditCut").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.deleteComponent()">
          <img [src]="model.getImage('images.Ribbon.Delete.png')" /><span>{{ loc.get2("Buttons", "Delete") }}</span>
        </div>
      </div>

      <!-- //////////////////////////////////////////////////////////////////// -->

      <div *ngIf="model.selectedPage" class="context-menu-container">
        <div *ngIf="clipboardService.hasCopy" class="context-menu-item" (click)="pasteElement($event)">
          <img [src]="model.getImage('images.Ribbon.Paste.png')" /><span>{{
            loc.get2("MainMenu", "menuEditPaste").replace("&amp", "").replace(";", "")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canMoveUp ? 'disabled' : '' }}" (click)="formEvents.moveUp()">
          <img [src]="model.getImage('images.Page.MovePageUp.png')" /><span>{{
            loc.get2("QueryBuilder", "MoveUp")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canMoveDown ? 'disabled' : '' }}" (click)="formEvents.moveDown()">
          <img [src]="model.getImage('images.Page.MovePageDown.png')" /><span>{{
            loc.get2("QueryBuilder", "MoveDown")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.insertBefore()">
          <img [src]="model.getImage('images.Page.InsertPageBefore.png')" /><span>{{
            loc.get2("TableRibbon", "InsertAbove")
          }}</span>
        </div>
        <div class="context-menu-item" (click)="formEvents.insertAfter()">
          <img [src]="model.getImage('images.Page.InsertPageAfter.png')" /><span>{{
            loc.get2("TableRibbon", "InsertBelow")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canClear ? 'disabled' : '' }}" (click)="formEvents.clear()">
          <img [src]="model.getImage('images.Page.ClearContent.png')" /><span>{{
            loc.get2("MainMenu", "menuEditClearContents")
          }}</span>
        </div>
        <div class="context-menu-item {{ !formEvents.canDelete ? 'disabled' : '' }}" (click)="formEvents.delete()">
          <img [src]="model.getImage('images.Page.DeletePage.png')" /><span>{{
            loc.get2("FormViewer", "PageDelete")
          }}</span>
        </div>
      </div>
    </div>
  `, styles: [".context-menu{position:absolute;z-index:999999999999999;background-color:var(--back-color);min-height:20px;max-height:380px;min-width:200px;display:flex;border:1px solid #c6c6c6;color:#444;-moz-box-shadow:0px 0px 7px rgba(0,0,0,.6);-webkit-box-shadow:0px 0px 7px rgb(0 0 0 / 60%);box-shadow:0 0 7px #0000004d;cursor:default;font-family:Arial;font-size:12px;padding:1px}.context-menu-container{height:100%;width:100%;display:flex;flex-direction:column;-webkit-user-select:none}.context-menu-item{display:flex;width:100%;height:26px;align-items:center;border-radius:3px}.context-menu-item:hover{background-color:#dadada}.context-menu-item img{height:16px;width:16px;margin-left:10px;margin-right:10px}.context-menu-item span{margin-right:10px}.disabled{opacity:.5;pointer-events:none}\n"] }]
        }], ctorParameters: () => [{ type: i1.StiModelService }, { type: i2.StiHelperService }, { type: i3.FormEventsService }, { type: i4.StiLocalizationService }, { type: i5.StiUndoService }, { type: i6.StiClipboardService }] });
//# sourceMappingURL=data:application/json;base64, 