@odoo/o-spreadsheet 17.3.0-alpha.6 → 17.3.0-alpha.7

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.6
5
- @date 2024-04-26T07:40:36.934Z
6
- @hash f58a0d5
4
+ @version 17.3.0-alpha.7
5
+ @date 2024-05-07T10:43:31.043Z
6
+ @hash 853c266
7
7
  -->
8
8
  <odoo>
9
9
  <t t-name="o-spreadsheet-ActionButton">
@@ -4644,42 +4644,34 @@
4644
4644
  <Section class="'pt-1'">
4645
4645
  <t t-set-slot="title">Style color</t>
4646
4646
  <div class="d-flex align-items-center">
4647
- <div
4648
- class="o-color-preview"
4649
- t-att-style="colorPreviewStyle"
4650
- t-on-click.stop="togglePicker"
4651
- />
4652
- <span class="pe-1">Primary table style color</span>
4653
- <ColorPickerWidget
4654
- currentColor="state.primaryColor"
4655
- showColorPicker="state.pickerOpened"
4656
- toggleColorPicker.bind="togglePicker"
4657
- onColorPicked.bind="onColorPicked"
4658
- icon="'o-spreadsheet-Icon.FILL_COLOR'"
4659
- />
4647
+ <span class="pe-2">Primary table style color</span>
4648
+ <RoundColorPicker currentColor="state.primaryColor" onColorPicked.bind="onColorPicked"/>
4660
4649
  </div>
4661
4650
  </Section>
4662
4651
  <Section class="'pt-1'">
4663
4652
  <t t-set-slot="title">Style template</t>
4664
4653
  <div class="d-flex flex-wrap">
4665
- <div
4666
- class="o-table-style-list-item"
4667
- t-foreach="tableTemplates"
4668
- t-as="templateName"
4669
- t-key="templateName"
4670
- t-att-class="{ 'selected': templateName === state.selectedTemplateName }"
4671
- t-on-click="() => this.onTemplatePicked(templateName)">
4672
- <div class="o-table-style-edit-template-preview">
4673
- <TableStylePreview
4674
- tableConfig="previewTableConfig"
4675
- tableStyle="computeTableStyle(templateName)"
4676
- />
4677
- </div>
4678
- </div>
4654
+ <t t-foreach="tableTemplates" t-as="templateName" t-key="templateName">
4655
+ <TableStylePreview
4656
+ class="'o-table-style-edit-template-preview'"
4657
+ selected="templateName === state.selectedTemplateName"
4658
+ tableConfig="previewTableConfig"
4659
+ tableStyle="computeTableStyle(templateName)"
4660
+ onClick="() => this.onTemplatePicked(templateName)"
4661
+ />
4662
+ </t>
4679
4663
  </div>
4680
4664
  <div class="o-sidePanelButtons">
4681
- <button t-on-click="onCancel" class="o-cancel o-button">Cancel</button>
4682
- <button t-on-click="onConfirm" class="o-confirm o-button">Confirm</button>
4665
+ <button
4666
+ t-if="props.styleId"
4667
+ t-on-click="onDelete"
4668
+ class="o-delete o-button o-button-grey danger">
4669
+ Delete
4670
+ </button>
4671
+ <button t-on-click="onCancel" class="o-cancel o-button o-button-grey">Cancel</button>
4672
+ <button t-on-click="onConfirm" class="o-confirm o-button o-button-grey primary">
4673
+ Confirm
4674
+ </button>
4683
4675
  </div>
4684
4676
  </Section>
4685
4677
  </div>
@@ -4746,23 +4738,16 @@
4746
4738
  <t t-name="o-spreadsheet-TableStylePicker">
4747
4739
  <div class="o-table-style-picker d-flex flew-row justify-content-between ps-1">
4748
4740
  <div class="d-flex flex-row overflow-hidden">
4749
- <div
4750
- class="o-table-style-list-item"
4751
- t-att-class="{ 'selected': styleId === props.table.config.styleId }"
4752
- t-foreach="getDisplayedTableStyles()"
4753
- t-as="styleId"
4754
- t-key="styleId"
4755
- t-att-title="getStyleName(styleId)"
4756
- t-att-data-id="styleId"
4757
- t-on-click="() => this.onStylePicked(styleId)"
4758
- t-on-contextmenu.prevent="(ev) => this.onContextMenu(ev, styleId)">
4759
- <div class="o-table-style-picker-preview">
4760
- <TableStylePreview
4761
- tableConfig="props.table.config"
4762
- tableStyle="env.model.getters.getTableStyle(styleId)"
4763
- />
4764
- </div>
4765
- </div>
4741
+ <t t-foreach="getDisplayedTableStyles()" t-as="styleId" t-key="styleId">
4742
+ <TableStylePreview
4743
+ class="'o-table-style-picker-preview'"
4744
+ selected="styleId === props.table.config.styleId"
4745
+ tableConfig="props.table.config"
4746
+ tableStyle="env.model.getters.getTableStyle(styleId)"
4747
+ styleId="styleId"
4748
+ onClick="() => this.onStylePicked(styleId)"
4749
+ />
4750
+ </t>
4766
4751
  </div>
4767
4752
  <div
4768
4753
  class="o-table-style-picker-arrow d-flex align-items-center px-1"
@@ -4777,6 +4762,27 @@
4777
4762
  popoverProps="state.popoverProps"
4778
4763
  closePopover.bind="closePopover"
4779
4764
  />
4765
+ </t>
4766
+
4767
+ <t t-name="o-spreadsheet-TableStylePreview">
4768
+ <div
4769
+ class="o-table-style-list-item position-relative"
4770
+ t-att-class="{ 'selected': props.selected }"
4771
+ t-att-data-id="props.styleId"
4772
+ t-att-title="styleName"
4773
+ t-on-click="props.onClick"
4774
+ t-on-contextmenu.prevent="(ev) => this.onContextMenu(ev)">
4775
+ <div t-att-class="props.class">
4776
+ <canvas t-ref="canvas" class="w-100 h-100"/>
4777
+ </div>
4778
+ <div
4779
+ class="o-table-style-edit-button position-absolute d-none"
4780
+ t-if="isStyleEditable"
4781
+ t-on-click="this.editTableStyle"
4782
+ title="Edit custom table style">
4783
+ <t t-call="o-spreadsheet-Icon.EDIT"/>
4784
+ </div>
4785
+ </div>
4780
4786
  <Menu
4781
4787
  t-if="menu.isOpen"
4782
4788
  menuItems="menu.menuItems"
@@ -4785,10 +4791,6 @@
4785
4791
  />
4786
4792
  </t>
4787
4793
 
4788
- <t t-name="o-spreadsheet-TableStylePreview">
4789
- <canvas t-ref="canvas" class="w-100 h-100"/>
4790
- </t>
4791
-
4792
4794
  <t t-name="o-spreadsheet-TableStylesPopover">
4793
4795
  <Popover t-if="props.popoverProps" t-props="props.popoverProps">
4794
4796
  <div
@@ -4818,22 +4820,16 @@
4818
4820
  </div>
4819
4821
  <hr class="hr my-2"/>
4820
4822
  <div class="d-flex flex-wrap">
4821
- <div
4822
- class="o-table-style-list-item"
4823
- t-att-class="{ 'selected': styleId === props.selectedStyleId }"
4824
- t-foreach="displayedStyles"
4825
- t-as="styleId"
4826
- t-key="styleId"
4827
- t-att-title="getStyleName(styleId)"
4828
- t-on-click="() => this.props.onStylePicked(styleId)"
4829
- t-on-contextmenu.prevent="(ev) => this.onContextMenu(ev, styleId)">
4830
- <div class="o-table-style-popover-preview">
4831
- <TableStylePreview
4832
- tableConfig="props.tableConfig"
4833
- tableStyle="env.model.getters.getTableStyle(styleId)"
4834
- />
4835
- </div>
4836
- </div>
4823
+ <t t-foreach="displayedStyles" t-as="styleId" t-key="styleId">
4824
+ <TableStylePreview
4825
+ class="'o-table-style-popover-preview'"
4826
+ styleId="styleId"
4827
+ selected="styleId === props.selectedStyleId"
4828
+ tableConfig="props.tableConfig"
4829
+ tableStyle="env.model.getters.getTableStyle(styleId)"
4830
+ onClick="() => this.props.onStylePicked(styleId)"
4831
+ />
4832
+ </t>
4837
4833
  <div
4838
4834
  t-if="state.selectedCategory === 'custom'"
4839
4835
  class="o-new-table-style o-table-style-list-item o-table-style-popover-preview d-flex justify-content-center align-items-center"
@@ -4842,12 +4838,6 @@
4842
4838
  </div>
4843
4839
  </div>
4844
4840
  </div>
4845
- <Menu
4846
- t-if="menu.isOpen"
4847
- menuItems="menu.menuItems"
4848
- position="menu.position"
4849
- onClose.bind="this.closeMenu"
4850
- />
4851
4841
  </Popover>
4852
4842
  </t>
4853
4843
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "17.3.0-alpha.6",
3
+ "version": "17.3.0-alpha.7",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o-spreadsheet.cjs.js",
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "dependencies": {
103
103
  "@odoo/owl": "2.2.10",
104
- "bootstrap": "^5.1.3",
104
+ "bootstrap": "^5.3.3",
105
105
  "font-awesome": "^4.7.0",
106
106
  "rbush": "^3.0.1"
107
107
  },