@odoo/o-spreadsheet 17.3.0-alpha.4 → 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.4
5
- @date 2024-04-15T11:03:33.066Z
6
- @hash a32a1df
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=""
@@ -2331,6 +2331,19 @@ https://fontawesome.com/license -->
2331
2331
  />
2332
2332
  </svg>
2333
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>
2334
2347
 
2335
2348
  <t t-name="o-spreadsheet-LinkDisplay">
2336
2349
  <div class="o-link-tool d-flex align-items-center">
@@ -4249,6 +4262,202 @@ https://fontawesome.com/license -->
4249
4262
  </div>
4250
4263
  </t>
4251
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
+
4252
4461
  <t t-name="o-spreadsheet-RemoveDuplicatesPanel">
4253
4462
  <div class="o-remove-duplicates">
4254
4463
  <Section>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.3.0-alpha.4",
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",