@odoo/o-spreadsheet 19.5.0-alpha.13 → 19.5.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o_spreadsheet.cjs +352 -311
- package/dist/o_spreadsheet.css +15 -4
- package/dist/o_spreadsheet.esm.js +352 -311
- package/dist/o_spreadsheet.iife.js +352 -311
- package/dist/o_spreadsheet.min.iife.js +299 -299
- package/dist/o_spreadsheet.xml +16 -10
- package/dist/types/components/figures/figure_container/figure_container.d.ts +6 -2
- package/dist/types/components/helpers/figure_drag_helper.d.ts +3 -3
- package/dist/types/components/helpers/figure_snap_helper.d.ts +8 -3
- package/dist/types/components/link/link_editor/link_editor.d.ts +1 -0
- package/dist/types/components/side_panel/carousel_panel/carousel_panel.d.ts +1 -1
- package/dist/types/components/side_panel/chart/chart_type_picker_popover/chart_type_picker_popover.d.ts +12 -12
- package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +1 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace_store.d.ts +2 -1
- package/dist/types/components/side_panel/table_style_editor_panel/table_style_editor_panel.d.ts +2 -0
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/helpers/color_themes.d.ts +2 -0
- package/dist/types/helpers/figures/chart.d.ts +2 -1
- package/dist/types/helpers/figures/charts/chart_common.d.ts +2 -2
- package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +3 -3
- package/dist/types/helpers/figures/charts/runtime/chart_data_extractor.d.ts +11 -10
- package/dist/types/helpers/owl3_helpers.d.ts +4 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/owl3_compatibility_layer.d.ts +1 -14
- package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +6 -5
- package/dist/types/plugins/ui_feature/chart_ui.d.ts +6 -0
- package/dist/types/plugins/ui_feature/color_theme.d.ts +0 -3
- package/dist/types/registries/chart_registry.d.ts +2 -2
- package/dist/types/registries/figures_registry.d.ts +1 -1
- package/dist/types/types/commands.d.ts +15 -15
- package/dist/types/types/getters.d.ts +2 -1
- package/dist/types/types/model.d.ts +2 -1
- package/dist/types/types/rendering.d.ts +2 -0
- package/package.json +2 -2
|
@@ -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
|
import * as owl from "@odoo/owl";
|
|
@@ -2637,7 +2637,6 @@ function unregisterChartJsExtensions() {
|
|
|
2637
2637
|
*
|
|
2638
2638
|
* 1. Update template directives:
|
|
2639
2639
|
* - replace `t-portal` → `t-custom-portal`
|
|
2640
|
-
* - replace `t-model` → `t-custom-model`
|
|
2641
2640
|
*
|
|
2642
2641
|
* 2. Load this file immediately after Owl 3.
|
|
2643
2642
|
*
|
|
@@ -2652,35 +2651,23 @@ function unregisterChartJsExtensions() {
|
|
|
2652
2651
|
* Gradually remove the compatibility layer by migrating to native Owl 3:
|
|
2653
2652
|
*
|
|
2654
2653
|
* - replace `t-custom-portal` with proper Owl 3 portal usage
|
|
2655
|
-
* - replace `t-custom-model` with `t-model` + signals
|
|
2656
2654
|
* - convert `useLayoutEffect` back to `useEffect` where appropriate
|
|
2657
2655
|
*
|
|
2658
2656
|
* The end goal is to eliminate all compatibility shims.
|
|
2659
2657
|
*/
|
|
2660
|
-
const { __ODOO_COMPATIBILITY_LAYER_ADDED__, blockDom: blockDom$1, config, onMounted: onMounted$1, onPatched: onPatched$1, onWillUnmount: onWillUnmount$1, App: OwlApp, Component: OwlComponent, EnvPlugin: OwlEnvPlugin,
|
|
2658
|
+
const { __ODOO_COMPATIBILITY_LAYER_ADDED__, blockDom: blockDom$1, config, onMounted: onMounted$1, onPatched: onPatched$1, onWillUnmount: onWillUnmount$1, App: OwlApp, Component: OwlComponent, EnvPlugin: OwlEnvPlugin, useComponent: OwlUseComponent, useEnv: OwlUseEnv, useLayoutEffect: OwlUseLayoutEffect, useSubEnv: OwlUseSubEnv, Plugin, usePlugin, useProps: useProps$1, providePlugins, useScope, xml: xml$1 } = owl;
|
|
2661
2659
|
const isOdooCompatLoaded = __ODOO_COMPATIBILITY_LAYER_ADDED__ === true;
|
|
2662
2660
|
var _Component = class extends OwlComponent {
|
|
2663
|
-
static template = "";
|
|
2664
2661
|
env;
|
|
2665
2662
|
constructor(node) {
|
|
2666
2663
|
super(node);
|
|
2667
|
-
this.env =
|
|
2668
|
-
this.__owl__ = node;
|
|
2664
|
+
this.env = _useEnv();
|
|
2669
2665
|
}
|
|
2670
2666
|
setup() {}
|
|
2671
|
-
render(deep = false) {
|
|
2672
|
-
this.__owl__.render(deep === true);
|
|
2673
|
-
}
|
|
2674
2667
|
};
|
|
2675
2668
|
function _useComponent() {
|
|
2676
2669
|
return useScope().component;
|
|
2677
2670
|
}
|
|
2678
|
-
function _useExternalListener(target, eventName, handler, eventParams) {
|
|
2679
|
-
const node = useScope();
|
|
2680
|
-
const boundHandler = handler.bind(node.component);
|
|
2681
|
-
onMounted$1(() => target.addEventListener(eventName, boundHandler, eventParams));
|
|
2682
|
-
onWillUnmount$1(() => target.removeEventListener(eventName, boundHandler, eventParams));
|
|
2683
|
-
}
|
|
2684
2671
|
function onWillRender(cb) {
|
|
2685
2672
|
const node = useScope();
|
|
2686
2673
|
const renderFn = node.renderFn;
|
|
@@ -2718,27 +2705,14 @@ var _EnvPlugin = class extends Plugin {
|
|
|
2718
2705
|
env = config("env") ?? {};
|
|
2719
2706
|
};
|
|
2720
2707
|
function _useEnv() {
|
|
2721
|
-
return
|
|
2722
|
-
}
|
|
2723
|
-
function provideEnv(env) {
|
|
2724
|
-
providePlugins([_EnvPlugin], { env });
|
|
2725
|
-
return env;
|
|
2726
|
-
}
|
|
2727
|
-
function extendEnv(extension) {
|
|
2728
|
-
const env = useChildEnv();
|
|
2729
|
-
const subEnv = Object.create(env);
|
|
2730
|
-
Object.defineProperties(subEnv, Object.getOwnPropertyDescriptors(extension));
|
|
2731
|
-
return provideEnv(subEnv);
|
|
2708
|
+
return usePlugin(_EnvPlugin).env;
|
|
2732
2709
|
}
|
|
2733
2710
|
function _useSubEnv(extension) {
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
}
|
|
2740
|
-
function _useChildEnv() {
|
|
2741
|
-
return plugin(_EnvPlugin).env;
|
|
2711
|
+
const subEnv = Object.create(_useEnv());
|
|
2712
|
+
Object.defineProperties(subEnv, Object.getOwnPropertyDescriptors(extension));
|
|
2713
|
+
providePlugins([_EnvPlugin], { env: subEnv });
|
|
2714
|
+
const component = _useComponent();
|
|
2715
|
+
component.env = subEnv;
|
|
2742
2716
|
}
|
|
2743
2717
|
var VPortal = class extends blockDom$1.text("").constructor {
|
|
2744
2718
|
/**
|
|
@@ -2787,7 +2761,7 @@ var Portal = class extends OwlComponent {
|
|
|
2787
2761
|
static template = xml$1`<t t-call-slot="default"/>`;
|
|
2788
2762
|
constructor(node) {
|
|
2789
2763
|
super(node);
|
|
2790
|
-
this.props =
|
|
2764
|
+
this.props = useProps$1();
|
|
2791
2765
|
this.__owl__ = node;
|
|
2792
2766
|
}
|
|
2793
2767
|
setup() {
|
|
@@ -2820,18 +2794,6 @@ const customDirectives = {
|
|
|
2820
2794
|
/**
|
|
2821
2795
|
* @param {HTMLElement} node
|
|
2822
2796
|
* @param {string} value
|
|
2823
|
-
* @param {string[]} modifiers
|
|
2824
|
-
*/
|
|
2825
|
-
model: (node, value, modifiers) => {
|
|
2826
|
-
let attribute = "t-model";
|
|
2827
|
-
for (const modifier of modifiers) attribute += `.${modifier}`;
|
|
2828
|
-
const getter = `() => ${value}`;
|
|
2829
|
-
const setter = `(nv) => {${value} = nv;}`;
|
|
2830
|
-
node.setAttribute(attribute, `__globals__.createModelSignal(${getter}, ${setter})`);
|
|
2831
|
-
},
|
|
2832
|
-
/**
|
|
2833
|
-
* @param {HTMLElement} node
|
|
2834
|
-
* @param {string} value
|
|
2835
2797
|
*/
|
|
2836
2798
|
portal: (node, value) => {
|
|
2837
2799
|
if (node.nodeName.toLowerCase() !== "t") throw new Error("t-custom-portal should be on a 't' element");
|
|
@@ -2860,11 +2822,6 @@ set(value) {
|
|
|
2860
2822
|
refInfo.values[refId] = value;
|
|
2861
2823
|
} };
|
|
2862
2824
|
},
|
|
2863
|
-
/**
|
|
2864
|
-
* @param {Function} getter
|
|
2865
|
-
* @param {Function} setter
|
|
2866
|
-
*/
|
|
2867
|
-
createModelSignal: (getter, setter) => Object.assign(getter, { set: setter }),
|
|
2868
2825
|
Portal
|
|
2869
2826
|
};
|
|
2870
2827
|
var _App = class extends OwlApp {
|
|
@@ -2890,7 +2847,7 @@ var _App = class extends OwlApp {
|
|
|
2890
2847
|
createRoot(component, config = {}) {
|
|
2891
2848
|
if (config.env) component = { [component.name]: class extends component {
|
|
2892
2849
|
constructor(node) {
|
|
2893
|
-
|
|
2850
|
+
providePlugins([_EnvPlugin], { env: config.env });
|
|
2894
2851
|
super(node);
|
|
2895
2852
|
}
|
|
2896
2853
|
} }[component.name];
|
|
@@ -2899,13 +2856,10 @@ var _App = class extends OwlApp {
|
|
|
2899
2856
|
};
|
|
2900
2857
|
const Component = isOdooCompatLoaded ? OwlComponent : _Component;
|
|
2901
2858
|
const useComponent = isOdooCompatLoaded ? OwlUseComponent : _useComponent;
|
|
2902
|
-
const useExternalListener = isOdooCompatLoaded ? OwlUseExternalListener : _useExternalListener;
|
|
2903
2859
|
const useLayoutEffect = isOdooCompatLoaded ? OwlUseLayoutEffect : _useLayoutEffect;
|
|
2904
2860
|
const EnvPlugin = isOdooCompatLoaded ? OwlEnvPlugin : _EnvPlugin;
|
|
2905
2861
|
const useEnv = isOdooCompatLoaded ? OwlUseEnv : _useEnv;
|
|
2906
2862
|
const useSubEnv = isOdooCompatLoaded ? OwlUseSubEnv : _useSubEnv;
|
|
2907
|
-
const useChildEnv = isOdooCompatLoaded ? OwlUseChildEnv : _useChildEnv;
|
|
2908
|
-
const useChildSubEnv = isOdooCompatLoaded ? OwlUseChildSubEnv : _useChildSubEnv;
|
|
2909
2863
|
const App$1 = isOdooCompatLoaded ? OwlApp : _App;
|
|
2910
2864
|
|
|
2911
2865
|
//#endregion
|
|
@@ -7949,7 +7903,8 @@ const readonlyAllowedCommands = /* @__PURE__ */ new Set([
|
|
|
7949
7903
|
"UPDATE_CHART",
|
|
7950
7904
|
"UPDATE_CHART_REGION",
|
|
7951
7905
|
"UPDATE_CAROUSEL_ACTIVE_ITEM",
|
|
7952
|
-
"UPDATE_PIVOT"
|
|
7906
|
+
"UPDATE_PIVOT",
|
|
7907
|
+
"UPDATE_COLOR_SCHEME"
|
|
7953
7908
|
]);
|
|
7954
7909
|
const lockedSheetAllowedCommands = /* @__PURE__ */ new Set([
|
|
7955
7910
|
"LOCK_SHEET",
|
|
@@ -9993,6 +9948,46 @@ const NON_RETROCOMPATIBLE_FUNCTIONS = [
|
|
|
9993
9948
|
];
|
|
9994
9949
|
const CONTENT_TYPES_FILE = "[Content_Types].xml";
|
|
9995
9950
|
|
|
9951
|
+
//#endregion
|
|
9952
|
+
//#region src/helpers/color_themes.ts
|
|
9953
|
+
const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
9954
|
+
const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
9955
|
+
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
9956
|
+
const TEXT_HEADER_COLOR = "#666666";
|
|
9957
|
+
const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
9958
|
+
const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
9959
|
+
const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
9960
|
+
const COLOR_THEMES = {
|
|
9961
|
+
light: {
|
|
9962
|
+
colorThemeName: "light",
|
|
9963
|
+
backgroundColor: "#FFFFFF",
|
|
9964
|
+
gridBorderColor: "#CECFCF",
|
|
9965
|
+
headerBackgroundColor: BACKGROUND_HEADER_COLOR,
|
|
9966
|
+
headerActiveBackgroundColor: BACKGROUND_HEADER_ACTIVE_COLOR,
|
|
9967
|
+
headerSelectedBackgroundColor: BACKGROUND_HEADER_SELECTED_COLOR,
|
|
9968
|
+
headerTextColor: TEXT_HEADER_COLOR,
|
|
9969
|
+
headerBorderColor: HEADER_BORDER_COLOR,
|
|
9970
|
+
frozenPaneBorderColor: FROZEN_PANE_BORDER_COLOR,
|
|
9971
|
+
frozenPaneHeaderBorderColor: FROZEN_PANE_HEADER_BORDER_COLOR,
|
|
9972
|
+
singleCellSelectionBackgroundColor: "#F3F7FE",
|
|
9973
|
+
multipleCellsSelectionBackgroundColor: "#E9F0FF"
|
|
9974
|
+
},
|
|
9975
|
+
dark: {
|
|
9976
|
+
colorThemeName: "dark",
|
|
9977
|
+
backgroundColor: adaptForDarkMode("#1A1C2E"),
|
|
9978
|
+
gridBorderColor: adaptForDarkMode("#6B706F"),
|
|
9979
|
+
headerBackgroundColor: adaptForDarkMode("#262A36"),
|
|
9980
|
+
headerActiveBackgroundColor: adaptForDarkMode("#3A4052"),
|
|
9981
|
+
headerSelectedBackgroundColor: adaptForDarkMode("#4E566E"),
|
|
9982
|
+
headerTextColor: adaptForDarkMode("#A1A6B3"),
|
|
9983
|
+
headerBorderColor: adaptForDarkMode("#7A7F91"),
|
|
9984
|
+
frozenPaneBorderColor: adaptForDarkMode("#7A7F91"),
|
|
9985
|
+
frozenPaneHeaderBorderColor: adaptForDarkMode("#9FA5BD"),
|
|
9986
|
+
singleCellSelectionBackgroundColor: adaptForDarkMode("#696E8044"),
|
|
9987
|
+
multipleCellsSelectionBackgroundColor: adaptForDarkMode("#828AA044")
|
|
9988
|
+
}
|
|
9989
|
+
};
|
|
9990
|
+
|
|
9996
9991
|
//#endregion
|
|
9997
9992
|
//#region src/helpers/figures/charts/chart_common.ts
|
|
9998
9993
|
const TREND_LINE_XAXIS_ID = "x1";
|
|
@@ -10214,9 +10209,8 @@ function truncateLabel(label, maxLen = 20) {
|
|
|
10214
10209
|
function isTrendLineAxis(axisID) {
|
|
10215
10210
|
return axisID === "x1" || axisID === "xMovingAverage";
|
|
10216
10211
|
}
|
|
10217
|
-
function getChartBackgroundColor({ background },
|
|
10218
|
-
|
|
10219
|
-
if (!background) return defaultColor;
|
|
10212
|
+
function getChartBackgroundColor({ background }, colorThemeName) {
|
|
10213
|
+
if (!background) return COLOR_THEMES[colorThemeName].backgroundColor;
|
|
10220
10214
|
return background;
|
|
10221
10215
|
}
|
|
10222
10216
|
|
|
@@ -12313,14 +12307,14 @@ const ScorecardChart$1 = {
|
|
|
12313
12307
|
if (definition.baseline && isFormula(definition.baseline)) formulas.push(CompiledFormula.Compile(definition.baseline, sheetId, getters));
|
|
12314
12308
|
return formulas;
|
|
12315
12309
|
},
|
|
12316
|
-
getRuntime(getters, definition, _dataExtractor, sheetId) {
|
|
12310
|
+
getRuntime(getters, definition, _dataExtractor, sheetId, eventHandlers, colorThemeName) {
|
|
12317
12311
|
let formattedKeyValue = "";
|
|
12318
12312
|
const { scalar: keyValue, range: keyValueRange } = getData$1(definition.keyValue, getters, sheetId);
|
|
12319
12313
|
const locale = getters.getLocale();
|
|
12320
12314
|
if (keyValue !== null && keyValue !== void 0) formattedKeyValue = getKeyValueText(keyValue, definition.humanize ?? true, locale);
|
|
12321
12315
|
else formattedKeyValue = "";
|
|
12322
12316
|
const { scalar: baseline, range: baselineRange } = getData$1(definition.baseline, getters, sheetId);
|
|
12323
|
-
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, keyValueRange);
|
|
12317
|
+
const { background, fontColor } = getters.getStyleOfSingleCellChart(definition.background, keyValueRange, colorThemeName);
|
|
12324
12318
|
const baselineDisplay = getBaselineText(baseline, keyValue, definition.baselineMode, definition.humanize ?? true, locale);
|
|
12325
12319
|
const baselineValue = definition.baselineMode === "progress" && isNumber(baselineDisplay, locale) ? toNumber(baselineDisplay, locale) : 0;
|
|
12326
12320
|
const title = definition.title;
|
|
@@ -14560,22 +14554,35 @@ function sampleIndices(length, maxPoints) {
|
|
|
14560
14554
|
const step = length / maxPoints;
|
|
14561
14555
|
return Array.from({ length: maxPoints }, (_, i) => Math.min(length - 1, Math.floor(i * step)));
|
|
14562
14556
|
}
|
|
14563
|
-
async function chartToImageUrl(runtime, figure, type) {
|
|
14557
|
+
async function chartToImageUrl(runtime, figure, type, colorThemeName = "light") {
|
|
14564
14558
|
try {
|
|
14565
14559
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14566
14560
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14567
|
-
const imageUrl = await canvasToObjectUrl(canvas);
|
|
14561
|
+
const imageUrl = await canvasToObjectUrl(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14568
14562
|
cleanup();
|
|
14569
14563
|
return imageUrl;
|
|
14570
14564
|
} catch (error) {
|
|
14571
14565
|
console.log("Error exporting chart to image URL: " + error.message);
|
|
14572
14566
|
}
|
|
14573
14567
|
}
|
|
14574
|
-
|
|
14568
|
+
/**
|
|
14569
|
+
* Charts are drawn with pre-inverted colors (see `adaptForDarkMode`) because they are displayed
|
|
14570
|
+
* through the `os-theme-dependant` CSS filter. An exported image doesn't get that filter, so it
|
|
14571
|
+
* has to be applied to the pixels to obtain what is actually displayed on screen.
|
|
14572
|
+
*/
|
|
14573
|
+
function applyDarkMode(canvas) {
|
|
14574
|
+
const filtered = createRenderingSurface(canvas.width, canvas.height);
|
|
14575
|
+
const ctx = filtered.getContext("2d");
|
|
14576
|
+
if (!ctx || !("filter" in ctx)) return canvas;
|
|
14577
|
+
ctx.filter = DARK_MODE_FILTER_STRING;
|
|
14578
|
+
ctx.drawImage(canvas, 0, 0);
|
|
14579
|
+
return filtered;
|
|
14580
|
+
}
|
|
14581
|
+
async function chartToImageFile(runtime, figure, type, colorThemeName = "light") {
|
|
14575
14582
|
try {
|
|
14576
14583
|
const canvas = createRenderingSurface(figure.width, figure.height);
|
|
14577
14584
|
const cleanup = drawChartOnCanvas(canvas, runtime, figure, type);
|
|
14578
|
-
const chartBlob = await canvasToBlob(canvas);
|
|
14585
|
+
const chartBlob = await canvasToBlob(colorThemeName === "dark" ? applyDarkMode(canvas) : canvas);
|
|
14579
14586
|
cleanup();
|
|
14580
14587
|
return chartBlob;
|
|
14581
14588
|
} catch (error) {
|
|
@@ -14883,7 +14890,7 @@ function getCopyAsImageMenuItem(figureId, env) {
|
|
|
14883
14890
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14884
14891
|
if (!chartId) return;
|
|
14885
14892
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14886
|
-
const blob = await chartToImageFile(env.model.getters.getChartRuntime(chartId), figure, chartType);
|
|
14893
|
+
const blob = await chartToImageFile(env.model.getters.getChartRuntime(chartId), figure, chartType, env.model.getters.getSpreadsheetTheme().colorThemeName);
|
|
14887
14894
|
if (!blob) return;
|
|
14888
14895
|
const image = await new Promise((resolve) => {
|
|
14889
14896
|
const reader = new FileReader();
|
|
@@ -14920,7 +14927,7 @@ function getDownloadChartMenuItem(figureId, env) {
|
|
|
14920
14927
|
const chartId = env.model.getters.getChartIdFromFigureId(figureId);
|
|
14921
14928
|
if (!chartId) return;
|
|
14922
14929
|
const chartType = env.model.getters.getChartType(chartId);
|
|
14923
|
-
const url = await chartToImageUrl(env.model.getters.getChartRuntime(chartId), figure, chartType);
|
|
14930
|
+
const url = await chartToImageUrl(env.model.getters.getChartRuntime(chartId), figure, chartType, env.model.getters.getSpreadsheetTheme().colorThemeName);
|
|
14924
14931
|
if (!url) return;
|
|
14925
14932
|
downloadFile(url, "chart");
|
|
14926
14933
|
},
|
|
@@ -16469,8 +16476,8 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
16469
16476
|
useLayoutEffect(() => {
|
|
16470
16477
|
if (!this.props.disableKeyboardNavigation && !this.state.hoveredMenu && !this.subMenu.isOpen) this.menuRef()?.focus();
|
|
16471
16478
|
});
|
|
16472
|
-
|
|
16473
|
-
|
|
16479
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
16480
|
+
useListener(window, "contextmenu", this.onExternalClick.bind(this), { capture: true });
|
|
16474
16481
|
onWillUpdateProps((nextProps) => {
|
|
16475
16482
|
if (nextProps.menuItems !== this.props.menuItems) this.closeSubMenu();
|
|
16476
16483
|
});
|
|
@@ -20974,7 +20981,7 @@ var GridAddRowsFooter = class extends Component {
|
|
|
20974
20981
|
setup() {
|
|
20975
20982
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
20976
20983
|
this.viewStore = useStore(ViewportsStore);
|
|
20977
|
-
|
|
20984
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
20978
20985
|
}
|
|
20979
20986
|
get addRowsPosition() {
|
|
20980
20987
|
const { scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
@@ -21505,7 +21512,7 @@ function useCellHovered(env, gridRef) {
|
|
|
21505
21512
|
useListener(gridRef, "mouseenter", resume);
|
|
21506
21513
|
useListener(gridRef, "pointerdown", recompute);
|
|
21507
21514
|
useListener(gridRef, "pointerdown", (ev) => env.isMobile() && updateMousePosition(withZoom(env, ev)));
|
|
21508
|
-
|
|
21515
|
+
useListener(window, "click", handleGlobalClick);
|
|
21509
21516
|
function handleGlobalClick(e) {
|
|
21510
21517
|
const target = e.target;
|
|
21511
21518
|
const grid = gridRef();
|
|
@@ -23509,7 +23516,7 @@ var Select = class extends Component {
|
|
|
23509
23516
|
hoveredValue: void 0
|
|
23510
23517
|
});
|
|
23511
23518
|
setup() {
|
|
23512
|
-
|
|
23519
|
+
useListener(window, "pointerdown", this.onExternalClick.bind(this), { capture: true });
|
|
23513
23520
|
useLayoutEffect(() => {
|
|
23514
23521
|
const el = this.dropdownRef();
|
|
23515
23522
|
if (el) el.style.width = `${this.selectRef()?.offsetWidth}px`;
|
|
@@ -23611,7 +23618,7 @@ var InfoPopover = class extends Component {
|
|
|
23611
23618
|
});
|
|
23612
23619
|
static components = { Popover };
|
|
23613
23620
|
setup() {
|
|
23614
|
-
|
|
23621
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
23615
23622
|
}
|
|
23616
23623
|
infoRef = signal.ref();
|
|
23617
23624
|
get popoverProps() {
|
|
@@ -24021,6 +24028,7 @@ figureRegistry.add("chart", {
|
|
|
24021
24028
|
Component: ChartFigure,
|
|
24022
24029
|
SidePanelComponent: "ChartPanel",
|
|
24023
24030
|
menuBuilder: getChartMenuActions,
|
|
24031
|
+
minFigSize: 80,
|
|
24024
24032
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24025
24033
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24026
24034
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24039,6 +24047,7 @@ figureRegistry.add("image", {
|
|
|
24039
24047
|
figureRegistry.add("carousel", {
|
|
24040
24048
|
Component: CarouselFigure,
|
|
24041
24049
|
menuBuilder: getCarouselMenuActions,
|
|
24050
|
+
minFigSize: 80,
|
|
24042
24051
|
borderWidth: (getters) => getters.isDashboard() ? 0 : 1,
|
|
24043
24052
|
hasShadow: (getters) => getters.isDashboard(),
|
|
24044
24053
|
isRounded: (getters) => getters.isDashboard(),
|
|
@@ -24171,7 +24180,7 @@ var FigureComponent = class extends Component {
|
|
|
24171
24180
|
...this.positionInBoundary(sheetId, this.env.model.getters.getFigureUI(sheetId, figure), ev.key, ev.shiftKey)
|
|
24172
24181
|
});
|
|
24173
24182
|
}
|
|
24174
|
-
this.env.model.dispatch("
|
|
24183
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures });
|
|
24175
24184
|
ev.preventDefault();
|
|
24176
24185
|
ev.stopPropagation();
|
|
24177
24186
|
break;
|
|
@@ -30916,7 +30925,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30916
30925
|
getFormulas(getters) {
|
|
30917
30926
|
return this.chartTypeBuilder.getFormulas(getters, this.sheetId, this.definition);
|
|
30918
30927
|
}
|
|
30919
|
-
getRuntime(getters, chartId) {
|
|
30928
|
+
getRuntime(getters, chartId, colorThemeName) {
|
|
30920
30929
|
const dataSource = this.dataSource;
|
|
30921
30930
|
const dataExtractors = dataSource ? {
|
|
30922
30931
|
extractData: () => this.dataSourceBuilder.extractData(dataSource, chartId, getters),
|
|
@@ -30936,7 +30945,7 @@ var SpreadsheetChart = class SpreadsheetChart {
|
|
|
30936
30945
|
return this.dataSourceBuilder.onDataSetClick?.(this.definition.type, chartId, event, items, chartJsChart, getters);
|
|
30937
30946
|
},
|
|
30938
30947
|
onHover: (event, items, chartJsChart) => this.dataSourceBuilder.onDataSetHover?.(this.definition.type, chartId, event, items, chartJsChart)
|
|
30939
|
-
});
|
|
30948
|
+
}, colorThemeName);
|
|
30940
30949
|
}
|
|
30941
30950
|
static deleteInvalidKeys(definition) {
|
|
30942
30951
|
definition = { ...definition };
|
|
@@ -32199,7 +32208,7 @@ var NumberEditor = class extends Component {
|
|
|
32199
32208
|
DOMFocusableElementStore;
|
|
32200
32209
|
setup() {
|
|
32201
32210
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
32202
|
-
|
|
32211
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
32203
32212
|
onWillUpdateProps((nextProps) => {
|
|
32204
32213
|
const input = this.inputRef();
|
|
32205
32214
|
if (input && document.activeElement !== input) input.value = nextProps.currentValue;
|
|
@@ -32300,7 +32309,7 @@ var TextStyler = class extends Component {
|
|
|
32300
32309
|
});
|
|
32301
32310
|
openedEl = null;
|
|
32302
32311
|
setup() {
|
|
32303
|
-
|
|
32312
|
+
useListener(window, "click", this.onExternalClick.bind(this));
|
|
32304
32313
|
}
|
|
32305
32314
|
state = proxy({ activeTool: "" });
|
|
32306
32315
|
updateFontSize(fontSize) {
|
|
@@ -33394,7 +33403,7 @@ var RoundColorPicker = class extends Component {
|
|
|
33394
33403
|
state;
|
|
33395
33404
|
setup() {
|
|
33396
33405
|
this.state = proxy({ pickerOpened: false });
|
|
33397
|
-
|
|
33406
|
+
useListener(window, "click", this.closePicker.bind(this));
|
|
33398
33407
|
}
|
|
33399
33408
|
closePicker() {
|
|
33400
33409
|
this.state.pickerOpened = false;
|
|
@@ -34017,7 +34026,7 @@ function toXlsxHexColor(color) {
|
|
|
34017
34026
|
//#region src/helpers/figures/charts/runtime/chart_data_extractor.ts
|
|
34018
34027
|
const EMPTY$1 = Object.freeze({ value: null });
|
|
34019
34028
|
const ZERO = Object.freeze({ value: 0 });
|
|
34020
|
-
function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34029
|
+
function getBarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34021
34030
|
const locale = getters.getLocale();
|
|
34022
34031
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34023
34032
|
format,
|
|
@@ -34049,7 +34058,7 @@ function getBarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34049
34058
|
labels,
|
|
34050
34059
|
locale: getters.getLocale(),
|
|
34051
34060
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34052
|
-
background: getChartBackgroundColor(definition,
|
|
34061
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34053
34062
|
};
|
|
34054
34063
|
}
|
|
34055
34064
|
function getDateTimeLabel(value, stamp) {
|
|
@@ -34108,7 +34117,7 @@ function computeValuesAndLabels(timeValues, values, horizontalGroupBy, verticalG
|
|
|
34108
34117
|
labels: xValues.map((v) => ({ value: getDateTimeLabel(v, horizontalGroupBy) }))
|
|
34109
34118
|
};
|
|
34110
34119
|
}
|
|
34111
|
-
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34120
|
+
function getCalendarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34112
34121
|
let labels = labelValues;
|
|
34113
34122
|
const locale = getters.getLocale();
|
|
34114
34123
|
const countEntries = dataSetsValues.length === 0;
|
|
@@ -34121,14 +34130,14 @@ function getCalendarChartData(definition, { labelValues, dataSetsValues }, gette
|
|
|
34121
34130
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34122
34131
|
locale: getters.getLocale(),
|
|
34123
34132
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34124
|
-
background: getChartBackgroundColor(definition,
|
|
34133
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34125
34134
|
};
|
|
34126
34135
|
}
|
|
34127
|
-
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34136
|
+
function getPyramidChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34128
34137
|
const barChartData = getBarChartData(definition, {
|
|
34129
34138
|
labelValues,
|
|
34130
34139
|
dataSetsValues: dataSetsValues.slice(0, 2)
|
|
34131
|
-
}, getters);
|
|
34140
|
+
}, getters, colorThemeName);
|
|
34132
34141
|
const barDataset = barChartData.dataSetsValues.filter((ds) => !ds.hidden);
|
|
34133
34142
|
const pyramidDatasetValues = [];
|
|
34134
34143
|
if (barDataset[0]) {
|
|
@@ -34150,7 +34159,7 @@ function getPyramidChartData(definition, { labelValues, dataSetsValues }, getter
|
|
|
34150
34159
|
dataSetsValues: pyramidDatasetValues
|
|
34151
34160
|
};
|
|
34152
34161
|
}
|
|
34153
|
-
function getLineChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34162
|
+
function getLineChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34154
34163
|
const axisType = getChartAxisType(definition, {
|
|
34155
34164
|
labelValues,
|
|
34156
34165
|
dataSetsValues
|
|
@@ -34186,10 +34195,10 @@ function getLineChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34186
34195
|
trendDataSetsValues,
|
|
34187
34196
|
axisType,
|
|
34188
34197
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34189
|
-
background: getChartBackgroundColor(definition,
|
|
34198
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34190
34199
|
};
|
|
34191
34200
|
}
|
|
34192
|
-
function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34201
|
+
function getPieChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34193
34202
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34194
34203
|
format,
|
|
34195
34204
|
locale: getters.getLocale()
|
|
@@ -34204,10 +34213,10 @@ function getPieChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34204
34213
|
labels,
|
|
34205
34214
|
locale: getters.getLocale(),
|
|
34206
34215
|
topPadding: getTopPaddingForDashboard(definition, getters),
|
|
34207
|
-
background: getChartBackgroundColor(definition,
|
|
34216
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34208
34217
|
};
|
|
34209
34218
|
}
|
|
34210
|
-
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34219
|
+
function getRadarChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34211
34220
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34212
34221
|
format,
|
|
34213
34222
|
locale: getters.getLocale()
|
|
@@ -34220,10 +34229,10 @@ function getRadarChartData(definition, { labelValues, dataSetsValues }, getters)
|
|
|
34220
34229
|
axisFormats,
|
|
34221
34230
|
labels,
|
|
34222
34231
|
locale: getters.getLocale(),
|
|
34223
|
-
background: getChartBackgroundColor(definition,
|
|
34232
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34224
34233
|
};
|
|
34225
34234
|
}
|
|
34226
|
-
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34235
|
+
function getGeoChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34227
34236
|
dataSetsValues = dataSetsValues.slice(0, 1);
|
|
34228
34237
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34229
34238
|
format,
|
|
@@ -34239,10 +34248,10 @@ function getGeoChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
|
34239
34248
|
availableRegions: getters.getGeoChartAvailableRegions(),
|
|
34240
34249
|
geoFeatureNameToId: getters.geoFeatureNameToId,
|
|
34241
34250
|
getGeoJsonFeatures: getters.getGeoJsonFeatures,
|
|
34242
|
-
background: getChartBackgroundColor(definition,
|
|
34251
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34243
34252
|
};
|
|
34244
34253
|
}
|
|
34245
|
-
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34254
|
+
function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34246
34255
|
let labels = labelValues.map(({ value, format }) => formatValue(value, {
|
|
34247
34256
|
format,
|
|
34248
34257
|
locale: getters.getLocale()
|
|
@@ -34256,10 +34265,10 @@ function getFunnelChartData(definition, { labelValues, dataSetsValues }, getters
|
|
|
34256
34265
|
axisFormats: { x: format },
|
|
34257
34266
|
labels,
|
|
34258
34267
|
locale: getters.getLocale(),
|
|
34259
|
-
background: getChartBackgroundColor(definition,
|
|
34268
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34260
34269
|
};
|
|
34261
34270
|
}
|
|
34262
|
-
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters) {
|
|
34271
|
+
function getHierarchalChartData(definition, { labelValues, dataSetsValues }, getters, colorThemeName) {
|
|
34263
34272
|
let labels = labelValues;
|
|
34264
34273
|
({labels, dataSetsValues} = filterValuesWithDifferentSigns(labels, dataSetsValues));
|
|
34265
34274
|
({labels, dataSetsValues} = filterInvalidHierarchicalPoints(labels, dataSetsValues));
|
|
@@ -34268,12 +34277,12 @@ function getHierarchalChartData(definition, { labelValues, dataSetsValues }, get
|
|
|
34268
34277
|
axisFormats: { y: getChartLabelFormat(labels) },
|
|
34269
34278
|
labels: labels.map(({ value }) => String(value ?? "")),
|
|
34270
34279
|
locale: getters.getLocale(),
|
|
34271
|
-
background: getChartBackgroundColor(definition,
|
|
34280
|
+
background: getChartBackgroundColor(definition, colorThemeName)
|
|
34272
34281
|
};
|
|
34273
34282
|
}
|
|
34274
|
-
function getBubbleChartData(definition, getters) {
|
|
34283
|
+
function getBubbleChartData(definition, getters, colorThemeName) {
|
|
34275
34284
|
const chartData = getBubbleChartSourceData(definition, getters);
|
|
34276
|
-
const data = getLineChartData(definition, chartData, getters);
|
|
34285
|
+
const data = getLineChartData(definition, chartData, getters, colorThemeName);
|
|
34277
34286
|
let labelValues = definition.labelRange ? getters.getVisibleRangeValues(definition.labelRange) : [];
|
|
34278
34287
|
let sizeValues = definition.sizeRange ? getters.getVisibleRangeValues(definition.sizeRange) : [];
|
|
34279
34288
|
if (chartData.shouldRemoveFirstLabel) {
|
|
@@ -35275,9 +35284,9 @@ const templates = `
|
|
|
35275
35284
|
`;
|
|
35276
35285
|
let app;
|
|
35277
35286
|
function renderToString(templateName, context = {}) {
|
|
35278
|
-
return render(templateName, context).innerHTML;
|
|
35287
|
+
return render$1(templateName, context).innerHTML;
|
|
35279
35288
|
}
|
|
35280
|
-
function render(templateName, context = {}) {
|
|
35289
|
+
function render$1(templateName, context = {}) {
|
|
35281
35290
|
if (!app) app = new App({
|
|
35282
35291
|
templates,
|
|
35283
35292
|
translateFn: _t
|
|
@@ -35642,8 +35651,8 @@ const BarChart = {
|
|
|
35642
35651
|
verticalAxis: getDefinedAxis(definition)
|
|
35643
35652
|
};
|
|
35644
35653
|
},
|
|
35645
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
35646
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
35654
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
35655
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
35647
35656
|
return {
|
|
35648
35657
|
chartJsConfig: {
|
|
35649
35658
|
type: "bar",
|
|
@@ -35831,7 +35840,7 @@ const GaugeChart = {
|
|
|
35831
35840
|
definition.sectionRule.upperInflectionPoint.value
|
|
35832
35841
|
].filter((value) => value.startsWith("=")).map((formula) => CompiledFormula.Compile(formula, sheetId, getters));
|
|
35833
35842
|
},
|
|
35834
|
-
getRuntime(getters, definition, dataSource, sheetId) {
|
|
35843
|
+
getRuntime(getters, definition, dataSource, sheetId, eventHandlers, colorThemeName) {
|
|
35835
35844
|
const locale = getters.getLocale();
|
|
35836
35845
|
const chartColors = definition.sectionRule.colors;
|
|
35837
35846
|
let gaugeValue = void 0;
|
|
@@ -35852,7 +35861,7 @@ const GaugeChart = {
|
|
|
35852
35861
|
}
|
|
35853
35862
|
let minValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMin, getters);
|
|
35854
35863
|
let maxValue = getFormulaNumberValue(sheetId, definition.sectionRule.rangeMax, getters);
|
|
35855
|
-
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters);
|
|
35864
|
+
if (minValue === void 0 || maxValue === void 0) return getInvalidGaugeRuntime(definition, getters, colorThemeName);
|
|
35856
35865
|
if (maxValue < minValue) [minValue, maxValue] = [maxValue, minValue];
|
|
35857
35866
|
const lowerPoint = definition.sectionRule.lowerInflectionPoint;
|
|
35858
35867
|
const upperPoint = definition.sectionRule.upperInflectionPoint;
|
|
@@ -35884,7 +35893,7 @@ const GaugeChart = {
|
|
|
35884
35893
|
}
|
|
35885
35894
|
colors.push(chartColors.upperColor);
|
|
35886
35895
|
return {
|
|
35887
|
-
background: getters.getStyleOfSingleCellChart(definition.background, dataRange).background,
|
|
35896
|
+
background: getters.getStyleOfSingleCellChart(definition.background, dataRange, colorThemeName).background,
|
|
35888
35897
|
title: {
|
|
35889
35898
|
...title,
|
|
35890
35899
|
text: title.text ? getters.dynamicTranslate(title.text) : ""
|
|
@@ -35918,9 +35927,9 @@ function getFormulaNumberValue(sheetId, formula, getters) {
|
|
|
35918
35927
|
const value = getters.evaluateFormula(sheetId, formula);
|
|
35919
35928
|
return isMultipleElementMatrix(value) ? void 0 : tryToNumber(toScalar(value), getters.getLocale());
|
|
35920
35929
|
}
|
|
35921
|
-
function getInvalidGaugeRuntime(definition, getters) {
|
|
35930
|
+
function getInvalidGaugeRuntime(definition, getters, colorThemeName) {
|
|
35922
35931
|
return {
|
|
35923
|
-
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange).background,
|
|
35932
|
+
background: getters.getStyleOfSingleCellChart(definition.background, definition.dataRange, colorThemeName).background,
|
|
35924
35933
|
title: definition.title ?? { text: "" },
|
|
35925
35934
|
minValue: {
|
|
35926
35935
|
value: 0,
|
|
@@ -36014,8 +36023,8 @@ const LineChart = {
|
|
|
36014
36023
|
verticalAxis: getDefinedAxis(definition)
|
|
36015
36024
|
};
|
|
36016
36025
|
},
|
|
36017
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36018
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
36026
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36027
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
36019
36028
|
return {
|
|
36020
36029
|
chartJsConfig: {
|
|
36021
36030
|
type: "line",
|
|
@@ -36096,8 +36105,8 @@ const PieChart = {
|
|
|
36096
36105
|
labelRange
|
|
36097
36106
|
};
|
|
36098
36107
|
},
|
|
36099
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36100
|
-
const chartData = getPieChartData(definition, extractData(), getters);
|
|
36108
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36109
|
+
const chartData = getPieChartData(definition, extractData(), getters, colorThemeName);
|
|
36101
36110
|
return { chartJsConfig: {
|
|
36102
36111
|
type: definition.isDoughnut ? "doughnut" : "pie",
|
|
36103
36112
|
data: {
|
|
@@ -36173,8 +36182,8 @@ const WaterfallChart = {
|
|
|
36173
36182
|
};
|
|
36174
36183
|
},
|
|
36175
36184
|
getDefinitionForExcel: () => void 0,
|
|
36176
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
36177
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
36185
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
36186
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
36178
36187
|
const { labels, datasets } = getWaterfallDatasetAndLabels(definition, chartData);
|
|
36179
36188
|
return { chartJsConfig: {
|
|
36180
36189
|
type: "bar",
|
|
@@ -36941,7 +36950,7 @@ var CalendarChartConfigPanel = class extends GenericChartConfigPanel {
|
|
|
36941
36950
|
getGroupByOptions() {
|
|
36942
36951
|
const sheetId = this.env.model.getters.getFigureSheetId(this.env.model.getters.getFigureIdFromChartId(this.props.chartId));
|
|
36943
36952
|
const definition = SpreadsheetChart.fromStrDefinition(this.env.model.getters, sheetId, this.props.definition).getRangeDefinition();
|
|
36944
|
-
const labels = getBarChartData(definition, getChartData(this.env.model.getters, definition.dataSource), this.env.model.getters).labels.filter((l) => isDateTime(l, DEFAULT_LOCALE));
|
|
36953
|
+
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));
|
|
36945
36954
|
if (labels.length === 0) return [];
|
|
36946
36955
|
const dates = labels.map((label) => toJsDate(label, this.env.model.getters.getLocale()));
|
|
36947
36956
|
const uniqueYears = /* @__PURE__ */ new Set();
|
|
@@ -37005,7 +37014,7 @@ var ColorScalePicker = class extends Component {
|
|
|
37005
37014
|
});
|
|
37006
37015
|
popoverRef = signal.ref(HTMLTableElement);
|
|
37007
37016
|
setup() {
|
|
37008
|
-
|
|
37017
|
+
useListener(window, "click", this.closePopover.bind(this));
|
|
37009
37018
|
}
|
|
37010
37019
|
get currentColorScale() {
|
|
37011
37020
|
return this.props.definition.colorScale || schemeToColorScale("oranges");
|
|
@@ -42024,7 +42033,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
42024
42033
|
useLayoutEffect((sheetId, isCfRemoved) => {
|
|
42025
42034
|
if (this.activeSheetId !== sheetId || isCfRemoved) this.env.replaceSidePanel("ConditionalFormatting", `ConditionalFormattingEditor_${this.props.cf.id}`);
|
|
42026
42035
|
}, () => [this.env.model.getters.getActiveSheetId(), this.isEditedCfRemoved]);
|
|
42027
|
-
|
|
42036
|
+
useListener(window, "click", () => this.store.closeMenus());
|
|
42028
42037
|
}
|
|
42029
42038
|
get isEditedCfRemoved() {
|
|
42030
42039
|
return !Boolean(this.env.model.getters.getConditionalFormats(this.activeSheetId).find((cf) => cf.id === this.props.cf.id));
|
|
@@ -42297,7 +42306,7 @@ function startChartDragAndDrop(env, definition, ev) {
|
|
|
42297
42306
|
canvas.className = "w-100 h-100";
|
|
42298
42307
|
container.appendChild(canvas);
|
|
42299
42308
|
spreadsheet.appendChild(container);
|
|
42300
|
-
destroyChart = drawChartOnCanvas(canvas, SpreadsheetChart.fromStrDefinition(getters, sheetId, definition).getRuntime(getters, "newChart"), {
|
|
42309
|
+
destroyChart = drawChartOnCanvas(canvas, SpreadsheetChart.fromStrDefinition(getters, sheetId, definition).getRuntime(getters, "newChart", getters.getSpreadsheetTheme().colorThemeName), {
|
|
42301
42310
|
width,
|
|
42302
42311
|
height
|
|
42303
42312
|
}, definition.type, zoom);
|
|
@@ -42378,7 +42387,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42378
42387
|
getChartConfiguration() {
|
|
42379
42388
|
const getters = this.env.model.getters;
|
|
42380
42389
|
const activeSheetId = getters.getActiveSheetId();
|
|
42381
|
-
const runtime = SpreadsheetChart.fromStrDefinition(getters, activeSheetId, this.props.definition).getRuntime(getters, "myChart");
|
|
42390
|
+
const runtime = SpreadsheetChart.fromStrDefinition(getters, activeSheetId, this.props.definition).getRuntime(getters, "myChart", getters.getSpreadsheetTheme().colorThemeName);
|
|
42382
42391
|
if (!("chartJsConfig" in runtime)) return null;
|
|
42383
42392
|
let config = runtime.chartJsConfig;
|
|
42384
42393
|
const existingScales = config.options?.scales ?? {};
|
|
@@ -42445,7 +42454,7 @@ var ChartSuggestionPreview = class extends Component {
|
|
|
42445
42454
|
const canvas = this.chartCanvasRef();
|
|
42446
42455
|
if (!canvas) return;
|
|
42447
42456
|
const getters = this.env.model.getters;
|
|
42448
|
-
let runtime = SpreadsheetChart.fromStrDefinition(getters, getters.getActiveSheetId(), this.props.definition).getRuntime(getters, "myChart");
|
|
42457
|
+
let runtime = SpreadsheetChart.fromStrDefinition(getters, getters.getActiveSheetId(), this.props.definition).getRuntime(getters, "myChart", getters.getSpreadsheetTheme().colorThemeName);
|
|
42449
42458
|
const { type } = this.props.definition;
|
|
42450
42459
|
if (type === "scorecard") {
|
|
42451
42460
|
const rect = canvas.getBoundingClientRect();
|
|
@@ -43927,6 +43936,7 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43927
43936
|
mutators = [
|
|
43928
43937
|
"updateSearchOptions",
|
|
43929
43938
|
"updateSearchContent",
|
|
43939
|
+
"updateReplaceContent",
|
|
43930
43940
|
"searchFormulas",
|
|
43931
43941
|
"selectPreviousMatch",
|
|
43932
43942
|
"selectNextMatch",
|
|
@@ -43979,6 +43989,9 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
43979
43989
|
updateSearchContent(toSearch) {
|
|
43980
43990
|
this._updateSearch(toSearch, this.searchOptions);
|
|
43981
43991
|
}
|
|
43992
|
+
updateReplaceContent(toReplace) {
|
|
43993
|
+
this.toReplace = toReplace;
|
|
43994
|
+
}
|
|
43982
43995
|
updateSearchOptions(searchOptions) {
|
|
43983
43996
|
this._updateSearch(this.toSearch, {
|
|
43984
43997
|
...this.searchOptions,
|
|
@@ -44336,7 +44349,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44336
44349
|
get currentSheetMatchesCount() {
|
|
44337
44350
|
const { activeSheetMatchesCount: count, activeSheetHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44338
44351
|
const sheetName = this.env.model.getters.getSheetName(this.env.model.getters.getActiveSheetId());
|
|
44339
|
-
let label = count === 1 ? _t("1 match in %(sheetName)s", { sheetName }) : _t("%(count)s matches in %(sheetName)s", {
|
|
44352
|
+
let label = count === 1 ? _t("1 match in '%(sheetName)s'", { sheetName }) : _t("%(count)s matches in '%(sheetName)s'", {
|
|
44340
44353
|
count,
|
|
44341
44354
|
sheetName
|
|
44342
44355
|
});
|
|
@@ -44348,10 +44361,10 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44348
44361
|
if (!range) return "";
|
|
44349
44362
|
const { specificRangeMatchesCount: count, specificRangeHiddenMatchesCount: hidden, searchOptions } = this.store;
|
|
44350
44363
|
const { sheetId, zone } = range;
|
|
44351
|
-
let label = count === 1 ? _t("1 match in range %(range)s of %(sheetName)s", {
|
|
44364
|
+
let label = count === 1 ? _t("1 match in range %(range)s of '%(sheetName)s'", {
|
|
44352
44365
|
range: zoneToXc(zone),
|
|
44353
44366
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
44354
|
-
}) : _t("%(count)s matches in range %(range)s of %(sheetName)s", {
|
|
44367
|
+
}) : _t("%(count)s matches in range %(range)s of '%(sheetName)s'", {
|
|
44355
44368
|
count,
|
|
44356
44369
|
range: zoneToXc(zone),
|
|
44357
44370
|
sheetName: this.env.model.getters.getSheetName(sheetId)
|
|
@@ -44379,7 +44392,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44379
44392
|
onMounted(() => this.searchInputRef()?.focus());
|
|
44380
44393
|
onWillUnmount(() => this.updateSearchContent.stopDebounce());
|
|
44381
44394
|
this.updateSearchContent = debounce(this.store.updateSearchContent, 200);
|
|
44382
|
-
|
|
44395
|
+
useListener(window, "keydown", (ev) => {
|
|
44383
44396
|
const code = keyboardEventToShortcutString(ev);
|
|
44384
44397
|
if (code === "Ctrl+F" || code === "Ctrl+H") {
|
|
44385
44398
|
this.searchInputRef()?.focus();
|
|
@@ -44394,6 +44407,9 @@ var FindAndReplacePanel = class extends Component {
|
|
|
44394
44407
|
onSearchInput(ev) {
|
|
44395
44408
|
this.updateSearchContent(ev.target.value);
|
|
44396
44409
|
}
|
|
44410
|
+
onReplaceInput(ev) {
|
|
44411
|
+
this.store.updateReplaceContent(ev.target.value);
|
|
44412
|
+
}
|
|
44397
44413
|
onKeydownPanel(ev) {
|
|
44398
44414
|
if (ev.key === "Escape") {
|
|
44399
44415
|
ev.preventDefault();
|
|
@@ -45974,7 +45990,7 @@ var PivotFilterEditor = class extends Component {
|
|
|
45974
45990
|
buttonFilter = signal.ref();
|
|
45975
45991
|
popover;
|
|
45976
45992
|
setup() {
|
|
45977
|
-
|
|
45993
|
+
useListener(window, "click", (ev) => {
|
|
45978
45994
|
if (!isChildEvent(this.buttonFilter(), ev)) this.popover.isOpen = false;
|
|
45979
45995
|
});
|
|
45980
45996
|
onWillUpdateProps((nextProps) => {
|
|
@@ -46108,7 +46124,7 @@ var AddDimensionButton = class extends Component {
|
|
|
46108
46124
|
setup() {
|
|
46109
46125
|
this.autoComplete = useLocalStore(AutoCompleteStore);
|
|
46110
46126
|
this.autoComplete.useProvider(this.getProvider());
|
|
46111
|
-
|
|
46127
|
+
useListener(window, "click", (ev) => {
|
|
46112
46128
|
if (ev.target !== this.buttonRef()) this.popover.isOpen = false;
|
|
46113
46129
|
});
|
|
46114
46130
|
useAutofocus(this.autofocusRef);
|
|
@@ -48486,7 +48502,7 @@ var TableStylesPopover = class extends Component {
|
|
|
48486
48502
|
tableStyleListRef = signal.ref();
|
|
48487
48503
|
state = proxy({ selectedCategory: this.initialSelectedCategory });
|
|
48488
48504
|
setup() {
|
|
48489
|
-
|
|
48505
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
48490
48506
|
}
|
|
48491
48507
|
onExternalClick(ev) {
|
|
48492
48508
|
const el = this.tableStyleListRef();
|
|
@@ -49701,7 +49717,8 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49701
49717
|
static components = {
|
|
49702
49718
|
Section,
|
|
49703
49719
|
RoundColorPicker,
|
|
49704
|
-
TableStylePreview
|
|
49720
|
+
TableStylePreview,
|
|
49721
|
+
TextInput
|
|
49705
49722
|
};
|
|
49706
49723
|
props = useProps({
|
|
49707
49724
|
onCloseSidePanel: types$1.function(),
|
|
@@ -49710,7 +49727,7 @@ var TableStyleEditorPanel = class extends Component {
|
|
|
49710
49727
|
});
|
|
49711
49728
|
state = proxy(this.getInitialState());
|
|
49712
49729
|
setup() {
|
|
49713
|
-
|
|
49730
|
+
useListener(window, "click", () => this.state.pickerOpened = false);
|
|
49714
49731
|
}
|
|
49715
49732
|
getInitialState() {
|
|
49716
49733
|
const editedStyle = this.props.styleId ? this.env.model.getters.getTableStyle(this.props.styleId) : null;
|
|
@@ -53587,6 +53604,15 @@ var GridComposer = class extends Component {
|
|
|
53587
53604
|
}
|
|
53588
53605
|
};
|
|
53589
53606
|
|
|
53607
|
+
//#endregion
|
|
53608
|
+
//#region src/helpers/owl3_helpers.ts
|
|
53609
|
+
/**
|
|
53610
|
+
* Comes from https://github.com/odoo/odoo/blob/master/addons/web/static/src/owl2/utils.js
|
|
53611
|
+
*/
|
|
53612
|
+
function render(component, deep = false) {
|
|
53613
|
+
component.__owl__.render(deep);
|
|
53614
|
+
}
|
|
53615
|
+
|
|
53590
53616
|
//#endregion
|
|
53591
53617
|
//#region src/components/helpers/figure_drag_helper.ts
|
|
53592
53618
|
function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, initialFigures, { maxX, maxY }, { scrollX: initialScrollX, scrollY: initialScrollY }, { scrollX, scrollY }) {
|
|
@@ -53604,19 +53630,19 @@ function dragFigureForMove({ x: mouseX, y: mouseY }, { x: mouseInitialX, y: mous
|
|
|
53604
53630
|
};
|
|
53605
53631
|
});
|
|
53606
53632
|
}
|
|
53607
|
-
function dragFigureForResize(
|
|
53608
|
-
let { x, y, width, height } =
|
|
53633
|
+
function dragFigureForResize(initialRect, dirX, dirY, { x: mouseX, y: mouseY }, { x: mouseInitialX, y: mouseInitialY }, keepRatio, minFigSize, { scrollX: initialScrollX, scrollY: initialScrollY }, { scrollX, scrollY }, { maxX, maxY }) {
|
|
53634
|
+
let { x, y, width, height } = initialRect;
|
|
53609
53635
|
if (keepRatio && dirX !== 0 && dirY !== 0) {
|
|
53610
|
-
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize);
|
|
53611
|
-
const deltaY = Math.min(dirY * (mouseInitialY - mouseY + scrollY - initialScrollY), height - minFigSize);
|
|
53636
|
+
const deltaX = Math.min(dirX * (mouseInitialX - mouseX + scrollX - initialScrollX), width - minFigSize.width);
|
|
53637
|
+
const deltaY = Math.min(dirY * (mouseInitialY - mouseY + scrollY - initialScrollY), height - minFigSize.height);
|
|
53612
53638
|
const fraction = Math.min(deltaX / width, deltaY / height);
|
|
53613
53639
|
if (dirX < 0) x = x + width * fraction;
|
|
53614
53640
|
if (dirY < 0) y = y + height * fraction;
|
|
53615
53641
|
width = width * (1 - fraction);
|
|
53616
53642
|
height = height * (1 - fraction);
|
|
53617
53643
|
} else {
|
|
53618
|
-
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize - width);
|
|
53619
|
-
const deltaY = Math.max(dirY * (mouseY - mouseInitialY + scrollY - initialScrollY), minFigSize - height);
|
|
53644
|
+
const deltaX = Math.max(dirX * (mouseX - mouseInitialX + scrollX - initialScrollX), minFigSize.width - width);
|
|
53645
|
+
const deltaY = Math.max(dirY * (mouseY - mouseInitialY + scrollY - initialScrollY), minFigSize.height - height);
|
|
53620
53646
|
width = width + deltaX;
|
|
53621
53647
|
height = height + deltaY;
|
|
53622
53648
|
if (dirX < 0) x = x - deltaX;
|
|
@@ -53631,7 +53657,6 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
53631
53657
|
y = -scrollY;
|
|
53632
53658
|
} else if (y + height > maxY) height = maxY - y;
|
|
53633
53659
|
return {
|
|
53634
|
-
...initialFigure,
|
|
53635
53660
|
x,
|
|
53636
53661
|
y,
|
|
53637
53662
|
width,
|
|
@@ -53694,29 +53719,30 @@ function snapForMove(env, figuresToSnap, otherFigures) {
|
|
|
53694
53719
|
* Try to snap the given figure to the other figures when resizing the figure, and return the snapped
|
|
53695
53720
|
* figure and the possible snap lines, if any were found
|
|
53696
53721
|
*/
|
|
53697
|
-
function snapForResize(env, resizeDirX, resizeDirY,
|
|
53698
|
-
const verticalSnapLine = getSnapLine(env,
|
|
53722
|
+
function snapForResize(env, resizeDirX, resizeDirY, rect, otherFigures) {
|
|
53723
|
+
const verticalSnapLine = getSnapLine(env, rect, [resizeDirX === -1 ? "left" : "right"], otherFigures, ["right", "left"]);
|
|
53724
|
+
const horizontalSnapLine = getSnapLine(env, rect, [resizeDirY === -1 ? "top" : "bottom"], otherFigures, ["bottom", "top"]);
|
|
53699
53725
|
if (verticalSnapLine) {
|
|
53700
|
-
if (resizeDirX === 1)
|
|
53726
|
+
if (resizeDirX === 1) rect.width -= verticalSnapLine.snapOffset;
|
|
53701
53727
|
else if (resizeDirX === -1) {
|
|
53702
|
-
|
|
53703
|
-
|
|
53728
|
+
rect.x -= verticalSnapLine.snapOffset;
|
|
53729
|
+
rect.width += verticalSnapLine.snapOffset;
|
|
53704
53730
|
}
|
|
53705
53731
|
}
|
|
53706
|
-
const horizontalSnapLine = getSnapLine(env, figureToSnap, [resizeDirY === -1 ? "top" : "bottom"], otherFigures, ["bottom", "top"]);
|
|
53707
53732
|
if (horizontalSnapLine) {
|
|
53708
|
-
if (resizeDirY === 1)
|
|
53733
|
+
if (resizeDirY === 1) rect.height -= horizontalSnapLine.snapOffset;
|
|
53709
53734
|
else if (resizeDirY === -1) {
|
|
53710
|
-
|
|
53711
|
-
|
|
53735
|
+
rect.y -= horizontalSnapLine.snapOffset;
|
|
53736
|
+
rect.height += horizontalSnapLine.snapOffset;
|
|
53712
53737
|
}
|
|
53713
53738
|
}
|
|
53714
|
-
figureToSnap.x = Math.round(figureToSnap.x);
|
|
53715
|
-
figureToSnap.y = Math.round(figureToSnap.y);
|
|
53716
|
-
figureToSnap.height = Math.round(figureToSnap.height);
|
|
53717
|
-
figureToSnap.width = Math.round(figureToSnap.width);
|
|
53718
53739
|
return {
|
|
53719
|
-
|
|
53740
|
+
snappedRect: {
|
|
53741
|
+
x: Math.round(rect.x),
|
|
53742
|
+
y: Math.round(rect.y),
|
|
53743
|
+
width: Math.round(rect.width),
|
|
53744
|
+
height: Math.round(rect.height)
|
|
53745
|
+
},
|
|
53720
53746
|
verticalSnapLine,
|
|
53721
53747
|
horizontalSnapLine
|
|
53722
53748
|
};
|
|
@@ -53907,7 +53933,7 @@ var FiguresContainer = class extends Component {
|
|
|
53907
53933
|
this.zoomStore = useStore(ZoomStore);
|
|
53908
53934
|
this.chartDragStore = useStore(ChartDragStore);
|
|
53909
53935
|
onMounted(() => {
|
|
53910
|
-
|
|
53936
|
+
render(this);
|
|
53911
53937
|
});
|
|
53912
53938
|
onWillUpdateProps(() => {
|
|
53913
53939
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -53981,6 +54007,13 @@ var FiguresContainer = class extends Component {
|
|
|
53981
54007
|
get selectedRectStyle() {
|
|
53982
54008
|
return this.dnd.selectedRect ? this.rectToCss(this.dnd.selectedRect) : "";
|
|
53983
54009
|
}
|
|
54010
|
+
get maxDimensions() {
|
|
54011
|
+
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
54012
|
+
return {
|
|
54013
|
+
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
54014
|
+
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end
|
|
54015
|
+
};
|
|
54016
|
+
}
|
|
53984
54017
|
getInverseViewportPositionStyle(container) {
|
|
53985
54018
|
const { scrollX, scrollY } = this.viewStore.activeSheetScrollInfo;
|
|
53986
54019
|
const { x: viewportX, y: viewportY } = this.viewStore.mainViewportCoordinates;
|
|
@@ -54038,12 +54071,9 @@ var FiguresContainer = class extends Component {
|
|
|
54038
54071
|
y: ev.clientY / zoom
|
|
54039
54072
|
};
|
|
54040
54073
|
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54074
|
+
const maxDimensions = this.maxDimensions;
|
|
54041
54075
|
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));
|
|
54042
54076
|
const draggedFigureId = figureUI.id;
|
|
54043
|
-
const maxDimensions = {
|
|
54044
|
-
maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
|
|
54045
|
-
maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end
|
|
54046
|
-
};
|
|
54047
54077
|
let hasStartedDnd = false;
|
|
54048
54078
|
let overlappingChartOrCarousel = void 0;
|
|
54049
54079
|
const onMouseMove = (ev) => {
|
|
@@ -54090,7 +54120,7 @@ var FiguresContainer = class extends Component {
|
|
|
54090
54120
|
...this.viewStore.viewports.getPositionAnchorOffset(sheetId, f)
|
|
54091
54121
|
};
|
|
54092
54122
|
}) || [];
|
|
54093
|
-
this.env.model.dispatch("
|
|
54123
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: payloads });
|
|
54094
54124
|
} else {
|
|
54095
54125
|
const overlappingFigureId = overlappingChartOrCarousel.id;
|
|
54096
54126
|
const chartFigureIds = this.dnd.selectedFigures?.map((f) => f.id) || [];
|
|
@@ -54115,7 +54145,7 @@ var FiguresContainer = class extends Component {
|
|
|
54115
54145
|
this.dnd.cancelDnd = startDnd(onMouseMove, onMouseUp);
|
|
54116
54146
|
}
|
|
54117
54147
|
/**
|
|
54118
|
-
* Initialize the resize of
|
|
54148
|
+
* Initialize the resize of the selected figures with mouse movements
|
|
54119
54149
|
*
|
|
54120
54150
|
* @param dirX X direction of the resize. -1 : resize from the left border of the figure, 0 : no resize in X, 1 :
|
|
54121
54151
|
* resize from the right border of the figure
|
|
@@ -54123,44 +54153,78 @@ var FiguresContainer = class extends Component {
|
|
|
54123
54153
|
* resize from the bottom border of the figure
|
|
54124
54154
|
* @param ev Mouse Event
|
|
54125
54155
|
*/
|
|
54126
|
-
|
|
54156
|
+
resizeAllSelectedFigures(dirX, dirY, ev) {
|
|
54127
54157
|
ev.stopPropagation();
|
|
54128
|
-
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54129
|
-
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
54130
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
|
|
54131
|
-
const zoom = this.zoomStore.zoomLevel;
|
|
54132
54158
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
54159
|
+
const zoom = this.zoomStore.zoomLevel;
|
|
54133
54160
|
const initialMousePosition = {
|
|
54134
54161
|
x: ev.clientX / zoom,
|
|
54135
54162
|
y: ev.clientY / zoom
|
|
54136
54163
|
};
|
|
54137
|
-
const
|
|
54138
|
-
|
|
54139
|
-
|
|
54140
|
-
|
|
54164
|
+
const initialScrollPosition = this.viewStore.activeSheetScrollInfo;
|
|
54165
|
+
const maxDimensions = this.maxDimensions;
|
|
54166
|
+
const selectedFiguresIds = this.env.model.getters.getSelectedFigureIds();
|
|
54167
|
+
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));
|
|
54168
|
+
const mutlipleFiguresSelected = selectedFiguresIds.length > 1;
|
|
54169
|
+
const otherFiguresUI = this.getOtherFigures(selectedFiguresIds);
|
|
54170
|
+
if (initialFigures.length === 0) return;
|
|
54171
|
+
let minAggregateSize;
|
|
54172
|
+
if (mutlipleFiguresSelected) {
|
|
54173
|
+
const widthScaleMax = Math.max(...initialFigures.map((f) => {
|
|
54174
|
+
return figureRegistry.get(f.tag).minFigSize / f.width;
|
|
54175
|
+
}));
|
|
54176
|
+
const heightScaleMax = Math.max(...initialFigures.map((f) => {
|
|
54177
|
+
return figureRegistry.get(f.tag).minFigSize / f.height;
|
|
54178
|
+
}));
|
|
54179
|
+
const initialAggregateRect = rectUnion(...initialFigures);
|
|
54180
|
+
minAggregateSize = {
|
|
54181
|
+
width: Math.round(initialAggregateRect.width * widthScaleMax),
|
|
54182
|
+
height: Math.round(initialAggregateRect.height * heightScaleMax)
|
|
54183
|
+
};
|
|
54184
|
+
} else {
|
|
54185
|
+
const minFigSize = figureRegistry.get(initialFigures[0].tag).minFigSize;
|
|
54186
|
+
minAggregateSize = {
|
|
54187
|
+
width: minFigSize,
|
|
54188
|
+
height: minFigSize
|
|
54189
|
+
};
|
|
54190
|
+
}
|
|
54141
54191
|
const onMouseMove = (ev) => {
|
|
54142
|
-
const
|
|
54192
|
+
const currentMousePosition = {
|
|
54143
54193
|
x: ev.clientX / zoom,
|
|
54144
54194
|
y: ev.clientY / zoom
|
|
54145
|
-
}
|
|
54146
|
-
const
|
|
54147
|
-
const
|
|
54148
|
-
this.
|
|
54149
|
-
|
|
54150
|
-
|
|
54151
|
-
|
|
54152
|
-
|
|
54195
|
+
};
|
|
54196
|
+
const keepRatio = mutlipleFiguresSelected || ev.shiftKey ? true : figureRegistry.get(initialFigures[0].tag).keepRatio || false;
|
|
54197
|
+
const initialRect = rectUnion(...initialFigures);
|
|
54198
|
+
const resizedRect = dragFigureForResize(initialRect, dirX, dirY, currentMousePosition, initialMousePosition, keepRatio, minAggregateSize, initialScrollPosition, this.viewStore.activeSheetScrollInfo, maxDimensions);
|
|
54199
|
+
const { snappedRect, verticalSnapLine, horizontalSnapLine } = snapForResize(this.env, dirX, dirY, resizedRect, otherFiguresUI);
|
|
54200
|
+
const scaleX = snappedRect.width / initialRect.width;
|
|
54201
|
+
const scaleY = snappedRect.height / initialRect.height;
|
|
54202
|
+
const snappedFigures = initialFigures.map((figureUI) => ({
|
|
54203
|
+
...figureUI,
|
|
54204
|
+
x: Math.round(snappedRect.x + (figureUI.x - initialRect.x) * scaleX),
|
|
54205
|
+
y: Math.round(snappedRect.y + (figureUI.y - initialRect.y) * scaleY),
|
|
54206
|
+
width: Math.round(figureUI.width * scaleX),
|
|
54207
|
+
height: Math.round(figureUI.height * scaleY)
|
|
54208
|
+
}));
|
|
54209
|
+
this.dnd.draggedFigure = snappedFigures[0];
|
|
54210
|
+
this.dnd.selectedFigures = snappedFigures;
|
|
54211
|
+
this.dnd.selectedRect = this.getDndFigureRect();
|
|
54212
|
+
this.dnd.horizontalSnap = this.getSnap(horizontalSnapLine);
|
|
54213
|
+
this.dnd.verticalSnap = this.getSnap(verticalSnapLine);
|
|
54153
54214
|
};
|
|
54154
|
-
const onMouseUp = (
|
|
54155
|
-
if (!this.dnd.
|
|
54156
|
-
const
|
|
54157
|
-
|
|
54158
|
-
|
|
54159
|
-
|
|
54160
|
-
|
|
54161
|
-
|
|
54162
|
-
|
|
54215
|
+
const onMouseUp = () => {
|
|
54216
|
+
if (!this.dnd.selectedFigures) return;
|
|
54217
|
+
const dispatchPayload = this.dnd.selectedFigures.map((figureUI) => {
|
|
54218
|
+
const update = this.viewStore.viewports.getPositionAnchorOffset(sheetId, figureUI);
|
|
54219
|
+
if (dirX) update.width = figureUI.width;
|
|
54220
|
+
if (dirY) update.height = figureUI.height;
|
|
54221
|
+
return {
|
|
54222
|
+
sheetId,
|
|
54223
|
+
figureId: figureUI.id,
|
|
54224
|
+
...update
|
|
54225
|
+
};
|
|
54163
54226
|
});
|
|
54227
|
+
this.env.model.dispatch("UPDATE_FIGURES", { figures: dispatchPayload });
|
|
54164
54228
|
this.dnd.draggedFigure = void 0;
|
|
54165
54229
|
this.dnd.selectedFigures = void 0;
|
|
54166
54230
|
this.dnd.selectedRect = void 0;
|
|
@@ -54823,7 +54887,7 @@ function useTouchHandlers(ref, { updateScroll, canMoveUp, canMoveDown, getZoom,
|
|
|
54823
54887
|
passive: false,
|
|
54824
54888
|
capture: false
|
|
54825
54889
|
});
|
|
54826
|
-
|
|
54890
|
+
useListener(window, "pointerup", onPointerUp, {
|
|
54827
54891
|
passive: false,
|
|
54828
54892
|
capture: true
|
|
54829
54893
|
});
|
|
@@ -55387,10 +55451,10 @@ var Grid = class extends Component {
|
|
|
55387
55451
|
this.checkboxToggleStore = useStore(CheckboxToggleStore);
|
|
55388
55452
|
useStore(ArrayFormulaHighlight);
|
|
55389
55453
|
this.automaticSumStore = useLocalStore(AutomaticSumStore);
|
|
55390
|
-
|
|
55391
|
-
|
|
55392
|
-
|
|
55393
|
-
|
|
55454
|
+
useSubEnv({ getPopoverContainerRect: () => this.getGridRect() });
|
|
55455
|
+
useListener(document.body, "cut", this.copy.bind(this, true));
|
|
55456
|
+
useListener(document.body, "copy", this.copy.bind(this, false));
|
|
55457
|
+
useListener(document.body, "paste", this.paste.bind(this));
|
|
55394
55458
|
onMounted(() => this.focusDefaultElement());
|
|
55395
55459
|
this.props.exposeFocus(() => this.focusDefaultElement());
|
|
55396
55460
|
useGridDrawing({
|
|
@@ -64521,36 +64585,37 @@ function generateMasterChartConfig(chartJsConfig) {
|
|
|
64521
64585
|
//#endregion
|
|
64522
64586
|
//#region src/plugins/ui_core_views/evaluation_chart.ts
|
|
64523
64587
|
var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
64524
|
-
static getters = ["
|
|
64588
|
+
static getters = ["getStyleOfSingleCellChart", "getChartRuntimeWithTheme"];
|
|
64525
64589
|
charts = {};
|
|
64526
64590
|
handle(cmd) {
|
|
64527
|
-
if (invalidateEvaluationCommands.has(cmd.type) || invalidateCFEvaluationCommands.has(cmd.type) || invalidateChartEvaluationCommands.has(cmd.type)) for (const chartId in this.charts) this.charts[chartId] =
|
|
64591
|
+
if (invalidateEvaluationCommands.has(cmd.type) || invalidateCFEvaluationCommands.has(cmd.type) || invalidateChartEvaluationCommands.has(cmd.type)) for (const chartId in this.charts) this.charts[chartId] = {};
|
|
64528
64592
|
switch (cmd.type) {
|
|
64529
64593
|
case "UPDATE_CHART":
|
|
64530
64594
|
case "CREATE_CHART":
|
|
64531
|
-
this.charts[cmd.chartId] =
|
|
64595
|
+
this.charts[cmd.chartId] = {};
|
|
64532
64596
|
break;
|
|
64533
64597
|
case "DELETE_CHART":
|
|
64534
|
-
this.charts[cmd.chartId] =
|
|
64598
|
+
this.charts[cmd.chartId] = {};
|
|
64535
64599
|
break;
|
|
64536
64600
|
case "DELETE_SHEET":
|
|
64537
|
-
for (const chartId in this.charts) if (!this.getters.isChartDefined(chartId)) this.charts[chartId] =
|
|
64601
|
+
for (const chartId in this.charts) if (!this.getters.isChartDefined(chartId)) this.charts[chartId] = {};
|
|
64538
64602
|
break;
|
|
64539
64603
|
}
|
|
64540
64604
|
}
|
|
64541
|
-
|
|
64542
|
-
if (!this.charts[chartId]) {
|
|
64605
|
+
getChartRuntimeWithTheme(chartId, colorThemeName) {
|
|
64606
|
+
if (!this.charts[chartId]) this.charts[chartId] = {};
|
|
64607
|
+
if (!this.charts[chartId][colorThemeName]) {
|
|
64543
64608
|
const chart = this.getters.getChart(chartId);
|
|
64544
64609
|
if (!chart) throw new Error(`No chart for the given id: ${chartId}`);
|
|
64545
|
-
this.charts[chartId] = this.createRuntimeChart(chartId, chart);
|
|
64610
|
+
this.charts[chartId][colorThemeName] = this.createRuntimeChart(chartId, chart, colorThemeName);
|
|
64546
64611
|
}
|
|
64547
|
-
return this.charts[chartId];
|
|
64612
|
+
return this.charts[chartId][colorThemeName];
|
|
64548
64613
|
}
|
|
64549
64614
|
/**
|
|
64550
64615
|
* Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
|
|
64551
64616
|
*/
|
|
64552
|
-
getStyleOfSingleCellChart(chartBackground, mainRange) {
|
|
64553
|
-
const themeBackground =
|
|
64617
|
+
getStyleOfSingleCellChart(chartBackground, mainRange, colorThemeName) {
|
|
64618
|
+
const themeBackground = COLOR_THEMES[colorThemeName].backgroundColor;
|
|
64554
64619
|
if (chartBackground) return {
|
|
64555
64620
|
background: chartBackground,
|
|
64556
64621
|
fontColor: chartFontColor(chartBackground)
|
|
@@ -64591,7 +64656,7 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64591
64656
|
else {
|
|
64592
64657
|
if (!chart) continue;
|
|
64593
64658
|
const type = this.getters.getChartType(chartId);
|
|
64594
|
-
const img = await chartToImageUrl(this.
|
|
64659
|
+
const img = await chartToImageUrl(this.getChartRuntimeWithTheme(chartId, "light"), figure, type);
|
|
64595
64660
|
if (img) sheet.images.push({
|
|
64596
64661
|
...figure,
|
|
64597
64662
|
tag: "image",
|
|
@@ -64609,9 +64674,9 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
64609
64674
|
sheet.charts = figures;
|
|
64610
64675
|
}
|
|
64611
64676
|
}
|
|
64612
|
-
createRuntimeChart(chartId, chart) {
|
|
64677
|
+
createRuntimeChart(chartId, chart, colorThemeName) {
|
|
64613
64678
|
const definition = chart.getRangeDefinition();
|
|
64614
|
-
const runtime = chart.getRuntime(this.getters, chartId);
|
|
64679
|
+
const runtime = chart.getRuntime(this.getters, chartId, colorThemeName);
|
|
64615
64680
|
if ("chartJsConfig" in runtime && /line|combo|bar|scatter|waterfall/.test(definition.type)) {
|
|
64616
64681
|
const chartJsConfig = runtime.chartJsConfig;
|
|
64617
64682
|
runtime["masterChartConfig"] = generateMasterChartConfig(chartJsConfig);
|
|
@@ -65977,6 +66042,39 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
65977
66042
|
}
|
|
65978
66043
|
};
|
|
65979
66044
|
|
|
66045
|
+
//#endregion
|
|
66046
|
+
//#region src/plugins/ui_plugin.ts
|
|
66047
|
+
/**
|
|
66048
|
+
* UI plugins handle any transient data required to display a spreadsheet.
|
|
66049
|
+
* They can draw on the grid canvas.
|
|
66050
|
+
*/
|
|
66051
|
+
var UIPlugin = class extends BasePlugin {
|
|
66052
|
+
static layers = [];
|
|
66053
|
+
getters;
|
|
66054
|
+
ui;
|
|
66055
|
+
selection;
|
|
66056
|
+
dispatch;
|
|
66057
|
+
canDispatch;
|
|
66058
|
+
constructor({ getters, stateObserver, dispatch, canDispatch, uiActions, selection }) {
|
|
66059
|
+
super(stateObserver);
|
|
66060
|
+
this.getters = getters;
|
|
66061
|
+
this.ui = uiActions;
|
|
66062
|
+
this.selection = selection;
|
|
66063
|
+
this.dispatch = dispatch;
|
|
66064
|
+
this.canDispatch = canDispatch;
|
|
66065
|
+
}
|
|
66066
|
+
drawLayer(ctx, layer) {}
|
|
66067
|
+
};
|
|
66068
|
+
|
|
66069
|
+
//#endregion
|
|
66070
|
+
//#region src/plugins/ui_feature/chart_ui.ts
|
|
66071
|
+
var ChartUIPlugin = class extends UIPlugin {
|
|
66072
|
+
static getters = ["getChartRuntime"];
|
|
66073
|
+
getChartRuntime(chartId) {
|
|
66074
|
+
return this.getters.getChartRuntimeWithTheme(chartId, this.getters.getSpreadsheetTheme().colorThemeName);
|
|
66075
|
+
}
|
|
66076
|
+
};
|
|
66077
|
+
|
|
65980
66078
|
//#endregion
|
|
65981
66079
|
//#region src/helpers/range_adapter_functions.ts
|
|
65982
66080
|
function getRangeAdapterFunctions(executedCommand) {
|
|
@@ -66966,30 +67064,6 @@ var Session = class extends EventBus {
|
|
|
66966
67064
|
}
|
|
66967
67065
|
};
|
|
66968
67066
|
|
|
66969
|
-
//#endregion
|
|
66970
|
-
//#region src/plugins/ui_plugin.ts
|
|
66971
|
-
/**
|
|
66972
|
-
* UI plugins handle any transient data required to display a spreadsheet.
|
|
66973
|
-
* They can draw on the grid canvas.
|
|
66974
|
-
*/
|
|
66975
|
-
var UIPlugin = class extends BasePlugin {
|
|
66976
|
-
static layers = [];
|
|
66977
|
-
getters;
|
|
66978
|
-
ui;
|
|
66979
|
-
selection;
|
|
66980
|
-
dispatch;
|
|
66981
|
-
canDispatch;
|
|
66982
|
-
constructor({ getters, stateObserver, dispatch, canDispatch, uiActions, selection }) {
|
|
66983
|
-
super(stateObserver);
|
|
66984
|
-
this.getters = getters;
|
|
66985
|
-
this.ui = uiActions;
|
|
66986
|
-
this.selection = selection;
|
|
66987
|
-
this.dispatch = dispatch;
|
|
66988
|
-
this.canDispatch = canDispatch;
|
|
66989
|
-
}
|
|
66990
|
-
drawLayer(ctx, layer) {}
|
|
66991
|
-
};
|
|
66992
|
-
|
|
66993
67067
|
//#endregion
|
|
66994
67068
|
//#region src/plugins/ui_feature/collaborative.ts
|
|
66995
67069
|
var CollaborativePlugin = class extends UIPlugin {
|
|
@@ -67073,41 +67147,6 @@ var CollaborativePlugin = class extends UIPlugin {
|
|
|
67073
67147
|
|
|
67074
67148
|
//#endregion
|
|
67075
67149
|
//#region src/plugins/ui_feature/color_theme.ts
|
|
67076
|
-
const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
67077
|
-
const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
67078
|
-
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
67079
|
-
const TEXT_HEADER_COLOR = "#666666";
|
|
67080
|
-
const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
67081
|
-
const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
67082
|
-
const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
67083
|
-
const COLOR_THEMES = {
|
|
67084
|
-
light: {
|
|
67085
|
-
backgroundColor: "#FFFFFF",
|
|
67086
|
-
gridBorderColor: "#CECFCF",
|
|
67087
|
-
headerBackgroundColor: BACKGROUND_HEADER_COLOR,
|
|
67088
|
-
headerActiveBackgroundColor: BACKGROUND_HEADER_ACTIVE_COLOR,
|
|
67089
|
-
headerSelectedBackgroundColor: BACKGROUND_HEADER_SELECTED_COLOR,
|
|
67090
|
-
headerTextColor: TEXT_HEADER_COLOR,
|
|
67091
|
-
headerBorderColor: HEADER_BORDER_COLOR,
|
|
67092
|
-
frozenPaneBorderColor: FROZEN_PANE_BORDER_COLOR,
|
|
67093
|
-
frozenPaneHeaderBorderColor: FROZEN_PANE_HEADER_BORDER_COLOR,
|
|
67094
|
-
singleCellSelectionBackgroundColor: "#F3F7FE",
|
|
67095
|
-
multipleCellsSelectionBackgroundColor: "#E9F0FF"
|
|
67096
|
-
},
|
|
67097
|
-
dark: {
|
|
67098
|
-
backgroundColor: adaptForDarkMode("#1A1C2E"),
|
|
67099
|
-
gridBorderColor: adaptForDarkMode("#6B706F"),
|
|
67100
|
-
headerBackgroundColor: adaptForDarkMode("#262A36"),
|
|
67101
|
-
headerActiveBackgroundColor: adaptForDarkMode("#3A4052"),
|
|
67102
|
-
headerSelectedBackgroundColor: adaptForDarkMode("#4E566E"),
|
|
67103
|
-
headerTextColor: adaptForDarkMode("#A1A6B3"),
|
|
67104
|
-
headerBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67105
|
-
frozenPaneBorderColor: adaptForDarkMode("#7A7F91"),
|
|
67106
|
-
frozenPaneHeaderBorderColor: adaptForDarkMode("#9FA5BD"),
|
|
67107
|
-
singleCellSelectionBackgroundColor: adaptForDarkMode("#696E8044"),
|
|
67108
|
-
multipleCellsSelectionBackgroundColor: adaptForDarkMode("#828AA044")
|
|
67109
|
-
}
|
|
67110
|
-
};
|
|
67111
67150
|
var ColorThemeUIPlugin = class extends UIPlugin {
|
|
67112
67151
|
static getters = ["isDarkMode", "getSpreadsheetTheme"];
|
|
67113
67152
|
colorScheme;
|
|
@@ -69378,7 +69417,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69378
69417
|
static getters = ["getFigureUI"];
|
|
69379
69418
|
allowDispatch(cmd) {
|
|
69380
69419
|
switch (cmd.type) {
|
|
69381
|
-
case "
|
|
69420
|
+
case "UPDATE_FIGURES":
|
|
69382
69421
|
for (const updateFigurePayload of cmd.figures) {
|
|
69383
69422
|
const result = this.canDispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69384
69423
|
if (!result.isSuccessful) return result.reasons;
|
|
@@ -69402,7 +69441,7 @@ var FigureUIPlugin = class extends UIPlugin {
|
|
|
69402
69441
|
}
|
|
69403
69442
|
handle(cmd) {
|
|
69404
69443
|
switch (cmd.type) {
|
|
69405
|
-
case "
|
|
69444
|
+
case "UPDATE_FIGURES":
|
|
69406
69445
|
for (const updateFigurePayload of cmd.figures) this.dispatch("UPDATE_FIGURE", updateFigurePayload);
|
|
69407
69446
|
break;
|
|
69408
69447
|
case "DELETE_FIGURES":
|
|
@@ -70549,7 +70588,7 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
70549
70588
|
//#endregion
|
|
70550
70589
|
//#region src/plugins/plugin_registries.ts
|
|
70551
70590
|
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);
|
|
70552
|
-
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);
|
|
70591
|
+
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);
|
|
70553
70592
|
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);
|
|
70554
70593
|
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);
|
|
70555
70594
|
|
|
@@ -71905,7 +71944,7 @@ var BottomBarSheet = class extends Component {
|
|
|
71905
71944
|
DOMFocusableElementStore;
|
|
71906
71945
|
setup() {
|
|
71907
71946
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
71908
|
-
|
|
71947
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
71909
71948
|
useLayoutEffect(() => {}, () => [this.state.isEditing]);
|
|
71910
71949
|
onPatched(() => {
|
|
71911
71950
|
if (this.sheetNameRef() && this.state.isEditing && this.editionState === "initializing") {
|
|
@@ -72469,7 +72508,7 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72469
72508
|
this.zoomStore = useStore(ZoomStore);
|
|
72470
72509
|
useLocalStore(HoveredTableStore);
|
|
72471
72510
|
const rendererStore = useLocalStore(RendererStore, OrderedLayers().filter((layer) => layer !== "Headers"));
|
|
72472
|
-
|
|
72511
|
+
useSubEnv({ getPopoverContainerRect: () => this.zoomStore.getZoomedRect(this.getGridRect()) });
|
|
72473
72512
|
useGridDrawing({
|
|
72474
72513
|
canvasRef: this.canvasRef,
|
|
72475
72514
|
rendererStore,
|
|
@@ -72541,13 +72580,12 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
72541
72580
|
return this.env.model.getters.getColDimensions(sheetId, right).end;
|
|
72542
72581
|
}
|
|
72543
72582
|
get dashboardStyle() {
|
|
72544
|
-
|
|
72545
|
-
if (this.env.model.getters.getActiveSheet().backgroundColor) style["background-color"] = "transparent";
|
|
72546
|
-
return cssPropertiesToCss(style);
|
|
72583
|
+
return cssPropertiesToCss({ zoom: this.zoomStore.cssZoom });
|
|
72547
72584
|
}
|
|
72548
72585
|
get backgroundStyle() {
|
|
72549
72586
|
const sheet = this.env.model.getters.getActiveSheet();
|
|
72550
|
-
|
|
72587
|
+
const theme = this.env.model.getters.getSpreadsheetTheme();
|
|
72588
|
+
return cssPropertiesToCss({ "background-color": sheet.backgroundColor || theme.backgroundColor });
|
|
72551
72589
|
}
|
|
72552
72590
|
};
|
|
72553
72591
|
|
|
@@ -72893,7 +72931,7 @@ var RibbonMenu = class extends Component {
|
|
|
72893
72931
|
parentState: void 0
|
|
72894
72932
|
});
|
|
72895
72933
|
setup() {
|
|
72896
|
-
|
|
72934
|
+
useListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
72897
72935
|
onMounted(this.updateShadows);
|
|
72898
72936
|
}
|
|
72899
72937
|
onExternalClick(ev) {
|
|
@@ -73547,7 +73585,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73547
73585
|
setup() {
|
|
73548
73586
|
this.printStore = useLocalStore(SpreadsheetPrintStore);
|
|
73549
73587
|
let styleElement = null;
|
|
73550
|
-
|
|
73588
|
+
useListener(window, "beforeprint", () => {
|
|
73551
73589
|
styleElement = document.createElement("style");
|
|
73552
73590
|
styleElement.id = "o-spreadsheet-print-style";
|
|
73553
73591
|
const size = `${this.printStore.pageLayout} ${this.printStore.orientation}`;
|
|
@@ -73560,7 +73598,7 @@ var SpreadsheetPrint = class extends Component {
|
|
|
73560
73598
|
styleElement = null;
|
|
73561
73599
|
}
|
|
73562
73600
|
};
|
|
73563
|
-
|
|
73601
|
+
useListener(window, "afterprint", () => removePrintStyle());
|
|
73564
73602
|
onWillUnmount(() => removePrintStyle());
|
|
73565
73603
|
}
|
|
73566
73604
|
get pageStyle() {
|
|
@@ -74549,8 +74587,8 @@ var TopBar = class extends Component {
|
|
|
74549
74587
|
this.composerFocusStore = useStore(ComposerFocusStore);
|
|
74550
74588
|
this.fingerprints = useStore(FormulaFingerprintStore);
|
|
74551
74589
|
this.topBarToolStore = useStore(TopBarToolStore);
|
|
74552
|
-
|
|
74553
|
-
|
|
74590
|
+
useListener(window, "click", this.onExternalClick.bind(this));
|
|
74591
|
+
useListener(window, "keydown", this.onKeydown.bind(this));
|
|
74554
74592
|
this.menus = topbarMenuRegistry.getMenuItems();
|
|
74555
74593
|
let lastWidth;
|
|
74556
74594
|
const updateVisibility = () => {
|
|
@@ -74877,9 +74915,9 @@ var Spreadsheet = class extends Component {
|
|
|
74877
74915
|
const el = this.spreadsheetRef();
|
|
74878
74916
|
if (el && !el.contains(document.activeElement) && document.activeElement?.contains(el)) this.focusGrid();
|
|
74879
74917
|
});
|
|
74880
|
-
|
|
74881
|
-
|
|
74882
|
-
|
|
74918
|
+
useListener(window, "resize", () => render(this, true));
|
|
74919
|
+
useListener(document.body, "wheel", () => {});
|
|
74920
|
+
useListener(window, "keydown", async (event) => {
|
|
74883
74921
|
if (keyboardEventToShortcutString(event) === "Ctrl+P") {
|
|
74884
74922
|
this.state.printModeEnabled = true;
|
|
74885
74923
|
event.stopPropagation();
|
|
@@ -74899,11 +74937,11 @@ var Spreadsheet = class extends Component {
|
|
|
74899
74937
|
resizeObserver.observe(el);
|
|
74900
74938
|
return () => resizeObserver.disconnect();
|
|
74901
74939
|
});
|
|
74902
|
-
const
|
|
74940
|
+
const batchedRender = batched(() => render(this, true));
|
|
74903
74941
|
onMounted(() => {
|
|
74904
74942
|
this.bindModelEvents();
|
|
74905
74943
|
this.checkViewportSize();
|
|
74906
|
-
stores.on("store-updated", this,
|
|
74944
|
+
stores.on("store-updated", this, batchedRender);
|
|
74907
74945
|
});
|
|
74908
74946
|
onWillUnmount(() => {
|
|
74909
74947
|
this.unbindModelEvents();
|
|
@@ -74915,7 +74953,7 @@ var Spreadsheet = class extends Component {
|
|
|
74915
74953
|
});
|
|
74916
74954
|
}
|
|
74917
74955
|
bindModelEvents() {
|
|
74918
|
-
this.model.on("update", this, () =>
|
|
74956
|
+
this.model.on("update", this, () => render(this, true));
|
|
74919
74957
|
this.model.on("command-rejected", this, ({ result }) => {
|
|
74920
74958
|
if (result.isCancelledBecause("SheetLocked")) this.notificationStore.notifyUser({
|
|
74921
74959
|
type: "info",
|
|
@@ -80988,6 +81026,10 @@ var LinkEditor = class extends Component {
|
|
|
80988
81026
|
this.computeLinks();
|
|
80989
81027
|
onMounted(() => this.urlInput()?.focus());
|
|
80990
81028
|
}
|
|
81029
|
+
onLinkUrlInput(ev) {
|
|
81030
|
+
this.state.url = ev.target.value;
|
|
81031
|
+
this.computeLinks();
|
|
81032
|
+
}
|
|
80991
81033
|
computeLinks() {
|
|
80992
81034
|
this.state.selectedIndex = null;
|
|
80993
81035
|
this.state.linksByCategory = this.linkProposalByCategory;
|
|
@@ -81687,8 +81729,8 @@ const BubbleChart = {
|
|
|
81687
81729
|
};
|
|
81688
81730
|
},
|
|
81689
81731
|
copyInSheetId: (definition) => definition,
|
|
81690
|
-
getRuntime(getters, definition) {
|
|
81691
|
-
const chartData = getBubbleChartData(definition, getters);
|
|
81732
|
+
getRuntime(getters, definition, chartDataExtractors, sheetId, eventHandlers, colorThemeName) {
|
|
81733
|
+
const chartData = getBubbleChartData(definition, getters, colorThemeName);
|
|
81692
81734
|
return { chartJsConfig: {
|
|
81693
81735
|
type: "line",
|
|
81694
81736
|
data: {
|
|
@@ -81763,8 +81805,8 @@ const CalendarChart = {
|
|
|
81763
81805
|
};
|
|
81764
81806
|
},
|
|
81765
81807
|
getDefinitionForExcel: () => void 0,
|
|
81766
|
-
getRuntime(getters, definition, { extractData }) {
|
|
81767
|
-
const chartData = getCalendarChartData(definition, extractData(), getters);
|
|
81808
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
81809
|
+
const chartData = getCalendarChartData(definition, extractData(), getters, colorThemeName);
|
|
81768
81810
|
const { labels, datasets } = getCalendarChartDatasetAndLabels(definition, chartData);
|
|
81769
81811
|
return { chartJsConfig: {
|
|
81770
81812
|
type: "calendar",
|
|
@@ -81850,8 +81892,8 @@ const ComboChart = {
|
|
|
81850
81892
|
annotationLink: context.annotationLink
|
|
81851
81893
|
};
|
|
81852
81894
|
},
|
|
81853
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
81854
|
-
const chartData = getBarChartData(definition, extractData(), getters);
|
|
81895
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
81896
|
+
const chartData = getBarChartData(definition, extractData(), getters, colorThemeName);
|
|
81855
81897
|
return {
|
|
81856
81898
|
chartJsConfig: {
|
|
81857
81899
|
type: "bar",
|
|
@@ -81927,8 +81969,8 @@ const FunnelChart = {
|
|
|
81927
81969
|
};
|
|
81928
81970
|
},
|
|
81929
81971
|
getDefinitionForExcel: () => void 0,
|
|
81930
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
81931
|
-
const chartData = getFunnelChartData(definition, extractData(), getters);
|
|
81972
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
81973
|
+
const chartData = getFunnelChartData(definition, extractData(), getters, colorThemeName);
|
|
81932
81974
|
return { chartJsConfig: {
|
|
81933
81975
|
type: "funnel",
|
|
81934
81976
|
data: {
|
|
@@ -81990,8 +82032,8 @@ const GeoChart = {
|
|
|
81990
82032
|
};
|
|
81991
82033
|
},
|
|
81992
82034
|
getDefinitionForExcel: () => void 0,
|
|
81993
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
81994
|
-
const chartData = getGeoChartData(definition, extractData(), getters);
|
|
82035
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82036
|
+
const chartData = getGeoChartData(definition, extractData(), getters, colorThemeName);
|
|
81995
82037
|
return { chartJsConfig: {
|
|
81996
82038
|
type: "choropleth",
|
|
81997
82039
|
data: { datasets: getGeoChartDatasets(definition, chartData) },
|
|
@@ -82060,7 +82102,7 @@ const PyramidChart = {
|
|
|
82060
82102
|
},
|
|
82061
82103
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
82062
82104
|
if (definition.dataSource.type !== "range") return;
|
|
82063
|
-
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters);
|
|
82105
|
+
const chartData = getPyramidChartData(definition, getChartData(getters, definition.dataSource), getters, "light");
|
|
82064
82106
|
const { dataSetsValues } = chartData;
|
|
82065
82107
|
const maxValue = Math.max(...dataSetsValues.map((dataSet) => Math.max(...dataSet.data.map((cell) => isNumberResult(cell) ? Math.abs(cell.value) : -Infinity))));
|
|
82066
82108
|
return {
|
|
@@ -82074,8 +82116,8 @@ const PyramidChart = {
|
|
|
82074
82116
|
maxValue
|
|
82075
82117
|
};
|
|
82076
82118
|
},
|
|
82077
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82078
|
-
const chartData = getPyramidChartData(definition, extractData(), getters);
|
|
82119
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82120
|
+
const chartData = getPyramidChartData(definition, extractData(), getters, colorThemeName);
|
|
82079
82121
|
return {
|
|
82080
82122
|
chartJsConfig: {
|
|
82081
82123
|
type: "bar",
|
|
@@ -82157,8 +82199,8 @@ const RadarChart = {
|
|
|
82157
82199
|
labelRange
|
|
82158
82200
|
};
|
|
82159
82201
|
},
|
|
82160
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82161
|
-
const chartData = getRadarChartData(definition, extractData(), getters);
|
|
82202
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82203
|
+
const chartData = getRadarChartData(definition, extractData(), getters, colorThemeName);
|
|
82162
82204
|
return {
|
|
82163
82205
|
chartJsConfig: {
|
|
82164
82206
|
type: "radar",
|
|
@@ -82238,8 +82280,8 @@ const ScatterChart = {
|
|
|
82238
82280
|
verticalAxis: getDefinedAxis(definition)
|
|
82239
82281
|
};
|
|
82240
82282
|
},
|
|
82241
|
-
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers) {
|
|
82242
|
-
const chartData = getLineChartData(definition, extractData(), getters);
|
|
82283
|
+
getRuntime(getters, definition, { extractData }, sheetId, eventHandlers, colorThemeName) {
|
|
82284
|
+
const chartData = getLineChartData(definition, extractData(), getters, colorThemeName);
|
|
82243
82285
|
return {
|
|
82244
82286
|
chartJsConfig: {
|
|
82245
82287
|
type: "line",
|
|
@@ -82317,8 +82359,8 @@ const SunburstChart = {
|
|
|
82317
82359
|
};
|
|
82318
82360
|
},
|
|
82319
82361
|
getDefinitionForExcel: () => void 0,
|
|
82320
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82321
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82362
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82363
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82322
82364
|
return { chartJsConfig: {
|
|
82323
82365
|
type: "doughnut",
|
|
82324
82366
|
data: { datasets: getSunburstChartDatasets(definition, chartData) },
|
|
@@ -82391,8 +82433,8 @@ const TreeMapChart = {
|
|
|
82391
82433
|
};
|
|
82392
82434
|
},
|
|
82393
82435
|
getDefinitionForExcel: () => void 0,
|
|
82394
|
-
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers) {
|
|
82395
|
-
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters);
|
|
82436
|
+
getRuntime(getters, definition, { extractHierarchicalData }, sheetId, eventHandlers, colorThemeName) {
|
|
82437
|
+
const chartData = getHierarchalChartData(definition, extractHierarchicalData(), getters, colorThemeName);
|
|
82396
82438
|
return { chartJsConfig: {
|
|
82397
82439
|
type: "treemap",
|
|
82398
82440
|
data: {
|
|
@@ -90879,7 +90921,6 @@ const hooks = {
|
|
|
90879
90921
|
};
|
|
90880
90922
|
const compatibility = {
|
|
90881
90923
|
Component,
|
|
90882
|
-
useExternalListener,
|
|
90883
90924
|
EnvPlugin,
|
|
90884
90925
|
App: App$1
|
|
90885
90926
|
};
|
|
@@ -90935,6 +90976,6 @@ const chartHelpers = {
|
|
|
90935
90976
|
//#endregion
|
|
90936
90977
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, BadExpressionError, CHART_TYPES, CellErrorType, CellValueType, CircularDependencyError, ClientDisconnectedError, ClipboardMIMEType, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DEFAULT_LOCALE_DIGIT_GROUPING, DIRECTION, DispatchResult, DivisionByZeroError, EvaluationError, InvalidReferenceError, LocalTransportService, Model, NEXT_VALUE, NotAvailableError, NumberTooLargeError, OrderedLayers, PREVIOUS_VALUE, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, SplillBlockedError, Spreadsheet, SpreadsheetPivotTable, UIPlugin, UnknownFunctionError, __info__, addFunction, addRenderingLayer, astToFormula, availableConditionalFormatOperators, availableDataValidationOperators, availableFiltersOperators, borderPositions, borderStyles, canExecuteInReadonly, categories, chartHelpers, compatibility, components, composerFocusTypes, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, errorTypes, filterDateCriterionOperators, filterNumberCriterionOperators, filterTextCriterionOperators, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidSubtotalFormulasCommands, invalidateBordersCommands, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isHeadersDependant, isMatrix, isPositionDependent, isRangeDependant, isSheetDependent, isTargetDependent, isZoneDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, schemeToColorScale, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
90937
90978
|
|
|
90938
|
-
__info__.version = "19.5.0-alpha.
|
|
90939
|
-
__info__.date = "2026-08-
|
|
90940
|
-
__info__.hash = "
|
|
90979
|
+
__info__.version = "19.5.0-alpha.14";
|
|
90980
|
+
__info__.date = "2026-08-29T09:17:09.184Z";
|
|
90981
|
+
__info__.hash = "e8ad6ad";
|