@odoo/o-spreadsheet 18.0.12 → 18.0.13
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 +75 -32
- package/dist/o-spreadsheet.d.ts +20 -11
- package/dist/o-spreadsheet.esm.js +75 -32
- package/dist/o-spreadsheet.iife.js +75 -32
- package/dist/o-spreadsheet.iife.min.js +5 -5
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2025-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.13
|
|
6
|
+
* @date 2025-01-31T07:59:17.481Z
|
|
7
|
+
* @hash f505971
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -3183,11 +3183,11 @@ const getInvaluableSymbolsRegexp = memoize(function getInvaluableSymbolsRegexp(l
|
|
|
3183
3183
|
* number from the point of view of the isNumber function.
|
|
3184
3184
|
*/
|
|
3185
3185
|
function parseNumber(str, locale) {
|
|
3186
|
+
// remove invaluable characters
|
|
3187
|
+
str = str.replace(getInvaluableSymbolsRegexp(locale), "");
|
|
3186
3188
|
if (locale.decimalSeparator !== ".") {
|
|
3187
3189
|
str = str.replace(locale.decimalSeparator, ".");
|
|
3188
3190
|
}
|
|
3189
|
-
// remove invaluable characters
|
|
3190
|
-
str = str.replace(getInvaluableSymbolsRegexp(locale), "");
|
|
3191
3191
|
let n = Number(str);
|
|
3192
3192
|
if (isNaN(n) && str.includes("%")) {
|
|
3193
3193
|
n = Number(str.split("%")[0]);
|
|
@@ -4282,7 +4282,7 @@ function dichotomicSearch(data, target, mode, sortOrder, rangeLength, getValueIn
|
|
|
4282
4282
|
* @param reverseSearch if true, search in the array starting from the end.
|
|
4283
4283
|
|
|
4284
4284
|
*/
|
|
4285
|
-
function linearSearch(data, target, mode, numberOfValues, getValueInData, reverseSearch = false) {
|
|
4285
|
+
function linearSearch(data, target, mode, numberOfValues, getValueInData, lookupCaches, reverseSearch = false) {
|
|
4286
4286
|
if (target === undefined || target.value === null) {
|
|
4287
4287
|
return -1;
|
|
4288
4288
|
}
|
|
@@ -4291,17 +4291,48 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4291
4291
|
}
|
|
4292
4292
|
const _target = normalizeValue(target.value);
|
|
4293
4293
|
const getValue = reverseSearch
|
|
4294
|
-
? (data, i) => getValueInData(data, numberOfValues - i - 1)
|
|
4295
|
-
: getValueInData;
|
|
4294
|
+
? (data, i) => normalizeValue(getValueInData(data, numberOfValues - i - 1))
|
|
4295
|
+
: (data, i) => normalizeValue(getValueInData(data, i));
|
|
4296
|
+
// first check if the target is in the cache
|
|
4297
|
+
const isNotWildcardTarget = mode !== "wildcard" ||
|
|
4298
|
+
typeof _target !== "string" ||
|
|
4299
|
+
!(_target.includes("*") || _target.includes("?"));
|
|
4300
|
+
if (lookupCaches && isNotWildcardTarget) {
|
|
4301
|
+
const searchMode = reverseSearch ? "reverseSearch" : "forwardSearch";
|
|
4302
|
+
let cache = lookupCaches[searchMode].get(data);
|
|
4303
|
+
if (cache === undefined) {
|
|
4304
|
+
// build the cache for all the values
|
|
4305
|
+
cache = new Map();
|
|
4306
|
+
for (let i = 0; i < numberOfValues; i++) {
|
|
4307
|
+
const value = getValue(data, i) ?? null;
|
|
4308
|
+
if (!cache.has(value)) {
|
|
4309
|
+
cache.set(value, i);
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
lookupCaches[searchMode].set(data, cache);
|
|
4313
|
+
}
|
|
4314
|
+
if (cache.has(_target)) {
|
|
4315
|
+
const resultIndex = cache.get(_target);
|
|
4316
|
+
return reverseSearch ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4317
|
+
}
|
|
4318
|
+
if (mode === "strict") {
|
|
4319
|
+
return -1;
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
// else perform the linear search
|
|
4323
|
+
const resultIndex = _linearSearch(data, _target, mode, numberOfValues, getValue);
|
|
4324
|
+
return reverseSearch && resultIndex !== -1 ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4325
|
+
}
|
|
4326
|
+
function _linearSearch(data, _target, mode, numberOfValues, getNormalizeValue) {
|
|
4296
4327
|
let indexMatchTarget = (i) => {
|
|
4297
|
-
return
|
|
4328
|
+
return getNormalizeValue(data, i) === _target;
|
|
4298
4329
|
};
|
|
4299
4330
|
if (mode === "wildcard" &&
|
|
4300
4331
|
typeof _target === "string" &&
|
|
4301
4332
|
(_target.includes("*") || _target.includes("?"))) {
|
|
4302
4333
|
const regExp = wildcardToRegExp(_target);
|
|
4303
4334
|
indexMatchTarget = (i) => {
|
|
4304
|
-
const value =
|
|
4335
|
+
const value = getNormalizeValue(data, i);
|
|
4305
4336
|
if (typeof value === "string") {
|
|
4306
4337
|
return regExp.test(value);
|
|
4307
4338
|
}
|
|
@@ -4312,7 +4343,7 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4312
4343
|
let closestMatchIndex = -1;
|
|
4313
4344
|
if (mode === "nextSmaller") {
|
|
4314
4345
|
indexMatchTarget = (i) => {
|
|
4315
|
-
const value =
|
|
4346
|
+
const value = getNormalizeValue(data, i);
|
|
4316
4347
|
if ((!closestMatch && compareCellValues(_target, value) >= 0) ||
|
|
4317
4348
|
(compareCellValues(_target, value) >= 0 && compareCellValues(value, closestMatch) > 0)) {
|
|
4318
4349
|
closestMatch = value;
|
|
@@ -4323,7 +4354,7 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4323
4354
|
}
|
|
4324
4355
|
if (mode === "nextGreater") {
|
|
4325
4356
|
indexMatchTarget = (i) => {
|
|
4326
|
-
const value =
|
|
4357
|
+
const value = getNormalizeValue(data, i);
|
|
4327
4358
|
if ((!closestMatch && compareCellValues(_target, value) <= 0) ||
|
|
4328
4359
|
(compareCellValues(_target, value) <= 0 && compareCellValues(value, closestMatch) < 0)) {
|
|
4329
4360
|
closestMatch = value;
|
|
@@ -4334,12 +4365,10 @@ function linearSearch(data, target, mode, numberOfValues, getValueInData, revers
|
|
|
4334
4365
|
}
|
|
4335
4366
|
for (let i = 0; i < numberOfValues; i++) {
|
|
4336
4367
|
if (indexMatchTarget(i)) {
|
|
4337
|
-
return
|
|
4368
|
+
return i;
|
|
4338
4369
|
}
|
|
4339
4370
|
}
|
|
4340
|
-
return
|
|
4341
|
-
? numberOfValues - closestMatchIndex - 1
|
|
4342
|
-
: closestMatchIndex;
|
|
4371
|
+
return closestMatchIndex;
|
|
4343
4372
|
}
|
|
4344
4373
|
/**
|
|
4345
4374
|
* Normalize a value.
|
|
@@ -18364,7 +18393,7 @@ const HLOOKUP = {
|
|
|
18364
18393
|
const _isSorted = toBoolean(isSorted.value);
|
|
18365
18394
|
const colIndex = _isSorted
|
|
18366
18395
|
? dichotomicSearch(range, searchKey, "nextSmaller", "asc", range.length, getValueFromRange)
|
|
18367
|
-
: linearSearch(range, searchKey, "wildcard", range.length, getValueFromRange);
|
|
18396
|
+
: linearSearch(range, searchKey, "wildcard", range.length, getValueFromRange, this.lookupCaches);
|
|
18368
18397
|
const col = range[colIndex];
|
|
18369
18398
|
if (col === undefined) {
|
|
18370
18399
|
return valueNotAvailable(searchKey);
|
|
@@ -18516,7 +18545,7 @@ const MATCH = {
|
|
|
18516
18545
|
index = dichotomicSearch(range, searchKey, "nextSmaller", "asc", rangeLen, getElement);
|
|
18517
18546
|
break;
|
|
18518
18547
|
case 0:
|
|
18519
|
-
index = linearSearch(range, searchKey, "wildcard", rangeLen, getElement);
|
|
18548
|
+
index = linearSearch(range, searchKey, "wildcard", rangeLen, getElement, this.lookupCaches);
|
|
18520
18549
|
break;
|
|
18521
18550
|
case -1:
|
|
18522
18551
|
index = dichotomicSearch(range, searchKey, "nextGreater", "desc", rangeLen, getElement);
|
|
@@ -18583,7 +18612,7 @@ const VLOOKUP = {
|
|
|
18583
18612
|
const _isSorted = toBoolean(isSorted.value);
|
|
18584
18613
|
const rowIndex = _isSorted
|
|
18585
18614
|
? dichotomicSearch(range, searchKey, "nextSmaller", "asc", range[0].length, getValueFromRange)
|
|
18586
|
-
: linearSearch(range, searchKey, "wildcard", range[0].length, getValueFromRange);
|
|
18615
|
+
: linearSearch(range, searchKey, "wildcard", range[0].length, getValueFromRange, this.lookupCaches);
|
|
18587
18616
|
const value = range[_index - 1][rowIndex];
|
|
18588
18617
|
if (value === undefined) {
|
|
18589
18618
|
return valueNotAvailable(searchKey);
|
|
@@ -18637,7 +18666,7 @@ const XLOOKUP = {
|
|
|
18637
18666
|
const reverseSearch = _searchMode === -1;
|
|
18638
18667
|
const index = _searchMode === 2 || _searchMode === -2
|
|
18639
18668
|
? dichotomicSearch(lookupRange, searchKey, mode, _searchMode === 2 ? "asc" : "desc", rangeLen, getElement)
|
|
18640
|
-
: linearSearch(lookupRange, searchKey, mode, rangeLen, getElement, reverseSearch);
|
|
18669
|
+
: linearSearch(lookupRange, searchKey, mode, rangeLen, getElement, this.lookupCaches, reverseSearch);
|
|
18641
18670
|
if (index !== -1) {
|
|
18642
18671
|
return lookupDirection === "col"
|
|
18643
18672
|
? returnRange.map((col) => [col[index]])
|
|
@@ -21077,6 +21106,12 @@ class Composer extends Component {
|
|
|
21077
21106
|
}
|
|
21078
21107
|
this.contentHelper.updateEl(el);
|
|
21079
21108
|
});
|
|
21109
|
+
this.env.model.selection.observe(this, {
|
|
21110
|
+
handleEvent: () => this.autoCompleteState.hide(),
|
|
21111
|
+
});
|
|
21112
|
+
onWillUnmount(() => {
|
|
21113
|
+
this.env.model.selection.detachObserver(this);
|
|
21114
|
+
});
|
|
21080
21115
|
useEffect(() => {
|
|
21081
21116
|
this.processContent();
|
|
21082
21117
|
if (document.activeElement === this.contentHelper.el &&
|
|
@@ -57558,6 +57593,10 @@ class Evaluator {
|
|
|
57558
57593
|
this.compilationParams = buildCompilationParameters(this.context, this.getters, this.computeAndSave.bind(this));
|
|
57559
57594
|
this.compilationParams.evalContext.updateDependencies = this.updateDependencies.bind(this);
|
|
57560
57595
|
this.compilationParams.evalContext.addDependencies = this.addDependencies.bind(this);
|
|
57596
|
+
this.compilationParams.evalContext.lookupCaches = {
|
|
57597
|
+
forwardSearch: new Map(),
|
|
57598
|
+
reverseSearch: new Map(),
|
|
57599
|
+
};
|
|
57561
57600
|
}
|
|
57562
57601
|
createEmptyPositionSet() {
|
|
57563
57602
|
const sheetSizes = {};
|
|
@@ -59407,7 +59446,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
59407
59446
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
59408
59447
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
59409
59448
|
}
|
|
59410
|
-
return this.
|
|
59449
|
+
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
59411
59450
|
};
|
|
59412
59451
|
const result = this.getters.evaluateCompiledFormula(measure.computedBy.sheetId, formula, getSymbolValue);
|
|
59413
59452
|
if (isMatrix(result)) {
|
|
@@ -62524,14 +62563,12 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
62524
62563
|
}
|
|
62525
62564
|
break;
|
|
62526
62565
|
case "AUTORESIZE_ROWS":
|
|
62527
|
-
|
|
62528
|
-
|
|
62529
|
-
|
|
62530
|
-
|
|
62531
|
-
|
|
62532
|
-
|
|
62533
|
-
});
|
|
62534
|
-
}
|
|
62566
|
+
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
62567
|
+
elements: cmd.rows,
|
|
62568
|
+
dimension: "ROW",
|
|
62569
|
+
size: null,
|
|
62570
|
+
sheetId: cmd.sheetId,
|
|
62571
|
+
});
|
|
62535
62572
|
break;
|
|
62536
62573
|
}
|
|
62537
62574
|
}
|
|
@@ -69638,6 +69675,9 @@ class EventStream {
|
|
|
69638
69675
|
observe(owner, callbacks) {
|
|
69639
69676
|
this.observers.set(owner, { owner, callbacks });
|
|
69640
69677
|
}
|
|
69678
|
+
detachObserver(owner) {
|
|
69679
|
+
this.observers.delete(owner);
|
|
69680
|
+
}
|
|
69641
69681
|
/**
|
|
69642
69682
|
* Capture the stream for yourself
|
|
69643
69683
|
*/
|
|
@@ -69730,6 +69770,9 @@ class SelectionStreamProcessorImpl {
|
|
|
69730
69770
|
observe(owner, callbacks) {
|
|
69731
69771
|
this.stream.observe(owner, callbacks);
|
|
69732
69772
|
}
|
|
69773
|
+
detachObserver(owner) {
|
|
69774
|
+
this.stream.detachObserver(owner);
|
|
69775
|
+
}
|
|
69733
69776
|
release(owner) {
|
|
69734
69777
|
if (this.stream.isListening(owner)) {
|
|
69735
69778
|
this.stream.release(owner);
|
|
@@ -73045,6 +73088,6 @@ const constants = {
|
|
|
73045
73088
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
73046
73089
|
|
|
73047
73090
|
|
|
73048
|
-
__info__.version = "18.0.
|
|
73049
|
-
__info__.date = "2025-01-
|
|
73050
|
-
__info__.hash = "
|
|
73091
|
+
__info__.version = "18.0.13";
|
|
73092
|
+
__info__.date = "2025-01-31T07:59:17.481Z";
|
|
73093
|
+
__info__.hash = "f505971";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2025-01-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.13
|
|
6
|
+
* @date 2025-01-31T07:59:17.481Z
|
|
7
|
+
* @hash f505971
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3184,11 +3184,11 @@
|
|
|
3184
3184
|
* number from the point of view of the isNumber function.
|
|
3185
3185
|
*/
|
|
3186
3186
|
function parseNumber(str, locale) {
|
|
3187
|
+
// remove invaluable characters
|
|
3188
|
+
str = str.replace(getInvaluableSymbolsRegexp(locale), "");
|
|
3187
3189
|
if (locale.decimalSeparator !== ".") {
|
|
3188
3190
|
str = str.replace(locale.decimalSeparator, ".");
|
|
3189
3191
|
}
|
|
3190
|
-
// remove invaluable characters
|
|
3191
|
-
str = str.replace(getInvaluableSymbolsRegexp(locale), "");
|
|
3192
3192
|
let n = Number(str);
|
|
3193
3193
|
if (isNaN(n) && str.includes("%")) {
|
|
3194
3194
|
n = Number(str.split("%")[0]);
|
|
@@ -4283,7 +4283,7 @@
|
|
|
4283
4283
|
* @param reverseSearch if true, search in the array starting from the end.
|
|
4284
4284
|
|
|
4285
4285
|
*/
|
|
4286
|
-
function linearSearch(data, target, mode, numberOfValues, getValueInData, reverseSearch = false) {
|
|
4286
|
+
function linearSearch(data, target, mode, numberOfValues, getValueInData, lookupCaches, reverseSearch = false) {
|
|
4287
4287
|
if (target === undefined || target.value === null) {
|
|
4288
4288
|
return -1;
|
|
4289
4289
|
}
|
|
@@ -4292,17 +4292,48 @@
|
|
|
4292
4292
|
}
|
|
4293
4293
|
const _target = normalizeValue(target.value);
|
|
4294
4294
|
const getValue = reverseSearch
|
|
4295
|
-
? (data, i) => getValueInData(data, numberOfValues - i - 1)
|
|
4296
|
-
: getValueInData;
|
|
4295
|
+
? (data, i) => normalizeValue(getValueInData(data, numberOfValues - i - 1))
|
|
4296
|
+
: (data, i) => normalizeValue(getValueInData(data, i));
|
|
4297
|
+
// first check if the target is in the cache
|
|
4298
|
+
const isNotWildcardTarget = mode !== "wildcard" ||
|
|
4299
|
+
typeof _target !== "string" ||
|
|
4300
|
+
!(_target.includes("*") || _target.includes("?"));
|
|
4301
|
+
if (lookupCaches && isNotWildcardTarget) {
|
|
4302
|
+
const searchMode = reverseSearch ? "reverseSearch" : "forwardSearch";
|
|
4303
|
+
let cache = lookupCaches[searchMode].get(data);
|
|
4304
|
+
if (cache === undefined) {
|
|
4305
|
+
// build the cache for all the values
|
|
4306
|
+
cache = new Map();
|
|
4307
|
+
for (let i = 0; i < numberOfValues; i++) {
|
|
4308
|
+
const value = getValue(data, i) ?? null;
|
|
4309
|
+
if (!cache.has(value)) {
|
|
4310
|
+
cache.set(value, i);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
lookupCaches[searchMode].set(data, cache);
|
|
4314
|
+
}
|
|
4315
|
+
if (cache.has(_target)) {
|
|
4316
|
+
const resultIndex = cache.get(_target);
|
|
4317
|
+
return reverseSearch ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4318
|
+
}
|
|
4319
|
+
if (mode === "strict") {
|
|
4320
|
+
return -1;
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
// else perform the linear search
|
|
4324
|
+
const resultIndex = _linearSearch(data, _target, mode, numberOfValues, getValue);
|
|
4325
|
+
return reverseSearch && resultIndex !== -1 ? numberOfValues - resultIndex - 1 : resultIndex;
|
|
4326
|
+
}
|
|
4327
|
+
function _linearSearch(data, _target, mode, numberOfValues, getNormalizeValue) {
|
|
4297
4328
|
let indexMatchTarget = (i) => {
|
|
4298
|
-
return
|
|
4329
|
+
return getNormalizeValue(data, i) === _target;
|
|
4299
4330
|
};
|
|
4300
4331
|
if (mode === "wildcard" &&
|
|
4301
4332
|
typeof _target === "string" &&
|
|
4302
4333
|
(_target.includes("*") || _target.includes("?"))) {
|
|
4303
4334
|
const regExp = wildcardToRegExp(_target);
|
|
4304
4335
|
indexMatchTarget = (i) => {
|
|
4305
|
-
const value =
|
|
4336
|
+
const value = getNormalizeValue(data, i);
|
|
4306
4337
|
if (typeof value === "string") {
|
|
4307
4338
|
return regExp.test(value);
|
|
4308
4339
|
}
|
|
@@ -4313,7 +4344,7 @@
|
|
|
4313
4344
|
let closestMatchIndex = -1;
|
|
4314
4345
|
if (mode === "nextSmaller") {
|
|
4315
4346
|
indexMatchTarget = (i) => {
|
|
4316
|
-
const value =
|
|
4347
|
+
const value = getNormalizeValue(data, i);
|
|
4317
4348
|
if ((!closestMatch && compareCellValues(_target, value) >= 0) ||
|
|
4318
4349
|
(compareCellValues(_target, value) >= 0 && compareCellValues(value, closestMatch) > 0)) {
|
|
4319
4350
|
closestMatch = value;
|
|
@@ -4324,7 +4355,7 @@
|
|
|
4324
4355
|
}
|
|
4325
4356
|
if (mode === "nextGreater") {
|
|
4326
4357
|
indexMatchTarget = (i) => {
|
|
4327
|
-
const value =
|
|
4358
|
+
const value = getNormalizeValue(data, i);
|
|
4328
4359
|
if ((!closestMatch && compareCellValues(_target, value) <= 0) ||
|
|
4329
4360
|
(compareCellValues(_target, value) <= 0 && compareCellValues(value, closestMatch) < 0)) {
|
|
4330
4361
|
closestMatch = value;
|
|
@@ -4335,12 +4366,10 @@
|
|
|
4335
4366
|
}
|
|
4336
4367
|
for (let i = 0; i < numberOfValues; i++) {
|
|
4337
4368
|
if (indexMatchTarget(i)) {
|
|
4338
|
-
return
|
|
4369
|
+
return i;
|
|
4339
4370
|
}
|
|
4340
4371
|
}
|
|
4341
|
-
return
|
|
4342
|
-
? numberOfValues - closestMatchIndex - 1
|
|
4343
|
-
: closestMatchIndex;
|
|
4372
|
+
return closestMatchIndex;
|
|
4344
4373
|
}
|
|
4345
4374
|
/**
|
|
4346
4375
|
* Normalize a value.
|
|
@@ -18365,7 +18394,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18365
18394
|
const _isSorted = toBoolean(isSorted.value);
|
|
18366
18395
|
const colIndex = _isSorted
|
|
18367
18396
|
? dichotomicSearch(range, searchKey, "nextSmaller", "asc", range.length, getValueFromRange)
|
|
18368
|
-
: linearSearch(range, searchKey, "wildcard", range.length, getValueFromRange);
|
|
18397
|
+
: linearSearch(range, searchKey, "wildcard", range.length, getValueFromRange, this.lookupCaches);
|
|
18369
18398
|
const col = range[colIndex];
|
|
18370
18399
|
if (col === undefined) {
|
|
18371
18400
|
return valueNotAvailable(searchKey);
|
|
@@ -18517,7 +18546,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18517
18546
|
index = dichotomicSearch(range, searchKey, "nextSmaller", "asc", rangeLen, getElement);
|
|
18518
18547
|
break;
|
|
18519
18548
|
case 0:
|
|
18520
|
-
index = linearSearch(range, searchKey, "wildcard", rangeLen, getElement);
|
|
18549
|
+
index = linearSearch(range, searchKey, "wildcard", rangeLen, getElement, this.lookupCaches);
|
|
18521
18550
|
break;
|
|
18522
18551
|
case -1:
|
|
18523
18552
|
index = dichotomicSearch(range, searchKey, "nextGreater", "desc", rangeLen, getElement);
|
|
@@ -18584,7 +18613,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18584
18613
|
const _isSorted = toBoolean(isSorted.value);
|
|
18585
18614
|
const rowIndex = _isSorted
|
|
18586
18615
|
? dichotomicSearch(range, searchKey, "nextSmaller", "asc", range[0].length, getValueFromRange)
|
|
18587
|
-
: linearSearch(range, searchKey, "wildcard", range[0].length, getValueFromRange);
|
|
18616
|
+
: linearSearch(range, searchKey, "wildcard", range[0].length, getValueFromRange, this.lookupCaches);
|
|
18588
18617
|
const value = range[_index - 1][rowIndex];
|
|
18589
18618
|
if (value === undefined) {
|
|
18590
18619
|
return valueNotAvailable(searchKey);
|
|
@@ -18638,7 +18667,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18638
18667
|
const reverseSearch = _searchMode === -1;
|
|
18639
18668
|
const index = _searchMode === 2 || _searchMode === -2
|
|
18640
18669
|
? dichotomicSearch(lookupRange, searchKey, mode, _searchMode === 2 ? "asc" : "desc", rangeLen, getElement)
|
|
18641
|
-
: linearSearch(lookupRange, searchKey, mode, rangeLen, getElement, reverseSearch);
|
|
18670
|
+
: linearSearch(lookupRange, searchKey, mode, rangeLen, getElement, this.lookupCaches, reverseSearch);
|
|
18642
18671
|
if (index !== -1) {
|
|
18643
18672
|
return lookupDirection === "col"
|
|
18644
18673
|
? returnRange.map((col) => [col[index]])
|
|
@@ -21078,6 +21107,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21078
21107
|
}
|
|
21079
21108
|
this.contentHelper.updateEl(el);
|
|
21080
21109
|
});
|
|
21110
|
+
this.env.model.selection.observe(this, {
|
|
21111
|
+
handleEvent: () => this.autoCompleteState.hide(),
|
|
21112
|
+
});
|
|
21113
|
+
owl.onWillUnmount(() => {
|
|
21114
|
+
this.env.model.selection.detachObserver(this);
|
|
21115
|
+
});
|
|
21081
21116
|
owl.useEffect(() => {
|
|
21082
21117
|
this.processContent();
|
|
21083
21118
|
if (document.activeElement === this.contentHelper.el &&
|
|
@@ -57559,6 +57594,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57559
57594
|
this.compilationParams = buildCompilationParameters(this.context, this.getters, this.computeAndSave.bind(this));
|
|
57560
57595
|
this.compilationParams.evalContext.updateDependencies = this.updateDependencies.bind(this);
|
|
57561
57596
|
this.compilationParams.evalContext.addDependencies = this.addDependencies.bind(this);
|
|
57597
|
+
this.compilationParams.evalContext.lookupCaches = {
|
|
57598
|
+
forwardSearch: new Map(),
|
|
57599
|
+
reverseSearch: new Map(),
|
|
57600
|
+
};
|
|
57562
57601
|
}
|
|
57563
57602
|
createEmptyPositionSet() {
|
|
57564
57603
|
const sheetSizes = {};
|
|
@@ -59408,7 +59447,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59408
59447
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
59409
59448
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
59410
59449
|
}
|
|
59411
|
-
return this.
|
|
59450
|
+
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
59412
59451
|
};
|
|
59413
59452
|
const result = this.getters.evaluateCompiledFormula(measure.computedBy.sheetId, formula, getSymbolValue);
|
|
59414
59453
|
if (isMatrix(result)) {
|
|
@@ -62525,14 +62564,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62525
62564
|
}
|
|
62526
62565
|
break;
|
|
62527
62566
|
case "AUTORESIZE_ROWS":
|
|
62528
|
-
|
|
62529
|
-
|
|
62530
|
-
|
|
62531
|
-
|
|
62532
|
-
|
|
62533
|
-
|
|
62534
|
-
});
|
|
62535
|
-
}
|
|
62567
|
+
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
62568
|
+
elements: cmd.rows,
|
|
62569
|
+
dimension: "ROW",
|
|
62570
|
+
size: null,
|
|
62571
|
+
sheetId: cmd.sheetId,
|
|
62572
|
+
});
|
|
62536
62573
|
break;
|
|
62537
62574
|
}
|
|
62538
62575
|
}
|
|
@@ -69639,6 +69676,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
69639
69676
|
observe(owner, callbacks) {
|
|
69640
69677
|
this.observers.set(owner, { owner, callbacks });
|
|
69641
69678
|
}
|
|
69679
|
+
detachObserver(owner) {
|
|
69680
|
+
this.observers.delete(owner);
|
|
69681
|
+
}
|
|
69642
69682
|
/**
|
|
69643
69683
|
* Capture the stream for yourself
|
|
69644
69684
|
*/
|
|
@@ -69731,6 +69771,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
69731
69771
|
observe(owner, callbacks) {
|
|
69732
69772
|
this.stream.observe(owner, callbacks);
|
|
69733
69773
|
}
|
|
69774
|
+
detachObserver(owner) {
|
|
69775
|
+
this.stream.detachObserver(owner);
|
|
69776
|
+
}
|
|
69734
69777
|
release(owner) {
|
|
69735
69778
|
if (this.stream.isListening(owner)) {
|
|
69736
69779
|
this.stream.release(owner);
|
|
@@ -73089,9 +73132,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73089
73132
|
exports.tokenize = tokenize;
|
|
73090
73133
|
|
|
73091
73134
|
|
|
73092
|
-
__info__.version = "18.0.
|
|
73093
|
-
__info__.date = "2025-01-
|
|
73094
|
-
__info__.hash = "
|
|
73135
|
+
__info__.version = "18.0.13";
|
|
73136
|
+
__info__.date = "2025-01-31T07:59:17.481Z";
|
|
73137
|
+
__info__.hash = "f505971";
|
|
73095
73138
|
|
|
73096
73139
|
|
|
73097
73140
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|