@odoo/o-spreadsheet 16.0.48 → 16.0.50
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 +42 -40
- package/dist/o-spreadsheet.d.ts +2 -1
- package/dist/o-spreadsheet.esm.js +42 -40
- package/dist/o-spreadsheet.iife.js +42 -40
- package/dist/o-spreadsheet.iife.min.js +227 -227
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +2 -2
|
@@ -3346,7 +3346,7 @@ class DispatchResult {
|
|
|
3346
3346
|
* Static helper which returns a successful DispatchResult
|
|
3347
3347
|
*/
|
|
3348
3348
|
static get Success() {
|
|
3349
|
-
return
|
|
3349
|
+
return SUCCESS;
|
|
3350
3350
|
}
|
|
3351
3351
|
get isSuccessful() {
|
|
3352
3352
|
return this.reasons.length === 0;
|
|
@@ -3359,6 +3359,7 @@ class DispatchResult {
|
|
|
3359
3359
|
return this.reasons.includes(reason);
|
|
3360
3360
|
}
|
|
3361
3361
|
}
|
|
3362
|
+
const SUCCESS = new DispatchResult();
|
|
3362
3363
|
exports.CommandResult = void 0;
|
|
3363
3364
|
(function (CommandResult) {
|
|
3364
3365
|
CommandResult[CommandResult["Success"] = 0] = "Success";
|
|
@@ -4086,8 +4087,8 @@ function isCtrlKey(ev) {
|
|
|
4086
4087
|
* Return the o-spreadsheet element position relative
|
|
4087
4088
|
* to the browser viewport.
|
|
4088
4089
|
*/
|
|
4089
|
-
function
|
|
4090
|
-
const position = owl.useState({ x: 0, y: 0 });
|
|
4090
|
+
function useSpreadsheetRect() {
|
|
4091
|
+
const position = owl.useState({ x: 0, y: 0, width: 0, height: 0 });
|
|
4091
4092
|
let spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4092
4093
|
updatePosition();
|
|
4093
4094
|
function updatePosition() {
|
|
@@ -4095,9 +4096,11 @@ function useSpreadsheetPosition() {
|
|
|
4095
4096
|
spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4096
4097
|
}
|
|
4097
4098
|
if (spreadsheetElement) {
|
|
4098
|
-
const { top, left } = spreadsheetElement.getBoundingClientRect();
|
|
4099
|
+
const { top, left, width, height } = spreadsheetElement.getBoundingClientRect();
|
|
4099
4100
|
position.x = left;
|
|
4100
4101
|
position.y = top;
|
|
4102
|
+
position.width = width;
|
|
4103
|
+
position.height = height;
|
|
4101
4104
|
}
|
|
4102
4105
|
}
|
|
4103
4106
|
owl.onMounted(updatePosition);
|
|
@@ -4132,7 +4135,7 @@ function useAbsolutePosition(ref) {
|
|
|
4132
4135
|
class Popover extends owl.Component {
|
|
4133
4136
|
constructor() {
|
|
4134
4137
|
super(...arguments);
|
|
4135
|
-
this.
|
|
4138
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
4136
4139
|
}
|
|
4137
4140
|
get maxHeight() {
|
|
4138
4141
|
return Math.max(0, this.viewportDimension.height - BOTTOMBAR_HEIGHT - SCROLLBAR_WIDTH);
|
|
@@ -4141,8 +4144,8 @@ class Popover extends owl.Component {
|
|
|
4141
4144
|
// the props's position is expressed relative to the "body" element
|
|
4142
4145
|
// but we teleport the element in ".o-spreadsheet" to keep everything
|
|
4143
4146
|
// within our control and to avoid leaking into external DOM
|
|
4144
|
-
const horizontalPosition = `left:${this.horizontalPosition() - this.
|
|
4145
|
-
const verticalPosition = `top:${this.verticalPosition() - this.
|
|
4147
|
+
const horizontalPosition = `left:${this.horizontalPosition() - this.spreadsheetRect.x}`;
|
|
4148
|
+
const verticalPosition = `top:${this.verticalPosition() - this.spreadsheetRect.y}`;
|
|
4146
4149
|
const maxHeight = this.maxHeight;
|
|
4147
4150
|
const height = `max-height:${maxHeight}`;
|
|
4148
4151
|
const shadow = maxHeight !== 0 ? "box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);" : "";
|
|
@@ -11423,7 +11426,10 @@ function evaluatePredicate(value = "", criterion) {
|
|
|
11423
11426
|
return false;
|
|
11424
11427
|
}
|
|
11425
11428
|
if (typeof operand === "number" && operator === "=") {
|
|
11426
|
-
|
|
11429
|
+
if (typeof value === "string" && (isNumber(value) || isDateTime(value))) {
|
|
11430
|
+
return toNumber(value) === operand;
|
|
11431
|
+
}
|
|
11432
|
+
return value === operand;
|
|
11427
11433
|
}
|
|
11428
11434
|
if (operator === "<>" || operator === "=") {
|
|
11429
11435
|
let result;
|
|
@@ -20432,6 +20438,7 @@ class Composer extends owl.Component {
|
|
|
20432
20438
|
constructor() {
|
|
20433
20439
|
super(...arguments);
|
|
20434
20440
|
this.composerRef = owl.useRef("o_composer");
|
|
20441
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
20435
20442
|
this.contentHelper = new ContentEditableHelper(this.composerRef.el);
|
|
20436
20443
|
this.composerState = owl.useState({
|
|
20437
20444
|
positionStart: 0,
|
|
@@ -20467,24 +20474,28 @@ class Composer extends owl.Component {
|
|
|
20467
20474
|
};
|
|
20468
20475
|
}
|
|
20469
20476
|
get assistantStyle() {
|
|
20477
|
+
const composerRect = this.composerRef.el.getBoundingClientRect();
|
|
20478
|
+
const assistantStyle = {
|
|
20479
|
+
width: `${ASSISTANT_WIDTH}px`,
|
|
20480
|
+
};
|
|
20470
20481
|
if (this.props.delimitation && this.props.rect) {
|
|
20471
20482
|
const { x: cellX, y: cellY, height: cellHeight } = this.props.rect;
|
|
20472
20483
|
const remainingHeight = this.props.delimitation.height - (cellY + cellHeight);
|
|
20473
|
-
let assistantStyle = "";
|
|
20474
20484
|
if (cellY > remainingHeight) {
|
|
20475
20485
|
// render top
|
|
20476
|
-
assistantStyle
|
|
20477
|
-
|
|
20478
|
-
transform: translate(0, -100%);
|
|
20479
|
-
`;
|
|
20486
|
+
assistantStyle.top = "-8px";
|
|
20487
|
+
assistantStyle.transform = "translate(0, -100%)";
|
|
20480
20488
|
}
|
|
20481
20489
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) {
|
|
20482
20490
|
// render left
|
|
20483
|
-
assistantStyle
|
|
20491
|
+
assistantStyle.right = "0px";
|
|
20484
20492
|
}
|
|
20485
|
-
return (assistantStyle
|
|
20493
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20494
|
+
}
|
|
20495
|
+
if (composerRect.left + ASSISTANT_WIDTH > this.spreadsheetRect.width) {
|
|
20496
|
+
assistantStyle.right = "0px";
|
|
20486
20497
|
}
|
|
20487
|
-
return
|
|
20498
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20488
20499
|
}
|
|
20489
20500
|
setup() {
|
|
20490
20501
|
owl.onMounted(() => {
|
|
@@ -27468,12 +27479,13 @@ class BordersPlugin extends CorePlugin {
|
|
|
27468
27479
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
27469
27480
|
break;
|
|
27470
27481
|
case "REMOVE_COLUMNS_ROWS":
|
|
27471
|
-
|
|
27482
|
+
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
27483
|
+
for (const group of groupConsecutive(elements)) {
|
|
27472
27484
|
if (cmd.dimension === "COL") {
|
|
27473
|
-
this.shiftBordersHorizontally(cmd.sheetId,
|
|
27485
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27474
27486
|
}
|
|
27475
27487
|
else {
|
|
27476
|
-
this.shiftBordersVertically(cmd.sheetId,
|
|
27488
|
+
this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27477
27489
|
}
|
|
27478
27490
|
}
|
|
27479
27491
|
break;
|
|
@@ -30970,12 +30982,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30970
30982
|
});
|
|
30971
30983
|
}
|
|
30972
30984
|
if (colIndex > deletedColumn) {
|
|
30973
|
-
this.
|
|
30974
|
-
sheetId: sheet.id,
|
|
30975
|
-
cellId: cellId,
|
|
30976
|
-
col: colIndex - 1,
|
|
30977
|
-
row: rowIndex,
|
|
30978
|
-
});
|
|
30985
|
+
this.setNewPosition(cellId, sheet.id, colIndex - 1, rowIndex);
|
|
30979
30986
|
}
|
|
30980
30987
|
}
|
|
30981
30988
|
}
|
|
@@ -30985,7 +30992,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30985
30992
|
* Move the cells after a column or rows insertion
|
|
30986
30993
|
*/
|
|
30987
30994
|
moveCellsOnAddition(sheet, addedElement, quantity, dimension) {
|
|
30988
|
-
const
|
|
30995
|
+
const updates = [];
|
|
30989
30996
|
for (let rowIndex = 0; rowIndex < sheet.rows.length; rowIndex++) {
|
|
30990
30997
|
const row = sheet.rows[rowIndex];
|
|
30991
30998
|
if (dimension !== "rows" || rowIndex >= addedElement) {
|
|
@@ -30994,20 +31001,20 @@ class SheetPlugin extends CorePlugin {
|
|
|
30994
31001
|
const cellId = row.cells[i];
|
|
30995
31002
|
if (cellId) {
|
|
30996
31003
|
if (dimension === "rows" || colIndex >= addedElement) {
|
|
30997
|
-
|
|
30998
|
-
type: "UPDATE_CELL_POSITION",
|
|
31004
|
+
updates.push({
|
|
30999
31005
|
sheetId: sheet.id,
|
|
31000
31006
|
cellId: cellId,
|
|
31001
31007
|
col: colIndex + (dimension === "columns" ? quantity : 0),
|
|
31002
31008
|
row: rowIndex + (dimension === "rows" ? quantity : 0),
|
|
31009
|
+
type: "UPDATE_CELL_POSITION",
|
|
31003
31010
|
});
|
|
31004
31011
|
}
|
|
31005
31012
|
}
|
|
31006
31013
|
}
|
|
31007
31014
|
}
|
|
31008
31015
|
}
|
|
31009
|
-
for (let
|
|
31010
|
-
this.
|
|
31016
|
+
for (let update of updates.reverse()) {
|
|
31017
|
+
this.updateCellPosition(update);
|
|
31011
31018
|
}
|
|
31012
31019
|
}
|
|
31013
31020
|
/**
|
|
@@ -31040,12 +31047,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31040
31047
|
const colIndex = Number(i);
|
|
31041
31048
|
const cellId = row.cells[i];
|
|
31042
31049
|
if (cellId) {
|
|
31043
|
-
this.
|
|
31044
|
-
sheetId: sheet.id,
|
|
31045
|
-
cellId: cellId,
|
|
31046
|
-
col: colIndex,
|
|
31047
|
-
row: rowIndex - numberRows,
|
|
31048
|
-
});
|
|
31050
|
+
this.setNewPosition(cellId, sheet.id, colIndex, rowIndex - numberRows);
|
|
31049
31051
|
}
|
|
31050
31052
|
}
|
|
31051
31053
|
}
|
|
@@ -40671,7 +40673,7 @@ class RangeAdapter {
|
|
|
40671
40673
|
* @param sheetXC the string description of a range, in the form SheetName!XC:XC
|
|
40672
40674
|
*/
|
|
40673
40675
|
getRangeFromSheetXC(defaultSheetId, sheetXC) {
|
|
40674
|
-
if (!rangeReference.test(sheetXC)) {
|
|
40676
|
+
if (!rangeReference.test(sheetXC) || !this.getters.tryGetSheet(defaultSheetId)) {
|
|
40675
40677
|
return new RangeImpl({
|
|
40676
40678
|
sheetId: "",
|
|
40677
40679
|
zone: { left: -1, top: -1, right: -1, bottom: -1 },
|
|
@@ -43439,6 +43441,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
43439
43441
|
exports.tokenize = tokenize;
|
|
43440
43442
|
|
|
43441
43443
|
|
|
43442
|
-
__info__.version = '16.0.
|
|
43443
|
-
__info__.date = '2024-
|
|
43444
|
-
__info__.hash = '
|
|
43444
|
+
__info__.version = '16.0.50';
|
|
43445
|
+
__info__.date = '2024-08-09T12:18:35.332Z';
|
|
43446
|
+
__info__.hash = '3972870';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -5287,7 +5287,7 @@ declare class Popover extends Component<Props$o, SpreadsheetChildEnv> {
|
|
|
5287
5287
|
onMouseWheel: () => void;
|
|
5288
5288
|
zIndex: ComponentsImportance;
|
|
5289
5289
|
};
|
|
5290
|
-
private
|
|
5290
|
+
private spreadsheetRect;
|
|
5291
5291
|
get maxHeight(): number;
|
|
5292
5292
|
get style(): string;
|
|
5293
5293
|
private get viewportDimension();
|
|
@@ -5574,6 +5574,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
|
|
|
5574
5574
|
el: HTMLElement | null;
|
|
5575
5575
|
};
|
|
5576
5576
|
private autocompleteAPI?;
|
|
5577
|
+
private spreadsheetRect;
|
|
5577
5578
|
contentHelper: ContentEditableHelper;
|
|
5578
5579
|
composerState: ComposerState$1;
|
|
5579
5580
|
autoCompleteState: AutoCompleteState;
|
|
@@ -3342,7 +3342,7 @@ class DispatchResult {
|
|
|
3342
3342
|
* Static helper which returns a successful DispatchResult
|
|
3343
3343
|
*/
|
|
3344
3344
|
static get Success() {
|
|
3345
|
-
return
|
|
3345
|
+
return SUCCESS;
|
|
3346
3346
|
}
|
|
3347
3347
|
get isSuccessful() {
|
|
3348
3348
|
return this.reasons.length === 0;
|
|
@@ -3355,6 +3355,7 @@ class DispatchResult {
|
|
|
3355
3355
|
return this.reasons.includes(reason);
|
|
3356
3356
|
}
|
|
3357
3357
|
}
|
|
3358
|
+
const SUCCESS = new DispatchResult();
|
|
3358
3359
|
var CommandResult;
|
|
3359
3360
|
(function (CommandResult) {
|
|
3360
3361
|
CommandResult[CommandResult["Success"] = 0] = "Success";
|
|
@@ -4082,8 +4083,8 @@ function isCtrlKey(ev) {
|
|
|
4082
4083
|
* Return the o-spreadsheet element position relative
|
|
4083
4084
|
* to the browser viewport.
|
|
4084
4085
|
*/
|
|
4085
|
-
function
|
|
4086
|
-
const position = useState({ x: 0, y: 0 });
|
|
4086
|
+
function useSpreadsheetRect() {
|
|
4087
|
+
const position = useState({ x: 0, y: 0, width: 0, height: 0 });
|
|
4087
4088
|
let spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4088
4089
|
updatePosition();
|
|
4089
4090
|
function updatePosition() {
|
|
@@ -4091,9 +4092,11 @@ function useSpreadsheetPosition() {
|
|
|
4091
4092
|
spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4092
4093
|
}
|
|
4093
4094
|
if (spreadsheetElement) {
|
|
4094
|
-
const { top, left } = spreadsheetElement.getBoundingClientRect();
|
|
4095
|
+
const { top, left, width, height } = spreadsheetElement.getBoundingClientRect();
|
|
4095
4096
|
position.x = left;
|
|
4096
4097
|
position.y = top;
|
|
4098
|
+
position.width = width;
|
|
4099
|
+
position.height = height;
|
|
4097
4100
|
}
|
|
4098
4101
|
}
|
|
4099
4102
|
onMounted(updatePosition);
|
|
@@ -4128,7 +4131,7 @@ function useAbsolutePosition(ref) {
|
|
|
4128
4131
|
class Popover extends Component {
|
|
4129
4132
|
constructor() {
|
|
4130
4133
|
super(...arguments);
|
|
4131
|
-
this.
|
|
4134
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
4132
4135
|
}
|
|
4133
4136
|
get maxHeight() {
|
|
4134
4137
|
return Math.max(0, this.viewportDimension.height - BOTTOMBAR_HEIGHT - SCROLLBAR_WIDTH);
|
|
@@ -4137,8 +4140,8 @@ class Popover extends Component {
|
|
|
4137
4140
|
// the props's position is expressed relative to the "body" element
|
|
4138
4141
|
// but we teleport the element in ".o-spreadsheet" to keep everything
|
|
4139
4142
|
// within our control and to avoid leaking into external DOM
|
|
4140
|
-
const horizontalPosition = `left:${this.horizontalPosition() - this.
|
|
4141
|
-
const verticalPosition = `top:${this.verticalPosition() - this.
|
|
4143
|
+
const horizontalPosition = `left:${this.horizontalPosition() - this.spreadsheetRect.x}`;
|
|
4144
|
+
const verticalPosition = `top:${this.verticalPosition() - this.spreadsheetRect.y}`;
|
|
4142
4145
|
const maxHeight = this.maxHeight;
|
|
4143
4146
|
const height = `max-height:${maxHeight}`;
|
|
4144
4147
|
const shadow = maxHeight !== 0 ? "box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);" : "";
|
|
@@ -11419,7 +11422,10 @@ function evaluatePredicate(value = "", criterion) {
|
|
|
11419
11422
|
return false;
|
|
11420
11423
|
}
|
|
11421
11424
|
if (typeof operand === "number" && operator === "=") {
|
|
11422
|
-
|
|
11425
|
+
if (typeof value === "string" && (isNumber(value) || isDateTime(value))) {
|
|
11426
|
+
return toNumber(value) === operand;
|
|
11427
|
+
}
|
|
11428
|
+
return value === operand;
|
|
11423
11429
|
}
|
|
11424
11430
|
if (operator === "<>" || operator === "=") {
|
|
11425
11431
|
let result;
|
|
@@ -20428,6 +20434,7 @@ class Composer extends Component {
|
|
|
20428
20434
|
constructor() {
|
|
20429
20435
|
super(...arguments);
|
|
20430
20436
|
this.composerRef = useRef("o_composer");
|
|
20437
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
20431
20438
|
this.contentHelper = new ContentEditableHelper(this.composerRef.el);
|
|
20432
20439
|
this.composerState = useState({
|
|
20433
20440
|
positionStart: 0,
|
|
@@ -20463,24 +20470,28 @@ class Composer extends Component {
|
|
|
20463
20470
|
};
|
|
20464
20471
|
}
|
|
20465
20472
|
get assistantStyle() {
|
|
20473
|
+
const composerRect = this.composerRef.el.getBoundingClientRect();
|
|
20474
|
+
const assistantStyle = {
|
|
20475
|
+
width: `${ASSISTANT_WIDTH}px`,
|
|
20476
|
+
};
|
|
20466
20477
|
if (this.props.delimitation && this.props.rect) {
|
|
20467
20478
|
const { x: cellX, y: cellY, height: cellHeight } = this.props.rect;
|
|
20468
20479
|
const remainingHeight = this.props.delimitation.height - (cellY + cellHeight);
|
|
20469
|
-
let assistantStyle = "";
|
|
20470
20480
|
if (cellY > remainingHeight) {
|
|
20471
20481
|
// render top
|
|
20472
|
-
assistantStyle
|
|
20473
|
-
|
|
20474
|
-
transform: translate(0, -100%);
|
|
20475
|
-
`;
|
|
20482
|
+
assistantStyle.top = "-8px";
|
|
20483
|
+
assistantStyle.transform = "translate(0, -100%)";
|
|
20476
20484
|
}
|
|
20477
20485
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) {
|
|
20478
20486
|
// render left
|
|
20479
|
-
assistantStyle
|
|
20487
|
+
assistantStyle.right = "0px";
|
|
20480
20488
|
}
|
|
20481
|
-
return (assistantStyle
|
|
20489
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20490
|
+
}
|
|
20491
|
+
if (composerRect.left + ASSISTANT_WIDTH > this.spreadsheetRect.width) {
|
|
20492
|
+
assistantStyle.right = "0px";
|
|
20482
20493
|
}
|
|
20483
|
-
return
|
|
20494
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20484
20495
|
}
|
|
20485
20496
|
setup() {
|
|
20486
20497
|
onMounted(() => {
|
|
@@ -27464,12 +27475,13 @@ class BordersPlugin extends CorePlugin {
|
|
|
27464
27475
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
27465
27476
|
break;
|
|
27466
27477
|
case "REMOVE_COLUMNS_ROWS":
|
|
27467
|
-
|
|
27478
|
+
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
27479
|
+
for (const group of groupConsecutive(elements)) {
|
|
27468
27480
|
if (cmd.dimension === "COL") {
|
|
27469
|
-
this.shiftBordersHorizontally(cmd.sheetId,
|
|
27481
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27470
27482
|
}
|
|
27471
27483
|
else {
|
|
27472
|
-
this.shiftBordersVertically(cmd.sheetId,
|
|
27484
|
+
this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27473
27485
|
}
|
|
27474
27486
|
}
|
|
27475
27487
|
break;
|
|
@@ -30966,12 +30978,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30966
30978
|
});
|
|
30967
30979
|
}
|
|
30968
30980
|
if (colIndex > deletedColumn) {
|
|
30969
|
-
this.
|
|
30970
|
-
sheetId: sheet.id,
|
|
30971
|
-
cellId: cellId,
|
|
30972
|
-
col: colIndex - 1,
|
|
30973
|
-
row: rowIndex,
|
|
30974
|
-
});
|
|
30981
|
+
this.setNewPosition(cellId, sheet.id, colIndex - 1, rowIndex);
|
|
30975
30982
|
}
|
|
30976
30983
|
}
|
|
30977
30984
|
}
|
|
@@ -30981,7 +30988,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30981
30988
|
* Move the cells after a column or rows insertion
|
|
30982
30989
|
*/
|
|
30983
30990
|
moveCellsOnAddition(sheet, addedElement, quantity, dimension) {
|
|
30984
|
-
const
|
|
30991
|
+
const updates = [];
|
|
30985
30992
|
for (let rowIndex = 0; rowIndex < sheet.rows.length; rowIndex++) {
|
|
30986
30993
|
const row = sheet.rows[rowIndex];
|
|
30987
30994
|
if (dimension !== "rows" || rowIndex >= addedElement) {
|
|
@@ -30990,20 +30997,20 @@ class SheetPlugin extends CorePlugin {
|
|
|
30990
30997
|
const cellId = row.cells[i];
|
|
30991
30998
|
if (cellId) {
|
|
30992
30999
|
if (dimension === "rows" || colIndex >= addedElement) {
|
|
30993
|
-
|
|
30994
|
-
type: "UPDATE_CELL_POSITION",
|
|
31000
|
+
updates.push({
|
|
30995
31001
|
sheetId: sheet.id,
|
|
30996
31002
|
cellId: cellId,
|
|
30997
31003
|
col: colIndex + (dimension === "columns" ? quantity : 0),
|
|
30998
31004
|
row: rowIndex + (dimension === "rows" ? quantity : 0),
|
|
31005
|
+
type: "UPDATE_CELL_POSITION",
|
|
30999
31006
|
});
|
|
31000
31007
|
}
|
|
31001
31008
|
}
|
|
31002
31009
|
}
|
|
31003
31010
|
}
|
|
31004
31011
|
}
|
|
31005
|
-
for (let
|
|
31006
|
-
this.
|
|
31012
|
+
for (let update of updates.reverse()) {
|
|
31013
|
+
this.updateCellPosition(update);
|
|
31007
31014
|
}
|
|
31008
31015
|
}
|
|
31009
31016
|
/**
|
|
@@ -31036,12 +31043,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31036
31043
|
const colIndex = Number(i);
|
|
31037
31044
|
const cellId = row.cells[i];
|
|
31038
31045
|
if (cellId) {
|
|
31039
|
-
this.
|
|
31040
|
-
sheetId: sheet.id,
|
|
31041
|
-
cellId: cellId,
|
|
31042
|
-
col: colIndex,
|
|
31043
|
-
row: rowIndex - numberRows,
|
|
31044
|
-
});
|
|
31046
|
+
this.setNewPosition(cellId, sheet.id, colIndex, rowIndex - numberRows);
|
|
31045
31047
|
}
|
|
31046
31048
|
}
|
|
31047
31049
|
}
|
|
@@ -40667,7 +40669,7 @@ class RangeAdapter {
|
|
|
40667
40669
|
* @param sheetXC the string description of a range, in the form SheetName!XC:XC
|
|
40668
40670
|
*/
|
|
40669
40671
|
getRangeFromSheetXC(defaultSheetId, sheetXC) {
|
|
40670
|
-
if (!rangeReference.test(sheetXC)) {
|
|
40672
|
+
if (!rangeReference.test(sheetXC) || !this.getters.tryGetSheet(defaultSheetId)) {
|
|
40671
40673
|
return new RangeImpl({
|
|
40672
40674
|
sheetId: "",
|
|
40673
40675
|
zone: { left: -1, top: -1, right: -1, bottom: -1 },
|
|
@@ -43407,6 +43409,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43407
43409
|
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 };
|
|
43408
43410
|
|
|
43409
43411
|
|
|
43410
|
-
__info__.version = '16.0.
|
|
43411
|
-
__info__.date = '2024-
|
|
43412
|
-
__info__.hash = '
|
|
43412
|
+
__info__.version = '16.0.50';
|
|
43413
|
+
__info__.date = '2024-08-09T12:18:35.332Z';
|
|
43414
|
+
__info__.hash = '3972870';
|
|
@@ -3343,7 +3343,7 @@
|
|
|
3343
3343
|
* Static helper which returns a successful DispatchResult
|
|
3344
3344
|
*/
|
|
3345
3345
|
static get Success() {
|
|
3346
|
-
return
|
|
3346
|
+
return SUCCESS;
|
|
3347
3347
|
}
|
|
3348
3348
|
get isSuccessful() {
|
|
3349
3349
|
return this.reasons.length === 0;
|
|
@@ -3356,6 +3356,7 @@
|
|
|
3356
3356
|
return this.reasons.includes(reason);
|
|
3357
3357
|
}
|
|
3358
3358
|
}
|
|
3359
|
+
const SUCCESS = new DispatchResult();
|
|
3359
3360
|
exports.CommandResult = void 0;
|
|
3360
3361
|
(function (CommandResult) {
|
|
3361
3362
|
CommandResult[CommandResult["Success"] = 0] = "Success";
|
|
@@ -4083,8 +4084,8 @@
|
|
|
4083
4084
|
* Return the o-spreadsheet element position relative
|
|
4084
4085
|
* to the browser viewport.
|
|
4085
4086
|
*/
|
|
4086
|
-
function
|
|
4087
|
-
const position = owl.useState({ x: 0, y: 0 });
|
|
4087
|
+
function useSpreadsheetRect() {
|
|
4088
|
+
const position = owl.useState({ x: 0, y: 0, width: 0, height: 0 });
|
|
4088
4089
|
let spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4089
4090
|
updatePosition();
|
|
4090
4091
|
function updatePosition() {
|
|
@@ -4092,9 +4093,11 @@
|
|
|
4092
4093
|
spreadsheetElement = document.querySelector(".o-spreadsheet");
|
|
4093
4094
|
}
|
|
4094
4095
|
if (spreadsheetElement) {
|
|
4095
|
-
const { top, left } = spreadsheetElement.getBoundingClientRect();
|
|
4096
|
+
const { top, left, width, height } = spreadsheetElement.getBoundingClientRect();
|
|
4096
4097
|
position.x = left;
|
|
4097
4098
|
position.y = top;
|
|
4099
|
+
position.width = width;
|
|
4100
|
+
position.height = height;
|
|
4098
4101
|
}
|
|
4099
4102
|
}
|
|
4100
4103
|
owl.onMounted(updatePosition);
|
|
@@ -4129,7 +4132,7 @@
|
|
|
4129
4132
|
class Popover extends owl.Component {
|
|
4130
4133
|
constructor() {
|
|
4131
4134
|
super(...arguments);
|
|
4132
|
-
this.
|
|
4135
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
4133
4136
|
}
|
|
4134
4137
|
get maxHeight() {
|
|
4135
4138
|
return Math.max(0, this.viewportDimension.height - BOTTOMBAR_HEIGHT - SCROLLBAR_WIDTH);
|
|
@@ -4138,8 +4141,8 @@
|
|
|
4138
4141
|
// the props's position is expressed relative to the "body" element
|
|
4139
4142
|
// but we teleport the element in ".o-spreadsheet" to keep everything
|
|
4140
4143
|
// within our control and to avoid leaking into external DOM
|
|
4141
|
-
const horizontalPosition = `left:${this.horizontalPosition() - this.
|
|
4142
|
-
const verticalPosition = `top:${this.verticalPosition() - this.
|
|
4144
|
+
const horizontalPosition = `left:${this.horizontalPosition() - this.spreadsheetRect.x}`;
|
|
4145
|
+
const verticalPosition = `top:${this.verticalPosition() - this.spreadsheetRect.y}`;
|
|
4143
4146
|
const maxHeight = this.maxHeight;
|
|
4144
4147
|
const height = `max-height:${maxHeight}`;
|
|
4145
4148
|
const shadow = maxHeight !== 0 ? "box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);" : "";
|
|
@@ -11420,7 +11423,10 @@
|
|
|
11420
11423
|
return false;
|
|
11421
11424
|
}
|
|
11422
11425
|
if (typeof operand === "number" && operator === "=") {
|
|
11423
|
-
|
|
11426
|
+
if (typeof value === "string" && (isNumber(value) || isDateTime(value))) {
|
|
11427
|
+
return toNumber(value) === operand;
|
|
11428
|
+
}
|
|
11429
|
+
return value === operand;
|
|
11424
11430
|
}
|
|
11425
11431
|
if (operator === "<>" || operator === "=") {
|
|
11426
11432
|
let result;
|
|
@@ -20429,6 +20435,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
20429
20435
|
constructor() {
|
|
20430
20436
|
super(...arguments);
|
|
20431
20437
|
this.composerRef = owl.useRef("o_composer");
|
|
20438
|
+
this.spreadsheetRect = useSpreadsheetRect();
|
|
20432
20439
|
this.contentHelper = new ContentEditableHelper(this.composerRef.el);
|
|
20433
20440
|
this.composerState = owl.useState({
|
|
20434
20441
|
positionStart: 0,
|
|
@@ -20464,24 +20471,28 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
20464
20471
|
};
|
|
20465
20472
|
}
|
|
20466
20473
|
get assistantStyle() {
|
|
20474
|
+
const composerRect = this.composerRef.el.getBoundingClientRect();
|
|
20475
|
+
const assistantStyle = {
|
|
20476
|
+
width: `${ASSISTANT_WIDTH}px`,
|
|
20477
|
+
};
|
|
20467
20478
|
if (this.props.delimitation && this.props.rect) {
|
|
20468
20479
|
const { x: cellX, y: cellY, height: cellHeight } = this.props.rect;
|
|
20469
20480
|
const remainingHeight = this.props.delimitation.height - (cellY + cellHeight);
|
|
20470
|
-
let assistantStyle = "";
|
|
20471
20481
|
if (cellY > remainingHeight) {
|
|
20472
20482
|
// render top
|
|
20473
|
-
assistantStyle
|
|
20474
|
-
|
|
20475
|
-
transform: translate(0, -100%);
|
|
20476
|
-
`;
|
|
20483
|
+
assistantStyle.top = "-8px";
|
|
20484
|
+
assistantStyle.transform = "translate(0, -100%)";
|
|
20477
20485
|
}
|
|
20478
20486
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) {
|
|
20479
20487
|
// render left
|
|
20480
|
-
assistantStyle
|
|
20488
|
+
assistantStyle.right = "0px";
|
|
20481
20489
|
}
|
|
20482
|
-
return (assistantStyle
|
|
20490
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20491
|
+
}
|
|
20492
|
+
if (composerRect.left + ASSISTANT_WIDTH > this.spreadsheetRect.width) {
|
|
20493
|
+
assistantStyle.right = "0px";
|
|
20483
20494
|
}
|
|
20484
|
-
return
|
|
20495
|
+
return cssPropertiesToCss(assistantStyle);
|
|
20485
20496
|
}
|
|
20486
20497
|
setup() {
|
|
20487
20498
|
owl.onMounted(() => {
|
|
@@ -27465,12 +27476,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
27465
27476
|
this.clearBorders(cmd.sheetId, cmd.target);
|
|
27466
27477
|
break;
|
|
27467
27478
|
case "REMOVE_COLUMNS_ROWS":
|
|
27468
|
-
|
|
27479
|
+
const elements = [...cmd.elements].sort((a, b) => b - a);
|
|
27480
|
+
for (const group of groupConsecutive(elements)) {
|
|
27469
27481
|
if (cmd.dimension === "COL") {
|
|
27470
|
-
this.shiftBordersHorizontally(cmd.sheetId,
|
|
27482
|
+
this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27471
27483
|
}
|
|
27472
27484
|
else {
|
|
27473
|
-
this.shiftBordersVertically(cmd.sheetId,
|
|
27485
|
+
this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
|
|
27474
27486
|
}
|
|
27475
27487
|
}
|
|
27476
27488
|
break;
|
|
@@ -30967,12 +30979,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
30967
30979
|
});
|
|
30968
30980
|
}
|
|
30969
30981
|
if (colIndex > deletedColumn) {
|
|
30970
|
-
this.
|
|
30971
|
-
sheetId: sheet.id,
|
|
30972
|
-
cellId: cellId,
|
|
30973
|
-
col: colIndex - 1,
|
|
30974
|
-
row: rowIndex,
|
|
30975
|
-
});
|
|
30982
|
+
this.setNewPosition(cellId, sheet.id, colIndex - 1, rowIndex);
|
|
30976
30983
|
}
|
|
30977
30984
|
}
|
|
30978
30985
|
}
|
|
@@ -30982,7 +30989,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
30982
30989
|
* Move the cells after a column or rows insertion
|
|
30983
30990
|
*/
|
|
30984
30991
|
moveCellsOnAddition(sheet, addedElement, quantity, dimension) {
|
|
30985
|
-
const
|
|
30992
|
+
const updates = [];
|
|
30986
30993
|
for (let rowIndex = 0; rowIndex < sheet.rows.length; rowIndex++) {
|
|
30987
30994
|
const row = sheet.rows[rowIndex];
|
|
30988
30995
|
if (dimension !== "rows" || rowIndex >= addedElement) {
|
|
@@ -30991,20 +30998,20 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
30991
30998
|
const cellId = row.cells[i];
|
|
30992
30999
|
if (cellId) {
|
|
30993
31000
|
if (dimension === "rows" || colIndex >= addedElement) {
|
|
30994
|
-
|
|
30995
|
-
type: "UPDATE_CELL_POSITION",
|
|
31001
|
+
updates.push({
|
|
30996
31002
|
sheetId: sheet.id,
|
|
30997
31003
|
cellId: cellId,
|
|
30998
31004
|
col: colIndex + (dimension === "columns" ? quantity : 0),
|
|
30999
31005
|
row: rowIndex + (dimension === "rows" ? quantity : 0),
|
|
31006
|
+
type: "UPDATE_CELL_POSITION",
|
|
31000
31007
|
});
|
|
31001
31008
|
}
|
|
31002
31009
|
}
|
|
31003
31010
|
}
|
|
31004
31011
|
}
|
|
31005
31012
|
}
|
|
31006
|
-
for (let
|
|
31007
|
-
this.
|
|
31013
|
+
for (let update of updates.reverse()) {
|
|
31014
|
+
this.updateCellPosition(update);
|
|
31008
31015
|
}
|
|
31009
31016
|
}
|
|
31010
31017
|
/**
|
|
@@ -31037,12 +31044,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
31037
31044
|
const colIndex = Number(i);
|
|
31038
31045
|
const cellId = row.cells[i];
|
|
31039
31046
|
if (cellId) {
|
|
31040
|
-
this.
|
|
31041
|
-
sheetId: sheet.id,
|
|
31042
|
-
cellId: cellId,
|
|
31043
|
-
col: colIndex,
|
|
31044
|
-
row: rowIndex - numberRows,
|
|
31045
|
-
});
|
|
31047
|
+
this.setNewPosition(cellId, sheet.id, colIndex, rowIndex - numberRows);
|
|
31046
31048
|
}
|
|
31047
31049
|
}
|
|
31048
31050
|
}
|
|
@@ -40668,7 +40670,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
40668
40670
|
* @param sheetXC the string description of a range, in the form SheetName!XC:XC
|
|
40669
40671
|
*/
|
|
40670
40672
|
getRangeFromSheetXC(defaultSheetId, sheetXC) {
|
|
40671
|
-
if (!rangeReference.test(sheetXC)) {
|
|
40673
|
+
if (!rangeReference.test(sheetXC) || !this.getters.tryGetSheet(defaultSheetId)) {
|
|
40672
40674
|
return new RangeImpl({
|
|
40673
40675
|
sheetId: "",
|
|
40674
40676
|
zone: { left: -1, top: -1, right: -1, bottom: -1 },
|
|
@@ -43438,9 +43440,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
|
|
|
43438
43440
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
43439
43441
|
|
|
43440
43442
|
|
|
43441
|
-
__info__.version = '16.0.
|
|
43442
|
-
__info__.date = '2024-
|
|
43443
|
-
__info__.hash = '
|
|
43443
|
+
__info__.version = '16.0.50';
|
|
43444
|
+
__info__.date = '2024-08-09T12:18:35.332Z';
|
|
43445
|
+
__info__.hash = '3972870';
|
|
43444
43446
|
|
|
43445
43447
|
|
|
43446
43448
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|