@pixerate/editor 0.46.1 → 0.48.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/THIRD_PARTY_NOTICES.md +20 -0
- package/dist/agent/index.cjs +252 -34
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +19 -7
- package/dist/agent/index.d.ts +19 -7
- package/dist/agent/index.js +228 -10
- package/dist/agent/index.js.map +1 -1
- package/dist/{builtins-CZW-aYKS.d.cts → builtins-1kqwLUnb.d.cts} +2 -2
- package/dist/{builtins-DghNQbT-.d.ts → builtins-BKYlHH1s.d.ts} +2 -2
- package/dist/chart/index.cjs +1596 -1849
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +760 -548
- package/dist/chart/index.d.ts +760 -548
- package/dist/chart/index.js +1499 -1752
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-3RPOW4CS.js → chunk-2CJ3LPYQ.js} +12 -10
- package/dist/{chunk-3RPOW4CS.js.map → chunk-2CJ3LPYQ.js.map} +1 -1
- package/dist/{chunk-PQM5W7ZN.js → chunk-4FX5ACVG.js} +29 -2
- package/dist/{chunk-PQM5W7ZN.js.map → chunk-4FX5ACVG.js.map} +1 -1
- package/dist/{chunk-HHQ4XJWT.js → chunk-AMWXSYCI.js} +2 -2
- package/dist/chunk-EKYHKQPG.js +1895 -0
- package/dist/chunk-EKYHKQPG.js.map +1 -0
- package/dist/chunk-HXUL3LS7.js +113 -0
- package/dist/chunk-HXUL3LS7.js.map +1 -0
- package/dist/{chunk-ZRNHGAQT.js → chunk-JQ3BB3E6.js} +43 -1891
- package/dist/chunk-JQ3BB3E6.js.map +1 -0
- package/dist/chunk-LTUM52X6.js +4074 -0
- package/dist/chunk-LTUM52X6.js.map +1 -0
- package/dist/{chunk-J3R2OWOE.cjs → chunk-MUCYWI6W.cjs} +608 -15
- package/dist/chunk-MUCYWI6W.cjs.map +1 -0
- package/dist/chunk-PIMCHMZE.cjs +521 -0
- package/dist/chunk-PIMCHMZE.cjs.map +1 -0
- package/dist/{chunk-TK2XZK6Z.js → chunk-PKBWLEL7.js} +594 -1
- package/dist/chunk-PKBWLEL7.js.map +1 -0
- package/dist/chunk-PRSJJZBS.cjs +4074 -0
- package/dist/chunk-PRSJJZBS.cjs.map +1 -0
- package/dist/{chunk-EFDCLENW.cjs → chunk-RIWPYSKU.cjs} +29 -2
- package/dist/chunk-RIWPYSKU.cjs.map +1 -0
- package/dist/chunk-U6IZKC7B.cjs +113 -0
- package/dist/chunk-U6IZKC7B.cjs.map +1 -0
- package/dist/{chunk-EWCOFSCQ.cjs → chunk-UN33YOXW.cjs} +252 -2100
- package/dist/chunk-UN33YOXW.cjs.map +1 -0
- package/dist/{chunk-Q25ZS4F7.js → chunk-VKPEPWKZ.js} +72 -92
- package/dist/chunk-VKPEPWKZ.js.map +1 -0
- package/dist/{chunk-N4MLNJPO.cjs → chunk-WXEHCVJQ.cjs} +160 -180
- package/dist/chunk-WXEHCVJQ.cjs.map +1 -0
- package/dist/{chunk-K2LVZ4FA.cjs → chunk-XFYUFVAX.cjs} +3 -3
- package/dist/{chunk-K2LVZ4FA.cjs.map → chunk-XFYUFVAX.cjs.map} +1 -1
- package/dist/chunk-XP5IUZUO.cjs +1895 -0
- package/dist/chunk-XP5IUZUO.cjs.map +1 -0
- package/dist/chunk-XUUD43OV.js +521 -0
- package/dist/chunk-XUUD43OV.js.map +1 -0
- package/dist/{chunk-U7VGDSNY.cjs → chunk-YU4WQE5M.cjs} +101 -99
- package/dist/chunk-YU4WQE5M.cjs.map +1 -0
- package/dist/commands/index.cjs +93 -11
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +9 -7
- package/dist/commands/index.d.ts +9 -7
- package/dist/commands/index.js +92 -10
- package/dist/commands/index.js.map +1 -1
- package/dist/controller-ChjCCMLl.d.cts +822 -0
- package/dist/controller-DtbEo3om.d.ts +822 -0
- package/dist/extensions/index.cjs +32 -3
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +5 -2
- package/dist/extensions/index.d.ts +5 -2
- package/dist/extensions/index.js +31 -2
- package/dist/generation/index.cjs +2 -2
- package/dist/generation/index.js +1 -1
- package/dist/{index-CfOQf70b.d.cts → index-DoHqT1mq.d.cts} +222 -5
- package/dist/{index-jwJ_onWf.d.ts → index-YLZ0fKqE.d.ts} +222 -5
- package/dist/index.cjs +38 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +52 -24
- package/dist/index.js.map +1 -1
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/{registry-vz6HOiiy.d.cts → registry-CaR7LC6W.d.cts} +2 -0
- package/dist/{registry-BfVD-vVg.d.ts → registry-rVtFJjRM.d.ts} +2 -0
- package/dist/spreadsheet/index.cjs +5 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.js +24 -22
- package/dist/tools/index.cjs +3 -3
- package/dist/tools/index.js +2 -2
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/package.json +2 -1
- package/dist/chunk-EFDCLENW.cjs.map +0 -1
- package/dist/chunk-EWCOFSCQ.cjs.map +0 -1
- package/dist/chunk-J3R2OWOE.cjs.map +0 -1
- package/dist/chunk-N4MLNJPO.cjs.map +0 -1
- package/dist/chunk-Q25ZS4F7.js.map +0 -1
- package/dist/chunk-TK2XZK6Z.js.map +0 -1
- package/dist/chunk-U7VGDSNY.cjs.map +0 -1
- package/dist/chunk-ZRNHGAQT.js.map +0 -1
- /package/dist/{chunk-HHQ4XJWT.js.map → chunk-AMWXSYCI.js.map} +0 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkUN33YOXWcjs = require('./chunk-UN33YOXW.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
|
|
30
|
+
var _chunkXP5IUZUOcjs = require('./chunk-XP5IUZUO.cjs');
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
|
|
@@ -72,22 +74,22 @@ function extractCellDependencies(node) {
|
|
|
72
74
|
deps.push({ col: curr.col, row: curr.row, ...sheet });
|
|
73
75
|
} else if (curr.type === "SpillRef") {
|
|
74
76
|
deps.push({ col: curr.col, row: curr.row, ...sheet });
|
|
75
|
-
} else if (curr.type === "Range" && curr.endRow >=
|
|
76
|
-
const startC =
|
|
77
|
-
const endC =
|
|
77
|
+
} else if (curr.type === "Range" && curr.endRow >= _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW) {
|
|
78
|
+
const startC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.startCol);
|
|
79
|
+
const endC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.endCol);
|
|
78
80
|
for (let c = Math.min(startC, endC); c <= Math.max(startC, endC); c++) {
|
|
79
|
-
deps.push({ col:
|
|
81
|
+
deps.push({ col: _chunkXP5IUZUOcjs.indexToColName.call(void 0, c), row: 0, ...sheet });
|
|
80
82
|
}
|
|
81
83
|
} else if (curr.type === "Range") {
|
|
82
|
-
const startC =
|
|
83
|
-
const endC =
|
|
84
|
+
const startC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.startCol);
|
|
85
|
+
const endC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.endCol);
|
|
84
86
|
const minC = Math.min(startC, endC);
|
|
85
87
|
const maxC = Math.max(startC, endC);
|
|
86
88
|
const minR = Math.min(curr.startRow, curr.endRow);
|
|
87
89
|
const maxR = Math.max(curr.startRow, curr.endRow);
|
|
88
90
|
for (let c = minC; c <= maxC; c++) {
|
|
89
91
|
for (let r = minR; r <= maxR; r++) {
|
|
90
|
-
deps.push({ col:
|
|
92
|
+
deps.push({ col: _chunkXP5IUZUOcjs.indexToColName.call(void 0, c), row: r, ...sheet });
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
} else if (curr.type === "BinaryOp") {
|
|
@@ -117,15 +119,15 @@ function extractReferenceDependencies(node) {
|
|
|
117
119
|
deps.push({ kind: "cell", col: curr.col.toUpperCase(), row: curr.row, ...sheet });
|
|
118
120
|
break;
|
|
119
121
|
case "Range": {
|
|
120
|
-
const startC =
|
|
121
|
-
const endC =
|
|
122
|
-
const whole = curr.endRow >=
|
|
122
|
+
const startC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.startCol);
|
|
123
|
+
const endC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, curr.endCol);
|
|
124
|
+
const whole = curr.endRow >= _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW;
|
|
123
125
|
deps.push({
|
|
124
126
|
kind: "range",
|
|
125
|
-
startCol:
|
|
126
|
-
endCol:
|
|
127
|
+
startCol: _chunkXP5IUZUOcjs.indexToColName.call(void 0, Math.min(startC, endC)),
|
|
128
|
+
endCol: _chunkXP5IUZUOcjs.indexToColName.call(void 0, Math.max(startC, endC)),
|
|
127
129
|
startRow: whole ? 1 : Math.min(curr.startRow, curr.endRow),
|
|
128
|
-
endRow: whole ?
|
|
130
|
+
endRow: whole ? _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW : Math.max(curr.startRow, curr.endRow),
|
|
129
131
|
...sheet
|
|
130
132
|
});
|
|
131
133
|
break;
|
|
@@ -251,19 +253,19 @@ function parseKey(key) {
|
|
|
251
253
|
const sheet = bang < 0 ? "" : key.slice(0, bang);
|
|
252
254
|
const ref = bang < 0 ? key : key.slice(bang + 1);
|
|
253
255
|
let m = CELL_KEY.exec(ref);
|
|
254
|
-
if (m) return { kind: "cell", sheet, col:
|
|
256
|
+
if (m) return { kind: "cell", sheet, col: _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[1]), row: Number(m[2]) };
|
|
255
257
|
m = RANGE_KEY.exec(ref);
|
|
256
258
|
if (m) {
|
|
257
|
-
const ca =
|
|
258
|
-
const cb =
|
|
259
|
+
const ca = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[1]);
|
|
260
|
+
const cb = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[3]);
|
|
259
261
|
const ra = Number(m[2]);
|
|
260
262
|
const rb = Number(m[4]);
|
|
261
263
|
return { kind: "range", sheet, c0: Math.min(ca, cb), c1: Math.max(ca, cb), r0: Math.min(ra, rb), r1: Math.max(ra, rb) };
|
|
262
264
|
}
|
|
263
265
|
m = COLUMN_KEY.exec(ref);
|
|
264
266
|
if (m) {
|
|
265
|
-
const c =
|
|
266
|
-
return { kind: "range", sheet, c0: c, c1: c, r0: 1, r1:
|
|
267
|
+
const c = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[1]);
|
|
268
|
+
return { kind: "range", sheet, c0: c, c1: c, r0: 1, r1: _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW };
|
|
267
269
|
}
|
|
268
270
|
return { kind: "opaque" };
|
|
269
271
|
}
|
|
@@ -350,7 +352,7 @@ var DependencyGraph = (_class2 = class {constructor() { _class2.prototype.__init
|
|
|
350
352
|
node.ranges.push({ key: dep, sheet: parsed.sheet, c0: parsed.c0, c1: parsed.c1, r0: parsed.r0, r1: parsed.r1 });
|
|
351
353
|
continue;
|
|
352
354
|
}
|
|
353
|
-
const cell = parsed.kind === "range" ? `${parsed.sheet === "" ? "" : `${parsed.sheet}!`}${
|
|
355
|
+
const cell = parsed.kind === "range" ? `${parsed.sheet === "" ? "" : `${parsed.sheet}!`}${_chunkXP5IUZUOcjs.indexToColName.call(void 0, parsed.c0)}${parsed.r0}` : dep;
|
|
354
356
|
node.cells.add(cell);
|
|
355
357
|
}
|
|
356
358
|
if (node.cells.size === 0 && node.ranges.length === 0) {
|
|
@@ -401,7 +403,7 @@ var DependencyGraph = (_class2 = class {constructor() { _class2.prototype.__init
|
|
|
401
403
|
}
|
|
402
404
|
let ast;
|
|
403
405
|
try {
|
|
404
|
-
ast =
|
|
406
|
+
ast = _chunkUN33YOXWcjs.parseFormula.call(void 0, formulaStr);
|
|
405
407
|
} catch (e2) {
|
|
406
408
|
this.setCellDependencies(key, []);
|
|
407
409
|
return;
|
|
@@ -409,7 +411,7 @@ var DependencyGraph = (_class2 = class {constructor() { _class2.prototype.__init
|
|
|
409
411
|
const keys = [];
|
|
410
412
|
for (const dep of extractReferenceDependencies(ast)) {
|
|
411
413
|
keys.push(
|
|
412
|
-
dep.kind === "cell" ? `${dep.col}${dep.row}` : dep.endRow >=
|
|
414
|
+
dep.kind === "cell" ? `${dep.col}${dep.row}` : dep.endRow >= _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW && dep.startCol === dep.endCol ? columnDependencyKey(dep.startCol) : rangeDependencyKey(dep.startCol, dep.startRow, dep.endCol, dep.endRow)
|
|
413
415
|
);
|
|
414
416
|
}
|
|
415
417
|
this.setCellDependencies(key, keys);
|
|
@@ -718,19 +720,19 @@ function parsePart(text) {
|
|
|
718
720
|
if (cell) {
|
|
719
721
|
return {
|
|
720
722
|
colAbs: cell[1],
|
|
721
|
-
col:
|
|
723
|
+
col: _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, cell[2]),
|
|
722
724
|
rowAbs: cell[3],
|
|
723
725
|
row: parseInt(cell[4], 10) - 1
|
|
724
726
|
};
|
|
725
727
|
}
|
|
726
728
|
const column = COLUMN_PART.exec(text);
|
|
727
729
|
if (column) {
|
|
728
|
-
return { colAbs: column[1], col:
|
|
730
|
+
return { colAbs: column[1], col: _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, column[2]), rowAbs: "", row: null };
|
|
729
731
|
}
|
|
730
732
|
return null;
|
|
731
733
|
}
|
|
732
734
|
function formatPart(part) {
|
|
733
|
-
const col = `${part.colAbs}${
|
|
735
|
+
const col = `${part.colAbs}${_chunkXP5IUZUOcjs.indexToColName.call(void 0, part.col)}`;
|
|
734
736
|
return part.row === null ? col : `${col}${part.rowAbs}${part.row + 1}`;
|
|
735
737
|
}
|
|
736
738
|
function shiftCoordinate(value, change) {
|
|
@@ -780,7 +782,7 @@ function mapFormulaReferences(formula, rewrite) {
|
|
|
780
782
|
if (!formula.startsWith("=")) return formula;
|
|
781
783
|
let tokens;
|
|
782
784
|
try {
|
|
783
|
-
tokens =
|
|
785
|
+
tokens = _chunkUN33YOXWcjs.tokenizeFormula.call(void 0, formula);
|
|
784
786
|
} catch (e3) {
|
|
785
787
|
return formula;
|
|
786
788
|
}
|
|
@@ -909,7 +911,7 @@ function formatSheetPrefix(sheet, sheetEnd) {
|
|
|
909
911
|
function tokensOf(formula) {
|
|
910
912
|
if (!formula.startsWith("=")) return null;
|
|
911
913
|
try {
|
|
912
|
-
return
|
|
914
|
+
return _chunkUN33YOXWcjs.tokenizeFormula.call(void 0, formula);
|
|
913
915
|
} catch (e4) {
|
|
914
916
|
return null;
|
|
915
917
|
}
|
|
@@ -1039,7 +1041,7 @@ function innermostCall(stack) {
|
|
|
1039
1041
|
}
|
|
1040
1042
|
var toSuggestion = (def) => ({
|
|
1041
1043
|
name: def.name,
|
|
1042
|
-
signature:
|
|
1044
|
+
signature: _chunkUN33YOXWcjs.getFormulaSignature.call(void 0, def),
|
|
1043
1045
|
description: def.description,
|
|
1044
1046
|
category: def.category
|
|
1045
1047
|
});
|
|
@@ -1058,21 +1060,21 @@ function getFormulaHints(input, caret = input.length, options = {}) {
|
|
|
1058
1060
|
}));
|
|
1059
1061
|
suggestions = [
|
|
1060
1062
|
...names,
|
|
1061
|
-
...
|
|
1063
|
+
..._chunkUN33YOXWcjs.searchFormulaFunctions.call(void 0, query, { limit: void 0 }).filter((def) => def.name.startsWith(query) && !names.some((n) => n.name.toUpperCase() === def.name)).map(toSuggestion)
|
|
1062
1064
|
].slice(0, _nullishCoalesce(options.limit, () => ( 8)));
|
|
1063
1065
|
const followedByParen = input.slice(context.prefix.end).trimStart().startsWith("(");
|
|
1064
1066
|
if (followedByParen || suggestions.length === 1 && suggestions[0].name.toUpperCase() === query) suggestions = [];
|
|
1065
1067
|
}
|
|
1066
1068
|
let activeCall = null;
|
|
1067
1069
|
if (context.call) {
|
|
1068
|
-
const def =
|
|
1070
|
+
const def = _chunkUN33YOXWcjs.getFormulaFunction.call(void 0, context.call.name);
|
|
1069
1071
|
if (def) {
|
|
1070
|
-
const specIndex =
|
|
1072
|
+
const specIndex = _chunkUN33YOXWcjs.getFormulaArgumentSpecIndex.call(void 0, def, context.call.argIndex);
|
|
1071
1073
|
activeCall = {
|
|
1072
1074
|
name: def.name,
|
|
1073
|
-
signature:
|
|
1075
|
+
signature: _chunkUN33YOXWcjs.getFormulaSignature.call(void 0, def),
|
|
1074
1076
|
description: def.description,
|
|
1075
|
-
parts:
|
|
1077
|
+
parts: _chunkUN33YOXWcjs.getFormulaSignatureParts.call(void 0, def, context.call.argIndex),
|
|
1076
1078
|
argIndex: context.call.argIndex,
|
|
1077
1079
|
argument: specIndex >= 0 ? def.args[specIndex] : null
|
|
1078
1080
|
};
|
|
@@ -1120,7 +1122,7 @@ function numberFormatForCellFormat(format) {
|
|
|
1120
1122
|
}
|
|
1121
1123
|
}
|
|
1122
1124
|
function cellFormatForNumberFormat(code) {
|
|
1123
|
-
switch (
|
|
1125
|
+
switch (_chunkXP5IUZUOcjs.NumberFormat.parseCached(code).kind()) {
|
|
1124
1126
|
case "number":
|
|
1125
1127
|
case "fraction":
|
|
1126
1128
|
case "scientific":
|
|
@@ -1139,7 +1141,7 @@ function cellFormatForNumberFormat(code) {
|
|
|
1139
1141
|
return void 0;
|
|
1140
1142
|
}
|
|
1141
1143
|
}
|
|
1142
|
-
var isGeneralNumberFormat = (code) => code === void 0 ||
|
|
1144
|
+
var isGeneralNumberFormat = (code) => code === void 0 || _chunkXP5IUZUOcjs.NumberFormat.parseCached(code).isGeneral();
|
|
1143
1145
|
|
|
1144
1146
|
// src/spreadsheet/formula/format.ts
|
|
1145
1147
|
function formatCellForDisplay(cell) {
|
|
@@ -1147,16 +1149,16 @@ function formatCellForDisplay(cell) {
|
|
|
1147
1149
|
if (cell.error) return { text: cell.error, numeric: false };
|
|
1148
1150
|
const { value } = cell;
|
|
1149
1151
|
const code = _nullishCoalesce(cell.numberFormat, () => ( (typeof value === "number" ? numberFormatForCellFormat(cell.format) : void 0)));
|
|
1150
|
-
if (code !== void 0 && !isGeneralNumberFormat(code) && !
|
|
1151
|
-
return
|
|
1152
|
+
if (code !== void 0 && !isGeneralNumberFormat(code) && !_chunkXP5IUZUOcjs.isBlank.call(void 0, value) && typeof value !== "boolean") {
|
|
1153
|
+
return _chunkXP5IUZUOcjs.NumberFormat.parseCached(code).format(value);
|
|
1152
1154
|
}
|
|
1153
|
-
return { text:
|
|
1155
|
+
return { text: _chunkXP5IUZUOcjs.toText.call(void 0, value), numeric: typeof value === "number" };
|
|
1154
1156
|
}
|
|
1155
1157
|
function formatCellDisplay(cell) {
|
|
1156
1158
|
return formatCellForDisplay(cell).text;
|
|
1157
1159
|
}
|
|
1158
1160
|
function formatValueWithCode(value, format) {
|
|
1159
|
-
const result =
|
|
1161
|
+
const result = _chunkXP5IUZUOcjs.formatTextFunction.call(void 0, value, format);
|
|
1160
1162
|
return "text" in result ? result.text : null;
|
|
1161
1163
|
}
|
|
1162
1164
|
|
|
@@ -1334,28 +1336,28 @@ function compareCellValues(a, b, direction = "asc") {
|
|
|
1334
1336
|
const bBlank = isBlankValue(b);
|
|
1335
1337
|
if (aBlank || bBlank) return aBlank === bBlank ? 0 : aBlank ? 1 : -1;
|
|
1336
1338
|
let result;
|
|
1337
|
-
if (isPlainText(a) && isPlainText(b) && !(
|
|
1339
|
+
if (isPlainText(a) && isPlainText(b) && !(_chunkXP5IUZUOcjs.parseIsoDate.call(void 0, a) && _chunkXP5IUZUOcjs.parseIsoDate.call(void 0, b))) {
|
|
1338
1340
|
result = compareText(a, b);
|
|
1339
1341
|
} else {
|
|
1340
|
-
result =
|
|
1342
|
+
result = _chunkXP5IUZUOcjs.sortCompareValues.call(void 0, a, b);
|
|
1341
1343
|
}
|
|
1342
1344
|
if (result === 0) return 0;
|
|
1343
1345
|
return direction === "desc" ? -Math.sign(result) : Math.sign(result);
|
|
1344
1346
|
}
|
|
1345
|
-
var isPlainText = (value) => typeof value === "string" && !
|
|
1347
|
+
var isPlainText = (value) => typeof value === "string" && !_chunkXP5IUZUOcjs.isFormulaError.call(void 0, value);
|
|
1346
1348
|
function filterValue(value) {
|
|
1347
|
-
if (isBlankValue(value) ||
|
|
1349
|
+
if (isBlankValue(value) || _chunkXP5IUZUOcjs.isFormulaError.call(void 0, value)) return null;
|
|
1348
1350
|
if (typeof value === "number") return Number.isFinite(value) ? { value, kind: "number" } : null;
|
|
1349
1351
|
if (typeof value === "boolean") return { value, kind: "boolean" };
|
|
1350
|
-
const num =
|
|
1352
|
+
const num = _chunkXP5IUZUOcjs.numericValue.call(void 0, value);
|
|
1351
1353
|
if (num !== null) return { value: num, kind: "number" };
|
|
1352
1354
|
const text = String(value);
|
|
1353
|
-
return { value: text, kind:
|
|
1355
|
+
return { value: text, kind: _chunkXP5IUZUOcjs.parseIsoDate.call(void 0, text) ? "number" : "text" };
|
|
1354
1356
|
}
|
|
1355
1357
|
function filterOperand(operand) {
|
|
1356
1358
|
if (typeof operand !== "string") return filterValue(operand);
|
|
1357
1359
|
if (operand.trim() === "") return null;
|
|
1358
|
-
const parsed =
|
|
1360
|
+
const parsed = _chunkXP5IUZUOcjs.parseCellInput.call(void 0, operand.trim());
|
|
1359
1361
|
if (parsed.type === "number" || parsed.type === "date" || parsed.type === "boolean") return filterValue(parsed.value);
|
|
1360
1362
|
return { value: operand, kind: "text" };
|
|
1361
1363
|
}
|
|
@@ -1363,7 +1365,7 @@ function compareForFilter(value, operand) {
|
|
|
1363
1365
|
const a = filterValue(value);
|
|
1364
1366
|
const b = filterOperand(operand);
|
|
1365
1367
|
if (!a || !b || a.kind !== b.kind) return null;
|
|
1366
|
-
return
|
|
1368
|
+
return _chunkXP5IUZUOcjs.compareValues.call(void 0, a.value, b.value);
|
|
1367
1369
|
}
|
|
1368
1370
|
function looselyEquals(value, operand) {
|
|
1369
1371
|
const c = compareForFilter(value, operand);
|
|
@@ -1442,7 +1444,7 @@ function classifyFillValue(raw) {
|
|
|
1442
1444
|
if (raw.trim() === "") return { kind: "blank" };
|
|
1443
1445
|
const num = toNumber(raw);
|
|
1444
1446
|
if (num !== null) return { kind: "number", value: num };
|
|
1445
|
-
const typed =
|
|
1447
|
+
const typed = _chunkXP5IUZUOcjs.parseCellInput.call(void 0, raw);
|
|
1446
1448
|
const date = ISO_DATE_PATTERN.exec(typed.type === "date" ? String(typed.value) : raw.trim());
|
|
1447
1449
|
if (date) {
|
|
1448
1450
|
const [year, month, day] = [Number(date[1]), Number(date[2]), Number(date[3])];
|
|
@@ -1780,8 +1782,8 @@ function forEachRangeCell(ranges, rowCount, colCount, fn) {
|
|
|
1780
1782
|
function formatRuleRanges(ranges) {
|
|
1781
1783
|
return ranges.map((range) => {
|
|
1782
1784
|
const r = normalizeRange(range);
|
|
1783
|
-
const start = `${
|
|
1784
|
-
const end = `${
|
|
1785
|
+
const start = `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, r.startCol)}${r.startRow + 1}`;
|
|
1786
|
+
const end = `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, r.endCol)}${r.endRow + 1}`;
|
|
1785
1787
|
return start === end ? start : `${start}:${end}`;
|
|
1786
1788
|
}).join(", ");
|
|
1787
1789
|
}
|
|
@@ -1794,9 +1796,9 @@ function parseRuleRanges(text) {
|
|
|
1794
1796
|
const m = A1_RANGE.exec(part);
|
|
1795
1797
|
if (!m) return null;
|
|
1796
1798
|
const startRow = Number(m[2]) - 1;
|
|
1797
|
-
const startCol =
|
|
1799
|
+
const startCol = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[1]);
|
|
1798
1800
|
const endRow = m[4] ? Number(m[4]) - 1 : startRow;
|
|
1799
|
-
const endCol = m[3] ?
|
|
1801
|
+
const endCol = m[3] ? _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, m[3]) : startCol;
|
|
1800
1802
|
if (startRow < 0 || endRow < 0 || startCol < 0 || endCol < 0) return null;
|
|
1801
1803
|
out.push(normalizeRange({ startRow, startCol, endRow, endCol }));
|
|
1802
1804
|
}
|
|
@@ -2025,7 +2027,7 @@ function conditionalFormatNumber(value) {
|
|
|
2025
2027
|
if (typeof value !== "string" || value.length < 8 || value.length > 19) return null;
|
|
2026
2028
|
const m = ISO_DATE.exec(value);
|
|
2027
2029
|
if (!m) return null;
|
|
2028
|
-
const serial =
|
|
2030
|
+
const serial = _chunkXP5IUZUOcjs.serialFromYmd.call(void 0, Number(m[1]), Number(m[2]), Number(m[3]));
|
|
2029
2031
|
if (serial === null) return null;
|
|
2030
2032
|
const time = m[4] ? (Number(m[4]) * 3600 + Number(m[5]) * 60 + Number(_nullishCoalesce(m[6], () => ( 0)))) / 86400 : 0;
|
|
2031
2033
|
return serial + time;
|
|
@@ -2033,7 +2035,7 @@ function conditionalFormatNumber(value) {
|
|
|
2033
2035
|
function valueText(value) {
|
|
2034
2036
|
if (isBlank2(value)) return "";
|
|
2035
2037
|
if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
|
|
2036
|
-
if (typeof value === "number") return
|
|
2038
|
+
if (typeof value === "number") return _chunkXP5IUZUOcjs.numberToText.call(void 0, value);
|
|
2037
2039
|
return String(value);
|
|
2038
2040
|
}
|
|
2039
2041
|
function firstValue(value) {
|
|
@@ -2247,7 +2249,7 @@ var ConditionalFormatEngine = (_class4 = class {
|
|
|
2247
2249
|
operand(text, rule, row, col) {
|
|
2248
2250
|
if (text === void 0) return "";
|
|
2249
2251
|
if (isFormulaText2(text)) return this.evalFormula(text, rule, row, col);
|
|
2250
|
-
return
|
|
2252
|
+
return _chunkXP5IUZUOcjs.parseCellInput.call(void 0, text).value;
|
|
2251
2253
|
}
|
|
2252
2254
|
/** Combines every rule that applies to (row, col). */
|
|
2253
2255
|
computeLook(rules, row, col) {
|
|
@@ -2279,7 +2281,7 @@ var ConditionalFormatEngine = (_class4 = class {
|
|
|
2279
2281
|
* scale fill, bar or icon on `out`, or null.
|
|
2280
2282
|
*/
|
|
2281
2283
|
matchRule(rule, v, row, col, out) {
|
|
2282
|
-
const error =
|
|
2284
|
+
const error = _chunkXP5IUZUOcjs.isFormulaError.call(void 0, v);
|
|
2283
2285
|
switch (rule.type) {
|
|
2284
2286
|
case "cellIs": {
|
|
2285
2287
|
if (error) return null;
|
|
@@ -2287,18 +2289,18 @@ var ConditionalFormatEngine = (_class4 = class {
|
|
|
2287
2289
|
let ok;
|
|
2288
2290
|
if (rule.operator === "between" || rule.operator === "notBetween") {
|
|
2289
2291
|
const b = this.operand(rule.value2, rule, row, col);
|
|
2290
|
-
const [lo, hi] =
|
|
2291
|
-
const inside =
|
|
2292
|
+
const [lo, hi] = _chunkXP5IUZUOcjs.compareValues.call(void 0, a, b) > 0 ? [b, a] : [a, b];
|
|
2293
|
+
const inside = _chunkXP5IUZUOcjs.compareValues.call(void 0, v, lo) >= 0 && _chunkXP5IUZUOcjs.compareValues.call(void 0, v, hi) <= 0;
|
|
2292
2294
|
ok = rule.operator === "between" ? inside : !inside;
|
|
2293
2295
|
} else {
|
|
2294
|
-
if (
|
|
2295
|
-
const cmp =
|
|
2296
|
+
if (_chunkXP5IUZUOcjs.isFormulaError.call(void 0, a)) return null;
|
|
2297
|
+
const cmp = _chunkXP5IUZUOcjs.compareValues.call(void 0, v, a);
|
|
2296
2298
|
ok = rule.operator === "equal" ? cmp === 0 : rule.operator === "notEqual" ? cmp !== 0 : rule.operator === "greaterThan" ? cmp > 0 : rule.operator === "lessThan" ? cmp < 0 : rule.operator === "greaterThanOrEqual" ? cmp >= 0 : cmp <= 0;
|
|
2297
2299
|
}
|
|
2298
2300
|
return ok ? rule.style : null;
|
|
2299
2301
|
}
|
|
2300
2302
|
case "expression": {
|
|
2301
|
-
const result =
|
|
2303
|
+
const result = _chunkXP5IUZUOcjs.toBoolean.call(void 0, this.evalFormula(rule.formula, rule, row, col));
|
|
2302
2304
|
return result === true ? rule.style : null;
|
|
2303
2305
|
}
|
|
2304
2306
|
case "containsText":
|
|
@@ -2402,10 +2404,10 @@ var ConditionalFormatEngine = (_class4 = class {
|
|
|
2402
2404
|
}
|
|
2403
2405
|
}, _class4);
|
|
2404
2406
|
function matchesTimePeriod(period, d, today) {
|
|
2405
|
-
const t =
|
|
2407
|
+
const t = _chunkXP5IUZUOcjs.serialFromYmd.call(void 0, today.getFullYear(), today.getMonth() + 1, today.getDate());
|
|
2406
2408
|
if (t === null) return false;
|
|
2407
2409
|
const weekStart = t - today.getDay();
|
|
2408
|
-
const date =
|
|
2410
|
+
const date = _chunkXP5IUZUOcjs.serialToDate.call(void 0, d);
|
|
2409
2411
|
const monthOffset = (k) => {
|
|
2410
2412
|
if (!date) return false;
|
|
2411
2413
|
const m = today.getMonth() + k;
|
|
@@ -2708,7 +2710,7 @@ var isBlank3 = (v) => v === "" || v === null || v === void 0;
|
|
|
2708
2710
|
function valueText2(value) {
|
|
2709
2711
|
if (isBlank3(value)) return "";
|
|
2710
2712
|
if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
|
|
2711
|
-
if (typeof value === "number") return
|
|
2713
|
+
if (typeof value === "number") return _chunkXP5IUZUOcjs.numberToText.call(void 0, value);
|
|
2712
2714
|
return String(value);
|
|
2713
2715
|
}
|
|
2714
2716
|
function findDataValidation(rules, row, col) {
|
|
@@ -2733,7 +2735,7 @@ function getValidationListValues(sheet, rule) {
|
|
|
2733
2735
|
const result = evaluate(sheet, rule, f, anchor.row, anchor.col);
|
|
2734
2736
|
const values = Array.isArray(result) ? result : [result];
|
|
2735
2737
|
const out = [];
|
|
2736
|
-
for (const v of values) if (!isBlank3(v) && !
|
|
2738
|
+
for (const v of values) if (!isBlank3(v) && !_chunkXP5IUZUOcjs.isFormulaError.call(void 0, v)) out.push(valueText2(v));
|
|
2737
2739
|
return out;
|
|
2738
2740
|
}
|
|
2739
2741
|
const unquoted = f.length >= 2 && f.startsWith('"') && f.endsWith('"') ? f.slice(1, -1) : f;
|
|
@@ -2762,7 +2764,7 @@ function compareOp(op, n, a, b) {
|
|
|
2762
2764
|
}
|
|
2763
2765
|
function bound(sheet, rule, text, row, col, entered) {
|
|
2764
2766
|
if (text === void 0 || text.trim() === "") return null;
|
|
2765
|
-
const value = text.trim().startsWith("=") ? first(evaluate(sheet, rule, text, row, col, entered)) :
|
|
2767
|
+
const value = text.trim().startsWith("=") ? first(evaluate(sheet, rule, text, row, col, entered)) : _chunkXP5IUZUOcjs.parseCellInput.call(void 0, text.trim()).value;
|
|
2766
2768
|
return conditionalFormatNumber(value);
|
|
2767
2769
|
}
|
|
2768
2770
|
function satisfies(sheet, rule, row, col, value, text, entered) {
|
|
@@ -2773,18 +2775,18 @@ function satisfies(sheet, rule, row, col, value, text, entered) {
|
|
|
2773
2775
|
case "list": {
|
|
2774
2776
|
const typed = text.trim().toLowerCase();
|
|
2775
2777
|
return getValidationListValues(sheet, rule).some(
|
|
2776
|
-
(item) => item.toLowerCase() === typed ||
|
|
2778
|
+
(item) => item.toLowerCase() === typed || _chunkXP5IUZUOcjs.compareValues.call(void 0, _chunkXP5IUZUOcjs.parseCellInput.call(void 0, item).value, value) === 0
|
|
2777
2779
|
);
|
|
2778
2780
|
}
|
|
2779
2781
|
case "custom":
|
|
2780
|
-
return
|
|
2782
|
+
return _chunkXP5IUZUOcjs.toBoolean.call(void 0, first(evaluate(sheet, rule, _nullishCoalesce(rule.formula1, () => ( "")), row, col, entered))) === true;
|
|
2781
2783
|
case "textLength":
|
|
2782
2784
|
return compareOp(op, Array.from(text).length, bound(sheet, rule, rule.formula1, row, col, entered), bound(sheet, rule, rule.formula2, row, col, entered));
|
|
2783
2785
|
case "whole":
|
|
2784
2786
|
case "decimal":
|
|
2785
2787
|
case "date":
|
|
2786
2788
|
case "time": {
|
|
2787
|
-
if (
|
|
2789
|
+
if (_chunkXP5IUZUOcjs.isFormulaError.call(void 0, value)) return false;
|
|
2788
2790
|
let n = conditionalFormatNumber(value);
|
|
2789
2791
|
if (n === null) return false;
|
|
2790
2792
|
if (rule.type === "whole" && !Number.isInteger(n)) return false;
|
|
@@ -2813,7 +2815,7 @@ function validateCellInput(sheet, rules, row, col, input) {
|
|
|
2813
2815
|
value = first(sheet.evaluateFormula ? safeEval(sheet, input, row, col) : "#NAME?");
|
|
2814
2816
|
text = valueText2(value);
|
|
2815
2817
|
} else {
|
|
2816
|
-
value =
|
|
2818
|
+
value = _chunkXP5IUZUOcjs.parseCellInput.call(void 0, input).value;
|
|
2817
2819
|
if (input.startsWith("'")) text = input.slice(1);
|
|
2818
2820
|
}
|
|
2819
2821
|
const entered = { row, col, value };
|
|
@@ -3187,7 +3189,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3187
3189
|
if (options.dataSources) {
|
|
3188
3190
|
options.dataSources.forEach((ds) => this.binder.register(ds));
|
|
3189
3191
|
}
|
|
3190
|
-
this.evaluator = new (0,
|
|
3192
|
+
this.evaluator = new (0, _chunkUN33YOXWcjs.FormulaEvaluator)({
|
|
3191
3193
|
resolveCell: (colStr, rowNum, sheet) => this.onSheet(sheet, () => this.resolveCellByCoord(colStr, rowNum)),
|
|
3192
3194
|
resolveRange: (sCol, sRow, eCol, eRow, sheet, options2) => this.onSheet(sheet, () => this.resolveRangeByCoords(sCol, sRow, eCol, eRow, options2)),
|
|
3193
3195
|
resolveProperty: (prop) => this.resolveCurrentRowProperty(prop),
|
|
@@ -3431,7 +3433,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3431
3433
|
* number) when `format` is unset or `text` (the default of new columns).
|
|
3432
3434
|
*/
|
|
3433
3435
|
typedCell(raw, format, col, existing) {
|
|
3434
|
-
const parsed =
|
|
3436
|
+
const parsed = _chunkXP5IUZUOcjs.parseCellInput.call(void 0, raw);
|
|
3435
3437
|
const fixed = this.fixedNumberFormat(col, existing);
|
|
3436
3438
|
const numberFormat = _nullishCoalesce(fixed, () => ( parsed.numberFormat));
|
|
3437
3439
|
return {
|
|
@@ -3465,7 +3467,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3465
3467
|
if (raw.startsWith("=")) return raw;
|
|
3466
3468
|
const type = _optionalChain([this, 'access', _127 => _127.binder, 'access', _128 => _128.getDataSource, 'call', _129 => _129(dataSourceId), 'optionalAccess', _130 => _130.getFields, 'call', _131 => _131(), 'access', _132 => _132.find, 'call', _133 => _133((f) => f.key === field), 'optionalAccess', _134 => _134.type]);
|
|
3467
3469
|
if (type !== "number" && type !== "boolean" && type !== "date") return raw;
|
|
3468
|
-
const parsed =
|
|
3470
|
+
const parsed = _chunkXP5IUZUOcjs.parseCellInput.call(void 0, raw);
|
|
3469
3471
|
if (type === "number" && parsed.type === "number") return parsed.value;
|
|
3470
3472
|
if (type === "boolean" && parsed.type === "boolean") return parsed.value;
|
|
3471
3473
|
if (type === "date" && parsed.type === "date") return parsed.value;
|
|
@@ -3494,7 +3496,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3494
3496
|
r.index = idx;
|
|
3495
3497
|
});
|
|
3496
3498
|
this.document.columns.forEach((c, idx) => {
|
|
3497
|
-
c.key =
|
|
3499
|
+
c.key = _chunkXP5IUZUOcjs.indexToColName.call(void 0, idx);
|
|
3498
3500
|
});
|
|
3499
3501
|
}
|
|
3500
3502
|
getColumn(colIdOrKey) {
|
|
@@ -3523,7 +3525,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3523
3525
|
/** The column whose key is `key` (`A`, `B`, …): keys follow column positions. */
|
|
3524
3526
|
columnByKey(key) {
|
|
3525
3527
|
const upper = key.toUpperCase();
|
|
3526
|
-
const col = this.document.columns[
|
|
3528
|
+
const col = this.document.columns[_chunkXP5IUZUOcjs.colNameToIndex.call(void 0, upper)];
|
|
3527
3529
|
if (col && col.key.toUpperCase() === upper) return col;
|
|
3528
3530
|
return this.document.columns.find((c) => c.key.toUpperCase() === upper);
|
|
3529
3531
|
}
|
|
@@ -3680,7 +3682,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3680
3682
|
parseCached(formula) {
|
|
3681
3683
|
let ast = this.astCache.get(formula);
|
|
3682
3684
|
if (!ast) {
|
|
3683
|
-
ast =
|
|
3685
|
+
ast = _chunkUN33YOXWcjs.parseFormula.call(void 0, formula);
|
|
3684
3686
|
if (this.astCache.size >= AST_CACHE_SIZE) this.astCache.clear();
|
|
3685
3687
|
this.astCache.set(formula, ast);
|
|
3686
3688
|
}
|
|
@@ -3713,7 +3715,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3713
3715
|
}
|
|
3714
3716
|
for (const used of extractNameDependencies(ast)) {
|
|
3715
3717
|
if (used.call) {
|
|
3716
|
-
const fn =
|
|
3718
|
+
const fn = _chunkUN33YOXWcjs.getFormulaFunction.call(void 0, used.name);
|
|
3717
3719
|
if (fn) {
|
|
3718
3720
|
if (fn.volatile) volatile.found = true;
|
|
3719
3721
|
continue;
|
|
@@ -3729,7 +3731,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3729
3731
|
if (seenNames.has(seenKey)) continue;
|
|
3730
3732
|
seenNames.add(seenKey);
|
|
3731
3733
|
try {
|
|
3732
|
-
this.collectDependencies(
|
|
3734
|
+
this.collectDependencies(_chunkUN33YOXWcjs.parseFormula.call(void 0, def.refersTo), nameHome, out, seenNames, volatile);
|
|
3733
3735
|
} catch (e11) {
|
|
3734
3736
|
}
|
|
3735
3737
|
}
|
|
@@ -3836,7 +3838,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3836
3838
|
}
|
|
3837
3839
|
if (onActive) this.markValueChanged(located.key);
|
|
3838
3840
|
const spilled = hadSpill || this.spills.has(located.key) || (_nullishCoalesce(_optionalChain([this, 'access', _158 => _158.spillChanges, 'optionalAccess', _159 => _159.size]), () => ( 0))) !== spillChanges;
|
|
3839
|
-
this.invalidateRangeCache(located.rt.doc.id, spilled ? null :
|
|
3841
|
+
this.invalidateRangeCache(located.rt.doc.id, spilled ? null : _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, located.key.replace(/\d+$/, "")));
|
|
3840
3842
|
});
|
|
3841
3843
|
}
|
|
3842
3844
|
} finally {
|
|
@@ -3938,7 +3940,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3938
3940
|
placeSpill(anchor, row, col, array) {
|
|
3939
3941
|
const { rows, cols } = array;
|
|
3940
3942
|
const area = { startRow: row, startCol: col, endRow: row + rows - 1, endCol: col + cols - 1 };
|
|
3941
|
-
const label = `${
|
|
3943
|
+
const label = `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, area.startCol)}${area.startRow + 1}:${_chunkXP5IUZUOcjs.indexToColName.call(void 0, area.endCol)}${area.endRow + 1}`;
|
|
3942
3944
|
let reason = null;
|
|
3943
3945
|
const blockers = [];
|
|
3944
3946
|
if (area.endRow >= this.document.rows.length || area.endCol >= this.document.columns.length) {
|
|
@@ -3987,9 +3989,9 @@ var SpreadsheetController = (_class6 = class {
|
|
|
3987
3989
|
spillAnchor: anchor,
|
|
3988
3990
|
...this.fixedNumberFormatFields(column, _optionalChain([this, 'access', _164 => _164.document, 'access', _165 => _165.cells, 'access', _166 => _166[rowObj.id], 'optionalAccess', _167 => _167[column.id]]))
|
|
3989
3991
|
};
|
|
3990
|
-
if (
|
|
3992
|
+
if (_chunkXP5IUZUOcjs.isFormulaError.call(void 0, value)) {
|
|
3991
3993
|
display.error = value;
|
|
3992
|
-
display.errorMessage =
|
|
3994
|
+
display.errorMessage = _chunkUN33YOXWcjs.describeFormulaError.call(void 0, value);
|
|
3993
3995
|
}
|
|
3994
3996
|
this.spillCells.set(spillCellId(rowObj.id, column.id), display);
|
|
3995
3997
|
if (this.spilledBy.get(key) !== anchor) {
|
|
@@ -4031,7 +4033,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4031
4033
|
const record = this.spills.get(`${colStr}${rowNum}`.toUpperCase());
|
|
4032
4034
|
if (record) return { rows: record.rows, cols: record.cols, values: record.values };
|
|
4033
4035
|
const value = this.resolveCellByCoord(colStr, rowNum);
|
|
4034
|
-
return
|
|
4036
|
+
return _chunkXP5IUZUOcjs.isFormulaError.call(void 0, value) ? value : "#REF!";
|
|
4035
4037
|
}
|
|
4036
4038
|
toSpill(record) {
|
|
4037
4039
|
const row = this.document.rows[record.row];
|
|
@@ -4054,7 +4056,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4054
4056
|
*/
|
|
4055
4057
|
getSpillAt(row, col) {
|
|
4056
4058
|
if (this.spills.size === 0) return null;
|
|
4057
|
-
const key = `${
|
|
4059
|
+
const key = `${_chunkXP5IUZUOcjs.indexToColName.call(void 0, col)}${row + 1}`;
|
|
4058
4060
|
const record = _nullishCoalesce(this.spills.get(key), () => ( this.spills.get(_nullishCoalesce(this.spilledBy.get(key), () => ( "")))));
|
|
4059
4061
|
return record ? this.toSpill(record) : null;
|
|
4060
4062
|
}
|
|
@@ -4089,12 +4091,12 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4089
4091
|
* a sparse column costs one lookup per row and no array slot.
|
|
4090
4092
|
*/
|
|
4091
4093
|
resolveRangeByCoords(sCol, sRow, eCol, eRow, options) {
|
|
4092
|
-
const startC =
|
|
4093
|
-
const endC =
|
|
4094
|
+
const startC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, sCol);
|
|
4095
|
+
const endC = _chunkXP5IUZUOcjs.colNameToIndex.call(void 0, eCol);
|
|
4094
4096
|
const minC = Math.min(startC, endC);
|
|
4095
4097
|
const maxC = Math.max(startC, endC);
|
|
4096
4098
|
const minR = Math.min(sRow, eRow);
|
|
4097
|
-
const maxR = Math.min(Math.max(sRow, eRow),
|
|
4099
|
+
const maxR = Math.min(Math.max(sRow, eRow), _chunkUN33YOXWcjs.WHOLE_COLUMN_END_ROW, this.document.rows.length);
|
|
4098
4100
|
const skipBlanks = _optionalChain([options, 'optionalAccess', _177 => _177.skipBlanks]) === true;
|
|
4099
4101
|
const cacheable = this.rangeCache !== null && !this.valueOverride && (maxC - minC + 1) * (maxR - minR + 1) >= RANGE_CACHE_MIN_CELLS;
|
|
4100
4102
|
const cacheKey = cacheable ? `${this.document.id}|${minC}|${maxC}|${minR}|${maxR}|${skipBlanks ? 1 : 0}` : "";
|
|
@@ -4107,7 +4109,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4107
4109
|
const spills = this.spillCells.size > 0 ? this.spillCells : null;
|
|
4108
4110
|
const results = [];
|
|
4109
4111
|
for (let c = minC; c <= maxC; c++) {
|
|
4110
|
-
const col = this.columnByKey(
|
|
4112
|
+
const col = this.columnByKey(_chunkXP5IUZUOcjs.indexToColName.call(void 0, c));
|
|
4111
4113
|
if (!col) continue;
|
|
4112
4114
|
const plain = col.type !== "bound" && col.type !== "formula";
|
|
4113
4115
|
const colId = col.id;
|
|
@@ -4303,8 +4305,8 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4303
4305
|
const newId = _optionalChain([config, 'optionalAccess', _206 => _206.id]) || this.generateId("col");
|
|
4304
4306
|
const newCol = {
|
|
4305
4307
|
id: newId,
|
|
4306
|
-
key:
|
|
4307
|
-
title: _optionalChain([config, 'optionalAccess', _207 => _207.title]) ||
|
|
4308
|
+
key: _chunkXP5IUZUOcjs.indexToColName.call(void 0, index),
|
|
4309
|
+
title: _optionalChain([config, 'optionalAccess', _207 => _207.title]) || _chunkXP5IUZUOcjs.indexToColName.call(void 0, index),
|
|
4308
4310
|
width: _optionalChain([config, 'optionalAccess', _208 => _208.width]) || 130,
|
|
4309
4311
|
type: _optionalChain([config, 'optionalAccess', _209 => _209.type]) || "freeform",
|
|
4310
4312
|
binding: _optionalChain([config, 'optionalAccess', _210 => _210.binding]),
|
|
@@ -4463,7 +4465,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4463
4465
|
this.document.rows.push({ id: this.generateId("row"), index, height: 32, type: "freeform" });
|
|
4464
4466
|
}
|
|
4465
4467
|
while (colIndex >= this.document.columns.length) {
|
|
4466
|
-
const key =
|
|
4468
|
+
const key = _chunkXP5IUZUOcjs.indexToColName.call(void 0, this.document.columns.length);
|
|
4467
4469
|
this.document.columns.push({
|
|
4468
4470
|
id: this.generateId("col"),
|
|
4469
4471
|
key,
|
|
@@ -4914,7 +4916,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
4914
4916
|
/** The column's format, or the one typed input chose (typed cells only). */
|
|
4915
4917
|
implicitNumberFormat(cell, col, row) {
|
|
4916
4918
|
const typed = cell.raw !== "" && !cell.raw.startsWith("=") && !(col.type === "bound" && col.binding && row.recordId);
|
|
4917
|
-
return _nullishCoalesce(this.fixedNumberFormat(col, void 0), () => ( (typed ?
|
|
4919
|
+
return _nullishCoalesce(this.fixedNumberFormat(col, void 0), () => ( (typed ? _chunkXP5IUZUOcjs.parseCellInput.call(void 0, cell.raw).numberFormat : void 0)));
|
|
4918
4920
|
}
|
|
4919
4921
|
/** A copy of `cell` with `numberFormat` set, or removed when undefined. */
|
|
4920
4922
|
withNumberFormat(cell, numberFormat) {
|
|
@@ -5257,8 +5259,8 @@ var SpreadsheetController = (_class6 = class {
|
|
|
5257
5259
|
const doc = {
|
|
5258
5260
|
columns: Array.from({ length: 4 }, (_, i) => ({
|
|
5259
5261
|
id: `col_${String.fromCharCode(97 + i)}`,
|
|
5260
|
-
key:
|
|
5261
|
-
title:
|
|
5262
|
+
key: _chunkXP5IUZUOcjs.indexToColName.call(void 0, i),
|
|
5263
|
+
title: _chunkXP5IUZUOcjs.indexToColName.call(void 0, i),
|
|
5262
5264
|
width: 120,
|
|
5263
5265
|
type: "freeform"
|
|
5264
5266
|
})),
|
|
@@ -5431,7 +5433,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
5431
5433
|
if (invalid2) throw new Error(invalid2);
|
|
5432
5434
|
const formula = refersTo.trim().startsWith("=") ? refersTo.trim() : `=${refersTo.trim()}`;
|
|
5433
5435
|
try {
|
|
5434
|
-
|
|
5436
|
+
_chunkUN33YOXWcjs.parseFormula.call(void 0, formula);
|
|
5435
5437
|
} catch (err) {
|
|
5436
5438
|
throw new Error(`There's a problem with this formula: ${_nullishCoalesce(_optionalChain([err, 'optionalAccess', _312 => _312.message]), () => ( formula))}`);
|
|
5437
5439
|
}
|
|
@@ -5703,7 +5705,7 @@ var SpreadsheetController = (_class6 = class {
|
|
|
5703
5705
|
evaluateFormulaAt(formula, row, col, entered) {
|
|
5704
5706
|
const saved = { rowIndex: this.evaluatingRowIndex, cell: this.evaluatingCell, override: this.valueOverride };
|
|
5705
5707
|
this.evaluatingRowIndex = row;
|
|
5706
|
-
this.evaluatingCell = { col: _nullishCoalesce(_optionalChain([this, 'access', _343 => _343.document, 'access', _344 => _344.columns, 'access', _345 => _345[col], 'optionalAccess', _346 => _346.key]), () => (
|
|
5708
|
+
this.evaluatingCell = { col: _nullishCoalesce(_optionalChain([this, 'access', _343 => _343.document, 'access', _344 => _344.columns, 'access', _345 => _345[col], 'optionalAccess', _346 => _346.key]), () => ( _chunkXP5IUZUOcjs.indexToColName.call(void 0, col))), row: row + 1 };
|
|
5707
5709
|
this.valueOverride = _nullishCoalesce(entered, () => ( null));
|
|
5708
5710
|
try {
|
|
5709
5711
|
const result = this.evaluator.evaluateWithDiagnostics(formula.startsWith("=") ? formula : `=${formula}`);
|
|
@@ -6041,7 +6043,7 @@ function getSpreadsheetMenuItems(controller, cell) {
|
|
|
6041
6043
|
const row = doc.rows[cell.row];
|
|
6042
6044
|
if (!column || !row) return [];
|
|
6043
6045
|
const selection = controller.selectedRange && rangeContains(controller.selectedRange, cell.row, cell.col) ? normalizeRange(controller.selectedRange) : { startRow: cell.row, startCol: cell.col, endRow: cell.row, endCol: cell.col };
|
|
6044
|
-
const colName =
|
|
6046
|
+
const colName = _chunkXP5IUZUOcjs.indexToColName.call(void 0, cell.col);
|
|
6045
6047
|
const cellData = controller.getCell(row.id, column.id);
|
|
6046
6048
|
const value = cellData.value;
|
|
6047
6049
|
const table = _nullishCoalesce(doc.table, () => ( {}));
|
|
@@ -6478,7 +6480,7 @@ function getNameManagerRows(controller) {
|
|
|
6478
6480
|
value = "[LAMBDA]";
|
|
6479
6481
|
} else {
|
|
6480
6482
|
const result = controller.evaluateFormula(`=${n.name}`, n.sheetId ? { sheet: n.sheetId } : {});
|
|
6481
|
-
value = result.array ? `{${result.array.rows}\xD7${result.array.cols} array}` :
|
|
6483
|
+
value = result.array ? `{${result.array.rows}\xD7${result.array.cols} array}` : _chunkXP5IUZUOcjs.isFormulaError.call(void 0, result.value) ? String(result.value) : formatCellDisplay({ value: result.value });
|
|
6482
6484
|
}
|
|
6483
6485
|
return {
|
|
6484
6486
|
name: n.name,
|
|
@@ -6801,4 +6803,4 @@ function sameSpreadsheetViewWindow(a, b) {
|
|
|
6801
6803
|
|
|
6802
6804
|
|
|
6803
6805
|
exports.extractNameDependencies = extractNameDependencies; exports.columnDependencyKey = columnDependencyKey; exports.extractCellDependencies = extractCellDependencies; exports.extractReferenceDependencies = extractReferenceDependencies; exports.rangeDependencyKey = rangeDependencyKey; exports.IntervalIndex = IntervalIndex; exports.DependencyGraph = DependencyGraph; exports.shiftFormulaReferences = shiftFormulaReferences; exports.mapFormulaReferences = mapFormulaReferences; exports.offsetFormulaReferences = offsetFormulaReferences; exports.remapFormulaReferences = remapFormulaReferences; exports.transposeFormulaReferences = transposeFormulaReferences; exports.sheetNameNeedsQuotes = sheetNameNeedsQuotes; exports.quoteSheetName = quoteSheetName; exports.formatSheetPrefix = formatSheetPrefix; exports.renameSheetInFormula = renameSheetInFormula; exports.deleteSheetInFormula = deleteSheetInFormula; exports.renameNameInFormula = renameNameInFormula; exports.formulaIdentifiers = formulaIdentifiers; exports.getFormulaCaretContext = getFormulaCaretContext; exports.getFormulaHints = getFormulaHints; exports.applyFormulaSuggestion = applyFormulaSuggestion; exports.NUMBER_FORMAT_PRESETS = NUMBER_FORMAT_PRESETS; exports.numberFormatForCellFormat = numberFormatForCellFormat; exports.cellFormatForNumberFormat = cellFormatForNumberFormat; exports.isGeneralNumberFormat = isGeneralNumberFormat; exports.formatCellForDisplay = formatCellForDisplay; exports.formatCellDisplay = formatCellDisplay; exports.formatValueWithCode = formatValueWithCode; exports.DataSourceBinder = DataSourceBinder; exports.MAX_SHEET_NAME_LENGTH = MAX_SHEET_NAME_LENGTH; exports.MAX_DEFINED_NAME_LENGTH = MAX_DEFINED_NAME_LENGTH; exports.validateSheetName = validateSheetName; exports.nextSheetName = nextSheetName; exports.copySheetName = copySheetName; exports.validateDefinedName = validateDefinedName; exports.isLambdaDefinition = isLambdaDefinition; exports.normalizeRange = normalizeRange; exports.rangeContains = rangeContains; exports.rangesIntersect = rangesIntersect; exports.rangeContainsRange = rangeContainsRange; exports.isSingleCellRange = isSingleCellRange; exports.isBlankValue = isBlankValue; exports.toNumber = toNumber; exports.compareCellValues = compareCellValues; exports.matchesFilterRule = matchesFilterRule; exports.aggregateValues = aggregateValues; exports.roundFloat = roundFloat; exports.fillSeries = fillSeries; exports.computeFillTarget = computeFillTarget; exports.getFillDirection = getFillDirection; exports.SPREADSHEET_CLIPBOARD_MIME = SPREADSHEET_CLIPBOARD_MIME; exports.serializeHtmlTable = serializeHtmlTable; exports.parseHtmlTable = parseHtmlTable; exports.createSpreadsheetClipboardData = createSpreadsheetClipboardData; exports.readSpreadsheetClipboard = readSpreadsheetClipboard; exports.rebaseClipboardRows = rebaseClipboardRows; exports.adjustRangeForStructuralChange = adjustRangeForStructuralChange; exports.adjustRangesForStructuralChange = adjustRangesForStructuralChange; exports.subtractRange = subtractRange; exports.subtractRangeFromRanges = subtractRangeFromRanges; exports.rangesContain = rangesContain; exports.ruleAnchor = ruleAnchor; exports.ruleFormulaAt = ruleFormulaAt; exports.shiftRuleFormula = shiftRuleFormula; exports.forEachRangeCell = forEachRangeCell; exports.formatRuleRanges = formatRuleRanges; exports.parseRuleRanges = parseRuleRanges; exports.mergeRuleRanges = mergeRuleRanges; exports.sortRuleRanges = sortRuleRanges; exports.transposeRuleRanges = transposeRuleRanges; exports.reanchorRuleFormula = reanchorRuleFormula; exports.transposeRuleFormula = transposeRuleFormula; exports.mapConditionalFormatFormulas = mapConditionalFormatFormulas; exports.mapDataValidationFormulas = mapDataValidationFormulas; exports.sortRules = sortRules; exports.transposeRules = transposeRules; exports.CONDITIONAL_FORMAT_ICON_SETS = CONDITIONAL_FORMAT_ICON_SETS; exports.conditionalFormatIconCount = conditionalFormatIconCount; exports.getConditionalFormatIcon = getConditionalFormatIcon; exports.conditionalFormatNumber = conditionalFormatNumber; exports.blendConditionalFormatColors = blendConditionalFormatColors; exports.defaultIconThresholds = defaultIconThresholds; exports.EMPTY_CONDITIONAL_FORMAT_OVERLAY = EMPTY_CONDITIONAL_FORMAT_OVERLAY; exports.ConditionalFormatEngine = ConditionalFormatEngine; exports.matchesTimePeriod = matchesTimePeriod; exports.evaluateConditionalFormats = evaluateConditionalFormats; exports.describeConditionalFormat = describeConditionalFormat; exports.describeDataValidation = describeDataValidation; exports.CONDITIONAL_FORMAT_STYLE_PRESETS = CONDITIONAL_FORMAT_STYLE_PRESETS; exports.DEFAULT_CONDITIONAL_FORMAT_STYLE = DEFAULT_CONDITIONAL_FORMAT_STYLE; exports.CONDITIONAL_FORMAT_PRESETS = CONDITIONAL_FORMAT_PRESETS; exports.CONDITIONAL_FORMAT_TIME_PERIODS = CONDITIONAL_FORMAT_TIME_PERIODS; exports.createConditionalFormatRule = createConditionalFormatRule; exports.DATA_VALIDATION_TYPE_OPTIONS = DATA_VALIDATION_TYPE_OPTIONS; exports.DATA_VALIDATION_OPERATOR_OPTIONS = DATA_VALIDATION_OPERATOR_OPTIONS; exports.DATA_VALIDATION_ERROR_STYLE_OPTIONS = DATA_VALIDATION_ERROR_STYLE_OPTIONS; exports.conditionalFormatContrastColor = conditionalFormatContrastColor; exports.getConditionalFormatCss = getConditionalFormatCss; exports.getDataBarCss = getDataBarCss; exports.conditionalFormatStyleString = conditionalFormatStyleString; exports.DEFAULT_DATA_VALIDATION_MESSAGE = DEFAULT_DATA_VALIDATION_MESSAGE; exports.DEFAULT_DATA_VALIDATION_TITLE = DEFAULT_DATA_VALIDATION_TITLE; exports.findDataValidation = findDataValidation; exports.getValidationListValues = getValidationListValues; exports.validateCellInput = validateCellInput; exports.findInvalidCells = findInvalidCells; exports.DEFAULT_ROW_HEIGHT = DEFAULT_ROW_HEIGHT; exports.DEFAULT_COLUMN_WIDTH = DEFAULT_COLUMN_WIDTH; exports.getTableSections = getTableSections; exports.getRowSection = getRowSection; exports.rowPassesFilters = rowPassesFilters; exports.computeRowGroups = computeRowGroups; exports.buildSpreadsheetView = buildSpreadsheetView; exports.SpreadsheetController = SpreadsheetController; exports.runSpreadsheetMenuItem = runSpreadsheetMenuItem; exports.clampMenuPosition = clampMenuPosition; exports.getSpreadsheetMenuItems = getSpreadsheetMenuItems; exports.SPREADSHEET_TABLE_ACTIONS = SPREADSHEET_TABLE_ACTIONS; exports.bindSpreadsheetTableActions = bindSpreadsheetTableActions; exports.csvImportAdapter = csvImportAdapter; exports.tsvImportAdapter = tsvImportAdapter; exports.SPREADSHEET_IMPORT_ADAPTERS = SPREADSHEET_IMPORT_ADAPTERS; exports.registerSpreadsheetImportAdapters = registerSpreadsheetImportAdapters; exports.importFileIntoSpreadsheet = importFileIntoSpreadsheet; exports.getSheetTabMenuItems = getSheetTabMenuItems; exports.sheetDropIndex = sheetDropIndex; exports.getNameManagerRows = getNameManagerRows; exports.SPREADSHEET_COLUMN_HEADER_HEIGHT = SPREADSHEET_COLUMN_HEADER_HEIGHT; exports.SPREADSHEET_ROW_HEADER_WIDTH = SPREADSHEET_ROW_HEADER_WIDTH; exports.SPREADSHEET_GROUP_ROW_HEIGHT = SPREADSHEET_GROUP_ROW_HEIGHT; exports.SPREADSHEET_VIRTUAL_ROW_THRESHOLD = SPREADSHEET_VIRTUAL_ROW_THRESHOLD; exports.SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD = SPREADSHEET_VIRTUAL_COLUMN_THRESHOLD; exports.SPREADSHEET_DEFAULT_VIEWPORT = SPREADSHEET_DEFAULT_VIEWPORT; exports.measureSpreadsheetView = measureSpreadsheetView; exports.shouldVirtualizeSpreadsheet = shouldVirtualizeSpreadsheet; exports.fullSpreadsheetViewWindow = fullSpreadsheetViewWindow; exports.getSpreadsheetViewWindow = getSpreadsheetViewWindow; exports.getSpreadsheetScrollToCell = getSpreadsheetScrollToCell; exports.sameSpreadsheetViewWindow = sameSpreadsheetViewWindow;
|
|
6804
|
-
//# sourceMappingURL=chunk-
|
|
6806
|
+
//# sourceMappingURL=chunk-YU4WQE5M.cjs.map
|