@omniumretail/component-library 1.2.25 → 1.2.26

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -360,7 +360,7 @@ const Template: Story<any> = (args) => {
360
360
  }
361
361
  ]
362
362
 
363
- return <Category {...args} chooseResponse serverReadyData={setServerData} responseTypeOptions={getAnswerTypeOptions} hasHeader data={[]}></Category>
363
+ return <Category {...args} serverReadyData={setServerData} responseTypeOptions={getAnswerTypeOptions} data={[]}></Category>
364
364
  };
365
365
 
366
366
  export const Primary = Template.bind({});
@@ -205,23 +205,17 @@ export const CategorySidebar = (props: SidebarProps) => {
205
205
  }
206
206
 
207
207
  function generateCategoryKeys(categories: DataNode[], parentKey: string = ''): DataNode[] {
208
- let keyCounter = parentKey === '' ? 1 : parseInt(parentKey, 10) + 1; // Inicia o contador de chaves
209
-
210
- return categories.map((category: DataNode) => {
211
- if (hasHeader && (category.key === '0')) {
212
- return category; // Mantém a chave do Header fixa
213
- }
214
-
215
- const categoryKey = `${keyCounter++}`; // Incrementa o contador para cada categoria
216
-
208
+ return categories.map((category, index) => {
209
+ const categoryKey = parentKey ? `${parentKey}.${index + 1}` : `${index + 1}`; // Cria hierarquia 1.1, 1.1.1 etc.
210
+
217
211
  let children: DataNode[] = [];
218
212
  if (category.children) {
219
- children = generateCategoryKeys(category.children, categoryKey); // Gera chaves para os filhos recursivamente
213
+ children = generateCategoryKeys(category.children, categoryKey); // Recursivamente atualiza os filhos
220
214
  }
221
-
222
- return { ...category, key: categoryKey, children }; // Atualiza a chave e os filhos
215
+
216
+ return { ...category, key: categoryKey, children };
223
217
  });
224
- }
218
+ }
225
219
 
226
220
  setGData(generateCategoryKeys(data));
227
221
  };
@@ -56,7 +56,6 @@ const getActionsForRecord = (record: any) => {
56
56
 
57
57
 
58
58
  return <ResponsiveTable
59
- scroll={{ x: 4000 }}
60
59
  cleanRowSelection={clearRowSelection}
61
60
  columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo}
62
61
  getRowActions={getActionsForRecord}