rez-table-listing-mui 1.2.6 → 1.2.8

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.2.6",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
package/rollup.config.js CHANGED
@@ -15,12 +15,12 @@ export default [
15
15
  {
16
16
  file: packageJson.main,
17
17
  format: "cjs",
18
- sourmap: true,
18
+ sourcemap: true,
19
19
  },
20
20
  {
21
21
  file: packageJson.module,
22
22
  format: "esm",
23
- sourmap: true,
23
+ sourcemap: true,
24
24
  },
25
25
  ],
26
26
  plugins: [
@@ -191,7 +191,10 @@ const AttributesFilter = ({
191
191
  )}
192
192
 
193
193
  {dropdownData && (
194
- <Box sx={{ mt: 2 }}>
194
+ <Box
195
+ className="attributes-filter-list"
196
+ sx={{ mt: 2, overflow: "auto", maxHeight: "calc(100dvh - 300px)" }}
197
+ >
195
198
  <FormControl>
196
199
  {selectedAttributeOptions
197
200
  ?.filter((option) => {
@@ -11,7 +11,10 @@ interface TableSearchProps {
11
11
  onChange: (value: string) => void;
12
12
  }
13
13
 
14
- const TableSearch = ({ value, onChange }: TableSearchProps): JSX.Element => {
14
+ export const TableSearch = ({
15
+ value,
16
+ onChange,
17
+ }: TableSearchProps): JSX.Element => {
15
18
  const [showSearchInput, setShowSearchInput] = useState(false);
16
19
  const [localValue, setLocalValue] = useState(value);
17
20
  const searchContainerRef = useRef<HTMLDivElement>(null);
@@ -115,5 +118,3 @@ const TableSearch = ({ value, onChange }: TableSearchProps): JSX.Element => {
115
118
  </Box>
116
119
  );
117
120
  };
118
-
119
- export default TableSearch;
@@ -4,6 +4,7 @@ import { CraftTableOptionsProps } from "../../types/table-options";
4
4
  import SettingsOutlinedIcon from "@mui/icons-material/SettingsOutlined";
5
5
  import { settingsOptionsProps } from "../../types/table";
6
6
  import { tableTabsStyles } from "./styles";
7
+ import { useMemo } from "react";
7
8
 
8
9
  interface TabDataProps {
9
10
  tab_value: string | null;
@@ -36,12 +37,24 @@ export function TableTabs({
36
37
  };
37
38
 
38
39
  // Normalize tab_value to uppercase for display + logic
39
- const normalizedTabs = tabsData
40
- ?.filter((tab) => tab.tab_value)
41
- ?.map((tab) => ({
42
- ...tab,
43
- tab_value: tab.tab_value,
44
- }));
40
+ const normalizedTabs = useMemo(() => {
41
+ return tabsData
42
+ ?.filter((tab) => tab.tab_value !== null)
43
+ ?.map((tab) => ({
44
+ ...tab,
45
+ tab_value: tab.tab_value?.toUpperCase(),
46
+ }));
47
+ }, [tabsData]);
48
+
49
+ const defaultTab = useMemo(() => {
50
+ return (
51
+ normalizedTabs.find((t) => t.tab_value === "ALL")?.tab_value ||
52
+ normalizedTabs[0]?.tab_value ||
53
+ ""
54
+ );
55
+ }, [normalizedTabs]);
56
+
57
+ const selectedTab = activeTab || defaultTab;
45
58
 
46
59
  return (
47
60
  <Box display="flex" alignItems="center" justifyContent="flex-start">
@@ -57,10 +70,10 @@ export function TableTabs({
57
70
 
58
71
  {/* Tabs */}
59
72
  <Tabs
60
- value={activeTab}
73
+ value={selectedTab}
61
74
  onChange={(_, newValue) => handleTabClick(newValue)}
62
75
  variant="scrollable"
63
- scrollButtons={false}
76
+ scrollButtons="auto"
64
77
  slotProps={{ indicator: { sx: { display: "none" } } }}
65
78
  sx={tableTabsStyles.tabs}
66
79
  >
@@ -16,7 +16,7 @@ import { useFullscreenPopoverContainer } from "../../libs/hooks/useFullScreen";
16
16
  import SortPopover from "../sorting-modal.tsx";
17
17
  import ColumnToggle from "../column-visibility-modal/index.tsx";
18
18
  import { CraftTableOptionsProps } from "../../types/table-options.ts";
19
- import TableSearch from "../search/index.tsx";
19
+ import { TableSearch } from "../search/index.tsx";
20
20
 
21
21
  interface TopbarProps<T> {
22
22
  table: Table<T>;
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ export { useCraftTableFilterSettings } from "./libs/hooks/useCraftTableFilterSet
4
4
  export { TableTabs as CraftTableTabs } from "./components/tabs";
5
5
  export { TableFilter as CraftTableFilter } from "./components/filter";
6
6
  export { QuickFilterSettings as CraftTableSettings } from "./components/table-settings";
7
+ export { TableSearch as CraftTableSearch } from "./components/search";
7
8
 
8
9
  export * from "./types/table";
9
10
  export * from "./types/table-options";
File without changes