From 3e574662cbeff55804052f96bdd9cf19d1b23104 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 7 Apr 2022 19:19:08 +0800 Subject: [PATCH] fix(client): styling of the filter component --- .../schema-component/antd/filter/Filter.tsx | 3 ++- .../antd/filter/FilterGroup.tsx | 24 ++++++++++++------- .../antd/filter/FilterItem.tsx | 6 +++-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/packages/client/src/schema-component/antd/filter/Filter.tsx b/packages/client/src/schema-component/antd/filter/Filter.tsx index 3aeed8ab8..17f629e90 100644 --- a/packages/client/src/schema-component/antd/filter/Filter.tsx +++ b/packages/client/src/schema-component/antd/filter/Filter.tsx @@ -29,7 +29,8 @@ export const Filter: any = observer((props: any) => { - + + {/*
{JSON.stringify(field.value, null, 2)}
*/}
); diff --git a/packages/client/src/schema-component/antd/filter/FilterGroup.tsx b/packages/client/src/schema-component/antd/filter/FilterGroup.tsx index bc053bf9f..f70581777 100644 --- a/packages/client/src/schema-component/antd/filter/FilterGroup.tsx +++ b/packages/client/src/schema-component/antd/filter/FilterGroup.tsx @@ -8,6 +8,7 @@ import { FilterLogicContext, RemoveConditionContext } from './context'; import { FilterItems } from './FilterItems'; export const FilterGroup = connect((props) => { + const { bordered = true } = props; const field = useField(); const remove = useContext(RemoveConditionContext); const { t } = useTranslation(); @@ -19,25 +20,30 @@ export const FilterGroup = connect((props) => { [value]: [...(obj[logic] || [])], }; }; - console.log('logic', logic); return (
{remove && ( - remove()} - /> + + remove()} + /> + )}
diff --git a/packages/client/src/schema-component/antd/filter/FilterItem.tsx b/packages/client/src/schema-component/antd/filter/FilterItem.tsx index e445f9f49..7ff918642 100644 --- a/packages/client/src/schema-component/antd/filter/FilterItem.tsx +++ b/packages/client/src/schema-component/antd/filter/FilterItem.tsx @@ -43,12 +43,14 @@ export const FilterItem = observer((props: any) => { {!operator?.noValue && React.createElement(DynamicComponent, { value, - schema, + schema: {}, onChange(value) { setValue(value); }, })} - remove()} /> + + remove()} /> +
);