diff --git a/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx b/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx new file mode 100644 index 00000000..b0354f82 --- /dev/null +++ b/rsconcept/frontend/src/components/Common/ConceptTooltip.tsx @@ -0,0 +1,23 @@ +import { ITooltip, Tooltip } from 'react-tooltip'; + +import { useConceptTheme } from '../../context/ThemeContext'; + +interface ConceptTooltipProps +extends Omit { + +} + +function ConceptTooltip({ className, ...props }: ConceptTooltipProps) { + const { darkMode } = useConceptTheme(); + + return ( + + ); +} + +export default ConceptTooltip; diff --git a/rsconcept/frontend/src/components/Icons.tsx b/rsconcept/frontend/src/components/Icons.tsx index 6bc47a94..836bd78e 100644 --- a/rsconcept/frontend/src/components/Icons.tsx +++ b/rsconcept/frontend/src/components/Icons.tsx @@ -283,3 +283,12 @@ export function SaveIcon(props: IconProps) { ); } + +export function HelpIcon(props: IconProps) { + return ( + + + + + ); +} diff --git a/rsconcept/frontend/src/index.css b/rsconcept/frontend/src/index.css index 86331b9e..26365095 100644 --- a/rsconcept/frontend/src/index.css +++ b/rsconcept/frontend/src/index.css @@ -19,6 +19,10 @@ } @layer components { + h1 { + @apply text-lg font-bold text-center + } + .border { @apply clr-border rounded } diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorItems.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorItems.tsx index 88c568a5..75efefad 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorItems.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorItems.tsx @@ -3,8 +3,9 @@ import { toast } from 'react-toastify'; import Button from '../../components/Common/Button'; import ConceptDataTable from '../../components/Common/ConceptDataTable'; +import ConceptTooltip from '../../components/Common/ConceptTooltip'; import Divider from '../../components/Common/Divider'; -import { ArrowDownIcon, ArrowsRotateIcon, ArrowUpIcon, DumpBinIcon, SmallPlusIcon } from '../../components/Icons'; +import { ArrowDownIcon, ArrowsRotateIcon, ArrowUpIcon, DumpBinIcon, HelpIcon, SmallPlusIcon } from '../../components/Icons'; import { useRSForm } from '../../context/RSFormContext'; import { useConceptTheme } from '../../context/ThemeContext'; import { CstType, type IConstituenta, ICstMovetoData, inferStatus, ParsingStatus, ValueClass } from '../../utils/models' @@ -288,7 +289,7 @@ function EditorItems({ onOpenEdit, onShowCreateCst }: EditorItemsProps) { {selected.length} из {schema?.stats?.count_all ?? 0} - {isEditable &&
+ {isEditable &&
}
-
+
Создайте новую конституенту

} - + striped highlightOnHover pointerOnHover - + selectableRows selectableRowsHighlight onSelectedRowsChange={handleSelectionChange} @@ -362,7 +371,7 @@ function EditorItems({ onOpenEdit, onShowCreateCst }: EditorItemsProps) { onRowClicked={handleRowClicked} clearSelectedRows={toggledClearRows} dense - /> + />
); diff --git a/rsconcept/frontend/src/pages/RSFormPage/elements/ConstituentaTooltip.tsx b/rsconcept/frontend/src/pages/RSFormPage/elements/ConstituentaTooltip.tsx new file mode 100644 index 00000000..bdadbe1c --- /dev/null +++ b/rsconcept/frontend/src/pages/RSFormPage/elements/ConstituentaTooltip.tsx @@ -0,0 +1,25 @@ +import ConceptTooltip from '../../../components/Common/ConceptTooltip'; +import { IConstituenta } from '../../../utils/models'; + +interface ConstituentaTooltipProps { + data: IConstituenta + anchor: string +} + +function ConstituentaTooltip({ data, anchor }: ConstituentaTooltipProps) { + return ( + +

Конституента {data.alias}

+

Типизация: {data.parse.typification}

+

Тремин: {data.term.resolved || data.term.raw}

+ {data.definition.formal &&

Выражение: {data.definition.formal}

} + {data.definition.text.resolved &&

Определение: {data.definition.text.resolved}

} + {data.convention &&

Конвенция: {data.convention}

} +
+ ); +} + +export default ConstituentaTooltip; diff --git a/rsconcept/frontend/src/pages/RSFormPage/elements/ViewSideConstituents.tsx b/rsconcept/frontend/src/pages/RSFormPage/elements/ViewSideConstituents.tsx index 9a187c30..51e4c153 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/elements/ViewSideConstituents.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/elements/ViewSideConstituents.tsx @@ -6,6 +6,7 @@ import { useRSForm } from '../../../context/RSFormContext'; import useLocalStorage from '../../../hooks/useLocalStorage'; import { CstType, extractGlobals,type IConstituenta, matchConstituenta } from '../../../utils/models'; import { getMockConstituenta } from '../../../utils/staticUI'; +import ConstituentaTooltip from './ConstituentaTooltip'; interface ViewSideConstituentsProps { expression: string @@ -61,7 +62,12 @@ function ViewSideConstituents({ expression }: ViewSideConstituentsProps) { { name: 'ID', id: 'alias', - selector: (cst: IConstituenta) => cst.alias, + cell: (cst: IConstituenta) => { + return (
+ {cst.alias} + +
); + }, width: '62px', maxWidth: '62px', conditionalCellStyles: [