@odoo/o-spreadsheet 18.1.0-alpha.6 → 18.1.0-alpha.8

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.
@@ -1,9 +1,9 @@
1
1
  <!--
2
2
  This file is generated by o-spreadsheet build tools. Do not edit it.
3
3
  @see https://github.com/odoo/o-spreadsheet
4
- @version 18.1.0-alpha.6
5
- @date 2024-11-28T09:07:41.105Z
6
- @hash 875c901
4
+ @version 18.1.0-alpha.8
5
+ @date 2024-12-19T07:50:38.927Z
6
+ @hash 87a1567
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
@@ -460,7 +460,7 @@
460
460
  <div
461
461
  class="o-autocomplete-description text-truncate"
462
462
  t-esc="proposal.description"
463
- t-if="props.selectedIndex === proposal_index"
463
+ t-if="props.selectedIndex === proposal_index || proposal.alwaysExpanded"
464
464
  />
465
465
  </div>
466
466
  </t>
@@ -891,22 +891,22 @@
891
891
  <div class="o-filter-menu d-flex flex-column bg-white" t-on-wheel.stop="">
892
892
  <t t-if="isSortable">
893
893
  <div>
894
- <div class="o-filter-menu-item" t-on-click="() => this.sortFilterZone('ascending')">
894
+ <div class="o-filter-menu-item my-2 mb-3" t-on-click="() => this.sortFilterZone('asc')">
895
895
  Sort ascending (A ⟶ Z)
896
896
  </div>
897
- <div class="o-filter-menu-item" t-on-click="() => this.sortFilterZone('descending')">
897
+ <div class="o-filter-menu-item my-2" t-on-click="() => this.sortFilterZone('desc')">
898
898
  Sort descending (Z ⟶ A)
899
899
  </div>
900
900
  </div>
901
901
  <div class="o-separator"/>
902
902
  </t>
903
- <div class="o-filter-menu-actions">
904
- <div class="o-filter-menu-action-text" t-on-click="selectAll">Select all</div>
905
- <div class="o-filter-menu-action-text" t-on-click="clearAll">Clear</div>
903
+ <div class="o-filter-menu-actions d-flex">
904
+ <div class="o-button-link me-4" t-on-click="selectAll">Select all</div>
905
+ <div class="o-button-link me-4" t-on-click="clearAll">Clear</div>
906
906
  </div>
907
907
  <div class="position-relative">
908
908
  <input
909
- class="w-100"
909
+ class="w-100 o-input my-2"
910
910
  t-ref="filterMenuSearchBar"
911
911
  type="text"
912
912
  t-model="state.textFilter"
@@ -918,7 +918,7 @@
918
918
  </i>
919
919
  </div>
920
920
  <div
921
- class="o-filter-menu-list d-flex flex-column rounded"
921
+ class="o-filter-menu-list d-flex flex-column"
922
922
  t-ref="filterValueList"
923
923
  t-on-click="this.clearScrolledToValue"
924
924
  t-on-scroll="this.clearScrolledToValue">
@@ -947,20 +947,22 @@
947
947
 
948
948
  <t t-name="o-spreadsheet-FilterMenuValueItem">
949
949
  <div
950
- t-on-click="this.props.onClick"
951
950
  t-on-pointermove="this.props.onMouseMove"
952
951
  class="o-filter-menu-item o-filter-menu-value"
953
952
  t-ref="menuValueItem"
954
953
  t-att-class="{'selected': this.props.isSelected}">
955
- <div>
956
- <div class="o-filter-menu-value-checked">
957
- <span t-if="this.props.isChecked">✓</span>
958
- </div>
959
- </div>
960
- <div class="o-filter-menu-value-text text-truncate">
954
+ <t t-set="value">
961
955
  <t t-if="this.props.value === ''">(Blanks)</t>
962
956
  <t t-else="" t-esc="this.props.value"/>
963
- </div>
957
+ </t>
958
+ <!-- toString because t-set with a body creates a LazyValue instead of a string -->
959
+ <Checkbox
960
+ name="value.toString()"
961
+ value="this.props.isChecked"
962
+ onChange="this.props.onClick"
963
+ className="'p-2 w-100 pe-auto text-truncate'"
964
+ label="value.toString()"
965
+ />
964
966
  </div>
965
967
  </t>
966
968
 
@@ -979,7 +981,7 @@
979
981
  t-on-keydown="onInputKeydown"
980
982
  t-on-click.stop=""
981
983
  t-on-focus.stop="onInputFocused"
982
- t-att-value="currentFontSize"
984
+ t-att-value="props.currentFontSize"
983
985
  t-on-change="setSizeFromInput"
984
986
  t-ref="inputFontSize"
985
987
  />
@@ -987,19 +989,17 @@
987
989
  <t t-call="o-spreadsheet-Icon.CARET_DOWN"/>
988
990
  </span>
989
991
  </div>
990
- <div
991
- class="o-dropdown-content o-text-options"
992
- t-if="dropdown.isOpen"
993
- t-on-click.stop=""
994
- t-att-style="props.dropdownStyle">
995
- <t t-foreach="fontSizes" t-as="fontSize" t-key="fontSize">
996
- <div
997
- t-esc="fontSize"
998
- t-att-data-size="fontSize"
999
- t-on-click="() => this.setSizeFromList(fontSize)"
1000
- />
1001
- </t>
1002
- </div>
992
+ <Popover t-if="dropdown.isOpen" t-props="popoverProps">
993
+ <div class="o-text-options bg-white" t-on-click.stop="" t-ref="fontSizeList">
994
+ <t t-foreach="fontSizes" t-as="fontSize" t-key="fontSize">
995
+ <div
996
+ t-esc="fontSize"
997
+ t-att-data-size="fontSize"
998
+ t-on-click="() => this.setSizeFromList(fontSize)"
999
+ />
1000
+ </t>
1001
+ </div>
1002
+ </Popover>
1003
1003
  </div>
1004
1004
  </t>
1005
1005
 
@@ -1801,6 +1801,11 @@
1801
1801
  <path fill="currentColor" d="M4 14v2h10v-2H4m0-8v2h10V6H4m-2 6h14v-2H2v2M2 2v2h14V2H2"/>
1802
1802
  </svg>
1803
1803
  </t>
1804
+ <t t-name="o-spreadsheet-Icon.IRREGULARITY_MAP">
1805
+ <div class="o-icon">
1806
+ <i class="fa fa-align-center fa-rotate-270"/>
1807
+ </div>
1808
+ </t>
1804
1809
  <t t-name="o-spreadsheet-Icon.ALIGN_RIGHT">
1805
1810
  <svg class="o-icon align-right">
1806
1811
  <path fill="currentColor" d="M6 16h10v-2H6v2m-4-4h14v-2H2v2M2 2v2h14V2H2m4 6h10V6H6v2"/>
@@ -2700,6 +2705,7 @@
2700
2705
  updateAlignment.bind="updateAxisTitleAlignment"
2701
2706
  updateColor.bind="updateAxisTitleColor"
2702
2707
  style="axisTitleStyle"
2708
+ onFontSizeChanged.bind="updateAxisTitleFontSize"
2703
2709
  />
2704
2710
  </t>
2705
2711
 
@@ -2741,6 +2747,7 @@
2741
2747
  updateAlignment.bind="updateChartTitleAlignment"
2742
2748
  updateColor.bind="updateChartTitleColor"
2743
2749
  style="titleStyle"
2750
+ onFontSizeChanged.bind="updateChartTitleFontSize"
2744
2751
  />
2745
2752
  <t t-slot="general-extension"/>
2746
2753
  </t>
@@ -3012,6 +3019,12 @@
3012
3019
  </div>
3013
3020
  </div>
3014
3021
  <div class="o-divider"/>
3022
+ <FontSizeEditor
3023
+ currentFontSize="props.style.fontSize"
3024
+ onFontSizeChanged.bind="this.updateFontSize"
3025
+ class="'o-hoverable-button'"
3026
+ />
3027
+ <div class="o-divider"/>
3015
3028
  <ColorPickerWidget
3016
3029
  currentColor="props.style.color"
3017
3030
  toggleColorPicker="(ev) => this.toggleDropdownTool('fillChartColorTool', ev)"
@@ -3260,6 +3273,33 @@
3260
3273
  />
3261
3274
  </svg>
3262
3275
  </t>
3276
+ <t t-name="o-spreadsheet-ChartPreview.GEO_CHART">
3277
+ <svg
3278
+ viewBox="0 0 32 32"
3279
+ xmlns="http://www.w3.org/2000/svg"
3280
+ class="o-chart-preview"
3281
+ fill="none"
3282
+ stroke-width="0.5"
3283
+ stroke-linejoin="round">
3284
+ <circle cx="16" cy="16" r="13" fill="#c4e4ff"/>
3285
+ <path
3286
+ stroke="#eb6d00"
3287
+ fill="#ffe1c8"
3288
+ d="M12.225 16.293c0 6.8 4 9 5 9 3.5 0 2-5.293 3.5-6.793s5-.707 5-4.207-2-5-5-5c-5 0-8.5 1.5-8.5 7z"
3289
+ />
3290
+ <path
3291
+ fill="#ffe1c8"
3292
+ d="M21.5 4.4c0 1.167-1.735 1.5-3 1.5-5.217 0-10.705 3.48-11.421 8.004C6.992 14.549 6.552 15 6 15H3.07 A 13 13 0 0 1 21.5 4.2
3293
+ M3.8 20.5c.785.262 2.126 1.285 3.44 1.517.57.101 1.153.464 1.299 1.023.303 1.16.548 1.992-.239 3.58 A 13 13 0 0 1 3.8 20.5"
3294
+ />
3295
+ <path
3296
+ stroke="#eb6d00"
3297
+ d="M21.5 4.4c0 1.167-1.735 1.5-3 1.5-5.217 0-10.705 3.48-11.421 8.004C6.992 14.549 6.552 15 6 15H3.07
3298
+ M3.8 20.5c.785.262 2.126 1.285 3.44 1.517.57.101 1.153.464 1.299 1.023.303 1.16.548 1.992-.239 3.58"
3299
+ />
3300
+ <circle cx="16" cy="16" r="13" stroke="#444"/>
3301
+ </svg>
3302
+ </t>
3263
3303
 
3264
3304
  <t t-name="o-spreadsheet-ChartTypePicker">
3265
3305
  <t t-set="selectedChartProperties" t-value="getSelectedChartSubtypeProperties()"/>
@@ -3554,6 +3594,120 @@
3554
3594
  </tr>
3555
3595
  </t>
3556
3596
 
3597
+ <t t-name="o-spreadsheet-GeoChartConfigPanel">
3598
+ <div>
3599
+ <GeoChartRegionSelectSection
3600
+ figureId="props.figureId"
3601
+ definition="props.definition"
3602
+ updateChart="props.updateChart"
3603
+ />
3604
+
3605
+ <ChartDataSeries
3606
+ ranges="dataRanges"
3607
+ onSelectionChanged="(ranges) => this.onDataSeriesRangesChanged(ranges)"
3608
+ onSelectionConfirmed="() => this.onDataSeriesConfirmed()"
3609
+ hasSingleRange="true"
3610
+ />
3611
+ <ChartLabelRange
3612
+ range="this.getLabelRange()"
3613
+ isInvalid="isLabelInvalid"
3614
+ onSelectionChanged="(ranges) => this.onLabelRangeChanged(ranges)"
3615
+ onSelectionConfirmed="() => this.onLabelRangeConfirmed()"
3616
+ options="this.getLabelRangeOptions()"
3617
+ title.translate="Territories"
3618
+ />
3619
+
3620
+ <ChartErrorSection t-if="errorMessages.length" messages="errorMessages"/>
3621
+ </div>
3622
+ </t>
3623
+
3624
+ <t t-name="o-spreadsheet-GeoChartDesignPanel">
3625
+ <GeneralDesignEditor
3626
+ figureId="props.figureId"
3627
+ definition="props.definition"
3628
+ updateChart="props.updateChart">
3629
+ <t t-set-slot="general-extension">
3630
+ <Section class="'pt-0'" title.translate="Legend position">
3631
+ <select
3632
+ t-att-value="props.definition.legendPosition ?? 'bottom-left'"
3633
+ class="o-input o-chart-legend-position"
3634
+ t-on-change="this.updateLegendPosition">
3635
+ <option value="none">None</option>
3636
+ <option value="top">Top left</option>
3637
+ <option value="right">Top right</option>
3638
+ <option value="bottom">Bottom right</option>
3639
+ <option value="left">Bottom left</option>
3640
+ </select>
3641
+ </Section>
3642
+ </t>
3643
+ </GeneralDesignEditor>
3644
+
3645
+ <SidePanelCollapsible collapsedAtInit="false" title.translate="Geo chart options">
3646
+ <t t-set-slot="content">
3647
+ <Section class="'pt-0 o-color-scale'" title.translate="Color Scale">
3648
+ <select class="o-input" t-on-change="this.updateColorScaleType">
3649
+ <option value="custom">Custom</option>
3650
+ <hr/>
3651
+ <t t-foreach="colorScalesChoices" t-as="colorScale" t-key="colorScale">
3652
+ <option
3653
+ t-att-value="colorScale"
3654
+ t-esc="colorScale_value"
3655
+ t-att-selected="colorScale === selectedColorScale"
3656
+ />
3657
+ </t>
3658
+ </select>
3659
+
3660
+ <t t-if="customColorScale">
3661
+ <div class="o-min-color d-flex align-items-center mb-2 mt-4">
3662
+ <RoundColorPicker
3663
+ currentColor="getCustomColorScaleColor('minColor')"
3664
+ onColorPicked="(color) => this.setCustomColorScaleColor('minColor', color)"
3665
+ disableNoColor="true"
3666
+ />
3667
+ <span class="ps-2">Color of minimum values</span>
3668
+ </div>
3669
+ <div class="o-mid-color d-flex align-items-center mb-2">
3670
+ <RoundColorPicker
3671
+ currentColor="getCustomColorScaleColor('midColor')"
3672
+ onColorPicked="(color) => this.setCustomColorScaleColor('midColor', color)"
3673
+ />
3674
+ <span class="ps-2">Color of middle values</span>
3675
+ </div>
3676
+ <div class="o-max-color d-flex align-items-center">
3677
+ <RoundColorPicker
3678
+ currentColor="getCustomColorScaleColor('maxColor')"
3679
+ onColorPicked="(color) => this.setCustomColorScaleColor('maxColor', color)"
3680
+ disableNoColor="true"
3681
+ />
3682
+ <span class="ps-2">Color of maximum values</span>
3683
+ </div>
3684
+ </t>
3685
+ </Section>
3686
+
3687
+ <Section class="'pt-0 o-missing-value'" title.translate="Countries without value">
3688
+ <RoundColorPicker
3689
+ currentColor="selectedMissingValueColor"
3690
+ onColorPicked.bind="updateMissingValueColor"
3691
+ />
3692
+ </Section>
3693
+ </t>
3694
+ </SidePanelCollapsible>
3695
+ </t>
3696
+
3697
+ <t t-name="o-spreadsheet-GeoChartRegionSelectSection">
3698
+ <Section class="'o-geo-region'" title.translate="Region">
3699
+ <select class="o-input" t-on-change="this.updateSelectedRegion">
3700
+ <t t-foreach="availableRegions" t-as="region" t-key="region.id">
3701
+ <option
3702
+ t-att-value="region.id"
3703
+ t-esc="region.label"
3704
+ t-att-selected="region.id === selectedRegion"
3705
+ />
3706
+ </t>
3707
+ </select>
3708
+ </Section>
3709
+ </t>
3710
+
3557
3711
  <t t-name="o-spreadsheet-LineConfigPanel">
3558
3712
  <div>
3559
3713
  <Section class="'pt-0'">
@@ -3741,7 +3895,8 @@
3741
3895
  <GeneralDesignEditor
3742
3896
  figureId="props.figureId"
3743
3897
  definition="props.definition"
3744
- updateChart="props.updateChart">
3898
+ updateChart="props.updateChart"
3899
+ defaultChartTitleFontSize="defaultScorecardTitleFontSize">
3745
3900
  <t t-set-slot="general-extension">
3746
3901
  <Section class="'pt-1'" title.translate="Number formatting">
3747
3902
  <Checkbox
@@ -3896,6 +4051,7 @@
3896
4051
  <t t-name="o-spreadsheet.Checkbox">
3897
4052
  <label
3898
4053
  class="o-checkbox d-flex align-items-center"
4054
+ role="button"
3899
4055
  t-att-title="props.title"
3900
4056
  t-att-class="{'text-muted': props.disabled }"
3901
4057
  t-attf-class="{{props.className}}">
@@ -4247,6 +4403,7 @@
4247
4403
  <RoundColorPicker
4248
4404
  currentColor="colorNumberString(rule.color)"
4249
4405
  onColorPicked.bind="updateDataBarColor"
4406
+ disableNoColor="true"
4250
4407
  />
4251
4408
  <div class="o-section-subtitle">Range of values</div>
4252
4409
  <SelectionInput
@@ -5111,6 +5268,7 @@
5111
5268
  </div>
5112
5269
  </t>
5113
5270
  </div>
5271
+ <PivotSortSection definition="props.definition" pivotId="props.pivotId"/>
5114
5272
  </t>
5115
5273
 
5116
5274
  <t t-name="o-spreadsheet-PivotMeasureEditor">
@@ -5138,6 +5296,7 @@
5138
5296
  composerContent="measure.computedBy.formula"
5139
5297
  defaultRangeSheetId="measure.computedBy.sheetId"
5140
5298
  contextualAutocomplete="getMeasureAutocomplete()"
5299
+ getContextualColoredSymbolToken.bind="getColoredSymbolToken"
5141
5300
  />
5142
5301
  </div>
5143
5302
  </div>
@@ -5161,6 +5320,24 @@
5161
5320
  </PivotDimension>
5162
5321
  </t>
5163
5322
 
5323
+ <t t-name="o-spreadsheet-PivotSortSection">
5324
+ <Section t-if="hasValidSort" class="'o-pivot-sort'">
5325
+ <t t-set-slot="title">Sorting</t>
5326
+ <div t-esc="sortDescription" class="pb-2"/>
5327
+ <div class="d-flex flex-column gap-2">
5328
+ <t t-foreach="sortValuesAndFields" t-as="valueAndField" t-key="valueAndField_index">
5329
+ <div class="o-sort-card d-flex gap-1 px-2">
5330
+ <t t-if="valueAndField.field">
5331
+ <span class="fw-bolder" t-esc="valueAndField.field"/>
5332
+ =
5333
+ </t>
5334
+ <span class="fw-bolder o-sort-value" t-esc="valueAndField.value"/>
5335
+ </div>
5336
+ </t>
5337
+ </div>
5338
+ </Section>
5339
+ </t>
5340
+
5164
5341
  <t t-name="o-spreadsheet-PivotMeasureDisplayPanel">
5165
5342
  <Section title.translate="Show measure as:">
5166
5343
  <select
@@ -5585,7 +5762,11 @@
5585
5762
  <input type="text" class="o-input" t-model="state.styleName"/>
5586
5763
  </Section>
5587
5764
  <Section class="'pt-1'" title.translate="Style color">
5588
- <RoundColorPicker currentColor="state.primaryColor" onColorPicked.bind="onColorPicked"/>
5765
+ <RoundColorPicker
5766
+ currentColor="state.primaryColor"
5767
+ onColorPicked.bind="onColorPicked"
5768
+ disableNoColor="true"
5769
+ />
5589
5770
  </Section>
5590
5771
  <Section class="'pt-1'" title.translate="Style template">
5591
5772
  <div class="d-flex flex-wrap">
@@ -5841,9 +6022,10 @@
5841
6022
 
5842
6023
  <div class="o-divider"/>
5843
6024
  <FontSizeEditor
6025
+ currentFontSize="currentFontSize"
6026
+ onFontSizeChanged.bind="this.setFontSize"
5844
6027
  class="'o-hoverable-button'"
5845
6028
  onToggle.bind="this.onClick"
5846
- dropdownStyle="this.dropdownStyle"
5847
6029
  />
5848
6030
  <div class="o-divider"/>
5849
6031
 
@@ -5953,6 +6135,27 @@
5953
6135
  </div>
5954
6136
  <TopBarComposer/>
5955
6137
  </div>
6138
+ <div
6139
+ t-if="this.fingerprints.isEnabled"
6140
+ class="irregularity-map d-flex align-items-center justify-content-between">
6141
+ <div
6142
+ t-on-click="() => this.fingerprints.disable()"
6143
+ role="button"
6144
+ title="This tool analyzes spreadsheet formulas for patterns and highlights inconsistencies. Irregularities may indicate potential errors in formula structures, references, or arguments. (Click to turn off)"
6145
+ class="h-100 d-flex align-items-center text-info px-3">
6146
+ <t t-call="o-spreadsheet-Icon.IRREGULARITY_MAP"/>
6147
+ Irregularity map
6148
+ </div>
6149
+ <div
6150
+ class="ps-3 h-100 flex-fill d-flex justify-content-between align-items-center rounded-0 alert alert-info ps-0 py-0 my-0">
6151
+ This tool analyzes formulas for patterns and highlights
6152
+ inconsistencies. Irregularities may indicate potential errors in formula
6153
+ structures, references or arguments.
6154
+ <div class="btn btn-link align-self-end" t-on-click="() => this.fingerprints.disable()">
6155
+ Turn off
6156
+ </div>
6157
+ </div>
6158
+ </div>
5956
6159
  </div>
5957
6160
  <Menu
5958
6161
  t-if="state.menuState.isOpen"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "18.1.0-alpha.6",
3
+ "version": "18.1.0-alpha.8",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",
@@ -66,6 +66,7 @@
66
66
  "body-parser": "^1.19.0",
67
67
  "chart.js": "4.4.5",
68
68
  "chartjs-adapter-luxon": "^1.3.1",
69
+ "chartjs-chart-geo": "^4.3.2",
69
70
  "cors": "^2.8.5",
70
71
  "eslint": "^6.8.0",
71
72
  "express": "^4.17.1",
@@ -79,7 +80,7 @@
79
80
  "jszip": "^3.6.0",
80
81
  "lint-staged": "^12.1.2",
81
82
  "live-server": "^1.2.1",
82
- "luxon": "^3.0.1",
83
+ "luxon": "^3.5.0",
83
84
  "minimist": "^1.2.8",
84
85
  "mockdate": "^3.0.2",
85
86
  "node-watch": "^0.7.3",