@gobolt/genesis 0.4.28 → 0.4.31
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/components/Message/styles.d.ts +2 -2
- package/dist/components/Table/InfiniteScrollTable/InfiniteScrollTable.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +4 -19
- package/dist/components/Table/TableControls/SecondaryTableControlsRow.d.ts +2 -1
- package/dist/index.cjs +54 -25
- package/dist/index.js +54 -25
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const MessageRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
2
|
state: string;
|
|
3
3
|
size: string;
|
|
4
|
-
isFullWidth: boolean;
|
|
4
|
+
$isFullWidth: boolean;
|
|
5
5
|
}>> & string;
|
|
6
6
|
export declare const MessageContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
7
|
size?: string;
|
|
8
8
|
action?: unknown;
|
|
9
|
-
isFullWidth?: boolean;
|
|
9
|
+
$isFullWidth?: boolean;
|
|
10
10
|
}>> & string;
|
|
11
11
|
export declare const ActionButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { InfiniteScrollTableProps } from './types';
|
|
2
|
-
declare const InfiniteScrollTable: <T>({ columns: initialColumns, fetchService, scrollHeight, scrollWidth, onChange, rowSelection, onRowClick, onRowSelectionChange, onDataChange, filterFn, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const InfiniteScrollTable: <T>({ columns: initialColumns, fetchService, title, scrollHeight, scrollWidth, useWindowScroll, onChange, rowSelection, onRowClick, onRowSelectionChange, onDataChange, filterFn, }: InfiniteScrollTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default InfiniteScrollTable;
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import { ColumnType, TablePaginationConfig } from 'antd/es/table';
|
|
2
2
|
import { PaginationStyle } from './TableControls/CustomPagination';
|
|
3
3
|
import { ActionEvent } from '../../types/events';
|
|
4
|
+
import { FetchService } from './InfiniteScrollTable/types';
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
export type Change = (actionEvent: ActionEvent) => void;
|
|
6
7
|
export type SelectionType = "checkbox" | "radio";
|
|
7
8
|
export interface InfiniteScrollConfig<T = any> {
|
|
8
9
|
instanceId: string;
|
|
9
|
-
fetchService:
|
|
10
|
-
|
|
11
|
-
pageParam: number;
|
|
12
|
-
}) => Promise<{
|
|
13
|
-
docs: T[];
|
|
14
|
-
totalDocs: number;
|
|
15
|
-
limit: number;
|
|
16
|
-
page: number;
|
|
17
|
-
totalPages: number;
|
|
18
|
-
pagingCounter: number;
|
|
19
|
-
hasPrevPage: boolean;
|
|
20
|
-
hasNextPage: boolean;
|
|
21
|
-
prevPage?: number;
|
|
22
|
-
nextPage?: number;
|
|
23
|
-
}>;
|
|
24
|
-
queryKey: string[];
|
|
25
|
-
};
|
|
26
|
-
title: string;
|
|
10
|
+
fetchService: FetchService<T>;
|
|
11
|
+
title?: string;
|
|
27
12
|
scrollHeight?: number;
|
|
28
13
|
scrollWidth?: number;
|
|
29
|
-
|
|
14
|
+
useWindowScroll?: boolean;
|
|
30
15
|
}
|
|
31
16
|
export interface TableProps<T extends Record<string, any>> {
|
|
32
17
|
dataSource: T[];
|
|
@@ -9,6 +9,7 @@ export interface SecondaryTableControlsRowProps {
|
|
|
9
9
|
onChange?: Change;
|
|
10
10
|
infiniteScrollData?: InfiniteScrollChangeEvent;
|
|
11
11
|
intialRowTotal?: number;
|
|
12
|
+
hasExternalFilters?: boolean;
|
|
12
13
|
}
|
|
13
|
-
declare const SecondaryTableControlsRow: ({ groups, totalRecords, onChange, infiniteScrollData, intialRowTotal, }: SecondaryTableControlsRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const SecondaryTableControlsRow: ({ groups, totalRecords, onChange, infiniteScrollData, intialRowTotal, hasExternalFilters, }: SecondaryTableControlsRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default SecondaryTableControlsRow;
|
package/dist/index.cjs
CHANGED
|
@@ -78958,7 +78958,7 @@ const MessageRow = styled.div`
|
|
|
78958
78958
|
gap: ${({ theme }) => theme.sizing.Size4}px;
|
|
78959
78959
|
padding: ${({ theme }) => theme.sizing.Size3}px;
|
|
78960
78960
|
background-color: ${({ theme, state }) => theme.colors.status[state].surface};
|
|
78961
|
-
width: ${({ theme, state, size, isFullWidth }) => isFullWidth ? "100%" : size === "standard" ? "320px" : "240px"};
|
|
78961
|
+
width: ${({ theme, state, size, $isFullWidth }) => $isFullWidth ? "100%" : size === "standard" ? "320px" : "240px"};
|
|
78962
78962
|
pointer-events: none;
|
|
78963
78963
|
cursor: default;
|
|
78964
78964
|
border-radius: ${({ theme }) => theme.borderRadius.BorderRadiusSm}px;
|
|
@@ -78968,7 +78968,7 @@ const MessageContent = styled.div`
|
|
|
78968
78968
|
align-items: center;
|
|
78969
78969
|
gap: ${({ theme }) => theme.sizing.Size2}px;
|
|
78970
78970
|
flex: 1;
|
|
78971
|
-
max-width: ${({ size, action, isFullWidth }) => isFullWidth ? "
|
|
78971
|
+
max-width: ${({ size, action, $isFullWidth }) => $isFullWidth ? "700px" : size === "standard" || !action ? "320px" : "240px"};
|
|
78972
78972
|
|
|
78973
78973
|
.ant-typography {
|
|
78974
78974
|
display: -webkit-box;
|
|
@@ -79044,8 +79044,8 @@ const Message = ({
|
|
|
79044
79044
|
const [linkColor, setLinkColor] = React.useState(
|
|
79045
79045
|
theme.colors.interactive.link.active
|
|
79046
79046
|
);
|
|
79047
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(MessageRow, { state, size, isFullWidth, children: [
|
|
79048
|
-
/* @__PURE__ */ jsxRuntime.jsxs(MessageContent, { action, size, isFullWidth, children: [
|
|
79047
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(MessageRow, { state, size, $isFullWidth: isFullWidth, children: [
|
|
79048
|
+
/* @__PURE__ */ jsxRuntime.jsxs(MessageContent, { action, size, $isFullWidth: isFullWidth, children: [
|
|
79049
79049
|
getIcon(state, color2),
|
|
79050
79050
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79051
79051
|
Typography,
|
|
@@ -81625,7 +81625,10 @@ const Progress = ({
|
|
|
81625
81625
|
] });
|
|
81626
81626
|
}
|
|
81627
81627
|
if (isProgressCombined) {
|
|
81628
|
-
const combinedPercent = getCombinedPercent(
|
|
81628
|
+
const combinedPercent = getCombinedPercent(
|
|
81629
|
+
firstBarData,
|
|
81630
|
+
secondBarData || null
|
|
81631
|
+
);
|
|
81629
81632
|
const textColor = Number(combinedPercent) === 100 ? "green" : "black";
|
|
81630
81633
|
const adjustedFirstBar = secondBarData?.value === 100 ? 100 : firstBarData?.value || 0;
|
|
81631
81634
|
const firstBarStrokeColor = theme?.colors?.inputs?.progress?.[firstBarData?.status || "info"];
|
|
@@ -84812,8 +84815,10 @@ const ResizableTitle = (props) => {
|
|
|
84812
84815
|
const InfiniteScrollTable = ({
|
|
84813
84816
|
columns: initialColumns,
|
|
84814
84817
|
fetchService,
|
|
84818
|
+
title = "Data",
|
|
84815
84819
|
scrollHeight = 600,
|
|
84816
84820
|
scrollWidth = 1300,
|
|
84821
|
+
useWindowScroll = false,
|
|
84817
84822
|
onChange,
|
|
84818
84823
|
rowSelection,
|
|
84819
84824
|
onRowClick,
|
|
@@ -84882,19 +84887,37 @@ const InfiniteScrollTable = ({
|
|
|
84882
84887
|
}));
|
|
84883
84888
|
const lastRowRef = React.useCallback(
|
|
84884
84889
|
(node2) => {
|
|
84885
|
-
if (isFetchingNextPage
|
|
84890
|
+
if (isFetchingNextPage) return;
|
|
84886
84891
|
if (observer.current) observer.current.disconnect();
|
|
84887
|
-
|
|
84888
|
-
|
|
84889
|
-
|
|
84890
|
-
|
|
84891
|
-
|
|
84892
|
-
|
|
84893
|
-
|
|
84894
|
-
|
|
84892
|
+
if (useWindowScroll) {
|
|
84893
|
+
observer.current = new IntersectionObserver(
|
|
84894
|
+
(entries) => {
|
|
84895
|
+
if (entries[0].isIntersecting && hasNextPage) {
|
|
84896
|
+
fetchNextPage();
|
|
84897
|
+
}
|
|
84898
|
+
},
|
|
84899
|
+
{ root: null, threshold: 0.1, rootMargin: "100px" }
|
|
84900
|
+
);
|
|
84901
|
+
} else {
|
|
84902
|
+
if (!scrollableNode) return;
|
|
84903
|
+
observer.current = new IntersectionObserver(
|
|
84904
|
+
(entries) => {
|
|
84905
|
+
if (entries[0].isIntersecting && hasNextPage) {
|
|
84906
|
+
fetchNextPage();
|
|
84907
|
+
}
|
|
84908
|
+
},
|
|
84909
|
+
{ root: scrollableNode, threshold: 0.5 }
|
|
84910
|
+
);
|
|
84911
|
+
}
|
|
84895
84912
|
if (node2) observer.current.observe(node2);
|
|
84896
84913
|
},
|
|
84897
|
-
[
|
|
84914
|
+
[
|
|
84915
|
+
isFetchingNextPage,
|
|
84916
|
+
hasNextPage,
|
|
84917
|
+
fetchNextPage,
|
|
84918
|
+
scrollableNode,
|
|
84919
|
+
useWindowScroll
|
|
84920
|
+
]
|
|
84898
84921
|
);
|
|
84899
84922
|
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84900
84923
|
const filteredDataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
@@ -84975,7 +84998,7 @@ const InfiniteScrollTable = ({
|
|
|
84975
84998
|
pagination: false,
|
|
84976
84999
|
showSorterTooltip: false,
|
|
84977
85000
|
size: "small",
|
|
84978
|
-
scroll: { y: scrollHeight, x: scrollWidth },
|
|
85001
|
+
scroll: useWindowScroll ? { x: scrollWidth } : { y: scrollHeight, x: scrollWidth },
|
|
84979
85002
|
onChange: () => {
|
|
84980
85003
|
},
|
|
84981
85004
|
rowSelection: finalRowSelection,
|
|
@@ -85133,10 +85156,10 @@ function Table({
|
|
|
85133
85156
|
title: infiniteScrollConfig.title,
|
|
85134
85157
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
85135
85158
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
85159
|
+
useWindowScroll: infiniteScrollConfig.useWindowScroll,
|
|
85136
85160
|
onChange: isInfiniteScroll ? onChange : onChange,
|
|
85137
85161
|
onRowSelectionChange,
|
|
85138
|
-
onDataChange
|
|
85139
|
-
filterFn: infiniteScrollConfig.filterFn
|
|
85162
|
+
onDataChange
|
|
85140
85163
|
}
|
|
85141
85164
|
);
|
|
85142
85165
|
}
|
|
@@ -85701,7 +85724,8 @@ const SecondaryTableControlsRow = ({
|
|
|
85701
85724
|
totalRecords,
|
|
85702
85725
|
onChange,
|
|
85703
85726
|
infiniteScrollData,
|
|
85704
|
-
intialRowTotal = 40
|
|
85727
|
+
intialRowTotal = 40,
|
|
85728
|
+
hasExternalFilters = false
|
|
85705
85729
|
}) => {
|
|
85706
85730
|
const [hasChanged, setHasChanged] = React__namespace.useState(false);
|
|
85707
85731
|
const onGroupItemClick = (title, item) => {
|
|
@@ -85725,10 +85749,13 @@ const SecondaryTableControlsRow = ({
|
|
|
85725
85749
|
if (groups) {
|
|
85726
85750
|
setHasChanged(true);
|
|
85727
85751
|
}
|
|
85752
|
+
if (hasExternalFilters) {
|
|
85753
|
+
setHasChanged(true);
|
|
85754
|
+
}
|
|
85728
85755
|
return () => {
|
|
85729
85756
|
setHasChanged(false);
|
|
85730
85757
|
};
|
|
85731
|
-
}, [infiniteScrollData, groups]);
|
|
85758
|
+
}, [infiniteScrollData, groups, hasExternalFilters]);
|
|
85732
85759
|
const isGroupsEmpty = groups ? Object.values(groups).every((items) => items.length === 0) : true;
|
|
85733
85760
|
const isMoreThanInitial = infiniteScrollData && Number(infiniteScrollData?.resultsShown) > intialRowTotal || !isGroupsEmpty;
|
|
85734
85761
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -85755,7 +85782,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85755
85782
|
},
|
|
85756
85783
|
children: [
|
|
85757
85784
|
isMoreThanInitial && hasChanged ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body3", color: "#6C6C6C", children: `${infiniteScrollData?.resultsShown ?? intialRowTotal} results` }) : null,
|
|
85758
|
-
!isGroupsEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
85785
|
+
!isGroupsEmpty || hasExternalFilters ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
85759
85786
|
"button",
|
|
85760
85787
|
{
|
|
85761
85788
|
onClick: handleClearFilters,
|
|
@@ -85774,8 +85801,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85774
85801
|
) : null
|
|
85775
85802
|
]
|
|
85776
85803
|
}
|
|
85777
|
-
)
|
|
85778
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 100, height: 0 } })
|
|
85804
|
+
)
|
|
85779
85805
|
]
|
|
85780
85806
|
}
|
|
85781
85807
|
);
|
|
@@ -85816,7 +85842,9 @@ const TableControls = ({
|
|
|
85816
85842
|
groups: secondaryTableRowData.groups,
|
|
85817
85843
|
totalRecords: secondaryTableRowData.totalRecords,
|
|
85818
85844
|
onChange: onSecondaryChange,
|
|
85819
|
-
infiniteScrollData: secondaryTableRowData.infiniteScrollData
|
|
85845
|
+
infiniteScrollData: secondaryTableRowData.infiniteScrollData,
|
|
85846
|
+
hasExternalFilters: secondaryTableRowData.hasExternalFilters,
|
|
85847
|
+
intialRowTotal: secondaryTableRowData.intialRowTotal
|
|
85820
85848
|
}
|
|
85821
85849
|
) : null
|
|
85822
85850
|
]
|
|
@@ -85887,9 +85915,10 @@ const TableWithControls = ({
|
|
|
85887
85915
|
instanceId: infiniteScrollConfig.instanceId,
|
|
85888
85916
|
columns: resizableColumns,
|
|
85889
85917
|
fetchService: infiniteScrollConfig.fetchService,
|
|
85890
|
-
title: infiniteScrollConfig.title,
|
|
85918
|
+
title: infiniteScrollConfig.title || "",
|
|
85891
85919
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
85892
85920
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
85921
|
+
useWindowScroll: infiniteScrollConfig.useWindowScroll,
|
|
85893
85922
|
onChange: onInfiniteScrollTableChange,
|
|
85894
85923
|
rowSelection,
|
|
85895
85924
|
onRowClick: tableOnRowClick || onRowClick,
|
package/dist/index.js
CHANGED
|
@@ -78940,7 +78940,7 @@ const MessageRow = styled.div`
|
|
|
78940
78940
|
gap: ${({ theme }) => theme.sizing.Size4}px;
|
|
78941
78941
|
padding: ${({ theme }) => theme.sizing.Size3}px;
|
|
78942
78942
|
background-color: ${({ theme, state }) => theme.colors.status[state].surface};
|
|
78943
|
-
width: ${({ theme, state, size, isFullWidth }) => isFullWidth ? "100%" : size === "standard" ? "320px" : "240px"};
|
|
78943
|
+
width: ${({ theme, state, size, $isFullWidth }) => $isFullWidth ? "100%" : size === "standard" ? "320px" : "240px"};
|
|
78944
78944
|
pointer-events: none;
|
|
78945
78945
|
cursor: default;
|
|
78946
78946
|
border-radius: ${({ theme }) => theme.borderRadius.BorderRadiusSm}px;
|
|
@@ -78950,7 +78950,7 @@ const MessageContent = styled.div`
|
|
|
78950
78950
|
align-items: center;
|
|
78951
78951
|
gap: ${({ theme }) => theme.sizing.Size2}px;
|
|
78952
78952
|
flex: 1;
|
|
78953
|
-
max-width: ${({ size, action, isFullWidth }) => isFullWidth ? "
|
|
78953
|
+
max-width: ${({ size, action, $isFullWidth }) => $isFullWidth ? "700px" : size === "standard" || !action ? "320px" : "240px"};
|
|
78954
78954
|
|
|
78955
78955
|
.ant-typography {
|
|
78956
78956
|
display: -webkit-box;
|
|
@@ -79026,8 +79026,8 @@ const Message = ({
|
|
|
79026
79026
|
const [linkColor, setLinkColor] = useState(
|
|
79027
79027
|
theme.colors.interactive.link.active
|
|
79028
79028
|
);
|
|
79029
|
-
return /* @__PURE__ */ jsxs(MessageRow, { state, size, isFullWidth, children: [
|
|
79030
|
-
/* @__PURE__ */ jsxs(MessageContent, { action, size, isFullWidth, children: [
|
|
79029
|
+
return /* @__PURE__ */ jsxs(MessageRow, { state, size, $isFullWidth: isFullWidth, children: [
|
|
79030
|
+
/* @__PURE__ */ jsxs(MessageContent, { action, size, $isFullWidth: isFullWidth, children: [
|
|
79031
79031
|
getIcon(state, color2),
|
|
79032
79032
|
/* @__PURE__ */ jsx(
|
|
79033
79033
|
Typography,
|
|
@@ -81607,7 +81607,10 @@ const Progress = ({
|
|
|
81607
81607
|
] });
|
|
81608
81608
|
}
|
|
81609
81609
|
if (isProgressCombined) {
|
|
81610
|
-
const combinedPercent = getCombinedPercent(
|
|
81610
|
+
const combinedPercent = getCombinedPercent(
|
|
81611
|
+
firstBarData,
|
|
81612
|
+
secondBarData || null
|
|
81613
|
+
);
|
|
81611
81614
|
const textColor = Number(combinedPercent) === 100 ? "green" : "black";
|
|
81612
81615
|
const adjustedFirstBar = secondBarData?.value === 100 ? 100 : firstBarData?.value || 0;
|
|
81613
81616
|
const firstBarStrokeColor = theme?.colors?.inputs?.progress?.[firstBarData?.status || "info"];
|
|
@@ -84794,8 +84797,10 @@ const ResizableTitle = (props) => {
|
|
|
84794
84797
|
const InfiniteScrollTable = ({
|
|
84795
84798
|
columns: initialColumns,
|
|
84796
84799
|
fetchService,
|
|
84800
|
+
title = "Data",
|
|
84797
84801
|
scrollHeight = 600,
|
|
84798
84802
|
scrollWidth = 1300,
|
|
84803
|
+
useWindowScroll = false,
|
|
84799
84804
|
onChange,
|
|
84800
84805
|
rowSelection,
|
|
84801
84806
|
onRowClick,
|
|
@@ -84864,19 +84869,37 @@ const InfiniteScrollTable = ({
|
|
|
84864
84869
|
}));
|
|
84865
84870
|
const lastRowRef = useCallback(
|
|
84866
84871
|
(node2) => {
|
|
84867
|
-
if (isFetchingNextPage
|
|
84872
|
+
if (isFetchingNextPage) return;
|
|
84868
84873
|
if (observer.current) observer.current.disconnect();
|
|
84869
|
-
|
|
84870
|
-
|
|
84871
|
-
|
|
84872
|
-
|
|
84873
|
-
|
|
84874
|
-
|
|
84875
|
-
|
|
84876
|
-
|
|
84874
|
+
if (useWindowScroll) {
|
|
84875
|
+
observer.current = new IntersectionObserver(
|
|
84876
|
+
(entries) => {
|
|
84877
|
+
if (entries[0].isIntersecting && hasNextPage) {
|
|
84878
|
+
fetchNextPage();
|
|
84879
|
+
}
|
|
84880
|
+
},
|
|
84881
|
+
{ root: null, threshold: 0.1, rootMargin: "100px" }
|
|
84882
|
+
);
|
|
84883
|
+
} else {
|
|
84884
|
+
if (!scrollableNode) return;
|
|
84885
|
+
observer.current = new IntersectionObserver(
|
|
84886
|
+
(entries) => {
|
|
84887
|
+
if (entries[0].isIntersecting && hasNextPage) {
|
|
84888
|
+
fetchNextPage();
|
|
84889
|
+
}
|
|
84890
|
+
},
|
|
84891
|
+
{ root: scrollableNode, threshold: 0.5 }
|
|
84892
|
+
);
|
|
84893
|
+
}
|
|
84877
84894
|
if (node2) observer.current.observe(node2);
|
|
84878
84895
|
},
|
|
84879
|
-
[
|
|
84896
|
+
[
|
|
84897
|
+
isFetchingNextPage,
|
|
84898
|
+
hasNextPage,
|
|
84899
|
+
fetchNextPage,
|
|
84900
|
+
scrollableNode,
|
|
84901
|
+
useWindowScroll
|
|
84902
|
+
]
|
|
84880
84903
|
);
|
|
84881
84904
|
const rawDataSource = data?.pages.flatMap((page) => page.docs) ?? [];
|
|
84882
84905
|
const filteredDataSource = filterFn ? filterFn(rawDataSource) : rawDataSource;
|
|
@@ -84957,7 +84980,7 @@ const InfiniteScrollTable = ({
|
|
|
84957
84980
|
pagination: false,
|
|
84958
84981
|
showSorterTooltip: false,
|
|
84959
84982
|
size: "small",
|
|
84960
|
-
scroll: { y: scrollHeight, x: scrollWidth },
|
|
84983
|
+
scroll: useWindowScroll ? { x: scrollWidth } : { y: scrollHeight, x: scrollWidth },
|
|
84961
84984
|
onChange: () => {
|
|
84962
84985
|
},
|
|
84963
84986
|
rowSelection: finalRowSelection,
|
|
@@ -85115,10 +85138,10 @@ function Table({
|
|
|
85115
85138
|
title: infiniteScrollConfig.title,
|
|
85116
85139
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
85117
85140
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
85141
|
+
useWindowScroll: infiniteScrollConfig.useWindowScroll,
|
|
85118
85142
|
onChange: isInfiniteScroll ? onChange : onChange,
|
|
85119
85143
|
onRowSelectionChange,
|
|
85120
|
-
onDataChange
|
|
85121
|
-
filterFn: infiniteScrollConfig.filterFn
|
|
85144
|
+
onDataChange
|
|
85122
85145
|
}
|
|
85123
85146
|
);
|
|
85124
85147
|
}
|
|
@@ -85683,7 +85706,8 @@ const SecondaryTableControlsRow = ({
|
|
|
85683
85706
|
totalRecords,
|
|
85684
85707
|
onChange,
|
|
85685
85708
|
infiniteScrollData,
|
|
85686
|
-
intialRowTotal = 40
|
|
85709
|
+
intialRowTotal = 40,
|
|
85710
|
+
hasExternalFilters = false
|
|
85687
85711
|
}) => {
|
|
85688
85712
|
const [hasChanged, setHasChanged] = React.useState(false);
|
|
85689
85713
|
const onGroupItemClick = (title, item) => {
|
|
@@ -85707,10 +85731,13 @@ const SecondaryTableControlsRow = ({
|
|
|
85707
85731
|
if (groups) {
|
|
85708
85732
|
setHasChanged(true);
|
|
85709
85733
|
}
|
|
85734
|
+
if (hasExternalFilters) {
|
|
85735
|
+
setHasChanged(true);
|
|
85736
|
+
}
|
|
85710
85737
|
return () => {
|
|
85711
85738
|
setHasChanged(false);
|
|
85712
85739
|
};
|
|
85713
|
-
}, [infiniteScrollData, groups]);
|
|
85740
|
+
}, [infiniteScrollData, groups, hasExternalFilters]);
|
|
85714
85741
|
const isGroupsEmpty = groups ? Object.values(groups).every((items) => items.length === 0) : true;
|
|
85715
85742
|
const isMoreThanInitial = infiniteScrollData && Number(infiniteScrollData?.resultsShown) > intialRowTotal || !isGroupsEmpty;
|
|
85716
85743
|
return /* @__PURE__ */ jsxs(
|
|
@@ -85737,7 +85764,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85737
85764
|
},
|
|
85738
85765
|
children: [
|
|
85739
85766
|
isMoreThanInitial && hasChanged ? /* @__PURE__ */ jsx(Typography, { variant: "body3", color: "#6C6C6C", children: `${infiniteScrollData?.resultsShown ?? intialRowTotal} results` }) : null,
|
|
85740
|
-
!isGroupsEmpty ? /* @__PURE__ */ jsx(
|
|
85767
|
+
!isGroupsEmpty || hasExternalFilters ? /* @__PURE__ */ jsx(
|
|
85741
85768
|
"button",
|
|
85742
85769
|
{
|
|
85743
85770
|
onClick: handleClearFilters,
|
|
@@ -85756,8 +85783,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85756
85783
|
) : null
|
|
85757
85784
|
]
|
|
85758
85785
|
}
|
|
85759
|
-
)
|
|
85760
|
-
/* @__PURE__ */ jsx("div", { style: { width: 100, height: 0 } })
|
|
85786
|
+
)
|
|
85761
85787
|
]
|
|
85762
85788
|
}
|
|
85763
85789
|
);
|
|
@@ -85798,7 +85824,9 @@ const TableControls = ({
|
|
|
85798
85824
|
groups: secondaryTableRowData.groups,
|
|
85799
85825
|
totalRecords: secondaryTableRowData.totalRecords,
|
|
85800
85826
|
onChange: onSecondaryChange,
|
|
85801
|
-
infiniteScrollData: secondaryTableRowData.infiniteScrollData
|
|
85827
|
+
infiniteScrollData: secondaryTableRowData.infiniteScrollData,
|
|
85828
|
+
hasExternalFilters: secondaryTableRowData.hasExternalFilters,
|
|
85829
|
+
intialRowTotal: secondaryTableRowData.intialRowTotal
|
|
85802
85830
|
}
|
|
85803
85831
|
) : null
|
|
85804
85832
|
]
|
|
@@ -85869,9 +85897,10 @@ const TableWithControls = ({
|
|
|
85869
85897
|
instanceId: infiniteScrollConfig.instanceId,
|
|
85870
85898
|
columns: resizableColumns,
|
|
85871
85899
|
fetchService: infiniteScrollConfig.fetchService,
|
|
85872
|
-
title: infiniteScrollConfig.title,
|
|
85900
|
+
title: infiniteScrollConfig.title || "",
|
|
85873
85901
|
scrollHeight: infiniteScrollConfig.scrollHeight,
|
|
85874
85902
|
scrollWidth: infiniteScrollConfig.scrollWidth,
|
|
85903
|
+
useWindowScroll: infiniteScrollConfig.useWindowScroll,
|
|
85875
85904
|
onChange: onInfiniteScrollTableChange,
|
|
85876
85905
|
rowSelection,
|
|
85877
85906
|
onRowClick: tableOnRowClick || onRowClick,
|