From 81fa0c57966d6b9324b10fcb85e0a265af774f2b Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Fri, 7 Mar 2025 20:38:40 +0300 Subject: [PATCH] F: Refactor z-index and stacking --- .../src/components/Container/Overlay.tsx | 7 +- .../src/components/Container/Tooltip.tsx | 1 + .../src/components/Dropdown/Dropdown.tsx | 1 + .../src/components/Input/SearchBar.tsx | 11 +-- .../src/components/Input/SelectTree.tsx | 17 ++-- .../src/components/Modal/ModalBackdrop.tsx | 4 +- .../src/components/Modal/ModalForm.tsx | 23 +++-- .../src/components/Modal/ModalLoader.tsx | 6 +- .../src/components/Modal/ModalView.tsx | 21 ++--- .../features/help/components/BadgeHelp.tsx | 8 +- .../help/pages/ManualsPage/TopicsDropdown.tsx | 2 +- .../library/components/EditorLibraryItem.tsx | 34 ++++---- .../library/components/PickSchema.tsx | 2 +- .../components/SelectLocationContext.tsx | 2 +- .../library/components/SelectLocationHead.tsx | 2 +- .../library/components/ToolbarItemAccess.tsx | 2 +- .../library/dialogs/DlgCloneLibraryItem.tsx | 2 +- .../pages/CreateItemPage/FormCreateItem.tsx | 8 +- .../library/pages/LibraryPage/LibraryPage.tsx | 15 +--- .../pages/LibraryPage/ToolbarSearch.tsx | 2 +- .../pages/OssPage/EditorOssCard/FormOSS.tsx | 2 +- .../pages/OssPage/EditorOssGraph/OssFlow.tsx | 2 +- .../OssPage/EditorOssGraph/graph/NodeCore.tsx | 40 ++++----- .../features/oss/pages/OssPage/OssTabs.tsx | 23 +++-- .../rsform/dialogs/DlgShowAST/DlgShowAST.tsx | 10 +-- .../EditorConstituenta/EditorConstituenta.tsx | 74 ++++++----------- .../EditorConstituenta/EditorControls.tsx | 2 +- .../EditorConstituenta/FormConstituenta.tsx | 27 ++++-- .../EditorRSExpression/EditorRSExpression.tsx | 27 ++---- .../EditorRSExpression/StatusBar.tsx | 66 ++++++++------- .../EditorRSFormCard/EditorRSFormCard.tsx | 32 +++---- .../EditorRSFormCard/FormRSForm.tsx | 2 +- .../RSFormPage/EditorRSList/EditorRSList.tsx | 65 +++++++-------- .../EditorTermGraph/GraphSelectors.tsx | 2 +- .../EditorTermGraph/SchemasGuide.tsx | 1 - .../RSFormPage/EditorTermGraph/ViewHidden.tsx | 21 +++-- .../rsform/pages/RSFormPage/RSTabs.tsx | 83 ++++++++++--------- .../users/pages/RegisterPage/FormSignup.tsx | 18 ++-- rsconcept/frontend/src/index.css | 2 - 39 files changed, 317 insertions(+), 352 deletions(-) diff --git a/rsconcept/frontend/src/components/Container/Overlay.tsx b/rsconcept/frontend/src/components/Container/Overlay.tsx index 2e0083c4..f816675d 100644 --- a/rsconcept/frontend/src/components/Container/Overlay.tsx +++ b/rsconcept/frontend/src/components/Container/Overlay.tsx @@ -15,6 +15,7 @@ interface OverlayProps extends Styling { /** * Displays a transparent overlay over the main content. + * Note: Overlay should be inside a relative container. */ export function Overlay({ children, @@ -24,10 +25,8 @@ export function Overlay({ ...restProps }: React.PropsWithChildren) { return ( -
-
- {children} -
+
+ {children}
); } diff --git a/rsconcept/frontend/src/components/Container/Tooltip.tsx b/rsconcept/frontend/src/components/Container/Tooltip.tsx index c45988e4..d76fd948 100644 --- a/rsconcept/frontend/src/components/Container/Tooltip.tsx +++ b/rsconcept/frontend/src/components/Container/Tooltip.tsx @@ -39,6 +39,7 @@ export function Tooltip({ delayHide={100} opacity={1} className={clsx( + 'relative', 'max-h-[calc(100svh-6rem)]', 'overflow-y-auto overflow-x-hidden sm:overflow-hidden overscroll-contain', 'border shadow-md', diff --git a/rsconcept/frontend/src/components/Dropdown/Dropdown.tsx b/rsconcept/frontend/src/components/Dropdown/Dropdown.tsx index 8250e1d6..63c5f004 100644 --- a/rsconcept/frontend/src/components/Dropdown/Dropdown.tsx +++ b/rsconcept/frontend/src/components/Dropdown/Dropdown.tsx @@ -23,6 +23,7 @@ interface DropdownProps extends Styling { /** * Animated list of children with optional positioning and visibility control. + * Note: Dropdown should be inside a relative container. */ export function Dropdown({ isOpen, diff --git a/rsconcept/frontend/src/components/Input/SearchBar.tsx b/rsconcept/frontend/src/components/Input/SearchBar.tsx index 6c364244..aeada2ed 100644 --- a/rsconcept/frontend/src/components/Input/SearchBar.tsx +++ b/rsconcept/frontend/src/components/Input/SearchBar.tsx @@ -1,6 +1,5 @@ import clsx from 'clsx'; -import { Overlay } from '@/components/Container'; import { IconSearch } from '@/components/Icons'; import { type Styling } from '@/components/props'; @@ -35,15 +34,17 @@ export function SearchBar({ noIcon, onChangeQuery, noBorder, + className, placeholder = 'Поиск', ...restProps }: SearchBarProps) { return ( -
+
{!noIcon ? ( - - - + ) : null} ({
({ }} > {foldable.has(item) ? ( - - : } - onClick={event => handleClickFold(event, item, folded.includes(item))} - /> - + : } + onClick={event => handleClickFold(event, item, folded.includes(item))} + /> ) : null} {getParent(item) === item ? getLabel(item) : `- ${getLabel(item).toLowerCase()}`}
diff --git a/rsconcept/frontend/src/components/Modal/ModalBackdrop.tsx b/rsconcept/frontend/src/components/Modal/ModalBackdrop.tsx index 1fa5f8e6..4d9a74c1 100644 --- a/rsconcept/frontend/src/components/Modal/ModalBackdrop.tsx +++ b/rsconcept/frontend/src/components/Modal/ModalBackdrop.tsx @@ -9,9 +9,9 @@ interface ModalBackdropProps { export function ModalBackdrop({ onHide }: ModalBackdropProps) { return ( <> -
+
diff --git a/rsconcept/frontend/src/components/Modal/ModalForm.tsx b/rsconcept/frontend/src/components/Modal/ModalForm.tsx index bb521091..1958881e 100644 --- a/rsconcept/frontend/src/components/Modal/ModalForm.tsx +++ b/rsconcept/frontend/src/components/Modal/ModalForm.tsx @@ -10,7 +10,6 @@ import { useDialogsStore } from '@/stores/dialogs'; import { PARAMETER } from '@/utils/constants'; import { prepareTooltip } from '@/utils/utils'; -import { Overlay } from '../Container'; import { Button, MiniButton, SubmitButton } from '../Control'; import { IconClose } from '../Icons'; import { type Styling } from '../props'; @@ -89,12 +88,12 @@ export function ModalForm({ } return ( -
+
) : null} - - } - className='float-right mt-2 mr-2' - onClick={handleCancel} - /> - + } + className='float-right mt-2 mr-2' + onClick={handleCancel} + /> {header ?

{header}

: null} @@ -133,7 +130,7 @@ export function ModalForm({ {children}
-
+
-
-
+
+
+
+
) : null} - - } - className='float-right mt-2 mr-2' - onClick={hideDialog} - /> - + } + className='float-right mt-2 mr-2' + onClick={hideDialog} + /> {header ?

{header}

: null} @@ -77,7 +74,7 @@ export function ModalView({ {children}
-
+
diff --git a/rsconcept/frontend/src/features/help/components/BadgeHelp.tsx b/rsconcept/frontend/src/features/help/components/BadgeHelp.tsx index eedae3a8..6861f01b 100644 --- a/rsconcept/frontend/src/features/help/components/BadgeHelp.tsx +++ b/rsconcept/frontend/src/features/help/components/BadgeHelp.tsx @@ -39,12 +39,10 @@ export function BadgeHelp({ topic, padding = 'p-1', ...restProps }: BadgeHelpPro return (
- + }> -
event.stopPropagation()}> -
- -
+
event.stopPropagation()}> +
diff --git a/rsconcept/frontend/src/features/help/pages/ManualsPage/TopicsDropdown.tsx b/rsconcept/frontend/src/features/help/pages/ManualsPage/TopicsDropdown.tsx index b5688f6e..f0b22c59 100644 --- a/rsconcept/frontend/src/features/help/pages/ManualsPage/TopicsDropdown.tsx +++ b/rsconcept/frontend/src/features/help/pages/ManualsPage/TopicsDropdown.tsx @@ -33,7 +33,7 @@ export function TopicsDropdown({ activeTopic, onChangeTopic }: TopicsDropdownPro className={clsx( 'absolute left-0 w-[13.5rem]', // prettier: split-lines 'flex flex-col', - 'z-modal-tooltip', + 'z-topmost', 'text-xs sm:text-sm', 'select-none', { diff --git a/rsconcept/frontend/src/features/library/components/EditorLibraryItem.tsx b/rsconcept/frontend/src/features/library/components/EditorLibraryItem.tsx index f8dc01eb..55a50516 100644 --- a/rsconcept/frontend/src/features/library/components/EditorLibraryItem.tsx +++ b/rsconcept/frontend/src/features/library/components/EditorLibraryItem.tsx @@ -5,7 +5,7 @@ import { urls, useConceptNavigation } from '@/app'; import { useLabelUser, useRoleStore, UserRole } from '@/features/users'; import { InfoUsers, SelectUser } from '@/features/users/components'; -import { Overlay, Tooltip } from '@/components/Container'; +import { Tooltip } from '@/components/Container'; import { MiniButton } from '@/components/Control'; import { useDropdown } from '@/components/Dropdown'; import { @@ -83,7 +83,7 @@ export function EditorLibraryItem({ schema, isAttachedToOSS }: EditorLibraryItem return (
-
+
- {ownerSelector.isOpen ? ( - - {ownerSelector.isOpen ? ( +
+ {ownerSelector.isOpen ? ( +
- ) : null} - - ) : null} - } - value={getUserLabel(schema.owner)} - title={isAttachedToOSS ? 'Владелец наследуется от ОСС' : 'Владелец'} - onClick={ownerSelector.toggle} - disabled={isModified || isProcessing || isAttachedToOSS || role < UserRole.OWNER} - /> +
+ ) : null} + } + value={getUserLabel(schema.owner)} + title={isAttachedToOSS ? 'Владелец наследуется от ОСС' : 'Владелец'} + onClick={ownerSelector.toggle} + disabled={isModified || isProcessing || isAttachedToOSS || role < UserRole.OWNER} + /> +
- + }> diff --git a/rsconcept/frontend/src/features/library/components/PickSchema.tsx b/rsconcept/frontend/src/features/library/components/PickSchema.tsx index 9276aad0..c95e90ad 100644 --- a/rsconcept/frontend/src/features/library/components/PickSchema.tsx +++ b/rsconcept/frontend/src/features/library/components/PickSchema.tsx @@ -120,7 +120,7 @@ export function PickSchema({ className='mt-1' onClick={() => locationMenu.toggle()} /> - + - + {Object.values(LocationHead) .filter(head => !excluded.includes(head)) .map((head, index) => { diff --git a/rsconcept/frontend/src/features/library/components/ToolbarItemAccess.tsx b/rsconcept/frontend/src/features/library/components/ToolbarItemAccess.tsx index d138a0e4..33fb84c4 100644 --- a/rsconcept/frontend/src/features/library/components/ToolbarItemAccess.tsx +++ b/rsconcept/frontend/src/features/library/components/ToolbarItemAccess.tsx @@ -42,7 +42,7 @@ export function ToolbarItemAccess({ } return ( - +