From 168ff94c420b5ee7e16b6e7379d32af83a512f75 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:49:36 +0300 Subject: [PATCH] F: Improve RSEditor layout responsiveness --- .../src/components/info/BadgeConstituenta.tsx | 13 ++++++++----- rsconcept/frontend/src/components/ui/Modal.tsx | 14 ++++++++------ .../src/dialogs/DlgCreateCst/FormCreateCst.tsx | 2 +- .../EditorConstituenta/FormConstituenta.tsx | 4 ++-- .../EditorRSExpression/EditorRSExpression.tsx | 2 +- .../EditorRSExpression/RSEditControls.tsx | 5 ++++- .../EditorRSExpression/RSLocalButton.tsx | 17 ++++++++++++++--- .../RSFormPage/EditorRSExpression/StatusBar.tsx | 2 -- .../ViewConstituents/TableSideConstituents.tsx | 7 ++++++- 9 files changed, 44 insertions(+), 22 deletions(-) diff --git a/rsconcept/frontend/src/components/info/BadgeConstituenta.tsx b/rsconcept/frontend/src/components/info/BadgeConstituenta.tsx index f70ab2fd..8d78b8e6 100644 --- a/rsconcept/frontend/src/components/info/BadgeConstituenta.tsx +++ b/rsconcept/frontend/src/components/info/BadgeConstituenta.tsx @@ -4,29 +4,32 @@ import { IConstituenta } from '@/models/rsform'; import { isMockCst } from '@/models/rsformAPI'; import { colorFgCstStatus, IColorTheme } from '@/styling/color'; +import { CProps } from '../props'; import TooltipConstituenta from './TooltipConstituenta'; -interface BadgeConstituentaProps { +interface BadgeConstituentaProps extends CProps.Styling { prefixID?: string; value: IConstituenta; theme: IColorTheme; } -function BadgeConstituenta({ value, prefixID, theme }: BadgeConstituentaProps) { +function BadgeConstituenta({ value, prefixID, className, style, theme }: BadgeConstituentaProps) { return (
{value.alias} diff --git a/rsconcept/frontend/src/components/ui/Modal.tsx b/rsconcept/frontend/src/components/ui/Modal.tsx index 4e8ced08..dcd01f2b 100644 --- a/rsconcept/frontend/src/components/ui/Modal.tsx +++ b/rsconcept/frontend/src/components/ui/Modal.tsx @@ -91,12 +91,14 @@ function Modal({ {header ?

{header}

: null}
{children}
diff --git a/rsconcept/frontend/src/dialogs/DlgCreateCst/FormCreateCst.tsx b/rsconcept/frontend/src/dialogs/DlgCreateCst/FormCreateCst.tsx index 188af2fa..f01f3c09 100644 --- a/rsconcept/frontend/src/dialogs/DlgCreateCst/FormCreateCst.tsx +++ b/rsconcept/frontend/src/dialogs/DlgCreateCst/FormCreateCst.tsx @@ -78,7 +78,7 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat fitContent spellCheck label='Термин' - placeholder='Обозначение, используемое в текстовых определениях' + placeholder='Обозначение для текстовых определений' className='max-h-[3.6rem]' value={state.term_raw} onChange={event => partialUpdate({ term_raw: event.target.value })} diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx index 191bba40..2321fbe9 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx @@ -149,7 +149,7 @@ function FormConstituenta({ id='cst_term' label='Термин' maxHeight='8rem' - placeholder='Обозначение, используемое в текстовых определениях' + placeholder='Обозначение для текстовых определений' schema={schema} onOpenEdit={onOpenEdit} value={term} @@ -240,7 +240,7 @@ function FormConstituenta({ {!disabled || processing ? ( -
+
setShowControls(prev => !prev)} /> - + ))} @@ -121,6 +122,7 @@ function RSEditorControls({ isOpen, disabled, onEdit }: RSEditorControlsProps) { {SECONDARY_SECOND_ROW.map(({ text, title }) => ( ( void; } -function RSLocalButton({ text, title, titleHtml, hideTitle, disabled, onInsert }: RSLocalButtonProps) { +function RSLocalButton({ + text, + title, + titleHtml, + hideTitle, + disabled, + className, + onInsert, + ...restProps +}: RSLocalButtonProps) { return ( diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/StatusBar.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/StatusBar.tsx index 4bbacfcb..74b69b19 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/StatusBar.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/StatusBar.tsx @@ -41,12 +41,10 @@ function StatusBar({ isModified, processing, activeCst, parseData, onAnalyze }: tabIndex={0} className={clsx( 'w-[10rem] h-[1.75rem]', - 'scale-75 sm:scale-100 mx-[-2.5rem] sm:m-0', 'px-2 flex items-center justify-center gap-2', 'border', 'select-none', 'cursor-pointer', - 'translate-x-[-1.5rem]', 'focus-frame', 'duration-500 transition-colors' )} diff --git a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/TableSideConstituents.tsx b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/TableSideConstituents.tsx index cec12186..11780219 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/TableSideConstituents.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/TableSideConstituents.tsx @@ -69,7 +69,12 @@ function TableSideConstituents({ minSize: 65, footer: undefined, cell: props => ( - + ) }), columnHelper.accessor(cst => describeConstituenta(cst), {