@antscorp/antsomi-ui 1.3.5-beta.511 → 1.3.5-beta.513
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.
|
@@ -30,7 +30,7 @@ import { Typography, Switch, Flex } from '@antscorp/antsomi-ui/es/components/ato
|
|
|
30
30
|
// Constants
|
|
31
31
|
import { COLUMN_DOMAIN, OPERATORS_CODE, QUERY_KEYS, globalToken, } from '@antscorp/antsomi-ui/es/constants';
|
|
32
32
|
import { MODIFY_COLUMN_DISABLE_EDITABLE, MODIFY_COLUMN_DISABLE_REMOVE, SAVED_FILTER_DEFAULT, TABLE_LISTING_PREFIX, } from './constants';
|
|
33
|
-
import { DEFAULT_CELL_EMPTY, DEFAULT_TOGGLE_WIDTH, SORT_MAP } from '../../constants';
|
|
33
|
+
import { DEFAULT_CELL_EMPTY, DEFAULT_PAGE_SIZE, DEFAULT_TOGGLE_WIDTH, SORT_MAP, } from '../../constants';
|
|
34
34
|
// Hooks
|
|
35
35
|
import { useDeepCompareEffect, useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
|
|
36
36
|
import { useCreateModifyColumn, useDeleteModifyColumn, useDeleteSavedFilter, useGetColumnMetrics, useGetFilterMetricList, useGetInfiniteMatchesAnyList, useGetModifyColumnList, useGetSavedFilterList, useGetSearchListing, useGetTableListing, useSaveFilter, useUpdateFilter, useUpdateModifyColumn, } from '@antscorp/antsomi-ui/es/queries';
|
|
@@ -45,7 +45,7 @@ const initialState = {
|
|
|
45
45
|
selectedFilterId: SAVED_FILTER_DEFAULT[0].id,
|
|
46
46
|
pagination: {
|
|
47
47
|
page: 1,
|
|
48
|
-
pageSize:
|
|
48
|
+
pageSize: DEFAULT_PAGE_SIZE,
|
|
49
49
|
total: 0,
|
|
50
50
|
},
|
|
51
51
|
table: {
|
|
@@ -387,7 +387,6 @@ export function useDataTableListing(props) {
|
|
|
387
387
|
});
|
|
388
388
|
}, [mapObject, updateModifyColumn]);
|
|
389
389
|
const onApplyModifyColumn = useCallback((args) => __awaiter(this, void 0, void 0, function* () {
|
|
390
|
-
var _h;
|
|
391
390
|
const { selectedMetrics, columnSetName, existColumnSet } = args || {};
|
|
392
391
|
const flattenMetrics = flatTree(columnMetricsData, 'child');
|
|
393
392
|
const selectedColumnMetrics = selectedMetrics
|
|
@@ -396,12 +395,14 @@ export function useDataTableListing(props) {
|
|
|
396
395
|
let exitModifyColumnId = '';
|
|
397
396
|
// Update exits column set
|
|
398
397
|
// columnSetName is empty that mean save for Custom column set
|
|
399
|
-
if (existColumnSet || columnSetName === '') {
|
|
398
|
+
if (existColumnSet /* || columnSetName === '' */) {
|
|
400
399
|
exitModifyColumnId = (existColumnSet === null || existColumnSet === void 0 ? void 0 : existColumnSet.id) || '';
|
|
401
|
-
if (columnSetName === '') {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
400
|
+
// if (columnSetName === '') {
|
|
401
|
+
// exitModifyColumnId =
|
|
402
|
+
// modifyColumnsData?.find(
|
|
403
|
+
// modifyColumn => modifyColumn.modifyName === 'Custom', // NOTES: Hard Custom name, will move constants
|
|
404
|
+
// )?.modifyColId || '';
|
|
405
|
+
// }
|
|
405
406
|
}
|
|
406
407
|
/**
|
|
407
408
|
* Check if exitModifyColumnId is not empty
|
|
@@ -423,7 +424,7 @@ export function useDataTableListing(props) {
|
|
|
423
424
|
return {
|
|
424
425
|
success: !!status,
|
|
425
426
|
};
|
|
426
|
-
}), [columnMetricsData, createModifyColumn, mapObject,
|
|
427
|
+
}), [columnMetricsData, createModifyColumn, mapObject, updateModifyColumn]);
|
|
427
428
|
const handleUpdatePagination = useCallback((pagination) => {
|
|
428
429
|
const localStorageValues = parseJSONFromLocalStorage(localStorageKey) || {};
|
|
429
430
|
// Set State
|
|
@@ -218,12 +218,14 @@ export const ModifyColumnModal = props => {
|
|
|
218
218
|
},
|
|
219
219
|
body: {
|
|
220
220
|
padding: 0,
|
|
221
|
-
height:
|
|
221
|
+
height: '100%',
|
|
222
222
|
},
|
|
223
223
|
footer: {
|
|
224
224
|
marginTop: 0,
|
|
225
225
|
},
|
|
226
|
-
}, centered: true, width:
|
|
226
|
+
}, centered: true, width: "65vw", style: {
|
|
227
|
+
height: '70%',
|
|
228
|
+
}, footer: React.createElement(Flex, { align: "center", justify: "space-between" },
|
|
227
229
|
React.createElement(Flex, null,
|
|
228
230
|
React.createElement(Checkbox, { checked: !!editedColumnSet || state.checkedColumnSet, disabled: !!editedColumnSet, onChange: () => setState(prev => (Object.assign(Object.assign({}, prev), { checkedColumnSet: !prev.checkedColumnSet }))) }, checkedColumnSet || !!editedColumnSet ? (React.createElement(Input, { disabled: !!editedColumnSet, value: editedColumnSet ? editedColumnSet.name : columnSetName, maxLength: 255, showCount: true, onChange: e => setState(prev => (Object.assign(Object.assign({}, prev), { columnSetName: e.target.value }))) })) : (t(translations.modifyColumn.saveColumnSet).toString()))),
|
|
229
231
|
React.createElement(Flex, { align: "center", gap: 10 },
|
|
@@ -8,6 +8,10 @@ import { Scrollbars } from '../../atoms/Scrollbars';
|
|
|
8
8
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
9
9
|
export const StyledModal = styled(ModalV2) `
|
|
10
10
|
.antsomi-modal-content {
|
|
11
|
+
height: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
|
|
11
15
|
.antsomi-modal-close {
|
|
12
16
|
right: 15px !important;
|
|
13
17
|
top: 14px !important;
|