@odoo/o-spreadsheet 18.1.0-alpha.7 → 18.1.0

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.7
5
- @date 2024-12-05T10:41:08.683Z
6
- @hash 7b1c39b
4
+ @version 18.1.0
5
+ @date 2024-12-26T06:37:49.767Z
6
+ @hash c520e89
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
 
@@ -1799,6 +1801,11 @@
1799
1801
  <path fill="currentColor" d="M4 14v2h10v-2H4m0-8v2h10V6H4m-2 6h14v-2H2v2M2 2v2h14V2H2"/>
1800
1802
  </svg>
1801
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>
1802
1809
  <t t-name="o-spreadsheet-Icon.ALIGN_RIGHT">
1803
1810
  <svg class="o-icon align-right">
1804
1811
  <path fill="currentColor" d="M6 16h10v-2H6v2m-4-4h14v-2H2v2M2 2v2h14V2H2m4 6h10V6H6v2"/>
@@ -3266,6 +3273,33 @@
3266
3273
  />
3267
3274
  </svg>
3268
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>
3269
3303
 
3270
3304
  <t t-name="o-spreadsheet-ChartTypePicker">
3271
3305
  <t t-set="selectedChartProperties" t-value="getSelectedChartSubtypeProperties()"/>
@@ -3560,6 +3594,120 @@
3560
3594
  </tr>
3561
3595
  </t>
3562
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
+
3563
3711
  <t t-name="o-spreadsheet-LineConfigPanel">
3564
3712
  <div>
3565
3713
  <Section class="'pt-0'">
@@ -3903,6 +4051,7 @@
3903
4051
  <t t-name="o-spreadsheet.Checkbox">
3904
4052
  <label
3905
4053
  class="o-checkbox d-flex align-items-center"
4054
+ role="button"
3906
4055
  t-att-title="props.title"
3907
4056
  t-att-class="{'text-muted': props.disabled }"
3908
4057
  t-attf-class="{{props.className}}">
@@ -4254,6 +4403,7 @@
4254
4403
  <RoundColorPicker
4255
4404
  currentColor="colorNumberString(rule.color)"
4256
4405
  onColorPicked.bind="updateDataBarColor"
4406
+ disableNoColor="true"
4257
4407
  />
4258
4408
  <div class="o-section-subtitle">Range of values</div>
4259
4409
  <SelectionInput
@@ -4558,11 +4708,11 @@
4558
4708
  onChange.bind="toggleAccountingFormat"
4559
4709
  />
4560
4710
  <div class="o-format-examples mt-4" t-if="selectedFormat">
4561
- <table>
4711
+ <table class="w-100">
4562
4712
  <t t-foreach="getFormatExamples()" t-as="example" t-key="example_index">
4563
4713
  <tr>
4564
- <td class="pe-3 o-fw-bold" t-esc="example.label"/>
4565
- <td t-esc="example.value"/>
4714
+ <td class="w-25 pe-3 o-fw-bold" t-esc="example.label"/>
4715
+ <td class="w-75 text-truncate" t-esc="example.value"/>
4566
4716
  </tr>
4567
4717
  </t>
4568
4718
  </table>
@@ -5118,6 +5268,7 @@
5118
5268
  </div>
5119
5269
  </t>
5120
5270
  </div>
5271
+ <PivotSortSection definition="props.definition" pivotId="props.pivotId"/>
5121
5272
  </t>
5122
5273
 
5123
5274
  <t t-name="o-spreadsheet-PivotMeasureEditor">
@@ -5169,6 +5320,24 @@
5169
5320
  </PivotDimension>
5170
5321
  </t>
5171
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
+
5172
5341
  <t t-name="o-spreadsheet-PivotMeasureDisplayPanel">
5173
5342
  <Section title.translate="Show measure as:">
5174
5343
  <select
@@ -5593,7 +5762,11 @@
5593
5762
  <input type="text" class="o-input" t-model="state.styleName"/>
5594
5763
  </Section>
5595
5764
  <Section class="'pt-1'" title.translate="Style color">
5596
- <RoundColorPicker currentColor="state.primaryColor" onColorPicked.bind="onColorPicked"/>
5765
+ <RoundColorPicker
5766
+ currentColor="state.primaryColor"
5767
+ onColorPicked.bind="onColorPicked"
5768
+ disableNoColor="true"
5769
+ />
5597
5770
  </Section>
5598
5771
  <Section class="'pt-1'" title.translate="Style template">
5599
5772
  <div class="d-flex flex-wrap">
@@ -5962,6 +6135,27 @@
5962
6135
  </div>
5963
6136
  <TopBarComposer/>
5964
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>
5965
6159
  </div>
5966
6160
  <Menu
5967
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.7",
3
+ "version": "18.1.0",
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",
@@ -136,6 +137,6 @@
136
137
  "*": "prettier --write"
137
138
  },
138
139
  "publishConfig": {
139
- "tag": "alpha"
140
+ "tag": "latest"
140
141
  }
141
142
  }