@sme.up/doc-alchemist 1.3.0 → 1.4.0-CommonJS-20251015134706

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/gfx-data.js +4 -1
  3. package/dist/assets/gfx-data.js.map +1 -1
  4. package/dist/converters/excel/commons.d.ts +2 -2
  5. package/dist/converters/excel/commons.js +49 -33
  6. package/dist/converters/excel/commons.js.map +1 -1
  7. package/dist/converters/excel/excel-converter.types.js +14 -11
  8. package/dist/converters/excel/excel-converter.types.js.map +1 -1
  9. package/dist/converters/excel/matrix-converter.d.ts +3 -3
  10. package/dist/converters/excel/matrix-converter.js +46 -36
  11. package/dist/converters/excel/matrix-converter.js.map +1 -1
  12. package/dist/converters/excel/tree-converter.d.ts +2 -2
  13. package/dist/converters/excel/tree-converter.js +33 -25
  14. package/dist/converters/excel/tree-converter.js.map +1 -1
  15. package/dist/converters/excel-converter.d.ts +3 -3
  16. package/dist/converters/excel-converter.js +18 -13
  17. package/dist/converters/excel-converter.js.map +1 -1
  18. package/dist/converters/images/charts-generator.d.ts +2 -2
  19. package/dist/converters/images/charts-generator.js +41 -4
  20. package/dist/converters/images/charts-generator.js.map +1 -1
  21. package/dist/converters/pdf/autotable-renderer.d.ts +2 -2
  22. package/dist/converters/pdf/autotable-renderer.js +7 -3
  23. package/dist/converters/pdf/autotable-renderer.js.map +1 -1
  24. package/dist/converters/pdf/cover-renderer.js +41 -4
  25. package/dist/converters/pdf/cover-renderer.js.map +1 -1
  26. package/dist/converters/pdf/formulas-helper.d.ts +2 -2
  27. package/dist/converters/pdf/formulas-helper.js +37 -28
  28. package/dist/converters/pdf/formulas-helper.js.map +1 -1
  29. package/dist/converters/pdf/matrix-converter.d.ts +2 -2
  30. package/dist/converters/pdf/matrix-converter.js +52 -12
  31. package/dist/converters/pdf/matrix-converter.js.map +1 -1
  32. package/dist/converters/pdf/pdf-converter.types.js +2 -1
  33. package/dist/converters/pdf/pdf-converter.types.js.map +1 -1
  34. package/dist/converters/pdf/sch-converter.d.ts +1 -1
  35. package/dist/converters/pdf/sch-converter.js +43 -6
  36. package/dist/converters/pdf/sch-converter.js.map +1 -1
  37. package/dist/converters/pdf-converter.d.ts +3 -3
  38. package/dist/converters/pdf-converter.js +23 -18
  39. package/dist/converters/pdf-converter.js.map +1 -1
  40. package/dist/index.d.ts +7 -7
  41. package/dist/index.js +13 -4
  42. package/dist/index.js.map +1 -1
  43. package/dist/types/component-props.js +5 -2
  44. package/dist/types/component-props.js.map +1 -1
  45. package/dist/types/component.js +7 -4
  46. package/dist/types/component.js.map +1 -1
  47. package/dist/types/converter.js +2 -1
  48. package/dist/types/converter.js.map +1 -1
  49. package/dist/types/data-structures/smeupDataStructure.d.ts +4 -4
  50. package/dist/types/data-structures/smeupDataStructure.js +16 -12
  51. package/dist/types/data-structures/smeupDataStructure.js.map +1 -1
  52. package/dist/types/data-structures/smeupDataTable.d.ts +1 -1
  53. package/dist/types/data-structures/smeupDataTable.js +4 -1
  54. package/dist/types/data-structures/smeupDataTable.js.map +1 -1
  55. package/dist/types/data-structures/smeupDataTree.d.ts +2 -2
  56. package/dist/types/data-structures/smeupDataTree.js +2 -1
  57. package/dist/types/data-structures/smeupDataTree.js.map +1 -1
  58. package/dist/types/data-structures/smeupSch.d.ts +6 -6
  59. package/dist/types/data-structures/smeupSch.js +5 -2
  60. package/dist/types/data-structures/smeupSch.js.map +1 -1
  61. package/dist/types/dynamism.d.ts +1 -1
  62. package/dist/types/dynamism.js +7 -4
  63. package/dist/types/dynamism.js.map +1 -1
  64. package/dist/types/general.js +7 -2
  65. package/dist/types/general.js.map +1 -1
  66. package/dist/types/helpers.js +5 -2
  67. package/dist/types/helpers.js.map +1 -1
  68. package/dist/types/index.d.ts +3 -2
  69. package/dist/types/index.js +7 -4
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/utils/commons-utility.d.ts +4 -3
  72. package/dist/utils/commons-utility.js +136 -43
  73. package/dist/utils/commons-utility.js.map +1 -1
  74. package/dist/utils/datastructure-utility.d.ts +1 -1
  75. package/dist/utils/datastructure-utility.js +5 -1
  76. package/dist/utils/datastructure-utility.js.map +1 -1
  77. package/dist/utils/dates-utility.js +37 -27
  78. package/dist/utils/dates-utility.js.map +1 -1
  79. package/dist/utils/formatter-utility.d.ts +1 -1
  80. package/dist/utils/formatter-utility.js +9 -3
  81. package/dist/utils/formatter-utility.js.map +1 -1
  82. package/dist/utils/image-utils.js +10 -3
  83. package/dist/utils/image-utils.js.map +1 -1
  84. package/dist/utils/math-utility.js +46 -29
  85. package/dist/utils/math-utility.js.map +1 -1
  86. package/dist/utils/objects-utility.d.ts +1 -1
  87. package/dist/utils/objects-utility.js +9 -3
  88. package/dist/utils/objects-utility.js.map +1 -1
  89. package/dist/utils/regex-utility.js +4 -1
  90. package/dist/utils/regex-utility.js.map +1 -1
  91. package/package.json +1 -2
@@ -1,8 +1,44 @@
1
- import * as jsPDFModule from "jspdf";
2
- import { dataTableToChart } from "../images/charts-generator.js";
3
- import { Shapes } from "../../types/component.js";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.schedaToPdfDoc = void 0;
37
+ const jsPDFModule = __importStar(require("jspdf"));
38
+ const charts_generator_1 = require("../images/charts-generator");
39
+ const component_1 = require("../../types/component");
4
40
  const jsPDF = jsPDFModule.jsPDF;
5
- export const schedaToPdfDoc = async (sch) => {
41
+ const schedaToPdfDoc = async (sch) => {
6
42
  const doc = new jsPDF({ orientation: "landscape" });
7
43
  const x = 10;
8
44
  const y = 10;
@@ -28,6 +64,7 @@ export const schedaToPdfDoc = async (sch) => {
28
64
  }
29
65
  return doc;
30
66
  };
67
+ exports.schedaToPdfDoc = schedaToPdfDoc;
31
68
  // Helper to render a section
32
69
  const renderSection = async (doc, section, parentLayout, parentX, parentY, parentW, parentH) => {
33
70
  const layout = section.layout || parentLayout;
@@ -51,7 +88,7 @@ const renderSection = async (doc, section, parentLayout, parentX, parentY, paren
51
88
  if (options == null) {
52
89
  throw new Error("Options is undefined or null for component");
53
90
  }
54
- const image = await dataTableToChart(data, "line", {
91
+ const image = await (0, charts_generator_1.dataTableToChart)(data, "line", {
55
92
  Width: String((sectionW - 4) * 10),
56
93
  Height: String((sectionH - 20) * 10),
57
94
  ...options,
@@ -85,7 +122,7 @@ const filterSections = (sections) => {
85
122
  // Filter out sections that are empty or have no components
86
123
  if (section.components &&
87
124
  section.components.length > 0 &&
88
- section.components[0].type === Shapes.EXA) {
125
+ section.components[0].type === component_1.Shapes.EXA) {
89
126
  return true;
90
127
  }
91
128
  // Recursively filter child sections
@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,CAAC;AACL,CAAC,CAAC","sourcesContent":["import * as jsPDFModule from \"jspdf\";\nimport { dataTableToChart } from \"../images/charts-generator.js\";\nimport { Shapes } from \"../../types/component.js\";\nimport { SmeupDataTable } from \"../../types/data-structures/smeupDataTable.js\";\nimport {\n SmeupSch,\n SmeupSchSection,\n} from \"../../types/data-structures/smeupSch.js\";\nconst jsPDF = jsPDFModule.jsPDF;\n\nexport const schedaToPdfDoc = async (\n sch: SmeupSch,\n): Promise<jsPDFModule.jsPDF> => {\n const doc = new jsPDF({ orientation: \"landscape\" });\n const x = 10;\n const y = 10;\n doc.setFont(\"Helvetica\", \"normal\", 10);\n const pageWidth = doc.internal.pageSize.getWidth();\n const pageHeight = doc.internal.pageSize.getHeight();\n\n const layout = sch.layout || \"column\";\n const sections = sch.sections || [];\n let offsetX = x;\n let offsetY = y;\n for (const section of filterSections(sections)) {\n let sectionW = pageWidth - 2 * x;\n let sectionH = (pageHeight - 2 * y) / sections.length;\n if (layout === \"row\") {\n sectionW = (pageWidth - 2 * x) / sections.length;\n sectionH = pageHeight - 2 * y;\n }\n await renderSection(\n doc,\n section,\n layout,\n offsetX,\n offsetY,\n sectionW,\n sectionH,\n );\n if (layout === \"row\") offsetX += sectionW;\n else offsetY += sectionH;\n }\n\n return doc;\n};\n\n// Helper to render a section\nconst renderSection = async (\n doc: jsPDFModule.jsPDF,\n section: SmeupSchSection,\n parentLayout: string,\n parentX: number,\n parentY: number,\n parentW: number,\n parentH: number,\n): Promise<void> => {\n const layout = section.layout || parentLayout;\n const title = section.components?.[0]?.title || \"\";\n const dim = section.dim ? parseFloat(section.dim) : undefined;\n let sectionW = parentW;\n let sectionH = parentH;\n if (dim) {\n if (layout === \"row\") sectionW = parentW * (dim / 100);\n else sectionH = parentH * (dim / 100);\n }\n // Draw title\n doc.text(title, parentX + 2, parentY + 7);\n // Draw component type (assume one component)\n if (section.components && section.components.length > 0) {\n //const compType = section.components[0].type;\n const data = section.components[0].data || ({} as SmeupDataTable);\n const options = section.components[0].options?.EXA?.[0];\n if (options == null) {\n throw new Error(\"Options is undefined or null for component\");\n }\n const image = await dataTableToChart(data as SmeupDataTable, \"line\", {\n Width: String((sectionW - 4) * 10),\n Height: String((sectionH - 20) * 10),\n ...options,\n });\n const base64Image = image.toString(\"base64\");\n doc.addImage(\n `data:image/jpg;base64,${base64Image}`,\n \"JPG\",\n parentX + 2,\n parentY + 15,\n sectionW - 4,\n sectionH - 20,\n undefined,\n );\n }\n // Draw child sections\n if (section.sections && section.sections.length > 0) {\n let offsetX = parentX;\n let offsetY = parentY + 20;\n const filteredSections = filterSections(section.sections);\n for (let i = 0; i < filteredSections.length; i++) {\n const sub = filteredSections[i];\n let subW = sectionW;\n let subH = sectionH;\n if (layout === \"row\") subW = sectionW / section.sections!.length;\n else subH = sectionH / section.sections!.length;\n await renderSection(doc, sub, layout, offsetX, offsetY, subW, subH);\n if (layout === \"row\") offsetX += subW;\n else offsetY += subH;\n }\n }\n};\n\nconst filterSections = (sections: SmeupSchSection[]): SmeupSchSection[] => {\n return sections.filter(section => {\n // Filter out sections that are empty or have no components\n if (\n section.components &&\n section.components.length > 0 &&\n section.components[0].type === Shapes.EXA\n ) {\n return true;\n }\n // Recursively filter child sections\n if (section.sections && section.sections.length > 0) {\n section.sections = filterSections(section.sections);\n return section.sections.length > 0;\n }\n return false;\n });\n};\n"]}
1
+ {"version":3,"file":"sch-converter.js","sourceRoot":"","sources":["../../../src/converters/pdf/sch-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AACrC,iEAA8D;AAC9D,qDAA+C;AAM/C,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;AAEzB,MAAM,cAAc,GAAG,KAAK,EACjC,GAAa,EACe,EAAE;IAC9B,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IACpD,MAAM,CAAC,GAAG,EAAE,CAAC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AAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACpE,IAAI,MAAM,KAAK,KAAK;gBAAE,OAAO,IAAI,IAAI,CAAC;;gBACjC,OAAO,IAAI,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAA2B,EAAqB,EAAE;IACxE,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAC/B,2DAA2D;QAC3D,IACE,OAAO,CAAC,UAAU;YAClB,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YAC7B,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAM,CAAC,GAAG,EACzC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,oCAAoC;QACpC,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpD,OAAO,CAAC,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpD,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import * as jsPDFModule from \"jspdf\";\nimport { dataTableToChart } from \"../images/charts-generator\";\nimport { Shapes } from \"../../types/component\";\nimport { SmeupDataTable } from \"../../types/data-structures/smeupDataTable\";\nimport {\n SmeupSch,\n SmeupSchSection,\n} from \"../../types/data-structures/smeupSch\";\nconst jsPDF = jsPDFModule.jsPDF;\n\nexport const schedaToPdfDoc = async (\n sch: SmeupSch,\n): Promise<jsPDFModule.jsPDF> => {\n const doc = new jsPDF({ orientation: \"landscape\" });\n const x = 10;\n const y = 10;\n doc.setFont(\"Helvetica\", \"normal\", 10);\n const pageWidth = doc.internal.pageSize.getWidth();\n const pageHeight = doc.internal.pageSize.getHeight();\n\n const layout = sch.layout || \"column\";\n const sections = sch.sections || [];\n let offsetX = x;\n let offsetY = y;\n for (const section of filterSections(sections)) {\n let sectionW = pageWidth - 2 * x;\n let sectionH = (pageHeight - 2 * y) / sections.length;\n if (layout === \"row\") {\n sectionW = (pageWidth - 2 * x) / sections.length;\n sectionH = pageHeight - 2 * y;\n }\n await renderSection(\n doc,\n section,\n layout,\n offsetX,\n offsetY,\n sectionW,\n sectionH,\n );\n if (layout === \"row\") offsetX += sectionW;\n else offsetY += sectionH;\n }\n\n return doc;\n};\n\n// Helper to render a section\nconst renderSection = async (\n doc: jsPDFModule.jsPDF,\n section: SmeupSchSection,\n parentLayout: string,\n parentX: number,\n parentY: number,\n parentW: number,\n parentH: number,\n): Promise<void> => {\n const layout = section.layout || parentLayout;\n const title = section.components?.[0]?.title || \"\";\n const dim = section.dim ? parseFloat(section.dim) : undefined;\n let sectionW = parentW;\n let sectionH = parentH;\n if (dim) {\n if (layout === \"row\") sectionW = parentW * (dim / 100);\n else sectionH = parentH * (dim / 100);\n }\n // Draw title\n doc.text(title, parentX + 2, parentY + 7);\n // Draw component type (assume one component)\n if (section.components && section.components.length > 0) {\n //const compType = section.components[0].type;\n const data = section.components[0].data || ({} as SmeupDataTable);\n const options = section.components[0].options?.EXA?.[0];\n if (options == null) {\n throw new Error(\"Options is undefined or null for component\");\n }\n const image = await dataTableToChart(data as SmeupDataTable, \"line\", {\n Width: String((sectionW - 4) * 10),\n Height: String((sectionH - 20) * 10),\n ...options,\n });\n const base64Image = image.toString(\"base64\");\n doc.addImage(\n `data:image/jpg;base64,${base64Image}`,\n \"JPG\",\n parentX + 2,\n parentY + 15,\n sectionW - 4,\n sectionH - 20,\n undefined,\n );\n }\n // Draw child sections\n if (section.sections && section.sections.length > 0) {\n let offsetX = parentX;\n let offsetY = parentY + 20;\n const filteredSections = filterSections(section.sections);\n for (let i = 0; i < filteredSections.length; i++) {\n const sub = filteredSections[i];\n let subW = sectionW;\n let subH = sectionH;\n if (layout === \"row\") subW = sectionW / section.sections!.length;\n else subH = sectionH / section.sections!.length;\n await renderSection(doc, sub, layout, offsetX, offsetY, subW, subH);\n if (layout === \"row\") offsetX += subW;\n else offsetY += subH;\n }\n }\n};\n\nconst filterSections = (sections: SmeupSchSection[]): SmeupSchSection[] => {\n return sections.filter(section => {\n // Filter out sections that are empty or have no components\n if (\n section.components &&\n section.components.length > 0 &&\n section.components[0].type === Shapes.EXA\n ) {\n return true;\n }\n // Recursively filter child sections\n if (section.sections && section.sections.length > 0) {\n section.sections = filterSections(section.sections);\n return section.sections.length > 0;\n }\n return false;\n });\n};\n\n"]}
@@ -1,6 +1,6 @@
1
- import { SmeupDataTable } from "../types/data-structures/smeupDataTable.js";
2
- import { SmeupSch } from "../types/data-structures/smeupSch.js";
3
- import { WebupManagerData, GenericObject } from "../types/index.js";
1
+ import { SmeupDataTable } from "../types/data-structures/smeupDataTable";
2
+ import { SmeupSch } from "../types/data-structures/smeupSch";
3
+ import { WebupManagerData, GenericObject } from "../types/index";
4
4
  export declare const schedaToPdfData: (sch: SmeupSch, webupManagerData: WebupManagerData) => Promise<Buffer>;
5
5
  export declare const dataTableToPdfData: (component: {
6
6
  smeupDataTable: SmeupDataTable;
@@ -1,38 +1,43 @@
1
+ "use strict";
1
2
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
- import { SupportedExportFormats, } from "../types/index.js";
3
- import { convertToBuffer } from "../utils/commons-utility.js";
4
- import { dataTableToExcelWorkbook } from "./excel/matrix-converter.js";
5
- import { dataTableToPdfDoc } from "./pdf/matrix-converter.js";
6
- import { schedaToPdfDoc } from "./pdf/sch-converter.js";
7
- import { PDFDocument } from "pdf-lib";
8
- import { createCoverPdf } from "./pdf/cover-renderer.js";
9
- import { logoBase64 } from "../assets/gfx-data.js";
10
- export const schedaToPdfData = async (sch, webupManagerData) => {
11
- const doc = await schedaToPdfDoc(sch);
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.dataTableToPdfData = exports.schedaToPdfData = void 0;
5
+ const index_1 = require("../types/index");
6
+ const commons_utility_1 = require("../utils/commons-utility");
7
+ const matrix_converter_1 = require("./excel/matrix-converter");
8
+ const matrix_converter_2 = require("./pdf/matrix-converter");
9
+ const sch_converter_1 = require("./pdf/sch-converter");
10
+ const pdf_lib_1 = require("pdf-lib");
11
+ const cover_renderer_1 = require("./pdf/cover-renderer");
12
+ const gfx_data_1 = require("../assets/gfx-data");
13
+ const schedaToPdfData = async (sch, webupManagerData) => {
14
+ const doc = await (0, sch_converter_1.schedaToPdfDoc)(sch);
12
15
  return Buffer.from(doc.output("arraybuffer"));
13
16
  };
14
- export const dataTableToPdfData = async (component, webupManagerData) => {
15
- const workbook = dataTableToExcelWorkbook(component, SupportedExportFormats.XLSX, webupManagerData);
17
+ exports.schedaToPdfData = schedaToPdfData;
18
+ const dataTableToPdfData = async (component, webupManagerData) => {
19
+ const workbook = (0, matrix_converter_1.dataTableToExcelWorkbook)(component, index_1.SupportedExportFormats.XLSX, webupManagerData);
16
20
  const worksheet = workbook.getWorksheet(1);
17
21
  if (worksheet) {
18
22
  const title = component.smeupDataTable.cover?.titles?.["T01"] ?? "";
19
23
  const subtitle = component.smeupDataTable.cover?.titles?.["T02"] ?? "";
20
24
  const subtitle2 = component.smeupDataTable.cover?.titles?.["T03"] ?? "";
21
25
  const image = component.smeupDataTable.cover?.image ?? "";
22
- const logo = component.smeupDataTable.cover?.logo ?? logoBase64;
23
- const cover = createCoverPdf(image, logo, title, subtitle, subtitle2);
24
- const pdfDoc = await dataTableToPdfDoc(worksheet, webupManagerData, {
26
+ const logo = component.smeupDataTable.cover?.logo ?? gfx_data_1.logoBase64;
27
+ const cover = (0, cover_renderer_1.createCoverPdf)(image, logo, title, subtitle, subtitle2);
28
+ const pdfDoc = await (0, matrix_converter_2.dataTableToPdfDoc)(worksheet, webupManagerData, {
25
29
  logoBase64: logo,
26
30
  title: title,
27
31
  subtitle: subtitle,
28
32
  });
29
33
  const pdfBuffer = pdfDoc.output("arraybuffer");
30
- return convertToBuffer(await appendPdfDocs([cover, pdfBuffer]));
34
+ return (0, commons_utility_1.convertToBuffer)(await appendPdfDocs([cover, pdfBuffer]));
31
35
  }
32
36
  else {
33
37
  throw new Error("Worksheet not found in the workbook");
34
38
  }
35
39
  };
40
+ exports.dataTableToPdfData = dataTableToPdfData;
36
41
  /**
37
42
  * Unisce più PDF (in formato ArrayBuffer/Uint8Array/Buffer) in un unico PDF.
38
43
  * @param pdfBuffers Array di buffer PDF (es. ottenuti da jsPDF.output("arraybuffer"))
@@ -42,9 +47,9 @@ const appendPdfDocs = async (pdfBuffers) => {
42
47
  if (!pdfBuffers.length)
43
48
  throw new Error("No PDF buffers to append");
44
49
  // Crea un nuovo documento PDF vuoto
45
- const mergedPdf = await PDFDocument.create();
50
+ const mergedPdf = await pdf_lib_1.PDFDocument.create();
46
51
  for (const pdfBytes of pdfBuffers) {
47
- const srcPdf = await PDFDocument.load(pdfBytes);
52
+ const srcPdf = await pdf_lib_1.PDFDocument.load(pdfBytes);
48
53
  const copiedPages = await mergedPdf.copyPages(srcPdf, srcPdf.getPageIndices());
49
54
  copiedPages.forEach(page => mergedPdf.addPage(page));
50
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-converter.js","sourceRoot":"","sources":["../../src/converters/pdf-converter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAKtD,OAAO,EAGL,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,UAAU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AAE,IAAI;YAChB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,eAAe,CAAC,MAAM,aAAa,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,aAAa,GAAG,KAAK,EACzB,UAAiD,EAC5B,EAAE;IACvB,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAEpE,oCAAoC;IACpC,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC;IAE7C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,SAAS,CAC3C,MAAM,EACN,MAAM,CAAC,cAAc,EAAE,CACxB,CAAC;QACF,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { create } from \"domain\";\nimport { SmeupDataTable } from \"../types/data-structures/smeupDataTable.js\";\nimport { SmeupSch } from \"../types/data-structures/smeupSch.js\";\nimport {\n WebupManagerData,\n GenericObject,\n SupportedExportFormats,\n} from \"../types/index.js\";\nimport { convertToBuffer } from \"../utils/commons-utility.js\";\nimport { dataTableToExcelWorkbook } from \"./excel/matrix-converter.js\";\nimport { dataTableToPdfDoc } from \"./pdf/matrix-converter.js\";\nimport { schedaToPdfDoc } from \"./pdf/sch-converter.js\";\nimport { PDFDocument } from \"pdf-lib\";\nimport { createCoverPdf } from \"./pdf/cover-renderer.js\";\nimport { logoBase64 } from \"../assets/gfx-data.js\";\n\nexport const schedaToPdfData = async (\n sch: SmeupSch,\n webupManagerData: WebupManagerData,\n): Promise<Buffer> => {\n const doc = await schedaToPdfDoc(sch);\n return Buffer.from(doc.output(\"arraybuffer\"));\n};\n\nexport const dataTableToPdfData = async (\n component: {\n smeupDataTable: SmeupDataTable;\n props: GenericObject;\n },\n webupManagerData: WebupManagerData,\n): Promise<Buffer | Uint8Array> => {\n const workbook = dataTableToExcelWorkbook(\n component,\n SupportedExportFormats.XLSX,\n webupManagerData,\n );\n\n const worksheet = workbook.getWorksheet(1);\n if (worksheet) {\n const title = component.smeupDataTable.cover?.titles?.[\"T01\"] ?? \"\";\n const subtitle = component.smeupDataTable.cover?.titles?.[\"T02\"] ?? \"\";\n const subtitle2 = component.smeupDataTable.cover?.titles?.[\"T03\"] ?? \"\";\n const image = component.smeupDataTable.cover?.image ?? \"\";\n const logo = component.smeupDataTable.cover?.logo ?? logoBase64;\n const cover = createCoverPdf(image, logo, title, subtitle, subtitle2);\n const pdfDoc = await dataTableToPdfDoc(worksheet, webupManagerData, {\n logoBase64: logo,\n title: title,\n subtitle: subtitle,\n });\n const pdfBuffer = pdfDoc.output(\"arraybuffer\");\n return convertToBuffer(await appendPdfDocs([cover, pdfBuffer]));\n } else {\n throw new Error(\"Worksheet not found in the workbook\");\n }\n};\n\n/**\n * Unisce più PDF (in formato ArrayBuffer/Uint8Array/Buffer) in un unico PDF.\n * @param pdfBuffers Array di buffer PDF (es. ottenuti da jsPDF.output(\"arraybuffer\"))\n * @returns Buffer del PDF unito\n */\nconst appendPdfDocs = async (\n pdfBuffers: (Uint8Array | ArrayBuffer | Buffer)[],\n): Promise<Uint8Array> => {\n if (!pdfBuffers.length) throw new Error(\"No PDF buffers to append\");\n\n // Crea un nuovo documento PDF vuoto\n const mergedPdf = await PDFDocument.create();\n\n for (const pdfBytes of pdfBuffers) {\n const srcPdf = await PDFDocument.load(pdfBytes);\n const copiedPages = await mergedPdf.copyPages(\n srcPdf,\n srcPdf.getPageIndices(),\n );\n copiedPages.forEach(page => mergedPdf.addPage(page));\n }\n\n const mergedBytes = await mergedPdf.save();\n return mergedBytes;\n};\n"]}
1
+ {"version":3,"file":"pdf-converter.js","sourceRoot":"","sources":["../../src/converters/pdf-converter.ts"],"names":[],"mappings":";AAAA,sDAAsD;;;AAKtD,0CAIwB;AACxB,8DAA2D;AAC3D,+DAAoE;AACpE,6DAA2D;AAC3D,uDAAqD;AACrD,qCAAsC;AACtC,yDAAsD;AACtD,iDAAgD;AAEzC,MAAM,eAAe,GAAG,KAAK,EAClC,GAAa,EACb,gBAAkC,EACjB,EAAE;IACnB,MAAM,GAAG,GAAG,MAAM,IAAA,8BAAc,EAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC;AANW,QAAA,eAAe,mBAM1B;AAEK,MAAM,kBAAkB,GAAG,KAAK,EACrC,SAGC,EACD,gBAAkC,EACJ,EAAE;IAChC,MAAM,QAAQ,GAAG,IAAA,2CAAwB,EACvC,SAAS,EACT,8BAAsB,CAAC,IAAI,EAC3B,gBAAgB,CACjB,CAAC;IAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpE,MAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,CA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AM,qBAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,SAAS,CAC3C,MAAM,EACN,MAAM,CAAC,cAAc,EAAE,CACxB,CAAC;QACF,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\nimport { create } from \"domain\";\nimport { SmeupDataTable } from \"../types/data-structures/smeupDataTable\";\nimport { SmeupSch } from \"../types/data-structures/smeupSch\";\nimport {\n WebupManagerData,\n GenericObject,\n SupportedExportFormats,\n} from \"../types/index\";\nimport { convertToBuffer } from \"../utils/commons-utility\";\nimport { dataTableToExcelWorkbook } from \"./excel/matrix-converter\";\nimport { dataTableToPdfDoc } from \"./pdf/matrix-converter\";\nimport { schedaToPdfDoc } from \"./pdf/sch-converter\";\nimport { PDFDocument } from \"pdf-lib\";\nimport { createCoverPdf } from \"./pdf/cover-renderer\";\nimport { logoBase64 } from \"../assets/gfx-data\";\n\nexport const schedaToPdfData = async (\n sch: SmeupSch,\n webupManagerData: WebupManagerData,\n): Promise<Buffer> => {\n const doc = await schedaToPdfDoc(sch);\n return Buffer.from(doc.output(\"arraybuffer\"));\n};\n\nexport const dataTableToPdfData = async (\n component: {\n smeupDataTable: SmeupDataTable;\n props: GenericObject;\n },\n webupManagerData: WebupManagerData,\n): Promise<Buffer | Uint8Array> => {\n const workbook = dataTableToExcelWorkbook(\n component,\n SupportedExportFormats.XLSX,\n webupManagerData,\n );\n\n const worksheet = workbook.getWorksheet(1);\n if (worksheet) {\n const title = component.smeupDataTable.cover?.titles?.[\"T01\"] ?? \"\";\n const subtitle = component.smeupDataTable.cover?.titles?.[\"T02\"] ?? \"\";\n const subtitle2 = component.smeupDataTable.cover?.titles?.[\"T03\"] ?? \"\";\n const image = component.smeupDataTable.cover?.image ?? \"\";\n const logo = component.smeupDataTable.cover?.logo ?? logoBase64;\n const cover = createCoverPdf(image, logo, title, subtitle, subtitle2);\n const pdfDoc = await dataTableToPdfDoc(worksheet, webupManagerData, {\n logoBase64: logo,\n title: title,\n subtitle: subtitle,\n });\n const pdfBuffer = pdfDoc.output(\"arraybuffer\");\n return convertToBuffer(await appendPdfDocs([cover, pdfBuffer]));\n } else {\n throw new Error(\"Worksheet not found in the workbook\");\n }\n};\n\n/**\n * Unisce più PDF (in formato ArrayBuffer/Uint8Array/Buffer) in un unico PDF.\n * @param pdfBuffers Array di buffer PDF (es. ottenuti da jsPDF.output(\"arraybuffer\"))\n * @returns Buffer del PDF unito\n */\nconst appendPdfDocs = async (\n pdfBuffers: (Uint8Array | ArrayBuffer | Buffer)[],\n): Promise<Uint8Array> => {\n if (!pdfBuffers.length) throw new Error(\"No PDF buffers to append\");\n\n // Crea un nuovo documento PDF vuoto\n const mergedPdf = await PDFDocument.create();\n\n for (const pdfBytes of pdfBuffers) {\n const srcPdf = await PDFDocument.load(pdfBytes);\n const copiedPages = await mergedPdf.copyPages(\n srcPdf,\n srcPdf.getPageIndices(),\n );\n copiedPages.forEach(page => mergedPdf.addPage(page));\n }\n\n const mergedBytes = await mergedPdf.save();\n return mergedBytes;\n};\n\n"]}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { dataTableToExcelData, dataTreeToExcelData, } from "./converters/excel-converter.js";
2
- export { schedaToPdfData, dataTableToPdfData, } from "./converters/pdf-converter.js";
3
- export { dataTableToChart } from "./converters/images/charts-generator.js";
4
- export type { WebupManagerData, GenericObject } from "./types/index.js";
5
- export { SupportedExportFormats } from "./types/index.js";
6
- export type { SmeupDataTable } from "./types/data-structures/smeupDataTable.js";
7
- export type { SmeupDataTree } from "./types/data-structures/smeupDataTree.js";
1
+ export { dataTableToExcelData, dataTreeToExcelData, } from "./converters/excel-converter";
2
+ export { schedaToPdfData, dataTableToPdfData, } from "./converters/pdf-converter";
3
+ export { dataTableToChart } from "./converters/images/charts-generator";
4
+ export type { WebupManagerData, GenericObject } from "./types/index";
5
+ export { SupportedExportFormats } from "./types/index";
6
+ export type { SmeupDataTable } from "./types/data-structures/smeupDataTable";
7
+ export type { SmeupDataTree } from "./types/data-structures/smeupDataTree";
8
8
  export type ColumnGroup = {
9
9
  column: string;
10
10
  visible: boolean;
package/dist/index.js CHANGED
@@ -1,6 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SupportedExportFormats = exports.dataTableToChart = exports.dataTableToPdfData = exports.schedaToPdfData = exports.dataTreeToExcelData = exports.dataTableToExcelData = void 0;
1
4
  // Public API exports
2
- export { dataTableToExcelData, dataTreeToExcelData, } from "./converters/excel-converter.js";
3
- export { schedaToPdfData, dataTableToPdfData, } from "./converters/pdf-converter.js";
4
- export { dataTableToChart } from "./converters/images/charts-generator.js";
5
- export { SupportedExportFormats } from "./types/index.js";
5
+ var excel_converter_1 = require("./converters/excel-converter");
6
+ Object.defineProperty(exports, "dataTableToExcelData", { enumerable: true, get: function () { return excel_converter_1.dataTableToExcelData; } });
7
+ Object.defineProperty(exports, "dataTreeToExcelData", { enumerable: true, get: function () { return excel_converter_1.dataTreeToExcelData; } });
8
+ var pdf_converter_1 = require("./converters/pdf-converter");
9
+ Object.defineProperty(exports, "schedaToPdfData", { enumerable: true, get: function () { return pdf_converter_1.schedaToPdfData; } });
10
+ Object.defineProperty(exports, "dataTableToPdfData", { enumerable: true, get: function () { return pdf_converter_1.dataTableToPdfData; } });
11
+ var charts_generator_1 = require("./converters/images/charts-generator");
12
+ Object.defineProperty(exports, "dataTableToChart", { enumerable: true, get: function () { return charts_generator_1.dataTableToChart; } });
13
+ var index_1 = require("./types/index");
14
+ Object.defineProperty(exports, "SupportedExportFormats", { enumerable: true, get: function () { return index_1.SupportedExportFormats; } });
6
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,eAAe,EACf,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Public API exports\nexport {\n dataTableToExcelData,\n dataTreeToExcelData,\n} from \"./converters/excel-converter.js\";\n\nexport {\n schedaToPdfData,\n dataTableToPdfData,\n} from \"./converters/pdf-converter.js\";\n\nexport { dataTableToChart } from \"./converters/images/charts-generator.js\";\n// Export types that users might need\nexport type { WebupManagerData, GenericObject } from \"./types/index.js\";\nexport { SupportedExportFormats } from \"./types/index.js\";\nexport type { SmeupDataTable } from \"./types/data-structures/smeupDataTable.js\";\nexport type { SmeupDataTree } from \"./types/data-structures/smeupDataTree.js\";\n\nexport type ColumnGroup = {\n column: string;\n visible: boolean;\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qBAAqB;AACrB,gEAGsC;AAFpC,uHAAA,oBAAoB,OAAA;AACpB,sHAAA,mBAAmB,OAAA;AAGrB,4DAGoC;AAFlC,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAGpB,yEAAwE;AAA/D,oHAAA,gBAAgB,OAAA;AAGzB,uCAAuD;AAA9C,+GAAA,sBAAsB,OAAA","sourcesContent":["// Public API exports\nexport {\n dataTableToExcelData,\n dataTreeToExcelData,\n} from \"./converters/excel-converter\";\n\nexport {\n schedaToPdfData,\n dataTableToPdfData,\n} from \"./converters/pdf-converter\";\n\nexport { dataTableToChart } from \"./converters/images/charts-generator\";\n// Export types that users might need\nexport type { WebupManagerData, GenericObject } from \"./types/index\";\nexport { SupportedExportFormats } from \"./types/index\";\nexport type { SmeupDataTable } from \"./types/data-structures/smeupDataTable\";\nexport type { SmeupDataTree } from \"./types/data-structures/smeupDataTree\";\n\nexport type ColumnGroup = {\n column: string;\n visible: boolean;\n};\n"]}
@@ -1,7 +1,10 @@
1
+ "use strict";
1
2
  // Definitions of some utility types that comes from component library (currently Ketchup) to help understand code's logic.
2
- export var SortMode;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SortMode = void 0;
5
+ var SortMode;
3
6
  (function (SortMode) {
4
7
  SortMode["A"] = "A";
5
8
  SortMode["D"] = "D";
6
- })(SortMode || (SortMode = {}));
9
+ })(SortMode || (exports.SortMode = SortMode = {}));
7
10
  //# sourceMappingURL=component-props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-props.js","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAU3H,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mBAAO,CAAA;IACP,mBAAO,CAAA;AACT,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB","sourcesContent":["// Definitions of some utility types that comes from component library (currently Ketchup) to help understand code's logic.\n\n// ** data table\n\n// @Props() sort\nexport interface SortObject {\n column: string;\n sortMode: SortMode;\n}\n\nexport enum SortMode {\n A = \"A\",\n D = \"D\",\n}\n"]}
1
+ {"version":3,"file":"component-props.js","sourceRoot":"","sources":["../../src/types/component-props.ts"],"names":[],"mappings":";AAAA,2HAA2H;;;AAU3H,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mBAAO,CAAA;IACP,mBAAO,CAAA;AACT,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB","sourcesContent":["// Definitions of some utility types that comes from component library (currently Ketchup) to help understand code's logic.\n\n// ** data table\n\n// @Props() sort\nexport interface SortObject {\n column: string;\n sortMode: SortMode;\n}\n\nexport enum SortMode {\n A = \"A\",\n D = \"D\",\n}\n\n"]}
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolbarState = exports.Shapes = void 0;
1
4
  /**
2
5
  * Supported shapes.
3
6
  */
4
- export var Shapes;
7
+ var Shapes;
5
8
  (function (Shapes) {
6
9
  Shapes["ACC"] = "ACC";
7
10
  Shapes["ACT"] = "ACT";
@@ -40,14 +43,14 @@ export var Shapes;
40
43
  Shapes["CND"] = "CND";
41
44
  Shapes["UNK"] = "UNK";
42
45
  Shapes["OGN"] = "OGN";
43
- })(Shapes || (Shapes = {}));
46
+ })(Shapes || (exports.Shapes = Shapes = {}));
44
47
  /**
45
48
  * ToolbarState Info.
46
49
  */
47
- export var ToolbarState;
50
+ var ToolbarState;
48
51
  (function (ToolbarState) {
49
52
  ToolbarState["EXPANDED"] = "Expanded";
50
53
  ToolbarState["COLLAPSED"] = "Collapsed";
51
54
  ToolbarState["INVISIBLE"] = "Invisible";
52
- })(ToolbarState || (ToolbarState = {}));
55
+ })(ToolbarState || (exports.ToolbarState = ToolbarState = {}));
53
56
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,MAsCX;AAtCD,WAAY,MAAM;IAChB,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;AACb,CAAC,EAtCW,MAAM,KAAN,MAAM,QAsCjB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB","sourcesContent":["/**\n * Supported shapes.\n */\nexport enum Shapes {\n ACC = \"ACC\",\n ACT = \"ACT\",\n ATM = \"ATM\",\n BOX = \"BOX\",\n BTN = \"BTN\",\n CAL = \"CAL\",\n CHA = \"CHA\", // = EXA\n DFT = \"DFT\",\n DYN = \"DYN\",\n DSH = \"DSH\",\n EML = \"EML\",\n EXA = \"EXA\", // = CHA\n EXB = \"EXB\", // = MAT\n EXD = \"EXD\", // = SCH\n EXU = \"EXU\",\n FBK = \"FBK\",\n FLD = \"FLD\",\n FOR = \"FOR\",\n GNT = \"GNT\",\n HTM = \"HTM\",\n IML = \"IML\",\n IMG = \"IMG\",\n INT = \"INT\",\n INP = \"INP\",\n JSO = \"JSO\",\n LAB = \"LAB\",\n MAT = \"MAT\", // = EXB\n PLN = \"PLN\",\n PDF = \"PDF\",\n SCH = \"SCH\", // = EXD\n SPL = \"SPL\",\n TED = \"TED\",\n TRE = \"TRE\",\n TXT = \"TXT\",\n CND = \"CND\",\n UNK = \"UNK\",\n OGN = \"OGN\",\n}\n\n/**\n * ToolbarState Info.\n */\nexport enum ToolbarState {\n EXPANDED = \"Expanded\",\n COLLAPSED = \"Collapsed\",\n INVISIBLE = \"Invisible\",\n}\n\nexport interface ComponentOptions extends Record<string, string> {\n Name: string;\n}\n"]}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,MAsCX;AAtCD,WAAY,MAAM;IAChB,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;IACX,qBAAW,CAAA;AACb,CAAC,EAtCW,MAAM,sBAAN,MAAM,QAsCjB;AAED;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB","sourcesContent":["/**\n * Supported shapes.\n */\nexport enum Shapes {\n ACC = \"ACC\",\n ACT = \"ACT\",\n ATM = \"ATM\",\n BOX = \"BOX\",\n BTN = \"BTN\",\n CAL = \"CAL\",\n CHA = \"CHA\", // = EXA\n DFT = \"DFT\",\n DYN = \"DYN\",\n DSH = \"DSH\",\n EML = \"EML\",\n EXA = \"EXA\", // = CHA\n EXB = \"EXB\", // = MAT\n EXD = \"EXD\", // = SCH\n EXU = \"EXU\",\n FBK = \"FBK\",\n FLD = \"FLD\",\n FOR = \"FOR\",\n GNT = \"GNT\",\n HTM = \"HTM\",\n IML = \"IML\",\n IMG = \"IMG\",\n INT = \"INT\",\n INP = \"INP\",\n JSO = \"JSO\",\n LAB = \"LAB\",\n MAT = \"MAT\", // = EXB\n PLN = \"PLN\",\n PDF = \"PDF\",\n SCH = \"SCH\", // = EXD\n SPL = \"SPL\",\n TED = \"TED\",\n TRE = \"TRE\",\n TXT = \"TXT\",\n CND = \"CND\",\n UNK = \"UNK\",\n OGN = \"OGN\",\n}\n\n/**\n * ToolbarState Info.\n */\nexport enum ToolbarState {\n EXPANDED = \"Expanded\",\n COLLAPSED = \"Collapsed\",\n INVISIBLE = \"Invisible\",\n}\n\nexport interface ComponentOptions extends Record<string, string> {\n Name: string;\n}\n\n"]}
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=converter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../../src/types/converter.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Provides context to the converters chains by exposing common info that can be reused in many different occasions and multiple times.\n */\nexport interface ConverterContext {\n title?: string;\n subtitle?: string;\n logoBase64?: string;\n}\n"]}
1
+ {"version":3,"file":"converter.js","sourceRoot":"","sources":["../../src/types/converter.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Provides context to the converters chains by exposing common info that can be reused in many different occasions and multiple times.\n */\nexport interface ConverterContext {\n title?: string;\n subtitle?: string;\n logoBase64?: string;\n}\n\n"]}
@@ -1,7 +1,7 @@
1
- import { ComponentOptions, Shapes } from "../component.js";
2
- import { Fun } from "../general.js";
3
- import { SmeupDataCell } from "./smeupDataTable.js";
4
- import { SmeupDataNode } from "./smeupDataTree.js";
1
+ import { ComponentOptions, Shapes } from "../component";
2
+ import { Fun } from "../general";
3
+ import { SmeupDataCell } from "./smeupDataTable";
4
+ import { SmeupDataNode } from "./smeupDataTree";
5
5
  /**
6
6
  * Smeup data structure
7
7
  */
@@ -1,14 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SmeupLayoutSectionType = exports.SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS = exports.SMEUP_ACTION_TYPE = exports.SMEUP_VARIABLE_TYPE = exports.SMEUP_MESSAGE_MODE = exports.SMEUP_MESSAGE_GRAVITY = exports.SmeupDataStructureType = exports.ApiVersion = void 0;
4
+ exports.getSmeupDataStructureType = getSmeupDataStructureType;
1
5
  /**
2
6
  * Api version
3
7
  */
4
- export var ApiVersion;
8
+ var ApiVersion;
5
9
  (function (ApiVersion) {
6
10
  ApiVersion[ApiVersion["V2"] = 0] = "V2";
7
- })(ApiVersion || (ApiVersion = {}));
11
+ })(ApiVersion || (exports.ApiVersion = ApiVersion = {}));
8
12
  /**
9
13
  * SmeupDataStructure types
10
14
  */
11
- export var SmeupDataStructureType;
15
+ var SmeupDataStructureType;
12
16
  (function (SmeupDataStructureType) {
13
17
  /** Smeup feedback (FBK) */
14
18
  SmeupDataStructureType["SmeupFeedback"] = "SmeupFeedback";
@@ -18,8 +22,8 @@ export var SmeupDataStructureType;
18
22
  SmeupDataStructureType["SmeupDataTree"] = "SmeupDataTree";
19
23
  /** SmeupSch */
20
24
  SmeupDataStructureType["SmeupScheda"] = "SmeupSch";
21
- })(SmeupDataStructureType || (SmeupDataStructureType = {}));
22
- export function getSmeupDataStructureType(fun, version) {
25
+ })(SmeupDataStructureType || (exports.SmeupDataStructureType = SmeupDataStructureType = {}));
26
+ function getSmeupDataStructureType(fun, version) {
23
27
  switch (fun.component) {
24
28
  case "TRE":
25
29
  case "HTM":
@@ -42,7 +46,7 @@ export function getSmeupDataStructureType(fun, version) {
42
46
  /**
43
47
  * SmeupMessage Gravity
44
48
  */
45
- export const SMEUP_MESSAGE_GRAVITY = {
49
+ exports.SMEUP_MESSAGE_GRAVITY = {
46
50
  INFO: "INFO",
47
51
  ERROR: "ERROR",
48
52
  WARNING: "WARNING",
@@ -51,7 +55,7 @@ export const SMEUP_MESSAGE_GRAVITY = {
51
55
  /**
52
56
  * SmeupMessage Mode
53
57
  */
54
- export const SMEUP_MESSAGE_MODE = {
58
+ exports.SMEUP_MESSAGE_MODE = {
55
59
  PM: "PM",
56
60
  PN: "PN",
57
61
  TN: "TN",
@@ -59,7 +63,7 @@ export const SMEUP_MESSAGE_MODE = {
59
63
  /**
60
64
  * SmeupVariableType
61
65
  */
62
- export const SMEUP_VARIABLE_TYPE = {
66
+ exports.SMEUP_VARIABLE_TYPE = {
63
67
  SEC: "sec",
64
68
  SCH: "sch",
65
69
  SSC: "ssc",
@@ -68,7 +72,7 @@ export const SMEUP_VARIABLE_TYPE = {
68
72
  /**
69
73
  * SmeupActionType
70
74
  */
71
- export const SMEUP_ACTION_TYPE = {
75
+ exports.SMEUP_ACTION_TYPE = {
72
76
  CLOSE: "CLOSE",
73
77
  CLOSEW: "CLOSEW",
74
78
  DYNAMIC: "DYNAMIC",
@@ -86,14 +90,14 @@ export const SMEUP_ACTION_TYPE = {
86
90
  /**
87
91
  * Smeup Data Cell Input Settings Keys
88
92
  */
89
- export const SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS = {
93
+ exports.SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS = {
90
94
  MANDATORY: { key: "mandatory", type: "boolean" },
91
95
  CHECK_VALUE_ON_EXIT: { key: "checkValueOnExit", type: "boolean" },
92
96
  CHECK_OBJECT: { key: "checkObject", type: "boolean" },
93
97
  FORCE_UPPERCASE: { key: "forceUppercase", type: "boolean" },
94
98
  };
95
- export var SmeupLayoutSectionType;
99
+ var SmeupLayoutSectionType;
96
100
  (function (SmeupLayoutSectionType) {
97
101
  SmeupLayoutSectionType["TAB"] = "tab";
98
- })(SmeupLayoutSectionType || (SmeupLayoutSectionType = {}));
102
+ })(SmeupLayoutSectionType || (exports.SmeupLayoutSectionType = SmeupLayoutSectionType = {}));
99
103
  //# sourceMappingURL=smeupDataStructure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smeupDataStructure.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataStructure.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,uCAAE,CAAA;AACJ,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBASX;AATD,WAAY,sBAAsB;IAChC,2BAA2B;IAC3B,yDAA+B,CAAA;IAC/B,2BAA2B;IAC3B,2DAAiC,CAAA;IACjC,0BAA0B;IAC1B,yDAA+B,CAAA;IAC/B,eAAe;IACf,kDAAwB,CAAA;AAC1B,CAAC,EATW,sBAAsB,KAAtB,sBAAsB,QASjC;AAED,MAAM,UAAU,yBAAyB,CACvC,GAAQ,EACR,OAAmB;IAEnB,QAAQ,GAAG,CAAC,SAAS,EAAE,CAAC;QACtB,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,aAAa,CAAC;QAE9C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,cAAc,CAAC;QAE/C,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,aAAa,CAAC;QAE9C,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,WAAW,CAAC;QAE5C;YACE,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,SAAS,oDAAoD,CACrE,CAAC;IACN,CAAC;A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AAY,sBAAsB;IAChC,qCAAW,CAAA;AACb,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { ComponentOptions, Shapes } from \"../component.js\";\nimport { Fun } from \"../general.js\";\nimport { SmeupDataCell } from \"./smeupDataTable.js\";\nimport { SmeupDataNode } from \"./smeupDataTree.js\";\n\n/**\n * Smeup data structure\n */\nexport interface SmeupDataStructure {\n type: SmeupDataStructureType;\n messages?: SmeupMessage[];\n variables?: SmeupVariable[];\n buttons?: SmeupDataNode[];\n actions?: SmeupAction[];\n setup?: SmeupSetup;\n debugInfo?: DebugInfo;\n}\n\n/**\n * Api version\n */\nexport enum ApiVersion {\n V2,\n}\n\n/**\n * SmeupDataStructure types\n */\nexport enum SmeupDataStructureType {\n /** Smeup feedback (FBK) */\n SmeupFeedback = \"SmeupFeedback\",\n /** SmeupDataTable (DTA) */\n SmeupDataTable = \"SmeupDataTable\",\n /** SmeupDataTree (DTR) */\n SmeupDataTree = \"SmeupDataTree\",\n /** SmeupSch */\n SmeupScheda = \"SmeupSch\",\n}\n\nexport function getSmeupDataStructureType(\n fun: Fun,\n version: ApiVersion,\n): SmeupDataStructureType {\n switch (fun.component) {\n case \"TRE\":\n case \"HTM\":\n case \"CDE\":\n case \"EDT\":\n return SmeupDataStructureType.SmeupDataTree;\n\n case \"EXU\":\n case \"INP\":\n case \"EXB\":\n case \"EXC\":\n return SmeupDataStructureType.SmeupDataTable;\n\n case \"FBK\":\n return SmeupDataStructureType.SmeupFeedback;\n\n case \"SCH\":\n return SmeupDataStructureType.SmeupScheda;\n\n default:\n throw new Error(\n `${fun.component} not correspond to a valid SmeupDataStructure type`,\n );\n }\n}\n\n/**\n * Smeup data structure\n */\nexport interface SmeupFeedback extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupFeedback;\n}\n\n/**\n * SmeupMessage type\n */\nexport interface SmeupMessage {\n gravity: SmeupMessageGravity;\n message: string;\n mode: string;\n}\n\n/**\n * SmeupMessage Gravity\n */\nexport const SMEUP_MESSAGE_GRAVITY = {\n INFO: \"INFO\",\n ERROR: \"ERROR\",\n WARNING: \"WARNING\",\n UNAUTHORIZED: \"UNAUTHORIZED\",\n} as const;\nexport type SmeupMessageGravity =\n (typeof SMEUP_MESSAGE_GRAVITY)[keyof typeof SMEUP_MESSAGE_GRAVITY];\n\n/**\n * SmeupMessage Mode\n */\nexport const SMEUP_MESSAGE_MODE = {\n PM: \"PM\",\n PN: \"PN\",\n TN: \"TN\",\n} as const;\ntype SmeupMessageMode =\n (typeof SMEUP_MESSAGE_MODE)[keyof typeof SMEUP_MESSAGE_MODE];\n\n/**\n * SmeupVariable\n */\nexport interface SmeupVariable {\n name: string;\n value: string;\n type?: SmeupVariableType;\n}\n\n/**\n * SmeupVariableType\n */\nexport const SMEUP_VARIABLE_TYPE = {\n SEC: \"sec\",\n SCH: \"sch\",\n SSC: \"ssc\",\n LOO: \"loo\",\n} as const;\nexport type SmeupVariableType =\n (typeof SMEUP_VARIABLE_TYPE)[keyof typeof SMEUP_VARIABLE_TYPE];\n\n/**\n * SmeupAction\n */\nexport interface SmeupAction {\n exec?: string;\n parameter?: string;\n type?: SmeupActionType;\n}\n\n/**\n * SmeupActionType\n */\n\nexport const SMEUP_ACTION_TYPE = {\n CLOSE: \"CLOSE\",\n CLOSEW: \"CLOSEW\",\n DYNAMIC: \"DYNAMIC\",\n DINAMIC: \"DINAMIC\",\n EXECUTE: \"EXECUTE\",\n LOAD: \"LOAD\",\n RELOAD: \"RELOAD\",\n UPDATE: \"UPDATE\",\n EXIT: \"EXIT\",\n REFRESH: \"REFRESH\",\n HARDREFRESH: \"HARDREFRESH\",\n POPUP: \"POPUP\",\n RETURNVALUE: \"RETURNVALUE\",\n} as const;\ntype SmeupActionType =\n (typeof SMEUP_ACTION_TYPE)[keyof typeof SMEUP_ACTION_TYPE];\n\n/**\n * Smeup Data Cell Input Settings Keys\n */\nexport const SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS = {\n MANDATORY: { key: \"mandatory\", type: \"boolean\" },\n CHECK_VALUE_ON_EXIT: { key: \"checkValueOnExit\", type: \"boolean\" },\n CHECK_OBJECT: { key: \"checkObject\", type: \"boolean\" },\n FORCE_UPPERCASE: { key: \"forceUppercase\", type: \"boolean\" },\n} as const;\n\nexport type SmeupDataCellInputSettingsKeys =\n keyof typeof SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS;\n\nexport type SmeupDataCellInputSettingsValue =\n (typeof SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS)[SmeupDataCellInputSettingsKeys];\n\nexport interface DebugInfo {\n executionTime_ms: number;\n initialTimestamp: string;\n finalTimestamp: string;\n runtime: {\n [index: string]: string;\n };\n}\n\n/**\n * LAYOUT\n * Represent the layout of the fields in a form and the adjuntive informations\n */\nexport interface SmeupLayout {\n horizontal?: boolean;\n absolute?: boolean;\n sections?: SmeupLayoutSection[];\n sectionsType?: SmeupLayoutSectionType;\n}\n\n/**\n * Represent a layout section\n */\nexport interface SmeupLayoutSection {\n id?: string;\n content?: SmeupLayoutField[];\n sections?: SmeupLayoutSection[];\n dim?: string;\n collapsible?: boolean;\n horizontal?: boolean;\n icon?: string;\n sectionsType?: SmeupLayoutSectionType;\n // style name declared in SCP_SCH\n styleName?: string;\n // grid attributes (each section is a grid)\n gridCols?: number;\n gridRows?: number;\n gap?: number;\n title?: string;\n absoluteColumn?: number;\n absoluteWidth?: number;\n absoluteRow?: number;\n absoluteHeight?: number;\n columns?: string;\n}\n\nexport enum SmeupLayoutSectionType {\n TAB = \"tab\",\n}\n\n/**\n * Represent the presentation information of a field in a form\n */\nexport interface SmeupLayoutField extends SmeupDataCell {\n id: string;\n title?: string;\n visible?: boolean;\n // grid attributes\n colSpan?: number;\n colStart?: number;\n colEnd?: number;\n rowSpan?: number;\n rowStart?: number;\n rowEnd?: number;\n absoluteColumn?: number;\n absoluteRow?: number;\n absoluteLength?: number;\n absoluteHeight?: number;\n useAs?: string;\n}\n\nexport type SmeupSetupBase<T extends ComponentOptions = ComponentOptions> = {\n [key in Shapes]?: T[];\n};\n\nexport interface SmeupSetup<T extends ComponentOptions = ComponentOptions> {\n title?: string;\n options?: SmeupSetupBase<T>;\n userSetups?: boolean;\n context?: string;\n commands?: Array<SmeupDataNode>;\n operations?: {\n insert?: boolean;\n delete?: boolean;\n update?: boolean;\n };\n}\n"]}
1
+ {"version":3,"file":"smeupDataStructure.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataStructure.ts"],"names":[],"mappings":";;;AAwCA,8DA4BC;AAjDD;;GAEG;AACH,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,uCAAE,CAAA;AACJ,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB;AAED;;GAEG;AACH,IAAY,sBASX;AATD,WAAY,sBAAsB;IAChC,2BAA2B;IAC3B,yDAA+B,CAAA;IAC/B,2BAA2B;IAC3B,2DAAiC,CAAA;IACjC,0BAA0B;IAC1B,yDAA+B,CAAA;IAC/B,eAAe;IACf,kDAAwB,CAAA;AAC1B,CAAC,EATW,sBAAsB,sCAAtB,sBAAsB,QASjC;AAED,SAAgB,yBAAyB,CACvC,GAAQ,EACR,OAAmB;IAEnB,QAAQ,GAAG,CAAC,SAAS,EAAE,CAAC;QACtB,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,aAAa,CAAC;QAE9C,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,cAAc,CAAC;QAE/C,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,aAAa,CAAC;QAE9C,KAAK,KAAK;YACR,OAAO,sBAAsB,CAAC,WAAW,CAAC;QAE5C;YACE,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,CAAC,SAAS,oDAAoD,CACr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AAsB,sCAAtB,sBAAsB,QAEjC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { ComponentOptions, Shapes } from \"../component\";\nimport { Fun } from \"../general\";\nimport { SmeupDataCell } from \"./smeupDataTable\";\nimport { SmeupDataNode } from \"./smeupDataTree\";\n\n/**\n * Smeup data structure\n */\nexport interface SmeupDataStructure {\n type: SmeupDataStructureType;\n messages?: SmeupMessage[];\n variables?: SmeupVariable[];\n buttons?: SmeupDataNode[];\n actions?: SmeupAction[];\n setup?: SmeupSetup;\n debugInfo?: DebugInfo;\n}\n\n/**\n * Api version\n */\nexport enum ApiVersion {\n V2,\n}\n\n/**\n * SmeupDataStructure types\n */\nexport enum SmeupDataStructureType {\n /** Smeup feedback (FBK) */\n SmeupFeedback = \"SmeupFeedback\",\n /** SmeupDataTable (DTA) */\n SmeupDataTable = \"SmeupDataTable\",\n /** SmeupDataTree (DTR) */\n SmeupDataTree = \"SmeupDataTree\",\n /** SmeupSch */\n SmeupScheda = \"SmeupSch\",\n}\n\nexport function getSmeupDataStructureType(\n fun: Fun,\n version: ApiVersion,\n): SmeupDataStructureType {\n switch (fun.component) {\n case \"TRE\":\n case \"HTM\":\n case \"CDE\":\n case \"EDT\":\n return SmeupDataStructureType.SmeupDataTree;\n\n case \"EXU\":\n case \"INP\":\n case \"EXB\":\n case \"EXC\":\n return SmeupDataStructureType.SmeupDataTable;\n\n case \"FBK\":\n return SmeupDataStructureType.SmeupFeedback;\n\n case \"SCH\":\n return SmeupDataStructureType.SmeupScheda;\n\n default:\n throw new Error(\n `${fun.component} not correspond to a valid SmeupDataStructure type`,\n );\n }\n}\n\n/**\n * Smeup data structure\n */\nexport interface SmeupFeedback extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupFeedback;\n}\n\n/**\n * SmeupMessage type\n */\nexport interface SmeupMessage {\n gravity: SmeupMessageGravity;\n message: string;\n mode: string;\n}\n\n/**\n * SmeupMessage Gravity\n */\nexport const SMEUP_MESSAGE_GRAVITY = {\n INFO: \"INFO\",\n ERROR: \"ERROR\",\n WARNING: \"WARNING\",\n UNAUTHORIZED: \"UNAUTHORIZED\",\n} as const;\nexport type SmeupMessageGravity =\n (typeof SMEUP_MESSAGE_GRAVITY)[keyof typeof SMEUP_MESSAGE_GRAVITY];\n\n/**\n * SmeupMessage Mode\n */\nexport const SMEUP_MESSAGE_MODE = {\n PM: \"PM\",\n PN: \"PN\",\n TN: \"TN\",\n} as const;\ntype SmeupMessageMode =\n (typeof SMEUP_MESSAGE_MODE)[keyof typeof SMEUP_MESSAGE_MODE];\n\n/**\n * SmeupVariable\n */\nexport interface SmeupVariable {\n name: string;\n value: string;\n type?: SmeupVariableType;\n}\n\n/**\n * SmeupVariableType\n */\nexport const SMEUP_VARIABLE_TYPE = {\n SEC: \"sec\",\n SCH: \"sch\",\n SSC: \"ssc\",\n LOO: \"loo\",\n} as const;\nexport type SmeupVariableType =\n (typeof SMEUP_VARIABLE_TYPE)[keyof typeof SMEUP_VARIABLE_TYPE];\n\n/**\n * SmeupAction\n */\nexport interface SmeupAction {\n exec?: string;\n parameter?: string;\n type?: SmeupActionType;\n}\n\n/**\n * SmeupActionType\n */\n\nexport const SMEUP_ACTION_TYPE = {\n CLOSE: \"CLOSE\",\n CLOSEW: \"CLOSEW\",\n DYNAMIC: \"DYNAMIC\",\n DINAMIC: \"DINAMIC\",\n EXECUTE: \"EXECUTE\",\n LOAD: \"LOAD\",\n RELOAD: \"RELOAD\",\n UPDATE: \"UPDATE\",\n EXIT: \"EXIT\",\n REFRESH: \"REFRESH\",\n HARDREFRESH: \"HARDREFRESH\",\n POPUP: \"POPUP\",\n RETURNVALUE: \"RETURNVALUE\",\n} as const;\ntype SmeupActionType =\n (typeof SMEUP_ACTION_TYPE)[keyof typeof SMEUP_ACTION_TYPE];\n\n/**\n * Smeup Data Cell Input Settings Keys\n */\nexport const SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS = {\n MANDATORY: { key: \"mandatory\", type: \"boolean\" },\n CHECK_VALUE_ON_EXIT: { key: \"checkValueOnExit\", type: \"boolean\" },\n CHECK_OBJECT: { key: \"checkObject\", type: \"boolean\" },\n FORCE_UPPERCASE: { key: \"forceUppercase\", type: \"boolean\" },\n} as const;\n\nexport type SmeupDataCellInputSettingsKeys =\n keyof typeof SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS;\n\nexport type SmeupDataCellInputSettingsValue =\n (typeof SMEUP_DATA_CELL_INPUT_SETTINGS_KEYS)[SmeupDataCellInputSettingsKeys];\n\nexport interface DebugInfo {\n executionTime_ms: number;\n initialTimestamp: string;\n finalTimestamp: string;\n runtime: {\n [index: string]: string;\n };\n}\n\n/**\n * LAYOUT\n * Represent the layout of the fields in a form and the adjuntive informations\n */\nexport interface SmeupLayout {\n horizontal?: boolean;\n absolute?: boolean;\n sections?: SmeupLayoutSection[];\n sectionsType?: SmeupLayoutSectionType;\n}\n\n/**\n * Represent a layout section\n */\nexport interface SmeupLayoutSection {\n id?: string;\n content?: SmeupLayoutField[];\n sections?: SmeupLayoutSection[];\n dim?: string;\n collapsible?: boolean;\n horizontal?: boolean;\n icon?: string;\n sectionsType?: SmeupLayoutSectionType;\n // style name declared in SCP_SCH\n styleName?: string;\n // grid attributes (each section is a grid)\n gridCols?: number;\n gridRows?: number;\n gap?: number;\n title?: string;\n absoluteColumn?: number;\n absoluteWidth?: number;\n absoluteRow?: number;\n absoluteHeight?: number;\n columns?: string;\n}\n\nexport enum SmeupLayoutSectionType {\n TAB = \"tab\",\n}\n\n/**\n * Represent the presentation information of a field in a form\n */\nexport interface SmeupLayoutField extends SmeupDataCell {\n id: string;\n title?: string;\n visible?: boolean;\n // grid attributes\n colSpan?: number;\n colStart?: number;\n colEnd?: number;\n rowSpan?: number;\n rowStart?: number;\n rowEnd?: number;\n absoluteColumn?: number;\n absoluteRow?: number;\n absoluteLength?: number;\n absoluteHeight?: number;\n useAs?: string;\n}\n\nexport type SmeupSetupBase<T extends ComponentOptions = ComponentOptions> = {\n [key in Shapes]?: T[];\n};\n\nexport interface SmeupSetup<T extends ComponentOptions = ComponentOptions> {\n title?: string;\n options?: SmeupSetupBase<T>;\n userSetups?: boolean;\n context?: string;\n commands?: Array<SmeupDataNode>;\n operations?: {\n insert?: boolean;\n delete?: boolean;\n update?: boolean;\n };\n}\n\n"]}
@@ -1,4 +1,4 @@
1
- import { SmeupDataStructure, SmeupDataStructureType, SmeupLayout } from "./smeupDataStructure.js";
1
+ import { SmeupDataStructure, SmeupDataStructureType, SmeupLayout } from "./smeupDataStructure";
2
2
  export interface SmeupDataTable extends SmeupDataStructure {
3
3
  type: SmeupDataStructureType.SmeupDataTable;
4
4
  columns: SmeupDataColumn[];
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SmeupDataCellShapes = void 0;
1
4
  /**
2
5
  * Represent the possible shapes of a field
3
6
  */
4
- export const SmeupDataCellShapes = {
7
+ exports.SmeupDataCellShapes = {
5
8
  AUTOCOMPLETE: "ACP",
6
9
  BUTTON_LIST: "BTN",
7
10
  CHART: "GRA",
@@ -1 +1 @@
1
- {"version":3,"file":"smeupDataTable.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataTable.ts"],"names":[],"mappings":"AAmFA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,KAAK;IACzB,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,eAAe,EAAE,KAAK;IACtB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;CACL,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-wrapper-object-types */\nimport {\n SmeupDataStructure,\n SmeupDataStructureType,\n SmeupLayout,\n} from \"./smeupDataStructure.js\";\n\nexport interface SmeupDataTable extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupDataTable;\n columns: SmeupDataColumn[];\n rows: SmeupDataRow[];\n layout?: SmeupLayout;\n cover?: SmeupCover;\n}\n\nexport interface SmeupDataColumn {\n name: string;\n title?: string;\n visible?: boolean;\n isEditable?: boolean;\n isKey?: boolean;\n fill?: string;\n obj?: {\n t: string;\n p: string;\n };\n maxLength?: number;\n length?: number;\n integers?: number;\n decimals?: number;\n tooltip?: boolean;\n formula?: string;\n shape?: SmeupDataCellShapes;\n useAs?: string;\n hideValuesRepetitions?: boolean;\n}\n\nexport interface SmeupDataRow {\n cells?: {\n [columnName: string]: SmeupDataCell;\n };\n layout?: SmeupLayout;\n rowId?: string;\n error?: boolean;\n}\n\nexport interface SmeupDataCell {\n value: string;\n obj?: {\n t: string;\n p: string;\n k: string;\n };\n // multiple options (i.e. radio, checkbox, select, etc.)\n options?: SmeupDataCellOption[];\n icon?: string;\n isEditable?: boolean;\n hasMCell?: boolean;\n mandatory?: boolean;\n shape?: SmeupDataCellShapes;\n fun?: string;\n tooltip?: boolean;\n data?: {\n [key: string]: Object;\n };\n disabled?: boolean;\n styleName?: string;\n styleAttributes?: {\n [attributeKey: string]: string;\n };\n inputSettings?: {\n [key: string]: Object;\n };\n}\n\n/**\n * Represents the single option of the cell\n */\nexport interface SmeupDataCellOption {\n id: string;\n label: string;\n}\n\n/**\n * Represent the possible shapes of a field\n */\nexport const SmeupDataCellShapes = {\n AUTOCOMPLETE: \"ACP\",\n BUTTON_LIST: \"BTN\",\n CHART: \"GRA\",\n CHECKBOX: \"CHK\",\n CHIP: \"CHI\",\n COLOR_PICKER: \"CLP\",\n COMBOBOX: \"CMB\",\n DATE: \"CAL\",\n EDITOR: \"EDT\",\n GAUGE: \"GAU\",\n ICON: \"ICO\",\n IMAGE: \"IMG\",\n INPUT_CHECKBOX: \"INC\",\n INPUT_FIELD: \"INF\",\n KNOB: \"KNB\",\n LABEL: \"LBL\",\n MEMO: \"MEM\",\n MULTI_AUTOCOMPLETE: \"AML\",\n MULTI_COMBOBOX: \"CML\",\n OBJECT: \"OBJ\",\n PROGRESS_BAR: \"PGB\",\n RADIO: \"RAD\",\n RATING: \"RTG\",\n SWITCH: \"SWT\",\n TABLE: \"TBL\",\n TEXT_FIELD: \"ITX\",\n TIME: \"TIM\",\n INPUT_NUMBER: \"INR\",\n BOOLEAN_BUTTON: \"BNB\",\n RANGE: \"RNG\",\n FILE_UPLOAD: \"FUP\",\n FILE_READER: \"FRE\",\n COMMAND_EXECUTE: \"RUN\",\n ONE_BUTTON: \"BTO\",\n PASSWORD: \"PWD\",\n SPINNER: \"SPN\",\n DECODE: \"DEC\",\n} as const;\n\n/**\n * Represent the type of the shape (like enum)\n */\nexport type SmeupDataCellShapes =\n | (typeof SmeupDataCellShapes)[keyof typeof SmeupDataCellShapes]\n | string;\n\nexport interface SmeupCover {\n image?: string;\n logo?: string;\n titles?: {\n [t: string]: string;\n };\n data?: SmeupDataTable[];\n}\n"]}
1
+ {"version":3,"file":"smeupDataTable.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataTable.ts"],"names":[],"mappings":";;;AAmFA;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,KAAK;IACzB,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,KAAK;IAClB,eAAe,EAAE,KAAK;IACtB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;CACL,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-wrapper-object-types */\nimport {\n SmeupDataStructure,\n SmeupDataStructureType,\n SmeupLayout,\n} from \"./smeupDataStructure\";\n\nexport interface SmeupDataTable extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupDataTable;\n columns: SmeupDataColumn[];\n rows: SmeupDataRow[];\n layout?: SmeupLayout;\n cover?: SmeupCover;\n}\n\nexport interface SmeupDataColumn {\n name: string;\n title?: string;\n visible?: boolean;\n isEditable?: boolean;\n isKey?: boolean;\n fill?: string;\n obj?: {\n t: string;\n p: string;\n };\n maxLength?: number;\n length?: number;\n integers?: number;\n decimals?: number;\n tooltip?: boolean;\n formula?: string;\n shape?: SmeupDataCellShapes;\n useAs?: string;\n hideValuesRepetitions?: boolean;\n}\n\nexport interface SmeupDataRow {\n cells?: {\n [columnName: string]: SmeupDataCell;\n };\n layout?: SmeupLayout;\n rowId?: string;\n error?: boolean;\n}\n\nexport interface SmeupDataCell {\n value: string;\n obj?: {\n t: string;\n p: string;\n k: string;\n };\n // multiple options (i.e. radio, checkbox, select, etc.)\n options?: SmeupDataCellOption[];\n icon?: string;\n isEditable?: boolean;\n hasMCell?: boolean;\n mandatory?: boolean;\n shape?: SmeupDataCellShapes;\n fun?: string;\n tooltip?: boolean;\n data?: {\n [key: string]: Object;\n };\n disabled?: boolean;\n styleName?: string;\n styleAttributes?: {\n [attributeKey: string]: string;\n };\n inputSettings?: {\n [key: string]: Object;\n };\n}\n\n/**\n * Represents the single option of the cell\n */\nexport interface SmeupDataCellOption {\n id: string;\n label: string;\n}\n\n/**\n * Represent the possible shapes of a field\n */\nexport const SmeupDataCellShapes = {\n AUTOCOMPLETE: \"ACP\",\n BUTTON_LIST: \"BTN\",\n CHART: \"GRA\",\n CHECKBOX: \"CHK\",\n CHIP: \"CHI\",\n COLOR_PICKER: \"CLP\",\n COMBOBOX: \"CMB\",\n DATE: \"CAL\",\n EDITOR: \"EDT\",\n GAUGE: \"GAU\",\n ICON: \"ICO\",\n IMAGE: \"IMG\",\n INPUT_CHECKBOX: \"INC\",\n INPUT_FIELD: \"INF\",\n KNOB: \"KNB\",\n LABEL: \"LBL\",\n MEMO: \"MEM\",\n MULTI_AUTOCOMPLETE: \"AML\",\n MULTI_COMBOBOX: \"CML\",\n OBJECT: \"OBJ\",\n PROGRESS_BAR: \"PGB\",\n RADIO: \"RAD\",\n RATING: \"RTG\",\n SWITCH: \"SWT\",\n TABLE: \"TBL\",\n TEXT_FIELD: \"ITX\",\n TIME: \"TIM\",\n INPUT_NUMBER: \"INR\",\n BOOLEAN_BUTTON: \"BNB\",\n RANGE: \"RNG\",\n FILE_UPLOAD: \"FUP\",\n FILE_READER: \"FRE\",\n COMMAND_EXECUTE: \"RUN\",\n ONE_BUTTON: \"BTO\",\n PASSWORD: \"PWD\",\n SPINNER: \"SPN\",\n DECODE: \"DEC\",\n} as const;\n\n/**\n * Represent the type of the shape (like enum)\n */\nexport type SmeupDataCellShapes =\n | (typeof SmeupDataCellShapes)[keyof typeof SmeupDataCellShapes]\n | string;\n\nexport interface SmeupCover {\n image?: string;\n logo?: string;\n titles?: {\n [t: string]: string;\n };\n data?: SmeupDataTable[];\n}\n\n"]}
@@ -1,5 +1,5 @@
1
- import { SmeupDataStructure, SmeupDataStructureType } from "./smeupDataStructure.js";
2
- import { SmeupDataCell, SmeupDataColumn } from "./smeupDataTable.js";
1
+ import { SmeupDataStructure, SmeupDataStructureType } from "./smeupDataStructure";
2
+ import { SmeupDataCell, SmeupDataColumn } from "./smeupDataTable";
3
3
  export interface SmeupDataTree extends SmeupDataStructure {
4
4
  type: SmeupDataStructureType.SmeupDataTree;
5
5
  children: SmeupDataNode[];
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=smeupDataTree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smeupDataTree.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataTree.ts"],"names":[],"mappings":"","sourcesContent":["import {\n SmeupDataStructure,\n SmeupDataStructureType,\n} from \"./smeupDataStructure.js\";\nimport { SmeupDataCell, SmeupDataColumn } from \"./smeupDataTable.js\";\n\nexport interface SmeupDataTree extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupDataTree;\n children: SmeupDataNode[];\n columns?: SmeupDataColumn[];\n}\n\nexport interface SmeupDataNode extends SmeupDataCell {\n children?: SmeupDataNode[];\n cells?: {\n [columnName: string]: SmeupDataCell;\n };\n}\n"]}
1
+ {"version":3,"file":"smeupDataTree.js","sourceRoot":"","sources":["../../../src/types/data-structures/smeupDataTree.ts"],"names":[],"mappings":"","sourcesContent":["import {\n SmeupDataStructure,\n SmeupDataStructureType,\n} from \"./smeupDataStructure\";\nimport { SmeupDataCell, SmeupDataColumn } from \"./smeupDataTable\";\n\nexport interface SmeupDataTree extends SmeupDataStructure {\n type: SmeupDataStructureType.SmeupDataTree;\n children: SmeupDataNode[];\n columns?: SmeupDataColumn[];\n}\n\nexport interface SmeupDataNode extends SmeupDataCell {\n children?: SmeupDataNode[];\n cells?: {\n [columnName: string]: SmeupDataCell;\n };\n}\n\n"]}
@@ -1,9 +1,9 @@
1
- import { SmeupDataStructure, SmeupDataStructureType, SmeupSetupBase, SmeupVariable } from "./smeupDataStructure.js";
2
- import { SmeupDataTable } from "./smeupDataTable.js";
3
- import { SmeupDataTree, SmeupDataNode } from "./smeupDataTree.js";
4
- import { Shapes, ToolbarState } from "../component.js";
5
- import { YesNo } from "../helpers.js";
6
- import { RawDynamism } from "../dynamism.js";
1
+ import { SmeupDataStructure, SmeupDataStructureType, SmeupSetupBase, SmeupVariable } from "./smeupDataStructure";
2
+ import { SmeupDataTable } from "./smeupDataTable";
3
+ import { SmeupDataTree, SmeupDataNode } from "./smeupDataTree";
4
+ import { Shapes, ToolbarState } from "../component";
5
+ import { YesNo } from "../helpers";
6
+ import { RawDynamism } from "../dynamism";
7
7
  export interface SmeupSch extends SmeupDataStructure {
8
8
  type: SmeupDataStructureType.SmeupScheda;
9
9
  title: string;
@@ -1,4 +1,7 @@
1
- export var SectionTypes;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SectionTypes = void 0;
4
+ var SectionTypes;
2
5
  (function (SectionTypes) {
3
6
  SectionTypes["Acc"] = "Acc";
4
7
  SectionTypes["Tab"] = "Tab";
@@ -7,5 +10,5 @@ export var SectionTypes;
7
10
  SectionTypes["Combo"] = "Combo";
8
11
  SectionTypes["OneBut"] = "OneBut";
9
12
  SectionTypes["Menu"] = "Menu";
10
- })(SectionTypes || (SectionTypes = {}));
13
+ })(SectionTypes || (exports.SectionTypes = SectionTypes = {}));
11
14
  //# sourceMappingURL=smeupSch.js.map