@@ -6,6 +6,19 @@ import { Flex, Typography } from '../../../../atomics';
66import { Form , Select , Space , Tooltip } from '../../../../molecules' ;
77import { FilterFooterWrapper } from './styles' ;
88import { RdFilterFooterProps } from './types' ;
9+ import { localize } from '../../../../utils/localize' ;
10+
11+ // export const rdI118next = i18next;
12+ // (rdI118next as any).fromLib = '1byte-react-design';
13+
14+ // export const useRdLocation = useLocation;
15+ // (useRdLocation as any).fromLib = '1byte-react-design';
16+
17+ // export const rdReact = React;
18+ // (rdReact as any).fromLib = '1byte-react-design';
19+
20+ // export const rdYup = Yup;
21+ // (rdYup as any).fromLib = '1byte-react-design';
922
1023export const FilterFooter = < T extends Record < string , string > > ( props : RdFilterFooterProps < T > ) => {
1124 const {
@@ -16,6 +29,7 @@ export const FilterFooter = <T extends Record<string, string>>(props: RdFilterFo
1629 isLoading,
1730 filterValue,
1831 localization,
32+ children,
1933 onChangeFilterValue,
2034 } = props ;
2135
@@ -39,38 +53,46 @@ export const FilterFooter = <T extends Record<string, string>>(props: RdFilterFo
3953 < Flex justify = "space-between" wrap >
4054 { Boolean ( fields ?. length ) && (
4155 < Space >
42- { fields ?. map ( field => (
43- < Form . Item
44- key = { field . name as string }
45- label = { field . label }
46- disableMargin
47- // labelCol={{
48- // flex: 1,
49- // }}
50- // wrapperCol={false}
51- >
52- < Select
53- options = { field . options }
54- value = { filterValue ?. [ field . name ] || null }
55- onChange = { e => {
56- const newFilterValue = { ...filterValue } as T ;
57- newFilterValue [ field . name ] = e ;
56+ { fields ?. map ( field => {
57+ return (
58+ < Form . Item
59+ key = { field . name as string }
60+ label = { field . label }
61+ disableMargin
62+ // labelCol={{
63+ // flex: 1,
64+ // }}
65+ // wrapperCol={false}
66+ >
67+ { field ?. render ? (
68+ field . render ( )
69+ ) : (
70+ < Select
71+ options = { field . options }
72+ value = { filterValue ?. [ field . name ] || null }
73+ onChange = { e => {
74+ const newFilterValue = { ...filterValue } as T ;
75+ newFilterValue [ field . name ] = e ;
5876
59- onChangeFilterValue ?.( newFilterValue ) ;
60- } }
61- popupMatchSelectWidth = { false }
62- />
63- </ Form . Item >
64- ) ) }
77+ onChangeFilterValue ?.( newFilterValue ) ;
78+ } }
79+ popupMatchSelectWidth = { false }
80+ />
81+ ) }
82+ </ Form . Item >
83+ ) ;
84+ } ) }
6585 </ Space >
6686 ) }
6787
88+ { children }
89+
6890 { Boolean ( totalItems || showTotalItemsCount ) && (
6991 < Space size = { 'small' } style = { { marginLeft : 'auto' } } align = "end" >
7092 { isLoading && < LoadingOutlined /> }
7193 < Typography . Text >
72- { i18next . t ( showing , { total : totalItems , count : showTotalItemsCount } ) } { ' ' }
73- < Tooltip title = { i18next . t ( showing_tooltip ) } >
94+ { localize ( showing , { total : totalItems , count : showTotalItemsCount } ) } { ' ' }
95+ < Tooltip title = { localize ( showing_tooltip ) } >
7496 < Typography . Text type = "secondary" >
7597 < InfoCircleFilled />
7698 </ Typography . Text >
0 commit comments