@odoo/o-spreadsheet 19.5.0-alpha.12 → 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 +625 -563
- package/dist/o_spreadsheet.css +38 -22
- package/dist/o_spreadsheet.esm.js +625 -563
- package/dist/o_spreadsheet.iife.js +625 -563
- package/dist/o_spreadsheet.min.iife.js +300 -300
- package/dist/o_spreadsheet.xml +80 -67
- 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/chart/scorecard_chart_panel/scorecard_chart_config_panel.d.ts +6 -10
- 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 +3 -2
- 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/stores/main_viewport_store.d.ts +3 -0
- package/dist/types/stores/viewports_store.d.ts +0 -1
- package/dist/types/types/chart/chart.d.ts +3 -1
- package/dist/types/types/chart/scorecard_chart.d.ts +3 -4
- package/dist/types/types/commands.d.ts +15 -17
- 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 +4 -3
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' });
|
|
@@ -402,7 +402,13 @@ function createAction(item) {
|
|
|
402
402
|
if (isEnabled(env)) return item.execute(env, isMiddleClick);
|
|
403
403
|
} : void 0,
|
|
404
404
|
children: children ? (env) => {
|
|
405
|
-
|
|
405
|
+
const uniqueChildren = {};
|
|
406
|
+
children.flatMap((child) => typeof child === "function" ? child(env) : child).forEach((childSpec) => {
|
|
407
|
+
const childAction = createAction(childSpec);
|
|
408
|
+
if (uniqueChildren[childAction.id]) throw new Error(`Duplicate child action id "${childAction.id}" in action "${itemId}".`);
|
|
409
|
+
uniqueChildren[childAction.id] = childAction;
|
|
410
|
+
});
|
|
411
|
+
return Object.values(uniqueChildren).sort((a, b) => a.sequence - b.sequence);
|
|
406
412
|
} : () => [],
|
|
407
413
|
isReadonlyAllowed: item.isReadonlyAllowed || false,
|
|
408
414
|
isEnabledOnLockedSheet: item.isEnabledOnLockedSheet || false,
|
|
@@ -2632,7 +2638,6 @@ function unregisterChartJsExtensions() {
|
|
|
2632
2638
|
*
|
|
2633
2639
|
* 1. Update template directives:
|
|
2634
2640
|
* - replace `t-portal` → `t-custom-portal`
|
|
2635
|
-
* - replace `t-model` → `t-custom-model`
|
|
2636
2641
|
*
|
|
2637
2642
|
* 2. Load this file immediately after Owl 3.
|
|
2638
2643
|
*
|
|
@@ -2647,35 +2652,23 @@ function unregisterChartJsExtensions() {
|
|
|
2647
2652
|
* Gradually remove the compatibility layer by migrating to native Owl 3:
|
|
2648
2653
|
*
|
|
2649
2654
|
* - replace `t-custom-portal` with proper Owl 3 portal usage
|
|
2650
|
-
* - replace `t-custom-model` with `t-model` + signals
|
|
2651
2655
|
* - convert `useLayoutEffect` back to `useEffect` where appropriate
|
|
2652
2656
|
*
|
|
2653
2657
|
* The end goal is to eliminate all compatibility shims.
|
|
2654
2658
|
*/
|
|
2655
|
-
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;
|
|
2656
2660
|
const isOdooCompatLoaded = __ODOO_COMPATIBILITY_LAYER_ADDED__ === true;
|
|
2657
2661
|
var _Component = class extends OwlComponent {
|
|
2658
|
-
static template = "";
|
|
2659
2662
|
env;
|
|
2660
2663
|
constructor(node) {
|
|
2661
2664
|
super(node);
|
|
2662
|
-
this.env =
|
|
2663
|
-
this.__owl__ = node;
|
|
2665
|
+
this.env = _useEnv();
|
|
2664
2666
|
}
|
|
2665
2667
|
setup() {}
|
|
2666
|
-
render(deep = false) {
|
|
2667
|
-
this.__owl__.render(deep === true);
|
|
2668
|
-
}
|
|
2669
2668
|
};
|
|
2670
2669
|
function _useComponent() {
|
|
2671
2670
|
return useScope().component;
|
|
2672
2671
|
}
|
|
2673
|
-
function _useExternalListener(target, eventName, handler, eventParams) {
|
|
2674
|
-
const node = useScope();
|
|
2675
|
-
const boundHandler = handler.bind(node.component);
|
|
2676
|
-
onMounted$26(() => target.addEventListener(eventName, boundHandler, eventParams));
|
|
2677
|
-
onWillUnmount$20(() => target.removeEventListener(eventName, boundHandler, eventParams));
|
|
2678
|
-
}
|
|
2679
2672
|
function onWillRender(cb) {
|
|
2680
2673
|
const node = useScope();
|
|
2681
2674
|
const renderFn = node.renderFn;
|
|
@@ -2713,27 +2706,14 @@ var _EnvPlugin = class extends Plugin {
|
|
|
2713
2706
|
env = config("env") ?? {};
|
|
2714
2707
|
};
|
|
2715
2708
|
function _useEnv() {
|
|
2716
|
-
return
|
|
2717
|
-
}
|
|
2718
|
-
function provideEnv(env) {
|
|
2719
|
-
providePlugins([_EnvPlugin], { env });
|
|
2720
|
-
return env;
|
|
2721
|
-
}
|
|
2722
|
-
function extendEnv(extension) {
|
|
2723
|
-
const env = useChildEnv();
|
|
2724
|
-
const subEnv = Object.create(env);
|
|
2725
|
-
Object.defineProperties(subEnv, Object.getOwnPropertyDescriptors(extension));
|
|
2726
|
-
return provideEnv(subEnv);
|
|
2709
|
+
return usePlugin(_EnvPlugin).env;
|
|
2727
2710
|
}
|
|
2728
2711
|
function _useSubEnv(extension) {
|
|
2729
|
-
const
|
|
2730
|
-
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
}
|
|
2735
|
-
function _useChildEnv() {
|
|
2736
|
-
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;
|
|
2737
2717
|
}
|
|
2738
2718
|
var VPortal = class extends blockDom$1.text("").constructor {
|
|
2739
2719
|
/**
|
|
@@ -2782,7 +2762,7 @@ var Portal = class extends OwlComponent {
|
|
|
2782
2762
|
static template = xml$5`<t t-call-slot="default"/>`;
|
|
2783
2763
|
constructor(node) {
|
|
2784
2764
|
super(node);
|
|
2785
|
-
this.props =
|
|
2765
|
+
this.props = useProps$171();
|
|
2786
2766
|
this.__owl__ = node;
|
|
2787
2767
|
}
|
|
2788
2768
|
setup() {
|
|
@@ -2815,18 +2795,6 @@ const customDirectives = {
|
|
|
2815
2795
|
/**
|
|
2816
2796
|
* @param {HTMLElement} node
|
|
2817
2797
|
* @param {string} value
|
|
2818
|
-
* @param {string[]} modifiers
|
|
2819
|
-
*/
|
|
2820
|
-
model: (node, value, modifiers) => {
|
|
2821
|
-
let attribute = "t-model";
|
|
2822
|
-
for (const modifier of modifiers) attribute += `.${modifier}`;
|
|
2823
|
-
const getter = `() => ${value}`;
|
|
2824
|
-
const setter = `(nv) => {${value} = nv;}`;
|
|
2825
|
-
node.setAttribute(attribute, `__globals__.createModelSignal(${getter}, ${setter})`);
|
|
2826
|
-
},
|
|
2827
|
-
/**
|
|
2828
|
-
* @param {HTMLElement} node
|
|
2829
|
-
* @param {string} value
|
|
2830
2798
|
*/
|
|
2831
2799
|
portal: (node, value) => {
|
|
2832
2800
|
if (node.nodeName.toLowerCase() !== "t") throw new Error("t-custom-portal should be on a 't' element");
|
|
@@ -2855,11 +2823,6 @@ set(value) {
|
|
|
2855
2823
|
refInfo.values[refId] = value;
|
|
2856
2824
|
} };
|
|
2857
2825
|
},
|
|
2858
|
-
/**
|
|
2859
|
-
* @param {Function} getter
|
|
2860
|
-
* @param {Function} setter
|
|
2861
|
-
*/
|
|
2862
|
-
createModelSignal: (getter, setter) => Object.assign(getter, { set: setter }),
|
|
2863
2826
|
Portal
|
|
2864
2827
|
};
|
|
2865
2828
|
var _App = class extends OwlApp {
|
|
@@ -2885,7 +2848,7 @@ var _App = class extends OwlApp {
|
|
|
2885
2848
|
createRoot(component, config = {}) {
|
|
2886
2849
|
if (config.env) component = { [component.name]: class extends component {
|
|
2887
2850
|
constructor(node) {
|
|
2888
|
-
|
|
2851
|
+
providePlugins([_EnvPlugin], { env: config.env });
|
|
2889
2852
|
super(node);
|
|
2890
2853
|
}
|
|
2891
2854
|
} }[component.name];
|
|
@@ -2894,13 +2857,10 @@ var _App = class extends OwlApp {
|
|
|
2894
2857
|
};
|
|
2895
2858
|
const Component = isOdooCompatLoaded ? OwlComponent : _Component;
|
|
2896
2859
|
const useComponent = isOdooCompatLoaded ? OwlUseComponent : _useComponent;
|
|
2897
|
-
const useExternalListener = isOdooCompatLoaded ? OwlUseExternalListener : _useExternalListener;
|
|
2898
2860
|
const useLayoutEffect = isOdooCompatLoaded ? OwlUseLayoutEffect : _useLayoutEffect;
|
|
2899
2861
|
const EnvPlugin = isOdooCompatLoaded ? OwlEnvPlugin : _EnvPlugin;
|
|
2900
2862
|
const useEnv = isOdooCompatLoaded ? OwlUseEnv : _useEnv;
|
|
2901
2863
|
const useSubEnv = isOdooCompatLoaded ? OwlUseSubEnv : _useSubEnv;
|
|
2902
|
-
const useChildEnv = isOdooCompatLoaded ? OwlUseChildEnv : _useChildEnv;
|
|
2903
|
-
const useChildSubEnv = isOdooCompatLoaded ? OwlUseChildSubEnv : _useChildSubEnv;
|
|
2904
2864
|
const App$1 = isOdooCompatLoaded ? OwlApp : _App;
|
|
2905
2865
|
|
|
2906
2866
|
//#endregion
|
|
@@ -5408,7 +5368,7 @@ function _roundFormat(internalFormat) {
|
|
|
5408
5368
|
}
|
|
5409
5369
|
function humanizeNumber({ value, format }, locale) {
|
|
5410
5370
|
const numberValue = tryToNumber(value, locale);
|
|
5411
|
-
if (numberValue === void 0) return "";
|
|
5371
|
+
if (numberValue === void 0) return value?.toString() || "";
|
|
5412
5372
|
let numberFormat = format;
|
|
5413
5373
|
if (Math.abs(numberValue) < 1e3) {
|
|
5414
5374
|
const hasDecimal = numberValue % 1 !== 0;
|
|
@@ -7944,7 +7904,8 @@ const readonlyAllowedCommands = /* @__PURE__ */ new Set([
|
|
|
7944
7904
|
"UPDATE_CHART",
|
|
7945
7905
|
"UPDATE_CHART_REGION",
|
|
7946
7906
|
"UPDATE_CAROUSEL_ACTIVE_ITEM",
|
|
7947
|
-
"UPDATE_PIVOT"
|
|
7907
|
+
"UPDATE_PIVOT",
|
|
7908
|
+
"UPDATE_COLOR_SCHEME"
|
|
7948
7909
|
]);
|
|
7949
7910
|
const lockedSheetAllowedCommands = /* @__PURE__ */ new Set([
|
|
7950
7911
|
"LOCK_SHEET",
|
|
@@ -8123,8 +8084,6 @@ let CommandResult = /* @__PURE__ */ function(CommandResult) {
|
|
|
8123
8084
|
CommandResult["InvalidXRange"] = "InvalidXRange";
|
|
8124
8085
|
CommandResult["InvalidLabelRange"] = "InvalidLabelRange";
|
|
8125
8086
|
CommandResult["InvalidBubbleSizeRange"] = "InvalidBubbleSizeRange";
|
|
8126
|
-
CommandResult["InvalidScorecardKeyValue"] = "InvalidScorecardKeyValue";
|
|
8127
|
-
CommandResult["InvalidScorecardBaseline"] = "InvalidScorecardBaseline";
|
|
8128
8087
|
CommandResult["InvalidGaugeDataRange"] = "InvalidGaugeDataRange";
|
|
8129
8088
|
CommandResult["EmptyGaugeRangeMin"] = "EmptyGaugeRangeMin";
|
|
8130
8089
|
CommandResult["GaugeRangeMinNaN"] = "GaugeRangeMinNaN";
|
|
@@ -9990,6 +9949,46 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
9990
9949
|
];
|
|
9991
9950
|
const CONTENT_TYPES_FILE = "[Content_Types].xml";
|
|
9992
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
|
+
|
|
9993
9992
|
//#endregion
|
|
9994
9993
|
//#region src/helpers/figures/charts/chart_common.ts
|
|
9995
9994
|
const TREND_LINE_XAXIS_ID = "x1";
|
|
@@ -10211,9 +10210,8 @@ function truncateLabel(label, maxLen = 20) {
|
|
|
10211
10210
|
function isTrendLineAxis(axisID) {
|
|
10212
10211
|
return axisID === "x1" || axisID === "xMovingAverage";
|
|
10213
10212
|
}
|
|
10214
|
-
function getChartBackgroundColor({ background },
|
|
10215
|
-
|
|
10216
|
-
if (!background) return defaultColor;
|
|
10213
|
+
function getChartBackgroundColor({ background }, colorThemeName) {
|
|
10214
|
+
if (!background) return COLOR_THEMES[colorThemeName].backgroundColor;
|
|
10217
10215
|
return background;
|
|
10218
10216
|
}
|
|
10219
10217
|
|
|
@@ -12011,6 +12009,110 @@ var ChartJsComponent = class extends Component {
|
|
|
12011
12009
|
}
|
|
12012
12010
|
};
|
|
12013
12011
|
|
|
12012
|
+
//#endregion
|
|
12013
|
+
//#region src/functions/helper_matrices.ts
|
|
12014
|
+
function getUnitMatrix(n) {
|
|
12015
|
+
const matrix = Array(n);
|
|
12016
|
+
for (let i = 0; i < n; i++) {
|
|
12017
|
+
matrix[i] = Array(n).fill(0);
|
|
12018
|
+
matrix[i][i] = 1;
|
|
12019
|
+
}
|
|
12020
|
+
return matrix;
|
|
12021
|
+
}
|
|
12022
|
+
/**
|
|
12023
|
+
* Invert a matrix and compute its determinant using Gaussian Elimination.
|
|
12024
|
+
*
|
|
12025
|
+
* The Matrix should be a square matrix, and should be indexed [col][row] instead of the
|
|
12026
|
+
* standard mathematical indexing [row][col].
|
|
12027
|
+
*/
|
|
12028
|
+
function invertMatrix(M) {
|
|
12029
|
+
if (M.length < 1 || M[0].length < 1) throw new Error("invertMatrix: an empty matrix cannot be inverted.");
|
|
12030
|
+
if (M.length !== M[0].length) throw new Error("invertMatrix: only square matrices are invertible");
|
|
12031
|
+
let determinant = 1;
|
|
12032
|
+
const dim = M.length;
|
|
12033
|
+
const I = getUnitMatrix(dim);
|
|
12034
|
+
const C = M.map((row) => row.slice());
|
|
12035
|
+
for (let pivot = 0; pivot < dim; pivot++) {
|
|
12036
|
+
let diagonalElement = C[pivot][pivot];
|
|
12037
|
+
if (diagonalElement === 0) {
|
|
12038
|
+
for (let row = pivot + 1; row < dim; row++) if (C[pivot][row] !== 0) {
|
|
12039
|
+
swapMatrixRows(C, pivot, row);
|
|
12040
|
+
swapMatrixRows(I, pivot, row);
|
|
12041
|
+
determinant *= -1;
|
|
12042
|
+
break;
|
|
12043
|
+
}
|
|
12044
|
+
diagonalElement = C[pivot][pivot];
|
|
12045
|
+
if (diagonalElement === 0) return { determinant: 0 };
|
|
12046
|
+
}
|
|
12047
|
+
for (let col = 0; col < dim; col++) {
|
|
12048
|
+
C[col][pivot] = C[col][pivot] / diagonalElement;
|
|
12049
|
+
I[col][pivot] = I[col][pivot] / diagonalElement;
|
|
12050
|
+
}
|
|
12051
|
+
determinant *= diagonalElement;
|
|
12052
|
+
for (let row = 0; row < dim; row++) {
|
|
12053
|
+
if (row === pivot) continue;
|
|
12054
|
+
const e = C[pivot][row];
|
|
12055
|
+
for (let col = 0; col < dim; col++) {
|
|
12056
|
+
C[col][row] -= e * C[col][pivot];
|
|
12057
|
+
I[col][row] -= e * I[col][pivot];
|
|
12058
|
+
}
|
|
12059
|
+
}
|
|
12060
|
+
}
|
|
12061
|
+
return {
|
|
12062
|
+
inverted: I,
|
|
12063
|
+
determinant
|
|
12064
|
+
};
|
|
12065
|
+
}
|
|
12066
|
+
function swapMatrixRows(matrix, row1, row2) {
|
|
12067
|
+
for (let i = 0; i < matrix.length; i++) {
|
|
12068
|
+
const tmp = matrix[i][row1];
|
|
12069
|
+
matrix[i][row1] = matrix[i][row2];
|
|
12070
|
+
matrix[i][row2] = tmp;
|
|
12071
|
+
}
|
|
12072
|
+
}
|
|
12073
|
+
/**
|
|
12074
|
+
* Matrix multiplication of 2 matrices.
|
|
12075
|
+
* ex: matrix1 : n x l, matrix2 : m x n => result : m x l
|
|
12076
|
+
*
|
|
12077
|
+
* Note: we use indexing [col][row] instead of the standard mathematical notation [row][col]
|
|
12078
|
+
*/
|
|
12079
|
+
function multiplyMatrices(matrix1, matrix2) {
|
|
12080
|
+
if (matrix1.length < 1 || matrix2.length < 1) throw new Error("multiplyMatrices: empty matrices cannot be multiplied.");
|
|
12081
|
+
if (matrix1.length !== matrix2[0].length) throw new Error("multiplyMatrices: incompatible matrices size.");
|
|
12082
|
+
const rowsM1 = matrix1[0].length;
|
|
12083
|
+
const colsM2 = matrix2.length;
|
|
12084
|
+
const n = matrix1.length;
|
|
12085
|
+
const result = Array(colsM2);
|
|
12086
|
+
for (let col = 0; col < colsM2; col++) {
|
|
12087
|
+
result[col] = Array(rowsM1);
|
|
12088
|
+
for (let row = 0; row < rowsM1; row++) {
|
|
12089
|
+
let sum = 0;
|
|
12090
|
+
for (let k = 0; k < n; k++) sum += matrix1[k][row] * matrix2[col][k];
|
|
12091
|
+
result[col][row] = sum;
|
|
12092
|
+
}
|
|
12093
|
+
}
|
|
12094
|
+
return result;
|
|
12095
|
+
}
|
|
12096
|
+
/**
|
|
12097
|
+
* Return the input if it's a scalar or the first element of the input if it's a matrix.
|
|
12098
|
+
*/
|
|
12099
|
+
function toScalar(arg) {
|
|
12100
|
+
if (!isMatrix(arg)) return arg;
|
|
12101
|
+
if (!isSingleElementMatrix(arg)) throw new Error("The value should be a scalar or a 1x1 matrix");
|
|
12102
|
+
return arg[0][0];
|
|
12103
|
+
}
|
|
12104
|
+
function isSingleElementMatrix(matrix) {
|
|
12105
|
+
return matrix.length === 1 && matrix[0].length === 1;
|
|
12106
|
+
}
|
|
12107
|
+
function isMultipleElementMatrix(arg) {
|
|
12108
|
+
return isMatrix(arg) && !isSingleElementMatrix(arg);
|
|
12109
|
+
}
|
|
12110
|
+
function getMatrixArgIndices(args) {
|
|
12111
|
+
const indices = [];
|
|
12112
|
+
for (let i = 0; i < args.length; i++) if (isMultipleElementMatrix(args[i])) indices.push(i);
|
|
12113
|
+
return indices;
|
|
12114
|
+
}
|
|
12115
|
+
|
|
12014
12116
|
//#endregion
|
|
12015
12117
|
//#region src/helpers/figures/charts/abstract_chart.ts
|
|
12016
12118
|
var AbstractChart = class {
|
|
@@ -12026,11 +12128,42 @@ var AbstractChart = class {
|
|
|
12026
12128
|
|
|
12027
12129
|
//#endregion
|
|
12028
12130
|
//#region src/helpers/figures/charts/scorecard_chart.ts
|
|
12131
|
+
function getData$1(value, getters, sheetId) {
|
|
12132
|
+
if (!value) return {
|
|
12133
|
+
scalar: void 0,
|
|
12134
|
+
range: void 0
|
|
12135
|
+
};
|
|
12136
|
+
if (!isFormula(value)) return {
|
|
12137
|
+
scalar: { value },
|
|
12138
|
+
range: void 0
|
|
12139
|
+
};
|
|
12140
|
+
const result = getters.evaluateFormulaResult(sheetId, value);
|
|
12141
|
+
let scalar = isMultipleElementMatrix(result) ? result[0][0] : toScalar(result);
|
|
12142
|
+
let range = void 0;
|
|
12143
|
+
const xc = getFormulaRangeXc(value);
|
|
12144
|
+
if (xc) {
|
|
12145
|
+
range = createValidRange(getters, sheetId, xc);
|
|
12146
|
+
if (range) {
|
|
12147
|
+
if (getters.getEvaluatedCell({
|
|
12148
|
+
sheetId: range.sheetId,
|
|
12149
|
+
col: range.zone.left,
|
|
12150
|
+
row: range.zone.top
|
|
12151
|
+
}).type === "empty") scalar = void 0;
|
|
12152
|
+
}
|
|
12153
|
+
}
|
|
12154
|
+
return {
|
|
12155
|
+
scalar,
|
|
12156
|
+
range
|
|
12157
|
+
};
|
|
12158
|
+
}
|
|
12029
12159
|
function getBaselineText(baseline, keyValue, baselineMode, humanizeNumbers, locale) {
|
|
12030
12160
|
if (!baseline) return "";
|
|
12031
|
-
else if (baselineMode === "text" || keyValue?.
|
|
12161
|
+
else if (baselineMode === "text" || typeof keyValue?.value !== "number" || typeof baseline.value !== "number") {
|
|
12032
12162
|
if (humanizeNumbers) return humanizeNumber(baseline, locale);
|
|
12033
|
-
return baseline.
|
|
12163
|
+
return formatValue(baseline.value, {
|
|
12164
|
+
format: baseline.format,
|
|
12165
|
+
locale
|
|
12166
|
+
});
|
|
12034
12167
|
}
|
|
12035
12168
|
let { value, format } = baseline;
|
|
12036
12169
|
if (baselineMode === "progress") {
|
|
@@ -12051,29 +12184,31 @@ function getBaselineText(baseline, keyValue, baselineMode, humanizeNumbers, loca
|
|
|
12051
12184
|
locale
|
|
12052
12185
|
});
|
|
12053
12186
|
}
|
|
12054
|
-
function getKeyValueText(
|
|
12055
|
-
if (
|
|
12056
|
-
if (humanizeNumbers) return humanizeNumber(
|
|
12057
|
-
return
|
|
12187
|
+
function getKeyValueText(keyValue, humanizeNumbers, locale) {
|
|
12188
|
+
if (keyValue?.value === void 0 || keyValue?.value === null) return "";
|
|
12189
|
+
if (humanizeNumbers) return humanizeNumber(keyValue, locale);
|
|
12190
|
+
return keyValue.format ? formatValue(keyValue.value, {
|
|
12191
|
+
format: keyValue.format,
|
|
12192
|
+
locale
|
|
12193
|
+
}) : String(keyValue.value ?? "");
|
|
12058
12194
|
}
|
|
12059
12195
|
function getBaselineColor(baseline, baselineMode, keyValue, colorUp, colorDown) {
|
|
12060
|
-
if (baselineMode === "text" || baselineMode === "progress" || baseline?.
|
|
12196
|
+
if (baselineMode === "text" || baselineMode === "progress" || typeof baseline?.value !== "number" || typeof keyValue?.value !== "number") return;
|
|
12061
12197
|
const diff = keyValue.value - baseline.value;
|
|
12062
12198
|
if (diff > 0) return colorUp;
|
|
12063
12199
|
else if (diff < 0) return colorDown;
|
|
12064
12200
|
}
|
|
12065
12201
|
function getBaselineArrowDirection(baseline, keyValue, baselineMode) {
|
|
12066
|
-
if (baselineMode === "text" || baseline?.
|
|
12202
|
+
if (baselineMode === "text" || typeof baseline?.value !== "number" || typeof keyValue?.value !== "number") return "neutral";
|
|
12067
12203
|
const diff = keyValue.value - baseline.value;
|
|
12068
12204
|
if (diff > 0) return "up";
|
|
12069
12205
|
else if (diff < 0) return "down";
|
|
12070
12206
|
return "neutral";
|
|
12071
12207
|
}
|
|
12072
|
-
function
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
return definition.baseline && !rangeReference.test(definition.baseline) ? "InvalidScorecardBaseline" : "Success";
|
|
12208
|
+
function getFormulaRangeXc(formula) {
|
|
12209
|
+
if (!formula || !isFormula(formula)) return;
|
|
12210
|
+
const content = formula.slice(1);
|
|
12211
|
+
return rangeReference.test(content) ? content : void 0;
|
|
12077
12212
|
}
|
|
12078
12213
|
const Path2DConstructor = globalThis.Path2D;
|
|
12079
12214
|
const arrowDownPath = Path2DConstructor && new Path2DConstructor("M8.6 4.8a.5.5 0 0 1 0 .75l-3.9 3.9a.5 .5 0 0 1 -.75 0l-3.8 -3.9a.5 .5 0 0 1 0 -.75l.4-.4a.5.5 0 0 1 .75 0l2.3 2.4v-5.7c0-.25.25-.5.5-.5h.6c.25 0 .5.25.5.5v5.8l2.3 -2.4a.5.5 0 0 1 .75 0z");
|
|
@@ -12090,84 +12225,76 @@ const ScorecardChart$1 = {
|
|
|
12090
12225
|
"baselineColorUp",
|
|
12091
12226
|
"baselineColorDown"
|
|
12092
12227
|
],
|
|
12093
|
-
fromStrDefinition(definition
|
|
12094
|
-
|
|
12095
|
-
|
|
12228
|
+
fromStrDefinition: (definition) => definition,
|
|
12229
|
+
validateDefinition(validator, definition) {
|
|
12230
|
+
return "Success";
|
|
12231
|
+
},
|
|
12232
|
+
copyInSheetId: (definition, sheetIdFrom, sheetIdTo, getters) => {
|
|
12233
|
+
const adaptFormula = (formula) => getters.copyFormulaStringForSheet(sheetIdFrom, sheetIdTo, formula, "keepSameReference");
|
|
12096
12234
|
return {
|
|
12097
12235
|
...definition,
|
|
12098
|
-
|
|
12099
|
-
|
|
12236
|
+
keyValue: definition.keyValue ? adaptFormula(definition.keyValue) : definition.keyValue,
|
|
12237
|
+
baseline: definition.baseline ? adaptFormula(definition.baseline) : definition.baseline
|
|
12100
12238
|
};
|
|
12101
12239
|
},
|
|
12102
|
-
validateDefinition(validator, definition) {
|
|
12103
|
-
return validator.checkValidations(definition, checkKeyValue, checkBaseline);
|
|
12104
|
-
},
|
|
12105
|
-
copyInSheetId: (definition) => definition,
|
|
12106
12240
|
getDefinitionFromContextCreation(context, dataSourceBuilder) {
|
|
12241
|
+
const dataRange = context.dataSource?.type === "range" ? context.dataSource?.dataSets?.[0]?.dataRange : void 0;
|
|
12242
|
+
const keyValue = (context.scorecardKeyValueFormula === void 0 || getFormulaRangeXc(context.scorecardKeyValueFormula)) && dataRange ? `=${dataRange}` : context.scorecardKeyValueFormula;
|
|
12243
|
+
const baseline = (context.scorecardBaselineFormula === void 0 || getFormulaRangeXc(context.scorecardBaselineFormula)) && context.auxiliaryRange ? `=${context.auxiliaryRange}` : context.scorecardBaselineFormula;
|
|
12107
12244
|
return {
|
|
12108
12245
|
background: context.background,
|
|
12109
12246
|
type: "scorecard",
|
|
12110
|
-
keyValue
|
|
12247
|
+
keyValue,
|
|
12111
12248
|
title: context.title || { text: "" },
|
|
12112
12249
|
baselineMode: DEFAULT_SCORECARD_BASELINE_MODE,
|
|
12113
12250
|
baselineColorUp: DEFAULT_SCORECARD_BASELINE_COLOR_UP,
|
|
12114
12251
|
baselineColorDown: DEFAULT_SCORECARD_BASELINE_COLOR_DOWN,
|
|
12115
|
-
baseline
|
|
12252
|
+
baseline,
|
|
12116
12253
|
humanize: context.humanize,
|
|
12117
12254
|
annotationLink: context.annotationLink,
|
|
12118
12255
|
annotationText: context.annotationText
|
|
12119
12256
|
};
|
|
12120
12257
|
},
|
|
12121
|
-
transformDefinition(definition, chartSheetId, {
|
|
12258
|
+
transformDefinition(definition, chartSheetId, { adaptFormulaString }) {
|
|
12122
12259
|
let baseline;
|
|
12123
12260
|
let keyValue;
|
|
12124
|
-
if (definition.baseline)
|
|
12125
|
-
|
|
12126
|
-
if (changeType !== "REMOVE") baseline = adaptedRange;
|
|
12127
|
-
}
|
|
12128
|
-
if (definition.keyValue) {
|
|
12129
|
-
const { changeType, range: adaptedRange } = adaptRangeString(chartSheetId, definition.keyValue);
|
|
12130
|
-
if (changeType !== "REMOVE") keyValue = adaptedRange;
|
|
12131
|
-
}
|
|
12132
|
-
return {
|
|
12133
|
-
...definition,
|
|
12134
|
-
baseline,
|
|
12135
|
-
keyValue
|
|
12136
|
-
};
|
|
12137
|
-
},
|
|
12138
|
-
duplicateInDuplicatedSheet(definition, sheetIdFrom, sheetIdTo) {
|
|
12139
|
-
const baseline = duplicateLabelRangeInDuplicatedSheet(sheetIdFrom, sheetIdTo, definition.baseline);
|
|
12140
|
-
const keyValue = duplicateLabelRangeInDuplicatedSheet(sheetIdFrom, sheetIdTo, definition.keyValue);
|
|
12261
|
+
if (definition.baseline) baseline = adaptFormulaString(chartSheetId, definition.baseline);
|
|
12262
|
+
if (definition.keyValue) keyValue = adaptFormulaString(chartSheetId, definition.keyValue);
|
|
12141
12263
|
return {
|
|
12142
12264
|
...definition,
|
|
12143
12265
|
baseline,
|
|
12144
12266
|
keyValue
|
|
12145
12267
|
};
|
|
12146
12268
|
},
|
|
12147
|
-
|
|
12269
|
+
duplicateInDuplicatedSheet(definition, sheetIdFrom, sheetIdTo, getters) {
|
|
12270
|
+
const adaptFormula = (formula) => getters.copyFormulaStringForSheet(sheetIdFrom, sheetIdTo, formula, "moveReference");
|
|
12148
12271
|
return {
|
|
12149
12272
|
...definition,
|
|
12150
|
-
keyValue: definition.keyValue ?
|
|
12151
|
-
baseline: definition.baseline ?
|
|
12273
|
+
keyValue: definition.keyValue ? adaptFormula(definition.keyValue) : definition.keyValue,
|
|
12274
|
+
baseline: definition.baseline ? adaptFormula(definition.baseline) : definition.baseline
|
|
12152
12275
|
};
|
|
12153
12276
|
},
|
|
12277
|
+
toStrDefinition: (definition) => definition,
|
|
12154
12278
|
getContextCreation(definition, dataSource) {
|
|
12279
|
+
const keyValueXc = getFormulaRangeXc(definition.keyValue);
|
|
12155
12280
|
return {
|
|
12156
12281
|
...definition,
|
|
12157
12282
|
dataSource: {
|
|
12158
12283
|
type: "range",
|
|
12159
|
-
dataSets:
|
|
12160
|
-
dataRange:
|
|
12284
|
+
dataSets: keyValueXc ? [{
|
|
12285
|
+
dataRange: keyValueXc,
|
|
12161
12286
|
dataSetId: "0"
|
|
12162
12287
|
}] : []
|
|
12163
12288
|
},
|
|
12164
|
-
auxiliaryRange: definition.baseline
|
|
12289
|
+
auxiliaryRange: getFormulaRangeXc(definition.baseline),
|
|
12290
|
+
scorecardKeyValueFormula: definition.keyValue,
|
|
12291
|
+
scorecardBaselineFormula: definition.baseline
|
|
12165
12292
|
};
|
|
12166
12293
|
},
|
|
12167
12294
|
getDefinitionForExcel: () => void 0,
|
|
12168
|
-
updateRanges(definition, adapterFunctions) {
|
|
12169
|
-
const baseline =
|
|
12170
|
-
const keyValue =
|
|
12295
|
+
updateRanges(definition, adapterFunctions, sheetId) {
|
|
12296
|
+
const baseline = definition.baseline ? adapterFunctions.adaptFormulaString(sheetId, definition.baseline) : definition.baseline;
|
|
12297
|
+
const keyValue = definition.keyValue ? adapterFunctions.adaptFormulaString(sheetId, definition.keyValue) : definition.keyValue;
|
|
12171
12298
|
if (definition.baseline === baseline && definition.keyValue === keyValue) return definition;
|
|
12172
12299
|
return {
|
|
12173
12300
|
...definition,
|
|
@@ -12175,32 +12302,21 @@ const ScorecardChart$1 = {
|
|
|
12175
12302
|
keyValue
|
|
12176
12303
|
};
|
|
12177
12304
|
},
|
|
12178
|
-
getFormulas
|
|
12179
|
-
|
|
12305
|
+
getFormulas(getters, sheetId, definition) {
|
|
12306
|
+
const formulas = [];
|
|
12307
|
+
if (definition.keyValue && isFormula(definition.keyValue)) formulas.push(CompiledFormula.Compile(definition.keyValue, sheetId, getters));
|
|
12308
|
+
if (definition.baseline && isFormula(definition.baseline)) formulas.push(CompiledFormula.Compile(definition.baseline, sheetId, getters));
|
|
12309
|
+
return formulas;
|
|
12310
|
+
},
|
|
12311
|
+
getRuntime(getters, definition, _dataExtractor, sheetId, eventHandlers, colorThemeName) {
|
|
12180
12312
|
let formattedKeyValue = "";
|
|
12181
|
-
|
|
12313
|
+
const { scalar: keyValue, range: keyValueRange } = getData$1(definition.keyValue, getters, sheetId);
|
|
12182
12314
|
const locale = getters.getLocale();
|
|
12183
|
-
if (definition.
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
};
|
|
12189
|
-
keyValueCell = getters.getEvaluatedCell(keyValuePosition);
|
|
12190
|
-
formattedKeyValue = getKeyValueText(keyValueCell, definition.humanize ?? true, locale);
|
|
12191
|
-
}
|
|
12192
|
-
let baselineCell;
|
|
12193
|
-
const baseline = definition.baseline;
|
|
12194
|
-
if (baseline) {
|
|
12195
|
-
const baselinePosition = {
|
|
12196
|
-
sheetId: baseline.sheetId,
|
|
12197
|
-
col: baseline.zone.left,
|
|
12198
|
-
row: baseline.zone.top
|
|
12199
|
-
};
|
|
12200
|
-
baselineCell = getters.getEvaluatedCell(baselinePosition);
|
|
12201
|
-
}
|
|
12202
|
-
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, definition.keyValue);
|
|
12203
|
-
const baselineDisplay = getBaselineText(baselineCell, keyValueCell, definition.baselineMode, definition.humanize ?? true, locale);
|
|
12315
|
+
if (keyValue !== null && keyValue !== void 0) formattedKeyValue = getKeyValueText(keyValue, definition.humanize ?? true, locale);
|
|
12316
|
+
else formattedKeyValue = "";
|
|
12317
|
+
const { scalar: baseline, range: baselineRange } = getData$1(definition.baseline, getters, sheetId);
|
|
12318
|
+
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, keyValueRange, colorThemeName);
|
|
12319
|
+
const baselineDisplay = getBaselineText(baseline, keyValue, definition.baselineMode, definition.humanize ?? true, locale);
|
|
12204
12320
|
const baselineValue = definition.baselineMode === "progress" && isNumber(baselineDisplay, locale) ? toNumber(baselineDisplay, locale) : 0;
|
|
12205
12321
|
const title = definition.title;
|
|
12206
12322
|
return {
|
|
@@ -12211,16 +12327,16 @@ const ScorecardChart$1 = {
|
|
|
12211
12327
|
keyValue: formattedKeyValue,
|
|
12212
12328
|
keyDescr: definition.keyDescr?.text ? getters.dynamicTranslate(definition.keyDescr.text) : "",
|
|
12213
12329
|
baselineDisplay,
|
|
12214
|
-
baselineArrow: getBaselineArrowDirection(
|
|
12215
|
-
baselineColor: getBaselineColor(
|
|
12330
|
+
baselineArrow: getBaselineArrowDirection(baseline, keyValue, definition.baselineMode),
|
|
12331
|
+
baselineColor: getBaselineColor(baseline, definition.baselineMode, keyValue, definition.baselineColorUp, definition.baselineColorDown),
|
|
12216
12332
|
baselineDescr: definition.baselineMode !== "progress" && definition.baselineDescr?.text ? getters.dynamicTranslate(definition.baselineDescr.text) : "",
|
|
12217
12333
|
fontColor,
|
|
12218
12334
|
background,
|
|
12219
12335
|
baselineStyle: {
|
|
12220
|
-
...definition.baselineMode !== "percentage" && definition.baselineMode !== "progress" &&
|
|
12221
|
-
sheetId:
|
|
12222
|
-
col:
|
|
12223
|
-
row:
|
|
12336
|
+
...definition.baselineMode !== "percentage" && definition.baselineMode !== "progress" && baselineRange ? getters.getCellComputedStyle({
|
|
12337
|
+
sheetId: baselineRange.sheetId,
|
|
12338
|
+
col: baselineRange.zone.left,
|
|
12339
|
+
row: baselineRange.zone.top
|
|
12224
12340
|
}) : void 0,
|
|
12225
12341
|
fontSize: definition.baselineDescr?.fontSize,
|
|
12226
12342
|
align: definition.baselineDescr?.align
|
|
@@ -12230,10 +12346,10 @@ const ScorecardChart$1 = {
|
|
|
12230
12346
|
...definition.baselineDescr
|
|
12231
12347
|
},
|
|
12232
12348
|
keyValueStyle: {
|
|
12233
|
-
...
|
|
12234
|
-
sheetId:
|
|
12235
|
-
col:
|
|
12236
|
-
row:
|
|
12349
|
+
...keyValueRange ? getters.getCellComputedStyle({
|
|
12350
|
+
sheetId: keyValueRange.sheetId,
|
|
12351
|
+
col: keyValueRange.zone.left,
|
|
12352
|
+
row: keyValueRange.zone.top
|
|
12237
12353
|
}) : void 0,
|
|
12238
12354
|
fontSize: definition.keyDescr?.fontSize,
|
|
12239
12355
|
align: definition.keyDescr?.align
|
|
@@ -13735,33 +13851,8 @@ var ViewportsStore = class extends SpreadsheetStore {
|
|
|
13735
13851
|
displayedSheetId = this.model.getters.getActiveSheetId();
|
|
13736
13852
|
constructor(get) {
|
|
13737
13853
|
super(get);
|
|
13738
|
-
this.model.selection.observe(this, { handleEvent: this.handleEvent.bind(this) });
|
|
13739
|
-
this.onDispose(() => {
|
|
13740
|
-
this.model.selection.unobserve(this);
|
|
13741
|
-
});
|
|
13742
13854
|
this.viewports.resetViewports(this.displayedSheetId);
|
|
13743
13855
|
}
|
|
13744
|
-
handleEvent(event) {
|
|
13745
|
-
const eventSheetId = this.getters.getActiveSheetId();
|
|
13746
|
-
if (event.options.scrollIntoView) {
|
|
13747
|
-
const oldZone = event.previousAnchor.zone;
|
|
13748
|
-
const newZone = event.anchor.zone;
|
|
13749
|
-
const isUpdateAnchorEvent = event.mode === "updateAnchor";
|
|
13750
|
-
const sameZone = isEqual(oldZone, newZone);
|
|
13751
|
-
let { col, row } = isUpdateAnchorEvent && sameZone ? event.anchor.cell : findCellInNewZone(oldZone, newZone);
|
|
13752
|
-
if (isUpdateAnchorEvent && !sameZone) {
|
|
13753
|
-
const { top, bottom, left, right } = this.viewports.getMainInternalViewport(eventSheetId);
|
|
13754
|
-
if (oldZone.left === newZone.left && oldZone.right === newZone.right) col = left > col || col > right ? left : col;
|
|
13755
|
-
if (oldZone.top === newZone.top && oldZone.bottom === newZone.bottom) row = top > row || row > bottom ? top : row;
|
|
13756
|
-
}
|
|
13757
|
-
col = Math.min(col, this.getters.getNumberCols(eventSheetId) - 1);
|
|
13758
|
-
row = Math.min(row, this.getters.getNumberRows(eventSheetId) - 1);
|
|
13759
|
-
if (!this.sheetsWithDirtyViewports.has(eventSheetId)) this.viewports.refreshViewport(eventSheetId, {
|
|
13760
|
-
col,
|
|
13761
|
-
row
|
|
13762
|
-
});
|
|
13763
|
-
}
|
|
13764
|
-
}
|
|
13765
13856
|
handle(cmd) {
|
|
13766
13857
|
if (invalidateEvaluationCommands.has(cmd.type)) for (const sheetId of this.getters.getSheetIds()) this.sheetsWithDirtyViewports.add(sheetId);
|
|
13767
13858
|
switch (cmd.type) {
|
|
@@ -13861,6 +13952,7 @@ var ViewportsStore = class extends SpreadsheetStore {
|
|
|
13861
13952
|
this.shiftVertically(topRowDims.end - boundaryTopY - viewportHeight);
|
|
13862
13953
|
}
|
|
13863
13954
|
scrollToCell(sheetId, col, row) {
|
|
13955
|
+
if (this.sheetsWithDirtyViewports.has(sheetId)) return;
|
|
13864
13956
|
this.viewports.refreshViewport(sheetId, {
|
|
13865
13957
|
col,
|
|
13866
13958
|
row
|
|
@@ -14463,22 +14555,35 @@ function sampleIndices(length, maxPoints) {
|
|
|
14463
14555
|
const step = length / maxPoints;
|
|
14464
14556
|
return Array.from({ length: maxPoints }, (_, i) => Math.min(length - 1, Math.floor(i * step)));
|
|
14465
14557
|
}
|
|
14466
|
-
async function chartToImageUrl(runtime, figure, type) {
|
|
14558
|
+
async function chartToImageUrl(runtime, figure, type, colorThemeName = "light") {
|
|
14467
14559
|
try {
|
|
14468
14560
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14469
14561
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14470
|
-
const imageUrl = await canvasToObjectUrl(canvas);
|
|
14562
|
+
const imageUrl = await canvasToObjectUrl(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14471
14563
|
cleanup();
|
|
14472
14564
|
return imageUrl;
|
|
14473
14565
|
} catch (error) {
|
|
14474
14566
|
console.log("Error exporting chart to image URL: " + error.message);
|
|
14475
14567
|
}
|
|
14476
14568
|
}
|
|
14477
|
-
|
|
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") {
|
|
14478
14583
|
try {
|
|
14479
14584
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14480
14585
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14481
|
-
const chartBlob = await canvasToBlob(canvas);
|
|
14586
|
+
const chartBlob = await canvasToBlob(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14482
14587
|
cleanup();
|
|
14483
14588
|
return chartBlob;
|
|
14484
14589
|
} catch (error) {
|
|
@@ -14786,7 +14891,7 @@ function getCopyAsImageMenuItem(figureId, env) {
|
|
|
14786
14891
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14787
14892
|
if (!chartId) return;
|
|
14788
14893
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14789
|
-
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);
|
|
14790
14895
|
if (!blob) return;
|
|
14791
14896
|
const image = await new Promise((resolve) => {
|
|
14792
14897
|
const reader = new FileReader();
|
|
@@ -14823,7 +14928,7 @@ function getDownloadChartMenuItem(figureId, env) {
|
|
|
14823
14928
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14824
14929
|
if (!chartId) return;
|
|
14825
14930
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14826
|
-
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);
|
|
14827
14932
|
if (!url) return;
|
|
14828
14933
|
downloadFile(url, "chart");
|
|
14829
14934
|
},
|
|
@@ -16372,8 +16477,8 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
16372
16477
|
useLayoutEffect(() => {
|
|
16373
16478
|
if (!this.props.disableKeyboardNavigation && !this.state.hoveredMenu && !this.subMenu.isOpen) this.menuRef()?.focus();
|
|
16374
16479
|
});
|
|
16375
|
-
|
|
16376
|
-
|
|
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 });
|
|
16377
16482
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
16378
16483
|
if (nextProps.menuItems !== this.props.menuItems) this.closeSubMenu();
|
|
16379
16484
|
});
|
|
@@ -16953,110 +17058,6 @@ function isSquareMatrix(arg) {
|
|
|
16953
17058
|
}
|
|
16954
17059
|
const expectNumberGreaterThanOrEqualToOne = (value) => _t("The function [[FUNCTION_NAME]] expects a number value to be greater than or equal to 1, but receives %s.", value);
|
|
16955
17060
|
|
|
16956
|
-
//#endregion
|
|
16957
|
-
//#region src/functions/helper_matrices.ts
|
|
16958
|
-
function getUnitMatrix(n) {
|
|
16959
|
-
const matrix = Array(n);
|
|
16960
|
-
for (let i = 0; i < n; i++) {
|
|
16961
|
-
matrix[i] = Array(n).fill(0);
|
|
16962
|
-
matrix[i][i] = 1;
|
|
16963
|
-
}
|
|
16964
|
-
return matrix;
|
|
16965
|
-
}
|
|
16966
|
-
/**
|
|
16967
|
-
* Invert a matrix and compute its determinant using Gaussian Elimination.
|
|
16968
|
-
*
|
|
16969
|
-
* The Matrix should be a square matrix, and should be indexed [col][row] instead of the
|
|
16970
|
-
* standard mathematical indexing [row][col].
|
|
16971
|
-
*/
|
|
16972
|
-
function invertMatrix(M) {
|
|
16973
|
-
if (M.length < 1 || M[0].length < 1) throw new Error("invertMatrix: an empty matrix cannot be inverted.");
|
|
16974
|
-
if (M.length !== M[0].length) throw new Error("invertMatrix: only square matrices are invertible");
|
|
16975
|
-
let determinant = 1;
|
|
16976
|
-
const dim = M.length;
|
|
16977
|
-
const I = getUnitMatrix(dim);
|
|
16978
|
-
const C = M.map((row) => row.slice());
|
|
16979
|
-
for (let pivot = 0; pivot < dim; pivot++) {
|
|
16980
|
-
let diagonalElement = C[pivot][pivot];
|
|
16981
|
-
if (diagonalElement === 0) {
|
|
16982
|
-
for (let row = pivot + 1; row < dim; row++) if (C[pivot][row] !== 0) {
|
|
16983
|
-
swapMatrixRows(C, pivot, row);
|
|
16984
|
-
swapMatrixRows(I, pivot, row);
|
|
16985
|
-
determinant *= -1;
|
|
16986
|
-
break;
|
|
16987
|
-
}
|
|
16988
|
-
diagonalElement = C[pivot][pivot];
|
|
16989
|
-
if (diagonalElement === 0) return { determinant: 0 };
|
|
16990
|
-
}
|
|
16991
|
-
for (let col = 0; col < dim; col++) {
|
|
16992
|
-
C[col][pivot] = C[col][pivot] / diagonalElement;
|
|
16993
|
-
I[col][pivot] = I[col][pivot] / diagonalElement;
|
|
16994
|
-
}
|
|
16995
|
-
determinant *= diagonalElement;
|
|
16996
|
-
for (let row = 0; row < dim; row++) {
|
|
16997
|
-
if (row === pivot) continue;
|
|
16998
|
-
const e = C[pivot][row];
|
|
16999
|
-
for (let col = 0; col < dim; col++) {
|
|
17000
|
-
C[col][row] -= e * C[col][pivot];
|
|
17001
|
-
I[col][row] -= e * I[col][pivot];
|
|
17002
|
-
}
|
|
17003
|
-
}
|
|
17004
|
-
}
|
|
17005
|
-
return {
|
|
17006
|
-
inverted: I,
|
|
17007
|
-
determinant
|
|
17008
|
-
};
|
|
17009
|
-
}
|
|
17010
|
-
function swapMatrixRows(matrix, row1, row2) {
|
|
17011
|
-
for (let i = 0; i < matrix.length; i++) {
|
|
17012
|
-
const tmp = matrix[i][row1];
|
|
17013
|
-
matrix[i][row1] = matrix[i][row2];
|
|
17014
|
-
matrix[i][row2] = tmp;
|
|
17015
|
-
}
|
|
17016
|
-
}
|
|
17017
|
-
/**
|
|
17018
|
-
* Matrix multiplication of 2 matrices.
|
|
17019
|
-
* ex: matrix1 : n x l, matrix2 : m x n => result : m x l
|
|
17020
|
-
*
|
|
17021
|
-
* Note: we use indexing [col][row] instead of the standard mathematical notation [row][col]
|
|
17022
|
-
*/
|
|
17023
|
-
function multiplyMatrices(matrix1, matrix2) {
|
|
17024
|
-
if (matrix1.length < 1 || matrix2.length < 1) throw new Error("multiplyMatrices: empty matrices cannot be multiplied.");
|
|
17025
|
-
if (matrix1.length !== matrix2[0].length) throw new Error("multiplyMatrices: incompatible matrices size.");
|
|
17026
|
-
const rowsM1 = matrix1[0].length;
|
|
17027
|
-
const colsM2 = matrix2.length;
|
|
17028
|
-
const n = matrix1.length;
|
|
17029
|
-
const result = Array(colsM2);
|
|
17030
|
-
for (let col = 0; col < colsM2; col++) {
|
|
17031
|
-
result[col] = Array(rowsM1);
|
|
17032
|
-
for (let row = 0; row < rowsM1; row++) {
|
|
17033
|
-
let sum = 0;
|
|
17034
|
-
for (let k = 0; k < n; k++) sum += matrix1[k][row] * matrix2[col][k];
|
|
17035
|
-
result[col][row] = sum;
|
|
17036
|
-
}
|
|
17037
|
-
}
|
|
17038
|
-
return result;
|
|
17039
|
-
}
|
|
17040
|
-
/**
|
|
17041
|
-
* Return the input if it's a scalar or the first element of the input if it's a matrix.
|
|
17042
|
-
*/
|
|
17043
|
-
function toScalar(arg) {
|
|
17044
|
-
if (!isMatrix(arg)) return arg;
|
|
17045
|
-
if (!isSingleElementMatrix(arg)) throw new Error("The value should be a scalar or a 1x1 matrix");
|
|
17046
|
-
return arg[0][0];
|
|
17047
|
-
}
|
|
17048
|
-
function isSingleElementMatrix(matrix) {
|
|
17049
|
-
return matrix.length === 1 && matrix[0].length === 1;
|
|
17050
|
-
}
|
|
17051
|
-
function isMultipleElementMatrix(arg) {
|
|
17052
|
-
return isMatrix(arg) && !isSingleElementMatrix(arg);
|
|
17053
|
-
}
|
|
17054
|
-
function getMatrixArgIndices(args) {
|
|
17055
|
-
const indices = [];
|
|
17056
|
-
for (let i = 0; i < args.length; i++) if (isMultipleElementMatrix(args[i])) indices.push(i);
|
|
17057
|
-
return indices;
|
|
17058
|
-
}
|
|
17059
|
-
|
|
17060
17061
|
//#endregion
|
|
17061
17062
|
//#region src/functions/helper_statistical.ts
|
|
17062
17063
|
function assertSameNumberOfElements(...args) {
|
|
@@ -18207,8 +18208,6 @@ const ChartTerms = {
|
|
|
18207
18208
|
Unexpected: _t("The chart definition is invalid for an unknown reason"),
|
|
18208
18209
|
["InvalidDataSet"]: _t("The dataset is invalid"),
|
|
18209
18210
|
["InvalidLabelRange"]: _t("Labels are invalid"),
|
|
18210
|
-
["InvalidScorecardKeyValue"]: _t("The key value is invalid"),
|
|
18211
|
-
["InvalidScorecardBaseline"]: _t("The baseline value is invalid"),
|
|
18212
18211
|
["InvalidGaugeDataRange"]: _t("The data range is invalid"),
|
|
18213
18212
|
["EmptyGaugeRangeMin"]: _t("A minimum range limit value is needed"),
|
|
18214
18213
|
["GaugeRangeMinNaN"]: _t("The minimum range limit value must be a number"),
|
|
@@ -20983,7 +20982,7 @@ var GridAddRowsFooter = class extends Component {
|
|
|
20983
20982
|
setup() {
|
|
20984
20983
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
20985
20984
|
this.viewStore = useStore(ViewportsStore);
|
|
20986
|
-
|
|
20985
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
20987
20986
|
}
|
|
20988
20987
|
get addRowsPosition() {
|
|
20989
20988
|
const { scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
@@ -21514,7 +21513,7 @@ function useCellHovered(env, gridRef) {
|
|
|
21514
21513
|
(0, _odoo_owl.useListener)(gridRef, "mouseenter", resume);
|
|
21515
21514
|
(0, _odoo_owl.useListener)(gridRef, "pointerdown", recompute);
|
|
21516
21515
|
(0, _odoo_owl.useListener)(gridRef, "pointerdown", (ev) => env.isMobile() && updateMousePosition(withZoom(env, ev)));
|
|
21517
|
-
|
|
21516
|
+
(0, _odoo_owl.useListener)(window, "click", handleGlobalClick);
|
|
21518
21517
|
function handleGlobalClick(e) {
|
|
21519
21518
|
const target = e.target;
|
|
21520
21519
|
const grid = gridRef();
|
|
@@ -21885,7 +21884,7 @@ function getPivotIconSvg(isCollapsed, isHovered) {
|
|
|
21885
21884
|
};
|
|
21886
21885
|
}
|
|
21887
21886
|
function getDataFilterIcon(isActive, isHighContrast, isHovered) {
|
|
21888
|
-
const symbolPath = isActive ? "
|
|
21887
|
+
const symbolPath = isActive ? "M 11 20 Q 10.575 20 10.2875 19.7125 T 10 19 L 10 13 L 4.2 5.6 Q 3.825 5.1 4.0875 4.55 T 5 4 L 19 4 Q 19.65 4 19.9125 4.55 T 19.8 5.6 L 14 13 L 14 19 Q 14 19.425 13.7125 19.7125 T 13 20 L 11 20 Z" : "M 339.667 681 L 510.333 681 L 510.333 595.667 L 339.667 595.667 L 339.667 681 Z M 41 169 L 41 254.333 L 809 254.333 L 809 169 L 41 169 Z M 169 467.667 L 681 467.667 L 681 382.333 L 169 382.333 L 169 467.667 Z";
|
|
21889
21888
|
const hoverBackgroundPath = isActive ? "M0,0 h24 v24 h-24" : "M0,0 h850 v850 h-850";
|
|
21890
21889
|
const colors = {
|
|
21891
21890
|
iconColor: FILTERS_COLOR,
|
|
@@ -23518,7 +23517,7 @@ var Select = class extends Component {
|
|
|
23518
23517
|
hoveredValue: void 0
|
|
23519
23518
|
});
|
|
23520
23519
|
setup() {
|
|
23521
|
-
|
|
23520
|
+
(0, _odoo_owl.useListener)(window, "pointerdown", this.onExternalClick.bind(this), { capture: true });
|
|
23522
23521
|
useLayoutEffect(() => {
|
|
23523
23522
|
const el = this.dropdownRef();
|
|
23524
23523
|
if (el) el.style.width = `${this.selectRef()?.offsetWidth}px`;
|
|
@@ -23620,7 +23619,7 @@ var InfoPopover = class extends Component {
|
|
|
23620
23619
|
});
|
|
23621
23620
|
static components = { Popover };
|
|
23622
23621
|
setup() {
|
|
23623
|
-
|
|
23622
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
23624
23623
|
}
|
|
23625
23624
|
infoRef = _odoo_owl.signal.ref();
|
|
23626
23625
|
get popoverProps() {
|
|
@@ -24030,6 +24029,7 @@ figureRegistry.add("chart", {
|
|
|
24030
24029
|
Component: ChartFigure,
|
|
24031
24030
|
SidePanelComponent: "ChartPanel",
|
|
24032
24031
|
menuBuilder: getChartMenuActions,
|
|
24032
|
+
minFigSize: 80,
|
|
24033
24033
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24034
24034
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24035
24035
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24048,6 +24048,7 @@ figureRegistry.add("image", {
|
|
|
24048
24048
|
figureRegistry.add("carousel", {
|
|
24049
24049
|
Component: CarouselFigure,
|
|
24050
24050
|
menuBuilder: getCarouselMenuActions,
|
|
24051
|
+
minFigSize: 80,
|
|
24051
24052
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24052
24053
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24053
24054
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24180,7 +24181,7 @@ var FigureComponent = class extends Component {
|
|
|
24180
24181
|
...this.positionInBoundary(sheetId, this.env.model.getters.getFigureUI(sheetId, figure), ev.key, ev.shiftKey)
|
|
24181
24182
|
});
|
|
24182
24183
|
}
|
|
24183
|
-
this.env.model.dispatch("
|
|
24184
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures });
|
|
24184
24185
|
ev.preventDefault();
|
|
24185
24186
|
ev.stopPropagation();
|
|
24186
24187
|
break;
|
|
@@ -29278,6 +29279,20 @@ migrationStepRegistry.add("0.1", { migrate(data) {
|
|
|
29278
29279
|
figure.data.chartDefinitions[chartId] = upgrade(definition);
|
|
29279
29280
|
}
|
|
29280
29281
|
return data;
|
|
29282
|
+
} }).add("19.5.1", { migrate(data) {
|
|
29283
|
+
function upgrade(definition) {
|
|
29284
|
+
if (definition.type !== "scorecard") return definition;
|
|
29285
|
+
definition = { ...definition };
|
|
29286
|
+
if (definition.keyValue) definition.keyValue = `=${definition.keyValue}`;
|
|
29287
|
+
if (definition.baseline) definition.baseline = `=${definition.baseline}`;
|
|
29288
|
+
return definition;
|
|
29289
|
+
}
|
|
29290
|
+
for (const sheet of data.sheets || []) for (const figure of sheet.figures || []) if (figure.tag === "chart") figure.data = upgrade(figure.data);
|
|
29291
|
+
else if (figure.tag === "carousel") for (const chartId in figure.data.chartDefinitions) {
|
|
29292
|
+
const definition = figure.data.chartDefinitions[chartId];
|
|
29293
|
+
figure.data.chartDefinitions[chartId] = upgrade(definition);
|
|
29294
|
+
}
|
|
29295
|
+
return data;
|
|
29281
29296
|
} });
|
|
29282
29297
|
function fixOverlappingFilters(data) {
|
|
29283
29298
|
for (const sheet of data.sheets || []) {
|
|
@@ -29950,7 +29965,7 @@ function buildScorecard(zone, getters) {
|
|
|
29950
29965
|
return {
|
|
29951
29966
|
type: "scorecard",
|
|
29952
29967
|
title: {},
|
|
29953
|
-
keyValue: getUnboundRange(getters, zone)
|
|
29968
|
+
keyValue: `=${getUnboundRange(getters, zone)}`,
|
|
29954
29969
|
background: cell?.style?.fillColor,
|
|
29955
29970
|
baselineMode: DEFAULT_SCORECARD_BASELINE_MODE,
|
|
29956
29971
|
baselineColorUp: DEFAULT_SCORECARD_BASELINE_COLOR_UP,
|
|
@@ -30911,7 +30926,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30911
30926
|
getFormulas(getters) {
|
|
30912
30927
|
return this.chartTypeBuilder.getFormulas(getters, this.sheetId, this.definition);
|
|
30913
30928
|
}
|
|
30914
|
-
getRuntime(getters, chartId) {
|
|
30929
|
+
getRuntime(getters, chartId, colorThemeName) {
|
|
30915
30930
|
const dataSource = this.dataSource;
|
|
30916
30931
|
const dataExtractors = dataSource ? {
|
|
30917
30932
|
extractData: () => this.dataSourceBuilder.extractData(dataSource, chartId, getters),
|
|
@@ -30931,7 +30946,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30931
30946
|
return this.dataSourceBuilder.onDataSetClick?.(this.definition.type, chartId, event, items, chartJsChart, getters);
|
|
30932
30947
|
},
|
|
30933
30948
|
onHover: (event, items, chartJsChart) => this.dataSourceBuilder.onDataSetHover?.(this.definition.type, chartId, event, items, chartJsChart)
|
|
30934
|
-
});
|
|
30949
|
+
}, colorThemeName);
|
|
30935
30950
|
}
|
|
30936
30951
|
static deleteInvalidKeys(definition) {
|
|
30937
30952
|
definition = { ...definition };
|
|
@@ -32194,7 +32209,7 @@ var NumberEditor = class extends Component {
|
|
|
32194
32209
|
DOMFocusableElementStore;
|
|
32195
32210
|
setup() {
|
|
32196
32211
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
32197
|
-
|
|
32212
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
32198
32213
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
32199
32214
|
const input = this.inputRef();
|
|
32200
32215
|
if (input && document.activeElement !== input) input.value = nextProps.currentValue;
|
|
@@ -32295,7 +32310,7 @@ var TextStyler = class extends Component {
|
|
|
32295
32310
|
});
|
|
32296
32311
|
openedEl = null;
|
|
32297
32312
|
setup() {
|
|
32298
|
-
|
|
32313
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this));
|
|
32299
32314
|
}
|
|
32300
32315
|
state = (0, _odoo_owl.proxy)({ activeTool: "" });
|
|
32301
32316
|
updateFontSize(fontSize) {
|
|
@@ -33389,7 +33404,7 @@ var RoundColorPicker = class extends Component {
|
|
|
33389
33404
|
state;
|
|
33390
33405
|
setup() {
|
|
33391
33406
|
this.state = (0, _odoo_owl.proxy)({ pickerOpened: false });
|
|
33392
|
-
|
|
33407
|
+
(0, _odoo_owl.useListener)(window, "click", this.closePicker.bind(this));
|
|
33393
33408
|
}
|
|
33394
33409
|
closePicker() {
|
|
33395
33410
|
this.state.pickerOpened = false;
|
|
@@ -34012,7 +34027,7 @@ function toXlsxHexColor(color) {
|
|
|
34012
34027
|
//#region src/helpers/figures/charts/runtime/chart_data_extractor.ts
|
|
34013
34028
|
const EMPTY$1 = Object.freeze({ value: null });
|
|
34014
34029
|
const ZERO = Object.freeze({ value: 0 });
|
|
34015
|
-
function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34030
|
+
function getBarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34016
34031
|
const locale = getters.getLocale();
|
|
34017
34032
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34018
34033
|
format,
|
|
@@ -34044,7 +34059,7 @@ function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34044
34059
|
labels,
|
|
34045
34060
|
locale: getters.getLocale(),
|
|
34046
34061
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34047
|
-
background: getChartBackgroundColor(definition,
|
|
34062
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34048
34063
|
};
|
|
34049
34064
|
}
|
|
34050
34065
|
function getDateTimeLabel(value, stamp) {
|
|
@@ -34103,7 +34118,7 @@ function computeValuesAndLabels(timeValues, values, horizontalGroupBy, verticalG
|
|
|
34103
34118
|
labels: xValues.map((v) => ({ value: getDateTimeLabel(v, horizontalGroupBy) }))
|
|
34104
34119
|
};
|
|
34105
34120
|
}
|
|
34106
|
-
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34121
|
+
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34107
34122
|
let labels = labelValues;
|
|
34108
34123
|
const locale = getters.getLocale();
|
|
34109
34124
|
const countEntries = dataSetsValues.length === 0;
|
|
@@ -34116,14 +34131,14 @@ function getCalendarChartData(definition, { labelValues, dataSetsValues }, gette
|
|
|
34116
34131
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34117
34132
|
locale: getters.getLocale(),
|
|
34118
34133
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34119
|
-
background: getChartBackgroundColor(definition,
|
|
34134
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34120
34135
|
};
|
|
34121
34136
|
}
|
|
34122
|
-
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34137
|
+
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34123
34138
|
const barChartData = getBarChartData(definition, {
|
|
34124
34139
|
labelValues,
|
|
34125
34140
|
dataSetsValues: dataSetsValues.slice(0, 2)
|
|
34126
|
-
}, getters);
|
|
34141
|
+
}, getters, colorThemeName);
|
|
34127
34142
|
const barDataset = barChartData.dataSetsValues.filter((ds) => !ds.hidden);
|
|
34128
34143
|
const pyramidDatasetValues = [];
|
|
34129
34144
|
if (barDataset[0]) {
|
|
@@ -34145,7 +34160,7 @@ function getPyramidChartData(definition, { labelValues, dataSetsValues }, getter
|
|
|
34145
34160
|
dataSetsValues: pyramidDatasetValues
|
|
34146
34161
|
};
|
|
34147
34162
|
}
|
|
34148
|
-
function getLineChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34163
|
+
function getLineChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34149
34164
|
const axisType = getChartAxisType(definition, {
|
|
34150
34165
|
labelValues,
|
|
34151
34166
|
dataSetsValues
|
|
@@ -34181,10 +34196,10 @@ function getLineChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34181
34196
|
trendDataSetsValues,
|
|
34182
34197
|
axisType,
|
|
34183
34198
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34184
|
-
background: getChartBackgroundColor(definition,
|
|
34199
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34185
34200
|
};
|
|
34186
34201
|
}
|
|
34187
|
-
function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34202
|
+
function getPieChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34188
34203
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34189
34204
|
format,
|
|
34190
34205
|
locale: getters.getLocale()
|
|
@@ -34199,10 +34214,10 @@ function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34199
34214
|
labels,
|
|
34200
34215
|
locale: getters.getLocale(),
|
|
34201
34216
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34202
|
-
background: getChartBackgroundColor(definition,
|
|
34217
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34203
34218
|
};
|
|
34204
34219
|
}
|
|
34205
|
-
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34220
|
+
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34206
34221
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34207
34222
|
format,
|
|
34208
34223
|
locale: getters.getLocale()
|
|
@@ -34215,10 +34230,10 @@ function getRadarChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34215
34230
|
axisFormats,
|
|
34216
34231
|
labels,
|
|
34217
34232
|
locale: getters.getLocale(),
|
|
34218
|
-
background: getChartBackgroundColor(definition,
|
|
34233
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34219
34234
|
};
|
|
34220
34235
|
}
|
|
34221
|
-
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34236
|
+
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34222
34237
|
dataSetsValues = dataSetsValues.slice(0, 1);
|
|
34223
34238
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34224
34239
|
format,
|
|
@@ -34234,10 +34249,10 @@ function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34234
34249
|
availableRegions: getters.getGeoChartAvailableRegions(),
|
|
34235
34250
|
geoFeatureNameToId: getters.geoFeatureNameToId,
|
|
34236
34251
|
getGeoJsonFeatures: getters.getGeoJsonFeatures,
|
|
34237
|
-
background: getChartBackgroundColor(definition,
|
|
34252
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34238
34253
|
};
|
|
34239
34254
|
}
|
|
34240
|
-
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34255
|
+
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34241
34256
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34242
34257
|
format,
|
|
34243
34258
|
locale: getters.getLocale()
|
|
@@ -34251,10 +34266,10 @@ function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters
|
|
|
34251
34266
|
axisFormats: { x: format },
|
|
34252
34267
|
labels,
|
|
34253
34268
|
locale: getters.getLocale(),
|
|
34254
|
-
background: getChartBackgroundColor(definition,
|
|
34269
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34255
34270
|
};
|
|
34256
34271
|
}
|
|
34257
|
-
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34272
|
+
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34258
34273
|
let labels = labelValues;
|
|
34259
34274
|
({labels, dataSetsValues} = filterValuesWithDifferentSigns(labels, dataSetsValues));
|
|
34260
34275
|
({labels, dataSetsValues} = filterInvalidHierarchicalPoints(labels, dataSetsValues));
|
|
@@ -34263,12 +34278,12 @@ function getHierarchalChartData(definition, { labelValues, dataSetsValues }, get
|
|
|
34263
34278
|
axisFormats: { y: getChartLabelFormat(labels) },
|
|
34264
34279
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34265
34280
|
locale: getters.getLocale(),
|
|
34266
|
-
background: getChartBackgroundColor(definition,
|
|
34281
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34267
34282
|
};
|
|
34268
34283
|
}
|
|
34269
|
-
function getBubbleChartData(definition, getters) {
|
|
34284
|
+
function getBubbleChartData(definition, getters, colorThemeName) {
|
|
34270
34285
|
const chartData = getBubbleChartSourceData(definition, getters);
|
|
34271
|
-
const data = getLineChartData(definition, chartData, getters);
|
|
34286
|
+
const data = getLineChartData(definition, chartData, getters, colorThemeName);
|
|
34272
34287
|
let labelValues = definition.labelRange ? getters.getVisibleRangeValues(definition.labelRange) : [];
|
|
34273
34288
|
let sizeValues = definition.sizeRange ? getters.getVisibleRangeValues(definition.sizeRange) : [];
|
|
34274
34289
|
if (chartData.shouldRemoveFirstLabel) {
|
|
@@ -35270,9 +35285,9 @@ const templates = `
|
|
|
35270
35285
|
`;
|
|
35271
35286
|
let app;
|
|
35272
35287
|
function renderToString(templateName, context = {}) {
|
|
35273
|
-
return render(templateName, context).innerHTML;
|
|
35288
|
+
return render$1(templateName, context).innerHTML;
|
|
35274
35289
|
}
|
|
35275
|
-
function render(templateName, context = {}) {
|
|
35290
|
+
function render$1(templateName, context = {}) {
|
|
35276
35291
|
if (!app) app = new _odoo_owl.App({
|
|
35277
35292
|
templates,
|
|
35278
35293
|
translateFn: _t
|
|
@@ -35637,8 +35652,8 @@ const BarChart = {
|
|
|
35637
35652
|
verticalAxis: getDefinedAxis(definition)
|
|
35638
35653
|
};
|
|
35639
35654
|
},
|
|
35640
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
35641
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
35655
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
35656
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
35642
35657
|
return {
|
|
35643
35658
|
chartJsConfig: {
|
|
35644
35659
|
type: "bar",
|
|
@@ -35826,7 +35841,7 @@ const GaugeChart = {
|
|
|
35826
35841
|
definition.sectionRule.upperInflectionPoint.value
|
|
35827
35842
|
].filter((value) => value.startsWith("=")).map((formula) => CompiledFormula.Compile(formula, sheetId, getters));
|
|
35828
35843
|
},
|
|
35829
|
-
getRuntime(getters, definition, dataSource, sheetId) {
|
|
35844
|
+
getRuntime(getters, definition, dataSource, sheetId, eventHandlers, colorThemeName) {
|
|
35830
35845
|
const locale = getters.getLocale();
|
|
35831
35846
|
const chartColors = definition.sectionRule.colors;
|
|
35832
35847
|
let gaugeValue = void 0;
|
|
@@ -35847,7 +35862,7 @@ const GaugeChart = {
|
|
|
35847
35862
|
}
|
|
35848
35863
|
let minValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMin, getters);
|
|
35849
35864
|
let maxValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMax, getters);
|
|
35850
|
-
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters);
|
|
35865
|
+
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters, colorThemeName);
|
|
35851
35866
|
if (maxValue < minValue) [minValue, maxValue] = [maxValue, minValue];
|
|
35852
35867
|
const lowerPoint = definition.sectionRule.lowerInflectionPoint;
|
|
35853
35868
|
const upperPoint = definition.sectionRule.upperInflectionPoint;
|
|
@@ -35879,7 +35894,7 @@ const GaugeChart = {
|
|
|
35879
35894
|
}
|
|
35880
35895
|
colors.push(chartColors.upperColor);
|
|
35881
35896
|
return {
|
|
35882
|
-
background: getters.getStyleOfSingleCellChart(definition.background, dataRange).background,
|
|
35897
|
+
background: getters.getStyleOfSingleCellChart(definition.background, dataRange, colorThemeName).background,
|
|
35883
35898
|
title: {
|
|
35884
35899
|
...title,
|
|
35885
35900
|
text: title.text ? getters.dynamicTranslate(title.text) : ""
|
|
@@ -35913,9 +35928,9 @@ function getFormulaNumberValue(sheetId, formula, getters) {
|
|
|
35913
35928
|
const value = getters.evaluateFormula(sheetId, formula);
|
|
35914
35929
|
return isMultipleElementMatrix(value) ? void 0 : tryToNumber(toScalar(value), getters.getLocale());
|
|
35915
35930
|
}
|
|
35916
|
-
function getInvalidGaugeRuntime(definition, getters) {
|
|
35931
|
+
function getInvalidGaugeRuntime(definition, getters, colorThemeName) {
|
|
35917
35932
|
return {
|
|
35918
|
-
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange).background,
|
|
35933
|
+
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange, colorThemeName).background,
|
|
35919
35934
|
title: definition.title ?? { text: "" },
|
|
35920
35935
|
minValue: {
|
|
35921
35936
|
value: 0,
|
|
@@ -36009,8 +36024,8 @@ const LineChart = {
|
|
|
36009
36024
|
verticalAxis: getDefinedAxis(definition)
|
|
36010
36025
|
};
|
|
36011
36026
|
},
|
|
36012
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36013
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
36027
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36028
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
36014
36029
|
return {
|
|
36015
36030
|
chartJsConfig: {
|
|
36016
36031
|
type: "line",
|
|
@@ -36091,8 +36106,8 @@ const PieChart = {
|
|
|
36091
36106
|
labelRange
|
|
36092
36107
|
};
|
|
36093
36108
|
},
|
|
36094
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36095
|
-
const chartData = getPieChartData(definition, extractData(), getters);
|
|
36109
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36110
|
+
const chartData = getPieChartData(definition, extractData(), getters, colorThemeName);
|
|
36096
36111
|
return { chartJsConfig: {
|
|
36097
36112
|
type: definition.isDoughnut ? "doughnut" : "pie",
|
|
36098
36113
|
data: {
|
|
@@ -36168,8 +36183,8 @@ const WaterfallChart = {
|
|
|
36168
36183
|
};
|
|
36169
36184
|
},
|
|
36170
36185
|
getDefinitionForExcel: () => void 0,
|
|
36171
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36172
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
36186
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36187
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
36173
36188
|
const { labels, datasets } = getWaterfallDatasetAndLabels(definition, chartData);
|
|
36174
36189
|
return { chartJsConfig: {
|
|
36175
36190
|
type: "bar",
|
|
@@ -36936,7 +36951,7 @@ var CalendarChartConfigPanel = class extends GenericChartConfigPanel {
|
|
|
36936
36951
|
getGroupByOptions() {
|
|
36937
36952
|
const sheetId = this.env.model.getters.getFigureSheetId(this.env.model.getters.getFigureIdFromChartId(this.props.chartId));
|
|
36938
36953
|
const definition = SpreadsheetChart.fromStrDefinition(this.env.model.getters, sheetId, this.props.definition).getRangeDefinition();
|
|
36939
|
-
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));
|
|
36940
36955
|
if (labels.length === 0) return [];
|
|
36941
36956
|
const dates = labels.map((label) => toJsDate(label, this.env.model.getters.getLocale()));
|
|
36942
36957
|
const uniqueYears = /* @__PURE__ */ new Set();
|
|
@@ -37000,7 +37015,7 @@ var ColorScalePicker = class extends Component {
|
|
|
37000
37015
|
});
|
|
37001
37016
|
popoverRef = _odoo_owl.signal.ref(HTMLTableElement);
|
|
37002
37017
|
setup() {
|
|
37003
|
-
|
|
37018
|
+
(0, _odoo_owl.useListener)(window, "click", this.closePopover.bind(this));
|
|
37004
37019
|
}
|
|
37005
37020
|
get currentColorScale() {
|
|
37006
37021
|
return this.props.definition.colorScale || schemeToColorScale("oranges");
|
|
@@ -39648,10 +39663,10 @@ var ScatterConfigPanel = class extends GenericChartConfigPanel {
|
|
|
39648
39663
|
var ScorecardChartConfigPanel = class extends Component {
|
|
39649
39664
|
static template = "o-spreadsheet-ScorecardChartConfigPanel";
|
|
39650
39665
|
static components = {
|
|
39651
|
-
SelectionInput,
|
|
39652
39666
|
ChartErrorSection,
|
|
39653
39667
|
Section,
|
|
39654
|
-
Select
|
|
39668
|
+
Select,
|
|
39669
|
+
StandaloneComposer
|
|
39655
39670
|
};
|
|
39656
39671
|
props = (0, _odoo_owl.useProps)(chartSidePanelPropsDefinition);
|
|
39657
39672
|
state = (0, _odoo_owl.proxy)({
|
|
@@ -39663,30 +39678,18 @@ var ScorecardChartConfigPanel = class extends Component {
|
|
|
39663
39678
|
get errorMessages() {
|
|
39664
39679
|
return [...this.state.keyValueDispatchResult?.reasons || [], ...this.state.baselineDispatchResult?.reasons || []].filter((reason) => reason !== "NoChanges").map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
39665
39680
|
}
|
|
39666
|
-
|
|
39667
|
-
|
|
39668
|
-
}
|
|
39669
|
-
get isBaselineInvalid() {
|
|
39670
|
-
return !!this.state.baselineDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
|
|
39671
|
-
}
|
|
39672
|
-
onKeyValueRangeChanged(ranges) {
|
|
39673
|
-
this.keyValue = ranges[0];
|
|
39674
|
-
this.state.keyValueDispatchResult = this.props.canUpdateChart(this.props.chartId, { keyValue: this.keyValue });
|
|
39675
|
-
}
|
|
39676
|
-
updateKeyValueRange() {
|
|
39681
|
+
onConfirmKeyValue(keyValue) {
|
|
39682
|
+
this.keyValue = keyValue;
|
|
39677
39683
|
this.state.keyValueDispatchResult = this.props.updateChart(this.props.chartId, { keyValue: this.keyValue });
|
|
39678
39684
|
}
|
|
39679
|
-
|
|
39685
|
+
getKeyValue() {
|
|
39680
39686
|
return this.keyValue || "";
|
|
39681
39687
|
}
|
|
39682
|
-
|
|
39683
|
-
this.baseline =
|
|
39684
|
-
this.state.baselineDispatchResult = this.props.canUpdateChart(this.props.chartId, { baseline: this.baseline });
|
|
39685
|
-
}
|
|
39686
|
-
updateBaselineRange() {
|
|
39688
|
+
onConfirmBaseline(baseline) {
|
|
39689
|
+
this.baseline = baseline;
|
|
39687
39690
|
this.state.baselineDispatchResult = this.props.updateChart(this.props.chartId, { baseline: this.baseline });
|
|
39688
39691
|
}
|
|
39689
|
-
|
|
39692
|
+
getBaseline() {
|
|
39690
39693
|
return this.baseline || "";
|
|
39691
39694
|
}
|
|
39692
39695
|
updateBaselineMode(baselineMode) {
|
|
@@ -40143,6 +40146,7 @@ var MainChartPanelStore = class extends SpreadsheetStore {
|
|
|
40143
40146
|
changeChartType(chartId, newDisplayType) {
|
|
40144
40147
|
const currentCreationContext = this.getters.getContextCreationChart(chartId);
|
|
40145
40148
|
const savedCreationContext = this.creationContexts[chartId] || {};
|
|
40149
|
+
const auxiliaryRange = currentCreationContext && "auxiliaryRange" in currentCreationContext ? currentCreationContext.auxiliaryRange : savedCreationContext.auxiliaryRange;
|
|
40146
40150
|
let dataSetStyles = savedCreationContext.dataSetStyles ?? currentCreationContext?.dataSetStyles;
|
|
40147
40151
|
let dataSource = {
|
|
40148
40152
|
...savedCreationContext.dataSource,
|
|
@@ -40164,7 +40168,8 @@ var MainChartPanelStore = class extends SpreadsheetStore {
|
|
|
40164
40168
|
dataSetsHaveTitle: false,
|
|
40165
40169
|
...savedCreationContext.dataSource,
|
|
40166
40170
|
...currentCreationContext?.dataSource,
|
|
40167
|
-
dataSets: newRanges ?? []
|
|
40171
|
+
dataSets: newRanges ?? [],
|
|
40172
|
+
labelRange: auxiliaryRange
|
|
40168
40173
|
};
|
|
40169
40174
|
}
|
|
40170
40175
|
this.creationContexts[chartId] = {
|
|
@@ -40193,7 +40198,7 @@ var MainChartPanelStore = class extends SpreadsheetStore {
|
|
|
40193
40198
|
dataSetsStartWithSameRanges(currentDataSets, savedDataSets, currentStyles, savedStyles) {
|
|
40194
40199
|
return currentDataSets.every((ds, i) => {
|
|
40195
40200
|
const savedDs = savedDataSets[i];
|
|
40196
|
-
return deepEquals(ds.dataRange, savedDs
|
|
40201
|
+
return deepEquals(ds.dataRange, savedDs?.dataRange) && deepEquals(currentStyles?.[ds.dataSetId], savedStyles?.[savedDs?.dataSetId]);
|
|
40197
40202
|
});
|
|
40198
40203
|
}
|
|
40199
40204
|
/**
|
|
@@ -42029,7 +42034,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
42029
42034
|
useLayoutEffect((sheetId, isCfRemoved) => {
|
|
42030
42035
|
if (this.activeSheetId !== sheetId || isCfRemoved) this.env.replaceSidePanel("ConditionalFormatting", `ConditionalFormattingEditor_${this.props.cf.id}`);
|
|
42031
42036
|
}, () => [this.env.model.getters.getActiveSheetId(), this.isEditedCfRemoved]);
|
|
42032
|
-
|
|
42037
|
+
(0, _odoo_owl.useListener)(window, "click", () => this.store.closeMenus());
|
|
42033
42038
|
}
|
|
42034
42039
|
get isEditedCfRemoved() {
|
|
42035
42040
|
return !Boolean(this.env.model.getters.getConditionalFormats(this.activeSheetId).find((cf) => cf.id === this.props.cf.id));
|
|
@@ -42302,7 +42307,7 @@ function startChartDragAndDrop(env, definition, ev) {
|
|
|
42302
42307
|
canvas.className = "w-100 h-100";
|
|
42303
42308
|
container.appendChild(canvas);
|
|
42304
42309
|
spreadsheet.appendChild(container);
|
|
42305
|
-
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), {
|
|
42306
42311
|
width,
|
|
42307
42312
|
height
|
|
42308
42313
|
}, definition.type, zoom);
|
|
@@ -42383,7 +42388,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42383
42388
|
getChartConfiguration() {
|
|
42384
42389
|
const getters = this.env.model.getters;
|
|
42385
42390
|
const activeSheetId = getters.getActiveSheetId();
|
|
42386
|
-
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);
|
|
42387
42392
|
if (!("chartJsConfig" in runtime)) return null;
|
|
42388
42393
|
let config = runtime.chartJsConfig;
|
|
42389
42394
|
const existingScales = config.options?.scales ?? {};
|
|
@@ -42450,7 +42455,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42450
42455
|
const canvas = this.chartCanvasRef();
|
|
42451
42456
|
if (!canvas) return;
|
|
42452
42457
|
const getters = this.env.model.getters;
|
|
42453
|
-
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);
|
|
42454
42459
|
const { type } = this.props.definition;
|
|
42455
42460
|
if (type === "scorecard") {
|
|
42456
42461
|
const rect = canvas.getBoundingClientRect();
|
|
@@ -42713,8 +42718,8 @@ const SINGLE_NUMBER_COLUMN_SUGGESTIONS = [
|
|
|
42713
42718
|
{
|
|
42714
42719
|
description: _t("Highlights the most recent value compared to the previous one."),
|
|
42715
42720
|
isApplicable: ({ rowCount }) => rowCount < 3,
|
|
42716
|
-
build: (ctx) => scorecardChart(ctx.title, ctx.lastCellXC
|
|
42717
|
-
baseline: ctx.prevCellXC,
|
|
42721
|
+
build: (ctx) => scorecardChart(ctx.title, `=${ctx.lastCellXC}`, {
|
|
42722
|
+
baseline: ctx.prevCellXC ? `=${ctx.prevCellXC}` : void 0,
|
|
42718
42723
|
baselineMode: "difference"
|
|
42719
42724
|
})
|
|
42720
42725
|
},
|
|
@@ -42747,8 +42752,8 @@ const SINGLE_PERCENTAGE_COLUMN_SUGGESTIONS = [
|
|
|
42747
42752
|
{
|
|
42748
42753
|
description: _t("Shows the last percentage value with its baseline."),
|
|
42749
42754
|
isApplicable: ({ rowCount }) => rowCount < 3,
|
|
42750
|
-
build: (ctx) => scorecardChart(ctx.title, ctx.lastCellXC
|
|
42751
|
-
baseline: ctx.prevCellXC,
|
|
42755
|
+
build: (ctx) => scorecardChart(ctx.title, `=${ctx.lastCellXC}`, {
|
|
42756
|
+
baseline: ctx.prevCellXC ? `=${ctx.prevCellXC}` : void 0,
|
|
42752
42757
|
baselineMode: "percentage"
|
|
42753
42758
|
})
|
|
42754
42759
|
},
|
|
@@ -42777,7 +42782,7 @@ const SINGLE_PERCENTAGE_COLUMN_SUGGESTIONS = [
|
|
|
42777
42782
|
const SINGLE_DATE_COLUMN_SUGGESTIONS = [{
|
|
42778
42783
|
description: _t("Shows the last date value."),
|
|
42779
42784
|
isApplicable: ({ rowCount }) => rowCount === 1,
|
|
42780
|
-
build: (ctx) => scorecardChart(ctx.title, ctx.lastCellXC)
|
|
42785
|
+
build: (ctx) => scorecardChart(ctx.title, `=${ctx.lastCellXC}`)
|
|
42781
42786
|
}];
|
|
42782
42787
|
/** Pattern D — Single categorical column */
|
|
42783
42788
|
const SINGLE_CATEGORICAL_COLUMN_SUGGESTIONS = [
|
|
@@ -42811,7 +42816,7 @@ const SINGLE_CATEGORICAL_COLUMN_SUGGESTIONS = [
|
|
|
42811
42816
|
const SINGLE_LABEL_COLUMN_SUGGESTIONS = [{
|
|
42812
42817
|
description: _t("Displays a key performance indicator."),
|
|
42813
42818
|
isApplicable: ({ rowCount }) => rowCount === 1,
|
|
42814
|
-
build: (ctx) => scorecardChart(ctx.title, ctx.lastCellXC
|
|
42819
|
+
build: (ctx) => scorecardChart(ctx.title, `=${ctx.lastCellXC}`, {
|
|
42815
42820
|
baselineMode: "text",
|
|
42816
42821
|
humanize: false
|
|
42817
42822
|
})
|
|
@@ -42869,8 +42874,8 @@ const NUMBER_VS_NUMBER_SUGGESTIONS = [
|
|
|
42869
42874
|
{
|
|
42870
42875
|
description: _t("Highlights the second metric compared to the first one."),
|
|
42871
42876
|
isApplicable: ({ rowCount1, rowCount2 }) => rowCount1 === 1 && rowCount2 === 1,
|
|
42872
|
-
build: (ctx) => scorecardChart(ctx.title, ctx.lastCellXC
|
|
42873
|
-
baseline: ctx.prevCellXC,
|
|
42877
|
+
build: (ctx) => scorecardChart(ctx.title, `=${ctx.lastCellXC}`, {
|
|
42878
|
+
baseline: ctx.prevCellXC ? `=${ctx.prevCellXC}` : void 0,
|
|
42874
42879
|
baselineMode: "difference"
|
|
42875
42880
|
})
|
|
42876
42881
|
},
|
|
@@ -42928,10 +42933,10 @@ const LABEL_VS_NUMBER_SUGGESTIONS = [
|
|
|
42928
42933
|
{
|
|
42929
42934
|
description: _t("Highlights the most recent value for the named entity."),
|
|
42930
42935
|
isApplicable: ({ rowCount }) => rowCount === 1,
|
|
42931
|
-
build: (ctx) => scorecardChart("", ctx.lastCellXC
|
|
42936
|
+
build: (ctx) => scorecardChart("", `=${ctx.lastCellXC}`, {
|
|
42932
42937
|
humanize: false,
|
|
42933
42938
|
baselineMode: "text",
|
|
42934
|
-
baseline: ctx.prevCellXC
|
|
42939
|
+
baseline: ctx.prevCellXC ? `=${ctx.prevCellXC}` : void 0
|
|
42935
42940
|
})
|
|
42936
42941
|
},
|
|
42937
42942
|
{
|
|
@@ -43932,6 +43937,7 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43932
43937
|
mutators = [
|
|
43933
43938
|
"updateSearchOptions",
|
|
43934
43939
|
"updateSearchContent",
|
|
43940
|
+
"updateReplaceContent",
|
|
43935
43941
|
"searchFormulas",
|
|
43936
43942
|
"selectPreviousMatch",
|
|
43937
43943
|
"selectNextMatch",
|
|
@@ -43984,6 +43990,9 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43984
43990
|
updateSearchContent(toSearch) {
|
|
43985
43991
|
this._updateSearch(toSearch, this.searchOptions);
|
|
43986
43992
|
}
|
|
43993
|
+
updateReplaceContent(toReplace) {
|
|
43994
|
+
this.toReplace = toReplace;
|
|
43995
|
+
}
|
|
43987
43996
|
updateSearchOptions(searchOptions) {
|
|
43988
43997
|
this._updateSearch(this.toSearch, {
|
|
43989
43998
|
...this.searchOptions,
|
|
@@ -44341,7 +44350,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44341
44350
|
get currentSheetMatchesCount() {
|
|
44342
44351
|
const { activeSheetMatchesCount: count, activeSheetHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44343
44352
|
const sheetName = this.env.model.getters.getSheetName(this.env.model.getters.getActiveSheetId());
|
|
44344
|
-
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'", {
|
|
44345
44354
|
count,
|
|
44346
44355
|
sheetName
|
|
44347
44356
|
});
|
|
@@ -44353,10 +44362,10 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44353
44362
|
if (!range) return "";
|
|
44354
44363
|
const { specificRangeMatchesCount: count, specificRangeHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44355
44364
|
const { sheetId, zone } = range;
|
|
44356
|
-
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'", {
|
|
44357
44366
|
range: zoneToXc(zone),
|
|
44358
44367
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
44359
|
-
}) : _t("%(count)s matches in range %(range)s of %(sheetName)s", {
|
|
44368
|
+
}) : _t("%(count)s matches in range %(range)s of '%(sheetName)s'", {
|
|
44360
44369
|
count,
|
|
44361
44370
|
range: zoneToXc(zone),
|
|
44362
44371
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
@@ -44384,7 +44393,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44384
44393
|
(0, _odoo_owl.onMounted)(() => this.searchInputRef()?.focus());
|
|
44385
44394
|
(0, _odoo_owl.onWillUnmount)(() => this.updateSearchContent.stopDebounce());
|
|
44386
44395
|
this.updateSearchContent = debounce(this.store.updateSearchContent, 200);
|
|
44387
|
-
|
|
44396
|
+
(0, _odoo_owl.useListener)(window, "keydown", (ev) => {
|
|
44388
44397
|
const code = keyboardEventToShortcutString(ev);
|
|
44389
44398
|
if (code === "Ctrl+F" || code === "Ctrl+H") {
|
|
44390
44399
|
this.searchInputRef()?.focus();
|
|
@@ -44399,6 +44408,9 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44399
44408
|
onSearchInput(ev) {
|
|
44400
44409
|
this.updateSearchContent(ev.target.value);
|
|
44401
44410
|
}
|
|
44411
|
+
onReplaceInput(ev) {
|
|
44412
|
+
this.store.updateReplaceContent(ev.target.value);
|
|
44413
|
+
}
|
|
44402
44414
|
onKeydownPanel(ev) {
|
|
44403
44415
|
if (ev.key === "Escape") {
|
|
44404
44416
|
ev.preventDefault();
|
|
@@ -45979,7 +45991,7 @@ var PivotFilterEditor = class extends Component {
|
|
|
45979
45991
|
buttonFilter = _odoo_owl.signal.ref();
|
|
45980
45992
|
popover;
|
|
45981
45993
|
setup() {
|
|
45982
|
-
|
|
45994
|
+
(0, _odoo_owl.useListener)(window, "click", (ev) => {
|
|
45983
45995
|
if (!isChildEvent(this.buttonFilter(), ev)) this.popover.isOpen = false;
|
|
45984
45996
|
});
|
|
45985
45997
|
(0, _odoo_owl.onWillUpdateProps)((nextProps) => {
|
|
@@ -46113,7 +46125,7 @@ var AddDimensionButton = class extends Component {
|
|
|
46113
46125
|
setup() {
|
|
46114
46126
|
this.autoComplete = useLocalStore(AutoCompleteStore);
|
|
46115
46127
|
this.autoComplete.useProvider(this.getProvider());
|
|
46116
|
-
|
|
46128
|
+
(0, _odoo_owl.useListener)(window, "click", (ev) => {
|
|
46117
46129
|
if (ev.target !== this.buttonRef()) this.popover.isOpen = false;
|
|
46118
46130
|
});
|
|
46119
46131
|
useAutofocus(this.autofocusRef);
|
|
@@ -48491,7 +48503,7 @@ var TableStylesPopover = class extends Component {
|
|
|
48491
48503
|
tableStyleListRef = _odoo_owl.signal.ref();
|
|
48492
48504
|
state = (0, _odoo_owl.proxy)({ selectedCategory: this.initialSelectedCategory });
|
|
48493
48505
|
setup() {
|
|
48494
|
-
|
|
48506
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
48495
48507
|
}
|
|
48496
48508
|
onExternalClick(ev) {
|
|
48497
48509
|
const el = this.tableStyleListRef();
|
|
@@ -49706,7 +49718,8 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49706
49718
|
static components = {
|
|
49707
49719
|
Section,
|
|
49708
49720
|
RoundColorPicker,
|
|
49709
|
-
TableStylePreview
|
|
49721
|
+
TableStylePreview,
|
|
49722
|
+
TextInput
|
|
49710
49723
|
};
|
|
49711
49724
|
props = (0, _odoo_owl.useProps)({
|
|
49712
49725
|
onCloseSidePanel: types.function(),
|
|
@@ -49715,7 +49728,7 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49715
49728
|
});
|
|
49716
49729
|
state = (0, _odoo_owl.proxy)(this.getInitialState());
|
|
49717
49730
|
setup() {
|
|
49718
|
-
|
|
49731
|
+
(0, _odoo_owl.useListener)(window, "click", () => this.state.pickerOpened = false);
|
|
49719
49732
|
}
|
|
49720
49733
|
getInitialState() {
|
|
49721
49734
|
const editedStyle = this.props.styleId ? this.env.model.getters.getTableStyle(this.props.styleId) : null;
|
|
@@ -53592,6 +53605,15 @@ var GridComposer = class extends Component {
|
|
|
53592
53605
|
}
|
|
53593
53606
|
};
|
|
53594
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
|
+
|
|
53595
53617
|
//#endregion
|
|
53596
53618
|
//#region src/components/helpers/figure_drag_helper.ts
|
|
53597
53619
|
function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, initialFigures, { maxX, maxY }, { scrollX: initialScrollX, scrollY: initialScrollY }, { scrollX, scrollY }) {
|
|
@@ -53609,19 +53631,19 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
53609
53631
|
};
|
|
53610
53632
|
});
|
|
53611
53633
|
}
|
|
53612
|
-
function dragFigureForResize(
|
|
53613
|
-
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;
|
|
53614
53636
|
if (keepRatio && dirX !== 0 && dirY !== 0) {
|
|
53615
|
-
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize);
|
|
53616
|
-
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);
|
|
53617
53639
|
const fraction = Math.min(deltaX / width, deltaY / height);
|
|
53618
53640
|
if (dirX < 0) x = x + width * fraction;
|
|
53619
53641
|
if (dirY < 0) y = y + height * fraction;
|
|
53620
53642
|
width = width * (1 - fraction);
|
|
53621
53643
|
height = height * (1 - fraction);
|
|
53622
53644
|
} else {
|
|
53623
|
-
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize - width);
|
|
53624
|
-
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);
|
|
53625
53647
|
width = width + deltaX;
|
|
53626
53648
|
height = height + deltaY;
|
|
53627
53649
|
if (dirX < 0) x = x - deltaX;
|
|
@@ -53636,7 +53658,6 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
53636
53658
|
y = -scrollY;
|
|
53637
53659
|
} else if (y + height > maxY) height = maxY - y;
|
|
53638
53660
|
return {
|
|
53639
|
-
...initialFigure,
|
|
53640
53661
|
x,
|
|
53641
53662
|
y,
|
|
53642
53663
|
width,
|
|
@@ -53699,29 +53720,30 @@ function snapForMove(env, figuresToSnap, otherFigures) {
|
|
|
53699
53720
|
* Try to snap the given figure to the other figures when resizing the figure, and return the snapped
|
|
53700
53721
|
* figure and the possible snap lines, if any were found
|
|
53701
53722
|
*/
|
|
53702
|
-
function snapForResize(env, resizeDirX, resizeDirY,
|
|
53703
|
-
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"]);
|
|
53704
53726
|
if (verticalSnapLine) {
|
|
53705
|
-
if (resizeDirX === 1)
|
|
53727
|
+
if (resizeDirX === 1) rect.width -= verticalSnapLine.snapOffset;
|
|
53706
53728
|
else if (resizeDirX === -1) {
|
|
53707
|
-
|
|
53708
|
-
|
|
53729
|
+
rect.x -= verticalSnapLine.snapOffset;
|
|
53730
|
+
rect.width += verticalSnapLine.snapOffset;
|
|
53709
53731
|
}
|
|
53710
53732
|
}
|
|
53711
|
-
const horizontalSnapLine = getSnapLine(env, figureToSnap, [resizeDirY === -1 ? "top" : "bottom"], otherFigures, ["bottom", "top"]);
|
|
53712
53733
|
if (horizontalSnapLine) {
|
|
53713
|
-
if (resizeDirY === 1)
|
|
53734
|
+
if (resizeDirY === 1) rect.height -= horizontalSnapLine.snapOffset;
|
|
53714
53735
|
else if (resizeDirY === -1) {
|
|
53715
|
-
|
|
53716
|
-
|
|
53736
|
+
rect.y -= horizontalSnapLine.snapOffset;
|
|
53737
|
+
rect.height += horizontalSnapLine.snapOffset;
|
|
53717
53738
|
}
|
|
53718
53739
|
}
|
|
53719
|
-
figureToSnap.x = Math.round(figureToSnap.x);
|
|
53720
|
-
figureToSnap.y = Math.round(figureToSnap.y);
|
|
53721
|
-
figureToSnap.height = Math.round(figureToSnap.height);
|
|
53722
|
-
figureToSnap.width = Math.round(figureToSnap.width);
|
|
53723
53740
|
return {
|
|
53724
|
-
|
|
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
|
+
},
|
|
53725
53747
|
verticalSnapLine,
|
|
53726
53748
|
horizontalSnapLine
|
|
53727
53749
|
};
|
|
@@ -53912,7 +53934,7 @@ var FiguresContainer = class extends Component {
|
|
|
53912
53934
|
this.zoomStore = useStore(ZoomStore);
|
|
53913
53935
|
this.chartDragStore = useStore(ChartDragStore);
|
|
53914
53936
|
(0, _odoo_owl.onMounted)(() => {
|
|
53915
|
-
|
|
53937
|
+
render(this);
|
|
53916
53938
|
});
|
|
53917
53939
|
(0, _odoo_owl.onWillUpdateProps)(() => {
|
|
53918
53940
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -53986,6 +54008,13 @@ var FiguresContainer = class extends Component {
|
|
|
53986
54008
|
get selectedRectStyle() {
|
|
53987
54009
|
return this.dnd.selectedRect ? this.rectToCss(this.dnd.selectedRect) : "";
|
|
53988
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
|
+
}
|
|
53989
54018
|
getInverseViewportPositionStyle(container) {
|
|
53990
54019
|
const { scrollX, scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
53991
54020
|
const { x: viewportX, y: viewportY } = this.viewStore.mainViewportCoordinates;
|
|
@@ -54043,12 +54072,9 @@ var FiguresContainer = class extends Component {
|
|
|
54043
54072
|
y: ev.clientY / zoom
|
|
54044
54073
|
};
|
|
54045
54074
|
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54075
|
+
const maxDimensions = this.maxDimensions;
|
|
54046
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));
|
|
54047
54077
|
const draggedFigureId = figureUI.id;
|
|
54048
|
-
const maxDimensions = {
|
|
54049
|
-
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
54050
|
-
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end
|
|
54051
|
-
};
|
|
54052
54078
|
let hasStartedDnd = false;
|
|
54053
54079
|
let overlappingChartOrCarousel = void 0;
|
|
54054
54080
|
const onMouseMove = (ev) => {
|
|
@@ -54095,7 +54121,7 @@ var FiguresContainer = class extends Component {
|
|
|
54095
54121
|
...this.viewStore.viewports.getPositionAnchorOffset(sheetId, f)
|
|
54096
54122
|
};
|
|
54097
54123
|
}) || [];
|
|
54098
|
-
this.env.model.dispatch("
|
|
54124
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: payloads });
|
|
54099
54125
|
} else {
|
|
54100
54126
|
const overlappingFigureId = overlappingChartOrCarousel.id;
|
|
54101
54127
|
const chartFigureIds = this.dnd.selectedFigures?.map((f) => f.id) || [];
|
|
@@ -54120,7 +54146,7 @@ var FiguresContainer = class extends Component {
|
|
|
54120
54146
|
this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
|
|
54121
54147
|
}
|
|
54122
54148
|
/**
|
|
54123
|
-
* Initialize the resize of
|
|
54149
|
+
* Initialize the resize of the selected figures with mouse movements
|
|
54124
54150
|
*
|
|
54125
54151
|
* @param dirX X direction of the resize. -1 : resize from the left border of the figure, 0 : no resize in X, 1 :
|
|
54126
54152
|
* resize from the right border of the figure
|
|
@@ -54128,44 +54154,78 @@ var FiguresContainer = class extends Component {
|
|
|
54128
54154
|
* resize from the bottom border of the figure
|
|
54129
54155
|
* @param ev Mouse Event
|
|
54130
54156
|
*/
|
|
54131
|
-
|
|
54157
|
+
resizeAllSelectedFigures(dirX, dirY, ev) {
|
|
54132
54158
|
ev.stopPropagation();
|
|
54133
|
-
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54134
|
-
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
54135
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
|
|
54136
|
-
const zoom = this.zoomStore.zoomLevel;
|
|
54137
54159
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
54160
|
+
const zoom = this.zoomStore.zoomLevel;
|
|
54138
54161
|
const initialMousePosition = {
|
|
54139
54162
|
x: ev.clientX / zoom,
|
|
54140
54163
|
y: ev.clientY / zoom
|
|
54141
54164
|
};
|
|
54142
|
-
const
|
|
54143
|
-
|
|
54144
|
-
|
|
54145
|
-
|
|
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
|
+
}
|
|
54146
54192
|
const onMouseMove = (ev) => {
|
|
54147
|
-
const
|
|
54193
|
+
const currentMousePosition = {
|
|
54148
54194
|
x: ev.clientX / zoom,
|
|
54149
54195
|
y: ev.clientY / zoom
|
|
54150
|
-
}
|
|
54151
|
-
const
|
|
54152
|
-
const
|
|
54153
|
-
this.
|
|
54154
|
-
|
|
54155
|
-
|
|
54156
|
-
|
|
54157
|
-
|
|
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);
|
|
54158
54215
|
};
|
|
54159
|
-
const onMouseUp = (
|
|
54160
|
-
if (!this.dnd.
|
|
54161
|
-
const
|
|
54162
|
-
|
|
54163
|
-
|
|
54164
|
-
|
|
54165
|
-
|
|
54166
|
-
|
|
54167
|
-
|
|
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
|
+
};
|
|
54168
54227
|
});
|
|
54228
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: dispatchPayload });
|
|
54169
54229
|
this.dnd.draggedFigure = void 0;
|
|
54170
54230
|
this.dnd.selectedFigures = void 0;
|
|
54171
54231
|
this.dnd.selectedRect = void 0;
|
|
@@ -54828,7 +54888,7 @@ function useTouchHandlers(ref, { updateScroll, canMoveUp, canMoveDown, getZoom,
|
|
|
54828
54888
|
passive: false,
|
|
54829
54889
|
capture: false
|
|
54830
54890
|
});
|
|
54831
|
-
|
|
54891
|
+
(0, _odoo_owl.useListener)(window, "pointerup", onPointerUp, {
|
|
54832
54892
|
passive: false,
|
|
54833
54893
|
capture: true
|
|
54834
54894
|
});
|
|
@@ -55392,10 +55452,10 @@ var Grid = class extends Component {
|
|
|
55392
55452
|
this.checkboxToggleStore = useStore(CheckboxToggleStore);
|
|
55393
55453
|
useStore(ArrayFormulaHighlight);
|
|
55394
55454
|
this.automaticSumStore = useLocalStore(AutomaticSumStore);
|
|
55395
|
-
|
|
55396
|
-
|
|
55397
|
-
|
|
55398
|
-
|
|
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));
|
|
55399
55459
|
(0, _odoo_owl.onMounted)(() => this.focusDefaultElement());
|
|
55400
55460
|
this.props.exposeFocus(() => this.focusDefaultElement());
|
|
55401
55461
|
useGridDrawing({
|
|
@@ -64710,36 +64770,37 @@ function generateMasterChartConfig(chartJsConfig) {
|
|
|
64710
64770
|
//#endregion
|
|
64711
64771
|
//#region src/plugins/ui_core_views/evaluation_chart.ts
|
|
64712
64772
|
var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
64713
|
-
static getters = ["
|
|
64773
|
+
static getters = ["getStyleOfSingleCellChart", "getChartRuntimeWithTheme"];
|
|
64714
64774
|
charts = {};
|
|
64715
64775
|
handle(cmd) {
|
|
64716
|
-
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] = {};
|
|
64717
64777
|
switch (cmd.type) {
|
|
64718
64778
|
case "UPDATE_CHART":
|
|
64719
64779
|
case "CREATE_CHART":
|
|
64720
|
-
this.charts[cmd.chartId] =
|
|
64780
|
+
this.charts[cmd.chartId] = {};
|
|
64721
64781
|
break;
|
|
64722
64782
|
case "DELETE_CHART":
|
|
64723
|
-
this.charts[cmd.chartId] =
|
|
64783
|
+
this.charts[cmd.chartId] = {};
|
|
64724
64784
|
break;
|
|
64725
64785
|
case "DELETE_SHEET":
|
|
64726
|
-
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] = {};
|
|
64727
64787
|
break;
|
|
64728
64788
|
}
|
|
64729
64789
|
}
|
|
64730
|
-
|
|
64731
|
-
if (!this.charts[chartId]) {
|
|
64790
|
+
getChartRuntimeWithTheme(chartId, colorThemeName) {
|
|
64791
|
+
if (!this.charts[chartId]) this.charts[chartId] = {};
|
|
64792
|
+
if (!this.charts[chartId][colorThemeName]) {
|
|
64732
64793
|
const chart = this.getters.getChart(chartId);
|
|
64733
64794
|
if (!chart) throw new Error(`No chart for the given id: ${chartId}`);
|
|
64734
|
-
this.charts[chartId] = this.createRuntimeChart(chartId, chart);
|
|
64795
|
+
this.charts[chartId][colorThemeName] = this.createRuntimeChart(chartId, chart, colorThemeName);
|
|
64735
64796
|
}
|
|
64736
|
-
return this.charts[chartId];
|
|
64797
|
+
return this.charts[chartId][colorThemeName];
|
|
64737
64798
|
}
|
|
64738
64799
|
/**
|
|
64739
64800
|
* Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
|
|
64740
64801
|
*/
|
|
64741
|
-
getStyleOfSingleCellChart(chartBackground, mainRange) {
|
|
64742
|
-
const themeBackground =
|
|
64802
|
+
getStyleOfSingleCellChart(chartBackground, mainRange, colorThemeName) {
|
|
64803
|
+
const themeBackground = COLOR_THEMES[colorThemeName].backgroundColor;
|
|
64743
64804
|
if (chartBackground) return {
|
|
64744
64805
|
background: chartBackground,
|
|
64745
64806
|
fontColor: chartFontColor(chartBackground)
|
|
@@ -64780,7 +64841,7 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64780
64841
|
else {
|
|
64781
64842
|
if (!chart) continue;
|
|
64782
64843
|
const type = this.getters.getChartType(chartId);
|
|
64783
|
-
const img = await chartToImageUrl(this.
|
|
64844
|
+
const img = await chartToImageUrl(this.getChartRuntimeWithTheme(chartId, "light"), figure, type);
|
|
64784
64845
|
if (img) sheet.images.push({
|
|
64785
64846
|
...figure,
|
|
64786
64847
|
tag: "image",
|
|
@@ -64798,9 +64859,9 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64798
64859
|
sheet.charts = figures;
|
|
64799
64860
|
}
|
|
64800
64861
|
}
|
|
64801
|
-
createRuntimeChart(chartId, chart) {
|
|
64862
|
+
createRuntimeChart(chartId, chart, colorThemeName) {
|
|
64802
64863
|
const definition = chart.getRangeDefinition();
|
|
64803
|
-
const runtime = chart.getRuntime(this.getters, chartId);
|
|
64864
|
+
const runtime = chart.getRuntime(this.getters, chartId, colorThemeName);
|
|
64804
64865
|
if ("chartJsConfig" in runtime && /line|combo|bar|scatter|waterfall/.test(definition.type)) {
|
|
64805
64866
|
const chartJsConfig = runtime.chartJsConfig;
|
|
64806
64867
|
runtime["masterChartConfig"] = generateMasterChartConfig(chartJsConfig);
|
|
@@ -66166,6 +66227,39 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
66166
66227
|
}
|
|
66167
66228
|
};
|
|
66168
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
|
+
|
|
66169
66263
|
//#endregion
|
|
66170
66264
|
//#region src/helpers/range_adapter_functions.ts
|
|
66171
66265
|
function getRangeAdapterFunctions(executedCommand) {
|
|
@@ -67155,30 +67249,6 @@ var Session = class extends EventBus {
|
|
|
67155
67249
|
}
|
|
67156
67250
|
};
|
|
67157
67251
|
|
|
67158
|
-
//#endregion
|
|
67159
|
-
//#region src/plugins/ui_plugin.ts
|
|
67160
|
-
/**
|
|
67161
|
-
* UI plugins handle any transient data required to display a spreadsheet.
|
|
67162
|
-
* They can draw on the grid canvas.
|
|
67163
|
-
*/
|
|
67164
|
-
var UIPlugin = class extends BasePlugin {
|
|
67165
|
-
static layers = [];
|
|
67166
|
-
getters;
|
|
67167
|
-
ui;
|
|
67168
|
-
selection;
|
|
67169
|
-
dispatch;
|
|
67170
|
-
canDispatch;
|
|
67171
|
-
constructor({ getters, stateObserver, dispatch, canDispatch, uiActions, selection }) {
|
|
67172
|
-
super(stateObserver);
|
|
67173
|
-
this.getters = getters;
|
|
67174
|
-
this.ui = uiActions;
|
|
67175
|
-
this.selection = selection;
|
|
67176
|
-
this.dispatch = dispatch;
|
|
67177
|
-
this.canDispatch = canDispatch;
|
|
67178
|
-
}
|
|
67179
|
-
drawLayer(ctx, layer) {}
|
|
67180
|
-
};
|
|
67181
|
-
|
|
67182
67252
|
//#endregion
|
|
67183
67253
|
//#region src/plugins/ui_feature/collaborative.ts
|
|
67184
67254
|
var CollaborativePlugin = class extends UIPlugin {
|
|
@@ -67262,41 +67332,6 @@ var CollaborativePlugin = class extends UIPlugin {
|
|
|
67262
67332
|
|
|
67263
67333
|
//#endregion
|
|
67264
67334
|
//#region src/plugins/ui_feature/color_theme.ts
|
|
67265
|
-
const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
67266
|
-
const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
67267
|
-
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
67268
|
-
const TEXT_HEADER_COLOR = "#666666";
|
|
67269
|
-
const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
67270
|
-
const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
67271
|
-
const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
67272
|
-
const COLOR_THEMES = {
|
|
67273
|
-
light: {
|
|
67274
|
-
backgroundColor: "#FFFFFF",
|
|
67275
|
-
gridBorderColor: "#CECFCF",
|
|
67276
|
-
headerBackgroundColor: BACKGROUND_HEADER_COLOR,
|
|
67277
|
-
headerActiveBackgroundColor: BACKGROUND_HEADER_ACTIVE_COLOR,
|
|
67278
|
-
headerSelectedBackgroundColor: BACKGROUND_HEADER_SELECTED_COLOR,
|
|
67279
|
-
headerTextColor: TEXT_HEADER_COLOR,
|
|
67280
|
-
headerBorderColor: HEADER_BORDER_COLOR,
|
|
67281
|
-
frozenPaneBorderColor: FROZEN_PANE_BORDER_COLOR,
|
|
67282
|
-
frozenPaneHeaderBorderColor: FROZEN_PANE_HEADER_BORDER_COLOR,
|
|
67283
|
-
singleCellSelectionBackgroundColor: "#F3F7FE",
|
|
67284
|
-
multipleCellsSelectionBackgroundColor: "#E9F0FF"
|
|
67285
|
-
},
|
|
67286
|
-
dark: {
|
|
67287
|
-
backgroundColor: adaptForDarkMode("#1A1C2E"),
|
|
67288
|
-
gridBorderColor: adaptForDarkMode("#6B706F"),
|
|
67289
|
-
headerBackgroundColor: adaptForDarkMode("#262A36"),
|
|
67290
|
-
headerActiveBackgroundColor: adaptForDarkMode("#3A4052"),
|
|
67291
|
-
headerSelectedBackgroundColor: adaptForDarkMode("#4E566E"),
|
|
67292
|
-
headerTextColor: adaptForDarkMode("#A1A6B3"),
|
|
67293
|
-
headerBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67294
|
-
frozenPaneBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67295
|
-
frozenPaneHeaderBorderColor: adaptForDarkMode("#9FA5BD"),
|
|
67296
|
-
singleCellSelectionBackgroundColor: adaptForDarkMode("#696E8044"),
|
|
67297
|
-
multipleCellsSelectionBackgroundColor: adaptForDarkMode("#828AA044")
|
|
67298
|
-
}
|
|
67299
|
-
};
|
|
67300
67335
|
var ColorThemeUIPlugin = class extends UIPlugin {
|
|
67301
67336
|
static getters = ["isDarkMode", "getSpreadsheetTheme"];
|
|
67302
67337
|
colorScheme;
|
|
@@ -69567,7 +69602,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69567
69602
|
static getters = ["getFigureUI"];
|
|
69568
69603
|
allowDispatch(cmd) {
|
|
69569
69604
|
switch (cmd.type) {
|
|
69570
|
-
case "
|
|
69605
|
+
case "UPDATE_FIGURES":
|
|
69571
69606
|
for (const updateFigurePayload of cmd.figures) {
|
|
69572
69607
|
const result = this.canDispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69573
69608
|
if (!result.isSuccessful) return result.reasons;
|
|
@@ -69591,7 +69626,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69591
69626
|
}
|
|
69592
69627
|
handle(cmd) {
|
|
69593
69628
|
switch (cmd.type) {
|
|
69594
|
-
case "
|
|
69629
|
+
case "UPDATE_FIGURES":
|
|
69595
69630
|
for (const updateFigurePayload of cmd.figures) this.dispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69596
69631
|
break;
|
|
69597
69632
|
case "DELETE_FIGURES":
|
|
@@ -70738,7 +70773,7 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
70738
70773
|
//#endregion
|
|
70739
70774
|
//#region src/plugins/plugin_registries.ts
|
|
70740
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);
|
|
70741
|
-
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);
|
|
70742
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);
|
|
70743
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);
|
|
70744
70779
|
|
|
@@ -71680,6 +71715,31 @@ var ImageProvider = class {
|
|
|
71680
71715
|
var MainViewportStore = class extends SpreadsheetStore {
|
|
71681
71716
|
viewStore = this.get(ViewportsStore);
|
|
71682
71717
|
sheetIdAtFinalize = void 0;
|
|
71718
|
+
constructor(get) {
|
|
71719
|
+
super(get);
|
|
71720
|
+
this.model.selection.observe(this, { handleEvent: this.handleEvent.bind(this) });
|
|
71721
|
+
this.onDispose(() => {
|
|
71722
|
+
this.model.selection.unobserve(this);
|
|
71723
|
+
});
|
|
71724
|
+
}
|
|
71725
|
+
handleEvent(event) {
|
|
71726
|
+
const eventSheetId = this.getters.getActiveSheetId();
|
|
71727
|
+
if (event.options.scrollIntoView) {
|
|
71728
|
+
const oldZone = event.previousAnchor.zone;
|
|
71729
|
+
const newZone = event.anchor.zone;
|
|
71730
|
+
const isUpdateAnchorEvent = event.mode === "updateAnchor";
|
|
71731
|
+
const sameZone = isEqual(oldZone, newZone);
|
|
71732
|
+
let { col, row } = isUpdateAnchorEvent && sameZone ? event.anchor.cell : findCellInNewZone(oldZone, newZone);
|
|
71733
|
+
if (isUpdateAnchorEvent && !sameZone) {
|
|
71734
|
+
const { top, bottom, left, right } = this.viewStore.viewports.getMainInternalViewport(eventSheetId);
|
|
71735
|
+
if (oldZone.left === newZone.left && oldZone.right === newZone.right) col = left > col || col > right ? left : col;
|
|
71736
|
+
if (oldZone.top === newZone.top && oldZone.bottom === newZone.bottom) row = top > row || row > bottom ? top : row;
|
|
71737
|
+
}
|
|
71738
|
+
col = Math.min(col, this.getters.getNumberCols(eventSheetId) - 1);
|
|
71739
|
+
row = Math.min(row, this.getters.getNumberRows(eventSheetId) - 1);
|
|
71740
|
+
this.viewStore.scrollToCell(eventSheetId, col, row);
|
|
71741
|
+
}
|
|
71742
|
+
}
|
|
71683
71743
|
handle(cmd) {
|
|
71684
71744
|
switch (cmd.type) {
|
|
71685
71745
|
case "UNDO":
|
|
@@ -72069,7 +72129,7 @@ var BottomBarSheet = class extends Component {
|
|
|
72069
72129
|
DOMFocusableElementStore;
|
|
72070
72130
|
setup() {
|
|
72071
72131
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
72072
|
-
|
|
72132
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
72073
72133
|
useLayoutEffect(() => {}, () => [this.state.isEditing]);
|
|
72074
72134
|
(0, _odoo_owl.onPatched)(() => {
|
|
72075
72135
|
if (this.sheetNameRef() && this.state.isEditing && this.editionState === "initializing") {
|
|
@@ -72633,7 +72693,7 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72633
72693
|
this.zoomStore = useStore(ZoomStore);
|
|
72634
72694
|
useLocalStore(HoveredTableStore);
|
|
72635
72695
|
const rendererStore = useLocalStore(RendererStore, OrderedLayers().filter((layer) => layer !== "Headers"));
|
|
72636
|
-
|
|
72696
|
+
useSubEnv({ getPopoverContainerRect: () => this.zoomStore.getZoomedRect(this.getGridRect()) });
|
|
72637
72697
|
useGridDrawing({
|
|
72638
72698
|
canvasRef: this.canvasRef,
|
|
72639
72699
|
rendererStore,
|
|
@@ -72705,13 +72765,12 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72705
72765
|
return this.env.model.getters.getColDimensions(sheetId, right).end;
|
|
72706
72766
|
}
|
|
72707
72767
|
get dashboardStyle() {
|
|
72708
|
-
|
|
72709
|
-
if (this.env.model.getters.getActiveSheet().backgroundColor) style["background-color"] = "transparent";
|
|
72710
|
-
return cssPropertiesToCss(style);
|
|
72768
|
+
return cssPropertiesToCss({ zoom: this.zoomStore.cssZoom });
|
|
72711
72769
|
}
|
|
72712
72770
|
get backgroundStyle() {
|
|
72713
72771
|
const sheet = this.env.model.getters.getActiveSheet();
|
|
72714
|
-
|
|
72772
|
+
const theme = this.env.model.getters.getSpreadsheetTheme();
|
|
72773
|
+
return cssPropertiesToCss({ "background-color": sheet.backgroundColor || theme.backgroundColor });
|
|
72715
72774
|
}
|
|
72716
72775
|
};
|
|
72717
72776
|
|
|
@@ -73057,7 +73116,7 @@ var RibbonMenu = class extends Component {
|
|
|
73057
73116
|
parentState: void 0
|
|
73058
73117
|
});
|
|
73059
73118
|
setup() {
|
|
73060
|
-
|
|
73119
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
73061
73120
|
(0, _odoo_owl.onMounted)(this.updateShadows);
|
|
73062
73121
|
}
|
|
73063
73122
|
onExternalClick(ev) {
|
|
@@ -73711,7 +73770,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73711
73770
|
setup() {
|
|
73712
73771
|
this.printStore = useLocalStore(SpreadsheetPrintStore);
|
|
73713
73772
|
let styleElement = null;
|
|
73714
|
-
|
|
73773
|
+
(0, _odoo_owl.useListener)(window, "beforeprint", () => {
|
|
73715
73774
|
styleElement = document.createElement("style");
|
|
73716
73775
|
styleElement.id = "o-spreadsheet-print-style";
|
|
73717
73776
|
const size = `${this.printStore.pageLayout} ${this.printStore.orientation}`;
|
|
@@ -73724,7 +73783,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73724
73783
|
styleElement = null;
|
|
73725
73784
|
}
|
|
73726
73785
|
};
|
|
73727
|
-
|
|
73786
|
+
(0, _odoo_owl.useListener)(window, "afterprint", () => removePrintStyle());
|
|
73728
73787
|
(0, _odoo_owl.onWillUnmount)(() => removePrintStyle());
|
|
73729
73788
|
}
|
|
73730
73789
|
get pageStyle() {
|
|
@@ -74713,8 +74772,8 @@ var TopBar = class extends Component {
|
|
|
74713
74772
|
this.composerFocusStore = useStore(ComposerFocusStore);
|
|
74714
74773
|
this.fingerprints = useStore(FormulaFingerprintStore);
|
|
74715
74774
|
this.topBarToolStore = useStore(TopBarToolStore);
|
|
74716
|
-
|
|
74717
|
-
|
|
74775
|
+
(0, _odoo_owl.useListener)(window, "click", this.onExternalClick.bind(this));
|
|
74776
|
+
(0, _odoo_owl.useListener)(window, "keydown", this.onKeydown.bind(this));
|
|
74718
74777
|
this.menus = topbarMenuRegistry.getMenuItems();
|
|
74719
74778
|
let lastWidth;
|
|
74720
74779
|
const updateVisibility = () => {
|
|
@@ -75041,9 +75100,9 @@ var Spreadsheet = class extends Component {
|
|
|
75041
75100
|
const el = this.spreadsheetRef();
|
|
75042
75101
|
if (el && !el.contains(document.activeElement) && document.activeElement?.contains(el)) this.focusGrid();
|
|
75043
75102
|
});
|
|
75044
|
-
|
|
75045
|
-
|
|
75046
|
-
|
|
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) => {
|
|
75047
75106
|
if (keyboardEventToShortcutString(event) === "Ctrl+P") {
|
|
75048
75107
|
this.state.printModeEnabled = true;
|
|
75049
75108
|
event.stopPropagation();
|
|
@@ -75063,11 +75122,11 @@ var Spreadsheet = class extends Component {
|
|
|
75063
75122
|
resizeObserver.observe(el);
|
|
75064
75123
|
return () => resizeObserver.disconnect();
|
|
75065
75124
|
});
|
|
75066
|
-
const
|
|
75125
|
+
const batchedRender = batched(() => render(this, true));
|
|
75067
75126
|
(0, _odoo_owl.onMounted)(() => {
|
|
75068
75127
|
this.bindModelEvents();
|
|
75069
75128
|
this.checkViewportSize();
|
|
75070
|
-
stores.on("store-updated", this,
|
|
75129
|
+
stores.on("store-updated", this, batchedRender);
|
|
75071
75130
|
});
|
|
75072
75131
|
(0, _odoo_owl.onWillUnmount)(() => {
|
|
75073
75132
|
this.unbindModelEvents();
|
|
@@ -75079,7 +75138,7 @@ var Spreadsheet = class extends Component {
|
|
|
75079
75138
|
});
|
|
75080
75139
|
}
|
|
75081
75140
|
bindModelEvents() {
|
|
75082
|
-
this.model.on("update", this, () =>
|
|
75141
|
+
this.model.on("update", this, () => render(this, true));
|
|
75083
75142
|
this.model.on("command-rejected", this, ({ result }) => {
|
|
75084
75143
|
if (result.isCancelledBecause("SheetLocked")) this.notificationStore.notifyUser({
|
|
75085
75144
|
type: "info",
|
|
@@ -81152,6 +81211,10 @@ var LinkEditor = class extends Component {
|
|
|
81152
81211
|
this.computeLinks();
|
|
81153
81212
|
(0, _odoo_owl.onMounted)(() => this.urlInput()?.focus());
|
|
81154
81213
|
}
|
|
81214
|
+
onLinkUrlInput(ev) {
|
|
81215
|
+
this.state.url = ev.target.value;
|
|
81216
|
+
this.computeLinks();
|
|
81217
|
+
}
|
|
81155
81218
|
computeLinks() {
|
|
81156
81219
|
this.state.selectedIndex = null;
|
|
81157
81220
|
this.state.linksByCategory = this.linkProposalByCategory;
|
|
@@ -81851,8 +81914,8 @@ const BubbleChart = {
|
|
|
81851
81914
|
};
|
|
81852
81915
|
},
|
|
81853
81916
|
copyInSheetId: (definition) => definition,
|
|
81854
|
-
getRuntime(getters, definition) {
|
|
81855
|
-
const chartData = getBubbleChartData(definition, getters);
|
|
81917
|
+
getRuntime(getters, definition, chartDataExtractors, sheetId, eventHandlers, colorThemeName) {
|
|
81918
|
+
const chartData = getBubbleChartData(definition, getters, colorThemeName);
|
|
81856
81919
|
return { chartJsConfig: {
|
|
81857
81920
|
type: "line",
|
|
81858
81921
|
data: {
|
|
@@ -81927,8 +81990,8 @@ const CalendarChart = {
|
|
|
81927
81990
|
};
|
|
81928
81991
|
},
|
|
81929
81992
|
getDefinitionForExcel: () => void 0,
|
|
81930
|
-
getRuntime(getters, definition, { extractData }) {
|
|
81931
|
-
const chartData = getCalendarChartData(definition, extractData(), getters);
|
|
81993
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
81994
|
+
const chartData = getCalendarChartData(definition, extractData(), getters, colorThemeName);
|
|
81932
81995
|
const { labels, datasets } = getCalendarChartDatasetAndLabels(definition, chartData);
|
|
81933
81996
|
return { chartJsConfig: {
|
|
81934
81997
|
type: "calendar",
|
|
@@ -82014,8 +82077,8 @@ const ComboChart = {
|
|
|
82014
82077
|
annotationLink: context.annotationLink
|
|
82015
82078
|
};
|
|
82016
82079
|
},
|
|
82017
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82018
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
82080
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82081
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
82019
82082
|
return {
|
|
82020
82083
|
chartJsConfig: {
|
|
82021
82084
|
type: "bar",
|
|
@@ -82091,8 +82154,8 @@ const FunnelChart = {
|
|
|
82091
82154
|
};
|
|
82092
82155
|
},
|
|
82093
82156
|
getDefinitionForExcel: () => void 0,
|
|
82094
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82095
|
-
const chartData = getFunnelChartData(definition, extractData(), getters);
|
|
82157
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82158
|
+
const chartData = getFunnelChartData(definition, extractData(), getters, colorThemeName);
|
|
82096
82159
|
return { chartJsConfig: {
|
|
82097
82160
|
type: "funnel",
|
|
82098
82161
|
data: {
|
|
@@ -82154,8 +82217,8 @@ const GeoChart = {
|
|
|
82154
82217
|
};
|
|
82155
82218
|
},
|
|
82156
82219
|
getDefinitionForExcel: () => void 0,
|
|
82157
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82158
|
-
const chartData = getGeoChartData(definition, extractData(), getters);
|
|
82220
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82221
|
+
const chartData = getGeoChartData(definition, extractData(), getters, colorThemeName);
|
|
82159
82222
|
return { chartJsConfig: {
|
|
82160
82223
|
type: "choropleth",
|
|
82161
82224
|
data: { datasets: getGeoChartDatasets(definition, chartData) },
|
|
@@ -82224,7 +82287,7 @@ const PyramidChart = {
|
|
|
82224
82287
|
},
|
|
82225
82288
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
82226
82289
|
if (definition.dataSource.type !== "range") return;
|
|
82227
|
-
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters);
|
|
82290
|
+
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters, "light");
|
|
82228
82291
|
const { dataSetsValues } = chartData;
|
|
82229
82292
|
const maxValue = Math.max(...dataSetsValues.map((dataSet) => Math.max(...dataSet.data.map((cell) => isNumberResult(cell) ? Math.abs(cell.value) : -Infinity))));
|
|
82230
82293
|
return {
|
|
@@ -82238,8 +82301,8 @@ const PyramidChart = {
|
|
|
82238
82301
|
maxValue
|
|
82239
82302
|
};
|
|
82240
82303
|
},
|
|
82241
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82242
|
-
const chartData = getPyramidChartData(definition, extractData(), getters);
|
|
82304
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82305
|
+
const chartData = getPyramidChartData(definition, extractData(), getters, colorThemeName);
|
|
82243
82306
|
return {
|
|
82244
82307
|
chartJsConfig: {
|
|
82245
82308
|
type: "bar",
|
|
@@ -82321,8 +82384,8 @@ const RadarChart = {
|
|
|
82321
82384
|
labelRange
|
|
82322
82385
|
};
|
|
82323
82386
|
},
|
|
82324
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82325
|
-
const chartData = getRadarChartData(definition, extractData(), getters);
|
|
82387
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82388
|
+
const chartData = getRadarChartData(definition, extractData(), getters, colorThemeName);
|
|
82326
82389
|
return {
|
|
82327
82390
|
chartJsConfig: {
|
|
82328
82391
|
type: "radar",
|
|
@@ -82402,8 +82465,8 @@ const ScatterChart = {
|
|
|
82402
82465
|
verticalAxis: getDefinedAxis(definition)
|
|
82403
82466
|
};
|
|
82404
82467
|
},
|
|
82405
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82406
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
82468
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82469
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
82407
82470
|
return {
|
|
82408
82471
|
chartJsConfig: {
|
|
82409
82472
|
type: "line",
|
|
@@ -82481,8 +82544,8 @@ const SunburstChart = {
|
|
|
82481
82544
|
};
|
|
82482
82545
|
},
|
|
82483
82546
|
getDefinitionForExcel: () => void 0,
|
|
82484
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82485
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82547
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82548
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82486
82549
|
return { chartJsConfig: {
|
|
82487
82550
|
type: "doughnut",
|
|
82488
82551
|
data: { datasets: getSunburstChartDatasets(definition, chartData) },
|
|
@@ -82555,8 +82618,8 @@ const TreeMapChart = {
|
|
|
82555
82618
|
};
|
|
82556
82619
|
},
|
|
82557
82620
|
getDefinitionForExcel: () => void 0,
|
|
82558
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82559
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82621
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82622
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82560
82623
|
return { chartJsConfig: {
|
|
82561
82624
|
type: "treemap",
|
|
82562
82625
|
data: {
|
|
@@ -91043,7 +91106,6 @@ const hooks = {
|
|
|
91043
91106
|
};
|
|
91044
91107
|
const compatibility = {
|
|
91045
91108
|
Component,
|
|
91046
|
-
useExternalListener,
|
|
91047
91109
|
EnvPlugin,
|
|
91048
91110
|
App: App$1
|
|
91049
91111
|
};
|
|
@@ -91193,6 +91255,6 @@ exports.stores = stores;
|
|
|
91193
91255
|
exports.tokenColors = tokenColors;
|
|
91194
91256
|
exports.tokenize = tokenize;
|
|
91195
91257
|
|
|
91196
|
-
__info__.version = "19.5.0-alpha.
|
|
91197
|
-
__info__.date = "2026-08-
|
|
91198
|
-
__info__.hash = "
|
|
91258
|
+
__info__.version = "19.5.0-alpha.14";
|
|
91259
|
+
__info__.date = "2026-08-29T09:17:09.184Z";
|
|
91260
|
+
__info__.hash = "e8ad6ad";
|