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[];
|
data?: IConstituenta[];
|
||||||
rows?: number;
|
rows?: number;
|
||||||
|
|
||||||
|
initialFilter?: string;
|
||||||
onBeginFilter?: (cst: IConstituenta) => boolean;
|
onBeginFilter?: (cst: IConstituenta) => boolean;
|
||||||
describeFunc?: (cst: IConstituenta) => string;
|
describeFunc?: (cst: IConstituenta) => string;
|
||||||
matchFunc?: (cst: IConstituenta, filter: string) => boolean;
|
matchFunc?: (cst: IConstituenta, filter: string) => boolean;
|
||||||
|
@ -30,6 +31,7 @@ const columnHelper = createColumnHelper<IConstituenta>();
|
||||||
function ConstituentaPicker({
|
function ConstituentaPicker({
|
||||||
data,
|
data,
|
||||||
value,
|
value,
|
||||||
|
initialFilter = '',
|
||||||
rows = 4,
|
rows = 4,
|
||||||
prefixID = prefixes.cst_list,
|
prefixID = prefixes.cst_list,
|
||||||
describeFunc = describeConstituenta,
|
describeFunc = describeConstituenta,
|
||||||
|
@ -39,7 +41,7 @@ function ConstituentaPicker({
|
||||||
}: ConstituentaPickerProps) {
|
}: ConstituentaPickerProps) {
|
||||||
const { colors } = useConceptTheme();
|
const { colors } = useConceptTheme();
|
||||||
const [filteredData, setFilteredData] = useState<IConstituenta[]>([]);
|
const [filteredData, setFilteredData] = useState<IConstituenta[]>([]);
|
||||||
const [filterText, setFilterText] = useState('');
|
const [filterText, setFilterText] = useState(initialFilter);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ function EntityTab({ initial, items, setIsValid, setReference }: EntityTabProps)
|
||||||
return (
|
return (
|
||||||
<FlexColumn>
|
<FlexColumn>
|
||||||
<ConstituentaPicker
|
<ConstituentaPicker
|
||||||
|
initialFilter={initial.text}
|
||||||
value={selectedCst}
|
value={selectedCst}
|
||||||
data={items}
|
data={items}
|
||||||
onSelectValue={handleSelectConstituenta}
|
onSelectValue={handleSelectConstituenta}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user