@sia.soul/sia-react-ui 0.1.165 → 0.1.167
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/chart.cjs +4553 -4513
- package/dist/chart.d.cts +1850 -1843
- package/dist/chart.d.ts +1850 -1843
- package/dist/chart.js +1 -1
- package/dist/chunk-2FZI7TP6.js +0 -0
- package/dist/{chunk-WR5YBY2A.js → chunk-5CGJVE4C.js} +57 -43
- package/dist/{chunk-2EC653G5.js → chunk-5KTQXNGL.js} +2 -2
- package/dist/{chunk-NHGCGOF2.js → chunk-A7TLMWMM.js} +4754 -4714
- package/dist/{chunk-G5EJJFUI.js → chunk-FSO46WEJ.js} +14 -6
- package/dist/{chunk-SX4LLT3H.js → chunk-KDNOLFDJ.js} +2 -2
- package/dist/{chunk-DKQ5UCN6.js → chunk-S6FA6NN3.js} +519 -220
- package/dist/{chunk-23FQ5ARA.js → chunk-XS7AVCHO.js} +27 -17
- package/dist/{core-r-smfiNN.d.cts → core-C7Was4Vc.d.cts} +11 -12
- package/dist/{core-XtqUDbbD.d.ts → core-D7C32Rdq.d.ts} +11 -12
- package/dist/core.cjs +267 -235
- package/dist/core.css +3125 -5327
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +4 -4
- package/dist/game.cjs +14 -6
- package/dist/game.css +1666 -3147
- package/dist/game.js +1 -1
- package/dist/index.cjs +6498 -6060
- package/dist/index.css +8721 -8545
- package/dist/index.d.cts +127 -111
- package/dist/index.d.ts +127 -111
- package/dist/index.js +817 -749
- package/dist/markdown-editor.css +461 -0
- package/dist/markdown-editor.js +2 -1
- package/dist/rich-text-editor.cjs +38 -20
- package/dist/rich-text-editor.css +461 -0
- package/dist/rich-text-editor.js +4 -3
- package/dist/{select-date-range-E1N5-oXv.d.ts → select-date-range-AOleKBXc.d.ts} +6 -9
- package/dist/{select-date-range-BnlISSPV.d.cts → select-date-range-BtTkMElI.d.cts} +6 -9
- package/dist/select-date-range.cjs +529 -222
- package/dist/select-date-range.d.cts +1 -1
- package/dist/select-date-range.d.ts +1 -1
- package/dist/select-date-range.js +4 -4
- package/package.json +5 -1
- /package/dist/{chunk-V4I32DPL.js → chunk-GKWSCL5Q.js} +0 -0
package/dist/chart.js
CHANGED
|
File without changes
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KDNOLFDJ.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XS7AVCHO.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
10
|
} from "./chunk-J6BPKBEL.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon,
|
|
13
13
|
useOverlayLifecycle
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FSO46WEJ.js";
|
|
15
15
|
import {
|
|
16
16
|
Button
|
|
17
17
|
} from "./chunk-PAWEP65C.js";
|
|
@@ -92,9 +92,9 @@ function Toolbar({ items, onAction, disabled = false, size = "small", variant =
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// src/components/Card.tsx
|
|
95
|
-
import { useState as useState2 } from "react";
|
|
95
|
+
import { forwardRef, useState as useState2 } from "react";
|
|
96
96
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
97
|
-
|
|
97
|
+
var Card = forwardRef(function Card2({
|
|
98
98
|
bordered = true,
|
|
99
99
|
title,
|
|
100
100
|
description,
|
|
@@ -124,7 +124,7 @@ function Card({
|
|
|
124
124
|
onClick,
|
|
125
125
|
onKeyDown,
|
|
126
126
|
...props
|
|
127
|
-
}) {
|
|
127
|
+
}, forwardedRef) {
|
|
128
128
|
const [internalCollapsed, setInternalCollapsed] = useState2(defaultCollapsed);
|
|
129
129
|
const [internalSelected, setInternalSelected] = useState2(defaultSelected);
|
|
130
130
|
const isSelected = selected ?? internalSelected;
|
|
@@ -151,6 +151,7 @@ function Card({
|
|
|
151
151
|
return /* @__PURE__ */ jsxs2(
|
|
152
152
|
"section",
|
|
153
153
|
{
|
|
154
|
+
ref: forwardedRef,
|
|
154
155
|
className: `sia-card${fill ? " sia-card--fill" : ""}${fill && bodyHeight !== void 0 ? " sia-card--body-height" : ""}${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
|
|
155
156
|
style: mergedStyle,
|
|
156
157
|
"data-sia-interaction-cursor": interactionCursor,
|
|
@@ -193,10 +194,18 @@ function Card({
|
|
|
193
194
|
]
|
|
194
195
|
}
|
|
195
196
|
);
|
|
196
|
-
}
|
|
197
|
+
});
|
|
197
198
|
|
|
198
199
|
// src/components/Tag.tsx
|
|
200
|
+
import { Children, Fragment as Fragment2, isValidElement } from "react";
|
|
199
201
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
202
|
+
function hasTagContent(content) {
|
|
203
|
+
return Children.toArray(content).some((node) => {
|
|
204
|
+
if (typeof node === "string") return node.trim().length > 0;
|
|
205
|
+
if (isValidElement(node) && node.type === Fragment2) return hasTagContent(node.props.children);
|
|
206
|
+
return true;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
200
209
|
function Tag({
|
|
201
210
|
size: sizeProp,
|
|
202
211
|
color,
|
|
@@ -214,6 +223,8 @@ function Tag({
|
|
|
214
223
|
...props
|
|
215
224
|
}) {
|
|
216
225
|
const size = useControlSize(sizeProp ?? (compact ? "small" : void 0));
|
|
226
|
+
const hasIcon = hasTagContent(icon);
|
|
227
|
+
if (!hasTagContent(children) && !hasIcon) return null;
|
|
217
228
|
const customColor = color?.trim() ? variant === "outlined" ? { borderColor: color, color, backgroundColor: "transparent" } : variant === "filled" ? { backgroundColor: color, color: "#fff", borderColor: "transparent" } : { color, backgroundColor: `color-mix(in srgb, ${color} 10%, transparent)`, borderColor: `color-mix(in srgb, ${color} 35%, transparent)` } : void 0;
|
|
218
229
|
return /* @__PURE__ */ jsxs3(
|
|
219
230
|
"span",
|
|
@@ -223,7 +234,7 @@ function Tag({
|
|
|
223
234
|
style: customColor ? { ...customColor, ...style } : style,
|
|
224
235
|
...withTitleTooltip(props),
|
|
225
236
|
children: [
|
|
226
|
-
|
|
237
|
+
hasIcon ? /* @__PURE__ */ jsx3("span", { className: "sia-tag__icon", children: icon }) : null,
|
|
227
238
|
/* @__PURE__ */ jsx3("span", { children }),
|
|
228
239
|
closable ? /* @__PURE__ */ jsx3(
|
|
229
240
|
"button",
|
|
@@ -245,10 +256,10 @@ function Tag({
|
|
|
245
256
|
}
|
|
246
257
|
|
|
247
258
|
// src/components/Tabs.tsx
|
|
248
|
-
import { useEffect, useId, useLayoutEffect as useLayoutEffect2, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
259
|
+
import { forwardRef as forwardRef2, useEffect, useId, useLayoutEffect as useLayoutEffect2, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
249
260
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
250
261
|
import { createElement } from "react";
|
|
251
|
-
|
|
262
|
+
var Tabs = forwardRef2(function Tabs2({
|
|
252
263
|
items,
|
|
253
264
|
activeKey,
|
|
254
265
|
defaultActiveKey,
|
|
@@ -272,7 +283,7 @@ function Tabs({
|
|
|
272
283
|
onTabContextMenuClick,
|
|
273
284
|
className = "",
|
|
274
285
|
...props
|
|
275
|
-
}) {
|
|
286
|
+
}, forwardedRef) {
|
|
276
287
|
const firstEnabledKey = items.find((item) => !item.disabled)?.key ?? "";
|
|
277
288
|
const [internalActiveKey, setInternalActiveKey] = useState3(defaultActiveKey ?? firstEnabledKey);
|
|
278
289
|
const currentKey = activeKey ?? internalActiveKey;
|
|
@@ -451,6 +462,7 @@ function Tabs({
|
|
|
451
462
|
return /* @__PURE__ */ jsxs4(
|
|
452
463
|
"div",
|
|
453
464
|
{
|
|
465
|
+
ref: forwardedRef,
|
|
454
466
|
className: `sia-tabs sia-tabs--${type}${type === "underline" ? " sia-tabs--line" : ""} sia-tabs--${size} sia-tabs--${resolvedOrientation} sia-tabs--${resolvedPosition}${centered ? " sia-tabs--centered" : ""} ${className}`.trim(),
|
|
455
467
|
...withTitleTooltip(props),
|
|
456
468
|
children: [
|
|
@@ -557,13 +569,13 @@ function Tabs({
|
|
|
557
569
|
]
|
|
558
570
|
}
|
|
559
571
|
);
|
|
560
|
-
}
|
|
572
|
+
});
|
|
561
573
|
|
|
562
574
|
// src/components/Feedback.tsx
|
|
563
575
|
import { cloneElement, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
564
576
|
import { createPortal } from "react-dom";
|
|
565
577
|
import { createRoot } from "react-dom/client";
|
|
566
|
-
import { Fragment as
|
|
578
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
567
579
|
function Popconfirm({
|
|
568
580
|
children,
|
|
569
581
|
title,
|
|
@@ -690,7 +702,7 @@ function Progress({
|
|
|
690
702
|
}
|
|
691
703
|
const height = Array.isArray(size) ? size[1] : typeof size === "number" ? size : size === "small" ? 6 : strokeWidth;
|
|
692
704
|
return /* @__PURE__ */ jsxs5("div", { className: `sia-progress sia-progress--line sia-progress--${resolved} ${className}`.trim(), style, ...withTitleTooltip(props), children: [
|
|
693
|
-
/* @__PURE__ */ jsx5("div", { className: "sia-progress__outer", style: { height, backgroundColor: trailColor }, children: steps ? /* @__PURE__ */ jsx5("div", { className: "sia-progress__steps", children: Array.from({ length: steps }, (_, index) => /* @__PURE__ */ jsx5("span", { className: index < Math.round(steps * safe / 100) ? "is-active" : "", style: { background: index < Math.round(steps * safe / 100) ? background : trailColor } }, index)) }) : /* @__PURE__ */ jsxs5(
|
|
705
|
+
/* @__PURE__ */ jsx5("div", { className: "sia-progress__outer", style: { height, backgroundColor: trailColor }, children: steps ? /* @__PURE__ */ jsx5("div", { className: "sia-progress__steps", children: Array.from({ length: steps }, (_, index) => /* @__PURE__ */ jsx5("span", { className: index < Math.round(steps * safe / 100) ? "is-active" : "", style: { background: index < Math.round(steps * safe / 100) ? background : trailColor } }, index)) }) : /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
694
706
|
/* @__PURE__ */ jsx5("span", { className: "sia-progress__bar", style: { width: `${safe}%`, background } }),
|
|
695
707
|
success?.percent ? /* @__PURE__ */ jsx5("span", { className: "sia-progress__success", style: { width: `${success.percent}%`, background: success.strokeColor } }) : null
|
|
696
708
|
] }) }),
|
|
@@ -790,7 +802,7 @@ function NotificationHost() {
|
|
|
790
802
|
};
|
|
791
803
|
}, []);
|
|
792
804
|
const placements = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
|
|
793
|
-
return /* @__PURE__ */ jsx5(
|
|
805
|
+
return /* @__PURE__ */ jsx5(Fragment3, { children: placements.map((placement) => /* @__PURE__ */ jsx5("div", { className: `sia-notification sia-notification--${placement}`, children: entries.filter((item) => (item.placement ?? "topRight") === placement).map((item) => /* @__PURE__ */ jsx5(NotificationNotice, { item }, item.key)) }, placement)) });
|
|
794
806
|
}
|
|
795
807
|
function ensureNotificationHost() {
|
|
796
808
|
if (typeof document === "undefined" || notificationHost) return;
|
|
@@ -878,9 +890,9 @@ function Tour({ open = false, steps, current, defaultCurrent = 0, mask = true, c
|
|
|
878
890
|
}
|
|
879
891
|
|
|
880
892
|
// src/components/DataDisplay.tsx
|
|
881
|
-
import { Children, createContext, useContext, useEffect as useEffect3, useId as useId2, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
|
|
893
|
+
import { Children as Children2, createContext, useContext, useEffect as useEffect3, useId as useId2, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
|
|
882
894
|
import { createPortal as createPortal2 } from "react-dom";
|
|
883
|
-
import { Fragment as
|
|
895
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
884
896
|
function Rate({ value, size: sizeProp, defaultValue = 0, count = 5, allowHalf = false, allowClear = true, disabled = false, character, tooltips, onChange, onHoverChange, className = "", ...props }) {
|
|
885
897
|
const size = useControlSize(sizeProp);
|
|
886
898
|
const [current, setCurrent] = useControllableState({ value, defaultValue, onChange });
|
|
@@ -981,7 +993,7 @@ function Calendar({ value, defaultValue, mode = "month", fullscreen = true, vali
|
|
|
981
993
|
}
|
|
982
994
|
const headerConfig = { value: formatDate(panel), mode: panelMode, onChange: (next) => setPanelValue(parseDate(next)), onTypeChange: setMode };
|
|
983
995
|
return /* @__PURE__ */ jsxs6("div", { className: `sia-calendar${fullscreen ? " sia-calendar--fullscreen" : " sia-calendar--mini"} ${className}`.trim(), ...withTitleTooltip(props), children: [
|
|
984
|
-
/* @__PURE__ */ jsx6("div", { className: "sia-calendar__header", children: headerRender ? headerRender(headerConfig) : /* @__PURE__ */ jsxs6(
|
|
996
|
+
/* @__PURE__ */ jsx6("div", { className: "sia-calendar__header", children: headerRender ? headerRender(headerConfig) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
985
997
|
/* @__PURE__ */ jsx6("button", { type: "button", "aria-label": "\u4E0A\u4E00\u9875", onClick: () => setPanelValue(new Date(panel.getFullYear() - (panelMode === "year" ? 1 : 0), panel.getMonth() - (panelMode === "month" ? 1 : 0), 1)), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-left" }) }),
|
|
986
998
|
/* @__PURE__ */ jsxs6("strong", { children: [
|
|
987
999
|
panel.getFullYear(),
|
|
@@ -997,13 +1009,13 @@ function Calendar({ value, defaultValue, mode = "month", fullscreen = true, vali
|
|
|
997
1009
|
panelMode === "year" ? /* @__PURE__ */ jsx6("div", { className: "sia-calendar__months", children: MONTHS.map((month, index) => /* @__PURE__ */ jsx6("button", { className: panel.getMonth() === index ? "is-selected" : "", onClick: () => {
|
|
998
1010
|
setPanelValue(new Date(panel.getFullYear(), index, 1));
|
|
999
1011
|
setMode("month");
|
|
1000
|
-
}, children: month }, month)) }) : /* @__PURE__ */ jsxs6(
|
|
1012
|
+
}, children: month }, month)) }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1001
1013
|
/* @__PURE__ */ jsx6("div", { className: "sia-calendar__week", children: WEEK.map((day) => /* @__PURE__ */ jsx6("span", { children: day }, day)) }),
|
|
1002
1014
|
/* @__PURE__ */ jsx6("div", { className: "sia-calendar__grid", children: grid.map((date) => {
|
|
1003
1015
|
const key = formatDate(date);
|
|
1004
1016
|
const outside = date.getMonth() !== panel.getMonth();
|
|
1005
1017
|
const disabled = Boolean(disabledDate?.(key) || validRange && (key < validRange[0] || key > validRange[1]));
|
|
1006
|
-
const origin = /* @__PURE__ */ jsxs6(
|
|
1018
|
+
const origin = /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1007
1019
|
/* @__PURE__ */ jsx6("span", { children: date.getDate() }),
|
|
1008
1020
|
dateCellRender?.(key)
|
|
1009
1021
|
] });
|
|
@@ -1017,7 +1029,7 @@ function Calendar({ value, defaultValue, mode = "month", fullscreen = true, vali
|
|
|
1017
1029
|
] });
|
|
1018
1030
|
}
|
|
1019
1031
|
function Carousel({ autoplay = false, autoplaySpeed = 3e3, arrows = false, dots = true, effect = "scroll", infinite = true, initialSlide = 0, pauseOnHover = true, beforeChange, afterChange, className = "", children, ...props }) {
|
|
1020
|
-
const slides =
|
|
1032
|
+
const slides = Children2.toArray(children);
|
|
1021
1033
|
const [current, setCurrent] = useState5(Math.min(initialSlide, Math.max(0, slides.length - 1)));
|
|
1022
1034
|
const [paused, setPaused] = useState5(false);
|
|
1023
1035
|
function go(next) {
|
|
@@ -1035,7 +1047,7 @@ function Carousel({ autoplay = false, autoplaySpeed = 3e3, arrows = false, dots
|
|
|
1035
1047
|
}, [autoplay, autoplaySpeed, current, paused, slides.length]);
|
|
1036
1048
|
return /* @__PURE__ */ jsxs6("div", { className: `sia-carousel sia-carousel--${effect} ${className}`.trim(), onMouseEnter: pauseOnHover ? () => setPaused(true) : void 0, onMouseLeave: pauseOnHover ? () => setPaused(false) : void 0, ...withTitleTooltip(props), children: [
|
|
1037
1049
|
/* @__PURE__ */ jsx6("div", { className: "sia-carousel__viewport", children: /* @__PURE__ */ jsx6("div", { className: "sia-carousel__track", style: effect === "scroll" ? { transform: `translateX(-${current * 100}%)` } : void 0, children: slides.map((slide, index) => /* @__PURE__ */ jsx6("div", { className: `sia-carousel__slide${index === current ? " is-active" : ""}`, "aria-hidden": index !== current, children: slide }, index)) }) }),
|
|
1038
|
-
arrows ? /* @__PURE__ */ jsxs6(
|
|
1050
|
+
arrows ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1039
1051
|
/* @__PURE__ */ jsx6("button", { className: "sia-carousel__arrow sia-carousel__arrow--prev", disabled: !infinite && current === 0, "aria-label": "\u4E0A\u4E00\u5F20", onClick: () => go(current - 1), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-left" }) }),
|
|
1040
1052
|
/* @__PURE__ */ jsx6("button", { className: "sia-carousel__arrow sia-carousel__arrow--next", disabled: !infinite && current === slides.length - 1, "aria-label": "\u4E0B\u4E00\u5F20", onClick: () => go(current + 1), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-right" }) })
|
|
1041
1053
|
] }) : null,
|
|
@@ -1223,7 +1235,7 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
|
|
|
1223
1235
|
displaySrc
|
|
1224
1236
|
) }),
|
|
1225
1237
|
/* @__PURE__ */ jsxs6("div", { className: "sia-image-preview__toolbar", role: "toolbar", "aria-label": "\u56FE\u7247\u64CD\u4F5C", onClick: (event) => event.stopPropagation(), children: [
|
|
1226
|
-
count > 1 && onCurrentChange ? /* @__PURE__ */ jsxs6(
|
|
1238
|
+
count > 1 && onCurrentChange ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1227
1239
|
/* @__PURE__ */ jsx6(Button, { variant: "text", "aria-label": "\u4E0A\u4E00\u5F20", disabled: current === 0, onClick: () => onCurrentChange(current - 1), children: /* @__PURE__ */ jsx6(Icon, { name: "chevron-left" }) }),
|
|
1228
1240
|
/* @__PURE__ */ jsxs6("output", { "aria-label": "\u56FE\u7247\u5E8F\u53F7", children: [
|
|
1229
1241
|
current + 1,
|
|
@@ -1325,7 +1337,7 @@ function Image({ fallback, placeholder, preview = true, rootClassName = "", clas
|
|
|
1325
1337
|
if (!failed && fallback) setFailed(true);
|
|
1326
1338
|
onError?.(event);
|
|
1327
1339
|
} }),
|
|
1328
|
-
preview ? /* @__PURE__ */ jsx6("button", { type: "button", className: "sia-image__mask", "aria-label": "\u9884\u89C8\u56FE\u7247", onClick: () => setOpen(true), children: config.mask ?? /* @__PURE__ */ jsxs6(
|
|
1340
|
+
preview ? /* @__PURE__ */ jsx6("button", { type: "button", className: "sia-image__mask", "aria-label": "\u9884\u89C8\u56FE\u7247", onClick: () => setOpen(true), children: config.mask ?? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
1329
1341
|
/* @__PURE__ */ jsx6(Icon, { name: "eye" }),
|
|
1330
1342
|
"\u9884\u89C8"
|
|
1331
1343
|
] }) }) : null,
|
|
@@ -1457,7 +1469,7 @@ var message = {
|
|
|
1457
1469
|
};
|
|
1458
1470
|
|
|
1459
1471
|
// src/components/Upload.tsx
|
|
1460
|
-
import { forwardRef, useEffect as useEffect5, useImperativeHandle, useRef as useRef6, useState as useState6 } from "react";
|
|
1472
|
+
import { forwardRef as forwardRef3, useEffect as useEffect5, useImperativeHandle, useRef as useRef6, useState as useState6 } from "react";
|
|
1461
1473
|
|
|
1462
1474
|
// src/components/uploadFiles.ts
|
|
1463
1475
|
function acceptsUploadFile(file, accept) {
|
|
@@ -1588,7 +1600,7 @@ function isUploadImage(file, accept) {
|
|
|
1588
1600
|
}
|
|
1589
1601
|
|
|
1590
1602
|
// src/components/Upload.tsx
|
|
1591
|
-
import { Fragment as
|
|
1603
|
+
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1592
1604
|
var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
|
|
1593
1605
|
function useThumbnail(file, accept) {
|
|
1594
1606
|
const [local, setLocal] = useState6();
|
|
@@ -1642,9 +1654,9 @@ function UploadItem({ file, files, props, actions }) {
|
|
|
1642
1654
|
file.status === "error" && /* @__PURE__ */ jsx8("span", { className: "sia-upload__error", children: "\u4E0A\u4F20\u5931\u8D25" }),
|
|
1643
1655
|
props.listType === "text" && (file.status === void 0 || file.status === "ready" || file.status === "done") && /* @__PURE__ */ jsx8("span", { className: "sia-upload__status", children: file.status === "done" ? "\u4E0A\u4F20\u5B8C\u6210" : "\u5DF2\u9009\u62E9" })
|
|
1644
1656
|
] });
|
|
1645
|
-
return /* @__PURE__ */ jsx8(
|
|
1657
|
+
return /* @__PURE__ */ jsx8(Fragment5, { children: props.itemRender ? props.itemRender(node, file, files, actions) : node });
|
|
1646
1658
|
}
|
|
1647
|
-
var UploadRoot =
|
|
1659
|
+
var UploadRoot = forwardRef3(function UploadRoot2({
|
|
1648
1660
|
accept,
|
|
1649
1661
|
acceptMode = "validate",
|
|
1650
1662
|
multiple = false,
|
|
@@ -1875,10 +1887,10 @@ var UploadRoot = forwardRef(function UploadRoot2({
|
|
|
1875
1887
|
}
|
|
1876
1888
|
const trigger = !full && /* @__PURE__ */ jsx8("div", { className: "sia-upload__trigger", children: /* @__PURE__ */ jsx8(Button, { className: "sia-upload__choose", "aria-label": compactCard ? directory ? "\u9009\u62E9\u6587\u4EF6\u5939" : "\u9009\u62E9\u6587\u4EF6" : void 0, disabled: disabled || full, onClick: () => {
|
|
1877
1889
|
if (!disabled && !full && onChoose?.() !== false) inputRef.current?.click();
|
|
1878
|
-
}, children: children ?? (listType === "picture-card" ? /* @__PURE__ */ jsxs8(
|
|
1890
|
+
}, children: children ?? (listType === "picture-card" ? /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
1879
1891
|
/* @__PURE__ */ jsx8(Icon, { name: "plus", size: 24 }),
|
|
1880
1892
|
/* @__PURE__ */ jsx8("span", { children: "\u4E0A\u4F20\u56FE\u7247" })
|
|
1881
|
-
] }) : /* @__PURE__ */ jsxs8(
|
|
1893
|
+
] }) : /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
1882
1894
|
/* @__PURE__ */ jsx8(Icon, { name: "upload", size: 16 }),
|
|
1883
1895
|
directory ? "\u9009\u62E9\u6587\u4EF6\u5939" : "\u9009\u62E9\u6587\u4EF6"
|
|
1884
1896
|
] })) }) });
|
|
@@ -1949,7 +1961,7 @@ var UploadRoot = forwardRef(function UploadRoot2({
|
|
|
1949
1961
|
}
|
|
1950
1962
|
);
|
|
1951
1963
|
});
|
|
1952
|
-
var UploadDragger =
|
|
1964
|
+
var UploadDragger = forwardRef3(function UploadDragger2({ hint = "\u652F\u6301\u5355\u4E2A\u6216\u6279\u91CF\u4E0A\u4F20", children, className = "", ...props }, ref) {
|
|
1953
1965
|
return /* @__PURE__ */ jsx8(UploadRoot, { ...props, ref, className: `sia-upload-dragger ${className}`.trim(), children: children ?? /* @__PURE__ */ jsxs8("span", { className: "sia-upload-dragger__content", children: [
|
|
1954
1966
|
/* @__PURE__ */ jsx8(Icon, { name: "upload", size: 32 }),
|
|
1955
1967
|
/* @__PURE__ */ jsxs8("strong", { children: [
|
|
@@ -1969,11 +1981,12 @@ var Upload = Object.assign(UploadRoot, {
|
|
|
1969
1981
|
});
|
|
1970
1982
|
|
|
1971
1983
|
// src/components/Breadcrumb.tsx
|
|
1972
|
-
import {
|
|
1973
|
-
|
|
1974
|
-
|
|
1984
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
1985
|
+
import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1986
|
+
var Breadcrumb = forwardRef4(function Breadcrumb2({ items, separator = "/", itemRender, className = "", ...props }, forwardedRef) {
|
|
1987
|
+
return /* @__PURE__ */ jsx9("nav", { ref: forwardedRef, "aria-label": "\u9762\u5305\u5C51\u5BFC\u822A", ...withTitleTooltip(props), className: `sia-breadcrumb ${className}`.trim(), children: /* @__PURE__ */ jsx9("ol", { className: "sia-breadcrumb__list", children: items.map((item, index) => {
|
|
1975
1988
|
const current = index === items.length - 1;
|
|
1976
|
-
const content = /* @__PURE__ */ jsxs9(
|
|
1989
|
+
const content = /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
1977
1990
|
item.icon ? /* @__PURE__ */ jsx9("span", { className: "sia-breadcrumb__icon", "aria-hidden": "true", children: item.icon }) : null,
|
|
1978
1991
|
/* @__PURE__ */ jsx9("span", { className: "sia-breadcrumb__title", children: item.title })
|
|
1979
1992
|
] });
|
|
@@ -1987,11 +2000,11 @@ function Breadcrumb({ items, separator = "/", itemRender, className = "", ...pro
|
|
|
1987
2000
|
!current ? /* @__PURE__ */ jsx9("span", { className: "sia-breadcrumb__separator", "aria-hidden": "true", children: item.separator === void 0 ? separator : item.separator }) : null
|
|
1988
2001
|
] }, item.key ?? index);
|
|
1989
2002
|
}) }) });
|
|
1990
|
-
}
|
|
2003
|
+
});
|
|
1991
2004
|
|
|
1992
2005
|
// src/components/Typography.tsx
|
|
1993
2006
|
import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect3, useRef as useRef7, useState as useState7 } from "react";
|
|
1994
|
-
import { Fragment as
|
|
2007
|
+
import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1995
2008
|
function TypographyContent({
|
|
1996
2009
|
as: Tag2 = "span",
|
|
1997
2010
|
type,
|
|
@@ -2094,7 +2107,7 @@ function TypographyContent({
|
|
|
2094
2107
|
/* @__PURE__ */ jsx10(Button, { size: "small", onClick: () => finish(false), children: "\u53D6\u6D88" }),
|
|
2095
2108
|
/* @__PURE__ */ jsx10(Button, { size: "small", variant: "primary", onClick: () => finish(true), children: "\u4FDD\u5B58" })
|
|
2096
2109
|
] })
|
|
2097
|
-
] }) : /* @__PURE__ */ jsxs10(
|
|
2110
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
2098
2111
|
/* @__PURE__ */ jsx10("span", { ref: contentRef, className: ellipsis && !expanded ? "sia-typography__ellipsis" : void 0, style: ellipsis && !expanded ? { "--sia-typography-rows": rows } : void 0, children: formatted }),
|
|
2099
2112
|
expandable && (overflow || expanded) ? /* @__PURE__ */ jsx10(Button, { variant: "link", size: "small", className: "sia-typography__action", "aria-expanded": expanded, disabled, onClick: () => setExpanded(!expanded), children: expanded ? "\u6536\u8D77" : "\u5C55\u5F00" }) : null,
|
|
2100
2113
|
editable ? /* @__PURE__ */ jsx10(Button, { ref: editRef, variant: "text", size: "small", className: "sia-typography__action", "aria-label": "\u7F16\u8F91\u6587\u672C", title: "\u7F16\u8F91", disabled, icon: /* @__PURE__ */ jsx10(Icon, { name: "edit", size: 14 }), onClick: () => {
|
|
@@ -2147,10 +2160,10 @@ var Typography = Object.assign(TypographyRoot, {
|
|
|
2147
2160
|
});
|
|
2148
2161
|
|
|
2149
2162
|
// src/components/FloatButton.tsx
|
|
2150
|
-
import { createContext as createContext2, forwardRef as
|
|
2163
|
+
import { createContext as createContext2, forwardRef as forwardRef5, useContext as useContext2, useEffect as useEffect7, useId as useId3, useRef as useRef8, useState as useState8 } from "react";
|
|
2151
2164
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2152
2165
|
var GroupShape = createContext2(void 0);
|
|
2153
|
-
var FloatButtonRoot =
|
|
2166
|
+
var FloatButtonRoot = forwardRef5(function FloatButton({
|
|
2154
2167
|
icon,
|
|
2155
2168
|
description,
|
|
2156
2169
|
tooltip,
|
|
@@ -2287,6 +2300,7 @@ var FloatButton2 = Object.assign(FloatButtonRoot, {
|
|
|
2287
2300
|
});
|
|
2288
2301
|
|
|
2289
2302
|
// src/components/Result.tsx
|
|
2303
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
2290
2304
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2291
2305
|
var icons = {
|
|
2292
2306
|
success: "circle-check",
|
|
@@ -2294,17 +2308,17 @@ var icons = {
|
|
|
2294
2308
|
info: "info",
|
|
2295
2309
|
warning: "warning"
|
|
2296
2310
|
};
|
|
2297
|
-
|
|
2311
|
+
var Result = forwardRef6(function Result2({ status = "info", title, subTitle, icon, extra, children, className = "", ...props }, forwardedRef) {
|
|
2298
2312
|
const resultIcon = icon === void 0 ? /* @__PURE__ */ jsx12(Icon, { name: icons[status], size: 72, variant: "filled" }) : icon;
|
|
2299
2313
|
const present = (value) => value !== void 0 && value !== null && value !== false;
|
|
2300
|
-
return /* @__PURE__ */ jsxs12("div", { ...props, className: `sia-result sia-result--${status} ${className}`.trim(), children: [
|
|
2314
|
+
return /* @__PURE__ */ jsxs12("div", { ref: forwardedRef, ...props, className: `sia-result sia-result--${status} ${className}`.trim(), children: [
|
|
2301
2315
|
present(resultIcon) && /* @__PURE__ */ jsx12("div", { className: "sia-result__icon", "aria-hidden": "true", children: resultIcon }),
|
|
2302
2316
|
present(title) && /* @__PURE__ */ jsx12("div", { className: "sia-result__title", children: title }),
|
|
2303
2317
|
present(subTitle) && /* @__PURE__ */ jsx12("div", { className: "sia-result__subtitle", children: subTitle }),
|
|
2304
2318
|
present(children) && /* @__PURE__ */ jsx12("div", { className: "sia-result__content", children }),
|
|
2305
2319
|
present(extra) && /* @__PURE__ */ jsx12("div", { className: "sia-result__extra", children: extra })
|
|
2306
2320
|
] });
|
|
2307
|
-
}
|
|
2321
|
+
});
|
|
2308
2322
|
|
|
2309
2323
|
export {
|
|
2310
2324
|
Toolbar,
|