@antscorp/antsomi-ui 1.3.5-beta.424 → 1.3.5-beta.426
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/es/components/organism/DataTable/components/Table/index.js +41 -43
- package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +6 -12
- package/es/components/organism/DataTable/components/Toolbar/styled.d.ts +2 -0
- package/es/components/organism/DataTable/components/Toolbar/styled.js +16 -0
- package/es/components/organism/DataTable/hooks/useDataTableListing/types.d.ts +2 -1
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +4 -2
- package/es/components/organism/DataTable/utils/filter.d.ts +1 -1
- package/es/components/organism/DataTable/utils/filter.js +2 -5
- package/es/queries/DataTable/index.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
// Libraries
|
|
2
13
|
import React, { memo, useCallback, useRef, useState } from 'react';
|
|
14
|
+
import { ConfigProvider } from 'antd';
|
|
3
15
|
import { cloneDeep } from 'lodash';
|
|
4
16
|
import { useShallow } from 'zustand/react/shallow';
|
|
5
17
|
// Components
|
|
@@ -18,7 +30,7 @@ export const Table = memo(() => {
|
|
|
18
30
|
// Store
|
|
19
31
|
const tableProps = useDataTableContext(useShallow(store => store.table));
|
|
20
32
|
const setTable = useDataTableContext(useShallow(store => store.setTable));
|
|
21
|
-
const { rowSelection } =
|
|
33
|
+
const _c = tableProps || {}, { rowSelection } = _c, restOfTable = __rest(_c, ["rowSelection"]);
|
|
22
34
|
// State
|
|
23
35
|
const [state, setState] = useState({
|
|
24
36
|
columns: [],
|
|
@@ -39,16 +51,6 @@ export const Table = memo(() => {
|
|
|
39
51
|
var _a;
|
|
40
52
|
(_a = tableProps.onColumnResize) === null || _a === void 0 ? void 0 : _a.call(tableProps, { index, width: size.width });
|
|
41
53
|
}, [tableProps]);
|
|
42
|
-
const calculateLastColWidth = (col) => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
// If last column is fixed then return full rest of width
|
|
45
|
-
if (col.fixed) {
|
|
46
|
-
return '100%';
|
|
47
|
-
}
|
|
48
|
-
const restOfWidth = ((((_a = tableProps.columns) === null || _a === void 0 ? void 0 : _a.length) || 1) - 1) * DEFAULT_COLUMN_WIDTH;
|
|
49
|
-
const tableWidth = ((_b = tableRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) || restOfWidth;
|
|
50
|
-
return tableWidth > restOfWidth ? tableWidth - restOfWidth : DEFAULT_COLUMN_WIDTH;
|
|
51
|
-
};
|
|
52
54
|
// Effects
|
|
53
55
|
useDeepCompareEffect(() => {
|
|
54
56
|
if (tableProps.columns) {
|
|
@@ -56,41 +58,37 @@ export const Table = memo(() => {
|
|
|
56
58
|
var _a;
|
|
57
59
|
return (Object.assign(Object.assign({}, prev), { columns: (_a = tableProps.columns) === null || _a === void 0 ? void 0 : _a.map((col, index) => {
|
|
58
60
|
var _a;
|
|
59
|
-
return (Object.assign(Object.assign({}, col), {
|
|
60
|
-
// width:
|
|
61
|
-
// index === (tableProps.columns?.length || 1) - 1
|
|
62
|
-
// ? calculateLastColWidth(col)
|
|
63
|
-
// : columnWidths?.[index] ||
|
|
64
|
-
// (col.width ?? (DEFAULT_COLUMN_WIDTHS[index] || DEFAULT_COLUMN_WIDTH)),
|
|
65
|
-
width: (columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths[index]) ||
|
|
61
|
+
return (Object.assign(Object.assign({}, col), { width: (columnWidths === null || columnWidths === void 0 ? void 0 : columnWidths[index]) ||
|
|
66
62
|
((_a = col.width) !== null && _a !== void 0 ? _a : (DEFAULT_COLUMN_WIDTHS[index] || DEFAULT_COLUMN_WIDTH)) }));
|
|
67
63
|
}) }));
|
|
68
64
|
});
|
|
69
65
|
}
|
|
70
66
|
}, [(_a = tableProps.columns) === null || _a === void 0 ? void 0 : _a.map(col => col.width), columnWidths]);
|
|
71
|
-
return (React.createElement(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
67
|
+
return (React.createElement(ConfigProvider, { theme: { token: { motion: false } } },
|
|
68
|
+
React.createElement(StyledTable, Object.assign({}, restOfTable, { virtual: true, ref: ref => {
|
|
69
|
+
tableRef.current = ref === null || ref === void 0 ? void 0 : ref.nativeElement;
|
|
70
|
+
}, scroll: Object.assign(Object.assign({}, scroll), { y: (scroll === null || scroll === void 0 ? void 0 : scroll.y) || '500px', x: (scroll === null || scroll === void 0 ? void 0 : scroll.x) || '100%' }), components: {
|
|
71
|
+
header: Object.assign({ cell: ResizableCell }, (_b = tableProps === null || tableProps === void 0 ? void 0 : tableProps.components) === null || _b === void 0 ? void 0 : _b.header),
|
|
72
|
+
} }, (Array.isArray(tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) &&
|
|
73
|
+
(tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource.length) &&
|
|
74
|
+
!!rowSelection && {
|
|
75
|
+
rowSelection: Object.assign(Object.assign({ fixed: true, columnWidth: DEFAULT_ROW_SELECTION_WIDTH }, rowSelection), { onChange(selectedRowKeys, selectedRows, info) {
|
|
76
|
+
var _a;
|
|
77
|
+
setTable({
|
|
78
|
+
rowSelection: Object.assign(Object.assign({}, rowSelection), { selectedRowKeys }),
|
|
79
|
+
});
|
|
80
|
+
(_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectedRowKeys, selectedRows, info);
|
|
81
|
+
} }),
|
|
82
|
+
}), { columns: columns === null || columns === void 0 ? void 0 : columns.map((col, index) => (Object.assign(Object.assign({}, col), { onHeaderCell: (column) => ({
|
|
83
|
+
tableRef,
|
|
84
|
+
disableResize: index === ((columns === null || columns === void 0 ? void 0 : columns.length) || 1) - 1,
|
|
85
|
+
fixed: column.fixed,
|
|
86
|
+
width: column.width,
|
|
87
|
+
index,
|
|
88
|
+
onResize: onResize(index),
|
|
89
|
+
onResizeStop: onResizeStop(index),
|
|
90
|
+
}) }))), bordered: true, showSorterTooltip: false, sortDirections: ['descend', 'ascend'], pagination: false, loading: {
|
|
91
|
+
indicator: React.createElement(Spin, null),
|
|
92
|
+
spinning: !!tableProps.loading,
|
|
93
|
+
}, tableLayout: "fixed" }))));
|
|
96
94
|
});
|
|
@@ -13,8 +13,7 @@ import { Link } from 'react-router-dom';
|
|
|
13
13
|
import React, { useState } from 'react';
|
|
14
14
|
import styled from 'styled-components';
|
|
15
15
|
// Components
|
|
16
|
-
import { Input, Popover, Divider, Typography, Scrollbars, Icon, Spin,
|
|
17
|
-
import { Menu } from '@antscorp/antsomi-ui/es/components/organism';
|
|
16
|
+
import { Input, Popover, Divider, Typography, Scrollbars, Icon, Spin, } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
18
17
|
import { EmptyData } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
19
18
|
// Constants
|
|
20
19
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
@@ -24,7 +23,7 @@ import { useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
|
24
23
|
import { searchStringQuery } from '@antscorp/antsomi-ui/es/utils';
|
|
25
24
|
import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
26
25
|
// Styles
|
|
27
|
-
import { FilterSection, IconWrapper } from './styled';
|
|
26
|
+
import { FilterSection, IconWrapper, StyledSearchItem } from './styled';
|
|
28
27
|
import { FilterButton } from '../../styled';
|
|
29
28
|
// Translations
|
|
30
29
|
import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
@@ -71,17 +70,13 @@ export const SearchPopover = props => {
|
|
|
71
70
|
}
|
|
72
71
|
return draftSearchList.map((searchItem, index) => {
|
|
73
72
|
const { id, label, link, icon } = searchItem;
|
|
74
|
-
const Label = (React.createElement(
|
|
73
|
+
const Label = (React.createElement(React.Fragment, null,
|
|
75
74
|
icon && React.createElement(IconWrapper, null, icon),
|
|
76
75
|
React.createElement(Typography.Text, { className: `${link ? 'text-link' : ''}`, ellipsis: { tooltip: true } }, link && !itemSearchRender && !onClickSearchItem && !isAddFilterFromSearchItem ? (React.createElement(Link, { to: link }, label)) : (label))));
|
|
77
|
-
return {
|
|
78
|
-
key: id,
|
|
79
|
-
label: itemSearchRender ? itemSearchRender(searchItem, index, Label) : Label,
|
|
80
|
-
onClick: () => {
|
|
76
|
+
return (React.createElement(StyledSearchItem, { key: id, align: "center", gap: 6, onClick: () => {
|
|
81
77
|
onClick(searchItem);
|
|
82
78
|
setState(prev => (Object.assign(Object.assign({}, prev), { isOpenPopover: false })));
|
|
83
|
-
},
|
|
84
|
-
};
|
|
79
|
+
} }, itemSearchRender ? itemSearchRender(searchItem, index, Label) : Label));
|
|
85
80
|
});
|
|
86
81
|
}, [isClientSearch, itemSearchRender, searchList, searchValue]);
|
|
87
82
|
// Handlers
|
|
@@ -111,8 +106,7 @@ export const SearchPopover = props => {
|
|
|
111
106
|
return React.createElement(EmptyData, { showIcon: false, title: t(translations.noData).toString() });
|
|
112
107
|
return (React.createElement(React.Fragment, null,
|
|
113
108
|
React.createElement(Text, { className: "or-go-to" }, t(translations.dataTableFilter.orGoTo).toString()),
|
|
114
|
-
React.createElement(Scrollbars, { autoHeight: true, autoHeightMax: 200 },
|
|
115
|
-
React.createElement(Menu, { mode: "vertical", items: filteredSearchList }))));
|
|
109
|
+
React.createElement(Scrollbars, { autoHeight: true, autoHeightMax: 200 }, filteredSearchList)));
|
|
116
110
|
};
|
|
117
111
|
const content = (React.createElement(StyledContent, null,
|
|
118
112
|
React.createElement(Input.CustomSearch, { value: searchValue, placeholder: t(translations.global.search).toString(), onAfterChange: searchValue => {
|
|
@@ -9,3 +9,5 @@ export declare const ToolbarActionButtonWrapper: import("styled-components").Sty
|
|
|
9
9
|
export declare const FilterSection: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
10
10
|
export declare const RowSelectedControlWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
11
11
|
export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
/** Search Popover */
|
|
13
|
+
export declare const StyledSearchItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -65,3 +65,19 @@ export const RowSelectedControlWrapper = styled(Flex) `
|
|
|
65
65
|
export const IconWrapper = styled.div `
|
|
66
66
|
flex-shrink: 0;
|
|
67
67
|
`;
|
|
68
|
+
/** Search Popover */
|
|
69
|
+
export const StyledSearchItem = styled(Flex) `
|
|
70
|
+
height: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.controlHeight}px;
|
|
71
|
+
padding-inline: 10px;
|
|
72
|
+
margin-block: 6px;
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:active {
|
|
81
|
+
background-color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.blue1_1};
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
@@ -41,7 +41,7 @@ export interface UseDataTableListingProps<TTableType = any, TSearchType = any> {
|
|
|
41
41
|
[K in keyof TTableType | 'toggle']?: TTableColumnType<TTableType, K>;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
search?: Pick<TSearchActionButton, 'addFilterInfo' | 'isClientSearch' | 'isAddFilterFromSearchItem' | 'onClickSearchItem'
|
|
44
|
+
search?: Partial<Pick<TSearchActionButton, 'addFilterInfo' | 'isClientSearch' | 'isAddFilterFromSearchItem' | 'onClickSearchItem'>> & {
|
|
45
45
|
link?: ((record: TSearchType) => string) | string;
|
|
46
46
|
icon?: (record: TSearchType) => ReactNode | ReactNode;
|
|
47
47
|
itemMapKeys: Record<keyof Omit<TSearchItem, 'icon' | 'link'>, keyof TSearchType>;
|
|
@@ -49,6 +49,7 @@ export interface UseDataTableListingProps<TTableType = any, TSearchType = any> {
|
|
|
49
49
|
};
|
|
50
50
|
filter?: {
|
|
51
51
|
externalFilters?: FilterItem[];
|
|
52
|
+
includeDataType?: boolean;
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
export interface DataTableLocalStorage<TTableType = any> {
|
|
@@ -74,7 +74,7 @@ export function useDataTableListing(props) {
|
|
|
74
74
|
const _e = apiListing || {}, { url: listingUrl = '', enabled: enabledApiListing = true } = _e, restOfApiListingRequest = __rest(_e, ["url", "enabled"]);
|
|
75
75
|
const _f = apiSearch || {}, { url: searchUrl = '', enabled: enabledApiSearch = true } = _f, restOfApiSearchRequest = __rest(_f, ["url", "enabled"]);
|
|
76
76
|
const { filters, selectedFilterId, pagination, selectedRowKeys, searchValue, table, sorter, selectedRow, } = state;
|
|
77
|
-
const { externalFilters } = filterProps || {};
|
|
77
|
+
const { externalFilters, includeDataType = false } = filterProps || {};
|
|
78
78
|
const modifyColumnAuth = Object.assign(Object.assign({}, auth), { url: columnUrl });
|
|
79
79
|
const filterAuth = Object.assign(Object.assign({}, auth), { url: filterUrl });
|
|
80
80
|
const listingAuth = Object.assign(Object.assign({}, auth), { url: listingUrl });
|
|
@@ -137,7 +137,7 @@ export function useDataTableListing(props) {
|
|
|
137
137
|
const getTableListing = useGetTableListing({
|
|
138
138
|
args: {
|
|
139
139
|
auth: listingAuth,
|
|
140
|
-
params: Object.assign({ limit: pagination.pageSize, page: pagination.page, filter: JSON.stringify(mapFiltersToApiFilters([...(filters || []), ...(externalFilters || [])])), columns: JSON.stringify(((_b = (_a = modifyColumnsData === null || modifyColumnsData === void 0 ? void 0 : modifyColumnsData.find(modifyColumnItem => modifyColumnItem.modifyColId === modifyColumnSelected)) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.map(col => { var _a; return (_a = col.metricCode) === null || _a === void 0 ? void 0 : _a.toUpperCase(); })) || []) }, ((sorter === null || sorter === void 0 ? void 0 : sorter.order) &&
|
|
140
|
+
params: Object.assign({ limit: pagination.pageSize, page: pagination.page, filter: JSON.stringify(mapFiltersToApiFilters([...(filters || []), ...(externalFilters || [])], includeDataType)), columns: JSON.stringify(((_b = (_a = modifyColumnsData === null || modifyColumnsData === void 0 ? void 0 : modifyColumnsData.find(modifyColumnItem => modifyColumnItem.modifyColId === modifyColumnSelected)) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.map(col => { var _a; return (_a = col.metricCode) === null || _a === void 0 ? void 0 : _a.toUpperCase(); })) || []) }, ((sorter === null || sorter === void 0 ? void 0 : sorter.order) &&
|
|
141
141
|
(sorter === null || sorter === void 0 ? void 0 : sorter.columnKey) && {
|
|
142
142
|
sort: sorter.columnKey.toString(),
|
|
143
143
|
az: SORT_MAP[sorter.order],
|
|
@@ -145,6 +145,7 @@ export function useDataTableListing(props) {
|
|
|
145
145
|
request: restOfApiListingRequest,
|
|
146
146
|
},
|
|
147
147
|
options: {
|
|
148
|
+
keepPreviousData: true,
|
|
148
149
|
enabled: !!(listingAuth === null || listingAuth === void 0 ? void 0 : listingAuth.url) && !!(listingAuth === null || listingAuth === void 0 ? void 0 : listingAuth.token) && enabledApiListing,
|
|
149
150
|
},
|
|
150
151
|
});
|
|
@@ -157,6 +158,7 @@ export function useDataTableListing(props) {
|
|
|
157
158
|
request: restOfApiSearchRequest,
|
|
158
159
|
},
|
|
159
160
|
options: {
|
|
161
|
+
keepPreviousData: true,
|
|
160
162
|
enabled: !!(searchAuth === null || searchAuth === void 0 ? void 0 : searchAuth.url) && !!(searchAuth === null || searchAuth === void 0 ? void 0 : searchAuth.token) && enabledApiSearch,
|
|
161
163
|
},
|
|
162
164
|
});
|
|
@@ -89,5 +89,5 @@ export declare const renderValueField: ({ filterMetric, operator, value, onChang
|
|
|
89
89
|
export declare const getFilterMetricByName: ({ filterMetrics, name, }: TGetFilterMetricByName) => FilterMetricItem | undefined;
|
|
90
90
|
export declare const mapFiltersToRules: (filters: FilterItem[]) => SavedFilter['rules'];
|
|
91
91
|
export declare const mapRulesToFilters: (rules: SavedFilter['rules']) => FilterItem[];
|
|
92
|
-
export declare const mapFiltersToApiFilters: (filters: FilterItem[]) => TApiFilter;
|
|
92
|
+
export declare const mapFiltersToApiFilters: (filters: FilterItem[], includeDataType?: boolean) => TApiFilter;
|
|
93
93
|
export {};
|
|
@@ -172,9 +172,6 @@ export const mapRulesToFilters = (rules) => rules.map(({ dataType, metricCode, o
|
|
|
172
172
|
operator: operatorValue,
|
|
173
173
|
value: filterValue,
|
|
174
174
|
}));
|
|
175
|
-
export const mapFiltersToApiFilters = (filters) => filters.map(({ column, operator, value, dataType }) => ({
|
|
176
|
-
[column]: {
|
|
177
|
-
[operator]: value,
|
|
178
|
-
dataType: METRIC_MAP_STRING_TYPE[dataType || 'string'],
|
|
179
|
-
},
|
|
175
|
+
export const mapFiltersToApiFilters = (filters, includeDataType = false) => filters.map(({ column, operator, value, dataType }) => ({
|
|
176
|
+
[column]: Object.assign({ [operator]: value }, (includeDataType && { dataType: METRIC_MAP_STRING_TYPE[dataType || 'string'] })),
|
|
180
177
|
}));
|
|
@@ -8,11 +8,11 @@ const { GET_COLUMN_METRICS, GET_MODIFY_COLUMN_LIST, GET_SAVED_FILTER_LIST, GET_F
|
|
|
8
8
|
/* Column */
|
|
9
9
|
export const useGetColumnMetrics = (params) => {
|
|
10
10
|
const { args, options } = params;
|
|
11
|
-
return useQuery(Object.assign({ queryKey: [GET_COLUMN_METRICS, args], queryFn: () => dataTableServices.column.getColumnMetrics(args) }, options));
|
|
11
|
+
return useQuery(Object.assign({ queryKey: [GET_COLUMN_METRICS, args], queryFn: ({ signal }) => dataTableServices.column.getColumnMetrics(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
12
12
|
};
|
|
13
13
|
export const useGetModifyColumnList = (params) => {
|
|
14
14
|
const { args, options } = params;
|
|
15
|
-
return useQuery(Object.assign({ queryKey: [GET_MODIFY_COLUMN_LIST, args], queryFn: () => dataTableServices.column.getModifyColumnList(args) }, options));
|
|
15
|
+
return useQuery(Object.assign({ queryKey: [GET_MODIFY_COLUMN_LIST, args], queryFn: ({ signal }) => dataTableServices.column.getModifyColumnList(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
16
16
|
};
|
|
17
17
|
export const useUpdateModifyColumn = (params) => {
|
|
18
18
|
const { options, auth } = params || {};
|
|
@@ -44,11 +44,11 @@ export const useDeleteModifyColumn = (params) => {
|
|
|
44
44
|
/* Filter */
|
|
45
45
|
export const useGetSavedFilterList = (params) => {
|
|
46
46
|
const { args, options } = params;
|
|
47
|
-
return useQuery(Object.assign({ queryKey: [GET_SAVED_FILTER_LIST, args], queryFn: () => dataTableServices.filter.getSavedFilterList(args) }, options));
|
|
47
|
+
return useQuery(Object.assign({ queryKey: [GET_SAVED_FILTER_LIST, args], queryFn: ({ signal }) => dataTableServices.filter.getSavedFilterList(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
48
48
|
};
|
|
49
49
|
export const useGetFilterMetricList = (params) => {
|
|
50
50
|
const { args, options } = params;
|
|
51
|
-
return useQuery(Object.assign({ queryKey: [GET_FILTER_METRIC_LIST, args], queryFn: () => dataTableServices.filter.getFilterMetricList(args) }, options));
|
|
51
|
+
return useQuery(Object.assign({ queryKey: [GET_FILTER_METRIC_LIST, args], queryFn: ({ signal }) => dataTableServices.filter.getFilterMetricList(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
52
52
|
};
|
|
53
53
|
export const useSaveFilter = (params) => {
|
|
54
54
|
const { options, auth } = params || {};
|
|
@@ -80,9 +80,9 @@ export const useDeleteSavedFilter = (params) => {
|
|
|
80
80
|
/* Table Listing */
|
|
81
81
|
export const useGetTableListing = (params) => {
|
|
82
82
|
const { options, args } = params || {};
|
|
83
|
-
return useQuery(Object.assign({ queryKey: [GET_DATA_TABLE_LISTING, args], queryFn: () => dataTableServices.listing.getTableListing(args) }, options));
|
|
83
|
+
return useQuery(Object.assign({ queryKey: [GET_DATA_TABLE_LISTING, args], queryFn: ({ signal }) => dataTableServices.listing.getTableListing(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
84
84
|
};
|
|
85
85
|
export const useGetSearchListing = (params) => {
|
|
86
86
|
const { args, options } = params || {};
|
|
87
|
-
return useQuery(Object.assign({ queryKey: [GET_SEARCH_LIST, args], queryFn: () => dataTableServices.search.getSearchListing(args) }, options));
|
|
87
|
+
return useQuery(Object.assign({ queryKey: [GET_SEARCH_LIST, args], queryFn: ({ signal }) => dataTableServices.search.getSearchListing(Object.assign(Object.assign({}, args), { request: Object.assign(Object.assign({}, args.request), { signal }) })) }, options));
|
|
88
88
|
};
|