diff --git a/rsconcept/frontend/src/components/Common/ConceptDataTable.tsx b/rsconcept/frontend/src/components/Common/ConceptDataTable.tsx index 9da2e38e..ea619cfe 100644 --- a/rsconcept/frontend/src/components/Common/ConceptDataTable.tsx +++ b/rsconcept/frontend/src/components/Common/ConceptDataTable.tsx @@ -15,21 +15,21 @@ createTheme('customDark', { disabled: 'rgba(228, 228, 231, 0.54)' }, background: { - default: '#002b36' + default: '#002129' }, context: { background: '#3e014d', text: 'rgba(228, 228, 231, 0.87)' }, highlightOnHover: { - default: '#3e014d', + default: '#2d0138', text: 'rgba(228, 228, 231, 1)' }, divider: { default: '#6b6b6b' }, striped: { - default: '#004859', + default: '#003845', text: 'rgba(228, 228, 231, 1)' }, selected: { diff --git a/rsconcept/frontend/src/index.css b/rsconcept/frontend/src/index.css index b853420e..54ac9339 100644 --- a/rsconcept/frontend/src/index.css +++ b/rsconcept/frontend/src/index.css @@ -3,7 +3,7 @@ @tailwind utilities; .rdt_TableCell{ - font-size: 14px; + font-size: 0.875rem; } [data-color-scheme="dark"] { @@ -59,7 +59,7 @@ } .clr-input { - @apply dark:bg-black bg-white disabled:bg-[#f0f2f7] dark:disabled:bg-gray-700 + @apply dark:bg-[#070b12] bg-white disabled:bg-[#f0f2f7] dark:disabled:bg-gray-700 } .clr-footer { diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta.tsx index 587ccae9..081a66a6 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta.tsx @@ -171,8 +171,8 @@ function EditorConstituenta({ activeID, onShowAST, onCreateCst, onOpenEdit, onDe

- столбец "Описание" содержит один из непустых текстовых атрибутов

Статусы

- { [... mapStatusInfo.values()].map(info => { - return (

+ { [... mapStatusInfo.values()].map((info, index) => { + return (

{info.text} diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx index 7e63ca79..b62330c0 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression.tsx @@ -4,7 +4,6 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react'; import Button from '../../components/Common/Button'; import Label from '../../components/Common/Label'; import { Loader } from '../../components/Common/Loader'; -import { useAuth } from '../../context/AuthContext'; import { useRSForm } from '../../context/RSFormContext'; import useCheckExpression from '../../hooks/useCheckExpression'; import { TokenID } from '../../utils/enums'; @@ -33,15 +32,13 @@ interface EditorRSExpressionProps { } function EditorRSExpression({ - id, activeCst, label, disabled, isActive, placeholder, value, setValue, onShowAST, + id, activeCst, label, disabled, isActive, placeholder, value, onShowAST, toggleEditMode, setTypification, onChange }: EditorRSExpressionProps) { - const { user } = useAuth(); const { schema } = useRSForm(); const [isModified, setIsModified] = useState(false); const { parseData, checkExpression, resetParse, loading } = useCheckExpression({ schema }); - const expressionCtrl = useRef(null); const rsInput = useRef(null); useLayoutEffect(() => { @@ -66,11 +63,10 @@ function EditorRSExpression({ const expression = prefix + value; checkExpression(expression, parse => { if (parse.errors.length > 0) { - const errorPosition = parse.errors[0].position - prefix.length - expressionCtrl.current!.selectionStart = errorPosition; - expressionCtrl.current!.selectionEnd = errorPosition; + onShowError(parse.errors[0]); + } else { + rsInput.current?.view?.focus(); } - expressionCtrl.current!.focus(); setIsModified(false); setTypification(getTypificationLabel({ isValid: parse.parseResult, @@ -82,38 +78,40 @@ function EditorRSExpression({ const onShowError = useCallback( (error: IRSErrorDescription) => { - if (!activeCst || !expressionCtrl.current) { - return; + if (!activeCst || !rsInput.current) { + return; + } + const prefix = getCstExpressionPrefix(activeCst); + const errorPosition = error.position - prefix.length; + rsInput.current?.view?.dispatch({ + selection: { + anchor: errorPosition, + head: errorPosition } - const errorPosition = error.position - getCstExpressionPrefix(activeCst).length - expressionCtrl.current.selectionStart = errorPosition; - expressionCtrl.current.selectionEnd = errorPosition; - expressionCtrl.current.focus(); + }); + rsInput.current?.view?.focus(); }, [activeCst]); const handleEdit = useCallback((id: TokenID, key?: string) => { - if (!expressionCtrl.current) { + if (!rsInput.current || !rsInput.current.editor || !rsInput.current.state || !rsInput.current.view) { return; } - const text = new TextWrapper(expressionCtrl.current); + const text = new TextWrapper(rsInput.current as Required); if (id === TokenID.ID_LOCAL) { text.insertChar(key ?? 'unknown_local'); } else { text.insertToken(id); } - text.finalize(); - text.focus(); - setValue(text.value); + rsInput.current?.view?.focus(); setIsModified(true); - }, [setValue]); + }, []); const handleInput = useCallback( - (event: React.KeyboardEvent) => { - if (!expressionCtrl.current) { + (event: React.KeyboardEvent) => { + if (!rsInput.current) { return; } - const text = new TextWrapper(expressionCtrl.current); - // rsInput.current?.state?.selection + const text = new TextWrapper(rsInput.current as Required); if (event.shiftKey && event.key === '*' && !event.altKey) { text.insertToken(TokenID.DECART); } else if (event.altKey) { @@ -130,10 +128,8 @@ function EditorRSExpression({ return; } event.preventDefault(); - text.finalize(); - setValue(text.value); setIsModified(true); - }, [expressionCtrl, setValue]); + }, []); const EditButtons = useMemo(() => { return (

@@ -229,24 +225,15 @@ function EditorRSExpression({ required={false} htmlFor={id} /> -