Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(floating): mv all floating components to same API #6212

Merged
merged 3 commits into from
Dec 6, 2023

Commits on Dec 6, 2023

  1. refactor(floating): mv all floating components to same API

    h2. ~~`Tooltip`~~ -> [OnboardingTooltip](#/OnboardingTooltip)
    
    ```diff
    <OnboardingTooltip
    - isShown
    + isShown
    
    - alignX="bottom"
    - alignY="left"
    + placement="bottom-start"
    
    - offsetX={0}
    + offsetByCrossAxis={0}
    
    - offsetY={0}
    + offsetByMainAxis={0}
    
    - cornerOffset={0}
    - cornerAbsoluteOffset={0}
    + arrowCornerOffset={0}
    + arrowCornerAbsoluteOffset={0}
    >
      <div>Target</div>
    </OnboardingTooltip>
    ```
    
    h2. ~~`TextTooltip`~~ -> [Tooltip](#/Tooltip)
    
    ```diff
    <Tooltip
    - autoUpdateOnTargetResize
    - customMiddlewares
    - renderContent
    - getRef
    
    - offsetSkidding={0}
    + offsetByCrossAxis={0}
    
    - offsetDistance={0}
    + offsetByMainAxis={0}
    
    - shownDelay={0}
    - hideDelay={10}
    + hoverDelay={[0, 10]}
    
    - forcePortal
    + usePortal
    
    - portalRoot={someHTMLElement}
    + usePortal={someHTMLElement}
    >
      <div>Target</div>
    </Tooltip>
    ```
    
    h1. ⚠️ Поправить в migration_v6.md
    
    h2. [Popper](#/Popper)
    
    ```diff
    <Popper
    - renderContent
    
    - arrowClassName=""
    + arrowProps={{ iconClassName: "" }}
    
    - offsetDistance={0}
    + offsetByMainAxis={0}
    
    - offsetSkidding={0}
    + offsetByCrossAxis={0}
    
    - onPlacementChange={({ placement }) => {}}
    + onPlacementChange={(placement) => {}}
    
    - forcePortal
    + usePortal
    
    - portalRoot={someHTMLElement}
    + usePortal={someHTMLElement}
    />
      <div>Target</div>
    </Popper>
    ```
    
    - `onPlacementChange` теперь вызывается только в случае, если `Popper` подобрал оптимальный
      `placement` вместо пользовательского.
    - `renderContent` удалён в пользу `children`. Раньше из `renderContent` можно было получить
      `className`, который задаёт `Popper`, сейчас этот `className` пустой.
    - `targetRef` теперь умеет принимать `VirtualElement`.
    - `arrowProps` принимает атрибуты `HTMLDivElement`, а также `iconStyle` и `iconClassName`.
    inomdzhon committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    887a298 View commit details
    Browse the repository at this point in the history
  2. review: fix arrow offset property

    - Заменил `arrowCornerOffset` на `arrowOffset`.
    - Заменил `arrowCornerAbsoluteOffset` на `isStaticArrowOffset`.
    - Переименовал PopperArrow на FloatingArrow
    - Заменил UseFloatingMiddleware для смещения стрелки на параметр
       в FloatingArrow.
    inomdzhon committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    0236ee8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    42744a7 View commit details
    Browse the repository at this point in the history