@odoo/o-spreadsheet 18.4.0-alpha.1 → 18.4.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.
@@ -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.4.0-alpha.1
5
- @date 2025-05-02T12:35:37.038Z
6
- @hash 50d42e1
4
+ @version 18.4.0-alpha.2
5
+ @date 2025-05-12T05:28:52.249Z
6
+ @hash a11158e
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ValidationMessages">
@@ -1017,7 +1017,7 @@
1017
1017
  <t t-name="o-spreadsheet-PivotDimensionGranularity">
1018
1018
  <div class="d-flex flex-row">
1019
1019
  <div class="d-flex flex-row py-1 px-2 w-100 small">
1020
- <t t-set="granularity" t-value="props.dimension.granularity"/>
1020
+ <t t-set="granularityProps" t-value="props.dimension.granularity || 'month'"/>
1021
1021
  <div class="pivot-dim-operator-label">Granularity</div>
1022
1022
  <select
1023
1023
  class="o-input flex-grow-1"
@@ -1026,10 +1026,10 @@
1026
1026
  t-foreach="props.allGranularities"
1027
1027
  t-as="granularity"
1028
1028
  t-key="granularity"
1029
- t-if="props.availableGranularities.has(granularity) || granularity === props.dimension.granularity"
1029
+ t-if="props.availableGranularities.has(granularity) || granularity === granularityProps"
1030
1030
  t-att-value="granularity"
1031
1031
  t-esc="periods[granularity]"
1032
- t-att-selected="granularity === props.dimension.granularity or (granularity === 'month' and !props.dimension.granularity)"
1032
+ t-att-selected="granularity === granularityProps or (granularity === 'month' and !granularityProps)"
1033
1033
  />
1034
1034
  </select>
1035
1035
  </div>
@@ -2426,6 +2426,10 @@
2426
2426
  defaultStyle="defaults.valuesDesign"
2427
2427
  />
2428
2428
  </Section>
2429
+ <PieHoleSize
2430
+ value="props.definition.pieHolePercentage ?? 25"
2431
+ onValueChange.bind="onPieHoleSizeChange"
2432
+ />
2429
2433
  </t>
2430
2434
  </SidePanelCollapsible>
2431
2435
  </t>
@@ -2583,6 +2587,11 @@
2583
2587
  onChange="(showValues) => props.updateChart(this.props.figureId, { showValues })"
2584
2588
  />
2585
2589
  </Section>
2590
+ <PieHoleSize
2591
+ t-if="props.definition.isDoughnut"
2592
+ value="props.definition.pieHolePercentage ?? 50"
2593
+ onValueChange.bind="onPieHoleSizeChange"
2594
+ />
2586
2595
  </t>
2587
2596
  </GeneralDesignEditor>
2588
2597
  </t>
@@ -2787,9 +2796,11 @@
2787
2796
 
2788
2797
  <ChartDataSeries
2789
2798
  ranges="dataRanges"
2790
- onSelectionChanged="(ranges) => this.onDataSeriesRangesChanged(ranges)"
2791
- onSelectionConfirmed="() => this.onDataSeriesConfirmed()"
2792
- hasSingleRange="true"
2799
+ onSelectionChanged.bind="onDataSeriesRangesChanged"
2800
+ onSelectionConfirmed.bind="onDataSeriesConfirmed"
2801
+ onSelectionReordered.bind="onDataSeriesReordered"
2802
+ onSelectionRemoved.bind="onDataSeriesRemoved"
2803
+ maxNumberOfUsedRanges="maxNumberOfUsedRanges"
2793
2804
  />
2794
2805
  <ChartLabelRange
2795
2806
  range="this.getLabelRange()"
@@ -3610,6 +3621,22 @@
3610
3621
  </SidePanelCollapsible>
3611
3622
  </t>
3612
3623
 
3624
+ <t t-name="o-spreadsheet.PieHoleSize">
3625
+ <Section class="'pt-0'" title.translate="Center radius">
3626
+ <div class="d-flex flex-row">
3627
+ <input
3628
+ t-att-value="props.value"
3629
+ type="number"
3630
+ class="o-input o-pie-hole-size-input"
3631
+ min="0"
3632
+ max="95"
3633
+ t-on-change="(ev) => debouncedOnChange(ev.target.value)"
3634
+ />
3635
+ %
3636
+ </div>
3637
+ </Section>
3638
+ </t>
3639
+
3613
3640
  <t t-name="o-spreadsheet-ChartLegend">
3614
3641
  <Section class="'pt-0'" title.translate="Legend position">
3615
3642
  <select
@@ -3654,6 +3681,7 @@
3654
3681
  onSelectionConfirmed.bind="onDataSeriesConfirmed"
3655
3682
  onSelectionReordered.bind="onDataSeriesReordered"
3656
3683
  onSelectionRemoved.bind="onDataSeriesRemoved"
3684
+ maxNumberOfUsedRanges="maxNumberOfUsedRanges"
3657
3685
  />
3658
3686
  <ChartLabelRange
3659
3687
  range="this.getLabelRange()"
@@ -3707,6 +3735,8 @@
3707
3735
  onSelectionReordered="props.onSelectionReordered"
3708
3736
  onSelectionRemoved="props.onSelectionRemoved"
3709
3737
  colors="colors"
3738
+ disabledRanges="disabledRanges"
3739
+ disabledRangeTitle.translate="Excluded due to chart limits. Drag to swap with another range."
3710
3740
  />
3711
3741
  </Section>
3712
3742
  </t>
@@ -3810,6 +3840,7 @@
3810
3840
  t-att-style="getColor(range)"
3811
3841
  class="o-input mb-2"
3812
3842
  t-att-class="{
3843
+ 'o-disabled-ranges' : range.disabled and !range.isFocused,
3813
3844
  'o-focused' : range.isFocused,
3814
3845
  'o-invalid border-danger position-relative': isInvalid || !range.isValidRange,
3815
3846
  'text-decoration-underline': range.xc and range.isFocused and state.mode === 'select-range'
@@ -3818,10 +3849,16 @@
3818
3849
  />
3819
3850
  <span
3820
3851
  t-if="isInvalid || !range.isValidRange"
3821
- class="error-icon text-danger position-absolute d-flex align-items-center"
3852
+ class="input-icon text-danger position-absolute d-flex align-items-center"
3822
3853
  title="This range is invalid">
3823
3854
  <t t-call="o-spreadsheet-Icon.ERROR"/>
3824
3855
  </span>
3856
+ <span
3857
+ class="input-icon o-disabled-ranges position-absolute d-flex align-items-center"
3858
+ t-if="!range.isFocused and range.disabled"
3859
+ t-att-title="props.disabledRangeTitle">
3860
+ <t t-call="o-spreadsheet-Icon.CIRCLE_INFO"/>
3861
+ </span>
3825
3862
  </div>
3826
3863
  <button
3827
3864
  class="border-0 bg-transparent fw-bold o-remove-selection o-button-icon pe-0"
@@ -3830,7 +3867,6 @@
3830
3867
  <t t-call="o-spreadsheet-Icon.TRASH_FILLED"/>
3831
3868
  </button>
3832
3869
  </div>
3833
-
3834
3870
  <div class="d-flex flex-row w-100 o-selection-input">
3835
3871
  <button class="o-button o-add-selection" t-if="canAddRange" t-on-click="addEmptyInput">
3836
3872
  Add range
@@ -5716,6 +5752,9 @@
5716
5752
  t-key="this.props.figureUI.id"
5717
5753
  />
5718
5754
  </div>
5755
+ <div t-if="env.isDashboard()" class="position-absolute top-0 end-0">
5756
+ <ChartDashboardMenu figureUI="props.figureUI"/>
5757
+ </div>
5719
5758
  </t>
5720
5759
 
5721
5760
  <t t-name="o-spreadsheet-FigureComponent">
@@ -5811,6 +5850,32 @@
5811
5850
  <canvas class="o-figure-canvas o-gauge-chart w-100 h-100" t-ref="chartContainer"/>
5812
5851
  </t>
5813
5852
 
5853
+ <t t-name="spreadsheet.ChartDashboardMenu">
5854
+ <div class="o-dashboard-chart-select position-absolute top-0 end-0" t-on-click.stop="">
5855
+ <div class="d-flex flex-row px-1" t-att-style="backgroundColor">
5856
+ <t t-foreach="getAvailableTypes()" t-as="type" t-key="type.chartSubtype">
5857
+ <button
5858
+ t-attf-class=" {{type.icon}} {{type.chartType === selectedChartType ? 'active' : ''}}"
5859
+ class="o-chart-dashboard-item btn mt-1 me-1 p-1 "
5860
+ t-att-title="type.displayName"
5861
+ t-on-click="() => this.onTypeChange(type.chartSubtype)"
5862
+ t-att-data-id="type.chartSubtype"
5863
+ />
5864
+ </t>
5865
+ <button
5866
+ class="o-chart-dashboard-item btn mt-1 p-1 fa fa-ellipsis-v"
5867
+ t-on-click="openContextMenu"
5868
+ />
5869
+ </div>
5870
+ <Menu
5871
+ t-if="menuState.isOpen"
5872
+ anchorRect="menuState.anchorRect"
5873
+ menuItems="menuState.menuItems"
5874
+ onClose="() => this.menuState.isOpen=false"
5875
+ />
5876
+ </div>
5877
+ </t>
5878
+
5814
5879
  <t t-name="o-spreadsheet-ChartJsComponent">
5815
5880
  <canvas class="o-figure-canvas w-100 h-100" t-att-style="canvasStyle" t-ref="graphContainer"/>
5816
5881
  </t>
@@ -6063,6 +6128,7 @@
6063
6128
  t-on-dblclick="onDblClick"
6064
6129
  t-on-contextmenu="onContextMenu"
6065
6130
  t-on-blur="onBlur"
6131
+ t-on-wheel="onWheel"
6066
6132
  />
6067
6133
  </div>
6068
6134
  <div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "18.4.0-alpha.1",
3
+ "version": "18.4.0-alpha.2",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",