@sia.soul/sia-react-ui 0.1.119 → 0.1.121
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/{Select-BAFXKVZB.d.cts → Select-B9hlqeO5.d.cts} +6 -0
- package/dist/{Select-vjX7B63I.d.ts → Select-DgZW5a7j.d.ts} +6 -0
- package/dist/{chunk-GKFFFHHU.js → chunk-IRMKZYGV.js} +1 -1
- package/dist/{chunk-QBBIBJXW.js → chunk-ODJNSVNB.js} +2 -2
- package/dist/{chunk-AOWWHL5Z.js → chunk-RZR3EZRL.js} +2 -2
- package/dist/{chunk-BEVCKS5J.js → chunk-UW2W7RYZ.js} +81 -11
- package/dist/{chunk-BQIARYZB.js → chunk-XDG736H7.js} +2 -2
- package/dist/{chunk-6MGFX7B2.js → chunk-ZD45Z2NI.js} +15 -5
- package/dist/{core-bcMvT7pl.d.cts → core-C2V9aLTP.d.cts} +16 -3
- package/dist/{core-CA0gNAug.d.ts → core-DUjadxCD.d.ts} +16 -3
- package/dist/core.cjs +38 -6
- package/dist/core.css +9 -2
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +4 -4
- package/dist/game.cjs +15 -5
- package/dist/game.css +1 -1
- package/dist/game.js +1 -1
- package/dist/index.cjs +106 -9
- package/dist/index.css +9 -2
- package/dist/index.d.cts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +25 -7
- package/dist/rich-text-editor.cjs +15 -5
- package/dist/rich-text-editor.js +3 -3
- package/dist/{select-date-range-C9jlUrCX.d.ts → select-date-range-BskjBzTI.d.ts} +1 -1
- package/dist/{select-date-range-CIiI0F5o.d.cts → select-date-range-CZpQhFBu.d.cts} +1 -1
- package/dist/select-date-range.cjs +15 -5
- package/dist/select-date-range.d.cts +2 -2
- package/dist/select-date-range.d.ts +2 -2
- package/dist/select-date-range.js +4 -4
- package/package.json +1 -1
|
@@ -14,6 +14,12 @@ type ModalActionResult = void | boolean | Promise<void | boolean>;
|
|
|
14
14
|
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onSubmit"> {
|
|
15
15
|
/** 是否显示对话框 */
|
|
16
16
|
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 打开时自动聚焦正文中首个可用输入组件,跳过隐藏、禁用和只读字段;尊重内容自身已设置的焦点。
|
|
19
|
+
* 无可用输入组件或设置为 false 时,使用默认首个可聚焦元素。仅在打开时执行,不等待异步加载的字段;异步内容可在加载完成后自行聚焦。
|
|
20
|
+
* @defaultValue true
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
17
23
|
/** 标题 */
|
|
18
24
|
title?: ReactNode;
|
|
19
25
|
/** 弹框正文内容,默认字号为 13px;子元素可通过自身字号样式覆盖。 */
|
|
@@ -14,6 +14,12 @@ type ModalActionResult = void | boolean | Promise<void | boolean>;
|
|
|
14
14
|
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "onSubmit"> {
|
|
15
15
|
/** 是否显示对话框 */
|
|
16
16
|
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 打开时自动聚焦正文中首个可用输入组件,跳过隐藏、禁用和只读字段;尊重内容自身已设置的焦点。
|
|
19
|
+
* 无可用输入组件或设置为 false 时,使用默认首个可聚焦元素。仅在打开时执行,不等待异步加载的字段;异步内容可在加载完成后自行聚焦。
|
|
20
|
+
* @defaultValue true
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
17
23
|
/** 标题 */
|
|
18
24
|
title?: ReactNode;
|
|
19
25
|
/** 弹框正文内容,默认字号为 13px;子元素可通过自身字号样式覆盖。 */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FloatingScrollbarProvider,
|
|
3
3
|
Select
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XDG736H7.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZD45Z2NI.js";
|
|
8
8
|
import {
|
|
9
9
|
useFloatingPlaceholder
|
|
10
10
|
} from "./chunk-KY6A5IJH.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XDG736H7.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IRMKZYGV.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
10
|
} from "./chunk-SCEHVGKV.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon,
|
|
13
13
|
useOverlayLifecycle
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZD45Z2NI.js";
|
|
15
15
|
import {
|
|
16
16
|
Button
|
|
17
17
|
} from "./chunk-CZ2ITBRW.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);
|
|
@@ -1955,9 +2024,9 @@ var Typography = Object.assign(TypographyRoot, {
|
|
|
1955
2024
|
});
|
|
1956
2025
|
|
|
1957
2026
|
// src/components/FloatButton.tsx
|
|
1958
|
-
import { createContext, forwardRef as forwardRef2, useContext, useEffect as useEffect6, useId as
|
|
2027
|
+
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
2028
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1960
|
-
var GroupShape =
|
|
2029
|
+
var GroupShape = createContext2(void 0);
|
|
1961
2030
|
var FloatButtonRoot = forwardRef2(function FloatButton({
|
|
1962
2031
|
icon,
|
|
1963
2032
|
description,
|
|
@@ -1971,7 +2040,7 @@ var FloatButtonRoot = forwardRef2(function FloatButton({
|
|
|
1971
2040
|
children,
|
|
1972
2041
|
...props
|
|
1973
2042
|
}, ref) {
|
|
1974
|
-
const groupShape =
|
|
2043
|
+
const groupShape = useContext2(GroupShape);
|
|
1975
2044
|
const label = props["aria-label"] ?? (typeof tooltip === "string" ? tooltip : typeof description === "string" ? description : "\u60AC\u6D6E\u64CD\u4F5C");
|
|
1976
2045
|
const button = /* @__PURE__ */ jsx11(
|
|
1977
2046
|
"button",
|
|
@@ -2011,7 +2080,7 @@ function FloatButtonGroup({
|
|
|
2011
2080
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
2012
2081
|
const rootRef = useRef7(null);
|
|
2013
2082
|
const triggerRef = useRef7(null);
|
|
2014
|
-
const id =
|
|
2083
|
+
const id = useId3();
|
|
2015
2084
|
useEffect6(() => {
|
|
2016
2085
|
if (!trigger || !visible) return;
|
|
2017
2086
|
const close = (event) => {
|
|
@@ -2127,6 +2196,7 @@ export {
|
|
|
2127
2196
|
Carousel,
|
|
2128
2197
|
Collapse,
|
|
2129
2198
|
ImagePreview,
|
|
2199
|
+
ImagePreviewGroup,
|
|
2130
2200
|
Image,
|
|
2131
2201
|
message,
|
|
2132
2202
|
Upload,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Dropdown,
|
|
3
3
|
Input
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IRMKZYGV.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon,
|
|
7
7
|
Modal,
|
|
8
8
|
isAnchorBehindOverlay,
|
|
9
9
|
subscribeOverlayLayers
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZD45Z2NI.js";
|
|
11
11
|
import {
|
|
12
12
|
Button
|
|
13
13
|
} from "./chunk-CZ2ITBRW.js";
|
|
@@ -1216,7 +1216,14 @@ function focusableElements(container) {
|
|
|
1216
1216
|
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
1217
1217
|
)].filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true");
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function firstModalInput(panel) {
|
|
1220
|
+
const body = panel.querySelector(":scope > .sia-modal__body");
|
|
1221
|
+
const candidates = body?.querySelectorAll(
|
|
1222
|
+
'input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select, [contenteditable="true"], [role="combobox"], .sia-picker__trigger, .sia-cascader__trigger, .sia-tree-select__trigger'
|
|
1223
|
+
);
|
|
1224
|
+
return [...candidates ?? []].find((element) => (element.tabIndex >= 0 || element.isContentEditable && !element.hasAttribute("tabindex")) && !element.matches(":disabled, [readonly], [aria-readonly='true']") && !element.closest('[hidden], [inert], [aria-hidden="true"], [aria-disabled="true"]') && element.getClientRects().length > 0 && getComputedStyle(element).visibility === "visible");
|
|
1225
|
+
}
|
|
1226
|
+
function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, autoFocusInput = false) {
|
|
1220
1227
|
const overlayIdRef = useRef(/* @__PURE__ */ Symbol("sia-overlay"));
|
|
1221
1228
|
const closeRef = useRef(onRequestClose);
|
|
1222
1229
|
closeRef.current = onRequestClose;
|
|
@@ -1230,9 +1237,11 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
1230
1237
|
const unlockBody = lockBodyScroll();
|
|
1231
1238
|
const focusTimer = window.setTimeout(() => {
|
|
1232
1239
|
const panel = panelRef.current;
|
|
1233
|
-
if (!panel) return;
|
|
1240
|
+
if (!panel || overlayStack.at(-1) !== overlayId) return;
|
|
1241
|
+
if (panel.contains(document.activeElement) && document.activeElement !== panel) return;
|
|
1234
1242
|
const [firstFocusable] = focusableElements(panel);
|
|
1235
|
-
|
|
1243
|
+
const input = autoFocusInput ? firstModalInput(panel) : void 0;
|
|
1244
|
+
(input ?? firstFocusable ?? panel).focus({ preventScroll: true });
|
|
1236
1245
|
}, 0);
|
|
1237
1246
|
function handleKeyDown(event) {
|
|
1238
1247
|
if (overlayStack.at(-1) !== overlayId) return;
|
|
@@ -1269,7 +1278,7 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
1269
1278
|
unlockBody();
|
|
1270
1279
|
previouslyFocused?.focus({ preventScroll: true });
|
|
1271
1280
|
};
|
|
1272
|
-
}, [keyboard, open, panelRef]);
|
|
1281
|
+
}, [keyboard, open, panelRef, autoFocusInput]);
|
|
1273
1282
|
}
|
|
1274
1283
|
function OverlayPortal({ children, container }) {
|
|
1275
1284
|
if (typeof document === "undefined") return null;
|
|
@@ -1290,6 +1299,7 @@ var typeIcons = {
|
|
|
1290
1299
|
};
|
|
1291
1300
|
var ModalRoot = forwardRef2(function Modal({
|
|
1292
1301
|
open,
|
|
1302
|
+
autoFocus = true,
|
|
1293
1303
|
title,
|
|
1294
1304
|
children,
|
|
1295
1305
|
footer,
|
|
@@ -1379,7 +1389,7 @@ var ModalRoot = forwardRef2(function Modal({
|
|
|
1379
1389
|
setSubmitting(false);
|
|
1380
1390
|
}
|
|
1381
1391
|
}
|
|
1382
|
-
useOverlayLifecycle(rendered, localRef, requestClose, keyboard);
|
|
1392
|
+
useOverlayLifecycle(rendered, localRef, requestClose, keyboard, autoFocus);
|
|
1383
1393
|
if (!rendered) return null;
|
|
1384
1394
|
const mergedStyle = {
|
|
1385
1395
|
...height !== void 0 ? { display: "flex", flexDirection: "column", height, maxHeight: "calc(100dvh - 48px)" } : {},
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { B as ButtonProps, b as Button } from './Button-O_pNB3SQ.cjs';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.cjs';
|
|
5
|
-
import './Select-
|
|
5
|
+
import './Select-B9hlqeO5.cjs';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -1882,6 +1882,12 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
|
|
|
1882
1882
|
declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
|
|
1883
1883
|
/** 图片预览的属性配置。 */
|
|
1884
1884
|
interface ImagePreviewProps {
|
|
1885
|
+
/** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
|
|
1886
|
+
current?: number;
|
|
1887
|
+
/** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
|
|
1888
|
+
count?: number;
|
|
1889
|
+
/** 切换图片时回调新的序号,由外部同步 current、src 与 alt。 */
|
|
1890
|
+
onCurrentChange?: (current: number) => void;
|
|
1885
1891
|
/** 是否打开;传入后由外部控制显示状态。 */
|
|
1886
1892
|
open: boolean;
|
|
1887
1893
|
/** 图片或资源地址。 */
|
|
@@ -1895,7 +1901,7 @@ interface ImagePreviewProps {
|
|
|
1895
1901
|
onOpenChange: (open: boolean) => void;
|
|
1896
1902
|
}
|
|
1897
1903
|
/** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。 */
|
|
1898
|
-
declare function ImagePreview({ open, src, alt, onOpenChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1904
|
+
declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1899
1905
|
/** 图片预览的配置。 */
|
|
1900
1906
|
interface ImagePreviewConfig {
|
|
1901
1907
|
/** 图片或资源地址。 */
|
|
@@ -1926,6 +1932,13 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1926
1932
|
*/
|
|
1927
1933
|
rootClassName?: string;
|
|
1928
1934
|
}
|
|
1935
|
+
/** 图片预览组的配置。 */
|
|
1936
|
+
interface ImagePreviewGroupProps {
|
|
1937
|
+
/** 包含 Image 的内容,可嵌套布局容器;preview=false 或受控预览的 Image 不加入分组。 */
|
|
1938
|
+
children?: ReactNode;
|
|
1939
|
+
}
|
|
1940
|
+
/** 按图片在页面中的顺序组织预览,支持按钮和方向键切换;删除当前图片时关闭预览。 */
|
|
1941
|
+
declare function ImagePreviewGroup({ children }: ImagePreviewGroupProps): react.JSX.Element;
|
|
1929
1942
|
/** 图片组件。 */
|
|
1930
1943
|
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1931
1944
|
|
|
@@ -2424,4 +2437,4 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
2424
2437
|
/** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
|
|
2425
2438
|
declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
|
|
2426
2439
|
|
|
2427
|
-
export { type
|
|
2440
|
+
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 };
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { B as ButtonProps, b as Button } from './Button-BiL3Wjsd.js';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.js';
|
|
5
|
-
import './Select-
|
|
5
|
+
import './Select-DgZW5a7j.js';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -1882,6 +1882,12 @@ interface CollapseProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange">
|
|
|
1882
1882
|
declare function Collapse({ items, activeKey, defaultActiveKey, accordion, bordered, ghost, destroyInactivePanel, expandIconPosition, onChange, className, ...props }: CollapseProps): react.JSX.Element;
|
|
1883
1883
|
/** 图片预览的属性配置。 */
|
|
1884
1884
|
interface ImagePreviewProps {
|
|
1885
|
+
/** 分组中当前图片的序号,从 0 开始;与 count、onCurrentChange 一起提供时显示切换按钮。 */
|
|
1886
|
+
current?: number;
|
|
1887
|
+
/** 分组图片数量;大于 1 时允许按钮及左右方向键切换,首尾不循环。 */
|
|
1888
|
+
count?: number;
|
|
1889
|
+
/** 切换图片时回调新的序号,由外部同步 current、src 与 alt。 */
|
|
1890
|
+
onCurrentChange?: (current: number) => void;
|
|
1885
1891
|
/** 是否打开;传入后由外部控制显示状态。 */
|
|
1886
1892
|
open: boolean;
|
|
1887
1893
|
/** 图片或资源地址。 */
|
|
@@ -1895,7 +1901,7 @@ interface ImagePreviewProps {
|
|
|
1895
1901
|
onOpenChange: (open: boolean) => void;
|
|
1896
1902
|
}
|
|
1897
1903
|
/** 图片预览弹层,初始按窗口适配大图,支持水平/垂直翻转、左右旋转、缩放及拖动;重新打开或更换图片时重置视图。 */
|
|
1898
|
-
declare function ImagePreview({ open, src, alt, onOpenChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1904
|
+
declare function ImagePreview({ open, src, alt, onOpenChange, current, count, onCurrentChange }: ImagePreviewProps): react.ReactPortal | null;
|
|
1899
1905
|
/** 图片预览的配置。 */
|
|
1900
1906
|
interface ImagePreviewConfig {
|
|
1901
1907
|
/** 图片或资源地址。 */
|
|
@@ -1926,6 +1932,13 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1926
1932
|
*/
|
|
1927
1933
|
rootClassName?: string;
|
|
1928
1934
|
}
|
|
1935
|
+
/** 图片预览组的配置。 */
|
|
1936
|
+
interface ImagePreviewGroupProps {
|
|
1937
|
+
/** 包含 Image 的内容,可嵌套布局容器;preview=false 或受控预览的 Image 不加入分组。 */
|
|
1938
|
+
children?: ReactNode;
|
|
1939
|
+
}
|
|
1940
|
+
/** 按图片在页面中的顺序组织预览,支持按钮和方向键切换;删除当前图片时关闭预览。 */
|
|
1941
|
+
declare function ImagePreviewGroup({ children }: ImagePreviewGroupProps): react.JSX.Element;
|
|
1929
1942
|
/** 图片组件。 */
|
|
1930
1943
|
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1931
1944
|
|
|
@@ -2424,4 +2437,4 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
|
2424
2437
|
/** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
|
|
2425
2438
|
declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
|
|
2426
2439
|
|
|
2427
|
-
export { type
|
|
2440
|
+
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
|
@@ -3121,7 +3121,14 @@ function focusableElements(container) {
|
|
|
3121
3121
|
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
3122
3122
|
)].filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true");
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function firstModalInput(panel) {
|
|
3125
|
+
const body = panel.querySelector(":scope > .sia-modal__body");
|
|
3126
|
+
const candidates = body?.querySelectorAll(
|
|
3127
|
+
'input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select, [contenteditable="true"], [role="combobox"], .sia-picker__trigger, .sia-cascader__trigger, .sia-tree-select__trigger'
|
|
3128
|
+
);
|
|
3129
|
+
return [...candidates ?? []].find((element) => (element.tabIndex >= 0 || element.isContentEditable && !element.hasAttribute("tabindex")) && !element.matches(":disabled, [readonly], [aria-readonly='true']") && !element.closest('[hidden], [inert], [aria-hidden="true"], [aria-disabled="true"]') && element.getClientRects().length > 0 && getComputedStyle(element).visibility === "visible");
|
|
3130
|
+
}
|
|
3131
|
+
function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, autoFocusInput = false) {
|
|
3125
3132
|
const overlayIdRef = (0, import_react16.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
|
|
3126
3133
|
const closeRef = (0, import_react16.useRef)(onRequestClose);
|
|
3127
3134
|
closeRef.current = onRequestClose;
|
|
@@ -3135,9 +3142,11 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
3135
3142
|
const unlockBody = lockBodyScroll();
|
|
3136
3143
|
const focusTimer = window.setTimeout(() => {
|
|
3137
3144
|
const panel = panelRef.current;
|
|
3138
|
-
if (!panel) return;
|
|
3145
|
+
if (!panel || overlayStack.at(-1) !== overlayId) return;
|
|
3146
|
+
if (panel.contains(document.activeElement) && document.activeElement !== panel) return;
|
|
3139
3147
|
const [firstFocusable] = focusableElements(panel);
|
|
3140
|
-
|
|
3148
|
+
const input = autoFocusInput ? firstModalInput(panel) : void 0;
|
|
3149
|
+
(input ?? firstFocusable ?? panel).focus({ preventScroll: true });
|
|
3141
3150
|
}, 0);
|
|
3142
3151
|
function handleKeyDown(event) {
|
|
3143
3152
|
if (overlayStack.at(-1) !== overlayId) return;
|
|
@@ -3174,7 +3183,7 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true) {
|
|
|
3174
3183
|
unlockBody();
|
|
3175
3184
|
previouslyFocused?.focus({ preventScroll: true });
|
|
3176
3185
|
};
|
|
3177
|
-
}, [keyboard, open, panelRef]);
|
|
3186
|
+
}, [keyboard, open, panelRef, autoFocusInput]);
|
|
3178
3187
|
}
|
|
3179
3188
|
function OverlayPortal({ children, container }) {
|
|
3180
3189
|
if (typeof document === "undefined") return null;
|
|
@@ -3548,7 +3557,7 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
|
|
|
3548
3557
|
] }, item.key);
|
|
3549
3558
|
}) });
|
|
3550
3559
|
}
|
|
3551
|
-
function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
3560
|
+
function ImagePreview({ open, src, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
|
|
3552
3561
|
const previewRef = (0, import_react19.useRef)(null);
|
|
3553
3562
|
const stageRef = (0, import_react19.useRef)(null);
|
|
3554
3563
|
const [natural, setNatural] = (0, import_react19.useState)({ src: "", width: 0, height: 0 });
|
|
@@ -3571,6 +3580,18 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3571
3580
|
reset();
|
|
3572
3581
|
setFailed(false);
|
|
3573
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]);
|
|
3574
3595
|
(0, import_react19.useEffect)(() => {
|
|
3575
3596
|
const stage = stageRef.current;
|
|
3576
3597
|
if (!open || !stage) return;
|
|
@@ -3627,6 +3648,15 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3627
3648
|
src
|
|
3628
3649
|
) }),
|
|
3629
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,
|
|
3630
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 }) }),
|
|
3631
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 }) }),
|
|
3632
3662
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { variant: "text", title: "\u5411\u5DE6\u65CB\u8F6C", "aria-label": "\u5411\u5DE6\u65CB\u8F6C", disabled: !ready, onClick: () => {
|
|
@@ -3644,6 +3674,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
3644
3674
|
] })
|
|
3645
3675
|
] }), document.body);
|
|
3646
3676
|
}
|
|
3677
|
+
var ImageGroupContext = (0, import_react19.createContext)(null);
|
|
3647
3678
|
|
|
3648
3679
|
// src/components/FloatingPlaceholder.tsx
|
|
3649
3680
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -3674,6 +3705,7 @@ var typeIcons = {
|
|
|
3674
3705
|
};
|
|
3675
3706
|
var ModalRoot = (0, import_react20.forwardRef)(function Modal({
|
|
3676
3707
|
open,
|
|
3708
|
+
autoFocus = true,
|
|
3677
3709
|
title,
|
|
3678
3710
|
children,
|
|
3679
3711
|
footer,
|
|
@@ -3763,7 +3795,7 @@ var ModalRoot = (0, import_react20.forwardRef)(function Modal({
|
|
|
3763
3795
|
setSubmitting(false);
|
|
3764
3796
|
}
|
|
3765
3797
|
}
|
|
3766
|
-
useOverlayLifecycle(rendered, localRef, requestClose, keyboard);
|
|
3798
|
+
useOverlayLifecycle(rendered, localRef, requestClose, keyboard, autoFocus);
|
|
3767
3799
|
if (!rendered) return null;
|
|
3768
3800
|
const mergedStyle = {
|
|
3769
3801
|
...height !== void 0 ? { display: "flex", flexDirection: "column", height, maxHeight: "calc(100dvh - 48px)" } : {},
|
package/dist/core.css
CHANGED
|
@@ -2744,7 +2744,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
2744
2744
|
gap: 2px;
|
|
2745
2745
|
flex: 1;
|
|
2746
2746
|
}
|
|
2747
|
-
.sia-alert__content span {
|
|
2747
|
+
.sia-alert__content > span {
|
|
2748
2748
|
color: var(--sia-color-text-secondary);
|
|
2749
2749
|
}
|
|
2750
2750
|
.sia-alert__action {
|
|
@@ -8026,6 +8026,13 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8026
8026
|
padding: 0;
|
|
8027
8027
|
border: 0;
|
|
8028
8028
|
}
|
|
8029
|
+
.sia-form--fill {
|
|
8030
|
+
display: flex;
|
|
8031
|
+
flex: 1;
|
|
8032
|
+
flex-direction: column;
|
|
8033
|
+
min-width: 0;
|
|
8034
|
+
min-height: 0;
|
|
8035
|
+
}
|
|
8029
8036
|
.sia-form-item {
|
|
8030
8037
|
display: grid;
|
|
8031
8038
|
grid-template-columns: var(--sia-form-label-width, var(--sia-form-auto-label-width, 0px)) minmax(0, 1fr);
|
|
@@ -10461,7 +10468,7 @@ body > .sia-popup-portal[data-sia-popup-layer] {
|
|
|
10461
10468
|
.sia-alert__content {
|
|
10462
10469
|
flex: 1;
|
|
10463
10470
|
}
|
|
10464
|
-
.sia-alert__content strong,
|
|
10471
|
+
.sia-alert__content > strong,
|
|
10465
10472
|
.sia-alert__content > span {
|
|
10466
10473
|
display: block;
|
|
10467
10474
|
}
|
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-C2V9aLTP.cjs';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
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-
|
|
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';
|
|
5
5
|
import './shared-Bx4B28Wh.cjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-DUjadxCD.js';
|
|
2
2
|
export { b as Button, B as ButtonProps, a as ButtonSize, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
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-
|
|
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';
|
|
5
5
|
import './shared-Bx4B28Wh.js';
|