-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '354-generic-resource-list' of github.com:beda-software/…
…fhir-emr into update-app-layout
- Loading branch information
Showing
12 changed files
with
145 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,45 @@ | ||
import { ColumnFilterValue } from 'src/components/SearchBar/types'; | ||
import { ColumnFilterValue, isSingleDateColumn, isStringColumn } from 'src/components/SearchBar/types'; | ||
import { SearchBarColumn } from 'src/components/SearchBar/SearchBarColumn'; | ||
import { S } from './styles'; | ||
import { FilterDropdownProps } from 'antd/lib/table/interface'; | ||
import _ from 'lodash'; | ||
|
||
interface Props extends FilterDropdownProps { | ||
interface Props { | ||
filter: ColumnFilterValue; | ||
onChange: (value: ColumnFilterValue['value'], key: string) => void; | ||
} | ||
|
||
export function TableFilter(props: Props) { | ||
const { filter, onChange, close } = props; | ||
interface TableFilterProps extends FilterDropdownProps, Props {} | ||
|
||
export function TableFilter(props: TableFilterProps) { | ||
const { filter, onChange: onInitialChange, close, visible } = props; | ||
|
||
const onChange = (value: ColumnFilterValue['value'], key: string) => { | ||
if (isStringColumn(filter.column)) { | ||
onInitialChange(value, key); | ||
|
||
return; | ||
} | ||
|
||
onInitialChange(value, key); | ||
close(); | ||
}; | ||
|
||
if (isSingleDateColumn(filter.column)) { | ||
return ( | ||
<S.Container> | ||
<S.DatePickerFilter> | ||
<SearchBarColumn columnFilterValue={filter} onChange={onChange} defaultOpen={visible} /> | ||
</S.DatePickerFilter> | ||
</S.Container> | ||
); | ||
} | ||
|
||
return ( | ||
<S.Filter> | ||
<SearchBarColumn | ||
columnFilterValue={filter} | ||
onChange={(value, key) => { | ||
onChange(value, key); | ||
close(); | ||
}} | ||
/> | ||
</S.Filter> | ||
<S.Container> | ||
<S.Filter> | ||
<SearchBarColumn columnFilterValue={filter} onChange={onChange} defaultOpen={visible} /> | ||
</S.Filter> | ||
</S.Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.ant-dropdown .ant-table-filter-dropdown { | ||
border: 0; | ||
background: none; | ||
box-shadow: none; | ||
position: relative; | ||
overflow: visible; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters