@odoo/o-spreadsheet 16.4.9 → 16.4.11
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 +73 -13
- package/dist/o-spreadsheet.d.ts +3 -1
- package/dist/o-spreadsheet.esm.js +73 -13
- package/dist/o-spreadsheet.iife.js +73 -13
- package/dist/o-spreadsheet.iife.min.js +241 -240
- package/package.json +1 -1
|
@@ -13047,6 +13047,35 @@ const HLOOKUP = {
|
|
|
13047
13047
|
isExported: true,
|
|
13048
13048
|
};
|
|
13049
13049
|
// -----------------------------------------------------------------------------
|
|
13050
|
+
// INDEX
|
|
13051
|
+
// -----------------------------------------------------------------------------
|
|
13052
|
+
const INDEX = {
|
|
13053
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
13054
|
+
args: [
|
|
13055
|
+
arg("reference (any, range)", _lt("The range of cells from which the values are returned.")),
|
|
13056
|
+
arg("row (number)", _lt("The index of the row to be returned from within the reference range of cells.")),
|
|
13057
|
+
arg("column (number)", _lt("The index of the column to be returned from within the reference range of cells.")),
|
|
13058
|
+
],
|
|
13059
|
+
returns: ["ANY"],
|
|
13060
|
+
computeFormat: function (reference, row, column) {
|
|
13061
|
+
const _row = toNumber(row.value, this.locale);
|
|
13062
|
+
const _column = toNumber(column.value, this.locale);
|
|
13063
|
+
return reference.format[_column - 1][_row - 1];
|
|
13064
|
+
},
|
|
13065
|
+
compute: function (reference, row, column) {
|
|
13066
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
13067
|
+
const _row = toNumber(row, this.locale);
|
|
13068
|
+
const _column = toNumber(column, this.locale);
|
|
13069
|
+
assert(() => _column >= 0 &&
|
|
13070
|
+
_column - 1 < _reference.length &&
|
|
13071
|
+
_row >= 0 &&
|
|
13072
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
13073
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
13074
|
+
return _reference[_column - 1][_row - 1];
|
|
13075
|
+
},
|
|
13076
|
+
isExported: true,
|
|
13077
|
+
};
|
|
13078
|
+
// -----------------------------------------------------------------------------
|
|
13050
13079
|
// LOOKUP
|
|
13051
13080
|
// -----------------------------------------------------------------------------
|
|
13052
13081
|
const LOOKUP = {
|
|
@@ -13244,6 +13273,7 @@ var lookup = /*#__PURE__*/Object.freeze({
|
|
|
13244
13273
|
COLUMN: COLUMN,
|
|
13245
13274
|
COLUMNS: COLUMNS,
|
|
13246
13275
|
HLOOKUP: HLOOKUP,
|
|
13276
|
+
INDEX: INDEX,
|
|
13247
13277
|
LOOKUP: LOOKUP,
|
|
13248
13278
|
MATCH: MATCH,
|
|
13249
13279
|
ROW: ROW,
|
|
@@ -21815,7 +21845,7 @@ class ChartPanel extends owl.Component {
|
|
|
21815
21845
|
});
|
|
21816
21846
|
}
|
|
21817
21847
|
canUpdateChart(figureId, updateDefinition) {
|
|
21818
|
-
if (figureId !== this.figureId) {
|
|
21848
|
+
if (figureId !== this.figureId || !this.env.model.getters.isChartDefined(figureId)) {
|
|
21819
21849
|
return;
|
|
21820
21850
|
}
|
|
21821
21851
|
const definition = {
|
|
@@ -23490,7 +23520,7 @@ class ClientTag extends owl.Component {
|
|
|
23490
23520
|
left: `${x - 1}px`,
|
|
23491
23521
|
border: `1px solid ${color}`,
|
|
23492
23522
|
"background-color": color,
|
|
23493
|
-
opacity: this.props.active ? "
|
|
23523
|
+
opacity: this.props.active ? "1 !important" : undefined,
|
|
23494
23524
|
});
|
|
23495
23525
|
}
|
|
23496
23526
|
}
|
|
@@ -25683,7 +25713,14 @@ class AbstractResizer extends owl.Component {
|
|
|
25683
25713
|
return;
|
|
25684
25714
|
}
|
|
25685
25715
|
if (this.state.waitingForMove === true) {
|
|
25686
|
-
this.
|
|
25716
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
25717
|
+
this._selectElement(index, false);
|
|
25718
|
+
}
|
|
25719
|
+
else {
|
|
25720
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
25721
|
+
// a way to have the grid selection follow the other selections evolution
|
|
25722
|
+
this.startMovement(ev);
|
|
25723
|
+
}
|
|
25687
25724
|
return;
|
|
25688
25725
|
}
|
|
25689
25726
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -29109,12 +29146,15 @@ function createXMLFile(doc, path, contentType) {
|
|
|
29109
29146
|
};
|
|
29110
29147
|
}
|
|
29111
29148
|
function xmlEscape(str) {
|
|
29112
|
-
return String(str)
|
|
29149
|
+
return (String(str)
|
|
29113
29150
|
.replace(/\&/g, "&")
|
|
29114
29151
|
.replace(/\</g, "<")
|
|
29115
29152
|
.replace(/\>/g, ">")
|
|
29116
29153
|
.replace(/\"/g, """)
|
|
29117
|
-
.replace(/\'/g, "'")
|
|
29154
|
+
.replace(/\'/g, "'")
|
|
29155
|
+
// Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
|
|
29156
|
+
// They are not valid at all in XML 1.0 (even escaped)
|
|
29157
|
+
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
|
|
29118
29158
|
}
|
|
29119
29159
|
function formatAttributes(attrs) {
|
|
29120
29160
|
return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
|
|
@@ -41714,6 +41754,10 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
41714
41754
|
if (!newRangesXC) {
|
|
41715
41755
|
return;
|
|
41716
41756
|
}
|
|
41757
|
+
if (newRangesXC.length === 0) {
|
|
41758
|
+
this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
|
|
41759
|
+
return;
|
|
41760
|
+
}
|
|
41717
41761
|
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
41718
41762
|
cf: {
|
|
41719
41763
|
id: cf.id,
|
|
@@ -43219,6 +43263,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43219
43263
|
"isSingleColSelected",
|
|
43220
43264
|
"getElementsFromSelection",
|
|
43221
43265
|
"tryGetActiveSheetId",
|
|
43266
|
+
"isGridSelectionActive",
|
|
43222
43267
|
];
|
|
43223
43268
|
gridSelection = {
|
|
43224
43269
|
anchor: {
|
|
@@ -43428,6 +43473,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43428
43473
|
// ---------------------------------------------------------------------------
|
|
43429
43474
|
// Getters
|
|
43430
43475
|
// ---------------------------------------------------------------------------
|
|
43476
|
+
isGridSelectionActive() {
|
|
43477
|
+
return this.selection.isListening(this);
|
|
43478
|
+
}
|
|
43431
43479
|
getActiveSheet() {
|
|
43432
43480
|
return this.activeSheet;
|
|
43433
43481
|
}
|
|
@@ -43512,11 +43560,19 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43512
43560
|
}
|
|
43513
43561
|
}
|
|
43514
43562
|
getStatisticFnResults() {
|
|
43515
|
-
|
|
43516
|
-
const cells = new Set(
|
|
43517
|
-
|
|
43518
|
-
|
|
43519
|
-
|
|
43563
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
43564
|
+
const cells = new Set();
|
|
43565
|
+
for (const zone of this.gridSelection.zones) {
|
|
43566
|
+
for (const { col, row } of positions(zone)) {
|
|
43567
|
+
if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
|
|
43568
|
+
continue; // Skip hidden cells
|
|
43569
|
+
}
|
|
43570
|
+
const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
|
|
43571
|
+
if (evaluatedCell.type !== CellValueType.empty) {
|
|
43572
|
+
cells.add(evaluatedCell);
|
|
43573
|
+
}
|
|
43574
|
+
}
|
|
43575
|
+
}
|
|
43520
43576
|
let cellsTypes = new Set();
|
|
43521
43577
|
let cellsValues = [];
|
|
43522
43578
|
for (let cell of cells) {
|
|
@@ -46100,6 +46156,7 @@ const BORDER_POSITIONS = [
|
|
|
46100
46156
|
css /* scss */ `
|
|
46101
46157
|
.o-border-selector {
|
|
46102
46158
|
padding: 4px;
|
|
46159
|
+
background-color: white;
|
|
46103
46160
|
}
|
|
46104
46161
|
.o-divider {
|
|
46105
46162
|
border-right: 1px solid #e0e2e4;
|
|
@@ -48243,6 +48300,9 @@ class SelectionStreamProcessorImpl {
|
|
|
48243
48300
|
},
|
|
48244
48301
|
});
|
|
48245
48302
|
}
|
|
48303
|
+
isListening(owner) {
|
|
48304
|
+
return this.stream.isListening(owner);
|
|
48305
|
+
}
|
|
48246
48306
|
/**
|
|
48247
48307
|
* Process a new anchor selection event. If the new anchor is inside
|
|
48248
48308
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -50711,6 +50771,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
50711
50771
|
exports.tokenize = tokenize;
|
|
50712
50772
|
|
|
50713
50773
|
|
|
50714
|
-
__info__.version = '16.4.
|
|
50715
|
-
__info__.date = '2023-10-
|
|
50716
|
-
__info__.hash = '
|
|
50774
|
+
__info__.version = '16.4.11';
|
|
50775
|
+
__info__.date = '2023-10-25T10:03:47.870Z';
|
|
50776
|
+
__info__.hash = 'ae96a3e';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1057,6 +1057,7 @@ interface SelectionProcessor {
|
|
|
1057
1057
|
selectAll(): DispatchResult;
|
|
1058
1058
|
loopSelection(): DispatchResult;
|
|
1059
1059
|
selectTableAroundSelection(): DispatchResult;
|
|
1060
|
+
isListening(owner: unknown): boolean;
|
|
1060
1061
|
}
|
|
1061
1062
|
type SelectionStreamProcessor = SelectionProcessor & StatefulStream<SelectionEvent, AnchorZone>;
|
|
1062
1063
|
|
|
@@ -4508,7 +4509,7 @@ declare class FilterEvaluationPlugin extends UIPlugin {
|
|
|
4508
4509
|
*/
|
|
4509
4510
|
declare class GridSelectionPlugin extends UIPlugin {
|
|
4510
4511
|
static layers: LAYERS[];
|
|
4511
|
-
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection", "tryGetActiveSheetId"];
|
|
4512
|
+
static getters: readonly ["getActiveSheet", "getActiveSheetId", "getActiveCell", "getActiveCols", "getActiveRows", "getCurrentStyle", "getSelectedZones", "getSelectedZone", "getSelectedCells", "getStatisticFnResults", "getAggregate", "getSelectedFigureId", "getSelection", "getActivePosition", "getSheetPosition", "isSelected", "isSingleColSelected", "getElementsFromSelection", "tryGetActiveSheetId", "isGridSelectionActive"];
|
|
4512
4513
|
private gridSelection;
|
|
4513
4514
|
private selectedFigureId;
|
|
4514
4515
|
private sheetsData;
|
|
@@ -4518,6 +4519,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
4518
4519
|
allowDispatch(cmd: LocalCommand): CommandResult;
|
|
4519
4520
|
private handleEvent;
|
|
4520
4521
|
handle(cmd: Command): void;
|
|
4522
|
+
isGridSelectionActive(): boolean;
|
|
4521
4523
|
getActiveSheet(): Readonly<Sheet>;
|
|
4522
4524
|
getActiveSheetId(): UID;
|
|
4523
4525
|
tryGetActiveSheetId(): UID | undefined;
|
|
@@ -13043,6 +13043,35 @@ const HLOOKUP = {
|
|
|
13043
13043
|
isExported: true,
|
|
13044
13044
|
};
|
|
13045
13045
|
// -----------------------------------------------------------------------------
|
|
13046
|
+
// INDEX
|
|
13047
|
+
// -----------------------------------------------------------------------------
|
|
13048
|
+
const INDEX = {
|
|
13049
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
13050
|
+
args: [
|
|
13051
|
+
arg("reference (any, range)", _lt("The range of cells from which the values are returned.")),
|
|
13052
|
+
arg("row (number)", _lt("The index of the row to be returned from within the reference range of cells.")),
|
|
13053
|
+
arg("column (number)", _lt("The index of the column to be returned from within the reference range of cells.")),
|
|
13054
|
+
],
|
|
13055
|
+
returns: ["ANY"],
|
|
13056
|
+
computeFormat: function (reference, row, column) {
|
|
13057
|
+
const _row = toNumber(row.value, this.locale);
|
|
13058
|
+
const _column = toNumber(column.value, this.locale);
|
|
13059
|
+
return reference.format[_column - 1][_row - 1];
|
|
13060
|
+
},
|
|
13061
|
+
compute: function (reference, row, column) {
|
|
13062
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
13063
|
+
const _row = toNumber(row, this.locale);
|
|
13064
|
+
const _column = toNumber(column, this.locale);
|
|
13065
|
+
assert(() => _column >= 0 &&
|
|
13066
|
+
_column - 1 < _reference.length &&
|
|
13067
|
+
_row >= 0 &&
|
|
13068
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
13069
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
13070
|
+
return _reference[_column - 1][_row - 1];
|
|
13071
|
+
},
|
|
13072
|
+
isExported: true,
|
|
13073
|
+
};
|
|
13074
|
+
// -----------------------------------------------------------------------------
|
|
13046
13075
|
// LOOKUP
|
|
13047
13076
|
// -----------------------------------------------------------------------------
|
|
13048
13077
|
const LOOKUP = {
|
|
@@ -13240,6 +13269,7 @@ var lookup = /*#__PURE__*/Object.freeze({
|
|
|
13240
13269
|
COLUMN: COLUMN,
|
|
13241
13270
|
COLUMNS: COLUMNS,
|
|
13242
13271
|
HLOOKUP: HLOOKUP,
|
|
13272
|
+
INDEX: INDEX,
|
|
13243
13273
|
LOOKUP: LOOKUP,
|
|
13244
13274
|
MATCH: MATCH,
|
|
13245
13275
|
ROW: ROW,
|
|
@@ -21811,7 +21841,7 @@ class ChartPanel extends Component {
|
|
|
21811
21841
|
});
|
|
21812
21842
|
}
|
|
21813
21843
|
canUpdateChart(figureId, updateDefinition) {
|
|
21814
|
-
if (figureId !== this.figureId) {
|
|
21844
|
+
if (figureId !== this.figureId || !this.env.model.getters.isChartDefined(figureId)) {
|
|
21815
21845
|
return;
|
|
21816
21846
|
}
|
|
21817
21847
|
const definition = {
|
|
@@ -23486,7 +23516,7 @@ class ClientTag extends Component {
|
|
|
23486
23516
|
left: `${x - 1}px`,
|
|
23487
23517
|
border: `1px solid ${color}`,
|
|
23488
23518
|
"background-color": color,
|
|
23489
|
-
opacity: this.props.active ? "
|
|
23519
|
+
opacity: this.props.active ? "1 !important" : undefined,
|
|
23490
23520
|
});
|
|
23491
23521
|
}
|
|
23492
23522
|
}
|
|
@@ -25679,7 +25709,14 @@ class AbstractResizer extends Component {
|
|
|
25679
25709
|
return;
|
|
25680
25710
|
}
|
|
25681
25711
|
if (this.state.waitingForMove === true) {
|
|
25682
|
-
this.
|
|
25712
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
25713
|
+
this._selectElement(index, false);
|
|
25714
|
+
}
|
|
25715
|
+
else {
|
|
25716
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
25717
|
+
// a way to have the grid selection follow the other selections evolution
|
|
25718
|
+
this.startMovement(ev);
|
|
25719
|
+
}
|
|
25683
25720
|
return;
|
|
25684
25721
|
}
|
|
25685
25722
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -29105,12 +29142,15 @@ function createXMLFile(doc, path, contentType) {
|
|
|
29105
29142
|
};
|
|
29106
29143
|
}
|
|
29107
29144
|
function xmlEscape(str) {
|
|
29108
|
-
return String(str)
|
|
29145
|
+
return (String(str)
|
|
29109
29146
|
.replace(/\&/g, "&")
|
|
29110
29147
|
.replace(/\</g, "<")
|
|
29111
29148
|
.replace(/\>/g, ">")
|
|
29112
29149
|
.replace(/\"/g, """)
|
|
29113
|
-
.replace(/\'/g, "'")
|
|
29150
|
+
.replace(/\'/g, "'")
|
|
29151
|
+
// Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
|
|
29152
|
+
// They are not valid at all in XML 1.0 (even escaped)
|
|
29153
|
+
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
|
|
29114
29154
|
}
|
|
29115
29155
|
function formatAttributes(attrs) {
|
|
29116
29156
|
return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
|
|
@@ -41710,6 +41750,10 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
41710
41750
|
if (!newRangesXC) {
|
|
41711
41751
|
return;
|
|
41712
41752
|
}
|
|
41753
|
+
if (newRangesXC.length === 0) {
|
|
41754
|
+
this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
|
|
41755
|
+
return;
|
|
41756
|
+
}
|
|
41713
41757
|
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
41714
41758
|
cf: {
|
|
41715
41759
|
id: cf.id,
|
|
@@ -43215,6 +43259,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43215
43259
|
"isSingleColSelected",
|
|
43216
43260
|
"getElementsFromSelection",
|
|
43217
43261
|
"tryGetActiveSheetId",
|
|
43262
|
+
"isGridSelectionActive",
|
|
43218
43263
|
];
|
|
43219
43264
|
gridSelection = {
|
|
43220
43265
|
anchor: {
|
|
@@ -43424,6 +43469,9 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43424
43469
|
// ---------------------------------------------------------------------------
|
|
43425
43470
|
// Getters
|
|
43426
43471
|
// ---------------------------------------------------------------------------
|
|
43472
|
+
isGridSelectionActive() {
|
|
43473
|
+
return this.selection.isListening(this);
|
|
43474
|
+
}
|
|
43427
43475
|
getActiveSheet() {
|
|
43428
43476
|
return this.activeSheet;
|
|
43429
43477
|
}
|
|
@@ -43508,11 +43556,19 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
43508
43556
|
}
|
|
43509
43557
|
}
|
|
43510
43558
|
getStatisticFnResults() {
|
|
43511
|
-
|
|
43512
|
-
const cells = new Set(
|
|
43513
|
-
|
|
43514
|
-
|
|
43515
|
-
|
|
43559
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
43560
|
+
const cells = new Set();
|
|
43561
|
+
for (const zone of this.gridSelection.zones) {
|
|
43562
|
+
for (const { col, row } of positions(zone)) {
|
|
43563
|
+
if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
|
|
43564
|
+
continue; // Skip hidden cells
|
|
43565
|
+
}
|
|
43566
|
+
const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
|
|
43567
|
+
if (evaluatedCell.type !== CellValueType.empty) {
|
|
43568
|
+
cells.add(evaluatedCell);
|
|
43569
|
+
}
|
|
43570
|
+
}
|
|
43571
|
+
}
|
|
43516
43572
|
let cellsTypes = new Set();
|
|
43517
43573
|
let cellsValues = [];
|
|
43518
43574
|
for (let cell of cells) {
|
|
@@ -46096,6 +46152,7 @@ const BORDER_POSITIONS = [
|
|
|
46096
46152
|
css /* scss */ `
|
|
46097
46153
|
.o-border-selector {
|
|
46098
46154
|
padding: 4px;
|
|
46155
|
+
background-color: white;
|
|
46099
46156
|
}
|
|
46100
46157
|
.o-divider {
|
|
46101
46158
|
border-right: 1px solid #e0e2e4;
|
|
@@ -48239,6 +48296,9 @@ class SelectionStreamProcessorImpl {
|
|
|
48239
48296
|
},
|
|
48240
48297
|
});
|
|
48241
48298
|
}
|
|
48299
|
+
isListening(owner) {
|
|
48300
|
+
return this.stream.isListening(owner);
|
|
48301
|
+
}
|
|
48242
48302
|
/**
|
|
48243
48303
|
* Process a new anchor selection event. If the new anchor is inside
|
|
48244
48304
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -50675,6 +50735,6 @@ const constants = {
|
|
|
50675
50735
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
50676
50736
|
|
|
50677
50737
|
|
|
50678
|
-
__info__.version = '16.4.
|
|
50679
|
-
__info__.date = '2023-10-
|
|
50680
|
-
__info__.hash = '
|
|
50738
|
+
__info__.version = '16.4.11';
|
|
50739
|
+
__info__.date = '2023-10-25T10:03:47.870Z';
|
|
50740
|
+
__info__.hash = 'ae96a3e';
|
|
@@ -13044,6 +13044,35 @@
|
|
|
13044
13044
|
isExported: true,
|
|
13045
13045
|
};
|
|
13046
13046
|
// -----------------------------------------------------------------------------
|
|
13047
|
+
// INDEX
|
|
13048
|
+
// -----------------------------------------------------------------------------
|
|
13049
|
+
const INDEX = {
|
|
13050
|
+
description: _lt(`Returns the content of a cell, specified by row and column offset.`),
|
|
13051
|
+
args: [
|
|
13052
|
+
arg("reference (any, range)", _lt("The range of cells from which the values are returned.")),
|
|
13053
|
+
arg("row (number)", _lt("The index of the row to be returned from within the reference range of cells.")),
|
|
13054
|
+
arg("column (number)", _lt("The index of the column to be returned from within the reference range of cells.")),
|
|
13055
|
+
],
|
|
13056
|
+
returns: ["ANY"],
|
|
13057
|
+
computeFormat: function (reference, row, column) {
|
|
13058
|
+
const _row = toNumber(row.value, this.locale);
|
|
13059
|
+
const _column = toNumber(column.value, this.locale);
|
|
13060
|
+
return reference.format[_column - 1][_row - 1];
|
|
13061
|
+
},
|
|
13062
|
+
compute: function (reference, row, column) {
|
|
13063
|
+
const _reference = isMatrix(reference) ? reference : [[reference]];
|
|
13064
|
+
const _row = toNumber(row, this.locale);
|
|
13065
|
+
const _column = toNumber(column, this.locale);
|
|
13066
|
+
assert(() => _column >= 0 &&
|
|
13067
|
+
_column - 1 < _reference.length &&
|
|
13068
|
+
_row >= 0 &&
|
|
13069
|
+
_row - 1 < _reference[0].length, _lt("Index out of range."));
|
|
13070
|
+
assert(() => row !== 0 && column !== 0, _lt("This function can only return a single cell value, not an array. Provide valid row and column indices."));
|
|
13071
|
+
return _reference[_column - 1][_row - 1];
|
|
13072
|
+
},
|
|
13073
|
+
isExported: true,
|
|
13074
|
+
};
|
|
13075
|
+
// -----------------------------------------------------------------------------
|
|
13047
13076
|
// LOOKUP
|
|
13048
13077
|
// -----------------------------------------------------------------------------
|
|
13049
13078
|
const LOOKUP = {
|
|
@@ -13241,6 +13270,7 @@
|
|
|
13241
13270
|
COLUMN: COLUMN,
|
|
13242
13271
|
COLUMNS: COLUMNS,
|
|
13243
13272
|
HLOOKUP: HLOOKUP,
|
|
13273
|
+
INDEX: INDEX,
|
|
13244
13274
|
LOOKUP: LOOKUP,
|
|
13245
13275
|
MATCH: MATCH,
|
|
13246
13276
|
ROW: ROW,
|
|
@@ -21812,7 +21842,7 @@
|
|
|
21812
21842
|
});
|
|
21813
21843
|
}
|
|
21814
21844
|
canUpdateChart(figureId, updateDefinition) {
|
|
21815
|
-
if (figureId !== this.figureId) {
|
|
21845
|
+
if (figureId !== this.figureId || !this.env.model.getters.isChartDefined(figureId)) {
|
|
21816
21846
|
return;
|
|
21817
21847
|
}
|
|
21818
21848
|
const definition = {
|
|
@@ -23487,7 +23517,7 @@
|
|
|
23487
23517
|
left: `${x - 1}px`,
|
|
23488
23518
|
border: `1px solid ${color}`,
|
|
23489
23519
|
"background-color": color,
|
|
23490
|
-
opacity: this.props.active ? "
|
|
23520
|
+
opacity: this.props.active ? "1 !important" : undefined,
|
|
23491
23521
|
});
|
|
23492
23522
|
}
|
|
23493
23523
|
}
|
|
@@ -25680,7 +25710,14 @@
|
|
|
25680
25710
|
return;
|
|
25681
25711
|
}
|
|
25682
25712
|
if (this.state.waitingForMove === true) {
|
|
25683
|
-
this.
|
|
25713
|
+
if (!this.env.model.getters.isGridSelectionActive()) {
|
|
25714
|
+
this._selectElement(index, false);
|
|
25715
|
+
}
|
|
25716
|
+
else {
|
|
25717
|
+
// FIXME: Consider reintroducing this feature for all type of selection if we find
|
|
25718
|
+
// a way to have the grid selection follow the other selections evolution
|
|
25719
|
+
this.startMovement(ev);
|
|
25720
|
+
}
|
|
25684
25721
|
return;
|
|
25685
25722
|
}
|
|
25686
25723
|
if (this.env.model.getters.getEditionMode() === "editing") {
|
|
@@ -29106,12 +29143,15 @@
|
|
|
29106
29143
|
};
|
|
29107
29144
|
}
|
|
29108
29145
|
function xmlEscape(str) {
|
|
29109
|
-
return String(str)
|
|
29146
|
+
return (String(str)
|
|
29110
29147
|
.replace(/\&/g, "&")
|
|
29111
29148
|
.replace(/\</g, "<")
|
|
29112
29149
|
.replace(/\>/g, ">")
|
|
29113
29150
|
.replace(/\"/g, """)
|
|
29114
|
-
.replace(/\'/g, "'")
|
|
29151
|
+
.replace(/\'/g, "'")
|
|
29152
|
+
// Delete all ASCII control characters except for TAB (\x09), LF (\x0A) and CR (\x0D)
|
|
29153
|
+
// They are not valid at all in XML 1.0 (even escaped)
|
|
29154
|
+
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, ""));
|
|
29115
29155
|
}
|
|
29116
29156
|
function formatAttributes(attrs) {
|
|
29117
29157
|
return new XMLString(attrs.map(([key, val]) => `${key}="${xmlEscape(val)}"`).join(" "));
|
|
@@ -41711,6 +41751,10 @@
|
|
|
41711
41751
|
if (!newRangesXC) {
|
|
41712
41752
|
return;
|
|
41713
41753
|
}
|
|
41754
|
+
if (newRangesXC.length === 0) {
|
|
41755
|
+
this.dispatch("REMOVE_CONDITIONAL_FORMAT", { id: cf.id, sheetId });
|
|
41756
|
+
return;
|
|
41757
|
+
}
|
|
41714
41758
|
this.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
41715
41759
|
cf: {
|
|
41716
41760
|
id: cf.id,
|
|
@@ -43216,6 +43260,7 @@
|
|
|
43216
43260
|
"isSingleColSelected",
|
|
43217
43261
|
"getElementsFromSelection",
|
|
43218
43262
|
"tryGetActiveSheetId",
|
|
43263
|
+
"isGridSelectionActive",
|
|
43219
43264
|
];
|
|
43220
43265
|
gridSelection = {
|
|
43221
43266
|
anchor: {
|
|
@@ -43425,6 +43470,9 @@
|
|
|
43425
43470
|
// ---------------------------------------------------------------------------
|
|
43426
43471
|
// Getters
|
|
43427
43472
|
// ---------------------------------------------------------------------------
|
|
43473
|
+
isGridSelectionActive() {
|
|
43474
|
+
return this.selection.isListening(this);
|
|
43475
|
+
}
|
|
43428
43476
|
getActiveSheet() {
|
|
43429
43477
|
return this.activeSheet;
|
|
43430
43478
|
}
|
|
@@ -43509,11 +43557,19 @@
|
|
|
43509
43557
|
}
|
|
43510
43558
|
}
|
|
43511
43559
|
getStatisticFnResults() {
|
|
43512
|
-
|
|
43513
|
-
const cells = new Set(
|
|
43514
|
-
|
|
43515
|
-
|
|
43516
|
-
|
|
43560
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
43561
|
+
const cells = new Set();
|
|
43562
|
+
for (const zone of this.gridSelection.zones) {
|
|
43563
|
+
for (const { col, row } of positions(zone)) {
|
|
43564
|
+
if (this.getters.isRowHidden(sheetId, row) || this.getters.isColHidden(sheetId, col)) {
|
|
43565
|
+
continue; // Skip hidden cells
|
|
43566
|
+
}
|
|
43567
|
+
const evaluatedCell = this.getters.getEvaluatedCell({ sheetId, col, row });
|
|
43568
|
+
if (evaluatedCell.type !== CellValueType.empty) {
|
|
43569
|
+
cells.add(evaluatedCell);
|
|
43570
|
+
}
|
|
43571
|
+
}
|
|
43572
|
+
}
|
|
43517
43573
|
let cellsTypes = new Set();
|
|
43518
43574
|
let cellsValues = [];
|
|
43519
43575
|
for (let cell of cells) {
|
|
@@ -46097,6 +46153,7 @@
|
|
|
46097
46153
|
css /* scss */ `
|
|
46098
46154
|
.o-border-selector {
|
|
46099
46155
|
padding: 4px;
|
|
46156
|
+
background-color: white;
|
|
46100
46157
|
}
|
|
46101
46158
|
.o-divider {
|
|
46102
46159
|
border-right: 1px solid #e0e2e4;
|
|
@@ -48240,6 +48297,9 @@
|
|
|
48240
48297
|
},
|
|
48241
48298
|
});
|
|
48242
48299
|
}
|
|
48300
|
+
isListening(owner) {
|
|
48301
|
+
return this.stream.isListening(owner);
|
|
48302
|
+
}
|
|
48243
48303
|
/**
|
|
48244
48304
|
* Process a new anchor selection event. If the new anchor is inside
|
|
48245
48305
|
* the sheet boundaries, the event is pushed to the event stream to
|
|
@@ -50710,9 +50770,9 @@
|
|
|
50710
50770
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
50711
50771
|
|
|
50712
50772
|
|
|
50713
|
-
__info__.version = '16.4.
|
|
50714
|
-
__info__.date = '2023-10-
|
|
50715
|
-
__info__.hash = '
|
|
50773
|
+
__info__.version = '16.4.11';
|
|
50774
|
+
__info__.date = '2023-10-25T10:03:47.870Z';
|
|
50775
|
+
__info__.hash = 'ae96a3e';
|
|
50716
50776
|
|
|
50717
50777
|
|
|
50718
50778
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|