@odoo/o-spreadsheet 19.5.0-alpha.13 → 19.5.0-alpha.14
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 +352 -311
- package/dist/o_spreadsheet.css +15 -4
- package/dist/o_spreadsheet.esm.js +352 -311
- package/dist/o_spreadsheet.iife.js +352 -311
- package/dist/o_spreadsheet.min.iife.js +299 -299
- package/dist/o_spreadsheet.xml +16 -10
- package/dist/types/components/figures/figure_container/figure_container.d.ts +6 -2
- package/dist/types/components/helpers/figure_drag_helper.d.ts +3 -3
- package/dist/types/components/helpers/figure_snap_helper.d.ts +8 -3
- package/dist/types/components/link/link_editor/link_editor.d.ts +1 -0
- package/dist/types/components/side_panel/carousel_panel/carousel_panel.d.ts +1 -1
- package/dist/types/components/side_panel/chart/chart_type_picker_popover/chart_type_picker_popover.d.ts +12 -12
- package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +1 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace_store.d.ts +2 -1
- package/dist/types/components/side_panel/table_style_editor_panel/table_style_editor_panel.d.ts +2 -0
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/helpers/color_themes.d.ts +2 -0
- package/dist/types/helpers/figures/chart.d.ts +2 -1
- package/dist/types/helpers/figures/charts/chart_common.d.ts +2 -2
- package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +3 -3
- package/dist/types/helpers/figures/charts/runtime/chart_data_extractor.d.ts +11 -10
- package/dist/types/helpers/owl3_helpers.d.ts +4 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/owl3_compatibility_layer.d.ts +1 -14
- package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +6 -5
- package/dist/types/plugins/ui_feature/chart_ui.d.ts +6 -0
- package/dist/types/plugins/ui_feature/color_theme.d.ts +0 -3
- package/dist/types/registries/chart_registry.d.ts +2 -2
- package/dist/types/registries/figures_registry.d.ts +1 -1
- package/dist/types/types/commands.d.ts +15 -15
- package/dist/types/types/getters.d.ts +2 -1
- package/dist/types/types/model.d.ts +2 -1
- package/dist/types/types/rendering.d.ts +2 -0
- package/package.json +2 -2
package/dist/o_spreadsheet.cjs
CHANGED
|
@@ -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 19.5.0-alpha.
|
|
6
|
-
* @date 2026-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.5.0-alpha.14
|
|
6
|
+
* @date 2026-08-29T09:17:09.184Z
|
|
7
|
+
* @hash e8ad6ad
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
@@ -2638,7 +2638,6 @@ function unregisterChartJsExtensions() {
|
|
|
2638
2638
|
*
|
|
2639
2639
|
* 1. Update template directives:
|
|
2640
2640
|
* - replace `t-portal` → `t-custom-portal`
|
|
2641
|
-
* - replace `t-model` → `t-custom-model`
|
|
2642
2641
|
*
|
|
2643
2642
|
* 2. Load this file immediately after Owl 3.
|
|
2644
2643
|
*
|
|
@@ -2653,35 +2652,23 @@ function unregisterChartJsExtensions() {
|
|
|
2653
2652
|
* Gradually remove the compatibility layer by migrating to native Owl 3:
|
|
2654
2653
|
*
|
|
2655
2654
|
* - replace `t-custom-portal` with proper Owl 3 portal usage
|
|
2656
|
-
* - replace `t-custom-model` with `t-model` + signals
|
|
2657
2655
|
* - convert `useLayoutEffect` back to `useEffect` where appropriate
|
|
2658
2656
|
*
|
|
2659
2657
|
* The end goal is to eliminate all compatibility shims.
|
|
2660
2658
|
*/
|
|
2661
|
-
const { __ODOO_COMPATIBILITY_LAYER_ADDED__, blockDom: blockDom$1, config, onMounted: onMounted$26, onPatched: onPatched$5, onWillUnmount: onWillUnmount$20, App: OwlApp, Component: OwlComponent, EnvPlugin: OwlEnvPlugin,
|
|
2659
|
+
const { __ODOO_COMPATIBILITY_LAYER_ADDED__, blockDom: blockDom$1, config, onMounted: onMounted$26, onPatched: onPatched$5, onWillUnmount: onWillUnmount$20, App: OwlApp, Component: OwlComponent, EnvPlugin: OwlEnvPlugin, useComponent: OwlUseComponent, useEnv: OwlUseEnv, useLayoutEffect: OwlUseLayoutEffect, useSubEnv: OwlUseSubEnv, Plugin, usePlugin, useProps: useProps$171, providePlugins, useScope, xml: xml$5 } = _odoo_owl;
|
|
2662
2660
|
const isOdooCompatLoaded = __ODOO_COMPATIBILITY_LAYER_ADDED__ === true;
|
|
2663
2661
|
var _Component = class extends OwlComponent {
|
|
2664
|
-
static template = "";
|
|
2665
2662
|
env;
|
|
2666
2663
|
constructor(node) {
|
|
2667
2664
|
super(node);
|
|
2668
|
-
this.env =
|
|
2669
|
-
this.__owl__ = node;
|
|
2665
|
+
this.env = _useEnv();
|
|
2670
2666
|
}
|
|
2671
2667
|
setup() {}
|
|
2672
|
-
render(deep = false) {
|
|
2673
|
-
this.__owl__.render(deep === true);
|
|
2674
|
-
}
|
|
2675
2668
|
};
|
|
2676
2669
|
function _useComponent() {
|
|
2677
2670
|
return useScope().component;
|
|
2678
2671
|
}
|
|
2679
|
-
function _useExternalListener(target, eventName, handler, eventParams) {
|
|
2680
|
-
const node = useScope();
|
|
2681
|
-
const boundHandler = handler.bind(node.component);
|
|
2682
|
-
onMounted$26(() => target.addEventListener(eventName, boundHandler, eventParams));
|
|
2683
|
-
onWillUnmount$20(() => target.removeEventListener(eventName, boundHandler, eventParams));
|
|
2684
|
-
}
|
|
2685
2672
|
function onWillRender(cb) {
|
|
2686
2673
|
const node = useScope();
|
|
2687
2674
|
const renderFn = node.renderFn;
|
|
@@ -2719,27 +2706,14 @@ var _EnvPlugin = class extends Plugin {
|
|
|
2719
2706
|
env = config("env") ?? {};
|
|
2720
2707
|
};
|
|
2721
2708
|
function _useEnv() {
|
|
2722
|
-
return
|
|
2723
|
-
}
|
|
2724
|
-
function provideEnv(env) {
|
|
2725
|
-
providePlugins([_EnvPlugin], { env });
|
|
2726
|
-
return env;
|
|
2727
|
-
}
|
|
2728
|
-
function extendEnv(extension) {
|
|
2729
|
-
const env = useChildEnv();
|
|
2730
|
-
const subEnv = Object.create(env);
|
|
2731
|
-
Object.defineProperties(subEnv, Object.getOwnPropertyDescriptors(extension));
|
|
2732
|
-
return provideEnv(subEnv);
|
|
2709
|
+
return usePlugin(_EnvPlugin).env;
|
|
2733
2710
|
}
|
|
2734
2711
|
function _useSubEnv(extension) {
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
}
|
|
2741
|
-
function _useChildEnv() {
|
|
2742
|
-
return plugin(_EnvPlugin).env;
|
|
2712
|
+
const subEnv = Object.create(_useEnv());
|
|
2713
|
+
Object.defineProperties(subEnv, Object.getOwnPropertyDescriptors(extension));
|
|
2714
|
+
providePlugins([_EnvPlugin], { env: subEnv });
|
|
2715
|
+
const component = _useComponent();
|
|
2716
|
+
component.env = subEnv;
|
|
2743
2717
|
}
|
|
2744
2718
|
var VPortal = class extends blockDom$1.text("").constructor {
|
|
2745
2719
|
/**
|
|
@@ -2788,7 +2762,7 @@ var Portal = class extends OwlComponent {
|
|
|
2788
2762
|
static template = xml$5`<t t-call-slot="default"/>`;
|
|
2789
2763
|
constructor(node) {
|
|
2790
2764
|
super(node);
|
|
2791
|
-
this.props =
|
|
2765
|
+
this.props = useProps$171();
|
|
2792
2766
|
this.__owl__ = node;
|
|
2793
2767
|
}
|
|
2794
2768
|
setup() {
|
|
@@ -2821,18 +2795,6 @@ const customDirectives = {
|
|
|
2821
2795
|
/**
|
|
2822
2796
|
* @param {HTMLElement} node
|
|
2823
2797
|
* @param {string} value
|
|
2824
|
-
* @param {string[]} modifiers
|
|
2825
|
-
*/
|
|
2826
|
-
model: (node, value, modifiers) => {
|
|
2827
|
-
let attribute = "t-model";
|
|
2828
|
-
for (const modifier of modifiers) attribute += `.${modifier}`;
|
|
2829
|
-
const getter = `() => ${value}`;
|
|
2830
|
-
const setter = `(nv) => {${value} = nv;}`;
|
|
2831
|
-
node.setAttribute(attribute, `__globals__.createModelSignal(${getter}, ${setter})`);
|
|
2832
|
-
},
|
|
2833
|
-
/**
|
|
2834
|
-
* @param {HTMLElement} node
|
|
2835
|
-
* @param {string} value
|
|
2836
2798
|
*/
|
|
2837
2799
|
portal: (node, value) => {
|
|
2838
2800
|
if (node.nodeName.toLowerCase() !== "t") throw new Error("t-custom-portal should be on a 't' element");
|
|
@@ -2861,11 +2823,6 @@ set(value) {
|
|
|
2861
2823
|
refInfo.values[refId] = value;
|
|
2862
2824
|
} };
|
|
2863
2825
|
},
|
|
2864
|
-
/**
|
|
2865
|
-
* @param {Function} getter
|
|
2866
|
-
* @param {Function} setter
|
|
2867
|
-
*/
|
|
2868
|
-
createModelSignal: (getter, setter) => Object.assign(getter, { set: setter }),
|
|
2869
2826
|
Portal
|
|
2870
2827
|
};
|
|
2871
2828
|
var _App = class extends OwlApp {
|
|
@@ -2891,7 +2848,7 @@ var _App = class extends OwlApp {
|
|
|
2891
2848
|
createRoot(component, config = {}) {
|
|
2892
2849
|
if (config.env) component = { [component.name]: class extends component {
|
|
2893
2850
|
constructor(node) {
|
|
2894
|
-
|
|
2851
|
+
providePlugins([_EnvPlugin], { env: config.env });
|
|
2895
2852
|
super(node);
|
|
2896
2853
|
}
|
|
2897
2854
|
} }[component.name];
|
|
@@ -2900,13 +2857,10 @@ var _App = class extends OwlApp {
|
|
|
2900
2857
|
};
|
|
2901
2858
|
const Component = isOdooCompatLoaded ? OwlComponent : _Component;
|
|
2902
2859
|
const useComponent = isOdooCompatLoaded ? OwlUseComponent : _useComponent;
|
|
2903
|
-
const useExternalListener = isOdooCompatLoaded ? OwlUseExternalListener : _useExternalListener;
|
|
2904
2860
|
const useLayoutEffect = isOdooCompatLoaded ? OwlUseLayoutEffect : _useLayoutEffect;
|
|
2905
2861
|
const EnvPlugin = isOdooCompatLoaded ? OwlEnvPlugin : _EnvPlugin;
|
|
2906
2862
|
const useEnv = isOdooCompatLoaded ? OwlUseEnv : _useEnv;
|
|
2907
2863
|
const useSubEnv = isOdooCompatLoaded ? OwlUseSubEnv : _useSubEnv;
|
|
2908
|
-
const useChildEnv = isOdooCompatLoaded ? OwlUseChildEnv : _useChildEnv;
|
|
2909
|
-
const useChildSubEnv = isOdooCompatLoaded ? OwlUseChildSubEnv : _useChildSubEnv;
|
|
2910
2864
|
const App$1 = isOdooCompatLoaded ? OwlApp : _App;
|
|
2911
2865
|
|
|
2912
2866
|
//#endregion
|
|
@@ -7950,7 +7904,8 @@ const readonlyAllowedCommands = /* @__PURE__ */ new Set([
|
|
|
7950
7904
|
"UPDATE_CHART",
|
|
7951
7905
|
"UPDATE_CHART_REGION",
|
|
7952
7906
|
"UPDATE_CAROUSEL_ACTIVE_ITEM",
|
|
7953
|
-
"UPDATE_PIVOT"
|
|
7907
|
+
"UPDATE_PIVOT",
|
|
7908
|
+
"UPDATE_COLOR_SCHEME"
|
|
7954
7909
|
]);
|
|
7955
7910
|
const lockedSheetAllowedCommands = /* @__PURE__ */ new Set([
|
|
7956
7911
|
"LOCK_SHEET",
|
|
@@ -9994,6 +9949,46 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
9994
9949
|
];
|
|
9995
9950
|
const CONTENT_TYPES_FILE = "[Content_Types].xml";
|
|
9996
9951
|
|
|
9952
|
+
//#endregion
|
|
9953
|
+
//#region src/helpers/color_themes.ts
|
|
9954
|
+
const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
9955
|
+
const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
9956
|
+
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
9957
|
+
const TEXT_HEADER_COLOR = "#666666";
|
|
9958
|
+
const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
9959
|
+
const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
9960
|
+
const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
9961
|
+
const COLOR_THEMES = {
|
|
9962
|
+
light: {
|
|
9963
|
+
colorThemeName: "light",
|
|
9964
|
+
backgroundColor: "#FFFFFF",
|
|
9965
|
+
gridBorderColor: "#CECFCF",
|
|
9966
|
+
headerBackgroundColor: BACKGROUND_HEADER_COLOR,
|
|
9967
|
+
headerActiveBackgroundColor: BACKGROUND_HEADER_ACTIVE_COLOR,
|
|
9968
|
+
headerSelectedBackgroundColor: BACKGROUND_HEADER_SELECTED_COLOR,
|
|
9969
|
+
headerTextColor: TEXT_HEADER_COLOR,
|
|
9970
|
+
headerBorderColor: HEADER_BORDER_COLOR,
|
|
9971
|
+
frozenPaneBorderColor: FROZEN_PANE_BORDER_COLOR,
|
|
9972
|
+
frozenPaneHeaderBorderColor: FROZEN_PANE_HEADER_BORDER_COLOR,
|
|
9973
|
+
singleCellSelectionBackgroundColor: "#F3F7FE",
|
|
9974
|
+
multipleCellsSelectionBackgroundColor: "#E9F0FF"
|
|
9975
|
+
},
|
|
9976
|
+
dark: {
|
|
9977
|
+
colorThemeName: "dark",
|
|
9978
|
+
backgroundColor: adaptForDarkMode("#1A1C2E"),
|
|
9979
|
+
gridBorderColor: adaptForDarkMode("#6B706F"),
|
|
9980
|
+
headerBackgroundColor: adaptForDarkMode("#262A36"),
|
|
9981
|
+
headerActiveBackgroundColor: adaptForDarkMode("#3A4052"),
|
|
9982
|
+
headerSelectedBackgroundColor: adaptForDarkMode("#4E566E"),
|
|
9983
|
+
headerTextColor: adaptForDarkMode("#A1A6B3"),
|
|
9984
|
+
headerBorderColor: adaptForDarkMode("#7A7F91"),
|
|
9985
|
+
frozenPaneBorderColor: adaptForDarkMode("#7A7F91"),
|
|
9986
|
+
frozenPaneHeaderBorderColor: adaptForDarkMode("#9FA5BD"),
|
|
9987
|
+
singleCellSelectionBackgroundColor: adaptForDarkMode("#696E8044"),
|
|
9988
|
+
multipleCellsSelectionBackgroundColor: adaptForDarkMode("#828AA044")
|
|
9989
|
+
}
|
|
9990
|
+
};
|
|
9991
|
+
|
|
9997
9992
|
//#endregion
|
|
9998
9993
|
//#region src/helpers/figures/charts/chart_common.ts
|
|
9999
9994
|
const TREND_LINE_XAXIS_ID = "x1";
|
|
@@ -10215,9 +10210,8 @@ function truncateLabel(label, maxLen = 20) {
|
|
|
10215
10210
|
function isTrendLineAxis(axisID) {
|
|
10216
10211
|
return axisID === "x1" || axisID === "xMovingAverage";
|
|
10217
10212
|
}
|
|
10218
|
-
function getChartBackgroundColor({ background },
|
|
10219
|
-
|
|
10220
|
-
if (!background) return defaultColor;
|
|
10213
|
+
function getChartBackgroundColor({ background }, colorThemeName) {
|
|
10214
|
+
if (!background) return COLOR_THEMES[colorThemeName].backgroundColor;
|
|
10221
10215
|
return background;
|
|
10222
10216
|
}
|
|
10223
10217
|
|
|
@@ -12314,14 +12308,14 @@ const ScorecardChart$1 = {
|
|
|
12314
12308
|
if (definition.baseline && isFormula(definition.baseline)) formulas.push(CompiledFormula.Compile(definition.baseline, sheetId, getters));
|
|
12315
12309
|
return formulas;
|
|
12316
12310
|
},
|
|
12317
|
-
getRuntime(getters, definition, _dataExtractor, sheetId) {
|
|
12311
|
+
getRuntime(getters, definition, _dataExtractor, sheetId, eventHandlers, colorThemeName) {
|
|
12318
12312
|
let formattedKeyValue = "";
|
|
12319
12313
|
const { scalar: keyValue, range: keyValueRange } = getData$1(definition.keyValue, getters, sheetId);
|
|
12320
12314
|
const locale = getters.getLocale();
|
|
12321
12315
|
if (keyValue !== null && keyValue !== void 0) formattedKeyValue = getKeyValueText(keyValue, definition.humanize ?? true, locale);
|
|
12322
12316
|
else formattedKeyValue = "";
|
|
12323
12317
|
const { scalar: baseline, range: baselineRange } = getData$1(definition.baseline, getters, sheetId);
|
|
12324
|
-
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, keyValueRange);
|
|
12318
|
+
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, keyValueRange, colorThemeName);
|
|
12325
12319
|
const baselineDisplay = getBaselineText(baseline, keyValue, definition.baselineMode, definition.humanize ?? true, locale);
|
|
12326
12320
|
const baselineValue = definition.baselineMode === "progress" && isNumber(baselineDisplay, locale) ? toNumber(baselineDisplay, locale) : 0;
|
|
12327
12321
|
const title = definition.title;
|
|
@@ -14561,22 +14555,35 @@ function sampleIndices(length, maxPoints) {
|
|
|
14561
14555
|
const step = length / maxPoints;
|
|
14562
14556
|
return Array.from({ length: maxPoints }, (_, i) => Math.min(length - 1, Math.floor(i * step)));
|
|
14563
14557
|
}
|
|
14564
|
-
async function chartToImageUrl(runtime, figure, type) {
|
|
14558
|
+
async function chartToImageUrl(runtime, figure, type, colorThemeName = "light") {
|
|
14565
14559
|
try {
|
|
14566
14560
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14567
14561
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14568
|
-
const imageUrl = await canvasToObjectUrl(canvas);
|
|
14562
|
+
const imageUrl = await canvasToObjectUrl(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14569
14563
|
cleanup();
|
|
14570
14564
|
return imageUrl;
|
|
14571
14565
|
} catch (error) {
|
|
14572
14566
|
console.log("Error exporting chart to image URL: " + error.message);
|
|
14573
14567
|
}
|
|
14574
14568
|
}
|
|
14575
|
-
|
|
14569
|
+
/**
|
|
14570
|
+
* Charts are drawn with pre-inverted colors (see `adaptForDarkMode`) because they are displayed
|
|
14571
|
+
* through the `os-theme-dependant` CSS filter. An exported image doesn't get that filter, so it
|
|
14572
|
+
* has to be applied to the pixels to obtain what is actually displayed on screen.
|
|
14573
|
+
*/
|
|
14574
|
+
function applyDarkMode(canvas) {
|
|
14575
|
+
const filtered = createRenderingSurface(canvas.width, canvas.height);
|
|
14576
|
+
const ctx = filtered.getContext("2d");
|
|
14577
|
+
if (!ctx || !("filter" in ctx)) return canvas;
|
|
14578
|
+
ctx.filter = DARK_MODE_FILTER_STRING;
|
|
14579
|
+
ctx.drawImage(canvas, 0, 0);
|
|
14580
|
+
return filtered;
|
|
14581
|
+
}
|
|
14582
|
+
async function chartToImageFile(runtime, figure, type, colorThemeName = "light") {
|
|
14576
14583
|
try {
|
|
14577
14584
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14578
14585
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14579
|
-
const chartBlob = await canvasToBlob(canvas);
|
|
14586
|
+
const chartBlob = await canvasToBlob(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14580
14587
|
cleanup();
|
|
14581
14588
|
return chartBlob;
|
|
14582
14589
|
} catch (error) {
|
|
@@ -14884,7 +14891,7 @@ function getCopyAsImageMenuItem(figureId, env) {
|
|
|
14884
14891
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14885
14892
|
if (!chartId) return;
|
|
14886
14893
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14887
|
-
const blob = await chartToImageFile(env.model.getters.getChartRuntime(chartId), figure, chartType);
|
|
14894
|
+
const blob = await chartToImageFile(env.model.getters.getChartRuntime(chartId), figure, chartType, env.model.getters.getSpreadsheetTheme().colorThemeName);
|
|
14888
14895
|
if (!blob) return;
|
|
14889
14896
|
const image = await new Promise((resolve) => {
|
|
14890
14897
|
const reader = new FileReader();
|
|
@@ -14921,7 +14928,7 @@ function getDownloadChartMenuItem(figureId, env) {
|
|
|
14921
14928
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14922
14929
|
if (!chartId) return;
|
|
14923
14930
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14924
|
-
const url = await chartToImageUrl(env.model.getters.getChartRuntime(chartId), figure, chartType);
|
|
14931
|
+
const url = await chartToImageUrl(env.model.getters.getChartRuntime(chartId), figure, chartType, env.model.getters.getSpreadsheetTheme().colorThemeName);
|
|
14925
14932
|
if (!url) return;
|
|
14926
14933
|
downloadFile(url, "chart");
|
|
14927
14934
|
},
|
|
@@ -16470,8 +16477,8 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
16470
16477
|
useLayoutEffect(() => {
|
|
16471
16478
|
if (!this.props.disableKeyboardNavigation && !this.state.hoveredMenu && !this.subMenu.isOpen) this.menuRef()?.focus();
|
|
16472
16479
|
});
|
|
16473
|
-
|
|
16474
|
-
|
|
16480
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
16481
|
+
(0, _odoo_owl.useListener)(window, "contextmenu", this.onExternalClick.bind(this), { capture: true });
|
|
16475
16482
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
16476
16483
|
if (nextProps.menuItems !== this.props.menuItems) this.closeSubMenu();
|
|
16477
16484
|
});
|
|
@@ -20975,7 +20982,7 @@ var GridAddRowsFooter = class extends Component {
|
|
|
20975
20982
|
setup() {
|
|
20976
20983
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
20977
20984
|
this.viewStore = useStore(ViewportsStore);
|
|
20978
|
-
|
|
20985
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
20979
20986
|
}
|
|
20980
20987
|
get addRowsPosition() {
|
|
20981
20988
|
const { scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
@@ -21506,7 +21513,7 @@ function useCellHovered(env, gridRef) {
|
|
|
21506
21513
|
(0, _odoo_owl.useListener)(gridRef, "mouseenter", resume);
|
|
21507
21514
|
(0, _odoo_owl.useListener)(gridRef, "pointerdown", recompute);
|
|
21508
21515
|
(0, _odoo_owl.useListener)(gridRef, "pointerdown", (ev) => env.isMobile() && updateMousePosition(withZoom(env, ev)));
|
|
21509
|
-
|
|
21516
|
+
(0, _odoo_owl.useListener)(window, "click", handleGlobalClick);
|
|
21510
21517
|
function handleGlobalClick(e) {
|
|
21511
21518
|
const target = e.target;
|
|
21512
21519
|
const grid = gridRef();
|
|
@@ -23510,7 +23517,7 @@ var Select = class extends Component {
|
|
|
23510
23517
|
hoveredValue: void 0
|
|
23511
23518
|
});
|
|
23512
23519
|
setup() {
|
|
23513
|
-
|
|
23520
|
+
(0, _odoo_owl.useListener)(window, "pointerdown", this.onExternalClick.bind(this), { capture: true });
|
|
23514
23521
|
useLayoutEffect(() => {
|
|
23515
23522
|
const el = this.dropdownRef();
|
|
23516
23523
|
if (el) el.style.width = `${this.selectRef()?.offsetWidth}px`;
|
|
@@ -23612,7 +23619,7 @@ var InfoPopover = class extends Component {
|
|
|
23612
23619
|
});
|
|
23613
23620
|
static components = { Popover };
|
|
23614
23621
|
setup() {
|
|
23615
|
-
|
|
23622
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
23616
23623
|
}
|
|
23617
23624
|
infoRef = _odoo_owl.signal.ref();
|
|
23618
23625
|
get popoverProps() {
|
|
@@ -24022,6 +24029,7 @@ figureRegistry.add("chart", {
|
|
|
24022
24029
|
Component: ChartFigure,
|
|
24023
24030
|
SidePanelComponent: "ChartPanel",
|
|
24024
24031
|
menuBuilder: getChartMenuActions,
|
|
24032
|
+
minFigSize: 80,
|
|
24025
24033
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24026
24034
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24027
24035
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24040,6 +24048,7 @@ figureRegistry.add("image", {
|
|
|
24040
24048
|
figureRegistry.add("carousel", {
|
|
24041
24049
|
Component: CarouselFigure,
|
|
24042
24050
|
menuBuilder: getCarouselMenuActions,
|
|
24051
|
+
minFigSize: 80,
|
|
24043
24052
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24044
24053
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24045
24054
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24172,7 +24181,7 @@ var FigureComponent = class extends Component {
|
|
|
24172
24181
|
...this.positionInBoundary(sheetId, this.env.model.getters.getFigureUI(sheetId, figure), ev.key, ev.shiftKey)
|
|
24173
24182
|
});
|
|
24174
24183
|
}
|
|
24175
|
-
this.env.model.dispatch("
|
|
24184
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures });
|
|
24176
24185
|
ev.preventDefault();
|
|
24177
24186
|
ev.stopPropagation();
|
|
24178
24187
|
break;
|
|
@@ -30917,7 +30926,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30917
30926
|
getFormulas(getters) {
|
|
30918
30927
|
return this.chartTypeBuilder.getFormulas(getters, this.sheetId, this.definition);
|
|
30919
30928
|
}
|
|
30920
|
-
getRuntime(getters, chartId) {
|
|
30929
|
+
getRuntime(getters, chartId, colorThemeName) {
|
|
30921
30930
|
const dataSource = this.dataSource;
|
|
30922
30931
|
const dataExtractors = dataSource ? {
|
|
30923
30932
|
extractData: () => this.dataSourceBuilder.extractData(dataSource, chartId, getters),
|
|
@@ -30937,7 +30946,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30937
30946
|
return this.dataSourceBuilder.onDataSetClick?.(this.definition.type, chartId, event, items, chartJsChart, getters);
|
|
30938
30947
|
},
|
|
30939
30948
|
onHover: (event, items, chartJsChart) => this.dataSourceBuilder.onDataSetHover?.(this.definition.type, chartId, event, items, chartJsChart)
|
|
30940
|
-
});
|
|
30949
|
+
}, colorThemeName);
|
|
30941
30950
|
}
|
|
30942
30951
|
static deleteInvalidKeys(definition) {
|
|
30943
30952
|
definition = { ...definition };
|
|
@@ -32200,7 +32209,7 @@ var NumberEditor = class extends Component {
|
|
|
32200
32209
|
DOMFocusableElementStore;
|
|
32201
32210
|
setup() {
|
|
32202
32211
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
32203
|
-
|
|
32212
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
32204
32213
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
32205
32214
|
const input = this.inputRef();
|
|
32206
32215
|
if (input && document.activeElement !== input) input.value = nextProps.currentValue;
|
|
@@ -32301,7 +32310,7 @@ var TextStyler = class extends Component {
|
|
|
32301
32310
|
});
|
|
32302
32311
|
openedEl = null;
|
|
32303
32312
|
setup() {
|
|
32304
|
-
|
|
32313
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this));
|
|
32305
32314
|
}
|
|
32306
32315
|
state = (0, _odoo_owl.proxy)({ activeTool: "" });
|
|
32307
32316
|
updateFontSize(fontSize) {
|
|
@@ -33395,7 +33404,7 @@ var RoundColorPicker = class extends Component {
|
|
|
33395
33404
|
state;
|
|
33396
33405
|
setup() {
|
|
33397
33406
|
this.state = (0, _odoo_owl.proxy)({ pickerOpened: false });
|
|
33398
|
-
|
|
33407
|
+
(0, _odoo_owl.useListener)(window, "click", this.closePicker.bind(this));
|
|
33399
33408
|
}
|
|
33400
33409
|
closePicker() {
|
|
33401
33410
|
this.state.pickerOpened = false;
|
|
@@ -34018,7 +34027,7 @@ function toXlsxHexColor(color) {
|
|
|
34018
34027
|
//#region src/helpers/figures/charts/runtime/chart_data_extractor.ts
|
|
34019
34028
|
const EMPTY$1 = Object.freeze({ value: null });
|
|
34020
34029
|
const ZERO = Object.freeze({ value: 0 });
|
|
34021
|
-
function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34030
|
+
function getBarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34022
34031
|
const locale = getters.getLocale();
|
|
34023
34032
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34024
34033
|
format,
|
|
@@ -34050,7 +34059,7 @@ function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34050
34059
|
labels,
|
|
34051
34060
|
locale: getters.getLocale(),
|
|
34052
34061
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34053
|
-
background: getChartBackgroundColor(definition,
|
|
34062
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34054
34063
|
};
|
|
34055
34064
|
}
|
|
34056
34065
|
function getDateTimeLabel(value, stamp) {
|
|
@@ -34109,7 +34118,7 @@ function computeValuesAndLabels(timeValues, values, horizontalGroupBy, verticalG
|
|
|
34109
34118
|
labels: xValues.map((v) => ({ value: getDateTimeLabel(v, horizontalGroupBy) }))
|
|
34110
34119
|
};
|
|
34111
34120
|
}
|
|
34112
|
-
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34121
|
+
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34113
34122
|
let labels = labelValues;
|
|
34114
34123
|
const locale = getters.getLocale();
|
|
34115
34124
|
const countEntries = dataSetsValues.length === 0;
|
|
@@ -34122,14 +34131,14 @@ function getCalendarChartData(definition, { labelValues, dataSetsValues }, gette
|
|
|
34122
34131
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34123
34132
|
locale: getters.getLocale(),
|
|
34124
34133
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34125
|
-
background: getChartBackgroundColor(definition,
|
|
34134
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34126
34135
|
};
|
|
34127
34136
|
}
|
|
34128
|
-
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34137
|
+
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34129
34138
|
const barChartData = getBarChartData(definition, {
|
|
34130
34139
|
labelValues,
|
|
34131
34140
|
dataSetsValues: dataSetsValues.slice(0, 2)
|
|
34132
|
-
}, getters);
|
|
34141
|
+
}, getters, colorThemeName);
|
|
34133
34142
|
const barDataset = barChartData.dataSetsValues.filter((ds) => !ds.hidden);
|
|
34134
34143
|
const pyramidDatasetValues = [];
|
|
34135
34144
|
if (barDataset[0]) {
|
|
@@ -34151,7 +34160,7 @@ function getPyramidChartData(definition, { labelValues, dataSetsValues }, getter
|
|
|
34151
34160
|
dataSetsValues: pyramidDatasetValues
|
|
34152
34161
|
};
|
|
34153
34162
|
}
|
|
34154
|
-
function getLineChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34163
|
+
function getLineChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34155
34164
|
const axisType = getChartAxisType(definition, {
|
|
34156
34165
|
labelValues,
|
|
34157
34166
|
dataSetsValues
|
|
@@ -34187,10 +34196,10 @@ function getLineChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34187
34196
|
trendDataSetsValues,
|
|
34188
34197
|
axisType,
|
|
34189
34198
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34190
|
-
background: getChartBackgroundColor(definition,
|
|
34199
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34191
34200
|
};
|
|
34192
34201
|
}
|
|
34193
|
-
function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34202
|
+
function getPieChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34194
34203
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34195
34204
|
format,
|
|
34196
34205
|
locale: getters.getLocale()
|
|
@@ -34205,10 +34214,10 @@ function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34205
34214
|
labels,
|
|
34206
34215
|
locale: getters.getLocale(),
|
|
34207
34216
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34208
|
-
background: getChartBackgroundColor(definition,
|
|
34217
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34209
34218
|
};
|
|
34210
34219
|
}
|
|
34211
|
-
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34220
|
+
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34212
34221
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34213
34222
|
format,
|
|
34214
34223
|
locale: getters.getLocale()
|
|
@@ -34221,10 +34230,10 @@ function getRadarChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34221
34230
|
axisFormats,
|
|
34222
34231
|
labels,
|
|
34223
34232
|
locale: getters.getLocale(),
|
|
34224
|
-
background: getChartBackgroundColor(definition,
|
|
34233
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34225
34234
|
};
|
|
34226
34235
|
}
|
|
34227
|
-
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34236
|
+
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34228
34237
|
dataSetsValues = dataSetsValues.slice(0, 1);
|
|
34229
34238
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34230
34239
|
format,
|
|
@@ -34240,10 +34249,10 @@ function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34240
34249
|
availableRegions: getters.getGeoChartAvailableRegions(),
|
|
34241
34250
|
geoFeatureNameToId: getters.geoFeatureNameToId,
|
|
34242
34251
|
getGeoJsonFeatures: getters.getGeoJsonFeatures,
|
|
34243
|
-
background: getChartBackgroundColor(definition,
|
|
34252
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34244
34253
|
};
|
|
34245
34254
|
}
|
|
34246
|
-
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34255
|
+
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34247
34256
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34248
34257
|
format,
|
|
34249
34258
|
locale: getters.getLocale()
|
|
@@ -34257,10 +34266,10 @@ function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters
|
|
|
34257
34266
|
axisFormats: { x: format },
|
|
34258
34267
|
labels,
|
|
34259
34268
|
locale: getters.getLocale(),
|
|
34260
|
-
background: getChartBackgroundColor(definition,
|
|
34269
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34261
34270
|
};
|
|
34262
34271
|
}
|
|
34263
|
-
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34272
|
+
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34264
34273
|
let labels = labelValues;
|
|
34265
34274
|
({labels, dataSetsValues} = filterValuesWithDifferentSigns(labels, dataSetsValues));
|
|
34266
34275
|
({labels, dataSetsValues} = filterInvalidHierarchicalPoints(labels, dataSetsValues));
|
|
@@ -34269,12 +34278,12 @@ function getHierarchalChartData(definition, { labelValues, dataSetsValues }, get
|
|
|
34269
34278
|
axisFormats: { y: getChartLabelFormat(labels) },
|
|
34270
34279
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34271
34280
|
locale: getters.getLocale(),
|
|
34272
|
-
background: getChartBackgroundColor(definition,
|
|
34281
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34273
34282
|
};
|
|
34274
34283
|
}
|
|
34275
|
-
function getBubbleChartData(definition, getters) {
|
|
34284
|
+
function getBubbleChartData(definition, getters, colorThemeName) {
|
|
34276
34285
|
const chartData = getBubbleChartSourceData(definition, getters);
|
|
34277
|
-
const data = getLineChartData(definition, chartData, getters);
|
|
34286
|
+
const data = getLineChartData(definition, chartData, getters, colorThemeName);
|
|
34278
34287
|
let labelValues = definition.labelRange ? getters.getVisibleRangeValues(definition.labelRange) : [];
|
|
34279
34288
|
let sizeValues = definition.sizeRange ? getters.getVisibleRangeValues(definition.sizeRange) : [];
|
|
34280
34289
|
if (chartData.shouldRemoveFirstLabel) {
|
|
@@ -35276,9 +35285,9 @@ const templates = `
|
|
|
35276
35285
|
`;
|
|
35277
35286
|
let app;
|
|
35278
35287
|
function renderToString(templateName, context = {}) {
|
|
35279
|
-
return render(templateName, context).innerHTML;
|
|
35288
|
+
return render$1(templateName, context).innerHTML;
|
|
35280
35289
|
}
|
|
35281
|
-
function render(templateName, context = {}) {
|
|
35290
|
+
function render$1(templateName, context = {}) {
|
|
35282
35291
|
if (!app) app = new _odoo_owl.App({
|
|
35283
35292
|
templates,
|
|
35284
35293
|
translateFn: _t
|
|
@@ -35643,8 +35652,8 @@ const BarChart = {
|
|
|
35643
35652
|
verticalAxis: getDefinedAxis(definition)
|
|
35644
35653
|
};
|
|
35645
35654
|
},
|
|
35646
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
35647
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
35655
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
35656
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
35648
35657
|
return {
|
|
35649
35658
|
chartJsConfig: {
|
|
35650
35659
|
type: "bar",
|
|
@@ -35832,7 +35841,7 @@ const GaugeChart = {
|
|
|
35832
35841
|
definition.sectionRule.upperInflectionPoint.value
|
|
35833
35842
|
].filter((value) => value.startsWith("=")).map((formula) => CompiledFormula.Compile(formula, sheetId, getters));
|
|
35834
35843
|
},
|
|
35835
|
-
getRuntime(getters, definition, dataSource, sheetId) {
|
|
35844
|
+
getRuntime(getters, definition, dataSource, sheetId, eventHandlers, colorThemeName) {
|
|
35836
35845
|
const locale = getters.getLocale();
|
|
35837
35846
|
const chartColors = definition.sectionRule.colors;
|
|
35838
35847
|
let gaugeValue = void 0;
|
|
@@ -35853,7 +35862,7 @@ const GaugeChart = {
|
|
|
35853
35862
|
}
|
|
35854
35863
|
let minValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMin, getters);
|
|
35855
35864
|
let maxValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMax, getters);
|
|
35856
|
-
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters);
|
|
35865
|
+
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters, colorThemeName);
|
|
35857
35866
|
if (maxValue < minValue) [minValue, maxValue] = [maxValue, minValue];
|
|
35858
35867
|
const lowerPoint = definition.sectionRule.lowerInflectionPoint;
|
|
35859
35868
|
const upperPoint = definition.sectionRule.upperInflectionPoint;
|
|
@@ -35885,7 +35894,7 @@ const GaugeChart = {
|
|
|
35885
35894
|
}
|
|
35886
35895
|
colors.push(chartColors.upperColor);
|
|
35887
35896
|
return {
|
|
35888
|
-
background: getters.getStyleOfSingleCellChart(definition.background, dataRange).background,
|
|
35897
|
+
background: getters.getStyleOfSingleCellChart(definition.background, dataRange, colorThemeName).background,
|
|
35889
35898
|
title: {
|
|
35890
35899
|
...title,
|
|
35891
35900
|
text: title.text ? getters.dynamicTranslate(title.text) : ""
|
|
@@ -35919,9 +35928,9 @@ function getFormulaNumberValue(sheetId, formula, getters) {
|
|
|
35919
35928
|
const value = getters.evaluateFormula(sheetId, formula);
|
|
35920
35929
|
return isMultipleElementMatrix(value) ? void 0 : tryToNumber(toScalar(value), getters.getLocale());
|
|
35921
35930
|
}
|
|
35922
|
-
function getInvalidGaugeRuntime(definition, getters) {
|
|
35931
|
+
function getInvalidGaugeRuntime(definition, getters, colorThemeName) {
|
|
35923
35932
|
return {
|
|
35924
|
-
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange).background,
|
|
35933
|
+
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange, colorThemeName).background,
|
|
35925
35934
|
title: definition.title ?? { text: "" },
|
|
35926
35935
|
minValue: {
|
|
35927
35936
|
value: 0,
|
|
@@ -36015,8 +36024,8 @@ const LineChart = {
|
|
|
36015
36024
|
verticalAxis: getDefinedAxis(definition)
|
|
36016
36025
|
};
|
|
36017
36026
|
},
|
|
36018
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36019
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
36027
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36028
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
36020
36029
|
return {
|
|
36021
36030
|
chartJsConfig: {
|
|
36022
36031
|
type: "line",
|
|
@@ -36097,8 +36106,8 @@ const PieChart = {
|
|
|
36097
36106
|
labelRange
|
|
36098
36107
|
};
|
|
36099
36108
|
},
|
|
36100
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36101
|
-
const chartData = getPieChartData(definition, extractData(), getters);
|
|
36109
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36110
|
+
const chartData = getPieChartData(definition, extractData(), getters, colorThemeName);
|
|
36102
36111
|
return { chartJsConfig: {
|
|
36103
36112
|
type: definition.isDoughnut ? "doughnut" : "pie",
|
|
36104
36113
|
data: {
|
|
@@ -36174,8 +36183,8 @@ const WaterfallChart = {
|
|
|
36174
36183
|
};
|
|
36175
36184
|
},
|
|
36176
36185
|
getDefinitionForExcel: () => void 0,
|
|
36177
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36178
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
36186
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36187
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
36179
36188
|
const { labels, datasets } = getWaterfallDatasetAndLabels(definition, chartData);
|
|
36180
36189
|
return { chartJsConfig: {
|
|
36181
36190
|
type: "bar",
|
|
@@ -36942,7 +36951,7 @@ var CalendarChartConfigPanel = class extends GenericChartConfigPanel {
|
|
|
36942
36951
|
getGroupByOptions() {
|
|
36943
36952
|
const sheetId = this.env.model.getters.getFigureSheetId(this.env.model.getters.getFigureIdFromChartId(this.props.chartId));
|
|
36944
36953
|
const definition = SpreadsheetChart.fromStrDefinition(this.env.model.getters, sheetId, this.props.definition).getRangeDefinition();
|
|
36945
|
-
const labels = getBarChartData(definition, getChartData(this.env.model.getters, definition.dataSource), this.env.model.getters).labels.filter((l) => isDateTime(l, DEFAULT_LOCALE));
|
|
36954
|
+
const labels = getBarChartData(definition, getChartData(this.env.model.getters, definition.dataSource), this.env.model.getters, this.env.model.getters.getSpreadsheetTheme().colorThemeName).labels.filter((l) => isDateTime(l, DEFAULT_LOCALE));
|
|
36946
36955
|
if (labels.length === 0) return [];
|
|
36947
36956
|
const dates = labels.map((label) => toJsDate(label, this.env.model.getters.getLocale()));
|
|
36948
36957
|
const uniqueYears = /* @__PURE__ */ new Set();
|
|
@@ -37006,7 +37015,7 @@ var ColorScalePicker = class extends Component {
|
|
|
37006
37015
|
});
|
|
37007
37016
|
popoverRef = _odoo_owl.signal.ref(HTMLTableElement);
|
|
37008
37017
|
setup() {
|
|
37009
|
-
|
|
37018
|
+
(0, _odoo_owl.useListener)(window, "click", this.closePopover.bind(this));
|
|
37010
37019
|
}
|
|
37011
37020
|
get currentColorScale() {
|
|
37012
37021
|
return this.props.definition.colorScale || schemeToColorScale("oranges");
|
|
@@ -42025,7 +42034,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
42025
42034
|
useLayoutEffect((sheetId, isCfRemoved) => {
|
|
42026
42035
|
if (this.activeSheetId !== sheetId || isCfRemoved) this.env.replaceSidePanel("ConditionalFormatting", `ConditionalFormattingEditor_${this.props.cf.id}`);
|
|
42027
42036
|
}, () => [this.env.model.getters.getActiveSheetId(), this.isEditedCfRemoved]);
|
|
42028
|
-
|
|
42037
|
+
(0, _odoo_owl.useListener)(window, "click", () => this.store.closeMenus());
|
|
42029
42038
|
}
|
|
42030
42039
|
get isEditedCfRemoved() {
|
|
42031
42040
|
return !Boolean(this.env.model.getters.getConditionalFormats(this.activeSheetId).find((cf) => cf.id === this.props.cf.id));
|
|
@@ -42298,7 +42307,7 @@ function startChartDragAndDrop(env, definition, ev) {
|
|
|
42298
42307
|
canvas.className = "w-100 h-100";
|
|
42299
42308
|
container.appendChild(canvas);
|
|
42300
42309
|
spreadsheet.appendChild(container);
|
|
42301
|
-
destroyChart = drawChartOnCanvas(canvas, SpreadsheetChart.fromStrDefinition(getters, sheetId, definition).getRuntime(getters, "newChart"), {
|
|
42310
|
+
destroyChart = drawChartOnCanvas(canvas, SpreadsheetChart.fromStrDefinition(getters, sheetId, definition).getRuntime(getters, "newChart", getters.getSpreadsheetTheme().colorThemeName), {
|
|
42302
42311
|
width,
|
|
42303
42312
|
height
|
|
42304
42313
|
}, definition.type, zoom);
|
|
@@ -42379,7 +42388,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42379
42388
|
getChartConfiguration() {
|
|
42380
42389
|
const getters = this.env.model.getters;
|
|
42381
42390
|
const activeSheetId = getters.getActiveSheetId();
|
|
42382
|
-
const runtime = SpreadsheetChart.fromStrDefinition(getters, activeSheetId, this.props.definition).getRuntime(getters, "myChart");
|
|
42391
|
+
const runtime = SpreadsheetChart.fromStrDefinition(getters, activeSheetId, this.props.definition).getRuntime(getters, "myChart", getters.getSpreadsheetTheme().colorThemeName);
|
|
42383
42392
|
if (!("chartJsConfig" in runtime)) return null;
|
|
42384
42393
|
let config = runtime.chartJsConfig;
|
|
42385
42394
|
const existingScales = config.options?.scales ?? {};
|
|
@@ -42446,7 +42455,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42446
42455
|
const canvas = this.chartCanvasRef();
|
|
42447
42456
|
if (!canvas) return;
|
|
42448
42457
|
const getters = this.env.model.getters;
|
|
42449
|
-
let runtime = SpreadsheetChart.fromStrDefinition(getters, getters.getActiveSheetId(), this.props.definition).getRuntime(getters, "myChart");
|
|
42458
|
+
let runtime = SpreadsheetChart.fromStrDefinition(getters, getters.getActiveSheetId(), this.props.definition).getRuntime(getters, "myChart", getters.getSpreadsheetTheme().colorThemeName);
|
|
42450
42459
|
const { type } = this.props.definition;
|
|
42451
42460
|
if (type === "scorecard") {
|
|
42452
42461
|
const rect = canvas.getBoundingClientRect();
|
|
@@ -43928,6 +43937,7 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43928
43937
|
mutators = [
|
|
43929
43938
|
"updateSearchOptions",
|
|
43930
43939
|
"updateSearchContent",
|
|
43940
|
+
"updateReplaceContent",
|
|
43931
43941
|
"searchFormulas",
|
|
43932
43942
|
"selectPreviousMatch",
|
|
43933
43943
|
"selectNextMatch",
|
|
@@ -43980,6 +43990,9 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43980
43990
|
updateSearchContent(toSearch) {
|
|
43981
43991
|
this._updateSearch(toSearch, this.searchOptions);
|
|
43982
43992
|
}
|
|
43993
|
+
updateReplaceContent(toReplace) {
|
|
43994
|
+
this.toReplace = toReplace;
|
|
43995
|
+
}
|
|
43983
43996
|
updateSearchOptions(searchOptions) {
|
|
43984
43997
|
this._updateSearch(this.toSearch, {
|
|
43985
43998
|
...this.searchOptions,
|
|
@@ -44337,7 +44350,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44337
44350
|
get currentSheetMatchesCount() {
|
|
44338
44351
|
const { activeSheetMatchesCount: count, activeSheetHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44339
44352
|
const sheetName = this.env.model.getters.getSheetName(this.env.model.getters.getActiveSheetId());
|
|
44340
|
-
let label = count === 1 ? _t("1 match in %(sheetName)s", { sheetName }) : _t("%(count)s matches in %(sheetName)s", {
|
|
44353
|
+
let label = count === 1 ? _t("1 match in '%(sheetName)s'", { sheetName }) : _t("%(count)s matches in '%(sheetName)s'", {
|
|
44341
44354
|
count,
|
|
44342
44355
|
sheetName
|
|
44343
44356
|
});
|
|
@@ -44349,10 +44362,10 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44349
44362
|
if (!range) return "";
|
|
44350
44363
|
const { specificRangeMatchesCount: count, specificRangeHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44351
44364
|
const { sheetId, zone } = range;
|
|
44352
|
-
let label = count === 1 ? _t("1 match in range %(range)s of %(sheetName)s", {
|
|
44365
|
+
let label = count === 1 ? _t("1 match in range %(range)s of '%(sheetName)s'", {
|
|
44353
44366
|
range: zoneToXc(zone),
|
|
44354
44367
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
44355
|
-
}) : _t("%(count)s matches in range %(range)s of %(sheetName)s", {
|
|
44368
|
+
}) : _t("%(count)s matches in range %(range)s of '%(sheetName)s'", {
|
|
44356
44369
|
count,
|
|
44357
44370
|
range: zoneToXc(zone),
|
|
44358
44371
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
@@ -44380,7 +44393,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44380
44393
|
(0, _odoo_owl.onMounted)(() => this.searchInputRef()?.focus());
|
|
44381
44394
|
(0, _odoo_owl.onWillUnmount)(() => this.updateSearchContent.stopDebounce());
|
|
44382
44395
|
this.updateSearchContent = debounce(this.store.updateSearchContent, 200);
|
|
44383
|
-
|
|
44396
|
+
(0, _odoo_owl.useListener)(window, "keydown", (ev) => {
|
|
44384
44397
|
const code = keyboardEventToShortcutString(ev);
|
|
44385
44398
|
if (code === "Ctrl+F" || code === "Ctrl+H") {
|
|
44386
44399
|
this.searchInputRef()?.focus();
|
|
@@ -44395,6 +44408,9 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44395
44408
|
onSearchInput(ev) {
|
|
44396
44409
|
this.updateSearchContent(ev.target.value);
|
|
44397
44410
|
}
|
|
44411
|
+
onReplaceInput(ev) {
|
|
44412
|
+
this.store.updateReplaceContent(ev.target.value);
|
|
44413
|
+
}
|
|
44398
44414
|
onKeydownPanel(ev) {
|
|
44399
44415
|
if (ev.key === "Escape") {
|
|
44400
44416
|
ev.preventDefault();
|
|
@@ -45975,7 +45991,7 @@ var PivotFilterEditor = class extends Component {
|
|
|
45975
45991
|
buttonFilter = _odoo_owl.signal.ref();
|
|
45976
45992
|
popover;
|
|
45977
45993
|
setup() {
|
|
45978
|
-
|
|
45994
|
+
(0, _odoo_owl.useListener)(window, "click", (ev) => {
|
|
45979
45995
|
if (!isChildEvent(this.buttonFilter(), ev)) this.popover.isOpen = false;
|
|
45980
45996
|
});
|
|
45981
45997
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
@@ -46109,7 +46125,7 @@ var AddDimensionButton = class extends Component {
|
|
|
46109
46125
|
setup() {
|
|
46110
46126
|
this.autoComplete = useLocalStore(AutoCompleteStore);
|
|
46111
46127
|
this.autoComplete.useProvider(this.getProvider());
|
|
46112
|
-
|
|
46128
|
+
(0, _odoo_owl.useListener)(window, "click", (ev) => {
|
|
46113
46129
|
if (ev.target !== this.buttonRef()) this.popover.isOpen = false;
|
|
46114
46130
|
});
|
|
46115
46131
|
useAutofocus(this.autofocusRef);
|
|
@@ -48487,7 +48503,7 @@ var TableStylesPopover = class extends Component {
|
|
|
48487
48503
|
tableStyleListRef = _odoo_owl.signal.ref();
|
|
48488
48504
|
state = (0, _odoo_owl.proxy)({ selectedCategory: this.initialSelectedCategory });
|
|
48489
48505
|
setup() {
|
|
48490
|
-
|
|
48506
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
48491
48507
|
}
|
|
48492
48508
|
onExternalClick(ev) {
|
|
48493
48509
|
const el = this.tableStyleListRef();
|
|
@@ -49702,7 +49718,8 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49702
49718
|
static components = {
|
|
49703
49719
|
Section,
|
|
49704
49720
|
RoundColorPicker,
|
|
49705
|
-
TableStylePreview
|
|
49721
|
+
TableStylePreview,
|
|
49722
|
+
TextInput
|
|
49706
49723
|
};
|
|
49707
49724
|
props = (0, _odoo_owl.useProps)({
|
|
49708
49725
|
onCloseSidePanel: types.function(),
|
|
@@ -49711,7 +49728,7 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49711
49728
|
});
|
|
49712
49729
|
state = (0, _odoo_owl.proxy)(this.getInitialState());
|
|
49713
49730
|
setup() {
|
|
49714
|
-
|
|
49731
|
+
(0, _odoo_owl.useListener)(window, "click", () => this.state.pickerOpened = false);
|
|
49715
49732
|
}
|
|
49716
49733
|
getInitialState() {
|
|
49717
49734
|
const editedStyle = this.props.styleId ? this.env.model.getters.getTableStyle(this.props.styleId) : null;
|
|
@@ -53588,6 +53605,15 @@ var GridComposer = class extends Component {
|
|
|
53588
53605
|
}
|
|
53589
53606
|
};
|
|
53590
53607
|
|
|
53608
|
+
//#endregion
|
|
53609
|
+
//#region src/helpers/owl3_helpers.ts
|
|
53610
|
+
/**
|
|
53611
|
+
* Comes from https://github.com/odoo/odoo/blob/master/addons/web/static/src/owl2/utils.js
|
|
53612
|
+
*/
|
|
53613
|
+
function render(component, deep = false) {
|
|
53614
|
+
component.__owl__.render(deep);
|
|
53615
|
+
}
|
|
53616
|
+
|
|
53591
53617
|
//#endregion
|
|
53592
53618
|
//#region src/components/helpers/figure_drag_helper.ts
|
|
53593
53619
|
function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, initialFigures, { maxX, maxY }, { scrollX: initialScrollX, scrollY: initialScrollY }, { scrollX, scrollY }) {
|
|
@@ -53605,19 +53631,19 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
53605
53631
|
};
|
|
53606
53632
|
});
|
|
53607
53633
|
}
|
|
53608
|
-
function dragFigureForResize(
|
|
53609
|
-
let { x, y, width, height } =
|
|
53634
|
+
function dragFigureForResize(initialRect, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX: initialScrollX, scrollY: initialScrollY }, { scrollX, scrollY }, { maxX, maxY }) {
|
|
53635
|
+
let { x, y, width, height } = initialRect;
|
|
53610
53636
|
if (keepRatio && dirX !== 0 && dirY !== 0) {
|
|
53611
|
-
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize);
|
|
53612
|
-
const deltaY = Math.min(dirY * (mouseInitialY - mouseY + scrollY - initialScrollY), height - minFigSize);
|
|
53637
|
+
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize.width);
|
|
53638
|
+
const deltaY = Math.min(dirY * (mouseInitialY - mouseY + scrollY - initialScrollY), height - minFigSize.height);
|
|
53613
53639
|
const fraction = Math.min(deltaX / width, deltaY / height);
|
|
53614
53640
|
if (dirX < 0) x = x + width * fraction;
|
|
53615
53641
|
if (dirY < 0) y = y + height * fraction;
|
|
53616
53642
|
width = width * (1 - fraction);
|
|
53617
53643
|
height = height * (1 - fraction);
|
|
53618
53644
|
} else {
|
|
53619
|
-
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize - width);
|
|
53620
|
-
const deltaY = Math.max(dirY * (mouseY - mouseInitialY + scrollY - initialScrollY), minFigSize - height);
|
|
53645
|
+
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize.width - width);
|
|
53646
|
+
const deltaY = Math.max(dirY * (mouseY - mouseInitialY + scrollY - initialScrollY), minFigSize.height - height);
|
|
53621
53647
|
width = width + deltaX;
|
|
53622
53648
|
height = height + deltaY;
|
|
53623
53649
|
if (dirX < 0) x = x - deltaX;
|
|
@@ -53632,7 +53658,6 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
53632
53658
|
y = -scrollY;
|
|
53633
53659
|
} else if (y + height > maxY) height = maxY - y;
|
|
53634
53660
|
return {
|
|
53635
|
-
...initialFigure,
|
|
53636
53661
|
x,
|
|
53637
53662
|
y,
|
|
53638
53663
|
width,
|
|
@@ -53695,29 +53720,30 @@ function snapForMove(env, figuresToSnap, otherFigures) {
|
|
|
53695
53720
|
* Try to snap the given figure to the other figures when resizing the figure, and return the snapped
|
|
53696
53721
|
* figure and the possible snap lines, if any were found
|
|
53697
53722
|
*/
|
|
53698
|
-
function snapForResize(env, resizeDirX, resizeDirY,
|
|
53699
|
-
const verticalSnapLine = getSnapLine(env,
|
|
53723
|
+
function snapForResize(env, resizeDirX, resizeDirY, rect, otherFigures) {
|
|
53724
|
+
const verticalSnapLine = getSnapLine(env, rect, [resizeDirX === -1 ? "left" : "right"], otherFigures, ["right", "left"]);
|
|
53725
|
+
const horizontalSnapLine = getSnapLine(env, rect, [resizeDirY === -1 ? "top" : "bottom"], otherFigures, ["bottom", "top"]);
|
|
53700
53726
|
if (verticalSnapLine) {
|
|
53701
|
-
if (resizeDirX === 1)
|
|
53727
|
+
if (resizeDirX === 1) rect.width -= verticalSnapLine.snapOffset;
|
|
53702
53728
|
else if (resizeDirX === -1) {
|
|
53703
|
-
|
|
53704
|
-
|
|
53729
|
+
rect.x -= verticalSnapLine.snapOffset;
|
|
53730
|
+
rect.width += verticalSnapLine.snapOffset;
|
|
53705
53731
|
}
|
|
53706
53732
|
}
|
|
53707
|
-
const horizontalSnapLine = getSnapLine(env, figureToSnap, [resizeDirY === -1 ? "top" : "bottom"], otherFigures, ["bottom", "top"]);
|
|
53708
53733
|
if (horizontalSnapLine) {
|
|
53709
|
-
if (resizeDirY === 1)
|
|
53734
|
+
if (resizeDirY === 1) rect.height -= horizontalSnapLine.snapOffset;
|
|
53710
53735
|
else if (resizeDirY === -1) {
|
|
53711
|
-
|
|
53712
|
-
|
|
53736
|
+
rect.y -= horizontalSnapLine.snapOffset;
|
|
53737
|
+
rect.height += horizontalSnapLine.snapOffset;
|
|
53713
53738
|
}
|
|
53714
53739
|
}
|
|
53715
|
-
figureToSnap.x = Math.round(figureToSnap.x);
|
|
53716
|
-
figureToSnap.y = Math.round(figureToSnap.y);
|
|
53717
|
-
figureToSnap.height = Math.round(figureToSnap.height);
|
|
53718
|
-
figureToSnap.width = Math.round(figureToSnap.width);
|
|
53719
53740
|
return {
|
|
53720
|
-
|
|
53741
|
+
snappedRect: {
|
|
53742
|
+
x: Math.round(rect.x),
|
|
53743
|
+
y: Math.round(rect.y),
|
|
53744
|
+
width: Math.round(rect.width),
|
|
53745
|
+
height: Math.round(rect.height)
|
|
53746
|
+
},
|
|
53721
53747
|
verticalSnapLine,
|
|
53722
53748
|
horizontalSnapLine
|
|
53723
53749
|
};
|
|
@@ -53908,7 +53934,7 @@ var FiguresContainer = class extends Component {
|
|
|
53908
53934
|
this.zoomStore = useStore(ZoomStore);
|
|
53909
53935
|
this.chartDragStore = useStore(ChartDragStore);
|
|
53910
53936
|
(0, _odoo_owl.onMounted)(() => {
|
|
53911
|
-
|
|
53937
|
+
render(this);
|
|
53912
53938
|
});
|
|
53913
53939
|
(0, _odoo_owl.onWillUpdateProps)(() => {
|
|
53914
53940
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -53982,6 +54008,13 @@ var FiguresContainer = class extends Component {
|
|
|
53982
54008
|
get selectedRectStyle() {
|
|
53983
54009
|
return this.dnd.selectedRect ? this.rectToCss(this.dnd.selectedRect) : "";
|
|
53984
54010
|
}
|
|
54011
|
+
get maxDimensions() {
|
|
54012
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
54013
|
+
return {
|
|
54014
|
+
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
54015
|
+
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end
|
|
54016
|
+
};
|
|
54017
|
+
}
|
|
53985
54018
|
getInverseViewportPositionStyle(container) {
|
|
53986
54019
|
const { scrollX, scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
53987
54020
|
const { x: viewportX, y: viewportY } = this.viewStore.mainViewportCoordinates;
|
|
@@ -54039,12 +54072,9 @@ var FiguresContainer = class extends Component {
|
|
|
54039
54072
|
y: ev.clientY / zoom
|
|
54040
54073
|
};
|
|
54041
54074
|
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54075
|
+
const maxDimensions = this.maxDimensions;
|
|
54042
54076
|
const initialFigures = this.env.model.getters.getSelectedFigureIds().map((id) => this.env.model.getters.getFigure(sheetId, id)).filter(isDefined).map((f) => this.env.model.getters.getFigureUI(sheetId, f)).map(this.toBottomRightViewport.bind(this));
|
|
54043
54077
|
const draggedFigureId = figureUI.id;
|
|
54044
|
-
const maxDimensions = {
|
|
54045
|
-
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
54046
|
-
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end
|
|
54047
|
-
};
|
|
54048
54078
|
let hasStartedDnd = false;
|
|
54049
54079
|
let overlappingChartOrCarousel = void 0;
|
|
54050
54080
|
const onMouseMove = (ev) => {
|
|
@@ -54091,7 +54121,7 @@ var FiguresContainer = class extends Component {
|
|
|
54091
54121
|
...this.viewStore.viewports.getPositionAnchorOffset(sheetId, f)
|
|
54092
54122
|
};
|
|
54093
54123
|
}) || [];
|
|
54094
|
-
this.env.model.dispatch("
|
|
54124
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: payloads });
|
|
54095
54125
|
} else {
|
|
54096
54126
|
const overlappingFigureId = overlappingChartOrCarousel.id;
|
|
54097
54127
|
const chartFigureIds = this.dnd.selectedFigures?.map((f) => f.id) || [];
|
|
@@ -54116,7 +54146,7 @@ var FiguresContainer = class extends Component {
|
|
|
54116
54146
|
this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
|
|
54117
54147
|
}
|
|
54118
54148
|
/**
|
|
54119
|
-
* Initialize the resize of
|
|
54149
|
+
* Initialize the resize of the selected figures with mouse movements
|
|
54120
54150
|
*
|
|
54121
54151
|
* @param dirX X direction of the resize. -1 : resize from the left border of the figure, 0 : no resize in X, 1 :
|
|
54122
54152
|
* resize from the right border of the figure
|
|
@@ -54124,44 +54154,78 @@ var FiguresContainer = class extends Component {
|
|
|
54124
54154
|
* resize from the bottom border of the figure
|
|
54125
54155
|
* @param ev Mouse Event
|
|
54126
54156
|
*/
|
|
54127
|
-
|
|
54157
|
+
resizeAllSelectedFigures(dirX, dirY, ev) {
|
|
54128
54158
|
ev.stopPropagation();
|
|
54129
|
-
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54130
|
-
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
54131
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
|
|
54132
|
-
const zoom = this.zoomStore.zoomLevel;
|
|
54133
54159
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
54160
|
+
const zoom = this.zoomStore.zoomLevel;
|
|
54134
54161
|
const initialMousePosition = {
|
|
54135
54162
|
x: ev.clientX / zoom,
|
|
54136
54163
|
y: ev.clientY / zoom
|
|
54137
54164
|
};
|
|
54138
|
-
const
|
|
54139
|
-
|
|
54140
|
-
|
|
54141
|
-
|
|
54165
|
+
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54166
|
+
const maxDimensions = this.maxDimensions;
|
|
54167
|
+
const selectedFiguresIds = this.env.model.getters.getSelectedFigureIds();
|
|
54168
|
+
const initialFigures = selectedFiguresIds.map((id) => this.env.model.getters.getFigure(sheetId, id)).filter(isDefined).map((figure) => this.env.model.getters.getFigureUI(sheetId, figure)).map(this.toBottomRightViewport.bind(this));
|
|
54169
|
+
const mutlipleFiguresSelected = selectedFiguresIds.length > 1;
|
|
54170
|
+
const otherFiguresUI = this.getOtherFigures(selectedFiguresIds);
|
|
54171
|
+
if (initialFigures.length === 0) return;
|
|
54172
|
+
let minAggregateSize;
|
|
54173
|
+
if (mutlipleFiguresSelected) {
|
|
54174
|
+
const widthScaleMax = Math.max(...initialFigures.map((f) => {
|
|
54175
|
+
return figureRegistry.get(f.tag).minFigSize / f.width;
|
|
54176
|
+
}));
|
|
54177
|
+
const heightScaleMax = Math.max(...initialFigures.map((f) => {
|
|
54178
|
+
return figureRegistry.get(f.tag).minFigSize / f.height;
|
|
54179
|
+
}));
|
|
54180
|
+
const initialAggregateRect = rectUnion(...initialFigures);
|
|
54181
|
+
minAggregateSize = {
|
|
54182
|
+
width: Math.round(initialAggregateRect.width * widthScaleMax),
|
|
54183
|
+
height: Math.round(initialAggregateRect.height * heightScaleMax)
|
|
54184
|
+
};
|
|
54185
|
+
} else {
|
|
54186
|
+
const minFigSize = figureRegistry.get(initialFigures[0].tag).minFigSize;
|
|
54187
|
+
minAggregateSize = {
|
|
54188
|
+
width: minFigSize,
|
|
54189
|
+
height: minFigSize
|
|
54190
|
+
};
|
|
54191
|
+
}
|
|
54142
54192
|
const onMouseMove = (ev) => {
|
|
54143
|
-
const
|
|
54193
|
+
const currentMousePosition = {
|
|
54144
54194
|
x: ev.clientX / zoom,
|
|
54145
54195
|
y: ev.clientY / zoom
|
|
54146
|
-
}
|
|
54147
|
-
const
|
|
54148
|
-
const
|
|
54149
|
-
this.
|
|
54150
|
-
|
|
54151
|
-
|
|
54152
|
-
|
|
54153
|
-
|
|
54196
|
+
};
|
|
54197
|
+
const keepRatio = mutlipleFiguresSelected || ev.shiftKey ? true : figureRegistry.get(initialFigures[0].tag).keepRatio || false;
|
|
54198
|
+
const initialRect = rectUnion(...initialFigures);
|
|
54199
|
+
const resizedRect = dragFigureForResize(initialRect, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minAggregateSize, initialScrollPosition, this.viewStore.activeSheetScrollInfo, maxDimensions);
|
|
54200
|
+
const { snappedRect, verticalSnapLine, horizontalSnapLine } = snapForResize(this.env, dirX, dirY, resizedRect, otherFiguresUI);
|
|
54201
|
+
const scaleX = snappedRect.width / initialRect.width;
|
|
54202
|
+
const scaleY = snappedRect.height / initialRect.height;
|
|
54203
|
+
const snappedFigures = initialFigures.map((figureUI) => ({
|
|
54204
|
+
...figureUI,
|
|
54205
|
+
x: Math.round(snappedRect.x + (figureUI.x - initialRect.x) * scaleX),
|
|
54206
|
+
y: Math.round(snappedRect.y + (figureUI.y - initialRect.y) * scaleY),
|
|
54207
|
+
width: Math.round(figureUI.width * scaleX),
|
|
54208
|
+
height: Math.round(figureUI.height * scaleY)
|
|
54209
|
+
}));
|
|
54210
|
+
this.dnd.draggedFigure = snappedFigures[0];
|
|
54211
|
+
this.dnd.selectedFigures = snappedFigures;
|
|
54212
|
+
this.dnd.selectedRect = this.getDndFigureRect();
|
|
54213
|
+
this.dnd.horizontalSnap = this.getSnap(horizontalSnapLine);
|
|
54214
|
+
this.dnd.verticalSnap = this.getSnap(verticalSnapLine);
|
|
54154
54215
|
};
|
|
54155
|
-
const onMouseUp = (
|
|
54156
|
-
if (!this.dnd.
|
|
54157
|
-
const
|
|
54158
|
-
|
|
54159
|
-
|
|
54160
|
-
|
|
54161
|
-
|
|
54162
|
-
|
|
54163
|
-
|
|
54216
|
+
const onMouseUp = () => {
|
|
54217
|
+
if (!this.dnd.selectedFigures) return;
|
|
54218
|
+
const dispatchPayload = this.dnd.selectedFigures.map((figureUI) => {
|
|
54219
|
+
const update = this.viewStore.viewports.getPositionAnchorOffset(sheetId, figureUI);
|
|
54220
|
+
if (dirX) update.width = figureUI.width;
|
|
54221
|
+
if (dirY) update.height = figureUI.height;
|
|
54222
|
+
return {
|
|
54223
|
+
sheetId,
|
|
54224
|
+
figureId: figureUI.id,
|
|
54225
|
+
...update
|
|
54226
|
+
};
|
|
54164
54227
|
});
|
|
54228
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: dispatchPayload });
|
|
54165
54229
|
this.dnd.draggedFigure = void 0;
|
|
54166
54230
|
this.dnd.selectedFigures = void 0;
|
|
54167
54231
|
this.dnd.selectedRect = void 0;
|
|
@@ -54824,7 +54888,7 @@ function useTouchHandlers(ref, { updateScroll, canMoveUp, canMoveDown, getZoom,
|
|
|
54824
54888
|
passive: false,
|
|
54825
54889
|
capture: false
|
|
54826
54890
|
});
|
|
54827
|
-
|
|
54891
|
+
(0, _odoo_owl.useListener)(window, "pointerup", onPointerUp, {
|
|
54828
54892
|
passive: false,
|
|
54829
54893
|
capture: true
|
|
54830
54894
|
});
|
|
@@ -55388,10 +55452,10 @@ var Grid = class extends Component {
|
|
|
55388
55452
|
this.checkboxToggleStore = useStore(CheckboxToggleStore);
|
|
55389
55453
|
useStore(ArrayFormulaHighlight);
|
|
55390
55454
|
this.automaticSumStore = useLocalStore(AutomaticSumStore);
|
|
55391
|
-
|
|
55392
|
-
|
|
55393
|
-
|
|
55394
|
-
|
|
55455
|
+
useSubEnv({ getPopoverContainerRect: () => this.getGridRect() });
|
|
55456
|
+
(0, _odoo_owl.useListener)(document.body, "cut", this.copy.bind(this, true));
|
|
55457
|
+
(0, _odoo_owl.useListener)(document.body, "copy", this.copy.bind(this, false));
|
|
55458
|
+
(0, _odoo_owl.useListener)(document.body, "paste", this.paste.bind(this));
|
|
55395
55459
|
(0, _odoo_owl.onMounted)(() => this.focusDefaultElement());
|
|
55396
55460
|
this.props.exposeFocus(() => this.focusDefaultElement());
|
|
55397
55461
|
useGridDrawing({
|
|
@@ -64706,36 +64770,37 @@ function generateMasterChartConfig(chartJsConfig) {
|
|
|
64706
64770
|
//#endregion
|
|
64707
64771
|
//#region src/plugins/ui_core_views/evaluation_chart.ts
|
|
64708
64772
|
var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
64709
|
-
static getters = ["
|
|
64773
|
+
static getters = ["getStyleOfSingleCellChart", "getChartRuntimeWithTheme"];
|
|
64710
64774
|
charts = {};
|
|
64711
64775
|
handle(cmd) {
|
|
64712
|
-
if (invalidateEvaluationCommands.has(cmd.type) || invalidateCFEvaluationCommands.has(cmd.type) || invalidateChartEvaluationCommands.has(cmd.type)) for (const chartId in this.charts) this.charts[chartId] =
|
|
64776
|
+
if (invalidateEvaluationCommands.has(cmd.type) || invalidateCFEvaluationCommands.has(cmd.type) || invalidateChartEvaluationCommands.has(cmd.type)) for (const chartId in this.charts) this.charts[chartId] = {};
|
|
64713
64777
|
switch (cmd.type) {
|
|
64714
64778
|
case "UPDATE_CHART":
|
|
64715
64779
|
case "CREATE_CHART":
|
|
64716
|
-
this.charts[cmd.chartId] =
|
|
64780
|
+
this.charts[cmd.chartId] = {};
|
|
64717
64781
|
break;
|
|
64718
64782
|
case "DELETE_CHART":
|
|
64719
|
-
this.charts[cmd.chartId] =
|
|
64783
|
+
this.charts[cmd.chartId] = {};
|
|
64720
64784
|
break;
|
|
64721
64785
|
case "DELETE_SHEET":
|
|
64722
|
-
for (const chartId in this.charts) if (!this.getters.isChartDefined(chartId)) this.charts[chartId] =
|
|
64786
|
+
for (const chartId in this.charts) if (!this.getters.isChartDefined(chartId)) this.charts[chartId] = {};
|
|
64723
64787
|
break;
|
|
64724
64788
|
}
|
|
64725
64789
|
}
|
|
64726
|
-
|
|
64727
|
-
if (!this.charts[chartId]) {
|
|
64790
|
+
getChartRuntimeWithTheme(chartId, colorThemeName) {
|
|
64791
|
+
if (!this.charts[chartId]) this.charts[chartId] = {};
|
|
64792
|
+
if (!this.charts[chartId][colorThemeName]) {
|
|
64728
64793
|
const chart = this.getters.getChart(chartId);
|
|
64729
64794
|
if (!chart) throw new Error(`No chart for the given id: ${chartId}`);
|
|
64730
|
-
this.charts[chartId] = this.createRuntimeChart(chartId, chart);
|
|
64795
|
+
this.charts[chartId][colorThemeName] = this.createRuntimeChart(chartId, chart, colorThemeName);
|
|
64731
64796
|
}
|
|
64732
|
-
return this.charts[chartId];
|
|
64797
|
+
return this.charts[chartId][colorThemeName];
|
|
64733
64798
|
}
|
|
64734
64799
|
/**
|
|
64735
64800
|
* Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
|
|
64736
64801
|
*/
|
|
64737
|
-
getStyleOfSingleCellChart(chartBackground, mainRange) {
|
|
64738
|
-
const themeBackground =
|
|
64802
|
+
getStyleOfSingleCellChart(chartBackground, mainRange, colorThemeName) {
|
|
64803
|
+
const themeBackground = COLOR_THEMES[colorThemeName].backgroundColor;
|
|
64739
64804
|
if (chartBackground) return {
|
|
64740
64805
|
background: chartBackground,
|
|
64741
64806
|
fontColor: chartFontColor(chartBackground)
|
|
@@ -64776,7 +64841,7 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64776
64841
|
else {
|
|
64777
64842
|
if (!chart) continue;
|
|
64778
64843
|
const type = this.getters.getChartType(chartId);
|
|
64779
|
-
const img = await chartToImageUrl(this.
|
|
64844
|
+
const img = await chartToImageUrl(this.getChartRuntimeWithTheme(chartId, "light"), figure, type);
|
|
64780
64845
|
if (img) sheet.images.push({
|
|
64781
64846
|
...figure,
|
|
64782
64847
|
tag: "image",
|
|
@@ -64794,9 +64859,9 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64794
64859
|
sheet.charts = figures;
|
|
64795
64860
|
}
|
|
64796
64861
|
}
|
|
64797
|
-
createRuntimeChart(chartId, chart) {
|
|
64862
|
+
createRuntimeChart(chartId, chart, colorThemeName) {
|
|
64798
64863
|
const definition = chart.getRangeDefinition();
|
|
64799
|
-
const runtime = chart.getRuntime(this.getters, chartId);
|
|
64864
|
+
const runtime = chart.getRuntime(this.getters, chartId, colorThemeName);
|
|
64800
64865
|
if ("chartJsConfig" in runtime && /line|combo|bar|scatter|waterfall/.test(definition.type)) {
|
|
64801
64866
|
const chartJsConfig = runtime.chartJsConfig;
|
|
64802
64867
|
runtime["masterChartConfig"] = generateMasterChartConfig(chartJsConfig);
|
|
@@ -66162,6 +66227,39 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
66162
66227
|
}
|
|
66163
66228
|
};
|
|
66164
66229
|
|
|
66230
|
+
//#endregion
|
|
66231
|
+
//#region src/plugins/ui_plugin.ts
|
|
66232
|
+
/**
|
|
66233
|
+
* UI plugins handle any transient data required to display a spreadsheet.
|
|
66234
|
+
* They can draw on the grid canvas.
|
|
66235
|
+
*/
|
|
66236
|
+
var UIPlugin = class extends BasePlugin {
|
|
66237
|
+
static layers = [];
|
|
66238
|
+
getters;
|
|
66239
|
+
ui;
|
|
66240
|
+
selection;
|
|
66241
|
+
dispatch;
|
|
66242
|
+
canDispatch;
|
|
66243
|
+
constructor({ getters, stateObserver, dispatch, canDispatch, uiActions, selection }) {
|
|
66244
|
+
super(stateObserver);
|
|
66245
|
+
this.getters = getters;
|
|
66246
|
+
this.ui = uiActions;
|
|
66247
|
+
this.selection = selection;
|
|
66248
|
+
this.dispatch = dispatch;
|
|
66249
|
+
this.canDispatch = canDispatch;
|
|
66250
|
+
}
|
|
66251
|
+
drawLayer(ctx, layer) {}
|
|
66252
|
+
};
|
|
66253
|
+
|
|
66254
|
+
//#endregion
|
|
66255
|
+
//#region src/plugins/ui_feature/chart_ui.ts
|
|
66256
|
+
var ChartUIPlugin = class extends UIPlugin {
|
|
66257
|
+
static getters = ["getChartRuntime"];
|
|
66258
|
+
getChartRuntime(chartId) {
|
|
66259
|
+
return this.getters.getChartRuntimeWithTheme(chartId, this.getters.getSpreadsheetTheme().colorThemeName);
|
|
66260
|
+
}
|
|
66261
|
+
};
|
|
66262
|
+
|
|
66165
66263
|
//#endregion
|
|
66166
66264
|
//#region src/helpers/range_adapter_functions.ts
|
|
66167
66265
|
function getRangeAdapterFunctions(executedCommand) {
|
|
@@ -67151,30 +67249,6 @@ var Session = class extends EventBus {
|
|
|
67151
67249
|
}
|
|
67152
67250
|
};
|
|
67153
67251
|
|
|
67154
|
-
//#endregion
|
|
67155
|
-
//#region src/plugins/ui_plugin.ts
|
|
67156
|
-
/**
|
|
67157
|
-
* UI plugins handle any transient data required to display a spreadsheet.
|
|
67158
|
-
* They can draw on the grid canvas.
|
|
67159
|
-
*/
|
|
67160
|
-
var UIPlugin = class extends BasePlugin {
|
|
67161
|
-
static layers = [];
|
|
67162
|
-
getters;
|
|
67163
|
-
ui;
|
|
67164
|
-
selection;
|
|
67165
|
-
dispatch;
|
|
67166
|
-
canDispatch;
|
|
67167
|
-
constructor({ getters, stateObserver, dispatch, canDispatch, uiActions, selection }) {
|
|
67168
|
-
super(stateObserver);
|
|
67169
|
-
this.getters = getters;
|
|
67170
|
-
this.ui = uiActions;
|
|
67171
|
-
this.selection = selection;
|
|
67172
|
-
this.dispatch = dispatch;
|
|
67173
|
-
this.canDispatch = canDispatch;
|
|
67174
|
-
}
|
|
67175
|
-
drawLayer(ctx, layer) {}
|
|
67176
|
-
};
|
|
67177
|
-
|
|
67178
67252
|
//#endregion
|
|
67179
67253
|
//#region src/plugins/ui_feature/collaborative.ts
|
|
67180
67254
|
var CollaborativePlugin = class extends UIPlugin {
|
|
@@ -67258,41 +67332,6 @@ var CollaborativePlugin = class extends UIPlugin {
|
|
|
67258
67332
|
|
|
67259
67333
|
//#endregion
|
|
67260
67334
|
//#region src/plugins/ui_feature/color_theme.ts
|
|
67261
|
-
const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
67262
|
-
const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
67263
|
-
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
67264
|
-
const TEXT_HEADER_COLOR = "#666666";
|
|
67265
|
-
const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
67266
|
-
const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
67267
|
-
const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
67268
|
-
const COLOR_THEMES = {
|
|
67269
|
-
light: {
|
|
67270
|
-
backgroundColor: "#FFFFFF",
|
|
67271
|
-
gridBorderColor: "#CECFCF",
|
|
67272
|
-
headerBackgroundColor: BACKGROUND_HEADER_COLOR,
|
|
67273
|
-
headerActiveBackgroundColor: BACKGROUND_HEADER_ACTIVE_COLOR,
|
|
67274
|
-
headerSelectedBackgroundColor: BACKGROUND_HEADER_SELECTED_COLOR,
|
|
67275
|
-
headerTextColor: TEXT_HEADER_COLOR,
|
|
67276
|
-
headerBorderColor: HEADER_BORDER_COLOR,
|
|
67277
|
-
frozenPaneBorderColor: FROZEN_PANE_BORDER_COLOR,
|
|
67278
|
-
frozenPaneHeaderBorderColor: FROZEN_PANE_HEADER_BORDER_COLOR,
|
|
67279
|
-
singleCellSelectionBackgroundColor: "#F3F7FE",
|
|
67280
|
-
multipleCellsSelectionBackgroundColor: "#E9F0FF"
|
|
67281
|
-
},
|
|
67282
|
-
dark: {
|
|
67283
|
-
backgroundColor: adaptForDarkMode("#1A1C2E"),
|
|
67284
|
-
gridBorderColor: adaptForDarkMode("#6B706F"),
|
|
67285
|
-
headerBackgroundColor: adaptForDarkMode("#262A36"),
|
|
67286
|
-
headerActiveBackgroundColor: adaptForDarkMode("#3A4052"),
|
|
67287
|
-
headerSelectedBackgroundColor: adaptForDarkMode("#4E566E"),
|
|
67288
|
-
headerTextColor: adaptForDarkMode("#A1A6B3"),
|
|
67289
|
-
headerBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67290
|
-
frozenPaneBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67291
|
-
frozenPaneHeaderBorderColor: adaptForDarkMode("#9FA5BD"),
|
|
67292
|
-
singleCellSelectionBackgroundColor: adaptForDarkMode("#696E8044"),
|
|
67293
|
-
multipleCellsSelectionBackgroundColor: adaptForDarkMode("#828AA044")
|
|
67294
|
-
}
|
|
67295
|
-
};
|
|
67296
67335
|
var ColorThemeUIPlugin = class extends UIPlugin {
|
|
67297
67336
|
static getters = ["isDarkMode", "getSpreadsheetTheme"];
|
|
67298
67337
|
colorScheme;
|
|
@@ -69563,7 +69602,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69563
69602
|
static getters = ["getFigureUI"];
|
|
69564
69603
|
allowDispatch(cmd) {
|
|
69565
69604
|
switch (cmd.type) {
|
|
69566
|
-
case "
|
|
69605
|
+
case "UPDATE_FIGURES":
|
|
69567
69606
|
for (const updateFigurePayload of cmd.figures) {
|
|
69568
69607
|
const result = this.canDispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69569
69608
|
if (!result.isSuccessful) return result.reasons;
|
|
@@ -69587,7 +69626,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69587
69626
|
}
|
|
69588
69627
|
handle(cmd) {
|
|
69589
69628
|
switch (cmd.type) {
|
|
69590
|
-
case "
|
|
69629
|
+
case "UPDATE_FIGURES":
|
|
69591
69630
|
for (const updateFigurePayload of cmd.figures) this.dispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69592
69631
|
break;
|
|
69593
69632
|
case "DELETE_FIGURES":
|
|
@@ -70734,7 +70773,7 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
70734
70773
|
//#endregion
|
|
70735
70774
|
//#region src/plugins/plugin_registries.ts
|
|
70736
70775
|
const corePluginRegistry = new Registry().add("settings", SettingsPlugin).add("sheet", SheetPlugin).add("header grouping", HeaderGroupingPlugin).add("header visibility", HeaderVisibilityPlugin).add("tables", TablePlugin).add("dataValidation", DataValidationPlugin).add("cell", CellPlugin).add("default", DefaultPlugin).add("merge", MergePlugin).add("headerSize", HeaderSizePlugin).add("borders", BordersPlugin).add("conditional formatting", ConditionalFormatPlugin).add("figures", FigurePlugin).add("chart", ChartPlugin).add("carousel", CarouselPlugin).add("image", ImagePlugin).add("named_ranges", NamedRangesPlugin).add("pivot_core", PivotCorePlugin).add("spreadsheet_pivot_core", SpreadsheetPivotCorePlugin).add("tableStyle", TableStylePlugin);
|
|
70737
|
-
const featurePluginRegistry = new Registry().add("ui_sheet", SheetUIPlugin).add("ui_options", UIOptionsPlugin).add("sort", SortPlugin).add("format", FormatPlugin).add("insert_pivot", InsertPivotPlugin).add("pivot_presence", PivotPresencePlugin).add("subtotal_evaluation", SubtotalEvaluationPlugin).add("collaborative", CollaborativePlugin).add("history", HistoryPlugin).add("datavalidation_insert", DataValidationInsertionPlugin).add("dynamic_translate", DynamicTranslate).add("geo_features", GeoFeaturePlugin).add("color_theme", ColorThemeUIPlugin).add("lock_sheet", LockSheetPlugin);
|
|
70776
|
+
const featurePluginRegistry = new Registry().add("ui_sheet", SheetUIPlugin).add("ui_options", UIOptionsPlugin).add("sort", SortPlugin).add("format", FormatPlugin).add("insert_pivot", InsertPivotPlugin).add("pivot_presence", PivotPresencePlugin).add("subtotal_evaluation", SubtotalEvaluationPlugin).add("collaborative", CollaborativePlugin).add("history", HistoryPlugin).add("datavalidation_insert", DataValidationInsertionPlugin).add("dynamic_translate", DynamicTranslate).add("geo_features", GeoFeaturePlugin).add("color_theme", ColorThemeUIPlugin).add("lock_sheet", LockSheetPlugin).add("chart_ui", ChartUIPlugin);
|
|
70738
70777
|
const statefulUIPluginRegistry = new Registry().add("selection", GridSelectionPlugin).add("evaluation_filter", FilterEvaluationPlugin).add("header_visibility_ui", HeaderVisibilityUIPlugin).add("cell_computed_style", CellComputedStylePlugin).add("table_computed_style", TableComputedStylePlugin).add("header_positions", HeaderPositionsUIPlugin).add("clipboard", ClipboardPlugin).add("carousel_ui", CarouselUIPlugin).add("figure_ui", FigureUIPlugin);
|
|
70739
70778
|
const coreViewsPluginRegistry = new Registry().add("evaluation", EvaluationPlugin).add("evaluation_chart", EvaluationChartPlugin).add("fingerprints", FingerprintPlugin).add("evaluation_cf", EvaluationConditionalFormatPlugin).add("row_size", HeaderSizeUIPlugin).add("data_validation_ui", EvaluationDataValidationPlugin).add("dynamic_tables", DynamicTablesPlugin).add("custom_colors", CustomColorsPlugin).add("pivot_ui", PivotUIPlugin).add("cell_icon", CellIconPlugin).add("formula_tracker", FormulaTrackerPlugin);
|
|
70740
70779
|
|
|
@@ -72090,7 +72129,7 @@ var BottomBarSheet = class extends Component {
|
|
|
72090
72129
|
DOMFocusableElementStore;
|
|
72091
72130
|
setup() {
|
|
72092
72131
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
72093
|
-
|
|
72132
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
72094
72133
|
useLayoutEffect(() => {}, () => [this.state.isEditing]);
|
|
72095
72134
|
(0, _odoo_owl.onPatched)(() => {
|
|
72096
72135
|
if (this.sheetNameRef() && this.state.isEditing && this.editionState === "initializing") {
|
|
@@ -72654,7 +72693,7 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72654
72693
|
this.zoomStore = useStore(ZoomStore);
|
|
72655
72694
|
useLocalStore(HoveredTableStore);
|
|
72656
72695
|
const rendererStore = useLocalStore(RendererStore, OrderedLayers().filter((layer) => layer !== "Headers"));
|
|
72657
|
-
|
|
72696
|
+
useSubEnv({ getPopoverContainerRect: () => this.zoomStore.getZoomedRect(this.getGridRect()) });
|
|
72658
72697
|
useGridDrawing({
|
|
72659
72698
|
canvasRef: this.canvasRef,
|
|
72660
72699
|
rendererStore,
|
|
@@ -72726,13 +72765,12 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72726
72765
|
return this.env.model.getters.getColDimensions(sheetId, right).end;
|
|
72727
72766
|
}
|
|
72728
72767
|
get dashboardStyle() {
|
|
72729
|
-
|
|
72730
|
-
if (this.env.model.getters.getActiveSheet().backgroundColor) style["background-color"] = "transparent";
|
|
72731
|
-
return cssPropertiesToCss(style);
|
|
72768
|
+
return cssPropertiesToCss({ zoom: this.zoomStore.cssZoom });
|
|
72732
72769
|
}
|
|
72733
72770
|
get backgroundStyle() {
|
|
72734
72771
|
const sheet = this.env.model.getters.getActiveSheet();
|
|
72735
|
-
|
|
72772
|
+
const theme = this.env.model.getters.getSpreadsheetTheme();
|
|
72773
|
+
return cssPropertiesToCss({ "background-color": sheet.backgroundColor || theme.backgroundColor });
|
|
72736
72774
|
}
|
|
72737
72775
|
};
|
|
72738
72776
|
|
|
@@ -73078,7 +73116,7 @@ var RibbonMenu = class extends Component {
|
|
|
73078
73116
|
parentState: void 0
|
|
73079
73117
|
});
|
|
73080
73118
|
setup() {
|
|
73081
|
-
|
|
73119
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
73082
73120
|
(0, _odoo_owl.onMounted)(this.updateShadows);
|
|
73083
73121
|
}
|
|
73084
73122
|
onExternalClick(ev) {
|
|
@@ -73732,7 +73770,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73732
73770
|
setup() {
|
|
73733
73771
|
this.printStore = useLocalStore(SpreadsheetPrintStore);
|
|
73734
73772
|
let styleElement = null;
|
|
73735
|
-
|
|
73773
|
+
(0, _odoo_owl.useListener)(window, "beforeprint", () => {
|
|
73736
73774
|
styleElement = document.createElement("style");
|
|
73737
73775
|
styleElement.id = "o-spreadsheet-print-style";
|
|
73738
73776
|
const size = `${this.printStore.pageLayout} ${this.printStore.orientation}`;
|
|
@@ -73745,7 +73783,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73745
73783
|
styleElement = null;
|
|
73746
73784
|
}
|
|
73747
73785
|
};
|
|
73748
|
-
|
|
73786
|
+
(0, _odoo_owl.useListener)(window, "afterprint", () => removePrintStyle());
|
|
73749
73787
|
(0, _odoo_owl.onWillUnmount)(() => removePrintStyle());
|
|
73750
73788
|
}
|
|
73751
73789
|
get pageStyle() {
|
|
@@ -74734,8 +74772,8 @@ var TopBar = class extends Component {
|
|
|
74734
74772
|
this.composerFocusStore = useStore(ComposerFocusStore);
|
|
74735
74773
|
this.fingerprints = useStore(FormulaFingerprintStore);
|
|
74736
74774
|
this.topBarToolStore = useStore(TopBarToolStore);
|
|
74737
|
-
|
|
74738
|
-
|
|
74775
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this));
|
|
74776
|
+
(0, _odoo_owl.useListener)(window, "keydown", this.onKeydown.bind(this));
|
|
74739
74777
|
this.menus = topbarMenuRegistry.getMenuItems();
|
|
74740
74778
|
let lastWidth;
|
|
74741
74779
|
const updateVisibility = () => {
|
|
@@ -75062,9 +75100,9 @@ var Spreadsheet = class extends Component {
|
|
|
75062
75100
|
const el = this.spreadsheetRef();
|
|
75063
75101
|
if (el && !el.contains(document.activeElement) && document.activeElement?.contains(el)) this.focusGrid();
|
|
75064
75102
|
});
|
|
75065
|
-
|
|
75066
|
-
|
|
75067
|
-
|
|
75103
|
+
(0, _odoo_owl.useListener)(window, "resize", () => render(this, true));
|
|
75104
|
+
(0, _odoo_owl.useListener)(document.body, "wheel", () => {});
|
|
75105
|
+
(0, _odoo_owl.useListener)(window, "keydown", async (event) => {
|
|
75068
75106
|
if (keyboardEventToShortcutString(event) === "Ctrl+P") {
|
|
75069
75107
|
this.state.printModeEnabled = true;
|
|
75070
75108
|
event.stopPropagation();
|
|
@@ -75084,11 +75122,11 @@ var Spreadsheet = class extends Component {
|
|
|
75084
75122
|
resizeObserver.observe(el);
|
|
75085
75123
|
return () => resizeObserver.disconnect();
|
|
75086
75124
|
});
|
|
75087
|
-
const
|
|
75125
|
+
const batchedRender = batched(() => render(this, true));
|
|
75088
75126
|
(0, _odoo_owl.onMounted)(() => {
|
|
75089
75127
|
this.bindModelEvents();
|
|
75090
75128
|
this.checkViewportSize();
|
|
75091
|
-
stores.on("store-updated", this,
|
|
75129
|
+
stores.on("store-updated", this, batchedRender);
|
|
75092
75130
|
});
|
|
75093
75131
|
(0, _odoo_owl.onWillUnmount)(() => {
|
|
75094
75132
|
this.unbindModelEvents();
|
|
@@ -75100,7 +75138,7 @@ var Spreadsheet = class extends Component {
|
|
|
75100
75138
|
});
|
|
75101
75139
|
}
|
|
75102
75140
|
bindModelEvents() {
|
|
75103
|
-
this.model.on("update", this, () =>
|
|
75141
|
+
this.model.on("update", this, () => render(this, true));
|
|
75104
75142
|
this.model.on("command-rejected", this, ({ result }) => {
|
|
75105
75143
|
if (result.isCancelledBecause("SheetLocked")) this.notificationStore.notifyUser({
|
|
75106
75144
|
type: "info",
|
|
@@ -81173,6 +81211,10 @@ var LinkEditor = class extends Component {
|
|
|
81173
81211
|
this.computeLinks();
|
|
81174
81212
|
(0, _odoo_owl.onMounted)(() => this.urlInput()?.focus());
|
|
81175
81213
|
}
|
|
81214
|
+
onLinkUrlInput(ev) {
|
|
81215
|
+
this.state.url = ev.target.value;
|
|
81216
|
+
this.computeLinks();
|
|
81217
|
+
}
|
|
81176
81218
|
computeLinks() {
|
|
81177
81219
|
this.state.selectedIndex = null;
|
|
81178
81220
|
this.state.linksByCategory = this.linkProposalByCategory;
|
|
@@ -81872,8 +81914,8 @@ const BubbleChart = {
|
|
|
81872
81914
|
};
|
|
81873
81915
|
},
|
|
81874
81916
|
copyInSheetId: (definition) => definition,
|
|
81875
|
-
getRuntime(getters, definition) {
|
|
81876
|
-
const chartData = getBubbleChartData(definition, getters);
|
|
81917
|
+
getRuntime(getters, definition, chartDataExtractors, sheetId, eventHandlers, colorThemeName) {
|
|
81918
|
+
const chartData = getBubbleChartData(definition, getters, colorThemeName);
|
|
81877
81919
|
return { chartJsConfig: {
|
|
81878
81920
|
type: "line",
|
|
81879
81921
|
data: {
|
|
@@ -81948,8 +81990,8 @@ const CalendarChart = {
|
|
|
81948
81990
|
};
|
|
81949
81991
|
},
|
|
81950
81992
|
getDefinitionForExcel: () => void 0,
|
|
81951
|
-
getRuntime(getters, definition, { extractData }) {
|
|
81952
|
-
const chartData = getCalendarChartData(definition, extractData(), getters);
|
|
81993
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
81994
|
+
const chartData = getCalendarChartData(definition, extractData(), getters, colorThemeName);
|
|
81953
81995
|
const { labels, datasets } = getCalendarChartDatasetAndLabels(definition, chartData);
|
|
81954
81996
|
return { chartJsConfig: {
|
|
81955
81997
|
type: "calendar",
|
|
@@ -82035,8 +82077,8 @@ const ComboChart = {
|
|
|
82035
82077
|
annotationLink: context.annotationLink
|
|
82036
82078
|
};
|
|
82037
82079
|
},
|
|
82038
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82039
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
82080
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82081
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
82040
82082
|
return {
|
|
82041
82083
|
chartJsConfig: {
|
|
82042
82084
|
type: "bar",
|
|
@@ -82112,8 +82154,8 @@ const FunnelChart = {
|
|
|
82112
82154
|
};
|
|
82113
82155
|
},
|
|
82114
82156
|
getDefinitionForExcel: () => void 0,
|
|
82115
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82116
|
-
const chartData = getFunnelChartData(definition, extractData(), getters);
|
|
82157
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82158
|
+
const chartData = getFunnelChartData(definition, extractData(), getters, colorThemeName);
|
|
82117
82159
|
return { chartJsConfig: {
|
|
82118
82160
|
type: "funnel",
|
|
82119
82161
|
data: {
|
|
@@ -82175,8 +82217,8 @@ const GeoChart = {
|
|
|
82175
82217
|
};
|
|
82176
82218
|
},
|
|
82177
82219
|
getDefinitionForExcel: () => void 0,
|
|
82178
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82179
|
-
const chartData = getGeoChartData(definition, extractData(), getters);
|
|
82220
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82221
|
+
const chartData = getGeoChartData(definition, extractData(), getters, colorThemeName);
|
|
82180
82222
|
return { chartJsConfig: {
|
|
82181
82223
|
type: "choropleth",
|
|
82182
82224
|
data: { datasets: getGeoChartDatasets(definition, chartData) },
|
|
@@ -82245,7 +82287,7 @@ const PyramidChart = {
|
|
|
82245
82287
|
},
|
|
82246
82288
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
82247
82289
|
if (definition.dataSource.type !== "range") return;
|
|
82248
|
-
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters);
|
|
82290
|
+
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters, "light");
|
|
82249
82291
|
const { dataSetsValues } = chartData;
|
|
82250
82292
|
const maxValue = Math.max(...dataSetsValues.map((dataSet) => Math.max(...dataSet.data.map((cell) => isNumberResult(cell) ? Math.abs(cell.value) : -Infinity))));
|
|
82251
82293
|
return {
|
|
@@ -82259,8 +82301,8 @@ const PyramidChart = {
|
|
|
82259
82301
|
maxValue
|
|
82260
82302
|
};
|
|
82261
82303
|
},
|
|
82262
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82263
|
-
const chartData = getPyramidChartData(definition, extractData(), getters);
|
|
82304
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82305
|
+
const chartData = getPyramidChartData(definition, extractData(), getters, colorThemeName);
|
|
82264
82306
|
return {
|
|
82265
82307
|
chartJsConfig: {
|
|
82266
82308
|
type: "bar",
|
|
@@ -82342,8 +82384,8 @@ const RadarChart = {
|
|
|
82342
82384
|
labelRange
|
|
82343
82385
|
};
|
|
82344
82386
|
},
|
|
82345
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82346
|
-
const chartData = getRadarChartData(definition, extractData(), getters);
|
|
82387
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82388
|
+
const chartData = getRadarChartData(definition, extractData(), getters, colorThemeName);
|
|
82347
82389
|
return {
|
|
82348
82390
|
chartJsConfig: {
|
|
82349
82391
|
type: "radar",
|
|
@@ -82423,8 +82465,8 @@ const ScatterChart = {
|
|
|
82423
82465
|
verticalAxis: getDefinedAxis(definition)
|
|
82424
82466
|
};
|
|
82425
82467
|
},
|
|
82426
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82427
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
82468
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82469
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
82428
82470
|
return {
|
|
82429
82471
|
chartJsConfig: {
|
|
82430
82472
|
type: "line",
|
|
@@ -82502,8 +82544,8 @@ const SunburstChart = {
|
|
|
82502
82544
|
};
|
|
82503
82545
|
},
|
|
82504
82546
|
getDefinitionForExcel: () => void 0,
|
|
82505
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82506
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82547
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82548
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82507
82549
|
return { chartJsConfig: {
|
|
82508
82550
|
type: "doughnut",
|
|
82509
82551
|
data: { datasets: getSunburstChartDatasets(definition, chartData) },
|
|
@@ -82576,8 +82618,8 @@ const TreeMapChart = {
|
|
|
82576
82618
|
};
|
|
82577
82619
|
},
|
|
82578
82620
|
getDefinitionForExcel: () => void 0,
|
|
82579
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82580
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82621
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82622
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82581
82623
|
return { chartJsConfig: {
|
|
82582
82624
|
type: "treemap",
|
|
82583
82625
|
data: {
|
|
@@ -91064,7 +91106,6 @@ const hooks = {
|
|
|
91064
91106
|
};
|
|
91065
91107
|
const compatibility = {
|
|
91066
91108
|
Component,
|
|
91067
|
-
useExternalListener,
|
|
91068
91109
|
EnvPlugin,
|
|
91069
91110
|
App: App$1
|
|
91070
91111
|
};
|
|
@@ -91214,6 +91255,6 @@ exports.stores = stores;
|
|
|
91214
91255
|
exports.tokenColors = tokenColors;
|
|
91215
91256
|
exports.tokenize = tokenize;
|
|
91216
91257
|
|
|
91217
|
-
__info__.version = "19.5.0-alpha.
|
|
91218
|
-
__info__.date = "2026-08-
|
|
91219
|
-
__info__.hash = "
|
|
91258
|
+
__info__.version = "19.5.0-alpha.14";
|
|
91259
|
+
__info__.date = "2026-08-29T09:17:09.184Z";
|
|
91260
|
+
__info__.hash = "e8ad6ad";
|