@odoo/o-spreadsheet 17.2.0-alpha.5 → 17.2.0-alpha.6

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.2.0-alpha.5
5
- @date 2024-02-16T14:28:32.318Z
6
- @hash 0c69dd8
4
+ @version 17.2.0-alpha.6
5
+ @date 2024-02-28T12:29:23.715Z
6
+ @hash 318a04e
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
@@ -53,7 +53,7 @@
53
53
  <div
54
54
  class="o-autofill-handler"
55
55
  t-att-style="handlerStyle"
56
- t-on-mousedown="onMouseDown"
56
+ t-on-pointerdown="onMouseDown"
57
57
  t-on-dblclick="onDblClick"
58
58
  />
59
59
  <t t-set="tooltip" t-value="getTooltip()"/>
@@ -260,7 +260,7 @@
260
260
  <Ripple>
261
261
  <div
262
262
  class="o-sheet d-flex align-items-center user-select-none text-nowrap "
263
- t-on-mousedown="(ev) => this.onMouseDown(ev)"
263
+ t-on-pointerdown="(ev) => this.onMouseDown(ev)"
264
264
  t-on-contextmenu.prevent="(ev) => this.onContextMenu(ev)"
265
265
  t-ref="sheetDiv"
266
266
  t-att-style="props.style"
@@ -356,13 +356,13 @@
356
356
  <div
357
357
  class="o-gradient"
358
358
  t-on-click.stop=""
359
- t-on-mousedown="dragGradientPointer"
359
+ t-on-pointerdown="dragGradientPointer"
360
360
  t-att-style="gradientHueStyle">
361
361
  <div class="saturation w-100 h-100 position-absolute pe-none"/>
362
362
  <div class="lightness w-100 h-100 position-absolute pe-none"/>
363
363
  <div class="magnifier pe-none" t-att-style="pointerStyle"/>
364
364
  </div>
365
- <div class="o-hue-container" t-on-mousedown="dragHuePointer">
365
+ <div class="o-hue-container" t-on-pointerdown="dragHuePointer">
366
366
  <div class="o-hue-picker" t-on-click.stop=""/>
367
367
  <div class="o-hue-slider pe-none" t-att-style="sliderStyle">
368
368
  <t t-call="o-spreadsheet-Icon.TRIANGLE_UP"/>
@@ -423,15 +423,15 @@
423
423
  <div
424
424
  t-ref="autoCompleteList"
425
425
  t-att-class="{
426
- 'o-autocomplete-dropdown':props.values.length }">
427
- <t t-foreach="props.values" t-as="v" t-key="v.text">
426
+ 'o-autocomplete-dropdown': props.proposals.length}">
427
+ <t t-foreach="props.proposals" t-as="proposal" t-key="proposal.text">
428
428
  <div
429
429
  class="d-flex flex-column text-start"
430
- t-att-class="{'o-autocomplete-value-focus': props.selectedIndex === v_index}"
431
- t-on-click="() => this.props.onValueSelected(v.text)"
432
- t-on-mousemove="() => this.props.onValueHovered(v_index)">
430
+ t-att-class="{'o-autocomplete-value-focus': props.selectedIndex === proposal_index}"
431
+ t-on-click="() => this.props.onValueSelected(proposal.text)"
432
+ t-on-pointermove="() => this.props.onValueHovered(proposal_index)">
433
433
  <div class="o-autocomplete-value text-truncate">
434
- <t t-set="htmlContent" t-value="props.getHtmlContent(v.text)"/>
434
+ <t t-set="htmlContent" t-value="proposal.htmlContent || [{ value: proposal.text}]"/>
435
435
  <span
436
436
  t-foreach="htmlContent"
437
437
  t-as="content"
@@ -443,8 +443,8 @@
443
443
  </div>
444
444
  <div
445
445
  class="o-autocomplete-description text-truncate"
446
- t-esc="v.description"
447
- t-if="props.selectedIndex === v_index"
446
+ t-esc="proposal.description"
447
+ t-if="props.selectedIndex === proposal_index"
448
448
  />
449
449
  </div>
450
450
  </t>
@@ -464,7 +464,7 @@
464
464
  t-on-keydown="onKeydown"
465
465
  t-on-mousewheel.stop=""
466
466
  t-on-input="onInput"
467
- t-on-mousedown="onMousedown"
467
+ t-on-pointerdown="onMousedown"
468
468
  t-on-click="onClick"
469
469
  t-on-keyup="onKeyup"
470
470
  t-on-paste="onPaste"
@@ -474,20 +474,19 @@
474
474
  />
475
475
 
476
476
  <div
477
- t-if="props.focus !== 'inactive' and (autoCompleteState.showProvider or functionDescriptionState.showDescription)"
477
+ t-if="props.focus !== 'inactive' and (autoCompleteState.provider or functionDescriptionState.showDescription)"
478
478
  class="o-composer-assistant shadow"
479
479
  t-att-style="assistantStyle"
480
480
  t-on-wheel.stop=""
481
- t-on-mousedown.prevent.stop=""
481
+ t-on-pointerdown.prevent.stop=""
482
482
  t-on-click.prevent.stop=""
483
- t-on-mouseup.prevent.stop="">
483
+ t-on-pointerup.prevent.stop="">
484
484
  <TextValueProvider
485
- t-if="autoCompleteState.showProvider"
486
- values="autoCompleteState.values"
485
+ t-if="autoCompleteState.provider"
486
+ proposals="autoCompleteState.provider.proposals"
487
487
  selectedIndex="autoCompleteState.selectedIndex"
488
488
  onValueSelected.bind="this.autoComplete"
489
489
  onValueHovered.bind="this.updateAutoCompleteIndex"
490
- getHtmlContent="autoCompleteState.getHtmlContent"
491
490
  />
492
491
  <FunctionDescriptionProvider
493
492
  t-if="functionDescriptionState.showDescription"
@@ -510,7 +509,7 @@
510
509
  <div
511
510
  class="o-formula-assistant bg-white"
512
511
  t-if="context.functionName"
513
- t-on-mousemove="onMouseMove"
512
+ t-on-pointermove="onMouseMove"
514
513
  t-att-class="{'opacity-25': assistantState.allowCellSelectionBehind}">
515
514
  <div class="o-formula-assistant-head">
516
515
  <span t-esc="context.functionName"/>
@@ -664,6 +663,10 @@
664
663
  <canvas class="o-figure-canvas w-100 h-100" t-att-style="canvasStyle" t-ref="graphContainer"/>
665
664
  </t>
666
665
 
666
+ <t t-name="o-spreadsheet-GaugeChartComponent">
667
+ <canvas class="o-figure-canvas w-100 h-100" t-ref="chartContainer"/>
668
+ </t>
669
+
667
670
  <t t-name="o-spreadsheet-ScorecardChart">
668
671
  <canvas class="o-figure-canvas w-100 h-100" t-ref="chartContainer"/>
669
672
  </t>
@@ -672,7 +675,7 @@
672
675
  <div class="o-figure-wrapper pe-auto" t-att-style="wrapperStyle">
673
676
  <div
674
677
  class="o-figure w-100 h-100"
675
- t-on-mousedown.stop="(ev) => this.onMouseDown(ev)"
678
+ t-on-pointerdown.stop="(ev) => this.onMouseDown(ev)"
676
679
  t-on-contextmenu.prevent.stop="(ev) => !env.model.getters.isReadonly() and this.onContextMenu(ev)"
677
680
  t-ref="figure"
678
681
  t-att-style="props.style"
@@ -708,42 +711,42 @@
708
711
  <div
709
712
  class="o-fig-anchor o-top"
710
713
  t-att-style="this.getResizerPosition('top')"
711
- t-on-mousedown="(ev) => this.clickAnchor(0,-1, ev)"
714
+ t-on-pointerdown="(ev) => this.clickAnchor(0,-1, ev)"
712
715
  />
713
716
  <div
714
717
  class="o-fig-anchor o-topRight"
715
718
  t-att-style="this.getResizerPosition('top right')"
716
- t-on-mousedown="(ev) => this.clickAnchor(1,-1, ev)"
719
+ t-on-pointerdown="(ev) => this.clickAnchor(1,-1, ev)"
717
720
  />
718
721
  <div
719
722
  class="o-fig-anchor o-right"
720
723
  t-att-style="this.getResizerPosition('right')"
721
- t-on-mousedown="(ev) => this.clickAnchor(1,0, ev)"
724
+ t-on-pointerdown="(ev) => this.clickAnchor(1,0, ev)"
722
725
  />
723
726
  <div
724
727
  class="o-fig-anchor o-bottomRight"
725
728
  t-att-style="this.getResizerPosition('bottom right')"
726
- t-on-mousedown="(ev) => this.clickAnchor(1,1, ev)"
729
+ t-on-pointerdown="(ev) => this.clickAnchor(1,1, ev)"
727
730
  />
728
731
  <div
729
732
  class="o-fig-anchor o-bottom"
730
733
  t-att-style="this.getResizerPosition('bottom')"
731
- t-on-mousedown="(ev) => this.clickAnchor(0,1, ev)"
734
+ t-on-pointerdown="(ev) => this.clickAnchor(0,1, ev)"
732
735
  />
733
736
  <div
734
737
  class="o-fig-anchor o-bottomLeft"
735
738
  t-att-style="this.getResizerPosition('bottom left')"
736
- t-on-mousedown="(ev) => this.clickAnchor(-1,1, ev)"
739
+ t-on-pointerdown="(ev) => this.clickAnchor(-1,1, ev)"
737
740
  />
738
741
  <div
739
742
  class="o-fig-anchor o-left"
740
743
  t-att-style="this.getResizerPosition('left')"
741
- t-on-mousedown="(ev) => this.clickAnchor(-1,0, ev)"
744
+ t-on-pointerdown="(ev) => this.clickAnchor(-1,0, ev)"
742
745
  />
743
746
  <div
744
747
  class="o-fig-anchor o-topLeft"
745
748
  t-att-style="this.getResizerPosition('top left')"
746
- t-on-mousedown="(ev) => this.clickAnchor(-1,-1, ev)"
749
+ t-on-pointerdown="(ev) => this.clickAnchor(-1,-1, ev)"
747
750
  />
748
751
  </t>
749
752
  </div>
@@ -803,7 +806,7 @@
803
806
  </t>
804
807
 
805
808
  <t t-name="o-spreadsheet-FilterIcon">
806
- <div class="o-filter-icon" t-on-click.stop="onClick">
809
+ <div class="o-filter-icon" t-att-class="iconClass" t-on-click.stop="onClick">
807
810
  <t t-if="isFilterActive" t-call="o-spreadsheet-Icon.FILTER_ICON_ACTIVE"/>
808
811
  <t t-else="" t-call="o-spreadsheet-Icon.FILTER_ICON"/>
809
812
  </div>
@@ -883,7 +886,7 @@
883
886
  <t t-name="o-spreadsheet-FilterMenuValueItem">
884
887
  <div
885
888
  t-on-click="this.props.onClick"
886
- t-on-mousemove="this.props.onMouseMove"
889
+ t-on-pointermove="this.props.onMouseMove"
887
890
  class="o-filter-menu-item o-filter-menu-value"
888
891
  t-ref="menuValueItem"
889
892
  t-att-class="{'selected': this.props.isSelected}">
@@ -910,7 +913,7 @@
910
913
  type="number"
911
914
  min="1"
912
915
  max="400"
913
- class="o-font-size bg-transparent border-0"
916
+ class="o-font-size o-number-input bg-transparent border-0"
914
917
  t-on-keydown="onInputKeydown"
915
918
  t-on-click.stop=""
916
919
  t-on-focus.stop="onInputFocused"
@@ -1004,7 +1007,7 @@
1004
1007
  <div
1005
1008
  class="o-grid-add-rows mt-2 ms-2 w-100 d-flex position-relative align-items-center"
1006
1009
  t-att-style="addRowsPosition"
1007
- t-on-mousedown.stop.prevent="">
1010
+ t-on-pointerdown.stop.prevent="">
1008
1011
  <button t-on-click="onConfirm" t-att-disabled="state.errorFlag" class="o-button">Add</button>
1009
1012
  <input
1010
1013
  type="text"
@@ -1013,7 +1016,7 @@
1013
1016
  value="100"
1014
1017
  t-on-click.stop=""
1015
1018
  t-on-keydown.stop="onKeydown"
1016
- t-on-mousedown.stop=""
1019
+ t-on-pointerdown.stop=""
1017
1020
  t-on-input.stop="onInput"
1018
1021
  />
1019
1022
  <span>more rows at the bottom</span>
@@ -1036,7 +1039,7 @@
1036
1039
  class="o-grid-overlay overflow-hidden"
1037
1040
  t-att-class="{'o-paint-format-cursor': isPaintingFormat}"
1038
1041
  t-att-style="style"
1039
- t-on-mousedown="onMouseDown"
1042
+ t-on-pointerdown="onMouseDown"
1040
1043
  t-on-dblclick.self="onDoubleClick"
1041
1044
  t-on-contextmenu.stop.prevent="onContextMenu">
1042
1045
  <FiguresContainer onFigureDeleted="props.onFigureDeleted"/>
@@ -1162,18 +1165,18 @@
1162
1165
  <div class="o-overlay">
1163
1166
  <ColResizer onOpenContextMenu="props.onOpenContextMenu"/>
1164
1167
  <RowResizer onOpenContextMenu="props.onOpenContextMenu"/>
1165
- <div class="all" t-on-mousedown.self="selectAll"/>
1168
+ <div class="all" t-on-pointerdown.self="selectAll"/>
1166
1169
  </div>
1167
1170
  </t>
1168
1171
 
1169
1172
  <t t-name="o-spreadsheet-RowResizer">
1170
1173
  <div
1171
1174
  class="o-row-resizer"
1172
- t-on-mousemove.self="onMouseMove"
1175
+ t-on-pointermove.self="onMouseMove"
1173
1176
  t-on-mouseleave="onMouseLeave"
1174
- t-on-mousedown.self.prevent="select"
1177
+ t-on-pointerdown.self.prevent="select"
1175
1178
  t-ref="rowResizer"
1176
- t-on-mouseup.self="onMouseUp"
1179
+ t-on-pointerup.self="onMouseUp"
1177
1180
  t-on-contextmenu.self="onContextMenu"
1178
1181
  t-att-class="{'o-grab': state.waitingForMove, 'o-dragging': state.isMoving}">
1179
1182
  <div
@@ -1189,7 +1192,7 @@
1189
1192
  <t t-if="state.resizerIsActive">
1190
1193
  <div
1191
1194
  class="o-handle"
1192
- t-on-mousedown="onMouseDown"
1195
+ t-on-pointerdown="onMouseDown"
1193
1196
  t-on-dblclick="onDblClick"
1194
1197
  t-on-contextmenu.prevent=""
1195
1198
  t-attf-style="top:{{state.draggerLinePosition - 2}}px;">
@@ -1228,11 +1231,11 @@
1228
1231
  <t t-name="o-spreadsheet-ColResizer">
1229
1232
  <div
1230
1233
  class="o-col-resizer"
1231
- t-on-mousemove.self="onMouseMove"
1234
+ t-on-pointermove.self="onMouseMove"
1232
1235
  t-on-mouseleave="onMouseLeave"
1233
- t-on-mousedown.self.prevent="select"
1236
+ t-on-pointerdown.self.prevent="select"
1234
1237
  t-ref="colResizer"
1235
- t-on-mouseup.self="onMouseUp"
1238
+ t-on-pointerup.self="onMouseUp"
1236
1239
  t-on-contextmenu.self="onContextMenu"
1237
1240
  t-att-class="{'o-grab': state.waitingForMove, 'o-dragging': state.isMoving, }">
1238
1241
  <div
@@ -1248,7 +1251,7 @@
1248
1251
  <t t-if="state.resizerIsActive">
1249
1252
  <div
1250
1253
  class="o-handle"
1251
- t-on-mousedown="onMouseDown"
1254
+ t-on-pointerdown="onMouseDown"
1252
1255
  t-on-dblclick="onDblClick"
1253
1256
  t-on-contextmenu.prevent=""
1254
1257
  t-attf-style="left:{{state.draggerLinePosition - 2}}px;">
@@ -1287,7 +1290,7 @@
1287
1290
  <t t-name="o-spreadsheet-Border">
1288
1291
  <div
1289
1292
  class="o-border"
1290
- t-on-mousedown.prevent="onMouseDown"
1293
+ t-on-pointerdown.prevent="onMouseDown"
1291
1294
  t-att-style="style"
1292
1295
  t-att-class="{
1293
1296
  'o-moving': props.isMoving,
@@ -1302,7 +1305,7 @@
1302
1305
  <t t-name="o-spreadsheet-Corner">
1303
1306
  <div
1304
1307
  class="o-corner"
1305
- t-on-mousedown.prevent="onMouseDown"
1308
+ t-on-pointerdown.prevent="onMouseDown"
1306
1309
  t-att-style="style"
1307
1310
  t-att-class="{
1308
1311
  'o-resizing': props.isResizing,
@@ -2128,12 +2131,7 @@ https://fontawesome.com/license -->
2128
2131
  </svg>
2129
2132
  </t>
2130
2133
  <t t-name="o-spreadsheet-Icon.FILTER_ICON">
2131
- <svg
2132
- class="o-cf-icon filter-icon"
2133
- width="10"
2134
- height="10"
2135
- focusable="false"
2136
- viewBox="0 0 850 850">
2134
+ <svg class="o-cf-icon filter-icon" viewBox="0 0 850 850">
2137
2135
  <path
2138
2136
  fill="currentColor"
2139
2137
  d="M 339.667 681 L 510.333 681 L 510.333 595.667 L 339.667 595.667 L 339.667 681 Z M 41 169 L 41 254.333 L 809 254.333 L 809 169 L 41 169 Z M 169 467.667 L 681 467.667 L 681 382.333 L 169 382.333 L 169 467.667 Z"
@@ -2141,33 +2139,7 @@ https://fontawesome.com/license -->
2141
2139
  </svg>
2142
2140
  </t>
2143
2141
  <t t-name="o-spreadsheet-Icon.FILTER_ICON_ACTIVE">
2144
- <svg
2145
- class="o-cf-icon filter-icon-active"
2146
- width="10"
2147
- height="10"
2148
- focusable="false"
2149
- viewBox="0 0 512 512">
2150
- <path
2151
- fill="currentColor"
2152
- d="M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"
2153
- />
2154
- </svg>
2155
- </t>
2156
- <t t-name="o-spreadsheet-Icon.FILTER_ICON_INACTIVE">
2157
- <svg
2158
- class="o-cf-icon filter-icon-inactive"
2159
- width="10"
2160
- height="10"
2161
- focusable="false"
2162
- viewBox="0 0 512 512">
2163
- <path
2164
- fill="currentColor"
2165
- d="M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"
2166
- />
2167
- </svg>
2168
- </t>
2169
- <t t-name="o-spreadsheet-Icon.MENU_FILTER_ICON">
2170
- <svg class="o-icon">
2142
+ <svg class="o-cf-icon filter-icon-active" viewBox="0 0 18 18">
2171
2143
  <path
2172
2144
  fill="currentColor"
2173
2145
  d="M16.6.5H1.29C.59.5.23 1.35.73 1.85l6.1 6.1v6.8c0 .26.13.5.34.65l2.64 1.85a.79.79 0 0 0 1.25-.65V7.96l6.1-6.1A.79.79 0 0 0 16.6.51"
@@ -2316,6 +2288,30 @@ https://fontawesome.com/license -->
2316
2288
  <circle cx="2" cy="12.5" r="1"/>
2317
2289
  </svg>
2318
2290
  </t>
2291
+ <t t-name="o-spreadsheet-Icon.EDIT_TABLE">
2292
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18">
2293
+ <path
2294
+ fill="currentColor"
2295
+ d="M2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15H7l1.5-1.5H7v-2.75h3.5v.75l2.25-2.25H12v-2.5h3.5v.75c.1-.2.45-.05.5.02l1 1V2.5A1.5 1.5 0 0 0 15.5 1m-13 1.5h13v2.75h-13m0 1.5h3v2.5h-3M7 6.75h3.5v2.5H7m-4.5 1.5h3v2.75h-3 M8.2 15.7v1.8h1.8l5.4-5.4-1.8-1.8-5.4 5.4Zm8.8-5.2a.5.5 0 0 0 0-.7l-1.1-1.1a.5.5 0 0 0-.7 0l-.9.9 1.8 1.8.9-.9Z"
2296
+ />
2297
+ </svg>
2298
+ </t>
2299
+ <t t-name="o-spreadsheet-Icon.DELETE_TABLE">
2300
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18">
2301
+ <path
2302
+ fill="currentColor"
2303
+ d="M2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15H7l1.5-1.5H7V6.75h3.5v.75L12 9V6.75h3.5l1.5 1.5V2.5A1.5 1.5 0 0 0 15.5 1m-13 1.5h13v2.75h-13m0 1.5h3v2.5h-3m0 1.5h3v2.75h-3m10-2.25 3-3 1.5 1.5-3 3 3 3-1.5 1.5-3-3-3 3-1.5-1.5 3-3-3-3 1.5-1.5"
2304
+ />
2305
+ </svg>
2306
+ </t>
2307
+ <t t-name="o-spreadsheet-Icon.PAINT_TABLE">
2308
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18">
2309
+ <path
2310
+ fill="currentColor"
2311
+ d="M2.5 1A1.5 1.5 0 0 0 1 2.5v11A1.5 1.5 0 0 0 2.5 15h5c0-.5 0-1 .5-1.5H7v-2.75h3.5v.75l2.25-2.25H12v-2.5h3.5v.75c1-.7 1.5-.4 1.5-.4V2.5A1.5 1.5 0 0 0 15.5 1m-13 1.5h13v2.75h-13m0 1.5h3v2.5h-3M7 6.75h3.5v2.5H7m-4.5 1.5h3v2.75h-3m7.5-.3c.7-.3 1.5-.1 2.1.6.6.7.8 1.4.5 1.9-.6 1.4-3.7 1.6-4 1.7l-.6.1.3-.5s.5-.8.5-2.1c0-.7.5-1.4 1.1-1.7Zm6.7-5.1a.9.9 0 0 1 1 1c-.1 1.3-2.5 3.7-4.3 5.3a3.9 3.9 0 0 0-.6-1.1c-.4-.4-.8-.7-1.3-.8 1.5-1.7 4-4.3 5.4-4.4"
2312
+ />
2313
+ </svg>
2314
+ </t>
2319
2315
 
2320
2316
  <t t-name="o-spreadsheet-LinkDisplay">
2321
2317
  <div class="o-link-tool d-flex align-items-center">
@@ -3143,9 +3139,13 @@ https://fontawesome.com/license -->
3143
3139
  </t>
3144
3140
 
3145
3141
  <t t-name="o-spreadsheet.Checkbox">
3146
- <label class="o-checkbox" t-att-title="props.title">
3142
+ <label
3143
+ class="o-checkbox"
3144
+ t-att-title="props.title"
3145
+ t-att-class="{'text-muted': props.disabled }">
3147
3146
  <input
3148
3147
  type="checkbox"
3148
+ t-att-disabled="props.disabled"
3149
3149
  t-att-name="props.name"
3150
3150
  t-att-checked="props.value"
3151
3151
  t-on-change="onChange"
@@ -3553,7 +3553,7 @@ https://fontawesome.com/license -->
3553
3553
  t-att-class="props.class"
3554
3554
  t-att-data-id="cf.id"
3555
3555
  t-on-click="props.onPreviewClick"
3556
- t-on-mousedown="(ev) => this.onMouseDown(ev)">
3556
+ t-on-pointerdown="(ev) => this.onMouseDown(ev)">
3557
3557
  <div class="position-relative h-100 w-100 d-flex align-items-center">
3558
3558
  <div class="o-cf-drag-handle h-100 position-absolute d-flex align-items-center text-muted">
3559
3559
  <t t-call="o-spreadsheet-Icon.THIN_DRAG_HANDLE"/>
@@ -4077,7 +4077,7 @@ https://fontawesome.com/license -->
4077
4077
  <select
4078
4078
  t-att-class="props.class"
4079
4079
  t-ref="select"
4080
- t-on-mousedown.stop.prevent=""
4080
+ t-on-pointerdown.stop.prevent=""
4081
4081
  t-on-click="onClick">
4082
4082
  <option selected="true" t-esc="props.selectedValue"/>
4083
4083
  </select>
@@ -4191,6 +4191,90 @@ https://fontawesome.com/license -->
4191
4191
  </div>
4192
4192
  </t>
4193
4193
 
4194
+ <t t-name="o-spreadsheet-TablePanel">
4195
+ <div class="o-table-panel">
4196
+ <Section>
4197
+ <t t-set-slot="title">Style options</t>
4198
+ <div class="d-flex flex-row">
4199
+ <div class="w-50">
4200
+ <div class="d-flex align-items-center">
4201
+ <Checkbox
4202
+ label="getCheckboxLabel('headerRow')"
4203
+ name="'headerRow'"
4204
+ value="tableConfig.numberOfHeaders > 0"
4205
+ onChange.bind="this.updateHasHeaders"
4206
+ />
4207
+ <input
4208
+ t-if="tableConfig.numberOfHeaders > 0"
4209
+ t-att-value="tableConfig.numberOfHeaders"
4210
+ type="number"
4211
+ class="o-table-n-of-headers ms-2 o-number-input"
4212
+ t-on-change="onChangeNumberOfHeaders"
4213
+ />
4214
+ </div>
4215
+ <Checkbox
4216
+ label="getCheckboxLabel('totalRow')"
4217
+ name="'totalRow'"
4218
+ value="tableConfig.totalRow"
4219
+ onChange="(val) => this.updateTableConfig('totalRow', val)"
4220
+ />
4221
+ <Checkbox
4222
+ label="getCheckboxLabel('bandedRows')"
4223
+ name="'bandedRows'"
4224
+ value="tableConfig.bandedRows"
4225
+ onChange="(val) => this.updateTableConfig('bandedRows', val)"
4226
+ />
4227
+ <Checkbox
4228
+ label="getCheckboxLabel('hasFilters')"
4229
+ name="'hasFilters'"
4230
+ value="tableConfig.hasFilters"
4231
+ title="hasFilterCheckboxTooltip"
4232
+ disabled="!this.canHaveFilters"
4233
+ onChange.bind="this.updateHasFilters"
4234
+ />
4235
+ </div>
4236
+ <div>
4237
+ <Checkbox
4238
+ label="getCheckboxLabel('firstColumn')"
4239
+ name="'firstColumn'"
4240
+ value="tableConfig.firstColumn"
4241
+ onChange="(val) => this.updateTableConfig('firstColumn', val)"
4242
+ />
4243
+ <Checkbox
4244
+ label="getCheckboxLabel('lastColumn')"
4245
+ name="'lastColumn'"
4246
+ value="tableConfig.lastColumn"
4247
+ onChange="(val) => this.updateTableConfig('lastColumn', val)"
4248
+ />
4249
+ <Checkbox
4250
+ label="getCheckboxLabel('bandedColumns')"
4251
+ name="'bandedColumns'"
4252
+ value="tableConfig.bandedColumns"
4253
+ onChange="(val) => this.updateTableConfig('bandedColumns', val)"
4254
+ />
4255
+ </div>
4256
+ </div>
4257
+ </Section>
4258
+ <Section>
4259
+ <TableStylePicker table="props.table"/>
4260
+ </Section>
4261
+ <Section>
4262
+ <t t-set-slot="title">Data range</t>
4263
+ <SelectionInput
4264
+ t-key="props.table.id"
4265
+ ranges="[this.state.tableXc]"
4266
+ hasSingleRange="true"
4267
+ onSelectionChanged="(ranges) => this.onRangeChanged(ranges)"
4268
+ onSelectionConfirmed.bind="this.onRangeConfirmed"
4269
+ />
4270
+ <ValidationMessages messages="errorMessages" msgType="'error'"/>
4271
+ </Section>
4272
+ <div class="o-sidePanelButtons">
4273
+ <button t-on-click="deleteTable" class="o-table-delete o-button">Delete table</button>
4274
+ </div>
4275
+ </div>
4276
+ </t>
4277
+
4194
4278
  <t t-name="o-spreadsheet-Spreadsheet">
4195
4279
  <div
4196
4280
  class="o-spreadsheet"
@@ -4218,12 +4302,91 @@ https://fontawesome.com/license -->
4218
4302
  <Grid exposeFocus="(focus) => this._focusGrid = focus"/>
4219
4303
  </div>
4220
4304
  </div>
4221
- <SidePanel t-if="sidePanel.isOpen"/>
4305
+ <SidePanel/>
4222
4306
  <BottomBar onClick="() => this.focusGrid()"/>
4223
4307
  </t>
4224
4308
  </div>
4225
4309
  </t>
4226
4310
 
4311
+ <t t-name="o-spreadsheet-TableDropdownButton">
4312
+ <div class="o-table-widget d-flex align-item-center">
4313
+ <ActionButton
4314
+ action="action"
4315
+ hasTriangleDownIcon="true"
4316
+ t-on-click="onClick"
4317
+ class="'o-hoverable-button'"
4318
+ />
4319
+ </div>
4320
+ <TableStylesPopover
4321
+ tableConfig="tableConfig"
4322
+ onStylePicked.bind="onStylePicked"
4323
+ popoverProps="state.popoverProps"
4324
+ closePopover.bind="closePopover"
4325
+ />
4326
+ </t>
4327
+
4328
+ <t t-name="o-spreadsheet-TableStylePicker">
4329
+ <div class="o-table-style-picker d-flex flew-row justify-content-between ps-1">
4330
+ <div class="d-flex flex-row overflow-hidden">
4331
+ <div
4332
+ class="o-table-style-list-item"
4333
+ t-att-class="{ 'selected': styleId === props.table.config.styleId }"
4334
+ t-foreach="getDisplayedTableStyles()"
4335
+ t-as="styleId"
4336
+ t-key="styleId"
4337
+ t-att-title="getStyleName(styleId)"
4338
+ t-on-click="() => this.onStylePicked(styleId)">
4339
+ <div class="o-table-style-picker-preview">
4340
+ <TableStylePreview tableConfig="getTableConfig(styleId)"/>
4341
+ </div>
4342
+ </div>
4343
+ </div>
4344
+ <div
4345
+ class="o-table-style-picker-arrow d-flex align-items-center px-1"
4346
+ t-on-click.stop="onArrowButtonClick">
4347
+ <t t-call="o-spreadsheet-Icon.TRIANGLE_DOWN"/>
4348
+ </div>
4349
+ </div>
4350
+ <TableStylesPopover
4351
+ tableConfig="props.table.config"
4352
+ selectedStyleId="props.table.config.styleId"
4353
+ onStylePicked.bind="onStylePicked"
4354
+ popoverProps="state.popoverProps"
4355
+ closePopover.bind="closePopover"
4356
+ />
4357
+ </t>
4358
+
4359
+ <t t-name="o-spreadsheet-TableStylePreview">
4360
+ <canvas t-ref="canvas" class="w-100 h-100"/>
4361
+ </t>
4362
+
4363
+ <t t-name="o-spreadsheet-TableStylesPopover">
4364
+ <Popover t-if="props.popoverProps" t-props="props.popoverProps">
4365
+ <div class="o-table-style-popover d-flex flex-column px-4 py-1" t-ref="tableStyleList">
4366
+ <div t-foreach="categories" t-as="category" t-key="category">
4367
+ <div class="mt-2 mb-1">
4368
+ <b t-esc="category_value"/>
4369
+ </div>
4370
+ <div class="d-flex flex-wrap">
4371
+ <div
4372
+ class="o-table-style-list-item"
4373
+ t-att-class="{ 'selected': styleId === props.selectedStyleId }"
4374
+ t-foreach="getPresetsByCategory(category)"
4375
+ t-as="styleId"
4376
+ t-key="styleId"
4377
+ t-att-title="getStyleName(styleId)"
4378
+ t-on-click="() => this.props.onStylePicked(styleId)">
4379
+ <div class="o-table-style-popover-preview">
4380
+ <TableStylePreview tableConfig="getTableConfig(styleId)"/>
4381
+ </div>
4382
+ </div>
4383
+ </div>
4384
+ <hr t-if="!category_last" class="hr mt-2 mb-0"/>
4385
+ </div>
4386
+ </div>
4387
+ </Popover>
4388
+ </t>
4389
+
4227
4390
  <t t-name="o-spreadsheet-TopBar">
4228
4391
  <t t-set="text_color">Text Color</t>
4229
4392
  <t t-set="fill_color">Fill Color</t>
@@ -4389,7 +4552,8 @@ https://fontawesome.com/license -->
4389
4552
 
4390
4553
  <div class="o-divider"/>
4391
4554
 
4392
- <ActionButton action="VIEW.createRemoveFilter" class="'o-hoverable-button'"/>
4555
+ <TableDropdownButton/>
4556
+ <ActionButton action="DATA.createRemoveFilterTool" class="'o-hoverable-button'"/>
4393
4557
  </div>
4394
4558
  </div>
4395
4559
  <TopBarComposer/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.2.0-alpha.5",
3
+ "version": "17.2.0-alpha.6",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",