listpage-next 0.0.31 → 0.0.33
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.
|
@@ -5,6 +5,7 @@ import { ReloadOutlined, SearchOutlined } from "@ant-design/icons";
|
|
|
5
5
|
import { FilterGridLayout } from "../FilterGridLayout/index.js";
|
|
6
6
|
import { FilterItem } from "../FilterItem/index.js";
|
|
7
7
|
import { getComponent } from "../../utils/getComponent.js";
|
|
8
|
+
import { cleanUpFormValues } from "../../utils/format.js";
|
|
8
9
|
const FilterForm = ({ options, initialValues, onSubmit, onReset })=>{
|
|
9
10
|
const formRef = useRef(null);
|
|
10
11
|
const items = useMemo(()=>(options ?? []).map(({ colSpan, component, label, ...props })=>{
|
|
@@ -23,7 +24,7 @@ const FilterForm = ({ options, initialValues, onSubmit, onReset })=>{
|
|
|
23
24
|
]);
|
|
24
25
|
const handleSubmit = ()=>{
|
|
25
26
|
const values = formRef.current?.getFieldsValue();
|
|
26
|
-
onSubmit?.(values);
|
|
27
|
+
onSubmit?.(cleanUpFormValues(values));
|
|
27
28
|
};
|
|
28
29
|
const handleReset = ()=>{
|
|
29
30
|
formRef.current?.resetFields();
|
|
@@ -4,7 +4,8 @@ import styled_components from "styled-components";
|
|
|
4
4
|
const GridContainer = styled_components.div`
|
|
5
5
|
display: grid;
|
|
6
6
|
grid-template-columns: repeat(12, 1fr);
|
|
7
|
-
gap:
|
|
7
|
+
row-gap: 0;
|
|
8
|
+
column-gap: 1rem;
|
|
8
9
|
`;
|
|
9
10
|
const GridItem = styled_components.div`
|
|
10
11
|
grid-column: span ${(props)=>props.$colSpan};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cleanUpFormValues: (values: any) => any;
|