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/dist/index.d.ts +7 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
- package/rollup.config.js +2 -2
- package/src/components/filter/components/attributes-filter.tsx +4 -1
- package/src/components/search/index.tsx +4 -3
- package/src/components/tabs/index.tsx +21 -8
- package/src/components/topbar/index.tsx +1 -1
- package/src/index.ts +1 -0
- /package/src/components/search/{style.tsx → style.ts} +0 -0
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -191,7 +191,10 @@ const AttributesFilter = ({
|
|
|
191
191
|
)}
|
|
192
192
|
|
|
193
193
|
{dropdownData && (
|
|
194
|
-
<Box
|
|
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 = ({
|
|
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 =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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={
|
|
73
|
+
value={selectedTab}
|
|
61
74
|
onChange={(_, newValue) => handleTabClick(newValue)}
|
|
62
75
|
variant="scrollable"
|
|
63
|
-
scrollButtons=
|
|
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
|