@gobolt/genesis 0.4.28 → 0.4.30
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.
|
@@ -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
|
@@ -85701,7 +85701,8 @@ const SecondaryTableControlsRow = ({
|
|
|
85701
85701
|
totalRecords,
|
|
85702
85702
|
onChange,
|
|
85703
85703
|
infiniteScrollData,
|
|
85704
|
-
intialRowTotal = 40
|
|
85704
|
+
intialRowTotal = 40,
|
|
85705
|
+
hasExternalFilters = false
|
|
85705
85706
|
}) => {
|
|
85706
85707
|
const [hasChanged, setHasChanged] = React__namespace.useState(false);
|
|
85707
85708
|
const onGroupItemClick = (title, item) => {
|
|
@@ -85725,10 +85726,13 @@ const SecondaryTableControlsRow = ({
|
|
|
85725
85726
|
if (groups) {
|
|
85726
85727
|
setHasChanged(true);
|
|
85727
85728
|
}
|
|
85729
|
+
if (hasExternalFilters) {
|
|
85730
|
+
setHasChanged(true);
|
|
85731
|
+
}
|
|
85728
85732
|
return () => {
|
|
85729
85733
|
setHasChanged(false);
|
|
85730
85734
|
};
|
|
85731
|
-
}, [infiniteScrollData, groups]);
|
|
85735
|
+
}, [infiniteScrollData, groups, hasExternalFilters]);
|
|
85732
85736
|
const isGroupsEmpty = groups ? Object.values(groups).every((items) => items.length === 0) : true;
|
|
85733
85737
|
const isMoreThanInitial = infiniteScrollData && Number(infiniteScrollData?.resultsShown) > intialRowTotal || !isGroupsEmpty;
|
|
85734
85738
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -85755,7 +85759,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85755
85759
|
},
|
|
85756
85760
|
children: [
|
|
85757
85761
|
isMoreThanInitial && hasChanged ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body3", color: "#6C6C6C", children: `${infiniteScrollData?.resultsShown ?? intialRowTotal} results` }) : null,
|
|
85758
|
-
!isGroupsEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
85762
|
+
!isGroupsEmpty || hasExternalFilters ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
85759
85763
|
"button",
|
|
85760
85764
|
{
|
|
85761
85765
|
onClick: handleClearFilters,
|
|
@@ -85816,7 +85820,9 @@ const TableControls = ({
|
|
|
85816
85820
|
groups: secondaryTableRowData.groups,
|
|
85817
85821
|
totalRecords: secondaryTableRowData.totalRecords,
|
|
85818
85822
|
onChange: onSecondaryChange,
|
|
85819
|
-
infiniteScrollData: secondaryTableRowData.infiniteScrollData
|
|
85823
|
+
infiniteScrollData: secondaryTableRowData.infiniteScrollData,
|
|
85824
|
+
hasExternalFilters: secondaryTableRowData.hasExternalFilters,
|
|
85825
|
+
intialRowTotal: secondaryTableRowData.intialRowTotal
|
|
85820
85826
|
}
|
|
85821
85827
|
) : null
|
|
85822
85828
|
]
|
package/dist/index.js
CHANGED
|
@@ -85683,7 +85683,8 @@ const SecondaryTableControlsRow = ({
|
|
|
85683
85683
|
totalRecords,
|
|
85684
85684
|
onChange,
|
|
85685
85685
|
infiniteScrollData,
|
|
85686
|
-
intialRowTotal = 40
|
|
85686
|
+
intialRowTotal = 40,
|
|
85687
|
+
hasExternalFilters = false
|
|
85687
85688
|
}) => {
|
|
85688
85689
|
const [hasChanged, setHasChanged] = React.useState(false);
|
|
85689
85690
|
const onGroupItemClick = (title, item) => {
|
|
@@ -85707,10 +85708,13 @@ const SecondaryTableControlsRow = ({
|
|
|
85707
85708
|
if (groups) {
|
|
85708
85709
|
setHasChanged(true);
|
|
85709
85710
|
}
|
|
85711
|
+
if (hasExternalFilters) {
|
|
85712
|
+
setHasChanged(true);
|
|
85713
|
+
}
|
|
85710
85714
|
return () => {
|
|
85711
85715
|
setHasChanged(false);
|
|
85712
85716
|
};
|
|
85713
|
-
}, [infiniteScrollData, groups]);
|
|
85717
|
+
}, [infiniteScrollData, groups, hasExternalFilters]);
|
|
85714
85718
|
const isGroupsEmpty = groups ? Object.values(groups).every((items) => items.length === 0) : true;
|
|
85715
85719
|
const isMoreThanInitial = infiniteScrollData && Number(infiniteScrollData?.resultsShown) > intialRowTotal || !isGroupsEmpty;
|
|
85716
85720
|
return /* @__PURE__ */ jsxs(
|
|
@@ -85737,7 +85741,7 @@ const SecondaryTableControlsRow = ({
|
|
|
85737
85741
|
},
|
|
85738
85742
|
children: [
|
|
85739
85743
|
isMoreThanInitial && hasChanged ? /* @__PURE__ */ jsx(Typography, { variant: "body3", color: "#6C6C6C", children: `${infiniteScrollData?.resultsShown ?? intialRowTotal} results` }) : null,
|
|
85740
|
-
!isGroupsEmpty ? /* @__PURE__ */ jsx(
|
|
85744
|
+
!isGroupsEmpty || hasExternalFilters ? /* @__PURE__ */ jsx(
|
|
85741
85745
|
"button",
|
|
85742
85746
|
{
|
|
85743
85747
|
onClick: handleClearFilters,
|
|
@@ -85798,7 +85802,9 @@ const TableControls = ({
|
|
|
85798
85802
|
groups: secondaryTableRowData.groups,
|
|
85799
85803
|
totalRecords: secondaryTableRowData.totalRecords,
|
|
85800
85804
|
onChange: onSecondaryChange,
|
|
85801
|
-
infiniteScrollData: secondaryTableRowData.infiniteScrollData
|
|
85805
|
+
infiniteScrollData: secondaryTableRowData.infiniteScrollData,
|
|
85806
|
+
hasExternalFilters: secondaryTableRowData.hasExternalFilters,
|
|
85807
|
+
intialRowTotal: secondaryTableRowData.intialRowTotal
|
|
85802
85808
|
}
|
|
85803
85809
|
) : null
|
|
85804
85810
|
]
|