@odoo/o-spreadsheet 19.1.0-alpha.0 → 19.1.0-alpha.2

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.
@@ -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.1.0-alpha.0
6
- * @date 2025-09-11T07:49:49.483Z
7
- * @hash 587c928
5
+ * @version 19.1.0-alpha.2
6
+ * @date 2025-09-19T07:26:49.306Z
7
+ * @hash 8cc543d
8
8
  */
9
9
 
10
10
  'use strict';
@@ -589,7 +589,6 @@ var DIRECTION;
589
589
  const CANVAS_SHIFT = 0.5;
590
590
  // Colors
591
591
  const HIGHLIGHT_COLOR = "#017E84";
592
- const BACKGROUND_GRAY_COLOR = "#f5f5f5";
593
592
  const BACKGROUND_HEADER_COLOR = "#F8F9FA";
594
593
  const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
595
594
  const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
@@ -599,15 +598,10 @@ const SELECTION_BORDER_COLOR = "#3266ca";
599
598
  const HEADER_BORDER_COLOR = "#C0C0C0";
600
599
  const CELL_BORDER_COLOR = "#E2E3E3";
601
600
  const BACKGROUND_CHART_COLOR = "#FFFFFF";
602
- const DISABLED_TEXT_COLOR = "#CACACA";
603
601
  const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
604
602
  const LINK_COLOR = HIGHLIGHT_COLOR;
605
603
  const FILTERS_COLOR = "#188038";
606
- const SEPARATOR_COLOR = "#E0E2E4";
607
- const ICONS_COLOR = "#4A4F59";
608
- const HEADER_GROUPING_BACKGROUND_COLOR = "#F5F5F5";
609
604
  const HEADER_GROUPING_BORDER_COLOR = "#999";
610
- const GRID_BORDER_COLOR = "#E2E3E3";
611
605
  const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
612
606
  const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
613
607
  const COMPOSER_ASSISTANT_COLOR = "#9B359B";
@@ -619,30 +613,9 @@ const CHART_WATERFALL_SUBTOTAL_COLOR = "#AAAAAA";
619
613
  const GRAY_900 = "#111827";
620
614
  const GRAY_300 = "#D8DADD";
621
615
  const GRAY_200 = "#E7E9ED";
622
- const GRAY_100 = "#F9FAFB";
623
616
  const TEXT_BODY = "#374151";
624
617
  const TEXT_BODY_MUTED = TEXT_BODY + "C2";
625
- const TEXT_HEADING = "#111827";
626
- const PRIMARY_BUTTON_BG = "#714B67";
627
- const PRIMARY_BUTTON_HOVER_BG = "#624159";
628
- const PRIMARY_BUTTON_ACTIVE_BG = "#f1edf0";
629
- const BUTTON_BG = GRAY_200;
630
- const BUTTON_HOVER_BG = GRAY_300;
631
- const BUTTON_HOVER_TEXT_COLOR = "#111827";
632
- const BUTTON_ACTIVE_BG = "#e6f2f3";
633
- const BUTTON_ACTIVE_TEXT_COLOR = "#111827";
634
618
  const ACTION_COLOR = HIGHLIGHT_COLOR;
635
- const ACTION_COLOR_HOVER = "#01585c";
636
- const ALERT_WARNING_BG = "#FBEBCC";
637
- const ALERT_WARNING_BORDER = "#F8E2B3";
638
- const ALERT_WARNING_TEXT_COLOR = "#946D23";
639
- const ALERT_DANGER_BG = "#D44C591A";
640
- const ALERT_DANGER_BORDER = "#C34A41";
641
- const ALERT_DANGER_TEXT_COLOR = "#C34A41";
642
- const ALERT_INFO_BG = "#CDEDF1";
643
- const ALERT_INFO_BORDER = "#98DBE2";
644
- const ALERT_INFO_TEXT_COLOR = "#09414A";
645
- const BADGE_SELECTED_COLOR = "#E6F2F3";
646
619
  const CHART_PADDING = 20;
647
620
  const CHART_PADDING_BOTTOM = 10;
648
621
  const CHART_PADDING_TOP = 15;
@@ -740,9 +713,7 @@ const MIN_COL_WIDTH = 5;
740
713
  const HEADER_HEIGHT = 26;
741
714
  const HEADER_WIDTH = 48;
742
715
  const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
743
- const MOBILE_TOPBAR_TOOLBAR_HEIGHT = 44;
744
716
  const DESKTOP_BOTTOMBAR_HEIGHT = 36;
745
- const MOBILE_BOTTOMBAR_HEIGHT = 44;
746
717
  const DEFAULT_CELL_WIDTH = 96;
747
718
  const DEFAULT_CELL_HEIGHT = 23;
748
719
  const SCROLLBAR_WIDTH = 15;
@@ -750,7 +721,6 @@ const AUTOFILL_EDGE_LENGTH = 8;
750
721
  const ICON_EDGE_LENGTH = 18;
751
722
  const MIN_CF_ICON_MARGIN = 4;
752
723
  const MIN_CELL_TEXT_MARGIN = 4;
753
- const CF_ICON_EDGE_LENGTH = 15;
754
724
  const PADDING_AUTORESIZE_VERTICAL = 3;
755
725
  const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
756
726
  const GROUP_LAYER_WIDTH = 21;
@@ -765,11 +735,6 @@ const MOBILE_WIDTH_BREAKPOINT = 768;
765
735
  const MENU_WIDTH = 250;
766
736
  const MENU_VERTICAL_PADDING = 6;
767
737
  const DESKTOP_MENU_ITEM_HEIGHT = 26;
768
- const MOBILE_MENU_ITEM_HEIGHT = 35;
769
- const MENU_ITEM_PADDING_HORIZONTAL = 11;
770
- const MENU_ITEM_PADDING_VERTICAL = 4;
771
- const MENU_SEPARATOR_BORDER_WIDTH = 1;
772
- const MENU_SEPARATOR_PADDING = 5;
773
738
  // Style
774
739
  const DEFAULT_STYLE = {
775
740
  align: "left",
@@ -823,23 +788,6 @@ const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
823
788
  const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
824
789
  // Cells
825
790
  const FORMULA_REF_IDENTIFIER = "|";
826
- // Components
827
- var ComponentsImportance;
828
- (function (ComponentsImportance) {
829
- ComponentsImportance[ComponentsImportance["Grid"] = 0] = "Grid";
830
- ComponentsImportance[ComponentsImportance["Highlight"] = 5] = "Highlight";
831
- ComponentsImportance[ComponentsImportance["HeaderGroupingButton"] = 6] = "HeaderGroupingButton";
832
- ComponentsImportance[ComponentsImportance["Figure"] = 10] = "Figure";
833
- ComponentsImportance[ComponentsImportance["ScrollBar"] = 15] = "ScrollBar";
834
- ComponentsImportance[ComponentsImportance["GridPopover"] = 19] = "GridPopover";
835
- ComponentsImportance[ComponentsImportance["GridComposer"] = 20] = "GridComposer";
836
- ComponentsImportance[ComponentsImportance["IconPicker"] = 25] = "IconPicker";
837
- ComponentsImportance[ComponentsImportance["TopBarComposer"] = 30] = "TopBarComposer";
838
- ComponentsImportance[ComponentsImportance["Popover"] = 35] = "Popover";
839
- ComponentsImportance[ComponentsImportance["FigureAnchor"] = 1000] = "FigureAnchor";
840
- ComponentsImportance[ComponentsImportance["FigureSnapLine"] = 1001] = "FigureSnapLine";
841
- ComponentsImportance[ComponentsImportance["FigureTooltip"] = 1002] = "FigureTooltip";
842
- })(ComponentsImportance || (ComponentsImportance = {}));
843
791
  let DEFAULT_SHEETVIEW_SIZE = 0;
844
792
  function getDefaultSheetViewSize() {
845
793
  return DEFAULT_SHEETVIEW_SIZE;
@@ -890,6 +838,7 @@ const tokenColors = {
890
838
  ARG_SEPARATOR: functionColor,
891
839
  ORPHAN_RIGHT_PAREN: "#ff0000",
892
840
  };
841
+ const DRAG_THRESHOLD = 5; // in pixels, to avoid unwanted drag when clicking
893
842
 
894
843
  //------------------------------------------------------------------------------
895
844
  // Miscellaneous
@@ -1368,8 +1317,19 @@ function memoize(func) {
1368
1317
  },
1369
1318
  }[funcName];
1370
1319
  }
1320
+ /**
1321
+ * Removes the specified indexes from the array.
1322
+ * Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
1323
+ */
1371
1324
  function removeIndexesFromArray(array, indexes) {
1372
- return array.filter((_, index) => !indexes.includes(index));
1325
+ const toRemove = new Set(indexes);
1326
+ const newArray = [];
1327
+ for (let i = 0; i < array.length; i++) {
1328
+ if (!toRemove.has(i)) {
1329
+ newArray.push(array[i]);
1330
+ }
1331
+ }
1332
+ return newArray;
1373
1333
  }
1374
1334
  function insertItemsAtIndex(array, items, index) {
1375
1335
  const newArray = [...array];
@@ -10665,153 +10625,6 @@ class ComposerFocusStore extends SpreadsheetStore {
10665
10625
  }
10666
10626
  }
10667
10627
 
10668
- /**
10669
- * This file is largely inspired by owl 1.
10670
- * `css` tag has been removed from owl 2 without workaround to manage css.
10671
- * So, the solution was to import the behavior of owl 1 directly in our
10672
- * codebase, with one difference: the css is added to the sheet as soon as the
10673
- * css tag is executed. In owl 1, the css was added as soon as a Component was
10674
- * created for the first time.
10675
- */
10676
- const STYLESHEETS = {};
10677
- let nextId = 0;
10678
- /**
10679
- * CSS tag helper for defining inline stylesheets. With this, one can simply define
10680
- * an inline stylesheet with just the following code:
10681
- * ```js
10682
- * css`.component-a { color: red; }`;
10683
- * ```
10684
- */
10685
- function css(strings, ...args) {
10686
- const name = `__sheet__${nextId++}`;
10687
- const value = String.raw(strings, ...args);
10688
- registerSheet(name, value);
10689
- activateSheet(name);
10690
- return name;
10691
- }
10692
- function processSheet(str) {
10693
- const tokens = str.split(/(\{|\}|;)/).map((s) => s.trim());
10694
- const selectorStack = [];
10695
- const parts = [];
10696
- let rules = [];
10697
- function generateSelector(stackIndex, parentSelector) {
10698
- const parts = [];
10699
- for (const selector of selectorStack[stackIndex]) {
10700
- let part = (parentSelector && parentSelector + " " + selector) || selector;
10701
- if (part.includes("&")) {
10702
- part = selector.replace(/&/g, parentSelector || "");
10703
- }
10704
- if (stackIndex < selectorStack.length - 1) {
10705
- part = generateSelector(stackIndex + 1, part);
10706
- }
10707
- parts.push(part);
10708
- }
10709
- return parts.join(", ");
10710
- }
10711
- function generateRules() {
10712
- if (rules.length) {
10713
- parts.push(generateSelector(0) + " {");
10714
- parts.push(...rules);
10715
- parts.push("}");
10716
- rules = [];
10717
- }
10718
- }
10719
- while (tokens.length) {
10720
- const token = tokens.shift();
10721
- if (token === "}") {
10722
- generateRules();
10723
- selectorStack.pop();
10724
- }
10725
- else {
10726
- if (tokens[0] === "{") {
10727
- generateRules();
10728
- selectorStack.push(token.split(/\s*,\s*/));
10729
- tokens.shift();
10730
- }
10731
- if (tokens[0] === ";") {
10732
- rules.push(" " + token + ";");
10733
- }
10734
- }
10735
- }
10736
- return parts.join("\n");
10737
- }
10738
- function registerSheet(id, css) {
10739
- const sheet = document.createElement("style");
10740
- sheet.textContent = processSheet(css);
10741
- STYLESHEETS[id] = sheet;
10742
- }
10743
- function activateSheet(id) {
10744
- const sheet = STYLESHEETS[id];
10745
- sheet.setAttribute("component", id);
10746
- document.head.appendChild(sheet);
10747
- }
10748
- function getTextDecoration({ strikethrough, underline, }) {
10749
- if (!strikethrough && !underline) {
10750
- return "none";
10751
- }
10752
- return `${strikethrough ? "line-through" : ""} ${underline ? "underline" : ""}`;
10753
- }
10754
- /**
10755
- * Convert the cell style to CSS properties.
10756
- */
10757
- function cellStyleToCss(style) {
10758
- const attributes = cellTextStyleToCss(style);
10759
- if (!style)
10760
- return attributes;
10761
- if (style.fillColor) {
10762
- attributes["background"] = style.fillColor;
10763
- }
10764
- return attributes;
10765
- }
10766
- /**
10767
- * Convert the cell text style to CSS properties.
10768
- */
10769
- function cellTextStyleToCss(style) {
10770
- const attributes = {};
10771
- if (!style)
10772
- return attributes;
10773
- if (style.bold) {
10774
- attributes["font-weight"] = "bold";
10775
- }
10776
- if (style.italic) {
10777
- attributes["font-style"] = "italic";
10778
- }
10779
- if (style.fontSize) {
10780
- attributes["font-size"] = `${style.fontSize}px`;
10781
- }
10782
- if (style.strikethrough || style.underline) {
10783
- let decoration = style.strikethrough ? "line-through" : "";
10784
- decoration = style.underline ? decoration + " underline" : decoration;
10785
- attributes["text-decoration"] = decoration;
10786
- }
10787
- if (style.textColor) {
10788
- attributes["color"] = style.textColor;
10789
- }
10790
- return attributes;
10791
- }
10792
- /**
10793
- * Transform CSS properties into a CSS string.
10794
- */
10795
- function cssPropertiesToCss(attributes) {
10796
- let styleStr = "";
10797
- for (const attName in attributes) {
10798
- if (!attributes[attName]) {
10799
- continue;
10800
- }
10801
- styleStr += `${attName}:${attributes[attName]}; `;
10802
- }
10803
- return styleStr;
10804
- }
10805
- function getElementMargins(el) {
10806
- const style = window.getComputedStyle(el);
10807
- return {
10808
- top: parseInt(style.marginTop, 10) || 0,
10809
- bottom: parseInt(style.marginBottom, 10) || 0,
10810
- left: parseInt(style.marginLeft, 10) || 0,
10811
- right: parseInt(style.marginRight, 10) || 0,
10812
- };
10813
- }
10814
-
10815
10628
  const chartJsExtensionRegistry = new Registry();
10816
10629
  function areChartJSExtensionsLoaded() {
10817
10630
  return !!window.Chart.registry.plugins.get("chartShowValuesPlugin");
@@ -16084,8 +15897,9 @@ function interactiveSort(env, sheetId, anchor, zone, sortDirection, sortOptions)
16084
15897
  }
16085
15898
 
16086
15899
  function sortMatrix(matrix, locale, ...criteria) {
16087
- for (const [i, value] of criteria.entries()) {
16088
- assert(value !== undefined, _t("Value for parameter %d is missing, while the function [[FUNCTION_NAME]] expect a number or a range.", i + 1));
15900
+ for (let i = 0; i < criteria.length; i++) {
15901
+ const param = i % 2 === 0 ? "sort_column" : "is_ascending";
15902
+ assert(criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
16089
15903
  }
16090
15904
  const sortingOrders = [];
16091
15905
  const sortColumns = [];
@@ -24033,15 +23847,6 @@ function getNextNonEmptyBar(bars, startIndex) {
24033
23847
  return bars.find((bar, i) => i > startIndex && bar.height !== 0);
24034
23848
  }
24035
23849
 
24036
- css /* scss */ `
24037
- .o-spreadsheet {
24038
- .o-chart-custom-tooltip {
24039
- font-size: 12px;
24040
- background-color: #fff;
24041
- z-index: ${ComponentsImportance.FigureTooltip};
24042
- }
24043
- }
24044
- `;
24045
23850
  chartJsExtensionRegistry.add("chartShowValuesPlugin", {
24046
23851
  register: (Chart) => Chart.register(chartShowValuesPlugin),
24047
23852
  unregister: (Chart) => Chart.unregister(chartShowValuesPlugin),
@@ -24539,18 +24344,15 @@ function createScorecardChartRuntime(chart, getters) {
24539
24344
  return {
24540
24345
  title: {
24541
24346
  ...chart.title,
24542
- // chart titles are extracted from .json files and they are translated at runtime here
24543
- text: chart.title.text ? _t(chart.title.text) : "",
24347
+ text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
24544
24348
  },
24545
24349
  keyValue: formattedKeyValue,
24546
- keyDescr: chart.keyDescr?.text
24547
- ? _t(chart.keyDescr.text) // descriptions are extracted from .json files and they are translated at runtime here
24548
- : "",
24350
+ keyDescr: chart.keyDescr?.text ? getters.dynamicTranslate(chart.keyDescr.text) : "",
24549
24351
  baselineDisplay,
24550
24352
  baselineArrow: getBaselineArrowDirection(baselineCell, keyValueCell, chart.baselineMode),
24551
24353
  baselineColor: getBaselineColor(baselineCell, chart.baselineMode, keyValueCell, chart.baselineColorUp, chart.baselineColorDown),
24552
24354
  baselineDescr: chart.baselineMode !== "progress" && chart.baselineDescr?.text
24553
- ? _t(chart.baselineDescr.text) // descriptions are extracted from .json files and they are translated at runtime here
24355
+ ? getters.dynamicTranslate(chart.baselineDescr.text)
24554
24356
  : "",
24555
24357
  fontColor,
24556
24358
  background,
@@ -24850,9 +24652,8 @@ class ScorecardChart extends owl.Component {
24850
24652
  return this.env.model.getters.getChartRuntime(this.props.chartId);
24851
24653
  }
24852
24654
  get title() {
24853
- const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text ?? "";
24854
- // chart titles are extracted from .json files and they are translated at runtime here
24855
- return _t(title);
24655
+ const title = this.env.model.getters.getChartDefinition(this.props.chartId).title.text;
24656
+ return title ? this.env.model.getters.dynamicTranslate(title) : "";
24856
24657
  }
24857
24658
  setup() {
24858
24659
  owl.useEffect(this.createChart.bind(this), () => {
@@ -27025,12 +26826,12 @@ function getDatasetAxisId(definition, dataset) {
27025
26826
  return axisId || "y";
27026
26827
  }
27027
26828
 
27028
- function getChartTitle(definition) {
26829
+ function getChartTitle(definition, getters) {
27029
26830
  const chartTitle = definition.title;
27030
26831
  const fontColor = chartMutedFontColor(definition.background);
27031
26832
  return {
27032
26833
  display: !!chartTitle.text,
27033
- text: _t(chartTitle.text),
26834
+ text: chartTitle.text ? getters.dynamicTranslate(chartTitle.text) : "",
27034
26835
  color: chartTitle?.color ?? fontColor,
27035
26836
  align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
27036
26837
  font: {
@@ -27598,7 +27399,7 @@ function createBarChartRuntime(chart, getters) {
27598
27399
  layout: getChartLayout(definition, chartData),
27599
27400
  scales: getBarChartScales(definition, chartData),
27600
27401
  plugins: {
27601
- title: getChartTitle(definition),
27402
+ title: getChartTitle(definition, getters),
27602
27403
  legend: getBarChartLegend(definition),
27603
27404
  tooltip: getBarChartTooltip(definition, chartData),
27604
27405
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -27785,13 +27586,6 @@ const zoomWindowPlugin = {
27785
27586
  },
27786
27587
  };
27787
27588
 
27788
- css /* scss */ `
27789
- .o-spreadsheet {
27790
- .o-master-chart-container {
27791
- height: ${MASTER_CHART_HEIGHT}px;
27792
- }
27793
- }
27794
- `;
27795
27589
  chartJsExtensionRegistry.add("zoomWindowPlugin", {
27796
27590
  register: (Chart) => Chart.register(zoomWindowPlugin),
27797
27591
  unregister: (Chart) => Chart.unregister(zoomWindowPlugin),
@@ -28829,7 +28623,7 @@ function createComboChartRuntime(chart, getters) {
28829
28623
  layout: getChartLayout(definition, chartData),
28830
28624
  scales: getBarChartScales(definition, chartData),
28831
28625
  plugins: {
28832
- title: getChartTitle(definition),
28626
+ title: getChartTitle(definition, getters),
28833
28627
  legend: getComboChartLegend(definition),
28834
28628
  tooltip: getBarChartTooltip(definition, chartData),
28835
28629
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -28975,7 +28769,7 @@ function createFunnelChartRuntime(chart, getters) {
28975
28769
  layout: getChartLayout(definition, chartData),
28976
28770
  scales: getFunnelChartScales(definition, chartData),
28977
28771
  plugins: {
28978
- title: getChartTitle(definition),
28772
+ title: getChartTitle(definition, getters),
28979
28773
  legend: { display: false },
28980
28774
  tooltip: getFunnelChartTooltip(definition, chartData),
28981
28775
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -29212,8 +29006,7 @@ function createGaugeChartRuntime(chart, getters) {
29212
29006
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
29213
29007
  title: {
29214
29008
  ...chart.title,
29215
- // chart titles are extracted from .json files and they are translated at runtime here
29216
- text: _t(chart.title.text ?? ""),
29009
+ text: chart.title.text ? getters.dynamicTranslate(chart.title.text) : "",
29217
29010
  },
29218
29011
  minValue: {
29219
29012
  value: minValue,
@@ -29397,7 +29190,7 @@ function createGeoChartRuntime(chart, getters) {
29397
29190
  layout: getChartLayout(definition, chartData),
29398
29191
  scales: getGeoChartScales(definition, chartData),
29399
29192
  plugins: {
29400
- title: getChartTitle(definition),
29193
+ title: getChartTitle(definition, getters),
29401
29194
  tooltip: getGeoChartTooltip(definition, chartData),
29402
29195
  legend: { display: false },
29403
29196
  },
@@ -29562,7 +29355,7 @@ function createLineChartRuntime(chart, getters) {
29562
29355
  layout: getChartLayout(definition, chartData),
29563
29356
  scales: getLineChartScales(definition, chartData),
29564
29357
  plugins: {
29565
- title: getChartTitle(definition),
29358
+ title: getChartTitle(definition, getters),
29566
29359
  legend: getLineChartLegend(definition),
29567
29360
  tooltip: getLineChartTooltip(definition, chartData),
29568
29361
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -29699,7 +29492,7 @@ function createPieChartRuntime(chart, getters) {
29699
29492
  : undefined,
29700
29493
  layout: getChartLayout(definition, chartData),
29701
29494
  plugins: {
29702
- title: getChartTitle(definition),
29495
+ title: getChartTitle(definition, getters),
29703
29496
  legend: getPieChartLegend(definition, chartData),
29704
29497
  tooltip: getPieChartTooltip(definition, chartData),
29705
29498
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -29853,7 +29646,7 @@ function createPyramidChartRuntime(chart, getters) {
29853
29646
  layout: getChartLayout(definition, chartData),
29854
29647
  scales: getPyramidChartScales(definition, chartData),
29855
29648
  plugins: {
29856
- title: getChartTitle(definition),
29649
+ title: getChartTitle(definition, getters),
29857
29650
  legend: getBarChartLegend(definition),
29858
29651
  tooltip: getPyramidChartTooltip(definition, chartData),
29859
29652
  chartShowValuesPlugin: getPyramidChartShowValues(definition, chartData),
@@ -30002,7 +29795,7 @@ function createRadarChartRuntime(chart, getters) {
30002
29795
  layout: getChartLayout(definition, chartData),
30003
29796
  scales: getRadarChartScales(definition, chartData),
30004
29797
  plugins: {
30005
- title: getChartTitle(definition),
29798
+ title: getChartTitle(definition, getters),
30006
29799
  legend: getRadarChartLegend(definition),
30007
29800
  tooltip: getRadarChartTooltip(definition, chartData),
30008
29801
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -30157,7 +29950,7 @@ function createScatterChartRuntime(chart, getters) {
30157
29950
  layout: getChartLayout(definition, chartData),
30158
29951
  scales: getScatterChartScales(definition, chartData),
30159
29952
  plugins: {
30160
- title: getChartTitle(definition),
29953
+ title: getChartTitle(definition, getters),
30161
29954
  legend: getScatterChartLegend(definition),
30162
29955
  tooltip: getLineChartTooltip(definition, chartData),
30163
29956
  chartShowValuesPlugin: getChartShowValues(definition, chartData),
@@ -30296,7 +30089,7 @@ function createSunburstChartRuntime(chart, getters) {
30296
30089
  ...CHART_COMMON_OPTIONS,
30297
30090
  layout: getChartLayout(definition, chartData),
30298
30091
  plugins: {
30299
- title: getChartTitle(definition),
30092
+ title: getChartTitle(definition, getters),
30300
30093
  legend: getSunburstChartLegend(definition),
30301
30094
  tooltip: getSunburstChartTooltip(definition, chartData),
30302
30095
  sunburstLabelsPlugin: getSunburstShowValues(definition, chartData),
@@ -30446,7 +30239,7 @@ function createTreeMapChartRuntime(chart, getters) {
30446
30239
  ...CHART_COMMON_OPTIONS,
30447
30240
  layout: getChartLayout(definition, chartData),
30448
30241
  plugins: {
30449
- title: getChartTitle(definition),
30242
+ title: getChartTitle(definition, getters),
30450
30243
  legend: { display: false },
30451
30244
  tooltip: getTreeMapChartTooltip(definition, chartData),
30452
30245
  },
@@ -30609,7 +30402,7 @@ function createWaterfallChartRuntime(chart, getters) {
30609
30402
  layout: getChartLayout(definition, chartData),
30610
30403
  scales: getWaterfallChartScales(definition, chartData),
30611
30404
  plugins: {
30612
- title: getChartTitle(definition),
30405
+ title: getChartTitle(definition, getters),
30613
30406
  legend: getWaterfallChartLegend(definition),
30614
30407
  tooltip: getWaterfallChartTooltip(definition, chartData),
30615
30408
  chartShowValuesPlugin: getWaterfallChartShowValues(definition, chartData),
@@ -31603,6 +31396,81 @@ function getCarouselItemTitle(getters, item) {
31603
31396
  return matchedChart.displayName;
31604
31397
  }
31605
31398
 
31399
+ /**
31400
+ * This file is largely inspired by owl 1.
31401
+ * `css` tag has been removed from owl 2 without workaround to manage css.
31402
+ * So, the solution was to import the behavior of owl 1 directly in our
31403
+ * codebase, with one difference: the css is added to the sheet as soon as the
31404
+ * css tag is executed. In owl 1, the css was added as soon as a Component was
31405
+ * created for the first time.
31406
+ */
31407
+ function getTextDecoration({ strikethrough, underline, }) {
31408
+ if (!strikethrough && !underline) {
31409
+ return "none";
31410
+ }
31411
+ return `${strikethrough ? "line-through" : ""} ${underline ? "underline" : ""}`;
31412
+ }
31413
+ /**
31414
+ * Convert the cell style to CSS properties.
31415
+ */
31416
+ function cellStyleToCss(style) {
31417
+ const attributes = cellTextStyleToCss(style);
31418
+ if (!style)
31419
+ return attributes;
31420
+ if (style.fillColor) {
31421
+ attributes["background"] = style.fillColor;
31422
+ }
31423
+ return attributes;
31424
+ }
31425
+ /**
31426
+ * Convert the cell text style to CSS properties.
31427
+ */
31428
+ function cellTextStyleToCss(style) {
31429
+ const attributes = {};
31430
+ if (!style)
31431
+ return attributes;
31432
+ if (style.bold) {
31433
+ attributes["font-weight"] = "bold";
31434
+ }
31435
+ if (style.italic) {
31436
+ attributes["font-style"] = "italic";
31437
+ }
31438
+ if (style.fontSize) {
31439
+ attributes["font-size"] = `${style.fontSize}px`;
31440
+ }
31441
+ if (style.strikethrough || style.underline) {
31442
+ let decoration = style.strikethrough ? "line-through" : "";
31443
+ decoration = style.underline ? decoration + " underline" : decoration;
31444
+ attributes["text-decoration"] = decoration;
31445
+ }
31446
+ if (style.textColor) {
31447
+ attributes["color"] = style.textColor;
31448
+ }
31449
+ return attributes;
31450
+ }
31451
+ /**
31452
+ * Transform CSS properties into a CSS string.
31453
+ */
31454
+ function cssPropertiesToCss(attributes) {
31455
+ let styleStr = "";
31456
+ for (const attName in attributes) {
31457
+ if (!attributes[attName]) {
31458
+ continue;
31459
+ }
31460
+ styleStr += `${attName}:${attributes[attName]}; `;
31461
+ }
31462
+ return styleStr;
31463
+ }
31464
+ function getElementMargins(el) {
31465
+ const style = window.getComputedStyle(el);
31466
+ return {
31467
+ top: parseInt(style.marginTop, 10) || 0,
31468
+ bottom: parseInt(style.marginBottom, 10) || 0,
31469
+ left: parseInt(style.marginLeft, 10) || 0,
31470
+ right: parseInt(style.marginRight, 10) || 0,
31471
+ };
31472
+ }
31473
+
31606
31474
  /**
31607
31475
  * Repeatedly calls a callback function with a time delay between calls.
31608
31476
  */
@@ -31657,59 +31525,6 @@ function useTimeOut() {
31657
31525
  };
31658
31526
  }
31659
31527
 
31660
- //------------------------------------------------------------------------------
31661
- // Context Menu Component
31662
- //------------------------------------------------------------------------------
31663
- css /* scss */ `
31664
- .o-menu {
31665
- background-color: white;
31666
- user-select: none;
31667
-
31668
- .o-menu-item {
31669
- height: ${DESKTOP_MENU_ITEM_HEIGHT}px;
31670
- padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
31671
- cursor: pointer;
31672
- user-select: none;
31673
-
31674
- .o-menu-item-name {
31675
- min-width: 40%;
31676
- }
31677
-
31678
- .o-menu-item-icon {
31679
- display: inline-block;
31680
- margin: 0px 8px 0px 0px;
31681
- width: ${DESKTOP_MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
31682
- line-height: ${DESKTOP_MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
31683
- }
31684
-
31685
- &:not(.disabled) {
31686
- &:hover,
31687
- &.o-menu-item-active {
31688
- background-color: ${BUTTON_ACTIVE_BG};
31689
- color: ${BUTTON_ACTIVE_TEXT_COLOR};
31690
- }
31691
- .o-menu-item-description {
31692
- color: grey;
31693
- }
31694
- .o-menu-item-icon {
31695
- .o-icon {
31696
- color: ${ICONS_COLOR};
31697
- }
31698
- }
31699
- }
31700
- &.disabled {
31701
- color: ${DISABLED_TEXT_COLOR};
31702
- cursor: not-allowed;
31703
- }
31704
- }
31705
- }
31706
-
31707
- .o-spreadsheet-mobile {
31708
- .o-menu-item {
31709
- height: ${MOBILE_MENU_ITEM_HEIGHT}px;
31710
- }
31711
- }
31712
- `;
31713
31528
  class Menu extends owl.Component {
31714
31529
  static template = "o-spreadsheet-Menu";
31715
31530
  static props = {
@@ -31886,16 +31701,6 @@ function usePopoverContainer() {
31886
31701
  return container;
31887
31702
  }
31888
31703
 
31889
- css /* scss */ `
31890
- .o-popover {
31891
- position: absolute;
31892
- z-index: ${ComponentsImportance.Popover};
31893
- overflow: auto;
31894
- box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);
31895
- width: fit-content;
31896
- height: fit-content;
31897
- }
31898
- `;
31899
31704
  class Popover extends owl.Component {
31900
31705
  static template = "o-spreadsheet-Popover";
31901
31706
  static props = {
@@ -31918,7 +31723,6 @@ class Popover extends owl.Component {
31918
31723
  onMouseWheel: () => { },
31919
31724
  onPopoverMoved: () => { },
31920
31725
  onPopoverHidden: () => { },
31921
- zIndex: ComponentsImportance.Popover,
31922
31726
  };
31923
31727
  popoverRef = owl.useRef("popover");
31924
31728
  popoverContentRef = owl.useRef("popoverContent");
@@ -31939,11 +31743,6 @@ class Popover extends owl.Component {
31939
31743
  // the element in rendered, so we can still set its position
31940
31744
  owl.useEffect(this.computePopoverPosition.bind(this));
31941
31745
  }
31942
- get popoverStyle() {
31943
- return cssPropertiesToCss({
31944
- "z-index": `${this.props.zIndex}`,
31945
- });
31946
- }
31947
31746
  computePopoverPosition() {
31948
31747
  if (!this.containerRect)
31949
31748
  throw new Error("Popover container is not defined");
@@ -32134,12 +31933,6 @@ class TopRightPopoverContext extends PopoverPositionContext {
32134
31933
  //------------------------------------------------------------------------------
32135
31934
  // Context MenuPopover Component
32136
31935
  //------------------------------------------------------------------------------
32137
- css /* scss */ `
32138
- .o-menu-wrapper {
32139
- padding: ${MENU_VERTICAL_PADDING}px 0px;
32140
- background-color: white;
32141
- }
32142
- `;
32143
31936
  const TIMEOUT_DELAY = 250;
32144
31937
  class MenuPopover extends owl.Component {
32145
31938
  static template = "o-spreadsheet-Menu-Popover";
@@ -32385,7 +32178,11 @@ class CarouselFigure extends owl.Component {
32385
32178
  onFigureDeleted: Function,
32386
32179
  editFigureStyle: { type: Function, optional: true },
32387
32180
  };
32388
- static components = { ChartDashboardMenu };
32181
+ static components = { ChartDashboardMenu, MenuPopover };
32182
+ carouselTabsRef = owl.useRef("carouselTabs");
32183
+ carouselTabsDropdownRef = owl.useRef("carouselTabsDropdown");
32184
+ menuState = owl.useState({ isOpen: false, anchorRect: null, menuItems: [] });
32185
+ hiddenItems = [];
32389
32186
  animationStore;
32390
32187
  setup() {
32391
32188
  this.animationStore = useStore(ChartAnimationStore);
@@ -32396,6 +32193,7 @@ class CarouselFigure extends owl.Component {
32396
32193
  else {
32397
32194
  this.props.editFigureStyle?.({ "pointer-events": "auto" });
32398
32195
  }
32196
+ this.updateTabsVisibility();
32399
32197
  });
32400
32198
  }
32401
32199
  get carousel() {
@@ -32455,6 +32253,49 @@ class CarouselFigure extends owl.Component {
32455
32253
  const style = { ...DEFAULT_CAROUSEL_TITLE_STYLE, ...this.carousel.title };
32456
32254
  return cssPropertiesToCss(cellTextStyleToCss(chartStyleToCellStyle(style)));
32457
32255
  }
32256
+ updateTabsVisibility() {
32257
+ const tabsContainerEl = this.carouselTabsRef.el;
32258
+ const dropDownEl = this.carouselTabsDropdownRef.el;
32259
+ if (!tabsContainerEl || !dropDownEl) {
32260
+ return;
32261
+ }
32262
+ this.hiddenItems = [];
32263
+ const containerRect = getBoundingRectAsPOJO(tabsContainerEl);
32264
+ const tabs = Array.from(tabsContainerEl.children);
32265
+ for (const tab of tabs) {
32266
+ tab.style.display = "block";
32267
+ }
32268
+ const tabWidths = tabs.map((tab) => getBoundingRectAsPOJO(tab).width);
32269
+ let currentWidth = 0;
32270
+ for (let i = 0; i < tabs.length; i++) {
32271
+ const shouldBeHidden = currentWidth + tabWidths[i] > containerRect.width;
32272
+ currentWidth += tabWidths[i];
32273
+ if (shouldBeHidden) {
32274
+ tabs[i].style.display = "none";
32275
+ this.hiddenItems.push(this.carousel.items[i]);
32276
+ }
32277
+ }
32278
+ dropDownEl.style.display = this.hiddenItems.length ? "block" : "none";
32279
+ }
32280
+ get menuId() {
32281
+ return "carousel-tabs-menu-";
32282
+ }
32283
+ toggleMenu(ev) {
32284
+ if (ev.closedMenuId === this.menuId) {
32285
+ this.menuState.isOpen = false;
32286
+ return;
32287
+ }
32288
+ const rect = getRefBoundingRect(this.carouselTabsDropdownRef);
32289
+ const menuItems = this.hiddenItems.map((item) => ({
32290
+ name: this.getItemTitle(item),
32291
+ execute: () => this.onCarouselTabClick(item),
32292
+ isActive: () => this.isItemSelected(item),
32293
+ isReadonlyAllowed: true,
32294
+ }));
32295
+ this.menuState.isOpen = true;
32296
+ this.menuState.anchorRect = rect;
32297
+ this.menuState.menuItems = createActions(menuItems);
32298
+ }
32458
32299
  }
32459
32300
 
32460
32301
  class ChartFigure extends owl.Component {
@@ -32532,79 +32373,6 @@ figureRegistry.add("carousel", {
32532
32373
  const ANCHOR_SIZE = 8;
32533
32374
  const BORDER_WIDTH = 1;
32534
32375
  const ACTIVE_BORDER_WIDTH = 2;
32535
- css /*SCSS*/ `
32536
- div.o-figure {
32537
- position: absolute;
32538
- width: 100%;
32539
- height: 100%;
32540
- user-select: none;
32541
-
32542
- &:focus {
32543
- outline: none;
32544
- }
32545
- }
32546
-
32547
- div.o-figure-border {
32548
- z-index: 1;
32549
- }
32550
-
32551
- .o-figure-wrapper {
32552
- position: absolute;
32553
- box-sizing: content-box;
32554
- pointer-events: auto;
32555
-
32556
- .o-fig-anchor {
32557
- z-index: ${ComponentsImportance.FigureAnchor};
32558
- position: absolute;
32559
- width: ${ANCHOR_SIZE}px;
32560
- height: ${ANCHOR_SIZE}px;
32561
- background-color: #1a73e8;
32562
- outline: ${BORDER_WIDTH}px solid white;
32563
-
32564
- &.o-top {
32565
- cursor: n-resize;
32566
- }
32567
- &.o-topRight {
32568
- cursor: ne-resize;
32569
- }
32570
- &.o-right {
32571
- cursor: e-resize;
32572
- }
32573
- &.o-bottomRight {
32574
- cursor: se-resize;
32575
- }
32576
- &.o-bottom {
32577
- cursor: s-resize;
32578
- }
32579
- &.o-bottomLeft {
32580
- cursor: sw-resize;
32581
- }
32582
- &.o-left {
32583
- cursor: w-resize;
32584
- }
32585
- &.o-topLeft {
32586
- cursor: nw-resize;
32587
- }
32588
- }
32589
-
32590
- .o-figure-menu {
32591
- right: 0px;
32592
- top: 0px;
32593
- display: none;
32594
- }
32595
-
32596
- .o-figure-menu-item {
32597
- cursor: pointer;
32598
- }
32599
-
32600
- .o-figure.active:focus,
32601
- .o-figure:hover {
32602
- .o-figure-menu {
32603
- display: flex;
32604
- }
32605
- }
32606
- }
32607
- `;
32608
32376
  class FigureComponent extends owl.Component {
32609
32377
  static template = "o-spreadsheet-FigureComponent";
32610
32378
  static props = {
@@ -32649,7 +32417,6 @@ class FigureComponent extends owl.Component {
32649
32417
  top: `${y}px`,
32650
32418
  width: `${width}px`,
32651
32419
  height: `${height}px`,
32652
- "z-index": String(ComponentsImportance.Figure + (this.isSelected ? 1 : 0)),
32653
32420
  });
32654
32421
  }
32655
32422
  getResizerPosition(resizer) {
@@ -32928,21 +32695,6 @@ class CellPopoverStore extends SpreadsheetStore {
32928
32695
  }
32929
32696
 
32930
32697
  const ERROR_TOOLTIP_MAX_HEIGHT = 80;
32931
- const ERROR_TOOLTIP_WIDTH = 180;
32932
- css /* scss */ `
32933
- .o-error-tooltip {
32934
- font-size: 13px;
32935
- background-color: white;
32936
- border-left: 3px solid red;
32937
- padding: 10px;
32938
- width: ${ERROR_TOOLTIP_WIDTH}px;
32939
- overflow-wrap: break-word;
32940
-
32941
- .o-error-tooltip-message {
32942
- overflow: hidden;
32943
- }
32944
- }
32945
- `;
32946
32698
  class ErrorToolTip extends owl.Component {
32947
32699
  static maxSize = { maxHeight: ERROR_TOOLTIP_MAX_HEIGHT };
32948
32700
  static template = "o-spreadsheet-ErrorToolTip";
@@ -33043,34 +32795,6 @@ class Collapse extends owl.Component {
33043
32795
  }
33044
32796
  }
33045
32797
 
33046
- css /* scss */ `
33047
- .o_side_panel_collapsible_title {
33048
- font-size: 16px;
33049
- cursor: pointer;
33050
- padding: 6px 0px 6px 6px !important;
33051
-
33052
- .collapsor-arrow {
33053
- transform: rotate(-90deg);
33054
- display: inline-block;
33055
- transform-origin: 8px 11px;
33056
- transition: transform 0.2s ease-in-out;
33057
-
33058
- .o-icon {
33059
- width: 16px;
33060
- height: 22px;
33061
- }
33062
- }
33063
- .collapsor:not(.collapsed) .collapsor-arrow {
33064
- transform: rotate(0);
33065
- }
33066
-
33067
- .collapsor {
33068
- width: 100%;
33069
- transition-delay: 0.35s;
33070
- transition-property: all;
33071
- }
33072
- }
33073
- `;
33074
32798
  class SidePanelCollapsible extends owl.Component {
33075
32799
  static template = "o-spreadsheet-SidePanelCollapsible";
33076
32800
  static props = {
@@ -33707,27 +33431,6 @@ function updateSelectionWithArrowKeys(ev, selection) {
33707
33431
  }
33708
33432
  }
33709
33433
 
33710
- css /* scss */ `
33711
- .o-autocomplete-dropdown {
33712
- pointer-events: auto;
33713
- cursor: pointer;
33714
- background-color: #fff;
33715
- max-width: 400px;
33716
- z-index: 1;
33717
-
33718
- .o-autocomplete-value-focus {
33719
- background-color: #f2f2f2;
33720
- }
33721
-
33722
- & > div {
33723
- padding: 1px 5px 5px 5px;
33724
- .o-autocomplete-description {
33725
- padding-left: 5px;
33726
- font-size: 11px;
33727
- }
33728
- }
33729
- }
33730
- `;
33731
33434
  class TextValueProvider extends owl.Component {
33732
33435
  static template = "o-spreadsheet-TextValueProvider";
33733
33436
  static props = {
@@ -34029,36 +33732,6 @@ class FunctionDescriptionProvider extends owl.Component {
34029
33732
  }
34030
33733
 
34031
33734
  const BUBBLE_ARROW_SIZE = 7;
34032
- css /* scss */ `
34033
- .o-spreadsheet {
34034
- .o-speech-bubble {
34035
- background-color: white;
34036
- box-sizing: border-box;
34037
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
34038
- border: 1px solid #ccc;
34039
- z-index: ${ComponentsImportance.Popover};
34040
-
34041
- &::after {
34042
- content: "";
34043
- position: absolute;
34044
- top: 100%;
34045
- left: 50%;
34046
- background-color: white;
34047
- height: ${BUBBLE_ARROW_SIZE}px;
34048
- width: ${BUBBLE_ARROW_SIZE}px;
34049
- transform-origin: top left;
34050
- transform: translate(0, -67%) rotate(45deg);
34051
- border-right: 1px solid #ccc;
34052
- border-bottom: 1px solid #ccc;
34053
- box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
34054
- }
34055
- }
34056
-
34057
- .o-speech-content {
34058
- max-width: 300px;
34059
- }
34060
- }
34061
- `;
34062
33735
  class SpeechBubble extends owl.Component {
34063
33736
  static template = "o-spreadsheet-SpeechBubble";
34064
33737
  static props = { content: String, anchorRect: Object };
@@ -34087,85 +33760,6 @@ const CLOSE_ICON_RADIUS = 9;
34087
33760
  const selectionIndicatorClass = "selector-flag";
34088
33761
  const highlightParenthesisClass = "highlight-parenthesis-flag";
34089
33762
  const highlightClass = "highlight-flag";
34090
- const selectionIndicatorColor = "#a9a9a9";
34091
- const selectionIndicator = "␣";
34092
- css /* scss */ `
34093
- .o-composer-container {
34094
- .o-composer {
34095
- overflow-y: auto;
34096
- overflow-x: hidden;
34097
- word-break: break-all;
34098
- padding-right: 2px;
34099
-
34100
- caret-color: black;
34101
- padding-left: 3px;
34102
- padding-right: 3px;
34103
- outline: none;
34104
-
34105
- tab-size: 4;
34106
-
34107
- p {
34108
- margin-bottom: 0px;
34109
-
34110
- span {
34111
- white-space: pre-wrap;
34112
- /* On some browsers (chromium ?) it is somehow possible to hover two of the composer's spans at the same time, leading to
34113
- * flickering with a succession of onmouseenter/onmouseleave events. A small invisible padding seems to prevent the issue.*/
34114
- padding-left: 0.01px;
34115
-
34116
- &.${selectionIndicatorClass}:after {
34117
- content: "${selectionIndicator}";
34118
- color: ${selectionIndicatorColor};
34119
- }
34120
-
34121
- &.${highlightParenthesisClass}:not(.${highlightClass}) {
34122
- border-radius: 5px;
34123
- background-color: lightgray;
34124
- padding: 1.5px 0px 1.5px 0px;
34125
- }
34126
-
34127
- &.${highlightClass} {
34128
- background-color: #e6edf3;
34129
- }
34130
- }
34131
- }
34132
- }
34133
- .o-composer[placeholder]:empty:not(:focus):not(.active)::before {
34134
- content: attr(placeholder);
34135
- color: #bdbdbd;
34136
- position: relative;
34137
- top: 0%;
34138
- pointer-events: none;
34139
- }
34140
-
34141
- .fa-stack {
34142
- /* reset stack size which is doubled by default */
34143
- width: ${CLOSE_ICON_RADIUS * 2}px;
34144
- height: ${CLOSE_ICON_RADIUS * 2}px;
34145
- line-height: ${CLOSE_ICON_RADIUS * 2}px;
34146
- }
34147
-
34148
- .force-open-assistant {
34149
- left: -1px;
34150
- top: -1px;
34151
-
34152
- .fa-question-circle {
34153
- color: ${PRIMARY_BUTTON_BG};
34154
- }
34155
- }
34156
-
34157
- .o-composer-assistant {
34158
- margin-top: 1px;
34159
-
34160
- .o-semi-bold {
34161
- /* FIXME: to remove in favor of Bootstrap
34162
- * 'fw-semibold' when we upgrade to Bootstrap 5.2
34163
- */
34164
- font-weight: 600 !important;
34165
- }
34166
- }
34167
- }
34168
- `;
34169
33763
  class Composer extends owl.Component {
34170
33764
  static template = "o-spreadsheet-Composer";
34171
33765
  static props = {
@@ -35838,30 +35432,6 @@ class StandaloneComposerStore extends AbstractComposerStore {
35838
35432
  }
35839
35433
  }
35840
35434
 
35841
- css /* scss */ `
35842
- .o-spreadsheet {
35843
- .o-standalone-composer {
35844
- min-height: 24px;
35845
-
35846
- border-bottom: 1px solid;
35847
- border-color: ${GRAY_300};
35848
-
35849
- &.active {
35850
- border-color: ${ACTION_COLOR};
35851
- }
35852
-
35853
- &.o-invalid {
35854
- border-bottom: 2px solid red;
35855
- }
35856
-
35857
- /* As the standalone composer is potentially very small (eg. in a side panel), we remove the scrollbar display */
35858
- scrollbar-width: none; /* Firefox */
35859
- &::-webkit-scrollbar {
35860
- display: none;
35861
- }
35862
- }
35863
- }
35864
- `;
35865
35435
  class StandaloneComposer extends owl.Component {
35866
35436
  static template = "o-spreadsheet-StandaloneComposer";
35867
35437
  static props = {
@@ -35929,17 +35499,6 @@ class StandaloneComposer extends owl.Component {
35929
35499
  }
35930
35500
  }
35931
35501
 
35932
- css /* scss */ `
35933
- .o-dv-input {
35934
- &.o-invalid {
35935
- background-color: #ffdddd;
35936
- }
35937
- .error-icon {
35938
- right: 7px;
35939
- top: 7px;
35940
- }
35941
- }
35942
- `;
35943
35502
  class CriterionInput extends owl.Component {
35944
35503
  static template = "o-spreadsheet-CriterionInput";
35945
35504
  static props = {
@@ -36107,8 +35666,6 @@ function startDnd(onPointerMove, onPointerUp) {
36107
35666
  return removeListeners;
36108
35667
  }
36109
35668
 
36110
- const LINE_VERTICAL_PADDING = 1;
36111
- const PICKER_PADDING = 8;
36112
35669
  const ITEM_BORDER_WIDTH = 1;
36113
35670
  const ITEM_EDGE_LENGTH = 18;
36114
35671
  const ITEMS_PER_LINE = 10;
@@ -36117,170 +35674,6 @@ const ITEM_GAP = 2;
36117
35674
  const CONTENT_WIDTH = ITEMS_PER_LINE * (ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH) + (ITEMS_PER_LINE - 1) * ITEM_GAP;
36118
35675
  const INNER_GRADIENT_WIDTH = CONTENT_WIDTH - 2 * ITEM_BORDER_WIDTH;
36119
35676
  const INNER_GRADIENT_HEIGHT = CONTENT_WIDTH - 30 - 2 * ITEM_BORDER_WIDTH;
36120
- const CONTAINER_WIDTH = CONTENT_WIDTH + 2 * PICKER_PADDING;
36121
- css /* scss */ `
36122
- .o-color-picker {
36123
- padding: ${PICKER_PADDING}px 0;
36124
- /* FIXME: this is useless, overiden by the popover container */
36125
- box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
36126
- background-color: white;
36127
- line-height: 1.2;
36128
- overflow-y: auto;
36129
- overflow-x: hidden;
36130
- width: ${CONTAINER_WIDTH}px;
36131
-
36132
- .o-color-picker-section-name {
36133
- margin: 0px ${ITEM_BORDER_WIDTH}px;
36134
- padding: 4px ${PICKER_PADDING}px;
36135
- }
36136
- .colors-grid {
36137
- display: grid;
36138
- padding: ${LINE_VERTICAL_PADDING}px ${PICKER_PADDING}px;
36139
- grid-template-columns: repeat(${ITEMS_PER_LINE}, 1fr);
36140
- grid-gap: ${ITEM_GAP}px;
36141
- }
36142
- .o-color-picker-toggler-button {
36143
- display: flex;
36144
- .o-color-picker-toggler-sign {
36145
- display: flex;
36146
- margin: auto auto;
36147
- width: 55%;
36148
- height: 55%;
36149
- .o-icon {
36150
- width: 100%;
36151
- height: 100%;
36152
- }
36153
- }
36154
- }
36155
- .o-color-picker-line-item {
36156
- width: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
36157
- height: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
36158
- margin: 0px;
36159
- border-radius: 50px;
36160
- border: ${ITEM_BORDER_WIDTH}px solid #666666;
36161
- padding: 0px;
36162
- font-size: 16px;
36163
- background: white;
36164
- &:hover {
36165
- background-color: rgba(0, 0, 0, 0.08);
36166
- outline: 1px solid gray;
36167
- cursor: pointer;
36168
- }
36169
- }
36170
- .o-buttons {
36171
- padding: ${PICKER_PADDING}px;
36172
- display: flex;
36173
- .o-cancel {
36174
- border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
36175
- width: 100%;
36176
- padding: 5px;
36177
- font-size: 14px;
36178
- background: white;
36179
- border-radius: 4px;
36180
- &:hover:enabled {
36181
- background-color: rgba(0, 0, 0, 0.08);
36182
- }
36183
- }
36184
- }
36185
- .o-add-button {
36186
- border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
36187
- padding: 4px;
36188
- background: white;
36189
- border-radius: 4px;
36190
- &:hover:enabled {
36191
- background-color: rgba(0, 0, 0, 0.08);
36192
- }
36193
- }
36194
- .o-separator {
36195
- border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
36196
- margin-top: ${MENU_SEPARATOR_PADDING}px;
36197
- margin-bottom: ${MENU_SEPARATOR_PADDING}px;
36198
- }
36199
-
36200
- .o-custom-selector {
36201
- padding: ${PICKER_PADDING + 2}px ${PICKER_PADDING}px;
36202
- position: relative;
36203
- .o-gradient {
36204
- margin-bottom: ${MAGNIFIER_EDGE / 2}px;
36205
- border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
36206
- width: ${INNER_GRADIENT_WIDTH + 2 * ITEM_BORDER_WIDTH}px;
36207
- height: ${INNER_GRADIENT_HEIGHT + 2 * ITEM_BORDER_WIDTH}px;
36208
- position: relative;
36209
- }
36210
-
36211
- .magnifier {
36212
- height: ${MAGNIFIER_EDGE}px;
36213
- width: ${MAGNIFIER_EDGE}px;
36214
- border-radius: 50%;
36215
- border: 2px solid #fff;
36216
- box-shadow: 0px 0px 3px #c0c0c0;
36217
- position: absolute;
36218
- z-index: 2;
36219
- }
36220
- .saturation {
36221
- background: linear-gradient(to right, #fff 0%, transparent 100%);
36222
- }
36223
- .lightness {
36224
- background: linear-gradient(to top, #000 0%, transparent 100%);
36225
- }
36226
- .o-hue-picker {
36227
- border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
36228
- width: 100%;
36229
- height: 12px;
36230
- border-radius: 4px;
36231
- background: linear-gradient(
36232
- to right,
36233
- hsl(0 100% 50%) 0%,
36234
- hsl(0.2turn 100% 50%) 20%,
36235
- hsl(0.3turn 100% 50%) 30%,
36236
- hsl(0.4turn 100% 50%) 40%,
36237
- hsl(0.5turn 100% 50%) 50%,
36238
- hsl(0.6turn 100% 50%) 60%,
36239
- hsl(0.7turn 100% 50%) 70%,
36240
- hsl(0.8turn 100% 50%) 80%,
36241
- hsl(0.9turn 100% 50%) 90%,
36242
- hsl(1turn 100% 50%) 100%
36243
- );
36244
- position: relative;
36245
- cursor: crosshair;
36246
- }
36247
- .o-hue-slider {
36248
- margin-top: -3px;
36249
- }
36250
- .o-custom-input-preview {
36251
- padding: 2px 0px;
36252
- display: flex;
36253
- input {
36254
- width: 50%;
36255
- border-radius: 4px;
36256
- padding: 4px 23px 4px 10px;
36257
- height: 24px;
36258
- border: 1px solid #c0c0c0;
36259
- margin-right: 2px;
36260
- }
36261
- .o-wrong-color {
36262
- /* FIXME bootstrap class instead? */
36263
- outline-color: red;
36264
- border-color: red;
36265
- &:focus {
36266
- outline-style: solid;
36267
- outline-width: 1px;
36268
- }
36269
- }
36270
- }
36271
- .o-custom-input-buttons {
36272
- padding: 2px 0px;
36273
- display: flex;
36274
- justify-content: end;
36275
- }
36276
- .o-color-preview {
36277
- border: 1px solid #c0c0c0;
36278
- border-radius: 4px;
36279
- width: 50%;
36280
- }
36281
- }
36282
- }
36283
- `;
36284
35677
  class ColorPicker extends owl.Component {
36285
35678
  static template = "o-spreadsheet-ColorPicker";
36286
35679
  static props = {
@@ -36435,21 +35828,12 @@ class Section extends owl.Component {
36435
35828
  };
36436
35829
  }
36437
35830
 
36438
- const TRANSPARENT_BACKGROUND_SVG = /*xml*/ `
36439
- <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10">
36440
- <path fill="#d9d9d9" d="M5 5h5v5H5zH0V0h5"/>
36441
- </svg>
36442
- `;
36443
- css /* scss */ `
36444
- .o-round-color-picker-button {
36445
- width: 20px;
36446
- height: 20px;
36447
- cursor: pointer;
36448
- border: 1px solid ${GRAY_300};
36449
- background-position: 1px 1px;
36450
- background-image: url("data:image/svg+xml,${encodeURIComponent(TRANSPARENT_BACKGROUND_SVG)}");
36451
- }
36452
- `;
35831
+ // FIXME Encoding version used in css
35832
+ // const TRANSPARENT_BACKGROUND_SVG = /*xml*/ `
35833
+ // <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10">
35834
+ // <path fill="#d9d9d9" d="M5 5h5v5H5zH0V0h5"/>
35835
+ // </svg>
35836
+ // `;
36453
35837
  class RoundColorPicker extends owl.Component {
36454
35838
  static template = "o-spreadsheet.RoundColorPicker";
36455
35839
  static components = { Section, ColorPicker };
@@ -36486,12 +35870,6 @@ class RoundColorPicker extends owl.Component {
36486
35870
  }
36487
35871
  }
36488
35872
 
36489
- css /* scss */ `
36490
- .o-dv-list-item-delete {
36491
- color: #666666;
36492
- cursor: pointer;
36493
- }
36494
- `;
36495
35873
  class ListCriterionForm extends CriterionForm {
36496
35874
  static template = "o-spreadsheet-ListCriterionForm";
36497
35875
  static components = { CriterionInput, RoundColorPicker };
@@ -37205,36 +36583,6 @@ class SelectionInputStore extends SpreadsheetStore {
37205
36583
  }
37206
36584
  }
37207
36585
 
37208
- css /* scss */ `
37209
- .o-selection {
37210
- .o-selection-input {
37211
- padding: 2px 0px;
37212
-
37213
- input.o-invalid {
37214
- background-color: ${ALERT_DANGER_BG};
37215
- }
37216
- .input-icon {
37217
- right: 7px;
37218
- top: 4px;
37219
- }
37220
- .o-drag-handle {
37221
- cursor: move;
37222
- }
37223
- }
37224
- .o-disabled-ranges {
37225
- color: #888 !important;
37226
- }
37227
- .o-button {
37228
- flex-grow: 0;
37229
- }
37230
-
37231
- /* Make the character a bit bigger
37232
- compared to its neighbor INPUT box */
37233
- .o-remove-selection {
37234
- font-size: calc(100% + 4px);
37235
- }
37236
- }
37237
- `;
37238
36586
  /**
37239
36587
  * This component can be used when the user needs to input some
37240
36588
  * ranges. He can either input the ranges with the regular DOM `<input/>`
@@ -37733,44 +37081,6 @@ class FilterMenuCriterion extends owl.Component {
37733
37081
  }
37734
37082
  }
37735
37083
 
37736
- const CHECK_SVG = /*xml*/ `
37737
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>
37738
- <path fill='none' stroke='#FFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/>
37739
- </svg>
37740
- `;
37741
- const CHECKBOX_WIDTH = 14;
37742
- css /* scss */ `
37743
- label.o-checkbox {
37744
- input {
37745
- appearance: none;
37746
- -webkit-appearance: none;
37747
- -moz-appearance: none;
37748
- border-radius: 0;
37749
- width: ${CHECKBOX_WIDTH}px;
37750
- height: ${CHECKBOX_WIDTH}px;
37751
- vertical-align: top;
37752
- outline: none;
37753
- border: 1px solid ${GRAY_300};
37754
- cursor: pointer;
37755
-
37756
- &:hover {
37757
- border-color: ${ACTION_COLOR};
37758
- }
37759
-
37760
- &:checked {
37761
- background: url("data:image/svg+xml,${encodeURIComponent(CHECK_SVG)}");
37762
- background-color: ${ACTION_COLOR};
37763
- border-color: ${ACTION_COLOR};
37764
- }
37765
-
37766
- &:focus {
37767
- outline: none;
37768
- box-shadow: 0 0 0 0.25rem rgba(113, 75, 103, 0.25);
37769
- border-color: ${ACTION_COLOR};
37770
- }
37771
- }
37772
- }
37773
- `;
37774
37084
  class Checkbox extends owl.Component {
37775
37085
  static template = "o-spreadsheet.Checkbox";
37776
37086
  static props = {
@@ -37978,60 +37288,6 @@ class FilterMenuValueList extends owl.Component {
37978
37288
  }
37979
37289
  }
37980
37290
 
37981
- css /* scss */ `
37982
- .o-filter-menu {
37983
- width: 245px;
37984
- padding: 8px 0;
37985
- user-select: none;
37986
-
37987
- .o-filter-menu-content {
37988
- padding: 0 16px;
37989
- }
37990
-
37991
- .o-sort-item {
37992
- padding-left: 34px;
37993
- }
37994
-
37995
- .o_side_panel_collapsible_title {
37996
- font-size: inherit;
37997
- padding: 0 0 4px 0 !important;
37998
- font-weight: 400 !important;
37999
-
38000
- .collapsor .o-icon {
38001
- opacity: 0.8;
38002
- }
38003
-
38004
- .collapsor-arrow {
38005
- transform-origin: 6px 8px;
38006
-
38007
- .o-icon {
38008
- width: 12px;
38009
- height: 16px;
38010
- }
38011
- }
38012
- }
38013
-
38014
- .o-filter-menu-item {
38015
- display: flex;
38016
- cursor: pointer;
38017
- user-select: none;
38018
- line-height: 1;
38019
-
38020
- &.selected,
38021
- &:hover {
38022
- background-color: ${BUTTON_ACTIVE_BG};
38023
- }
38024
- }
38025
-
38026
- .o-filter-menu-buttons {
38027
- margin-top: 9px;
38028
-
38029
- .o-button {
38030
- height: 26px;
38031
- }
38032
- }
38033
- }
38034
- `;
38035
37291
  class FilterMenu extends owl.Component {
38036
37292
  static template = "o-spreadsheet-FilterMenu";
38037
37293
  static props = {
@@ -38155,55 +37411,6 @@ const FilterMenuPopoverBuilder = {
38155
37411
  },
38156
37412
  };
38157
37413
 
38158
- const LINK_TOOLTIP_HEIGHT = 32;
38159
- const LINK_TOOLTIP_WIDTH = 220;
38160
- css /* scss */ `
38161
- .o-link-tool {
38162
- font-size: 13px;
38163
- background-color: white;
38164
- box-shadow: 0 1px 4px 3px rgba(60, 64, 67, 0.15);
38165
- padding: 6px 12px;
38166
- border-radius: 4px;
38167
- display: flex;
38168
- justify-content: space-between;
38169
- height: ${LINK_TOOLTIP_HEIGHT}px;
38170
- width: ${LINK_TOOLTIP_WIDTH}px;
38171
-
38172
- img {
38173
- margin-right: 3px;
38174
- width: 16px;
38175
- height: 16px;
38176
- }
38177
-
38178
- a.o-link {
38179
- color: ${LINK_COLOR};
38180
- text-decoration: none;
38181
- flex-grow: 2;
38182
- white-space: nowrap;
38183
- overflow: hidden;
38184
- text-overflow: ellipsis;
38185
- }
38186
- a.o-link:hover {
38187
- text-decoration: none;
38188
- color: #001d1f;
38189
- cursor: pointer;
38190
- }
38191
- }
38192
- .o-link-icon {
38193
- float: right;
38194
- padding-left: 5px;
38195
- .o-icon {
38196
- height: 16px;
38197
- }
38198
- }
38199
- .o-link-icon .o-icon {
38200
- height: 13px;
38201
- }
38202
- .o-link-icon:hover {
38203
- cursor: pointer;
38204
- color: #000;
38205
- }
38206
- `;
38207
37414
  class LinkDisplay extends owl.Component {
38208
37415
  static template = "o-spreadsheet-LinkDisplay";
38209
37416
  static props = {
@@ -38434,54 +37641,6 @@ linkMenuRegistry.add("sheet", {
38434
37641
  sequence: 10,
38435
37642
  });
38436
37643
 
38437
- const PADDING = 12;
38438
- const LINK_EDITOR_WIDTH = 340 + 2 * PADDING;
38439
- css /* scss */ `
38440
- .o-link-editor {
38441
- font-size: 13px;
38442
- background-color: white;
38443
- box-shadow: 0 1px 4px 3px rgba(60, 64, 67, 0.15);
38444
- padding: ${PADDING}px;
38445
- display: flex;
38446
- flex-direction: column;
38447
- border-radius: 4px;
38448
- width: ${LINK_EDITOR_WIDTH}px;
38449
-
38450
- .o-section {
38451
- .o-section-title {
38452
- font-weight: bold;
38453
- margin-bottom: 5px;
38454
- }
38455
- }
38456
- .o-buttons {
38457
- padding-left: 16px;
38458
- padding-top: 16px;
38459
- text-align: right;
38460
- }
38461
- input.o-input {
38462
- width: 100%;
38463
- padding: 0 23px 4px 0;
38464
- }
38465
- .o-link-url {
38466
- position: relative;
38467
- flex-grow: 1;
38468
- button {
38469
- position: absolute;
38470
- right: 0px;
38471
- top: 0px;
38472
- border: none;
38473
- height: 20px;
38474
- width: 20px;
38475
- background-color: #fff;
38476
- margin: 2px 3px 1px 0px;
38477
- padding: 0px 1px 0px 0px;
38478
- }
38479
- button:hover {
38480
- cursor: pointer;
38481
- }
38482
- }
38483
- }
38484
- `;
38485
37644
  class LinkEditor extends owl.Component {
38486
37645
  static template = "o-spreadsheet-LinkEditor";
38487
37646
  static props = {
@@ -39209,29 +38368,6 @@ function buildTableStyle(name, templateName, primaryColor) {
39209
38368
  };
39210
38369
  }
39211
38370
 
39212
- css /* scss */ `
39213
- .o-spreadsheet {
39214
- .o-icon {
39215
- display: flex;
39216
- align-items: center;
39217
- justify-content: center;
39218
- width: ${ICON_EDGE_LENGTH}px;
39219
- height: ${ICON_EDGE_LENGTH}px;
39220
- font-size: ${ICON_EDGE_LENGTH}px;
39221
- vertical-align: middle;
39222
-
39223
- .small-text {
39224
- font: bold 9px sans-serif;
39225
- }
39226
- .heavy-text {
39227
- font: bold 16px sans-serif;
39228
- }
39229
- }
39230
- .fa-small {
39231
- font-size: 14px;
39232
- }
39233
- }
39234
- `;
39235
38371
  // -----------------------------------------------------------------------------
39236
38372
  // We need here the svg of the icons that we need to convert to images for the renderer
39237
38373
  // -----------------------------------------------------------------------------
@@ -39328,6 +38464,14 @@ function getCaretDownSvg(color) {
39328
38464
  paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 195 h270 l-135 130" }],
39329
38465
  };
39330
38466
  }
38467
+ function getCaretUpSvg(color) {
38468
+ return {
38469
+ name: "CARET_UP",
38470
+ width: 512,
38471
+ height: 512,
38472
+ paths: [{ fillColor: color.textColor || TEXT_BODY_MUTED, path: "M120 325 h270 l-135 -130" }],
38473
+ };
38474
+ }
39331
38475
  function getHoveredCaretDownSvg(color) {
39332
38476
  return {
39333
38477
  name: "CARET_DOWN",
@@ -49097,37 +48241,6 @@ function adjustIndexWithinBounds(index, position, max) {
49097
48241
  return index;
49098
48242
  }
49099
48243
 
49100
- // -----------------------------------------------------------------------------
49101
- // Autofill
49102
- // -----------------------------------------------------------------------------
49103
- css /* scss */ `
49104
- .o-autofill {
49105
- position: absolute;
49106
- height: ${AUTOFILL_EDGE_LENGTH}px;
49107
- width: ${AUTOFILL_EDGE_LENGTH}px;
49108
- border: 1px solid white;
49109
- background-color: #1a73e8;
49110
- }
49111
-
49112
- .o-autofill-handler {
49113
- position: absolute;
49114
- height: ${AUTOFILL_EDGE_LENGTH}px;
49115
- width: ${AUTOFILL_EDGE_LENGTH}px;
49116
- &:hover {
49117
- cursor: crosshair;
49118
- }
49119
- }
49120
-
49121
- .o-autofill-nextvalue {
49122
- position: absolute;
49123
- background-color: #ffffff;
49124
- border: 1px solid black;
49125
- padding: 5px;
49126
- font-size: 12px;
49127
- pointer-events: none;
49128
- white-space: nowrap;
49129
- }
49130
- `;
49131
48244
  class Autofill extends owl.Component {
49132
48245
  static template = "o-spreadsheet-Autofill";
49133
48246
  static props = {
@@ -49212,16 +48325,6 @@ class TooltipComponent extends owl.Component {
49212
48325
  `;
49213
48326
  }
49214
48327
 
49215
- css /* scss */ `
49216
- .o-client-tag {
49217
- position: absolute;
49218
- border-top-left-radius: 4px;
49219
- border-top-right-radius: 4px;
49220
- font-size: ${DEFAULT_FONT_SIZE};
49221
- color: white;
49222
- pointer-events: none;
49223
- }
49224
- `;
49225
48328
  class ClientTag extends owl.Component {
49226
48329
  static template = "o-spreadsheet-ClientTag";
49227
48330
  static props = {
@@ -49771,28 +48874,6 @@ class CellComposerStore extends AbstractComposerStore {
49771
48874
 
49772
48875
  const COMPOSER_BORDER_WIDTH = 3 * 0.4 * window.devicePixelRatio || 1;
49773
48876
  const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
49774
- css /* scss */ `
49775
- div.o-grid-composer {
49776
- z-index: ${ComponentsImportance.GridComposer};
49777
- position: absolute;
49778
- border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
49779
- font-family: ${DEFAULT_FONT};
49780
-
49781
- display: flex;
49782
- align-items: center;
49783
- }
49784
-
49785
- div.o-cell-reference {
49786
- position: absolute;
49787
- z-index: ${ComponentsImportance.GridComposer};
49788
- background: ${SELECTION_BORDER_COLOR};
49789
- color: white;
49790
- font-size: 12px;
49791
- line-height: 14px;
49792
- padding: 6px 7px;
49793
- border-radius: 4px;
49794
- }
49795
- `;
49796
48877
  /**
49797
48878
  * This component is a composer which positions itself on the grid at the anchor cell.
49798
48879
  * It also applies the style of the cell to the composer input.
@@ -49918,6 +48999,7 @@ class GridComposer extends owl.Component {
49918
48999
  return cssPropertiesToCss({
49919
49000
  left: `${left - 1}px`,
49920
49001
  top: `${top}px`,
49002
+ border: `${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR}`,
49921
49003
  "min-width": `${minWidth}px`,
49922
49004
  "min-height": `${minHeight}px`,
49923
49005
  "max-width": `${maxWidth}px`,
@@ -50188,24 +49270,6 @@ function getAxis(getters, figureUI, dnd, axisType) {
50188
49270
  return { position, axisType: axisType };
50189
49271
  }
50190
49272
 
50191
- css /*SCSS*/ `
50192
- .o-figure-snap-line {
50193
- position: relative;
50194
- z-index: ${ComponentsImportance.FigureSnapLine};
50195
- &.vertical {
50196
- width: 0px;
50197
- border-left: 1px dashed black;
50198
- }
50199
- &.horizontal {
50200
- border-top: 1px dashed black;
50201
- height: 0px;
50202
- }
50203
- }
50204
- .o-figure-container {
50205
- -webkit-user-select: none; /* safari */
50206
- user-select: none;
50207
- }
50208
- `;
50209
49273
  /**
50210
49274
  * Each figure ⭐ is positioned inside a container `div` placed and sized
50211
49275
  * according to the split pane the figure is part of, or a separate container for the figure
@@ -50434,9 +49498,16 @@ class FiguresContainer extends owl.Component {
50434
49498
  maxX: this.env.model.getters.getColDimensions(sheetId, this.env.model.getters.getNumberCols(sheetId) - 1).end,
50435
49499
  maxY: this.env.model.getters.getRowDimensions(sheetId, this.env.model.getters.getNumberRows(sheetId) - 1).end,
50436
49500
  };
49501
+ let hasStartedDnd = false;
50437
49502
  const onMouseMove = (ev) => {
50438
49503
  const getters = this.env.model.getters;
50439
49504
  const currentMousePosition = { x: ev.clientX, y: ev.clientY };
49505
+ const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
49506
+ const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
49507
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) {
49508
+ return; // add a small threshold to avoid dnd when just clicking
49509
+ }
49510
+ hasStartedDnd = true;
50440
49511
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
50441
49512
  const otherFigures = this.getOtherFigures(initialFigure.id);
50442
49513
  const overlappingCarousel = this.getCarouselOverlappingChart(draggedFigure, otherFigures);
@@ -50630,38 +49701,6 @@ class FiguresContainer extends owl.Component {
50630
49701
  }
50631
49702
  }
50632
49703
 
50633
- css /* scss */ `
50634
- .o-validation {
50635
- border-radius: 4px;
50636
- border-width: 0 0 0 3px;
50637
- border-style: solid;
50638
- gap: 3px;
50639
-
50640
- .o-icon {
50641
- margin-right: 5px;
50642
- height: 1.2em;
50643
- width: 1.2em;
50644
- }
50645
- }
50646
-
50647
- .o-validation-warning {
50648
- border-color: ${ALERT_WARNING_BORDER};
50649
- color: ${ALERT_WARNING_TEXT_COLOR};
50650
- background-color: ${ALERT_WARNING_BG};
50651
- }
50652
-
50653
- .o-validation-error {
50654
- border-color: ${ALERT_DANGER_BORDER};
50655
- color: ${ALERT_DANGER_TEXT_COLOR};
50656
- background-color: ${ALERT_DANGER_BG};
50657
- }
50658
-
50659
- .o-validation-info {
50660
- border-color: ${ALERT_INFO_BORDER};
50661
- color: ${ALERT_INFO_TEXT_COLOR};
50662
- background-color: ${ALERT_INFO_BG};
50663
- }
50664
- `;
50665
49704
  class ValidationMessages extends owl.Component {
50666
49705
  static template = "o-spreadsheet-ValidationMessages";
50667
49706
  static props = {
@@ -50683,20 +49722,6 @@ class ValidationMessages extends owl.Component {
50683
49722
  }
50684
49723
  }
50685
49724
 
50686
- css /* scss */ `
50687
- .o-grid-add-rows {
50688
- input.o-input {
50689
- width: 60px;
50690
- height: 30px;
50691
- }
50692
-
50693
- .o-validation-error {
50694
- display: inline-block !important;
50695
- margin-top: 0;
50696
- margin-left: 8px;
50697
- }
50698
- }
50699
- `;
50700
49725
  class GridAddRowsFooter extends owl.Component {
50701
49726
  static template = "o-spreadsheet-GridAddRowsFooter";
50702
49727
  static props = {
@@ -50941,14 +49966,6 @@ class HoveredIconStore extends SpreadsheetStore {
50941
49966
  }
50942
49967
  }
50943
49968
 
50944
- const CURSOR_SVG = /*xml*/ `
50945
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="16"><path d="M6.5.4c1.3-.8 2.9-.1 3.8 1.4l2.9 5.1c.2.4.9 1.6-.4 2.3l-1.6.9 1.8 3.1c.2.4.1 1-.2 1.2l-1.6 1c-.3.1-.9 0-1.1-.4l-1.8-3.1-1.6 1c-.6.4-1.7 0-2.2-.8L0 4.3"/><path fill="#fff" d="M9.1 2a1.4 1.1 60 0 0-1.7-.6L5.5 2.5l.9 1.6-1 .6-.9-1.6-.6.4 1.8 3.1-1.3.7-1.8-3.1-1 .6 3.8 6.6 6.8-3.98M3.9 8.8 10.82 5l.795 1.4-6.81 3.96"/></svg>
50946
- `;
50947
- css /* scss */ `
50948
- .o-paint-format-cursor {
50949
- cursor: url("data:image/svg+xml,${encodeURIComponent(CURSOR_SVG)}"), auto;
50950
- }
50951
- `;
50952
49969
  function useCellHovered(env, gridRef) {
50953
49970
  const delayedHoveredCell = useStore(DelayedHoveredCellStore);
50954
49971
  const hoveredTable = useStore(HoveredTableStore);
@@ -51194,7 +50211,6 @@ class GridPopover extends owl.Component {
51194
50211
  };
51195
50212
  static components = { Popover };
51196
50213
  cellPopovers;
51197
- zIndex = ComponentsImportance.GridPopover;
51198
50214
  setup() {
51199
50215
  this.cellPopovers = useStore(CellPopoverStore);
51200
50216
  }
@@ -51513,58 +50529,6 @@ class AbstractResizer extends owl.Component {
51513
50529
  this.props.onOpenContextMenu(type, ev.clientX, ev.clientY);
51514
50530
  }
51515
50531
  }
51516
- css /* scss */ `
51517
- .o-col-resizer {
51518
- position: absolute;
51519
- top: 0;
51520
- left: ${HEADER_WIDTH}px;
51521
- right: ${SCROLLBAR_WIDTH}px;
51522
- height: ${HEADER_HEIGHT}px;
51523
- width: calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px);
51524
- &.o-dragging {
51525
- cursor: grabbing;
51526
- }
51527
- &.o-grab {
51528
- cursor: grab;
51529
- }
51530
- .dragging-col-line {
51531
- top: ${HEADER_HEIGHT}px;
51532
- position: absolute;
51533
- width: 2px;
51534
- height: 10000px;
51535
- background-color: black;
51536
- }
51537
- .dragging-col-shadow {
51538
- top: ${HEADER_HEIGHT}px;
51539
- position: absolute;
51540
- height: 10000px;
51541
- background-color: black;
51542
- opacity: 0.1;
51543
- }
51544
- .o-handle {
51545
- position: absolute;
51546
- height: ${HEADER_HEIGHT}px;
51547
- width: 4px;
51548
- cursor: e-resize;
51549
- background-color: ${SELECTION_BORDER_COLOR};
51550
- }
51551
- .dragging-resizer {
51552
- top: ${HEADER_HEIGHT}px;
51553
- position: absolute;
51554
- margin-left: 2px;
51555
- width: 1px;
51556
- height: 10000px;
51557
- background-color: ${SELECTION_BORDER_COLOR};
51558
- }
51559
- .o-unhide {
51560
- color: ${ICONS_COLOR};
51561
- }
51562
- .o-unhide:hover {
51563
- z-index: ${ComponentsImportance.Grid + 1};
51564
- background-color: lightgrey;
51565
- }
51566
- }
51567
- `;
51568
50532
  class ColResizer extends AbstractResizer {
51569
50533
  static props = {
51570
50534
  onOpenContextMenu: Function,
@@ -51707,57 +50671,6 @@ class ColResizer extends AbstractResizer {
51707
50671
  return this.env.model.getters.getPaneDivisions(this.sheetId).xSplit > 0;
51708
50672
  }
51709
50673
  }
51710
- css /* scss */ `
51711
- .o-row-resizer {
51712
- position: absolute;
51713
- top: ${HEADER_HEIGHT}px;
51714
- left: 0;
51715
- bottom: ${SCROLLBAR_WIDTH}px;
51716
- width: ${HEADER_WIDTH}px;
51717
- &.o-dragging {
51718
- cursor: grabbing;
51719
- }
51720
- &.o-grab {
51721
- cursor: grab;
51722
- }
51723
- .dragging-row-line {
51724
- left: ${HEADER_WIDTH}px;
51725
- position: absolute;
51726
- width: 10000px;
51727
- height: 2px;
51728
- background-color: black;
51729
- }
51730
- .dragging-row-shadow {
51731
- left: ${HEADER_WIDTH}px;
51732
- position: absolute;
51733
- width: 10000px;
51734
- background-color: black;
51735
- opacity: 0.1;
51736
- }
51737
- .o-handle {
51738
- position: absolute;
51739
- height: 4px;
51740
- width: ${HEADER_WIDTH}px;
51741
- cursor: n-resize;
51742
- background-color: ${SELECTION_BORDER_COLOR};
51743
- }
51744
- .dragging-resizer {
51745
- left: ${HEADER_WIDTH}px;
51746
- position: absolute;
51747
- margin-top: 2px;
51748
- width: 10000px;
51749
- height: 1px;
51750
- background-color: ${SELECTION_BORDER_COLOR};
51751
- }
51752
- .o-unhide {
51753
- color: ${ICONS_COLOR};
51754
- }
51755
- .o-unhide:hover {
51756
- z-index: ${ComponentsImportance.Grid + 1};
51757
- background-color: lightgrey;
51758
- }
51759
- }
51760
- `;
51761
50674
  class RowResizer extends AbstractResizer {
51762
50675
  static props = {
51763
50676
  onOpenContextMenu: Function,
@@ -51898,18 +50811,6 @@ class RowResizer extends AbstractResizer {
51898
50811
  return this.env.model.getters.getPaneDivisions(this.sheetId).ySplit > 0;
51899
50812
  }
51900
50813
  }
51901
- css /* scss */ `
51902
- .o-overlay {
51903
- .all {
51904
- position: absolute;
51905
- top: 0;
51906
- left: 0;
51907
- right: 0;
51908
- width: ${HEADER_WIDTH}px;
51909
- height: ${HEADER_HEIGHT}px;
51910
- }
51911
- }
51912
- `;
51913
50814
  class HeadersOverlay extends owl.Component {
51914
50815
  static props = {
51915
50816
  onOpenContextMenu: Function,
@@ -52864,17 +51765,6 @@ function useWheelHandler(handler) {
52864
51765
  return onMouseWheel;
52865
51766
  }
52866
51767
 
52867
- css /* scss */ `
52868
- .o-border {
52869
- position: absolute;
52870
- &:hover {
52871
- cursor: grab;
52872
- }
52873
- }
52874
- .o-moving {
52875
- cursor: grabbing;
52876
- }
52877
- `;
52878
51768
  class Border extends owl.Component {
52879
51769
  static template = "o-spreadsheet-Border";
52880
51770
  static props = {
@@ -52913,32 +51803,6 @@ class Border extends owl.Component {
52913
51803
  }
52914
51804
 
52915
51805
  const MOBILE_HANDLER_WIDTH = 40;
52916
- css /* scss */ `
52917
- .o-corner {
52918
- position: absolute;
52919
- }
52920
-
52921
- .o-corner-button {
52922
- border: 1px solid white;
52923
- height: ${AUTOFILL_EDGE_LENGTH}px;
52924
- width: ${AUTOFILL_EDGE_LENGTH}px;
52925
- }
52926
- .o-corner-nw,
52927
- .o-corner-se {
52928
- &:hover {
52929
- cursor: nwse-resize;
52930
- }
52931
- }
52932
- .o-corner-ne,
52933
- .o-corner-sw {
52934
- &:hover {
52935
- cursor: nesw-resize;
52936
- }
52937
- }
52938
- .o-resizing {
52939
- cursor: grabbing;
52940
- }
52941
- `;
52942
51806
  class Corner extends owl.Component {
52943
51807
  static template = "o-spreadsheet-Corner";
52944
51808
  static props = {
@@ -53004,11 +51868,6 @@ function orientationToDir(or) {
53004
51868
  return { dirX, dirY };
53005
51869
  }
53006
51870
 
53007
- css /*SCSS*/ `
53008
- .o-highlight {
53009
- z-index: ${ComponentsImportance.Highlight};
53010
- }
53011
- `;
53012
51871
  class Highlight extends owl.Component {
53013
51872
  static template = "o-spreadsheet-Highlight";
53014
51873
  static props = {
@@ -53143,24 +52002,6 @@ let ScrollBar$1 = class ScrollBar {
53143
52002
  }
53144
52003
  };
53145
52004
 
53146
- css /* scss */ `
53147
- .o-scrollbar {
53148
- position: absolute;
53149
- overflow: auto;
53150
- z-index: ${ComponentsImportance.ScrollBar};
53151
- background-color: ${BACKGROUND_GRAY_COLOR};
53152
-
53153
- &.corner {
53154
- box-sizing: content-box;
53155
- right: 0px;
53156
- bottom: 0px;
53157
- height: ${SCROLLBAR_WIDTH}px;
53158
- width: ${SCROLLBAR_WIDTH}px;
53159
- border-top: 1px solid #e2e3e3;
53160
- border-left: 1px solid #e2e3e3;
53161
- }
53162
- }
53163
- `;
53164
52005
  class ScrollBar extends owl.Component {
53165
52006
  static props = {
53166
52007
  width: { type: Number, optional: true },
@@ -53323,24 +52164,6 @@ function useAutofocus({ refName }) {
53323
52164
  }, () => [ref.el]);
53324
52165
  }
53325
52166
 
53326
- css /* scss */ `
53327
- .o-spreadsheet {
53328
- .os-input {
53329
- border-width: 0 0 1px 0;
53330
- border-color: transparent;
53331
- outline: none;
53332
- text-overflow: ellipsis;
53333
- color: ${TEXT_BODY};
53334
- }
53335
- .os-input:hover,
53336
- .os-input.o-input-border {
53337
- border-color: ${GRAY_300};
53338
- }
53339
- .os-input:focus {
53340
- border-color: ${ACTION_COLOR};
53341
- }
53342
- }
53343
- `;
53344
52167
  class TextInput extends owl.Component {
53345
52168
  static template = "o-spreadsheet-TextInput";
53346
52169
  static props = {
@@ -53422,21 +52245,6 @@ class TextInput extends owl.Component {
53422
52245
  }
53423
52246
  }
53424
52247
 
53425
- css /* scss */ `
53426
- .o-menu-item-button {
53427
- display: flex;
53428
- justify-content: center;
53429
- align-items: center;
53430
- margin: 2px 1px;
53431
- padding: 0px 1px;
53432
- border-radius: 2px;
53433
- min-width: 22px;
53434
- }
53435
- .o-disabled {
53436
- opacity: 0.6;
53437
- cursor: default;
53438
- }
53439
- `;
53440
52248
  class ActionButton extends owl.Component {
53441
52249
  static template = "o-spreadsheet-ActionButton";
53442
52250
  static props = {
@@ -53489,41 +52297,6 @@ class ActionButton extends owl.Component {
53489
52297
  }
53490
52298
  }
53491
52299
 
53492
- css /* scss */ `
53493
- .o-color-picker-widget {
53494
- display: flex;
53495
- position: relative;
53496
- align-items: center;
53497
- height: 30px;
53498
-
53499
- .o-color-picker-button-style {
53500
- display: flex;
53501
- justify-content: center;
53502
- align-items: center;
53503
- margin: 2px;
53504
- padding: 3px;
53505
- border-radius: 2px;
53506
- cursor: pointer;
53507
- &:not([disabled]):hover {
53508
- background-color: rgba(0, 0, 0, 0.08);
53509
- }
53510
- }
53511
-
53512
- .o-color-picker-button {
53513
- > span {
53514
- border-bottom: 4px solid;
53515
- height: 20px;
53516
- margin-top: 2px;
53517
- display: block;
53518
- }
53519
-
53520
- &[disabled] {
53521
- pointer-events: none;
53522
- opacity: 0.3;
53523
- }
53524
- }
53525
- }
53526
- `;
53527
52300
  class ColorPickerWidget extends owl.Component {
53528
52301
  static template = "o-spreadsheet-ColorPickerWidget";
53529
52302
  static props = {
@@ -53556,26 +52329,6 @@ class ColorPickerWidget extends owl.Component {
53556
52329
  }
53557
52330
  }
53558
52331
 
53559
- css /* scss */ `
53560
- .o-font-size-editor {
53561
- width: max-content !important;
53562
- height: calc(100% - 4px);
53563
- input.o-font-size {
53564
- outline: none;
53565
- height: 20px;
53566
- width: 31px;
53567
- text-align: center;
53568
- }
53569
- }
53570
- .o-text-options > div {
53571
- cursor: pointer;
53572
- line-height: 26px;
53573
- padding: 3px 12px;
53574
- &:hover {
53575
- background-color: rgba(0, 0, 0, 0.08);
53576
- }
53577
- }
53578
- `;
53579
52332
  class FontSizeEditor extends owl.Component {
53580
52333
  static template = "o-spreadsheet-FontSizeEditor";
53581
52334
  static props = {
@@ -53651,41 +52404,6 @@ class FontSizeEditor extends owl.Component {
53651
52404
  }
53652
52405
  }
53653
52406
 
53654
- css /* scss */ `
53655
- .o-chart-title-designer {
53656
- .o-hoverable-button {
53657
- height: 30px;
53658
- }
53659
- .o-dropdown-content .o-hoverable-button {
53660
- height: fit-content;
53661
- }
53662
-
53663
- .o-divider {
53664
- border-right: 1px solid ${GRAY_300};
53665
- margin: 0px 4px;
53666
- height: 14px;
53667
- }
53668
-
53669
- .o-menu-item-button.active {
53670
- background-color: #e6f4ea;
53671
- color: #188038;
53672
- }
53673
-
53674
- .o-dropdown-content {
53675
- overflow-y: auto;
53676
- overflow-x: hidden;
53677
- padding: 2px;
53678
- z-index: 100;
53679
- box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
53680
-
53681
- .o-dropdown-line {
53682
- > span {
53683
- padding: 4px;
53684
- }
53685
- }
53686
- }
53687
- }
53688
- `;
53689
52407
  class TextStyler extends owl.Component {
53690
52408
  static template = "o-spreadsheet.TextStyler";
53691
52409
  static components = { ColorPickerWidget, ActionButton, FontSizeEditor };
@@ -54513,27 +53231,6 @@ class BarConfigPanel extends GenericChartConfigPanel {
54513
53231
  }
54514
53232
  }
54515
53233
 
54516
- css /* scss */ `
54517
- .o-badge-selection {
54518
- gap: 1px;
54519
- button.o-button {
54520
- border-radius: 0;
54521
- &.selected {
54522
- color: ${GRAY_900};
54523
- border-color: ${ACTION_COLOR};
54524
- background: ${BADGE_SELECTED_COLOR};
54525
- font-weight: 600;
54526
- }
54527
-
54528
- &:first-child {
54529
- border-radius: 4px 0 0 4px;
54530
- }
54531
- &:last-child {
54532
- border-radius: 0 4px 4px 0;
54533
- }
54534
- }
54535
- }
54536
- `;
54537
53234
  class BadgeSelection extends owl.Component {
54538
53235
  static template = "o-spreadsheet.BadgeSelection";
54539
53236
  static props = {
@@ -54543,13 +53240,6 @@ class BadgeSelection extends owl.Component {
54543
53240
  };
54544
53241
  }
54545
53242
 
54546
- css /* scss */ `
54547
- .o-chart-title-designer {
54548
- > span {
54549
- height: 30px;
54550
- }
54551
- }
54552
- `;
54553
53243
  class ChartTitle extends owl.Component {
54554
53244
  static template = "o-spreadsheet.ChartTitle";
54555
53245
  static components = { Section, TextStyler };
@@ -54611,31 +53301,12 @@ class AxisDesignEditor extends owl.Component {
54611
53301
  }
54612
53302
  }
54613
53303
 
54614
- const CIRCLE_SVG = /*xml*/ `
54615
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'>
54616
- <circle r="2" fill="#FFF"/>
54617
- </svg>
54618
- `;
54619
- css /* scss */ `
54620
- .o-radio {
54621
- input {
54622
- appearance: none;
54623
- -webkit-appearance: none;
54624
- -moz-appearance: none;
54625
- width: 14px;
54626
- height: 14px;
54627
- border: 1px solid ${GRAY_300};
54628
- outline: none;
54629
- border-radius: 8px;
54630
-
54631
- &:checked {
54632
- background: url("data:image/svg+xml,${encodeURIComponent(CIRCLE_SVG)}");
54633
- background-color: ${ACTION_COLOR};
54634
- border-color: ${ACTION_COLOR};
54635
- }
54636
- }
54637
- }
54638
- `;
53304
+ // FIXME Encoding version used in css
53305
+ // const CIRCLE_SVG = /*xml*/ `
53306
+ // <svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'>
53307
+ // <circle r="2" fill="#FFF"/>
53308
+ // </svg>
53309
+ // `;
54639
53310
  class RadioSelection extends owl.Component {
54640
53311
  static template = "o-spreadsheet.RadioSelection";
54641
53312
  static props = {
@@ -55132,45 +53803,6 @@ class GaugeChartConfigPanel extends owl.Component {
55132
53803
  }
55133
53804
  }
55134
53805
 
55135
- css /* scss */ `
55136
- .o-gauge-color-set {
55137
- table {
55138
- table-layout: fixed;
55139
- margin-top: 2%;
55140
- display: table;
55141
- text-align: left;
55142
- font-size: 12px;
55143
- line-height: 18px;
55144
- width: 100%;
55145
- font-size: 12px;
55146
- }
55147
-
55148
- td {
55149
- height: 30px;
55150
- padding: 6px 0;
55151
- }
55152
- th.o-gauge-color-set-colorPicker {
55153
- width: 8%;
55154
- }
55155
- th.o-gauge-color-set-text {
55156
- width: 25%;
55157
- }
55158
- th.o-gauge-color-set-operator {
55159
- width: 10%;
55160
- }
55161
- th.o-gauge-color-set-value {
55162
- width: 22%;
55163
- }
55164
- th.o-gauge-color-set-type {
55165
- width: 30%;
55166
- }
55167
- input,
55168
- select {
55169
- width: 100%;
55170
- height: 100%;
55171
- }
55172
- }
55173
- `;
55174
53806
  class GaugeChartDesignPanel extends owl.Component {
55175
53807
  static template = "o-spreadsheet-GaugeChartDesignPanel";
55176
53808
  static components = {
@@ -55636,7 +54268,7 @@ class ScorecardChartDesignPanel extends owl.Component {
55636
54268
  return SCORECARD_CHART_TITLE_FONT_SIZE;
55637
54269
  }
55638
54270
  translate(term) {
55639
- return _t(term);
54271
+ return this.env.model.getters.dynamicTranslate(term);
55640
54272
  }
55641
54273
  setColor(color, colorPickerId) {
55642
54274
  switch (colorPickerId) {
@@ -55976,40 +54608,6 @@ chartSidePanelComponentRegistry
55976
54608
  design: TreeMapChartDesignPanel,
55977
54609
  });
55978
54610
 
55979
- css /* scss */ `
55980
- .o-section .o-input.o-type-selector {
55981
- height: 30px;
55982
- padding-left: 35px;
55983
- padding-top: 5px;
55984
- }
55985
- .o-type-selector-preview {
55986
- left: 5px;
55987
- top: 3px;
55988
- .o-chart-preview {
55989
- width: 24px;
55990
- height: 24px;
55991
- }
55992
- }
55993
-
55994
- .o-popover .o-chart-select-popover {
55995
- background: #fff;
55996
- .o-chart-type-item {
55997
- cursor: pointer;
55998
- padding: 3px 6px;
55999
- margin: 1px 2px;
56000
- &.selected,
56001
- &:hover {
56002
- border: 1px solid ${ACTION_COLOR};
56003
- background: ${BADGE_SELECTED_COLOR};
56004
- padding: 2px 5px;
56005
- }
56006
- .o-chart-preview {
56007
- width: 48px;
56008
- height: 48px;
56009
- }
56010
- }
56011
- }
56012
- `;
56013
54611
  class ChartTypePicker extends owl.Component {
56014
54612
  static template = "o-spreadsheet-ChartTypePicker";
56015
54613
  static components = { Section, Popover };
@@ -56112,38 +54710,6 @@ class MainChartPanelStore extends SpreadsheetStore {
56112
54710
  }
56113
54711
  }
56114
54712
 
56115
- css /* scss */ `
56116
- .o-chart {
56117
- .o-panel {
56118
- display: flex;
56119
- .o-panel-element {
56120
- flex: 1 0 auto;
56121
- padding: 8px 0px;
56122
- text-align: center;
56123
- cursor: pointer;
56124
- border-right: 1px solid ${GRAY_300};
56125
-
56126
- &.inactive {
56127
- color: ${TEXT_BODY};
56128
- background-color: ${GRAY_100};
56129
- border-bottom: 1px solid ${GRAY_300};
56130
- }
56131
-
56132
- &:not(.inactive) {
56133
- color: ${TEXT_HEADING};
56134
- border-bottom: 1px solid #fff;
56135
- }
56136
-
56137
- .fa {
56138
- margin-right: 4px;
56139
- }
56140
- }
56141
- .o-panel-element:last-child {
56142
- border-right: none;
56143
- }
56144
- }
56145
- }
56146
- `;
56147
54713
  class ChartPanel extends owl.Component {
56148
54714
  static template = "o-spreadsheet-ChartPanel";
56149
54715
  static components = { Section, ChartTypePicker };
@@ -56232,26 +54798,6 @@ class ChartPanel extends owl.Component {
56232
54798
  }
56233
54799
  }
56234
54800
 
56235
- css /* scss */ `
56236
- .o-icon-picker {
56237
- position: absolute;
56238
- z-index: ${ComponentsImportance.IconPicker};
56239
- box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
56240
- background-color: white;
56241
- padding: 2px 1px;
56242
- }
56243
- .o-cf-icon-line {
56244
- display: flex;
56245
- padding: 0 6px;
56246
- }
56247
- .o-icon-picker-item {
56248
- cursor: pointer;
56249
- &:hover {
56250
- background-color: ${BADGE_SELECTED_COLOR};
56251
- outline: ${ACTION_COLOR} solid 1px;
56252
- }
56253
- }
56254
- `;
56255
54801
  class IconPicker extends owl.Component {
56256
54802
  static template = "o-spreadsheet-IconPicker";
56257
54803
  static props = {
@@ -56289,77 +54835,6 @@ function useHighlights(highlightProvider) {
56289
54835
  }, () => [highlightProvider.highlights]);
56290
54836
  }
56291
54837
 
56292
- css /* scss */ `
56293
- .o-cf-preview {
56294
- &.o-cf-cursor-ptr {
56295
- cursor: pointer;
56296
- }
56297
-
56298
- border-bottom: 1px solid ${GRAY_300};
56299
- height: 80px;
56300
- padding: 10px;
56301
- position: relative;
56302
- cursor: pointer;
56303
- &:hover,
56304
- &.o-cf-dragging {
56305
- background-color: ${GRAY_200};
56306
- }
56307
-
56308
- &:not(:hover) .o-cf-delete-button {
56309
- display: none;
56310
- }
56311
- .o-cf-preview-icon {
56312
- border: 1px solid ${GRAY_300};
56313
- background-color: #fff;
56314
- position: absolute;
56315
- height: 50px;
56316
- width: 50px;
56317
- .o-icon {
56318
- width: ${CF_ICON_EDGE_LENGTH}px;
56319
- height: ${CF_ICON_EDGE_LENGTH}px;
56320
- }
56321
- }
56322
- .o-cf-preview-description {
56323
- left: 65px;
56324
- margin-bottom: auto;
56325
- margin-right: 8px;
56326
- margin-top: auto;
56327
- position: relative;
56328
- width: 142px;
56329
- .o-cf-preview-description-rule {
56330
- margin-bottom: 4px;
56331
- max-height: 2.8em;
56332
- line-height: 1.4em;
56333
- }
56334
- .o-cf-preview-range {
56335
- font-size: 12px;
56336
- }
56337
- }
56338
- .o-cf-delete {
56339
- left: 90%;
56340
- top: 39%;
56341
- position: absolute;
56342
- }
56343
- &:not(:hover):not(.o-cf-dragging) .o-cf-drag-handle {
56344
- display: none !important;
56345
- }
56346
- .o-cf-drag-handle {
56347
- left: -8px;
56348
- cursor: move;
56349
- .o-icon {
56350
- width: 6px;
56351
- height: 30px;
56352
- }
56353
- }
56354
-
56355
- .o-icon.arrow-down {
56356
- color: #e06666;
56357
- }
56358
- .o-icon.arrow-up {
56359
- color: #6aa84f;
56360
- }
56361
- }
56362
- `;
56363
54838
  class ConditionalFormatPreview extends owl.Component {
56364
54839
  static template = "o-spreadsheet-ConditionalFormatPreview";
56365
54840
  icons = ICONS;
@@ -56478,95 +54953,6 @@ class ConditionalFormatPreviewList extends owl.Component {
56478
54953
  }
56479
54954
  }
56480
54955
 
56481
- css /* scss */ `
56482
- .o-cf-ruleEditor {
56483
- .o-cf-preview-display {
56484
- border: 1px solid ${GRAY_300};
56485
- padding: 10px;
56486
- }
56487
-
56488
- .o-cf-cell-is-rule {
56489
- .o-divider {
56490
- border-right: 1px solid ${GRAY_300};
56491
- margin: 4px 6px;
56492
- }
56493
- }
56494
- .o-cf-color-scale-editor {
56495
- .o-threshold {
56496
- .o-select-with-input {
56497
- max-width: 150px;
56498
- }
56499
- .o-threshold-value {
56500
- flex-grow: 1;
56501
- flex-basis: 60%;
56502
- min-width: 0px; /* input overflows in Firefox otherwise */
56503
- }
56504
- .o-threshold-value input:disabled {
56505
- background-color: #edebed;
56506
- }
56507
- }
56508
- }
56509
- .o-cf-iconset-rule {
56510
- .o-cf-clickable-icon {
56511
- border: 1px solid ${GRAY_200};
56512
- border-radius: 4px;
56513
- cursor: pointer;
56514
- &:hover {
56515
- border-color: ${ACTION_COLOR};
56516
- background-color: ${BADGE_SELECTED_COLOR};
56517
- }
56518
- .o-icon {
56519
- width: ${CF_ICON_EDGE_LENGTH}px;
56520
- height: ${CF_ICON_EDGE_LENGTH}px;
56521
- }
56522
- }
56523
- .o-cf-iconsets {
56524
- gap: 11px;
56525
- .o-cf-iconset {
56526
- padding: 7px 8px;
56527
- width: 95px;
56528
- .o-icon {
56529
- margin: 0 3px;
56530
- }
56531
- svg {
56532
- vertical-align: baseline;
56533
- }
56534
- }
56535
- }
56536
- .o-inflection {
56537
- .o-cf-icon-button {
56538
- padding: 4px 10px;
56539
- }
56540
- table {
56541
- font-size: 13px;
56542
- td {
56543
- padding: 6px 0;
56544
- }
56545
-
56546
- th.o-cf-iconset-icons {
56547
- width: 25px;
56548
- }
56549
- th.o-cf-iconset-text {
56550
- width: 82px;
56551
- }
56552
- th.o-cf-iconset-operator {
56553
- width: 20px;
56554
- }
56555
- .o-cf-iconset-type {
56556
- min-width: 80px;
56557
- }
56558
- }
56559
- }
56560
- }
56561
-
56562
- .o-icon.arrow-down {
56563
- color: #e06666;
56564
- }
56565
- .o-icon.arrow-up {
56566
- color: #6aa84f;
56567
- }
56568
- }
56569
- `;
56570
54956
  class ConditionalFormattingEditor extends owl.Component {
56571
54957
  static template = "o-spreadsheet-ConditionalFormattingEditor";
56572
54958
  static props = {
@@ -57096,25 +55482,6 @@ class ConditionalFormattingPanel extends owl.Component {
57096
55482
  */
57097
55483
  const currenciesRegistry = new Registry();
57098
55484
 
57099
- css /* scss */ `
57100
- .o-custom-currency {
57101
- .o-format-proposals {
57102
- color: black;
57103
- }
57104
-
57105
- .o-format-examples {
57106
- background: #f9fafb;
57107
- padding: 8px;
57108
- border-radius: 4px;
57109
- border: 1px solid #d8dadd;
57110
- color: #374151;
57111
- }
57112
-
57113
- table {
57114
- table-layout: fixed;
57115
- }
57116
- }
57117
- `;
57118
55485
  class CustomCurrencyPanel extends owl.Component {
57119
55486
  static template = "o-spreadsheet-CustomCurrencyPanel";
57120
55487
  static components = { Section, Checkbox };
@@ -57188,7 +55555,7 @@ class CustomCurrencyPanel extends owl.Component {
57188
55555
  });
57189
55556
  }
57190
55557
  const emptyCurrency = {
57191
- name: _t(CustomCurrencyTerms.Custom),
55558
+ name: CustomCurrencyTerms.Custom,
57192
55559
  code: "",
57193
55560
  symbol: "",
57194
55561
  decimalPlaces: 2,
@@ -57347,31 +55714,6 @@ class DataValidationEditor extends owl.Component {
57347
55714
  }
57348
55715
  }
57349
55716
 
57350
- css /* scss */ `
57351
- .o-sidePanel {
57352
- .o-dv-preview {
57353
- height: 70px;
57354
- cursor: pointer;
57355
- border-bottom: 1px solid ${FIGURE_BORDER_COLOR};
57356
-
57357
- .o-dv-container {
57358
- min-width: 0; /* otherwise flex won't shrink correctly */
57359
- }
57360
-
57361
- .o-dv-preview-description {
57362
- font-size: 13px;
57363
- }
57364
-
57365
- &:hover {
57366
- background-color: rgba(0, 0, 0, 0.08);
57367
- }
57368
-
57369
- &:not(:hover) .o-dv-preview-delete {
57370
- display: none !important;
57371
- }
57372
- }
57373
- }
57374
- `;
57375
55717
  class DataValidationPreview extends owl.Component {
57376
55718
  static template = "o-spreadsheet-DataValidationPreview";
57377
55719
  static props = {
@@ -57820,38 +56162,6 @@ class FindAndReplaceStore extends SpreadsheetStore {
57820
56162
  }
57821
56163
  }
57822
56164
 
57823
- css /* scss */ `
57824
- .o-find-and-replace {
57825
- outline: none;
57826
- height: 100%;
57827
- .o-input-search-container {
57828
- display: flex;
57829
- .o-input-with-count {
57830
- flex-grow: 1;
57831
- width: auto;
57832
- }
57833
- .o-input-without-count {
57834
- width: 100%;
57835
- }
57836
- .o-input-count {
57837
- width: fit-content;
57838
- padding: 4px 0 4px 4px;
57839
- white-space: nowrap;
57840
- }
57841
- }
57842
-
57843
- .o-result-buttons {
57844
- .o-button {
57845
- height: 19px;
57846
- width: 19px;
57847
- .o-icon {
57848
- height: 14px;
57849
- width: 14px;
57850
- }
57851
- }
57852
- }
57853
- }
57854
- `;
57855
56165
  class FindAndReplacePanel extends owl.Component {
57856
56166
  static template = "o-spreadsheet-FindAndReplacePanel";
57857
56167
  static components = { SelectionInput, Section, Checkbox, ValidationMessages };
@@ -57962,22 +56272,6 @@ class FindAndReplacePanel extends owl.Component {
57962
56272
  }
57963
56273
  }
57964
56274
 
57965
- css /* scss */ `
57966
- .o-more-formats-panel {
57967
- .format-preview {
57968
- height: 49px;
57969
- background-color: white;
57970
- cursor: pointer;
57971
-
57972
- &:hover {
57973
- background-color: rgba(0, 0, 0, 0.08);
57974
- }
57975
- }
57976
- .check-icon {
57977
- width: 24px;
57978
- }
57979
- }
57980
- `;
57981
56275
  const DATE_FORMAT_ACTIONS = createActions([
57982
56276
  formatNumberFullDateTime,
57983
56277
  formatNumberISODate,
@@ -58135,21 +56429,6 @@ class PivotMeasureDisplayPanelStore extends SpreadsheetStore {
58135
56429
  }
58136
56430
  }
58137
56431
 
58138
- css /* scss */ `
58139
- .o-sidePanel {
58140
- .o-pivot-measure-display-field,
58141
- .o-pivot-measure-display-value {
58142
- border: solid 1px ${GRAY_300};
58143
- border-radius: 3px;
58144
- }
58145
-
58146
- .o-pivot-measure-display-description {
58147
- white-space: pre-wrap;
58148
- color: dimgray;
58149
- border-left: 2px solid ${GRAY_300};
58150
- }
58151
- }
58152
- `;
58153
56432
  class PivotMeasureDisplayPanel extends owl.Component {
58154
56433
  static template = "o-spreadsheet-PivotMeasureDisplayPanel";
58155
56434
  static props = {
@@ -58208,11 +56487,6 @@ function getVisiblePivotCellPositions(getters, pivotId) {
58208
56487
  return positions;
58209
56488
  }
58210
56489
 
58211
- css /* scss */ `
58212
- .pivot-defer-update {
58213
- min-height: 40px;
58214
- }
58215
- `;
58216
56490
  class PivotDeferUpdate extends owl.Component {
58217
56491
  static template = "o-spreadsheet-PivotDeferUpdate";
58218
56492
  static props = {
@@ -58301,25 +56575,6 @@ function getHtmlContentFromPattern(pattern, value, highlightColor, className) {
58301
56575
  return pendingHtmlContent.filter((content) => content.value);
58302
56576
  }
58303
56577
 
58304
- css /* scss */ `
58305
- input.pivot-dimension-search-field:focus {
58306
- outline: none;
58307
- }
58308
- .pivot-dimension-search-field-icon svg {
58309
- width: 13px;
58310
- height: 13px;
58311
- }
58312
- .pivot-dimension-search {
58313
- background-color: white;
58314
- }
58315
- .add-dimension.o-button {
58316
- padding: 2px 7px;
58317
- font-weight: 400;
58318
- font-size: 12px;
58319
- flex-grow: 0;
58320
- height: inherit;
58321
- }
58322
- `;
58323
56578
  class AddDimensionButton extends owl.Component {
58324
56579
  static template = "o-spreadsheet-AddDimensionButton";
58325
56580
  static components = { Popover, TextValueProvider };
@@ -58413,35 +56668,6 @@ class AddDimensionButton extends owl.Component {
58413
56668
  }
58414
56669
  }
58415
56670
 
58416
- // don't use bg-white since it's flipped to dark in dark mode and we don't support dark mode
58417
- css /* scss */ `
58418
- .pivot-dimension {
58419
- background-color: white;
58420
- border: 1px solid ${GRAY_300};
58421
- border-radius: 4px;
58422
-
58423
- select.o-input {
58424
- height: inherit;
58425
- }
58426
-
58427
- select > option {
58428
- background-color: white;
58429
- }
58430
-
58431
- .pivot-dim-operator-label {
58432
- min-width: 120px;
58433
- }
58434
-
58435
- &.pivot-dimension-invalid {
58436
- background-color: #ffdddd;
58437
- border-color: red !important;
58438
- select,
58439
- input {
58440
- background-color: #ffdddd;
58441
- }
58442
- }
58443
- }
58444
- `;
58445
56671
  class PivotDimension extends owl.Component {
58446
56672
  static template = "o-spreadsheet-PivotDimension";
58447
56673
  static props = {
@@ -58593,19 +56819,6 @@ class PivotMeasureEditor extends owl.Component {
58593
56819
  }
58594
56820
  }
58595
56821
 
58596
- css /* scss */ `
58597
- .o-pivot-sort {
58598
- .o-sort-card {
58599
- width: fit-content;
58600
- background-color: ${GRAY_100};
58601
- border: 1px solid ${GRAY_300};
58602
-
58603
- .o-sort-value {
58604
- color: ${PRIMARY_BUTTON_BG};
58605
- }
58606
- }
58607
- }
58608
- `;
58609
56822
  class PivotSortSection extends owl.Component {
58610
56823
  static template = "o-spreadsheet-PivotSortSection";
58611
56824
  static components = {
@@ -58651,11 +56864,6 @@ class PivotSortSection extends owl.Component {
58651
56864
  }
58652
56865
  }
58653
56866
 
58654
- css /* scss */ `
58655
- .add-calculated-measure {
58656
- cursor: pointer;
58657
- }
58658
- `;
58659
56867
  class PivotLayoutConfigurator extends owl.Component {
58660
56868
  static template = "o-spreadsheet-PivotLayoutConfigurator";
58661
56869
  static components = {
@@ -58848,12 +57056,13 @@ class PivotLayoutConfigurator extends owl.Component {
58848
57056
  addCalculatedMeasure() {
58849
57057
  const { measures } = this.props.definition;
58850
57058
  const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
57059
+ const aggregator = "sum";
58851
57060
  this.props.onDimensionsUpdated({
58852
57061
  measures: measures.concat([
58853
57062
  {
58854
- id: this.getMeasureId(measureName),
57063
+ id: this.getMeasureId(measureName, aggregator),
58855
57064
  fieldName: measureName,
58856
- aggregator: "sum",
57065
+ aggregator,
58857
57066
  computedBy: {
58858
57067
  sheetId: this.env.model.getters.getActiveSheetId(),
58859
57068
  formula: "=0",
@@ -59469,11 +57678,6 @@ class PivotSidePanel extends owl.Component {
59469
57678
  }
59470
57679
  }
59471
57680
 
59472
- css /* scss */ `
59473
- .o-checkbox-selection {
59474
- max-height: 300px;
59475
- }
59476
- `;
59477
57681
  class RemoveDuplicatesPanel extends owl.Component {
59478
57682
  static template = "o-spreadsheet-RemoveDuplicatesPanel";
59479
57683
  static components = { ValidationMessages, Section, Checkbox };
@@ -59560,12 +57764,6 @@ class RemoveDuplicatesPanel extends owl.Component {
59560
57764
  }
59561
57765
  }
59562
57766
 
59563
- css /* scss */ `
59564
- .o-locale-preview {
59565
- border: 1px solid ${GRAY_300};
59566
- background-color: ${GRAY_100};
59567
- }
59568
- `;
59569
57767
  class SettingsPanel extends owl.Component {
59570
57768
  static template = "o-spreadsheet-SettingsPanel";
59571
57769
  static components = { Section, ValidationMessages, BadgeSelection };
@@ -59839,34 +58037,6 @@ function drawTexts(ctx, tableStyle, colWidth, rowHeight) {
59839
58037
  ctx.restore();
59840
58038
  }
59841
58039
 
59842
- css /* scss */ `
59843
- .o-table-style-list-item {
59844
- border: 1px solid transparent;
59845
- border-radius: 4px;
59846
- &.selected {
59847
- border: 1px solid ${ACTION_COLOR};
59848
- background: ${BADGE_SELECTED_COLOR};
59849
- }
59850
-
59851
- &:hover {
59852
- background: #ddd;
59853
- .o-table-style-edit-button {
59854
- display: block !important;
59855
- right: 0;
59856
- top: 0;
59857
- background: #fff;
59858
- cursor: pointer;
59859
- border: 1px solid #ddd;
59860
- padding: 1px 1px 1px 2px;
59861
- .o-icon {
59862
- font-size: 12px;
59863
- width: 12px;
59864
- height: 12px;
59865
- }
59866
- }
59867
- }
59868
- }
59869
- `;
59870
58040
  class TableStylePreview extends owl.Component {
59871
58041
  static template = "o-spreadsheet-TableStylePreview";
59872
58042
  static components = { MenuPopover };
@@ -59927,52 +58097,6 @@ class TableStylePreview extends owl.Component {
59927
58097
  }
59928
58098
  }
59929
58099
 
59930
- css /* scss */ `
59931
- .o-table-style-popover {
59932
- /* 7 tables preview + padding by line */
59933
- width: calc((66px + 4px * 2) * 7 + 1.5rem * 2);
59934
- background: #fff;
59935
- font-size: 14px;
59936
- user-select: none;
59937
-
59938
- .o-notebook {
59939
- border-bottom: 1px solid ${GRAY_300};
59940
-
59941
- .o-notebook-tab {
59942
- padding: 5px 15px;
59943
- border: 1px solid ${GRAY_300};
59944
- margin-bottom: -1px;
59945
- margin-left: -1px;
59946
- color: ${TEXT_BODY};
59947
- cursor: pointer;
59948
- transition: color 0.2s, border-color 0.2s;
59949
-
59950
- &.selected {
59951
- border-bottom-color: #fff;
59952
- border-top-color: ${PRIMARY_BUTTON_BG};
59953
- color: ${TEXT_HEADING};
59954
- }
59955
- }
59956
- }
59957
-
59958
- .o-table-style-list-item {
59959
- padding: 3px;
59960
- }
59961
-
59962
- .o-table-style-popover-preview {
59963
- width: 66px;
59964
- height: 51px;
59965
- }
59966
-
59967
- .o-new-table-style {
59968
- font-size: 36px;
59969
- color: #666;
59970
- &:hover {
59971
- background: #f5f5f5;
59972
- }
59973
- }
59974
- }
59975
- `;
59976
58100
  class TableStylesPopover extends owl.Component {
59977
58101
  static template = "o-spreadsheet-TableStylesPopover";
59978
58102
  static components = { Popover, TableStylePreview };
@@ -60012,31 +58136,6 @@ class TableStylesPopover extends owl.Component {
60012
58136
  }
60013
58137
  }
60014
58138
 
60015
- css /* scss */ `
60016
- .o-table-style-picker {
60017
- border: 1px solid ${GRAY_300};
60018
- border-radius: 3px;
60019
-
60020
- .o-table-style-picker-arrow {
60021
- border-left: 1px solid ${GRAY_300};
60022
-
60023
- &:hover {
60024
- background: #f5f5f5;
60025
- cursor: pointer;
60026
- }
60027
- }
60028
-
60029
- .o-table-style-list-item {
60030
- padding: 5px 6px;
60031
- margin: 5px 2px;
60032
-
60033
- .o-table-style-picker-preview {
60034
- width: 51px;
60035
- height: 36px;
60036
- }
60037
- }
60038
- }
60039
- `;
60040
58139
  class TableStylePicker extends owl.Component {
60041
58140
  static template = "o-spreadsheet-TableStylePicker";
60042
58141
  static components = { TableStylesPopover, TableStylePreview };
@@ -60080,19 +58179,6 @@ class TableStylePicker extends owl.Component {
60080
58179
  }
60081
58180
  }
60082
58181
 
60083
- css /* scss */ `
60084
- .o-table-panel {
60085
- input.o-table-n-of-headers {
60086
- width: 14px;
60087
- text-align: center;
60088
- }
60089
-
60090
- .o-info-icon {
60091
- width: 14px;
60092
- height: 14px;
60093
- }
60094
- }
60095
- `;
60096
58182
  class TablePanel extends owl.Component {
60097
58183
  static template = "o-spreadsheet-TablePanel";
60098
58184
  static components = { TableStylePicker, SelectionInput, ValidationMessages, Checkbox, Section };
@@ -60244,19 +58330,6 @@ class TablePanel extends owl.Component {
60244
58330
  }
60245
58331
  }
60246
58332
 
60247
- css /* scss */ `
60248
- .o-table-style-editor-panel {
60249
- .o-table-style-list-item {
60250
- margin: 2px 7px;
60251
- padding: 6px 9px;
60252
-
60253
- .o-table-style-edit-template-preview {
60254
- width: 71px;
60255
- height: 51px;
60256
- }
60257
- }
60258
- }
60259
- `;
60260
58333
  const DEFAULT_TABLE_STYLE_COLOR = "#3C78D8";
60261
58334
  class TableStyleEditorPanel extends owl.Component {
60262
58335
  static template = "o-spreadsheet-TableStyleEditorPanel";
@@ -60691,15 +58764,6 @@ class SidePanelStore extends SpreadsheetStore {
60691
58764
 
60692
58765
  const SIZE = 3;
60693
58766
  const COLOR = "#777";
60694
- css /* scss */ `
60695
- .o-table-resizer {
60696
- width: ${SIZE * 2}px;
60697
- height: ${SIZE * 2}px;
60698
- border-bottom: ${SIZE}px solid ${COLOR};
60699
- border-right: ${SIZE}px solid ${COLOR};
60700
- cursor: nwse-resize;
60701
- }
60702
- `;
60703
58767
  class TableResizer extends owl.Component {
60704
58768
  static template = "o-spreadsheet-TableResizer";
60705
58769
  static props = { table: Object };
@@ -61445,14 +59509,16 @@ class ClickableCellSortIcon extends owl.Component {
61445
59509
  "background-color": this.getBackgroundColor(cellStyle),
61446
59510
  });
61447
59511
  }
61448
- get icon() {
61449
- switch (this.props.sortDirection) {
61450
- case "asc":
61451
- return "fa-sort-asc";
61452
- case "desc":
61453
- return "fa-sort-desc";
59512
+ get verticalJustifyClass() {
59513
+ const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
59514
+ switch (cellStyle.verticalAlign) {
59515
+ case "top":
59516
+ return "justify-content-start";
59517
+ case "middle":
59518
+ return "justify-content-center";
59519
+ case "bottom":
61454
59520
  default:
61455
- return "fa-sort";
59521
+ return "justify-content-end";
61456
59522
  }
61457
59523
  }
61458
59524
  getBackgroundColor(cellStyle) {
@@ -61514,43 +59580,6 @@ class FullScreenChart extends owl.Component {
61514
59580
  }
61515
59581
  }
61516
59582
 
61517
- css /* scss */ `
61518
- .o_pivot_html_renderer {
61519
- width: 100%;
61520
- border-collapse: collapse;
61521
-
61522
- &:hover {
61523
- cursor: pointer;
61524
- }
61525
-
61526
- td,
61527
- th {
61528
- border: 1px solid #dee2e6;
61529
- background-color: #fff;
61530
- padding: 0.3rem;
61531
- white-space: nowrap;
61532
-
61533
- &:hover {
61534
- filter: brightness(0.9);
61535
- }
61536
- }
61537
-
61538
- td {
61539
- text-align: right;
61540
- }
61541
-
61542
- th {
61543
- background-color: #f5f5f5;
61544
- font-weight: bold;
61545
- color: black;
61546
- }
61547
-
61548
- .o_missing_value {
61549
- color: #46646d;
61550
- background: #e7f2f6;
61551
- }
61552
- }
61553
- `;
61554
59583
  class PivotHTMLRenderer extends owl.Component {
61555
59584
  static template = "o_spreadsheet.PivotHTMLRenderer";
61556
59585
  static components = { Checkbox };
@@ -70653,6 +68682,30 @@ function togglePivotCollapse(position, env) {
70653
68682
  pivot: { ...definition, collapsedDomains: newDomains },
70654
68683
  });
70655
68684
  }
68685
+ iconsOnCellRegistry.add("pivot_dashboard_sorting", (getters, position) => {
68686
+ if (!getters.isDashboard()) {
68687
+ return undefined;
68688
+ }
68689
+ const pivotCell = getters.getPivotCellFromPosition(position);
68690
+ if (pivotCell.type !== "MEASURE_HEADER") {
68691
+ return undefined;
68692
+ }
68693
+ const sortDirection = getters.getPivotCellSortDirection(position);
68694
+ if (sortDirection !== "asc" && sortDirection !== "desc") {
68695
+ return undefined;
68696
+ }
68697
+ const cellStyle = getters.getCellComputedStyle(position);
68698
+ return {
68699
+ type: `pivot_dashboard_sorting_${sortDirection}`,
68700
+ priority: 5,
68701
+ horizontalAlign: "right",
68702
+ size: GRID_ICON_EDGE_LENGTH,
68703
+ margin: GRID_ICON_MARGIN,
68704
+ svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
68705
+ position,
68706
+ onClick: undefined, // click is managed by ClickableCellSortIcon
68707
+ };
68708
+ });
70656
68709
 
70657
68710
  class CellIconPlugin extends CoreViewPlugin {
70658
68711
  static getters = ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
@@ -71132,7 +69185,7 @@ function withPivotPresentationLayer (PivotClass) {
71132
69185
  return { value: 0 };
71133
69186
  }
71134
69187
  const { columns, rows } = super.definition;
71135
- if (columns.length + rows.length !== domain.length) {
69188
+ if (measure.aggregator && columns.length + rows.length !== domain.length) {
71136
69189
  const values = this.getValuesToAggregate(measure, domain);
71137
69190
  const aggregator = AGGREGATORS_FN[measure.aggregator];
71138
69191
  if (!aggregator) {
@@ -71151,11 +69204,17 @@ function withPivotPresentationLayer (PivotClass) {
71151
69204
  if (columns.find((col) => col.nameWithGranularity === symbolName)) {
71152
69205
  const { colDomain } = domainToColRowDomain(this, domain);
71153
69206
  const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
69207
+ if (symbolIndex === -1) {
69208
+ return new NotAvailableError();
69209
+ }
71154
69210
  return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
71155
69211
  }
71156
69212
  if (rows.find((row) => row.nameWithGranularity === symbolName)) {
71157
69213
  const { rowDomain } = domainToColRowDomain(this, domain);
71158
69214
  const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
69215
+ if (symbolIndex === -1) {
69216
+ return new NotAvailableError();
69217
+ }
71159
69218
  return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
71160
69219
  }
71161
69220
  return this.getPivotCellValueAndFormat(symbolName, domain);
@@ -75549,6 +73608,21 @@ class DataValidationInsertionPlugin extends UIPlugin {
75549
73608
  }
75550
73609
  }
75551
73610
 
73611
+ /**
73612
+ * This plugin provides dynamic translation getter. In o-spreadsheet, it has
73613
+ * no implementation, but this plugin can be replaced by another one to provide
73614
+ * a real implementation.
73615
+ *
73616
+ * For example, in Odoo, the plugin is replaced by a plugin that used the
73617
+ * module namespace to dynamically translate terms.
73618
+ */
73619
+ class DynamicTranslate extends UIPlugin {
73620
+ static getters = ["dynamicTranslate"];
73621
+ dynamicTranslate(term) {
73622
+ return term;
73623
+ }
73624
+ }
73625
+
75552
73626
  const genericRepeatsTransforms = [
75553
73627
  repeatSheetDependantCommand,
75554
73628
  repeatTargetDependantCommand,
@@ -77519,13 +75593,10 @@ class GridSelectionPlugin extends UIPlugin {
77519
75593
  const deltaCol = isBasedBefore && isCol ? thickness : 0;
77520
75594
  const deltaRow = isBasedBefore && !isCol ? thickness : 0;
77521
75595
  const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
77522
- const originalSize = Object.fromEntries(toRemove.map((element) => {
77523
- const size = isCol
77524
- ? this.getters.getColSize(cmd.sheetId, element)
77525
- : this.getters.getUserRowSize(cmd.sheetId, element);
77526
- const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
77527
- return [element, isDefaultCol ? undefined : size];
77528
- }));
75596
+ const originalSize = {};
75597
+ for (const element of toRemove) {
75598
+ originalSize[element] = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
75599
+ }
77529
75600
  const target = [
77530
75601
  {
77531
75602
  left: isCol ? start + deltaCol : 0,
@@ -77569,11 +75640,11 @@ class GridSelectionPlugin extends UIPlugin {
77569
75640
  for (const element of toRemove) {
77570
75641
  const size = originalSize[element];
77571
75642
  const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
77572
- if (size && size !== currentSize) {
75643
+ if (size !== currentSize) {
77573
75644
  resizingGroups[size] ??= [];
77574
75645
  resizingGroups[size].push(currentIndex);
77575
- currentIndex += 1;
77576
75646
  }
75647
+ currentIndex += 1;
77577
75648
  }
77578
75649
  for (const size in resizingGroups) {
77579
75650
  this.dispatch("RESIZE_COLUMNS_ROWS", {
@@ -79180,6 +77251,7 @@ const featurePluginRegistry = new Registry()
79180
77251
  .add("table_ui_resize", TableResizeUI)
79181
77252
  .add("datavalidation_insert", DataValidationInsertionPlugin)
79182
77253
  .add("checkbox_toggle", CheckboxTogglePlugin)
77254
+ .add("dynamic_translate", DynamicTranslate)
79183
77255
  .add("geo_features", GeoFeaturePlugin);
79184
77256
  // Plugins which have a state, but which should not be shared in collaborative
79185
77257
  const statefulUIPluginRegistry = new Registry()
@@ -80491,11 +78563,6 @@ const RIPPLE_KEY_FRAMES = [
80491
78563
  { transform: "scale(0.8)", offset: 0.33 },
80492
78564
  { opacity: "0", transform: "scale(1)", offset: 1 },
80493
78565
  ];
80494
- css /* scss */ `
80495
- .o-ripple {
80496
- z-index: 1;
80497
- }
80498
- `;
80499
78566
  class RippleEffect extends owl.Component {
80500
78567
  static template = "o-spreadsheet-RippleEffect";
80501
78568
  static props = {
@@ -80667,59 +78734,6 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
80667
78734
  }
80668
78735
  }
80669
78736
 
80670
- css /* scss */ `
80671
- .o-sheet {
80672
- padding: 0 15px;
80673
- padding-right: 10px;
80674
- height: ${DESKTOP_BOTTOMBAR_HEIGHT}px;
80675
- border-left: 1px solid #c1c1c1;
80676
- border-right: 1px solid #c1c1c1;
80677
- margin-left: -1px;
80678
- cursor: pointer;
80679
- &:hover {
80680
- background-color: rgba(0, 0, 0, 0.08);
80681
- }
80682
-
80683
- &.active {
80684
- color: ${ACTION_COLOR};
80685
- background-color: #ffffff;
80686
- box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15);
80687
- }
80688
-
80689
- .o-sheet-icon {
80690
- z-index: 1;
80691
-
80692
- &:hover {
80693
- background-color: rgba(0, 0, 0, 0.08);
80694
- }
80695
- }
80696
-
80697
- .o-sheet-name {
80698
- outline: none;
80699
- padding: 2px 4px;
80700
-
80701
- &.o-sheet-name-editable {
80702
- border-radius: 2px;
80703
- border: 2px solid mediumblue;
80704
- /* negative margins so nothing moves when the border is added */
80705
- margin-left: -2px;
80706
- margin-right: -2px;
80707
- }
80708
- }
80709
-
80710
- .o-sheet-color {
80711
- bottom: 0;
80712
- left: 0;
80713
- height: 6px;
80714
- z-index: 1;
80715
- width: calc(100% - 1px);
80716
- }
80717
- }
80718
-
80719
- .o-spreadshet-mobile .o-sheet {
80720
- height: ${MOBILE_BOTTOMBAR_HEIGHT}px;
80721
- }
80722
- `;
80723
78737
  class BottomBarSheet extends owl.Component {
80724
78738
  static template = "o-spreadsheet-BottomBarSheet";
80725
78739
  static props = {
@@ -80999,20 +79013,6 @@ class AggregateStatisticsStore extends SpreadsheetStore {
80999
79013
  }
81000
79014
  }
81001
79015
 
81002
- // -----------------------------------------------------------------------------
81003
- // SpreadSheet
81004
- // -----------------------------------------------------------------------------
81005
- css /* scss */ `
81006
- .o-selection-statistic {
81007
- margin-right: 20px;
81008
- padding: 4px 4px 4px 8px;
81009
- color: #333;
81010
- cursor: pointer;
81011
- &:hover {
81012
- background-color: rgba(0, 0, 0, 0.08) !important;
81013
- }
81014
- }
81015
- `;
81016
79016
  class BottomBarStatistic extends owl.Component {
81017
79017
  static template = "o-spreadsheet-BottomBarStatistic";
81018
79018
  static props = {
@@ -81069,77 +79069,6 @@ class BottomBarStatistic extends owl.Component {
81069
79069
  // SpreadSheet
81070
79070
  // -----------------------------------------------------------------------------
81071
79071
  const MENU_MAX_HEIGHT = 250;
81072
- css /* scss */ `
81073
- .o-spreadsheet-bottom-bar {
81074
- background-color: ${BACKGROUND_GRAY_COLOR};
81075
- padding-left: ${HEADER_WIDTH}px;
81076
- font-size: 15px;
81077
- border-top: 1px solid lightgrey;
81078
-
81079
- .o-sheet-item {
81080
- cursor: pointer;
81081
- &:hover {
81082
- background-color: rgba(0, 0, 0, 0.08);
81083
- }
81084
- }
81085
-
81086
- .o-all-sheets {
81087
- max-width: 70%;
81088
- .o-bottom-bar-fade-out {
81089
- background-image: linear-gradient(-90deg, #cfcfcf, transparent 1%);
81090
- }
81091
-
81092
- .o-bottom-bar-fade-in {
81093
- z-index: 1;
81094
- background-image: linear-gradient(90deg, #cfcfcf, transparent 1%);
81095
- }
81096
-
81097
- .o-sheet-list {
81098
- overflow-y: hidden;
81099
- overflow-x: auto;
81100
-
81101
- &::-webkit-scrollbar {
81102
- display: none; /* Chrome */
81103
- }
81104
- -ms-overflow-style: none; /* IE and Edge */
81105
- scrollbar-width: none; /* Firefox */
81106
- }
81107
- }
81108
-
81109
- .o-bottom-bar-arrows {
81110
- .o-bottom-bar-arrow {
81111
- cursor: pointer;
81112
- &:hover:not([class*="o-disabled"]) {
81113
- .o-icon {
81114
- opacity: 0.9;
81115
- }
81116
- }
81117
-
81118
- .o-icon {
81119
- height: 18px;
81120
- width: 18px;
81121
- font-size: 18px;
81122
- }
81123
- }
81124
- }
81125
- }
81126
-
81127
- .o-spreadsheet-mobile .o-spreadsheet-bottom-bar {
81128
- padding-left: 0;
81129
-
81130
- .add-sheet-container {
81131
- order: 2;
81132
- }
81133
-
81134
- .o-add-sheet {
81135
- margin-left: 0.5rem;
81136
- }
81137
-
81138
- .o-all-sheets {
81139
- max-width: none;
81140
- }
81141
- }
81142
- `;
81143
79072
  class BottomBar extends owl.Component {
81144
79073
  static template = "o-spreadsheet-BottomBar";
81145
79074
  static props = { onClick: Function };
@@ -81395,12 +79324,6 @@ class ClickableCellsStore extends SpreadsheetStore {
81395
79324
  }
81396
79325
  }
81397
79326
 
81398
- css /* scss */ `
81399
- .o-dashboard-clickable-cell {
81400
- position: absolute;
81401
- cursor: pointer;
81402
- }
81403
- `;
81404
79327
  class SpreadsheetDashboard extends owl.Component {
81405
79328
  static template = "o-spreadsheet-SpreadsheetDashboard";
81406
79329
  static props = { getGridSize: Function };
@@ -81492,27 +79415,6 @@ class SpreadsheetDashboard extends owl.Component {
81492
79415
  }
81493
79416
  }
81494
79417
 
81495
- css /* scss */ `
81496
- .o-header-group {
81497
- .o-header-group-header {
81498
- z-index: ${ComponentsImportance.HeaderGroupingButton};
81499
- .o-group-fold-button {
81500
- cursor: pointer;
81501
- width: 15px;
81502
- height: 15px;
81503
- border: 1px solid ${HEADER_GROUPING_BORDER_COLOR};
81504
- .o-icon {
81505
- width: 7px;
81506
- height: 7px;
81507
- }
81508
-
81509
- &:hover {
81510
- border-color: #777;
81511
- }
81512
- }
81513
- }
81514
- }
81515
- `;
81516
79418
  class AbstractHeaderGroup extends owl.Component {
81517
79419
  static template = "o-spreadsheet-HeaderGroup";
81518
79420
  static props = {
@@ -81663,27 +79565,6 @@ class ColGroup extends AbstractHeaderGroup {
81663
79565
  }
81664
79566
  }
81665
79567
 
81666
- css /* scss */ `
81667
- .o-header-group-frozen-pane-border {
81668
- &.o-group-rows {
81669
- margin-top: -1px;
81670
- border-bottom: 3px solid ${FROZEN_PANE_HEADER_BORDER_COLOR};
81671
- }
81672
- &.o-group-columns {
81673
- margin-left: -1px;
81674
- border-right: 3px solid ${FROZEN_PANE_HEADER_BORDER_COLOR};
81675
- }
81676
- }
81677
-
81678
- .o-header-group-main-pane {
81679
- &.o-group-rows {
81680
- margin-top: -2px; /* Counteract o-header-group-frozen-pane-border offset */
81681
- }
81682
- &.o-group-columns {
81683
- margin-left: -2px;
81684
- }
81685
- }
81686
- `;
81687
79568
  class HeaderGroupContainer extends owl.Component {
81688
79569
  static template = "o-spreadsheet-HeaderGroupContainer";
81689
79570
  static props = {
@@ -81762,121 +79643,6 @@ function useScreenWidth() {
81762
79643
  };
81763
79644
  }
81764
79645
 
81765
- css /* scss */ `
81766
- .o-sidePanel {
81767
- display: flex;
81768
- flex-direction: column;
81769
- overflow-x: hidden;
81770
- background-color: white;
81771
- border: solid ${GRAY_300};
81772
- border-width: 1px 0 0 1px;
81773
- user-select: none;
81774
- color: ${TEXT_BODY};
81775
-
81776
- &.collapsed {
81777
- padding: 8px;
81778
- cursor: pointer;
81779
-
81780
- .o-sidePanelTitle {
81781
- writing-mode: vertical-rl;
81782
- text-orientation: mixed;
81783
- }
81784
- }
81785
-
81786
- .o-sidePanelTitle {
81787
- line-height: 20px;
81788
- font-size: 16px;
81789
- }
81790
-
81791
- .o-sidePanelHeader {
81792
- padding: 8px;
81793
- border-bottom: 1px solid ${GRAY_300};
81794
- }
81795
-
81796
- .o-sidePanelAction {
81797
- padding: 5px 10px;
81798
- cursor: pointer;
81799
-
81800
- &.active {
81801
- background-color: ${BUTTON_ACTIVE_BG};
81802
- }
81803
-
81804
- &:hover {
81805
- background-color: ${BUTTON_HOVER_BG};
81806
- }
81807
- }
81808
- .o-sidePanelBody-container {
81809
- /* This overwrites the min-height: auto; of flex. Without this, a flex div cannot be smaller than its children */
81810
- min-height: 0;
81811
- }
81812
- .o-sidePanelBody {
81813
- overflow: auto;
81814
- width: 100%;
81815
- height: 100%;
81816
-
81817
- .o-section {
81818
- padding: 16px;
81819
-
81820
- .o-section-title {
81821
- font-weight: 500;
81822
- margin-bottom: 5px;
81823
- }
81824
-
81825
- .o-section-subtitle {
81826
- font-weight: 500;
81827
- font-size: 13px;
81828
- line-height: 14px;
81829
- margin: 8px 0 4px 0;
81830
- }
81831
-
81832
- .o-subsection-left {
81833
- display: inline-block;
81834
- width: 47%;
81835
- margin-right: 3%;
81836
- }
81837
-
81838
- .o-subsection-right {
81839
- display: inline-block;
81840
- width: 47%;
81841
- margin-left: 3%;
81842
- }
81843
- }
81844
-
81845
- .o-sidePanel-composer {
81846
- color: ${TEXT_BODY};
81847
- }
81848
- }
81849
-
81850
- .o-sidePanelButtons {
81851
- display: flex;
81852
- gap: 8px;
81853
- }
81854
-
81855
- .o-invalid {
81856
- border-width: 2px;
81857
- border-color: red;
81858
- }
81859
-
81860
- .o-sidePanel-handle-container {
81861
- width: 8px;
81862
- position: fixed;
81863
- top: 50%;
81864
- z-index: 1;
81865
- }
81866
- .o-sidePanel-handle {
81867
- cursor: col-resize;
81868
- color: #a9a9a9;
81869
- .o-icon {
81870
- height: 25px;
81871
- margin-left: -5px;
81872
- }
81873
- }
81874
- }
81875
-
81876
- .o-fw-bold {
81877
- font-weight: 500;
81878
- }
81879
- `;
81880
79646
  class SidePanel extends owl.Component {
81881
79647
  static template = "o-spreadsheet-SidePanel";
81882
79648
  static props = {
@@ -82051,11 +79817,6 @@ class RibbonMenu extends owl.Component {
82051
79817
  }
82052
79818
  }
82053
79819
 
82054
- css `
82055
- .o-small-composer {
82056
- z-index: ${ComponentsImportance.TopBarComposer};
82057
- }
82058
- `;
82059
79820
  class SmallBottomBar extends owl.Component {
82060
79821
  static components = { Composer, BottomBar, Ripple, RibbonMenu };
82061
79822
  static template = "o-spreadsheet-SmallBottomBar";
@@ -82143,36 +79904,12 @@ class SmallBottomBar extends owl.Component {
82143
79904
 
82144
79905
  const COMPOSER_MAX_HEIGHT = 300;
82145
79906
  /* svg free of use from https://uxwing.com/formula-fx-icon/ */
82146
- const FX_SVG = /*xml*/ `
82147
- <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 121.8 122.9' width='16' height='16' focusable='false'>
82148
- <path d='m28 34-4 5v2h10l-6 40c-4 22-6 28-7 30-2 2-3 3-5 3-3 0-7-2-9-4H4c-2 2-4 4-4 7s4 6 8 6 9-2 15-8c8-7 13-17 18-39l7-35 13-1 3-6H49c4-23 7-27 11-27 2 0 5 2 8 6h4c1-1 4-4 4-7 0-2-3-6-9-6-5 0-13 4-20 10-6 7-9 14-11 24h-8zm41 16c4-5 7-7 8-7s2 1 5 9l3 12c-7 11-12 17-16 17l-3-1-2-1c-3 0-6 3-6 7s3 7 7 7c6 0 12-6 22-23l3 10c3 9 6 13 10 13 5 0 11-4 18-15l-3-4c-4 6-7 8-8 8-2 0-4-3-6-10l-5-15 8-10 6-4 3 1 3 2c2 0 6-3 6-7s-2-7-6-7c-6 0-11 5-21 20l-2-6c-3-9-5-14-9-14-5 0-12 6-18 15l3 3z' fill='#BDBDBD'/>
82149
- </svg>
82150
- `;
82151
- css /* scss */ `
82152
- .o-topbar-composer-container {
82153
- height: ${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px;
82154
- }
82155
-
82156
- .o-topbar-composer {
82157
- height: fit-content;
82158
- margin-top: -1px;
82159
- margin-bottom: -1px;
82160
- border: 1px solid;
82161
- font-family: ${DEFAULT_FONT};
82162
-
82163
- /* In readonly we always show the fx icon if the composer is empty, not matter the focus */
82164
- .o-composer:empty:not(:focus):not(.active)::before,
82165
- &.o-topbar-composer-readonly .o-composer:empty::before {
82166
- content: url("data:image/svg+xml,${encodeURIComponent(FX_SVG)}");
82167
- position: relative;
82168
- top: 20%;
82169
- }
82170
- }
82171
-
82172
- .user-select-text {
82173
- user-select: text;
82174
- }
82175
- `;
79907
+ // FIXME This svg is hardcoded in the css file. We should find a better way to handle it.
79908
+ // const FX_SVG = /*xml*/ `
79909
+ // <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 121.8 122.9' width='16' height='16' focusable='false'>
79910
+ // <path d='m28 34-4 5v2h10l-6 40c-4 22-6 28-7 30-2 2-3 3-5 3-3 0-7-2-9-4H4c-2 2-4 4-4 7s4 6 8 6 9-2 15-8c8-7 13-17 18-39l7-35 13-1 3-6H49c4-23 7-27 11-27 2 0 5 2 8 6h4c1-1 4-4 4-7 0-2-3-6-9-6-5 0-13 4-20 10-6 7-9 14-11 24h-8zm41 16c4-5 7-7 8-7s2 1 5 9l3 12c-7 11-12 17-16 17l-3-1-2-1c-3 0-6 3-6 7s3 7 7 7c6 0 12-6 22-23l3 10c3 9 6 13 10 13 5 0 11-4 18-15l-3-4c-4 6-7 8-8 8-2 0-4-3-6-10l-5-15 8-10 6-4 3 1 3 2c2 0 6-3 6-7s-2-7-6-7c-6 0-11 5-21 20l-2-6c-3-9-5-14-9-14-5 0-12 6-18 15l3 3z' fill='#BDBDBD'/>
79911
+ // </svg>
79912
+ // `;
82176
79913
  class TopBarComposer extends owl.Component {
82177
79914
  static template = "o-spreadsheet-TopBarComposer";
82178
79915
  static props = {};
@@ -82208,18 +79945,6 @@ class TopBarComposer extends owl.Component {
82208
79945
  style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
82209
79946
  return cssPropertiesToCss(style);
82210
79947
  }
82211
- get containerStyle() {
82212
- if (this.focus === "inactive") {
82213
- return cssPropertiesToCss({
82214
- "border-color": SEPARATOR_COLOR,
82215
- "border-right": "none",
82216
- });
82217
- }
82218
- return cssPropertiesToCss({
82219
- "border-color": SELECTION_BORDER_COLOR,
82220
- "z-index": String(ComponentsImportance.TopBarComposer),
82221
- });
82222
- }
82223
79948
  onFocus(selection) {
82224
79949
  this.composerFocusStore.focusComposer(this.composerInterface, { selection });
82225
79950
  }
@@ -82309,79 +80034,6 @@ const BORDER_POSITIONS = [
82309
80034
  // -----------------------------------------------------------------------------
82310
80035
  // Border Editor
82311
80036
  // -----------------------------------------------------------------------------
82312
- css /* scss */ `
82313
- .o-border-selector {
82314
- padding: 4px;
82315
- background-color: white;
82316
-
82317
- .o-divider {
82318
- border-right: 1px solid ${GRAY_300};
82319
- margin: 0 6px;
82320
- }
82321
-
82322
- .o-border-selector-section {
82323
- .o-dropdown-line {
82324
- height: 30px;
82325
- margin: 1px;
82326
- .o-line-item {
82327
- padding: 4px;
82328
- width: 26px;
82329
- height: 26px;
82330
- &.active {
82331
- background-color: ${BUTTON_ACTIVE_BG};
82332
- }
82333
- }
82334
- }
82335
- .o-border-style-tool {
82336
- padding: 0px 3px;
82337
- margin: 2px;
82338
- height: 25px;
82339
- }
82340
- }
82341
- }
82342
-
82343
- .o-border-style-dropdown {
82344
- background: #ffffff;
82345
- padding: 4px;
82346
- .o-dropdown-line {
82347
- }
82348
- .o-style-preview {
82349
- margin: 7px 5px 7px 5px;
82350
- width: 60px;
82351
- height: 5px;
82352
- }
82353
- .o-style-thin {
82354
- border-bottom: 1px solid #000000;
82355
- }
82356
- .o-style-medium {
82357
- border-bottom: 2px solid #000000;
82358
- }
82359
- .o-style-thick {
82360
- border-bottom: 3px solid #000000;
82361
- }
82362
- .o-style-dashed {
82363
- border-bottom: 1px dashed #000000;
82364
- }
82365
- .o-style-dotted {
82366
- border-bottom: 1px dotted #000000;
82367
- }
82368
- .o-dropdown-border-type {
82369
- cursor: pointer;
82370
- &:not(.o-disabled):not(.active):hover {
82371
- background-color: ${BUTTON_HOVER_BG};
82372
- }
82373
- }
82374
- .o-dropdown-border-check {
82375
- width: 20px;
82376
- font-size: 12px;
82377
- }
82378
- .o-border-picker-button {
82379
- padding: 0px !important;
82380
- margin: 5px 0px 0px 0px !important;
82381
- height: 25px !important;
82382
- }
82383
- }
82384
- `;
82385
80037
  class BorderEditor extends owl.Component {
82386
80038
  static template = "o-spreadsheet-BorderEditor";
82387
80039
  static props = {
@@ -82932,90 +80584,6 @@ topBarToolBarRegistry
82932
80584
  // -----------------------------------------------------------------------------
82933
80585
  // TopBar
82934
80586
  // -----------------------------------------------------------------------------
82935
- css /* scss */ `
82936
- .o-topbar-divider {
82937
- border-right: 1px solid ${SEPARATOR_COLOR};
82938
- width: 0;
82939
- margin: 0 6px;
82940
- height: 30px;
82941
- }
82942
-
82943
- .o-toolbar-button {
82944
- height: 30px;
82945
- }
82946
-
82947
- .o-spreadsheet-topbar {
82948
- line-height: 1.2;
82949
- font-size: 14px;
82950
- font-weight: 500;
82951
- background-color: #fff;
82952
-
82953
- .o-topbar-top {
82954
- border-bottom: 1px solid ${SEPARATOR_COLOR};
82955
- padding: 2px 10px;
82956
-
82957
- /* Menus */
82958
- .o-topbar-topleft {
82959
- .o-topbar-menu {
82960
- padding: 4px 6px;
82961
- margin: 0 2px;
82962
-
82963
- &.active {
82964
- background-color: ${BUTTON_ACTIVE_BG};
82965
- color: ${BUTTON_ACTIVE_TEXT_COLOR};
82966
- }
82967
- }
82968
- }
82969
- }
82970
-
82971
- .irregularity-map {
82972
- border-top: 1px solid ${SEPARATOR_COLOR};
82973
- height: ${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px;
82974
-
82975
- .alert-info {
82976
- border-left: 3px solid ${ALERT_INFO_BORDER};
82977
- }
82978
- }
82979
-
82980
- .o-topbar-composer {
82981
- flex-grow: 1;
82982
- }
82983
-
82984
- /* Toolbar */
82985
- .o-topbar-toolbar {
82986
- height: ${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px;
82987
-
82988
- .o-readonly-toolbar {
82989
- background-color: ${BACKGROUND_HEADER_COLOR};
82990
- padding-left: 18px;
82991
- padding-right: 18px;
82992
- }
82993
-
82994
- /* Toolbar */
82995
- .o-toolbar-tools {
82996
- cursor: default;
82997
- }
82998
- }
82999
- }
83000
-
83001
- .o-spreadsheet-mobile {
83002
- .o-topbar-toolbar {
83003
- height: ${MOBILE_TOPBAR_TOOLBAR_HEIGHT}px;
83004
- }
83005
- .o-topbar-divider {
83006
- border-width: 2px;
83007
- border-radius: 4px;
83008
- }
83009
-
83010
- .o-toolbar-button {
83011
- height: 35px;
83012
- width: 31px;
83013
- .o-toolbar-button.o-mobile-disabled * {
83014
- color: ${DISABLED_TEXT_COLOR};
83015
- cursor: not-allowed;
83016
- }
83017
- }
83018
- `;
83019
80587
  class TopBar extends owl.Component {
83020
80588
  static template = "o-spreadsheet-TopBar";
83021
80589
  static props = {
@@ -83289,251 +80857,6 @@ class WebClipboardWrapper {
83289
80857
  }
83290
80858
  }
83291
80859
 
83292
- // -----------------------------------------------------------------------------
83293
- // SpreadSheet
83294
- // -----------------------------------------------------------------------------
83295
- const CARET_DOWN_SVG = /*xml*/ `
83296
- <svg xmlns='http://www.w3.org/2000/svg' width='7' height='4' viewBox='0 0 7 4'>
83297
- <polygon fill='%23374151' points='3.5 4 7 0 0 0'/>
83298
- </svg>
83299
- `;
83300
- css /* scss */ `
83301
- .o-spreadsheet {
83302
- position: relative;
83303
- display: grid;
83304
- font-size: 14px;
83305
-
83306
- .text-muted {
83307
- color: ${TEXT_BODY_MUTED} !important;
83308
- }
83309
- .o-disabled {
83310
- opacity: 0.4;
83311
- cursor: default;
83312
- pointer-events: none;
83313
- }
83314
-
83315
- &,
83316
- *,
83317
- *:before,
83318
- *:after {
83319
- /* rtl not supported ATM */
83320
- direction: ltr;
83321
- }
83322
- .o-separator {
83323
- border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
83324
- margin-top: ${MENU_SEPARATOR_PADDING}px;
83325
- margin-bottom: ${MENU_SEPARATOR_PADDING}px;
83326
- }
83327
- .o-hoverable-button {
83328
- border-radius: 2px;
83329
- cursor: pointer;
83330
- .o-icon {
83331
- color: ${TEXT_BODY};
83332
- }
83333
- &:not(.o-disabled):not(.active):hover {
83334
- background-color: ${BUTTON_HOVER_BG};
83335
- color: ${BUTTON_HOVER_TEXT_COLOR};
83336
- .o-icon {
83337
- color: ${BUTTON_HOVER_TEXT_COLOR};
83338
- }
83339
- }
83340
- &.active {
83341
- background-color: ${BUTTON_ACTIVE_BG};
83342
- color: ${BUTTON_ACTIVE_TEXT_COLOR};
83343
- .o-icon {
83344
- color: ${BUTTON_ACTIVE_TEXT_COLOR};
83345
- }
83346
- }
83347
- }
83348
-
83349
- .o-grid-container {
83350
- display: grid;
83351
- background-color: ${HEADER_GROUPING_BACKGROUND_COLOR};
83352
-
83353
- .o-top-left {
83354
- border: 1px solid ${GRID_BORDER_COLOR};
83355
- margin-bottom: -1px;
83356
- margin-right: -1px;
83357
- }
83358
-
83359
- .o-column-groups {
83360
- grid-column-start: 2;
83361
- border-top: 1px solid ${GRID_BORDER_COLOR};
83362
- }
83363
-
83364
- .o-row-groups {
83365
- grid-row-start: 2;
83366
- }
83367
-
83368
- .o-group-grid {
83369
- border-top: 1px solid ${GRID_BORDER_COLOR};
83370
- border-left: 1px solid ${GRID_BORDER_COLOR};
83371
- }
83372
- }
83373
-
83374
- .o-input {
83375
- min-width: 0px;
83376
- padding: 1px 0;
83377
- width: 100%;
83378
- outline: none;
83379
- border-color: ${GRAY_300};
83380
- color: ${GRAY_900};
83381
-
83382
- &::placeholder {
83383
- opacity: 0.5;
83384
- }
83385
- &:focus {
83386
- border-color: ${ACTION_COLOR};
83387
- }
83388
- }
83389
-
83390
- select.o-input {
83391
- cursor: pointer;
83392
- border-width: 0 0 1px 0;
83393
- padding: 1px 6px 1px 0px;
83394
-
83395
- appearance: none;
83396
- -webkit-appearance: none;
83397
- -moz-appearance: none;
83398
- background: transparent url("data:image/svg+xml,${encodeURIComponent(CARET_DOWN_SVG)}")
83399
- no-repeat right center;
83400
- text-overflow: ellipsis;
83401
-
83402
- &:disabled {
83403
- color: ${DISABLED_TEXT_COLOR};
83404
- opacity: 0.4;
83405
- cursor: default;
83406
- }
83407
- }
83408
-
83409
- .o-input[type="text"] {
83410
- border-width: 0 0 1px 0;
83411
- }
83412
-
83413
- .o-input[type="number"],
83414
- .o-number-input {
83415
- border-width: 0 0 1px 0;
83416
- /* Remove number input arrows */
83417
- appearance: textfield;
83418
- &::-webkit-outer-spin-button,
83419
- &::-webkit-inner-spin-button {
83420
- -webkit-appearance: none;
83421
- margin: 0;
83422
- }
83423
- }
83424
- }
83425
-
83426
- .o-two-columns {
83427
- grid-column: 1 / 3;
83428
- }
83429
-
83430
- .o-text-icon {
83431
- vertical-align: middle;
83432
- }
83433
- `;
83434
- // -----------------------------------------------------------------------------
83435
- // GRID STYLE
83436
- // -----------------------------------------------------------------------------
83437
- css /* scss */ `
83438
- .o-grid {
83439
- position: relative;
83440
- overflow: hidden;
83441
- background-color: ${BACKGROUND_GRAY_COLOR};
83442
- &:focus {
83443
- outline: none;
83444
- }
83445
-
83446
- > canvas {
83447
- box-sizing: content-box;
83448
- border-bottom: 1px solid #e2e3e3;
83449
- border-right: 1px solid #e2e3e3;
83450
- }
83451
-
83452
- .o-grid-overlay {
83453
- position: absolute;
83454
- outline: none;
83455
- }
83456
- }
83457
-
83458
- .o-button {
83459
- border: 1px solid;
83460
- border-radius: 4px;
83461
- font-weight: 500;
83462
- font-size: 14px;
83463
- height: 32px;
83464
- line-height: 16px;
83465
- flex-grow: 1;
83466
- background-color: ${BUTTON_BG};
83467
- border: 1px solid ${GRAY_200};
83468
- color: ${TEXT_BODY};
83469
-
83470
- &:disabled {
83471
- color: ${DISABLED_TEXT_COLOR};
83472
- }
83473
-
83474
- &.primary {
83475
- background-color: ${PRIMARY_BUTTON_BG};
83476
- border-color: ${PRIMARY_BUTTON_BG};
83477
- color: #fff;
83478
- &:hover:enabled {
83479
- color: #fff;
83480
- background-color: ${PRIMARY_BUTTON_HOVER_BG};
83481
- }
83482
- &:active:enabled {
83483
- background-color: ${PRIMARY_BUTTON_ACTIVE_BG};
83484
- color: ${PRIMARY_BUTTON_BG};
83485
- }
83486
- &.o-disabled,
83487
- &:disabled {
83488
- opacity: 0.5;
83489
- }
83490
- }
83491
-
83492
- &:hover:enabled {
83493
- color: ${BUTTON_HOVER_TEXT_COLOR};
83494
- background-color: ${BUTTON_HOVER_BG};
83495
- }
83496
- &:active:enabled {
83497
- color: ${BUTTON_ACTIVE_TEXT_COLOR};
83498
- background-color: ${BUTTON_ACTIVE_BG};
83499
- }
83500
-
83501
- &.o-disabled,
83502
- &:disabled {
83503
- opacity: 0.8;
83504
- }
83505
-
83506
- &.o-button-danger:hover {
83507
- color: #ffffff;
83508
- background: ${ALERT_DANGER_BORDER};
83509
- }
83510
- }
83511
-
83512
- .o-button-link {
83513
- cursor: pointer;
83514
- text-decoration: none;
83515
- color: ${ACTION_COLOR};
83516
- font-weight: 500;
83517
- &:hover,
83518
- &:active {
83519
- color: ${ACTION_COLOR_HOVER};
83520
- }
83521
- }
83522
-
83523
- .o-button-icon {
83524
- cursor: pointer;
83525
- color: ${TEXT_BODY_MUTED};
83526
- font-weight: 500;
83527
- &:hover,
83528
- &:active {
83529
- color: ${TEXT_BODY};
83530
- }
83531
- }
83532
-
83533
- .o-spreadsheet-bottombar-wrapper {
83534
- z-index: ${ComponentsImportance.ScrollBar + 1};
83535
- }
83536
- `;
83537
80860
  class Spreadsheet extends owl.Component {
83538
80861
  static template = "o-spreadsheet-Spreadsheet";
83539
80862
  static props = {
@@ -88390,6 +85713,8 @@ exports.convertAstNodes = convertAstNodes;
88390
85713
  exports.coreTypes = coreTypes;
88391
85714
  exports.findCellInNewZone = findCellInNewZone;
88392
85715
  exports.functionCache = functionCache;
85716
+ exports.getCaretDownSvg = getCaretDownSvg;
85717
+ exports.getCaretUpSvg = getCaretUpSvg;
88393
85718
  exports.helpers = helpers;
88394
85719
  exports.hooks = hooks;
88395
85720
  exports.invalidateCFEvaluationCommands = invalidateCFEvaluationCommands;
@@ -88410,6 +85735,6 @@ exports.tokenColors = tokenColors;
88410
85735
  exports.tokenize = tokenize;
88411
85736
 
88412
85737
 
88413
- __info__.version = "19.1.0-alpha.0";
88414
- __info__.date = "2025-09-11T07:49:49.483Z";
88415
- __info__.hash = "587c928";
85738
+ __info__.version = "19.1.0-alpha.2";
85739
+ __info__.date = "2025-09-19T07:26:49.306Z";
85740
+ __info__.hash = "8cc543d";