M: Small UI layout fixes

This commit is contained in:
Ivan 2024-08-24 11:21:02 +03:00
parent e33e22006e
commit c897966886
5 changed files with 12 additions and 14 deletions

View File

@ -23,7 +23,7 @@ function ApplicationLayout() {
<div <div
id={globals.main_scroll} id={globals.main_scroll}
className='flex flex-col items-start overflow-x-auto max-w-[100vw]' className='overflow-x-auto max-w-[100vw]'
style={{ style={{
maxHeight: viewportHeight maxHeight: viewportHeight
}} }}

View File

@ -74,7 +74,7 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
spellCheck spellCheck
label='Термин' label='Термин'
placeholder='Обозначение, используемое в текстовых определениях' placeholder='Обозначение, используемое в текстовых определениях'
rows={2} className='cc-fit-content max-h-[3.6rem]'
value={state.term_raw} value={state.term_raw}
onChange={event => partialUpdate({ term_raw: event.target.value })} onChange={event => partialUpdate({ term_raw: event.target.value })}
/> />
@ -104,7 +104,7 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
spellCheck spellCheck
label='Текстовое определение' label='Текстовое определение'
placeholder='Текстовая интерпретация формального выражения' placeholder='Текстовая интерпретация формального выражения'
rows={2} className='cc-fit-content max-h-[3.6rem]'
value={state.definition_raw} value={state.definition_raw}
onChange={event => partialUpdate({ definition_raw: event.target.value })} onChange={event => partialUpdate({ definition_raw: event.target.value })}
/> />
@ -128,7 +128,7 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
spellCheck spellCheck
label={isBasic ? 'Конвенция' : 'Комментарий'} label={isBasic ? 'Конвенция' : 'Комментарий'}
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'} placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
rows={2} className='cc-fit-content max-h-[5.4rem]'
value={state.convention} value={state.convention}
onChange={event => partialUpdate({ convention: event.target.value })} onChange={event => partialUpdate({ convention: event.target.value })}
/> />

View File

@ -184,8 +184,8 @@ function FormCreateItem() {
onChange={event => setComment(event.target.value)} onChange={event => setComment(event.target.value)}
/> />
<div className='flex justify-between gap-3'> <div className='flex justify-between gap-3 flex-grow'>
<div className='flex flex-col gap-2 w-[7rem] h-min'> <div className='flex flex-col gap-2 min-w-[7rem] h-min'>
<Label text='Корень' /> <Label text='Корень' />
<SelectLocationHead <SelectLocationHead
value={head} value={head}
@ -197,7 +197,6 @@ function FormCreateItem() {
<TextArea <TextArea
id='dlg_cst_body' id='dlg_cst_body'
label='Путь' label='Путь'
className='w-[18rem]'
rows={4} rows={4}
value={body} value={body}
onChange={event => setBody(event.target.value)} onChange={event => setBody(event.target.value)}

View File

@ -20,11 +20,6 @@ import { information, labelCstTypification } from '@/utils/labels';
import EditorRSExpression from '../EditorRSExpression'; import EditorRSExpression from '../EditorRSExpression';
import ControlsOverlay from './ControlsOverlay'; import ControlsOverlay from './ControlsOverlay';
/**
* Characters limit to start increasing number of rows.
*/
export const ROW_SIZE_IN_CHARACTERS = 70;
interface FormConstituentaProps { interface FormConstituentaProps {
disabled: boolean; disabled: boolean;
@ -166,7 +161,7 @@ function FormConstituenta({
{state ? ( {state ? (
<TextArea <TextArea
id='cst_typification' id='cst_typification'
rows={typification.length > ROW_SIZE_IN_CHARACTERS ? 2 : 1} className='cc-fit-content'
dense dense
noResize noResize
noBorder noBorder
@ -220,12 +215,12 @@ function FormConstituenta({
<AnimateFade key='cst_convention_fade' hideContent={!showConvention || !state}> <AnimateFade key='cst_convention_fade' hideContent={!showConvention || !state}>
<TextArea <TextArea
id='cst_convention' id='cst_convention'
className='cc-fit-content max-h-[8rem]'
spellCheck spellCheck
label={isBasic ? 'Конвенция' : 'Комментарий'} label={isBasic ? 'Конвенция' : 'Комментарий'}
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'} placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
value={convention} value={convention}
disabled={disabled || (isBasic && state?.is_inherited)} disabled={disabled || (isBasic && state?.is_inherited)}
rows={convention.length > 2 * ROW_SIZE_IN_CHARACTERS || convention.includes('\n') ? 4 : 2}
onChange={event => setConvention(event.target.value)} onChange={event => setConvention(event.target.value)}
/> />
</AnimateFade> </AnimateFade>

View File

@ -226,6 +226,10 @@
@apply flex gap-1; @apply flex gap-1;
} }
.cc-fit-content {
field-sizing: content;
}
.cc-scroll-row { .cc-scroll-row {
scroll-snap-align: start; scroll-snap-align: start;
scroll-snap-stop: always; scroll-snap-stop: always;