mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Add initial filter update
This commit is contained in:
parent
5a196b8fa1
commit
f2a1524c32
|
@ -17,6 +17,7 @@ interface ConstituentaPickerProps {
|
|||
data?: IConstituenta[];
|
||||
rows?: number;
|
||||
|
||||
initialFilter?: string;
|
||||
onBeginFilter?: (cst: IConstituenta) => boolean;
|
||||
describeFunc?: (cst: IConstituenta) => string;
|
||||
matchFunc?: (cst: IConstituenta, filter: string) => boolean;
|
||||
|
@ -30,6 +31,7 @@ const columnHelper = createColumnHelper<IConstituenta>();
|
|||
function ConstituentaPicker({
|
||||
data,
|
||||
value,
|
||||
initialFilter = '',
|
||||
rows = 4,
|
||||
prefixID = prefixes.cst_list,
|
||||
describeFunc = describeConstituenta,
|
||||
|
@ -39,7 +41,7 @@ function ConstituentaPicker({
|
|||
}: ConstituentaPickerProps) {
|
||||
const { colors } = useConceptTheme();
|
||||
const [filteredData, setFilteredData] = useState<IConstituenta[]>([]);
|
||||
const [filterText, setFilterText] = useState('');
|
||||
const [filterText, setFilterText] = useState(initialFilter);
|
||||
|
||||
useEffect(() => {
|
||||
if (!data) {
|
||||
|
|
|
@ -61,6 +61,7 @@ function EntityTab({ initial, items, setIsValid, setReference }: EntityTabProps)
|
|||
return (
|
||||
<FlexColumn>
|
||||
<ConstituentaPicker
|
||||
initialFilter={initial.text}
|
||||
value={selectedCst}
|
||||
data={items}
|
||||
onSelectValue={handleSelectConstituenta}
|
||||
|
|
Loading…
Reference in New Issue
Block a user