@odoo/o-spreadsheet 16.0.20 → 16.0.21
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/o-spreadsheet.cjs.js +67 -8
- package/dist/o-spreadsheet.d.ts +5 -2
- package/dist/o-spreadsheet.esm.js +67 -8
- package/dist/o-spreadsheet.iife.js +67 -8
- package/dist/o-spreadsheet.iife.min.js +274 -274
- package/package.json +1 -1
|
@@ -319,7 +319,16 @@ const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
|
|
|
319
319
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
320
320
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
321
321
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
322
|
+
const CACHE = {};
|
|
322
323
|
function parseDateTime(str) {
|
|
324
|
+
if (CACHE[str]) {
|
|
325
|
+
return CACHE[str];
|
|
326
|
+
}
|
|
327
|
+
const date = _parseDateTime(str);
|
|
328
|
+
CACHE[str] = date;
|
|
329
|
+
return date;
|
|
330
|
+
}
|
|
331
|
+
function _parseDateTime(str) {
|
|
323
332
|
str = str.trim();
|
|
324
333
|
let time;
|
|
325
334
|
const timeMatch = str.match(timeRegexp);
|
|
@@ -2045,8 +2054,9 @@ class RangeImpl {
|
|
|
2045
2054
|
}
|
|
2046
2055
|
get zone() {
|
|
2047
2056
|
const { left, top, bottom, right } = this._zone;
|
|
2048
|
-
if (right !== undefined && bottom !== undefined)
|
|
2049
|
-
return
|
|
2057
|
+
if (right !== undefined && bottom !== undefined) {
|
|
2058
|
+
return this._zone;
|
|
2059
|
+
}
|
|
2050
2060
|
else if (bottom === undefined && right !== undefined) {
|
|
2051
2061
|
return { right, top, left, bottom: this.getSheetSize(this.sheetId).height - 1 };
|
|
2052
2062
|
}
|
|
@@ -3297,6 +3307,9 @@ exports.CommandResult = void 0;
|
|
|
3297
3307
|
CommandResult[CommandResult["InvalidQuantity"] = 86] = "InvalidQuantity";
|
|
3298
3308
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3299
3309
|
|
|
3310
|
+
function isMatrix(x) {
|
|
3311
|
+
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3312
|
+
}
|
|
3300
3313
|
var DIRECTION;
|
|
3301
3314
|
(function (DIRECTION) {
|
|
3302
3315
|
DIRECTION["UP"] = "up";
|
|
@@ -17069,6 +17082,36 @@ const HLOOKUP = {
|
|
|
17069
17082
|
isExported: true,
|
|
17070
17083
|
};
|
|
17071
17084
|
// -----------------------------------------------------------------------------
|
|
17085
|
+
// INDEX
|
|
17086
|
+
// -----------------------------------------------------------------------------
|
|
17087
|
+
const INDEX = {
|
|
17088
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
17089
|
+
args: args(`
|
|
17090
|
+
reference (any, range) ${_lt("The range of cells from which the value is returned.")}
|
|
17091
|
+
row (number) ${_lt("The index of the row to be returned from within the reference range of cells.")}
|
|
17092
|
+
column (number) ${_lt("The index of the column to be returned from within the reference range of cells.")}
|
|
17093
|
+
`),
|
|
17094
|
+
returns: ["ANY"],
|
|
17095
|
+
computeFormat: (reference, row, column) => {
|
|
17096
|
+
var _a;
|
|
17097
|
+
const _row = toNumber(row.value);
|
|
17098
|
+
const _column = toNumber(column.value);
|
|
17099
|
+
return (_a = reference[_column - 1][_row - 1]) === null || _a === void 0 ? void 0 : _a.format;
|
|
17100
|
+
},
|
|
17101
|
+
compute: function (reference, row, column) {
|
|
17102
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
17103
|
+
const _row = toNumber(row);
|
|
17104
|
+
const _column = toNumber(column);
|
|
17105
|
+
assert(() => _column >= 0 &&
|
|
17106
|
+
_column - 1 < _reference.length &&
|
|
17107
|
+
_row >= 0 &&
|
|
17108
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
17109
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
17110
|
+
return _reference[_column - 1][_row - 1];
|
|
17111
|
+
},
|
|
17112
|
+
isExported: true,
|
|
17113
|
+
};
|
|
17114
|
+
// -----------------------------------------------------------------------------
|
|
17072
17115
|
// LOOKUP
|
|
17073
17116
|
// -----------------------------------------------------------------------------
|
|
17074
17117
|
const LOOKUP = {
|
|
@@ -17257,6 +17300,7 @@ var lookup = /*#__PURE__*/Object.freeze({
|
|
|
17257
17300
|
COLUMN: COLUMN,
|
|
17258
17301
|
COLUMNS: COLUMNS,
|
|
17259
17302
|
HLOOKUP: HLOOKUP,
|
|
17303
|
+
INDEX: INDEX,
|
|
17260
17304
|
LOOKUP: LOOKUP,
|
|
17261
17305
|
MATCH: MATCH,
|
|
17262
17306
|
ROW: ROW,
|
|
@@ -21577,7 +21621,14 @@ class AbstractResizer extends owl.Component {
|
|
|
21577
21621
|
return;
|
|
21578
21622
|
}
|
|
21579
21623
|
if (this.state.waitingForMove === true) {
|
|
21580
|
-
this.
|
|
21624
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
21625
|
+
this._selectElement(index, false);
|
|
21626
|
+
}
|
|
21627
|
+
else {
|
|
21628
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
21629
|
+
// a way to have the grid selection follow the other selections evolution
|
|
21630
|
+
this.startMovement(ev);
|
|
21631
|
+
}
|
|
21581
21632
|
return;
|
|
21582
21633
|
}
|
|
21583
21634
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -27732,10 +27783,11 @@ class CellPlugin extends CorePlugin {
|
|
|
27732
27783
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
27733
27784
|
*/
|
|
27734
27785
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
27735
|
-
const ranges = dependencies ||
|
|
27786
|
+
const ranges = dependencies || cell.dependencies;
|
|
27787
|
+
let rangeIndex = 0;
|
|
27736
27788
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
27737
27789
|
if (token.type === "REFERENCE") {
|
|
27738
|
-
const range = ranges
|
|
27790
|
+
const range = ranges[rangeIndex++];
|
|
27739
27791
|
return this.getters.getRangeString(range, sheetId);
|
|
27740
27792
|
}
|
|
27741
27793
|
return token.value;
|
|
@@ -34640,6 +34692,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
34640
34692
|
// ---------------------------------------------------------------------------
|
|
34641
34693
|
// Getters
|
|
34642
34694
|
// ---------------------------------------------------------------------------
|
|
34695
|
+
isGridSelectionActive() {
|
|
34696
|
+
return this.selection.isListening(this);
|
|
34697
|
+
}
|
|
34643
34698
|
getActiveSheet() {
|
|
34644
34699
|
return this.activeSheet;
|
|
34645
34700
|
}
|
|
@@ -35016,6 +35071,7 @@ GridSelectionPlugin.getters = [
|
|
|
35016
35071
|
"getSheetPosition",
|
|
35017
35072
|
"isSelected",
|
|
35018
35073
|
"getElementsFromSelection",
|
|
35074
|
+
"isGridSelectionActive",
|
|
35019
35075
|
];
|
|
35020
35076
|
|
|
35021
35077
|
const uuidGenerator = new UuidGenerator();
|
|
@@ -40727,6 +40783,9 @@ class SelectionStreamProcessor {
|
|
|
40727
40783
|
anchor: { zone, cell: this.anchor.cell },
|
|
40728
40784
|
});
|
|
40729
40785
|
}
|
|
40786
|
+
isListening(owner) {
|
|
40787
|
+
return this.stream.isListening(owner);
|
|
40788
|
+
}
|
|
40730
40789
|
/**
|
|
40731
40790
|
* Process a new anchor selection event. If the new anchor is inside
|
|
40732
40791
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -42924,6 +42983,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
42924
42983
|
exports.tokenize = tokenize;
|
|
42925
42984
|
|
|
42926
42985
|
|
|
42927
|
-
__info__.version = '16.0.
|
|
42928
|
-
__info__.date = '2023-10-
|
|
42929
|
-
__info__.hash = '
|
|
42986
|
+
__info__.version = '16.0.21';
|
|
42987
|
+
__info__.date = '2023-10-10T07:26:26.680Z';
|
|
42988
|
+
__info__.hash = '5f66b12';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -278,7 +278,7 @@ declare class RangeImpl implements Range {
|
|
|
278
278
|
constructor(args: ConstructorArgs, getSheetSize: (sheetId: UID) => ZoneDimension);
|
|
279
279
|
static fromRange(range: Range, getters: CoreGetters): RangeImpl;
|
|
280
280
|
get unboundedZone(): UnboundedZone;
|
|
281
|
-
get zone(): Zone
|
|
281
|
+
get zone(): Readonly<Zone>;
|
|
282
282
|
static getRangeParts(xc: string, zone: UnboundedZone): RangePart[];
|
|
283
283
|
get isFullCol(): boolean;
|
|
284
284
|
get isFullRow(): boolean;
|
|
@@ -373,6 +373,7 @@ interface SelectionProcessor {
|
|
|
373
373
|
selectRow(index: number, mode: "overrideSelection" | "updateAnchor" | "newAnchor"): DispatchResult;
|
|
374
374
|
selectAll(): DispatchResult;
|
|
375
375
|
loopSelection(): DispatchResult;
|
|
376
|
+
isListening(owner: unknown): boolean;
|
|
376
377
|
}
|
|
377
378
|
/**
|
|
378
379
|
* Processes all selection updates (usually from user inputs) and emits an event
|
|
@@ -439,6 +440,7 @@ declare class SelectionStreamProcessor implements SelectionProcessor, StatefulSt
|
|
|
439
440
|
* Select the entire sheet
|
|
440
441
|
*/
|
|
441
442
|
selectAll(): DispatchResult;
|
|
443
|
+
isListening(owner: unknown): boolean;
|
|
442
444
|
/**
|
|
443
445
|
* Process a new anchor selection event. If the new anchor is inside
|
|
444
446
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -4047,7 +4049,7 @@ declare class RendererPlugin extends UIPlugin {
|
|
|
4047
4049
|
*/
|
|
4048
4050
|
declare class GridSelectionPlugin extends UIPlugin {
|
|
4049
4051
|
static layers: LAYERS[];
|
|
4050
|
-
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getPosition", "getSheetPosition", "isSelected", "getElementsFromSelection"];
|
|
4052
|
+
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getPosition", "getSheetPosition", "isSelected", "getElementsFromSelection", "isGridSelectionActive"];
|
|
4051
4053
|
private gridSelection;
|
|
4052
4054
|
private selectedFigureId;
|
|
4053
4055
|
private sheetsData;
|
|
@@ -4057,6 +4059,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4057
4059
|
allowDispatch(cmd: Command): CommandResult;
|
|
4058
4060
|
private handleEvent;
|
|
4059
4061
|
handle(cmd: Command): void;
|
|
4062
|
+
isGridSelectionActive(): boolean;
|
|
4060
4063
|
getActiveSheet(): Readonly<Sheet>;
|
|
4061
4064
|
getActiveSheetId(): UID;
|
|
4062
4065
|
getActiveCell(): Cell | undefined;
|
|
@@ -315,7 +315,16 @@ const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
|
|
|
315
315
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
316
316
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
317
317
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
318
|
+
const CACHE = {};
|
|
318
319
|
function parseDateTime(str) {
|
|
320
|
+
if (CACHE[str]) {
|
|
321
|
+
return CACHE[str];
|
|
322
|
+
}
|
|
323
|
+
const date = _parseDateTime(str);
|
|
324
|
+
CACHE[str] = date;
|
|
325
|
+
return date;
|
|
326
|
+
}
|
|
327
|
+
function _parseDateTime(str) {
|
|
319
328
|
str = str.trim();
|
|
320
329
|
let time;
|
|
321
330
|
const timeMatch = str.match(timeRegexp);
|
|
@@ -2041,8 +2050,9 @@ class RangeImpl {
|
|
|
2041
2050
|
}
|
|
2042
2051
|
get zone() {
|
|
2043
2052
|
const { left, top, bottom, right } = this._zone;
|
|
2044
|
-
if (right !== undefined && bottom !== undefined)
|
|
2045
|
-
return
|
|
2053
|
+
if (right !== undefined && bottom !== undefined) {
|
|
2054
|
+
return this._zone;
|
|
2055
|
+
}
|
|
2046
2056
|
else if (bottom === undefined && right !== undefined) {
|
|
2047
2057
|
return { right, top, left, bottom: this.getSheetSize(this.sheetId).height - 1 };
|
|
2048
2058
|
}
|
|
@@ -3293,6 +3303,9 @@ var CommandResult;
|
|
|
3293
3303
|
CommandResult[CommandResult["InvalidQuantity"] = 86] = "InvalidQuantity";
|
|
3294
3304
|
})(CommandResult || (CommandResult = {}));
|
|
3295
3305
|
|
|
3306
|
+
function isMatrix(x) {
|
|
3307
|
+
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3308
|
+
}
|
|
3296
3309
|
var DIRECTION;
|
|
3297
3310
|
(function (DIRECTION) {
|
|
3298
3311
|
DIRECTION["UP"] = "up";
|
|
@@ -17065,6 +17078,36 @@ const HLOOKUP = {
|
|
|
17065
17078
|
isExported: true,
|
|
17066
17079
|
};
|
|
17067
17080
|
// -----------------------------------------------------------------------------
|
|
17081
|
+
// INDEX
|
|
17082
|
+
// -----------------------------------------------------------------------------
|
|
17083
|
+
const INDEX = {
|
|
17084
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
17085
|
+
args: args(`
|
|
17086
|
+
reference (any, range) ${_lt("The range of cells from which the value is returned.")}
|
|
17087
|
+
row (number) ${_lt("The index of the row to be returned from within the reference range of cells.")}
|
|
17088
|
+
column (number) ${_lt("The index of the column to be returned from within the reference range of cells.")}
|
|
17089
|
+
`),
|
|
17090
|
+
returns: ["ANY"],
|
|
17091
|
+
computeFormat: (reference, row, column) => {
|
|
17092
|
+
var _a;
|
|
17093
|
+
const _row = toNumber(row.value);
|
|
17094
|
+
const _column = toNumber(column.value);
|
|
17095
|
+
return (_a = reference[_column - 1][_row - 1]) === null || _a === void 0 ? void 0 : _a.format;
|
|
17096
|
+
},
|
|
17097
|
+
compute: function (reference, row, column) {
|
|
17098
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
17099
|
+
const _row = toNumber(row);
|
|
17100
|
+
const _column = toNumber(column);
|
|
17101
|
+
assert(() => _column >= 0 &&
|
|
17102
|
+
_column - 1 < _reference.length &&
|
|
17103
|
+
_row >= 0 &&
|
|
17104
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
17105
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
17106
|
+
return _reference[_column - 1][_row - 1];
|
|
17107
|
+
},
|
|
17108
|
+
isExported: true,
|
|
17109
|
+
};
|
|
17110
|
+
// -----------------------------------------------------------------------------
|
|
17068
17111
|
// LOOKUP
|
|
17069
17112
|
// -----------------------------------------------------------------------------
|
|
17070
17113
|
const LOOKUP = {
|
|
@@ -17253,6 +17296,7 @@ var lookup = /*#__PURE__*/Object.freeze({
|
|
|
17253
17296
|
COLUMN: COLUMN,
|
|
17254
17297
|
COLUMNS: COLUMNS,
|
|
17255
17298
|
HLOOKUP: HLOOKUP,
|
|
17299
|
+
INDEX: INDEX,
|
|
17256
17300
|
LOOKUP: LOOKUP,
|
|
17257
17301
|
MATCH: MATCH,
|
|
17258
17302
|
ROW: ROW,
|
|
@@ -21573,7 +21617,14 @@ class AbstractResizer extends Component {
|
|
|
21573
21617
|
return;
|
|
21574
21618
|
}
|
|
21575
21619
|
if (this.state.waitingForMove === true) {
|
|
21576
|
-
this.
|
|
21620
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
21621
|
+
this._selectElement(index, false);
|
|
21622
|
+
}
|
|
21623
|
+
else {
|
|
21624
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
21625
|
+
// a way to have the grid selection follow the other selections evolution
|
|
21626
|
+
this.startMovement(ev);
|
|
21627
|
+
}
|
|
21577
21628
|
return;
|
|
21578
21629
|
}
|
|
21579
21630
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -27728,10 +27779,11 @@ class CellPlugin extends CorePlugin {
|
|
|
27728
27779
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
27729
27780
|
*/
|
|
27730
27781
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
27731
|
-
const ranges = dependencies ||
|
|
27782
|
+
const ranges = dependencies || cell.dependencies;
|
|
27783
|
+
let rangeIndex = 0;
|
|
27732
27784
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
27733
27785
|
if (token.type === "REFERENCE") {
|
|
27734
|
-
const range = ranges
|
|
27786
|
+
const range = ranges[rangeIndex++];
|
|
27735
27787
|
return this.getters.getRangeString(range, sheetId);
|
|
27736
27788
|
}
|
|
27737
27789
|
return token.value;
|
|
@@ -34636,6 +34688,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
34636
34688
|
// ---------------------------------------------------------------------------
|
|
34637
34689
|
// Getters
|
|
34638
34690
|
// ---------------------------------------------------------------------------
|
|
34691
|
+
isGridSelectionActive() {
|
|
34692
|
+
return this.selection.isListening(this);
|
|
34693
|
+
}
|
|
34639
34694
|
getActiveSheet() {
|
|
34640
34695
|
return this.activeSheet;
|
|
34641
34696
|
}
|
|
@@ -35012,6 +35067,7 @@ GridSelectionPlugin.getters = [
|
|
|
35012
35067
|
"getSheetPosition",
|
|
35013
35068
|
"isSelected",
|
|
35014
35069
|
"getElementsFromSelection",
|
|
35070
|
+
"isGridSelectionActive",
|
|
35015
35071
|
];
|
|
35016
35072
|
|
|
35017
35073
|
const uuidGenerator = new UuidGenerator();
|
|
@@ -40723,6 +40779,9 @@ class SelectionStreamProcessor {
|
|
|
40723
40779
|
anchor: { zone, cell: this.anchor.cell },
|
|
40724
40780
|
});
|
|
40725
40781
|
}
|
|
40782
|
+
isListening(owner) {
|
|
40783
|
+
return this.stream.isListening(owner);
|
|
40784
|
+
}
|
|
40726
40785
|
/**
|
|
40727
40786
|
* Process a new anchor selection event. If the new anchor is inside
|
|
40728
40787
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -42892,6 +42951,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
42892
42951
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
42893
42952
|
|
|
42894
42953
|
|
|
42895
|
-
__info__.version = '16.0.
|
|
42896
|
-
__info__.date = '2023-10-
|
|
42897
|
-
__info__.hash = '
|
|
42954
|
+
__info__.version = '16.0.21';
|
|
42955
|
+
__info__.date = '2023-10-10T07:26:26.680Z';
|
|
42956
|
+
__info__.hash = '5f66b12';
|
|
@@ -316,7 +316,16 @@
|
|
|
316
316
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
317
317
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
318
318
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
319
|
+
const CACHE = {};
|
|
319
320
|
function parseDateTime(str) {
|
|
321
|
+
if (CACHE[str]) {
|
|
322
|
+
return CACHE[str];
|
|
323
|
+
}
|
|
324
|
+
const date = _parseDateTime(str);
|
|
325
|
+
CACHE[str] = date;
|
|
326
|
+
return date;
|
|
327
|
+
}
|
|
328
|
+
function _parseDateTime(str) {
|
|
320
329
|
str = str.trim();
|
|
321
330
|
let time;
|
|
322
331
|
const timeMatch = str.match(timeRegexp);
|
|
@@ -2042,8 +2051,9 @@
|
|
|
2042
2051
|
}
|
|
2043
2052
|
get zone() {
|
|
2044
2053
|
const { left, top, bottom, right } = this._zone;
|
|
2045
|
-
if (right !== undefined && bottom !== undefined)
|
|
2046
|
-
return
|
|
2054
|
+
if (right !== undefined && bottom !== undefined) {
|
|
2055
|
+
return this._zone;
|
|
2056
|
+
}
|
|
2047
2057
|
else if (bottom === undefined && right !== undefined) {
|
|
2048
2058
|
return { right, top, left, bottom: this.getSheetSize(this.sheetId).height - 1 };
|
|
2049
2059
|
}
|
|
@@ -3294,6 +3304,9 @@
|
|
|
3294
3304
|
CommandResult[CommandResult["InvalidQuantity"] = 86] = "InvalidQuantity";
|
|
3295
3305
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3296
3306
|
|
|
3307
|
+
function isMatrix(x) {
|
|
3308
|
+
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3309
|
+
}
|
|
3297
3310
|
var DIRECTION;
|
|
3298
3311
|
(function (DIRECTION) {
|
|
3299
3312
|
DIRECTION["UP"] = "up";
|
|
@@ -17066,6 +17079,36 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
17066
17079
|
isExported: true,
|
|
17067
17080
|
};
|
|
17068
17081
|
// -----------------------------------------------------------------------------
|
|
17082
|
+
// INDEX
|
|
17083
|
+
// -----------------------------------------------------------------------------
|
|
17084
|
+
const INDEX = {
|
|
17085
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
17086
|
+
args: args(`
|
|
17087
|
+
reference (any, range) ${_lt("The range of cells from which the value is returned.")}
|
|
17088
|
+
row (number) ${_lt("The index of the row to be returned from within the reference range of cells.")}
|
|
17089
|
+
column (number) ${_lt("The index of the column to be returned from within the reference range of cells.")}
|
|
17090
|
+
`),
|
|
17091
|
+
returns: ["ANY"],
|
|
17092
|
+
computeFormat: (reference, row, column) => {
|
|
17093
|
+
var _a;
|
|
17094
|
+
const _row = toNumber(row.value);
|
|
17095
|
+
const _column = toNumber(column.value);
|
|
17096
|
+
return (_a = reference[_column - 1][_row - 1]) === null || _a === void 0 ? void 0 : _a.format;
|
|
17097
|
+
},
|
|
17098
|
+
compute: function (reference, row, column) {
|
|
17099
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
17100
|
+
const _row = toNumber(row);
|
|
17101
|
+
const _column = toNumber(column);
|
|
17102
|
+
assert(() => _column >= 0 &&
|
|
17103
|
+
_column - 1 < _reference.length &&
|
|
17104
|
+
_row >= 0 &&
|
|
17105
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
17106
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
17107
|
+
return _reference[_column - 1][_row - 1];
|
|
17108
|
+
},
|
|
17109
|
+
isExported: true,
|
|
17110
|
+
};
|
|
17111
|
+
// -----------------------------------------------------------------------------
|
|
17069
17112
|
// LOOKUP
|
|
17070
17113
|
// -----------------------------------------------------------------------------
|
|
17071
17114
|
const LOOKUP = {
|
|
@@ -17254,6 +17297,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
17254
17297
|
COLUMN: COLUMN,
|
|
17255
17298
|
COLUMNS: COLUMNS,
|
|
17256
17299
|
HLOOKUP: HLOOKUP,
|
|
17300
|
+
INDEX: INDEX,
|
|
17257
17301
|
LOOKUP: LOOKUP,
|
|
17258
17302
|
MATCH: MATCH,
|
|
17259
17303
|
ROW: ROW,
|
|
@@ -21574,7 +21618,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
21574
21618
|
return;
|
|
21575
21619
|
}
|
|
21576
21620
|
if (this.state.waitingForMove === true) {
|
|
21577
|
-
this.
|
|
21621
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
21622
|
+
this._selectElement(index, false);
|
|
21623
|
+
}
|
|
21624
|
+
else {
|
|
21625
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
21626
|
+
// a way to have the grid selection follow the other selections evolution
|
|
21627
|
+
this.startMovement(ev);
|
|
21628
|
+
}
|
|
21578
21629
|
return;
|
|
21579
21630
|
}
|
|
21580
21631
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -27729,10 +27780,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
27729
27780
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
27730
27781
|
*/
|
|
27731
27782
|
buildFormulaContent(sheetId, cell, dependencies) {
|
|
27732
|
-
const ranges = dependencies ||
|
|
27783
|
+
const ranges = dependencies || cell.dependencies;
|
|
27784
|
+
let rangeIndex = 0;
|
|
27733
27785
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
27734
27786
|
if (token.type === "REFERENCE") {
|
|
27735
|
-
const range = ranges
|
|
27787
|
+
const range = ranges[rangeIndex++];
|
|
27736
27788
|
return this.getters.getRangeString(range, sheetId);
|
|
27737
27789
|
}
|
|
27738
27790
|
return token.value;
|
|
@@ -34637,6 +34689,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
34637
34689
|
// ---------------------------------------------------------------------------
|
|
34638
34690
|
// Getters
|
|
34639
34691
|
// ---------------------------------------------------------------------------
|
|
34692
|
+
isGridSelectionActive() {
|
|
34693
|
+
return this.selection.isListening(this);
|
|
34694
|
+
}
|
|
34640
34695
|
getActiveSheet() {
|
|
34641
34696
|
return this.activeSheet;
|
|
34642
34697
|
}
|
|
@@ -35013,6 +35068,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
35013
35068
|
"getSheetPosition",
|
|
35014
35069
|
"isSelected",
|
|
35015
35070
|
"getElementsFromSelection",
|
|
35071
|
+
"isGridSelectionActive",
|
|
35016
35072
|
];
|
|
35017
35073
|
|
|
35018
35074
|
const uuidGenerator = new UuidGenerator();
|
|
@@ -40724,6 +40780,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
40724
40780
|
anchor: { zone, cell: this.anchor.cell },
|
|
40725
40781
|
});
|
|
40726
40782
|
}
|
|
40783
|
+
isListening(owner) {
|
|
40784
|
+
return this.stream.isListening(owner);
|
|
40785
|
+
}
|
|
40727
40786
|
/**
|
|
40728
40787
|
* Process a new anchor selection event. If the new anchor is inside
|
|
40729
40788
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -42923,9 +42982,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
42923
42982
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
42924
42983
|
|
|
42925
42984
|
|
|
42926
|
-
__info__.version = '16.0.
|
|
42927
|
-
__info__.date = '2023-10-
|
|
42928
|
-
__info__.hash = '
|
|
42985
|
+
__info__.version = '16.0.21';
|
|
42986
|
+
__info__.date = '2023-10-10T07:26:26.680Z';
|
|
42987
|
+
__info__.hash = '5f66b12';
|
|
42929
42988
|
|
|
42930
42989
|
|
|
42931
42990
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|