@zat-design/sisyphus-react 4.5.8-beta.3 → 4.5.8-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable no-spaced-func */
3
3
  import { createContext, useMemo, useRef, useCallback, useLayoutEffect, useState } from 'react';
4
4
  import classNames from 'classnames';
5
- import { useSetState, useToggle, useDeepCompareEffect, useScroll } from 'ahooks';
5
+ import { useSetState, useToggle, useDeepCompareEffect } from 'ahooks';
6
6
  import { ProWaterMark } from "../index";
7
7
  import { ProCollapse, ProFooter, ProHeader } from "./components";
8
8
  import { Header, Notice, Menu } from "./components/Layout/index";
@@ -82,11 +82,6 @@ const ProLayout = props => {
82
82
  notice: 0,
83
83
  tabsBar: 0
84
84
  });
85
-
86
- // 仅 tabs 模式需要感知滚动位置(用于控制右上角圆弧伪元素的显隐)
87
- // 非 tabs 模式传 null,useScroll 不挂载监听器
88
- const scrollPos = useScroll(isTabsLayout ? document : null);
89
- const isAtTop = (scrollPos?.top ?? 0) === 0;
90
85
  const [{
91
86
  notice,
92
87
  menus,
@@ -324,7 +319,7 @@ const ProLayout = props => {
324
319
  ...noticeProps
325
320
  }), /*#__PURE__*/_jsx("div", {
326
321
  ref: setTabsBarElRef,
327
- className: `pro-layout-tabs-bar-wrapper${hasTabs ? ' tabs-visible' : ''}${collapsed ? ' tabs-menu-open' : ''}${isAtTop ? ' tabs-at-top' : ''}`,
322
+ className: `pro-layout-tabs-bar-wrapper${hasTabs ? ' tabs-visible' : ''}${collapsed ? ' tabs-menu-open' : ''}`,
328
323
  style: {
329
324
  marginTop: effectiveHeaderHeight + noticeHeight
330
325
  }
@@ -322,34 +322,14 @@
322
322
  grid-template-rows: 1fr;
323
323
  }
324
324
 
325
- // 页面顶部的圆角会向内容区延伸,此时放到 content 层级下方,
326
- // 让内容区内的 ProStep 能完整遮住圆角;滚动后恢复上方的 89 保持 sticky 遮挡。
327
- &.tabs-at-top {
328
- z-index: 9;
329
- }
330
-
331
325
  // Grid 子元素需要 overflow: hidden 才能实现 0fr 收起
332
326
  > * {
333
327
  overflow: hidden;
334
328
  min-height: 0;
335
329
  }
336
330
 
337
- // 右下角圆弧 + 横线截断:仅在页面顶部(tabs-at-top)时显示
338
- // 滚动后 sticky 偏移导致背景错位,此时隐藏伪元素避免视觉异常
339
- &.tabs-visible.tabs-at-top::after {
340
- content: '';
341
- position: absolute;
342
- bottom: calc(-1 * var(--zaui-border-radius, 8px));
343
- right: 0;
344
- width: var(--zaui-border-radius, 8px);
345
- height: var(--zaui-border-radius, 8px);
346
- border-right: 1px solid rgb(235 236 238);
347
- border-top-right-radius: var(--zaui-border-radius, 8px);
348
- pointer-events: none;
349
- }
350
-
351
- // 遮住 ant-tabs-nav::before 横线的右端(圆角半径宽度),使其在圆弧起点处截止
352
- &.tabs-visible.tabs-at-top::before {
331
+ // 稳定遮住 ant-tabs-nav::before 横线的右端,使其在内容区圆弧起点处截止
332
+ &.tabs-visible::before {
353
333
  content: '';
354
334
  position: absolute;
355
335
  bottom: 0;
@@ -392,6 +372,20 @@
392
372
  padding-top: var(--zaui-space-size-md, 16px);
393
373
  border-top-right-radius: var(--zaui-border-radius, 8px);
394
374
 
375
+ // 圆弧由内容区独立绘制并随内容滚动;sticky Tab 栏始终保持在其上方。
376
+ // ::before 在子内容之前绘制,ProStep / ProHeader 仍可完整覆盖圆弧。
377
+ &::before {
378
+ content: '';
379
+ position: absolute;
380
+ top: 0;
381
+ right: 0;
382
+ width: var(--zaui-border-radius, 8px);
383
+ height: var(--zaui-border-radius, 8px);
384
+ border-right: 1px solid rgb(235 236 238);
385
+ border-top-right-radius: var(--zaui-border-radius, 8px);
386
+ pointer-events: none;
387
+ }
388
+
395
389
  .pro-layout-tabs-content {
396
390
  > .tab-pane {
397
391
  // ProStep 以 ProHeader 开头时,去掉 tabs 内容区的顶部/右侧外层留白。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "4.5.8-beta.3",
3
+ "version": "4.5.8-beta.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",