mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Prevent text selections on control elements
This commit is contained in:
parent
d50afb290e
commit
101631a8be
|
@ -27,7 +27,7 @@ function Button({
|
|||
disabled={disabled ?? loading}
|
||||
onClick={onClick}
|
||||
title={tooltip}
|
||||
className={`inline-flex items-center gap-2 align-middle justify-center ${padding} ${borderClass} ${colorClass} ${widthClass} ${cursor}`}
|
||||
className={`inline-flex items-center gap-2 align-middle justify-center select-none ${padding} ${borderClass} ${colorClass} ${widthClass} ${cursor}`}
|
||||
{...props}
|
||||
>
|
||||
{icon && <span>{icon}</span>}
|
||||
|
|
|
@ -8,7 +8,7 @@ interface SubmitButtonProps {
|
|||
function SubmitButton({ text = 'ОК', icon, disabled, loading = false }: SubmitButtonProps) {
|
||||
return (
|
||||
<button type='submit'
|
||||
className={`px-4 py-2 inline-flex items-center gap-2 align-middle justify-center font-bold disabled:cursor-not-allowed border rounded clr-btn-primary ${loading ? ' cursor-progress' : ''}`}
|
||||
className={`px-4 py-2 inline-flex items-center gap-2 align-middle justify-center font-bold select-none disabled:cursor-not-allowed border rounded clr-btn-primary ${loading ? ' cursor-progress' : ''}`}
|
||||
disabled={disabled ?? loading}
|
||||
>
|
||||
{icon && <span>{icon}</span>}
|
||||
|
|
|
@ -10,7 +10,7 @@ function Footer() {
|
|||
<div className='px-4 underline whitespace-nowrap'>
|
||||
<Link to='/manuals' tabIndex={-1}>Справка</Link> <br/>
|
||||
<Link to='/library?filter=common' tabIndex={-1}>Библиотека КС</Link> <br/>
|
||||
<a href={urls.gitrepo} className='flex'>
|
||||
<a href={urls.gitrepo} className='flex' tabIndex={-1}>
|
||||
<GithubIcon />
|
||||
<span className='ml-1'>Репозиторий</span>
|
||||
</a>
|
||||
|
|
|
@ -35,7 +35,7 @@ function Navigation () {
|
|||
</button>}
|
||||
{!noNavigation &&
|
||||
<div className='pr-6 pl-2 py-2.5 h-[4rem] flex items-center justify-between border-b-2 clr-nav rounded-none'>
|
||||
<div className='flex items-start justify-start '>
|
||||
<div className='flex items-start justify-start select-none'>
|
||||
<Logo title='КонцептПортал' />
|
||||
<TopSearch />
|
||||
</div>
|
||||
|
|
|
@ -247,7 +247,7 @@ function EditorItems({ onOpenEdit, onCreateCst, onDeleteCst }: EditorItemsProps)
|
|||
return (
|
||||
<div className='w-full'>
|
||||
<div
|
||||
className={'flex justify-start w-full gap-1 px-2 py-1 border-y items-center h-[2.2rem] clr-app' +
|
||||
className={'flex justify-start w-full gap-1 px-2 py-1 border-y items-center h-[2.2rem] select-none clr-app' +
|
||||
(!noNavigation ? ' sticky z-10 top-[0rem]' : ' sticky z-10 top-[0rem]')}
|
||||
>
|
||||
<div className='mr-3 whitespace-nowrap'>
|
||||
|
|
|
@ -212,6 +212,11 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
focusOnSelect: false
|
||||
});
|
||||
|
||||
const allSelected: string[] = useMemo(
|
||||
() => {
|
||||
return [ ... selectedDismissed.map(id => String(id)), ... selections];
|
||||
}, [selectedDismissed, selections]);
|
||||
|
||||
const handleRecreate = useCallback(
|
||||
() => {
|
||||
graphRef.current?.resetControls();
|
||||
|
@ -239,6 +244,12 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
if (onNodeClick) onNodeClick(node);
|
||||
}, [onNodeClick, selections, onOpenEdit]);
|
||||
|
||||
const handleCanvasClick = useCallback(
|
||||
(event: MouseEvent) => {
|
||||
setSelectedDismissed([]);
|
||||
if (onCanvasClick) onCanvasClick(event);
|
||||
}, [onCanvasClick]);
|
||||
|
||||
function getOptions() {
|
||||
return {
|
||||
noHermits: noHermits,
|
||||
|
@ -301,7 +312,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
initial={getOptions()}
|
||||
onConfirm={handleChangeOptions}
|
||||
/>}
|
||||
<div className='flex flex-col py-2 border-t border-r w-[14.7rem] pr-2 text-sm' style={{height: canvasHeight}}>
|
||||
<div className='flex flex-col py-2 border-t border-r w-[14.7rem] pr-2 text-sm select-none' style={{height: canvasHeight}}>
|
||||
{hoverCst &&
|
||||
<div className='relative'>
|
||||
<InfoConstituenta
|
||||
|
@ -309,6 +320,16 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
className='absolute top-0 left-0 z-50 w-[25rem] min-h-[11rem] overflow-y-auto border h-fit clr-app px-3'
|
||||
/>
|
||||
</div>}
|
||||
|
||||
<div className='mr-3 whitespace-nowrap'>
|
||||
Выбраны
|
||||
<span className='ml-2'>
|
||||
<b>{allSelected.length}</b> из {schema?.stats?.count_all ?? 0}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Divider margins='mt-3 mb-2' />
|
||||
|
||||
<div className='flex items-center w-full gap-1'>
|
||||
<Button
|
||||
icon={<FilterCogIcon size={7} />}
|
||||
|
@ -421,7 +442,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
|
|||
selections={selections}
|
||||
actives={actives}
|
||||
onNodeClick={handleNodeClick}
|
||||
onCanvasClick={onCanvasClick}
|
||||
onCanvasClick={handleCanvasClick}
|
||||
onNodePointerOver={handleHoverIn}
|
||||
onNodePointerOut={handleHoverOut}
|
||||
cameraMode={ orbit ? 'orbit' : is3D ? 'rotate' : 'pan'}
|
||||
|
|
|
@ -223,7 +223,7 @@ function RSTabs() {
|
|||
defaultFocus={true}
|
||||
selectedTabClassName='font-bold'
|
||||
>
|
||||
<TabList className='flex items-start w-fit clr-bg-pop'>
|
||||
<TabList className='flex items-start select-none w-fit clr-bg-pop'>
|
||||
<RSTabsMenu
|
||||
onDestroy={onDestroySchema}
|
||||
showCloneDialog={() => setShowClone(true)}
|
||||
|
|
|
@ -24,7 +24,7 @@ function StatusBar({ isModified, constituenta, parseData }: StatusBarProps) {
|
|||
const data = mapStatusInfo.get(status)!;
|
||||
return (
|
||||
<div title={data.tooltip}
|
||||
className={`text-sm h-[1.6rem] w-[10rem] font-semibold inline-flex border items-center justify-center align-middle ${data.color}`}>
|
||||
className={`text-sm h-[1.6rem] w-[10rem] font-semibold inline-flex border items-center select-none justify-center align-middle ${data.color}`}>
|
||||
Статус: [ {data.text} ]
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -158,7 +158,7 @@ function ViewSideConstituents({ expression, baseHeight, activeID, onOpenEdit }:
|
|||
onChange={setFilterMatch}
|
||||
/>
|
||||
<input type='text'
|
||||
className='w-full px-2 bg-white outline-none hover:text-clip clr-bg-pop clr-border'
|
||||
className='w-full px-2 bg-white outline-none select-none hover:text-clip clr-bg-pop clr-border'
|
||||
placeholder='наберите текст фильтра'
|
||||
value={filterText}
|
||||
onChange={event => setFilterText(event.target.value)}
|
||||
|
|
Loading…
Reference in New Issue
Block a user