@sia.soul/sia-react-ui 0.1.128 → 0.1.130
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.css +26 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/game.css +26 -0
- package/dist/index.cjs +18 -7
- package/dist/index.css +29 -0
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -3
- 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.css
CHANGED
|
@@ -3769,6 +3769,32 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3769
3769
|
min-width: 0;
|
|
3770
3770
|
gap: 5px;
|
|
3771
3771
|
}
|
|
3772
|
+
.sia-table__header-label--required .sia-table__header-label-content,
|
|
3773
|
+
.sia-table__required-mark {
|
|
3774
|
+
color: var(--sia-color-error);
|
|
3775
|
+
}
|
|
3776
|
+
.sia-table__required-mark {
|
|
3777
|
+
flex: 0 0 auto;
|
|
3778
|
+
}
|
|
3779
|
+
.sia-table .sia-table__row td.sia-table__cell.sia-table__cell--invalid {
|
|
3780
|
+
isolation: isolate;
|
|
3781
|
+
background-image:
|
|
3782
|
+
repeating-linear-gradient(
|
|
3783
|
+
135deg,
|
|
3784
|
+
color-mix(in srgb, var(--sia-color-error) 9%, transparent) 0 7px,
|
|
3785
|
+
transparent 7px 14px);
|
|
3786
|
+
}
|
|
3787
|
+
.sia-table__cell--invalid::before {
|
|
3788
|
+
position: absolute;
|
|
3789
|
+
z-index: 9;
|
|
3790
|
+
right: 0;
|
|
3791
|
+
bottom: 0;
|
|
3792
|
+
left: 0;
|
|
3793
|
+
height: 3px;
|
|
3794
|
+
content: "";
|
|
3795
|
+
background: var(--sia-color-error);
|
|
3796
|
+
pointer-events: none;
|
|
3797
|
+
}
|
|
3772
3798
|
.sia-table__header-label-content {
|
|
3773
3799
|
display: block;
|
|
3774
3800
|
min-width: 0;
|
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/game.css
CHANGED
|
@@ -3778,6 +3778,32 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3778
3778
|
min-width: 0;
|
|
3779
3779
|
gap: 5px;
|
|
3780
3780
|
}
|
|
3781
|
+
.sia-table__header-label--required .sia-table__header-label-content,
|
|
3782
|
+
.sia-table__required-mark {
|
|
3783
|
+
color: var(--sia-color-error);
|
|
3784
|
+
}
|
|
3785
|
+
.sia-table__required-mark {
|
|
3786
|
+
flex: 0 0 auto;
|
|
3787
|
+
}
|
|
3788
|
+
.sia-table .sia-table__row td.sia-table__cell.sia-table__cell--invalid {
|
|
3789
|
+
isolation: isolate;
|
|
3790
|
+
background-image:
|
|
3791
|
+
repeating-linear-gradient(
|
|
3792
|
+
135deg,
|
|
3793
|
+
color-mix(in srgb, var(--sia-color-error) 9%, transparent) 0 7px,
|
|
3794
|
+
transparent 7px 14px);
|
|
3795
|
+
}
|
|
3796
|
+
.sia-table__cell--invalid::before {
|
|
3797
|
+
position: absolute;
|
|
3798
|
+
z-index: 9;
|
|
3799
|
+
right: 0;
|
|
3800
|
+
bottom: 0;
|
|
3801
|
+
left: 0;
|
|
3802
|
+
height: 3px;
|
|
3803
|
+
content: "";
|
|
3804
|
+
background: var(--sia-color-error);
|
|
3805
|
+
pointer-events: none;
|
|
3806
|
+
}
|
|
3781
3807
|
.sia-table__header-label-content {
|
|
3782
3808
|
display: block;
|
|
3783
3809
|
min-width: 0;
|
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
|
{
|
|
@@ -16438,6 +16446,7 @@ var TableBodyRow = (0, import_react57.memo)(function TableBodyRow2({
|
|
|
16438
16446
|
const pluginCellProps = getCellProps(column);
|
|
16439
16447
|
if (pluginCellProps.hidden) return null;
|
|
16440
16448
|
const value = getTableValue(row.record, column.dataIndex, column.code ?? column.key);
|
|
16449
|
+
const invalid = typeof column.invalid === "function" ? column.invalid(row.record, row.sourceIndex) : column.invalid;
|
|
16441
16450
|
const cellClass = typeof column.cellClassName === "function" ? column.cellClassName(row.record, rowIndex) : column.cellClassName ?? "";
|
|
16442
16451
|
const fixed = normalizeFixed(column.fixed);
|
|
16443
16452
|
const fixedStyle = fixed === "left" ? { left: leftOffsets.get(column.key) } : fixed === "right" ? { right: rightOffsets.get(column.key) } : void 0;
|
|
@@ -16447,11 +16456,12 @@ var TableBodyRow = (0, import_react57.memo)(function TableBodyRow2({
|
|
|
16447
16456
|
"td",
|
|
16448
16457
|
{
|
|
16449
16458
|
"data-column-key": column.key,
|
|
16459
|
+
"aria-invalid": invalid || void 0,
|
|
16450
16460
|
"data-canvas-dom-ready": canvas && (pluginCellProps.content !== void 0 || !column.canvasRender && column.render) ? "true" : void 0,
|
|
16451
16461
|
"aria-label": canvas ? column.canvasRender?.(value, row.record, row.sourceIndex, { row, rowIndex, column })?.text ?? (value == null ? "" : String(value)) : void 0,
|
|
16452
16462
|
rowSpan: pluginCellProps.rowSpan,
|
|
16453
16463
|
colSpan: pluginCellProps.colSpan,
|
|
16454
|
-
className: `sia-table__cell sia-table__cell--${column.align ?? "left"}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}${column.ellipsis !== false ? " sia-table__cell--ellipsis" : ""} ${cellClass} ${pluginCellProps.className ?? ""}`.trim(),
|
|
16464
|
+
className: `sia-table__cell sia-table__cell--${column.align ?? "left"}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}${invalid ? " sia-table__cell--invalid" : ""}${column.ellipsis !== false ? " sia-table__cell--ellipsis" : ""} ${cellClass} ${pluginCellProps.className ?? ""}`.trim(),
|
|
16455
16465
|
style: { ...fixedStyle, ...pluginCellProps.style },
|
|
16456
16466
|
onMouseEnter: () => onCellMouseEnter(column),
|
|
16457
16467
|
onMouseLeave: () => onCellMouseLeave(column),
|
|
@@ -16903,7 +16913,8 @@ function TableInner(props, ref) {
|
|
|
16903
16913
|
}
|
|
16904
16914
|
function renderHeaderContent(column, content) {
|
|
16905
16915
|
const title = getHeaderTitleText(column.title ?? column.name) || column.name || column.key;
|
|
16906
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "sia-table__header-label"
|
|
16916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: `sia-table__header-label${column.required ? " sia-table__header-label--required" : ""}`, children: [
|
|
16917
|
+
column.required && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sia-table__required-mark", "aria-hidden": "true", children: "*" }),
|
|
16907
16918
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sia-table__header-label-content", "data-sia-title-overflow-only": true, ...withTitleTooltip({ title }), children: content }),
|
|
16908
16919
|
column.description != null && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Tooltip, { title: column.description, placement: "top", trigger: ["hover", "focus"], children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", className: "sia-table__header-description", "aria-label": `${column.name ?? column.key}\u5217\u8BF4\u660E`, onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { name: "info", size: 14 }) }) })
|
|
16909
16920
|
] });
|
package/dist/index.css
CHANGED
|
@@ -3769,6 +3769,32 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3769
3769
|
min-width: 0;
|
|
3770
3770
|
gap: 5px;
|
|
3771
3771
|
}
|
|
3772
|
+
.sia-table__header-label--required .sia-table__header-label-content,
|
|
3773
|
+
.sia-table__required-mark {
|
|
3774
|
+
color: var(--sia-color-error);
|
|
3775
|
+
}
|
|
3776
|
+
.sia-table__required-mark {
|
|
3777
|
+
flex: 0 0 auto;
|
|
3778
|
+
}
|
|
3779
|
+
.sia-table .sia-table__row td.sia-table__cell.sia-table__cell--invalid {
|
|
3780
|
+
isolation: isolate;
|
|
3781
|
+
background-image:
|
|
3782
|
+
repeating-linear-gradient(
|
|
3783
|
+
135deg,
|
|
3784
|
+
color-mix(in srgb, var(--sia-color-error) 9%, transparent) 0 7px,
|
|
3785
|
+
transparent 7px 14px);
|
|
3786
|
+
}
|
|
3787
|
+
.sia-table__cell--invalid::before {
|
|
3788
|
+
position: absolute;
|
|
3789
|
+
z-index: 9;
|
|
3790
|
+
right: 0;
|
|
3791
|
+
bottom: 0;
|
|
3792
|
+
left: 0;
|
|
3793
|
+
height: 3px;
|
|
3794
|
+
content: "";
|
|
3795
|
+
background: var(--sia-color-error);
|
|
3796
|
+
pointer-events: none;
|
|
3797
|
+
}
|
|
3772
3798
|
.sia-table__header-label-content {
|
|
3773
3799
|
display: block;
|
|
3774
3800
|
min-width: 0;
|
|
@@ -11186,6 +11212,9 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11186
11212
|
.sia-table__worksheet-fill-preview {
|
|
11187
11213
|
box-shadow: inset 0 0 0 1px var(--sia-color-primary);
|
|
11188
11214
|
}
|
|
11215
|
+
.sia-table__cell--invalid .sia-table__worksheet-handle {
|
|
11216
|
+
z-index: 10;
|
|
11217
|
+
}
|
|
11189
11218
|
.sia-table__worksheet-tools {
|
|
11190
11219
|
display: inline-flex;
|
|
11191
11220
|
align-items: center;
|
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';
|
|
@@ -2053,6 +2053,10 @@ interface TableColumn<T = Record<string, unknown>> {
|
|
|
2053
2053
|
name?: string;
|
|
2054
2054
|
/** 列头内容,可传入文本或 React 节点;默认单行显示,仅文字实际超宽省略时通过框架 title 提示展示完整文本,完整显示时不提示。节点无法提取文本时使用 name 或 key。 */
|
|
2055
2055
|
title?: ReactNode;
|
|
2056
|
+
/** 是否以红色列名和前置红色星号标识必填列,默认 false;仅表达列头语义,不自动校验单元格。 */
|
|
2057
|
+
required?: boolean;
|
|
2058
|
+
/** 单元格是否校验失败,默认 false;可按行数据和源数据索引返回布尔值。失败时显示淡红斜纹和 3px 红色底线,不插入图标、不改变行高;业务负责判断空值、格式或其他错误。 */
|
|
2059
|
+
invalid?: boolean | ((record: T, index: number) => boolean);
|
|
2056
2060
|
/** 补充说明内容。 */
|
|
2057
2061
|
description?: ReactNode;
|
|
2058
2062
|
/** 读取单元格值的字段名或嵌套路径。 */
|
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';
|
|
@@ -2053,6 +2053,10 @@ interface TableColumn<T = Record<string, unknown>> {
|
|
|
2053
2053
|
name?: string;
|
|
2054
2054
|
/** 列头内容,可传入文本或 React 节点;默认单行显示,仅文字实际超宽省略时通过框架 title 提示展示完整文本,完整显示时不提示。节点无法提取文本时使用 name 或 key。 */
|
|
2055
2055
|
title?: ReactNode;
|
|
2056
|
+
/** 是否以红色列名和前置红色星号标识必填列,默认 false;仅表达列头语义,不自动校验单元格。 */
|
|
2057
|
+
required?: boolean;
|
|
2058
|
+
/** 单元格是否校验失败,默认 false;可按行数据和源数据索引返回布尔值。失败时显示淡红斜纹和 3px 红色底线,不插入图标、不改变行高;业务负责判断空值、格式或其他错误。 */
|
|
2059
|
+
invalid?: boolean | ((record: T, index: number) => boolean);
|
|
2056
2060
|
/** 补充说明内容。 */
|
|
2057
2061
|
description?: ReactNode;
|
|
2058
2062
|
/** 读取单元格值的字段名或嵌套路径。 */
|
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
|
|
@@ -8370,6 +8370,7 @@ var TableBodyRow = memo(function TableBodyRow2({
|
|
|
8370
8370
|
const pluginCellProps = getCellProps(column);
|
|
8371
8371
|
if (pluginCellProps.hidden) return null;
|
|
8372
8372
|
const value = getTableValue(row.record, column.dataIndex, column.code ?? column.key);
|
|
8373
|
+
const invalid = typeof column.invalid === "function" ? column.invalid(row.record, row.sourceIndex) : column.invalid;
|
|
8373
8374
|
const cellClass = typeof column.cellClassName === "function" ? column.cellClassName(row.record, rowIndex) : column.cellClassName ?? "";
|
|
8374
8375
|
const fixed = normalizeFixed(column.fixed);
|
|
8375
8376
|
const fixedStyle = fixed === "left" ? { left: leftOffsets.get(column.key) } : fixed === "right" ? { right: rightOffsets.get(column.key) } : void 0;
|
|
@@ -8379,11 +8380,12 @@ var TableBodyRow = memo(function TableBodyRow2({
|
|
|
8379
8380
|
"td",
|
|
8380
8381
|
{
|
|
8381
8382
|
"data-column-key": column.key,
|
|
8383
|
+
"aria-invalid": invalid || void 0,
|
|
8382
8384
|
"data-canvas-dom-ready": canvas && (pluginCellProps.content !== void 0 || !column.canvasRender && column.render) ? "true" : void 0,
|
|
8383
8385
|
"aria-label": canvas ? column.canvasRender?.(value, row.record, row.sourceIndex, { row, rowIndex, column })?.text ?? (value == null ? "" : String(value)) : void 0,
|
|
8384
8386
|
rowSpan: pluginCellProps.rowSpan,
|
|
8385
8387
|
colSpan: pluginCellProps.colSpan,
|
|
8386
|
-
className: `sia-table__cell sia-table__cell--${column.align ?? "left"}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}${column.ellipsis !== false ? " sia-table__cell--ellipsis" : ""} ${cellClass} ${pluginCellProps.className ?? ""}`.trim(),
|
|
8388
|
+
className: `sia-table__cell sia-table__cell--${column.align ?? "left"}${fixed ? ` sia-table__cell--fixed sia-table__cell--fixed-${fixed}` : ""}${fixedEdgeClass}${autoWidthClass}${invalid ? " sia-table__cell--invalid" : ""}${column.ellipsis !== false ? " sia-table__cell--ellipsis" : ""} ${cellClass} ${pluginCellProps.className ?? ""}`.trim(),
|
|
8387
8389
|
style: { ...fixedStyle, ...pluginCellProps.style },
|
|
8388
8390
|
onMouseEnter: () => onCellMouseEnter(column),
|
|
8389
8391
|
onMouseLeave: () => onCellMouseLeave(column),
|
|
@@ -8835,7 +8837,8 @@ function TableInner(props, ref) {
|
|
|
8835
8837
|
}
|
|
8836
8838
|
function renderHeaderContent(column, content) {
|
|
8837
8839
|
const title = getHeaderTitleText(column.title ?? column.name) || column.name || column.key;
|
|
8838
|
-
return /* @__PURE__ */ jsxs23("span", { className: "sia-table__header-label"
|
|
8840
|
+
return /* @__PURE__ */ jsxs23("span", { className: `sia-table__header-label${column.required ? " sia-table__header-label--required" : ""}`, children: [
|
|
8841
|
+
column.required && /* @__PURE__ */ jsx25("span", { className: "sia-table__required-mark", "aria-hidden": "true", children: "*" }),
|
|
8839
8842
|
/* @__PURE__ */ jsx25("span", { className: "sia-table__header-label-content", "data-sia-title-overflow-only": true, ...withTitleTooltip({ title }), children: content }),
|
|
8840
8843
|
column.description != null && /* @__PURE__ */ jsx25(Tooltip, { title: column.description, placement: "top", trigger: ["hover", "focus"], children: /* @__PURE__ */ jsx25("button", { type: "button", className: "sia-table__header-description", "aria-label": `${column.name ?? column.key}\u5217\u8BF4\u660E`, onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx25(Icon, { name: "info", size: 14 }) }) })
|
|
8841
8844
|
] });
|