@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
|
@@ -360,7 +360,7 @@ const Template: Story<any> = (args) => {
|
|
|
360
360
|
}
|
|
361
361
|
]
|
|
362
362
|
|
|
363
|
-
return <Category {...args}
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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); //
|
|
213
|
+
children = generateCategoryKeys(category.children, categoryKey); // Recursivamente atualiza os filhos
|
|
220
214
|
}
|
|
221
|
-
|
|
222
|
-
return { ...category, key: categoryKey, children };
|
|
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}
|