@sia.soul/sia-react-ui 0.1.120 → 0.1.122
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-WS4WYFJZ.js → chunk-B6MU2BBG.js} +82 -11
- package/dist/{chunk-XDG736H7.js → chunk-B7UK645K.js} +1 -1
- package/dist/{chunk-ODJNSVNB.js → chunk-JZK5OCZB.js} +1 -1
- package/dist/{chunk-IRMKZYGV.js → chunk-XQB5K7V4.js} +4 -3
- package/dist/{chunk-RZR3EZRL.js → chunk-ZPRDG3RS.js} +1 -1
- package/dist/{core-DCfngMfy.d.ts → core-ChdEzTaQ.d.ts} +21 -4
- package/dist/{core-DQ2ZROfx.d.cts → core-DDpzWdxm.d.cts} +21 -4
- package/dist/core.cjs +25 -2
- package/dist/core.css +51 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +3 -3
- package/dist/game.css +3 -0
- package/dist/index.cjs +91 -11
- package/dist/index.css +51 -0
- package/dist/index.d.cts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +18 -9
- package/dist/rich-text-editor.js +2 -2
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B7UK645K.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XQB5K7V4.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
10
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -816,7 +816,7 @@ function Tour({ open = false, steps, current, defaultCurrent = 0, mask = true, c
|
|
|
816
816
|
}
|
|
817
817
|
|
|
818
818
|
// src/components/DataDisplay.tsx
|
|
819
|
-
import { Children, useEffect as useEffect3, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
|
|
819
|
+
import { Children, createContext, useContext, useEffect as useEffect3, useId as useId2, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
|
|
820
820
|
import { createPortal as createPortal2 } from "react-dom";
|
|
821
821
|
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
822
822
|
function Rate({ value, size: sizeProp, defaultValue = 0, count = 5, allowHalf = false, allowClear = true, disabled = false, character, tooltips, onChange, onHoverChange, className = "", ...props }) {
|
|
@@ -1030,7 +1030,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
|
|
|
1030
1030
|
] }, item.key);
|
|
1031
1031
|
}) });
|
|
1032
1032
|
}
|
|
1033
|
-
function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
1033
|
+
function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
|
|
1034
1034
|
const previewRef = useRef4(null);
|
|
1035
1035
|
const stageRef = useRef4(null);
|
|
1036
1036
|
const [natural, setNatural] = useState5({ src: "", width: 0, height: 0 });
|
|
@@ -1053,6 +1053,18 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
1053
1053
|
reset();
|
|
1054
1054
|
setFailed(false);
|
|
1055
1055
|
}, [open, src]);
|
|
1056
|
+
useEffect3(() => {
|
|
1057
|
+
if (!open || !onCurrentChange || count < 2) return;
|
|
1058
|
+
const handleKey = (event) => {
|
|
1059
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
1060
|
+
event.preventDefault();
|
|
1061
|
+
event.stopPropagation();
|
|
1062
|
+
const next = current + (event.key === "ArrowRight" ? 1 : -1);
|
|
1063
|
+
if (next >= 0 && next < count) onCurrentChange(next);
|
|
1064
|
+
};
|
|
1065
|
+
document.addEventListener("keydown", handleKey, true);
|
|
1066
|
+
return () => document.removeEventListener("keydown", handleKey, true);
|
|
1067
|
+
}, [open, current, count, onCurrentChange]);
|
|
1056
1068
|
useEffect3(() => {
|
|
1057
1069
|
const stage = stageRef.current;
|
|
1058
1070
|
if (!open || !stage) return;
|
|
@@ -1109,6 +1121,15 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
1109
1121
|
src
|
|
1110
1122
|
) }),
|
|
1111
1123
|
/* @__PURE__ */ jsxs6("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
|
|
1124
|
+
count > 1 && onCurrentChange ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
1125
|
+
/* @__PURE__ */ jsx6(Button, { variant: "text", "aria-label": "\u4E0A\u4E00\u5F20", disabled: current === 0, onClick: () => onCurrentChange(current - 1), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-left" }) }),
|
|
1126
|
+
/* @__PURE__ */ jsxs6("output", { "aria-label": "\u56FE\u7247\u5E8F\u53F7", children: [
|
|
1127
|
+
current + 1,
|
|
1128
|
+
" / ",
|
|
1129
|
+
count
|
|
1130
|
+
] }),
|
|
1131
|
+
/* @__PURE__ */ jsx6(Button, { variant: "text", "aria-label": "\u4E0B\u4E00\u5F20", disabled: current >= count - 1, onClick: () => onCurrentChange(current + 1), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-right" }) })
|
|
1132
|
+
] }) : null,
|
|
1112
1133
|
/* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u6C34\u5E73\u7FFB\u8F6C", "aria-label": "\u6C34\u5E73\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, x: -value.x })), children: /* @__PURE__ */ jsx6(Icon, { name: "flip-horizontal", size: 20 }) }),
|
|
1113
1134
|
/* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u5782\u76F4\u7FFB\u8F6C", "aria-label": "\u5782\u76F4\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, y: -value.y })), children: /* @__PURE__ */ jsx6(Icon, { name: "flip-vertical", size: 20 }) }),
|
|
1114
1135
|
/* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u5411\u5DE6\u65CB\u8F6C", "aria-label": "\u5411\u5DE6\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
@@ -1126,6 +1147,46 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
1126
1147
|
] })
|
|
1127
1148
|
] }), document.body);
|
|
1128
1149
|
}
|
|
1150
|
+
var ImageGroupContext = createContext(null);
|
|
1151
|
+
function ImagePreviewGroup({ children }) {
|
|
1152
|
+
const images = useRef4(/* @__PURE__ */ new Map());
|
|
1153
|
+
const [active, setActive] = useState5();
|
|
1154
|
+
const [, setRevision] = useState5(0);
|
|
1155
|
+
const context = useMemo3(() => ({
|
|
1156
|
+
register: (id, image2) => {
|
|
1157
|
+
images.current.set(id, image2);
|
|
1158
|
+
setRevision((value) => value + 1);
|
|
1159
|
+
return () => {
|
|
1160
|
+
images.current.delete(id);
|
|
1161
|
+
setRevision((value) => value + 1);
|
|
1162
|
+
};
|
|
1163
|
+
},
|
|
1164
|
+
open: (id) => setActive(id)
|
|
1165
|
+
}), []);
|
|
1166
|
+
const entries = [...images.current].sort((a, b) => a[1].element.compareDocumentPosition(b[1].element) & 4 ? -1 : 1);
|
|
1167
|
+
const index = entries.findIndex(([id]) => id === active);
|
|
1168
|
+
const image = entries[index]?.[1];
|
|
1169
|
+
useEffect3(() => {
|
|
1170
|
+
if (active && index < 0) setActive(void 0);
|
|
1171
|
+
}, [active, index]);
|
|
1172
|
+
return /* @__PURE__ */ jsxs6(ImageGroupContext.Provider, { value: context, children: [
|
|
1173
|
+
children,
|
|
1174
|
+
/* @__PURE__ */ jsx6(
|
|
1175
|
+
ImagePreview,
|
|
1176
|
+
{
|
|
1177
|
+
open: Boolean(image),
|
|
1178
|
+
src: image?.src,
|
|
1179
|
+
alt: image?.alt,
|
|
1180
|
+
current: index,
|
|
1181
|
+
count: entries.length,
|
|
1182
|
+
onOpenChange: (open) => {
|
|
1183
|
+
if (!open) setActive(void 0);
|
|
1184
|
+
},
|
|
1185
|
+
onCurrentChange: (next) => setActive(entries[next]?.[0])
|
|
1186
|
+
}
|
|
1187
|
+
)
|
|
1188
|
+
] });
|
|
1189
|
+
}
|
|
1129
1190
|
function Image({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onLoad, onError, style, ...props }) {
|
|
1130
1191
|
const config = typeof preview === "object" ? preview : {};
|
|
1131
1192
|
const controlled = typeof preview === "object" && preview.open !== void 0;
|
|
@@ -1134,16 +1195,24 @@ function Image({ fallback, placeholder, preview = true, rootClassName = "", clas
|
|
|
1134
1195
|
const [loaded, setLoaded] = useState5(false);
|
|
1135
1196
|
const [failed, setFailed] = useState5(false);
|
|
1136
1197
|
const displaySrc = failed && fallback ? fallback : src;
|
|
1198
|
+
const group = useContext(ImageGroupContext);
|
|
1199
|
+
const groupId = useId2();
|
|
1200
|
+
const rootRef = useRef4(null);
|
|
1201
|
+
const grouped = Boolean(group && preview && !controlled && displaySrc);
|
|
1202
|
+
useEffect3(() => {
|
|
1203
|
+
if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: displaySrc, alt, element: rootRef.current });
|
|
1204
|
+
}, [group, grouped, groupId, displaySrc, alt]);
|
|
1137
1205
|
const radius = typeof style?.borderRadius === "number" ? `${style.borderRadius}px` : style?.borderRadius;
|
|
1138
1206
|
const rootStyle = {
|
|
1139
1207
|
...style,
|
|
1140
1208
|
"--sia-image-radius": radius ?? "var(--sia-radius)"
|
|
1141
1209
|
};
|
|
1142
1210
|
function setOpen(next) {
|
|
1143
|
-
if (
|
|
1211
|
+
if (grouped && next) group?.open(groupId);
|
|
1212
|
+
else if (!controlled) setInternalOpen(next);
|
|
1144
1213
|
config.onOpenChange?.(next);
|
|
1145
1214
|
}
|
|
1146
|
-
return /* @__PURE__ */ jsxs6("span", { className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
1215
|
+
return /* @__PURE__ */ jsxs6("span", { ref: rootRef, className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
1147
1216
|
!loaded && placeholder ? /* @__PURE__ */ jsx6("span", { className: "sia-image__placeholder", children: placeholder }) : null,
|
|
1148
1217
|
/* @__PURE__ */ jsx6("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (event) => {
|
|
1149
1218
|
setLoaded(true);
|
|
@@ -1455,6 +1524,7 @@ function UploadItem({ file, files, props, actions }) {
|
|
|
1455
1524
|
}
|
|
1456
1525
|
var UploadRoot = forwardRef(function UploadRoot2({
|
|
1457
1526
|
accept,
|
|
1527
|
+
acceptMode = "validate",
|
|
1458
1528
|
multiple = false,
|
|
1459
1529
|
directory = false,
|
|
1460
1530
|
recursive = true,
|
|
@@ -1642,7 +1712,7 @@ var UploadRoot = forwardRef(function UploadRoot2({
|
|
|
1642
1712
|
const selected = multiple || directory ? filtered : filtered.slice(0, 1);
|
|
1643
1713
|
const added = [];
|
|
1644
1714
|
for (const { file, path } of selected) {
|
|
1645
|
-
if (!acceptsUploadFile(file, accept)) {
|
|
1715
|
+
if (acceptMode === "validate" && !acceptsUploadFile(file, accept)) {
|
|
1646
1716
|
onReject?.({ file, reason: "accept" });
|
|
1647
1717
|
continue;
|
|
1648
1718
|
}
|
|
@@ -1955,9 +2025,9 @@ var Typography = Object.assign(TypographyRoot, {
|
|
|
1955
2025
|
});
|
|
1956
2026
|
|
|
1957
2027
|
// src/components/FloatButton.tsx
|
|
1958
|
-
import { createContext, forwardRef as forwardRef2, useContext, useEffect as useEffect6, useId as
|
|
2028
|
+
import { createContext as createContext2, forwardRef as forwardRef2, useContext as useContext2, useEffect as useEffect6, useId as useId3, useRef as useRef7, useState as useState8 } from "react";
|
|
1959
2029
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1960
|
-
var GroupShape =
|
|
2030
|
+
var GroupShape = createContext2(void 0);
|
|
1961
2031
|
var FloatButtonRoot = forwardRef2(function FloatButton({
|
|
1962
2032
|
icon,
|
|
1963
2033
|
description,
|
|
@@ -1971,7 +2041,7 @@ var FloatButtonRoot = forwardRef2(function FloatButton({
|
|
|
1971
2041
|
children,
|
|
1972
2042
|
...props
|
|
1973
2043
|
}, ref) {
|
|
1974
|
-
const groupShape =
|
|
2044
|
+
const groupShape = useContext2(GroupShape);
|
|
1975
2045
|
const label = props["aria-label"] ?? (typeof tooltip === "string" ? tooltip : typeof description === "string" ? description : "\u60AC\u6D6E\u64CD\u4F5C");
|
|
1976
2046
|
const button = /* @__PURE__ */ jsx11(
|
|
1977
2047
|
"button",
|
|
@@ -2011,7 +2081,7 @@ function FloatButtonGroup({
|
|
|
2011
2081
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
2012
2082
|
const rootRef = useRef7(null);
|
|
2013
2083
|
const triggerRef = useRef7(null);
|
|
2014
|
-
const id =
|
|
2084
|
+
const id = useId3();
|
|
2015
2085
|
useEffect6(() => {
|
|
2016
2086
|
if (!trigger || !visible) return;
|
|
2017
2087
|
const close = (event) => {
|
|
@@ -2127,6 +2197,7 @@ export {
|
|
|
2127
2197
|
Carousel,
|
|
2128
2198
|
Collapse,
|
|
2129
2199
|
ImagePreview,
|
|
2200
|
+
ImagePreviewGroup,
|
|
2130
2201
|
Image,
|
|
2131
2202
|
message,
|
|
2132
2203
|
Upload,
|
|
@@ -247,8 +247,8 @@ function Menu({
|
|
|
247
247
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
248
248
|
return /* @__PURE__ */ jsx("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ jsx(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
249
249
|
}
|
|
250
|
-
function Steps({ items, current = 0, initial = 0, direction = "horizontal", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
251
|
-
return /* @__PURE__ */ jsx("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
250
|
+
function Steps({ items, current = 0, initial = 0, direction = "horizontal", labelPlacement = "vertical", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
251
|
+
return /* @__PURE__ */ jsx("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} sia-steps--label-${labelPlacement} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
252
252
|
const index = rawIndex + initial;
|
|
253
253
|
const itemStatus = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
|
|
254
254
|
const dot = /* @__PURE__ */ jsx("span", { className: "sia-steps__dot" });
|
|
@@ -264,7 +264,8 @@ function Steps({ items, current = 0, initial = 0, direction = "horizontal", type
|
|
|
264
264
|
item.subTitle ? /* @__PURE__ */ jsx("small", { children: item.subTitle }) : null
|
|
265
265
|
] }),
|
|
266
266
|
item.description ? /* @__PURE__ */ jsx("span", { className: "sia-steps__description", children: item.description }) : null
|
|
267
|
-
] })
|
|
267
|
+
] }),
|
|
268
|
+
direction === "horizontal" && labelPlacement === "horizontal" ? /* @__PURE__ */ jsx("span", { className: "sia-steps__tail sia-steps__inline-tail" }) : null
|
|
268
269
|
] }, index);
|
|
269
270
|
}) });
|
|
270
271
|
}
|
|
@@ -636,6 +636,8 @@ type StepItem = {
|
|
|
636
636
|
};
|
|
637
637
|
/** 步骤条的属性配置。 */
|
|
638
638
|
interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
639
|
+
/** 横向步骤条的标题位置:vertical 在图标下方,horizontal 在图标右侧;纵向和窄屏堆叠时保持原布局。默认 vertical。 */
|
|
640
|
+
labelPlacement?: "horizontal" | "vertical";
|
|
639
641
|
/** 按展示顺序排列的项目配置。 */
|
|
640
642
|
items: readonly StepItem[];
|
|
641
643
|
/**
|
|
@@ -689,7 +691,7 @@ interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
689
691
|
onChange?: (current: number) => void;
|
|
690
692
|
}
|
|
691
693
|
/** 步骤条组件。 */
|
|
692
|
-
declare function Steps({ items, current, initial, direction, type, size, status, progressDot, onChange, className, ...props }: StepsProps): react.JSX.Element;
|
|
694
|
+
declare function Steps({ items, current, initial, direction, labelPlacement, type, size, status, progressDot, onChange, className, ...props }: StepsProps): react.JSX.Element;
|
|
693
695
|
/** 分段选择的值类型。 */
|
|
694
696
|
type SegmentedValue = string | number;
|
|
695
697
|
/** 分段选择的候选项定义。 */
|
|
@@ -1882,6 +1884,12 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
|
|
|
1882
1884
|
declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
|
|
1883
1885
|
/** 图片预览的属性配置。 */
|
|
1884
1886
|
interface ImagePreviewProps {
|
|
1887
|
+
/** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
|
|
1888
|
+
current?: number;
|
|
1889
|
+
/** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
|
|
1890
|
+
count?: number;
|
|
1891
|
+
/** 切换图片时回调新的序号,由外部同步 current、src 与 alt。 */
|
|
1892
|
+
onCurrentChange?: (current: number) => void;
|
|
1885
1893
|
/** 是否打开;传入后由外部控制显示状态。 */
|
|
1886
1894
|
open: boolean;
|
|
1887
1895
|
/** 图片或资源地址。 */
|
|
@@ -1895,7 +1903,7 @@ interface ImagePreviewProps {
|
|
|
1895
1903
|
onOpenChange: (open: boolean) => void;
|
|
1896
1904
|
}
|
|
1897
1905
|
/** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。 */
|
|
1898
|
-
declare function ImagePreview({ open, src, alt, onOpenChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1906
|
+
declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1899
1907
|
/** 图片预览的配置。 */
|
|
1900
1908
|
interface ImagePreviewConfig {
|
|
1901
1909
|
/** 图片或资源地址。 */
|
|
@@ -1926,6 +1934,13 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1926
1934
|
*/
|
|
1927
1935
|
rootClassName?: string;
|
|
1928
1936
|
}
|
|
1937
|
+
/** 图片预览组的配置。 */
|
|
1938
|
+
interface ImagePreviewGroupProps {
|
|
1939
|
+
/** 包含 Image 的内容,可嵌套布局容器;preview=false 或受控预览的 Image 不加入分组。 */
|
|
1940
|
+
children?: ReactNode;
|
|
1941
|
+
}
|
|
1942
|
+
/** 按图片在页面中的顺序组织预览,支持按钮和方向键切换;删除当前图片时关闭预览。 */
|
|
1943
|
+
declare function ImagePreviewGroup({ children }: ImagePreviewGroupProps): react.JSX.Element;
|
|
1929
1944
|
/** 图片组件。 */
|
|
1930
1945
|
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1931
1946
|
|
|
@@ -2085,8 +2100,10 @@ interface UploadRef {
|
|
|
2085
2100
|
}
|
|
2086
2101
|
/** 文件上传属性;未配置 request/customRequest 时仅选择文件,不模拟上传成功。 */
|
|
2087
2102
|
interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
2088
|
-
/** 扩展名或 MIME
|
|
2103
|
+
/** 扩展名或 MIME 类型,逗号分隔;默认对点击、拖拽和粘贴均校验,acceptMode="hint" 时仅作为系统文件选择器提示。 */
|
|
2089
2104
|
accept?: string;
|
|
2105
|
+
/** 文件类型校验方式:validate 在进入队列前按 accept 拒绝不匹配文件;hint 仅保留文件选择器过滤提示,全部所选文件继续交给 beforeUpload,便于业务生成完整失败明细。默认 validate;hint 模式须由业务校验类型,不改变 maxCount、禁用或目录规则。 */
|
|
2106
|
+
acceptMode?: "validate" | "hint";
|
|
2090
2107
|
/** 每批是否允许多个文件;false 仅取首个,directory 模式不受此限制。 @defaultValue false */
|
|
2091
2108
|
multiple?: boolean;
|
|
2092
2109
|
/** 选择或拖入文件夹,文件路径保存在 relativePath;不会上传空目录。 @defaultValue false */
|
|
@@ -2424,4 +2441,4 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
2424
2441
|
/** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
|
|
2425
2442
|
declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
|
|
2426
2443
|
|
|
2427
|
-
export { type
|
|
2444
|
+
export { type MenuMode as $, type FloatButtonGroupProps as A, type BadgeProps as B, Calendar as C, Dropdown as D, type FloatButtonProps as E, FILLED_ICON_NAMES as F, type FloatButtonShape as G, type FloatingPlacement as H, type FloatingTrigger as I, ICON_NAMES as J, Icon as K, type IconName as L, type IconProps as M, type IconVariant as N, Image as O, ImagePreview as P, type ImagePreviewConfig as Q, ImagePreviewGroup as R, type ImagePreviewGroupProps as S, type TagStatus as T, type ImagePreviewProps as U, type ImageProps as V, Input as W, type InputProps as X, Menu as Y, type MenuClickInfo as Z, type MenuItem as _, Badge as a, Upload as a$, type MenuProps as a0, type MenuTheme as a1, type MessageConfig as a2, type MessageHandle as a3, type MessageKey as a4, type MessageType as a5, type NotificationConfig as a6, type NotificationPlacement as a7, type NotificationType as a8, Popconfirm as a9, type TabsProps as aA, type TabsType as aB, Tag as aC, type TagProps as aD, type TagSize as aE, type TagVariant as aF, Timeline as aG, type TimelineItem as aH, type TimelineProps as aI, Toolbar as aJ, type ToolbarItem as aK, type ToolbarProps as aL, Tooltip as aM, type TooltipProps as aN, Tour as aO, type TourProps as aP, type TourStep as aQ, Tree as aR, type TreeDropPosition as aS, type TreeKey as aT, type TreeNode as aU, type TreeProps as aV, Typography as aW, type TypographyLinkProps as aX, type TypographyProps as aY, type TypographyTitleProps as aZ, type TypographyType as a_, type PopconfirmProps as aa, Popover as ab, type PopoverProps as ac, Progress as ad, type ProgressProps as ae, type ProgressStatus as af, Rate as ag, type RateProps as ah, Result as ai, type ResultProps as aj, type ResultStatus as ak, Segmented as al, type SegmentedOption as am, type SegmentedProps as an, type SegmentedValue as ao, Spin as ap, type SpinProps as aq, type StepItem as ar, type StepStatus as as, Steps as at, type StepsProps as au, type TabItem as av, Tabs as aw, type TabsContextMenuClickInfo as ax, type TabsOrientation as ay, type TabsPosition as az, type BadgeRibbonProps as b, type UploadChangeInfo as b0, type UploadDraggerProps as b1, type UploadFile as b2, type UploadFileStatus as b3, type UploadHttpRequest as b4, type UploadItemActions as b5, type UploadProps as b6, type UploadRef as b7, type UploadRejectInfo as b8, type UploadRequestHandle as b9, type UploadRequestOptions as ba, Watermark as bb, type WatermarkFont as bc, type WatermarkProps as bd, message as be, notification as bf, type BadgeStatus as c, Breadcrumb as d, type BreadcrumbItem as e, type BreadcrumbProps as f, type CalendarProps as g, Card as h, type CardAccent as i, type CardProps as j, Carousel as k, type CarouselProps as l, type CarouselRef as m, Collapse as n, type CollapseItem as o, type CollapseKey as p, type CollapseProps as q, type DropdownButtonProps as r, type DropdownMenuProps as s, type DropdownOpenSource as t, type DropdownPlacement as u, type DropdownProps as v, type DropdownTrigger as w, type FilledIconName as x, FloatButton as y, type FloatButtonBackTopProps as z };
|
|
@@ -636,6 +636,8 @@ type StepItem = {
|
|
|
636
636
|
};
|
|
637
637
|
/** 步骤条的属性配置。 */
|
|
638
638
|
interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
639
|
+
/** 横向步骤条的标题位置:vertical 在图标下方,horizontal 在图标右侧;纵向和窄屏堆叠时保持原布局。默认 vertical。 */
|
|
640
|
+
labelPlacement?: "horizontal" | "vertical";
|
|
639
641
|
/** 按展示顺序排列的项目配置。 */
|
|
640
642
|
items: readonly StepItem[];
|
|
641
643
|
/**
|
|
@@ -689,7 +691,7 @@ interface StepsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
|
689
691
|
onChange?: (current: number) => void;
|
|
690
692
|
}
|
|
691
693
|
/** 步骤条组件。 */
|
|
692
|
-
declare function Steps({ items, current, initial, direction, type, size, status, progressDot, onChange, className, ...props }: StepsProps): react.JSX.Element;
|
|
694
|
+
declare function Steps({ items, current, initial, direction, labelPlacement, type, size, status, progressDot, onChange, className, ...props }: StepsProps): react.JSX.Element;
|
|
693
695
|
/** 分段选择的值类型。 */
|
|
694
696
|
type SegmentedValue = string | number;
|
|
695
697
|
/** 分段选择的候选项定义。 */
|
|
@@ -1882,6 +1884,12 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
|
|
|
1882
1884
|
declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
|
|
1883
1885
|
/** 图片预览的属性配置。 */
|
|
1884
1886
|
interface ImagePreviewProps {
|
|
1887
|
+
/** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
|
|
1888
|
+
current?: number;
|
|
1889
|
+
/** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
|
|
1890
|
+
count?: number;
|
|
1891
|
+
/** 切换图片时回调新的序号,由外部同步 current、src 与 alt。 */
|
|
1892
|
+
onCurrentChange?: (current: number) => void;
|
|
1885
1893
|
/** 是否打开;传入后由外部控制显示状态。 */
|
|
1886
1894
|
open: boolean;
|
|
1887
1895
|
/** 图片或资源地址。 */
|
|
@@ -1895,7 +1903,7 @@ interface ImagePreviewProps {
|
|
|
1895
1903
|
onOpenChange: (open: boolean) => void;
|
|
1896
1904
|
}
|
|
1897
1905
|
/** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。 */
|
|
1898
|
-
declare function ImagePreview({ open, src, alt, onOpenChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1906
|
+
declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1899
1907
|
/** 图片预览的配置。 */
|
|
1900
1908
|
interface ImagePreviewConfig {
|
|
1901
1909
|
/** 图片或资源地址。 */
|
|
@@ -1926,6 +1934,13 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1926
1934
|
*/
|
|
1927
1935
|
rootClassName?: string;
|
|
1928
1936
|
}
|
|
1937
|
+
/** 图片预览组的配置。 */
|
|
1938
|
+
interface ImagePreviewGroupProps {
|
|
1939
|
+
/** 包含 Image 的内容,可嵌套布局容器;preview=false 或受控预览的 Image 不加入分组。 */
|
|
1940
|
+
children?: ReactNode;
|
|
1941
|
+
}
|
|
1942
|
+
/** 按图片在页面中的顺序组织预览,支持按钮和方向键切换;删除当前图片时关闭预览。 */
|
|
1943
|
+
declare function ImagePreviewGroup({ children }: ImagePreviewGroupProps): react.JSX.Element;
|
|
1929
1944
|
/** 图片组件。 */
|
|
1930
1945
|
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1931
1946
|
|
|
@@ -2085,8 +2100,10 @@ interface UploadRef {
|
|
|
2085
2100
|
}
|
|
2086
2101
|
/** 文件上传属性;未配置 request/customRequest 时仅选择文件,不模拟上传成功。 */
|
|
2087
2102
|
interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
2088
|
-
/** 扩展名或 MIME
|
|
2103
|
+
/** 扩展名或 MIME 类型,逗号分隔;默认对点击、拖拽和粘贴均校验,acceptMode="hint" 时仅作为系统文件选择器提示。 */
|
|
2089
2104
|
accept?: string;
|
|
2105
|
+
/** 文件类型校验方式:validate 在进入队列前按 accept 拒绝不匹配文件;hint 仅保留文件选择器过滤提示,全部所选文件继续交给 beforeUpload,便于业务生成完整失败明细。默认 validate;hint 模式须由业务校验类型,不改变 maxCount、禁用或目录规则。 */
|
|
2106
|
+
acceptMode?: "validate" | "hint";
|
|
2090
2107
|
/** 每批是否允许多个文件;false 仅取首个,directory 模式不受此限制。 @defaultValue false */
|
|
2091
2108
|
multiple?: boolean;
|
|
2092
2109
|
/** 选择或拖入文件夹,文件路径保存在 relativePath;不会上传空目录。 @defaultValue false */
|
|
@@ -2424,4 +2441,4 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
2424
2441
|
/** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
|
|
2425
2442
|
declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
|
|
2426
2443
|
|
|
2427
|
-
export { type
|
|
2444
|
+
export { type MenuMode as $, type FloatButtonGroupProps as A, type BadgeProps as B, Calendar as C, Dropdown as D, type FloatButtonProps as E, FILLED_ICON_NAMES as F, type FloatButtonShape as G, type FloatingPlacement as H, type FloatingTrigger as I, ICON_NAMES as J, Icon as K, type IconName as L, type IconProps as M, type IconVariant as N, Image as O, ImagePreview as P, type ImagePreviewConfig as Q, ImagePreviewGroup as R, type ImagePreviewGroupProps as S, type TagStatus as T, type ImagePreviewProps as U, type ImageProps as V, Input as W, type InputProps as X, Menu as Y, type MenuClickInfo as Z, type MenuItem as _, Badge as a, Upload as a$, type MenuProps as a0, type MenuTheme as a1, type MessageConfig as a2, type MessageHandle as a3, type MessageKey as a4, type MessageType as a5, type NotificationConfig as a6, type NotificationPlacement as a7, type NotificationType as a8, Popconfirm as a9, type TabsProps as aA, type TabsType as aB, Tag as aC, type TagProps as aD, type TagSize as aE, type TagVariant as aF, Timeline as aG, type TimelineItem as aH, type TimelineProps as aI, Toolbar as aJ, type ToolbarItem as aK, type ToolbarProps as aL, Tooltip as aM, type TooltipProps as aN, Tour as aO, type TourProps as aP, type TourStep as aQ, Tree as aR, type TreeDropPosition as aS, type TreeKey as aT, type TreeNode as aU, type TreeProps as aV, Typography as aW, type TypographyLinkProps as aX, type TypographyProps as aY, type TypographyTitleProps as aZ, type TypographyType as a_, type PopconfirmProps as aa, Popover as ab, type PopoverProps as ac, Progress as ad, type ProgressProps as ae, type ProgressStatus as af, Rate as ag, type RateProps as ah, Result as ai, type ResultProps as aj, type ResultStatus as ak, Segmented as al, type SegmentedOption as am, type SegmentedProps as an, type SegmentedValue as ao, Spin as ap, type SpinProps as aq, type StepItem as ar, type StepStatus as as, Steps as at, type StepsProps as au, type TabItem as av, Tabs as aw, type TabsContextMenuClickInfo as ax, type TabsOrientation as ay, type TabsPosition as az, type BadgeRibbonProps as b, type UploadChangeInfo as b0, type UploadDraggerProps as b1, type UploadFile as b2, type UploadFileStatus as b3, type UploadHttpRequest as b4, type UploadItemActions as b5, type UploadProps as b6, type UploadRef as b7, type UploadRejectInfo as b8, type UploadRequestHandle as b9, type UploadRequestOptions as ba, Watermark as bb, type WatermarkFont as bc, type WatermarkProps as bd, message as be, notification as bf, type BadgeStatus as c, Breadcrumb as d, type BreadcrumbItem as e, type BreadcrumbProps as f, type CalendarProps as g, Card as h, type CardAccent as i, type CardProps as j, Carousel as k, type CarouselProps as l, type CarouselRef as m, Collapse as n, type CollapseItem as o, type CollapseKey as p, type CollapseProps as q, type DropdownButtonProps as r, type DropdownMenuProps as s, type DropdownOpenSource as t, type DropdownPlacement as u, type DropdownProps as v, type DropdownTrigger as w, type FilledIconName as x, FloatButton as y, type FloatButtonBackTopProps as z };
|
package/dist/core.cjs
CHANGED
|
@@ -3557,7 +3557,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
|
|
|
3557
3557
|
] }, item.key);
|
|
3558
3558
|
}) });
|
|
3559
3559
|
}
|
|
3560
|
-
function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
3560
|
+
function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
|
|
3561
3561
|
const previewRef = (0, import_react19.useRef)(null);
|
|
3562
3562
|
const stageRef = (0, import_react19.useRef)(null);
|
|
3563
3563
|
const [natural, setNatural] = (0, import_react19.useState)({ src: "", width: 0, height: 0 });
|
|
@@ -3580,6 +3580,18 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3580
3580
|
reset();
|
|
3581
3581
|
setFailed(false);
|
|
3582
3582
|
}, [open, src]);
|
|
3583
|
+
(0, import_react19.useEffect)(() => {
|
|
3584
|
+
if (!open || !onCurrentChange || count < 2) return;
|
|
3585
|
+
const handleKey = (event) => {
|
|
3586
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
3587
|
+
event.preventDefault();
|
|
3588
|
+
event.stopPropagation();
|
|
3589
|
+
const next = current + (event.key === "ArrowRight" ? 1 : -1);
|
|
3590
|
+
if (next >= 0 && next < count) onCurrentChange(next);
|
|
3591
|
+
};
|
|
3592
|
+
document.addEventListener("keydown", handleKey, true);
|
|
3593
|
+
return () => document.removeEventListener("keydown", handleKey, true);
|
|
3594
|
+
}, [open, current, count, onCurrentChange]);
|
|
3583
3595
|
(0, import_react19.useEffect)(() => {
|
|
3584
3596
|
const stage = stageRef.current;
|
|
3585
3597
|
if (!open || !stage) return;
|
|
@@ -3636,6 +3648,15 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3636
3648
|
src
|
|
3637
3649
|
) }),
|
|
3638
3650
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
|
|
3651
|
+
count > 1 && onCurrentChange ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
3652
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", "aria-label": "\u4E0A\u4E00\u5F20", disabled: current === 0, onClick: () => onCurrentChange(current - 1), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron-left" }) }),
|
|
3653
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("output", { "aria-label": "\u56FE\u7247\u5E8F\u53F7", children: [
|
|
3654
|
+
current + 1,
|
|
3655
|
+
" / ",
|
|
3656
|
+
count
|
|
3657
|
+
] }),
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", "aria-label": "\u4E0B\u4E00\u5F20", disabled: current >= count - 1, onClick: () => onCurrentChange(current + 1), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron-right" }) })
|
|
3659
|
+
] }) : null,
|
|
3639
3660
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u6C34\u5E73\u7FFB\u8F6C", "aria-label": "\u6C34\u5E73\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, x: -value.x })), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "flip-horizontal", size: 20 }) }),
|
|
3640
3661
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5782\u76F4\u7FFB\u8F6C", "aria-label": "\u5782\u76F4\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, y: -value.y })), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "flip-vertical", size: 20 }) }),
|
|
3641
3662
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5411\u5DE6\u65CB\u8F6C", "aria-label": "\u5411\u5DE6\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
@@ -3653,6 +3674,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3653
3674
|
] })
|
|
3654
3675
|
] }), document.body);
|
|
3655
3676
|
}
|
|
3677
|
+
var ImageGroupContext = (0, import_react19.createContext)(null);
|
|
3656
3678
|
|
|
3657
3679
|
// src/components/FloatingPlaceholder.tsx
|
|
3658
3680
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -5202,6 +5224,7 @@ function UploadItem({ file, files, props, actions }) {
|
|
|
5202
5224
|
}
|
|
5203
5225
|
var UploadRoot = (0, import_react26.forwardRef)(function UploadRoot2({
|
|
5204
5226
|
accept,
|
|
5227
|
+
acceptMode = "validate",
|
|
5205
5228
|
multiple = false,
|
|
5206
5229
|
directory = false,
|
|
5207
5230
|
recursive = true,
|
|
@@ -5389,7 +5412,7 @@ var UploadRoot = (0, import_react26.forwardRef)(function UploadRoot2({
|
|
|
5389
5412
|
const selected = multiple || directory ? filtered : filtered.slice(0, 1);
|
|
5390
5413
|
const added = [];
|
|
5391
5414
|
for (const { file, path } of selected) {
|
|
5392
|
-
if (!acceptsUploadFile(file, accept)) {
|
|
5415
|
+
if (acceptMode === "validate" && !acceptsUploadFile(file, accept)) {
|
|
5393
5416
|
onReject?.({ file, reason: "accept" });
|
|
5394
5417
|
continue;
|
|
5395
5418
|
}
|
package/dist/core.css
CHANGED
|
@@ -3861,6 +3861,9 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3861
3861
|
.sia-table__row--striped .sia-table__cell {
|
|
3862
3862
|
background: color-mix(in srgb, var(--sia-color-background) 55%, var(--sia-color-surface));
|
|
3863
3863
|
}
|
|
3864
|
+
.sia-table__row--info .sia-table__cell {
|
|
3865
|
+
background: color-mix(in srgb, var(--sia-color-primary) 10%, var(--sia-color-surface));
|
|
3866
|
+
}
|
|
3864
3867
|
.sia-table__row--success .sia-table__cell {
|
|
3865
3868
|
background: color-mix(in srgb, var(--sia-color-success) 10%, var(--sia-color-surface));
|
|
3866
3869
|
}
|
|
@@ -8026,6 +8029,13 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8026
8029
|
padding: 0;
|
|
8027
8030
|
border: 0;
|
|
8028
8031
|
}
|
|
8032
|
+
.sia-form--fill {
|
|
8033
|
+
display: flex;
|
|
8034
|
+
flex: 1;
|
|
8035
|
+
flex-direction: column;
|
|
8036
|
+
min-width: 0;
|
|
8037
|
+
min-height: 0;
|
|
8038
|
+
}
|
|
8029
8039
|
.sia-form-item {
|
|
8030
8040
|
display: grid;
|
|
8031
8041
|
grid-template-columns: var(--sia-form-label-width, var(--sia-form-auto-label-width, 0px)) minmax(0, 1fr);
|
|
@@ -8863,6 +8873,47 @@ button.sia-pagination__total:disabled {
|
|
|
8863
8873
|
margin: 4px 0 0 12px;
|
|
8864
8874
|
padding: 0;
|
|
8865
8875
|
}
|
|
8876
|
+
.sia-steps__inline-tail {
|
|
8877
|
+
display: none;
|
|
8878
|
+
}
|
|
8879
|
+
@media (min-width: 721px) {
|
|
8880
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item {
|
|
8881
|
+
flex-direction: row;
|
|
8882
|
+
align-items: flex-start;
|
|
8883
|
+
}
|
|
8884
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item:last-child {
|
|
8885
|
+
flex: 0 0 auto;
|
|
8886
|
+
}
|
|
8887
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__head {
|
|
8888
|
+
width: auto;
|
|
8889
|
+
}
|
|
8890
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__head .sia-steps__tail {
|
|
8891
|
+
display: none;
|
|
8892
|
+
}
|
|
8893
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__content {
|
|
8894
|
+
width: auto;
|
|
8895
|
+
flex: 0 1 auto;
|
|
8896
|
+
margin: 0 0 0 10px;
|
|
8897
|
+
padding: 0;
|
|
8898
|
+
}
|
|
8899
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__title {
|
|
8900
|
+
line-height: 32px;
|
|
8901
|
+
}
|
|
8902
|
+
.sia-steps--horizontal.sia-steps--label-horizontal.sia-steps--small .sia-steps__title {
|
|
8903
|
+
line-height: 26px;
|
|
8904
|
+
}
|
|
8905
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__inline-tail {
|
|
8906
|
+
display: block;
|
|
8907
|
+
min-width: 12px;
|
|
8908
|
+
margin-block-start: 16px;
|
|
8909
|
+
}
|
|
8910
|
+
.sia-steps--horizontal.sia-steps--label-horizontal.sia-steps--small .sia-steps__inline-tail {
|
|
8911
|
+
margin-block-start: 13px;
|
|
8912
|
+
}
|
|
8913
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item:last-child .sia-steps__inline-tail {
|
|
8914
|
+
display: none;
|
|
8915
|
+
}
|
|
8916
|
+
}
|
|
8866
8917
|
.sia-segmented {
|
|
8867
8918
|
display: inline-flex;
|
|
8868
8919
|
align-items: stretch;
|
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,
|
|
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-DDpzWdxm.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-B9hlqeO5.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,
|
|
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-ChdEzTaQ.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-DgZW5a7j.js';
|
|
4
4
|
import 'react';
|
package/dist/core.js
CHANGED
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
Typography,
|
|
12
12
|
Upload,
|
|
13
13
|
message
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-B6MU2BBG.js";
|
|
15
15
|
import "./chunk-RX242MUO.js";
|
|
16
16
|
import {
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B7UK645K.js";
|
|
19
19
|
import {
|
|
20
20
|
Input,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XQB5K7V4.js";
|
|
23
23
|
import "./chunk-SCEHVGKV.js";
|
|
24
24
|
import {
|
|
25
25
|
Icon,
|
package/dist/game.css
CHANGED
|
@@ -3870,6 +3870,9 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3870
3870
|
.sia-table__row--striped .sia-table__cell {
|
|
3871
3871
|
background: color-mix(in srgb, var(--sia-color-background) 55%, var(--sia-color-surface));
|
|
3872
3872
|
}
|
|
3873
|
+
.sia-table__row--info .sia-table__cell {
|
|
3874
|
+
background: color-mix(in srgb, var(--sia-color-primary) 10%, var(--sia-color-surface));
|
|
3875
|
+
}
|
|
3873
3876
|
.sia-table__row--success .sia-table__cell {
|
|
3874
3877
|
background: color-mix(in srgb, var(--sia-color-success) 10%, var(--sia-color-surface));
|
|
3875
3878
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -87,6 +87,7 @@ __export(index_exports, {
|
|
|
87
87
|
Icon: () => Icon,
|
|
88
88
|
Image: () => Image2,
|
|
89
89
|
ImagePreview: () => ImagePreview,
|
|
90
|
+
ImagePreviewGroup: () => ImagePreviewGroup,
|
|
90
91
|
Input: () => Input,
|
|
91
92
|
InputNumber: () => InputNumber,
|
|
92
93
|
InputSelect: () => InputSelect,
|
|
@@ -2033,7 +2034,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
|
|
|
2033
2034
|
] }, item.key);
|
|
2034
2035
|
}) });
|
|
2035
2036
|
}
|
|
2036
|
-
function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
2037
|
+
function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
|
|
2037
2038
|
const previewRef = (0, import_react7.useRef)(null);
|
|
2038
2039
|
const stageRef = (0, import_react7.useRef)(null);
|
|
2039
2040
|
const [natural, setNatural] = (0, import_react7.useState)({ src: "", width: 0, height: 0 });
|
|
@@ -2056,6 +2057,18 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
2056
2057
|
reset();
|
|
2057
2058
|
setFailed(false);
|
|
2058
2059
|
}, [open, src]);
|
|
2060
|
+
(0, import_react7.useEffect)(() => {
|
|
2061
|
+
if (!open || !onCurrentChange || count < 2) return;
|
|
2062
|
+
const handleKey = (event) => {
|
|
2063
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
2064
|
+
event.preventDefault();
|
|
2065
|
+
event.stopPropagation();
|
|
2066
|
+
const next = current + (event.key === "ArrowRight" ? 1 : -1);
|
|
2067
|
+
if (next >= 0 && next < count) onCurrentChange(next);
|
|
2068
|
+
};
|
|
2069
|
+
document.addEventListener("keydown", handleKey, true);
|
|
2070
|
+
return () => document.removeEventListener("keydown", handleKey, true);
|
|
2071
|
+
}, [open, current, count, onCurrentChange]);
|
|
2059
2072
|
(0, import_react7.useEffect)(() => {
|
|
2060
2073
|
const stage = stageRef.current;
|
|
2061
2074
|
if (!open || !stage) return;
|
|
@@ -2112,6 +2125,15 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
2112
2125
|
src
|
|
2113
2126
|
) }),
|
|
2114
2127
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
|
|
2128
|
+
count > 1 && onCurrentChange ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", "aria-label": "\u4E0A\u4E00\u5F20", disabled: current === 0, onClick: () => onCurrentChange(current - 1), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chevron-left" }) }),
|
|
2130
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("output", { "aria-label": "\u56FE\u7247\u5E8F\u53F7", children: [
|
|
2131
|
+
current + 1,
|
|
2132
|
+
" / ",
|
|
2133
|
+
count
|
|
2134
|
+
] }),
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", "aria-label": "\u4E0B\u4E00\u5F20", disabled: current >= count - 1, onClick: () => onCurrentChange(current + 1), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chevron-right" }) })
|
|
2136
|
+
] }) : null,
|
|
2115
2137
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u6C34\u5E73\u7FFB\u8F6C", "aria-label": "\u6C34\u5E73\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, x: -value.x })), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "flip-horizontal", size: 20 }) }),
|
|
2116
2138
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u5782\u76F4\u7FFB\u8F6C", "aria-label": "\u5782\u76F4\u7FFB\u8F6C", disabled: !ready, onClick: () => setFlip((value) => ({ ...value, y: -value.y })), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "flip-vertical", size: 20 }) }),
|
|
2117
2139
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u5411\u5DE6\u65CB\u8F6C", "aria-label": "\u5411\u5DE6\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
@@ -2129,6 +2151,46 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
2129
2151
|
] })
|
|
2130
2152
|
] }), document.body);
|
|
2131
2153
|
}
|
|
2154
|
+
var ImageGroupContext = (0, import_react7.createContext)(null);
|
|
2155
|
+
function ImagePreviewGroup({ children }) {
|
|
2156
|
+
const images = (0, import_react7.useRef)(/* @__PURE__ */ new Map());
|
|
2157
|
+
const [active, setActive] = (0, import_react7.useState)();
|
|
2158
|
+
const [, setRevision] = (0, import_react7.useState)(0);
|
|
2159
|
+
const context = (0, import_react7.useMemo)(() => ({
|
|
2160
|
+
register: (id, image2) => {
|
|
2161
|
+
images.current.set(id, image2);
|
|
2162
|
+
setRevision((value) => value + 1);
|
|
2163
|
+
return () => {
|
|
2164
|
+
images.current.delete(id);
|
|
2165
|
+
setRevision((value) => value + 1);
|
|
2166
|
+
};
|
|
2167
|
+
},
|
|
2168
|
+
open: (id) => setActive(id)
|
|
2169
|
+
}), []);
|
|
2170
|
+
const entries = [...images.current].sort((a, b) => a[1].element.compareDocumentPosition(b[1].element) & 4 ? -1 : 1);
|
|
2171
|
+
const index = entries.findIndex(([id]) => id === active);
|
|
2172
|
+
const image = entries[index]?.[1];
|
|
2173
|
+
(0, import_react7.useEffect)(() => {
|
|
2174
|
+
if (active && index < 0) setActive(void 0);
|
|
2175
|
+
}, [active, index]);
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ImageGroupContext.Provider, { value: context, children: [
|
|
2177
|
+
children,
|
|
2178
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2179
|
+
ImagePreview,
|
|
2180
|
+
{
|
|
2181
|
+
open: Boolean(image),
|
|
2182
|
+
src: image?.src,
|
|
2183
|
+
alt: image?.alt,
|
|
2184
|
+
current: index,
|
|
2185
|
+
count: entries.length,
|
|
2186
|
+
onOpenChange: (open) => {
|
|
2187
|
+
if (!open) setActive(void 0);
|
|
2188
|
+
},
|
|
2189
|
+
onCurrentChange: (next) => setActive(entries[next]?.[0])
|
|
2190
|
+
}
|
|
2191
|
+
)
|
|
2192
|
+
] });
|
|
2193
|
+
}
|
|
2132
2194
|
function Image2({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onLoad, onError, style, ...props }) {
|
|
2133
2195
|
const config = typeof preview === "object" ? preview : {};
|
|
2134
2196
|
const controlled = typeof preview === "object" && preview.open !== void 0;
|
|
@@ -2137,16 +2199,24 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
|
|
|
2137
2199
|
const [loaded, setLoaded] = (0, import_react7.useState)(false);
|
|
2138
2200
|
const [failed, setFailed] = (0, import_react7.useState)(false);
|
|
2139
2201
|
const displaySrc = failed && fallback ? fallback : src;
|
|
2202
|
+
const group = (0, import_react7.useContext)(ImageGroupContext);
|
|
2203
|
+
const groupId = (0, import_react7.useId)();
|
|
2204
|
+
const rootRef = (0, import_react7.useRef)(null);
|
|
2205
|
+
const grouped = Boolean(group && preview && !controlled && displaySrc);
|
|
2206
|
+
(0, import_react7.useEffect)(() => {
|
|
2207
|
+
if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: displaySrc, alt, element: rootRef.current });
|
|
2208
|
+
}, [group, grouped, groupId, displaySrc, alt]);
|
|
2140
2209
|
const radius = typeof style?.borderRadius === "number" ? `${style.borderRadius}px` : style?.borderRadius;
|
|
2141
2210
|
const rootStyle = {
|
|
2142
2211
|
...style,
|
|
2143
2212
|
"--sia-image-radius": radius ?? "var(--sia-radius)"
|
|
2144
2213
|
};
|
|
2145
2214
|
function setOpen(next) {
|
|
2146
|
-
if (
|
|
2215
|
+
if (grouped && next) group?.open(groupId);
|
|
2216
|
+
else if (!controlled) setInternalOpen(next);
|
|
2147
2217
|
config.onOpenChange?.(next);
|
|
2148
2218
|
}
|
|
2149
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
2219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { ref: rootRef, className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
2150
2220
|
!loaded && placeholder ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-image__placeholder", children: placeholder }) : null,
|
|
2151
2221
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (event) => {
|
|
2152
2222
|
setLoaded(true);
|
|
@@ -2638,8 +2708,8 @@ function Menu({
|
|
|
2638
2708
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
2639
2709
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
2640
2710
|
}
|
|
2641
|
-
function Steps({ items, current = 0, initial: initial3 = 0, direction = "horizontal", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
2642
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
2711
|
+
function Steps({ items, current = 0, initial: initial3 = 0, direction = "horizontal", labelPlacement = "vertical", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
2712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} sia-steps--label-${labelPlacement} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
2643
2713
|
const index = rawIndex + initial3;
|
|
2644
2714
|
const itemStatus = item.status ?? (index < current ? "finish" : index === current ? status : "wait");
|
|
2645
2715
|
const dot = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sia-steps__dot" });
|
|
@@ -2655,7 +2725,8 @@ function Steps({ items, current = 0, initial: initial3 = 0, direction = "horizon
|
|
|
2655
2725
|
item.subTitle ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: item.subTitle }) : null
|
|
2656
2726
|
] }),
|
|
2657
2727
|
item.description ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sia-steps__description", children: item.description }) : null
|
|
2658
|
-
] })
|
|
2728
|
+
] }),
|
|
2729
|
+
direction === "horizontal" && labelPlacement === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sia-steps__tail sia-steps__inline-tail" }) : null
|
|
2659
2730
|
] }, index);
|
|
2660
2731
|
}) });
|
|
2661
2732
|
}
|
|
@@ -7407,6 +7478,7 @@ function useForm(form) {
|
|
|
7407
7478
|
return [ref.current];
|
|
7408
7479
|
}
|
|
7409
7480
|
function FormRoot({
|
|
7481
|
+
fill = false,
|
|
7410
7482
|
form,
|
|
7411
7483
|
initialValues,
|
|
7412
7484
|
layout = "horizontal",
|
|
@@ -7473,7 +7545,7 @@ function FormRoot({
|
|
|
7473
7545
|
{
|
|
7474
7546
|
ref: formRef,
|
|
7475
7547
|
...withTitleTooltip(props),
|
|
7476
|
-
className: `sia-form sia-form--${layout} sia-form--${size}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
7548
|
+
className: `sia-form sia-form--${layout} sia-form--${size}${fill ? " sia-form--fill" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
7477
7549
|
"data-required-mark": requiredMark,
|
|
7478
7550
|
onSubmit: (event) => {
|
|
7479
7551
|
event.preventDefault();
|
|
@@ -9850,6 +9922,7 @@ function UploadItem({ file, files, props, actions }) {
|
|
|
9850
9922
|
}
|
|
9851
9923
|
var UploadRoot = (0, import_react42.forwardRef)(function UploadRoot2({
|
|
9852
9924
|
accept,
|
|
9925
|
+
acceptMode = "validate",
|
|
9853
9926
|
multiple = false,
|
|
9854
9927
|
directory = false,
|
|
9855
9928
|
recursive = true,
|
|
@@ -10037,7 +10110,7 @@ var UploadRoot = (0, import_react42.forwardRef)(function UploadRoot2({
|
|
|
10037
10110
|
const selected = multiple || directory ? filtered : filtered.slice(0, 1);
|
|
10038
10111
|
const added = [];
|
|
10039
10112
|
for (const { file, path } of selected) {
|
|
10040
|
-
if (!acceptsUploadFile(file, accept)) {
|
|
10113
|
+
if (acceptMode === "validate" && !acceptsUploadFile(file, accept)) {
|
|
10041
10114
|
onReject?.({ file, reason: "accept" });
|
|
10042
10115
|
continue;
|
|
10043
10116
|
}
|
|
@@ -16333,6 +16406,7 @@ function TableInner(props, ref) {
|
|
|
16333
16406
|
loading = false,
|
|
16334
16407
|
emptyText = "\u6682\u65E0\u6570\u636E",
|
|
16335
16408
|
height,
|
|
16409
|
+
maxBodyHeight,
|
|
16336
16410
|
tableHeight,
|
|
16337
16411
|
fillRemaining,
|
|
16338
16412
|
size = "medium",
|
|
@@ -16603,7 +16677,8 @@ function TableInner(props, ref) {
|
|
|
16603
16677
|
const rightFixedEdgeKey = leafColumns.find((column) => normalizeFixed(column.fixed) === "right")?.key;
|
|
16604
16678
|
const canvas = renderMode === "canvas" && !sortedPlugins.some((plugin) => plugin.disableVirtual);
|
|
16605
16679
|
const shouldVirtualize = canvas || pipeline.rows.length > 100 || (virtual ?? pipeline.rows.length >= virtualThreshold) && !sortedPlugins.some((plugin) => plugin.disableVirtual);
|
|
16606
|
-
const
|
|
16680
|
+
const firstVisibleIndex = Math.min(Math.floor(scrollTop / rowHeight), Math.max(0, pipeline.rows.length - Math.ceil(viewportHeight / rowHeight)));
|
|
16681
|
+
const startIndex = shouldVirtualize ? Math.max(0, firstVisibleIndex - overscan) : 0;
|
|
16607
16682
|
const visibleCount = shouldVirtualize ? Math.ceil(viewportHeight / rowHeight) + overscan * 2 : pipeline.rows.length;
|
|
16608
16683
|
const endIndex = shouldVirtualize ? Math.min(pipeline.rows.length, startIndex + visibleCount) : pipeline.rows.length;
|
|
16609
16684
|
const renderedRows = pipeline.rows.slice(startIndex, endIndex);
|
|
@@ -16652,7 +16727,10 @@ function TableInner(props, ref) {
|
|
|
16652
16727
|
return content ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_react57.Fragment, { children: content }, `overlay-${plugin.id}`) : null;
|
|
16653
16728
|
}).filter(Boolean);
|
|
16654
16729
|
const hasToolbar = toolbarStart.length > 0 || toolbarEnd.length > 0;
|
|
16655
|
-
const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize ? 420 : void 0);
|
|
16730
|
+
const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize && maxBodyHeight == null ? 420 : void 0);
|
|
16731
|
+
const viewportStyle = maxBodyHeight == null ? void 0 : {
|
|
16732
|
+
maxHeight: `calc(${typeof maxBodyHeight === "number" ? `${maxBodyHeight}px` : maxBodyHeight} + var(--sia-table-header-height))`
|
|
16733
|
+
};
|
|
16656
16734
|
const rootStyle = {
|
|
16657
16735
|
...style,
|
|
16658
16736
|
height: effectiveHeight,
|
|
@@ -16855,7 +16933,7 @@ function TableInner(props, ref) {
|
|
|
16855
16933
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { children: toolbarStart }),
|
|
16856
16934
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { children: toolbarEnd })
|
|
16857
16935
|
] }) : null,
|
|
16858
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "sia-table__viewport-wrap", children: [
|
|
16936
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "sia-table__viewport-wrap", style: viewportStyle, children: [
|
|
16859
16937
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "sia-table__viewport", ref: scrollRef, onScroll: handleScroll, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("table", { ref: tableRef, className: "sia-table__element", style: { width: Math.max(totalWidth, 1), ...manualColumnLayout ? { minWidth: 0 } : {}, ...tableStyle }, children: [
|
|
16860
16938
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("colgroup", { children: leafColumns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("col", { "data-column-key": column.key, style: { width: columnWidths.get(column.key) ?? DEFAULT_WIDTH } }, column.key)) }),
|
|
16861
16939
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("thead", { className: stickyHeader ? "sia-table__head sia-table__head--sticky" : "sia-table__head", children: headerRows.map((headerRow, depth) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { children: headerRow.map((cell) => {
|
|
@@ -16885,6 +16963,7 @@ function TableInner(props, ref) {
|
|
|
16885
16963
|
);
|
|
16886
16964
|
}) }, depth)) }),
|
|
16887
16965
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tbody", { children: [
|
|
16966
|
+
maxBodyHeight != null && pipeline.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { colSpan: leafColumns.length, style: { height: 120, padding: 0, border: 0 } }) }) : null,
|
|
16888
16967
|
pipeline.rows.length === 0 && summaries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { colSpan: leafColumns.length, style: { height: Math.max(0, viewportHeight - (headerRows.length + summaries.length) * rowHeight), padding: 0, border: 0 } }) }) : null,
|
|
16889
16968
|
topSpacer > 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { colSpan: leafColumns.length, style: { height: topSpacer, padding: 0, border: 0 } }) }) : null,
|
|
16890
16969
|
renderedRows.map((row, offset) => {
|
|
@@ -25747,6 +25826,7 @@ function Result({ status = "info", title, subTitle, icon, extra, children, class
|
|
|
25747
25826
|
Icon,
|
|
25748
25827
|
Image,
|
|
25749
25828
|
ImagePreview,
|
|
25829
|
+
ImagePreviewGroup,
|
|
25750
25830
|
Input,
|
|
25751
25831
|
InputNumber,
|
|
25752
25832
|
InputSelect,
|
package/dist/index.css
CHANGED
|
@@ -3861,6 +3861,9 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
3861
3861
|
.sia-table__row--striped .sia-table__cell {
|
|
3862
3862
|
background: color-mix(in srgb, var(--sia-color-background) 55%, var(--sia-color-surface));
|
|
3863
3863
|
}
|
|
3864
|
+
.sia-table__row--info .sia-table__cell {
|
|
3865
|
+
background: color-mix(in srgb, var(--sia-color-primary) 10%, var(--sia-color-surface));
|
|
3866
|
+
}
|
|
3864
3867
|
.sia-table__row--success .sia-table__cell {
|
|
3865
3868
|
background: color-mix(in srgb, var(--sia-color-success) 10%, var(--sia-color-surface));
|
|
3866
3869
|
}
|
|
@@ -8026,6 +8029,13 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8026
8029
|
padding: 0;
|
|
8027
8030
|
border: 0;
|
|
8028
8031
|
}
|
|
8032
|
+
.sia-form--fill {
|
|
8033
|
+
display: flex;
|
|
8034
|
+
flex: 1;
|
|
8035
|
+
flex-direction: column;
|
|
8036
|
+
min-width: 0;
|
|
8037
|
+
min-height: 0;
|
|
8038
|
+
}
|
|
8029
8039
|
.sia-form-item {
|
|
8030
8040
|
display: grid;
|
|
8031
8041
|
grid-template-columns: var(--sia-form-label-width, var(--sia-form-auto-label-width, 0px)) minmax(0, 1fr);
|
|
@@ -8863,6 +8873,47 @@ button.sia-pagination__total:disabled {
|
|
|
8863
8873
|
margin: 4px 0 0 12px;
|
|
8864
8874
|
padding: 0;
|
|
8865
8875
|
}
|
|
8876
|
+
.sia-steps__inline-tail {
|
|
8877
|
+
display: none;
|
|
8878
|
+
}
|
|
8879
|
+
@media (min-width: 721px) {
|
|
8880
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item {
|
|
8881
|
+
flex-direction: row;
|
|
8882
|
+
align-items: flex-start;
|
|
8883
|
+
}
|
|
8884
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item:last-child {
|
|
8885
|
+
flex: 0 0 auto;
|
|
8886
|
+
}
|
|
8887
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__head {
|
|
8888
|
+
width: auto;
|
|
8889
|
+
}
|
|
8890
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__head .sia-steps__tail {
|
|
8891
|
+
display: none;
|
|
8892
|
+
}
|
|
8893
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__content {
|
|
8894
|
+
width: auto;
|
|
8895
|
+
flex: 0 1 auto;
|
|
8896
|
+
margin: 0 0 0 10px;
|
|
8897
|
+
padding: 0;
|
|
8898
|
+
}
|
|
8899
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__title {
|
|
8900
|
+
line-height: 32px;
|
|
8901
|
+
}
|
|
8902
|
+
.sia-steps--horizontal.sia-steps--label-horizontal.sia-steps--small .sia-steps__title {
|
|
8903
|
+
line-height: 26px;
|
|
8904
|
+
}
|
|
8905
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__inline-tail {
|
|
8906
|
+
display: block;
|
|
8907
|
+
min-width: 12px;
|
|
8908
|
+
margin-block-start: 16px;
|
|
8909
|
+
}
|
|
8910
|
+
.sia-steps--horizontal.sia-steps--label-horizontal.sia-steps--small .sia-steps__inline-tail {
|
|
8911
|
+
margin-block-start: 13px;
|
|
8912
|
+
}
|
|
8913
|
+
.sia-steps--horizontal.sia-steps--label-horizontal .sia-steps__item:last-child .sia-steps__inline-tail {
|
|
8914
|
+
display: none;
|
|
8915
|
+
}
|
|
8916
|
+
}
|
|
8866
8917
|
.sia-segmented {
|
|
8867
8918
|
display: inline-flex;
|
|
8868
8919
|
align-items: stretch;
|
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
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-DDpzWdxm.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-DDpzWdxm.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';
|
|
@@ -828,6 +828,8 @@ interface FormInstance {
|
|
|
828
828
|
declare function useForm(form?: FormInstance): readonly [FormInstance];
|
|
829
829
|
/** 表单的属性配置。 */
|
|
830
830
|
interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
831
|
+
/** 是否作为纵向弹性容器填满父容器剩余高度;父容器需提供确定高度,子列表可用 flex 分配剩余空间。默认 false。 */
|
|
832
|
+
fill?: boolean;
|
|
831
833
|
/** 组件尺寸;用于调整控件高度、字号和间距。 */
|
|
832
834
|
size?: ControlSize;
|
|
833
835
|
/** 表单实例;可由 Form.useForm() 或 useForm() 创建。 */
|
|
@@ -863,7 +865,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
863
865
|
/** 字段通过表单控件交互更新时调用,接收本次变化字段和完整值;用于联动查询条件等业务逻辑。 */
|
|
864
866
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
865
867
|
}
|
|
866
|
-
declare function FormRoot({ form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
868
|
+
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
867
869
|
/** 表单项的字段绑定、标签、校验及内容配置;默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
868
870
|
interface FormItemProps {
|
|
869
871
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
@@ -2266,6 +2268,8 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2266
2268
|
emptyText?: ReactNode;
|
|
2267
2269
|
/** 高度;数值按像素处理,字符串可使用 CSS 尺寸。 */
|
|
2268
2270
|
height?: number | string;
|
|
2271
|
+
/** 数据内容区的最大高度(不含表头、工具栏和分页);数值为 px,字符串为 CSS 长度。少量行按自然高度展示,超出后内部滚动;不设置则不额外限制。与 height 同时使用时两者共同约束。 */
|
|
2272
|
+
maxBodyHeight?: number | string;
|
|
2269
2273
|
/**
|
|
2270
2274
|
* 自动填充从表格顶部到可视区域底部的剩余高度,包含工具栏和分页;true 使用当前窗口视口。
|
|
2271
2275
|
* 查询区尺寸、祖先布局、窗口尺寸及隐藏页签显示后自动重测。height / tableHeight 显式设置时优先。
|
|
@@ -2329,11 +2333,11 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2329
2333
|
/** 单元格右键事件,可用于业务上下文菜单 */
|
|
2330
2334
|
onCellContextMenu?: (record: T, column: TableColumn<T>, index: number, event: MouseEvent<HTMLTableCellElement>) => void;
|
|
2331
2335
|
/**
|
|
2332
|
-
*
|
|
2336
|
+
* 行的语义状态,info 使用主题蓝色表示进行中或提示,success / warning / error 分别使用成功、警告、错误背景色;默认不设置。
|
|
2333
2337
|
* 可传固定状态或计算函数,函数参数为当前记录和原始数据索引,返回 undefined 时沿用普通行背景。
|
|
2334
2338
|
* 状态背景覆盖斑马纹,悬停和勾选反馈优先;普通列、固定列及 Canvas 模式行为一致。
|
|
2335
2339
|
*/
|
|
2336
|
-
rowStatus?: "success" | "warning" | "error" | ((record: T, index: number) => "success" | "warning" | "error" | undefined);
|
|
2340
|
+
rowStatus?: "info" | "success" | "warning" | "error" | ((record: T, index: number) => "info" | "success" | "warning" | "error" | undefined);
|
|
2337
2341
|
/** 行的 CSS 类名或计算函数。 */
|
|
2338
2342
|
rowClassName?: string | ((record: T, index: number) => string);
|
|
2339
2343
|
/** 表格元素的内联样式。 */
|
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
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-ChdEzTaQ.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-ChdEzTaQ.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';
|
|
@@ -828,6 +828,8 @@ interface FormInstance {
|
|
|
828
828
|
declare function useForm(form?: FormInstance): readonly [FormInstance];
|
|
829
829
|
/** 表单的属性配置。 */
|
|
830
830
|
interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
831
|
+
/** 是否作为纵向弹性容器填满父容器剩余高度;父容器需提供确定高度,子列表可用 flex 分配剩余空间。默认 false。 */
|
|
832
|
+
fill?: boolean;
|
|
831
833
|
/** 组件尺寸;用于调整控件高度、字号和间距。 */
|
|
832
834
|
size?: ControlSize;
|
|
833
835
|
/** 表单实例;可由 Form.useForm() 或 useForm() 创建。 */
|
|
@@ -863,7 +865,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
|
|
|
863
865
|
/** 字段通过表单控件交互更新时调用,接收本次变化字段和完整值;用于联动查询条件等业务逻辑。 */
|
|
864
866
|
onValuesChange?: (changedValues: FormValues, values: FormValues) => void;
|
|
865
867
|
}
|
|
866
|
-
declare function FormRoot({ form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
868
|
+
declare function FormRoot({ fill, form, initialValues, layout, size: sizeProp, placeholderMode, disabled, requiredMark, className, onFinish, onFinishFailed, onValuesChange, children, ...props }: FormProps): react.JSX.Element;
|
|
867
869
|
/** 表单项的字段绑定、标签、校验及内容配置;默认保留 8px 下外边距,noStyle 不生成布局容器或间距。 */
|
|
868
870
|
interface FormItemProps {
|
|
869
871
|
/** 绑定到表单值的字段名或嵌套路径,例如 ["user", "name"]。 */
|
|
@@ -2266,6 +2268,8 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2266
2268
|
emptyText?: ReactNode;
|
|
2267
2269
|
/** 高度;数值按像素处理,字符串可使用 CSS 尺寸。 */
|
|
2268
2270
|
height?: number | string;
|
|
2271
|
+
/** 数据内容区的最大高度(不含表头、工具栏和分页);数值为 px,字符串为 CSS 长度。少量行按自然高度展示,超出后内部滚动;不设置则不额外限制。与 height 同时使用时两者共同约束。 */
|
|
2272
|
+
maxBodyHeight?: number | string;
|
|
2269
2273
|
/**
|
|
2270
2274
|
* 自动填充从表格顶部到可视区域底部的剩余高度,包含工具栏和分页;true 使用当前窗口视口。
|
|
2271
2275
|
* 查询区尺寸、祖先布局、窗口尺寸及隐藏页签显示后自动重测。height / tableHeight 显式设置时优先。
|
|
@@ -2329,11 +2333,11 @@ interface TableProps<T extends Record<string, unknown> = Record<string, unknown>
|
|
|
2329
2333
|
/** 单元格右键事件,可用于业务上下文菜单 */
|
|
2330
2334
|
onCellContextMenu?: (record: T, column: TableColumn<T>, index: number, event: MouseEvent<HTMLTableCellElement>) => void;
|
|
2331
2335
|
/**
|
|
2332
|
-
*
|
|
2336
|
+
* 行的语义状态,info 使用主题蓝色表示进行中或提示,success / warning / error 分别使用成功、警告、错误背景色;默认不设置。
|
|
2333
2337
|
* 可传固定状态或计算函数,函数参数为当前记录和原始数据索引,返回 undefined 时沿用普通行背景。
|
|
2334
2338
|
* 状态背景覆盖斑马纹,悬停和勾选反馈优先;普通列、固定列及 Canvas 模式行为一致。
|
|
2335
2339
|
*/
|
|
2336
|
-
rowStatus?: "success" | "warning" | "error" | ((record: T, index: number) => "success" | "warning" | "error" | undefined);
|
|
2340
|
+
rowStatus?: "info" | "success" | "warning" | "error" | ((record: T, index: number) => "info" | "success" | "warning" | "error" | undefined);
|
|
2337
2341
|
/** 行的 CSS 类名或计算函数。 */
|
|
2338
2342
|
rowClassName?: string | ((record: T, index: number) => string);
|
|
2339
2343
|
/** 表格元素的内联样式。 */
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
FloatButton,
|
|
68
68
|
Image,
|
|
69
69
|
ImagePreview,
|
|
70
|
+
ImagePreviewGroup,
|
|
70
71
|
Popconfirm,
|
|
71
72
|
Progress,
|
|
72
73
|
Rate,
|
|
@@ -81,7 +82,7 @@ import {
|
|
|
81
82
|
Watermark,
|
|
82
83
|
message,
|
|
83
84
|
notification
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-B6MU2BBG.js";
|
|
85
86
|
import "./chunk-RX242MUO.js";
|
|
86
87
|
import {
|
|
87
88
|
MarkdownEditor
|
|
@@ -89,12 +90,12 @@ import {
|
|
|
89
90
|
import {
|
|
90
91
|
RichTextContent,
|
|
91
92
|
RichTextEditor
|
|
92
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-JZK5OCZB.js";
|
|
93
94
|
import {
|
|
94
95
|
DatePicker,
|
|
95
96
|
SelectDateRange,
|
|
96
97
|
TimePanel
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-ZPRDG3RS.js";
|
|
98
99
|
import {
|
|
99
100
|
Checkbox,
|
|
100
101
|
FloatingScrollbarProvider,
|
|
@@ -106,14 +107,14 @@ import {
|
|
|
106
107
|
Tooltip,
|
|
107
108
|
Tree,
|
|
108
109
|
useScrollbarProximity
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-B7UK645K.js";
|
|
110
111
|
import {
|
|
111
112
|
Dropdown,
|
|
112
113
|
Input,
|
|
113
114
|
Menu,
|
|
114
115
|
Segmented,
|
|
115
116
|
Steps
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-XQB5K7V4.js";
|
|
117
118
|
import {
|
|
118
119
|
TextArea
|
|
119
120
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -1940,6 +1941,7 @@ function useForm(form) {
|
|
|
1940
1941
|
return [ref.current];
|
|
1941
1942
|
}
|
|
1942
1943
|
function FormRoot({
|
|
1944
|
+
fill = false,
|
|
1943
1945
|
form,
|
|
1944
1946
|
initialValues,
|
|
1945
1947
|
layout = "horizontal",
|
|
@@ -2006,7 +2008,7 @@ function FormRoot({
|
|
|
2006
2008
|
{
|
|
2007
2009
|
ref: formRef,
|
|
2008
2010
|
...withTitleTooltip(props),
|
|
2009
|
-
className: `sia-form sia-form--${layout} sia-form--${size}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
2011
|
+
className: `sia-form sia-form--${layout} sia-form--${size}${fill ? " sia-form--fill" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
2010
2012
|
"data-required-mark": requiredMark,
|
|
2011
2013
|
onSubmit: (event) => {
|
|
2012
2014
|
event.preventDefault();
|
|
@@ -8341,6 +8343,7 @@ function TableInner(props, ref) {
|
|
|
8341
8343
|
loading = false,
|
|
8342
8344
|
emptyText = "\u6682\u65E0\u6570\u636E",
|
|
8343
8345
|
height,
|
|
8346
|
+
maxBodyHeight,
|
|
8344
8347
|
tableHeight,
|
|
8345
8348
|
fillRemaining,
|
|
8346
8349
|
size = "medium",
|
|
@@ -8611,7 +8614,8 @@ function TableInner(props, ref) {
|
|
|
8611
8614
|
const rightFixedEdgeKey = leafColumns.find((column) => normalizeFixed(column.fixed) === "right")?.key;
|
|
8612
8615
|
const canvas = renderMode === "canvas" && !sortedPlugins.some((plugin) => plugin.disableVirtual);
|
|
8613
8616
|
const shouldVirtualize = canvas || pipeline.rows.length > 100 || (virtual ?? pipeline.rows.length >= virtualThreshold) && !sortedPlugins.some((plugin) => plugin.disableVirtual);
|
|
8614
|
-
const
|
|
8617
|
+
const firstVisibleIndex = Math.min(Math.floor(scrollTop / rowHeight), Math.max(0, pipeline.rows.length - Math.ceil(viewportHeight / rowHeight)));
|
|
8618
|
+
const startIndex = shouldVirtualize ? Math.max(0, firstVisibleIndex - overscan) : 0;
|
|
8615
8619
|
const visibleCount = shouldVirtualize ? Math.ceil(viewportHeight / rowHeight) + overscan * 2 : pipeline.rows.length;
|
|
8616
8620
|
const endIndex = shouldVirtualize ? Math.min(pipeline.rows.length, startIndex + visibleCount) : pipeline.rows.length;
|
|
8617
8621
|
const renderedRows = pipeline.rows.slice(startIndex, endIndex);
|
|
@@ -8660,7 +8664,10 @@ function TableInner(props, ref) {
|
|
|
8660
8664
|
return content ? /* @__PURE__ */ jsx25(Fragment8, { children: content }, `overlay-${plugin.id}`) : null;
|
|
8661
8665
|
}).filter(Boolean);
|
|
8662
8666
|
const hasToolbar = toolbarStart.length > 0 || toolbarEnd.length > 0;
|
|
8663
|
-
const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize ? 420 : void 0);
|
|
8667
|
+
const effectiveHeight = height ?? tableHeight ?? remainingHeight ?? (shouldVirtualize && maxBodyHeight == null ? 420 : void 0);
|
|
8668
|
+
const viewportStyle = maxBodyHeight == null ? void 0 : {
|
|
8669
|
+
maxHeight: `calc(${typeof maxBodyHeight === "number" ? `${maxBodyHeight}px` : maxBodyHeight} + var(--sia-table-header-height))`
|
|
8670
|
+
};
|
|
8664
8671
|
const rootStyle = {
|
|
8665
8672
|
...style,
|
|
8666
8673
|
height: effectiveHeight,
|
|
@@ -8863,7 +8870,7 @@ function TableInner(props, ref) {
|
|
|
8863
8870
|
/* @__PURE__ */ jsx25("div", { children: toolbarStart }),
|
|
8864
8871
|
/* @__PURE__ */ jsx25("div", { children: toolbarEnd })
|
|
8865
8872
|
] }) : null,
|
|
8866
|
-
/* @__PURE__ */ jsxs23("div", { className: "sia-table__viewport-wrap", children: [
|
|
8873
|
+
/* @__PURE__ */ jsxs23("div", { className: "sia-table__viewport-wrap", style: viewportStyle, children: [
|
|
8867
8874
|
/* @__PURE__ */ jsx25("div", { className: "sia-table__viewport", ref: scrollRef, onScroll: handleScroll, children: /* @__PURE__ */ jsxs23("table", { ref: tableRef, className: "sia-table__element", style: { width: Math.max(totalWidth, 1), ...manualColumnLayout ? { minWidth: 0 } : {}, ...tableStyle }, children: [
|
|
8868
8875
|
/* @__PURE__ */ jsx25("colgroup", { children: leafColumns.map((column) => /* @__PURE__ */ jsx25("col", { "data-column-key": column.key, style: { width: columnWidths.get(column.key) ?? DEFAULT_WIDTH } }, column.key)) }),
|
|
8869
8876
|
/* @__PURE__ */ jsx25("thead", { className: stickyHeader ? "sia-table__head sia-table__head--sticky" : "sia-table__head", children: headerRows.map((headerRow, depth) => /* @__PURE__ */ jsx25("tr", { children: headerRow.map((cell) => {
|
|
@@ -8893,6 +8900,7 @@ function TableInner(props, ref) {
|
|
|
8893
8900
|
);
|
|
8894
8901
|
}) }, depth)) }),
|
|
8895
8902
|
/* @__PURE__ */ jsxs23("tbody", { children: [
|
|
8903
|
+
maxBodyHeight != null && pipeline.rows.length === 0 ? /* @__PURE__ */ jsx25("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx25("td", { colSpan: leafColumns.length, style: { height: 120, padding: 0, border: 0 } }) }) : null,
|
|
8896
8904
|
pipeline.rows.length === 0 && summaries.length > 0 ? /* @__PURE__ */ jsx25("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx25("td", { colSpan: leafColumns.length, style: { height: Math.max(0, viewportHeight - (headerRows.length + summaries.length) * rowHeight), padding: 0, border: 0 } }) }) : null,
|
|
8897
8905
|
topSpacer > 0 ? /* @__PURE__ */ jsx25("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx25("td", { colSpan: leafColumns.length, style: { height: topSpacer, padding: 0, border: 0 } }) }) : null,
|
|
8898
8906
|
renderedRows.map((row, offset) => {
|
|
@@ -10151,6 +10159,7 @@ export {
|
|
|
10151
10159
|
Icon,
|
|
10152
10160
|
Image,
|
|
10153
10161
|
ImagePreview,
|
|
10162
|
+
ImagePreviewGroup,
|
|
10154
10163
|
Input,
|
|
10155
10164
|
InputNumber,
|
|
10156
10165
|
InputSelect,
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JZK5OCZB.js";
|
|
5
|
+
import "./chunk-XQB5K7V4.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
7
|
import "./chunk-ZD45Z2NI.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ZPRDG3RS.js";
|
|
4
|
+
import "./chunk-B7UK645K.js";
|
|
5
|
+
import "./chunk-XQB5K7V4.js";
|
|
6
6
|
import "./chunk-SCEHVGKV.js";
|
|
7
7
|
import "./chunk-ZD45Z2NI.js";
|
|
8
8
|
import "./chunk-CZ2ITBRW.js";
|