@antscorp/antsomi-ui 1.3.5-beta.431 → 1.3.5-beta.433
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/molecules/ModalSelect/Card.js +2 -6
- package/es/components/organism/DataTable/components/Filter/FilterCondition/index.js +1 -1
- package/es/components/organism/DataTable/components/Filter/SaveFilterPopover.js +1 -1
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.d.ts +1 -0
- package/es/components/organism/DataTable/hooks/useDataTableListing/useDataTableListing.js +6 -4
- package/package.json +1 -1
|
@@ -23,11 +23,7 @@ export const CardDefination = (props) => {
|
|
|
23
23
|
const refreshKey = useRef(0);
|
|
24
24
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
25
25
|
const [expandable, setExpandable] = useState(true);
|
|
26
|
-
const { title, description, descriptionEllipsis = {
|
|
27
|
-
rows: 3,
|
|
28
|
-
symbol: 'Learn more',
|
|
29
|
-
tooltip: true,
|
|
30
|
-
}, } = props;
|
|
26
|
+
const { title, description, descriptionEllipsis = {} } = props;
|
|
31
27
|
useEffect(() => {
|
|
32
28
|
if (!expandable) {
|
|
33
29
|
setExpandable(true);
|
|
@@ -39,7 +35,7 @@ export const CardDefination = (props) => {
|
|
|
39
35
|
};
|
|
40
36
|
return (React.createElement(CardDefinationContainer, null,
|
|
41
37
|
title && React.createElement(Text, { className: "title" }, title),
|
|
42
|
-
description && (React.createElement(Paragraph, { key: refreshKey.current, ellipsis: Object.assign(Object.assign({}, descriptionEllipsis), { expandable, onExpand: () => setIsExpanded(true) }), className: "description" },
|
|
38
|
+
description && (React.createElement(Paragraph, { key: refreshKey.current, ellipsis: Object.assign(Object.assign({ rows: 3, tooltip: true, symbol: 'View more' }, descriptionEllipsis), { expandable, onExpand: () => setIsExpanded(true) }), className: "description" },
|
|
43
39
|
description,
|
|
44
40
|
isExpanded && (React.createElement("span", { className: "antsomi-typography-collapse", onClick: handleCollapse }, "View less"))))));
|
|
45
41
|
};
|
|
@@ -83,7 +83,7 @@ export const FilterCondition = props => {
|
|
|
83
83
|
React.createElement(Form.Item, { name: "operator", noStyle: true },
|
|
84
84
|
React.createElement(Select, { value: operator, options: operatorList, onChange: () => form.setFieldsValue({
|
|
85
85
|
value: '',
|
|
86
|
-
}),
|
|
86
|
+
}), dropdownRender: menu => React.createElement("div", { className: EXCEPTION_OFF_FILTER_CLASS }, menu) })),
|
|
87
87
|
React.createElement(Form.Item, { name: "value", noStyle: true }),
|
|
88
88
|
renderValueField({
|
|
89
89
|
filterMetric,
|
|
@@ -29,7 +29,7 @@ export const SaveFilterPopover = memo(props => {
|
|
|
29
29
|
const onFinishSubmit = (values) => {
|
|
30
30
|
onApply(values.name);
|
|
31
31
|
};
|
|
32
|
-
return (React.createElement(Popover, Object.assign({}, restProps, { trigger: ['
|
|
32
|
+
return (React.createElement(Popover, Object.assign({}, restProps, { trigger: ['click'], overlayInnerStyle: { width: 300, padding: 0 }, arrow: false, placement: "bottomRight", content: React.createElement("div", { className: EXCEPTION_OFF_FILTER_CLASS },
|
|
33
33
|
React.createElement(ApplyPopupContent, { cancelButtonProps: {
|
|
34
34
|
disabled: loading,
|
|
35
35
|
}, applyButtonProps: {
|
|
@@ -24,6 +24,7 @@ interface TUseDataTableListing<TTableType = any> {
|
|
|
24
24
|
getFilterMetricList: ReturnType<typeof useGetFilterMetricList>;
|
|
25
25
|
getSearchListing: ReturnType<typeof useGetSearchListing>;
|
|
26
26
|
};
|
|
27
|
+
onChangeSelectedRow: (selectedRowKeys: React.Key[], selectedRows: TTableType[]) => void;
|
|
27
28
|
setDatTableListingState: React.Dispatch<React.SetStateAction<TState<TTableType>>>;
|
|
28
29
|
}
|
|
29
30
|
type TState<TTableType = any> = {
|
|
@@ -471,6 +471,9 @@ export function useDataTableListing(props) {
|
|
|
471
471
|
pageSize,
|
|
472
472
|
});
|
|
473
473
|
}, [handleUpdatePagination]);
|
|
474
|
+
const onChangeSelectedRow = useCallback((selectedRowKeys, selectedRows) => {
|
|
475
|
+
setState(prev => (Object.assign(Object.assign({}, prev), { selectedRowKeys, selectedRow: { keys: selectedRowKeys, rows: selectedRows } })));
|
|
476
|
+
}, []);
|
|
474
477
|
return {
|
|
475
478
|
/* Modify Column */
|
|
476
479
|
modifyColumn: {
|
|
@@ -506,10 +509,8 @@ export function useDataTableListing(props) {
|
|
|
506
509
|
dataSource: tableData,
|
|
507
510
|
columnWidths: table.columnWidths || {},
|
|
508
511
|
rowSelection: {
|
|
509
|
-
selectedRowKeys,
|
|
510
|
-
onChange
|
|
511
|
-
setState(prev => (Object.assign(Object.assign({}, prev), { selectedRowKeys, selectedRow: { keys: selectedRowKeys, rows: selectedRows } })));
|
|
512
|
-
},
|
|
512
|
+
selectedRowKeys: selectedRow.keys || [],
|
|
513
|
+
onChange: onChangeSelectedRow,
|
|
513
514
|
},
|
|
514
515
|
onChange: onChangeTable,
|
|
515
516
|
onColumnResize(data) {
|
|
@@ -549,6 +550,7 @@ export function useDataTableListing(props) {
|
|
|
549
550
|
getSearchListing,
|
|
550
551
|
},
|
|
551
552
|
// Handles
|
|
553
|
+
onChangeSelectedRow,
|
|
552
554
|
setDatTableListingState: setState,
|
|
553
555
|
};
|
|
554
556
|
}
|