{"version":3,"file":"Menu.mjs","sources":["../../../src/shapes/Menu.ts"],"sourcesContent":["//*PMW* class addded for menu\nimport { Table } from './Table';\nimport { classRegistry } from '../ClassRegistry';\nimport { FabricObject } from './Object/Object';\n\nexport class CustomBorderTable extends Table {\n  /**\n   * Renders vertical borders for table Style Menu Layouts\n   * @param {CanvasRenderingContext2D} ctx context to render on\n   */\n  drawColumnBorders(ctx: CanvasRenderingContext2D) {\n    const groups = this.getObjects();\n    let  w,\n      maxWidth = 0,\n      left = 0;\n\n    for (let i = 0; i < groups.length; i++) {\n      // @ts-ignore\n      const items = groups[i].getObjects();\n      w = items[1].width;\n      if (w > maxWidth) {\n        maxWidth = w;\n        left = this.width / 2 - maxWidth;\n      }\n    }\n    const oldPadding = 11;\n    ctx.beginPath();\n    ctx.moveTo(left - oldPadding * 2, -(this.height / 2));\n    ctx.lineTo(left - oldPadding * 2, -(this.height / 2) + this.height);\n    ctx.stroke();\n  }\n\n  /**\n   * Returns true if design is simple table structure('layout-13'), false otherwise\n   * @returns {boolean}\n   */\n  isTableLayout() {\n    return this.layoutType == 'layout-13';\n  }\n}\n"],"names":["CustomBorderTable","Table","drawColumnBorders","ctx","groups","getObjects","w","maxWidth","left","i","length","items","width","oldPadding","beginPath","moveTo","height","lineTo","stroke","isTableLayout","layoutType"],"mappings":";;AAAA;AAKO,MAAMA,iBAAiB,SAASC,KAAK,CAAC;AAC3C;AACF;AACA;AACA;EACEC,iBAAiBA,CAACC,GAA6B,EAAE;AAC/C,IAAA,MAAMC,MAAM,GAAG,IAAI,CAACC,UAAU,EAAE;AAChC,IAAA,IAAKC,CAAC;AACJC,MAAAA,QAAQ,GAAG,CAAC;AACZC,MAAAA,IAAI,GAAG,CAAC;AAEV,IAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,MAAM,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;AACtC;MACA,MAAME,KAAK,GAAGP,MAAM,CAACK,CAAC,CAAC,CAACJ,UAAU,EAAE;AACpCC,MAAAA,CAAC,GAAGK,KAAK,CAAC,CAAC,CAAC,CAACC,KAAK;MAClB,IAAIN,CAAC,GAAGC,QAAQ,EAAE;AAChBA,QAAAA,QAAQ,GAAGD,CAAC;AACZE,QAAAA,IAAI,GAAG,IAAI,CAACI,KAAK,GAAG,CAAC,GAAGL,QAAQ;AAClC;AACF;IACA,MAAMM,UAAU,GAAG,EAAE;IACrBV,GAAG,CAACW,SAAS,EAAE;AACfX,IAAAA,GAAG,CAACY,MAAM,CAACP,IAAI,GAAGK,UAAU,GAAG,CAAC,EAAE,EAAE,IAAI,CAACG,MAAM,GAAG,CAAC,CAAC,CAAC;IACrDb,GAAG,CAACc,MAAM,CAACT,IAAI,GAAGK,UAAU,GAAG,CAAC,EAAE,EAAE,IAAI,CAACG,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAACA,MAAM,CAAC;IACnEb,GAAG,CAACe,MAAM,EAAE;AACd;;AAEA;AACF;AACA;AACA;AACEC,EAAAA,aAAaA,GAAG;AACd,IAAA,OAAO,IAAI,CAACC,UAAU,IAAI,WAAW;AACvC;AACF;;;;"}