B: Small UI fixes

This commit is contained in:
Ivan 2024-08-28 22:38:50 +03:00
parent de0b240e78
commit ddeab3bbb6
5 changed files with 13 additions and 14 deletions

View File

@ -6,6 +6,7 @@ import Label from './Label';
export interface TextAreaProps extends CProps.Editor, CProps.Colors, CProps.TextArea { export interface TextAreaProps extends CProps.Editor, CProps.Colors, CProps.TextArea {
dense?: boolean; dense?: boolean;
noResize?: boolean; noResize?: boolean;
fitContent?: boolean;
} }
function TextArea({ function TextArea({
@ -18,6 +19,7 @@ function TextArea({
noOutline, noOutline,
noResize, noResize,
className, className,
fitContent,
colors = 'clr-input', colors = 'clr-input',
...restProps ...restProps
}: TextAreaProps) { }: TextAreaProps) {
@ -40,6 +42,7 @@ function TextArea({
'leading-tight', 'leading-tight',
'overflow-x-hidden overflow-y-auto', 'overflow-x-hidden overflow-y-auto',
{ {
'cc-fit-content': fitContent,
'resize-none': noResize, 'resize-none': noResize,
'border': !noBorder, 'border': !noBorder,
'flex-grow max-w-full': dense, 'flex-grow max-w-full': dense,

View File

@ -59,14 +59,7 @@ function DlgChangeLocation({ hideWindow, initial, onChangeLocation }: DlgChangeL
onChange={handleSelectLocation} onChange={handleSelectLocation}
className='max-h-[9.2rem]' className='max-h-[9.2rem]'
/> />
<TextArea <TextArea id='dlg_cst_body' label='Путь' rows={3} value={body} onChange={event => setBody(event.target.value)} />
id='dlg_cst_body'
label='Путь'
className='w-[23rem]'
rows={3}
value={body}
onChange={event => setBody(event.target.value)}
/>
</Modal> </Modal>
); );
} }

View File

@ -128,7 +128,6 @@ function DlgCloneLibraryItem({ hideWindow, base, initialLocation, selected, tota
<TextArea <TextArea
id='dlg_cst_body' id='dlg_cst_body'
label='Путь' label='Путь'
className='w-[18rem]'
rows={3} rows={3}
value={body} value={body}
onChange={event => setBody(event.target.value)} onChange={event => setBody(event.target.value)}

View File

@ -71,10 +71,11 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
<TextArea <TextArea
key='dlg_cst_term' key='dlg_cst_term'
id='dlg_cst_term' id='dlg_cst_term'
fitContent
spellCheck spellCheck
label='Термин' label='Термин'
placeholder='Обозначение, используемое в текстовых определениях' placeholder='Обозначение, используемое в текстовых определениях'
className='cc-fit-content max-h-[3.6rem]' className='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 })}
/> />
@ -102,9 +103,10 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
<TextArea <TextArea
id='dlg_cst_definition' id='dlg_cst_definition'
spellCheck spellCheck
fitContent
label='Текстовое определение' label='Текстовое определение'
placeholder='Текстовая интерпретация формального выражения' placeholder='Текстовая интерпретация формального выражения'
className='cc-fit-content max-h-[3.6rem]' className='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 })}
/> />
@ -126,9 +128,10 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
key='dlg_cst_convention' key='dlg_cst_convention'
id='dlg_cst_convention' id='dlg_cst_convention'
spellCheck spellCheck
fitContent
label={isBasic ? 'Конвенция' : 'Комментарий'} label={isBasic ? 'Конвенция' : 'Комментарий'}
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'} placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
className='cc-fit-content max-h-[5.4rem]' className='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

@ -161,7 +161,7 @@ function FormConstituenta({
{state ? ( {state ? (
<TextArea <TextArea
id='cst_typification' id='cst_typification'
className='cc-fit-content' fitContent
dense dense
noResize noResize
noBorder noBorder
@ -215,7 +215,8 @@ 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]' fitContent
className='max-h-[8rem]'
spellCheck spellCheck
label={isBasic ? 'Конвенция' : 'Комментарий'} label={isBasic ? 'Конвенция' : 'Комментарий'}
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'} placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}