M: Multiple minor UI fixes

This commit is contained in:
Ivan 2025-07-03 14:35:26 +03:00
parent c361047caf
commit 1260f159c9
21 changed files with 31 additions and 35 deletions

View File

@ -48,7 +48,7 @@ export function HelpLibrary() {
<IconUserSearch size='1rem' className='inline-icon' /> фильтр по пользователю <IconUserSearch size='1rem' className='inline-icon' /> фильтр по пользователю
</li> </li>
<li> <li>
<IconSearch size='1rem' className='inline-icon' /> фильтр по названию и шифру <IconSearch size='1rem' className='inline-icon' /> фильтр по названию и сокращению
</li> </li>
<li> <li>
<IconFilterReset size='1rem' className='inline-icon' /> сбросить фильтры <IconFilterReset size='1rem' className='inline-icon' /> сбросить фильтры

View File

@ -59,7 +59,7 @@ export function PickSchema({
const columns = [ const columns = [
columnHelper.accessor('alias', { columnHelper.accessor('alias', {
id: 'alias', id: 'alias',
header: 'Шифр', header: 'Сокращение',
size: 150, size: 150,
minSize: 80, minSize: 80,
maxSize: 150 maxSize: 150

View File

@ -88,7 +88,7 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
/> />
<SelectUser <SelectUser
aria-label='Выбор пользователя для фильтра по владельцу' aria-label='Выбор пользователя для фильтра по владельцу'
placeholder='Выберите владельца' placeholder='Выбрать владельца'
noBorder noBorder
className='min-w-60 mx-1 mb-1 cc-hover-bg select-none' className='min-w-60 mx-1 mb-1 cc-hover-bg select-none'
filter={filterNonEmptyUsers} filter={filterNonEmptyUsers}

View File

@ -36,7 +36,7 @@ export function useLibraryColumns() {
]), ]),
columnHelper.accessor('alias', { columnHelper.accessor('alias', {
id: 'alias', id: 'alias',
header: 'Шифр', header: 'Сокращение',
size: 150, size: 150,
minSize: 80, minSize: 80,
maxSize: 150, maxSize: 150,

View File

@ -18,7 +18,7 @@ interface OssStatsProps {
export function OssStats({ className, stats }: OssStatsProps) { export function OssStats({ className, stats }: OssStatsProps) {
return ( return (
<aside className={cn('grid grid-cols-4 gap-1 justify-items-end h-min', className)}> <aside className={cn('grid grid-cols-4 gap-1 justify-items-end h-min select-none', className)}>
<div id='count_operations' className='w-fit flex gap-3 hover:cursor-default '> <div id='count_operations' className='w-fit flex gap-3 hover:cursor-default '>
<span>Всего</span> <span>Всего</span>
<span>{stats.count_all}</span> <span>{stats.count_all}</span>

View File

@ -62,7 +62,7 @@ export function PickMultiOperation({ rows, items, value, onChange, className, ..
const columns = [ const columns = [
columnHelper.accessor('alias', { columnHelper.accessor('alias', {
id: 'alias', id: 'alias',
header: 'Шифр', header: 'Сокращение',
size: 300, size: 300,
minSize: 150, minSize: 150,
maxSize: 300 maxSize: 300
@ -79,7 +79,7 @@ export function PickMultiOperation({ rows, items, value, onChange, className, ..
id: 'actions', id: 'actions',
size: 0, size: 0,
cell: props => ( cell: props => (
<div className='flex w-fit'> <div className='flex gap-1 w-fit'>
<MiniButton <MiniButton
title='Удалить' title='Удалить'
className='px-0' className='px-0'

View File

@ -14,7 +14,7 @@ interface SelectBlockProps extends Styling {
popoverClassname?: string; popoverClassname?: string;
} }
export function SelectBlock({ items, placeholder = 'Выберите блок', ...restProps }: SelectBlockProps) { export function SelectBlock({ items, placeholder = 'Выбор блока', ...restProps }: SelectBlockProps) {
return ( return (
<ComboBox <ComboBox
items={items} items={items}

View File

@ -14,7 +14,7 @@ interface SelectOperationProps extends Styling {
popoverClassname?: string; popoverClassname?: string;
} }
export function SelectOperation({ items, placeholder = 'Выберите операцию', ...restProps }: SelectOperationProps) { export function SelectOperation({ items, placeholder = 'Выбор операции', ...restProps }: SelectOperationProps) {
return ( return (
<ComboBox <ComboBox
items={items} items={items}

View File

@ -77,7 +77,7 @@ export function DlgCreateBlock() {
return ( return (
<ModalForm <ModalForm
header='Создание операции' header='Создание блока'
submitText='Создать' submitText='Создать'
canSubmit={isValid} canSubmit={isValid}
onSubmit={event => void methods.handleSubmit(onSubmit)(event)} onSubmit={event => void methods.handleSubmit(onSubmit)(event)}

View File

@ -77,7 +77,7 @@ export function TabInputOperation() {
<SelectParent <SelectParent
items={manager.oss.blocks} items={manager.oss.blocks}
value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null} value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null}
placeholder='Блок содержания' placeholder='Родительский блок'
onChange={value => field.onChange(value ? value.id : null)} onChange={value => field.onChange(value ? value.id : null)}
/> />
)} )}

View File

@ -42,7 +42,7 @@ export function TabSynthesisOperation() {
<SelectParent <SelectParent
items={manager.oss.blocks} items={manager.oss.blocks}
value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null} value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null}
placeholder='Блок содержания' placeholder='Родительский блок'
onChange={value => field.onChange(value ? value.id : null)} onChange={value => field.onChange(value ? value.id : null)}
/> />
)} )}

View File

@ -39,7 +39,7 @@ export function TabOperation() {
<SelectParent <SelectParent
items={manager.oss.blocks} items={manager.oss.blocks}
value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null} value={field.value ? manager.oss.blockByID.get(field.value) ?? null : null}
placeholder='Блок содержания' placeholder='Родительский блок'
onChange={value => field.onChange(value ? value.id : null)} onChange={value => field.onChange(value ? value.id : null)}
/> />
)} )}

View File

@ -122,8 +122,8 @@ export function DlgRelocateConstituents() {
<div className='flex gap-1 items-center bg-input border-b rounded-t-md'> <div className='flex gap-1 items-center bg-input border-b rounded-t-md'>
<SelectLibraryItem <SelectLibraryItem
noBorder noBorder
className='w-1/2' className='w-1/2 shrink-1'
placeholder='Выберите исходную схему' placeholder='Исходная схема'
items={sourceSchemas} items={sourceSchemas}
value={source} value={source}
onChange={handleSelectSource} onChange={handleSelectSource}
@ -135,8 +135,8 @@ export function DlgRelocateConstituents() {
/> />
<SelectLibraryItem <SelectLibraryItem
noBorder noBorder
className='w-1/2' className='w-1/2 shrink-1'
placeholder='Выберите целевую схему' placeholder='Целевая схема'
items={destinationSchemas} items={destinationSchemas}
value={destinationItem} value={destinationItem}
onChange={handleSelectDestination} onChange={handleSelectDestination}

View File

@ -30,7 +30,7 @@ export function SidePanel({ selectedItems, isMounted, className }: SidePanelProp
const sidePanelHeight = useMainHeight(); const sidePanelHeight = useMainHeight();
return ( return (
<div <aside
className={cn( className={cn(
'relative flex flex-col py-2 h-full overflow-hidden', 'relative flex flex-col py-2 h-full overflow-hidden',
'border-l rounded-none rounded-l-sm bg-background', 'border-l rounded-none rounded-l-sm bg-background',
@ -67,6 +67,6 @@ export function SidePanel({ selectedItems, isMounted, className }: SidePanelProp
<ViewSchema schemaID={selectedSchema} /> <ViewSchema schemaID={selectedSchema} />
</Suspense> </Suspense>
) : null} ) : null}
</div> </aside>
); );
} }

View File

@ -231,7 +231,7 @@ export function PickSubstitutions({
<SelectLibraryItem <SelectLibraryItem
id='substitute-left-schema' id='substitute-left-schema'
noBorder noBorder
placeholder='Выберите аргумент' placeholder='Аргумент'
items={allowSelfSubstitution ? schemas : schemas.filter(item => item.id !== rightArgument?.id)} items={allowSelfSubstitution ? schemas : schemas.filter(item => item.id !== rightArgument?.id)}
value={leftArgument} value={leftArgument}
onChange={setLeftArgument} onChange={setLeftArgument}
@ -263,7 +263,7 @@ export function PickSubstitutions({
<SelectLibraryItem <SelectLibraryItem
id='substitute-right-schema' id='substitute-right-schema'
noBorder noBorder
placeholder='Выберите аргумент' placeholder='Аргумент'
items={allowSelfSubstitution ? schemas : schemas.filter(item => item.id !== leftArgument?.id)} items={allowSelfSubstitution ? schemas : schemas.filter(item => item.id !== leftArgument?.id)}
value={rightArgument} value={rightArgument}
onChange={setRightArgument} onChange={setRightArgument}

View File

@ -29,7 +29,7 @@ interface RSFormStatsProps {
export function RSFormStats({ className, stats }: RSFormStatsProps) { export function RSFormStats({ className, stats }: RSFormStatsProps) {
return ( return (
<aside className={cn('h-min', 'grid grid-cols-4 gap-1 justify-items-end ', className)}> <div className={cn('h-min', 'grid grid-cols-4 gap-1 justify-items-end select-none', className)}>
<div id='count_all' className='col-span-2 w-fit flex gap-3 hover:cursor-default'> <div id='count_all' className='col-span-2 w-fit flex gap-3 hover:cursor-default'>
<span>Всего</span> <span>Всего</span>
<span>{stats.count_all}</span> <span>{stats.count_all}</span>
@ -138,6 +138,6 @@ export function RSFormStats({ className, stats }: RSFormStatsProps) {
} }
value={stats.count_convention} value={stats.count_convention}
/> />
</aside> </div>
); );
} }

View File

@ -16,7 +16,7 @@ interface SelectConstituentaProps {
export function SelectConstituenta({ export function SelectConstituenta({
items, items,
placeholder = 'Выберите конституенту', placeholder = 'Выбор конституенты',
...restProps ...restProps
}: SelectConstituentaProps) { }: SelectConstituentaProps) {
return ( return (

View File

@ -67,7 +67,7 @@ export function TabTemplate() {
noBorder noBorder
noSearch noSearch
clearable clearable
placeholder='Выберите категорию' placeholder='Категория'
className='grow' className='grow'
idFunc={cst => String(cst.id)} idFunc={cst => String(cst.id)}
labelValueFunc={cst => cst.term_raw} labelValueFunc={cst => cst.term_raw}

View File

@ -63,14 +63,15 @@ export function EditorRSFormCard() {
<EditorLibraryItem schema={schema} isAttachedToOSS={isAttachedToOSS} /> <EditorLibraryItem schema={schema} isAttachedToOSS={isAttachedToOSS} />
</div> </div>
<RSFormStats <aside
className={clsx( className={clsx(
'w-80 md:w-56 mt-3 md:mt-8 mx-auto md:ml-5 md:mr-0', 'w-80 md:w-56 mt-3 md:mt-8 mx-auto md:ml-5 md:mr-0',
'cc-animate-sidebar', 'cc-animate-sidebar',
showRSFormStats ? 'max-w-full' : 'opacity-0 max-w-0' showRSFormStats ? 'max-w-full' : 'opacity-0 max-w-0'
)} )}
stats={schema.stats} >
/> <RSFormStats stats={schema.stats} />
</aside>
</div> </div>
); );
} }

View File

@ -31,12 +31,7 @@ function compareUsers(a: IUserInfo, b: IUserInfo) {
return a.id - b.id; return a.id - b.id;
} }
export function SelectUser({ export function SelectUser({ filter, noAnonymous, placeholder = 'Выбор пользователя', ...restProps }: SelectUserProps) {
filter,
noAnonymous,
placeholder = 'Выберите пользователя',
...restProps
}: SelectUserProps) {
const { users } = useUsers(); const { users } = useUsers();
const getUserLabel = useLabelUser(); const getUserLabel = useLabelUser();

View File

@ -151,7 +151,7 @@
@utility cc-animate-panel { @utility cc-animate-panel {
transition-property: translate, opacity; transition-property: translate, opacity;
transition-timing-function: var(--ease-bezier); transition-timing-function: var(--ease-bezier);
transition-duration: var(--duration-transform); transition-duration: var(--duration-move);
} }
@utility cc-animate-position { @utility cc-animate-position {