ooxml-core 1.36.0 → 1.37.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/PptxHandler-2JSQ22VD.cjs +14 -0
- package/dist/{PptxHandler-XCYX5DVX.mjs → PptxHandler-3T5DTNKA.mjs} +2 -2
- package/dist/PptxHandler-7T7ZS7IK.mjs +5 -0
- package/dist/{PresentationBuilder-JBTNOIL7.mjs → PresentationBuilder-D6ZICJWN.mjs} +3 -3
- package/dist/{PresentationBuilder-HA56ZY23.cjs → PresentationBuilder-HCMXZQDK.cjs} +6 -6
- package/dist/{PresentationBuilder-IVLUEB4K.mjs → PresentationBuilder-XHKNDJMD.mjs} +2 -2
- package/dist/automation/index.cjs +21750 -19661
- package/dist/automation/index.mjs +21731 -19661
- package/dist/chart/index.cjs +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/chart/region-map/index.cjs +1 -1
- package/dist/chart/region-map/index.mjs +1 -1
- package/dist/{chunk-UQMAPY6D.mjs → chunk-2TQJHNVU.mjs} +1 -1
- package/dist/{chunk-RI56PFGL.mjs → chunk-4YBSHQ76.mjs} +5 -5
- package/dist/{chunk-XF6ZRA2D.cjs → chunk-AFALJ5TA.cjs} +3 -3
- package/dist/{chunk-MK2IBZU6.mjs → chunk-CNIKTXAV.mjs} +1 -1
- package/dist/{chunk-PA5ADSTX.cjs → chunk-GZOYXHDF.cjs} +1269 -1269
- package/dist/{chunk-LSO5SSFX.mjs → chunk-H2Q42P6P.mjs} +1 -1
- package/dist/{chunk-EGBNPVBA.mjs → chunk-J43V3QOA.mjs} +2 -2
- package/dist/{chunk-TJXK4D4U.mjs → chunk-M2DFN3SP.mjs} +4 -4
- package/dist/{chunk-RPJHMPEL.mjs → chunk-OEM2ECAJ.mjs} +1 -1
- package/dist/{chunk-GNGL4BO7.mjs → chunk-RHQQS6LJ.mjs} +4 -4
- package/dist/{chunk-A27O7M5X.cjs → chunk-SNID2FDY.cjs} +1 -1
- package/dist/{chunk-EDRS3OSM.mjs → chunk-WNAPUUAT.mjs} +1 -0
- package/dist/color/theme-palette.d.ts +1 -1
- package/dist/color/theme-palette.d.ts.map +1 -1
- package/dist/crypto/index.cjs +1 -1
- package/dist/crypto/index.mjs +1 -1
- package/dist/diagram/index.cjs +1 -1
- package/dist/diagram/index.mjs +1 -1
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/comment-parts.d.ts +33 -0
- package/dist/docx/comment-parts.d.ts.map +1 -0
- package/dist/docx/comments.d.ts +5 -2
- package/dist/docx/comments.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +15231 -14731
- package/dist/docx/embedded.mjs +15231 -14731
- package/dist/docx/glossary.d.ts.map +1 -1
- package/dist/docx/index.cjs +10771 -10329
- package/dist/docx/index.mjs +10771 -10329
- package/dist/docx/layout/index.cjs +81 -73
- package/dist/docx/layout/index.mjs +81 -73
- package/dist/docx/load/index.cjs +16891 -16391
- package/dist/docx/load/index.mjs +16891 -16391
- package/dist/docx/page-background.d.ts +4 -3
- package/dist/docx/page-background.d.ts.map +1 -1
- package/dist/docx/paragraph-text.d.ts +5 -0
- package/dist/docx/paragraph-text.d.ts.map +1 -0
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/special-characters.d.ts +2 -0
- package/dist/docx/special-characters.d.ts.map +1 -1
- package/dist/docx/theme-color.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +135 -135
- package/dist/docx/ui/index.mjs +135 -135
- package/dist/docx/write-comment-identities.d.ts +8 -0
- package/dist/docx/write-comment-identities.d.ts.map +1 -0
- package/dist/docx/write-comment-metadata.d.ts +12 -0
- package/dist/docx/write-comment-metadata.d.ts.map +1 -0
- package/dist/docx/write-comment-text.d.ts +3 -0
- package/dist/docx/write-comment-text.d.ts.map +1 -0
- package/dist/docx/write-comments.d.ts +1 -4
- package/dist/docx/write-comments.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +1 -1
- package/dist/drawingml/index.mjs +1 -1
- package/dist/index.cjs +110 -6
- package/dist/index.mjs +91 -6
- package/dist/math/index.cjs +1 -1
- package/dist/math/index.mjs +1 -1
- package/dist/opc/index.cjs +78 -3
- package/dist/opc/index.mjs +78 -3
- package/dist/opc/signature/index.d.ts +1 -0
- package/dist/opc/signature/index.d.ts.map +1 -1
- package/dist/opc/signature/package.d.ts +12 -0
- package/dist/opc/signature/package.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +21 -4
- package/dist/pptx/automation/index.d.ts +1 -0
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +16 -6
- package/dist/pptx/automation/schemas/index.cjs +1 -0
- package/dist/pptx/automation/schemas/index.mjs +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.cjs +1 -0
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -0
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.mjs +1 -1
- package/dist/pptx/cli/index.cjs +10 -4
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +7 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/index.cjs +10 -4
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/ui/index.d.ts +1 -1
- package/dist/teams/index.cjs +812 -95
- package/dist/teams/index.mjs +811 -95
- package/dist/visio/bevel-3d.d.ts +6 -10
- package/dist/visio/bevel-3d.d.ts.map +1 -1
- package/dist/visio/bevel-shading.d.ts +72 -0
- package/dist/visio/bevel-shading.d.ts.map +1 -0
- package/dist/visio/cff-recalc.d.ts.map +1 -1
- package/dist/visio/collab/index.cjs +1 -1
- package/dist/visio/collab/index.mjs +1 -1
- package/dist/visio/data-graphic-instance.d.ts +44 -0
- package/dist/visio/data-graphic-instance.d.ts.map +1 -0
- package/dist/visio/data-graphic-masters.d.ts +38 -0
- package/dist/visio/data-graphic-masters.d.ts.map +1 -0
- package/dist/visio/data-graphic-place.d.ts +34 -0
- package/dist/visio/data-graphic-place.d.ts.map +1 -0
- package/dist/visio/edit-commands.d.ts +3 -1
- package/dist/visio/edit-commands.d.ts.map +1 -1
- package/dist/visio/edit-data-graphic-guard.d.ts +13 -0
- package/dist/visio/edit-data-graphic-guard.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic-owner.d.ts +9 -0
- package/dist/visio/edit-data-graphic-owner.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic-refresh.d.ts +14 -0
- package/dist/visio/edit-data-graphic-refresh.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic.d.ts +33 -0
- package/dist/visio/edit-data-graphic.d.ts.map +1 -0
- package/dist/visio/edit-formatting-text-commands.d.ts +8 -0
- package/dist/visio/edit-formatting-text-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-text-extra.d.ts +14 -0
- package/dist/visio/edit-formatting-text-extra.d.ts.map +1 -1
- package/dist/visio/edit-formatting-text.d.ts.map +1 -1
- package/dist/visio/edit-formatting.d.ts.map +1 -1
- package/dist/visio/edit-shape-data.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-cff.d.ts +28 -0
- package/dist/visio/edit-swimlane-cff.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-clone.d.ts +8 -4
- package/dist/visio/edit-swimlane-clone.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-layout.d.ts +6 -1
- package/dist/visio/edit-swimlane-layout.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-ops.d.ts.map +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/formula-analyze.d.ts.map +1 -1
- package/dist/visio/formula-evaluate.d.ts.map +1 -1
- package/dist/visio/formula.d.ts.map +1 -1
- package/dist/visio/index.cjs +2980 -1707
- package/dist/visio/index.d.ts +2 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +2971 -1708
- package/dist/visio/master-list.d.ts +3 -3
- package/dist/visio/master-list.d.ts.map +1 -1
- package/dist/visio/model.d.ts +6 -1
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/rotation-presets.d.ts +25 -0
- package/dist/visio/rotation-presets.d.ts.map +1 -0
- package/dist/visio/shape-structure.d.ts.map +1 -1
- package/dist/visio/shapes.d.ts +2 -0
- package/dist/visio/shapes.d.ts.map +1 -1
- package/dist/visio/solid-3d.d.ts +9 -0
- package/dist/visio/solid-3d.d.ts.map +1 -1
- package/dist/visio/style.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-config.d.ts +4 -19
- package/dist/visio/ui/data-graphic-config.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-items.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-native.d.ts +20 -0
- package/dist/visio/ui/data-graphic-native.d.ts.map +1 -0
- package/dist/visio/ui/data-graphics.d.ts.map +1 -1
- package/dist/visio/ui/edit-commands.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +3130 -1821
- package/dist/visio/ui/index.mjs +3128 -1822
- package/dist/visio/ui/org-chart-belt.d.ts.map +1 -1
- package/dist/visio/ui/scene-validation.d.ts.map +1 -1
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
- package/dist/visio/ui/swimlane.d.ts.map +1 -1
- package/dist/visio/ui/text-dialog.d.ts +12 -0
- package/dist/visio/ui/text-dialog.d.ts.map +1 -1
- package/dist/xlsx/collab/index.cjs +45 -2
- package/dist/xlsx/collab/index.mjs +45 -2
- package/dist/xlsx/collab/part-specs.d.ts.map +1 -1
- package/dist/xlsx/collab/sheets.d.ts +1 -0
- package/dist/xlsx/collab/sheets.d.ts.map +1 -1
- package/dist/xlsx/edit/annotations.d.ts +4 -0
- package/dist/xlsx/edit/annotations.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-annotations.d.ts.map +1 -1
- package/dist/xlsx/edit/comment-identities.d.ts +4 -0
- package/dist/xlsx/edit/comment-identities.d.ts.map +1 -0
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/sheets.d.ts.map +1 -1
- package/dist/xlsx/edit/types.d.ts +3 -0
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/filterxml.d.ts +2 -0
- package/dist/xlsx/formula/functions/filterxml.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/registry.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +1007 -285
- package/dist/xlsx/index.mjs +988 -285
- package/dist/xlsx/layout/split.d.ts +3 -1
- package/dist/xlsx/layout/split.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +809 -126
- package/dist/xlsx/load/index.mjs +790 -126
- package/dist/xlsx/model.d.ts +19 -7
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/read/comments.d.ts +3 -1
- package/dist/xlsx/read/comments.d.ts.map +1 -1
- package/dist/xlsx/read/conditional.d.ts +2 -2
- package/dist/xlsx/read/conditional.d.ts.map +1 -1
- package/dist/xlsx/read/data-validations.d.ts +7 -0
- package/dist/xlsx/read/data-validations.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/messages.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/grid/geometry.d.ts +3 -0
- package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +952 -168
- package/dist/xlsx/ui/index.mjs +933 -169
- package/dist/xlsx/ui/selection.d.ts +3 -0
- package/dist/xlsx/ui/selection.d.ts.map +1 -1
- package/dist/xlsx/validation-extensions.d.ts +6 -0
- package/dist/xlsx/validation-extensions.d.ts.map +1 -0
- package/dist/xlsx/write/comment-ids.d.ts +14 -0
- package/dist/xlsx/write/comment-ids.d.ts.map +1 -0
- package/dist/xlsx/write/comment-mentions.d.ts +6 -0
- package/dist/xlsx/write/comment-mentions.d.ts.map +1 -0
- package/dist/xlsx/write/comment-persons.d.ts +16 -0
- package/dist/xlsx/write/comment-persons.d.ts.map +1 -0
- package/dist/xlsx/write/comments.d.ts +5 -11
- package/dist/xlsx/write/comments.d.ts.map +1 -1
- package/dist/xlsx/write/conditional.d.ts +2 -2
- package/dist/xlsx/write/conditional.d.ts.map +1 -1
- package/dist/xlsx/write/data-validations.d.ts +6 -0
- package/dist/xlsx/write/data-validations.d.ts.map +1 -0
- package/dist/xlsx/write/save.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-parts.d.ts +4 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/threaded-comments.d.ts +19 -0
- package/dist/xlsx/write/threaded-comments.d.ts.map +1 -0
- package/dist/xlsx/write/worksheet.d.ts.map +1 -1
- package/dist/xml/index.cjs +31 -1
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/index.mjs +11 -2
- package/dist/xml/xml.d.ts +2 -0
- package/dist/xml/xml.d.ts.map +1 -1
- package/dist/xml/xpath.d.ts +9 -0
- package/dist/xml/xpath.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/PptxHandler-5UDSMCBG.cjs +0 -14
- package/dist/PptxHandler-TTRTAQAR.mjs +0 -5
package/dist/xlsx/ui/index.cjs
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var xmldom = require('@xmldom/xmldom');
|
|
4
|
+
var xpath = require('xpath');
|
|
4
5
|
var JSZip2 = require('jszip');
|
|
5
6
|
var fflate = require('fflate');
|
|
6
7
|
|
|
7
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
9
|
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var xpath__namespace = /*#__PURE__*/_interopNamespace(xpath);
|
|
9
29
|
var JSZip2__default = /*#__PURE__*/_interopDefault(JSZip2);
|
|
10
30
|
|
|
11
31
|
var __defProp = Object.defineProperty;
|
|
@@ -1795,7 +1815,7 @@ function parseXml(xml, options7 = {}) {
|
|
|
1795
1815
|
try {
|
|
1796
1816
|
parsed = new xmldom.DOMParser({
|
|
1797
1817
|
onError: (level4, message) => {
|
|
1798
|
-
if (level4 !== "warning") parseError = message;
|
|
1818
|
+
if (level4 !== "warning" || options7.warningsAsErrors) parseError = message;
|
|
1799
1819
|
}
|
|
1800
1820
|
}).parseFromString(xml, "application/xml");
|
|
1801
1821
|
} catch (error) {
|
|
@@ -2033,6 +2053,14 @@ function startTag(source3, from, namespaces) {
|
|
|
2033
2053
|
if (i2 < n2 && !isSpace2(after) && after !== 62 && after !== 47) return void 0;
|
|
2034
2054
|
}
|
|
2035
2055
|
}
|
|
2056
|
+
var compiler = xpath__namespace;
|
|
2057
|
+
function selectXmlNodes(expression, node2, options7 = {}) {
|
|
2058
|
+
return compiler.parse(expression).select({
|
|
2059
|
+
node: node2,
|
|
2060
|
+
...options7.namespaces ? { namespaces: options7.namespaces } : {},
|
|
2061
|
+
allowAnyNamespaceForNoPrefix: options7.matchDefaultNamespace ?? false
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2036
2064
|
|
|
2037
2065
|
// color/color-primitives.ts
|
|
2038
2066
|
function clampUnitInterval(value3) {
|
|
@@ -18260,6 +18288,83 @@ var TEXT_EXTRA_FUNCTIONS = [
|
|
|
18260
18288
|
)
|
|
18261
18289
|
];
|
|
18262
18290
|
|
|
18291
|
+
// xlsx/formula/functions/filterxml.ts
|
|
18292
|
+
var XML = "http://www.w3.org/XML/1998/namespace";
|
|
18293
|
+
var XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
18294
|
+
function preservesSpace(node2) {
|
|
18295
|
+
for (let current = node2; current; current = current.parentNode) {
|
|
18296
|
+
if (current.nodeType !== 1) continue;
|
|
18297
|
+
const value3 = current.getAttributeNS(XML, "space");
|
|
18298
|
+
if (value3) return value3 === "preserve";
|
|
18299
|
+
}
|
|
18300
|
+
return false;
|
|
18301
|
+
}
|
|
18302
|
+
function prepare(root) {
|
|
18303
|
+
const namespaces = /* @__PURE__ */ Object.create(null);
|
|
18304
|
+
const visit2 = (element3) => {
|
|
18305
|
+
for (const attr3 of Array.from(element3.attributes)) {
|
|
18306
|
+
if (attr3.namespaceURI !== XMLNS || attr3.localName === "xmlns") continue;
|
|
18307
|
+
const prior = namespaces[attr3.localName];
|
|
18308
|
+
if (prior !== void 0 && prior !== attr3.value) throw new Error("Conflicting namespaces");
|
|
18309
|
+
namespaces[attr3.localName] = attr3.value;
|
|
18310
|
+
}
|
|
18311
|
+
for (const child6 of Array.from(element3.childNodes)) {
|
|
18312
|
+
if (child6.nodeType === 1) visit2(child6);
|
|
18313
|
+
else if (child6.nodeType === 3 && !child6.nodeValue?.trim() && !preservesSpace(element3))
|
|
18314
|
+
element3.removeChild(child6);
|
|
18315
|
+
}
|
|
18316
|
+
};
|
|
18317
|
+
visit2(root);
|
|
18318
|
+
return namespaces;
|
|
18319
|
+
}
|
|
18320
|
+
function nodeValue(node2) {
|
|
18321
|
+
let text3;
|
|
18322
|
+
if (node2.nodeType === 2) text3 = (node2.nodeValue ?? "").trim();
|
|
18323
|
+
else if (node2.nodeType === 1) {
|
|
18324
|
+
const preserve = preservesSpace(node2);
|
|
18325
|
+
text3 = Array.from(node2.childNodes).filter((child6) => child6.nodeType === 3 || child6.nodeType === 4).map((child6) => {
|
|
18326
|
+
const value3 = child6.nodeValue ?? "";
|
|
18327
|
+
return preserve || child6.nodeType === 4 ? value3 : value3.trim();
|
|
18328
|
+
}).join("");
|
|
18329
|
+
} else return ERR.VALUE;
|
|
18330
|
+
if (!text3) return ERR.VALUE;
|
|
18331
|
+
if (/^(true|false)$/i.test(text3)) return text3.toLowerCase() === "true";
|
|
18332
|
+
const date = /^(\d{1,4})[-/](\d{1,2})[-/](\d{1,4})(.*)$/.exec(text3.trim());
|
|
18333
|
+
let numberText = text3;
|
|
18334
|
+
if (date) {
|
|
18335
|
+
let year = Number(date[1]);
|
|
18336
|
+
if (year < 100) year += year < 30 ? 2e3 : 1900;
|
|
18337
|
+
numberText = `${year}-${date[2]}-${date[3]}${date[4]?.replace(/^T/, " ") ?? ""}`;
|
|
18338
|
+
}
|
|
18339
|
+
return parseNumberText(numberText) ?? text3;
|
|
18340
|
+
}
|
|
18341
|
+
var FILTERXML = spec(
|
|
18342
|
+
"FILTERXML",
|
|
18343
|
+
"Web",
|
|
18344
|
+
"FILTERXML(xml, xpath)",
|
|
18345
|
+
"Returns XML element or attribute values selected by XPath, as a column.",
|
|
18346
|
+
2,
|
|
18347
|
+
2,
|
|
18348
|
+
(args) => {
|
|
18349
|
+
const xml = str(args[0]);
|
|
18350
|
+
const expression = str(args[1]);
|
|
18351
|
+
if (xml.length > 32767 || expression.length > 32767) return ERR.VALUE;
|
|
18352
|
+
let nodes;
|
|
18353
|
+
try {
|
|
18354
|
+
const doc = parseXml(xml, { warningsAsErrors: true, label: "FILTERXML" });
|
|
18355
|
+
nodes = selectXmlNodes(expression, doc, {
|
|
18356
|
+
namespaces: prepare(doc.documentElement),
|
|
18357
|
+
matchDefaultNamespace: true
|
|
18358
|
+
});
|
|
18359
|
+
} catch {
|
|
18360
|
+
return ERR.VALUE;
|
|
18361
|
+
}
|
|
18362
|
+
if (!nodes.length) return ERR.VALUE;
|
|
18363
|
+
chargeArrayCells(nodes.length);
|
|
18364
|
+
return new Matrix(nodes.map((node2) => [nodeValue(node2)]));
|
|
18365
|
+
}
|
|
18366
|
+
);
|
|
18367
|
+
|
|
18263
18368
|
// xlsx/formula/functions/registry.ts
|
|
18264
18369
|
var ALL = [
|
|
18265
18370
|
...MATH_FUNCTIONS,
|
|
@@ -18269,6 +18374,7 @@ var ALL = [
|
|
|
18269
18374
|
...LOGICAL_FUNCTIONS,
|
|
18270
18375
|
...TEXT_FUNCTIONS,
|
|
18271
18376
|
...TEXT_EXTRA_FUNCTIONS,
|
|
18377
|
+
FILTERXML,
|
|
18272
18378
|
BAHTTEXT,
|
|
18273
18379
|
GETPIVOTDATA,
|
|
18274
18380
|
...GROUPBY_FUNCTIONS,
|
|
@@ -20810,7 +20916,7 @@ var PROPERTY_CONTENT_TYPES = {
|
|
|
20810
20916
|
};
|
|
20811
20917
|
|
|
20812
20918
|
// opc/properties/patch.ts
|
|
20813
|
-
var
|
|
20919
|
+
var XMLNS2 = "http://www.w3.org/2000/xmlns/";
|
|
20814
20920
|
function tagEnd(xml, from) {
|
|
20815
20921
|
let quote2 = "";
|
|
20816
20922
|
for (let i2 = from + 1; i2 < xml.length; i2++) {
|
|
@@ -20892,7 +20998,7 @@ var PartPatch = class {
|
|
|
20892
20998
|
this.root = root;
|
|
20893
20999
|
for (const attribute2 of Array.from(rootElement.attributes)) {
|
|
20894
21000
|
if (attribute2.name === "xmlns") this.defaultNs = attribute2.value;
|
|
20895
|
-
else if (attribute2.namespaceURI ===
|
|
21001
|
+
else if (attribute2.namespaceURI === XMLNS2 || attribute2.name.startsWith("xmlns:"))
|
|
20896
21002
|
this.prefixes.set(attribute2.value, attribute2.localName);
|
|
20897
21003
|
}
|
|
20898
21004
|
}
|
|
@@ -22735,31 +22841,90 @@ function parsePersons(xml) {
|
|
|
22735
22841
|
}
|
|
22736
22842
|
return persons;
|
|
22737
22843
|
}
|
|
22738
|
-
function parseThreadedComments(xml, persons) {
|
|
22844
|
+
function parseThreadedComments(xml, persons, personsXml) {
|
|
22739
22845
|
if (!xml) return [];
|
|
22740
22846
|
const root = parseXml(xml, { label: "XLSX threaded comments" }).documentElement;
|
|
22741
22847
|
const roots = /* @__PURE__ */ new Map();
|
|
22848
|
+
const personNames = new Map([...persons].map(([id, name]) => [id.toUpperCase(), name]));
|
|
22742
22849
|
const order = [];
|
|
22743
|
-
|
|
22744
|
-
|
|
22850
|
+
const nodes = children(root, "threadedComment", NS.tc);
|
|
22851
|
+
const byId2 = new Map(nodes.map((node2) => [(att(node2, "id") ?? "").toUpperCase(), node2]));
|
|
22852
|
+
const parentRoot = (parent) => {
|
|
22853
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22854
|
+
while (parent) {
|
|
22855
|
+
parent = parent.toUpperCase();
|
|
22856
|
+
if (seen.has(parent)) break;
|
|
22857
|
+
if (roots.has(parent)) return roots.get(parent);
|
|
22858
|
+
seen.add(parent);
|
|
22859
|
+
parent = att(byId2.get(parent), "parentId");
|
|
22860
|
+
}
|
|
22861
|
+
return void 0;
|
|
22862
|
+
};
|
|
22863
|
+
for (const node2 of [
|
|
22864
|
+
...nodes.filter((n2) => !att(n2, "parentId")),
|
|
22865
|
+
...nodes.filter((n2) => att(n2, "parentId"))
|
|
22866
|
+
]) {
|
|
22867
|
+
const parentComment = parentRoot(att(node2, "parentId"));
|
|
22868
|
+
const address2 = parseAddress(att(node2, "ref") ?? "") ?? parentComment?.address;
|
|
22745
22869
|
if (!address2) continue;
|
|
22746
|
-
const author =
|
|
22870
|
+
const author = personNames.get((att(node2, "personId") ?? "").toUpperCase()) ?? "";
|
|
22747
22871
|
const text3 = xText(children(node2, "text", NS.tc)[0]);
|
|
22748
22872
|
const date = att(node2, "dT");
|
|
22749
|
-
const parent = att(node2, "parentId");
|
|
22750
|
-
const parentComment = parent ? roots.get(parent) : void 0;
|
|
22751
22873
|
if (parentComment) {
|
|
22752
|
-
const reply = { author, text: text3 };
|
|
22874
|
+
const reply = { author, text: text3, threadedXml: selfContainedXml(node2) };
|
|
22753
22875
|
if (date) reply.date = date;
|
|
22754
22876
|
(parentComment.replies ??= []).push(reply);
|
|
22755
22877
|
continue;
|
|
22756
22878
|
}
|
|
22757
|
-
const comment = {
|
|
22758
|
-
|
|
22879
|
+
const comment = {
|
|
22880
|
+
address: address2,
|
|
22881
|
+
author,
|
|
22882
|
+
text: text3,
|
|
22883
|
+
replies: [],
|
|
22884
|
+
threadedXml: selfContainedXml(node2)
|
|
22885
|
+
};
|
|
22886
|
+
if (date) comment.date = date;
|
|
22887
|
+
const resolved = boolAttr(node2, "done");
|
|
22888
|
+
if (resolved !== void 0) comment.resolved = resolved;
|
|
22889
|
+
roots.set((att(node2, "id") ?? `${order.length}`).toUpperCase(), comment);
|
|
22759
22890
|
order.push(comment);
|
|
22760
22891
|
}
|
|
22892
|
+
for (const comment of order)
|
|
22893
|
+
comment.replies?.sort((a2, b) => {
|
|
22894
|
+
const aDate = a2.date ? Date.parse(a2.date) : NaN;
|
|
22895
|
+
const bDate = b.date ? Date.parse(b.date) : NaN;
|
|
22896
|
+
return Number.isFinite(aDate) && Number.isFinite(bDate) ? aDate - bDate : 0;
|
|
22897
|
+
});
|
|
22898
|
+
if (personsXml) {
|
|
22899
|
+
const records = /* @__PURE__ */ new Map();
|
|
22900
|
+
for (const person of children(parseXml(personsXml).documentElement, "person", NS.tc)) {
|
|
22901
|
+
const id = att(person, "id") ?? "";
|
|
22902
|
+
records.set(id.toUpperCase(), [id, selfContainedXml(person)]);
|
|
22903
|
+
}
|
|
22904
|
+
for (const comment of order) {
|
|
22905
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22906
|
+
for (const message of [comment, ...comment.replies ?? []]) {
|
|
22907
|
+
const node2 = parseXml(message.threadedXml).documentElement;
|
|
22908
|
+
ids.add((att(node2, "personId") ?? "").toUpperCase());
|
|
22909
|
+
const mentions = first(node2, "mentions", NS.tc);
|
|
22910
|
+
if (mentions)
|
|
22911
|
+
for (const mention of children(mentions, "mention", NS.tc))
|
|
22912
|
+
ids.add((att(mention, "mentionpersonId") ?? "").toUpperCase());
|
|
22913
|
+
}
|
|
22914
|
+
const kept = [...ids].flatMap((id) => records.has(id) ? [records.get(id)] : []);
|
|
22915
|
+
if (kept.length) comment.threadedPersons = Object.fromEntries(kept);
|
|
22916
|
+
}
|
|
22917
|
+
}
|
|
22761
22918
|
return order;
|
|
22762
22919
|
}
|
|
22920
|
+
function threadedCommentEnvelope(xml) {
|
|
22921
|
+
if (!xml) return void 0;
|
|
22922
|
+
const doc = parseXml(xml);
|
|
22923
|
+
for (const node2 of children(doc.documentElement, "threadedComment", NS.tc)) {
|
|
22924
|
+
doc.documentElement.removeChild(node2);
|
|
22925
|
+
}
|
|
22926
|
+
return buildXml(doc);
|
|
22927
|
+
}
|
|
22763
22928
|
function mergeComments(legacy, threaded) {
|
|
22764
22929
|
if (!threaded.length) return legacy;
|
|
22765
22930
|
const key = (c2) => `${c2.address.row}:${c2.address.col}`;
|
|
@@ -23594,7 +23759,7 @@ function readSheetView(sheetViews) {
|
|
|
23594
23759
|
const cols = Math.max(0, Math.round(numAttr(pane, "xSplit") ?? 0));
|
|
23595
23760
|
if (rows3 || cols) view.freeze = { rows: rows3, cols };
|
|
23596
23761
|
}
|
|
23597
|
-
const split2 = pane && state === "split";
|
|
23762
|
+
const split2 = pane && (state === void 0 || state === "split");
|
|
23598
23763
|
if (split2) {
|
|
23599
23764
|
const x = Math.max(0, Math.round(numAttr(pane, "xSplit") ?? 0));
|
|
23600
23765
|
const y = Math.max(0, Math.round(numAttr(pane, "ySplit") ?? 0));
|
|
@@ -23602,9 +23767,8 @@ function readSheetView(sheetViews) {
|
|
|
23602
23767
|
view.split = { x, y };
|
|
23603
23768
|
const first2 = parseAddress(att(node2, "topLeftCell") ?? "");
|
|
23604
23769
|
if (first2) view.split.topLeft = first2;
|
|
23605
|
-
const active = att(pane, "activePane");
|
|
23606
|
-
if (
|
|
23607
|
-
view.split.activePane = active;
|
|
23770
|
+
const active = att(pane, "activePane") ?? "topLeft";
|
|
23771
|
+
if (PANES.has(active)) view.split.activePane = active;
|
|
23608
23772
|
}
|
|
23609
23773
|
}
|
|
23610
23774
|
const topLeft = parseAddress(
|
|
@@ -43906,6 +44070,49 @@ var WORKSHEET_CHILD_ORDER = [
|
|
|
43906
44070
|
"extLst"
|
|
43907
44071
|
];
|
|
43908
44072
|
|
|
44073
|
+
// xlsx/read/data-validations.ts
|
|
44074
|
+
var VALIDATION_XM = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
44075
|
+
var TYPES = /* @__PURE__ */ new Set(["none", "whole", "decimal", "list", "date", "time", "textLength", "custom"]);
|
|
44076
|
+
var ERROR_STYLES = /* @__PURE__ */ new Set(["stop", "warning", "information"]);
|
|
44077
|
+
function readDataValidation(dv) {
|
|
44078
|
+
const extended = dv.namespaceURI === NS.x14;
|
|
44079
|
+
const ns = extended ? NS.x14 : NS.x;
|
|
44080
|
+
const ranges = parseSqref(
|
|
44081
|
+
extended ? first(dv, "sqref", VALIDATION_XM)?.textContent ?? "" : att(dv, "sqref")
|
|
44082
|
+
);
|
|
44083
|
+
if (!ranges.length) return void 0;
|
|
44084
|
+
const type = att(dv, "type") ?? "none";
|
|
44085
|
+
const validation = {
|
|
44086
|
+
ranges,
|
|
44087
|
+
type: TYPES.has(type) ? type : "none"
|
|
44088
|
+
};
|
|
44089
|
+
const operator = att(dv, "operator");
|
|
44090
|
+
if (operator) validation.operator = operator;
|
|
44091
|
+
for (const key of ["formula1", "formula2"]) {
|
|
44092
|
+
const container = first(dv, key, ns);
|
|
44093
|
+
const formula2 = extended ? first(container, "f", VALIDATION_XM) : container;
|
|
44094
|
+
if (formula2) validation[key] = stripFuturePrefixes(formula2.textContent ?? "");
|
|
44095
|
+
}
|
|
44096
|
+
if (boolAttr(dv, "allowBlank")) validation.allowBlank = true;
|
|
44097
|
+
const hideDropDown = boolAttr(dv, "showDropDown");
|
|
44098
|
+
if (validation.type === "list") validation.showDropDown = !hideDropDown;
|
|
44099
|
+
else if (hideDropDown) validation.showDropDown = false;
|
|
44100
|
+
if (boolAttr(dv, "showErrorMessage")) validation.showErrorMessage = true;
|
|
44101
|
+
if (boolAttr(dv, "showInputMessage")) validation.showInputMessage = true;
|
|
44102
|
+
const errorStyle = att(dv, "errorStyle");
|
|
44103
|
+
if (errorStyle && ERROR_STYLES.has(errorStyle))
|
|
44104
|
+
validation.errorStyle = errorStyle;
|
|
44105
|
+
for (const key of ["errorTitle", "error", "promptTitle", "prompt"]) {
|
|
44106
|
+
const value3 = att(dv, key);
|
|
44107
|
+
if (value3 !== void 0) validation[key] = value3;
|
|
44108
|
+
}
|
|
44109
|
+
if (extended) validation.extensionXml = selfContainedXml(dv);
|
|
44110
|
+
return validation;
|
|
44111
|
+
}
|
|
44112
|
+
function readDataValidations(node2) {
|
|
44113
|
+
return node2 ? children(node2, "dataValidation", NS.x).flatMap((dv) => readDataValidation(dv) ?? []) : [];
|
|
44114
|
+
}
|
|
44115
|
+
|
|
43909
44116
|
// xlsx/read/conditional.ts
|
|
43910
44117
|
var CFVO_TYPES = /* @__PURE__ */ new Set(["min", "max", "num", "percent", "percentile", "formula"]);
|
|
43911
44118
|
function cfvo(node2) {
|
|
@@ -44032,55 +44239,151 @@ function readConditionalFormats(blocks, dxfs, palette, warn) {
|
|
|
44032
44239
|
}
|
|
44033
44240
|
return out;
|
|
44034
44241
|
}
|
|
44035
|
-
|
|
44036
|
-
|
|
44037
|
-
|
|
44038
|
-
|
|
44039
|
-
|
|
44040
|
-
|
|
44041
|
-
|
|
44042
|
-
|
|
44043
|
-
|
|
44044
|
-
|
|
44045
|
-
|
|
44046
|
-
|
|
44047
|
-
|
|
44048
|
-
|
|
44049
|
-
|
|
44050
|
-
|
|
44051
|
-
|
|
44052
|
-
|
|
44053
|
-
|
|
44054
|
-
|
|
44055
|
-
|
|
44056
|
-
|
|
44057
|
-
|
|
44058
|
-
|
|
44059
|
-
|
|
44060
|
-
|
|
44061
|
-
|
|
44062
|
-
|
|
44063
|
-
|
|
44064
|
-
|
|
44065
|
-
|
|
44066
|
-
|
|
44067
|
-
|
|
44068
|
-
|
|
44069
|
-
const
|
|
44070
|
-
|
|
44071
|
-
validation.errorStyle = errorStyle;
|
|
44072
|
-
for (const key of ["errorTitle", "error", "promptTitle", "prompt"]) {
|
|
44073
|
-
const value3 = att(dv, key);
|
|
44074
|
-
if (value3 !== void 0) validation[key] = value3;
|
|
44075
|
-
}
|
|
44076
|
-
out.push(validation);
|
|
44242
|
+
|
|
44243
|
+
// xlsx/write/data-validations.ts
|
|
44244
|
+
function usesValidationExtension(dv) {
|
|
44245
|
+
if (dv.extensionXml) return true;
|
|
44246
|
+
return [dv.formula1, dv.formula2].some((formula2) => {
|
|
44247
|
+
if (!formula2) return false;
|
|
44248
|
+
try {
|
|
44249
|
+
return tokenize(formula2).some((token2) => token2.prefix !== void 0);
|
|
44250
|
+
} catch {
|
|
44251
|
+
return false;
|
|
44252
|
+
}
|
|
44253
|
+
});
|
|
44254
|
+
}
|
|
44255
|
+
function validationAttributes(dv) {
|
|
44256
|
+
return {
|
|
44257
|
+
type: dv.type === "none" ? void 0 : dv.type,
|
|
44258
|
+
errorStyle: dv.errorStyle,
|
|
44259
|
+
operator: dv.operator,
|
|
44260
|
+
allowBlank: dv.allowBlank || void 0,
|
|
44261
|
+
showDropDown: dv.showDropDown === false ? true : void 0,
|
|
44262
|
+
showInputMessage: dv.showInputMessage || void 0,
|
|
44263
|
+
showErrorMessage: dv.showErrorMessage || void 0,
|
|
44264
|
+
errorTitle: dv.errorTitle,
|
|
44265
|
+
error: dv.error,
|
|
44266
|
+
promptTitle: dv.promptTitle,
|
|
44267
|
+
prompt: dv.prompt
|
|
44268
|
+
};
|
|
44269
|
+
}
|
|
44270
|
+
function dataValidationXml(dv, extended) {
|
|
44271
|
+
const sqref2 = dv.ranges.map(formatRange).join(" ");
|
|
44272
|
+
if (!extended) {
|
|
44273
|
+
const formulas = ["formula1", "formula2"].map(
|
|
44274
|
+
(key) => dv[key] === void 0 ? "" : `<${key}>${escapeText(addFuturePrefixes(dv[key]))}</${key}>`
|
|
44275
|
+
).join("");
|
|
44276
|
+
const values2 = attrs2({ ...validationAttributes(dv), sqref: sqref2 });
|
|
44277
|
+
return formulas ? `<dataValidation${values2}>${formulas}</dataValidation>` : `<dataValidation${values2}/>`;
|
|
44077
44278
|
}
|
|
44078
|
-
|
|
44279
|
+
const doc = parseXml(
|
|
44280
|
+
dv.extensionXml || `<x14:dataValidation xmlns:x14="${NS.x14}" xmlns:xm="${VALIDATION_XM}"/>`
|
|
44281
|
+
);
|
|
44282
|
+
const node2 = doc.documentElement;
|
|
44283
|
+
for (const [key, value3] of Object.entries(validationAttributes(dv))) {
|
|
44284
|
+
if (value3 === void 0) node2.removeAttribute(key);
|
|
44285
|
+
else node2.setAttribute(key, typeof value3 === "boolean" ? "1" : value3);
|
|
44286
|
+
}
|
|
44287
|
+
for (const key of ["formula1", "formula2"]) {
|
|
44288
|
+
let container = first(node2, key, NS.x14);
|
|
44289
|
+
if (dv[key] === void 0) {
|
|
44290
|
+
if (container) node2.removeChild(container);
|
|
44291
|
+
continue;
|
|
44292
|
+
}
|
|
44293
|
+
if (!container) {
|
|
44294
|
+
container = doc.createElementNS(NS.x14, `x14:${key}`);
|
|
44295
|
+
const next = key === "formula1" ? first(node2, "formula2", NS.x14) : void 0;
|
|
44296
|
+
node2.insertBefore(container, next ?? first(node2, "sqref", VALIDATION_XM) ?? null);
|
|
44297
|
+
}
|
|
44298
|
+
let formula2 = first(container, "f", VALIDATION_XM);
|
|
44299
|
+
if (!formula2) {
|
|
44300
|
+
formula2 = doc.createElementNS(VALIDATION_XM, "xm:f");
|
|
44301
|
+
container.appendChild(formula2);
|
|
44302
|
+
}
|
|
44303
|
+
formula2.textContent = addFuturePrefixes(dv[key]);
|
|
44304
|
+
}
|
|
44305
|
+
let ranges = first(node2, "sqref", VALIDATION_XM);
|
|
44306
|
+
if (!ranges) {
|
|
44307
|
+
ranges = doc.createElementNS(VALIDATION_XM, "xm:sqref");
|
|
44308
|
+
node2.appendChild(ranges);
|
|
44309
|
+
}
|
|
44310
|
+
ranges.textContent = sqref2;
|
|
44311
|
+
return buildXml(doc);
|
|
44312
|
+
}
|
|
44313
|
+
function dataValidationsXml(validations) {
|
|
44314
|
+
const items = validations.filter((dv) => dv.ranges.length && !usesValidationExtension(dv)).map((dv) => dataValidationXml(dv, false));
|
|
44315
|
+
return items.length ? `<dataValidations count="${items.length}">${items.join("")}</dataValidations>` : "";
|
|
44316
|
+
}
|
|
44317
|
+
|
|
44318
|
+
// xlsx/validation-extensions.ts
|
|
44319
|
+
var URI = "{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}";
|
|
44320
|
+
function readValidationExtensions(sheet) {
|
|
44321
|
+
const kept = [];
|
|
44322
|
+
for (const xml of sheet.preserved.get("extLst") ?? []) {
|
|
44323
|
+
const doc = parseXml(xml);
|
|
44324
|
+
let changed = false;
|
|
44325
|
+
for (const ext of children(doc.documentElement, "ext", NS.x)) {
|
|
44326
|
+
if (ext.getAttribute("uri")?.toUpperCase() !== URI.toUpperCase()) continue;
|
|
44327
|
+
const collection = first(ext, "dataValidations", NS.x14);
|
|
44328
|
+
if (!collection) continue;
|
|
44329
|
+
for (const node2 of children(collection, "dataValidation", NS.x14)) {
|
|
44330
|
+
const rule = readDataValidation(node2);
|
|
44331
|
+
if (!rule) continue;
|
|
44332
|
+
sheet.dataValidations.push(rule);
|
|
44333
|
+
collection.removeChild(node2);
|
|
44334
|
+
changed = true;
|
|
44335
|
+
}
|
|
44336
|
+
collection.setAttribute(
|
|
44337
|
+
"count",
|
|
44338
|
+
String(children(collection, "dataValidation", NS.x14).length)
|
|
44339
|
+
);
|
|
44340
|
+
}
|
|
44341
|
+
if (!changed) kept.push(xml);
|
|
44342
|
+
else if (elements(doc.documentElement).length) kept.push(buildXml(doc));
|
|
44343
|
+
}
|
|
44344
|
+
if (kept.length) sheet.preserved.set("extLst", kept);
|
|
44345
|
+
else sheet.preserved.delete("extLst");
|
|
44346
|
+
}
|
|
44347
|
+
function validationExtensionsXml(sheet, extensions, ids = /* @__PURE__ */ new Set()) {
|
|
44348
|
+
const rules = sheet.dataValidations.filter(
|
|
44349
|
+
(dv) => dv.ranges.length && usesValidationExtension(dv)
|
|
44350
|
+
);
|
|
44351
|
+
const doc = parseXml(extensions || `<extLst xmlns="${NS.x}"/>`);
|
|
44352
|
+
let ext = elements(doc.documentElement).find(
|
|
44353
|
+
(node2) => node2.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
|
|
44354
|
+
);
|
|
44355
|
+
if (!rules.length) {
|
|
44356
|
+
const collection2 = first(ext, "dataValidations", NS.x14);
|
|
44357
|
+
if (ext && collection2 && !elements(collection2).length) {
|
|
44358
|
+
ext.removeChild(collection2);
|
|
44359
|
+
if (!elements(ext).length) doc.documentElement.removeChild(ext);
|
|
44360
|
+
}
|
|
44361
|
+
return elements(doc.documentElement).length ? inlineFragment(buildXml(doc)) : "";
|
|
44362
|
+
}
|
|
44363
|
+
if (!ext) {
|
|
44364
|
+
ext = doc.createElementNS(NS.x, "ext");
|
|
44365
|
+
ext.setAttribute("uri", URI);
|
|
44366
|
+
doc.documentElement.appendChild(ext);
|
|
44367
|
+
}
|
|
44368
|
+
let collection = first(ext, "dataValidations", NS.x14);
|
|
44369
|
+
if (!collection) {
|
|
44370
|
+
collection = doc.createElementNS(NS.x14, "x14:dataValidations");
|
|
44371
|
+
ext.appendChild(collection);
|
|
44372
|
+
}
|
|
44373
|
+
for (const rule of rules) {
|
|
44374
|
+
const node2 = doc.importNode(parseXml(dataValidationXml(rule, true)).documentElement, true);
|
|
44375
|
+
const id = node2.getAttributeNS(NS.xr, "uid");
|
|
44376
|
+
if (id && ids.has(id)) node2.removeAttributeNS(NS.xr, "uid");
|
|
44377
|
+
else if (id) ids.add(id);
|
|
44378
|
+
collection.appendChild(node2);
|
|
44379
|
+
}
|
|
44380
|
+
collection.setAttribute("count", String(children(collection, "dataValidation", NS.x14).length));
|
|
44381
|
+
return inlineFragment(buildXml(doc));
|
|
44079
44382
|
}
|
|
44080
44383
|
|
|
44081
44384
|
// xlsx/conditional-extensions.ts
|
|
44082
44385
|
var XM = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
44083
|
-
var
|
|
44386
|
+
var URI2 = "{78C0D931-6437-407d-A8EE-F0AAD7539E65}";
|
|
44084
44387
|
function writeSettings(node2, rule) {
|
|
44085
44388
|
const bar = first(node2, "dataBar", NS.x14);
|
|
44086
44389
|
if (!bar) return;
|
|
@@ -44174,14 +44477,14 @@ function conditionalExtensionsXml(sheet) {
|
|
|
44174
44477
|
for (const xml of preserved.slice(1))
|
|
44175
44478
|
for (const node2 of elements(parseXml(xml).documentElement))
|
|
44176
44479
|
doc.documentElement.appendChild(doc.importNode(node2, true));
|
|
44177
|
-
let ext = elements(doc.documentElement).find((e) => e.getAttribute("uri") ===
|
|
44480
|
+
let ext = elements(doc.documentElement).find((e) => e.getAttribute("uri") === URI2);
|
|
44178
44481
|
let collection = first(ext, "conditionalFormattings", NS.x14);
|
|
44179
44482
|
for (const format of sheet.conditionalFormats)
|
|
44180
44483
|
for (const rule of format.rules) {
|
|
44181
44484
|
if (rule.type !== "dataBar" || !rule.extensionXml || !rule.extensionId) continue;
|
|
44182
44485
|
if (!ext) {
|
|
44183
44486
|
ext = doc.createElementNS(NS.x, "ext");
|
|
44184
|
-
ext.setAttribute("uri",
|
|
44487
|
+
ext.setAttribute("uri", URI2);
|
|
44185
44488
|
doc.documentElement.appendChild(ext);
|
|
44186
44489
|
}
|
|
44187
44490
|
if (!collection) {
|
|
@@ -48131,7 +48434,7 @@ function slicerFrameXml(kind, name, id, anchor, box2) {
|
|
|
48131
48434
|
}
|
|
48132
48435
|
|
|
48133
48436
|
// xlsx/read/form-control.ts
|
|
48134
|
-
var
|
|
48437
|
+
var TYPES2 = {
|
|
48135
48438
|
checkbox: "checkbox",
|
|
48136
48439
|
radio: "radio",
|
|
48137
48440
|
drop: "dropdown",
|
|
@@ -48173,7 +48476,7 @@ var num4 = (value3) => {
|
|
|
48173
48476
|
};
|
|
48174
48477
|
function readProps(control, xml) {
|
|
48175
48478
|
const props = parseXml(xml, { label: "XLSX form control" }).documentElement;
|
|
48176
|
-
control.controlType =
|
|
48479
|
+
control.controlType = TYPES2[(att(props, "objectType") ?? "").toLowerCase()] ?? "other";
|
|
48177
48480
|
const link = att(props, "fmlaLink");
|
|
48178
48481
|
if (link) control.linkedCell = link;
|
|
48179
48482
|
const range2 = att(props, "fmlaRange");
|
|
@@ -48948,12 +49251,21 @@ function readTables(ctx, partName, node2, sheet) {
|
|
|
48948
49251
|
function readComments(ctx, partName, sheet) {
|
|
48949
49252
|
const legacyPart = ctx.source.targetOfType(partName, RELATIONSHIP_TYPES.comments);
|
|
48950
49253
|
const threadedPart = ctx.source.targetOfType(partName, RELATIONSHIP_TYPES.threadedComment);
|
|
49254
|
+
const personsPart = ctx.source.targetOfType(
|
|
49255
|
+
ctx.source.workbookPart() ?? "",
|
|
49256
|
+
RELATIONSHIP_TYPES.person
|
|
49257
|
+
);
|
|
48951
49258
|
const legacy = parseLegacyComments(legacyPart ? ctx.source.text(legacyPart) : void 0);
|
|
48952
49259
|
const threaded = parseThreadedComments(
|
|
48953
49260
|
threadedPart ? ctx.source.text(threadedPart) : void 0,
|
|
48954
|
-
ctx.persons
|
|
49261
|
+
ctx.persons,
|
|
49262
|
+
personsPart ? ctx.source.text(personsPart) : void 0
|
|
48955
49263
|
);
|
|
48956
49264
|
sheet.comments = mergeComments(legacy, threaded);
|
|
49265
|
+
const envelope = threadedCommentEnvelope(
|
|
49266
|
+
threadedPart ? ctx.source.text(threadedPart) : void 0
|
|
49267
|
+
);
|
|
49268
|
+
if (envelope) sheet.threadedCommentsXml = envelope;
|
|
48957
49269
|
}
|
|
48958
49270
|
function parseWorksheet(ctx, partName, name, sheetId) {
|
|
48959
49271
|
const xml = ctx.source.text(partName);
|
|
@@ -49024,6 +49336,7 @@ function readWorksheet(ctx, partName, name, sheetId, xml, rows3) {
|
|
|
49024
49336
|
const scenarios = readScenarios(byName.get("scenarios"));
|
|
49025
49337
|
if (scenarios) sheet.scenarios = scenarios;
|
|
49026
49338
|
sheet.dataValidations = readDataValidations(byName.get("dataValidations"));
|
|
49339
|
+
readValidationExtensions(sheet);
|
|
49027
49340
|
readConditionalExtensions(sheet);
|
|
49028
49341
|
sheet.hyperlinks = readHyperlinks(ctx, partName, byName.get("hyperlinks"));
|
|
49029
49342
|
const page2 = readPageSetup(
|
|
@@ -49185,7 +49498,7 @@ function readProperties(core, app, custom, warn) {
|
|
|
49185
49498
|
|
|
49186
49499
|
// xlsx/read/sparklines.ts
|
|
49187
49500
|
var XM2 = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
49188
|
-
var
|
|
49501
|
+
var TYPES3 = ["line", "column", "stacked"];
|
|
49189
49502
|
var EMPTY = ["gap", "zero", "span"];
|
|
49190
49503
|
var AXES = ["individual", "group", "custom"];
|
|
49191
49504
|
var COLORS = [
|
|
@@ -49208,7 +49521,7 @@ var text = (element3) => {
|
|
|
49208
49521
|
function readSparklineGroup(node2) {
|
|
49209
49522
|
const attr3 = (name) => node2.hasAttribute(name) ? node2.getAttribute(name) : null;
|
|
49210
49523
|
const group2 = {
|
|
49211
|
-
type: pick2(attr3("type"),
|
|
49524
|
+
type: pick2(attr3("type"), TYPES3, "line"),
|
|
49212
49525
|
lineWeight: numAttr(node2, "lineWeight") ?? 0.75,
|
|
49213
49526
|
dateAxis: boolAttr(node2, "dateAxis", false),
|
|
49214
49527
|
markers: boolAttr(node2, "markers", false),
|
|
@@ -49269,7 +49582,7 @@ function sheetSparklineGroups(sheet) {
|
|
|
49269
49582
|
return groups;
|
|
49270
49583
|
}
|
|
49271
49584
|
|
|
49272
|
-
// xlsx/write/
|
|
49585
|
+
// xlsx/write/comment-ids.ts
|
|
49273
49586
|
function guidFrom(seed) {
|
|
49274
49587
|
let h1 = 2166136261;
|
|
49275
49588
|
let h2 = 16777619;
|
|
@@ -49285,32 +49598,406 @@ function guidFrom(seed) {
|
|
|
49285
49598
|
const s = hex2.join("");
|
|
49286
49599
|
return `{${s.slice(0, 8)}-${s.slice(8, 12)}-4${s.slice(13, 16)}-8${s.slice(17, 20)}-${s.slice(20, 32)}}`;
|
|
49287
49600
|
}
|
|
49288
|
-
var
|
|
49601
|
+
var validGuid = (id) => /^\{[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}\}$/i.test(id);
|
|
49602
|
+
var CommentIds = class {
|
|
49603
|
+
reserved = /* @__PURE__ */ new Map();
|
|
49604
|
+
used = /* @__PURE__ */ new Set();
|
|
49605
|
+
mentions = /* @__PURE__ */ new WeakMap();
|
|
49606
|
+
constructor(workbook) {
|
|
49607
|
+
for (const matching2 of [true, false])
|
|
49608
|
+
for (const sheet of workbook?.sheets ?? []) {
|
|
49609
|
+
for (const comment of sheet.comments)
|
|
49610
|
+
for (const message of [comment, ...comment.replies ?? []]) {
|
|
49611
|
+
if (comment.regenerateThreadIds) continue;
|
|
49612
|
+
if (!message.threadedXml) continue;
|
|
49613
|
+
const node2 = parseXml(message.threadedXml).documentElement;
|
|
49614
|
+
if (node2.getAttribute("ref") === formatAddress(comment.address) !== matching2)
|
|
49615
|
+
continue;
|
|
49616
|
+
this.reserve(node2.getAttribute("id") ?? "", message);
|
|
49617
|
+
const mentions = first(node2, "mentions", NS.tc);
|
|
49618
|
+
if (mentions)
|
|
49619
|
+
children(mentions, "mention", NS.tc).forEach((mention, index3) => {
|
|
49620
|
+
this.reserve(
|
|
49621
|
+
mention.getAttribute("mentionId") ?? "",
|
|
49622
|
+
this.mentionOwner(message, index3)
|
|
49623
|
+
);
|
|
49624
|
+
});
|
|
49625
|
+
}
|
|
49626
|
+
}
|
|
49627
|
+
}
|
|
49628
|
+
reserve(id, owner) {
|
|
49629
|
+
const key = id.toUpperCase();
|
|
49630
|
+
if (validGuid(id) && !this.reserved.has(key)) this.reserved.set(key, owner);
|
|
49631
|
+
}
|
|
49632
|
+
mentionOwner(message, index3) {
|
|
49633
|
+
let owners = this.mentions.get(message);
|
|
49634
|
+
if (!owners) this.mentions.set(message, owners = []);
|
|
49635
|
+
return owners[index3] ??= {};
|
|
49636
|
+
}
|
|
49637
|
+
claim(source3, seed, owner, preserve = true) {
|
|
49638
|
+
const key = source3.toUpperCase();
|
|
49639
|
+
if (preserve && validGuid(source3) && !this.used.has(key) && (!this.reserved.has(key) || this.reserved.get(key) === owner)) {
|
|
49640
|
+
this.used.add(key);
|
|
49641
|
+
return source3;
|
|
49642
|
+
}
|
|
49643
|
+
let index3 = 0;
|
|
49644
|
+
let id = guidFrom(seed);
|
|
49645
|
+
while (this.used.has(id) || this.reserved.has(id)) id = guidFrom(`${seed}:${++index3}`);
|
|
49646
|
+
this.used.add(id);
|
|
49647
|
+
return id;
|
|
49648
|
+
}
|
|
49649
|
+
};
|
|
49650
|
+
|
|
49651
|
+
// text/text-diff.ts
|
|
49652
|
+
var isLowSurrogate = (text3, at2) => {
|
|
49653
|
+
const code = text3.charCodeAt(at2);
|
|
49654
|
+
return code >= 56320 && code <= 57343;
|
|
49655
|
+
};
|
|
49656
|
+
function shortestEdit(n2, m, same12, maxEdits) {
|
|
49657
|
+
const max = Math.min(n2 + m, maxEdits);
|
|
49658
|
+
const offset2 = max + 1;
|
|
49659
|
+
const v = new Int32Array(2 * max + 3);
|
|
49660
|
+
const trace2 = [];
|
|
49661
|
+
for (let d = 0; d <= max; d++) {
|
|
49662
|
+
for (let k = -d; k <= d; k += 2) {
|
|
49663
|
+
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
49664
|
+
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
49665
|
+
let y = x - k;
|
|
49666
|
+
while (x < n2 && y < m && same12(x, y)) {
|
|
49667
|
+
x++;
|
|
49668
|
+
y++;
|
|
49669
|
+
}
|
|
49670
|
+
v[offset2 + k] = x;
|
|
49671
|
+
if (x >= n2 && y >= m) return backtrack(trace2, n2, m, d);
|
|
49672
|
+
}
|
|
49673
|
+
trace2.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
49674
|
+
}
|
|
49675
|
+
return void 0;
|
|
49676
|
+
}
|
|
49677
|
+
function backtrack(trace2, n2, m, d) {
|
|
49678
|
+
const edits = [];
|
|
49679
|
+
let x = n2;
|
|
49680
|
+
let y = m;
|
|
49681
|
+
for (let step = d; step > 0; step--) {
|
|
49682
|
+
const previous = trace2[step - 1];
|
|
49683
|
+
const at2 = (k2) => previous[k2 + step - 1];
|
|
49684
|
+
const k = x - y;
|
|
49685
|
+
const down = k === -step || k !== step && at2(k - 1) < at2(k + 1);
|
|
49686
|
+
const before = down ? k + 1 : k - 1;
|
|
49687
|
+
const startX = at2(before);
|
|
49688
|
+
const startY = startX - before;
|
|
49689
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
49690
|
+
x = startX;
|
|
49691
|
+
y = startY;
|
|
49692
|
+
}
|
|
49693
|
+
return edits.reverse();
|
|
49694
|
+
}
|
|
49695
|
+
function changesOf(edits) {
|
|
49696
|
+
const changes = [];
|
|
49697
|
+
for (const [x, y, inserts] of edits) {
|
|
49698
|
+
const last = changes.at(-1);
|
|
49699
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
49700
|
+
if (inserts) last.toEnd++;
|
|
49701
|
+
else last.fromEnd++;
|
|
49702
|
+
} else
|
|
49703
|
+
changes.push({
|
|
49704
|
+
fromStart: x,
|
|
49705
|
+
fromEnd: inserts ? x : x + 1,
|
|
49706
|
+
toStart: y,
|
|
49707
|
+
toEnd: inserts ? y + 1 : y
|
|
49708
|
+
});
|
|
49709
|
+
}
|
|
49710
|
+
return changes;
|
|
49711
|
+
}
|
|
49712
|
+
function characterChanges(a2, b, maxEdits) {
|
|
49713
|
+
const edits = shortestEdit(
|
|
49714
|
+
a2.length,
|
|
49715
|
+
b.length,
|
|
49716
|
+
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
49717
|
+
maxEdits
|
|
49718
|
+
);
|
|
49719
|
+
return edits && changesOf(edits);
|
|
49720
|
+
}
|
|
49721
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
49722
|
+
function tokensOf(text3, ids) {
|
|
49723
|
+
const tokens2 = [];
|
|
49724
|
+
const starts = [];
|
|
49725
|
+
for (const match2 of text3.matchAll(TOKEN)) {
|
|
49726
|
+
let id = ids.get(match2[0]);
|
|
49727
|
+
if (id === void 0) ids.set(match2[0], id = ids.size);
|
|
49728
|
+
tokens2.push(id);
|
|
49729
|
+
starts.push(match2.index);
|
|
49730
|
+
}
|
|
49731
|
+
starts.push(text3.length);
|
|
49732
|
+
return { tokens: tokens2, starts };
|
|
49733
|
+
}
|
|
49734
|
+
function tokenChanges(a2, b, maxEdits) {
|
|
49735
|
+
const ids = /* @__PURE__ */ new Map();
|
|
49736
|
+
const from = tokensOf(a2, ids);
|
|
49737
|
+
const to = tokensOf(b, ids);
|
|
49738
|
+
const edits = shortestEdit(
|
|
49739
|
+
from.tokens.length,
|
|
49740
|
+
to.tokens.length,
|
|
49741
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
49742
|
+
maxEdits
|
|
49743
|
+
);
|
|
49744
|
+
if (!edits) return void 0;
|
|
49745
|
+
let budget2 = maxEdits;
|
|
49746
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
49747
|
+
const change = {
|
|
49748
|
+
fromStart: from.starts[stretch.fromStart],
|
|
49749
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
49750
|
+
toStart: to.starts[stretch.toStart],
|
|
49751
|
+
toEnd: to.starts[stretch.toEnd]
|
|
49752
|
+
};
|
|
49753
|
+
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
49754
|
+
a2.slice(change.fromStart, change.fromEnd),
|
|
49755
|
+
b.slice(change.toStart, change.toEnd),
|
|
49756
|
+
budget2
|
|
49757
|
+
) : void 0;
|
|
49758
|
+
if (!inner2) return [change];
|
|
49759
|
+
for (const found of inner2)
|
|
49760
|
+
budget2 -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
49761
|
+
return inner2.map((found) => ({
|
|
49762
|
+
fromStart: found.fromStart + change.fromStart,
|
|
49763
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
49764
|
+
toStart: found.toStart + change.toStart,
|
|
49765
|
+
toEnd: found.toEnd + change.toStart
|
|
49766
|
+
}));
|
|
49767
|
+
});
|
|
49768
|
+
}
|
|
49769
|
+
function diffText(from, to, maxEdits = 500) {
|
|
49770
|
+
let start = 0;
|
|
49771
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
49772
|
+
start++;
|
|
49773
|
+
let end = 0;
|
|
49774
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
49775
|
+
end++;
|
|
49776
|
+
const a2 = from.slice(start, from.length - end);
|
|
49777
|
+
const b = to.slice(start, to.length - end);
|
|
49778
|
+
if (!a2.length && !b.length) return [];
|
|
49779
|
+
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
49780
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
49781
|
+
const result2 = [];
|
|
49782
|
+
for (const change of changes) {
|
|
49783
|
+
const placed = {
|
|
49784
|
+
fromStart: change.fromStart + start,
|
|
49785
|
+
fromEnd: change.fromEnd + start,
|
|
49786
|
+
toStart: change.toStart + start,
|
|
49787
|
+
toEnd: change.toEnd + start
|
|
49788
|
+
};
|
|
49789
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
49790
|
+
placed.fromStart--;
|
|
49791
|
+
placed.toStart--;
|
|
49792
|
+
}
|
|
49793
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
49794
|
+
placed.fromEnd++;
|
|
49795
|
+
placed.toEnd++;
|
|
49796
|
+
}
|
|
49797
|
+
const last = result2.at(-1);
|
|
49798
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
49799
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
49800
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
49801
|
+
} else result2.push(placed);
|
|
49802
|
+
}
|
|
49803
|
+
return result2;
|
|
49804
|
+
}
|
|
49805
|
+
|
|
49806
|
+
// xlsx/write/comment-mentions.ts
|
|
49807
|
+
function patchCommentMentions(node2, before, message, ids, commentId, preserveIds) {
|
|
49808
|
+
const container = first(node2, "mentions", NS.tc);
|
|
49809
|
+
if (!container) return;
|
|
49810
|
+
const changes = diffText(before, message.text);
|
|
49811
|
+
children(container, "mention", NS.tc).forEach((mention, index3) => {
|
|
49812
|
+
const start = Number(mention.getAttribute("startIndex"));
|
|
49813
|
+
const length = Number(mention.getAttribute("length"));
|
|
49814
|
+
const end = start + length;
|
|
49815
|
+
let shift3 = 0;
|
|
49816
|
+
let intact = Number.isInteger(start) && start >= 0 && Number.isInteger(length) && length > 0 && end <= before.length;
|
|
49817
|
+
for (const change of changes) {
|
|
49818
|
+
if (change.fromEnd <= start)
|
|
49819
|
+
shift3 += change.toEnd - change.toStart - (change.fromEnd - change.fromStart);
|
|
49820
|
+
else if (change.fromStart < end) intact = false;
|
|
49821
|
+
}
|
|
49822
|
+
if (!intact) {
|
|
49823
|
+
container.removeChild(mention);
|
|
49824
|
+
return;
|
|
49825
|
+
}
|
|
49826
|
+
mention.setAttribute("startIndex", String(start + shift3));
|
|
49827
|
+
mention.setAttribute(
|
|
49828
|
+
"mentionId",
|
|
49829
|
+
ids.claim(
|
|
49830
|
+
mention.getAttribute("mentionId") ?? "",
|
|
49831
|
+
`${commentId}:mention:${index3}`,
|
|
49832
|
+
ids.mentionOwner(message, index3),
|
|
49833
|
+
preserveIds
|
|
49834
|
+
)
|
|
49835
|
+
);
|
|
49836
|
+
});
|
|
49837
|
+
if (!children(container, "mention", NS.tc).length) node2.removeChild(container);
|
|
49838
|
+
}
|
|
49839
|
+
|
|
49840
|
+
// xlsx/write/threaded-comments.ts
|
|
49841
|
+
var ThreadedCommentsWriter = class {
|
|
49842
|
+
constructor(persons, options7 = {}) {
|
|
49843
|
+
this.persons = persons;
|
|
49844
|
+
this.doc = parseXml(
|
|
49845
|
+
options7.envelope ?? `${XML_HEADER}<ThreadedComments xmlns="${NS.tc}" xmlns:x="${NS.x}"/>`
|
|
49846
|
+
);
|
|
49847
|
+
for (const node2 of children(this.doc.documentElement, "threadedComment", NS.tc))
|
|
49848
|
+
this.doc.documentElement.removeChild(node2);
|
|
49849
|
+
this.ids = options7.ids ?? new CommentIds();
|
|
49850
|
+
}
|
|
49851
|
+
persons;
|
|
49852
|
+
doc;
|
|
49853
|
+
ids;
|
|
49854
|
+
count = 0;
|
|
49855
|
+
add(comment, ref, sheetName) {
|
|
49856
|
+
this.persons.retain(comment.threadedPersons);
|
|
49857
|
+
const preserve = !comment.regenerateThreadIds;
|
|
49858
|
+
const prepare2 = (message, seed) => {
|
|
49859
|
+
const source3 = parseXml(message.threadedXml ?? `<threadedComment xmlns="${NS.tc}"/>`);
|
|
49860
|
+
const priorId = source3.documentElement.getAttribute("id") ?? "";
|
|
49861
|
+
const id = this.ids.claim(priorId, seed, message, preserve);
|
|
49862
|
+
return { message, source: source3, priorId, id };
|
|
49863
|
+
};
|
|
49864
|
+
const root = prepare2(comment, `${sheetName}!${ref}:${comment.text}`);
|
|
49865
|
+
const replies = (comment.replies ?? []).map(
|
|
49866
|
+
(reply, index3) => prepare2(reply, `${root.id}:reply:${index3}:${reply.text}`)
|
|
49867
|
+
);
|
|
49868
|
+
const identities = new Map(
|
|
49869
|
+
[root, ...replies].filter((item2) => item2.priorId).map((item2) => [item2.priorId.toUpperCase(), item2.id])
|
|
49870
|
+
);
|
|
49871
|
+
this.message(comment, ref, root.source, root.id, preserve, void 0, comment.resolved);
|
|
49872
|
+
for (const reply of replies)
|
|
49873
|
+
this.message(
|
|
49874
|
+
reply.message,
|
|
49875
|
+
ref,
|
|
49876
|
+
reply.source,
|
|
49877
|
+
reply.id,
|
|
49878
|
+
preserve,
|
|
49879
|
+
identities.get(
|
|
49880
|
+
(reply.source.documentElement.getAttribute("parentId") ?? "").toUpperCase()
|
|
49881
|
+
) ?? root.id
|
|
49882
|
+
);
|
|
49883
|
+
return root.id;
|
|
49884
|
+
}
|
|
49885
|
+
message(message, ref, source3, id, preserve, parent, resolved) {
|
|
49886
|
+
const node2 = source3.documentElement;
|
|
49887
|
+
const personId = this.persons.id(message.author, node2.getAttribute("personId") ?? void 0);
|
|
49888
|
+
for (const [key, value3] of Object.entries({
|
|
49889
|
+
id,
|
|
49890
|
+
ref,
|
|
49891
|
+
personId,
|
|
49892
|
+
dT: message.date,
|
|
49893
|
+
parentId: parent
|
|
49894
|
+
})) {
|
|
49895
|
+
if (value3 === void 0) node2.removeAttribute(key);
|
|
49896
|
+
else node2.setAttribute(key, value3);
|
|
49897
|
+
}
|
|
49898
|
+
if (!parent) {
|
|
49899
|
+
if (resolved === void 0) node2.removeAttribute("done");
|
|
49900
|
+
else node2.setAttribute("done", resolved ? "1" : "0");
|
|
49901
|
+
}
|
|
49902
|
+
let text3 = first(node2, "text", NS.tc);
|
|
49903
|
+
patchCommentMentions(node2, text3?.textContent ?? "", message, this.ids, id, preserve);
|
|
49904
|
+
if (!text3) {
|
|
49905
|
+
text3 = source3.createElementNS(NS.tc, node2.prefix ? `${node2.prefix}:text` : "text");
|
|
49906
|
+
node2.insertBefore(text3, node2.firstChild);
|
|
49907
|
+
}
|
|
49908
|
+
text3.textContent = message.text;
|
|
49909
|
+
const root = this.doc.documentElement;
|
|
49910
|
+
root.insertBefore(this.doc.importNode(node2, true), first(root, "extLst", NS.tc) ?? null);
|
|
49911
|
+
this.count++;
|
|
49912
|
+
}
|
|
49913
|
+
xml() {
|
|
49914
|
+
return this.count ? buildXml(this.doc) : void 0;
|
|
49915
|
+
}
|
|
49916
|
+
};
|
|
49917
|
+
|
|
49918
|
+
// xlsx/write/comment-persons.ts
|
|
49289
49919
|
var PersonRegistry = class {
|
|
49920
|
+
constructor(existing, source3) {
|
|
49921
|
+
this.source = source3;
|
|
49922
|
+
for (const [id, name] of existing ?? []) {
|
|
49923
|
+
this.names.set(id, name);
|
|
49924
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49925
|
+
if (!this.byName.has(name)) this.byName.set(name, id);
|
|
49926
|
+
}
|
|
49927
|
+
}
|
|
49928
|
+
source;
|
|
49290
49929
|
names = /* @__PURE__ */ new Map();
|
|
49291
49930
|
byName = /* @__PURE__ */ new Map();
|
|
49292
|
-
|
|
49293
|
-
|
|
49931
|
+
identities = /* @__PURE__ */ new Map();
|
|
49932
|
+
added = /* @__PURE__ */ new Map();
|
|
49933
|
+
retained = /* @__PURE__ */ new Map();
|
|
49934
|
+
get changed() {
|
|
49935
|
+
return this.added.size > 0;
|
|
49936
|
+
}
|
|
49937
|
+
/** Bring referenced account records along with a thread copied from another workbook. */
|
|
49938
|
+
retain(records) {
|
|
49939
|
+
for (const [sourceId, xml] of Object.entries(records ?? {})) {
|
|
49940
|
+
const known = this.identities.get(sourceId.toUpperCase());
|
|
49941
|
+
if (known && (this.source || this.retained.has(known))) continue;
|
|
49942
|
+
const node2 = parseXml(xml).documentElement;
|
|
49943
|
+
if (node2.localName !== "person" || node2.namespaceURI !== NS.tc || node2.getAttribute("id")?.toUpperCase() !== sourceId.toUpperCase())
|
|
49944
|
+
continue;
|
|
49945
|
+
const name = node2.getAttribute("displayName") ?? "";
|
|
49946
|
+
const id = known ?? node2.getAttribute("id");
|
|
49947
|
+
this.retained.set(id, xml);
|
|
49294
49948
|
this.names.set(id, name);
|
|
49949
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49950
|
+
this.added.set(id, name);
|
|
49295
49951
|
if (!this.byName.has(name)) this.byName.set(name, id);
|
|
49296
49952
|
}
|
|
49297
49953
|
}
|
|
49298
|
-
id(name) {
|
|
49954
|
+
id(name, preferred) {
|
|
49955
|
+
const preferredId = preferred ? this.identities.get(preferred.toUpperCase()) : void 0;
|
|
49956
|
+
if (preferredId && this.names.get(preferredId) === name) return preferredId;
|
|
49299
49957
|
let id = this.byName.get(name);
|
|
49300
49958
|
if (!id) {
|
|
49959
|
+
let index3 = 0;
|
|
49301
49960
|
id = guidFrom(`person:${name}`);
|
|
49961
|
+
while (this.identities.has(id.toUpperCase())) id = guidFrom(`person:${name}:${++index3}`);
|
|
49302
49962
|
this.byName.set(name, id);
|
|
49303
49963
|
this.names.set(id, name);
|
|
49964
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49965
|
+
this.added.set(id, name);
|
|
49304
49966
|
}
|
|
49305
49967
|
return id;
|
|
49306
49968
|
}
|
|
49307
49969
|
xml() {
|
|
49308
|
-
|
|
49309
|
-
|
|
49310
|
-
|
|
49311
|
-
|
|
49970
|
+
if (this.source && !this.changed) return this.source;
|
|
49971
|
+
const doc = parseXml(
|
|
49972
|
+
this.source ?? `${XML_HEADER}<personList xmlns="${NS.tc}" xmlns:x="${NS.x}"/>`
|
|
49973
|
+
);
|
|
49974
|
+
const root = doc.documentElement;
|
|
49975
|
+
for (const [id, name] of this.source ? this.added : this.names) {
|
|
49976
|
+
const retained = this.retained.get(id);
|
|
49977
|
+
if (retained) {
|
|
49978
|
+
root.insertBefore(
|
|
49979
|
+
doc.importNode(parseXml(retained).documentElement, true),
|
|
49980
|
+
first(root, "extLst", NS.tc) ?? null
|
|
49981
|
+
);
|
|
49982
|
+
continue;
|
|
49983
|
+
}
|
|
49984
|
+
const person = doc.createElementNS(NS.tc, root.prefix ? `${root.prefix}:person` : "person");
|
|
49985
|
+
for (const [key, value3] of Object.entries({
|
|
49986
|
+
id,
|
|
49987
|
+
displayName: name,
|
|
49988
|
+
userId: name,
|
|
49989
|
+
providerId: "None"
|
|
49990
|
+
})) {
|
|
49991
|
+
person.setAttribute(key, value3);
|
|
49992
|
+
}
|
|
49993
|
+
root.insertBefore(person, first(root, "extLst", NS.tc) ?? null);
|
|
49994
|
+
}
|
|
49995
|
+
return buildXml(doc);
|
|
49312
49996
|
}
|
|
49313
49997
|
};
|
|
49998
|
+
|
|
49999
|
+
// xlsx/write/comments.ts
|
|
50000
|
+
var THREADED_NOTE = "[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ";
|
|
49314
50001
|
function vmlShape(comment, index3, id) {
|
|
49315
50002
|
const { row: row2, col } = comment.address;
|
|
49316
50003
|
const anchor = `${col + 1}, 15, ${Math.max(0, row2 - 1)}, 10, ${col + 3}, 15, ${row2 + 3}, 4`;
|
|
@@ -49332,7 +50019,7 @@ function vmlXml(comments, layout2) {
|
|
|
49332
50019
|
}
|
|
49333
50020
|
return `<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="${data}"/></o:shapelayout>` + NOTE_SHAPETYPE + shapes + "</xml>";
|
|
49334
50021
|
}
|
|
49335
|
-
function commentParts(comments, sheetNumber, persons, sheetName, layout2) {
|
|
50022
|
+
function commentParts(comments, sheetNumber, persons, sheetName, layout2, threadOptions) {
|
|
49336
50023
|
const authors = [];
|
|
49337
50024
|
const authorId = (name) => {
|
|
49338
50025
|
let id = authors.indexOf(name);
|
|
@@ -49342,18 +50029,11 @@ function commentParts(comments, sheetNumber, persons, sheetName, layout2) {
|
|
|
49342
50029
|
const sorted2 = [...comments].sort(
|
|
49343
50030
|
(a2, b) => a2.address.row - b.address.row || a2.address.col - b.address.col
|
|
49344
50031
|
);
|
|
49345
|
-
|
|
50032
|
+
const threads = new ThreadedCommentsWriter(persons, threadOptions);
|
|
49346
50033
|
const list2 = sorted2.map((comment) => {
|
|
49347
50034
|
const ref = formatAddress(comment.address);
|
|
49348
50035
|
if (comment.replies) {
|
|
49349
|
-
const id =
|
|
49350
|
-
const personId = persons.id(comment.author);
|
|
49351
|
-
threaded += `<threadedComment ref="${ref}" personId="${personId}" id="${id}"><text>${escapeText(comment.text)}</text></threadedComment>`;
|
|
49352
|
-
comment.replies.forEach((reply, index3) => {
|
|
49353
|
-
const replyId = guidFrom(`${id}:reply:${index3}:${reply.text}`);
|
|
49354
|
-
const dT = reply.date ? ` dT="${escapeAttr(reply.date)}"` : "";
|
|
49355
|
-
threaded += `<threadedComment ref="${ref}"${dT} personId="${persons.id(reply.author)}" id="${replyId}" parentId="${id}"><text>${escapeText(reply.text)}</text></threadedComment>`;
|
|
49356
|
-
});
|
|
50036
|
+
const id = threads.add(comment, ref, sheetName);
|
|
49357
50037
|
const fallback = `${THREADED_NOTE}${comment.text}${comment.replies.map((r) => `
|
|
49358
50038
|
Reply:
|
|
49359
50039
|
${r.text}`).join("")}`;
|
|
@@ -49371,8 +50051,8 @@ Reply:
|
|
|
49371
50051
|
}
|
|
49372
50052
|
);
|
|
49373
50053
|
const parts = { comments: commentsXml, vml };
|
|
49374
|
-
|
|
49375
|
-
|
|
50054
|
+
const threaded = threads.xml();
|
|
50055
|
+
if (threaded) parts.threaded = threaded;
|
|
49376
50056
|
return parts;
|
|
49377
50057
|
}
|
|
49378
50058
|
|
|
@@ -52361,6 +53041,40 @@ function pageXml(sheet) {
|
|
|
52361
53041
|
return result2;
|
|
52362
53042
|
}
|
|
52363
53043
|
|
|
53044
|
+
// xlsx/layout/split.ts
|
|
53045
|
+
function splitActivePane(split2) {
|
|
53046
|
+
const valid = split2.x > 0 && split2.y > 0 ? ["topLeft", "topRight", "bottomLeft", "bottomRight"] : split2.y > 0 ? ["topLeft", "bottomLeft"] : ["topLeft", "topRight"];
|
|
53047
|
+
return split2.activePane && valid.includes(split2.activePane) ? split2.activePane : valid[valid.length - 1];
|
|
53048
|
+
}
|
|
53049
|
+
function revealInSplit(metrics, layout2, row2, col) {
|
|
53050
|
+
const axis = (start, size, paneStart, paneSize, mainStart, mainSize) => {
|
|
53051
|
+
const inPane = paneSize > 0 && start >= paneStart && start + size <= paneStart + paneSize;
|
|
53052
|
+
if (inPane) return mainStart;
|
|
53053
|
+
if (start < mainStart) return start;
|
|
53054
|
+
if (start + size > mainStart + mainSize)
|
|
53055
|
+
return Math.max(0, Math.min(start, start + size - mainSize));
|
|
53056
|
+
return mainStart;
|
|
53057
|
+
};
|
|
53058
|
+
return {
|
|
53059
|
+
left: axis(
|
|
53060
|
+
metrics.colLeft(col),
|
|
53061
|
+
metrics.colWidth(col),
|
|
53062
|
+
layout2.left,
|
|
53063
|
+
layout2.x,
|
|
53064
|
+
layout2.mainLeft,
|
|
53065
|
+
Math.max(0, layout2.width - layout2.x)
|
|
53066
|
+
),
|
|
53067
|
+
top: axis(
|
|
53068
|
+
metrics.rowTop(row2),
|
|
53069
|
+
metrics.rowHeight(row2),
|
|
53070
|
+
layout2.top,
|
|
53071
|
+
layout2.y,
|
|
53072
|
+
layout2.mainTop,
|
|
53073
|
+
Math.max(0, layout2.height - layout2.y)
|
|
53074
|
+
)
|
|
53075
|
+
};
|
|
53076
|
+
}
|
|
53077
|
+
|
|
52364
53078
|
// xlsx/write/filter-columns.ts
|
|
52365
53079
|
function criteriaOf(column2) {
|
|
52366
53080
|
const { values: values2, blank, dateGroups, custom, top10, dynamic, color: color2, icon: icon2, hiddenButton } = column2;
|
|
@@ -52522,16 +53236,14 @@ function dimensionXml(sheet) {
|
|
|
52522
53236
|
const used = usedRange(sheet);
|
|
52523
53237
|
return `<dimension ref="${used ? formatRange(used) : "A1"}"/>`;
|
|
52524
53238
|
}
|
|
52525
|
-
function splitActivePane(split2) {
|
|
52526
|
-
const both = split2.x > 0 && split2.y > 0;
|
|
52527
|
-
const valid = both ? ["topLeft", "topRight", "bottomLeft", "bottomRight"] : split2.y > 0 ? ["topLeft", "bottomLeft"] : ["topLeft", "topRight"];
|
|
52528
|
-
if (split2.activePane && valid.includes(split2.activePane)) return split2.activePane;
|
|
52529
|
-
return both ? "bottomRight" : split2.y > 0 ? "bottomLeft" : "topRight";
|
|
52530
|
-
}
|
|
52531
53239
|
function selectionXml(selection, pane) {
|
|
53240
|
+
const activeCellId = selection.ranges.findIndex(
|
|
53241
|
+
(range2) => rangeContains(range2, selection.active)
|
|
53242
|
+
);
|
|
52532
53243
|
return el("selection", {
|
|
52533
53244
|
pane,
|
|
52534
53245
|
activeCell: formatAddress(selection.active),
|
|
53246
|
+
activeCellId: activeCellId > 0 ? activeCellId : void 0,
|
|
52535
53247
|
sqref: sqref(selection.ranges) || formatAddress(selection.active)
|
|
52536
53248
|
});
|
|
52537
53249
|
}
|
|
@@ -53117,28 +53829,6 @@ function conditionalFormatsXml(formats, styles) {
|
|
|
53117
53829
|
return `<conditionalFormatting sqref="${format.ranges.map((r) => formatRange(r)).join(" ")}">${rules}</conditionalFormatting>`;
|
|
53118
53830
|
}).join("");
|
|
53119
53831
|
}
|
|
53120
|
-
function dataValidationsXml(validations) {
|
|
53121
|
-
const items = validations.filter((dv) => dv.ranges.length).map((dv) => {
|
|
53122
|
-
const hideDropDown = dv.showDropDown === false ? true : void 0;
|
|
53123
|
-
const values2 = attrs2({
|
|
53124
|
-
type: dv.type === "none" ? void 0 : dv.type,
|
|
53125
|
-
errorStyle: dv.errorStyle,
|
|
53126
|
-
operator: dv.operator,
|
|
53127
|
-
allowBlank: dv.allowBlank || void 0,
|
|
53128
|
-
showDropDown: hideDropDown,
|
|
53129
|
-
showInputMessage: dv.showInputMessage || void 0,
|
|
53130
|
-
showErrorMessage: dv.showErrorMessage || void 0,
|
|
53131
|
-
errorTitle: dv.errorTitle,
|
|
53132
|
-
error: dv.error,
|
|
53133
|
-
promptTitle: dv.promptTitle,
|
|
53134
|
-
prompt: dv.prompt,
|
|
53135
|
-
sqref: dv.ranges.map((r) => formatRange(r)).join(" ")
|
|
53136
|
-
});
|
|
53137
|
-
const formulas = (dv.formula1 !== void 0 ? formulaXml2(dv.formula1, "formula1") : "") + (dv.formula2 !== void 0 ? formulaXml2(dv.formula2, "formula2") : "");
|
|
53138
|
-
return formulas ? `<dataValidation${values2}>${formulas}</dataValidation>` : `<dataValidation${values2}/>`;
|
|
53139
|
-
});
|
|
53140
|
-
return items.length ? `<dataValidations count="${items.length}">${items.join("")}</dataValidations>` : "";
|
|
53141
|
-
}
|
|
53142
53832
|
|
|
53143
53833
|
// xlsx/write/sheet-data.ts
|
|
53144
53834
|
var MAX_CELL_TEXT = 32767;
|
|
@@ -54286,6 +54976,8 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54286
54976
|
const { writer, source: source3 } = ctx;
|
|
54287
54977
|
const name = (pattern) => writer.uniqueName(pattern, ctx.reserved);
|
|
54288
54978
|
const fromSource = source3 && sheet.partName && source3.has(sheet.partName);
|
|
54979
|
+
const sourceThreaded = fromSource ? source3.targetOfType(sheet.partName ?? "", RELATIONSHIP_TYPES.threadedComment) : void 0;
|
|
54980
|
+
const threadEnvelope = sheet.threadedCommentsXml ?? threadedCommentEnvelope(sourceThreaded ? source3?.text(sourceThreaded) : void 0);
|
|
54289
54981
|
const sourceVml = fromSource ? sourceVmlPart(source3, sheet.partName ?? "") : void 0;
|
|
54290
54982
|
const kept = source3 && sourceVml && !writer.has(sourceVml) ? stripNoteShapes(source3.text(sourceVml) ?? "") : void 0;
|
|
54291
54983
|
const base = kept && kept.kept > 0 ? kept.xml : void 0;
|
|
@@ -54310,11 +55002,13 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54310
55002
|
parseLegacyComments(legacyPart ? source3.text(legacyPart) : void 0),
|
|
54311
55003
|
parseThreadedComments(
|
|
54312
55004
|
threadedPart ? source3.text(threadedPart) : void 0,
|
|
54313
|
-
parsePersons(personsPart ? source3.text(personsPart) : void 0)
|
|
55005
|
+
parsePersons(personsPart ? source3.text(personsPart) : void 0),
|
|
55006
|
+
personsPart ? source3.text(personsPart) : void 0
|
|
54314
55007
|
)
|
|
54315
55008
|
);
|
|
54316
55009
|
const free = [legacyPart, threadedPart, vmlPart].every((p) => !p || !writer.has(p));
|
|
54317
|
-
|
|
55010
|
+
const envelope = threadedCommentEnvelope(threadedPart ? source3.text(threadedPart) : void 0);
|
|
55011
|
+
if (legacyPart && vmlPart && free && sameModel(before, sheet.comments) && (sheet.threadedCommentsXml === void 0 || sheet.threadedCommentsXml === envelope)) {
|
|
54318
55012
|
writer.carry(legacyPart);
|
|
54319
55013
|
writer.carry(vmlPart);
|
|
54320
55014
|
rels.add(RELATIONSHIP_TYPES.comments, relativeTarget(partName, legacyPart));
|
|
@@ -54328,10 +55022,20 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54328
55022
|
}
|
|
54329
55023
|
const own = base ? vmlIdmapBlocks(base) : [];
|
|
54330
55024
|
const layout2 = vmlAllocatorFor(ctx, source3).allocate(sheet.comments.length, index3 + 1, own);
|
|
54331
|
-
const parts = commentParts(
|
|
54332
|
-
|
|
54333
|
-
|
|
54334
|
-
|
|
55025
|
+
const parts = commentParts(
|
|
55026
|
+
sheet.comments,
|
|
55027
|
+
index3 + 1,
|
|
55028
|
+
ctx.persons,
|
|
55029
|
+
sheet.name,
|
|
55030
|
+
{
|
|
55031
|
+
...layout2,
|
|
55032
|
+
...base ? { base } : {}
|
|
55033
|
+
},
|
|
55034
|
+
{
|
|
55035
|
+
...threadEnvelope ? { envelope: threadEnvelope } : {},
|
|
55036
|
+
ids: ctx.commentIds ??= new CommentIds(ctx.workbook)
|
|
55037
|
+
}
|
|
55038
|
+
);
|
|
54335
55039
|
const commentsPart = name((n2) => `xl/comments${n2}.xml`);
|
|
54336
55040
|
writer.add(commentsPart, parts.comments, CONTENT_TYPES.comments);
|
|
54337
55041
|
rels.add(RELATIONSHIP_TYPES.comments, relativeTarget(partName, commentsPart));
|
|
@@ -54522,13 +55226,17 @@ function writeWorksheet(ctx, sheet, index3, partName) {
|
|
|
54522
55226
|
blocks.set("legacyDrawing", writeComments(ctx, sheet, index3, partName, rels));
|
|
54523
55227
|
blocks.set("tableParts", tableParts);
|
|
54524
55228
|
ctx.pivots?.writeSheet(writer, sheet, partName, rels);
|
|
54525
|
-
const extensions =
|
|
55229
|
+
const extensions = validationExtensionsXml(
|
|
55230
|
+
sheet,
|
|
55231
|
+
conditionalExtensionsXml(sheet),
|
|
55232
|
+
ctx.validationIds ??= /* @__PURE__ */ new Set()
|
|
55233
|
+
);
|
|
54526
55234
|
blocks.set(
|
|
54527
55235
|
"extLst",
|
|
54528
55236
|
ctx.slicers?.active ? ctx.slicers.writeSheet(sheet, partName, rels, extensions) : extensions
|
|
54529
55237
|
);
|
|
54530
55238
|
for (const [key, list2] of sheet.preserved) {
|
|
54531
|
-
if (key.startsWith("source:") || !WORKSHEET_CHILD_ORDER.includes(key) || (blocks.get(key) ?? "") !== "" || key === "extLst"
|
|
55239
|
+
if (key.startsWith("source:") || !WORKSHEET_CHILD_ORDER.includes(key) || (blocks.get(key) ?? "") !== "" || key === "extLst")
|
|
54532
55240
|
continue;
|
|
54533
55241
|
const valid = list2.filter(
|
|
54534
55242
|
(xml) => [...xml.matchAll(/\br:(?:id|embed|link|pict)="([^"]*)"/g)].every(
|
|
@@ -54804,7 +55512,7 @@ function dateFilterXml(pivot, filter2) {
|
|
|
54804
55512
|
}
|
|
54805
55513
|
|
|
54806
55514
|
// xlsx/pivot/write.ts
|
|
54807
|
-
var
|
|
55515
|
+
var TYPES4 = {
|
|
54808
55516
|
table: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
|
|
54809
55517
|
definition: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml",
|
|
54810
55518
|
records: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"
|
|
@@ -54870,14 +55578,14 @@ var PivotWritePlan = class {
|
|
|
54870
55578
|
`${NS.r}/pivotCacheRecords`,
|
|
54871
55579
|
relativeTarget(definition, records)
|
|
54872
55580
|
);
|
|
54873
|
-
writer.add(records, pivotCacheRecordsXml(pivot, cache3),
|
|
55581
|
+
writer.add(records, pivotCacheRecordsXml(pivot, cache3), TYPES4.records);
|
|
54874
55582
|
writer.add(
|
|
54875
55583
|
definition,
|
|
54876
55584
|
pivotCacheDefinitionXml(pivot, workbook, cache3, recordRel),
|
|
54877
|
-
|
|
55585
|
+
TYPES4.definition
|
|
54878
55586
|
);
|
|
54879
55587
|
writer.rels(definition, cacheRels);
|
|
54880
|
-
writer.add(table3, pivotTableXml(pivot, cacheId, cache3),
|
|
55588
|
+
writer.add(table3, pivotTableXml(pivot, cacheId, cache3), TYPES4.table);
|
|
54881
55589
|
const tableRels = new RelationshipSet();
|
|
54882
55590
|
tableRels.add(RELATIONSHIP_TYPES.pivotCacheDefinition, relativeTarget(table3, definition));
|
|
54883
55591
|
writer.rels(table3, tableRels);
|
|
@@ -56200,7 +56908,8 @@ async function saveXlsx(workbook) {
|
|
|
56200
56908
|
styles: new StyleWriter(workbook, stylesPart ? source3?.text(stylesPart) : void 0),
|
|
56201
56909
|
strings: new SharedStringTable(),
|
|
56202
56910
|
persons: new PersonRegistry(
|
|
56203
|
-
parsePersons(personsSource ? source3?.text(personsSource) : void 0)
|
|
56911
|
+
parsePersons(personsSource ? source3?.text(personsSource) : void 0),
|
|
56912
|
+
personsSource ? source3?.text(personsSource) : void 0
|
|
56204
56913
|
),
|
|
56205
56914
|
reserved,
|
|
56206
56915
|
tableIds: /* @__PURE__ */ new Set(),
|
|
@@ -56275,7 +56984,9 @@ async function saveXlsx(workbook) {
|
|
|
56275
56984
|
rels.add(RELATIONSHIP_TYPES.theme, relativeTarget(bookPart, outTheme));
|
|
56276
56985
|
if (ctx.threaded.used) {
|
|
56277
56986
|
const personsPart = personsSource ?? "xl/persons/person.xml";
|
|
56278
|
-
|
|
56987
|
+
if (personsSource) writer.carry(personsSource);
|
|
56988
|
+
if (!personsSource || ctx.persons.changed)
|
|
56989
|
+
writer.add(personsPart, ctx.persons.xml(), CONTENT_TYPES.persons);
|
|
56279
56990
|
rels.add(RELATIONSHIP_TYPES.person, relativeTarget(bookPart, personsPart));
|
|
56280
56991
|
}
|
|
56281
56992
|
writeMetadataPart(
|
|
@@ -57396,6 +58107,37 @@ function setComment(ctx, s, at2, text3, author) {
|
|
|
57396
58107
|
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
57397
58108
|
);
|
|
57398
58109
|
}
|
|
58110
|
+
function setCommentReply(ctx, s, at2, replyIndex, text3) {
|
|
58111
|
+
const sheet = sheetAt(ctx.workbook, s);
|
|
58112
|
+
const comment = sheet.comments.find((c2) => c2.address.row === at2.row && c2.address.col === at2.col);
|
|
58113
|
+
const reply = Number.isInteger(replyIndex) ? comment?.replies?.[replyIndex] : void 0;
|
|
58114
|
+
if (!reply) throw new RangeError("Comment reply not found.");
|
|
58115
|
+
if (reply.text === text3) return;
|
|
58116
|
+
ctx.run(
|
|
58117
|
+
"Edit comment",
|
|
58118
|
+
"annotations",
|
|
58119
|
+
[{ kind: "sheet", sheet: s }],
|
|
58120
|
+
() => {
|
|
58121
|
+
reply.text = text3;
|
|
58122
|
+
},
|
|
58123
|
+
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
58124
|
+
);
|
|
58125
|
+
}
|
|
58126
|
+
function setCommentResolved(ctx, s, at2, resolved) {
|
|
58127
|
+
const sheet = sheetAt(ctx.workbook, s);
|
|
58128
|
+
const comment = sheet.comments.find((c2) => c2.address.row === at2.row && c2.address.col === at2.col);
|
|
58129
|
+
if (!comment?.replies) throw new RangeError("Threaded comment not found.");
|
|
58130
|
+
if ((comment.resolved ?? false) === resolved) return;
|
|
58131
|
+
ctx.run(
|
|
58132
|
+
"Edit comment",
|
|
58133
|
+
"annotations",
|
|
58134
|
+
[{ kind: "sheet", sheet: s }],
|
|
58135
|
+
() => {
|
|
58136
|
+
comment.resolved = resolved;
|
|
58137
|
+
},
|
|
58138
|
+
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
58139
|
+
);
|
|
58140
|
+
}
|
|
57399
58141
|
function setHyperlink(ctx, s, range2, link) {
|
|
57400
58142
|
const sheet = sheetAt(ctx.workbook, s);
|
|
57401
58143
|
const r = normalizeRange(range2);
|
|
@@ -58739,6 +59481,11 @@ function pasteWidths(ctx, s, selection, cells, transpose2, cut) {
|
|
|
58739
59481
|
return dest;
|
|
58740
59482
|
}
|
|
58741
59483
|
|
|
59484
|
+
// xlsx/edit/comment-identities.ts
|
|
59485
|
+
function resetCommentIdentities(comment) {
|
|
59486
|
+
if (comment.replies) comment.regenerateThreadIds = true;
|
|
59487
|
+
}
|
|
59488
|
+
|
|
58742
59489
|
// xlsx/edit/clipboard-annotations.ts
|
|
58743
59490
|
function copyAnnotations(sheet, area) {
|
|
58744
59491
|
const relative = (at2) => ({
|
|
@@ -58780,7 +59527,9 @@ function pasteAnnotations(sheet, dest, cells, mode, transpose2, skipBlanks, cutF
|
|
|
58780
59527
|
for (const comment of cells.comments) {
|
|
58781
59528
|
const address2 = point2(comment.address);
|
|
58782
59529
|
comments.delete(key(address2));
|
|
58783
|
-
|
|
59530
|
+
const pasted = { ...structuredClone(comment), address: address2 };
|
|
59531
|
+
if (!cutFormula) resetCommentIdentities(pasted);
|
|
59532
|
+
comments.set(key(address2), pasted);
|
|
58784
59533
|
}
|
|
58785
59534
|
sheet.comments = [...comments.values()];
|
|
58786
59535
|
}
|
|
@@ -60743,7 +61492,7 @@ function applyPrint(workbook, sheet, index3, saved) {
|
|
|
60743
61492
|
|
|
60744
61493
|
// xlsx/edit/sparkline-xml.ts
|
|
60745
61494
|
var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
60746
|
-
var
|
|
61495
|
+
var URI3 = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
|
|
60747
61496
|
var COLORS2 = [
|
|
60748
61497
|
"colorSeries",
|
|
60749
61498
|
"colorNegative",
|
|
@@ -60829,15 +61578,15 @@ function appendSparklineXml(sheet, groupXml3) {
|
|
|
60829
61578
|
const doc = parseXml(source3[index3] ?? `<extLst xmlns="${NS.x}"/>`);
|
|
60830
61579
|
const root = doc.documentElement;
|
|
60831
61580
|
let ext = children(root, "ext", NS.x).find(
|
|
60832
|
-
(node2) => node2.getAttribute("uri")?.toUpperCase() ===
|
|
61581
|
+
(node2) => node2.getAttribute("uri")?.toUpperCase() === URI3.toUpperCase()
|
|
60833
61582
|
);
|
|
60834
61583
|
if (!ext) {
|
|
60835
61584
|
ext = doc.createElementNS(NS.x, "ext");
|
|
60836
|
-
ext.setAttribute("uri",
|
|
61585
|
+
ext.setAttribute("uri", URI3);
|
|
60837
61586
|
ext.setAttribute("xmlns:x14", NS.x14);
|
|
60838
61587
|
root.appendChild(ext);
|
|
60839
61588
|
}
|
|
60840
|
-
ext.setAttribute("uri",
|
|
61589
|
+
ext.setAttribute("uri", URI3);
|
|
60841
61590
|
let groups = first(ext, "sparklineGroups", NS.x14);
|
|
60842
61591
|
if (!groups) {
|
|
60843
61592
|
groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
|
|
@@ -62043,7 +62792,7 @@ function admitted(space, seriesIndex) {
|
|
|
62043
62792
|
if (!chartSeriesAnalysisSupported(space, seriesIndex))
|
|
62044
62793
|
throw new RangeError("This chart family does not support series analysis editing");
|
|
62045
62794
|
}
|
|
62046
|
-
var
|
|
62795
|
+
var TYPES5 = /* @__PURE__ */ new Set(["linear", "exp", "log", "poly", "power", "movingAvg"]);
|
|
62047
62796
|
function setChartTrendline(space, seriesIndex, index3, edit) {
|
|
62048
62797
|
admitted(space, seriesIndex);
|
|
62049
62798
|
return editChartSpace(space, (draft) => {
|
|
@@ -62057,7 +62806,7 @@ function setChartTrendline(space, seriesIndex, index3, edit) {
|
|
|
62057
62806
|
}
|
|
62058
62807
|
const next = { ...list2[index3] ?? { trendlineType: "linear" } };
|
|
62059
62808
|
if (edit.type !== void 0) {
|
|
62060
|
-
if (!
|
|
62809
|
+
if (!TYPES5.has(edit.type)) throw new RangeError("Unsupported trendline type");
|
|
62061
62810
|
next.trendlineType = edit.type;
|
|
62062
62811
|
if (edit.type !== "poly") delete next.order;
|
|
62063
62812
|
if (edit.type !== "movingAvg") delete next.period;
|
|
@@ -72756,6 +73505,7 @@ function duplicateSheet(ctx, index3) {
|
|
|
72756
73505
|
copy2.name = copyName(workbook, sheet.name);
|
|
72757
73506
|
copy2.sheetId = nextSheetId(workbook);
|
|
72758
73507
|
delete copy2.partName;
|
|
73508
|
+
for (const comment of copy2.comments) resetCommentIdentities(comment);
|
|
72759
73509
|
const pivotNames = reservedPivotNames(workbook);
|
|
72760
73510
|
for (const pivot of copy2.pivotTables ?? []) {
|
|
72761
73511
|
let suffix = 2;
|
|
@@ -73236,6 +73986,8 @@ function createEditSession(workbook, options7 = {}) {
|
|
|
73236
73986
|
setFreeze: (s, freeze) => setFreeze(ctx, s, freeze),
|
|
73237
73987
|
setSplit: (s, split2, topLeft) => setSplit(ctx, s, split2, topLeft),
|
|
73238
73988
|
setComment: (s, at2, text3, author) => setComment(ctx, s, at2, text3, author),
|
|
73989
|
+
setCommentReply: (s, at2, index3, text3) => setCommentReply(ctx, s, at2, index3, text3),
|
|
73990
|
+
setCommentResolved: (s, at2, resolved) => setCommentResolved(ctx, s, at2, resolved),
|
|
73239
73991
|
setHyperlink: (s, range2, link) => setHyperlink(ctx, s, range2, link),
|
|
73240
73992
|
addConditionalFormat: (s, cf) => addConditionalFormat(ctx, s, cf),
|
|
73241
73993
|
clearConditionalFormats: (s, range2) => clearConditionalFormats(ctx, s, range2),
|
|
@@ -73428,36 +74180,6 @@ function chartQuickLayoutPatch(chart, n2) {
|
|
|
73428
74180
|
return patch2;
|
|
73429
74181
|
}
|
|
73430
74182
|
|
|
73431
|
-
// xlsx/layout/split.ts
|
|
73432
|
-
function revealInSplit(metrics, layout2, row2, col) {
|
|
73433
|
-
const axis = (start, size, paneStart, paneSize, mainStart, mainSize) => {
|
|
73434
|
-
const inPane = paneSize > 0 && start >= paneStart && start + size <= paneStart + paneSize;
|
|
73435
|
-
if (inPane) return mainStart;
|
|
73436
|
-
if (start < mainStart) return start;
|
|
73437
|
-
if (start + size > mainStart + mainSize)
|
|
73438
|
-
return Math.max(0, Math.min(start, start + size - mainSize));
|
|
73439
|
-
return mainStart;
|
|
73440
|
-
};
|
|
73441
|
-
return {
|
|
73442
|
-
left: axis(
|
|
73443
|
-
metrics.colLeft(col),
|
|
73444
|
-
metrics.colWidth(col),
|
|
73445
|
-
layout2.left,
|
|
73446
|
-
layout2.x,
|
|
73447
|
-
layout2.mainLeft,
|
|
73448
|
-
Math.max(0, layout2.width - layout2.x)
|
|
73449
|
-
),
|
|
73450
|
-
top: axis(
|
|
73451
|
-
metrics.rowTop(row2),
|
|
73452
|
-
metrics.rowHeight(row2),
|
|
73453
|
-
layout2.top,
|
|
73454
|
-
layout2.y,
|
|
73455
|
-
layout2.mainTop,
|
|
73456
|
-
Math.max(0, layout2.height - layout2.y)
|
|
73457
|
-
)
|
|
73458
|
-
};
|
|
73459
|
-
}
|
|
73460
|
-
|
|
73461
74183
|
// xlsx/layout/sheet-queries.ts
|
|
73462
74184
|
function isOverflowTarget(sheet, row2, col) {
|
|
73463
74185
|
const cell = getCell(sheet, row2, col);
|
|
@@ -75897,6 +76619,19 @@ var MESSAGE_STRINGS = {
|
|
|
75897
76619
|
"Escriba primero un comentario.",
|
|
75898
76620
|
"\u8BF7\u5148\u952E\u5165\u6279\u6CE8\u3002"
|
|
75899
76621
|
],
|
|
76622
|
+
"Reply {number} ({author})": [
|
|
76623
|
+
"R\xE9ponse {number} ({author})",
|
|
76624
|
+
"Antwort {number} ({author})",
|
|
76625
|
+
"Respuesta {number} ({author})",
|
|
76626
|
+
"\u56DE\u590D {number}\uFF08{author}\uFF09"
|
|
76627
|
+
],
|
|
76628
|
+
Resolved: ["R\xE9solu", "Erledigt", "Resuelto", "\u5DF2\u89E3\u51B3"],
|
|
76629
|
+
"The comment changed. Reopen it and try again.": [
|
|
76630
|
+
"Le commentaire a chang\xE9. Rouvrez-le et r\xE9essayez.",
|
|
76631
|
+
"Der Kommentar wurde ge\xE4ndert. \xD6ffnen Sie ihn erneut und versuchen Sie es noch einmal.",
|
|
76632
|
+
"El comentario ha cambiado. Vuelva a abrirlo e int\xE9ntelo de nuevo.",
|
|
76633
|
+
"\u6279\u6CE8\u5DF2\u66F4\u6539\u3002\u8BF7\u91CD\u65B0\u6253\u5F00\u540E\u91CD\u8BD5\u3002"
|
|
76634
|
+
],
|
|
75900
76635
|
Unhide: ["Afficher", "Einblenden", "Mostrar", "\u53D6\u6D88\u9690\u85CF"],
|
|
75901
76636
|
"Unhide sheet:": [
|
|
75902
76637
|
"Afficher la feuille :",
|
|
@@ -76036,6 +76771,19 @@ var MESSAGE_STRINGS = {
|
|
|
76036
76771
|
|
|
76037
76772
|
// xlsx/ui/commands/i18n/navigation.ts
|
|
76038
76773
|
var NAVIGATION_STRINGS = {
|
|
76774
|
+
Web: ["Web", "Web", "Web", "\u7F51\u7EDC"],
|
|
76775
|
+
"Returns XML element or attribute values selected by XPath, as a column.": [
|
|
76776
|
+
"Renvoie dans une colonne les valeurs des \xE9l\xE9ments ou attributs XML s\xE9lectionn\xE9s par XPath.",
|
|
76777
|
+
"Gibt die mit XPath ausgew\xE4hlten XML-Element- oder Attributwerte als Spalte zur\xFCck.",
|
|
76778
|
+
"Devuelve en una columna los valores de elementos o atributos XML seleccionados mediante XPath.",
|
|
76779
|
+
"\u5C06 XPath \u9009\u4E2D\u7684 XML \u5143\u7D20\u6216\u5C5E\u6027\u503C\u8FD4\u56DE\u4E3A\u4E00\u5217\u3002"
|
|
76780
|
+
],
|
|
76781
|
+
"External formula services: CUBE*, WEBSERVICE, STOCKHISTORY, RTD, IMAGE, COPILOT, TRANSLATE and DETECTLANGUAGE": [
|
|
76782
|
+
"Services de formules externes : CUBE*, WEBSERVICE, STOCKHISTORY, RTD, IMAGE, COPILOT, TRANSLATE et DETECTLANGUAGE",
|
|
76783
|
+
"Externe Formeldienste: CUBE*, WEBSERVICE, STOCKHISTORY, RTD, IMAGE, COPILOT, TRANSLATE und DETECTLANGUAGE",
|
|
76784
|
+
"Servicios de f\xF3rmulas externos: CUBE*, WEBSERVICE, STOCKHISTORY, RTD, IMAGE, COPILOT, TRANSLATE y DETECTLANGUAGE",
|
|
76785
|
+
"\u5916\u90E8\u516C\u5F0F\u670D\u52A1\uFF1ACUBE*\u3001WEBSERVICE\u3001STOCKHISTORY\u3001RTD\u3001IMAGE\u3001COPILOT\u3001TRANSLATE \u548C DETECTLANGUAGE"
|
|
76786
|
+
],
|
|
76039
76787
|
"Sparklines (create, format and clear)": [
|
|
76040
76788
|
"Graphiques sparkline (cr\xE9ation, mise en forme et suppression)",
|
|
76041
76789
|
"Sparklines (erstellen, formatieren und l\xF6schen)",
|
|
@@ -76456,6 +77204,18 @@ var NAVIGATION_STRINGS = {
|
|
|
76456
77204
|
"Edici\xF3n de respuestas de comentarios en hilo",
|
|
76457
77205
|
"\u7F16\u8F91\u7EBF\u7A0B\u6279\u6CE8\u56DE\u590D"
|
|
76458
77206
|
],
|
|
77207
|
+
"Creating @mentions": [
|
|
77208
|
+
"Cr\xE9ation de @mentions",
|
|
77209
|
+
"Erstellen von @Erw\xE4hnungen",
|
|
77210
|
+
"Creaci\xF3n de @menciones",
|
|
77211
|
+
"\u521B\u5EFA @\u63D0\u53CA"
|
|
77212
|
+
],
|
|
77213
|
+
"Resolving and reopening comments": [
|
|
77214
|
+
"R\xE9solution et r\xE9ouverture des commentaires",
|
|
77215
|
+
"Erledigen und erneutes \xD6ffnen von Kommentaren",
|
|
77216
|
+
"Resolver y reabrir comentarios",
|
|
77217
|
+
"\u89E3\u51B3\u548C\u91CD\u65B0\u6253\u5F00\u6279\u6CE8"
|
|
77218
|
+
],
|
|
76459
77219
|
"Macros (VBA is kept in the file but never run)": [
|
|
76460
77220
|
"Macros (le code VBA est conserv\xE9 dans le fichier mais jamais ex\xE9cut\xE9)",
|
|
76461
77221
|
"Makros (VBA bleibt in der Datei erhalten, wird aber nie ausgef\xFChrt)",
|
|
@@ -85934,6 +86694,13 @@ var GridGeometry = class {
|
|
|
85934
86694
|
if (inHeaderX) return { area: "row-header", row: this.rowAtY(y), col: -1 };
|
|
85935
86695
|
return { area: "cell", row: this.rowAtY(y), col: this.colAtX(x) };
|
|
85936
86696
|
}
|
|
86697
|
+
/** Pane under the pointer, including frozen panes; independent of overlapping split cells. */
|
|
86698
|
+
paneAt(x, y) {
|
|
86699
|
+
if (this.mode === "none") return void 0;
|
|
86700
|
+
const right2 = this.frozenW > 0 && x >= this.headerW + this.frozenW;
|
|
86701
|
+
const bottom = this.frozenH > 0 && y >= this.headerH + this.frozenH;
|
|
86702
|
+
return bottom ? right2 ? "bottomRight" : "bottomLeft" : right2 ? "topRight" : "topLeft";
|
|
86703
|
+
}
|
|
85937
86704
|
/**
|
|
85938
86705
|
* A column border near `x` in the column header (for resizing): the column whose right edge
|
|
85939
86706
|
* is within `slop` pixels, or undefined.
|
|
@@ -86163,7 +86930,13 @@ function createSelectionModel(initial = initialSelection(0)) {
|
|
|
86163
86930
|
var SheetSelections = class {
|
|
86164
86931
|
saved = /* @__PURE__ */ new WeakMap();
|
|
86165
86932
|
remember(sheet, selection) {
|
|
86166
|
-
if (sheet)
|
|
86933
|
+
if (sheet) {
|
|
86934
|
+
this.saved.set(sheet, selection);
|
|
86935
|
+
sheet.view.selection = structuredClone({
|
|
86936
|
+
active: selection.active,
|
|
86937
|
+
ranges: selection.ranges
|
|
86938
|
+
});
|
|
86939
|
+
}
|
|
86167
86940
|
}
|
|
86168
86941
|
/** The remembered selection of a sheet, else the one saved in the file, else A1. */
|
|
86169
86942
|
restore(index3, workbook) {
|
|
@@ -86174,6 +86947,16 @@ var SheetSelections = class {
|
|
|
86174
86947
|
return { ...cells, sheet: index3 };
|
|
86175
86948
|
}
|
|
86176
86949
|
};
|
|
86950
|
+
function setSelectionPane(sheet, pane) {
|
|
86951
|
+
const view = sheet?.view;
|
|
86952
|
+
const window = view?.split;
|
|
86953
|
+
if (!view || !window || !pane) return;
|
|
86954
|
+
const previous = splitActivePane(window);
|
|
86955
|
+
if (previous === pane) return;
|
|
86956
|
+
if (view.selection) (window.paneSelections ??= {})[previous] = structuredClone(view.selection);
|
|
86957
|
+
delete window.paneSelections?.[pane];
|
|
86958
|
+
window.activePane = pane;
|
|
86959
|
+
}
|
|
86177
86960
|
var isWholeRows2 = (range2) => range2.start.col === 0 && range2.end.col === MAX_COL;
|
|
86178
86961
|
var isWholeCols = (range2) => range2.start.row === 0 && range2.end.row === MAX_ROW;
|
|
86179
86962
|
var columnPart = (address2) => formatAddress(address2).replace(/\d{1,10}$/u, "");
|
|
@@ -87132,6 +87915,7 @@ exports.selectionCellCount = selectionCellCount;
|
|
|
87132
87915
|
exports.selectionFormatting = selectionFormatting;
|
|
87133
87916
|
exports.selectionRef = selectionRef;
|
|
87134
87917
|
exports.setErrorRules = setErrorRules;
|
|
87918
|
+
exports.setSelectionPane = setSelectionPane;
|
|
87135
87919
|
exports.setTabHidden = setTabHidden;
|
|
87136
87920
|
exports.setTraceArrows = setTraceArrows;
|
|
87137
87921
|
exports.setWatchWindowOpen = setWatchWindowOpen;
|