@evotecit/officeimo 0.1.2 → 0.1.3
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 +43 -49
- package/bundles/officeimo-canopyx.js +966 -122
- package/bundles/officeimo-canopyx.mjs +929 -92
- package/bundles/officeimo-csv.js +18 -15
- package/bundles/officeimo-csv.mjs +16 -13
- package/bundles/officeimo-datatables.js +168 -82
- package/bundles/officeimo-datatables.mjs +140 -54
- package/bundles/officeimo-pdf.js +148 -65
- package/bundles/officeimo-pdf.mjs +124 -41
- package/bundles/officeimo.js +168 -82
- package/bundles/officeimo.mjs +140 -54
- package/dist/csv/index.js +16 -13
- package/dist/integrations/canopyx/diagnostics.d.ts +3 -0
- package/dist/integrations/canopyx/diagnostics.js +17 -0
- package/dist/integrations/canopyx/grouping.d.ts +6 -0
- package/dist/integrations/canopyx/grouping.js +188 -0
- package/dist/integrations/canopyx/index.d.ts +2 -2
- package/dist/integrations/canopyx/index.js +72 -15
- package/dist/integrations/canopyx/metadata.d.ts +4 -0
- package/dist/integrations/canopyx/metadata.js +51 -0
- package/dist/integrations/canopyx/presentation.d.ts +8 -0
- package/dist/integrations/canopyx/presentation.js +40 -0
- package/dist/integrations/canopyx/rule-predicates.d.ts +3 -0
- package/dist/integrations/canopyx/rule-predicates.js +110 -0
- package/dist/integrations/canopyx/rules.d.ts +6 -0
- package/dist/integrations/canopyx/rules.js +176 -0
- package/dist/integrations/canopyx/source.js +24 -22
- package/dist/integrations/canopyx/types.d.ts +89 -8
- package/dist/integrations/canopyx/workbook.d.ts +6 -0
- package/dist/integrations/canopyx/workbook.js +52 -0
- package/dist/pdf/font-resources.js +33 -14
- package/dist/pdf/pages.js +60 -14
- package/dist/pdf/table-band-flow.js +7 -2
- package/dist/pdf/table-band-plan.js +9 -1
- package/dist/pdf/table-layout.js +6 -2
- package/dist/pdf/table-structure.js +9 -8
- package/package.json +1 -1
package/bundles/officeimo-csv.js
CHANGED
|
@@ -1110,7 +1110,7 @@ _modules.set("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00",
|
|
|
1110
1110
|
return _exports;
|
|
1111
1111
|
})();
|
|
1112
1112
|
|
|
1113
|
-
const _m0 = _modules.get("
|
|
1113
|
+
const _m0 = _modules.get("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4") ?? (() => {
|
|
1114
1114
|
const { beginTask, checkAbort, consumeRows, taskYieldDue, withAbort } = _m1;
|
|
1115
1115
|
|
|
1116
1116
|
const { BlobByteSink, ChunkedTextSink, withDestination } = _m2;
|
|
@@ -1135,29 +1135,32 @@ const { captureCsvOptions } = _m15;
|
|
|
1135
1135
|
|
|
1136
1136
|
|
|
1137
1137
|
|
|
1138
|
-
function csvField(value, delimiter, protect, quote, booleanText
|
|
1139
|
-
|
|
1140
|
-
value = nullValue;
|
|
1138
|
+
function csvField(value, delimiter, protect, quote, booleanText) {
|
|
1139
|
+
const kind = typeof value;
|
|
1141
1140
|
let text;
|
|
1142
1141
|
if (value == null)
|
|
1143
1142
|
text = "";
|
|
1143
|
+
else if (kind === "string")
|
|
1144
|
+
text = value;
|
|
1145
|
+
else if (kind === "number") {
|
|
1146
|
+
text = Number.isFinite(value) ? String(value) : "";
|
|
1147
|
+
// Numeric text has no CSV delimiter, quote or line break to escape.
|
|
1148
|
+
return quote === "all" ? '"' + text + '"' : text;
|
|
1149
|
+
}
|
|
1150
|
+
else if (kind === "boolean")
|
|
1151
|
+
text = booleanText[value ? "true" : "false"];
|
|
1144
1152
|
else if (isDate(value))
|
|
1145
1153
|
text = Number.isFinite(value.getTime()) ? value.toISOString() : "";
|
|
1146
|
-
else if (typeof value === "boolean")
|
|
1147
|
-
text = booleanText[value ? "true" : "false"];
|
|
1148
|
-
else if (typeof value === "number")
|
|
1149
|
-
text = Number.isFinite(value) ? String(value) : "";
|
|
1150
|
-
else if (typeof value === "string")
|
|
1151
|
-
text = value;
|
|
1152
1154
|
else {
|
|
1153
1155
|
if (typeof value.then === "function")
|
|
1154
1156
|
void Promise.resolve(value).catch(() => { });
|
|
1155
1157
|
throw new TypeError("CSV cells and formatter results must be synchronous strings, numbers, booleans, Dates or null.");
|
|
1156
1158
|
}
|
|
1157
|
-
|
|
1159
|
+
// Only ASCII spaces, controls and markers through @ can begin the protected prefix.
|
|
1160
|
+
if (protect && (kind === "string" || kind === "boolean") && text.charCodeAt(0) <= 64 && /^ *[=+\-@\t\r\n]/.test(text))
|
|
1158
1161
|
text = "'" + text;
|
|
1159
|
-
return quote === "all" || (quote === "strings" &&
|
|
1160
|
-
? '"' + text.replace(/"/g, '""') + '"' : text;
|
|
1162
|
+
return quote === "all" || (quote === "strings" && kind === "string") || text.includes(delimiter) || /["\r\n]/.test(text)
|
|
1163
|
+
? '"' + (text.includes('"') ? text.replace(/"/g, '""') : text) + '"' : text;
|
|
1161
1164
|
}
|
|
1162
1165
|
async function writeCsvTo(rows, destination, configuration) {
|
|
1163
1166
|
const options = captureCsvOptions(configuration);
|
|
@@ -1209,7 +1212,7 @@ async function write(rows, sink, options) {
|
|
|
1209
1212
|
value = options.nullValue;
|
|
1210
1213
|
budget.cell(typeof value === "boolean" ? booleanText[value ? "true" : "false"] : value);
|
|
1211
1214
|
checkAbort(signal);
|
|
1212
|
-
text += (i ? delimiter : "") + csvField(value, delimiter, protect, quote, booleanText
|
|
1215
|
+
text += (i ? delimiter : "") + csvField(value, delimiter, protect, quote, booleanText);
|
|
1213
1216
|
if (text.length >= buffer.chunkSize || (i & 127) === 127 && taskYieldDue()) {
|
|
1214
1217
|
if (buffer.append(text))
|
|
1215
1218
|
return buffer.flush().then(() => record(values, header, i + 1, snapshot));
|
|
@@ -1257,7 +1260,7 @@ async function writeCsv(rows, configuration) {
|
|
|
1257
1260
|
}
|
|
1258
1261
|
}
|
|
1259
1262
|
const _exports = Object.freeze({ saveBlob: _m16.saveBlob, ExportCell: _m6.ExportCell, writeCsvTo: writeCsvTo, writeCsv: writeCsv });
|
|
1260
|
-
_modules.set("
|
|
1263
|
+
_modules.set("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4", _exports);
|
|
1261
1264
|
return _exports;
|
|
1262
1265
|
})();
|
|
1263
1266
|
Object.assign(officeimo, _m0, { core: _m16, csv: _m0 });
|
|
@@ -1111,29 +1111,32 @@ const { captureCsvOptions } = _m15;
|
|
|
1111
1111
|
|
|
1112
1112
|
|
|
1113
1113
|
|
|
1114
|
-
function csvField(value, delimiter, protect, quote, booleanText
|
|
1115
|
-
|
|
1116
|
-
value = nullValue;
|
|
1114
|
+
function csvField(value, delimiter, protect, quote, booleanText) {
|
|
1115
|
+
const kind = typeof value;
|
|
1117
1116
|
let text;
|
|
1118
1117
|
if (value == null)
|
|
1119
1118
|
text = "";
|
|
1119
|
+
else if (kind === "string")
|
|
1120
|
+
text = value;
|
|
1121
|
+
else if (kind === "number") {
|
|
1122
|
+
text = Number.isFinite(value) ? String(value) : "";
|
|
1123
|
+
// Numeric text has no CSV delimiter, quote or line break to escape.
|
|
1124
|
+
return quote === "all" ? '"' + text + '"' : text;
|
|
1125
|
+
}
|
|
1126
|
+
else if (kind === "boolean")
|
|
1127
|
+
text = booleanText[value ? "true" : "false"];
|
|
1120
1128
|
else if (isDate(value))
|
|
1121
1129
|
text = Number.isFinite(value.getTime()) ? value.toISOString() : "";
|
|
1122
|
-
else if (typeof value === "boolean")
|
|
1123
|
-
text = booleanText[value ? "true" : "false"];
|
|
1124
|
-
else if (typeof value === "number")
|
|
1125
|
-
text = Number.isFinite(value) ? String(value) : "";
|
|
1126
|
-
else if (typeof value === "string")
|
|
1127
|
-
text = value;
|
|
1128
1130
|
else {
|
|
1129
1131
|
if (typeof value.then === "function")
|
|
1130
1132
|
void Promise.resolve(value).catch(() => { });
|
|
1131
1133
|
throw new TypeError("CSV cells and formatter results must be synchronous strings, numbers, booleans, Dates or null.");
|
|
1132
1134
|
}
|
|
1133
|
-
|
|
1135
|
+
// Only ASCII spaces, controls and markers through @ can begin the protected prefix.
|
|
1136
|
+
if (protect && (kind === "string" || kind === "boolean") && text.charCodeAt(0) <= 64 && /^ *[=+\-@\t\r\n]/.test(text))
|
|
1134
1137
|
text = "'" + text;
|
|
1135
|
-
return quote === "all" || (quote === "strings" &&
|
|
1136
|
-
? '"' + text.replace(/"/g, '""') + '"' : text;
|
|
1138
|
+
return quote === "all" || (quote === "strings" && kind === "string") || text.includes(delimiter) || /["\r\n]/.test(text)
|
|
1139
|
+
? '"' + (text.includes('"') ? text.replace(/"/g, '""') : text) + '"' : text;
|
|
1137
1140
|
}
|
|
1138
1141
|
async function writeCsvTo(rows, destination, configuration) {
|
|
1139
1142
|
const options = captureCsvOptions(configuration);
|
|
@@ -1185,7 +1188,7 @@ async function write(rows, sink, options) {
|
|
|
1185
1188
|
value = options.nullValue;
|
|
1186
1189
|
budget.cell(typeof value === "boolean" ? booleanText[value ? "true" : "false"] : value);
|
|
1187
1190
|
checkAbort(signal);
|
|
1188
|
-
text += (i ? delimiter : "") + csvField(value, delimiter, protect, quote, booleanText
|
|
1191
|
+
text += (i ? delimiter : "") + csvField(value, delimiter, protect, quote, booleanText);
|
|
1189
1192
|
if (text.length >= buffer.chunkSize || (i & 127) === 127 && taskYieldDue()) {
|
|
1190
1193
|
if (buffer.append(text))
|
|
1191
1194
|
return buffer.flush().then(() => record(values, header, i + 1, snapshot));
|