-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added fk search support on fast search field
- Loading branch information
1 parent
dd2d5f7
commit 8937ef9
Showing
10 changed files
with
130 additions
and
16 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
10 changes: 10 additions & 0 deletions
10
library/src/components/List/Content/FastSearchField.styles.tsx
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,10 @@ | ||
import { styled } from '@mui/material'; | ||
import FastSearchField from './FastSearchField'; | ||
|
||
export const StyledFastSearchField = styled(FastSearchField)(() => { | ||
return { | ||
'& .MuiAutocomplete-endAdornment': { | ||
top: 'auto', | ||
}, | ||
}; | ||
}); |
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
30 changes: 30 additions & 0 deletions
30
library/src/components/List/Content/hook/useFirstColumn.ts
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,30 @@ | ||
import { PropertySpec } from '../../../../services'; | ||
import EntityService from '../../../../services/entity/EntityService'; | ||
import { useStoreState } from '../../../../store'; | ||
|
||
type useFirstColumnProps = { | ||
entityService: EntityService; | ||
ignoreColumn: string | undefined; | ||
}; | ||
|
||
const useFirstColumn = (props: useFirstColumnProps): [string, PropertySpec] => { | ||
const { entityService, ignoreColumn } = props; | ||
|
||
const storeState = useStoreState( | ||
(state) => state, | ||
() => { | ||
return true; | ||
} | ||
); | ||
|
||
const columns = entityService.getCollectionColumns(storeState); | ||
const firstColumnKey = Object.keys(columns).find( | ||
(columnKey) => columnKey !== ignoreColumn | ||
) as string; | ||
|
||
const firstColumnSpec = entityService.getProperties()[firstColumnKey]; | ||
|
||
return [firstColumnKey, firstColumnSpec]; | ||
}; | ||
|
||
export default useFirstColumn; |
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