@evotecit/officeimo 0.1.5 → 0.1.19
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.
- package/README.md +15 -3
- package/bundles/officeimo-canopyx-adapter.js +1444 -0
- package/bundles/officeimo-canopyx-adapter.min.js +2 -0
- package/bundles/officeimo-canopyx-adapter.min.mjs +2 -0
- package/bundles/officeimo-canopyx-adapter.mjs +1426 -0
- package/bundles/officeimo-canopyx.js +15 -14
- package/bundles/officeimo-canopyx.min.js +2 -0
- package/bundles/officeimo-canopyx.min.mjs +2 -0
- package/bundles/officeimo-canopyx.mjs +7 -6
- package/bundles/officeimo-csv.min.js +2 -0
- package/bundles/officeimo-csv.min.mjs +2 -0
- package/bundles/officeimo-datatables-adapter.js +626 -0
- package/bundles/officeimo-datatables-adapter.min.js +2 -0
- package/bundles/officeimo-datatables-adapter.min.mjs +2 -0
- package/bundles/officeimo-datatables-adapter.mjs +617 -0
- package/bundles/officeimo-datatables.js +55 -10
- package/bundles/officeimo-datatables.min.js +2 -0
- package/bundles/officeimo-datatables.min.mjs +2 -0
- package/bundles/officeimo-datatables.mjs +51 -6
- package/bundles/officeimo-execution.min.js +2 -0
- package/bundles/officeimo-execution.min.mjs +2 -0
- package/bundles/officeimo-pdf.min.js +2 -0
- package/bundles/officeimo-pdf.min.mjs +2 -0
- package/bundles/officeimo-xlsx.min.js +2 -0
- package/bundles/officeimo-xlsx.min.mjs +2 -0
- package/bundles/officeimo.min.js +2 -0
- package/bundles/officeimo.min.mjs +2 -0
- package/bundles/officeimo.mjs +2 -1
- package/dist/integrations/canopyx/metadata.js +1 -1
- package/dist/integrations/canopyx/pdf-number.js +6 -5
- package/dist/integrations/canopyx/types.d.ts +2 -1
- package/dist/integrations/datatables/snapshot.js +51 -6
- package/package.json +6 -2
|
@@ -11737,7 +11737,7 @@ _modules.set("0e5ede7759618ed3ec827d34fbd62b205f3a5241650504807c24e5323a2496a5",
|
|
|
11737
11737
|
return _exports;
|
|
11738
11738
|
})();
|
|
11739
11739
|
|
|
11740
|
-
const _m96 = _modules.get("
|
|
11740
|
+
const _m96 = _modules.get("8edb7b3b19d6555ea24a92d771d532dc0448ad18101fdf663217b4c518b5a31b") ?? (() => {
|
|
11741
11741
|
const { checkAbort, pause, rowsFromBatches, taskYieldDue } = _m4;
|
|
11742
11742
|
|
|
11743
11743
|
const { ExportBudget } = _m9;
|
|
@@ -11764,6 +11764,31 @@ function safeOptions(options) {
|
|
|
11764
11764
|
value(result);
|
|
11765
11765
|
} } : {}) };
|
|
11766
11766
|
}
|
|
11767
|
+
/** Buttons builds the heading structures before customizeData runs; carry changed leaf labels into their bottom row. */
|
|
11768
|
+
function customizedStructure(structure, before, after, kind) {
|
|
11769
|
+
if (!before || !Array.isArray(structure) || !structure.length)
|
|
11770
|
+
return structure;
|
|
11771
|
+
const changed = after.map((label, index) => !Object.is(label, before[index]));
|
|
11772
|
+
if (!changed.some(Boolean))
|
|
11773
|
+
return structure;
|
|
11774
|
+
return structure.map((row, level) => !Array.isArray(row) ? row : row.map((cell, index) => {
|
|
11775
|
+
if (cell == null || level + (Number(member(cell, "rowspan")) || 1) !== structure.length)
|
|
11776
|
+
return cell;
|
|
11777
|
+
const span = Number(member(cell, "colspan")) || 1;
|
|
11778
|
+
if (!changed.slice(index, index + span).some(Boolean))
|
|
11779
|
+
return cell;
|
|
11780
|
+
if (span !== 1)
|
|
11781
|
+
throw new TypeError("customizeData cannot change one column of a spanning " + kind + " cell.");
|
|
11782
|
+
return { ...cell, title: after[index] };
|
|
11783
|
+
}));
|
|
11784
|
+
}
|
|
11785
|
+
/** A customizeData reorder is visible as a permutation of distinct leaf labels; map each output column to its source. */
|
|
11786
|
+
function reorderedSources(before, after) {
|
|
11787
|
+
if (!before || before.length !== after.length || new Set(before).size !== before.length)
|
|
11788
|
+
return undefined;
|
|
11789
|
+
const sources = after.map(label => before.indexOf(label));
|
|
11790
|
+
return sources.every(source => source >= 0) && new Set(sources).size === sources.length && sources.some((source, index) => source !== index) ? sources : undefined;
|
|
11791
|
+
}
|
|
11767
11792
|
/** Capture export scope and headings, then produce values in bounded batches using public DataTables APIs. */
|
|
11768
11793
|
function createDataTablesExport(host, table, options = {}) {
|
|
11769
11794
|
return captureDataTablesExport(host, table, options);
|
|
@@ -11815,16 +11840,35 @@ function captureDataTablesExport(host, table, options = {}, omitted) {
|
|
|
11815
11840
|
throw new RangeError("A selected row exceeds maxBatchCells.");
|
|
11816
11841
|
if (new Set(rowIndexes).size !== rowIndexes.length || new Set(columnIndexes).size !== columnIndexes.length)
|
|
11817
11842
|
throw new TypeError("DataTables export indexes must be unique.");
|
|
11818
|
-
|
|
11843
|
+
let before;
|
|
11844
|
+
const customize = config.customizeData;
|
|
11845
|
+
const data = call(table.buttons, "exportData", { ...config, modifier, ...(mode === "batched" ? { rows: [] } : {}),
|
|
11846
|
+
...(customize ? { customizeData: (input) => {
|
|
11847
|
+
const footer = member(input, "footer");
|
|
11848
|
+
before = { header: [...array(member(input, "header"))], footer: footer == null ? undefined : [...array(footer)] };
|
|
11849
|
+
customize(input);
|
|
11850
|
+
} } : {}) });
|
|
11819
11851
|
const leaf = array(member(data, "header"));
|
|
11820
11852
|
if (leaf.length !== columnIndexes.length)
|
|
11821
11853
|
throw new TypeError("Export header must match the selected columns.");
|
|
11822
|
-
|
|
11854
|
+
// Only structured output reaches the source structures' bottom row; leaf and grouped headings take the leaf labels.
|
|
11855
|
+
const structured = headingMode === "structured" && !omitted?.header;
|
|
11856
|
+
const sourceStructure = omitted?.header ? undefined : member(data, "headerStructure");
|
|
11857
|
+
const heading = headings(structured ? customizedStructure(sourceStructure, before?.header, leaf, "header") : sourceStructure, leaf, omitted?.header ? "leaf" : headingMode);
|
|
11858
|
+
const reordered = reorderedSources(before?.header, leaf);
|
|
11859
|
+
if (reordered && heading.rows.length > 1)
|
|
11860
|
+
throw new TypeError("customizeData cannot reorder columns under grouped headings; select headings: 'leaf' or reorder the table's columns.");
|
|
11861
|
+
// Column options and keys follow each column to its new position after a customizeData reorder. Any other heading
|
|
11862
|
+
// change (a rename, or a reorder with a rename) leaves no reliable source mapping for column options.
|
|
11863
|
+
if (before && !reordered && before.header.some((label, index) => !Object.is(label, leaf[index])) &&
|
|
11864
|
+
columnIndexes.some(index => options.columnOptions?.[index] !== undefined))
|
|
11865
|
+
throw new TypeError("customizeData changed column headings, so columnOptions cannot be matched to columns; rename columns with columnOptions header instead.");
|
|
11866
|
+
const sourceColumns = reordered ? reordered.map(source => columnIndexes[source]) : columnIndexes;
|
|
11823
11867
|
for (const index of columnIndexes)
|
|
11824
11868
|
if (member(options.columnOptions?.[index], "value") !== undefined)
|
|
11825
11869
|
throw new TypeError("DataTables columnOptions describes columns; resolve values with project.");
|
|
11826
11870
|
const columns = Object.freeze(copyColumns(leaf.map((label, index) => ({
|
|
11827
|
-
header: text(label), key: "dt:" +
|
|
11871
|
+
header: text(label), key: "dt:" + sourceColumns[index], ...options.columnOptions?.[sourceColumns[index]],
|
|
11828
11872
|
...(heading.groups[index].length ? { groups: Object.freeze(heading.groups[index]) } : {})
|
|
11829
11873
|
}))).map(column => Object.freeze(column)));
|
|
11830
11874
|
// Explicit heading overrides also apply to CSV's leaf heading.
|
|
@@ -11833,8 +11877,8 @@ function captureDataTablesExport(host, table, options = {}, omitted) {
|
|
|
11833
11877
|
const headerStructure = heading.structure?.map((row, level) => Object.freeze(row.map((cell, index) => {
|
|
11834
11878
|
if (!cell || level + (cell.rowSpan ?? 1) !== heading.structure.length)
|
|
11835
11879
|
return cell;
|
|
11836
|
-
const override = options.columnOptions?.[
|
|
11837
|
-
if ((cell.columnSpan ?? 1) > 1 &&
|
|
11880
|
+
const override = options.columnOptions?.[sourceColumns[index]]?.header;
|
|
11881
|
+
if ((cell.columnSpan ?? 1) > 1 && sourceColumns.slice(index, index + (cell.columnSpan ?? 1)).some(c => options.columnOptions?.[c]?.header !== undefined))
|
|
11838
11882
|
throw new TypeError("A spanning leaf heading cannot have per-column header overrides.");
|
|
11839
11883
|
return override === undefined ? cell : Object.freeze({ ...cell, value: override });
|
|
11840
11884
|
})));
|
|
@@ -11846,7 +11890,8 @@ function captureDataTablesExport(host, table, options = {}, omitted) {
|
|
|
11846
11890
|
const footer = rawFooter == null ? undefined : array(rawFooter).map(value);
|
|
11847
11891
|
if (footer && footer.length !== columns.length)
|
|
11848
11892
|
throw new TypeError("Export footer must match the selected columns.");
|
|
11849
|
-
const footerHeading = footer && Array.isArray(footerStructure) && footerStructure.length
|
|
11893
|
+
const footerHeading = footer && Array.isArray(footerStructure) && footerStructure.length
|
|
11894
|
+
? headings(headingMode === "structured" ? customizedStructure(footerStructure, before?.footer, array(rawFooter), "footer") : footerStructure, footer, headingMode === "structured" ? "structured" : "grouped") : undefined;
|
|
11850
11895
|
const body = mode === "compatibility" ? array(member(data, "body")) : undefined;
|
|
11851
11896
|
const count = columns.length ? body?.length ?? rowIndexes.length : 0;
|
|
11852
11897
|
budget.check("maxRows", count);
|
|
@@ -11951,7 +11996,7 @@ function captureDataTablesExport(host, table, options = {}, omitted) {
|
|
|
11951
11996
|
...(footerHeading?.structure ? { footerStructure: footerHeading.structure } : {}), rowCount: count, rows });
|
|
11952
11997
|
}
|
|
11953
11998
|
const _exports = Object.freeze({ createDataTablesExport: createDataTablesExport, captureDataTablesExport: captureDataTablesExport });
|
|
11954
|
-
_modules.set("
|
|
11999
|
+
_modules.set("8edb7b3b19d6555ea24a92d771d532dc0448ad18101fdf663217b4c518b5a31b", _exports);
|
|
11955
12000
|
return _exports;
|
|
11956
12001
|
})();
|
|
11957
12002
|
|
|
@@ -12000,7 +12045,7 @@ _modules.set("7b12a415e92cc9ef7212fb3a88007cb6dc37f9f30077165d4897cfa8052f9a3c",
|
|
|
12000
12045
|
return _exports;
|
|
12001
12046
|
})();
|
|
12002
12047
|
|
|
12003
|
-
const _m0 = _modules.get("
|
|
12048
|
+
const _m0 = _modules.get("f5f1435b6f22ab08d91f4a58bb66e975d4427bcaf5697011e28bfa9e74b2a2ca") ?? (() => {
|
|
12004
12049
|
const { BlobByteSink, checkAbort, saveBlob } = _m1;
|
|
12005
12050
|
|
|
12006
12051
|
const { notifyProgress } = _m14;
|
|
@@ -12183,7 +12228,7 @@ function registerDataTablesButtons(host, options = {}) {
|
|
|
12183
12228
|
}
|
|
12184
12229
|
}
|
|
12185
12230
|
const _exports = Object.freeze({ createDataTablesExport: _m96.createDataTablesExport, ExportCell: _m5.ExportCell, PdfFont: _m63.PdfFont, writeDataTableTo: writeDataTableTo, exportDataTable: exportDataTable, registerDataTablesButtons: registerDataTablesButtons });
|
|
12186
|
-
_modules.set("
|
|
12231
|
+
_modules.set("f5f1435b6f22ab08d91f4a58bb66e975d4427bcaf5697011e28bfa9e74b2a2ca", _exports);
|
|
12187
12232
|
return _exports;
|
|
12188
12233
|
})();
|
|
12189
12234
|
Object.assign(officeimo, _m0);
|