@sia.soul/sia-react-ui 0.1.129 → 0.1.131
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.
- package/dist/{chunk-MQ6SYFJW.js → chunk-OHIBJFX5.js} +13 -5
- package/dist/{core-CI-qG-Xf.d.cts → core-DUmn3A2b.d.cts} +6 -5
- package/dist/{core-CZLIv1sc.d.ts → core-DoyeSoBN.d.ts} +6 -5
- package/dist/core.cjs +13 -5
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +33 -6
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +21 -2
- package/package.json +1 -1
|
@@ -262,7 +262,7 @@ function Tabs({
|
|
|
262
262
|
tabBarTitle,
|
|
263
263
|
tabBarExtraContent,
|
|
264
264
|
contentGap,
|
|
265
|
-
destroyInactiveTabPane =
|
|
265
|
+
destroyInactiveTabPane = false,
|
|
266
266
|
closable = false,
|
|
267
267
|
onEdit,
|
|
268
268
|
tabContextMenu,
|
|
@@ -317,7 +317,8 @@ function Tabs({
|
|
|
317
317
|
entries.forEach((entry) => observer.observe(entry));
|
|
318
318
|
return () => observer.disconnect();
|
|
319
319
|
}, [items, type, size, closable, resolvedOrientation, tabBarTitle, tabBarExtraContent]);
|
|
320
|
-
const [
|
|
320
|
+
const [settledContentKey, setSettledContentKey] = useState3(selectedKey);
|
|
321
|
+
const [visitedKeys, setVisitedKeys] = useState3(() => /* @__PURE__ */ new Set([selectedKey]));
|
|
321
322
|
const settledKeyRef = useRef2(selectedKey);
|
|
322
323
|
const afterChangeRef = useRef2(onAfterChange);
|
|
323
324
|
useLayoutEffect2(() => {
|
|
@@ -362,7 +363,7 @@ function Tabs({
|
|
|
362
363
|
const animations = indicator?.getAnimations() ?? [];
|
|
363
364
|
const complete = () => {
|
|
364
365
|
if (cancelled) return;
|
|
365
|
-
|
|
366
|
+
setSettledContentKey(selectedKey);
|
|
366
367
|
if (settledKeyRef.current !== selectedKey) {
|
|
367
368
|
settledKeyRef.current = selectedKey;
|
|
368
369
|
afterChangeRef.current?.(selectedKey);
|
|
@@ -378,7 +379,14 @@ function Tabs({
|
|
|
378
379
|
cancelAnimationFrame(frame);
|
|
379
380
|
};
|
|
380
381
|
}, [selectedKey, type, deferContent]);
|
|
381
|
-
const contentKey = deferContent
|
|
382
|
+
const contentKey = deferContent && items.some((item) => item.key === settledContentKey) ? settledContentKey : selectedKey;
|
|
383
|
+
useLayoutEffect2(() => {
|
|
384
|
+
if (deferContent && contentKey !== settledContentKey) setSettledContentKey(contentKey);
|
|
385
|
+
setVisitedKeys((previous) => {
|
|
386
|
+
const next = new Set(items.filter((item) => item.key === contentKey || !destroyInactiveTabPane && previous.has(item.key)).map((item) => item.key));
|
|
387
|
+
return next.size === previous.size && [...next].every((key) => previous.has(key)) ? previous : next;
|
|
388
|
+
});
|
|
389
|
+
}, [contentKey, items, destroyInactiveTabPane, deferContent, settledContentKey]);
|
|
382
390
|
function selectTab(key) {
|
|
383
391
|
if (key === selectedKey) return;
|
|
384
392
|
if (activeKey === void 0) setInternalActiveKey(key);
|
|
@@ -493,7 +501,7 @@ function Tabs({
|
|
|
493
501
|
}, "aria-busy": deferContent && contentKey !== selectedKey || void 0, children: items.map((item) => {
|
|
494
502
|
const selected = item.key === contentKey;
|
|
495
503
|
if (destroyInactiveTabPane && !selected) return null;
|
|
496
|
-
if (
|
|
504
|
+
if (!selected && !visitedKeys.has(item.key)) return null;
|
|
497
505
|
return /* @__PURE__ */ jsx4(
|
|
498
506
|
"div",
|
|
499
507
|
{
|
|
@@ -756,7 +756,7 @@ interface TabItem {
|
|
|
756
756
|
key: string;
|
|
757
757
|
/** 展示给用户的名称,可传入文本或 React 节点。 */
|
|
758
758
|
label: ReactNode;
|
|
759
|
-
/**
|
|
759
|
+
/** 标签面板内容;默认首次激活时挂载,切走后隐藏并保留组件状态。启用 destroyInactiveTabPane 时切走后卸载。 */
|
|
760
760
|
children?: ReactNode;
|
|
761
761
|
/** 是否禁用交互。 */
|
|
762
762
|
disabled?: boolean;
|
|
@@ -790,7 +790,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
790
790
|
onChange?: (key: string) => void;
|
|
791
791
|
/** 选中框动画结束且目标面板获准显示时调用,参数为最终目标 key;首次渲染不调用,连续切换仅通知最终目标。无动画或系统减少动态效果时在下一帧完成,不等待面板数据请求;也适用于业务在 Tabs 外渲染内容或切换路由。 */
|
|
792
792
|
onAfterChange?: (key: string) => void;
|
|
793
|
-
/** 是否等选中框动画结束后再切换 items[].children,等待期间保留旧面板。默认 false,立即切换;true
|
|
793
|
+
/** 是否等选中框动画结束后再切换 items[].children,等待期间保留旧面板。默认 false,立即切换;true 时未访问的目标面板在动画结束后首次挂载,连续切换跳过未显示的中间目标。面板是否保留由 destroyInactiveTabPane 决定,与是否延迟无关。不能延迟父组件已执行的同步计算或 onChange 中的渲染,请将外部重内容更新放到 onAfterChange。 */
|
|
794
794
|
deferContent?: boolean;
|
|
795
795
|
/**
|
|
796
796
|
* 标签样式:line 线型、card 卡片、pill 胶囊、capsule 圆角胶囊、underline 紧凑下划线、tech 科技型、tech-line 折线科技型。
|
|
@@ -821,8 +821,9 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
821
821
|
/** 标签栏右侧额外操作 */
|
|
822
822
|
tabBarExtraContent?: ReactNode;
|
|
823
823
|
/**
|
|
824
|
-
*
|
|
825
|
-
*
|
|
824
|
+
* 是否卸载非激活面板。默认 false:未访问的面板首次激活时挂载,切走后隐藏并保留组件状态,切回时不重新挂载;不阻止 props、state 或 Context 更新引起的重新渲染。
|
|
825
|
+
* true 时切走后卸载,切回时重新挂载并执行初始化副作用。移除 items 中的标签或卸载 Tabs 时释放对应内容;状态保留要求标签 key 和内容组件类型稳定。仅管理 items[].children,不管理外部路由或内容。
|
|
826
|
+
* @defaultValue false
|
|
826
827
|
*/
|
|
827
828
|
destroyInactiveTabPane?: boolean;
|
|
828
829
|
/**
|
|
@@ -837,7 +838,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
837
838
|
/** 点击选项卡右键菜单时调用。 */
|
|
838
839
|
onTabContextMenuClick?: (info: TabsContextMenuClickInfo) => void;
|
|
839
840
|
}
|
|
840
|
-
/**
|
|
841
|
+
/** 选项卡组件;默认仅挂载首次激活的面板,切走后隐藏并保留,显式设置 destroyInactiveTabPane=true 可在切走后卸载。横向空间不足时,剩余标签收起到末尾的更多菜单,支持悬停或点击展开。设置确定高度或由父级弹性布局分配高度时,内容面板占满导航之外的剩余空间;未限定高度时按内容自然撑开。 */
|
|
841
842
|
declare function Tabs({ items, activeKey, defaultActiveKey, onChange, onAfterChange, deferContent, type, size, tabPosition, orientation, centered, tabBarTitle, tabBarExtraContent, contentGap, destroyInactiveTabPane, closable, onEdit, tabContextMenu, onTabContextMenuClick, className, ...props }: TabsProps): react.JSX.Element;
|
|
842
843
|
|
|
843
844
|
/** 打开下拉菜单的触发方式。 */
|
|
@@ -756,7 +756,7 @@ interface TabItem {
|
|
|
756
756
|
key: string;
|
|
757
757
|
/** 展示给用户的名称,可传入文本或 React 节点。 */
|
|
758
758
|
label: ReactNode;
|
|
759
|
-
/**
|
|
759
|
+
/** 标签面板内容;默认首次激活时挂载,切走后隐藏并保留组件状态。启用 destroyInactiveTabPane 时切走后卸载。 */
|
|
760
760
|
children?: ReactNode;
|
|
761
761
|
/** 是否禁用交互。 */
|
|
762
762
|
disabled?: boolean;
|
|
@@ -790,7 +790,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
790
790
|
onChange?: (key: string) => void;
|
|
791
791
|
/** 选中框动画结束且目标面板获准显示时调用,参数为最终目标 key;首次渲染不调用,连续切换仅通知最终目标。无动画或系统减少动态效果时在下一帧完成,不等待面板数据请求;也适用于业务在 Tabs 外渲染内容或切换路由。 */
|
|
792
792
|
onAfterChange?: (key: string) => void;
|
|
793
|
-
/** 是否等选中框动画结束后再切换 items[].children,等待期间保留旧面板。默认 false,立即切换;true
|
|
793
|
+
/** 是否等选中框动画结束后再切换 items[].children,等待期间保留旧面板。默认 false,立即切换;true 时未访问的目标面板在动画结束后首次挂载,连续切换跳过未显示的中间目标。面板是否保留由 destroyInactiveTabPane 决定,与是否延迟无关。不能延迟父组件已执行的同步计算或 onChange 中的渲染,请将外部重内容更新放到 onAfterChange。 */
|
|
794
794
|
deferContent?: boolean;
|
|
795
795
|
/**
|
|
796
796
|
* 标签样式:line 线型、card 卡片、pill 胶囊、capsule 圆角胶囊、underline 紧凑下划线、tech 科技型、tech-line 折线科技型。
|
|
@@ -821,8 +821,9 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
821
821
|
/** 标签栏右侧额外操作 */
|
|
822
822
|
tabBarExtraContent?: ReactNode;
|
|
823
823
|
/**
|
|
824
|
-
*
|
|
825
|
-
*
|
|
824
|
+
* 是否卸载非激活面板。默认 false:未访问的面板首次激活时挂载,切走后隐藏并保留组件状态,切回时不重新挂载;不阻止 props、state 或 Context 更新引起的重新渲染。
|
|
825
|
+
* true 时切走后卸载,切回时重新挂载并执行初始化副作用。移除 items 中的标签或卸载 Tabs 时释放对应内容;状态保留要求标签 key 和内容组件类型稳定。仅管理 items[].children,不管理外部路由或内容。
|
|
826
|
+
* @defaultValue false
|
|
826
827
|
*/
|
|
827
828
|
destroyInactiveTabPane?: boolean;
|
|
828
829
|
/**
|
|
@@ -837,7 +838,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
837
838
|
/** 点击选项卡右键菜单时调用。 */
|
|
838
839
|
onTabContextMenuClick?: (info: TabsContextMenuClickInfo) => void;
|
|
839
840
|
}
|
|
840
|
-
/**
|
|
841
|
+
/** 选项卡组件;默认仅挂载首次激活的面板,切走后隐藏并保留,显式设置 destroyInactiveTabPane=true 可在切走后卸载。横向空间不足时,剩余标签收起到末尾的更多菜单,支持悬停或点击展开。设置确定高度或由父级弹性布局分配高度时,内容面板占满导航之外的剩余空间;未限定高度时按内容自然撑开。 */
|
|
841
842
|
declare function Tabs({ items, activeKey, defaultActiveKey, onChange, onAfterChange, deferContent, type, size, tabPosition, orientation, centered, tabBarTitle, tabBarExtraContent, contentGap, destroyInactiveTabPane, closable, onEdit, tabContextMenu, onTabContextMenuClick, className, ...props }: TabsProps): react.JSX.Element;
|
|
842
843
|
|
|
843
844
|
/** 打开下拉菜单的触发方式。 */
|
package/dist/core.cjs
CHANGED
|
@@ -2328,7 +2328,7 @@ function Tabs({
|
|
|
2328
2328
|
tabBarTitle,
|
|
2329
2329
|
tabBarExtraContent,
|
|
2330
2330
|
contentGap,
|
|
2331
|
-
destroyInactiveTabPane =
|
|
2331
|
+
destroyInactiveTabPane = false,
|
|
2332
2332
|
closable = false,
|
|
2333
2333
|
onEdit,
|
|
2334
2334
|
tabContextMenu,
|
|
@@ -2383,7 +2383,8 @@ function Tabs({
|
|
|
2383
2383
|
entries.forEach((entry) => observer.observe(entry));
|
|
2384
2384
|
return () => observer.disconnect();
|
|
2385
2385
|
}, [items, type, size, closable, resolvedOrientation, tabBarTitle, tabBarExtraContent]);
|
|
2386
|
-
const [
|
|
2386
|
+
const [settledContentKey, setSettledContentKey] = (0, import_react11.useState)(selectedKey);
|
|
2387
|
+
const [visitedKeys, setVisitedKeys] = (0, import_react11.useState)(() => /* @__PURE__ */ new Set([selectedKey]));
|
|
2387
2388
|
const settledKeyRef = (0, import_react11.useRef)(selectedKey);
|
|
2388
2389
|
const afterChangeRef = (0, import_react11.useRef)(onAfterChange);
|
|
2389
2390
|
(0, import_react11.useLayoutEffect)(() => {
|
|
@@ -2428,7 +2429,7 @@ function Tabs({
|
|
|
2428
2429
|
const animations = indicator?.getAnimations() ?? [];
|
|
2429
2430
|
const complete = () => {
|
|
2430
2431
|
if (cancelled) return;
|
|
2431
|
-
|
|
2432
|
+
setSettledContentKey(selectedKey);
|
|
2432
2433
|
if (settledKeyRef.current !== selectedKey) {
|
|
2433
2434
|
settledKeyRef.current = selectedKey;
|
|
2434
2435
|
afterChangeRef.current?.(selectedKey);
|
|
@@ -2444,7 +2445,14 @@ function Tabs({
|
|
|
2444
2445
|
cancelAnimationFrame(frame);
|
|
2445
2446
|
};
|
|
2446
2447
|
}, [selectedKey, type, deferContent]);
|
|
2447
|
-
const contentKey = deferContent
|
|
2448
|
+
const contentKey = deferContent && items.some((item) => item.key === settledContentKey) ? settledContentKey : selectedKey;
|
|
2449
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
2450
|
+
if (deferContent && contentKey !== settledContentKey) setSettledContentKey(contentKey);
|
|
2451
|
+
setVisitedKeys((previous) => {
|
|
2452
|
+
const next = new Set(items.filter((item) => item.key === contentKey || !destroyInactiveTabPane && previous.has(item.key)).map((item) => item.key));
|
|
2453
|
+
return next.size === previous.size && [...next].every((key) => previous.has(key)) ? previous : next;
|
|
2454
|
+
});
|
|
2455
|
+
}, [contentKey, items, destroyInactiveTabPane, deferContent, settledContentKey]);
|
|
2448
2456
|
function selectTab(key) {
|
|
2449
2457
|
if (key === selectedKey) return;
|
|
2450
2458
|
if (activeKey === void 0) setInternalActiveKey(key);
|
|
@@ -2559,7 +2567,7 @@ function Tabs({
|
|
|
2559
2567
|
}, "aria-busy": deferContent && contentKey !== selectedKey || void 0, children: items.map((item) => {
|
|
2560
2568
|
const selected = item.key === contentKey;
|
|
2561
2569
|
if (destroyInactiveTabPane && !selected) return null;
|
|
2562
|
-
if (
|
|
2570
|
+
if (!selected && !visitedKeys.has(item.key)) return null;
|
|
2563
2571
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2564
2572
|
"div",
|
|
2565
2573
|
{
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, W as Input, X as InputProps, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, ad as Progress, ae as ProgressProps, af as ProgressStatus, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, av as TabItem, aw as Tabs, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, T as TagStatus, aF as TagVariant, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b6 as UploadProps, ba as UploadRequestOptions, be as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, W as Input, X as InputProps, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, ad as Progress, ae as ProgressProps, af as ProgressStatus, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, av as TabItem, aw as Tabs, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, T as TagStatus, aF as TagVariant, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b6 as UploadProps, ba as UploadRequestOptions, be as message } from './core-DUmn3A2b.cjs';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
3
3
|
export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-Y0e9kaxE.cjs';
|
|
4
4
|
import 'react';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, W as Input, X as InputProps, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, ad as Progress, ae as ProgressProps, af as ProgressStatus, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, av as TabItem, aw as Tabs, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, T as TagStatus, aF as TagVariant, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b6 as UploadProps, ba as UploadRequestOptions, be as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, W as Input, X as InputProps, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, ad as Progress, ae as ProgressProps, af as ProgressStatus, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, av as TabItem, aw as Tabs, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, T as TagStatus, aF as TagVariant, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b6 as UploadProps, ba as UploadRequestOptions, be as message } from './core-DoyeSoBN.js';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
3
3
|
export { e as Modal, d as ModalActionResult, M as ModalOpenConfig, f as ModalProps, g as ModalType, a as OverlayApiHandle, h as Select, S as SelectOption, c as SelectProps, j as SelectValue } from './Select-DeD4O8FL.js';
|
|
4
4
|
import 'react';
|
package/dist/core.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -12654,7 +12654,7 @@ function Tabs({
|
|
|
12654
12654
|
tabBarTitle,
|
|
12655
12655
|
tabBarExtraContent,
|
|
12656
12656
|
contentGap,
|
|
12657
|
-
destroyInactiveTabPane =
|
|
12657
|
+
destroyInactiveTabPane = false,
|
|
12658
12658
|
closable = false,
|
|
12659
12659
|
onEdit,
|
|
12660
12660
|
tabContextMenu,
|
|
@@ -12709,7 +12709,8 @@ function Tabs({
|
|
|
12709
12709
|
entries.forEach((entry) => observer.observe(entry));
|
|
12710
12710
|
return () => observer.disconnect();
|
|
12711
12711
|
}, [items, type, size, closable, resolvedOrientation, tabBarTitle, tabBarExtraContent]);
|
|
12712
|
-
const [
|
|
12712
|
+
const [settledContentKey, setSettledContentKey] = (0, import_react49.useState)(selectedKey);
|
|
12713
|
+
const [visitedKeys, setVisitedKeys] = (0, import_react49.useState)(() => /* @__PURE__ */ new Set([selectedKey]));
|
|
12713
12714
|
const settledKeyRef = (0, import_react49.useRef)(selectedKey);
|
|
12714
12715
|
const afterChangeRef = (0, import_react49.useRef)(onAfterChange);
|
|
12715
12716
|
(0, import_react49.useLayoutEffect)(() => {
|
|
@@ -12754,7 +12755,7 @@ function Tabs({
|
|
|
12754
12755
|
const animations = indicator?.getAnimations() ?? [];
|
|
12755
12756
|
const complete = () => {
|
|
12756
12757
|
if (cancelled) return;
|
|
12757
|
-
|
|
12758
|
+
setSettledContentKey(selectedKey);
|
|
12758
12759
|
if (settledKeyRef.current !== selectedKey) {
|
|
12759
12760
|
settledKeyRef.current = selectedKey;
|
|
12760
12761
|
afterChangeRef.current?.(selectedKey);
|
|
@@ -12770,7 +12771,14 @@ function Tabs({
|
|
|
12770
12771
|
cancelAnimationFrame(frame);
|
|
12771
12772
|
};
|
|
12772
12773
|
}, [selectedKey, type, deferContent]);
|
|
12773
|
-
const contentKey = deferContent
|
|
12774
|
+
const contentKey = deferContent && items.some((item) => item.key === settledContentKey) ? settledContentKey : selectedKey;
|
|
12775
|
+
(0, import_react49.useLayoutEffect)(() => {
|
|
12776
|
+
if (deferContent && contentKey !== settledContentKey) setSettledContentKey(contentKey);
|
|
12777
|
+
setVisitedKeys((previous) => {
|
|
12778
|
+
const next = new Set(items.filter((item) => item.key === contentKey || !destroyInactiveTabPane && previous.has(item.key)).map((item) => item.key));
|
|
12779
|
+
return next.size === previous.size && [...next].every((key) => previous.has(key)) ? previous : next;
|
|
12780
|
+
});
|
|
12781
|
+
}, [contentKey, items, destroyInactiveTabPane, deferContent, settledContentKey]);
|
|
12774
12782
|
function selectTab(key) {
|
|
12775
12783
|
if (key === selectedKey) return;
|
|
12776
12784
|
if (activeKey === void 0) setInternalActiveKey(key);
|
|
@@ -12885,7 +12893,7 @@ function Tabs({
|
|
|
12885
12893
|
}, "aria-busy": deferContent && contentKey !== selectedKey || void 0, children: items.map((item) => {
|
|
12886
12894
|
const selected = item.key === contentKey;
|
|
12887
12895
|
if (destroyInactiveTabPane && !selected) return null;
|
|
12888
|
-
if (
|
|
12896
|
+
if (!selected && !visitedKeys.has(item.key)) return null;
|
|
12889
12897
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12890
12898
|
"div",
|
|
12891
12899
|
{
|
|
@@ -16871,6 +16879,25 @@ function TableInner(props, ref) {
|
|
|
16871
16879
|
getColumns: () => pipeline.columns,
|
|
16872
16880
|
getPluginApi: (pluginId) => pluginApisRef.current[pluginId],
|
|
16873
16881
|
scrollTo: (options) => scrollRef.current?.scrollTo(options),
|
|
16882
|
+
scrollToRow: (key) => {
|
|
16883
|
+
const viewport = scrollRef.current;
|
|
16884
|
+
const table = tableRef.current;
|
|
16885
|
+
const index = pipeline.rows.findIndex((row2) => row2.key === key);
|
|
16886
|
+
if (!viewport || !table || !viewport.clientHeight || index < 0) return false;
|
|
16887
|
+
const row = Array.from(table.tBodies[0]?.rows ?? []).find((element) => element.dataset.rowKey === String(key));
|
|
16888
|
+
const headerHeight = table.tHead?.offsetHeight ?? headerRows.length * rowHeight;
|
|
16889
|
+
const top = row ? row.getBoundingClientRect().top - viewport.getBoundingClientRect().top - viewport.clientTop + viewport.scrollTop : headerHeight + index * rowHeight;
|
|
16890
|
+
const height2 = row?.offsetHeight ?? rowHeight;
|
|
16891
|
+
const headerInset = stickyHeader ? headerHeight : 0;
|
|
16892
|
+
const footerInset = table.tFoot?.offsetHeight ?? 0;
|
|
16893
|
+
const visibleTop = viewport.scrollTop + headerInset;
|
|
16894
|
+
const visibleBottom = viewport.scrollTop + viewport.clientHeight - footerInset;
|
|
16895
|
+
if (top < visibleTop || height2 > visibleBottom - visibleTop) viewport.scrollTop = Math.max(0, top - headerInset);
|
|
16896
|
+
else if (top + height2 > visibleBottom) viewport.scrollTop = top + height2 - viewport.clientHeight + footerInset;
|
|
16897
|
+
if (shouldVirtualize) setScrollTop(viewport.scrollTop);
|
|
16898
|
+
updateScrollMetrics();
|
|
16899
|
+
return true;
|
|
16900
|
+
},
|
|
16874
16901
|
setLoading: setInternalLoading,
|
|
16875
16902
|
getPage: () => pluginApisRef.current.pagination?.getPage?.() ?? { current: 1, pageSize: dataSource.length || 25 },
|
|
16876
16903
|
setPage: (page) => pluginApisRef.current.pagination?.setPage?.(page),
|
|
@@ -16884,7 +16911,7 @@ function TableInner(props, ref) {
|
|
|
16884
16911
|
requestCount: async (model) => {
|
|
16885
16912
|
await pluginApisRef.current.pagination?.requestCount?.(model);
|
|
16886
16913
|
}
|
|
16887
|
-
}), [dataSource.length, pipeline.columns, pipeline.rows]);
|
|
16914
|
+
}), [dataSource.length, pipeline.columns, pipeline.rows, headerRows.length, rowHeight, stickyHeader, shouldVirtualize, updateScrollMetrics]);
|
|
16888
16915
|
const coreContext = {
|
|
16889
16916
|
pluginId: "core",
|
|
16890
16917
|
sourceData: dataSource,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-DUmn3A2b.cjs';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-DUmn3A2b.cjs';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-O_pNB3SQ.cjs';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
@@ -2359,6 +2359,8 @@ interface TableRef<T> {
|
|
|
2359
2359
|
getPluginApi: <Api = unknown>(pluginId: string) => Api | undefined;
|
|
2360
2360
|
/** 滚动到指定位置。 */
|
|
2361
2361
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
|
+
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
|
+
scrollToRow: (key: TableKey) => boolean;
|
|
2362
2364
|
/** 切换加载状态。 */
|
|
2363
2365
|
setLoading: (loading: boolean) => void;
|
|
2364
2366
|
/** 读取当前分页状态。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-DoyeSoBN.js';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-DoyeSoBN.js';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-BiL3Wjsd.js';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
@@ -2359,6 +2359,8 @@ interface TableRef<T> {
|
|
|
2359
2359
|
getPluginApi: <Api = unknown>(pluginId: string) => Api | undefined;
|
|
2360
2360
|
/** 滚动到指定位置。 */
|
|
2361
2361
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
|
+
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
|
+
scrollToRow: (key: TableKey) => boolean;
|
|
2362
2364
|
/** 切换加载状态。 */
|
|
2363
2365
|
setLoading: (loading: boolean) => void;
|
|
2364
2366
|
/** 读取当前分页状态。 */
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
Watermark,
|
|
83
83
|
message,
|
|
84
84
|
notification
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-OHIBJFX5.js";
|
|
86
86
|
import "./chunk-RX242MUO.js";
|
|
87
87
|
import {
|
|
88
88
|
MarkdownEditor
|
|
@@ -8803,6 +8803,25 @@ function TableInner(props, ref) {
|
|
|
8803
8803
|
getColumns: () => pipeline.columns,
|
|
8804
8804
|
getPluginApi: (pluginId) => pluginApisRef.current[pluginId],
|
|
8805
8805
|
scrollTo: (options) => scrollRef.current?.scrollTo(options),
|
|
8806
|
+
scrollToRow: (key) => {
|
|
8807
|
+
const viewport = scrollRef.current;
|
|
8808
|
+
const table = tableRef.current;
|
|
8809
|
+
const index = pipeline.rows.findIndex((row2) => row2.key === key);
|
|
8810
|
+
if (!viewport || !table || !viewport.clientHeight || index < 0) return false;
|
|
8811
|
+
const row = Array.from(table.tBodies[0]?.rows ?? []).find((element) => element.dataset.rowKey === String(key));
|
|
8812
|
+
const headerHeight = table.tHead?.offsetHeight ?? headerRows.length * rowHeight;
|
|
8813
|
+
const top = row ? row.getBoundingClientRect().top - viewport.getBoundingClientRect().top - viewport.clientTop + viewport.scrollTop : headerHeight + index * rowHeight;
|
|
8814
|
+
const height2 = row?.offsetHeight ?? rowHeight;
|
|
8815
|
+
const headerInset = stickyHeader ? headerHeight : 0;
|
|
8816
|
+
const footerInset = table.tFoot?.offsetHeight ?? 0;
|
|
8817
|
+
const visibleTop = viewport.scrollTop + headerInset;
|
|
8818
|
+
const visibleBottom = viewport.scrollTop + viewport.clientHeight - footerInset;
|
|
8819
|
+
if (top < visibleTop || height2 > visibleBottom - visibleTop) viewport.scrollTop = Math.max(0, top - headerInset);
|
|
8820
|
+
else if (top + height2 > visibleBottom) viewport.scrollTop = top + height2 - viewport.clientHeight + footerInset;
|
|
8821
|
+
if (shouldVirtualize) setScrollTop(viewport.scrollTop);
|
|
8822
|
+
updateScrollMetrics();
|
|
8823
|
+
return true;
|
|
8824
|
+
},
|
|
8806
8825
|
setLoading: setInternalLoading,
|
|
8807
8826
|
getPage: () => pluginApisRef.current.pagination?.getPage?.() ?? { current: 1, pageSize: dataSource.length || 25 },
|
|
8808
8827
|
setPage: (page) => pluginApisRef.current.pagination?.setPage?.(page),
|
|
@@ -8816,7 +8835,7 @@ function TableInner(props, ref) {
|
|
|
8816
8835
|
requestCount: async (model) => {
|
|
8817
8836
|
await pluginApisRef.current.pagination?.requestCount?.(model);
|
|
8818
8837
|
}
|
|
8819
|
-
}), [dataSource.length, pipeline.columns, pipeline.rows]);
|
|
8838
|
+
}), [dataSource.length, pipeline.columns, pipeline.rows, headerRows.length, rowHeight, stickyHeader, shouldVirtualize, updateScrollMetrics]);
|
|
8820
8839
|
const coreContext = {
|
|
8821
8840
|
pluginId: "core",
|
|
8822
8841
|
sourceData: dataSource,
|