@odoo/o-spreadsheet 17.0.25 → 17.0.28
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 +86 -24
- package/dist/o-spreadsheet.d.ts +9 -3
- package/dist/o-spreadsheet.esm.js +86 -24
- package/dist/o-spreadsheet.iife.js +86 -24
- package/dist/o-spreadsheet.iife.min.js +354 -354
- package/dist/o_spreadsheet.xml +6 -4
- package/package.json +1 -1
|
@@ -2,18 +2,19 @@
|
|
|
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 17.0.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.28
|
|
6
|
+
* @date 2024-07-02T10:35:57.899Z
|
|
7
|
+
* @hash 7f86a16
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
12
|
var owl = require('@odoo/owl');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let
|
|
14
|
+
const defaultTranslate = (s) => s;
|
|
15
|
+
const defaultLoaded = () => false;
|
|
16
|
+
let _translate = defaultTranslate;
|
|
17
|
+
let _loaded = defaultLoaded;
|
|
17
18
|
function sprintf(s, ...values) {
|
|
18
19
|
if (values.length === 1 && typeof values[0] === "object" && !(values[0] instanceof String)) {
|
|
19
20
|
const valuesDict = values[0];
|
|
@@ -25,7 +26,8 @@ function sprintf(s, ...values) {
|
|
|
25
26
|
return s;
|
|
26
27
|
}
|
|
27
28
|
/***
|
|
28
|
-
* Allow to inject a translation function from outside o-spreadsheet.
|
|
29
|
+
* Allow to inject a translation function from outside o-spreadsheet. This should be called before instantiating
|
|
30
|
+
* a model.
|
|
29
31
|
* @param tfn the function that will do the translation
|
|
30
32
|
* @param loaded a function that returns true when the translation is loaded
|
|
31
33
|
*/
|
|
@@ -33,6 +35,18 @@ function setTranslationMethod(tfn, loaded = () => true) {
|
|
|
33
35
|
_translate = tfn;
|
|
34
36
|
_loaded = loaded;
|
|
35
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* If no translation function has been set, this will mark the translation are loaded.
|
|
40
|
+
*
|
|
41
|
+
* By default, the translations should not be set as loaded, otherwise top-level translated constants will never be
|
|
42
|
+
* translated. But if by the time the model is instantiated no custom translation function has been set, we can set
|
|
43
|
+
* the default translation function as loaded so o-spreadsheet can be run in standalone with no translations.
|
|
44
|
+
*/
|
|
45
|
+
function setDefaultTranslationMethod() {
|
|
46
|
+
if (_translate === defaultTranslate && _loaded === defaultLoaded) {
|
|
47
|
+
_loaded = () => true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
36
50
|
const _t = function (s, ...values) {
|
|
37
51
|
if (!_loaded()) {
|
|
38
52
|
return new LazyTranslatedString(s, values);
|
|
@@ -6933,7 +6947,7 @@ class Popover extends owl.Component {
|
|
|
6933
6947
|
if (!anchor)
|
|
6934
6948
|
return;
|
|
6935
6949
|
const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
|
|
6936
|
-
|
|
6950
|
+
let elDims = {
|
|
6937
6951
|
width: el.getBoundingClientRect().width,
|
|
6938
6952
|
height: el.getBoundingClientRect().height,
|
|
6939
6953
|
};
|
|
@@ -6941,7 +6955,14 @@ class Popover extends owl.Component {
|
|
|
6941
6955
|
const popoverPositionHelper = this.props.positioning === "BottomLeft"
|
|
6942
6956
|
? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
|
|
6943
6957
|
: new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
|
|
6944
|
-
|
|
6958
|
+
el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
|
|
6959
|
+
el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
|
|
6960
|
+
// Re-compute the dimensions after setting the max-width and max-height
|
|
6961
|
+
elDims = {
|
|
6962
|
+
width: el.getBoundingClientRect().width,
|
|
6963
|
+
height: el.getBoundingClientRect().height,
|
|
6964
|
+
};
|
|
6965
|
+
let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
|
|
6945
6966
|
for (const property of Object.keys(style)) {
|
|
6946
6967
|
el.style[property] = style[property];
|
|
6947
6968
|
}
|
|
@@ -7017,8 +7038,6 @@ class PopoverPositionContext {
|
|
|
7017
7038
|
const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
|
|
7018
7039
|
verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
|
|
7019
7040
|
const cssProperties = {
|
|
7020
|
-
"max-height": maxHeight + "px",
|
|
7021
|
-
"max-width": maxWidth + "px",
|
|
7022
7041
|
top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
|
|
7023
7042
|
this.spreadsheetOffset.y -
|
|
7024
7043
|
verticalOffset +
|
|
@@ -24977,13 +24996,17 @@ SplitIntoColumnsPanel.props = {
|
|
|
24977
24996
|
class SelectMenu extends owl.Component {
|
|
24978
24997
|
static template = "o-spreadsheet-SelectMenu";
|
|
24979
24998
|
static components = { Menu };
|
|
24999
|
+
menuId = new UuidGenerator().uuidv4();
|
|
24980
25000
|
selectRef = owl.useRef("select");
|
|
24981
25001
|
selectRect = useAbsoluteBoundingRect(this.selectRef);
|
|
24982
25002
|
state = owl.useState({
|
|
24983
25003
|
isMenuOpen: false,
|
|
24984
25004
|
});
|
|
24985
|
-
onClick() {
|
|
24986
|
-
this.
|
|
25005
|
+
onClick(ev) {
|
|
25006
|
+
if (ev.closedMenuId === this.menuId) {
|
|
25007
|
+
return;
|
|
25008
|
+
}
|
|
25009
|
+
this.state.isMenuOpen = !this.state.isMenuOpen;
|
|
24987
25010
|
}
|
|
24988
25011
|
onMenuClosed() {
|
|
24989
25012
|
this.state.isMenuOpen = false;
|
|
@@ -24991,7 +25014,7 @@ class SelectMenu extends owl.Component {
|
|
|
24991
25014
|
get menuPosition() {
|
|
24992
25015
|
return {
|
|
24993
25016
|
x: this.selectRect.x,
|
|
24994
|
-
y: this.selectRect.y,
|
|
25017
|
+
y: this.selectRect.y + this.selectRect.height,
|
|
24995
25018
|
};
|
|
24996
25019
|
}
|
|
24997
25020
|
}
|
|
@@ -28022,7 +28045,7 @@ class FiguresContainer extends owl.Component {
|
|
|
28022
28045
|
});
|
|
28023
28046
|
}
|
|
28024
28047
|
getContainerRect(container) {
|
|
28025
|
-
const { width: viewWidth, height: viewHeight } = this.env.model.getters.
|
|
28048
|
+
const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
|
|
28026
28049
|
const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
|
|
28027
28050
|
const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
|
|
28028
28051
|
const width = viewWidth - x;
|
|
@@ -30305,6 +30328,8 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30305
30328
|
"BITOR",
|
|
30306
30329
|
"BITRSHIFT",
|
|
30307
30330
|
"BITXOR",
|
|
30331
|
+
"BYCOL",
|
|
30332
|
+
"BYROW",
|
|
30308
30333
|
"CEILING.MATH",
|
|
30309
30334
|
"CEILING.PRECISE",
|
|
30310
30335
|
"CHISQ.DIST",
|
|
@@ -30312,6 +30337,8 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30312
30337
|
"CHISQ.INV",
|
|
30313
30338
|
"CHISQ.INV.RT",
|
|
30314
30339
|
"CHISQ.TEST",
|
|
30340
|
+
"CHOOSECOLS",
|
|
30341
|
+
"CHOOSEROWS",
|
|
30315
30342
|
"COMBINA",
|
|
30316
30343
|
"CONCAT",
|
|
30317
30344
|
"CONFIDENCE.NORM",
|
|
@@ -30324,14 +30351,17 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30324
30351
|
"CSCH",
|
|
30325
30352
|
"DAYS",
|
|
30326
30353
|
"DECIMAL",
|
|
30354
|
+
"DROP",
|
|
30327
30355
|
"ERF.PRECISE",
|
|
30328
30356
|
"ERFC.PRECISE",
|
|
30357
|
+
"EXPAND",
|
|
30329
30358
|
"EXPON.DIST",
|
|
30330
30359
|
"F.DIST",
|
|
30331
30360
|
"F.DIST.RT",
|
|
30332
30361
|
"F.INV",
|
|
30333
30362
|
"F.INV.RT",
|
|
30334
30363
|
"F.TEST",
|
|
30364
|
+
"FIELDVALUE",
|
|
30335
30365
|
"FILTERXML",
|
|
30336
30366
|
"FLOOR.MATH",
|
|
30337
30367
|
"FLOOR.PRECISE",
|
|
@@ -30346,6 +30376,7 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30346
30376
|
"GAMMA.INV",
|
|
30347
30377
|
"GAMMALN.PRECISE",
|
|
30348
30378
|
"GAUSS",
|
|
30379
|
+
"HSTACK",
|
|
30349
30380
|
"HYPGEOM.DIST",
|
|
30350
30381
|
"IFNA",
|
|
30351
30382
|
"IFS",
|
|
@@ -30358,9 +30389,14 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30358
30389
|
"IMSINH",
|
|
30359
30390
|
"IMTAN",
|
|
30360
30391
|
"ISFORMULA",
|
|
30392
|
+
"ISOMITTED",
|
|
30361
30393
|
"ISOWEEKNUM",
|
|
30394
|
+
"LAMBDA",
|
|
30395
|
+
"LET",
|
|
30362
30396
|
"LOGNORM.DIST",
|
|
30363
30397
|
"LOGNORM.INV",
|
|
30398
|
+
"MAKEARRAY",
|
|
30399
|
+
"MAP",
|
|
30364
30400
|
"MAXIFS",
|
|
30365
30401
|
"MINIFS",
|
|
30366
30402
|
"MODE.MULT",
|
|
@@ -30380,17 +30416,26 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30380
30416
|
"PERMUTATIONA",
|
|
30381
30417
|
"PHI",
|
|
30382
30418
|
"POISSON.DIST",
|
|
30419
|
+
"PQSOURCE",
|
|
30420
|
+
"PYTHON_STR",
|
|
30421
|
+
"PYTHON_TYPE",
|
|
30422
|
+
"PYTHON_TYPENAME",
|
|
30383
30423
|
"QUARTILE.EXC",
|
|
30384
30424
|
"QUARTILE.INC",
|
|
30385
30425
|
"QUERYSTRING",
|
|
30426
|
+
"RANDARRAY",
|
|
30386
30427
|
"RANK.AVG",
|
|
30387
30428
|
"RANK.EQ",
|
|
30429
|
+
"REDUCE",
|
|
30388
30430
|
"RRI",
|
|
30431
|
+
"SCAN",
|
|
30389
30432
|
"SEC",
|
|
30390
30433
|
"SECH",
|
|
30434
|
+
"SEQUENCE",
|
|
30391
30435
|
"SHEET",
|
|
30392
30436
|
"SHEETS",
|
|
30393
30437
|
"SKEW.P",
|
|
30438
|
+
"SORTBY",
|
|
30394
30439
|
"STDEV.P",
|
|
30395
30440
|
"STDEV.S",
|
|
30396
30441
|
"SWITCH",
|
|
@@ -30400,13 +30445,24 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30400
30445
|
"T.INV",
|
|
30401
30446
|
"T.INV.2T",
|
|
30402
30447
|
"T.TEST",
|
|
30448
|
+
"TAKE",
|
|
30449
|
+
"TEXTAFTER",
|
|
30450
|
+
"TEXTBEFORE",
|
|
30403
30451
|
"TEXTJOIN",
|
|
30452
|
+
"TEXTSPLIT",
|
|
30453
|
+
"TOCOL",
|
|
30454
|
+
"TOROW",
|
|
30404
30455
|
"UNICHAR",
|
|
30405
30456
|
"UNICODE",
|
|
30457
|
+
"UNIQUE",
|
|
30406
30458
|
"VAR.P",
|
|
30407
30459
|
"VAR.S",
|
|
30460
|
+
"VSTACK",
|
|
30408
30461
|
"WEBSERVICE",
|
|
30409
30462
|
"WEIBULL.DIST",
|
|
30463
|
+
"WRAPCOLS",
|
|
30464
|
+
"WRAPROWS",
|
|
30465
|
+
"XLOOKUP",
|
|
30410
30466
|
"XOR",
|
|
30411
30467
|
"Z.TEST",
|
|
30412
30468
|
];
|
|
@@ -44347,7 +44403,10 @@ class Session extends EventBus {
|
|
|
44347
44403
|
/**
|
|
44348
44404
|
* Notify the server that the user client left the collaborative session
|
|
44349
44405
|
*/
|
|
44350
|
-
leave() {
|
|
44406
|
+
leave(data) {
|
|
44407
|
+
if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
|
|
44408
|
+
this.snapshot(data);
|
|
44409
|
+
}
|
|
44351
44410
|
delete this.clients[this.clientId];
|
|
44352
44411
|
this.transportService.leave(this.clientId);
|
|
44353
44412
|
this.transportService.sendMessage({
|
|
@@ -44360,6 +44419,9 @@ class Session extends EventBus {
|
|
|
44360
44419
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
44361
44420
|
*/
|
|
44362
44421
|
snapshot(data) {
|
|
44422
|
+
if (this.pendingMessages.length !== 0) {
|
|
44423
|
+
return;
|
|
44424
|
+
}
|
|
44363
44425
|
const snapshotId = this.uuidGenerator.uuidv4();
|
|
44364
44426
|
this.transportService.sendMessage({
|
|
44365
44427
|
type: "SNAPSHOT",
|
|
@@ -49140,10 +49202,8 @@ class EditionPlugin extends UIPlugin {
|
|
|
49140
49202
|
const refRange = this.getters.getRangeFromSheetXC(activeSheetId, xc);
|
|
49141
49203
|
return isEqual(this.getters.expandZone(activeSheetId, refRange.zone), oldZone);
|
|
49142
49204
|
});
|
|
49143
|
-
// this function assumes that the previous range is always found because
|
|
49144
|
-
// it's called when changing a highlight, which exists by definition
|
|
49145
49205
|
if (!previousRefToken) {
|
|
49146
|
-
|
|
49206
|
+
return;
|
|
49147
49207
|
}
|
|
49148
49208
|
const previousRange = this.getters.getRangeFromSheetXC(activeSheetId, previousRefToken.value);
|
|
49149
49209
|
this.selectionStart = previousRefToken.start;
|
|
@@ -51706,7 +51766,7 @@ class BottomBarSheet extends owl.Component {
|
|
|
51706
51766
|
this.env.focusableElement.focus();
|
|
51707
51767
|
}
|
|
51708
51768
|
}
|
|
51709
|
-
|
|
51769
|
+
onMouseEventSheetName(ev) {
|
|
51710
51770
|
if (this.state.isEditing)
|
|
51711
51771
|
ev.stopPropagation();
|
|
51712
51772
|
}
|
|
@@ -56899,6 +56959,7 @@ class Model extends EventBus {
|
|
|
56899
56959
|
coreHandlers = [];
|
|
56900
56960
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
56901
56961
|
super();
|
|
56962
|
+
setDefaultTranslationMethod();
|
|
56902
56963
|
stateUpdateMessages = repairInitialMessages(data, stateUpdateMessages);
|
|
56903
56964
|
const workbookData = load(data, verboseImport);
|
|
56904
56965
|
this.state = new StateObserver();
|
|
@@ -56974,7 +57035,7 @@ class Model extends EventBus {
|
|
|
56974
57035
|
this.session.join(this.config.client);
|
|
56975
57036
|
}
|
|
56976
57037
|
leaveSession() {
|
|
56977
|
-
this.session.leave();
|
|
57038
|
+
this.session.leave(this.exportData());
|
|
56978
57039
|
}
|
|
56979
57040
|
setupUiPlugin(Plugin) {
|
|
56980
57041
|
const plugin = new Plugin(this.uiPluginConfig);
|
|
@@ -57398,6 +57459,7 @@ const helpers = {
|
|
|
57398
57459
|
createAction,
|
|
57399
57460
|
createActions,
|
|
57400
57461
|
transformRangeData,
|
|
57462
|
+
deepEquals,
|
|
57401
57463
|
};
|
|
57402
57464
|
const links = {
|
|
57403
57465
|
isMarkdownLink,
|
|
@@ -57476,6 +57538,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
57476
57538
|
exports.tokenize = tokenize;
|
|
57477
57539
|
|
|
57478
57540
|
|
|
57479
|
-
__info__.version = "17.0.
|
|
57480
|
-
__info__.date = "2024-
|
|
57481
|
-
__info__.hash = "
|
|
57541
|
+
__info__.version = "17.0.28";
|
|
57542
|
+
__info__.date = "2024-07-02T10:35:57.899Z";
|
|
57543
|
+
__info__.hash = "7f86a16";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -852,7 +852,7 @@ declare class Session extends EventBus<CollaborativeEvent> {
|
|
|
852
852
|
/**
|
|
853
853
|
* Notify the server that the user client left the collaborative session
|
|
854
854
|
*/
|
|
855
|
-
leave(): void;
|
|
855
|
+
leave(data: WorkbookData): void;
|
|
856
856
|
/**
|
|
857
857
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
858
858
|
*/
|
|
@@ -993,6 +993,10 @@ declare function isDefined<T>(argument: T | undefined): argument is T;
|
|
|
993
993
|
* Lazy value computed by the provided function.
|
|
994
994
|
*/
|
|
995
995
|
declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
|
|
996
|
+
/**
|
|
997
|
+
* Compares two objects.
|
|
998
|
+
*/
|
|
999
|
+
declare function deepEquals(o1: any, o2: any, ignoreFunctions?: "ignoreFunctions"): boolean;
|
|
996
1000
|
|
|
997
1001
|
interface ConstructorArgs {
|
|
998
1002
|
readonly zone: Readonly<Zone | UnboundedZone>;
|
|
@@ -6189,7 +6193,7 @@ declare class BottomBarSheet extends Component<Props$v, SpreadsheetChildEnv> {
|
|
|
6189
6193
|
private activateSheet;
|
|
6190
6194
|
onDblClick(): void;
|
|
6191
6195
|
onKeyDown(ev: KeyboardEvent): void;
|
|
6192
|
-
|
|
6196
|
+
onMouseEventSheetName(ev: MouseEvent): void;
|
|
6193
6197
|
private startEdition;
|
|
6194
6198
|
private stopEdition;
|
|
6195
6199
|
private cancelEdition;
|
|
@@ -7819,7 +7823,8 @@ type SprintfValues = (string | String | number)[] | [{
|
|
|
7819
7823
|
}];
|
|
7820
7824
|
type TranslationFunction = (string: string, ...values: SprintfValues) => string;
|
|
7821
7825
|
/***
|
|
7822
|
-
* Allow to inject a translation function from outside o-spreadsheet.
|
|
7826
|
+
* Allow to inject a translation function from outside o-spreadsheet. This should be called before instantiating
|
|
7827
|
+
* a model.
|
|
7823
7828
|
* @param tfn the function that will do the translation
|
|
7824
7829
|
* @param loaded a function that returns true when the translation is loaded
|
|
7825
7830
|
*/
|
|
@@ -7934,6 +7939,7 @@ declare const helpers: {
|
|
|
7934
7939
|
createAction: typeof createAction;
|
|
7935
7940
|
createActions: typeof createActions;
|
|
7936
7941
|
transformRangeData: typeof transformRangeData;
|
|
7942
|
+
deepEquals: typeof deepEquals;
|
|
7937
7943
|
};
|
|
7938
7944
|
declare const links: {
|
|
7939
7945
|
isMarkdownLink: typeof isMarkdownLink;
|
|
@@ -2,16 +2,17 @@
|
|
|
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 17.0.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.0.28
|
|
6
|
+
* @date 2024-07-02T10:35:57.899Z
|
|
7
|
+
* @hash 7f86a16
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, useRef, onMounted, useEffect, onWillPatch, useState, onWillUpdateProps, onPatched, useComponent, useExternalListener, onWillUnmount, onWillStart, xml, useChildSubEnv, useSubEnv, markRaw } from '@odoo/owl';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let
|
|
12
|
+
const defaultTranslate = (s) => s;
|
|
13
|
+
const defaultLoaded = () => false;
|
|
14
|
+
let _translate = defaultTranslate;
|
|
15
|
+
let _loaded = defaultLoaded;
|
|
15
16
|
function sprintf(s, ...values) {
|
|
16
17
|
if (values.length === 1 && typeof values[0] === "object" && !(values[0] instanceof String)) {
|
|
17
18
|
const valuesDict = values[0];
|
|
@@ -23,7 +24,8 @@ function sprintf(s, ...values) {
|
|
|
23
24
|
return s;
|
|
24
25
|
}
|
|
25
26
|
/***
|
|
26
|
-
* Allow to inject a translation function from outside o-spreadsheet.
|
|
27
|
+
* Allow to inject a translation function from outside o-spreadsheet. This should be called before instantiating
|
|
28
|
+
* a model.
|
|
27
29
|
* @param tfn the function that will do the translation
|
|
28
30
|
* @param loaded a function that returns true when the translation is loaded
|
|
29
31
|
*/
|
|
@@ -31,6 +33,18 @@ function setTranslationMethod(tfn, loaded = () => true) {
|
|
|
31
33
|
_translate = tfn;
|
|
32
34
|
_loaded = loaded;
|
|
33
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* If no translation function has been set, this will mark the translation are loaded.
|
|
38
|
+
*
|
|
39
|
+
* By default, the translations should not be set as loaded, otherwise top-level translated constants will never be
|
|
40
|
+
* translated. But if by the time the model is instantiated no custom translation function has been set, we can set
|
|
41
|
+
* the default translation function as loaded so o-spreadsheet can be run in standalone with no translations.
|
|
42
|
+
*/
|
|
43
|
+
function setDefaultTranslationMethod() {
|
|
44
|
+
if (_translate === defaultTranslate && _loaded === defaultLoaded) {
|
|
45
|
+
_loaded = () => true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
34
48
|
const _t = function (s, ...values) {
|
|
35
49
|
if (!_loaded()) {
|
|
36
50
|
return new LazyTranslatedString(s, values);
|
|
@@ -6931,7 +6945,7 @@ class Popover extends Component {
|
|
|
6931
6945
|
if (!anchor)
|
|
6932
6946
|
return;
|
|
6933
6947
|
const propsMaxSize = { width: this.props.maxWidth, height: this.props.maxHeight };
|
|
6934
|
-
|
|
6948
|
+
let elDims = {
|
|
6935
6949
|
width: el.getBoundingClientRect().width,
|
|
6936
6950
|
height: el.getBoundingClientRect().height,
|
|
6937
6951
|
};
|
|
@@ -6939,7 +6953,14 @@ class Popover extends Component {
|
|
|
6939
6953
|
const popoverPositionHelper = this.props.positioning === "BottomLeft"
|
|
6940
6954
|
? new BottomLeftPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect)
|
|
6941
6955
|
: new TopRightPopoverContext(anchor, this.containerRect, propsMaxSize, spreadsheetRect);
|
|
6942
|
-
|
|
6956
|
+
el.style["max-height"] = popoverPositionHelper.getMaxHeight(elDims.height) + "px";
|
|
6957
|
+
el.style["max-width"] = popoverPositionHelper.getMaxWidth(elDims.width) + "px";
|
|
6958
|
+
// Re-compute the dimensions after setting the max-width and max-height
|
|
6959
|
+
elDims = {
|
|
6960
|
+
width: el.getBoundingClientRect().width,
|
|
6961
|
+
height: el.getBoundingClientRect().height,
|
|
6962
|
+
};
|
|
6963
|
+
let style = popoverPositionHelper.getCss(elDims, this.props.verticalOffset);
|
|
6943
6964
|
for (const property of Object.keys(style)) {
|
|
6944
6965
|
el.style[property] = style[property];
|
|
6945
6966
|
}
|
|
@@ -7015,8 +7036,6 @@ class PopoverPositionContext {
|
|
|
7015
7036
|
const shouldRenderAtRight = this.shouldRenderAtRight(elDims.width);
|
|
7016
7037
|
verticalOffset = shouldRenderAtBottom ? verticalOffset : -verticalOffset;
|
|
7017
7038
|
const cssProperties = {
|
|
7018
|
-
"max-height": maxHeight + "px",
|
|
7019
|
-
"max-width": maxWidth + "px",
|
|
7020
7039
|
top: this.getTopCoordinate(actualHeight, shouldRenderAtBottom) -
|
|
7021
7040
|
this.spreadsheetOffset.y -
|
|
7022
7041
|
verticalOffset +
|
|
@@ -24975,13 +24994,17 @@ SplitIntoColumnsPanel.props = {
|
|
|
24975
24994
|
class SelectMenu extends Component {
|
|
24976
24995
|
static template = "o-spreadsheet-SelectMenu";
|
|
24977
24996
|
static components = { Menu };
|
|
24997
|
+
menuId = new UuidGenerator().uuidv4();
|
|
24978
24998
|
selectRef = useRef("select");
|
|
24979
24999
|
selectRect = useAbsoluteBoundingRect(this.selectRef);
|
|
24980
25000
|
state = useState({
|
|
24981
25001
|
isMenuOpen: false,
|
|
24982
25002
|
});
|
|
24983
|
-
onClick() {
|
|
24984
|
-
this.
|
|
25003
|
+
onClick(ev) {
|
|
25004
|
+
if (ev.closedMenuId === this.menuId) {
|
|
25005
|
+
return;
|
|
25006
|
+
}
|
|
25007
|
+
this.state.isMenuOpen = !this.state.isMenuOpen;
|
|
24985
25008
|
}
|
|
24986
25009
|
onMenuClosed() {
|
|
24987
25010
|
this.state.isMenuOpen = false;
|
|
@@ -24989,7 +25012,7 @@ class SelectMenu extends Component {
|
|
|
24989
25012
|
get menuPosition() {
|
|
24990
25013
|
return {
|
|
24991
25014
|
x: this.selectRect.x,
|
|
24992
|
-
y: this.selectRect.y,
|
|
25015
|
+
y: this.selectRect.y + this.selectRect.height,
|
|
24993
25016
|
};
|
|
24994
25017
|
}
|
|
24995
25018
|
}
|
|
@@ -28020,7 +28043,7 @@ class FiguresContainer extends Component {
|
|
|
28020
28043
|
});
|
|
28021
28044
|
}
|
|
28022
28045
|
getContainerRect(container) {
|
|
28023
|
-
const { width: viewWidth, height: viewHeight } = this.env.model.getters.
|
|
28046
|
+
const { width: viewWidth, height: viewHeight } = this.env.model.getters.getSheetViewDimension();
|
|
28024
28047
|
const { x: viewportX, y: viewportY } = this.env.model.getters.getMainViewportCoordinates();
|
|
28025
28048
|
const x = ["bottomRight", "topRight"].includes(container) ? viewportX : 0;
|
|
28026
28049
|
const width = viewWidth - x;
|
|
@@ -30303,6 +30326,8 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30303
30326
|
"BITOR",
|
|
30304
30327
|
"BITRSHIFT",
|
|
30305
30328
|
"BITXOR",
|
|
30329
|
+
"BYCOL",
|
|
30330
|
+
"BYROW",
|
|
30306
30331
|
"CEILING.MATH",
|
|
30307
30332
|
"CEILING.PRECISE",
|
|
30308
30333
|
"CHISQ.DIST",
|
|
@@ -30310,6 +30335,8 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30310
30335
|
"CHISQ.INV",
|
|
30311
30336
|
"CHISQ.INV.RT",
|
|
30312
30337
|
"CHISQ.TEST",
|
|
30338
|
+
"CHOOSECOLS",
|
|
30339
|
+
"CHOOSEROWS",
|
|
30313
30340
|
"COMBINA",
|
|
30314
30341
|
"CONCAT",
|
|
30315
30342
|
"CONFIDENCE.NORM",
|
|
@@ -30322,14 +30349,17 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30322
30349
|
"CSCH",
|
|
30323
30350
|
"DAYS",
|
|
30324
30351
|
"DECIMAL",
|
|
30352
|
+
"DROP",
|
|
30325
30353
|
"ERF.PRECISE",
|
|
30326
30354
|
"ERFC.PRECISE",
|
|
30355
|
+
"EXPAND",
|
|
30327
30356
|
"EXPON.DIST",
|
|
30328
30357
|
"F.DIST",
|
|
30329
30358
|
"F.DIST.RT",
|
|
30330
30359
|
"F.INV",
|
|
30331
30360
|
"F.INV.RT",
|
|
30332
30361
|
"F.TEST",
|
|
30362
|
+
"FIELDVALUE",
|
|
30333
30363
|
"FILTERXML",
|
|
30334
30364
|
"FLOOR.MATH",
|
|
30335
30365
|
"FLOOR.PRECISE",
|
|
@@ -30344,6 +30374,7 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30344
30374
|
"GAMMA.INV",
|
|
30345
30375
|
"GAMMALN.PRECISE",
|
|
30346
30376
|
"GAUSS",
|
|
30377
|
+
"HSTACK",
|
|
30347
30378
|
"HYPGEOM.DIST",
|
|
30348
30379
|
"IFNA",
|
|
30349
30380
|
"IFS",
|
|
@@ -30356,9 +30387,14 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30356
30387
|
"IMSINH",
|
|
30357
30388
|
"IMTAN",
|
|
30358
30389
|
"ISFORMULA",
|
|
30390
|
+
"ISOMITTED",
|
|
30359
30391
|
"ISOWEEKNUM",
|
|
30392
|
+
"LAMBDA",
|
|
30393
|
+
"LET",
|
|
30360
30394
|
"LOGNORM.DIST",
|
|
30361
30395
|
"LOGNORM.INV",
|
|
30396
|
+
"MAKEARRAY",
|
|
30397
|
+
"MAP",
|
|
30362
30398
|
"MAXIFS",
|
|
30363
30399
|
"MINIFS",
|
|
30364
30400
|
"MODE.MULT",
|
|
@@ -30378,17 +30414,26 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30378
30414
|
"PERMUTATIONA",
|
|
30379
30415
|
"PHI",
|
|
30380
30416
|
"POISSON.DIST",
|
|
30417
|
+
"PQSOURCE",
|
|
30418
|
+
"PYTHON_STR",
|
|
30419
|
+
"PYTHON_TYPE",
|
|
30420
|
+
"PYTHON_TYPENAME",
|
|
30381
30421
|
"QUARTILE.EXC",
|
|
30382
30422
|
"QUARTILE.INC",
|
|
30383
30423
|
"QUERYSTRING",
|
|
30424
|
+
"RANDARRAY",
|
|
30384
30425
|
"RANK.AVG",
|
|
30385
30426
|
"RANK.EQ",
|
|
30427
|
+
"REDUCE",
|
|
30386
30428
|
"RRI",
|
|
30429
|
+
"SCAN",
|
|
30387
30430
|
"SEC",
|
|
30388
30431
|
"SECH",
|
|
30432
|
+
"SEQUENCE",
|
|
30389
30433
|
"SHEET",
|
|
30390
30434
|
"SHEETS",
|
|
30391
30435
|
"SKEW.P",
|
|
30436
|
+
"SORTBY",
|
|
30392
30437
|
"STDEV.P",
|
|
30393
30438
|
"STDEV.S",
|
|
30394
30439
|
"SWITCH",
|
|
@@ -30398,13 +30443,24 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
30398
30443
|
"T.INV",
|
|
30399
30444
|
"T.INV.2T",
|
|
30400
30445
|
"T.TEST",
|
|
30446
|
+
"TAKE",
|
|
30447
|
+
"TEXTAFTER",
|
|
30448
|
+
"TEXTBEFORE",
|
|
30401
30449
|
"TEXTJOIN",
|
|
30450
|
+
"TEXTSPLIT",
|
|
30451
|
+
"TOCOL",
|
|
30452
|
+
"TOROW",
|
|
30402
30453
|
"UNICHAR",
|
|
30403
30454
|
"UNICODE",
|
|
30455
|
+
"UNIQUE",
|
|
30404
30456
|
"VAR.P",
|
|
30405
30457
|
"VAR.S",
|
|
30458
|
+
"VSTACK",
|
|
30406
30459
|
"WEBSERVICE",
|
|
30407
30460
|
"WEIBULL.DIST",
|
|
30461
|
+
"WRAPCOLS",
|
|
30462
|
+
"WRAPROWS",
|
|
30463
|
+
"XLOOKUP",
|
|
30408
30464
|
"XOR",
|
|
30409
30465
|
"Z.TEST",
|
|
30410
30466
|
];
|
|
@@ -44345,7 +44401,10 @@ class Session extends EventBus {
|
|
|
44345
44401
|
/**
|
|
44346
44402
|
* Notify the server that the user client left the collaborative session
|
|
44347
44403
|
*/
|
|
44348
|
-
leave() {
|
|
44404
|
+
leave(data) {
|
|
44405
|
+
if (Object.keys(this.clients).length === 1 && this.processedRevisions.size) {
|
|
44406
|
+
this.snapshot(data);
|
|
44407
|
+
}
|
|
44349
44408
|
delete this.clients[this.clientId];
|
|
44350
44409
|
this.transportService.leave(this.clientId);
|
|
44351
44410
|
this.transportService.sendMessage({
|
|
@@ -44358,6 +44417,9 @@ class Session extends EventBus {
|
|
|
44358
44417
|
* Send a snapshot of the spreadsheet to the collaboration server
|
|
44359
44418
|
*/
|
|
44360
44419
|
snapshot(data) {
|
|
44420
|
+
if (this.pendingMessages.length !== 0) {
|
|
44421
|
+
return;
|
|
44422
|
+
}
|
|
44361
44423
|
const snapshotId = this.uuidGenerator.uuidv4();
|
|
44362
44424
|
this.transportService.sendMessage({
|
|
44363
44425
|
type: "SNAPSHOT",
|
|
@@ -49138,10 +49200,8 @@ class EditionPlugin extends UIPlugin {
|
|
|
49138
49200
|
const refRange = this.getters.getRangeFromSheetXC(activeSheetId, xc);
|
|
49139
49201
|
return isEqual(this.getters.expandZone(activeSheetId, refRange.zone), oldZone);
|
|
49140
49202
|
});
|
|
49141
|
-
// this function assumes that the previous range is always found because
|
|
49142
|
-
// it's called when changing a highlight, which exists by definition
|
|
49143
49203
|
if (!previousRefToken) {
|
|
49144
|
-
|
|
49204
|
+
return;
|
|
49145
49205
|
}
|
|
49146
49206
|
const previousRange = this.getters.getRangeFromSheetXC(activeSheetId, previousRefToken.value);
|
|
49147
49207
|
this.selectionStart = previousRefToken.start;
|
|
@@ -51704,7 +51764,7 @@ class BottomBarSheet extends Component {
|
|
|
51704
51764
|
this.env.focusableElement.focus();
|
|
51705
51765
|
}
|
|
51706
51766
|
}
|
|
51707
|
-
|
|
51767
|
+
onMouseEventSheetName(ev) {
|
|
51708
51768
|
if (this.state.isEditing)
|
|
51709
51769
|
ev.stopPropagation();
|
|
51710
51770
|
}
|
|
@@ -56897,6 +56957,7 @@ class Model extends EventBus {
|
|
|
56897
56957
|
coreHandlers = [];
|
|
56898
56958
|
constructor(data = {}, config = {}, stateUpdateMessages = [], uuidGenerator = new UuidGenerator(), verboseImport = true) {
|
|
56899
56959
|
super();
|
|
56960
|
+
setDefaultTranslationMethod();
|
|
56900
56961
|
stateUpdateMessages = repairInitialMessages(data, stateUpdateMessages);
|
|
56901
56962
|
const workbookData = load(data, verboseImport);
|
|
56902
56963
|
this.state = new StateObserver();
|
|
@@ -56972,7 +57033,7 @@ class Model extends EventBus {
|
|
|
56972
57033
|
this.session.join(this.config.client);
|
|
56973
57034
|
}
|
|
56974
57035
|
leaveSession() {
|
|
56975
|
-
this.session.leave();
|
|
57036
|
+
this.session.leave(this.exportData());
|
|
56976
57037
|
}
|
|
56977
57038
|
setupUiPlugin(Plugin) {
|
|
56978
57039
|
const plugin = new Plugin(this.uiPluginConfig);
|
|
@@ -57396,6 +57457,7 @@ const helpers = {
|
|
|
57396
57457
|
createAction,
|
|
57397
57458
|
createActions,
|
|
57398
57459
|
transformRangeData,
|
|
57460
|
+
deepEquals,
|
|
57399
57461
|
};
|
|
57400
57462
|
const links = {
|
|
57401
57463
|
isMarkdownLink,
|
|
@@ -57439,6 +57501,6 @@ const constants = {
|
|
|
57439
57501
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
57440
57502
|
|
|
57441
57503
|
|
|
57442
|
-
__info__.version = "17.0.
|
|
57443
|
-
__info__.date = "2024-
|
|
57444
|
-
__info__.hash = "
|
|
57504
|
+
__info__.version = "17.0.28";
|
|
57505
|
+
__info__.date = "2024-07-02T10:35:57.899Z";
|
|
57506
|
+
__info__.hash = "7f86a16";
|