@odoo/o-spreadsheet 16.2.9 → 16.2.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 +76 -56
- package/dist/o-spreadsheet.d.ts +167 -166
- package/dist/o-spreadsheet.esm.js +76 -56
- package/dist/o-spreadsheet.iife.js +76 -56
- package/dist/o-spreadsheet.iife.min.js +305 -299
- package/package.json +4 -4
|
@@ -105,7 +105,7 @@ const SELECTION_BORDER_COLOR = "#3266ca";
|
|
|
105
105
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
106
106
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
107
107
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
108
|
-
const
|
|
108
|
+
const DISABLED_TEXT_COLOR = "#CACACA";
|
|
109
109
|
const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
|
|
110
110
|
const LINK_COLOR = "#01666b";
|
|
111
111
|
const FILTERS_COLOR = "#188038";
|
|
@@ -707,12 +707,20 @@ function getDefaultCellHeight(cell) {
|
|
|
707
707
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
708
708
|
}
|
|
709
709
|
function computeTextWidth(context, text, style) {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
710
|
+
const font = computeTextFont(style);
|
|
711
|
+
if (!textWidthCache[font]) {
|
|
712
|
+
textWidthCache[font] = {};
|
|
713
|
+
}
|
|
714
|
+
if (textWidthCache[font][text] === undefined) {
|
|
715
|
+
context.save();
|
|
716
|
+
context.font = font;
|
|
717
|
+
const textWidth = context.measureText(text).width;
|
|
718
|
+
context.restore();
|
|
719
|
+
textWidthCache[font][text] = textWidth;
|
|
720
|
+
}
|
|
721
|
+
return textWidthCache[font][text];
|
|
715
722
|
}
|
|
723
|
+
const textWidthCache = {};
|
|
716
724
|
function fontSizeInPixels(fontSize) {
|
|
717
725
|
return Math.round((fontSize * 96) / 72);
|
|
718
726
|
}
|
|
@@ -4092,7 +4100,6 @@ const readonlyAllowedCommands = new Set([
|
|
|
4092
4100
|
"SET_VIEWPORT_OFFSET",
|
|
4093
4101
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
4094
4102
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
4095
|
-
"REFRESH_SEARCH",
|
|
4096
4103
|
"UPDATE_SEARCH",
|
|
4097
4104
|
"CLEAR_SEARCH",
|
|
4098
4105
|
"EVALUATE_CELLS",
|
|
@@ -5411,7 +5418,7 @@ css /* scss */ `
|
|
|
5411
5418
|
}
|
|
5412
5419
|
}
|
|
5413
5420
|
&.disabled {
|
|
5414
|
-
color: ${
|
|
5421
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
5415
5422
|
cursor: not-allowed;
|
|
5416
5423
|
}
|
|
5417
5424
|
}
|
|
@@ -18673,11 +18680,16 @@ class FindAndReplacePanel extends Component {
|
|
|
18673
18680
|
}
|
|
18674
18681
|
setup() {
|
|
18675
18682
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
18683
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
18676
18684
|
onMounted(() => this.focusInput());
|
|
18677
18685
|
onWillUnmount(() => {
|
|
18678
18686
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
18679
18687
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
18680
18688
|
});
|
|
18689
|
+
useEffect(() => {
|
|
18690
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
18691
|
+
this.searchFormulas();
|
|
18692
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
18681
18693
|
}
|
|
18682
18694
|
onInput(ev) {
|
|
18683
18695
|
this.state.toSearch = ev.target.value;
|
|
@@ -18697,10 +18709,6 @@ class FindAndReplacePanel extends Component {
|
|
|
18697
18709
|
this.replace();
|
|
18698
18710
|
}
|
|
18699
18711
|
}
|
|
18700
|
-
onFocusSidePanel() {
|
|
18701
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
18702
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
18703
|
-
}
|
|
18704
18712
|
searchFormulas() {
|
|
18705
18713
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
18706
18714
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -18719,13 +18727,6 @@ class FindAndReplacePanel extends Component {
|
|
|
18719
18727
|
searchOptions: this.state.searchOptions,
|
|
18720
18728
|
});
|
|
18721
18729
|
}
|
|
18722
|
-
debouncedUpdateSearch() {
|
|
18723
|
-
clearTimeout(this.debounceTimeoutId);
|
|
18724
|
-
this.debounceTimeoutId = setTimeout(() => {
|
|
18725
|
-
this.updateSearch();
|
|
18726
|
-
this.debounceTimeoutId = undefined;
|
|
18727
|
-
}, 400);
|
|
18728
|
-
}
|
|
18729
18730
|
replace() {
|
|
18730
18731
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
18731
18732
|
replaceWith: this.state.replaceWith,
|
|
@@ -29127,7 +29128,14 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29127
29128
|
this.history.update("tables", filterTables);
|
|
29128
29129
|
break;
|
|
29129
29130
|
case "DUPLICATE_SHEET":
|
|
29130
|
-
|
|
29131
|
+
const tables = {};
|
|
29132
|
+
for (const filterTable of Object.values(this.tables[cmd.sheetId] || {})) {
|
|
29133
|
+
if (filterTable) {
|
|
29134
|
+
const newFilterTable = deepCopy(filterTable);
|
|
29135
|
+
tables[newFilterTable.id] = newFilterTable;
|
|
29136
|
+
}
|
|
29137
|
+
}
|
|
29138
|
+
this.history.update("tables", cmd.sheetIdTo, tables);
|
|
29131
29139
|
break;
|
|
29132
29140
|
case "ADD_COLUMNS_ROWS":
|
|
29133
29141
|
this.onAddColumnsRows(cmd);
|
|
@@ -32704,6 +32712,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
32704
32712
|
}
|
|
32705
32713
|
exportForExcel(data) {
|
|
32706
32714
|
for (const sheetData of data.sheets) {
|
|
32715
|
+
const sheetId = sheetData.id;
|
|
32707
32716
|
for (const tableData of sheetData.filterTables) {
|
|
32708
32717
|
const tableZone = toZone(tableData.range);
|
|
32709
32718
|
const filters = [];
|
|
@@ -32719,20 +32728,20 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
32719
32728
|
if (!filter)
|
|
32720
32729
|
continue;
|
|
32721
32730
|
const valuesInFilterZone = filter.filteredZone
|
|
32722
|
-
? positions(filter.filteredZone)
|
|
32723
|
-
.map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId: sheetData.id, col, row }))
|
|
32724
|
-
.filter((cell) => cell.type !== CellValueType.empty)
|
|
32725
|
-
.map((cell) => cell.formattedValue)
|
|
32731
|
+
? positions(filter.filteredZone).map((position) => this.getters.getEvaluatedCell({ sheetId, ...position }).formattedValue)
|
|
32726
32732
|
: [];
|
|
32727
|
-
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32734
|
-
|
|
32735
|
-
|
|
32733
|
+
if (filteredValues.length) {
|
|
32734
|
+
const xlsxDisplayedValues = valuesInFilterZone
|
|
32735
|
+
.filter((val) => val)
|
|
32736
|
+
.filter((val) => !filteredValues.includes(val));
|
|
32737
|
+
filters.push({
|
|
32738
|
+
colId: i,
|
|
32739
|
+
displayedValues: [...new Set(xlsxDisplayedValues)],
|
|
32740
|
+
displayBlanks: !filteredValues.includes("") && valuesInFilterZone.some((val) => !val),
|
|
32741
|
+
});
|
|
32742
|
+
}
|
|
32743
|
+
// In xlsx, filter header should ALWAYS be a string and should be unique in the table
|
|
32744
|
+
const headerPosition = { col: filter.col, row: filter.zoneWithHeaders.top, sheetId };
|
|
32736
32745
|
const headerString = this.getters.getEvaluatedCell(headerPosition).formattedValue;
|
|
32737
32746
|
const headerName = this.getUniqueColNameForExcel(i, headerString, headerNames);
|
|
32738
32747
|
headerNames.push(headerName);
|
|
@@ -34469,6 +34478,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
34469
34478
|
searchFormulas: false,
|
|
34470
34479
|
};
|
|
34471
34480
|
this.toSearch = "";
|
|
34481
|
+
this.isSearchDirty = false;
|
|
34472
34482
|
}
|
|
34473
34483
|
// ---------------------------------------------------------------------------
|
|
34474
34484
|
// Command Handling
|
|
@@ -34497,14 +34507,21 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
34497
34507
|
case "REDO":
|
|
34498
34508
|
case "REMOVE_COLUMNS_ROWS":
|
|
34499
34509
|
case "ADD_COLUMNS_ROWS":
|
|
34500
|
-
|
|
34510
|
+
case "EVALUATE_CELLS":
|
|
34511
|
+
case "UPDATE_CELL":
|
|
34512
|
+
this.isSearchDirty = true;
|
|
34501
34513
|
break;
|
|
34502
34514
|
case "ACTIVATE_SHEET":
|
|
34503
|
-
case "REFRESH_SEARCH":
|
|
34504
34515
|
this.refreshSearch();
|
|
34505
34516
|
break;
|
|
34506
34517
|
}
|
|
34507
34518
|
}
|
|
34519
|
+
finalize() {
|
|
34520
|
+
if (this.isSearchDirty) {
|
|
34521
|
+
this.refreshSearch();
|
|
34522
|
+
this.isSearchDirty = false;
|
|
34523
|
+
}
|
|
34524
|
+
}
|
|
34508
34525
|
// ---------------------------------------------------------------------------
|
|
34509
34526
|
// Getters
|
|
34510
34527
|
// ---------------------------------------------------------------------------
|
|
@@ -34560,6 +34577,11 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
34560
34577
|
if (this.toSearch) {
|
|
34561
34578
|
for (const cell of Object.values(cells)) {
|
|
34562
34579
|
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
34580
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
34581
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
34582
|
+
if (isColHidden || isRowHidden) {
|
|
34583
|
+
continue;
|
|
34584
|
+
}
|
|
34563
34585
|
if (cell &&
|
|
34564
34586
|
this.currentSearchRegex &&
|
|
34565
34587
|
this.currentSearchRegex.test(this.getSearchableString({ sheetId, col, row }))) {
|
|
@@ -35761,15 +35783,15 @@ SelectionInputPlugin.getters = [];
|
|
|
35761
35783
|
* This plugin handles this internal state.
|
|
35762
35784
|
*/
|
|
35763
35785
|
class SelectionInputsManagerPlugin extends UIPlugin {
|
|
35786
|
+
get currentInput() {
|
|
35787
|
+
return this.focusedInputId ? this.inputs[this.focusedInputId] : null;
|
|
35788
|
+
}
|
|
35764
35789
|
constructor(config) {
|
|
35765
35790
|
super(config);
|
|
35766
35791
|
this.config = config;
|
|
35767
35792
|
this.inputs = {};
|
|
35768
35793
|
this.focusedInputId = null;
|
|
35769
35794
|
}
|
|
35770
|
-
get currentInput() {
|
|
35771
|
-
return this.focusedInputId ? this.inputs[this.focusedInputId] : null;
|
|
35772
|
-
}
|
|
35773
35795
|
// ---------------------------------------------------------------------------
|
|
35774
35796
|
// Command Handling
|
|
35775
35797
|
// ---------------------------------------------------------------------------
|
|
@@ -36998,10 +37020,8 @@ class SortPlugin extends UIPlugin {
|
|
|
36998
37020
|
}
|
|
36999
37021
|
updateCellCommands.push(newCellValues);
|
|
37000
37022
|
}
|
|
37001
|
-
for (const cmd of updateCellCommands) {
|
|
37002
|
-
this.dispatch("UPDATE_CELL", cmd);
|
|
37003
|
-
}
|
|
37004
37023
|
}
|
|
37024
|
+
updateCellCommands.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
37005
37025
|
}
|
|
37006
37026
|
/**
|
|
37007
37027
|
* Return the distances between main merge cells in the zone.
|
|
@@ -40700,6 +40720,11 @@ css /* scss */ `
|
|
|
40700
40720
|
.o-sidePanelButton:enabled {
|
|
40701
40721
|
cursor: pointer;
|
|
40702
40722
|
}
|
|
40723
|
+
|
|
40724
|
+
.o-sidePanelButton:disabled {
|
|
40725
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
40726
|
+
}
|
|
40727
|
+
|
|
40703
40728
|
.o-sidePanelButton:last-child {
|
|
40704
40729
|
margin-right: 0px;
|
|
40705
40730
|
}
|
|
@@ -40845,11 +40870,9 @@ TopBarComposer.props = {
|
|
|
40845
40870
|
onComposerContentFocused: Function,
|
|
40846
40871
|
};
|
|
40847
40872
|
|
|
40848
|
-
// -----------------------------------------------------------------------------
|
|
40849
|
-
// TopBar
|
|
40850
|
-
// -----------------------------------------------------------------------------
|
|
40851
40873
|
css /* scss */ `
|
|
40852
40874
|
.o-font-size-editor {
|
|
40875
|
+
height: calc(100% - 4px);
|
|
40853
40876
|
input.o-font-size {
|
|
40854
40877
|
height: 20px;
|
|
40855
40878
|
width: 23px;
|
|
@@ -40927,6 +40950,7 @@ FontSizeEditor.components = {};
|
|
|
40927
40950
|
FontSizeEditor.props = {
|
|
40928
40951
|
onToggle: Function,
|
|
40929
40952
|
dropdownStyle: String,
|
|
40953
|
+
class: String,
|
|
40930
40954
|
};
|
|
40931
40955
|
|
|
40932
40956
|
const FORMATS = [
|
|
@@ -44370,15 +44394,10 @@ function addAutoFilter(table) {
|
|
|
44370
44394
|
`;
|
|
44371
44395
|
}
|
|
44372
44396
|
function addFilterColumns(table) {
|
|
44373
|
-
const tableZone = toZone(table.range);
|
|
44374
44397
|
const columns = [];
|
|
44375
|
-
for (const
|
|
44376
|
-
const filter = table.filters[i];
|
|
44377
|
-
if (!filter || !filter.filteredValues.length) {
|
|
44378
|
-
continue;
|
|
44379
|
-
}
|
|
44398
|
+
for (const filter of table.filters) {
|
|
44380
44399
|
const colXml = escapeXml /*xml*/ `
|
|
44381
|
-
<filterColumn ${formatAttributes([["colId",
|
|
44400
|
+
<filterColumn ${formatAttributes([["colId", filter.colId]])}>
|
|
44382
44401
|
${addFilter(filter)}
|
|
44383
44402
|
</filterColumn>
|
|
44384
44403
|
`;
|
|
@@ -44387,9 +44406,10 @@ function addFilterColumns(table) {
|
|
|
44387
44406
|
return columns;
|
|
44388
44407
|
}
|
|
44389
44408
|
function addFilter(filter) {
|
|
44390
|
-
const filterValues = filter.
|
|
44409
|
+
const filterValues = filter.displayedValues.map((val) => escapeXml /*xml*/ `<filter ${formatAttributes([["val", val]])}/>`);
|
|
44410
|
+
const filterAttributes = filter.displayBlanks ? [["blank", 1]] : [];
|
|
44391
44411
|
return escapeXml /*xml*/ `
|
|
44392
|
-
<filters>
|
|
44412
|
+
<filters ${formatAttributes(filterAttributes)}>
|
|
44393
44413
|
${joinXmlNodes(filterValues)}
|
|
44394
44414
|
</filters>
|
|
44395
44415
|
`;
|
|
@@ -45336,6 +45356,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
45336
45356
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, 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, setTranslationMethod, tokenize };
|
|
45337
45357
|
|
|
45338
45358
|
|
|
45339
|
-
__info__.version = '16.2.
|
|
45340
|
-
__info__.date = '2023-
|
|
45341
|
-
__info__.hash = '
|
|
45359
|
+
__info__.version = '16.2.11';
|
|
45360
|
+
__info__.date = '2023-07-26T12:09:59.264Z';
|
|
45361
|
+
__info__.hash = '0d46dde';
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
107
107
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
108
108
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
109
|
-
const
|
|
109
|
+
const DISABLED_TEXT_COLOR = "#CACACA";
|
|
110
110
|
const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
|
|
111
111
|
const LINK_COLOR = "#01666b";
|
|
112
112
|
const FILTERS_COLOR = "#188038";
|
|
@@ -708,12 +708,20 @@
|
|
|
708
708
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
709
709
|
}
|
|
710
710
|
function computeTextWidth(context, text, style) {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
711
|
+
const font = computeTextFont(style);
|
|
712
|
+
if (!textWidthCache[font]) {
|
|
713
|
+
textWidthCache[font] = {};
|
|
714
|
+
}
|
|
715
|
+
if (textWidthCache[font][text] === undefined) {
|
|
716
|
+
context.save();
|
|
717
|
+
context.font = font;
|
|
718
|
+
const textWidth = context.measureText(text).width;
|
|
719
|
+
context.restore();
|
|
720
|
+
textWidthCache[font][text] = textWidth;
|
|
721
|
+
}
|
|
722
|
+
return textWidthCache[font][text];
|
|
716
723
|
}
|
|
724
|
+
const textWidthCache = {};
|
|
717
725
|
function fontSizeInPixels(fontSize) {
|
|
718
726
|
return Math.round((fontSize * 96) / 72);
|
|
719
727
|
}
|
|
@@ -4093,7 +4101,6 @@
|
|
|
4093
4101
|
"SET_VIEWPORT_OFFSET",
|
|
4094
4102
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
4095
4103
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
4096
|
-
"REFRESH_SEARCH",
|
|
4097
4104
|
"UPDATE_SEARCH",
|
|
4098
4105
|
"CLEAR_SEARCH",
|
|
4099
4106
|
"EVALUATE_CELLS",
|
|
@@ -5412,7 +5419,7 @@
|
|
|
5412
5419
|
}
|
|
5413
5420
|
}
|
|
5414
5421
|
&.disabled {
|
|
5415
|
-
color: ${
|
|
5422
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
5416
5423
|
cursor: not-allowed;
|
|
5417
5424
|
}
|
|
5418
5425
|
}
|
|
@@ -18674,11 +18681,16 @@
|
|
|
18674
18681
|
}
|
|
18675
18682
|
setup() {
|
|
18676
18683
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
18684
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
18677
18685
|
owl.onMounted(() => this.focusInput());
|
|
18678
18686
|
owl.onWillUnmount(() => {
|
|
18679
18687
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
18680
18688
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
18681
18689
|
});
|
|
18690
|
+
owl.useEffect(() => {
|
|
18691
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
18692
|
+
this.searchFormulas();
|
|
18693
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
18682
18694
|
}
|
|
18683
18695
|
onInput(ev) {
|
|
18684
18696
|
this.state.toSearch = ev.target.value;
|
|
@@ -18698,10 +18710,6 @@
|
|
|
18698
18710
|
this.replace();
|
|
18699
18711
|
}
|
|
18700
18712
|
}
|
|
18701
|
-
onFocusSidePanel() {
|
|
18702
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
18703
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
18704
|
-
}
|
|
18705
18713
|
searchFormulas() {
|
|
18706
18714
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
18707
18715
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -18720,13 +18728,6 @@
|
|
|
18720
18728
|
searchOptions: this.state.searchOptions,
|
|
18721
18729
|
});
|
|
18722
18730
|
}
|
|
18723
|
-
debouncedUpdateSearch() {
|
|
18724
|
-
clearTimeout(this.debounceTimeoutId);
|
|
18725
|
-
this.debounceTimeoutId = setTimeout(() => {
|
|
18726
|
-
this.updateSearch();
|
|
18727
|
-
this.debounceTimeoutId = undefined;
|
|
18728
|
-
}, 400);
|
|
18729
|
-
}
|
|
18730
18731
|
replace() {
|
|
18731
18732
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
18732
18733
|
replaceWith: this.state.replaceWith,
|
|
@@ -29128,7 +29129,14 @@
|
|
|
29128
29129
|
this.history.update("tables", filterTables);
|
|
29129
29130
|
break;
|
|
29130
29131
|
case "DUPLICATE_SHEET":
|
|
29131
|
-
|
|
29132
|
+
const tables = {};
|
|
29133
|
+
for (const filterTable of Object.values(this.tables[cmd.sheetId] || {})) {
|
|
29134
|
+
if (filterTable) {
|
|
29135
|
+
const newFilterTable = deepCopy(filterTable);
|
|
29136
|
+
tables[newFilterTable.id] = newFilterTable;
|
|
29137
|
+
}
|
|
29138
|
+
}
|
|
29139
|
+
this.history.update("tables", cmd.sheetIdTo, tables);
|
|
29132
29140
|
break;
|
|
29133
29141
|
case "ADD_COLUMNS_ROWS":
|
|
29134
29142
|
this.onAddColumnsRows(cmd);
|
|
@@ -32705,6 +32713,7 @@
|
|
|
32705
32713
|
}
|
|
32706
32714
|
exportForExcel(data) {
|
|
32707
32715
|
for (const sheetData of data.sheets) {
|
|
32716
|
+
const sheetId = sheetData.id;
|
|
32708
32717
|
for (const tableData of sheetData.filterTables) {
|
|
32709
32718
|
const tableZone = toZone(tableData.range);
|
|
32710
32719
|
const filters = [];
|
|
@@ -32720,20 +32729,20 @@
|
|
|
32720
32729
|
if (!filter)
|
|
32721
32730
|
continue;
|
|
32722
32731
|
const valuesInFilterZone = filter.filteredZone
|
|
32723
|
-
? positions(filter.filteredZone)
|
|
32724
|
-
.map(({ col, row }) => this.getters.getEvaluatedCell({ sheetId: sheetData.id, col, row }))
|
|
32725
|
-
.filter((cell) => cell.type !== CellValueType.empty)
|
|
32726
|
-
.map((cell) => cell.formattedValue)
|
|
32732
|
+
? positions(filter.filteredZone).map((position) => this.getters.getEvaluatedCell({ sheetId, ...position }).formattedValue)
|
|
32727
32733
|
: [];
|
|
32728
|
-
|
|
32729
|
-
|
|
32730
|
-
|
|
32731
|
-
|
|
32732
|
-
|
|
32733
|
-
|
|
32734
|
-
|
|
32735
|
-
|
|
32736
|
-
|
|
32734
|
+
if (filteredValues.length) {
|
|
32735
|
+
const xlsxDisplayedValues = valuesInFilterZone
|
|
32736
|
+
.filter((val) => val)
|
|
32737
|
+
.filter((val) => !filteredValues.includes(val));
|
|
32738
|
+
filters.push({
|
|
32739
|
+
colId: i,
|
|
32740
|
+
displayedValues: [...new Set(xlsxDisplayedValues)],
|
|
32741
|
+
displayBlanks: !filteredValues.includes("") && valuesInFilterZone.some((val) => !val),
|
|
32742
|
+
});
|
|
32743
|
+
}
|
|
32744
|
+
// In xlsx, filter header should ALWAYS be a string and should be unique in the table
|
|
32745
|
+
const headerPosition = { col: filter.col, row: filter.zoneWithHeaders.top, sheetId };
|
|
32737
32746
|
const headerString = this.getters.getEvaluatedCell(headerPosition).formattedValue;
|
|
32738
32747
|
const headerName = this.getUniqueColNameForExcel(i, headerString, headerNames);
|
|
32739
32748
|
headerNames.push(headerName);
|
|
@@ -34470,6 +34479,7 @@
|
|
|
34470
34479
|
searchFormulas: false,
|
|
34471
34480
|
};
|
|
34472
34481
|
this.toSearch = "";
|
|
34482
|
+
this.isSearchDirty = false;
|
|
34473
34483
|
}
|
|
34474
34484
|
// ---------------------------------------------------------------------------
|
|
34475
34485
|
// Command Handling
|
|
@@ -34498,14 +34508,21 @@
|
|
|
34498
34508
|
case "REDO":
|
|
34499
34509
|
case "REMOVE_COLUMNS_ROWS":
|
|
34500
34510
|
case "ADD_COLUMNS_ROWS":
|
|
34501
|
-
|
|
34511
|
+
case "EVALUATE_CELLS":
|
|
34512
|
+
case "UPDATE_CELL":
|
|
34513
|
+
this.isSearchDirty = true;
|
|
34502
34514
|
break;
|
|
34503
34515
|
case "ACTIVATE_SHEET":
|
|
34504
|
-
case "REFRESH_SEARCH":
|
|
34505
34516
|
this.refreshSearch();
|
|
34506
34517
|
break;
|
|
34507
34518
|
}
|
|
34508
34519
|
}
|
|
34520
|
+
finalize() {
|
|
34521
|
+
if (this.isSearchDirty) {
|
|
34522
|
+
this.refreshSearch();
|
|
34523
|
+
this.isSearchDirty = false;
|
|
34524
|
+
}
|
|
34525
|
+
}
|
|
34509
34526
|
// ---------------------------------------------------------------------------
|
|
34510
34527
|
// Getters
|
|
34511
34528
|
// ---------------------------------------------------------------------------
|
|
@@ -34561,6 +34578,11 @@
|
|
|
34561
34578
|
if (this.toSearch) {
|
|
34562
34579
|
for (const cell of Object.values(cells)) {
|
|
34563
34580
|
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
34581
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
34582
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
34583
|
+
if (isColHidden || isRowHidden) {
|
|
34584
|
+
continue;
|
|
34585
|
+
}
|
|
34564
34586
|
if (cell &&
|
|
34565
34587
|
this.currentSearchRegex &&
|
|
34566
34588
|
this.currentSearchRegex.test(this.getSearchableString({ sheetId, col, row }))) {
|
|
@@ -35762,15 +35784,15 @@
|
|
|
35762
35784
|
* This plugin handles this internal state.
|
|
35763
35785
|
*/
|
|
35764
35786
|
class SelectionInputsManagerPlugin extends UIPlugin {
|
|
35787
|
+
get currentInput() {
|
|
35788
|
+
return this.focusedInputId ? this.inputs[this.focusedInputId] : null;
|
|
35789
|
+
}
|
|
35765
35790
|
constructor(config) {
|
|
35766
35791
|
super(config);
|
|
35767
35792
|
this.config = config;
|
|
35768
35793
|
this.inputs = {};
|
|
35769
35794
|
this.focusedInputId = null;
|
|
35770
35795
|
}
|
|
35771
|
-
get currentInput() {
|
|
35772
|
-
return this.focusedInputId ? this.inputs[this.focusedInputId] : null;
|
|
35773
|
-
}
|
|
35774
35796
|
// ---------------------------------------------------------------------------
|
|
35775
35797
|
// Command Handling
|
|
35776
35798
|
// ---------------------------------------------------------------------------
|
|
@@ -36999,10 +37021,8 @@
|
|
|
36999
37021
|
}
|
|
37000
37022
|
updateCellCommands.push(newCellValues);
|
|
37001
37023
|
}
|
|
37002
|
-
for (const cmd of updateCellCommands) {
|
|
37003
|
-
this.dispatch("UPDATE_CELL", cmd);
|
|
37004
|
-
}
|
|
37005
37024
|
}
|
|
37025
|
+
updateCellCommands.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
37006
37026
|
}
|
|
37007
37027
|
/**
|
|
37008
37028
|
* Return the distances between main merge cells in the zone.
|
|
@@ -40701,6 +40721,11 @@
|
|
|
40701
40721
|
.o-sidePanelButton:enabled {
|
|
40702
40722
|
cursor: pointer;
|
|
40703
40723
|
}
|
|
40724
|
+
|
|
40725
|
+
.o-sidePanelButton:disabled {
|
|
40726
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
40727
|
+
}
|
|
40728
|
+
|
|
40704
40729
|
.o-sidePanelButton:last-child {
|
|
40705
40730
|
margin-right: 0px;
|
|
40706
40731
|
}
|
|
@@ -40846,11 +40871,9 @@
|
|
|
40846
40871
|
onComposerContentFocused: Function,
|
|
40847
40872
|
};
|
|
40848
40873
|
|
|
40849
|
-
// -----------------------------------------------------------------------------
|
|
40850
|
-
// TopBar
|
|
40851
|
-
// -----------------------------------------------------------------------------
|
|
40852
40874
|
css /* scss */ `
|
|
40853
40875
|
.o-font-size-editor {
|
|
40876
|
+
height: calc(100% - 4px);
|
|
40854
40877
|
input.o-font-size {
|
|
40855
40878
|
height: 20px;
|
|
40856
40879
|
width: 23px;
|
|
@@ -40928,6 +40951,7 @@
|
|
|
40928
40951
|
FontSizeEditor.props = {
|
|
40929
40952
|
onToggle: Function,
|
|
40930
40953
|
dropdownStyle: String,
|
|
40954
|
+
class: String,
|
|
40931
40955
|
};
|
|
40932
40956
|
|
|
40933
40957
|
const FORMATS = [
|
|
@@ -44371,15 +44395,10 @@
|
|
|
44371
44395
|
`;
|
|
44372
44396
|
}
|
|
44373
44397
|
function addFilterColumns(table) {
|
|
44374
|
-
const tableZone = toZone(table.range);
|
|
44375
44398
|
const columns = [];
|
|
44376
|
-
for (const
|
|
44377
|
-
const filter = table.filters[i];
|
|
44378
|
-
if (!filter || !filter.filteredValues.length) {
|
|
44379
|
-
continue;
|
|
44380
|
-
}
|
|
44399
|
+
for (const filter of table.filters) {
|
|
44381
44400
|
const colXml = escapeXml /*xml*/ `
|
|
44382
|
-
<filterColumn ${formatAttributes([["colId",
|
|
44401
|
+
<filterColumn ${formatAttributes([["colId", filter.colId]])}>
|
|
44383
44402
|
${addFilter(filter)}
|
|
44384
44403
|
</filterColumn>
|
|
44385
44404
|
`;
|
|
@@ -44388,9 +44407,10 @@
|
|
|
44388
44407
|
return columns;
|
|
44389
44408
|
}
|
|
44390
44409
|
function addFilter(filter) {
|
|
44391
|
-
const filterValues = filter.
|
|
44410
|
+
const filterValues = filter.displayedValues.map((val) => escapeXml /*xml*/ `<filter ${formatAttributes([["val", val]])}/>`);
|
|
44411
|
+
const filterAttributes = filter.displayBlanks ? [["blank", 1]] : [];
|
|
44392
44412
|
return escapeXml /*xml*/ `
|
|
44393
|
-
<filters>
|
|
44413
|
+
<filters ${formatAttributes(filterAttributes)}>
|
|
44394
44414
|
${joinXmlNodes(filterValues)}
|
|
44395
44415
|
</filters>
|
|
44396
44416
|
`;
|
|
@@ -45367,9 +45387,9 @@
|
|
|
45367
45387
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
45368
45388
|
|
|
45369
45389
|
|
|
45370
|
-
__info__.version = '16.2.
|
|
45371
|
-
__info__.date = '2023-
|
|
45372
|
-
__info__.hash = '
|
|
45390
|
+
__info__.version = '16.2.11';
|
|
45391
|
+
__info__.date = '2023-07-26T12:09:59.264Z';
|
|
45392
|
+
__info__.hash = '0d46dde';
|
|
45373
45393
|
|
|
45374
45394
|
|
|
45375
45395
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|