@odoo/o-spreadsheet 17.3.0-alpha.2 → 17.3.0-alpha.3

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 17.3.0-alpha.2
5
- @date 2024-04-05T14:01:48.832Z
6
- @hash 8c5a229
4
+ @version 17.3.0-alpha.3
5
+ @date 2024-04-10T12:29:04.461Z
6
+ @hash 80b5056
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
@@ -471,6 +471,7 @@
471
471
  t-on-compositionstart="onCompositionStart"
472
472
  t-on-compositionend="onCompositionEnd"
473
473
  t-on-dblclick="onDblClick"
474
+ t-on-contextmenu="onContextMenu"
474
475
  />
475
476
 
476
477
  <div
@@ -574,7 +575,12 @@
574
575
  class="o-topbar-composer bg-white user-select-text"
575
576
  t-on-click.stop=""
576
577
  t-att-style="containerStyle">
577
- <Composer focus="focus" inputStyle="composerStyle" onComposerContentFocused.bind="onFocus"/>
578
+ <Composer
579
+ focus="focus"
580
+ inputStyle="composerStyle"
581
+ onComposerContentFocused.bind="onFocus"
582
+ delimitation="delimitation"
583
+ />
578
584
  </div>
579
585
  </t>
580
586
 
@@ -583,7 +589,7 @@
583
589
  class="o-grid o-two-columns"
584
590
  tabindex="-1"
585
591
  t-on-wheel="onMouseWheel"
586
- t-on-click="onClosePopover">
592
+ t-on-pointerdown="onClosePopover">
587
593
  <div class="mx-auto h-100 position-relative" t-ref="grid" t-att-style="gridContainer">
588
594
  <GridOverlay
589
595
  onCellHovered.bind="onCellHovered"
@@ -606,7 +612,6 @@
606
612
  t-on-contextmenu.prevent=""
607
613
  t-att-style="getCellClickableStyle(clickableCell.coordinates)"
608
614
  />
609
- <FilterIconsOverlay/>
610
615
  </div>
611
616
  <VerticalScrollBar/>
612
617
  <HorizontalScrollBar/>
@@ -806,21 +811,23 @@
806
811
  </t>
807
812
 
808
813
  <t t-name="o-spreadsheet-FilterIcon">
809
- <div class="o-filter-icon" t-att-class="iconClass" t-on-click.stop="onClick">
814
+ <div class="o-filter-icon" t-att-class="iconClass" t-on-click="onClick">
810
815
  <t t-if="isFilterActive" t-call="o-spreadsheet-Icon.FILTER_ICON_ACTIVE"/>
811
816
  <t t-else="" t-call="o-spreadsheet-Icon.FILTER_ICON"/>
812
817
  </div>
813
818
  </t>
814
819
 
815
820
  <t t-name="o-spreadsheet-FilterIconsOverlay">
816
- <t
817
- t-foreach="getFilterHeadersPositions()"
818
- t-as="position"
819
- t-key="'filter'+position.col + '_' + position.row">
820
- <GridCellIcon cellPosition="position" offset="props.gridPosition" horizontalAlign="'right'">
821
- <FilterIcon cellPosition="position"/>
822
- </GridCellIcon>
823
- </t>
821
+ <div t-on-pointerdown.stop="this.props.onMouseDown">
822
+ <t
823
+ t-foreach="getFilterHeadersPositions()"
824
+ t-as="position"
825
+ t-key="'filter'+position.col + '_' + position.row">
826
+ <GridCellIcon cellPosition="position" horizontalAlign="'right'">
827
+ <FilterIcon cellPosition="position"/>
828
+ </GridCellIcon>
829
+ </t>
830
+ </div>
824
831
  </t>
825
832
 
826
833
  <t t-name="o-spreadsheet-FilterMenu">
@@ -948,7 +955,6 @@
948
955
  t-on-click="focusDefaultElement"
949
956
  t-on-keydown="onKeydown"
950
957
  t-on-wheel="onMouseWheel"
951
- t-on-contextmenu="onInputContextMenu"
952
958
  t-ref="grid">
953
959
  <GridOverlay
954
960
  onCellClicked.bind="onCellClicked"
@@ -961,7 +967,10 @@
961
967
  onFigureDeleted.bind="focusDefaultElement"
962
968
  />
963
969
  <HeadersOverlay onOpenContextMenu="(type, x, y) => this.toggleContextMenu(type, x, y)"/>
964
- <GridComposer gridDims="env.model.getters.getSheetViewDimensionWithHeaders()"/>
970
+ <GridComposer
971
+ gridDims="env.model.getters.getSheetViewDimensionWithHeaders()"
972
+ onInputContextMenu.bind="onInputContextMenu"
973
+ />
965
974
  <canvas t-ref="canvas"/>
966
975
  <t
967
976
  t-foreach="env.model.getters.getClientsToDisplay()"
@@ -996,7 +1005,6 @@
996
1005
  position="menuState.position"
997
1006
  onClose="() => this.closeMenu()"
998
1007
  />
999
- <FilterIconsOverlay gridPosition="{ x: HEADER_WIDTH, y : HEADER_HEIGHT }"/>
1000
1008
  <VerticalScrollBar topOffset="HEADER_HEIGHT"/>
1001
1009
  <HorizontalScrollBar leftOffset="HEADER_WIDTH"/>
1002
1010
  <div class="o-scrollbar corner"/>
@@ -1049,6 +1057,7 @@
1049
1057
  t-on-contextmenu.stop.prevent="onContextMenu">
1050
1058
  <FiguresContainer onFigureDeleted="props.onFigureDeleted"/>
1051
1059
  <DataValidationOverlay/>
1060
+ <FilterIconsOverlay onMouseDown="(ev) => this.onMouseDown(ev, {closePopover: false})"/>
1052
1061
  <GridAddRowsFooter
1053
1062
  t-if="!env.model.getters.isReadonly()"
1054
1063
  t-key="env.model.getters.getActiveSheetId()"
@@ -2610,10 +2619,17 @@ https://fontawesome.com/license -->
2610
2619
 
2611
2620
  <t t-name="o-spreadsheet-BarChartDesignPanel">
2612
2621
  <div>
2613
- <ChartColor
2614
- currentColor="props.definition.background"
2615
- onColorPicked.bind="updateBackgroundColor"
2616
- />
2622
+ <Section class="'o-chart-background-color'">
2623
+ <t t-set-slot="title">Background color</t>
2624
+ <div class="d-flex align-items-center">
2625
+ <span class="me-2">Select a color...</span>
2626
+ <RoundColorPicker
2627
+ currentColor="props.definition.background"
2628
+ onColorPicked.bind="updateBackgroundColor"
2629
+ title="backgroundColorTitle"
2630
+ />
2631
+ </div>
2632
+ </Section>
2617
2633
  <ChartTitle title="title" update.bind="updateTitle"/>
2618
2634
  <Section>
2619
2635
  <t t-set-slot="title">Vertical axis position</t>
@@ -2641,24 +2657,6 @@ https://fontawesome.com/license -->
2641
2657
  </div>
2642
2658
  </t>
2643
2659
 
2644
- <t t-name="o-spreadsheet.ChartColor">
2645
- <Section class="'o-chart-background-color'">
2646
- <t t-set-slot="title">Background color</t>
2647
- <div class="d-flex align-items-center">
2648
- <span class="pe-1">Select a color...</span>
2649
- <t t-set="background_color">Background color</t>
2650
- <ColorPickerWidget
2651
- currentColor="props.currentColor"
2652
- showColorPicker="state.pickerOpened"
2653
- toggleColorPicker.bind="togglePicker"
2654
- onColorPicked="props.onColorPicked"
2655
- title="background_color"
2656
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
2657
- />
2658
- </div>
2659
- </Section>
2660
- </t>
2661
-
2662
2660
  <t t-name="o-spreadsheet.ChartDataSeries">
2663
2661
  <Section class="'o-data-series'">
2664
2662
  <t t-set-slot="title" t-esc="title"/>
@@ -2751,10 +2749,17 @@ https://fontawesome.com/license -->
2751
2749
 
2752
2750
  <t t-name="o-spreadsheet-ComboChartDesignPanel">
2753
2751
  <div>
2754
- <ChartColor
2755
- currentColor="props.definition.background"
2756
- onColorPicked.bind="updateBackgroundColor"
2757
- />
2752
+ <Section class="'o-chart-background-color'">
2753
+ <t t-set-slot="title">Background color</t>
2754
+ <div class="d-flex align-items-center">
2755
+ <span class="me-2">Select a color...</span>
2756
+ <RoundColorPicker
2757
+ currentColor="props.definition.background"
2758
+ onColorPicked.bind="updateBackgroundColor"
2759
+ title="backgroundColorTitle"
2760
+ />
2761
+ </div>
2762
+ </Section>
2758
2763
  <ChartTitle title="title" update.bind="updateTitle"/>
2759
2764
  <Section t-if="!props.definition.useBothYAxis">
2760
2765
  <t t-set-slot="title">Vertical axis position</t>
@@ -2800,10 +2805,17 @@ https://fontawesome.com/license -->
2800
2805
 
2801
2806
  <t t-name="o-spreadsheet-GaugeChartDesignPanel">
2802
2807
  <div>
2803
- <ChartColor
2804
- currentColor="props.definition.background"
2805
- onColorPicked.bind="updateBackgroundColor"
2806
- />
2808
+ <Section class="'o-chart-background-color'">
2809
+ <t t-set-slot="title">Background color</t>
2810
+ <div class="d-flex align-items-center">
2811
+ <span class="me-2">Select a color...</span>
2812
+ <RoundColorPicker
2813
+ currentColor="props.definition.background"
2814
+ onColorPicked.bind="updateBackgroundColor"
2815
+ title="backgroundColorTitle"
2816
+ />
2817
+ </div>
2818
+ </Section>
2807
2819
  <ChartTitle title="title" update.bind="updateTitle"/>
2808
2820
  <Section>
2809
2821
  <t t-set-slot="title">Range</t>
@@ -2868,12 +2880,9 @@ https://fontawesome.com/license -->
2868
2880
 
2869
2881
  <tr>
2870
2882
  <td>
2871
- <ColorPickerWidget
2883
+ <RoundColorPicker
2872
2884
  currentColor="sectionRule.colors.upperColor"
2873
- toggleColorPicker="(ev) => this.toggleMenu('sectionColor-upperColor', ev)"
2874
- showColorPicker="state.openedMenu === 'sectionColor-upperColor'"
2875
2885
  onColorPicked="(color) => this.updateSectionColor('upperColor', color)"
2876
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
2877
2886
  />
2878
2887
  </td>
2879
2888
  <td>Else</td>
@@ -2888,12 +2897,9 @@ https://fontawesome.com/license -->
2888
2897
  <t t-name="o-spreadsheet-GaugeChartColorSectionTemplateRow">
2889
2898
  <tr>
2890
2899
  <td>
2891
- <ColorPickerWidget
2900
+ <RoundColorPicker
2892
2901
  currentColor="sectionColor"
2893
- toggleColorPicker="(ev) => this.toggleMenu('sectionColor-'+sectionType, ev)"
2894
- showColorPicker="state.openedMenu === 'sectionColor-'+sectionType"
2895
2902
  onColorPicked="(color) => this.updateSectionColor(sectionType, color)"
2896
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
2897
2903
  />
2898
2904
  </td>
2899
2905
  <td>When value is below</td>
@@ -2950,10 +2956,17 @@ https://fontawesome.com/license -->
2950
2956
 
2951
2957
  <t t-name="o-spreadsheet-LineBarPieDesignPanel">
2952
2958
  <div>
2953
- <ChartColor
2954
- currentColor="props.definition.background"
2955
- onColorPicked.bind="updateBackgroundColor"
2956
- />
2959
+ <Section class="'o-chart-background-color'">
2960
+ <t t-set-slot="title">Background color</t>
2961
+ <div class="d-flex align-items-center">
2962
+ <span class="me-2">Select a color...</span>
2963
+ <RoundColorPicker
2964
+ currentColor="props.definition.background"
2965
+ onColorPicked.bind="updateBackgroundColor"
2966
+ title="backgroundColorTitle"
2967
+ />
2968
+ </div>
2969
+ </Section>
2957
2970
  <ChartTitle title="title" update.bind="updateTitle"/>
2958
2971
  <Section>
2959
2972
  <t t-set-slot="title">Legend position</t>
@@ -3014,10 +3027,17 @@ https://fontawesome.com/license -->
3014
3027
 
3015
3028
  <t t-name="o-spreadsheet-LineChartDesignPanel">
3016
3029
  <div>
3017
- <ChartColor
3018
- currentColor="props.definition.background"
3019
- onColorPicked.bind="updateBackgroundColor"
3020
- />
3030
+ <Section class="'o-chart-background-color'">
3031
+ <t t-set-slot="title">Background color</t>
3032
+ <div class="d-flex align-items-center">
3033
+ <span class="me-2">Select a color...</span>
3034
+ <RoundColorPicker
3035
+ currentColor="props.definition.background"
3036
+ onColorPicked.bind="updateBackgroundColor"
3037
+ title="backgroundColorTitle"
3038
+ />
3039
+ </div>
3040
+ </Section>
3021
3041
  <ChartTitle title="title" update.bind="updateTitle"/>
3022
3042
  <Section>
3023
3043
  <t t-set-slot="title">Vertical axis position</t>
@@ -3163,6 +3183,7 @@ https://fontawesome.com/license -->
3163
3183
  <option value="text">Absolute value</option>
3164
3184
  <option value="difference">Value change from key value</option>
3165
3185
  <option value="percentage">Percentage change from key value</option>
3186
+ <option value="progress">Progress bar</option>
3166
3187
  </select>
3167
3188
  </Section>
3168
3189
 
@@ -3174,10 +3195,17 @@ https://fontawesome.com/license -->
3174
3195
  <t t-set="color_up">Color Up</t>
3175
3196
  <t t-set="color_down">Color Down</t>
3176
3197
  <div>
3177
- <ChartColor
3178
- currentColor="props.definition.background"
3179
- onColorPicked="(color) => this.setColor(color, 'backgroundColor')"
3180
- />
3198
+ <Section class="'o-chart-background-color'">
3199
+ <t t-set-slot="title">Background color</t>
3200
+ <div class="d-flex align-items-center">
3201
+ <span class="me-2">Select a color...</span>
3202
+ <RoundColorPicker
3203
+ currentColor="props.definition.background"
3204
+ onColorPicked="(color) => this.setColor(color, 'backgroundColor')"
3205
+ title="backgroundColorTitle"
3206
+ />
3207
+ </div>
3208
+ </Section>
3181
3209
  <ChartTitle title="title" update.bind="updateTitle"/>
3182
3210
  <Section>
3183
3211
  <t t-set-slot="title">Baseline description</t>
@@ -3190,30 +3218,33 @@ https://fontawesome.com/license -->
3190
3218
  </Section>
3191
3219
  </div>
3192
3220
  <Section class="'o-chart-baseline-color'">
3193
- <t t-set-slot="title">Baseline color</t>
3194
- <div class="d-flex align-items-center">
3195
- <span class="pe-1">Color on value increase</span>
3196
- <ColorPickerWidget
3221
+ <t t-set-slot="title" t-esc="colorsSectionTitle"/>
3222
+ <div class="d-flex align-items-center mb-2">
3223
+ <RoundColorPicker
3197
3224
  currentColor="props.definition.baselineColorUp"
3198
- toggleColorPicker="() => this.toggleColorPicker('baselineColorUp')"
3199
- showColorPicker="state.openedColorPicker === 'baselineColorUp'"
3200
3225
  onColorPicked="(color) => this.setColor(color, 'baselineColorUp')"
3201
3226
  title="color_up"
3202
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
3203
3227
  />
3228
+ <span class="ps-2">Color on value increase</span>
3204
3229
  </div>
3205
3230
  <div class="d-flex align-items-center">
3206
- <span class="pe-1">Color on value decrease</span>
3207
- <ColorPickerWidget
3231
+ <RoundColorPicker
3208
3232
  currentColor="props.definition.baselineColorDown"
3209
- toggleColorPicker="() => this.toggleColorPicker('baselineColorDown')"
3210
- showColorPicker="state.openedColorPicker === 'baselineColorDown'"
3211
3233
  onColorPicked="(color) => this.setColor(color, 'baselineColorDown')"
3212
3234
  title="color_down"
3213
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
3214
3235
  />
3236
+ <span class="ps-2">Color on value decrease</span>
3215
3237
  </div>
3216
3238
  </Section>
3239
+ <Section class="'pt-1'">
3240
+ <t t-set-slot="title">Number formatting</t>
3241
+ <Checkbox
3242
+ name="'humanizeNumbers'"
3243
+ label="humanizeNumbersLabel"
3244
+ value="props.definition.humanize"
3245
+ onChange.bind="updateHumanizeNumbers"
3246
+ />
3247
+ </Section>
3217
3248
  </t>
3218
3249
 
3219
3250
  <t t-name="o-spreadsheet.Checkbox">
@@ -3234,6 +3265,22 @@ https://fontawesome.com/license -->
3234
3265
  </label>
3235
3266
  </t>
3236
3267
 
3268
+ <t t-name="o-spreadsheet.RoundColorPicker">
3269
+ <div
3270
+ class="o-round-color-picker-button rounded-circle"
3271
+ t-ref="colorPickerButton"
3272
+ t-on-click.stop="togglePicker"
3273
+ t-att-title="props.title"
3274
+ t-att-style="buttonStyle"
3275
+ />
3276
+ <ColorPicker
3277
+ t-if="state.pickerOpened"
3278
+ anchorRect="colorPickerAnchorRect"
3279
+ onColorPicked.bind="onColorPicked"
3280
+ currentColor="props.currentColor"
3281
+ />
3282
+ </t>
3283
+
3237
3284
  <t t-name="o_spreadsheet.Section">
3238
3285
  <div class="o-section" t-att-class="props.class">
3239
3286
  <t t-if="props.slots.title">
@@ -3468,19 +3515,22 @@ https://fontawesome.com/license -->
3468
3515
  type="text"
3469
3516
  class="o-input o-threshold-value o-required"
3470
3517
  t-model="rule[thresholdType].value"
3471
- t-att-class="{ 'o-invalid': isValueInvalid(thresholdType) }"
3518
+ t-att-class="{ 'o-invalid': isValueInvalid(thresholdType), 'invisible': threshold === undefined }"
3472
3519
  t-if="threshold !== undefined and threshold.type !== 'value'"
3473
3520
  />
3474
- <input type="text" class="o-input o-threshold-value" t-else="" disabled="1"/>
3475
- <ColorPickerWidget
3476
- currentColor="getThresholdColor(threshold)"
3477
- toggleColorPicker="(ev) => this.toggleMenu('colorScale-'+thresholdType+'Color', ev)"
3478
- showColorPicker="state.openedMenu === 'colorScale-'+thresholdType+'Color'"
3479
- onColorPicked="(color) => this.setColorScaleColor(thresholdType, color)"
3480
- title="fill_color"
3481
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
3482
- disabled="threshold === undefined"
3521
+ <input
3522
+ type="text"
3523
+ t-attf-class="o-input o-threshold-value {{ threshold === undefined ? 'invisible' : ''}}"
3524
+ t-else=""
3525
+ disabled="1"
3483
3526
  />
3527
+ <div t-attf-class="flex-shrink-0 ms-1 {{ threshold === undefined ? 'invisible' : ''}}">
3528
+ <RoundColorPicker
3529
+ currentColor="getThresholdColor(threshold)"
3530
+ onColorPicked="(color) => this.setColorScaleColor(thresholdType, color)"
3531
+ title="fill_color"
3532
+ />
3533
+ </div>
3484
3534
  </div>
3485
3535
  </t>
3486
3536
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.3.0-alpha.2",
3
+ "version": "17.3.0-alpha.3",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",