@gobolt/genesis 0.4.0 → 0.4.2
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/Row/Row.d.ts +1 -1
- package/dist/components/Row/RowLabelValue/RowLabelValue.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/TableWithControls/TableWithControls.d.ts +2 -4
- package/dist/index.cjs +55 -28
- package/dist/index.js +55 -28
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ import * as React from "react";
|
|
|
5
5
|
export type Change = (actionEvent: ActionEvent) => void;
|
|
6
6
|
export type SelectionType = "checkbox" | "radio";
|
|
7
7
|
export interface MaterializedViewConfig<T = any> {
|
|
8
|
-
enabled: boolean;
|
|
9
8
|
height?: number | string;
|
|
10
9
|
onLoadMore?: (offset: number, limit: number) => Promise<T[]> | T[];
|
|
11
10
|
loadMoreThreshold?: number;
|
|
@@ -27,7 +26,7 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
27
26
|
name?: string;
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
|
-
onChange?: (pagination:
|
|
29
|
+
onChange?: (pagination: TablePaginationConfig, filters: Record<string, any>, sorter: SorterResult<T> | SorterResult<T>[], extra: any) => void;
|
|
31
30
|
loading?: boolean;
|
|
32
31
|
pagination?: (TablePaginationConfig & {
|
|
33
32
|
paginationStyle?: PaginationStyle;
|
|
@@ -42,7 +41,8 @@ export interface TableProps<T extends Record<string, any>> {
|
|
|
42
41
|
};
|
|
43
42
|
[key: string]: any;
|
|
44
43
|
isMainContentCell?: boolean;
|
|
45
|
-
|
|
44
|
+
isMaterializedView?: boolean;
|
|
45
|
+
materializedViewConfig?: MaterializedViewConfig<T>;
|
|
46
46
|
}
|
|
47
47
|
export type TablePaginationType = {
|
|
48
48
|
pageSize?: number;
|
|
@@ -56,5 +56,5 @@ export type SorterResult<T> = {
|
|
|
56
56
|
field?: keyof T | string | React.Key | readonly React.Key[];
|
|
57
57
|
columnKey?: React.Key;
|
|
58
58
|
};
|
|
59
|
-
declare function Table<T extends Record<string, any>>({ columns, dataSource, rowKey, size, onChange, rowSelection, pagination, isMainContentCell,
|
|
59
|
+
declare function Table<T extends Record<string, any>>({ columns, dataSource, rowKey, size, onChange, rowSelection, pagination, isMainContentCell, isMaterializedView, materializedViewConfig, ...rest }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
60
60
|
export default Table;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { TableProps } from '../Table';
|
|
2
2
|
import { TableControlsData } from '../Table/TableControls/TableControls';
|
|
3
|
+
import { ActionEvent, TableEventPayload } from '../../types/events';
|
|
3
4
|
export interface TableWithControlsProps {
|
|
4
5
|
tableControlsData: TableControlsData;
|
|
5
6
|
tableData: TableProps<Record<string, any>>;
|
|
6
|
-
onChange: (event:
|
|
7
|
-
event: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
7
|
+
onChange: (event: ActionEvent<TableEventPayload>) => void;
|
|
10
8
|
}
|
|
11
9
|
declare const TableWithControls: ({ tableData, tableControlsData, onChange, }: TableWithControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
export default TableWithControls;
|
package/dist/index.cjs
CHANGED
|
@@ -82128,6 +82128,9 @@ const getTextComponent = (firstBarData, secondBarData, stateColor, theme, isText
|
|
|
82128
82128
|
);
|
|
82129
82129
|
};
|
|
82130
82130
|
const getCombinedPercent = (firstBarData, secondBarData) => {
|
|
82131
|
+
if (secondBarData?.value === 0) {
|
|
82132
|
+
return firstBarData?.value;
|
|
82133
|
+
}
|
|
82131
82134
|
if (firstBarData?.value && secondBarData?.value) {
|
|
82132
82135
|
const total = firstBarData?.value + secondBarData?.value;
|
|
82133
82136
|
const dividedBy = total / 2;
|
|
@@ -82402,7 +82405,7 @@ const Radio = ({ id: id2, label, selectedId, onChange, isDisabled }) => {
|
|
|
82402
82405
|
RadioWrapper,
|
|
82403
82406
|
{
|
|
82404
82407
|
ref: radioReference,
|
|
82405
|
-
$isDisabled: isDisabled,
|
|
82408
|
+
$isDisabled: isDisabled ?? false,
|
|
82406
82409
|
onFocus: (e3) => {
|
|
82407
82410
|
if (isDisabled || e3.target !== radioReference.current) return;
|
|
82408
82411
|
setIsFocused(true);
|
|
@@ -82571,7 +82574,7 @@ const RowLabelValue = ({
|
|
|
82571
82574
|
children: label
|
|
82572
82575
|
}
|
|
82573
82576
|
) }),
|
|
82574
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(RowSkeleton, { isFullWidth }) }) : getBadgeOrTypography(badgeProps, value2) })
|
|
82577
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(RowSkeleton, { isFullWidth: isFullWidth ?? false }) }) : getBadgeOrTypography(badgeProps, value2) })
|
|
82575
82578
|
] });
|
|
82576
82579
|
};
|
|
82577
82580
|
const ActionsContainer = styled.div`
|
|
@@ -82621,13 +82624,13 @@ const Row = ({
|
|
|
82621
82624
|
RowLabelValue,
|
|
82622
82625
|
{
|
|
82623
82626
|
label,
|
|
82624
|
-
value: value2,
|
|
82627
|
+
value: value2 ?? "",
|
|
82625
82628
|
isFullWidth,
|
|
82626
82629
|
isLoading,
|
|
82627
82630
|
badgeProps: badgeProperties
|
|
82628
82631
|
}
|
|
82629
82632
|
),
|
|
82630
|
-
/* @__PURE__ */ jsxRuntime.jsx(RowActions, { actions })
|
|
82633
|
+
/* @__PURE__ */ jsxRuntime.jsx(RowActions, { actions: actions ?? null })
|
|
82631
82634
|
]
|
|
82632
82635
|
}
|
|
82633
82636
|
);
|
|
@@ -82682,11 +82685,14 @@ const SegmentedControls = ({
|
|
|
82682
82685
|
value: id2,
|
|
82683
82686
|
icon
|
|
82684
82687
|
}));
|
|
82688
|
+
const handleChange = (value2) => {
|
|
82689
|
+
onChange(String(value2));
|
|
82690
|
+
};
|
|
82685
82691
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
82686
82692
|
SegmentedControls$1,
|
|
82687
82693
|
{
|
|
82688
82694
|
options: antOptions,
|
|
82689
|
-
onChange,
|
|
82695
|
+
onChange: handleChange,
|
|
82690
82696
|
value: selectedTabId,
|
|
82691
82697
|
block: isScaled
|
|
82692
82698
|
}
|
|
@@ -82944,6 +82950,7 @@ const Select = ({
|
|
|
82944
82950
|
}
|
|
82945
82951
|
};
|
|
82946
82952
|
const getSelectModeValue = (value22) => {
|
|
82953
|
+
if (!value22) return "";
|
|
82947
82954
|
if (Array.isArray(value22)) {
|
|
82948
82955
|
if (selectDisplayMode === "count") {
|
|
82949
82956
|
return `${value22.length} selected`;
|
|
@@ -83663,7 +83670,8 @@ function Table({
|
|
|
83663
83670
|
rowSelection,
|
|
83664
83671
|
pagination,
|
|
83665
83672
|
isMainContentCell = false,
|
|
83666
|
-
|
|
83673
|
+
isMaterializedView = false,
|
|
83674
|
+
materializedViewConfig,
|
|
83667
83675
|
...rest
|
|
83668
83676
|
}) {
|
|
83669
83677
|
const [materializedData, setMaterializedData] = React__namespace.useState([]);
|
|
@@ -83671,27 +83679,29 @@ function Table({
|
|
|
83671
83679
|
const [hasMoreData, setHasMoreData] = React__namespace.useState(true);
|
|
83672
83680
|
const tableRef = React__namespace.useRef(null);
|
|
83673
83681
|
React__namespace.useEffect(() => {
|
|
83674
|
-
if (
|
|
83675
|
-
const initialSize =
|
|
83682
|
+
if (isMaterializedView) {
|
|
83683
|
+
const initialSize = materializedViewConfig?.initialLoadSize || 50;
|
|
83676
83684
|
const initialData = dataSource.slice(0, initialSize);
|
|
83677
83685
|
setMaterializedData(initialData);
|
|
83678
83686
|
setHasMoreData(dataSource.length > initialSize);
|
|
83679
83687
|
}
|
|
83680
|
-
}, [dataSource,
|
|
83688
|
+
}, [dataSource, isMaterializedView, materializedViewConfig]);
|
|
83681
83689
|
const handleScroll = React__namespace.useCallback(
|
|
83682
83690
|
debounce((e3) => {
|
|
83683
|
-
if (!
|
|
83691
|
+
if (!isMaterializedView || !materializedViewConfig?.onLoadMore || isLoadingMore || !hasMoreData) {
|
|
83684
83692
|
return;
|
|
83685
83693
|
}
|
|
83686
83694
|
const { target } = e3;
|
|
83687
83695
|
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
83688
|
-
const threshold =
|
|
83696
|
+
const threshold = materializedViewConfig?.loadMoreThreshold || 100;
|
|
83689
83697
|
if (scrollTop + clientHeight >= scrollHeight - threshold) {
|
|
83690
83698
|
setIsLoadingMore(true);
|
|
83691
83699
|
const currentLength = materializedData.length;
|
|
83692
|
-
const loadSize =
|
|
83693
|
-
if (
|
|
83694
|
-
Promise.resolve(
|
|
83700
|
+
const loadSize = materializedViewConfig?.initialLoadSize || 50;
|
|
83701
|
+
if (materializedViewConfig?.onLoadMore) {
|
|
83702
|
+
Promise.resolve(
|
|
83703
|
+
materializedViewConfig.onLoadMore(currentLength, loadSize)
|
|
83704
|
+
).then((newData) => {
|
|
83695
83705
|
setMaterializedData((prev2) => [...prev2, ...newData]);
|
|
83696
83706
|
setHasMoreData(newData.length === loadSize);
|
|
83697
83707
|
}).catch((error2) => {
|
|
@@ -83710,10 +83720,17 @@ function Table({
|
|
|
83710
83720
|
}
|
|
83711
83721
|
}
|
|
83712
83722
|
}, 200),
|
|
83713
|
-
[
|
|
83723
|
+
[
|
|
83724
|
+
isMaterializedView,
|
|
83725
|
+
materializedViewConfig,
|
|
83726
|
+
materializedData,
|
|
83727
|
+
isLoadingMore,
|
|
83728
|
+
hasMoreData,
|
|
83729
|
+
dataSource
|
|
83730
|
+
]
|
|
83714
83731
|
);
|
|
83715
83732
|
const paginationConfig = React__namespace.useMemo(() => {
|
|
83716
|
-
if (
|
|
83733
|
+
if (isMaterializedView) {
|
|
83717
83734
|
return false;
|
|
83718
83735
|
}
|
|
83719
83736
|
return pagination === false ? false : {
|
|
@@ -83728,17 +83745,17 @@ function Table({
|
|
|
83728
83745
|
}
|
|
83729
83746
|
)
|
|
83730
83747
|
};
|
|
83731
|
-
}, [
|
|
83748
|
+
}, [isMaterializedView, pagination]);
|
|
83732
83749
|
const scrollConfig = React__namespace.useMemo(() => {
|
|
83733
|
-
if (
|
|
83750
|
+
if (isMaterializedView) {
|
|
83734
83751
|
return {
|
|
83735
83752
|
...rest.scroll,
|
|
83736
|
-
y:
|
|
83753
|
+
y: materializedViewConfig?.height || 400
|
|
83737
83754
|
};
|
|
83738
83755
|
}
|
|
83739
83756
|
return rest.scroll;
|
|
83740
|
-
}, [
|
|
83741
|
-
const tableDataSource =
|
|
83757
|
+
}, [isMaterializedView, materializedViewConfig, rest.scroll]);
|
|
83758
|
+
const tableDataSource = isMaterializedView ? materializedData : dataSource;
|
|
83742
83759
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
83743
83760
|
Table$1,
|
|
83744
83761
|
{
|
|
@@ -83753,7 +83770,7 @@ function Table({
|
|
|
83753
83770
|
rowSelection,
|
|
83754
83771
|
pagination: paginationConfig,
|
|
83755
83772
|
scroll: scrollConfig,
|
|
83756
|
-
onScroll:
|
|
83773
|
+
onScroll: isMaterializedView ? handleScroll : void 0,
|
|
83757
83774
|
$isMainContentCell: isMainContentCell,
|
|
83758
83775
|
...rest
|
|
83759
83776
|
}
|
|
@@ -83925,7 +83942,7 @@ const PrimaryTableControlsRow = ({
|
|
|
83925
83942
|
const onSortChange = (value2) => {
|
|
83926
83943
|
const sortActionEvent = {
|
|
83927
83944
|
event: "primarySortChange",
|
|
83928
|
-
payload: { value: value2 }
|
|
83945
|
+
payload: { value: Array.isArray(value2) ? value2[0] : value2 }
|
|
83929
83946
|
};
|
|
83930
83947
|
onChange?.(sortActionEvent);
|
|
83931
83948
|
};
|
|
@@ -84127,7 +84144,7 @@ const SecondaryTableControlsRow = ({
|
|
|
84127
84144
|
},
|
|
84128
84145
|
children: [
|
|
84129
84146
|
/* @__PURE__ */ jsxRuntime.jsx(GroupsRow, { groups, onGroupItemClick }),
|
|
84130
|
-
totalRecords > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null
|
|
84147
|
+
(totalRecords ?? 0) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null
|
|
84131
84148
|
]
|
|
84132
84149
|
}
|
|
84133
84150
|
);
|
|
@@ -84173,14 +84190,22 @@ const TableWithControls = ({
|
|
|
84173
84190
|
onChange
|
|
84174
84191
|
}) => {
|
|
84175
84192
|
const { primaryTableRowData, secondaryTableRowData } = tableControlsData2;
|
|
84176
|
-
const {
|
|
84193
|
+
const {
|
|
84194
|
+
dataSource,
|
|
84195
|
+
columns,
|
|
84196
|
+
rowSelection,
|
|
84197
|
+
hasSettings,
|
|
84198
|
+
hasFilter,
|
|
84199
|
+
isMaterializedView,
|
|
84200
|
+
materializedViewConfig
|
|
84201
|
+
} = tableData;
|
|
84177
84202
|
const onTableControlsChange = (event) => {
|
|
84178
84203
|
onChange(event);
|
|
84179
84204
|
};
|
|
84180
84205
|
const onTableChange = (pagination, filters, sorter) => {
|
|
84181
84206
|
onChange({
|
|
84182
84207
|
event: "tableChange",
|
|
84183
|
-
payload: { pagination, filters, sorter }
|
|
84208
|
+
payload: { value: "tableChange", pagination, filters, sorter }
|
|
84184
84209
|
});
|
|
84185
84210
|
};
|
|
84186
84211
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -84193,12 +84218,14 @@ const TableWithControls = ({
|
|
|
84193
84218
|
}
|
|
84194
84219
|
),
|
|
84195
84220
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
84196
|
-
|
|
84221
|
+
Table,
|
|
84197
84222
|
{
|
|
84198
84223
|
dataSource,
|
|
84199
84224
|
columns,
|
|
84200
84225
|
rowSelection,
|
|
84201
|
-
onChange: onTableChange
|
|
84226
|
+
onChange: onTableChange,
|
|
84227
|
+
isMaterializedView,
|
|
84228
|
+
materializedViewConfig
|
|
84202
84229
|
}
|
|
84203
84230
|
)
|
|
84204
84231
|
] });
|
package/dist/index.js
CHANGED
|
@@ -82110,6 +82110,9 @@ const getTextComponent = (firstBarData, secondBarData, stateColor, theme, isText
|
|
|
82110
82110
|
);
|
|
82111
82111
|
};
|
|
82112
82112
|
const getCombinedPercent = (firstBarData, secondBarData) => {
|
|
82113
|
+
if (secondBarData?.value === 0) {
|
|
82114
|
+
return firstBarData?.value;
|
|
82115
|
+
}
|
|
82113
82116
|
if (firstBarData?.value && secondBarData?.value) {
|
|
82114
82117
|
const total = firstBarData?.value + secondBarData?.value;
|
|
82115
82118
|
const dividedBy = total / 2;
|
|
@@ -82384,7 +82387,7 @@ const Radio = ({ id: id2, label, selectedId, onChange, isDisabled }) => {
|
|
|
82384
82387
|
RadioWrapper,
|
|
82385
82388
|
{
|
|
82386
82389
|
ref: radioReference,
|
|
82387
|
-
$isDisabled: isDisabled,
|
|
82390
|
+
$isDisabled: isDisabled ?? false,
|
|
82388
82391
|
onFocus: (e3) => {
|
|
82389
82392
|
if (isDisabled || e3.target !== radioReference.current) return;
|
|
82390
82393
|
setIsFocused(true);
|
|
@@ -82553,7 +82556,7 @@ const RowLabelValue = ({
|
|
|
82553
82556
|
children: label
|
|
82554
82557
|
}
|
|
82555
82558
|
) }),
|
|
82556
|
-
/* @__PURE__ */ jsx("div", { children: isLoading ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(RowSkeleton, { isFullWidth }) }) : getBadgeOrTypography(badgeProps, value2) })
|
|
82559
|
+
/* @__PURE__ */ jsx("div", { children: isLoading ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(RowSkeleton, { isFullWidth: isFullWidth ?? false }) }) : getBadgeOrTypography(badgeProps, value2) })
|
|
82557
82560
|
] });
|
|
82558
82561
|
};
|
|
82559
82562
|
const ActionsContainer = styled.div`
|
|
@@ -82603,13 +82606,13 @@ const Row = ({
|
|
|
82603
82606
|
RowLabelValue,
|
|
82604
82607
|
{
|
|
82605
82608
|
label,
|
|
82606
|
-
value: value2,
|
|
82609
|
+
value: value2 ?? "",
|
|
82607
82610
|
isFullWidth,
|
|
82608
82611
|
isLoading,
|
|
82609
82612
|
badgeProps: badgeProperties
|
|
82610
82613
|
}
|
|
82611
82614
|
),
|
|
82612
|
-
/* @__PURE__ */ jsx(RowActions, { actions })
|
|
82615
|
+
/* @__PURE__ */ jsx(RowActions, { actions: actions ?? null })
|
|
82613
82616
|
]
|
|
82614
82617
|
}
|
|
82615
82618
|
);
|
|
@@ -82664,11 +82667,14 @@ const SegmentedControls = ({
|
|
|
82664
82667
|
value: id2,
|
|
82665
82668
|
icon
|
|
82666
82669
|
}));
|
|
82670
|
+
const handleChange = (value2) => {
|
|
82671
|
+
onChange(String(value2));
|
|
82672
|
+
};
|
|
82667
82673
|
return /* @__PURE__ */ jsx(
|
|
82668
82674
|
SegmentedControls$1,
|
|
82669
82675
|
{
|
|
82670
82676
|
options: antOptions,
|
|
82671
|
-
onChange,
|
|
82677
|
+
onChange: handleChange,
|
|
82672
82678
|
value: selectedTabId,
|
|
82673
82679
|
block: isScaled
|
|
82674
82680
|
}
|
|
@@ -82926,6 +82932,7 @@ const Select = ({
|
|
|
82926
82932
|
}
|
|
82927
82933
|
};
|
|
82928
82934
|
const getSelectModeValue = (value22) => {
|
|
82935
|
+
if (!value22) return "";
|
|
82929
82936
|
if (Array.isArray(value22)) {
|
|
82930
82937
|
if (selectDisplayMode === "count") {
|
|
82931
82938
|
return `${value22.length} selected`;
|
|
@@ -83645,7 +83652,8 @@ function Table({
|
|
|
83645
83652
|
rowSelection,
|
|
83646
83653
|
pagination,
|
|
83647
83654
|
isMainContentCell = false,
|
|
83648
|
-
|
|
83655
|
+
isMaterializedView = false,
|
|
83656
|
+
materializedViewConfig,
|
|
83649
83657
|
...rest
|
|
83650
83658
|
}) {
|
|
83651
83659
|
const [materializedData, setMaterializedData] = React.useState([]);
|
|
@@ -83653,27 +83661,29 @@ function Table({
|
|
|
83653
83661
|
const [hasMoreData, setHasMoreData] = React.useState(true);
|
|
83654
83662
|
const tableRef = React.useRef(null);
|
|
83655
83663
|
React.useEffect(() => {
|
|
83656
|
-
if (
|
|
83657
|
-
const initialSize =
|
|
83664
|
+
if (isMaterializedView) {
|
|
83665
|
+
const initialSize = materializedViewConfig?.initialLoadSize || 50;
|
|
83658
83666
|
const initialData = dataSource.slice(0, initialSize);
|
|
83659
83667
|
setMaterializedData(initialData);
|
|
83660
83668
|
setHasMoreData(dataSource.length > initialSize);
|
|
83661
83669
|
}
|
|
83662
|
-
}, [dataSource,
|
|
83670
|
+
}, [dataSource, isMaterializedView, materializedViewConfig]);
|
|
83663
83671
|
const handleScroll = React.useCallback(
|
|
83664
83672
|
debounce((e3) => {
|
|
83665
|
-
if (!
|
|
83673
|
+
if (!isMaterializedView || !materializedViewConfig?.onLoadMore || isLoadingMore || !hasMoreData) {
|
|
83666
83674
|
return;
|
|
83667
83675
|
}
|
|
83668
83676
|
const { target } = e3;
|
|
83669
83677
|
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
83670
|
-
const threshold =
|
|
83678
|
+
const threshold = materializedViewConfig?.loadMoreThreshold || 100;
|
|
83671
83679
|
if (scrollTop + clientHeight >= scrollHeight - threshold) {
|
|
83672
83680
|
setIsLoadingMore(true);
|
|
83673
83681
|
const currentLength = materializedData.length;
|
|
83674
|
-
const loadSize =
|
|
83675
|
-
if (
|
|
83676
|
-
Promise.resolve(
|
|
83682
|
+
const loadSize = materializedViewConfig?.initialLoadSize || 50;
|
|
83683
|
+
if (materializedViewConfig?.onLoadMore) {
|
|
83684
|
+
Promise.resolve(
|
|
83685
|
+
materializedViewConfig.onLoadMore(currentLength, loadSize)
|
|
83686
|
+
).then((newData) => {
|
|
83677
83687
|
setMaterializedData((prev2) => [...prev2, ...newData]);
|
|
83678
83688
|
setHasMoreData(newData.length === loadSize);
|
|
83679
83689
|
}).catch((error2) => {
|
|
@@ -83692,10 +83702,17 @@ function Table({
|
|
|
83692
83702
|
}
|
|
83693
83703
|
}
|
|
83694
83704
|
}, 200),
|
|
83695
|
-
[
|
|
83705
|
+
[
|
|
83706
|
+
isMaterializedView,
|
|
83707
|
+
materializedViewConfig,
|
|
83708
|
+
materializedData,
|
|
83709
|
+
isLoadingMore,
|
|
83710
|
+
hasMoreData,
|
|
83711
|
+
dataSource
|
|
83712
|
+
]
|
|
83696
83713
|
);
|
|
83697
83714
|
const paginationConfig = React.useMemo(() => {
|
|
83698
|
-
if (
|
|
83715
|
+
if (isMaterializedView) {
|
|
83699
83716
|
return false;
|
|
83700
83717
|
}
|
|
83701
83718
|
return pagination === false ? false : {
|
|
@@ -83710,17 +83727,17 @@ function Table({
|
|
|
83710
83727
|
}
|
|
83711
83728
|
)
|
|
83712
83729
|
};
|
|
83713
|
-
}, [
|
|
83730
|
+
}, [isMaterializedView, pagination]);
|
|
83714
83731
|
const scrollConfig = React.useMemo(() => {
|
|
83715
|
-
if (
|
|
83732
|
+
if (isMaterializedView) {
|
|
83716
83733
|
return {
|
|
83717
83734
|
...rest.scroll,
|
|
83718
|
-
y:
|
|
83735
|
+
y: materializedViewConfig?.height || 400
|
|
83719
83736
|
};
|
|
83720
83737
|
}
|
|
83721
83738
|
return rest.scroll;
|
|
83722
|
-
}, [
|
|
83723
|
-
const tableDataSource =
|
|
83739
|
+
}, [isMaterializedView, materializedViewConfig, rest.scroll]);
|
|
83740
|
+
const tableDataSource = isMaterializedView ? materializedData : dataSource;
|
|
83724
83741
|
return /* @__PURE__ */ jsx(
|
|
83725
83742
|
Table$1,
|
|
83726
83743
|
{
|
|
@@ -83735,7 +83752,7 @@ function Table({
|
|
|
83735
83752
|
rowSelection,
|
|
83736
83753
|
pagination: paginationConfig,
|
|
83737
83754
|
scroll: scrollConfig,
|
|
83738
|
-
onScroll:
|
|
83755
|
+
onScroll: isMaterializedView ? handleScroll : void 0,
|
|
83739
83756
|
$isMainContentCell: isMainContentCell,
|
|
83740
83757
|
...rest
|
|
83741
83758
|
}
|
|
@@ -83907,7 +83924,7 @@ const PrimaryTableControlsRow = ({
|
|
|
83907
83924
|
const onSortChange = (value2) => {
|
|
83908
83925
|
const sortActionEvent = {
|
|
83909
83926
|
event: "primarySortChange",
|
|
83910
|
-
payload: { value: value2 }
|
|
83927
|
+
payload: { value: Array.isArray(value2) ? value2[0] : value2 }
|
|
83911
83928
|
};
|
|
83912
83929
|
onChange?.(sortActionEvent);
|
|
83913
83930
|
};
|
|
@@ -84109,7 +84126,7 @@ const SecondaryTableControlsRow = ({
|
|
|
84109
84126
|
},
|
|
84110
84127
|
children: [
|
|
84111
84128
|
/* @__PURE__ */ jsx(GroupsRow, { groups, onGroupItemClick }),
|
|
84112
|
-
totalRecords > 0 ? /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null
|
|
84129
|
+
(totalRecords ?? 0) > 0 ? /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "#6C6C6C", children: `${totalRecords} results` }) : null
|
|
84113
84130
|
]
|
|
84114
84131
|
}
|
|
84115
84132
|
);
|
|
@@ -84155,14 +84172,22 @@ const TableWithControls = ({
|
|
|
84155
84172
|
onChange
|
|
84156
84173
|
}) => {
|
|
84157
84174
|
const { primaryTableRowData, secondaryTableRowData } = tableControlsData2;
|
|
84158
|
-
const {
|
|
84175
|
+
const {
|
|
84176
|
+
dataSource,
|
|
84177
|
+
columns,
|
|
84178
|
+
rowSelection,
|
|
84179
|
+
hasSettings,
|
|
84180
|
+
hasFilter,
|
|
84181
|
+
isMaterializedView,
|
|
84182
|
+
materializedViewConfig
|
|
84183
|
+
} = tableData;
|
|
84159
84184
|
const onTableControlsChange = (event) => {
|
|
84160
84185
|
onChange(event);
|
|
84161
84186
|
};
|
|
84162
84187
|
const onTableChange = (pagination, filters, sorter) => {
|
|
84163
84188
|
onChange({
|
|
84164
84189
|
event: "tableChange",
|
|
84165
|
-
payload: { pagination, filters, sorter }
|
|
84190
|
+
payload: { value: "tableChange", pagination, filters, sorter }
|
|
84166
84191
|
});
|
|
84167
84192
|
};
|
|
84168
84193
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -84175,12 +84200,14 @@ const TableWithControls = ({
|
|
|
84175
84200
|
}
|
|
84176
84201
|
),
|
|
84177
84202
|
/* @__PURE__ */ jsx(
|
|
84178
|
-
|
|
84203
|
+
Table,
|
|
84179
84204
|
{
|
|
84180
84205
|
dataSource,
|
|
84181
84206
|
columns,
|
|
84182
84207
|
rowSelection,
|
|
84183
|
-
onChange: onTableChange
|
|
84208
|
+
onChange: onTableChange,
|
|
84209
|
+
isMaterializedView,
|
|
84210
|
+
materializedViewConfig
|
|
84184
84211
|
}
|
|
84185
84212
|
)
|
|
84186
84213
|
] });
|