@sia.soul/sia-react-ui 0.1.114 → 0.1.115
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-Cf0xz1Tg.d.cts → Select-BAFXKVZB.d.cts} +1 -1
- package/dist/{Select-BddM4uXC.d.ts → Select-vjX7B63I.d.ts} +1 -1
- package/dist/{chunk-NKENBSLP.js → chunk-6XQ2LDGT.js} +1 -1
- package/dist/{chunk-DUOOIPWH.js → chunk-GNOZYUIH.js} +7 -4
- package/dist/{chunk-7KNHBJZX.js → chunk-KPOK4HIQ.js} +10 -3
- package/dist/{chunk-6CII5JCT.js → chunk-MDU5EONC.js} +1 -1
- package/dist/{chunk-IOVN3QL7.js → chunk-SPIQSYWQ.js} +4 -1
- package/dist/{core-CEaTbhWd.d.cts → core-O6oDXbkG.d.cts} +10 -6
- package/dist/{core-C6muCCSS.d.ts → core-uVaNwjTO.d.ts} +10 -6
- package/dist/core.cjs +13 -3
- package/dist/core.css +45 -0
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +3 -3
- package/dist/index.cjs +66 -13
- package/dist/index.css +76 -0
- package/dist/index.d.cts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +164 -124
- package/dist/rich-text-editor.cjs +4 -1
- package/dist/rich-text-editor.js +2 -2
- package/dist/{select-date-range-yGDEA1RP.d.ts → select-date-range-C9jlUrCX.d.ts} +1 -1
- package/dist/{select-date-range-Cm5o2xPp.d.cts → select-date-range-CIiI0F5o.d.cts} +1 -1
- package/dist/select-date-range.cjs +9 -2
- package/dist/select-date-range.d.cts +2 -2
- package/dist/select-date-range.d.ts +2 -2
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
|
@@ -269,7 +269,7 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
|
|
|
269
269
|
*/
|
|
270
270
|
notFoundContent?: ReactNode;
|
|
271
271
|
}
|
|
272
|
-
/**
|
|
272
|
+
/** 选择器组件。下拉面板每次展开自动定位到列表顺序中的第一个已选项,支持普通和虚拟列表;未选中时从顶部显示。展开时 Escape 只收起选择器,不关闭外层弹框或抽屉。 */
|
|
273
273
|
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
274
274
|
|
|
275
275
|
export { type ModalOpenConfig as M, type OverlayContainer as O, type SelectOption as S, type OverlayApiHandle as a, type SelectChangeValue as b, type SelectProps as c, type ModalActionResult as d, Modal as e, type ModalProps as f, type ModalType as g, Select as h, type SelectMode as i, type SelectValue as j };
|
|
@@ -269,7 +269,7 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
|
|
|
269
269
|
*/
|
|
270
270
|
notFoundContent?: ReactNode;
|
|
271
271
|
}
|
|
272
|
-
/**
|
|
272
|
+
/** 选择器组件。下拉面板每次展开自动定位到列表顺序中的第一个已选项,支持普通和虚拟列表;未选中时从顶部显示。展开时 Escape 只收起选择器,不关闭外层弹框或抽屉。 */
|
|
273
273
|
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
274
274
|
|
|
275
275
|
export { type ModalOpenConfig as M, type OverlayContainer as O, type SelectOption as S, type OverlayApiHandle as a, type SelectChangeValue as b, type SelectProps as c, type ModalActionResult as d, Modal as e, type ModalProps as f, type ModalType as g, Select as h, type SelectMode as i, type SelectValue as j };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KPOK4HIQ.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SPIQSYWQ.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
10
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -1124,7 +1124,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
1124
1124
|
] })
|
|
1125
1125
|
] }), document.body);
|
|
1126
1126
|
}
|
|
1127
|
-
function Image({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onError, style, ...props }) {
|
|
1127
|
+
function Image({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onLoad, onError, style, ...props }) {
|
|
1128
1128
|
const config = typeof preview === "object" ? preview : {};
|
|
1129
1129
|
const controlled = typeof preview === "object" && preview.open !== void 0;
|
|
1130
1130
|
const [internalOpen, setInternalOpen] = useState5(false);
|
|
@@ -1143,7 +1143,10 @@ function Image({ fallback, placeholder, preview = true, rootClassName = "", clas
|
|
|
1143
1143
|
}
|
|
1144
1144
|
return /* @__PURE__ */ jsxs6("span", { className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
1145
1145
|
!loaded && placeholder ? /* @__PURE__ */ jsx6("span", { className: "sia-image__placeholder", children: placeholder }) : null,
|
|
1146
|
-
/* @__PURE__ */ jsx6("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (
|
|
1146
|
+
/* @__PURE__ */ jsx6("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (event) => {
|
|
1147
|
+
setLoaded(true);
|
|
1148
|
+
onLoad?.(event);
|
|
1149
|
+
}, onError: (event) => {
|
|
1147
1150
|
if (!failed && fallback) setFailed(true);
|
|
1148
1151
|
onError?.(event);
|
|
1149
1152
|
} }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Dropdown,
|
|
3
3
|
Input
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SPIQSYWQ.js";
|
|
5
5
|
import {
|
|
6
6
|
Icon,
|
|
7
7
|
Modal
|
|
@@ -1678,8 +1678,15 @@ var Select = forwardRef2(function Select2({
|
|
|
1678
1678
|
function clearSelection() {
|
|
1679
1679
|
setCurrentValue(multiple ? [] : null);
|
|
1680
1680
|
}
|
|
1681
|
+
function handleDropdownEscape(event) {
|
|
1682
|
+
if (event.key !== "Escape" || !open || popupMode !== "dropdown") return false;
|
|
1683
|
+
event.preventDefault();
|
|
1684
|
+
event.stopPropagation();
|
|
1685
|
+
closeDropdown();
|
|
1686
|
+
return true;
|
|
1687
|
+
}
|
|
1681
1688
|
function handleInteractionKeyDown(event, fromSearch = false) {
|
|
1682
|
-
if (popupMode === "modal" && open) return;
|
|
1689
|
+
if (handleDropdownEscape(event) || popupMode === "modal" && open) return;
|
|
1683
1690
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
1684
1691
|
event.preventDefault();
|
|
1685
1692
|
if (!open) openDropdown();
|
|
@@ -1784,7 +1791,7 @@ var Select = forwardRef2(function Select2({
|
|
|
1784
1791
|
}
|
|
1785
1792
|
),
|
|
1786
1793
|
allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ jsx5("button", { className: "sia-select__clear", type: "button", "aria-label": "\u6E05\u7A7A\u9009\u62E9", onClick: clearValue, children: /* @__PURE__ */ jsx5(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
1787
|
-
/* @__PURE__ */ jsxs5(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
1794
|
+
/* @__PURE__ */ jsxs5(PopupPortal, { ref: popupRef, onKeyDown: handleDropdownEscape, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
1788
1795
|
/* @__PURE__ */ jsx5(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
1789
1796
|
showSearch || allowInput ? /* @__PURE__ */ jsxs5("label", { className: "sia-select__search", children: [
|
|
1790
1797
|
/* @__PURE__ */ jsx5(Icon, { name: "search", size: 15 }),
|
|
@@ -167,6 +167,7 @@ function MenuLevel({
|
|
|
167
167
|
function Menu({
|
|
168
168
|
items,
|
|
169
169
|
mode = "vertical",
|
|
170
|
+
gridColumns = 2,
|
|
170
171
|
theme = "light",
|
|
171
172
|
selectedKeys,
|
|
172
173
|
defaultSelectedKeys = [],
|
|
@@ -182,6 +183,7 @@ function Menu({
|
|
|
182
183
|
onDeselect,
|
|
183
184
|
onOpenChange,
|
|
184
185
|
className = "",
|
|
186
|
+
style,
|
|
185
187
|
...rest
|
|
186
188
|
}) {
|
|
187
189
|
const menuId = useId();
|
|
@@ -214,7 +216,8 @@ function Menu({
|
|
|
214
216
|
else onSelect?.({ ...info, selectedKeys: [...next] });
|
|
215
217
|
if (mode !== "inline") setOpen([]);
|
|
216
218
|
}
|
|
217
|
-
|
|
219
|
+
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
220
|
+
return /* @__PURE__ */ jsx("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ jsx(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
218
221
|
}
|
|
219
222
|
function Steps({ items, current = 0, initial = 0, direction = "horizontal", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
220
223
|
return /* @__PURE__ */ jsx("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
@@ -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-BAFXKVZB.cjs';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -486,8 +486,8 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
486
486
|
/** 标记状态或筛选条件的标签,支持语义配色、自定义边框色或背景色及关闭操作。 */
|
|
487
487
|
declare function Tag({ size: sizeProp, color, status, compact, variant, icon, closable, closeOnHover, disabled, onClose, className, children, style, ...props }: TagProps): react.JSX.Element;
|
|
488
488
|
|
|
489
|
-
/**
|
|
490
|
-
type MenuMode = "vertical" | "horizontal" | "inline";
|
|
489
|
+
/** 菜单排列模式;vertical 为纵向列表,horizontal 为横向菜单,inline 为内嵌子菜单,grid 为双列圆角卡片(图标在上、名称在下,子菜单以弹层展开)。 */
|
|
490
|
+
type MenuMode = "vertical" | "horizontal" | "inline" | "grid";
|
|
491
491
|
/** 菜单的亮色或暗色主题。 */
|
|
492
492
|
type MenuTheme = "light" | "dark";
|
|
493
493
|
/** 菜单的项目定义。 */
|
|
@@ -533,10 +533,12 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
533
533
|
/** 按展示顺序排列的项目配置。 */
|
|
534
534
|
items: readonly MenuItem[];
|
|
535
535
|
/**
|
|
536
|
-
*
|
|
536
|
+
* 展示或交互模式;grid 显示双列圆角卡片,图标居上、名称居下,保留选中和当前生效标记。
|
|
537
537
|
* @defaultValue "vertical"
|
|
538
538
|
*/
|
|
539
539
|
mode?: MenuMode;
|
|
540
|
+
/** grid 模式的列数,默认 2;正数取整且至少为 1,auto 按每列至少 88px 自动换列。通过 --sia-menu-grid-columns 传递到分组;style 中的同名变量可覆盖。其他模式不生效。 */
|
|
541
|
+
gridColumns?: number | "auto";
|
|
540
542
|
/**
|
|
541
543
|
组件的配色主题。
|
|
542
544
|
* @defaultValue "light"
|
|
@@ -597,7 +599,7 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
597
599
|
onOpenChange?: (keys: string[]) => void;
|
|
598
600
|
}
|
|
599
601
|
/** 菜单组件。 */
|
|
600
|
-
declare function Menu({ items, mode, theme, selectedKeys, defaultSelectedKeys, openKeys, defaultOpenKeys, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, onClick, onSelect, onDeselect, onOpenChange, className, ...rest }: MenuProps): react.JSX.Element;
|
|
602
|
+
declare function Menu({ items, mode, gridColumns, theme, selectedKeys, defaultSelectedKeys, openKeys, defaultOpenKeys, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, onClick, onSelect, onDeselect, onOpenChange, className, style, ...rest }: MenuProps): react.JSX.Element;
|
|
601
603
|
/** Step的状态类型。 */
|
|
602
604
|
type StepStatus = "wait" | "process" | "finish" | "error";
|
|
603
605
|
/** Step的项目定义。 */
|
|
@@ -1890,6 +1892,8 @@ interface ImagePreviewConfig {
|
|
|
1890
1892
|
}
|
|
1891
1893
|
/** 图片的属性配置。 */
|
|
1892
1894
|
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
1895
|
+
/** 图片成功加载后触发,传入原生图片的 React 加载事件;在框架更新占位状态后调用,可用于恢复业务预览状态。 */
|
|
1896
|
+
onLoad?: ImgHTMLAttributes<HTMLImageElement>["onLoad"];
|
|
1893
1897
|
/** 资源加载失败时使用的替代内容或地址。 */
|
|
1894
1898
|
fallback?: string;
|
|
1895
1899
|
/** 未填写或未选择时的提示内容。 */
|
|
@@ -1906,7 +1910,7 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1906
1910
|
rootClassName?: string;
|
|
1907
1911
|
}
|
|
1908
1912
|
/** 图片组件。 */
|
|
1909
|
-
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1913
|
+
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1910
1914
|
|
|
1911
1915
|
/** 输入框的属性配置。 */
|
|
1912
1916
|
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "size"> {
|
|
@@ -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-vjX7B63I.js';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -486,8 +486,8 @@ interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
486
486
|
/** 标记状态或筛选条件的标签,支持语义配色、自定义边框色或背景色及关闭操作。 */
|
|
487
487
|
declare function Tag({ size: sizeProp, color, status, compact, variant, icon, closable, closeOnHover, disabled, onClose, className, children, style, ...props }: TagProps): react.JSX.Element;
|
|
488
488
|
|
|
489
|
-
/**
|
|
490
|
-
type MenuMode = "vertical" | "horizontal" | "inline";
|
|
489
|
+
/** 菜单排列模式;vertical 为纵向列表,horizontal 为横向菜单,inline 为内嵌子菜单,grid 为双列圆角卡片(图标在上、名称在下,子菜单以弹层展开)。 */
|
|
490
|
+
type MenuMode = "vertical" | "horizontal" | "inline" | "grid";
|
|
491
491
|
/** 菜单的亮色或暗色主题。 */
|
|
492
492
|
type MenuTheme = "light" | "dark";
|
|
493
493
|
/** 菜单的项目定义。 */
|
|
@@ -533,10 +533,12 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
533
533
|
/** 按展示顺序排列的项目配置。 */
|
|
534
534
|
items: readonly MenuItem[];
|
|
535
535
|
/**
|
|
536
|
-
*
|
|
536
|
+
* 展示或交互模式;grid 显示双列圆角卡片,图标居上、名称居下,保留选中和当前生效标记。
|
|
537
537
|
* @defaultValue "vertical"
|
|
538
538
|
*/
|
|
539
539
|
mode?: MenuMode;
|
|
540
|
+
/** grid 模式的列数,默认 2;正数取整且至少为 1,auto 按每列至少 88px 自动换列。通过 --sia-menu-grid-columns 传递到分组;style 中的同名变量可覆盖。其他模式不生效。 */
|
|
541
|
+
gridColumns?: number | "auto";
|
|
540
542
|
/**
|
|
541
543
|
组件的配色主题。
|
|
542
544
|
* @defaultValue "light"
|
|
@@ -597,7 +599,7 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
597
599
|
onOpenChange?: (keys: string[]) => void;
|
|
598
600
|
}
|
|
599
601
|
/** 菜单组件。 */
|
|
600
|
-
declare function Menu({ items, mode, theme, selectedKeys, defaultSelectedKeys, openKeys, defaultOpenKeys, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, onClick, onSelect, onDeselect, onOpenChange, className, ...rest }: MenuProps): react.JSX.Element;
|
|
602
|
+
declare function Menu({ items, mode, gridColumns, theme, selectedKeys, defaultSelectedKeys, openKeys, defaultOpenKeys, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, onClick, onSelect, onDeselect, onOpenChange, className, style, ...rest }: MenuProps): react.JSX.Element;
|
|
601
603
|
/** Step的状态类型。 */
|
|
602
604
|
type StepStatus = "wait" | "process" | "finish" | "error";
|
|
603
605
|
/** Step的项目定义。 */
|
|
@@ -1890,6 +1892,8 @@ interface ImagePreviewConfig {
|
|
|
1890
1892
|
}
|
|
1891
1893
|
/** 图片的属性配置。 */
|
|
1892
1894
|
interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
1895
|
+
/** 图片成功加载后触发,传入原生图片的 React 加载事件;在框架更新占位状态后调用,可用于恢复业务预览状态。 */
|
|
1896
|
+
onLoad?: ImgHTMLAttributes<HTMLImageElement>["onLoad"];
|
|
1893
1897
|
/** 资源加载失败时使用的替代内容或地址。 */
|
|
1894
1898
|
fallback?: string;
|
|
1895
1899
|
/** 未填写或未选择时的提示内容。 */
|
|
@@ -1906,7 +1910,7 @@ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
|
1906
1910
|
rootClassName?: string;
|
|
1907
1911
|
}
|
|
1908
1912
|
/** 图片组件。 */
|
|
1909
|
-
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1913
|
+
declare function Image({ fallback, placeholder, preview, rootClassName, className, src, alt, onLoad, onError, style, ...props }: ImageProps): react.JSX.Element;
|
|
1910
1914
|
|
|
1911
1915
|
/** 输入框的属性配置。 */
|
|
1912
1916
|
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "size"> {
|
package/dist/core.cjs
CHANGED
|
@@ -1709,6 +1709,7 @@ function MenuLevel({
|
|
|
1709
1709
|
function Menu({
|
|
1710
1710
|
items,
|
|
1711
1711
|
mode = "vertical",
|
|
1712
|
+
gridColumns = 2,
|
|
1712
1713
|
theme = "light",
|
|
1713
1714
|
selectedKeys,
|
|
1714
1715
|
defaultSelectedKeys = [],
|
|
@@ -1724,6 +1725,7 @@ function Menu({
|
|
|
1724
1725
|
onDeselect,
|
|
1725
1726
|
onOpenChange,
|
|
1726
1727
|
className = "",
|
|
1728
|
+
style,
|
|
1727
1729
|
...rest
|
|
1728
1730
|
}) {
|
|
1729
1731
|
const menuId = (0, import_react6.useId)();
|
|
@@ -1756,7 +1758,8 @@ function Menu({
|
|
|
1756
1758
|
else onSelect?.({ ...info, selectedKeys: [...next] });
|
|
1757
1759
|
if (mode !== "inline") setOpen([]);
|
|
1758
1760
|
}
|
|
1759
|
-
|
|
1761
|
+
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
1762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
1760
1763
|
}
|
|
1761
1764
|
function Segmented({ options, value, defaultValue, variant = "default", shape = "capsule", size: sizeProp, block = false, vertical = false, disabled = false, onChange, className = "", onKeyDown, ...props }) {
|
|
1762
1765
|
const size = useControlSize(sizeProp);
|
|
@@ -4573,8 +4576,15 @@ var Select = (0, import_react25.forwardRef)(function Select2({
|
|
|
4573
4576
|
function clearSelection() {
|
|
4574
4577
|
setCurrentValue(multiple ? [] : null);
|
|
4575
4578
|
}
|
|
4579
|
+
function handleDropdownEscape(event) {
|
|
4580
|
+
if (event.key !== "Escape" || !open || popupMode !== "dropdown") return false;
|
|
4581
|
+
event.preventDefault();
|
|
4582
|
+
event.stopPropagation();
|
|
4583
|
+
closeDropdown();
|
|
4584
|
+
return true;
|
|
4585
|
+
}
|
|
4576
4586
|
function handleInteractionKeyDown(event, fromSearch = false) {
|
|
4577
|
-
if (popupMode === "modal" && open) return;
|
|
4587
|
+
if (handleDropdownEscape(event) || popupMode === "modal" && open) return;
|
|
4578
4588
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
4579
4589
|
event.preventDefault();
|
|
4580
4590
|
if (!open) openDropdown();
|
|
@@ -4679,7 +4689,7 @@ var Select = (0, import_react25.forwardRef)(function Select2({
|
|
|
4679
4689
|
}
|
|
4680
4690
|
),
|
|
4681
4691
|
allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "sia-select__clear", type: "button", "aria-label": "\u6E05\u7A7A\u9009\u62E9", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
4682
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(PopupPortal, { ref: popupRef, onKeyDown: handleDropdownEscape, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
4683
4693
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
4684
4694
|
showSearch || allowInput ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: "sia-select__search", children: [
|
|
4685
4695
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "search", size: 15 }),
|
package/dist/core.css
CHANGED
|
@@ -8258,6 +8258,51 @@ body:has(.sia-window-frame[data-sia-text-selectable=false]) img {
|
|
|
8258
8258
|
pointer-events: none;
|
|
8259
8259
|
z-index: -1;
|
|
8260
8260
|
}
|
|
8261
|
+
.sia-menu--grid,
|
|
8262
|
+
.sia-menu--grid .sia-menu__group > ul {
|
|
8263
|
+
display: grid;
|
|
8264
|
+
grid-template-columns: var(--sia-menu-grid-columns, repeat(2, minmax(0, 1fr)));
|
|
8265
|
+
gap: 8px;
|
|
8266
|
+
align-content: start;
|
|
8267
|
+
border-inline-end: 0;
|
|
8268
|
+
}
|
|
8269
|
+
.sia-menu--grid > .sia-menu__entry,
|
|
8270
|
+
.sia-menu--grid .sia-menu__group > ul > .sia-menu__entry {
|
|
8271
|
+
min-width: 0;
|
|
8272
|
+
margin: 0;
|
|
8273
|
+
}
|
|
8274
|
+
.sia-menu--grid > .sia-menu__entry > .sia-menu__item,
|
|
8275
|
+
.sia-menu--grid .sia-menu__group > ul > .sia-menu__entry > .sia-menu__item {
|
|
8276
|
+
flex-direction: column;
|
|
8277
|
+
justify-content: flex-start;
|
|
8278
|
+
gap: 10px;
|
|
8279
|
+
height: 100%;
|
|
8280
|
+
min-height: 108px;
|
|
8281
|
+
padding: 14px 6px 10px;
|
|
8282
|
+
border: 1px solid var(--sia-color-border);
|
|
8283
|
+
border-radius: var(--sia-radius-lg, 10px);
|
|
8284
|
+
text-align: center;
|
|
8285
|
+
}
|
|
8286
|
+
.sia-menu--grid > .sia-menu__entry > .sia-menu__item > .sia-menu__label,
|
|
8287
|
+
.sia-menu--grid .sia-menu__group > ul > .sia-menu__entry > .sia-menu__item > .sia-menu__label {
|
|
8288
|
+
flex: 0 0 auto;
|
|
8289
|
+
width: 100%;
|
|
8290
|
+
margin-top: auto;
|
|
8291
|
+
font-size: 12px;
|
|
8292
|
+
line-height: 1.5;
|
|
8293
|
+
white-space: normal;
|
|
8294
|
+
overflow-wrap: anywhere;
|
|
8295
|
+
}
|
|
8296
|
+
.sia-menu--grid > .sia-menu__entry > .sia-menu__item > .sia-menu__applied,
|
|
8297
|
+
.sia-menu--grid .sia-menu__group > ul > .sia-menu__entry > .sia-menu__item > .sia-menu__applied {
|
|
8298
|
+
top: 8px;
|
|
8299
|
+
right: 6px;
|
|
8300
|
+
transform: none;
|
|
8301
|
+
}
|
|
8302
|
+
.sia-menu--grid > .sia-menu__divider,
|
|
8303
|
+
.sia-menu--grid > .sia-menu__group {
|
|
8304
|
+
grid-column: 1 / -1;
|
|
8305
|
+
}
|
|
8261
8306
|
.sia-menu__extra {
|
|
8262
8307
|
color: var(--sia-color-text-secondary);
|
|
8263
8308
|
font-size: 12px;
|
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, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-O6oDXbkG.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-BAFXKVZB.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, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-
|
|
1
|
+
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, K as Icon, L as IconName, M as IconProps, N as IconVariant, U as Input, V as InputProps, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ag as Result, ah as ResultProps, ai as ResultStatus, aj as Segmented, ak as SegmentedOption, al as SegmentedProps, am as SegmentedValue, at as TabItem, au as Tabs, aw as TabsOrientation, ax as TabsPosition, ay as TabsProps, az as TabsType, aA as Tag, aB as TagProps, aC as TagSize, T as TagStatus, aD as TagVariant, aH as Toolbar, aI as ToolbarItem, aJ as ToolbarProps, aU as Typography, aV as TypographyLinkProps, aW as TypographyProps, aX as TypographyTitleProps, aY as TypographyType, aZ as Upload, a_ as UploadChangeInfo, a$ as UploadDraggerProps, b0 as UploadFile, b1 as UploadFileStatus, b4 as UploadProps, b8 as UploadRequestOptions, bc as message } from './core-uVaNwjTO.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-vjX7B63I.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import './shared-Bx4B28Wh.js';
|
package/dist/core.js
CHANGED
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
Typography,
|
|
12
12
|
Upload,
|
|
13
13
|
message
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GNOZYUIH.js";
|
|
15
15
|
import "./chunk-RX242MUO.js";
|
|
16
16
|
import {
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KPOK4HIQ.js";
|
|
19
19
|
import {
|
|
20
20
|
Input,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SPIQSYWQ.js";
|
|
23
23
|
import "./chunk-SCEHVGKV.js";
|
|
24
24
|
import {
|
|
25
25
|
Icon,
|
package/dist/index.cjs
CHANGED
|
@@ -2100,7 +2100,7 @@ function ImagePreview({ open, src, alt = "", onOpenChange }) {
|
|
|
2100
2100
|
] })
|
|
2101
2101
|
] }), document.body);
|
|
2102
2102
|
}
|
|
2103
|
-
function Image2({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onError, style, ...props }) {
|
|
2103
|
+
function Image2({ fallback, placeholder, preview = true, rootClassName = "", className = "", src, alt = "", onLoad, onError, style, ...props }) {
|
|
2104
2104
|
const config = typeof preview === "object" ? preview : {};
|
|
2105
2105
|
const controlled = typeof preview === "object" && preview.open !== void 0;
|
|
2106
2106
|
const [internalOpen, setInternalOpen] = (0, import_react7.useState)(false);
|
|
@@ -2119,7 +2119,10 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
|
|
|
2119
2119
|
}
|
|
2120
2120
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: `sia-image ${rootClassName}`.trim(), style: rootStyle, children: [
|
|
2121
2121
|
!loaded && placeholder ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sia-image__placeholder", children: placeholder }) : null,
|
|
2122
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { ...withTitleTooltip(props), src: displaySrc, alt, className, onLoad: (event) => {
|
|
2123
|
+
setLoaded(true);
|
|
2124
|
+
onLoad?.(event);
|
|
2125
|
+
}, onError: (event) => {
|
|
2123
2126
|
if (!failed && fallback) setFailed(true);
|
|
2124
2127
|
onError?.(event);
|
|
2125
2128
|
} }),
|
|
@@ -2133,13 +2136,25 @@ function Image2({ fallback, placeholder, preview = true, rootClassName = "", cla
|
|
|
2133
2136
|
|
|
2134
2137
|
// src/components/CursorPreview.tsx
|
|
2135
2138
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2136
|
-
function CursorPreview({ frames, size = 48, playing = true, followPointer = true, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerMove, onPointerLeave, ...props }) {
|
|
2139
|
+
function CursorPreview({ frames, size = 48, playing = true, followPointer = true, showHotspot = false, height = 180, empty = "\u6682\u65E0\u6307\u9488\u9884\u89C8", alt = "\u9F20\u6807\u6307\u9488\u9884\u89C8", className = "", style, children, onPointerEnter, onPointerMove, onPointerLeave, ...props }) {
|
|
2140
|
+
const rootRef = (0, import_react8.useRef)(null);
|
|
2141
|
+
const [bounds, setBounds] = (0, import_react8.useState)({ width: 0, height: 0 });
|
|
2142
|
+
const [hovered, setHovered] = (0, import_react8.useState)(false);
|
|
2137
2143
|
const [index, setIndex] = (0, import_react8.useState)(0);
|
|
2138
2144
|
const [point, setPoint] = (0, import_react8.useState)(null);
|
|
2139
2145
|
const [reduced, setReduced] = (0, import_react8.useState)(false);
|
|
2140
2146
|
const [failed, setFailed] = (0, import_react8.useState)(false);
|
|
2141
2147
|
const safeSize = Math.max(8, Number.isFinite(size) ? size : 48);
|
|
2142
2148
|
const frame = frames[playing && !reduced ? index % Math.max(1, frames.length) : 0];
|
|
2149
|
+
(0, import_react8.useLayoutEffect)(() => {
|
|
2150
|
+
const root = rootRef.current;
|
|
2151
|
+
if (!showHotspot || !root) return;
|
|
2152
|
+
const measure = () => setBounds({ width: root.clientWidth, height: root.clientHeight });
|
|
2153
|
+
measure();
|
|
2154
|
+
const observer = new ResizeObserver(measure);
|
|
2155
|
+
observer.observe(root);
|
|
2156
|
+
return () => observer.disconnect();
|
|
2157
|
+
}, [showHotspot]);
|
|
2143
2158
|
(0, import_react8.useEffect)(() => {
|
|
2144
2159
|
setIndex(0);
|
|
2145
2160
|
}, [frames]);
|
|
@@ -2158,18 +2173,46 @@ function CursorPreview({ frames, size = 48, playing = true, followPointer = true
|
|
|
2158
2173
|
}, [playing, reduced, frames, index, frame]);
|
|
2159
2174
|
function move(event) {
|
|
2160
2175
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
2176
|
+
if (event.pointerType !== "touch") setHovered(true);
|
|
2161
2177
|
if (followPointer && event.pointerType !== "touch") setPoint({ x: event.clientX - rect.left, y: event.clientY - rect.top });
|
|
2162
2178
|
onPointerMove?.(event);
|
|
2163
2179
|
}
|
|
2164
2180
|
const following = !!point && followPointer && !!frame && !failed;
|
|
2165
2181
|
const offset = (value) => Math.max(0, Math.min(1, Number.isFinite(value) ? value : 0)) * safeSize;
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2182
|
+
const hotspotX = (bounds.width - safeSize) / 2 + offset(frame?.hotspotX);
|
|
2183
|
+
const hotspotY = (bounds.height - safeSize) / 2 + offset(frame?.hotspotY);
|
|
2184
|
+
const direction = bounds.width - hotspotX >= 130 ? 1 : -1;
|
|
2185
|
+
const lineY = Math.max(18, hotspotY - 42);
|
|
2186
|
+
const elbowX = hotspotX + direction * 28;
|
|
2187
|
+
const endX = direction === 1 ? Math.min(bounds.width - 58, hotspotX + 82) : Math.max(58, hotspotX - 82);
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2189
|
+
"div",
|
|
2190
|
+
{
|
|
2191
|
+
...props,
|
|
2192
|
+
ref: rootRef,
|
|
2193
|
+
className: `sia-cursor-preview${following ? " is-following" : ""} ${className}`.trim(),
|
|
2194
|
+
style: { height, ...style },
|
|
2195
|
+
onPointerEnter: (event) => {
|
|
2196
|
+
if (event.pointerType !== "touch") setHovered(true);
|
|
2197
|
+
onPointerEnter?.(event);
|
|
2198
|
+
},
|
|
2199
|
+
onPointerMove: move,
|
|
2200
|
+
onPointerLeave: (event) => {
|
|
2201
|
+
setHovered(false);
|
|
2202
|
+
setPoint(null);
|
|
2203
|
+
onPointerLeave?.(event);
|
|
2204
|
+
},
|
|
2205
|
+
children: [
|
|
2206
|
+
frame ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sia-cursor-preview__bitmap", style: { width: safeSize, height: safeSize, left: following ? point.x - offset(frame.hotspotX) : "50%", top: following ? point.y - offset(frame.hotspotY) : "50%", transform: following ? void 0 : "translate(-50%, -50%)" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Image2, { src: frame.src, width: safeSize, height: safeSize, alt, preview: false, draggable: false, onLoad: () => setFailed(false), onError: () => setFailed(true) }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sia-cursor-preview__empty", children: empty }),
|
|
2207
|
+
showHotspot && !hovered && frame && !failed && bounds.width > 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { className: "sia-cursor-preview__hotspot", width: "100%", height: "100%", role: "img", "aria-label": "\u6307\u9488\u70B9\uFF1A\u9F20\u6807\u70B9\u51FB\u7684\u5B9E\u9645\u4F4D\u7F6E", children: [
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("polyline", { points: `${hotspotX},${hotspotY} ${elbowX},${lineY} ${endX},${lineY}` }),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { cx: hotspotX, cy: hotspotY, r: 2.5 }),
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("text", { x: endX + direction * 8, y: lineY, textAnchor: direction === 1 ? "start" : "end", dominantBaseline: "central", children: "\u6307\u9488\u70B9" })
|
|
2211
|
+
] }) : null,
|
|
2212
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "sia-cursor-preview__caption", children }) : null
|
|
2213
|
+
]
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2173
2216
|
}
|
|
2174
2217
|
|
|
2175
2218
|
// src/components/UtilityLayout.tsx
|
|
@@ -2436,6 +2479,7 @@ function MenuLevel({
|
|
|
2436
2479
|
function Menu({
|
|
2437
2480
|
items,
|
|
2438
2481
|
mode = "vertical",
|
|
2482
|
+
gridColumns = 2,
|
|
2439
2483
|
theme = "light",
|
|
2440
2484
|
selectedKeys,
|
|
2441
2485
|
defaultSelectedKeys = [],
|
|
@@ -2451,6 +2495,7 @@ function Menu({
|
|
|
2451
2495
|
onDeselect,
|
|
2452
2496
|
onOpenChange,
|
|
2453
2497
|
className = "",
|
|
2498
|
+
style,
|
|
2454
2499
|
...rest
|
|
2455
2500
|
}) {
|
|
2456
2501
|
const menuId = (0, import_react10.useId)();
|
|
@@ -2483,7 +2528,8 @@ function Menu({
|
|
|
2483
2528
|
else onSelect?.({ ...info, selectedKeys: [...next] });
|
|
2484
2529
|
if (mode !== "inline") setOpen([]);
|
|
2485
2530
|
}
|
|
2486
|
-
|
|
2531
|
+
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
2532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { ref: rootRef, className: `sia-menu sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuLevel, { items, level: 0, parents: [], props: { menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }) });
|
|
2487
2533
|
}
|
|
2488
2534
|
function Steps({ items, current = 0, initial: initial3 = 0, direction = "horizontal", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
2489
2535
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
@@ -5060,8 +5106,15 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
5060
5106
|
function clearSelection() {
|
|
5061
5107
|
setCurrentValue(multiple ? [] : null);
|
|
5062
5108
|
}
|
|
5109
|
+
function handleDropdownEscape(event) {
|
|
5110
|
+
if (event.key !== "Escape" || !open || popupMode !== "dropdown") return false;
|
|
5111
|
+
event.preventDefault();
|
|
5112
|
+
event.stopPropagation();
|
|
5113
|
+
closeDropdown();
|
|
5114
|
+
return true;
|
|
5115
|
+
}
|
|
5063
5116
|
function handleInteractionKeyDown(event, fromSearch = false) {
|
|
5064
|
-
if (popupMode === "modal" && open) return;
|
|
5117
|
+
if (handleDropdownEscape(event) || popupMode === "modal" && open) return;
|
|
5065
5118
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
5066
5119
|
event.preventDefault();
|
|
5067
5120
|
if (!open) openDropdown();
|
|
@@ -5166,7 +5219,7 @@ var Select = (0, import_react24.forwardRef)(function Select2({
|
|
|
5166
5219
|
}
|
|
5167
5220
|
),
|
|
5168
5221
|
allowClear && hasValue && !disabled && !loading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "sia-select__clear", type: "button", "aria-label": "\u6E05\u7A7A\u9009\u62E9", onClick: clearValue, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null,
|
|
5169
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
5222
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(PopupPortal, { ref: popupRef, onKeyDown: handleDropdownEscape, anchorRef: rootRef, open: open && popupMode === "dropdown", style: { fontSize: dropdownFontSize }, className: `sia-select__dropdown${filteredOptions.length === 0 && !canSubmitInput ? " sia-select__dropdown--empty" : ""}`, children: [
|
|
5170
5223
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
5171
5224
|
showSearch || allowInput ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "sia-select__search", children: [
|
|
5172
5225
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "search", size: 15 }),
|