Small UI fixes

This commit is contained in:
IRBorisov 2024-03-06 21:33:59 +03:00
parent f2cba9aaaf
commit da7af6f8dc
6 changed files with 14 additions and 5 deletions

View File

@ -76,7 +76,8 @@ const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
fontFamily: 'inherit',
background: !disabled ? colors.bgInput : colors.bgDefault,
foreground: colors.fgDefault,
selection: colors.bgHover
selection: colors.bgHover,
caret: colors.fgDefault
},
styles: [
{ tag: tags.name, color: colors.fgPurple, cursor: 'default' }, // GlobalID

View File

@ -87,7 +87,8 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
fontFamily: 'inherit',
background: !disabled ? colors.bgInput : colors.bgDefault,
foreground: colors.fgDefault,
selection: colors.bgHover
selection: colors.bgHover,
caret: colors.fgDefault
},
styles: [
{ tag: tags.name, color: colors.fgPurple, cursor: 'default' }, // EntityReference

View File

@ -16,6 +16,11 @@ import { labelCstTypification } from '@/utils/labels';
import EditorRSExpression from '../EditorRSExpression';
import ControlsOverlay from './ControlsOverlay';
/**
* Characters limit to start increasing number of rows.
*/
export const ROW_SIZE_IN_CHARACTERS = 70;
interface FormConstituentaProps {
disabled?: boolean;
showList: boolean;
@ -130,7 +135,7 @@ function FormConstituenta({
noBorder
disabled
label='Типизация'
rows={typification.length > 70 ? 2 : 1}
rows={typification.length > ROW_SIZE_IN_CHARACTERS ? 2 : 1}
value={typification}
colors='clr-app'
style={{
@ -166,6 +171,7 @@ function FormConstituenta({
placeholder='Договоренность об интерпретации или пояснение'
value={convention}
disabled={disabled}
rows={convention.length > ROW_SIZE_IN_CHARACTERS ? 3 : 2}
onChange={event => setConvention(event.target.value)}
/>
<SubmitButton

View File

@ -110,6 +110,7 @@ function FormRSForm({ id, disabled, isModified, setIsModified }: FormRSFormProps
/>
<TextArea
label='Комментарий'
rows={3}
value={comment}
disabled={disabled}
onChange={event => setComment(event.target.value)}

View File

@ -98,7 +98,7 @@ function TermGraph({
}, [selectedIDs, setSelections, nodes]);
const canvasWidth = useMemo(() => {
return 'calc(100vw - 1.1rem)';
return 'calc(100vw - 1rem)';
}, []);
const canvasHeight = useMemo(() => {

View File

@ -169,7 +169,7 @@ function RSTabs() {
selectedTabClassName='clr-selected'
className='flex flex-col min-w-fit'
>
<TabList className={clsx('sm:mx-auto w-fit', 'flex items-stretch', 'border-b-2 border-x-2 divide-x-2')}>
<TabList className={clsx('mx-auto w-fit', 'flex items-stretch', 'border-b-2 border-x-2 divide-x-2')}>
<RSTabsMenu onDestroy={onDestroySchema} />
<TabLabel className='' label='Карточка' title={`Название схемы: ${schema.title ?? ''}`} />