rez-table-listing-mui 1.3.57 → 1.3.59

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": "rez-table-listing-mui",
3
- "version": "1.3.57",
3
+ "version": "1.3.59",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
@@ -8,8 +8,8 @@ import { useMemo } from "react";
8
8
  import { SettingIcon } from "../../../assets/svg";
9
9
 
10
10
  interface TabDataProps {
11
- tab_value: string | null;
12
- tab_value_count: string | number;
11
+ tab_name: string | null;
12
+ count: string | number;
13
13
  }
14
14
 
15
15
  interface TableTabsProps {
@@ -37,20 +37,20 @@ export function TableTabs({
37
37
  tableStates.setPagination((prev) => ({ ...prev, pageIndex: 0 }));
38
38
  };
39
39
 
40
- // Normalize tab_value to uppercase for display + logic
40
+ // Normalize tab_name to uppercase for display + logic
41
41
  const normalizedTabs = useMemo(() => {
42
42
  return tabsData
43
- ?.filter((tab) => tab.tab_value !== null)
43
+ ?.filter((tab) => tab.tab_name !== null)
44
44
  ?.map((tab) => ({
45
45
  ...tab,
46
- tab_value: tab.tab_value,
46
+ tab_name: tab.tab_name,
47
47
  }));
48
48
  }, [tabsData]);
49
49
 
50
50
  const defaultTab = useMemo(() => {
51
51
  return (
52
- normalizedTabs.find((t) => t.tab_value === "All")?.tab_value ||
53
- normalizedTabs[0]?.tab_value ||
52
+ normalizedTabs.find((t) => t.tab_name === "All")?.tab_name ||
53
+ normalizedTabs[0]?.tab_name ||
54
54
  ""
55
55
  );
56
56
  }, [normalizedTabs]);
@@ -78,16 +78,16 @@ export function TableTabs({
78
78
  slotProps={{ indicator: { sx: { display: "none" } } }}
79
79
  sx={tableTabsStyles.tabs}
80
80
  >
81
- {normalizedTabs.map(({ tab_value, tab_value_count }) => {
82
- const isSelected = activeTab === tab_value;
81
+ {normalizedTabs.map(({ tab_name, count }) => {
82
+ const isSelected = activeTab === tab_name;
83
83
 
84
84
  return (
85
85
  <Tab
86
- key={tab_value}
87
- value={tab_value}
86
+ key={tab_name}
87
+ value={tab_name}
88
88
  label={
89
89
  <Box display="flex" alignItems="center" gap={1}>
90
- <Box>{tab_value}</Box>
90
+ <Box>{tab_name}</Box>
91
91
  <Box
92
92
  sx={{
93
93
  ...tableTabsStyles.tabCount,
@@ -100,9 +100,7 @@ export function TableTabs({
100
100
  }),
101
101
  }}
102
102
  >
103
- {tab_value_count == 0
104
- ? "0"
105
- : String(tab_value_count).padStart(2, "0")}
103
+ {count == 0 ? "0" : String(count).padStart(2, "0")}
106
104
  </Box>
107
105
  </Box>
108
106
  }
@@ -72,8 +72,8 @@ export interface viewSettingsDropDownAPIProps {
72
72
  }
73
73
 
74
74
  interface EntityListTab {
75
- tab_value: string | null;
76
- tab_value_count: string | number;
75
+ tab_name: string | null;
76
+ count: string | number;
77
77
  }
78
78
 
79
79
  interface EntityList {
@@ -231,17 +231,17 @@ function ListingView() {
231
231
  tabsData &&
232
232
  tabsData.length > 0 &&
233
233
  !tabsData.some(
234
- (tab) => tab.tab_value?.toLowerCase() === selectedTab.toLowerCase()
234
+ (tab) => tab.tab_name?.toLowerCase() === selectedTab.toLowerCase()
235
235
  )
236
236
  ) {
237
237
  // Try to select 'ALL' if it exists
238
238
  const allTab = tabsData.find(
239
- (tab) => tab.tab_value?.toLowerCase() === "all"
239
+ (tab) => tab.tab_name?.toLowerCase() === "all"
240
240
  );
241
241
  if (allTab) {
242
- setSelectedTab(allTab.tab_value || "All");
242
+ setSelectedTab(allTab.tab_name || "All");
243
243
  } else {
244
- setSelectedTab(tabsData[0].tab_value || "All");
244
+ setSelectedTab(tabsData[0].tab_name || "All");
245
245
  }
246
246
  }
247
247
  }, [tabsData, selectedTab]);
@@ -251,9 +251,9 @@ function ListingView() {
251
251
  tableData?.entity_tabs?.find((tab) => {
252
252
  const activeTab = selectedTab || "All";
253
253
  return (
254
- tab.tab_value?.toLocaleLowerCase() === activeTab.toLocaleLowerCase()
254
+ tab.tab_name?.toLocaleLowerCase() === activeTab.toLocaleLowerCase()
255
255
  );
256
- })?.tab_value_count || "0"
256
+ })?.count || "0"
257
257
  );
258
258
  }, [tableData, selectedTab]);
259
259