mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
F: Improve placeholder for RSExpressions
This commit is contained in:
parent
4759abd03f
commit
78efdb8743
|
@ -137,6 +137,24 @@ export function getCstTypeShortcut(type: CstType) {
|
|||
}
|
||||
}
|
||||
|
||||
/** Generates placeholder for RS definition based on {@link CstType}. */
|
||||
export function getRSDefinitionPlaceholder(type: CstType): string {
|
||||
switch (type) {
|
||||
case CstType.STRUCTURED:
|
||||
return 'Пример: ℬ(X1×D2)';
|
||||
case CstType.TERM:
|
||||
return 'Пример: D{ξ∈S1 | Pr1(ξ)∩Pr2(ξ)=∅}';
|
||||
case CstType.THEOREM:
|
||||
case CstType.AXIOM:
|
||||
return 'Пример: D11=∅';
|
||||
case CstType.FUNCTION:
|
||||
return 'Пример: [α∈X1, β∈ℬ(X1×X2)] Pr2(Fi1[{α}](β))';
|
||||
case CstType.PREDICATE:
|
||||
return 'Пример: [α∈X1, β∈ℬ(X1)] α∈β & card(β)>1';
|
||||
}
|
||||
return 'Формальное выражение';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates description for {@link TokenID}.
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { useMutatingRSForm } from '../../../backend/use-mutating-rsform';
|
||||
import { useUpdateConstituenta } from '../../../backend/use-update-constituenta';
|
||||
import { RefsInput } from '../../../components/refs-input';
|
||||
import { labelCstTypification, labelTypification } from '../../../labels';
|
||||
import { getRSDefinitionPlaceholder, labelCstTypification, labelTypification } from '../../../labels';
|
||||
import { type IConstituenta, type IRSForm } from '../../../models/rsform';
|
||||
import { isBaseSet, isBasicConcept, isFunctional } from '../../../models/rsform-api';
|
||||
import { EditorRSExpression } from '../editor-rsexpression';
|
||||
|
@ -198,7 +198,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
|||
id='cst_term'
|
||||
label='Термин'
|
||||
maxHeight='8rem'
|
||||
placeholder='Обозначение для текстовых определений'
|
||||
placeholder={disabled ? '' : 'Обозначение для текстовых определений'}
|
||||
schema={schema}
|
||||
onOpenEdit={onOpenEdit}
|
||||
value={field.value ?? ''}
|
||||
|
@ -238,9 +238,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
|||
? 'Определение функции'
|
||||
: 'Формальное определение'
|
||||
}
|
||||
placeholder={
|
||||
activeCst.cst_type !== CstType.STRUCTURED ? 'Родоструктурное выражение' : 'Типизация родовой структуры'
|
||||
}
|
||||
placeholder={disabled ? '' : getRSDefinitionPlaceholder(activeCst.cst_type)}
|
||||
value={field.value ?? ''}
|
||||
activeCst={activeCst}
|
||||
toggleReset={toggleReset}
|
||||
|
@ -261,7 +259,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
|||
<RefsInput
|
||||
id='cst_definition'
|
||||
label='Текстовое определение'
|
||||
placeholder='Текстовая интерпретация формального выражения'
|
||||
placeholder={disabled ? '' : 'Текстовая интерпретация формального выражения'}
|
||||
minHeight='3.75rem'
|
||||
maxHeight='8rem'
|
||||
schema={schema}
|
||||
|
@ -284,7 +282,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
|||
className='max-h-32'
|
||||
spellCheck
|
||||
label={isBasic ? 'Конвенция' : 'Комментарий'}
|
||||
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
|
||||
placeholder={disabled ? '' : isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
|
||||
disabled={disabled || (isBasic && activeCst.is_inherited)}
|
||||
/>
|
||||
) : null}
|
||||
|
|
Loading…
Reference in New Issue
Block a user