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

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.3
5
- @date 2024-04-10T12:29:04.461Z
6
- @hash 80b5056
4
+ @version 17.3.0-alpha.5
5
+ @date 2024-04-18T14:39:41.198Z
6
+ @hash cff0ef9
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
@@ -606,7 +606,7 @@
606
606
  <div
607
607
  t-foreach="getClickableCells()"
608
608
  t-as="clickableCell"
609
- t-key="clickableCell.tKey"
609
+ t-key="clickableCell_index"
610
610
  class="o-dashboard-clickable-cell"
611
611
  t-on-click="() => this.selectClickableCell(clickableCell)"
612
612
  t-on-contextmenu.prevent=""
@@ -1005,6 +1005,9 @@
1005
1005
  position="menuState.position"
1006
1006
  onClose="() => this.closeMenu()"
1007
1007
  />
1008
+ <t t-foreach="staticTables" t-as="table" t-key="table.id">
1009
+ <TableResizer table="table"/>
1010
+ </t>
1008
1011
  <VerticalScrollBar topOffset="HEADER_HEIGHT"/>
1009
1012
  <HorizontalScrollBar leftOffset="HEADER_WIDTH"/>
1010
1013
  <div class="o-scrollbar corner"/>
@@ -2328,6 +2331,19 @@ https://fontawesome.com/license -->
2328
2331
  />
2329
2332
  </svg>
2330
2333
  </t>
2334
+ <t t-name="o-spreadsheet-Icon.PIVOT">
2335
+ <svg class="o-icon" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
2336
+ <path
2337
+ fill="currentColor"
2338
+ d="M17 2v14H1V6h4V2h12m-1 1H6v3h10M2 7v2h3V7m-3 3v2h3v-2m-3 3v2h3v-2m1-6v2h6V7m-6 3v2h6v-2m-6 3v2h6v-2m1-6v2h3V7m-3 3v2h3v-2m-3 3v2h3v-2"
2339
+ />
2340
+ </svg>
2341
+ </t>
2342
+ <t t-name="o-spreadsheet-Icon.UNUSED_PIVOT_WARNING">
2343
+ <div class="o-unused-pivot-icon text-warning" title="This pivot is not used">
2344
+ <t t-call="o-spreadsheet-Icon.TRIANGLE_EXCLAMATION"/>
2345
+ </div>
2346
+ </t>
2331
2347
 
2332
2348
  <t t-name="o-spreadsheet-LinkDisplay">
2333
2349
  <div class="o-link-tool d-flex align-items-center">
@@ -2927,7 +2943,7 @@ https://fontawesome.com/license -->
2927
2943
  </tr>
2928
2944
  </t>
2929
2945
 
2930
- <t t-name="o-spreadsheet-LineBarPieConfigPanel">
2946
+ <t t-name="o-spreadsheet-GenericChartConfigPanel">
2931
2947
  <div>
2932
2948
  <ChartDataSeries
2933
2949
  ranges="this.getDataSeriesRanges()"
@@ -2954,7 +2970,7 @@ https://fontawesome.com/license -->
2954
2970
  </div>
2955
2971
  </t>
2956
2972
 
2957
- <t t-name="o-spreadsheet-LineBarPieDesignPanel">
2973
+ <t t-name="o-spreadsheet-GenericChartDesignPanel">
2958
2974
  <div>
2959
2975
  <Section class="'o-chart-background-color'">
2960
2976
  <t t-set-slot="title">Background color</t>
@@ -3247,6 +3263,93 @@ https://fontawesome.com/license -->
3247
3263
  </Section>
3248
3264
  </t>
3249
3265
 
3266
+ <t t-name="o-spreadsheet-WaterfallChartDesignPanel">
3267
+ <div>
3268
+ <Section class="'o-chart-background-color'">
3269
+ <t t-set-slot="title">Background color</t>
3270
+ <div class="d-flex align-items-center">
3271
+ <span class="me-2">Select a color...</span>
3272
+ <RoundColorPicker
3273
+ currentColor="props.definition.background"
3274
+ onColorPicked="(color) => this.updateColor('background', color)"
3275
+ />
3276
+ </div>
3277
+ </Section>
3278
+ <ChartTitle title="title" update.bind="updateTitle"/>
3279
+ <Section>
3280
+ <t t-set-slot="title">Vertical axis position</t>
3281
+ <select
3282
+ t-att-value="props.definition.verticalAxisPosition"
3283
+ class="o-input o-chart-vertical-axis-position"
3284
+ t-on-change="(ev) => this.updateSelect('verticalAxisPosition', ev)">
3285
+ <option value="left">Left</option>
3286
+ <option value="right">Right</option>
3287
+ </select>
3288
+ </Section>
3289
+ <Section>
3290
+ <t t-set-slot="title">Legend position</t>
3291
+ <select
3292
+ t-att-value="props.definition.legendPosition"
3293
+ class="o-input o-chart-legend-position"
3294
+ t-on-change="(ev) => this.updateSelect('legendPosition', ev)">
3295
+ <option value="none">None</option>
3296
+ <option value="top">Top</option>
3297
+ <option value="bottom">Bottom</option>
3298
+ <option value="left">Left</option>
3299
+ <option value="right">Right</option>
3300
+ </select>
3301
+ </Section>
3302
+ <Section>
3303
+ <t t-set-slot="title">Waterfall options</t>
3304
+ <t t-set="firstValueAsSubtotal">Use first value as subtotal</t>
3305
+ <Checkbox
3306
+ name="'firstValueAsSubtotal'"
3307
+ label="firstValueAsSubtotal"
3308
+ value="props.definition.firstValueAsSubtotal"
3309
+ onChange.bind="onUpdateFirstValueAsSubtotal"
3310
+ />
3311
+ <t t-set="showSubTotalsLabel">Show subtotals at the end of series</t>
3312
+ <Checkbox
3313
+ name="'showSubTotals'"
3314
+ label="showSubTotalsLabel"
3315
+ value="props.definition.showSubTotals"
3316
+ onChange.bind="onUpdateShowSubTotals"
3317
+ />
3318
+ <t t-set="showConnectorLinesLabel">Show connector lines</t>
3319
+ <Checkbox
3320
+ name="'showConnectorLines'"
3321
+ label="showConnectorLinesLabel"
3322
+ value="props.definition.showConnectorLines"
3323
+ onChange.bind="onUpdateShowConnectorLines"
3324
+ />
3325
+ </Section>
3326
+ <Section>
3327
+ <t t-set-slot="title">Waterfall colors</t>
3328
+ <div class="o-waterfall-positive-color d-flex align-items-center mb-1">
3329
+ <RoundColorPicker
3330
+ currentColor="positiveValuesColor"
3331
+ onColorPicked="(color) => this.updateColor('positiveValuesColor', color)"
3332
+ />
3333
+ <span class="ps-2">Color of positive values</span>
3334
+ </div>
3335
+ <div class="o-waterfall-negative-color d-flex align-items-center mb-1">
3336
+ <RoundColorPicker
3337
+ currentColor="negativeValuesColor"
3338
+ onColorPicked="(color) => this.updateColor('negativeValuesColor', color)"
3339
+ />
3340
+ <span class="ps-2">Color of negative values</span>
3341
+ </div>
3342
+ <div class="o-waterfall-subtotal-color d-flex align-items-center">
3343
+ <RoundColorPicker
3344
+ currentColor="subTotalValuesColor"
3345
+ onColorPicked="(color) => this.updateColor('subTotalValuesColor', color)"
3346
+ />
3347
+ <span class="ps-2">Color of subtotals</span>
3348
+ </div>
3349
+ </Section>
3350
+ </div>
3351
+ </t>
3352
+
3250
3353
  <t t-name="o-spreadsheet.Checkbox">
3251
3354
  <label
3252
3355
  class="o-checkbox"
@@ -4159,6 +4262,202 @@ https://fontawesome.com/license -->
4159
4262
  </div>
4160
4263
  </t>
4161
4264
 
4265
+ <div t-name="o-spreadsheet-AllPivotsSidePanel" class="o_spreadsheet_pivot_side_panel">
4266
+ <t t-foreach="env.model.getters.getPivotIds()" t-as="pivotId" t-key="pivotId">
4267
+ <PivotPreview pivotId="pivotId"/>
4268
+ </t>
4269
+ </div>
4270
+
4271
+ <t t-name="o-spreadsheet-PivotPreview">
4272
+ <div class="o_side_panel_select" t-ref="pivotPreview" t-on-click="this.selectPivot">
4273
+ <span t-esc="env.model.getters.getPivotDisplayName(props.pivotId)"/>
4274
+ </div>
4275
+ </t>
4276
+
4277
+ <t t-name="o-spreadsheet-EditableName">
4278
+ <t t-if="state.isEditing">
4279
+ <div>
4280
+ <input type="text" class="o_input o_sp_en_name" t-model="state.name"/>
4281
+ </div>
4282
+ <div class="btn btn-link o_sp_en_save" t-on-click="save">Save</div>
4283
+ <br/>
4284
+ </t>
4285
+ <t t-else="">
4286
+ <div class="o_sp_en_display_name" t-esc="props.displayName"/>
4287
+ <div class="btn btn-link o_sp_en_rename" t-on-click="rename">
4288
+ <i class="fa fa-pencil me-1"/>
4289
+ Rename
4290
+ </div>
4291
+ <br/>
4292
+ </t>
4293
+ </t>
4294
+
4295
+ <t t-name="o-spreadsheet-AddDimensionButton">
4296
+ <span class="btn btn-sm btn-link add-dimension" t-on-click="togglePopover" t-ref="button">
4297
+ Add
4298
+ </span>
4299
+ <Popover t-if="popover.isOpen" t-props="popoverProps">
4300
+ <div class="p-2 bg-white border-bottom d-flex align-items-baseline pivot-dimension-search">
4301
+ <i class="pe-1 pivot-dimension-search-field-icon">
4302
+ <t t-call="o-spreadsheet-Icon.SEARCH"/>
4303
+ </i>
4304
+ <input
4305
+ t-model="search.input"
4306
+ t-on-keydown="onKeyDown"
4307
+ class="border-0 w-100 pivot-dimension-search-field"
4308
+ autofocus="1"
4309
+ />
4310
+ </div>
4311
+ <div
4312
+ t-foreach="filteredFields"
4313
+ t-as="field"
4314
+ t-key="field.name"
4315
+ t-esc="field.string"
4316
+ t-att-title="field.help"
4317
+ t-on-click="() => this.pickField(field)"
4318
+ class="p-1 px-2 pivot-dimension-field"
4319
+ role="button"
4320
+ />
4321
+ </Popover>
4322
+ </t>
4323
+
4324
+ <t t-name="o-spreadsheet-PivotDimension">
4325
+ <div class="border py-1 px-2 d-flex flex-column shadow-sm pivot-dimension">
4326
+ <div class="d-flex flex-row justify-content-between align-items-center">
4327
+ <span class="fw-bold" t-esc="props.dimension.displayName"/>
4328
+ <i
4329
+ class="btn fa fa-times pe-0"
4330
+ t-if="props.onRemoved"
4331
+ t-on-click="() => props.onRemoved(props.dimension)"
4332
+ />
4333
+ </div>
4334
+ <t t-slot="default"/>
4335
+ </div>
4336
+ </t>
4337
+
4338
+ <t t-name="o-spreadsheet-PivotDimensionGranularity">
4339
+ <div class="d-flex flex-row">
4340
+ <div class="d-flex flex-row py-1 px-2 w-100 small">
4341
+ <t t-set="granularity" t-value="props.dimension.granularity"/>
4342
+ <div class="flex-basis-50">Granularity</div>
4343
+ <select
4344
+ class="o_input flex-basis-50"
4345
+ t-on-change="(ev) => props.onUpdated(props.dimension, ev.target.value)">
4346
+ <option
4347
+ t-foreach="allGranularities"
4348
+ t-as="granularity"
4349
+ t-key="granularity"
4350
+ t-if="props.availableGranularities.has(granularity) || granularity === props.dimension.granularity"
4351
+ t-att-value="granularity"
4352
+ t-esc="periods[granularity]"
4353
+ t-att-selected="granularity === props.dimension.granularity or (granularity === 'month' and !props.dimension.granularity)"
4354
+ />
4355
+ </select>
4356
+ </div>
4357
+ </div>
4358
+ </t>
4359
+
4360
+ <t t-name="o-spreadsheet-PivotDimensionOrder">
4361
+ <div class="d-flex">
4362
+ <div class="d-flex py-1 px-2 w-100 small">
4363
+ <div class="flex-basis-50">Order by</div>
4364
+ <select
4365
+ class="o_input flex-basis-50"
4366
+ t-on-change="(ev) => props.onUpdated(props.dimension, ev.target.value)">
4367
+ <option value="" t-att-selected="props.dimension.order === undefined">Automatic</option>
4368
+ <option value="asc" t-att-selected="props.dimension.order === 'asc'">Ascending</option>
4369
+ <option value="desc" t-att-selected="props.dimension.order === 'desc'">Descending</option>
4370
+ </select>
4371
+ </div>
4372
+ </div>
4373
+ </t>
4374
+
4375
+ <t t-name="o-spreadsheet-PivotDimensions">
4376
+ <div class="o_side_panel_section pivot-dimensions" t-ref="pivot-dimensions">
4377
+ <div class="fw-bold py-1 d-flex flex-row justify-content-between align-items-center">
4378
+ Columns
4379
+ <AddDimensionButton
4380
+ onFieldPicked.bind="addColumnDimension"
4381
+ fields="props.unusedGroupableFields"
4382
+ />
4383
+ </div>
4384
+ <t t-foreach="props.definition.columns" t-as="col" t-key="col.nameWithGranularity">
4385
+ <div
4386
+ t-on-pointerdown="(ev) => this.startDragAndDrop(col, ev)"
4387
+ t-att-style="dragAndDrop.itemsStyle[col.nameWithGranularity]"
4388
+ class="pt-1">
4389
+ <PivotDimension dimension="col" onRemoved.bind="removeDimension">
4390
+ <PivotDimensionGranularity
4391
+ t-if="isDateField(col)"
4392
+ dimension="col"
4393
+ onUpdated.bind="this.updateGranularity"
4394
+ availableGranularities="props.unusedDateTimeGranularities[col.name]"
4395
+ />
4396
+ <PivotDimensionOrder dimension="col" onUpdated.bind="this.updateOrder"/>
4397
+ </PivotDimension>
4398
+ </div>
4399
+ </t>
4400
+ <div
4401
+ class="fw-bold pt-4 pb-1 d-flex flex-row justify-content-between align-items-center"
4402
+ t-att-style="dragAndDrop.itemsStyle['__rows_title__']">
4403
+ Rows
4404
+ <AddDimensionButton
4405
+ onFieldPicked.bind="addRowDimension"
4406
+ fields="props.unusedGroupableFields"
4407
+ />
4408
+ </div>
4409
+ <t t-foreach="props.definition.rows" t-as="row" t-key="row.nameWithGranularity">
4410
+ <div
4411
+ t-on-pointerdown="(ev) => this.startDragAndDrop(row, ev)"
4412
+ t-att-style="dragAndDrop.itemsStyle[row.nameWithGranularity]"
4413
+ class="pt-1">
4414
+ <PivotDimension dimension="row" onRemoved.bind="removeDimension">
4415
+ <PivotDimensionGranularity
4416
+ t-if="isDateField(row)"
4417
+ dimension="row"
4418
+ onUpdated.bind="this.updateGranularity"
4419
+ availableGranularities="props.unusedDateTimeGranularities[row.name]"
4420
+ />
4421
+ <PivotDimensionOrder dimension="row" onUpdated.bind="this.updateOrder"/>
4422
+ </PivotDimension>
4423
+ </div>
4424
+ </t>
4425
+ <div class="fw-bold pt-4 pb-1 d-flex flex-row justify-content-between align-items-center">
4426
+ Measures
4427
+ <AddDimensionButton
4428
+ onFieldPicked.bind="addMeasureDimension"
4429
+ fields="props.unusedMeasureFields"
4430
+ />
4431
+ </div>
4432
+ <t t-foreach="props.definition.measures" t-as="measure" t-key="measure.nameWithAggregator">
4433
+ <div
4434
+ t-on-pointerdown="(ev) => this.startDragAndDropMeasures(measure, ev)"
4435
+ t-att-style="dragAndDrop.itemsStyle[measure.name]"
4436
+ class="pt-1 pivot-measure">
4437
+ <PivotDimension dimension="measure" onRemoved.bind="removeMeasureDimension">
4438
+ <div class="d-flex flex-row small">
4439
+ <div class="d-flex flex-row py-1 px-2 w-100">
4440
+ <div class="flex-basis-50">Aggregated by</div>
4441
+ <select
4442
+ class="o_input flex-basis-50"
4443
+ t-on-change="(ev) => this.updateAggregator(measure, ev.target.value)">
4444
+ <option
4445
+ t-foreach="Object.keys(AGGREGATORS[measure.type])"
4446
+ t-as="agg"
4447
+ t-key="agg"
4448
+ t-att-value="agg"
4449
+ t-att-selected="agg === measure.aggregator"
4450
+ t-esc="AGGREGATORS[measure.type][agg]"
4451
+ />
4452
+ </select>
4453
+ </div>
4454
+ </div>
4455
+ </PivotDimension>
4456
+ </div>
4457
+ </t>
4458
+ </div>
4459
+ </t>
4460
+
4162
4461
  <t t-name="o-spreadsheet-RemoveDuplicatesPanel">
4163
4462
  <div class="o-remove-duplicates">
4164
4463
  <Section>
@@ -4478,6 +4777,14 @@ https://fontawesome.com/license -->
4478
4777
  />
4479
4778
  </t>
4480
4779
 
4780
+ <t t-name="o-spreadsheet-TableResizer">
4781
+ <div
4782
+ class="o-table-resizer position-absolute"
4783
+ t-att-style="containerStyle"
4784
+ t-on-pointerdown="onMouseDown"
4785
+ />
4786
+ </t>
4787
+
4481
4788
  <t t-name="o-spreadsheet-TableStylePicker">
4482
4789
  <div class="o-table-style-picker d-flex flew-row justify-content-between ps-1">
4483
4790
  <div class="d-flex flex-row overflow-hidden">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.3.0-alpha.3",
3
+ "version": "17.3.0-alpha.5",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",
@@ -102,6 +102,7 @@
102
102
  "dependencies": {
103
103
  "@odoo/owl": "2.2.10",
104
104
  "bootstrap": "^5.1.3",
105
+ "font-awesome": "^4.7.0",
105
106
  "rbush": "^3.0.1"
106
107
  },
107
108
  "jest": {