Minor UI fixes

This commit is contained in:
IRBorisov 2023-11-07 18:03:37 +03:00
parent 150bfa0629
commit f73badebaa
8 changed files with 11 additions and 13 deletions

View File

@ -45,7 +45,7 @@ const editorSetup: BasicSetupOptions = {
interface RSInputProps interface RSInputProps
extends Pick<ReactCodeMirrorProps, extends Pick<ReactCodeMirrorProps,
'id' | 'height' | 'value' | 'className' | 'onFocus' | 'onBlur' | 'placeholder' 'id' | 'height' | 'minHeight' | 'maxHeight' | 'value' | 'className' | 'onFocus' | 'onBlur' | 'placeholder'
> { > {
label?: string label?: string
dimensions?: string dimensions?: string

View File

@ -177,7 +177,7 @@ function ArgumentsTab({ state, schema, partialUpdate }: ArgumentsTabProps) {
<RSInput id='result' <RSInput id='result'
dimensions='w-full mt-[0.3rem]' dimensions='w-full mt-[0.3rem]'
placeholder='Итоговое определение' placeholder='Итоговое определение'
height='4.8rem' height='4.9rem'
value={state.definition} value={state.definition}
disabled disabled
/> />

View File

@ -40,7 +40,7 @@ function ConstituentaTab({state, partialUpdate}: ConstituentaTabProps) {
/> />
<RSInput id='expression' label='Формальное определение' <RSInput id='expression' label='Формальное определение'
placeholder='Родоструктурное выражение, задающее формальное определение' placeholder='Родоструктурное выражение, задающее формальное определение'
height='4.8rem' height='4.9rem'
value={state.definition_formal} value={state.definition_formal}
onChange={value => partialUpdate({definition_formal: value})} onChange={value => partialUpdate({definition_formal: value})}
/> />
@ -52,7 +52,7 @@ function ConstituentaTab({state, partialUpdate}: ConstituentaTabProps) {
onChange={event => partialUpdate({ definition_raw: event.target.value })} onChange={event => partialUpdate({ definition_raw: event.target.value })}
/> />
<TextArea id='convention' label='Конвенция / Комментарий' <TextArea id='convention' label='Конвенция / Комментарий'
placeholder='Договоренность об интерпретации неопределяемого понятия&#x000D;&#x000A;Комментарий к производному понятию' placeholder='Договоренность об интерпретации или пояснение к схеме'
rows={2} rows={2}
value={state.convention} value={state.convention}
spellCheck spellCheck

View File

@ -121,7 +121,7 @@ function TemplateTab({ state, partialUpdate }: TemplateTabProps) {
spellCheck spellCheck
/> />
<RSInput id='expression' <RSInput id='expression'
height='4.8rem' height='4.9rem'
placeholder='Выберите шаблон из списка' placeholder='Выберите шаблон из списка'
disabled disabled
value={state.prototype?.definition_formal} value={state.prototype?.definition_formal}

View File

@ -79,7 +79,7 @@ function DlgCreateCst({ hideWindow, initial, schema, onCreate }: DlgCreateCstPro
/> />
<RSInput id='expression' label='Формальное определение' <RSInput id='expression' label='Формальное определение'
placeholder='Родоструктурное выражение, задающее формальное определение' placeholder='Родоструктурное выражение, задающее формальное определение'
height='4.8rem' height='4.9rem'
value={cstData.definition_formal} value={cstData.definition_formal}
onChange={value => updateCstData({definition_formal: value})} onChange={value => updateCstData({definition_formal: value})}
/> />
@ -91,7 +91,7 @@ function DlgCreateCst({ hideWindow, initial, schema, onCreate }: DlgCreateCstPro
onChange={event => updateCstData({ definition_raw: event.target.value })} onChange={event => updateCstData({ definition_raw: event.target.value })}
/> />
<TextArea id='convention' label='Конвенция / Комментарий' <TextArea id='convention' label='Конвенция / Комментарий'
placeholder='Договоренность об интерпретации неопределяемого понятия&#x000D;&#x000A;Комментарий к производному понятию' placeholder='Договоренность об интерпретации или пояснение'
rows={2} rows={2}
value={cstData.convention} value={cstData.convention}
spellCheck spellCheck

View File

@ -230,7 +230,6 @@ function EditorConstituenta({
<div className='flex flex-col gap-3 mt-1'> <div className='flex flex-col gap-3 mt-1'>
<RefsInput id='term' label='Термин' <RefsInput id='term' label='Термин'
placeholder='Обозначение, используемое в текстовых определениях данной схемы' placeholder='Обозначение, используемое в текстовых определениях данной схемы'
height='2.1rem'
items={schema?.items} items={schema?.items}
value={term} value={term}
initialValue={activeCst?.term_raw ?? ''} initialValue={activeCst?.term_raw ?? ''}
@ -239,7 +238,7 @@ function EditorConstituenta({
onChange={newValue => setTerm(newValue)} onChange={newValue => setTerm(newValue)}
/> />
<TextArea id='typification' label='Типизация' <TextArea id='typification' label='Типизация'
dense dense noBorder
rows={1} rows={1}
value={typification} value={typification}
colors='clr-app' colors='clr-app'
@ -257,7 +256,6 @@ function EditorConstituenta({
/> />
<RefsInput id='definition' label='Текстовое определение' <RefsInput id='definition' label='Текстовое определение'
placeholder='Лингвистическая интерпретация формального выражения' placeholder='Лингвистическая интерпретация формального выражения'
height='4.8rem'
items={schema?.items} items={schema?.items}
value={textDefinition} value={textDefinition}
initialValue={activeCst?.definition_raw ?? ''} initialValue={activeCst?.definition_raw ?? ''}
@ -266,7 +264,7 @@ function EditorConstituenta({
onChange={newValue => setTextDefinition(newValue)} onChange={newValue => setTextDefinition(newValue)}
/> />
<TextArea id='convention' label='Конвенция / Комментарий' <TextArea id='convention' label='Конвенция / Комментарий'
placeholder='Договоренность об интерпретации неопределяемого понятия&#x000D;&#x000A;Комментарий к производному понятию' placeholder='Договоренность об интерпретации или пояснение'
rows={2} rows={2}
value={convention} value={convention}
disabled={!isEnabled} disabled={!isEnabled}

View File

@ -129,8 +129,8 @@ function EditorRSExpression({
</div> </div>
</div> </div>
<RSInput innerref={rsInput} <RSInput innerref={rsInput}
height='4.8rem'
value={value} value={value}
minHeight='3.5rem'
disabled={disabled} disabled={disabled}
onChange={handleChange} onChange={handleChange}
{...props} {...props}

View File

@ -101,7 +101,7 @@ function ViewSideConstituents({ expression, baseHeight, activeID, onOpenEdit }:
filtered = filtered.filter(cst => matchConstituenta(cst, filterText, filterMatch)); filtered = filtered.filter(cst => matchConstituenta(cst, filterText, filterMatch));
} }
setFilteredData(filtered); setFilteredData(filtered);
}, [filterText, setFilteredData, filterSource, expression, schema, filterMatch, activeID]); }, [filterText, setFilteredData, filterSource, expression, schema?.items, schema, filterMatch, activeID]);
const handleRowClicked = useCallback( const handleRowClicked = useCallback(
(cst: IConstituenta, event: React.MouseEvent<Element, MouseEvent>) => { (cst: IConstituenta, event: React.MouseEvent<Element, MouseEvent>) => {