B: Small UI fixes

This commit is contained in:
Ivan 2025-07-29 22:41:57 +03:00
parent eedeba0fc8
commit ceacd900c6
2 changed files with 10 additions and 9 deletions

View File

@ -31,7 +31,7 @@ interface ToolbarGraphSelectionProps extends Styling {
export function ToolbarGraphSelection({ export function ToolbarGraphSelection({
className, className,
graph, graph,
value: selected, value,
isCore, isCore,
isInherited, isInherited,
isCrucial, isCrucial,
@ -40,7 +40,7 @@ export function ToolbarGraphSelection({
}: ToolbarGraphSelectionProps) { }: ToolbarGraphSelectionProps) {
const selectedMenu = useDropdown(); const selectedMenu = useDropdown();
const groupMenu = useDropdown(); const groupMenu = useDropdown();
const emptySelection = selected.length === 0; const emptySelection = value.length === 0;
function handleSelectReset() { function handleSelectReset() {
onChange([]); onChange([]);
@ -68,31 +68,31 @@ export function ToolbarGraphSelection({
} }
function handleExpandOutputs() { function handleExpandOutputs() {
onChange([...selected, ...graph.expandOutputs(selected)]); onChange([...value, ...graph.expandOutputs(value)]);
} }
function handleExpandInputs() { function handleExpandInputs() {
onChange([...selected, ...graph.expandInputs(selected)]); onChange([...value, ...graph.expandInputs(value)]);
} }
function handleSelectMaximize() { function handleSelectMaximize() {
selectedMenu.hide(); selectedMenu.hide();
onChange(graph.maximizePart(selected)); onChange(graph.maximizePart(value));
} }
function handleSelectInvert() { function handleSelectInvert() {
selectedMenu.hide(); selectedMenu.hide();
onChange([...graph.nodes.keys()].filter(item => !selected.includes(item))); onChange([...graph.nodes.keys()].filter(item => !value.includes(item)));
} }
function handleSelectAllInputs() { function handleSelectAllInputs() {
selectedMenu.hide(); selectedMenu.hide();
onChange([...graph.expandInputs(selected)]); onChange([...value, ...graph.expandInputs(value)]);
} }
function handleSelectAllOutputs() { function handleSelectAllOutputs() {
selectedMenu.hide(); selectedMenu.hide();
onChange([...graph.expandOutputs(selected)]); onChange([...value, ...graph.expandOutputs(value)]);
} }
return ( return (
@ -166,7 +166,7 @@ export function ToolbarGraphSelection({
icon={<IconGroupSelection size='1.25rem' className='icon-primary' />} icon={<IconGroupSelection size='1.25rem' className='icon-primary' />}
onClick={groupMenu.toggle} onClick={groupMenu.toggle}
/> />
<Dropdown isOpen={groupMenu.isOpen} className='-translate-x-1/2'> <Dropdown isOpen={groupMenu.isOpen} stretchLeft>
<DropdownButton <DropdownButton
text='ядро' text='ядро'
title='Выделить ядро' title='Выделить ядро'

View File

@ -36,6 +36,7 @@ export function DlgEditCst() {
target: target.id, target: target.id,
item_data: { item_data: {
alias: target.alias, alias: target.alias,
crucial: target.crucial,
cst_type: target.cst_type, cst_type: target.cst_type,
convention: target.convention, convention: target.convention,
definition_formal: target.definition_formal, definition_formal: target.definition_formal,