@rowsncolumns/toolkit 24.4.4 → 24.5.0
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/dist/cjs/autofilter-condition.d.ts +45 -1
- package/dist/cjs/autofilter-condition.d.ts.map +1 -1
- package/dist/cjs/autofilter-condition.js +135 -12
- package/dist/cjs/excel-parser/helpers.d.ts +15 -1
- package/dist/cjs/excel-parser/helpers.d.ts.map +1 -1
- package/dist/cjs/excel-parser/helpers.js +119 -5
- package/dist/cjs/excel-parser/interface.d.ts +3 -1
- package/dist/cjs/excel-parser/interface.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/ods/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/ods/index.js +186 -97
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts +15 -0
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/ods/styles.js +80 -6
- package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsb/index.js +107 -103
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts +77 -1
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/charts.js +920 -122
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts +7 -1
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.js +24 -9
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.d.ts +24 -3
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/form-controls.js +25 -3
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts +24 -1
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/index.js +561 -394
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts +8 -2
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.js +312 -21
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts +6 -0
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -1
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.js +9 -0
- package/dist/cjs/excel-parser/plugins/xlsx/theme.d.ts +1 -1
- package/dist/cjs/excel-parser/types.d.ts +9 -1
- package/dist/cjs/excel-parser/types.d.ts.map +1 -1
- package/dist/cjs/excel-parser/workbook.d.ts +1 -0
- package/dist/cjs/excel-parser/workbook.d.ts.map +1 -1
- package/dist/cjs/excel-parser/workbook.js +5 -0
- package/dist/cjs/excel-parser/worker.js +2 -0
- package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -1
- package/dist/cjs/exporter/ods/ods-export.js +255 -80
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts +7 -1
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/chart-builder.js +902 -119
- package/dist/cjs/exporter/xlsx/form-controls-builder.d.ts +16 -3
- package/dist/cjs/exporter/xlsx/form-controls-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/form-controls-builder.js +30 -8
- package/dist/cjs/exporter/xlsx/pivot-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/pivot-builder.js +206 -162
- package/dist/cjs/exporter/xlsx/style-builder.d.ts +8 -2
- package/dist/cjs/exporter/xlsx/style-builder.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/style-builder.js +25 -0
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts +2 -2
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -1
- package/dist/cjs/exporter/xlsx/xlsx-export.js +728 -452
- package/dist/esm/autofilter-condition.d.ts +45 -1
- package/dist/esm/autofilter-condition.d.ts.map +1 -1
- package/dist/esm/autofilter-condition.js +131 -11
- package/dist/esm/excel-parser/helpers.d.ts +15 -1
- package/dist/esm/excel-parser/helpers.d.ts.map +1 -1
- package/dist/esm/excel-parser/helpers.js +94 -4
- package/dist/esm/excel-parser/interface.d.ts +3 -1
- package/dist/esm/excel-parser/interface.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/ods/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/ods/index.js +105 -22
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts +15 -0
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/ods/styles.js +79 -5
- package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsb/index.js +15 -7
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts +77 -1
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/charts.js +708 -16
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts +7 -1
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/drawing.js +23 -0
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.d.ts +24 -3
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/form-controls.js +21 -3
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts +24 -1
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/index.js +192 -54
- package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts +8 -2
- package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/pivots.js +220 -4
- package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts +6 -0
- package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -1
- package/dist/esm/excel-parser/plugins/xlsx/relationships.js +9 -0
- package/dist/esm/excel-parser/plugins/xlsx/theme.d.ts +1 -1
- package/dist/esm/excel-parser/types.d.ts +9 -1
- package/dist/esm/excel-parser/types.d.ts.map +1 -1
- package/dist/esm/excel-parser/workbook.d.ts +1 -0
- package/dist/esm/excel-parser/workbook.d.ts.map +1 -1
- package/dist/esm/excel-parser/workbook.js +4 -0
- package/dist/esm/excel-parser/worker.js +2 -0
- package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -1
- package/dist/esm/exporter/ods/ods-export.js +238 -72
- package/dist/esm/exporter/xlsx/chart-builder.d.ts +7 -1
- package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/chart-builder.js +674 -58
- package/dist/esm/exporter/xlsx/form-controls-builder.d.ts +16 -3
- package/dist/esm/exporter/xlsx/form-controls-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/form-controls-builder.js +29 -8
- package/dist/esm/exporter/xlsx/pivot-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/pivot-builder.js +187 -139
- package/dist/esm/exporter/xlsx/style-builder.d.ts +8 -2
- package/dist/esm/exporter/xlsx/style-builder.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/style-builder.js +28 -0
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts +2 -2
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -1
- package/dist/esm/exporter/xlsx/xlsx-export.js +451 -197
- package/package.json +11 -4
|
@@ -29,6 +29,15 @@ var ODS_XML_OPTIONS = {
|
|
|
29
29
|
};
|
|
30
30
|
var ODS_ORDERED_XML_OPTIONS = __assign(__assign({}, ODS_XML_OPTIONS), { preserveOrder: true });
|
|
31
31
|
var DISPLAY_CURRENCY_REGEX = /[$€¥£₹]/;
|
|
32
|
+
/** The symbol behind an ODS `office:currency` value — an ISO code for the currencies the display-text detection knows, a literal symbol as is. */
|
|
33
|
+
var ODS_CURRENCY_CODE_SYMBOLS = {
|
|
34
|
+
USD: "$",
|
|
35
|
+
EUR: "€",
|
|
36
|
+
GBP: "£",
|
|
37
|
+
JPY: "¥",
|
|
38
|
+
INR: "₹",
|
|
39
|
+
};
|
|
40
|
+
var odsCurrencySymbol = function (currency) { var _a; return (_a = ODS_CURRENCY_CODE_SYMBOLS[currency.toUpperCase()]) !== null && _a !== void 0 ? _a : currency; };
|
|
32
41
|
function findChild(children, tagName) {
|
|
33
42
|
return children === null || children === void 0 ? void 0 : children.find(function (child) { return child[tagName]; });
|
|
34
43
|
}
|
|
@@ -279,6 +288,10 @@ var ODS_OPERATOR_TO_CONDITION = {
|
|
|
279
288
|
endswith: "TEXT_ENDS_WITH",
|
|
280
289
|
empty: "BLANK",
|
|
281
290
|
"non-empty": "NOT_BLANK",
|
|
291
|
+
"top values": "NUMBER_TOP_N",
|
|
292
|
+
"bottom values": "NUMBER_BOTTOM_N",
|
|
293
|
+
"top percent": "NUMBER_TOP_PERCENT",
|
|
294
|
+
"bottom percent": "NUMBER_BOTTOM_PERCENT",
|
|
282
295
|
};
|
|
283
296
|
var OdsPlugin = /** @class */ (function (_super) {
|
|
284
297
|
__extends(OdsPlugin, _super);
|
|
@@ -1090,60 +1103,63 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
1090
1103
|
return filters;
|
|
1091
1104
|
};
|
|
1092
1105
|
OdsPlugin.prototype.convertFilterNodeToSpecs = function (filterNode) {
|
|
1093
|
-
var e_20, _a, e_21, _b;
|
|
1094
1106
|
var _this = this;
|
|
1095
1107
|
var specMap = new Map();
|
|
1096
|
-
|
|
1097
|
-
|
|
1108
|
+
// <table:filter-and> / <table:filter-or> nest (the exporter puts a
|
|
1109
|
+
// column's Or-joined clause pair inside the outer And): walk them
|
|
1110
|
+
// recursively, tagging each condition with the join of its container so
|
|
1111
|
+
// a column's second condition becomes Excel's Custom AutoFilter clause.
|
|
1112
|
+
var walk = function (container, join) {
|
|
1113
|
+
var e_20, _a, e_21, _b, e_22, _c;
|
|
1098
1114
|
var conditions = _this.toArray(get(container, "table:filter-condition") ||
|
|
1099
1115
|
get(container, "filter-condition"));
|
|
1100
1116
|
try {
|
|
1101
1117
|
for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {
|
|
1102
1118
|
var condition = conditions_1_1.value;
|
|
1103
|
-
_this.applyFilterCondition(condition, specMap);
|
|
1119
|
+
_this.applyFilterCondition(condition, specMap, join);
|
|
1104
1120
|
}
|
|
1105
1121
|
}
|
|
1106
|
-
catch (
|
|
1122
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1107
1123
|
finally {
|
|
1108
1124
|
try {
|
|
1109
1125
|
if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);
|
|
1110
1126
|
}
|
|
1111
|
-
finally { if (
|
|
1112
|
-
}
|
|
1113
|
-
};
|
|
1114
|
-
addConditions(filterNode);
|
|
1115
|
-
var andNodes = this.toArray(get(filterNode, "table:filter-and") || get(filterNode, "filter-and"));
|
|
1116
|
-
try {
|
|
1117
|
-
for (var andNodes_1 = __values(andNodes), andNodes_1_1 = andNodes_1.next(); !andNodes_1_1.done; andNodes_1_1 = andNodes_1.next()) {
|
|
1118
|
-
var node = andNodes_1_1.value;
|
|
1119
|
-
addConditions(node);
|
|
1127
|
+
finally { if (e_20) throw e_20.error; }
|
|
1120
1128
|
}
|
|
1121
|
-
|
|
1122
|
-
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1123
|
-
finally {
|
|
1129
|
+
var andNodes = _this.toArray(get(container, "table:filter-and") || get(container, "filter-and"));
|
|
1124
1130
|
try {
|
|
1125
|
-
|
|
1131
|
+
for (var andNodes_1 = __values(andNodes), andNodes_1_1 = andNodes_1.next(); !andNodes_1_1.done; andNodes_1_1 = andNodes_1.next()) {
|
|
1132
|
+
var node = andNodes_1_1.value;
|
|
1133
|
+
walk(node, "AND");
|
|
1134
|
+
}
|
|
1126
1135
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
addConditions(node);
|
|
1136
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1137
|
+
finally {
|
|
1138
|
+
try {
|
|
1139
|
+
if (andNodes_1_1 && !andNodes_1_1.done && (_b = andNodes_1.return)) _b.call(andNodes_1);
|
|
1140
|
+
}
|
|
1141
|
+
finally { if (e_21) throw e_21.error; }
|
|
1134
1142
|
}
|
|
1135
|
-
|
|
1136
|
-
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1137
|
-
finally {
|
|
1143
|
+
var orNodes = _this.toArray(get(container, "table:filter-or") || get(container, "filter-or"));
|
|
1138
1144
|
try {
|
|
1139
|
-
|
|
1145
|
+
for (var orNodes_1 = __values(orNodes), orNodes_1_1 = orNodes_1.next(); !orNodes_1_1.done; orNodes_1_1 = orNodes_1.next()) {
|
|
1146
|
+
var node = orNodes_1_1.value;
|
|
1147
|
+
walk(node, "OR");
|
|
1148
|
+
}
|
|
1140
1149
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1150
|
+
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
1151
|
+
finally {
|
|
1152
|
+
try {
|
|
1153
|
+
if (orNodes_1_1 && !orNodes_1_1.done && (_c = orNodes_1.return)) _c.call(orNodes_1);
|
|
1154
|
+
}
|
|
1155
|
+
finally { if (e_22) throw e_22.error; }
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
walk(filterNode, "AND");
|
|
1143
1159
|
return Array.from(specMap.values()).sort(function (a, b) { return a.columnIndex - b.columnIndex; });
|
|
1144
1160
|
};
|
|
1145
|
-
OdsPlugin.prototype.applyFilterCondition = function (node, specMap) {
|
|
1146
|
-
var _a, _b, _c, _d;
|
|
1161
|
+
OdsPlugin.prototype.applyFilterCondition = function (node, specMap, join) {
|
|
1162
|
+
var _a, _b, _c, _d, _e;
|
|
1147
1163
|
var attrs = this.getAttributes(node);
|
|
1148
1164
|
if (!attrs)
|
|
1149
1165
|
return;
|
|
@@ -1179,10 +1195,16 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
1179
1195
|
if (value2 !== undefined) {
|
|
1180
1196
|
conditionValues.push({ userEnteredValue: String(value2) });
|
|
1181
1197
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1198
|
+
var condition = { type: conditionType, values: conditionValues };
|
|
1199
|
+
if ((_e = spec.filterCriteria.condition) === null || _e === void 0 ? void 0 : _e.type) {
|
|
1200
|
+
// A second operator condition on the column is the Custom
|
|
1201
|
+
// AutoFilter's second clause, joined the way its container joins.
|
|
1202
|
+
spec.filterCriteria.condition2 = condition;
|
|
1203
|
+
spec.filterCriteria.conditionJoin = join;
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
spec.filterCriteria.condition = condition;
|
|
1207
|
+
}
|
|
1186
1208
|
return;
|
|
1187
1209
|
}
|
|
1188
1210
|
// operator "=" (or unknown) -> value-list entry.
|
|
@@ -2584,7 +2606,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2584
2606
|
return undefined;
|
|
2585
2607
|
};
|
|
2586
2608
|
OdsPlugin.prototype.convertChartNodeToSpec = function (chartNode, sheetNameMap, context, styles) {
|
|
2587
|
-
var e_52, _a;
|
|
2609
|
+
var e_52, _a, e_53, _b;
|
|
2588
2610
|
if (!chartNode)
|
|
2589
2611
|
return undefined;
|
|
2590
2612
|
var chartAttrs = this.getAttributes(chartNode);
|
|
@@ -2599,7 +2621,38 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2599
2621
|
if (!plotArea)
|
|
2600
2622
|
return undefined;
|
|
2601
2623
|
var plotAreaAttrs = this.getAttributes(plotArea);
|
|
2602
|
-
var
|
|
2624
|
+
var plotAreaStyleName = (plotAreaAttrs === null || plotAreaAttrs === void 0 ? void 0 : plotAreaAttrs["@_chart:style-name"]) || (plotAreaAttrs === null || plotAreaAttrs === void 0 ? void 0 : plotAreaAttrs["@_style-name"]);
|
|
2625
|
+
var sourceChartType = this.resolveOdsSourceChartType(chartClass, chartType, plotAreaStyleName, styles);
|
|
2626
|
+
// Excel's "Show empty cells as" — the default (a gap) is left implicit.
|
|
2627
|
+
var emptyCells = styles.getChartStyleEmptyCells(plotAreaStyleName);
|
|
2628
|
+
// Axis tick-label formats — an axis style's data style with the source
|
|
2629
|
+
// link severed is Excel's `<c:numFmt sourceLinked="0">`; a linked axis
|
|
2630
|
+
// carries no options (the default).
|
|
2631
|
+
var valueAxisOptions;
|
|
2632
|
+
var categoryAxisOptions;
|
|
2633
|
+
try {
|
|
2634
|
+
for (var _c = __values(this.toArray(get(plotArea, "chart:axis") || get(plotArea, "axis"))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2635
|
+
var axisNode = _d.value;
|
|
2636
|
+
var axisAttrs = this.getAttributes(axisNode);
|
|
2637
|
+
var pattern = styles.getChartStyleNumberFormatPattern((axisAttrs === null || axisAttrs === void 0 ? void 0 : axisAttrs["@_chart:style-name"]) || (axisAttrs === null || axisAttrs === void 0 ? void 0 : axisAttrs["@_style-name"]));
|
|
2638
|
+
if (!pattern)
|
|
2639
|
+
continue;
|
|
2640
|
+
var dimension = (axisAttrs === null || axisAttrs === void 0 ? void 0 : axisAttrs["@_chart:dimension"]) || (axisAttrs === null || axisAttrs === void 0 ? void 0 : axisAttrs["@_dimension"]);
|
|
2641
|
+
if (dimension === "y" && !valueAxisOptions) {
|
|
2642
|
+
valueAxisOptions = { numberFormatPattern: pattern };
|
|
2643
|
+
}
|
|
2644
|
+
else if (dimension === "x" && !categoryAxisOptions) {
|
|
2645
|
+
categoryAxisOptions = { numberFormatPattern: pattern };
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
2650
|
+
finally {
|
|
2651
|
+
try {
|
|
2652
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2653
|
+
}
|
|
2654
|
+
finally { if (e_52) throw e_52.error; }
|
|
2655
|
+
}
|
|
2603
2656
|
var seriesNodes = this.toArray(get(plotArea, "chart:series") ||
|
|
2604
2657
|
get(plotArea, "chart:data-series") ||
|
|
2605
2658
|
get(plotArea, "series"));
|
|
@@ -2607,10 +2660,18 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2607
2660
|
return undefined;
|
|
2608
2661
|
var domains = [];
|
|
2609
2662
|
var series = [];
|
|
2663
|
+
// Exploded pie / doughnut: the largest `chart:pie-offset` across the
|
|
2664
|
+
// series styles (OOXML keeps one <c:explosion> per series too).
|
|
2665
|
+
var explosion;
|
|
2610
2666
|
var seriesIndex = 1;
|
|
2611
2667
|
try {
|
|
2612
2668
|
for (var seriesNodes_1 = __values(seriesNodes), seriesNodes_1_1 = seriesNodes_1.next(); !seriesNodes_1_1.done; seriesNodes_1_1 = seriesNodes_1.next()) {
|
|
2613
2669
|
var seriesNode = seriesNodes_1_1.value;
|
|
2670
|
+
var seriesAttrs = this.getAttributes(seriesNode);
|
|
2671
|
+
var pieOffset = styles.getChartStylePieOffset((seriesAttrs === null || seriesAttrs === void 0 ? void 0 : seriesAttrs["@_chart:style-name"]) || (seriesAttrs === null || seriesAttrs === void 0 ? void 0 : seriesAttrs["@_style-name"]));
|
|
2672
|
+
if (pieOffset !== undefined) {
|
|
2673
|
+
explosion = Math.max(explosion !== null && explosion !== void 0 ? explosion : 0, pieOffset);
|
|
2674
|
+
}
|
|
2614
2675
|
var domainNode = get(seriesNode, "chart:domain") ||
|
|
2615
2676
|
get(seriesNode, "domain") ||
|
|
2616
2677
|
get(seriesNode, "chart:categories");
|
|
@@ -2639,18 +2700,21 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2639
2700
|
}
|
|
2640
2701
|
}
|
|
2641
2702
|
}
|
|
2642
|
-
catch (
|
|
2703
|
+
catch (e_53_1) { e_53 = { error: e_53_1 }; }
|
|
2643
2704
|
finally {
|
|
2644
2705
|
try {
|
|
2645
|
-
if (seriesNodes_1_1 && !seriesNodes_1_1.done && (
|
|
2706
|
+
if (seriesNodes_1_1 && !seriesNodes_1_1.done && (_b = seriesNodes_1.return)) _b.call(seriesNodes_1);
|
|
2646
2707
|
}
|
|
2647
|
-
finally { if (
|
|
2708
|
+
finally { if (e_53) throw e_53.error; }
|
|
2648
2709
|
}
|
|
2649
2710
|
if (!series.length) {
|
|
2650
2711
|
return undefined;
|
|
2651
2712
|
}
|
|
2652
2713
|
var finalizedDomains = domains.length ? domains : [series[0]];
|
|
2653
|
-
return __assign({ chartType: chartType, title: title, domains: finalizedDomains, series: series }, (sourceChartType ? { sourceChartType: sourceChartType } : {}))
|
|
2714
|
+
return __assign(__assign(__assign(__assign(__assign({ chartType: chartType, title: title, domains: finalizedDomains, series: series }, (sourceChartType ? { sourceChartType: sourceChartType } : {})), (emptyCells && emptyCells !== "gaps" ? { emptyCells: emptyCells } : {})), (valueAxisOptions ? { valueAxisOptions: valueAxisOptions } : {})), (categoryAxisOptions ? { categoryAxisOptions: categoryAxisOptions } : {})), (explosion !== undefined &&
|
|
2715
|
+
(chartType === "pie" || chartType === "doughnut")
|
|
2716
|
+
? { explosion: explosion }
|
|
2717
|
+
: {}));
|
|
2654
2718
|
};
|
|
2655
2719
|
OdsPlugin.prototype.extractSeriesLabel = function (seriesNode) {
|
|
2656
2720
|
if (!seriesNode)
|
|
@@ -2662,7 +2726,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2662
2726
|
return (label === null || label === void 0 ? void 0 : label.trim()) || undefined;
|
|
2663
2727
|
};
|
|
2664
2728
|
OdsPlugin.prototype.extractChartSeriesColor = function (seriesNode, styles) {
|
|
2665
|
-
var
|
|
2729
|
+
var e_54, _a, e_55, _b, e_56, _c;
|
|
2666
2730
|
if (!seriesNode)
|
|
2667
2731
|
return undefined;
|
|
2668
2732
|
var attrs = this.getAttributes(seriesNode);
|
|
@@ -2680,12 +2744,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2680
2744
|
}
|
|
2681
2745
|
}
|
|
2682
2746
|
}
|
|
2683
|
-
catch (
|
|
2747
|
+
catch (e_54_1) { e_54 = { error: e_54_1 }; }
|
|
2684
2748
|
finally {
|
|
2685
2749
|
try {
|
|
2686
2750
|
if (styleCandidates_1_1 && !styleCandidates_1_1.done && (_a = styleCandidates_1.return)) _a.call(styleCandidates_1);
|
|
2687
2751
|
}
|
|
2688
|
-
finally { if (
|
|
2752
|
+
finally { if (e_54) throw e_54.error; }
|
|
2689
2753
|
}
|
|
2690
2754
|
var seriesProps = get(seriesNode, "chart:data-point-properties") ||
|
|
2691
2755
|
get(seriesNode, "chart:series-properties");
|
|
@@ -2706,31 +2770,31 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2706
2770
|
pointAttrs === null || pointAttrs === void 0 ? void 0 : pointAttrs["@_style-name"],
|
|
2707
2771
|
];
|
|
2708
2772
|
try {
|
|
2709
|
-
for (var pointStyleCandidates_1 = (
|
|
2773
|
+
for (var pointStyleCandidates_1 = (e_56 = void 0, __values(pointStyleCandidates)), pointStyleCandidates_1_1 = pointStyleCandidates_1.next(); !pointStyleCandidates_1_1.done; pointStyleCandidates_1_1 = pointStyleCandidates_1.next()) {
|
|
2710
2774
|
var candidate = pointStyleCandidates_1_1.value;
|
|
2711
2775
|
var color = styles.getChartStyleColor(candidate);
|
|
2712
2776
|
if (color)
|
|
2713
2777
|
return typeof color === "string" ? color : undefined;
|
|
2714
2778
|
}
|
|
2715
2779
|
}
|
|
2716
|
-
catch (
|
|
2780
|
+
catch (e_56_1) { e_56 = { error: e_56_1 }; }
|
|
2717
2781
|
finally {
|
|
2718
2782
|
try {
|
|
2719
2783
|
if (pointStyleCandidates_1_1 && !pointStyleCandidates_1_1.done && (_c = pointStyleCandidates_1.return)) _c.call(pointStyleCandidates_1);
|
|
2720
2784
|
}
|
|
2721
|
-
finally { if (
|
|
2785
|
+
finally { if (e_56) throw e_56.error; }
|
|
2722
2786
|
}
|
|
2723
2787
|
var pointColor = this.extractColorFromChartProperties(get(dataPoint, "chart:data-point-properties") || dataPoint);
|
|
2724
2788
|
if (pointColor)
|
|
2725
2789
|
return pointColor;
|
|
2726
2790
|
}
|
|
2727
2791
|
}
|
|
2728
|
-
catch (
|
|
2792
|
+
catch (e_55_1) { e_55 = { error: e_55_1 }; }
|
|
2729
2793
|
finally {
|
|
2730
2794
|
try {
|
|
2731
2795
|
if (dataPoints_1_1 && !dataPoints_1_1.done && (_b = dataPoints_1.return)) _b.call(dataPoints_1);
|
|
2732
2796
|
}
|
|
2733
|
-
finally { if (
|
|
2797
|
+
finally { if (e_55) throw e_55.error; }
|
|
2734
2798
|
}
|
|
2735
2799
|
return undefined;
|
|
2736
2800
|
};
|
|
@@ -2760,6 +2824,10 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2760
2824
|
if (normalized.includes("line") || normalized.includes("scatter")) {
|
|
2761
2825
|
return "line";
|
|
2762
2826
|
}
|
|
2827
|
+
// `chart:ring` is ODF's doughnut.
|
|
2828
|
+
if (normalized.includes("ring")) {
|
|
2829
|
+
return "doughnut";
|
|
2830
|
+
}
|
|
2763
2831
|
if (normalized.includes("pie") || normalized.includes("circle")) {
|
|
2764
2832
|
return "pie";
|
|
2765
2833
|
}
|
|
@@ -2792,10 +2860,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2792
2860
|
return "PIE_3D";
|
|
2793
2861
|
case "area":
|
|
2794
2862
|
return "AREA_3D";
|
|
2863
|
+
default:
|
|
2864
|
+
return undefined;
|
|
2795
2865
|
}
|
|
2796
2866
|
};
|
|
2797
2867
|
OdsPlugin.prototype.findRangeString = function (node, skipKeys) {
|
|
2798
|
-
var
|
|
2868
|
+
var e_57, _a, e_58, _b;
|
|
2799
2869
|
if (!node)
|
|
2800
2870
|
return undefined;
|
|
2801
2871
|
var stack = [node];
|
|
@@ -2816,7 +2886,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2816
2886
|
if (typeof current === "object") {
|
|
2817
2887
|
var attrs = current[":@"] || current;
|
|
2818
2888
|
try {
|
|
2819
|
-
for (var _c = (
|
|
2889
|
+
for (var _c = (e_57 = void 0, __values(Object.entries(attrs))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2820
2890
|
var _e = __read(_d.value, 2), key = _e[0], attrValue = _e[1];
|
|
2821
2891
|
if (key.startsWith("@_") &&
|
|
2822
2892
|
typeof attrValue === "string" &&
|
|
@@ -2825,15 +2895,15 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2825
2895
|
}
|
|
2826
2896
|
}
|
|
2827
2897
|
}
|
|
2828
|
-
catch (
|
|
2898
|
+
catch (e_57_1) { e_57 = { error: e_57_1 }; }
|
|
2829
2899
|
finally {
|
|
2830
2900
|
try {
|
|
2831
2901
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2832
2902
|
}
|
|
2833
|
-
finally { if (
|
|
2903
|
+
finally { if (e_57) throw e_57.error; }
|
|
2834
2904
|
}
|
|
2835
2905
|
try {
|
|
2836
|
-
for (var _f = (
|
|
2906
|
+
for (var _f = (e_58 = void 0, __values(Object.entries(current))), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
2837
2907
|
var _h = __read(_g.value, 2), childKey = _h[0], childValue = _h[1];
|
|
2838
2908
|
if (childKey === ":@")
|
|
2839
2909
|
continue;
|
|
@@ -2842,12 +2912,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2842
2912
|
stack.push(childValue);
|
|
2843
2913
|
}
|
|
2844
2914
|
}
|
|
2845
|
-
catch (
|
|
2915
|
+
catch (e_58_1) { e_58 = { error: e_58_1 }; }
|
|
2846
2916
|
finally {
|
|
2847
2917
|
try {
|
|
2848
2918
|
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
2849
2919
|
}
|
|
2850
|
-
finally { if (
|
|
2920
|
+
finally { if (e_58) throw e_58.error; }
|
|
2851
2921
|
}
|
|
2852
2922
|
}
|
|
2853
2923
|
}
|
|
@@ -2880,6 +2950,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2880
2950
|
};
|
|
2881
2951
|
};
|
|
2882
2952
|
OdsPlugin.prototype.buildOverlayPlacement = function (frameAttrs, cellAttrs, rowIndex, columnIndex) {
|
|
2953
|
+
var _a, _b, _c;
|
|
2883
2954
|
var widthPixels = this.convertLengthToPixels((frameAttrs === null || frameAttrs === void 0 ? void 0 : frameAttrs["@_svg:width"]) ||
|
|
2884
2955
|
(frameAttrs === null || frameAttrs === void 0 ? void 0 : frameAttrs["@_width"]) ||
|
|
2885
2956
|
(cellAttrs === null || cellAttrs === void 0 ? void 0 : cellAttrs["@_svg:width"]) ||
|
|
@@ -2911,6 +2982,26 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
2911
2982
|
if (typeof offsetYPixels === "number") {
|
|
2912
2983
|
overlayPosition.offsetYPixels = offsetYPixels;
|
|
2913
2984
|
}
|
|
2985
|
+
// `table:end-cell-address` (+ end-x / end-y) is ODS's "Move and size with
|
|
2986
|
+
// cells" second anchor — kept as `toCell` so the frame follows the cells
|
|
2987
|
+
// between the corners (#668 C-06). A frame without one keeps its pixel size.
|
|
2988
|
+
var endAttr = function (name) {
|
|
2989
|
+
return (frameAttrs === null || frameAttrs === void 0 ? void 0 : frameAttrs["@_table:".concat(name)]) ||
|
|
2990
|
+
(frameAttrs === null || frameAttrs === void 0 ? void 0 : frameAttrs["@_".concat(name)]) ||
|
|
2991
|
+
(cellAttrs === null || cellAttrs === void 0 ? void 0 : cellAttrs["@_table:".concat(name)]) ||
|
|
2992
|
+
(cellAttrs === null || cellAttrs === void 0 ? void 0 : cellAttrs["@_".concat(name)]);
|
|
2993
|
+
};
|
|
2994
|
+
var endCellAddress = endAttr("end-cell-address");
|
|
2995
|
+
if (endCellAddress) {
|
|
2996
|
+
var toCell = addressToCell(((_a = endCellAddress.split(".").pop()) !== null && _a !== void 0 ? _a : endCellAddress).toUpperCase());
|
|
2997
|
+
if (toCell) {
|
|
2998
|
+
overlayPosition.toCell = toCell;
|
|
2999
|
+
overlayPosition.toOffsetXPixels =
|
|
3000
|
+
(_b = this.convertLengthToPixels(endAttr("end-x"))) !== null && _b !== void 0 ? _b : 0;
|
|
3001
|
+
overlayPosition.toOffsetYPixels =
|
|
3002
|
+
(_c = this.convertLengthToPixels(endAttr("end-y"))) !== null && _c !== void 0 ? _c : 0;
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
2914
3005
|
var DEFAULT_CELL_IMAGE_MAX_SIZE = 60;
|
|
2915
3006
|
var exceedsCellSize = (typeof widthPixels === "number" &&
|
|
2916
3007
|
widthPixels > DEFAULT_CELL_IMAGE_MAX_SIZE) ||
|
|
@@ -3051,7 +3142,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3051
3142
|
return undefined;
|
|
3052
3143
|
};
|
|
3053
3144
|
OdsPlugin.prototype.buildSheetNameMap = function (sheetContexts) {
|
|
3054
|
-
var
|
|
3145
|
+
var e_59, _a;
|
|
3055
3146
|
var map = new Map();
|
|
3056
3147
|
try {
|
|
3057
3148
|
for (var sheetContexts_5 = __values(sheetContexts), sheetContexts_5_1 = sheetContexts_5.next(); !sheetContexts_5_1.done; sheetContexts_5_1 = sheetContexts_5.next()) {
|
|
@@ -3059,12 +3150,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3059
3150
|
this.registerSheetNameVariants(map, context.name, context.sheetId);
|
|
3060
3151
|
}
|
|
3061
3152
|
}
|
|
3062
|
-
catch (
|
|
3153
|
+
catch (e_59_1) { e_59 = { error: e_59_1 }; }
|
|
3063
3154
|
finally {
|
|
3064
3155
|
try {
|
|
3065
3156
|
if (sheetContexts_5_1 && !sheetContexts_5_1.done && (_a = sheetContexts_5.return)) _a.call(sheetContexts_5);
|
|
3066
3157
|
}
|
|
3067
|
-
finally { if (
|
|
3158
|
+
finally { if (e_59) throw e_59.error; }
|
|
3068
3159
|
}
|
|
3069
3160
|
return map;
|
|
3070
3161
|
};
|
|
@@ -3090,7 +3181,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3090
3181
|
return normalized;
|
|
3091
3182
|
};
|
|
3092
3183
|
OdsPlugin.prototype.parseRangeList = function (addresses, sheetNameMap, context) {
|
|
3093
|
-
var
|
|
3184
|
+
var e_60, _a;
|
|
3094
3185
|
if (!addresses)
|
|
3095
3186
|
return [];
|
|
3096
3187
|
var segments = this.splitAddressSegments(addresses);
|
|
@@ -3104,12 +3195,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3104
3195
|
}
|
|
3105
3196
|
}
|
|
3106
3197
|
}
|
|
3107
|
-
catch (
|
|
3198
|
+
catch (e_60_1) { e_60 = { error: e_60_1 }; }
|
|
3108
3199
|
finally {
|
|
3109
3200
|
try {
|
|
3110
3201
|
if (segments_1_1 && !segments_1_1.done && (_a = segments_1.return)) _a.call(segments_1);
|
|
3111
3202
|
}
|
|
3112
|
-
finally { if (
|
|
3203
|
+
finally { if (e_60) throw e_60.error; }
|
|
3113
3204
|
}
|
|
3114
3205
|
return ranges;
|
|
3115
3206
|
};
|
|
@@ -3250,7 +3341,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3250
3341
|
return Array.isArray(value) ? value : [value];
|
|
3251
3342
|
};
|
|
3252
3343
|
OdsPlugin.prototype.expandRowCells = function (rowChildren) {
|
|
3253
|
-
var
|
|
3344
|
+
var e_61, _a;
|
|
3254
3345
|
if (!rowChildren) {
|
|
3255
3346
|
return [];
|
|
3256
3347
|
}
|
|
@@ -3271,12 +3362,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3271
3362
|
}
|
|
3272
3363
|
}
|
|
3273
3364
|
}
|
|
3274
|
-
catch (
|
|
3365
|
+
catch (e_61_1) { e_61 = { error: e_61_1 }; }
|
|
3275
3366
|
finally {
|
|
3276
3367
|
try {
|
|
3277
3368
|
if (entries_2_1 && !entries_2_1.done && (_a = entries_2.return)) _a.call(entries_2);
|
|
3278
3369
|
}
|
|
3279
|
-
finally { if (
|
|
3370
|
+
finally { if (e_61) throw e_61.error; }
|
|
3280
3371
|
}
|
|
3281
3372
|
return normalized;
|
|
3282
3373
|
};
|
|
@@ -3293,7 +3384,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3293
3384
|
return wrapper;
|
|
3294
3385
|
};
|
|
3295
3386
|
OdsPlugin.prototype.extractAttributesFromNode = function (node) {
|
|
3296
|
-
var
|
|
3387
|
+
var e_62, _a, _b;
|
|
3297
3388
|
var attributes = {};
|
|
3298
3389
|
var childNodes = [];
|
|
3299
3390
|
if (node === undefined || node === null) {
|
|
@@ -3319,12 +3410,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3319
3410
|
childNodes.push((_b = {}, _b[key] = value, _b));
|
|
3320
3411
|
}
|
|
3321
3412
|
}
|
|
3322
|
-
catch (
|
|
3413
|
+
catch (e_62_1) { e_62 = { error: e_62_1 }; }
|
|
3323
3414
|
finally {
|
|
3324
3415
|
try {
|
|
3325
3416
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3326
3417
|
}
|
|
3327
|
-
finally { if (
|
|
3418
|
+
finally { if (e_62) throw e_62.error; }
|
|
3328
3419
|
}
|
|
3329
3420
|
return { attributes: attributes, childNodes: childNodes };
|
|
3330
3421
|
};
|
|
@@ -3401,7 +3492,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3401
3492
|
return this.ensureSheetCache().namedRanges;
|
|
3402
3493
|
};
|
|
3403
3494
|
OdsPlugin.prototype.findCalculationSettings = function (node) {
|
|
3404
|
-
var
|
|
3495
|
+
var e_63, _a;
|
|
3405
3496
|
if (!node)
|
|
3406
3497
|
return undefined;
|
|
3407
3498
|
if (Array.isArray(node)) {
|
|
@@ -3413,12 +3504,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3413
3504
|
return found;
|
|
3414
3505
|
}
|
|
3415
3506
|
}
|
|
3416
|
-
catch (
|
|
3507
|
+
catch (e_63_1) { e_63 = { error: e_63_1 }; }
|
|
3417
3508
|
finally {
|
|
3418
3509
|
try {
|
|
3419
3510
|
if (node_2_1 && !node_2_1.done && (_a = node_2.return)) _a.call(node_2);
|
|
3420
3511
|
}
|
|
3421
|
-
finally { if (
|
|
3512
|
+
finally { if (e_63) throw e_63.error; }
|
|
3422
3513
|
}
|
|
3423
3514
|
return undefined;
|
|
3424
3515
|
}
|
|
@@ -3469,8 +3560,8 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3469
3560
|
};
|
|
3470
3561
|
OdsPlugin.prototype.processSheetData = function () {
|
|
3471
3562
|
return __asyncGenerator(this, arguments, function processSheetData_1(chunkSize, enableCellXfsRegistry, enableSharedStrings) {
|
|
3472
|
-
var docContent, body, spreadsheet, tables, totalSheets, currentSheetIndex, tableWrapper, tableNameKey, tableChildren, tableAttrs, name_4, sheetId, tableStyleName, tableCellFormat, rows, columnWrappers, columnFormats, formattedColumnIndex, columnWrappers_1, columnWrappers_1_1, columnWrapper, columnAttrs, colsRepeated, columnStyleName, columnStyle, columnCellFormat, col, chunkIndex, currentChunk, currentChunkRowIndices, currentRowIndex, dvStamper, _a, rows_4, rows_4_1, rowWrapper, rowNameKey, rowChildren, rowAttrs, rowsRepeated, rowStyleName, rowStyle, rowCellFormat, rowBaseFormat, effectiveRepeats, r, rowData, columnIndex, normalizedRowChildren, normalizedRowChildren_3, normalizedRowChildren_3_1, cellWrapper, isCell, isCovered, cellNameKey, cellChildren, cellAttrs, colsRepeated, valueType, cellValue, displayValue, textFormatRuns, textPWrapper, textPKey, richText, hyperlinkValue, cellData, formula, isSharedString, excelFormula, matrixCols, matrixRows, cols, rows_5, start, end, cellStyleName, cellFormat, hasCellValue, c, targetColumnIndex, mergedFormat, alignment, needsDefaultRightAlign, displaySuggestsCurrency, currencySymbol, pattern, shouldInferNumberFormat, detectionSource, _b, detectedValueType, detectedNumberFormatType, detectedPattern, shouldOverrideExistingFormat, finalCellData, styleId, sheetSparklines, rowSparklines, _c, _d, _e, colIndex, sparkline, existingCell, sparklineData, sparklineOptions, cellData, isRowEmpty,
|
|
3473
|
-
var
|
|
3563
|
+
var docContent, body, spreadsheet, tables, totalSheets, currentSheetIndex, tableWrapper, tableNameKey, tableChildren, tableAttrs, name_4, sheetId, tableStyleName, tableCellFormat, rows, columnWrappers, columnFormats, formattedColumnIndex, columnWrappers_1, columnWrappers_1_1, columnWrapper, columnAttrs, colsRepeated, columnStyleName, columnStyle, columnCellFormat, col, chunkIndex, currentChunk, currentChunkRowIndices, currentRowIndex, dvStamper, _a, rows_4, rows_4_1, rowWrapper, rowNameKey, rowChildren, rowAttrs, rowsRepeated, rowStyleName, rowStyle, rowCellFormat, rowBaseFormat, effectiveRepeats, r, rowData, columnIndex, normalizedRowChildren, normalizedRowChildren_3, normalizedRowChildren_3_1, cellWrapper, isCell, isCovered, cellNameKey, cellChildren, cellAttrs, colsRepeated, valueType, cellValue, displayValue, textFormatRuns, textPWrapper, textPKey, richText, hyperlinkValue, cellData, formula, isSharedString, excelFormula, matrixCols, matrixRows, cols, rows_5, start, end, cellStyleName, cellFormat, hasCellValue, c, targetColumnIndex, mergedFormat, alignment, needsDefaultRightAlign, displaySuggestsCurrency, currencySymbol, pattern, shouldInferNumberFormat, detectionSource, _b, detectedValueType, detectedNumberFormatType, detectedPattern, shouldOverrideExistingFormat, finalCellData, styleId, sheetSparklines, rowSparklines, _c, _d, _e, colIndex, sparkline, existingCell, sparklineData, sparklineOptions, cellData, isRowEmpty, e_64_1, _f, _g, trailing, e_65_1, error_1;
|
|
3564
|
+
var e_66, _h, e_64, _j, e_67, _k, e_68, _l, e_65, _m;
|
|
3474
3565
|
var _o, _p, _q, _r;
|
|
3475
3566
|
if (chunkSize === void 0) { chunkSize = 100; }
|
|
3476
3567
|
if (enableCellXfsRegistry === void 0) { enableCellXfsRegistry = false; }
|
|
@@ -3526,7 +3617,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3526
3617
|
columnFormats = new Map();
|
|
3527
3618
|
formattedColumnIndex = 1;
|
|
3528
3619
|
try {
|
|
3529
|
-
for (columnWrappers_1 = (
|
|
3620
|
+
for (columnWrappers_1 = (e_66 = void 0, __values(columnWrappers)), columnWrappers_1_1 = columnWrappers_1.next(); !columnWrappers_1_1.done; columnWrappers_1_1 = columnWrappers_1.next()) {
|
|
3530
3621
|
columnWrapper = columnWrappers_1_1.value;
|
|
3531
3622
|
columnAttrs = columnWrapper[":@"] || {};
|
|
3532
3623
|
colsRepeated = parseInt(columnAttrs["@_table:number-columns-repeated"] ||
|
|
@@ -3545,12 +3636,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3545
3636
|
}
|
|
3546
3637
|
}
|
|
3547
3638
|
}
|
|
3548
|
-
catch (
|
|
3639
|
+
catch (e_66_1) { e_66 = { error: e_66_1 }; }
|
|
3549
3640
|
finally {
|
|
3550
3641
|
try {
|
|
3551
3642
|
if (columnWrappers_1_1 && !columnWrappers_1_1.done && (_h = columnWrappers_1.return)) _h.call(columnWrappers_1);
|
|
3552
3643
|
}
|
|
3553
|
-
finally { if (
|
|
3644
|
+
finally { if (e_66) throw e_66.error; }
|
|
3554
3645
|
}
|
|
3555
3646
|
chunkIndex = 0;
|
|
3556
3647
|
currentChunk = [];
|
|
@@ -3563,7 +3654,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3563
3654
|
_s.label = 11;
|
|
3564
3655
|
case 11:
|
|
3565
3656
|
_s.trys.push([11, 19, 20, 21]);
|
|
3566
|
-
rows_4 = (
|
|
3657
|
+
rows_4 = (e_64 = void 0, __values(rows)), rows_4_1 = rows_4.next();
|
|
3567
3658
|
_s.label = 12;
|
|
3568
3659
|
case 12:
|
|
3569
3660
|
if (!!rows_4_1.done) return [3 /*break*/, 18];
|
|
@@ -3596,7 +3687,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3596
3687
|
: null;
|
|
3597
3688
|
if (normalizedRowChildren) {
|
|
3598
3689
|
try {
|
|
3599
|
-
for (normalizedRowChildren_3 = (
|
|
3690
|
+
for (normalizedRowChildren_3 = (e_67 = void 0, __values(normalizedRowChildren)), normalizedRowChildren_3_1 = normalizedRowChildren_3.next(); !normalizedRowChildren_3_1.done; normalizedRowChildren_3_1 = normalizedRowChildren_3.next()) {
|
|
3600
3691
|
cellWrapper = normalizedRowChildren_3_1.value;
|
|
3601
3692
|
isCell = !!cellWrapper["table:table-cell"];
|
|
3602
3693
|
isCovered = !!cellWrapper["table:covered-table-cell"];
|
|
@@ -3740,9 +3831,9 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3740
3831
|
if (valueType === "currency") {
|
|
3741
3832
|
mergedFormat = mergedFormat
|
|
3742
3833
|
? __assign({}, mergedFormat) : {};
|
|
3743
|
-
currencySymbol = cellAttrs["@_office:currency"] ||
|
|
3834
|
+
currencySymbol = odsCurrencySymbol(cellAttrs["@_office:currency"] ||
|
|
3744
3835
|
cellAttrs["@_currency"] ||
|
|
3745
|
-
"$";
|
|
3836
|
+
"$");
|
|
3746
3837
|
if (!mergedFormat.numberFormat ||
|
|
3747
3838
|
mergedFormat.numberFormat.type === "NUMBER") {
|
|
3748
3839
|
pattern = ((_q = mergedFormat.numberFormat) === null || _q === void 0 ? void 0 : _q.pattern) || "#,##0.00";
|
|
@@ -3750,9 +3841,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3750
3841
|
type: "CURRENCY",
|
|
3751
3842
|
pattern: pattern.includes(currencySymbol)
|
|
3752
3843
|
? pattern
|
|
3753
|
-
: "".concat(currencySymbol).concat(pattern
|
|
3754
|
-
? " "
|
|
3755
|
-
: "").concat(pattern),
|
|
3844
|
+
: "".concat(currencySymbol).concat(pattern),
|
|
3756
3845
|
};
|
|
3757
3846
|
}
|
|
3758
3847
|
}
|
|
@@ -3805,12 +3894,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3805
3894
|
}
|
|
3806
3895
|
}
|
|
3807
3896
|
}
|
|
3808
|
-
catch (
|
|
3897
|
+
catch (e_67_1) { e_67 = { error: e_67_1 }; }
|
|
3809
3898
|
finally {
|
|
3810
3899
|
try {
|
|
3811
3900
|
if (normalizedRowChildren_3_1 && !normalizedRowChildren_3_1.done && (_k = normalizedRowChildren_3.return)) _k.call(normalizedRowChildren_3);
|
|
3812
3901
|
}
|
|
3813
|
-
finally { if (
|
|
3902
|
+
finally { if (e_67) throw e_67.error; }
|
|
3814
3903
|
}
|
|
3815
3904
|
}
|
|
3816
3905
|
sheetSparklines = this.sparklinesBySheet.get(sheetId);
|
|
@@ -3818,7 +3907,7 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3818
3907
|
rowSparklines = sheetSparklines.get(currentRowIndex);
|
|
3819
3908
|
if (rowSparklines) {
|
|
3820
3909
|
try {
|
|
3821
|
-
for (_c = (
|
|
3910
|
+
for (_c = (e_68 = void 0, __values(rowSparklines.entries())), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
3822
3911
|
_e = __read(_d.value, 2), colIndex = _e[0], sparkline = _e[1];
|
|
3823
3912
|
existingCell = rowData.values[colIndex];
|
|
3824
3913
|
// Only set formula if cell doesn't already have one
|
|
@@ -3847,12 +3936,12 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3847
3936
|
rowData.values[colIndex] = cellData;
|
|
3848
3937
|
}
|
|
3849
3938
|
}
|
|
3850
|
-
catch (
|
|
3939
|
+
catch (e_68_1) { e_68 = { error: e_68_1 }; }
|
|
3851
3940
|
finally {
|
|
3852
3941
|
try {
|
|
3853
3942
|
if (_d && !_d.done && (_l = _c.return)) _l.call(_c);
|
|
3854
3943
|
}
|
|
3855
|
-
finally { if (
|
|
3944
|
+
finally { if (e_68) throw e_68.error; }
|
|
3856
3945
|
}
|
|
3857
3946
|
// Clean up processed sparklines
|
|
3858
3947
|
sheetSparklines.delete(currentRowIndex);
|
|
@@ -3901,18 +3990,18 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3901
3990
|
return [3 /*break*/, 12];
|
|
3902
3991
|
case 18: return [3 /*break*/, 21];
|
|
3903
3992
|
case 19:
|
|
3904
|
-
|
|
3905
|
-
|
|
3993
|
+
e_64_1 = _s.sent();
|
|
3994
|
+
e_64 = { error: e_64_1 };
|
|
3906
3995
|
return [3 /*break*/, 21];
|
|
3907
3996
|
case 20:
|
|
3908
3997
|
try {
|
|
3909
3998
|
if (rows_4_1 && !rows_4_1.done && (_j = rows_4.return)) _j.call(rows_4);
|
|
3910
3999
|
}
|
|
3911
|
-
finally { if (
|
|
4000
|
+
finally { if (e_64) throw e_64.error; }
|
|
3912
4001
|
return [7 /*endfinally*/];
|
|
3913
4002
|
case 21:
|
|
3914
4003
|
_s.trys.push([21, 27, 28, 29]);
|
|
3915
|
-
_f = (
|
|
4004
|
+
_f = (e_65 = void 0, __values(dvStamper.trailingRows())), _g = _f.next();
|
|
3916
4005
|
_s.label = 22;
|
|
3917
4006
|
case 22:
|
|
3918
4007
|
if (!!_g.done) return [3 /*break*/, 26];
|
|
@@ -3946,14 +4035,14 @@ var OdsPlugin = /** @class */ (function (_super) {
|
|
|
3946
4035
|
return [3 /*break*/, 22];
|
|
3947
4036
|
case 26: return [3 /*break*/, 29];
|
|
3948
4037
|
case 27:
|
|
3949
|
-
|
|
3950
|
-
|
|
4038
|
+
e_65_1 = _s.sent();
|
|
4039
|
+
e_65 = { error: e_65_1 };
|
|
3951
4040
|
return [3 /*break*/, 29];
|
|
3952
4041
|
case 28:
|
|
3953
4042
|
try {
|
|
3954
4043
|
if (_g && !_g.done && (_m = _f.return)) _m.call(_f);
|
|
3955
4044
|
}
|
|
3956
|
-
finally { if (
|
|
4045
|
+
finally { if (e_65) throw e_65.error; }
|
|
3957
4046
|
return [7 /*endfinally*/];
|
|
3958
4047
|
case 29:
|
|
3959
4048
|
if (!(currentChunk.length > 0)) return [3 /*break*/, 32];
|