@odoo/o-spreadsheet 17.4.0-alpha.6 → 17.4.0-alpha.7
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 +28 -48
- package/dist/o-spreadsheet.d.ts +2 -16
- package/dist/o-spreadsheet.esm.js +28 -48
- package/dist/o-spreadsheet.iife.js +28 -48
- package/dist/o-spreadsheet.iife.min.js +4 -4
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +6 -4
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
// @odoo-module ignore
|
|
3
2
|
/**
|
|
4
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.4.0-alpha.
|
|
7
|
-
* @date 2024-06-
|
|
8
|
-
* @hash
|
|
5
|
+
* @version 17.4.0-alpha.7
|
|
6
|
+
* @date 2024-06-21T08:42:22.370Z
|
|
7
|
+
* @hash a99db9a
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
'use strict';
|
|
@@ -34628,6 +34627,10 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
34628
34627
|
case "ACTIVATE_SHEET":
|
|
34629
34628
|
this.isSearchDirty = true;
|
|
34630
34629
|
break;
|
|
34630
|
+
case "REPLACE_SEARCH":
|
|
34631
|
+
for (const match of cmd.matches) {
|
|
34632
|
+
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
34633
|
+
}
|
|
34631
34634
|
}
|
|
34632
34635
|
}
|
|
34633
34636
|
finalize() {
|
|
@@ -34801,6 +34804,21 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
34801
34804
|
searchOptions: this.searchOptions,
|
|
34802
34805
|
});
|
|
34803
34806
|
}
|
|
34807
|
+
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
34808
|
+
const cell = this.getters.getCell(selectedMatch);
|
|
34809
|
+
if (!cell?.content) {
|
|
34810
|
+
return;
|
|
34811
|
+
}
|
|
34812
|
+
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
34813
|
+
return;
|
|
34814
|
+
}
|
|
34815
|
+
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
34816
|
+
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
34817
|
+
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
34818
|
+
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
34819
|
+
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
34820
|
+
this.model.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
34821
|
+
}
|
|
34804
34822
|
getSearchableString(position) {
|
|
34805
34823
|
return this.getters.getCellText(position, this.searchOptions.searchFormulas);
|
|
34806
34824
|
}
|
|
@@ -35552,7 +35570,7 @@ function createMeasure(fields, measure) {
|
|
|
35552
35570
|
function createPivotDimension(fields, dimension) {
|
|
35553
35571
|
const field = fields[dimension.name];
|
|
35554
35572
|
const type = field?.type ?? "integer";
|
|
35555
|
-
const granularity = field && isDateField(field) ? dimension.granularity
|
|
35573
|
+
const granularity = field && isDateField(field) ? dimension.granularity : undefined;
|
|
35556
35574
|
return {
|
|
35557
35575
|
/**
|
|
35558
35576
|
* Get the display name of the dimension
|
|
@@ -35965,8 +35983,8 @@ function compareDimensionValues(dimension, a, b) {
|
|
|
35965
35983
|
}
|
|
35966
35984
|
|
|
35967
35985
|
function createDate(dimension, value, locale) {
|
|
35968
|
-
const granularity = dimension.granularity
|
|
35969
|
-
if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35986
|
+
const granularity = dimension.granularity;
|
|
35987
|
+
if (!granularity || !(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35970
35988
|
throw new Error(`Unknown date granularity: ${granularity}`);
|
|
35971
35989
|
}
|
|
35972
35990
|
if (value === null) {
|
|
@@ -56923,43 +56941,6 @@ class DataCleanupPlugin extends UIPlugin {
|
|
|
56923
56941
|
}
|
|
56924
56942
|
}
|
|
56925
56943
|
|
|
56926
|
-
/**
|
|
56927
|
-
* Find and Replace Plugin
|
|
56928
|
-
*
|
|
56929
|
-
* This plugin is used in combination with the find_and_replace sidePanel
|
|
56930
|
-
* It is used to 'highlight' cells that match an input string according to
|
|
56931
|
-
* the given searchOptions. The second part of this plugin makes it possible
|
|
56932
|
-
* (again with the find_and_replace sidePanel), to replace the values that match
|
|
56933
|
-
* the search with a new value.
|
|
56934
|
-
*/
|
|
56935
|
-
class FindAndReplacePlugin extends UIPlugin {
|
|
56936
|
-
static getters = [];
|
|
56937
|
-
handle(cmd) {
|
|
56938
|
-
switch (cmd.type) {
|
|
56939
|
-
case "REPLACE_SEARCH":
|
|
56940
|
-
for (const match of cmd.matches) {
|
|
56941
|
-
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
56942
|
-
}
|
|
56943
|
-
break;
|
|
56944
|
-
}
|
|
56945
|
-
}
|
|
56946
|
-
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
56947
|
-
const cell = this.getters.getCell(selectedMatch);
|
|
56948
|
-
if (!cell?.content) {
|
|
56949
|
-
return;
|
|
56950
|
-
}
|
|
56951
|
-
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
56952
|
-
return;
|
|
56953
|
-
}
|
|
56954
|
-
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
56955
|
-
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
56956
|
-
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
56957
|
-
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
56958
|
-
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
56959
|
-
this.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
56960
|
-
}
|
|
56961
|
-
}
|
|
56962
|
-
|
|
56963
56944
|
class FormatPlugin extends UIPlugin {
|
|
56964
56945
|
// ---------------------------------------------------------------------------
|
|
56965
56946
|
// Command Handling
|
|
@@ -60774,7 +60755,6 @@ const featurePluginRegistry = new Registry()
|
|
|
60774
60755
|
.add("ui_sheet", SheetUIPlugin)
|
|
60775
60756
|
.add("ui_options", UIOptionsPlugin)
|
|
60776
60757
|
.add("autofill", AutofillPlugin)
|
|
60777
|
-
.add("find_and_replace", FindAndReplacePlugin)
|
|
60778
60758
|
.add("sort", SortPlugin)
|
|
60779
60759
|
.add("automatic_sum", AutomaticSumPlugin)
|
|
60780
60760
|
.add("format", FormatPlugin)
|
|
@@ -67509,6 +67489,6 @@ exports.tokenColors = tokenColors;
|
|
|
67509
67489
|
exports.tokenize = tokenize;
|
|
67510
67490
|
|
|
67511
67491
|
|
|
67512
|
-
__info__.version = "17.4.0-alpha.
|
|
67513
|
-
__info__.date = "2024-06-
|
|
67514
|
-
__info__.hash = "
|
|
67492
|
+
__info__.version = "17.4.0-alpha.7";
|
|
67493
|
+
__info__.date = "2024-06-21T08:42:22.370Z";
|
|
67494
|
+
__info__.hash = "a99db9a";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -4505,21 +4505,6 @@ declare class CollaborativePlugin extends UIPlugin {
|
|
|
4505
4505
|
drawLayer(renderingContext: GridRenderingContext): void;
|
|
4506
4506
|
}
|
|
4507
4507
|
|
|
4508
|
-
/**
|
|
4509
|
-
* Find and Replace Plugin
|
|
4510
|
-
*
|
|
4511
|
-
* This plugin is used in combination with the find_and_replace sidePanel
|
|
4512
|
-
* It is used to 'highlight' cells that match an input string according to
|
|
4513
|
-
* the given searchOptions. The second part of this plugin makes it possible
|
|
4514
|
-
* (again with the find_and_replace sidePanel), to replace the values that match
|
|
4515
|
-
* the search with a new value.
|
|
4516
|
-
*/
|
|
4517
|
-
declare class FindAndReplacePlugin extends UIPlugin {
|
|
4518
|
-
static getters: readonly [];
|
|
4519
|
-
handle(cmd: Command): void;
|
|
4520
|
-
private replaceMatch;
|
|
4521
|
-
}
|
|
4522
|
-
|
|
4523
4508
|
declare class HeaderVisibilityUIPlugin extends UIPlugin {
|
|
4524
4509
|
static getters: readonly ["getNextVisibleCellPosition", "findVisibleHeader", "findLastVisibleColRowIndex", "findFirstVisibleColRowIndex", "isRowHidden", "isColHidden", "isHeaderHidden"];
|
|
4525
4510
|
isRowHidden(sheetId: UID, index: number): boolean;
|
|
@@ -5159,7 +5144,7 @@ type CoreGetters = PluginGetters<typeof SheetPlugin> & PluginGetters<typeof Head
|
|
|
5159
5144
|
type Getters = {
|
|
5160
5145
|
isReadonly: () => boolean;
|
|
5161
5146
|
isDashboard: () => boolean;
|
|
5162
|
-
} & CoreGetters & PluginGetters<typeof AutofillPlugin> & PluginGetters<typeof AutomaticSumPlugin> & PluginGetters<typeof HistoryPlugin> & PluginGetters<typeof ClipboardPlugin> & PluginGetters<typeof EvaluationPlugin> & PluginGetters<typeof EvaluationChartPlugin> & PluginGetters<typeof EvaluationConditionalFormatPlugin> & PluginGetters<typeof
|
|
5147
|
+
} & CoreGetters & PluginGetters<typeof AutofillPlugin> & PluginGetters<typeof AutomaticSumPlugin> & PluginGetters<typeof HistoryPlugin> & PluginGetters<typeof ClipboardPlugin> & PluginGetters<typeof EvaluationPlugin> & PluginGetters<typeof EvaluationChartPlugin> & PluginGetters<typeof EvaluationConditionalFormatPlugin> & PluginGetters<typeof HeaderVisibilityUIPlugin> & PluginGetters<typeof CustomColorsPlugin> & PluginGetters<typeof AutomaticSumPlugin> & PluginGetters<typeof GridSelectionPlugin> & PluginGetters<typeof CollaborativePlugin> & PluginGetters<typeof SortPlugin> & PluginGetters<typeof UIOptionsPlugin> & PluginGetters<typeof SheetUIPlugin> & PluginGetters<typeof SheetViewPlugin> & PluginGetters<typeof FilterEvaluationPlugin> & PluginGetters<typeof SplitToColumnsPlugin> & PluginGetters<typeof HeaderSizeUIPlugin> & PluginGetters<typeof EvaluationDataValidationPlugin> & PluginGetters<typeof HeaderPositionsUIPlugin> & PluginGetters<typeof TableStylePlugin> & PluginGetters<typeof CellComputedStylePlugin> & PluginGetters<typeof DynamicTablesPlugin> & PluginGetters<typeof PivotUIPlugin> & PluginGetters<typeof TableComputedStylePlugin>;
|
|
5163
5148
|
|
|
5164
5149
|
type ArgType = "ANY" | "BOOLEAN" | "NUMBER" | "STRING" | "DATE" | "RANGE" | "RANGE<BOOLEAN>" | "RANGE<NUMBER>" | "RANGE<DATE>" | "RANGE<STRING>" | "RANGE<ANY>" | "META";
|
|
5165
5150
|
interface ArgDefinition {
|
|
@@ -9089,6 +9074,7 @@ declare class FindAndReplaceStore extends SpreadsheetStore implements HighlightP
|
|
|
9089
9074
|
* Apply the replace function to all the matches one time.
|
|
9090
9075
|
*/
|
|
9091
9076
|
replaceAll(): void;
|
|
9077
|
+
private replaceMatch;
|
|
9092
9078
|
private getSearchableString;
|
|
9093
9079
|
get highlights(): Highlight$1[];
|
|
9094
9080
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
// @odoo-module ignore
|
|
3
2
|
/**
|
|
4
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.4.0-alpha.
|
|
7
|
-
* @date 2024-06-
|
|
8
|
-
* @hash
|
|
5
|
+
* @version 17.4.0-alpha.7
|
|
6
|
+
* @date 2024-06-21T08:42:22.370Z
|
|
7
|
+
* @hash a99db9a
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -34626,6 +34625,10 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
34626
34625
|
case "ACTIVATE_SHEET":
|
|
34627
34626
|
this.isSearchDirty = true;
|
|
34628
34627
|
break;
|
|
34628
|
+
case "REPLACE_SEARCH":
|
|
34629
|
+
for (const match of cmd.matches) {
|
|
34630
|
+
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
34631
|
+
}
|
|
34629
34632
|
}
|
|
34630
34633
|
}
|
|
34631
34634
|
finalize() {
|
|
@@ -34799,6 +34802,21 @@ class FindAndReplaceStore extends SpreadsheetStore {
|
|
|
34799
34802
|
searchOptions: this.searchOptions,
|
|
34800
34803
|
});
|
|
34801
34804
|
}
|
|
34805
|
+
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
34806
|
+
const cell = this.getters.getCell(selectedMatch);
|
|
34807
|
+
if (!cell?.content) {
|
|
34808
|
+
return;
|
|
34809
|
+
}
|
|
34810
|
+
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
34811
|
+
return;
|
|
34812
|
+
}
|
|
34813
|
+
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
34814
|
+
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
34815
|
+
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
34816
|
+
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
34817
|
+
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
34818
|
+
this.model.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
34819
|
+
}
|
|
34802
34820
|
getSearchableString(position) {
|
|
34803
34821
|
return this.getters.getCellText(position, this.searchOptions.searchFormulas);
|
|
34804
34822
|
}
|
|
@@ -35550,7 +35568,7 @@ function createMeasure(fields, measure) {
|
|
|
35550
35568
|
function createPivotDimension(fields, dimension) {
|
|
35551
35569
|
const field = fields[dimension.name];
|
|
35552
35570
|
const type = field?.type ?? "integer";
|
|
35553
|
-
const granularity = field && isDateField(field) ? dimension.granularity
|
|
35571
|
+
const granularity = field && isDateField(field) ? dimension.granularity : undefined;
|
|
35554
35572
|
return {
|
|
35555
35573
|
/**
|
|
35556
35574
|
* Get the display name of the dimension
|
|
@@ -35963,8 +35981,8 @@ function compareDimensionValues(dimension, a, b) {
|
|
|
35963
35981
|
}
|
|
35964
35982
|
|
|
35965
35983
|
function createDate(dimension, value, locale) {
|
|
35966
|
-
const granularity = dimension.granularity
|
|
35967
|
-
if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35984
|
+
const granularity = dimension.granularity;
|
|
35985
|
+
if (!granularity || !(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35968
35986
|
throw new Error(`Unknown date granularity: ${granularity}`);
|
|
35969
35987
|
}
|
|
35970
35988
|
if (value === null) {
|
|
@@ -56921,43 +56939,6 @@ class DataCleanupPlugin extends UIPlugin {
|
|
|
56921
56939
|
}
|
|
56922
56940
|
}
|
|
56923
56941
|
|
|
56924
|
-
/**
|
|
56925
|
-
* Find and Replace Plugin
|
|
56926
|
-
*
|
|
56927
|
-
* This plugin is used in combination with the find_and_replace sidePanel
|
|
56928
|
-
* It is used to 'highlight' cells that match an input string according to
|
|
56929
|
-
* the given searchOptions. The second part of this plugin makes it possible
|
|
56930
|
-
* (again with the find_and_replace sidePanel), to replace the values that match
|
|
56931
|
-
* the search with a new value.
|
|
56932
|
-
*/
|
|
56933
|
-
class FindAndReplacePlugin extends UIPlugin {
|
|
56934
|
-
static getters = [];
|
|
56935
|
-
handle(cmd) {
|
|
56936
|
-
switch (cmd.type) {
|
|
56937
|
-
case "REPLACE_SEARCH":
|
|
56938
|
-
for (const match of cmd.matches) {
|
|
56939
|
-
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
56940
|
-
}
|
|
56941
|
-
break;
|
|
56942
|
-
}
|
|
56943
|
-
}
|
|
56944
|
-
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
56945
|
-
const cell = this.getters.getCell(selectedMatch);
|
|
56946
|
-
if (!cell?.content) {
|
|
56947
|
-
return;
|
|
56948
|
-
}
|
|
56949
|
-
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
56950
|
-
return;
|
|
56951
|
-
}
|
|
56952
|
-
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
56953
|
-
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
56954
|
-
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
56955
|
-
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
56956
|
-
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
56957
|
-
this.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
56958
|
-
}
|
|
56959
|
-
}
|
|
56960
|
-
|
|
56961
56942
|
class FormatPlugin extends UIPlugin {
|
|
56962
56943
|
// ---------------------------------------------------------------------------
|
|
56963
56944
|
// Command Handling
|
|
@@ -60772,7 +60753,6 @@ const featurePluginRegistry = new Registry()
|
|
|
60772
60753
|
.add("ui_sheet", SheetUIPlugin)
|
|
60773
60754
|
.add("ui_options", UIOptionsPlugin)
|
|
60774
60755
|
.add("autofill", AutofillPlugin)
|
|
60775
|
-
.add("find_and_replace", FindAndReplacePlugin)
|
|
60776
60756
|
.add("sort", SortPlugin)
|
|
60777
60757
|
.add("automatic_sum", AutomaticSumPlugin)
|
|
60778
60758
|
.add("format", FormatPlugin)
|
|
@@ -67464,6 +67444,6 @@ const constants = {
|
|
|
67464
67444
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
67465
67445
|
|
|
67466
67446
|
|
|
67467
|
-
__info__.version = "17.4.0-alpha.
|
|
67468
|
-
__info__.date = "2024-06-
|
|
67469
|
-
__info__.hash = "
|
|
67447
|
+
__info__.version = "17.4.0-alpha.7";
|
|
67448
|
+
__info__.date = "2024-06-21T08:42:22.370Z";
|
|
67449
|
+
__info__.hash = "a99db9a";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
// @odoo-module ignore
|
|
3
2
|
/**
|
|
4
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
5
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
6
|
-
* @version 17.4.0-alpha.
|
|
7
|
-
* @date 2024-06-
|
|
8
|
-
* @hash
|
|
5
|
+
* @version 17.4.0-alpha.7
|
|
6
|
+
* @date 2024-06-21T08:42:22.370Z
|
|
7
|
+
* @hash a99db9a
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
10
|
(function (exports, owl) {
|
|
@@ -34627,6 +34626,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34627
34626
|
case "ACTIVATE_SHEET":
|
|
34628
34627
|
this.isSearchDirty = true;
|
|
34629
34628
|
break;
|
|
34629
|
+
case "REPLACE_SEARCH":
|
|
34630
|
+
for (const match of cmd.matches) {
|
|
34631
|
+
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
34632
|
+
}
|
|
34630
34633
|
}
|
|
34631
34634
|
}
|
|
34632
34635
|
finalize() {
|
|
@@ -34800,6 +34803,21 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34800
34803
|
searchOptions: this.searchOptions,
|
|
34801
34804
|
});
|
|
34802
34805
|
}
|
|
34806
|
+
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
34807
|
+
const cell = this.getters.getCell(selectedMatch);
|
|
34808
|
+
if (!cell?.content) {
|
|
34809
|
+
return;
|
|
34810
|
+
}
|
|
34811
|
+
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
34812
|
+
return;
|
|
34813
|
+
}
|
|
34814
|
+
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
34815
|
+
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
34816
|
+
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
34817
|
+
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
34818
|
+
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
34819
|
+
this.model.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
34820
|
+
}
|
|
34803
34821
|
getSearchableString(position) {
|
|
34804
34822
|
return this.getters.getCellText(position, this.searchOptions.searchFormulas);
|
|
34805
34823
|
}
|
|
@@ -35551,7 +35569,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35551
35569
|
function createPivotDimension(fields, dimension) {
|
|
35552
35570
|
const field = fields[dimension.name];
|
|
35553
35571
|
const type = field?.type ?? "integer";
|
|
35554
|
-
const granularity = field && isDateField(field) ? dimension.granularity
|
|
35572
|
+
const granularity = field && isDateField(field) ? dimension.granularity : undefined;
|
|
35555
35573
|
return {
|
|
35556
35574
|
/**
|
|
35557
35575
|
* Get the display name of the dimension
|
|
@@ -35964,8 +35982,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35964
35982
|
}
|
|
35965
35983
|
|
|
35966
35984
|
function createDate(dimension, value, locale) {
|
|
35967
|
-
const granularity = dimension.granularity
|
|
35968
|
-
if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35985
|
+
const granularity = dimension.granularity;
|
|
35986
|
+
if (!granularity || !(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
35969
35987
|
throw new Error(`Unknown date granularity: ${granularity}`);
|
|
35970
35988
|
}
|
|
35971
35989
|
if (value === null) {
|
|
@@ -56922,43 +56940,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56922
56940
|
}
|
|
56923
56941
|
}
|
|
56924
56942
|
|
|
56925
|
-
/**
|
|
56926
|
-
* Find and Replace Plugin
|
|
56927
|
-
*
|
|
56928
|
-
* This plugin is used in combination with the find_and_replace sidePanel
|
|
56929
|
-
* It is used to 'highlight' cells that match an input string according to
|
|
56930
|
-
* the given searchOptions. The second part of this plugin makes it possible
|
|
56931
|
-
* (again with the find_and_replace sidePanel), to replace the values that match
|
|
56932
|
-
* the search with a new value.
|
|
56933
|
-
*/
|
|
56934
|
-
class FindAndReplacePlugin extends UIPlugin {
|
|
56935
|
-
static getters = [];
|
|
56936
|
-
handle(cmd) {
|
|
56937
|
-
switch (cmd.type) {
|
|
56938
|
-
case "REPLACE_SEARCH":
|
|
56939
|
-
for (const match of cmd.matches) {
|
|
56940
|
-
this.replaceMatch(match, cmd.searchString, cmd.replaceWith, cmd.searchOptions);
|
|
56941
|
-
}
|
|
56942
|
-
break;
|
|
56943
|
-
}
|
|
56944
|
-
}
|
|
56945
|
-
replaceMatch(selectedMatch, searchString, replaceWith, searchOptions) {
|
|
56946
|
-
const cell = this.getters.getCell(selectedMatch);
|
|
56947
|
-
if (!cell?.content) {
|
|
56948
|
-
return;
|
|
56949
|
-
}
|
|
56950
|
-
if (cell?.isFormula && !searchOptions.searchFormulas) {
|
|
56951
|
-
return;
|
|
56952
|
-
}
|
|
56953
|
-
const searchRegex = getSearchRegex(searchString, searchOptions);
|
|
56954
|
-
const replaceRegex = new RegExp(searchRegex.source, searchRegex.flags + "g");
|
|
56955
|
-
const toReplace = this.getters.getCellText(selectedMatch, searchOptions.searchFormulas);
|
|
56956
|
-
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
56957
|
-
const canonicalContent = canonicalizeNumberContent(content, this.getters.getLocale());
|
|
56958
|
-
this.dispatch("UPDATE_CELL", { ...selectedMatch, content: canonicalContent });
|
|
56959
|
-
}
|
|
56960
|
-
}
|
|
56961
|
-
|
|
56962
56943
|
class FormatPlugin extends UIPlugin {
|
|
56963
56944
|
// ---------------------------------------------------------------------------
|
|
56964
56945
|
// Command Handling
|
|
@@ -60773,7 +60754,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60773
60754
|
.add("ui_sheet", SheetUIPlugin)
|
|
60774
60755
|
.add("ui_options", UIOptionsPlugin)
|
|
60775
60756
|
.add("autofill", AutofillPlugin)
|
|
60776
|
-
.add("find_and_replace", FindAndReplacePlugin)
|
|
60777
60757
|
.add("sort", SortPlugin)
|
|
60778
60758
|
.add("automatic_sum", AutomaticSumPlugin)
|
|
60779
60759
|
.add("format", FormatPlugin)
|
|
@@ -67508,9 +67488,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67508
67488
|
exports.tokenize = tokenize;
|
|
67509
67489
|
|
|
67510
67490
|
|
|
67511
|
-
__info__.version = "17.4.0-alpha.
|
|
67512
|
-
__info__.date = "2024-06-
|
|
67513
|
-
__info__.hash = "
|
|
67491
|
+
__info__.version = "17.4.0-alpha.7";
|
|
67492
|
+
__info__.date = "2024-06-21T08:42:22.370Z";
|
|
67493
|
+
__info__.hash = "a99db9a";
|
|
67514
67494
|
|
|
67515
67495
|
|
|
67516
67496
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|