diff --git a/rsconcept/frontend/src/components/Common/ConceptSearch.tsx b/rsconcept/frontend/src/components/Common/ConceptSearch.tsx index e6f1a3d7..d7220225 100644 --- a/rsconcept/frontend/src/components/Common/ConceptSearch.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptSearch.tsx @@ -1,23 +1,29 @@ import { MagnifyingGlassIcon } from '../Icons'; +import Overlay from './Overlay'; import TextInput from './TextInput'; interface ConceptSearchProps { value: string onChange?: (newValue: string) => void dense?: boolean + noBorder?: boolean + dimensions?: string } -function ConceptSearch({ value, onChange, dense }: ConceptSearchProps) { - const borderClass = dense ? 'border-t border-x': ''; +function ConceptSearch({ value, onChange, noBorder, dimensions, dense }: ConceptSearchProps) { + const borderClass = dense && !noBorder ? 'border-t border-x': ''; return ( -
Список пуст
-Добавьте словоформу
- - } - onRowClicked={handleRowClicked} - /> -Список пуст
+Добавьте словоформу
+ + } + onRowClicked={onFormSelect} + /> + >); +} + +export default WordFormsTable; \ No newline at end of file diff --git a/rsconcept/frontend/src/dialogs/DlgEditWordForms/index.tsx b/rsconcept/frontend/src/dialogs/DlgEditWordForms/index.tsx new file mode 100644 index 00000000..86ea2195 --- /dev/null +++ b/rsconcept/frontend/src/dialogs/DlgEditWordForms/index.tsx @@ -0,0 +1 @@ +export { default } from './DlgEditWordForms'; \ No newline at end of file diff --git a/rsconcept/frontend/src/models/rslangAPI.ts b/rsconcept/frontend/src/models/rslangAPI.ts index 05b0bc80..9743978e 100644 --- a/rsconcept/frontend/src/models/rslangAPI.ts +++ b/rsconcept/frontend/src/models/rslangAPI.ts @@ -91,11 +91,6 @@ export function substituteTemplateArgs(expression: string, args: IArgumentValue[ .every(local => local.every(match => !(match in mapping))) ).join(', '); - console.log(body); - console.log(head); - console.log(args); - console.log(mapping); - if (!head) { return body; } else { diff --git a/rsconcept/frontend/src/pages/LibraryPage/SearchPanel.tsx b/rsconcept/frontend/src/pages/LibraryPage/SearchPanel.tsx index 3c9f8b52..6e0da75c 100644 --- a/rsconcept/frontend/src/pages/LibraryPage/SearchPanel.tsx +++ b/rsconcept/frontend/src/pages/LibraryPage/SearchPanel.tsx @@ -1,7 +1,7 @@ import { useCallback, useLayoutEffect } from 'react'; import { useLocation } from 'react-router-dom'; -import { MagnifyingGlassIcon } from '../../components/Icons'; +import ConceptSearch from '../../components/Common/ConceptSearch'; import { useAuth } from '../../context/AuthContext'; import { useConceptNavigation } from '../../context/NagivationContext'; import { ILibraryFilter } from '../../models/miscelanious'; @@ -35,8 +35,7 @@ function SearchPanel({ total, filtered, query, setQuery, strategy, setStrategy, const search = useLocation().search; const { user } = useAuth(); - function handleChangeQuery(event: React.ChangeEvent{labelCstMathchMode(matchMode)}: {describeCstMathchMode(matchMode)}
-{labelCstSource(source)}: {describeCstSource(source)}
-Список конституент пуст
-Измените параметры фильтра
- - } - - onRowDoubleClicked={handleDoubleClick} - onRowClicked={handleRowClicked} - /> -{labelCstMathchMode(matchMode)}: {describeCstMathchMode(matchMode)}
+{labelCstSource(source)}: {describeCstSource(source)}
+Список конституент пуст
+Измените параметры фильтра
+ + } + + onRowDoubleClicked={handleDoubleClick} + onRowClicked={handleRowClicked} + />); +} + +export default ConstituentsTable; \ No newline at end of file diff --git a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx new file mode 100644 index 00000000..cf56780d --- /dev/null +++ b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx @@ -0,0 +1,53 @@ +import { useMemo, useState } from 'react'; + +import { useConceptTheme } from '../../../context/ThemeContext'; +import { IConstituenta, IRSForm } from '../../../models/rsform'; +import ConstituentsSearch from './ConstituentsSearch'; +import ConstituentsTable from './ConstituentsTable'; + +// Height that should be left to accomodate navigation panel + bottom margin +const LOCAL_NAVIGATION_H = '2.1rem'; + +// Window width cutoff for expression show +const COLUMN_EXPRESSION_HIDE_THRESHOLD = 1500; + +interface ViewConstituentsProps { + expression: string + baseHeight: string + activeID?: number + schema?: IRSForm + onOpenEdit: (cstID: number) => void +} + +function ViewConstituents({ expression, baseHeight, schema, activeID, onOpenEdit }: ViewConstituentsProps) { + const { noNavigation } = useConceptTheme(); + + const [filteredData, setFilteredData] = useState