@odoo/o-spreadsheet 16.3.27 → 16.3.30
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.
|
@@ -4794,8 +4794,8 @@ function getGroup(cell, cells, filter) {
|
|
|
4794
4794
|
if (x === cell) {
|
|
4795
4795
|
found = true;
|
|
4796
4796
|
}
|
|
4797
|
-
const cellValue = evaluateLiteral(x?.content);
|
|
4798
|
-
if (filter(cellValue)) {
|
|
4797
|
+
const cellValue = x?.isFormula ? undefined : evaluateLiteral(x?.content);
|
|
4798
|
+
if (cellValue && filter(cellValue)) {
|
|
4799
4799
|
group.push(cellValue);
|
|
4800
4800
|
}
|
|
4801
4801
|
else {
|
|
@@ -16549,14 +16549,19 @@ const categorieFunctionAll = {
|
|
|
16549
16549
|
children: [allFunctionListMenuBuilder],
|
|
16550
16550
|
};
|
|
16551
16551
|
function allFunctionListMenuBuilder() {
|
|
16552
|
-
const fnNames = functionRegistry.getKeys();
|
|
16552
|
+
const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
|
|
16553
16553
|
return createFormulaFunctions(fnNames);
|
|
16554
16554
|
}
|
|
16555
16555
|
const categoriesFunctionListMenuBuilder = () => {
|
|
16556
16556
|
const functions = functionRegistry.content;
|
|
16557
|
-
const categories = [
|
|
16557
|
+
const categories = [
|
|
16558
|
+
...new Set(functionRegistry
|
|
16559
|
+
.getAll()
|
|
16560
|
+
.filter((fn) => !fn.hidden)
|
|
16561
|
+
.map((fn) => fn.category)),
|
|
16562
|
+
].filter(isDefined$1);
|
|
16558
16563
|
return categories.sort().map((category, i) => {
|
|
16559
|
-
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
|
|
16564
|
+
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
|
|
16560
16565
|
return {
|
|
16561
16566
|
name: category,
|
|
16562
16567
|
children: createFormulaFunctions(functionsInCategory),
|
|
@@ -20216,6 +20221,9 @@ class FigureComponent extends owl.Component {
|
|
|
20216
20221
|
el?.focus({ preventScroll: true });
|
|
20217
20222
|
}
|
|
20218
20223
|
}, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
|
|
20224
|
+
owl.onWillUnmount(() => {
|
|
20225
|
+
this.props.onFigureDeleted();
|
|
20226
|
+
});
|
|
20219
20227
|
}
|
|
20220
20228
|
clickAnchor(dirX, dirY, ev) {
|
|
20221
20229
|
this.props.onClickAnchor(dirX, dirY, ev);
|
|
@@ -20234,6 +20242,7 @@ class FigureComponent extends owl.Component {
|
|
|
20234
20242
|
this.props.onFigureDeleted();
|
|
20235
20243
|
ev.stopPropagation();
|
|
20236
20244
|
ev.preventDefault();
|
|
20245
|
+
ev.stopPropagation();
|
|
20237
20246
|
break;
|
|
20238
20247
|
case "ArrowDown":
|
|
20239
20248
|
case "ArrowLeft":
|
|
@@ -20254,6 +20263,7 @@ class FigureComponent extends owl.Component {
|
|
|
20254
20263
|
});
|
|
20255
20264
|
ev.stopPropagation();
|
|
20256
20265
|
ev.preventDefault();
|
|
20266
|
+
ev.stopPropagation();
|
|
20257
20267
|
break;
|
|
20258
20268
|
}
|
|
20259
20269
|
}
|
|
@@ -21062,6 +21072,10 @@ class Composer extends owl.Component {
|
|
|
21062
21072
|
if (!this.isKeyStillDown) {
|
|
21063
21073
|
this.processContent();
|
|
21064
21074
|
}
|
|
21075
|
+
// Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
|
|
21076
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21077
|
+
this.processTokenAtCursor();
|
|
21078
|
+
}
|
|
21065
21079
|
});
|
|
21066
21080
|
}
|
|
21067
21081
|
// ---------------------------------------------------------------------------
|
|
@@ -21662,7 +21676,11 @@ class GridComposer extends owl.Component {
|
|
|
21662
21676
|
}
|
|
21663
21677
|
}
|
|
21664
21678
|
updateCellReferenceVisibility() {
|
|
21665
|
-
if (this.
|
|
21679
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21680
|
+
this.isCellReferenceVisible = false;
|
|
21681
|
+
return;
|
|
21682
|
+
}
|
|
21683
|
+
if (this.isCellReferenceVisible) {
|
|
21666
21684
|
return;
|
|
21667
21685
|
}
|
|
21668
21686
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -21823,7 +21841,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
21823
21841
|
function clamp(value, min, max) {
|
|
21824
21842
|
return Math.min(Math.max(value, min), max);
|
|
21825
21843
|
}
|
|
21826
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
21844
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
21827
21845
|
let { x, y, width, height } = initialFigure;
|
|
21828
21846
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
21829
21847
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -21850,14 +21868,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
21850
21868
|
y = initialFigure.y - deltaY;
|
|
21851
21869
|
}
|
|
21852
21870
|
}
|
|
21853
|
-
//
|
|
21854
|
-
if (x
|
|
21855
|
-
width
|
|
21856
|
-
x =
|
|
21871
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
21872
|
+
if (x + scrollX <= 0) {
|
|
21873
|
+
width = width + x + scrollX;
|
|
21874
|
+
x = -scrollX;
|
|
21857
21875
|
}
|
|
21858
|
-
if (y
|
|
21859
|
-
height
|
|
21860
|
-
y =
|
|
21876
|
+
if (y + scrollY <= 0) {
|
|
21877
|
+
height = height + y + scrollY;
|
|
21878
|
+
y = -scrollY;
|
|
21861
21879
|
}
|
|
21862
21880
|
return { ...initialFigure, x, y, width, height };
|
|
21863
21881
|
}
|
|
@@ -22274,7 +22292,7 @@ class FiguresContainer extends owl.Component {
|
|
|
22274
22292
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
22275
22293
|
const onMouseMove = (ev) => {
|
|
22276
22294
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
22277
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
22295
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
22278
22296
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
22279
22297
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
22280
22298
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -30704,6 +30722,15 @@ class FigurePlugin extends CorePlugin {
|
|
|
30704
30722
|
return 0 /* CommandResult.Success */;
|
|
30705
30723
|
}
|
|
30706
30724
|
}
|
|
30725
|
+
beforeHandle(cmd) {
|
|
30726
|
+
switch (cmd.type) {
|
|
30727
|
+
case "DELETE_SHEET":
|
|
30728
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
30729
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
30730
|
+
});
|
|
30731
|
+
break;
|
|
30732
|
+
}
|
|
30733
|
+
}
|
|
30707
30734
|
handle(cmd) {
|
|
30708
30735
|
switch (cmd.type) {
|
|
30709
30736
|
case "CREATE_SHEET":
|
|
@@ -41670,6 +41697,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41670
41697
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
41671
41698
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
41672
41699
|
this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
|
|
41700
|
+
this.selectedFigureId = null;
|
|
41673
41701
|
break;
|
|
41674
41702
|
}
|
|
41675
41703
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
@@ -42450,6 +42478,9 @@ class BottomBarSheet extends owl.Component {
|
|
|
42450
42478
|
this.scrollToSheet();
|
|
42451
42479
|
}
|
|
42452
42480
|
onDblClick() {
|
|
42481
|
+
if (this.env.model.getters.isReadonly()) {
|
|
42482
|
+
return;
|
|
42483
|
+
}
|
|
42453
42484
|
this.startEdition();
|
|
42454
42485
|
}
|
|
42455
42486
|
onKeyDown(ev) {
|
|
@@ -48033,6 +48064,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
48033
48064
|
exports.tokenize = tokenize;
|
|
48034
48065
|
|
|
48035
48066
|
|
|
48036
|
-
__info__.version = '16.3.
|
|
48037
|
-
__info__.date = '2024-
|
|
48038
|
-
__info__.hash = '
|
|
48067
|
+
__info__.version = '16.3.30';
|
|
48068
|
+
__info__.date = '2024-03-25T09:36:48.685Z';
|
|
48069
|
+
__info__.hash = '0d2ee33';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -3349,6 +3349,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
|
|
|
3349
3349
|
[sheet: string]: Record<UID, Figure | undefined> | undefined;
|
|
3350
3350
|
};
|
|
3351
3351
|
allowDispatch(cmd: CoreCommand): CommandResult;
|
|
3352
|
+
beforeHandle(cmd: CoreCommand): void;
|
|
3352
3353
|
handle(cmd: CoreCommand): void;
|
|
3353
3354
|
private onRowColDelete;
|
|
3354
3355
|
private onRowDeletion;
|
|
@@ -4790,8 +4790,8 @@ function getGroup(cell, cells, filter) {
|
|
|
4790
4790
|
if (x === cell) {
|
|
4791
4791
|
found = true;
|
|
4792
4792
|
}
|
|
4793
|
-
const cellValue = evaluateLiteral(x?.content);
|
|
4794
|
-
if (filter(cellValue)) {
|
|
4793
|
+
const cellValue = x?.isFormula ? undefined : evaluateLiteral(x?.content);
|
|
4794
|
+
if (cellValue && filter(cellValue)) {
|
|
4795
4795
|
group.push(cellValue);
|
|
4796
4796
|
}
|
|
4797
4797
|
else {
|
|
@@ -16545,14 +16545,19 @@ const categorieFunctionAll = {
|
|
|
16545
16545
|
children: [allFunctionListMenuBuilder],
|
|
16546
16546
|
};
|
|
16547
16547
|
function allFunctionListMenuBuilder() {
|
|
16548
|
-
const fnNames = functionRegistry.getKeys();
|
|
16548
|
+
const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
|
|
16549
16549
|
return createFormulaFunctions(fnNames);
|
|
16550
16550
|
}
|
|
16551
16551
|
const categoriesFunctionListMenuBuilder = () => {
|
|
16552
16552
|
const functions = functionRegistry.content;
|
|
16553
|
-
const categories = [
|
|
16553
|
+
const categories = [
|
|
16554
|
+
...new Set(functionRegistry
|
|
16555
|
+
.getAll()
|
|
16556
|
+
.filter((fn) => !fn.hidden)
|
|
16557
|
+
.map((fn) => fn.category)),
|
|
16558
|
+
].filter(isDefined$1);
|
|
16554
16559
|
return categories.sort().map((category, i) => {
|
|
16555
|
-
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
|
|
16560
|
+
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
|
|
16556
16561
|
return {
|
|
16557
16562
|
name: category,
|
|
16558
16563
|
children: createFormulaFunctions(functionsInCategory),
|
|
@@ -20212,6 +20217,9 @@ class FigureComponent extends Component {
|
|
|
20212
20217
|
el?.focus({ preventScroll: true });
|
|
20213
20218
|
}
|
|
20214
20219
|
}, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
|
|
20220
|
+
onWillUnmount(() => {
|
|
20221
|
+
this.props.onFigureDeleted();
|
|
20222
|
+
});
|
|
20215
20223
|
}
|
|
20216
20224
|
clickAnchor(dirX, dirY, ev) {
|
|
20217
20225
|
this.props.onClickAnchor(dirX, dirY, ev);
|
|
@@ -20230,6 +20238,7 @@ class FigureComponent extends Component {
|
|
|
20230
20238
|
this.props.onFigureDeleted();
|
|
20231
20239
|
ev.stopPropagation();
|
|
20232
20240
|
ev.preventDefault();
|
|
20241
|
+
ev.stopPropagation();
|
|
20233
20242
|
break;
|
|
20234
20243
|
case "ArrowDown":
|
|
20235
20244
|
case "ArrowLeft":
|
|
@@ -20250,6 +20259,7 @@ class FigureComponent extends Component {
|
|
|
20250
20259
|
});
|
|
20251
20260
|
ev.stopPropagation();
|
|
20252
20261
|
ev.preventDefault();
|
|
20262
|
+
ev.stopPropagation();
|
|
20253
20263
|
break;
|
|
20254
20264
|
}
|
|
20255
20265
|
}
|
|
@@ -21058,6 +21068,10 @@ class Composer extends Component {
|
|
|
21058
21068
|
if (!this.isKeyStillDown) {
|
|
21059
21069
|
this.processContent();
|
|
21060
21070
|
}
|
|
21071
|
+
// Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
|
|
21072
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21073
|
+
this.processTokenAtCursor();
|
|
21074
|
+
}
|
|
21061
21075
|
});
|
|
21062
21076
|
}
|
|
21063
21077
|
// ---------------------------------------------------------------------------
|
|
@@ -21658,7 +21672,11 @@ class GridComposer extends Component {
|
|
|
21658
21672
|
}
|
|
21659
21673
|
}
|
|
21660
21674
|
updateCellReferenceVisibility() {
|
|
21661
|
-
if (this.
|
|
21675
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21676
|
+
this.isCellReferenceVisible = false;
|
|
21677
|
+
return;
|
|
21678
|
+
}
|
|
21679
|
+
if (this.isCellReferenceVisible) {
|
|
21662
21680
|
return;
|
|
21663
21681
|
}
|
|
21664
21682
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -21819,7 +21837,7 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
21819
21837
|
function clamp(value, min, max) {
|
|
21820
21838
|
return Math.min(Math.max(value, min), max);
|
|
21821
21839
|
}
|
|
21822
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
21840
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
21823
21841
|
let { x, y, width, height } = initialFigure;
|
|
21824
21842
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
21825
21843
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -21846,14 +21864,14 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
21846
21864
|
y = initialFigure.y - deltaY;
|
|
21847
21865
|
}
|
|
21848
21866
|
}
|
|
21849
|
-
//
|
|
21850
|
-
if (x
|
|
21851
|
-
width
|
|
21852
|
-
x =
|
|
21867
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
21868
|
+
if (x + scrollX <= 0) {
|
|
21869
|
+
width = width + x + scrollX;
|
|
21870
|
+
x = -scrollX;
|
|
21853
21871
|
}
|
|
21854
|
-
if (y
|
|
21855
|
-
height
|
|
21856
|
-
y =
|
|
21872
|
+
if (y + scrollY <= 0) {
|
|
21873
|
+
height = height + y + scrollY;
|
|
21874
|
+
y = -scrollY;
|
|
21857
21875
|
}
|
|
21858
21876
|
return { ...initialFigure, x, y, width, height };
|
|
21859
21877
|
}
|
|
@@ -22270,7 +22288,7 @@ class FiguresContainer extends Component {
|
|
|
22270
22288
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
22271
22289
|
const onMouseMove = (ev) => {
|
|
22272
22290
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
22273
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
22291
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
22274
22292
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
22275
22293
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
22276
22294
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -30700,6 +30718,15 @@ class FigurePlugin extends CorePlugin {
|
|
|
30700
30718
|
return 0 /* CommandResult.Success */;
|
|
30701
30719
|
}
|
|
30702
30720
|
}
|
|
30721
|
+
beforeHandle(cmd) {
|
|
30722
|
+
switch (cmd.type) {
|
|
30723
|
+
case "DELETE_SHEET":
|
|
30724
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
30725
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
30726
|
+
});
|
|
30727
|
+
break;
|
|
30728
|
+
}
|
|
30729
|
+
}
|
|
30703
30730
|
handle(cmd) {
|
|
30704
30731
|
switch (cmd.type) {
|
|
30705
30732
|
case "CREATE_SHEET":
|
|
@@ -41666,6 +41693,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41666
41693
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
41667
41694
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
41668
41695
|
this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
|
|
41696
|
+
this.selectedFigureId = null;
|
|
41669
41697
|
break;
|
|
41670
41698
|
}
|
|
41671
41699
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
@@ -42446,6 +42474,9 @@ class BottomBarSheet extends Component {
|
|
|
42446
42474
|
this.scrollToSheet();
|
|
42447
42475
|
}
|
|
42448
42476
|
onDblClick() {
|
|
42477
|
+
if (this.env.model.getters.isReadonly()) {
|
|
42478
|
+
return;
|
|
42479
|
+
}
|
|
42449
42480
|
this.startEdition();
|
|
42450
42481
|
}
|
|
42451
42482
|
onKeyDown(ev) {
|
|
@@ -48001,6 +48032,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
48001
48032
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
48002
48033
|
|
|
48003
48034
|
|
|
48004
|
-
__info__.version = '16.3.
|
|
48005
|
-
__info__.date = '2024-
|
|
48006
|
-
__info__.hash = '
|
|
48035
|
+
__info__.version = '16.3.30';
|
|
48036
|
+
__info__.date = '2024-03-25T09:36:48.685Z';
|
|
48037
|
+
__info__.hash = '0d2ee33';
|
|
@@ -4791,8 +4791,8 @@
|
|
|
4791
4791
|
if (x === cell) {
|
|
4792
4792
|
found = true;
|
|
4793
4793
|
}
|
|
4794
|
-
const cellValue = evaluateLiteral(x?.content);
|
|
4795
|
-
if (filter(cellValue)) {
|
|
4794
|
+
const cellValue = x?.isFormula ? undefined : evaluateLiteral(x?.content);
|
|
4795
|
+
if (cellValue && filter(cellValue)) {
|
|
4796
4796
|
group.push(cellValue);
|
|
4797
4797
|
}
|
|
4798
4798
|
else {
|
|
@@ -16546,14 +16546,19 @@
|
|
|
16546
16546
|
children: [allFunctionListMenuBuilder],
|
|
16547
16547
|
};
|
|
16548
16548
|
function allFunctionListMenuBuilder() {
|
|
16549
|
-
const fnNames = functionRegistry.getKeys();
|
|
16549
|
+
const fnNames = functionRegistry.getKeys().filter((key) => !functionRegistry.get(key).hidden);
|
|
16550
16550
|
return createFormulaFunctions(fnNames);
|
|
16551
16551
|
}
|
|
16552
16552
|
const categoriesFunctionListMenuBuilder = () => {
|
|
16553
16553
|
const functions = functionRegistry.content;
|
|
16554
|
-
const categories = [
|
|
16554
|
+
const categories = [
|
|
16555
|
+
...new Set(functionRegistry
|
|
16556
|
+
.getAll()
|
|
16557
|
+
.filter((fn) => !fn.hidden)
|
|
16558
|
+
.map((fn) => fn.category)),
|
|
16559
|
+
].filter(isDefined$1);
|
|
16555
16560
|
return categories.sort().map((category, i) => {
|
|
16556
|
-
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category);
|
|
16561
|
+
const functionsInCategory = Object.keys(functions).filter((key) => functions[key].category === category && !functions[key].hidden);
|
|
16557
16562
|
return {
|
|
16558
16563
|
name: category,
|
|
16559
16564
|
children: createFormulaFunctions(functionsInCategory),
|
|
@@ -20213,6 +20218,9 @@
|
|
|
20213
20218
|
el?.focus({ preventScroll: true });
|
|
20214
20219
|
}
|
|
20215
20220
|
}, () => [this.env.model.getters.getSelectedFigureId(), this.props.figure.id, this.figureRef.el]);
|
|
20221
|
+
owl.onWillUnmount(() => {
|
|
20222
|
+
this.props.onFigureDeleted();
|
|
20223
|
+
});
|
|
20216
20224
|
}
|
|
20217
20225
|
clickAnchor(dirX, dirY, ev) {
|
|
20218
20226
|
this.props.onClickAnchor(dirX, dirY, ev);
|
|
@@ -20231,6 +20239,7 @@
|
|
|
20231
20239
|
this.props.onFigureDeleted();
|
|
20232
20240
|
ev.stopPropagation();
|
|
20233
20241
|
ev.preventDefault();
|
|
20242
|
+
ev.stopPropagation();
|
|
20234
20243
|
break;
|
|
20235
20244
|
case "ArrowDown":
|
|
20236
20245
|
case "ArrowLeft":
|
|
@@ -20251,6 +20260,7 @@
|
|
|
20251
20260
|
});
|
|
20252
20261
|
ev.stopPropagation();
|
|
20253
20262
|
ev.preventDefault();
|
|
20263
|
+
ev.stopPropagation();
|
|
20254
20264
|
break;
|
|
20255
20265
|
}
|
|
20256
20266
|
}
|
|
@@ -21059,6 +21069,10 @@
|
|
|
21059
21069
|
if (!this.isKeyStillDown) {
|
|
21060
21070
|
this.processContent();
|
|
21061
21071
|
}
|
|
21072
|
+
// Required because typing '=SUM' and double-clicking another cell leaves ShowProvider and ShowDescription true
|
|
21073
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21074
|
+
this.processTokenAtCursor();
|
|
21075
|
+
}
|
|
21062
21076
|
});
|
|
21063
21077
|
}
|
|
21064
21078
|
// ---------------------------------------------------------------------------
|
|
@@ -21659,7 +21673,11 @@
|
|
|
21659
21673
|
}
|
|
21660
21674
|
}
|
|
21661
21675
|
updateCellReferenceVisibility() {
|
|
21662
|
-
if (this.
|
|
21676
|
+
if (this.env.model.getters.getEditionMode() === "inactive") {
|
|
21677
|
+
this.isCellReferenceVisible = false;
|
|
21678
|
+
return;
|
|
21679
|
+
}
|
|
21680
|
+
if (this.isCellReferenceVisible) {
|
|
21663
21681
|
return;
|
|
21664
21682
|
}
|
|
21665
21683
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -21820,7 +21838,7 @@
|
|
|
21820
21838
|
function clamp(value, min, max) {
|
|
21821
21839
|
return Math.min(Math.max(value, min), max);
|
|
21822
21840
|
}
|
|
21823
|
-
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize) {
|
|
21841
|
+
function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX, scrollY }) {
|
|
21824
21842
|
let { x, y, width, height } = initialFigure;
|
|
21825
21843
|
if (keepRatio && dirX != 0 && dirY != 0) {
|
|
21826
21844
|
const deltaX = Math.min(dirX * (mouseInitialX - mouseX), initialFigure.width - minFigSize);
|
|
@@ -21847,14 +21865,14 @@
|
|
|
21847
21865
|
y = initialFigure.y - deltaY;
|
|
21848
21866
|
}
|
|
21849
21867
|
}
|
|
21850
|
-
//
|
|
21851
|
-
if (x
|
|
21852
|
-
width
|
|
21853
|
-
x =
|
|
21868
|
+
// Adjusts figure dimensions to ensure it remains within header boundaries and viewport during resizing.
|
|
21869
|
+
if (x + scrollX <= 0) {
|
|
21870
|
+
width = width + x + scrollX;
|
|
21871
|
+
x = -scrollX;
|
|
21854
21872
|
}
|
|
21855
|
-
if (y
|
|
21856
|
-
height
|
|
21857
|
-
y =
|
|
21873
|
+
if (y + scrollY <= 0) {
|
|
21874
|
+
height = height + y + scrollY;
|
|
21875
|
+
y = -scrollY;
|
|
21858
21876
|
}
|
|
21859
21877
|
return { ...initialFigure, x, y, width, height };
|
|
21860
21878
|
}
|
|
@@ -22271,7 +22289,7 @@
|
|
|
22271
22289
|
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
22272
22290
|
const onMouseMove = (ev) => {
|
|
22273
22291
|
const currentMousePosition = { x: ev.clientX, y: ev.clientY };
|
|
22274
|
-
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize);
|
|
22292
|
+
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minFigSize, this.env.model.getters.getActiveSheetScrollInfo());
|
|
22275
22293
|
const otherFigures = this.getOtherFigures(figure.id);
|
|
22276
22294
|
const snapResult = snapForResize(this.env.model.getters, dirX, dirY, draggedFigure, otherFigures);
|
|
22277
22295
|
this.dnd.draggedFigure = snapResult.snappedFigure;
|
|
@@ -30701,6 +30719,15 @@
|
|
|
30701
30719
|
return 0 /* CommandResult.Success */;
|
|
30702
30720
|
}
|
|
30703
30721
|
}
|
|
30722
|
+
beforeHandle(cmd) {
|
|
30723
|
+
switch (cmd.type) {
|
|
30724
|
+
case "DELETE_SHEET":
|
|
30725
|
+
this.getters.getFigures(cmd.sheetId).forEach((figure) => {
|
|
30726
|
+
this.dispatch("DELETE_FIGURE", { id: figure.id, sheetId: cmd.sheetId });
|
|
30727
|
+
});
|
|
30728
|
+
break;
|
|
30729
|
+
}
|
|
30730
|
+
}
|
|
30704
30731
|
handle(cmd) {
|
|
30705
30732
|
switch (cmd.type) {
|
|
30706
30733
|
case "CREATE_SHEET":
|
|
@@ -41667,6 +41694,7 @@
|
|
|
41667
41694
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
41668
41695
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
41669
41696
|
this.setSelectionMixin(this.gridSelection.anchor, this.gridSelection.zones);
|
|
41697
|
+
this.selectedFigureId = null;
|
|
41670
41698
|
break;
|
|
41671
41699
|
}
|
|
41672
41700
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
@@ -42447,6 +42475,9 @@
|
|
|
42447
42475
|
this.scrollToSheet();
|
|
42448
42476
|
}
|
|
42449
42477
|
onDblClick() {
|
|
42478
|
+
if (this.env.model.getters.isReadonly()) {
|
|
42479
|
+
return;
|
|
42480
|
+
}
|
|
42450
42481
|
this.startEdition();
|
|
42451
42482
|
}
|
|
42452
42483
|
onKeyDown(ev) {
|
|
@@ -48032,9 +48063,9 @@
|
|
|
48032
48063
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
48033
48064
|
|
|
48034
48065
|
|
|
48035
|
-
__info__.version = '16.3.
|
|
48036
|
-
__info__.date = '2024-
|
|
48037
|
-
__info__.hash = '
|
|
48066
|
+
__info__.version = '16.3.30';
|
|
48067
|
+
__info__.date = '2024-03-25T09:36:48.685Z';
|
|
48068
|
+
__info__.hash = '0d2ee33';
|
|
48038
48069
|
|
|
48039
48070
|
|
|
48040
48071
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|