@odoo/o-spreadsheet 18.5.0-alpha.3 → 18.5.0-alpha.4
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 +102 -61
- package/dist/o-spreadsheet.d.ts +313 -159
- package/dist/o-spreadsheet.esm.js +102 -61
- package/dist/o-spreadsheet.iife.js +102 -61
- package/dist/o-spreadsheet.iife.min.js +253 -253
- package/dist/o_spreadsheet.xml +10 -9
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.5.0-alpha.
|
|
6
|
-
* @date 2025-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.5.0-alpha.4
|
|
6
|
+
* @date 2025-07-30T11:23:18.805Z
|
|
7
|
+
* @hash 34a4ab3
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, useExternalListener, onWillUpdateProps, onWillStart, onWillPatch, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -8638,12 +8638,12 @@ const AGGREGATOR_NAMES = {
|
|
|
8638
8638
|
avg: _t("Average"),
|
|
8639
8639
|
sum: _t("Sum"),
|
|
8640
8640
|
};
|
|
8641
|
-
const
|
|
8641
|
+
const DEFAULT_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8642
8642
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8643
|
-
integer:
|
|
8644
|
-
char:
|
|
8643
|
+
integer: DEFAULT_AGGREGATORS,
|
|
8644
|
+
char: DEFAULT_AGGREGATORS,
|
|
8645
|
+
datetime: DEFAULT_AGGREGATORS,
|
|
8645
8646
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8646
|
-
datetime: ["max", "min", "count_distinct", "count"],
|
|
8647
8647
|
};
|
|
8648
8648
|
const AGGREGATORS = {};
|
|
8649
8649
|
for (const type in AGGREGATORS_BY_FIELD_TYPE) {
|
|
@@ -30515,28 +30515,17 @@ class MenuPopover extends Component {
|
|
|
30515
30515
|
}
|
|
30516
30516
|
}
|
|
30517
30517
|
|
|
30518
|
-
class
|
|
30519
|
-
|
|
30520
|
-
|
|
30521
|
-
static props = { figureUI: Object };
|
|
30518
|
+
class ChartDashboardMenuStore extends SpreadsheetStore {
|
|
30519
|
+
chartId;
|
|
30520
|
+
mutators = ["reset"];
|
|
30522
30521
|
originalChartDefinition;
|
|
30523
|
-
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
this.fullScreenFigureStore = useStore(FullScreenChartStore);
|
|
30528
|
-
this.originalChartDefinition = this.env.model.getters.getChartDefinition(this.props.figureUI.id);
|
|
30529
|
-
onWillUpdateProps(({ figureUI }) => {
|
|
30530
|
-
if (figureUI.id !== this.props.figureUI.id) {
|
|
30531
|
-
this.originalChartDefinition = this.env.model.getters.getChartDefinition(figureUI.id);
|
|
30532
|
-
}
|
|
30533
|
-
});
|
|
30534
|
-
}
|
|
30535
|
-
getMenuItems() {
|
|
30536
|
-
return [this.fullScreenMenuItem, ...this.changeChartTypeMenuItems].filter(isDefined);
|
|
30522
|
+
constructor(get, chartId) {
|
|
30523
|
+
super(get);
|
|
30524
|
+
this.chartId = chartId;
|
|
30525
|
+
this.originalChartDefinition = this.getters.getChartDefinition(this.chartId);
|
|
30537
30526
|
}
|
|
30538
30527
|
get changeChartTypeMenuItems() {
|
|
30539
|
-
const definition = this.
|
|
30528
|
+
const definition = this.getters.getChartDefinition(this.chartId);
|
|
30540
30529
|
if (!["line", "bar", "pie"].includes(definition.type)) {
|
|
30541
30530
|
return [];
|
|
30542
30531
|
}
|
|
@@ -30545,27 +30534,19 @@ class ChartDashboardMenu extends Component {
|
|
|
30545
30534
|
return {
|
|
30546
30535
|
id: item.chartType,
|
|
30547
30536
|
label: item.displayName,
|
|
30548
|
-
onClick: () => this.
|
|
30549
|
-
isSelected: item.chartType === this.
|
|
30537
|
+
onClick: () => this.updateType(item.chartType),
|
|
30538
|
+
isSelected: item.chartType === this.getters.getChartDefinition(this.chartId).type,
|
|
30550
30539
|
iconClass: this.getIconClasses(item.chartType),
|
|
30551
30540
|
};
|
|
30552
30541
|
});
|
|
30553
30542
|
}
|
|
30554
|
-
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
}
|
|
30558
|
-
if (type.includes("line")) {
|
|
30559
|
-
return "fa fa-line-chart";
|
|
30560
|
-
}
|
|
30561
|
-
if (type.includes("pie")) {
|
|
30562
|
-
return "fa fa-pie-chart";
|
|
30563
|
-
}
|
|
30564
|
-
return "";
|
|
30543
|
+
reset(chartId) {
|
|
30544
|
+
this.chartId = chartId;
|
|
30545
|
+
this.originalChartDefinition = this.getters.getChartDefinition(chartId);
|
|
30565
30546
|
}
|
|
30566
|
-
|
|
30567
|
-
const figureId = this.
|
|
30568
|
-
const currentDefinition = this.
|
|
30547
|
+
updateType(type) {
|
|
30548
|
+
const figureId = this.chartId;
|
|
30549
|
+
const currentDefinition = this.getters.getChartDefinition(figureId);
|
|
30569
30550
|
if (currentDefinition.type === type) {
|
|
30570
30551
|
return;
|
|
30571
30552
|
}
|
|
@@ -30576,7 +30557,7 @@ class ChartDashboardMenu extends Component {
|
|
|
30576
30557
|
else {
|
|
30577
30558
|
const newChartInfo = chartSubtypeRegistry.get(type);
|
|
30578
30559
|
const ChartClass = chartRegistry.get(newChartInfo.chartType);
|
|
30579
|
-
const chartCreationContext = this.
|
|
30560
|
+
const chartCreationContext = this.getters.getContextCreationChart(figureId);
|
|
30580
30561
|
if (!chartCreationContext)
|
|
30581
30562
|
return;
|
|
30582
30563
|
definition = {
|
|
@@ -30584,14 +30565,45 @@ class ChartDashboardMenu extends Component {
|
|
|
30584
30565
|
...newChartInfo.subtypeDefinition,
|
|
30585
30566
|
};
|
|
30586
30567
|
}
|
|
30587
|
-
this.
|
|
30568
|
+
this.model.dispatch("UPDATE_CHART", {
|
|
30588
30569
|
definition,
|
|
30589
30570
|
figureId,
|
|
30590
|
-
sheetId: this.
|
|
30571
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
30572
|
+
});
|
|
30573
|
+
}
|
|
30574
|
+
getIconClasses(type) {
|
|
30575
|
+
if (type.includes("bar")) {
|
|
30576
|
+
return "fa fa-bar-chart";
|
|
30577
|
+
}
|
|
30578
|
+
if (type.includes("line")) {
|
|
30579
|
+
return "fa fa-line-chart";
|
|
30580
|
+
}
|
|
30581
|
+
if (type.includes("pie")) {
|
|
30582
|
+
return "fa fa-pie-chart";
|
|
30583
|
+
}
|
|
30584
|
+
return "";
|
|
30585
|
+
}
|
|
30586
|
+
}
|
|
30587
|
+
|
|
30588
|
+
class ChartDashboardMenu extends Component {
|
|
30589
|
+
static template = "o-spreadsheet-ChartDashboardMenu";
|
|
30590
|
+
static components = { MenuPopover };
|
|
30591
|
+
static props = { figureUI: Object };
|
|
30592
|
+
fullScreenFigureStore;
|
|
30593
|
+
store;
|
|
30594
|
+
menuState = useState({ isOpen: false, anchorRect: null, menuItems: [] });
|
|
30595
|
+
setup() {
|
|
30596
|
+
super.setup();
|
|
30597
|
+
this.store = useLocalStore(ChartDashboardMenuStore, this.props.figureUI.id);
|
|
30598
|
+
this.fullScreenFigureStore = useStore(FullScreenChartStore);
|
|
30599
|
+
onWillUpdateProps(({ figureUI }) => {
|
|
30600
|
+
if (figureUI.id !== this.props.figureUI.id) {
|
|
30601
|
+
this.store.reset(figureUI.id);
|
|
30602
|
+
}
|
|
30591
30603
|
});
|
|
30592
30604
|
}
|
|
30593
|
-
|
|
30594
|
-
return this.
|
|
30605
|
+
getMenuItems() {
|
|
30606
|
+
return [this.fullScreenMenuItem, ...this.store.changeChartTypeMenuItems].filter(isDefined);
|
|
30595
30607
|
}
|
|
30596
30608
|
get backgroundColor() {
|
|
30597
30609
|
const color = this.env.model.getters.getChartDefinition(this.props.figureUI.id).background;
|
|
@@ -31733,7 +31745,7 @@ criterionEvaluatorRegistry.add("isValueInRange", {
|
|
|
31733
31745
|
}
|
|
31734
31746
|
const criterionValues = getters.getDataValidationRangeValues(sheetId, criterion);
|
|
31735
31747
|
return criterionValues
|
|
31736
|
-
.map((value) => value.toLowerCase())
|
|
31748
|
+
.map((value) => value.value.toLowerCase())
|
|
31737
31749
|
.includes(value.toString().toLowerCase());
|
|
31738
31750
|
},
|
|
31739
31751
|
getErrorString: (criterion) => _t("The value must be a value in the range %s", String(criterion.values[0])),
|
|
@@ -52110,7 +52122,8 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52110
52122
|
static props = {
|
|
52111
52123
|
editedCf: Object,
|
|
52112
52124
|
onCancel: Function,
|
|
52113
|
-
|
|
52125
|
+
onExit: Function,
|
|
52126
|
+
isNewCf: Boolean,
|
|
52114
52127
|
};
|
|
52115
52128
|
static components = {
|
|
52116
52129
|
SelectionInput,
|
|
@@ -52135,6 +52148,7 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52135
52148
|
currentCFType: this.props.editedCf.rule.type,
|
|
52136
52149
|
ranges: this.props.editedCf.ranges,
|
|
52137
52150
|
rules: this.getDefaultRules(),
|
|
52151
|
+
hasEditedCf: this.props.isNewCf,
|
|
52138
52152
|
});
|
|
52139
52153
|
switch (this.props.editedCf.rule.type) {
|
|
52140
52154
|
case "CellIsRule":
|
|
@@ -52186,6 +52200,9 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52186
52200
|
ranges: ranges.map((xc) => this.env.model.getters.getRangeDataFromXc(sheetId, xc)),
|
|
52187
52201
|
sheetId,
|
|
52188
52202
|
});
|
|
52203
|
+
if (result.isSuccessful) {
|
|
52204
|
+
this.state.hasEditedCf = true;
|
|
52205
|
+
}
|
|
52189
52206
|
const reasons = result.reasons.filter((r) => r !== "NoChanges" /* CommandResult.NoChanges */);
|
|
52190
52207
|
if (!newCf.suppressErrors) {
|
|
52191
52208
|
this.state.errors = reasons;
|
|
@@ -52207,7 +52224,15 @@ class ConditionalFormattingEditor extends Component {
|
|
|
52207
52224
|
onSave() {
|
|
52208
52225
|
const result = this.updateConditionalFormat({});
|
|
52209
52226
|
if (result.length === 0) {
|
|
52210
|
-
this.props.
|
|
52227
|
+
this.props.onExit();
|
|
52228
|
+
}
|
|
52229
|
+
}
|
|
52230
|
+
onCancel() {
|
|
52231
|
+
if (this.state.hasEditedCf) {
|
|
52232
|
+
this.props.onCancel();
|
|
52233
|
+
}
|
|
52234
|
+
else {
|
|
52235
|
+
this.props.onExit();
|
|
52211
52236
|
}
|
|
52212
52237
|
}
|
|
52213
52238
|
getDefaultRules() {
|
|
@@ -67103,8 +67128,16 @@ class EvaluationDataValidationPlugin extends CoreViewPlugin {
|
|
|
67103
67128
|
}
|
|
67104
67129
|
getDataValidationRangeValues(sheetId, criterion) {
|
|
67105
67130
|
const range = this.getters.getRangeFromSheetXC(sheetId, String(criterion.values[0]));
|
|
67106
|
-
const
|
|
67107
|
-
|
|
67131
|
+
const values = [];
|
|
67132
|
+
const labelsSet = new Set();
|
|
67133
|
+
for (const p of positions(range.zone)) {
|
|
67134
|
+
const cell = this.getters.getEvaluatedCell({ ...p, sheetId: range.sheetId });
|
|
67135
|
+
if (cell.formattedValue && !labelsSet.has(cell.formattedValue)) {
|
|
67136
|
+
labelsSet.add(cell.formattedValue);
|
|
67137
|
+
values.push({ label: cell.formattedValue, value: cell.value?.toString() || "" });
|
|
67138
|
+
}
|
|
67139
|
+
}
|
|
67140
|
+
return values;
|
|
67108
67141
|
}
|
|
67109
67142
|
isCellValidCheckbox(cellPosition) {
|
|
67110
67143
|
if (!this.getters.isMainCellPosition(cellPosition)) {
|
|
@@ -75726,25 +75759,30 @@ autoCompleteProviders.add("dataValidation", {
|
|
|
75726
75759
|
}
|
|
75727
75760
|
const sheetId = this.composer.currentEditedCell.sheetId;
|
|
75728
75761
|
const values = rule.criterion.type === "isValueInRange"
|
|
75729
|
-
?
|
|
75730
|
-
: rule.criterion.values;
|
|
75762
|
+
? this.getters.getDataValidationRangeValues(sheetId, rule.criterion)
|
|
75763
|
+
: rule.criterion.values.map((value) => ({ label: value, value }));
|
|
75731
75764
|
const isChip = rule.criterion.displayStyle === "chip";
|
|
75732
75765
|
if (!isChip) {
|
|
75733
|
-
return values.map((value) => ({
|
|
75766
|
+
return values.map((value) => ({
|
|
75767
|
+
text: value.value,
|
|
75768
|
+
fuzzySearchKey: value.label,
|
|
75769
|
+
htmlContent: [{ value: value.label }],
|
|
75770
|
+
}));
|
|
75734
75771
|
}
|
|
75735
75772
|
const colors = rule.criterion.colors;
|
|
75736
75773
|
return values.map((value) => {
|
|
75737
|
-
const color = colors?.[value];
|
|
75774
|
+
const color = colors?.[value.value];
|
|
75738
75775
|
return {
|
|
75739
|
-
text: value,
|
|
75776
|
+
text: value.value,
|
|
75740
75777
|
htmlContent: [
|
|
75741
75778
|
{
|
|
75742
|
-
value,
|
|
75779
|
+
value: value.label,
|
|
75743
75780
|
color: color ? chipTextColor(color) : undefined,
|
|
75744
75781
|
backgroundColor: color || GRAY_200,
|
|
75745
75782
|
classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"],
|
|
75746
75783
|
},
|
|
75747
75784
|
],
|
|
75785
|
+
fuzzySearchKey: value.label,
|
|
75748
75786
|
};
|
|
75749
75787
|
});
|
|
75750
75788
|
},
|
|
@@ -84718,6 +84756,8 @@ const components = {
|
|
|
84718
84756
|
WaterfallChartDesignPanel,
|
|
84719
84757
|
ComboChartDesignPanel,
|
|
84720
84758
|
FunnelChartDesignPanel,
|
|
84759
|
+
SunburstChartDesignPanel,
|
|
84760
|
+
TreeMapChartDesignPanel,
|
|
84721
84761
|
ChartTypePicker,
|
|
84722
84762
|
FigureComponent,
|
|
84723
84763
|
MenuPopover,
|
|
@@ -84747,6 +84787,7 @@ const hooks = {
|
|
|
84747
84787
|
};
|
|
84748
84788
|
const stores = {
|
|
84749
84789
|
useStoreProvider,
|
|
84790
|
+
ChartDashboardMenuStore,
|
|
84750
84791
|
DependencyContainer,
|
|
84751
84792
|
CellPopoverStore,
|
|
84752
84793
|
ComposerFocusStore,
|
|
@@ -84785,6 +84826,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
84785
84826
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
84786
84827
|
|
|
84787
84828
|
|
|
84788
|
-
__info__.version = "18.5.0-alpha.
|
|
84789
|
-
__info__.date = "2025-07-
|
|
84790
|
-
__info__.hash = "
|
|
84829
|
+
__info__.version = "18.5.0-alpha.4";
|
|
84830
|
+
__info__.date = "2025-07-30T11:23:18.805Z";
|
|
84831
|
+
__info__.hash = "34a4ab3";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.5.0-alpha.
|
|
6
|
-
* @date 2025-07-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.5.0-alpha.4
|
|
6
|
+
* @date 2025-07-30T11:23:18.805Z
|
|
7
|
+
* @hash 34a4ab3
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -8639,12 +8639,12 @@
|
|
|
8639
8639
|
avg: _t("Average"),
|
|
8640
8640
|
sum: _t("Sum"),
|
|
8641
8641
|
};
|
|
8642
|
-
const
|
|
8642
|
+
const DEFAULT_AGGREGATORS = ["max", "min", "avg", "sum", "count_distinct", "count"];
|
|
8643
8643
|
const AGGREGATORS_BY_FIELD_TYPE = {
|
|
8644
|
-
integer:
|
|
8645
|
-
char:
|
|
8644
|
+
integer: DEFAULT_AGGREGATORS,
|
|
8645
|
+
char: DEFAULT_AGGREGATORS,
|
|
8646
|
+
datetime: DEFAULT_AGGREGATORS,
|
|
8646
8647
|
boolean: ["count_distinct", "count", "bool_and", "bool_or"],
|
|
8647
|
-
datetime: ["max", "min", "count_distinct", "count"],
|
|
8648
8648
|
};
|
|
8649
8649
|
const AGGREGATORS = {};
|
|
8650
8650
|
for (const type in AGGREGATORS_BY_FIELD_TYPE) {
|
|
@@ -30516,28 +30516,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30516
30516
|
}
|
|
30517
30517
|
}
|
|
30518
30518
|
|
|
30519
|
-
class
|
|
30520
|
-
|
|
30521
|
-
|
|
30522
|
-
static props = { figureUI: Object };
|
|
30519
|
+
class ChartDashboardMenuStore extends SpreadsheetStore {
|
|
30520
|
+
chartId;
|
|
30521
|
+
mutators = ["reset"];
|
|
30523
30522
|
originalChartDefinition;
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
|
|
30528
|
-
this.fullScreenFigureStore = useStore(FullScreenChartStore);
|
|
30529
|
-
this.originalChartDefinition = this.env.model.getters.getChartDefinition(this.props.figureUI.id);
|
|
30530
|
-
owl.onWillUpdateProps(({ figureUI }) => {
|
|
30531
|
-
if (figureUI.id !== this.props.figureUI.id) {
|
|
30532
|
-
this.originalChartDefinition = this.env.model.getters.getChartDefinition(figureUI.id);
|
|
30533
|
-
}
|
|
30534
|
-
});
|
|
30535
|
-
}
|
|
30536
|
-
getMenuItems() {
|
|
30537
|
-
return [this.fullScreenMenuItem, ...this.changeChartTypeMenuItems].filter(isDefined);
|
|
30523
|
+
constructor(get, chartId) {
|
|
30524
|
+
super(get);
|
|
30525
|
+
this.chartId = chartId;
|
|
30526
|
+
this.originalChartDefinition = this.getters.getChartDefinition(this.chartId);
|
|
30538
30527
|
}
|
|
30539
30528
|
get changeChartTypeMenuItems() {
|
|
30540
|
-
const definition = this.
|
|
30529
|
+
const definition = this.getters.getChartDefinition(this.chartId);
|
|
30541
30530
|
if (!["line", "bar", "pie"].includes(definition.type)) {
|
|
30542
30531
|
return [];
|
|
30543
30532
|
}
|
|
@@ -30546,27 +30535,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30546
30535
|
return {
|
|
30547
30536
|
id: item.chartType,
|
|
30548
30537
|
label: item.displayName,
|
|
30549
|
-
onClick: () => this.
|
|
30550
|
-
isSelected: item.chartType === this.
|
|
30538
|
+
onClick: () => this.updateType(item.chartType),
|
|
30539
|
+
isSelected: item.chartType === this.getters.getChartDefinition(this.chartId).type,
|
|
30551
30540
|
iconClass: this.getIconClasses(item.chartType),
|
|
30552
30541
|
};
|
|
30553
30542
|
});
|
|
30554
30543
|
}
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
|
|
30558
|
-
}
|
|
30559
|
-
if (type.includes("line")) {
|
|
30560
|
-
return "fa fa-line-chart";
|
|
30561
|
-
}
|
|
30562
|
-
if (type.includes("pie")) {
|
|
30563
|
-
return "fa fa-pie-chart";
|
|
30564
|
-
}
|
|
30565
|
-
return "";
|
|
30544
|
+
reset(chartId) {
|
|
30545
|
+
this.chartId = chartId;
|
|
30546
|
+
this.originalChartDefinition = this.getters.getChartDefinition(chartId);
|
|
30566
30547
|
}
|
|
30567
|
-
|
|
30568
|
-
const figureId = this.
|
|
30569
|
-
const currentDefinition = this.
|
|
30548
|
+
updateType(type) {
|
|
30549
|
+
const figureId = this.chartId;
|
|
30550
|
+
const currentDefinition = this.getters.getChartDefinition(figureId);
|
|
30570
30551
|
if (currentDefinition.type === type) {
|
|
30571
30552
|
return;
|
|
30572
30553
|
}
|
|
@@ -30577,7 +30558,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30577
30558
|
else {
|
|
30578
30559
|
const newChartInfo = chartSubtypeRegistry.get(type);
|
|
30579
30560
|
const ChartClass = chartRegistry.get(newChartInfo.chartType);
|
|
30580
|
-
const chartCreationContext = this.
|
|
30561
|
+
const chartCreationContext = this.getters.getContextCreationChart(figureId);
|
|
30581
30562
|
if (!chartCreationContext)
|
|
30582
30563
|
return;
|
|
30583
30564
|
definition = {
|
|
@@ -30585,14 +30566,45 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30585
30566
|
...newChartInfo.subtypeDefinition,
|
|
30586
30567
|
};
|
|
30587
30568
|
}
|
|
30588
|
-
this.
|
|
30569
|
+
this.model.dispatch("UPDATE_CHART", {
|
|
30589
30570
|
definition,
|
|
30590
30571
|
figureId,
|
|
30591
|
-
sheetId: this.
|
|
30572
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
30573
|
+
});
|
|
30574
|
+
}
|
|
30575
|
+
getIconClasses(type) {
|
|
30576
|
+
if (type.includes("bar")) {
|
|
30577
|
+
return "fa fa-bar-chart";
|
|
30578
|
+
}
|
|
30579
|
+
if (type.includes("line")) {
|
|
30580
|
+
return "fa fa-line-chart";
|
|
30581
|
+
}
|
|
30582
|
+
if (type.includes("pie")) {
|
|
30583
|
+
return "fa fa-pie-chart";
|
|
30584
|
+
}
|
|
30585
|
+
return "";
|
|
30586
|
+
}
|
|
30587
|
+
}
|
|
30588
|
+
|
|
30589
|
+
class ChartDashboardMenu extends owl.Component {
|
|
30590
|
+
static template = "o-spreadsheet-ChartDashboardMenu";
|
|
30591
|
+
static components = { MenuPopover };
|
|
30592
|
+
static props = { figureUI: Object };
|
|
30593
|
+
fullScreenFigureStore;
|
|
30594
|
+
store;
|
|
30595
|
+
menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
|
|
30596
|
+
setup() {
|
|
30597
|
+
super.setup();
|
|
30598
|
+
this.store = useLocalStore(ChartDashboardMenuStore, this.props.figureUI.id);
|
|
30599
|
+
this.fullScreenFigureStore = useStore(FullScreenChartStore);
|
|
30600
|
+
owl.onWillUpdateProps(({ figureUI }) => {
|
|
30601
|
+
if (figureUI.id !== this.props.figureUI.id) {
|
|
30602
|
+
this.store.reset(figureUI.id);
|
|
30603
|
+
}
|
|
30592
30604
|
});
|
|
30593
30605
|
}
|
|
30594
|
-
|
|
30595
|
-
return this.
|
|
30606
|
+
getMenuItems() {
|
|
30607
|
+
return [this.fullScreenMenuItem, ...this.store.changeChartTypeMenuItems].filter(isDefined);
|
|
30596
30608
|
}
|
|
30597
30609
|
get backgroundColor() {
|
|
30598
30610
|
const color = this.env.model.getters.getChartDefinition(this.props.figureUI.id).background;
|
|
@@ -31734,7 +31746,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31734
31746
|
}
|
|
31735
31747
|
const criterionValues = getters.getDataValidationRangeValues(sheetId, criterion);
|
|
31736
31748
|
return criterionValues
|
|
31737
|
-
.map((value) => value.toLowerCase())
|
|
31749
|
+
.map((value) => value.value.toLowerCase())
|
|
31738
31750
|
.includes(value.toString().toLowerCase());
|
|
31739
31751
|
},
|
|
31740
31752
|
getErrorString: (criterion) => _t("The value must be a value in the range %s", String(criterion.values[0])),
|
|
@@ -52111,7 +52123,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52111
52123
|
static props = {
|
|
52112
52124
|
editedCf: Object,
|
|
52113
52125
|
onCancel: Function,
|
|
52114
|
-
|
|
52126
|
+
onExit: Function,
|
|
52127
|
+
isNewCf: Boolean,
|
|
52115
52128
|
};
|
|
52116
52129
|
static components = {
|
|
52117
52130
|
SelectionInput,
|
|
@@ -52136,6 +52149,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52136
52149
|
currentCFType: this.props.editedCf.rule.type,
|
|
52137
52150
|
ranges: this.props.editedCf.ranges,
|
|
52138
52151
|
rules: this.getDefaultRules(),
|
|
52152
|
+
hasEditedCf: this.props.isNewCf,
|
|
52139
52153
|
});
|
|
52140
52154
|
switch (this.props.editedCf.rule.type) {
|
|
52141
52155
|
case "CellIsRule":
|
|
@@ -52187,6 +52201,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52187
52201
|
ranges: ranges.map((xc) => this.env.model.getters.getRangeDataFromXc(sheetId, xc)),
|
|
52188
52202
|
sheetId,
|
|
52189
52203
|
});
|
|
52204
|
+
if (result.isSuccessful) {
|
|
52205
|
+
this.state.hasEditedCf = true;
|
|
52206
|
+
}
|
|
52190
52207
|
const reasons = result.reasons.filter((r) => r !== "NoChanges" /* CommandResult.NoChanges */);
|
|
52191
52208
|
if (!newCf.suppressErrors) {
|
|
52192
52209
|
this.state.errors = reasons;
|
|
@@ -52208,7 +52225,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52208
52225
|
onSave() {
|
|
52209
52226
|
const result = this.updateConditionalFormat({});
|
|
52210
52227
|
if (result.length === 0) {
|
|
52211
|
-
this.props.
|
|
52228
|
+
this.props.onExit();
|
|
52229
|
+
}
|
|
52230
|
+
}
|
|
52231
|
+
onCancel() {
|
|
52232
|
+
if (this.state.hasEditedCf) {
|
|
52233
|
+
this.props.onCancel();
|
|
52234
|
+
}
|
|
52235
|
+
else {
|
|
52236
|
+
this.props.onExit();
|
|
52212
52237
|
}
|
|
52213
52238
|
}
|
|
52214
52239
|
getDefaultRules() {
|
|
@@ -67104,8 +67129,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67104
67129
|
}
|
|
67105
67130
|
getDataValidationRangeValues(sheetId, criterion) {
|
|
67106
67131
|
const range = this.getters.getRangeFromSheetXC(sheetId, String(criterion.values[0]));
|
|
67107
|
-
const
|
|
67108
|
-
|
|
67132
|
+
const values = [];
|
|
67133
|
+
const labelsSet = new Set();
|
|
67134
|
+
for (const p of positions(range.zone)) {
|
|
67135
|
+
const cell = this.getters.getEvaluatedCell({ ...p, sheetId: range.sheetId });
|
|
67136
|
+
if (cell.formattedValue && !labelsSet.has(cell.formattedValue)) {
|
|
67137
|
+
labelsSet.add(cell.formattedValue);
|
|
67138
|
+
values.push({ label: cell.formattedValue, value: cell.value?.toString() || "" });
|
|
67139
|
+
}
|
|
67140
|
+
}
|
|
67141
|
+
return values;
|
|
67109
67142
|
}
|
|
67110
67143
|
isCellValidCheckbox(cellPosition) {
|
|
67111
67144
|
if (!this.getters.isMainCellPosition(cellPosition)) {
|
|
@@ -75727,25 +75760,30 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75727
75760
|
}
|
|
75728
75761
|
const sheetId = this.composer.currentEditedCell.sheetId;
|
|
75729
75762
|
const values = rule.criterion.type === "isValueInRange"
|
|
75730
|
-
?
|
|
75731
|
-
: rule.criterion.values;
|
|
75763
|
+
? this.getters.getDataValidationRangeValues(sheetId, rule.criterion)
|
|
75764
|
+
: rule.criterion.values.map((value) => ({ label: value, value }));
|
|
75732
75765
|
const isChip = rule.criterion.displayStyle === "chip";
|
|
75733
75766
|
if (!isChip) {
|
|
75734
|
-
return values.map((value) => ({
|
|
75767
|
+
return values.map((value) => ({
|
|
75768
|
+
text: value.value,
|
|
75769
|
+
fuzzySearchKey: value.label,
|
|
75770
|
+
htmlContent: [{ value: value.label }],
|
|
75771
|
+
}));
|
|
75735
75772
|
}
|
|
75736
75773
|
const colors = rule.criterion.colors;
|
|
75737
75774
|
return values.map((value) => {
|
|
75738
|
-
const color = colors?.[value];
|
|
75775
|
+
const color = colors?.[value.value];
|
|
75739
75776
|
return {
|
|
75740
|
-
text: value,
|
|
75777
|
+
text: value.value,
|
|
75741
75778
|
htmlContent: [
|
|
75742
75779
|
{
|
|
75743
|
-
value,
|
|
75780
|
+
value: value.label,
|
|
75744
75781
|
color: color ? chipTextColor(color) : undefined,
|
|
75745
75782
|
backgroundColor: color || GRAY_200,
|
|
75746
75783
|
classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"],
|
|
75747
75784
|
},
|
|
75748
75785
|
],
|
|
75786
|
+
fuzzySearchKey: value.label,
|
|
75749
75787
|
};
|
|
75750
75788
|
});
|
|
75751
75789
|
},
|
|
@@ -84719,6 +84757,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84719
84757
|
WaterfallChartDesignPanel,
|
|
84720
84758
|
ComboChartDesignPanel,
|
|
84721
84759
|
FunnelChartDesignPanel,
|
|
84760
|
+
SunburstChartDesignPanel,
|
|
84761
|
+
TreeMapChartDesignPanel,
|
|
84722
84762
|
ChartTypePicker,
|
|
84723
84763
|
FigureComponent,
|
|
84724
84764
|
MenuPopover,
|
|
@@ -84748,6 +84788,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84748
84788
|
};
|
|
84749
84789
|
const stores = {
|
|
84750
84790
|
useStoreProvider,
|
|
84791
|
+
ChartDashboardMenuStore,
|
|
84751
84792
|
DependencyContainer,
|
|
84752
84793
|
CellPopoverStore,
|
|
84753
84794
|
ComposerFocusStore,
|
|
@@ -84834,9 +84875,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84834
84875
|
exports.tokenize = tokenize;
|
|
84835
84876
|
|
|
84836
84877
|
|
|
84837
|
-
__info__.version = "18.5.0-alpha.
|
|
84838
|
-
__info__.date = "2025-07-
|
|
84839
|
-
__info__.hash = "
|
|
84878
|
+
__info__.version = "18.5.0-alpha.4";
|
|
84879
|
+
__info__.date = "2025-07-30T11:23:18.805Z";
|
|
84880
|
+
__info__.hash = "34a4ab3";
|
|
84840
84881
|
|
|
84841
84882
|
|
|
84842
84883
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|