@sia.soul/sia-react-ui 0.1.155 → 0.1.157

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.
@@ -1092,7 +1092,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
1092
1092
  ] }, item.key);
1093
1093
  }) });
1094
1094
  }
1095
- function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
1095
+ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
1096
1096
  const previewRef = useRef4(null);
1097
1097
  const motion = useOverlayMotion(open, previewRef, "fade");
1098
1098
  const stageRef = useRef4(null);
@@ -1103,6 +1103,28 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1103
1103
  const [flip, setFlip] = useState5({ x: 1, y: 1 });
1104
1104
  const [pan, setPan] = useState5({ x: 0, y: 0 });
1105
1105
  const [failed, setFailed] = useState5(false);
1106
+ const [original, setOriginal] = useState5("preview");
1107
+ const displaySrc = original === "loaded" && originalSrc ? originalSrc : src;
1108
+ useEffect3(() => {
1109
+ if (open) setOriginal("preview");
1110
+ }, [open, src, originalSrc]);
1111
+ useEffect3(() => {
1112
+ if (!open || original !== "loading" || !originalSrc) return;
1113
+ let active = true;
1114
+ const image = new window.Image();
1115
+ image.onload = () => {
1116
+ if (active) setOriginal("loaded");
1117
+ };
1118
+ image.onerror = () => {
1119
+ if (active) setOriginal("error");
1120
+ };
1121
+ image.src = originalSrc;
1122
+ return () => {
1123
+ active = false;
1124
+ image.onload = null;
1125
+ image.onerror = null;
1126
+ };
1127
+ }, [open, original, originalSrc, src]);
1106
1128
  const drag = useRef4();
1107
1129
  useOverlayLifecycle(motion.present, previewRef, () => {
1108
1130
  if (open) onOpenChange(false);
@@ -1119,7 +1141,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1119
1141
  reset();
1120
1142
  setFailed(false);
1121
1143
  }
1122
- }, [open, src]);
1144
+ }, [open, displaySrc]);
1123
1145
  useEffect3(() => {
1124
1146
  if (!open || !onCurrentChange || count < 2) return;
1125
1147
  const handleKey = (event) => {
@@ -1144,10 +1166,23 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1144
1166
  observer.observe(stage);
1145
1167
  return () => observer.disconnect();
1146
1168
  }, [open, src]);
1147
- const ready = natural.src === src && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
1169
+ const ready = natural.src === displaySrc && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
1148
1170
  const sideways = Math.abs(rotation % 180) === 90;
1149
1171
  const fit = ready ? Math.min(1, area.width / (sideways ? natural.height : natural.width), area.height / (sideways ? natural.width : natural.height)) : 0;
1150
1172
  const changeZoom = (factor) => setZoom((value) => Math.max(0.25, Math.min(8, value * factor)));
1173
+ useEffect3(() => {
1174
+ const stage = stageRef.current;
1175
+ if (!open || !stage) return;
1176
+ const wheel = (event) => {
1177
+ event.preventDefault();
1178
+ event.stopPropagation();
1179
+ if (!ready || event.deltaY === 0) return;
1180
+ const delta = event.deltaY * (event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? stage.clientHeight : 1);
1181
+ changeZoom(Math.exp(-Math.max(-160, Math.min(160, delta)) / 500));
1182
+ };
1183
+ stage.addEventListener("wheel", wheel, { passive: false });
1184
+ return () => stage.removeEventListener("wheel", wheel);
1185
+ }, [open, ready, motion.present]);
1151
1186
  if (!motion.present || !src || typeof document === "undefined") return null;
1152
1187
  return createPortal2(/* @__PURE__ */ jsxs6("div", { ref: previewRef, className: "sia-image-preview", style: { animation: "none", pointerEvents: open ? void 0 : "none" }, ...!open ? { inert: "" } : {}, role: "dialog", "aria-modal": "true", "aria-label": "\u56FE\u7247\u9884\u89C8", tabIndex: -1, onClick: () => onOpenChange(false), children: [
1153
1188
  /* @__PURE__ */ jsx6(Button, { variant: "text", className: "sia-image-preview__close", "aria-label": "\u5173\u95ED\u9884\u89C8", onClick: (event) => {
@@ -1157,11 +1192,11 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1157
1192
  /* @__PURE__ */ jsx6("div", { ref: stageRef, className: "sia-image-preview__stage", children: failed ? /* @__PURE__ */ jsx6("span", { className: "sia-image-preview__error", children: "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25" }) : /* @__PURE__ */ jsx6(
1158
1193
  "img",
1159
1194
  {
1160
- src,
1195
+ src: displaySrc,
1161
1196
  alt,
1162
1197
  draggable: false,
1163
1198
  style: { width: natural.width * fit, height: natural.height * fit, visibility: ready ? "visible" : "hidden", transform: `translate(${pan.x}px, ${pan.y}px) rotate(${rotation}deg) scale(${zoom * flip.x}, ${zoom * flip.y})` },
1164
- onLoad: (event) => setNatural({ src, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
1199
+ onLoad: (event) => setNatural({ src: displaySrc, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
1165
1200
  onError: () => setFailed(true),
1166
1201
  onClick: (event) => event.stopPropagation(),
1167
1202
  onPointerDown: (event) => {
@@ -1185,7 +1220,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1185
1220
  drag.current = void 0;
1186
1221
  }
1187
1222
  },
1188
- src
1223
+ displaySrc
1189
1224
  ) }),
1190
1225
  /* @__PURE__ */ jsxs6("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
1191
1226
  count > 1 && onCurrentChange ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
@@ -1210,7 +1245,8 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
1210
1245
  /* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u7F29\u5C0F", "aria-label": "\u7F29\u5C0F", disabled: !ready || zoom <= 0.25, onClick: () => changeZoom(1 / 1.25), children: /* @__PURE__ */ jsx6(Icon, { name: "zoom-out", size: 20 }) }),
1211
1246
  /* @__PURE__ */ jsx6("output", { className: "sia-image-preview__scale", "aria-label": "\u5F53\u524D\u7F29\u653E\u6BD4\u4F8B", "aria-live": "polite", children: ready ? `${Math.round(fit * zoom * 100)}%` : "\u2014" }),
1212
1247
  /* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u653E\u5927", "aria-label": "\u653E\u5927", disabled: !ready || zoom >= 8, onClick: () => changeZoom(1.25), children: /* @__PURE__ */ jsx6(Icon, { name: "zoom-in", size: 20 }) }),
1213
- /* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ jsx6(Icon, { name: "refresh", size: 20 }) })
1248
+ /* @__PURE__ */ jsx6(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ jsx6(Icon, { name: "refresh", size: 20 }) }),
1249
+ originalSrc && originalSrc !== src && original !== "loaded" ? /* @__PURE__ */ jsx6(Button, { variant: "text", className: "sia-image-preview__original", loading: original === "loading", title: original === "error" ? "\u539F\u56FE\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5" : "\u67E5\u770B\u539F\u56FE", onClick: () => setOriginal("loading"), children: "\u67E5\u770B\u539F\u56FE" }) : null
1214
1250
  ] })
1215
1251
  ] }), document.body);
1216
1252
  }
@@ -1243,6 +1279,7 @@ function ImagePreviewGroup({ children }) {
1243
1279
  {
1244
1280
  open: Boolean(image),
1245
1281
  src: image?.src,
1282
+ originalSrc: image?.originalSrc,
1246
1283
  alt: image?.alt,
1247
1284
  current: index,
1248
1285
  count: entries.length,
@@ -1267,8 +1304,8 @@ function Image({ fallback, placeholder, preview = true, rootClassName = "", clas
1267
1304
  const rootRef = useRef4(null);
1268
1305
  const grouped = Boolean(group && preview && !controlled && displaySrc);
1269
1306
  useEffect3(() => {
1270
- if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: displaySrc, alt, element: rootRef.current });
1271
- }, [group, grouped, groupId, displaySrc, alt]);
1307
+ if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: config.src ?? displaySrc, originalSrc: config.originalSrc, alt, element: rootRef.current });
1308
+ }, [group, grouped, groupId, displaySrc, config.src, config.originalSrc, alt]);
1272
1309
  const radius = typeof style?.borderRadius === "number" ? `${style.borderRadius}px` : style?.borderRadius;
1273
1310
  const rootStyle = {
1274
1311
  ...style,
@@ -1292,7 +1329,7 @@ function Image({ fallback, placeholder, preview = true, rootClassName = "", clas
1292
1329
  /* @__PURE__ */ jsx6(Icon, { name: "eye" }),
1293
1330
  "\u9884\u89C8"
1294
1331
  ] }) }) : null,
1295
- /* @__PURE__ */ jsx6(ImagePreview, { open, src: config.src ?? displaySrc, alt, onOpenChange: setOpen })
1332
+ /* @__PURE__ */ jsx6(ImagePreview, { open, src: config.src ?? displaySrc, originalSrc: config.originalSrc, alt, onOpenChange: setOpen })
1296
1333
  ] });
1297
1334
  }
1298
1335
 
@@ -1903,6 +1903,8 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
1903
1903
  declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
1904
1904
  /** 图片预览的属性配置。 */
1905
1905
  interface ImagePreviewProps {
1906
+ /** 原始图片地址;与 src 不同时显示“查看原图”。点击后按需加载,成功才替换预览,失败保留预览并允许重试;每次打开或切换图片重新使用 src。 */
1907
+ originalSrc?: string;
1906
1908
  /** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
1907
1909
  current?: number;
1908
1910
  /** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
@@ -1921,10 +1923,12 @@ interface ImagePreviewProps {
1921
1923
  /** 打开状态改变时触发,参数为新的打开状态。 */
1922
1924
  onOpenChange: (open: boolean) => void;
1923
1925
  }
1924
- /** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。入退场共用 180ms 淡入轨迹,关闭反播后卸载,退场期间保留图片视图;减少动态效果时直接切换。 */
1925
- declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
1926
+ /** 图片预览弹层,初始按窗口适配大图,支持翻转、旋转、按钮及鼠标滚轮缩放、拖动和按需查看原图;滚轮向上放大、向下缩小,范围为适配尺寸的 0.25~8 倍。重新打开或更换图片时重置视图。入退场使用 180ms 对称淡入淡出,退场期间保留图片视图。 */
1927
+ declare function ImagePreview({ open, src, originalSrc, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
1926
1928
  /** 图片预览的配置。 */
1927
1929
  interface ImagePreviewConfig {
1930
+ /** 按需加载的原图地址;与预览 src 不同时显示“查看原图”,支持加载状态、失败重试及预览分组。省略时不显示该入口。 */
1931
+ originalSrc?: string;
1928
1932
  /** 图片或资源地址。 */
1929
1933
  src?: string;
1930
1934
  /** 是否打开;传入后由外部控制显示状态。 */
@@ -1903,6 +1903,8 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
1903
1903
  declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
1904
1904
  /** 图片预览的属性配置。 */
1905
1905
  interface ImagePreviewProps {
1906
+ /** 原始图片地址;与 src 不同时显示“查看原图”。点击后按需加载,成功才替换预览,失败保留预览并允许重试;每次打开或切换图片重新使用 src。 */
1907
+ originalSrc?: string;
1906
1908
  /** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
1907
1909
  current?: number;
1908
1910
  /** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
@@ -1921,10 +1923,12 @@ interface ImagePreviewProps {
1921
1923
  /** 打开状态改变时触发,参数为新的打开状态。 */
1922
1924
  onOpenChange: (open: boolean) => void;
1923
1925
  }
1924
- /** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。入退场共用 180ms 淡入轨迹,关闭反播后卸载,退场期间保留图片视图;减少动态效果时直接切换。 */
1925
- declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
1926
+ /** 图片预览弹层,初始按窗口适配大图,支持翻转、旋转、按钮及鼠标滚轮缩放、拖动和按需查看原图;滚轮向上放大、向下缩小,范围为适配尺寸的 0.25~8 倍。重新打开或更换图片时重置视图。入退场使用 180ms 对称淡入淡出,退场期间保留图片视图。 */
1927
+ declare function ImagePreview({ open, src, originalSrc, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
1926
1928
  /** 图片预览的配置。 */
1927
1929
  interface ImagePreviewConfig {
1930
+ /** 按需加载的原图地址;与预览 src 不同时显示“查看原图”,支持加载状态、失败重试及预览分组。省略时不显示该入口。 */
1931
+ originalSrc?: string;
1928
1932
  /** 图片或资源地址。 */
1929
1933
  src?: string;
1930
1934
  /** 是否打开;传入后由外部控制显示状态。 */
package/dist/core.cjs CHANGED
@@ -4296,7 +4296,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
4296
4296
  ] }, item.key);
4297
4297
  }) });
4298
4298
  }
4299
- function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
4299
+ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
4300
4300
  const previewRef = (0, import_react23.useRef)(null);
4301
4301
  const motion = useOverlayMotion(open, previewRef, "fade");
4302
4302
  const stageRef = (0, import_react23.useRef)(null);
@@ -4307,6 +4307,28 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4307
4307
  const [flip, setFlip] = (0, import_react23.useState)({ x: 1, y: 1 });
4308
4308
  const [pan, setPan] = (0, import_react23.useState)({ x: 0, y: 0 });
4309
4309
  const [failed, setFailed] = (0, import_react23.useState)(false);
4310
+ const [original, setOriginal] = (0, import_react23.useState)("preview");
4311
+ const displaySrc = original === "loaded" && originalSrc ? originalSrc : src;
4312
+ (0, import_react23.useEffect)(() => {
4313
+ if (open) setOriginal("preview");
4314
+ }, [open, src, originalSrc]);
4315
+ (0, import_react23.useEffect)(() => {
4316
+ if (!open || original !== "loading" || !originalSrc) return;
4317
+ let active = true;
4318
+ const image = new window.Image();
4319
+ image.onload = () => {
4320
+ if (active) setOriginal("loaded");
4321
+ };
4322
+ image.onerror = () => {
4323
+ if (active) setOriginal("error");
4324
+ };
4325
+ image.src = originalSrc;
4326
+ return () => {
4327
+ active = false;
4328
+ image.onload = null;
4329
+ image.onerror = null;
4330
+ };
4331
+ }, [open, original, originalSrc, src]);
4310
4332
  const drag = (0, import_react23.useRef)();
4311
4333
  useOverlayLifecycle(motion.present, previewRef, () => {
4312
4334
  if (open) onOpenChange(false);
@@ -4323,7 +4345,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4323
4345
  reset();
4324
4346
  setFailed(false);
4325
4347
  }
4326
- }, [open, src]);
4348
+ }, [open, displaySrc]);
4327
4349
  (0, import_react23.useEffect)(() => {
4328
4350
  if (!open || !onCurrentChange || count < 2) return;
4329
4351
  const handleKey = (event) => {
@@ -4348,10 +4370,23 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4348
4370
  observer.observe(stage);
4349
4371
  return () => observer.disconnect();
4350
4372
  }, [open, src]);
4351
- const ready = natural.src === src && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
4373
+ const ready = natural.src === displaySrc && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
4352
4374
  const sideways = Math.abs(rotation % 180) === 90;
4353
4375
  const fit = ready ? Math.min(1, area.width / (sideways ? natural.height : natural.width), area.height / (sideways ? natural.width : natural.height)) : 0;
4354
4376
  const changeZoom = (factor) => setZoom((value) => Math.max(0.25, Math.min(8, value * factor)));
4377
+ (0, import_react23.useEffect)(() => {
4378
+ const stage = stageRef.current;
4379
+ if (!open || !stage) return;
4380
+ const wheel = (event) => {
4381
+ event.preventDefault();
4382
+ event.stopPropagation();
4383
+ if (!ready || event.deltaY === 0) return;
4384
+ const delta = event.deltaY * (event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? stage.clientHeight : 1);
4385
+ changeZoom(Math.exp(-Math.max(-160, Math.min(160, delta)) / 500));
4386
+ };
4387
+ stage.addEventListener("wheel", wheel, { passive: false });
4388
+ return () => stage.removeEventListener("wheel", wheel);
4389
+ }, [open, ready, motion.present]);
4355
4390
  if (!motion.present || !src || typeof document === "undefined") return null;
4356
4391
  return (0, import_react_dom5.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: previewRef, className: "sia-image-preview", style: { animation: "none", pointerEvents: open ? void 0 : "none" }, ...!open ? { inert: "" } : {}, role: "dialog", "aria-modal": "true", "aria-label": "\u56FE\u7247\u9884\u89C8", tabIndex: -1, onClick: () => onOpenChange(false), children: [
4357
4392
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", className: "sia-image-preview__close", "aria-label": "\u5173\u95ED\u9884\u89C8", onClick: (event) => {
@@ -4361,11 +4396,11 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4361
4396
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref: stageRef, className: "sia-image-preview__stage", children: failed ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sia-image-preview__error", children: "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4362
4397
  "img",
4363
4398
  {
4364
- src,
4399
+ src: displaySrc,
4365
4400
  alt,
4366
4401
  draggable: false,
4367
4402
  style: { width: natural.width * fit, height: natural.height * fit, visibility: ready ? "visible" : "hidden", transform: `translate(${pan.x}px, ${pan.y}px) rotate(${rotation}deg) scale(${zoom * flip.x}, ${zoom * flip.y})` },
4368
- onLoad: (event) => setNatural({ src, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
4403
+ onLoad: (event) => setNatural({ src: displaySrc, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
4369
4404
  onError: () => setFailed(true),
4370
4405
  onClick: (event) => event.stopPropagation(),
4371
4406
  onPointerDown: (event) => {
@@ -4389,7 +4424,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4389
4424
  drag.current = void 0;
4390
4425
  }
4391
4426
  },
4392
- src
4427
+ displaySrc
4393
4428
  ) }),
4394
4429
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
4395
4430
  count > 1 && onCurrentChange ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
@@ -4414,7 +4449,8 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
4414
4449
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", title: "\u7F29\u5C0F", "aria-label": "\u7F29\u5C0F", disabled: !ready || zoom <= 0.25, onClick: () => changeZoom(1 / 1.25), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "zoom-out", size: 20 }) }),
4415
4450
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("output", { className: "sia-image-preview__scale", "aria-label": "\u5F53\u524D\u7F29\u653E\u6BD4\u4F8B", "aria-live": "polite", children: ready ? `${Math.round(fit * zoom * 100)}%` : "\u2014" }),
4416
4451
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", title: "\u653E\u5927", "aria-label": "\u653E\u5927", disabled: !ready || zoom >= 8, onClick: () => changeZoom(1.25), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "zoom-in", size: 20 }) }),
4417
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "refresh", size: 20 }) })
4452
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "refresh", size: 20 }) }),
4453
+ originalSrc && originalSrc !== src && original !== "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { variant: "text", className: "sia-image-preview__original", loading: original === "loading", title: original === "error" ? "\u539F\u56FE\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5" : "\u67E5\u770B\u539F\u56FE", onClick: () => setOriginal("loading"), children: "\u67E5\u770B\u539F\u56FE" }) : null
4418
4454
  ] })
4419
4455
  ] }), document.body);
4420
4456
  }
package/dist/core.css CHANGED
@@ -4220,29 +4220,21 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4220
4220
  min-width: 0;
4221
4221
  }
4222
4222
  .sia-table__sort-button {
4223
- position: absolute;
4224
- z-index: 1;
4225
- right: 0;
4226
- top: 50%;
4227
- transform: translateY(-50%);
4223
+ position: relative;
4224
+ flex: 0 0 26px;
4225
+ margin-left: 4px;
4228
4226
  display: grid;
4229
4227
  align-content: center;
4230
4228
  justify-items: center;
4231
4229
  width: 26px;
4232
4230
  height: 28px;
4233
4231
  padding: 0;
4234
- opacity: 0;
4235
4232
  color: var(--sia-color-text-secondary);
4236
4233
  cursor: pointer;
4237
4234
  background: var(--sia-color-control-hover);
4238
4235
  border: 0;
4239
4236
  border-radius: var(--sia-radius);
4240
4237
  }
4241
- .sia-table__header-cell:hover .sia-table__sort-button,
4242
- .sia-table__sortable-header:focus-within .sia-table__sort-button,
4243
- .sia-table__sort-button:not([data-sort-order=none]) {
4244
- opacity: 1;
4245
- }
4246
4238
  .sia-table__sort-button[data-sort-order=none] .sia-icon {
4247
4239
  margin-block: -2px;
4248
4240
  }
@@ -10017,6 +10009,25 @@ fieldset:disabled :is(.sia-select, .sia-tree-select, .sia-cascader) > :is(.sia-s
10017
10009
  .sia-image-preview__toolbar > .sia-button:disabled {
10018
10010
  color: rgb(255 255 255 / 30%);
10019
10011
  }
10012
+ .sia-image-preview__toolbar > .sia-image-preview__original {
10013
+ flex: 0 0 auto;
10014
+ width: auto;
10015
+ padding-inline: 12px;
10016
+ white-space: nowrap;
10017
+ }
10018
+ @media (max-width: 600px) {
10019
+ .sia-image-preview__toolbar {
10020
+ width: max-content;
10021
+ flex-wrap: wrap;
10022
+ justify-content: center;
10023
+ }
10024
+ .sia-image-preview__toolbar > .sia-button {
10025
+ flex-shrink: 0;
10026
+ }
10027
+ .sia-image-preview__stage {
10028
+ bottom: 132px;
10029
+ }
10030
+ }
10020
10031
  .sia-image-preview__error {
10021
10032
  color: #fff;
10022
10033
  }
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, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-IKk39Mp9.cjs';
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, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-DIPB-9BE.cjs';
2
2
  export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-xLR4Yt57.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-DKfT3fJR.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, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-BJ4CiGSl.js';
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, I as FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, M as Icon, N as IconName, O as IconProps, P as IconVariant, Y as Input, Z as InputProps, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, af as Progress, ag as ProgressProps, ah as ProgressStatus, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, az as TabItem, aA as Tabs, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, T as TagStatus, aJ as TagVariant, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, ba as UploadProps, be as UploadRequestOptions, bi as message } from './core-D5lW_vcl.js';
2
2
  export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-B59TIes7.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-Wolx4zNc.js';
4
4
  import 'react';
package/dist/core.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  Typography,
12
12
  Upload,
13
13
  message
14
- } from "./chunk-AWBINTI3.js";
14
+ } from "./chunk-2USMAY2A.js";
15
15
  import "./chunk-RX242MUO.js";
16
16
  import {
17
17
  Select
package/dist/game.css CHANGED
@@ -4271,29 +4271,21 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4271
4271
  min-width: 0;
4272
4272
  }
4273
4273
  .sia-table__sort-button {
4274
- position: absolute;
4275
- z-index: 1;
4276
- right: 0;
4277
- top: 50%;
4278
- transform: translateY(-50%);
4274
+ position: relative;
4275
+ flex: 0 0 26px;
4276
+ margin-left: 4px;
4279
4277
  display: grid;
4280
4278
  align-content: center;
4281
4279
  justify-items: center;
4282
4280
  width: 26px;
4283
4281
  height: 28px;
4284
4282
  padding: 0;
4285
- opacity: 0;
4286
4283
  color: var(--sia-color-text-secondary);
4287
4284
  cursor: pointer;
4288
4285
  background: var(--sia-color-control-hover);
4289
4286
  border: 0;
4290
4287
  border-radius: var(--sia-radius);
4291
4288
  }
4292
- .sia-table__header-cell:hover .sia-table__sort-button,
4293
- .sia-table__sortable-header:focus-within .sia-table__sort-button,
4294
- .sia-table__sort-button:not([data-sort-order=none]) {
4295
- opacity: 1;
4296
- }
4297
4289
  .sia-table__sort-button[data-sort-order=none] .sia-icon {
4298
4290
  margin-block: -2px;
4299
4291
  }
package/dist/index.cjs CHANGED
@@ -2797,7 +2797,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
2797
2797
  ] }, item.key);
2798
2798
  }) });
2799
2799
  }
2800
- function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
2800
+ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
2801
2801
  const previewRef = (0, import_react10.useRef)(null);
2802
2802
  const motion = useOverlayMotion(open, previewRef, "fade");
2803
2803
  const stageRef = (0, import_react10.useRef)(null);
@@ -2808,6 +2808,28 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2808
2808
  const [flip, setFlip] = (0, import_react10.useState)({ x: 1, y: 1 });
2809
2809
  const [pan, setPan] = (0, import_react10.useState)({ x: 0, y: 0 });
2810
2810
  const [failed, setFailed] = (0, import_react10.useState)(false);
2811
+ const [original, setOriginal] = (0, import_react10.useState)("preview");
2812
+ const displaySrc = original === "loaded" && originalSrc ? originalSrc : src;
2813
+ (0, import_react10.useEffect)(() => {
2814
+ if (open) setOriginal("preview");
2815
+ }, [open, src, originalSrc]);
2816
+ (0, import_react10.useEffect)(() => {
2817
+ if (!open || original !== "loading" || !originalSrc) return;
2818
+ let active = true;
2819
+ const image = new window.Image();
2820
+ image.onload = () => {
2821
+ if (active) setOriginal("loaded");
2822
+ };
2823
+ image.onerror = () => {
2824
+ if (active) setOriginal("error");
2825
+ };
2826
+ image.src = originalSrc;
2827
+ return () => {
2828
+ active = false;
2829
+ image.onload = null;
2830
+ image.onerror = null;
2831
+ };
2832
+ }, [open, original, originalSrc, src]);
2811
2833
  const drag = (0, import_react10.useRef)();
2812
2834
  useOverlayLifecycle(motion.present, previewRef, () => {
2813
2835
  if (open) onOpenChange(false);
@@ -2824,7 +2846,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2824
2846
  reset();
2825
2847
  setFailed(false);
2826
2848
  }
2827
- }, [open, src]);
2849
+ }, [open, displaySrc]);
2828
2850
  (0, import_react10.useEffect)(() => {
2829
2851
  if (!open || !onCurrentChange || count < 2) return;
2830
2852
  const handleKey = (event) => {
@@ -2849,10 +2871,23 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2849
2871
  observer.observe(stage);
2850
2872
  return () => observer.disconnect();
2851
2873
  }, [open, src]);
2852
- const ready = natural.src === src && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
2874
+ const ready = natural.src === displaySrc && natural.width > 0 && area.width > 0 && area.height > 0 && !failed;
2853
2875
  const sideways = Math.abs(rotation % 180) === 90;
2854
2876
  const fit = ready ? Math.min(1, area.width / (sideways ? natural.height : natural.width), area.height / (sideways ? natural.width : natural.height)) : 0;
2855
2877
  const changeZoom = (factor) => setZoom((value) => Math.max(0.25, Math.min(8, value * factor)));
2878
+ (0, import_react10.useEffect)(() => {
2879
+ const stage = stageRef.current;
2880
+ if (!open || !stage) return;
2881
+ const wheel = (event) => {
2882
+ event.preventDefault();
2883
+ event.stopPropagation();
2884
+ if (!ready || event.deltaY === 0) return;
2885
+ const delta = event.deltaY * (event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? stage.clientHeight : 1);
2886
+ changeZoom(Math.exp(-Math.max(-160, Math.min(160, delta)) / 500));
2887
+ };
2888
+ stage.addEventListener("wheel", wheel, { passive: false });
2889
+ return () => stage.removeEventListener("wheel", wheel);
2890
+ }, [open, ready, motion.present]);
2856
2891
  if (!motion.present || !src || typeof document === "undefined") return null;
2857
2892
  return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: previewRef, className: "sia-image-preview", style: { animation: "none", pointerEvents: open ? void 0 : "none" }, ...!open ? { inert: "" } : {}, role: "dialog", "aria-modal": "true", "aria-label": "\u56FE\u7247\u9884\u89C8", tabIndex: -1, onClick: () => onOpenChange(false), children: [
2858
2893
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", className: "sia-image-preview__close", "aria-label": "\u5173\u95ED\u9884\u89C8", onClick: (event) => {
@@ -2862,11 +2897,11 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2862
2897
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: stageRef, className: "sia-image-preview__stage", children: failed ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-image-preview__error", children: "\u56FE\u7247\u52A0\u8F7D\u5931\u8D25" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2863
2898
  "img",
2864
2899
  {
2865
- src,
2900
+ src: displaySrc,
2866
2901
  alt,
2867
2902
  draggable: false,
2868
2903
  style: { width: natural.width * fit, height: natural.height * fit, visibility: ready ? "visible" : "hidden", transform: `translate(${pan.x}px, ${pan.y}px) rotate(${rotation}deg) scale(${zoom * flip.x}, ${zoom * flip.y})` },
2869
- onLoad: (event) => setNatural({ src, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
2904
+ onLoad: (event) => setNatural({ src: displaySrc, width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }),
2870
2905
  onError: () => setFailed(true),
2871
2906
  onClick: (event) => event.stopPropagation(),
2872
2907
  onPointerDown: (event) => {
@@ -2890,7 +2925,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2890
2925
  drag.current = void 0;
2891
2926
  }
2892
2927
  },
2893
- src
2928
+ displaySrc
2894
2929
  ) }),
2895
2930
  /* @__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: [
2896
2931
  count > 1 && onCurrentChange ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
@@ -2915,7 +2950,8 @@ function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count =
2915
2950
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u7F29\u5C0F", "aria-label": "\u7F29\u5C0F", disabled: !ready || zoom <= 0.25, onClick: () => changeZoom(1 / 1.25), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "zoom-out", size: 20 }) }),
2916
2951
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("output", { className: "sia-image-preview__scale", "aria-label": "\u5F53\u524D\u7F29\u653E\u6BD4\u4F8B", "aria-live": "polite", children: ready ? `${Math.round(fit * zoom * 100)}%` : "\u2014" }),
2917
2952
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u653E\u5927", "aria-label": "\u653E\u5927", disabled: !ready || zoom >= 8, onClick: () => changeZoom(1.25), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "zoom-in", size: 20 }) }),
2918
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "refresh", size: 20 }) })
2953
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", title: "\u9002\u5E94\u7A97\u53E3", "aria-label": "\u9002\u5E94\u7A97\u53E3", disabled: !ready, onClick: reset, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "refresh", size: 20 }) }),
2954
+ originalSrc && originalSrc !== src && original !== "loaded" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "text", className: "sia-image-preview__original", loading: original === "loading", title: original === "error" ? "\u539F\u56FE\u52A0\u8F7D\u5931\u8D25\uFF0C\u70B9\u51FB\u91CD\u8BD5" : "\u67E5\u770B\u539F\u56FE", onClick: () => setOriginal("loading"), children: "\u67E5\u770B\u539F\u56FE" }) : null
2919
2955
  ] })
2920
2956
  ] }), document.body);
2921
2957
  }
@@ -2948,6 +2984,7 @@ function ImagePreviewGroup({ children }) {
2948
2984
  {
2949
2985
  open: Boolean(image),
2950
2986
  src: image?.src,
2987
+ originalSrc: image?.originalSrc,
2951
2988
  alt: image?.alt,
2952
2989
  current: index,
2953
2990
  count: entries.length,
@@ -2972,8 +3009,8 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
2972
3009
  const rootRef = (0, import_react10.useRef)(null);
2973
3010
  const grouped = Boolean(group && preview && !controlled && displaySrc);
2974
3011
  (0, import_react10.useEffect)(() => {
2975
- if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: displaySrc, alt, element: rootRef.current });
2976
- }, [group, grouped, groupId, displaySrc, alt]);
3012
+ if (grouped && group && displaySrc && rootRef.current) return group.register(groupId, { src: config.src ?? displaySrc, originalSrc: config.originalSrc, alt, element: rootRef.current });
3013
+ }, [group, grouped, groupId, displaySrc, config.src, config.originalSrc, alt]);
2977
3014
  const radius = typeof style?.borderRadius === "number" ? `${style.borderRadius}px` : style?.borderRadius;
2978
3015
  const rootStyle = {
2979
3016
  ...style,
@@ -2997,7 +3034,7 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
2997
3034
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "eye" }),
2998
3035
  "\u9884\u89C8"
2999
3036
  ] }) }) : null,
3000
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ImagePreview, { open, src: config.src ?? displaySrc, alt, onOpenChange: setOpen })
3037
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ImagePreview, { open, src: config.src ?? displaySrc, originalSrc: config.originalSrc, alt, onOpenChange: setOpen })
3001
3038
  ] });
3002
3039
  }
3003
3040
 
@@ -28179,7 +28216,6 @@ function QueryForm({
28179
28216
  const [saveOpen, setSaveOpen] = (0, import_react111.useState)(false);
28180
28217
  const [saveName, setSaveName] = (0, import_react111.useState)("");
28181
28218
  const [saveError, setSaveError] = (0, import_react111.useState)("");
28182
- const [error, setError] = (0, import_react111.useState)("");
28183
28219
  const [activeShortcut, setActiveShortcut] = (0, import_react111.useState)("");
28184
28220
  const source = (0, import_react111.useRef)({ source: "submit" });
28185
28221
  const searchLock = (0, import_react111.useRef)(false);
@@ -28310,11 +28346,9 @@ function QueryForm({
28310
28346
  if (searchLock.current || disabled || loading) return;
28311
28347
  searchLock.current = true;
28312
28348
  setSearching(true);
28313
- setError("");
28314
28349
  try {
28315
28350
  await onSearch(values, info);
28316
28351
  } catch (reason) {
28317
- setError(reason instanceof Error ? reason.message : "\u67E5\u8BE2\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
28318
28352
  onError?.(reason, "search");
28319
28353
  } finally {
28320
28354
  searchLock.current = false;
@@ -28333,7 +28367,6 @@ function QueryForm({
28333
28367
  if (busy) return;
28334
28368
  form.resetFields();
28335
28369
  setActiveShortcut("");
28336
- setError("");
28337
28370
  if (resetSearch) {
28338
28371
  source.current = { source: "reset" };
28339
28372
  form.submit();
@@ -28354,9 +28387,6 @@ function QueryForm({
28354
28387
  await onSaveQuery({ name, values: snapshot.current });
28355
28388
  setSaveOpen(false);
28356
28389
  } catch (reason) {
28357
- setSaveError(
28358
- reason instanceof Error ? reason.message : "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"
28359
- );
28360
28390
  onError?.(reason, "save");
28361
28391
  return false;
28362
28392
  } finally {
@@ -28368,12 +28398,10 @@ function QueryForm({
28368
28398
  if (!onRemoveQuery || shortcutBusy || removeLock.current) return;
28369
28399
  removeLock.current = true;
28370
28400
  setRemoving(true);
28371
- setError("");
28372
28401
  try {
28373
28402
  await onRemoveQuery(query);
28374
28403
  if (activeShortcut === `saved:${query.key}`) setActiveShortcut("");
28375
28404
  } catch (reason) {
28376
- setError(reason instanceof Error ? reason.message : "\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
28377
28405
  onError?.(reason, "remove");
28378
28406
  } finally {
28379
28407
  removeLock.current = false;
@@ -28523,8 +28551,7 @@ function QueryForm({
28523
28551
  query.key
28524
28552
  )),
28525
28553
  " "
28526
- ] }) : null,
28527
- error ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "sia-query-form__error", role: "alert", children: error }) : null
28554
+ ] }) : null
28528
28555
  ]
28529
28556
  }
28530
28557
  ),
package/dist/index.css CHANGED
@@ -4220,29 +4220,21 @@ fieldset:disabled .sia-input-number__floating-placeholder {
4220
4220
  min-width: 0;
4221
4221
  }
4222
4222
  .sia-table__sort-button {
4223
- position: absolute;
4224
- z-index: 1;
4225
- right: 0;
4226
- top: 50%;
4227
- transform: translateY(-50%);
4223
+ position: relative;
4224
+ flex: 0 0 26px;
4225
+ margin-left: 4px;
4228
4226
  display: grid;
4229
4227
  align-content: center;
4230
4228
  justify-items: center;
4231
4229
  width: 26px;
4232
4230
  height: 28px;
4233
4231
  padding: 0;
4234
- opacity: 0;
4235
4232
  color: var(--sia-color-text-secondary);
4236
4233
  cursor: pointer;
4237
4234
  background: var(--sia-color-control-hover);
4238
4235
  border: 0;
4239
4236
  border-radius: var(--sia-radius);
4240
4237
  }
4241
- .sia-table__header-cell:hover .sia-table__sort-button,
4242
- .sia-table__sortable-header:focus-within .sia-table__sort-button,
4243
- .sia-table__sort-button:not([data-sort-order=none]) {
4244
- opacity: 1;
4245
- }
4246
4238
  .sia-table__sort-button[data-sort-order=none] .sia-icon {
4247
4239
  margin-block: -2px;
4248
4240
  }
@@ -10017,6 +10009,25 @@ fieldset:disabled :is(.sia-select, .sia-tree-select, .sia-cascader) > :is(.sia-s
10017
10009
  .sia-image-preview__toolbar > .sia-button:disabled {
10018
10010
  color: rgb(255 255 255 / 30%);
10019
10011
  }
10012
+ .sia-image-preview__toolbar > .sia-image-preview__original {
10013
+ flex: 0 0 auto;
10014
+ width: auto;
10015
+ padding-inline: 12px;
10016
+ white-space: nowrap;
10017
+ }
10018
+ @media (max-width: 600px) {
10019
+ .sia-image-preview__toolbar {
10020
+ width: max-content;
10021
+ flex-wrap: wrap;
10022
+ justify-content: center;
10023
+ }
10024
+ .sia-image-preview__toolbar > .sia-button {
10025
+ flex-shrink: 0;
10026
+ }
10027
+ .sia-image-preview__stage {
10028
+ bottom: 132px;
10029
+ }
10030
+ }
10020
10031
  .sia-image-preview__error {
10021
10032
  color: #fff;
10022
10033
  }
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, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-IKk39Mp9.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-IKk39Mp9.cjs';
3
+ import { T as TagStatus, B as BadgeProps } from './core-DIPB-9BE.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-DIPB-9BE.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-xLR4Yt57.cjs';
7
7
  export { b as Button, c as ButtonVariant } from './Button-xLR4Yt57.cjs';
@@ -2198,7 +2198,7 @@ interface TableColumn<T = Record<string, unknown>> {
2198
2198
  ellipsis?: boolean;
2199
2199
  /** 数据单元格是否使用 Sia Tooltip 显示完整文本;默认 false,不生成浏览器原生 title。列头仅在文字实际省略时提示完整标题,不受此属性影响。 */
2200
2200
  showTitle?: boolean;
2201
- /** 是否允许该列排序;配合排序插件显示浮动按钮,不挤占标题宽度。未排序时在悬停或键盘聚焦后显示,依次切换升序、降序、未排序;当前排序方向始终以高亮单箭头显示。 */
2201
+ /** 是否允许该列排序;配合排序插件常显排序按钮,按钮参与表头布局并保留独立宽度;依次切换升序、降序、未排序;当前排序方向始终以高亮单箭头显示。 */
2202
2202
  sortable?: boolean;
2203
2203
  /** 是否允许该列筛选。 */
2204
2204
  filterable?: boolean;
@@ -3574,7 +3574,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
3574
3574
  }) => void | Promise<void>;
3575
3575
  /** 删除已保存快捷项时调用,query 为被删除的完整快捷项。业务方负责持久化并更新 savedQueries;失败保留该项,删除操作不会触发查询。 */
3576
3576
  onRemoveQuery?: (query: QueryFormShortcut<T>) => void | Promise<void>;
3577
- /** 查询、保存或删除失败时调用。error 为原始异常,operation 为 search、save 或 remove;组件同时显示错误提示。 */
3577
+ /** 查询、保存或删除失败时调用,error 为原始异常,operation 为 search、save 或 remove。组件结束等待并保留条件/草稿,不渲染接口异常或额外弹出消息;错误展示由业务回调或统一请求层负责。未提供回调时也不展示接口异常。快捷查询名称为空等本地校验仍显示。 */
3578
3578
  onError?: (error: unknown, operation: "search" | "save" | "remove") => void;
3579
3579
  /**
3580
3580
  * 查询按钮文案。
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, VideoHTMLAttributes } from 'react';
3
- import { T as TagStatus, B as BadgeProps } from './core-BJ4CiGSl.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-BJ4CiGSl.js';
3
+ import { T as TagStatus, B as BadgeProps } from './core-D5lW_vcl.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 FloatingScrollbarProvider, J as FloatingScrollbarProviderProps, K as FloatingTrigger, L as ICON_NAMES, M as Icon, N as IconName, O as IconProps, P as IconVariant, Q as Image, R as ImagePreview, S as ImagePreviewConfig, U as ImagePreviewGroup, V as ImagePreviewGroupProps, W as ImagePreviewProps, X as ImageProps, Y as Input, Z as InputProps, _ as Menu, $ as MenuClickInfo, a0 as MenuItem, a1 as MenuMode, a2 as MenuProps, a3 as MenuTheme, a4 as MessageConfig, a5 as MessageHandle, a6 as MessageKey, a7 as MessageType, a8 as NotificationConfig, a9 as NotificationPlacement, aa as NotificationType, ab as Popconfirm, ac as PopconfirmProps, ad as Popover, ae as PopoverProps, af as Progress, ag as ProgressProps, ah as ProgressStatus, ai as Rate, aj as RateProps, ak as Result, al as ResultProps, am as ResultStatus, an as Segmented, ao as SegmentedOption, ap as SegmentedProps, aq as SegmentedValue, ar as Skeleton, as as SkeletonProps, at as Spin, au as SpinProps, av as StepItem, aw as StepStatus, ax as Steps, ay as StepsProps, az as TabItem, aA as Tabs, aB as TabsContextMenuClickInfo, aC as TabsOrientation, aD as TabsPosition, aE as TabsProps, aF as TabsType, aG as Tag, aH as TagProps, aI as TagSize, aJ as TagVariant, aK as Timeline, aL as TimelineItem, aM as TimelineProps, aN as Toolbar, aO as ToolbarItem, aP as ToolbarProps, aQ as Tooltip, aR as TooltipProps, aS as Tour, aT as TourProps, aU as TourStep, aV as Tree, aW as TreeDropPosition, aX as TreeKey, aY as TreeNode, aZ as TreeProps, a_ as Typography, a$ as TypographyLinkProps, b0 as TypographyProps, b1 as TypographyTitleProps, b2 as TypographyType, b3 as Upload, b4 as UploadChangeInfo, b5 as UploadDraggerProps, b6 as UploadFile, b7 as UploadFileStatus, b8 as UploadHttpRequest, b9 as UploadItemActions, ba as UploadProps, bb as UploadRef, bc as UploadRejectInfo, bd as UploadRequestHandle, be as UploadRequestOptions, bf as Watermark, bg as WatermarkFont, bh as WatermarkProps, bi as message, bj as notification } from './core-D5lW_vcl.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-B59TIes7.js';
7
7
  export { b as Button, c as ButtonVariant } from './Button-B59TIes7.js';
@@ -2198,7 +2198,7 @@ interface TableColumn<T = Record<string, unknown>> {
2198
2198
  ellipsis?: boolean;
2199
2199
  /** 数据单元格是否使用 Sia Tooltip 显示完整文本;默认 false,不生成浏览器原生 title。列头仅在文字实际省略时提示完整标题,不受此属性影响。 */
2200
2200
  showTitle?: boolean;
2201
- /** 是否允许该列排序;配合排序插件显示浮动按钮,不挤占标题宽度。未排序时在悬停或键盘聚焦后显示,依次切换升序、降序、未排序;当前排序方向始终以高亮单箭头显示。 */
2201
+ /** 是否允许该列排序;配合排序插件常显排序按钮,按钮参与表头布局并保留独立宽度;依次切换升序、降序、未排序;当前排序方向始终以高亮单箭头显示。 */
2202
2202
  sortable?: boolean;
2203
2203
  /** 是否允许该列筛选。 */
2204
2204
  filterable?: boolean;
@@ -3574,7 +3574,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
3574
3574
  }) => void | Promise<void>;
3575
3575
  /** 删除已保存快捷项时调用,query 为被删除的完整快捷项。业务方负责持久化并更新 savedQueries;失败保留该项,删除操作不会触发查询。 */
3576
3576
  onRemoveQuery?: (query: QueryFormShortcut<T>) => void | Promise<void>;
3577
- /** 查询、保存或删除失败时调用。error 为原始异常,operation 为 search、save 或 remove;组件同时显示错误提示。 */
3577
+ /** 查询、保存或删除失败时调用,error 为原始异常,operation 为 search、save 或 remove。组件结束等待并保留条件/草稿,不渲染接口异常或额外弹出消息;错误展示由业务回调或统一请求层负责。未提供回调时也不展示接口异常。快捷查询名称为空等本地校验仍显示。 */
3578
3578
  onError?: (error: unknown, operation: "search" | "save" | "remove") => void;
3579
3579
  /**
3580
3580
  * 查询按钮文案。
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ import {
82
82
  Watermark,
83
83
  message,
84
84
  notification
85
- } from "./chunk-AWBINTI3.js";
85
+ } from "./chunk-2USMAY2A.js";
86
86
  import "./chunk-RX242MUO.js";
87
87
  import {
88
88
  MarkdownEditor
@@ -11622,7 +11622,6 @@ function QueryForm({
11622
11622
  const [saveOpen, setSaveOpen] = useState28(false);
11623
11623
  const [saveName, setSaveName] = useState28("");
11624
11624
  const [saveError, setSaveError] = useState28("");
11625
- const [error, setError] = useState28("");
11626
11625
  const [activeShortcut, setActiveShortcut] = useState28("");
11627
11626
  const source = useRef29({ source: "submit" });
11628
11627
  const searchLock = useRef29(false);
@@ -11753,11 +11752,9 @@ function QueryForm({
11753
11752
  if (searchLock.current || disabled || loading) return;
11754
11753
  searchLock.current = true;
11755
11754
  setSearching(true);
11756
- setError("");
11757
11755
  try {
11758
11756
  await onSearch(values, info);
11759
11757
  } catch (reason) {
11760
- setError(reason instanceof Error ? reason.message : "\u67E5\u8BE2\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
11761
11758
  onError?.(reason, "search");
11762
11759
  } finally {
11763
11760
  searchLock.current = false;
@@ -11776,7 +11773,6 @@ function QueryForm({
11776
11773
  if (busy) return;
11777
11774
  form.resetFields();
11778
11775
  setActiveShortcut("");
11779
- setError("");
11780
11776
  if (resetSearch) {
11781
11777
  source.current = { source: "reset" };
11782
11778
  form.submit();
@@ -11797,9 +11793,6 @@ function QueryForm({
11797
11793
  await onSaveQuery({ name, values: snapshot.current });
11798
11794
  setSaveOpen(false);
11799
11795
  } catch (reason) {
11800
- setSaveError(
11801
- reason instanceof Error ? reason.message : "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"
11802
- );
11803
11796
  onError?.(reason, "save");
11804
11797
  return false;
11805
11798
  } finally {
@@ -11811,12 +11804,10 @@ function QueryForm({
11811
11804
  if (!onRemoveQuery || shortcutBusy || removeLock.current) return;
11812
11805
  removeLock.current = true;
11813
11806
  setRemoving(true);
11814
- setError("");
11815
11807
  try {
11816
11808
  await onRemoveQuery(query);
11817
11809
  if (activeShortcut === `saved:${query.key}`) setActiveShortcut("");
11818
11810
  } catch (reason) {
11819
- setError(reason instanceof Error ? reason.message : "\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");
11820
11811
  onError?.(reason, "remove");
11821
11812
  } finally {
11822
11813
  removeLock.current = false;
@@ -11966,8 +11957,7 @@ function QueryForm({
11966
11957
  query.key
11967
11958
  )),
11968
11959
  " "
11969
- ] }) : null,
11970
- error ? /* @__PURE__ */ jsx34("p", { className: "sia-query-form__error", role: "alert", children: error }) : null
11960
+ ] }) : null
11971
11961
  ]
11972
11962
  }
11973
11963
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.155",
3
+ "version": "0.1.157",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",