@sia.soul/sia-react-ui 0.1.145 → 0.1.147
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/{Button-C8W8ZHWV.d.ts → Button-B59TIes7.d.ts} +1 -1
- package/dist/{Button-CxKBjLda.d.cts → Button-xLR4Yt57.d.cts} +1 -1
- package/dist/{Select-bKLket9n.d.cts → Select-DKfT3fJR.d.cts} +1 -1
- package/dist/{Select-CTSd8zum.d.ts → Select-Wolx4zNc.d.ts} +1 -1
- package/dist/chart.cjs +2 -23
- package/dist/chart.js +5 -5
- package/dist/{chunk-ORSQAJ22.js → chunk-4PYHSNRA.js} +5 -5
- package/dist/{chunk-F52O2MOV.js → chunk-6SSZVJO4.js} +3 -3
- package/dist/{chunk-WCYVBO2N.js → chunk-EZTF5TA2.js} +4 -4
- package/dist/{chunk-LKLPCYEP.js → chunk-NRLIOMXY.js} +2 -2
- package/dist/{chunk-7SEGBB6V.js → chunk-PU2V3VB5.js} +1 -24
- package/dist/{chunk-566S64IP.js → chunk-QLS2IXU4.js} +4 -4
- package/dist/{chunk-4OHS7RXE.js → chunk-SRWUDTCS.js} +2 -0
- package/dist/{chunk-MD4CGSOR.js → chunk-TH7BNDV4.js} +6 -6
- package/dist/{chunk-4TYHSAR3.js → chunk-W4HDN7MD.js} +5 -5
- package/dist/{chunk-PD3K5U5Y.js → chunk-XXFYFLZA.js} +2 -2
- package/dist/{chunk-JRXYM5YH.js → chunk-YHVFLSZW.js} +2 -2
- package/dist/{chunk-ETQJ2DQ2.js → chunk-YO5OJQEH.js} +1 -1
- package/dist/{core-CvfsQGuT.d.ts → core-BJa8K9R8.d.ts} +5 -5
- package/dist/{core-COaZfusa.d.cts → core-DC4cb_KT.d.cts} +5 -5
- package/dist/core.cjs +2 -23
- package/dist/core.css +74 -1
- package/dist/core.d.cts +3 -3
- package/dist/core.d.ts +3 -3
- package/dist/core.js +8 -8
- package/dist/game.cjs +2 -23
- package/dist/game.css +74 -1
- package/dist/game.d.cts +1 -1
- package/dist/game.d.ts +1 -1
- package/dist/game.js +3 -3
- package/dist/index.cjs +1403 -1316
- package/dist/index.css +84 -1
- package/dist/index.d.cts +55 -9
- package/dist/index.d.ts +55 -9
- package/dist/index.js +167 -61
- package/dist/markdown-editor.cjs +2 -0
- package/dist/markdown-editor.js +3 -3
- package/dist/rich-text-editor.cjs +2 -23
- package/dist/rich-text-editor.js +7 -7
- package/dist/{select-date-range-Dad0IdD4.d.cts → select-date-range-C5bNGxaY.d.cts} +1 -1
- package/dist/{select-date-range-C8cacfmb.d.ts → select-date-range-DfhpX7vv.d.ts} +1 -1
- package/dist/select-date-range.cjs +2 -23
- package/dist/select-date-range.d.cts +3 -3
- package/dist/select-date-range.d.ts +3 -3
- package/dist/select-date-range.js +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
smoothSvgPath,
|
|
57
57
|
svgArcPath,
|
|
58
58
|
transferCompositeValue
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-6SSZVJO4.js";
|
|
60
60
|
import {
|
|
61
61
|
Badge,
|
|
62
62
|
Breadcrumb,
|
|
@@ -82,20 +82,20 @@ import {
|
|
|
82
82
|
Watermark,
|
|
83
83
|
message,
|
|
84
84
|
notification
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-TH7BNDV4.js";
|
|
86
86
|
import "./chunk-RX242MUO.js";
|
|
87
87
|
import {
|
|
88
88
|
MarkdownEditor
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-XXFYFLZA.js";
|
|
90
90
|
import {
|
|
91
91
|
RichTextContent,
|
|
92
92
|
RichTextEditor
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-W4HDN7MD.js";
|
|
94
94
|
import {
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-QLS2IXU4.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
OverflowTags,
|
|
@@ -107,17 +107,17 @@ import {
|
|
|
107
107
|
Tree,
|
|
108
108
|
normalizeSelectionValues,
|
|
109
109
|
usePressFeedback
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-4PYHSNRA.js";
|
|
111
111
|
import {
|
|
112
112
|
Dropdown,
|
|
113
113
|
Input,
|
|
114
114
|
Menu,
|
|
115
115
|
Segmented,
|
|
116
116
|
Steps
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-EZTF5TA2.js";
|
|
118
118
|
import {
|
|
119
119
|
TextArea
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-NRLIOMXY.js";
|
|
121
121
|
import {
|
|
122
122
|
FILLED_ICON_NAMES,
|
|
123
123
|
ICON_NAMES,
|
|
@@ -128,13 +128,13 @@ import {
|
|
|
128
128
|
Skeleton,
|
|
129
129
|
useOverlayExitPlaceholder,
|
|
130
130
|
useOverlayLifecycle
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-YHVFLSZW.js";
|
|
132
132
|
import {
|
|
133
133
|
Button
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-PU2V3VB5.js";
|
|
135
135
|
import {
|
|
136
136
|
useFloatingPlaceholder
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-YO5OJQEH.js";
|
|
138
138
|
import {
|
|
139
139
|
ControlSizeContext,
|
|
140
140
|
FloatingScrollbarProvider,
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
usePlaceholderMode,
|
|
148
148
|
useScrollbarProximity,
|
|
149
149
|
withTitleTooltip
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-SRWUDTCS.js";
|
|
151
151
|
|
|
152
152
|
// src/components/CursorPreview.tsx
|
|
153
153
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -10319,10 +10319,17 @@ function createWorksheetPlugin(options) {
|
|
|
10319
10319
|
};
|
|
10320
10320
|
}
|
|
10321
10321
|
|
|
10322
|
+
// src/components/Video.tsx
|
|
10323
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
10324
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
10325
|
+
var Video = forwardRef7(function Video2({ controls = true, muted = false, playsInline = true, className = "", ...props }, ref) {
|
|
10326
|
+
return /* @__PURE__ */ jsx29("video", { ...props, ref, controls, muted, playsInline, className: `sia-video ${className}`.trim() });
|
|
10327
|
+
});
|
|
10328
|
+
|
|
10322
10329
|
// src/components/InputSelect.tsx
|
|
10323
|
-
import { forwardRef as
|
|
10324
|
-
import { jsx as
|
|
10325
|
-
var InputSelect =
|
|
10330
|
+
import { forwardRef as forwardRef8, useEffect as useEffect16, useRef as useRef23, useState as useState24 } from "react";
|
|
10331
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10332
|
+
var InputSelect = forwardRef8(function InputSelect2({
|
|
10326
10333
|
options,
|
|
10327
10334
|
value,
|
|
10328
10335
|
defaultValue,
|
|
@@ -10411,7 +10418,7 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
10411
10418
|
inputRef.current?.focus();
|
|
10412
10419
|
}
|
|
10413
10420
|
}, children: [
|
|
10414
|
-
/* @__PURE__ */
|
|
10421
|
+
/* @__PURE__ */ jsx30(
|
|
10415
10422
|
Input,
|
|
10416
10423
|
{
|
|
10417
10424
|
...inputProps,
|
|
@@ -10449,25 +10456,25 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
10449
10456
|
changeOpen(true);
|
|
10450
10457
|
},
|
|
10451
10458
|
suffix: /* @__PURE__ */ jsxs26("span", { className: "sia-input-select__suffix", children: [
|
|
10452
|
-
allowClear && draft && !disabled && /* @__PURE__ */
|
|
10459
|
+
allowClear && draft && !disabled && /* @__PURE__ */ jsx30(Button, { className: "sia-input-select__clear", variant: "text", size: "small", disabled: loading, "aria-label": "\u6E05\u9664\u8F93\u5165\u9009\u62E9", onClick: (event) => {
|
|
10453
10460
|
event.stopPropagation();
|
|
10454
10461
|
setDraft("");
|
|
10455
10462
|
emit(multiple ? [] : void 0);
|
|
10456
10463
|
inputRef.current?.focus();
|
|
10457
10464
|
}, children: "\xD7" }),
|
|
10458
10465
|
suffix,
|
|
10459
|
-
enableModal && /* @__PURE__ */
|
|
10466
|
+
enableModal && /* @__PURE__ */ jsx30(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u6253\u5F00\u9009\u62E9\u5F39\u7A97", onClick: (event) => {
|
|
10460
10467
|
event.stopPropagation();
|
|
10461
10468
|
openModal();
|
|
10462
10469
|
}, children: "\u2026" }),
|
|
10463
|
-
/* @__PURE__ */
|
|
10470
|
+
/* @__PURE__ */ jsx30(Button, { variant: "text", size: "small", disabled: disabled || loading, "aria-label": "\u5C55\u5F00\u9009\u9879", onClick: (event) => {
|
|
10464
10471
|
event.stopPropagation();
|
|
10465
10472
|
changeOpen(!open);
|
|
10466
|
-
}, children: /* @__PURE__ */
|
|
10473
|
+
}, children: /* @__PURE__ */ jsx30(Icon, { name: loading ? "refresh" : open ? "chevron-up" : "chevron-down", size: 13 }) })
|
|
10467
10474
|
] })
|
|
10468
10475
|
}
|
|
10469
10476
|
),
|
|
10470
|
-
/* @__PURE__ */
|
|
10477
|
+
/* @__PURE__ */ jsx30(PopupPortal, { ref: popupRef, anchorRef: rootRef, open: open && !disabled && !loading, className: "sia-input-select__popup", children: /* @__PURE__ */ jsx30(
|
|
10471
10478
|
SelectionPanel,
|
|
10472
10479
|
{
|
|
10473
10480
|
options,
|
|
@@ -10496,14 +10503,14 @@ var InputSelect = forwardRef7(function InputSelect2({
|
|
|
10496
10503
|
},
|
|
10497
10504
|
children: [
|
|
10498
10505
|
/* @__PURE__ */ jsxs26("div", { className: "sia-selection-panel__actions", role: "tablist", "aria-label": "\u9009\u9879\u8303\u56F4", children: [
|
|
10499
|
-
/* @__PURE__ */
|
|
10506
|
+
/* @__PURE__ */ jsx30(Button, { role: "tab", "aria-selected": !selectedOnly, variant: !selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(false), children: "\u5168\u90E8" }),
|
|
10500
10507
|
/* @__PURE__ */ jsxs26(Button, { role: "tab", "aria-selected": selectedOnly, variant: selectedOnly ? "primary" : "text", onClick: () => setSelectedOnly(true), children: [
|
|
10501
10508
|
"\u5DF2\u9009\u9879(",
|
|
10502
10509
|
modalValues.length,
|
|
10503
10510
|
")"
|
|
10504
10511
|
] })
|
|
10505
10512
|
] }),
|
|
10506
|
-
modalOpen && /* @__PURE__ */
|
|
10513
|
+
modalOpen && /* @__PURE__ */ jsx30(
|
|
10507
10514
|
SelectionPanel,
|
|
10508
10515
|
{
|
|
10509
10516
|
options,
|
|
@@ -10802,7 +10809,7 @@ function countQueryFieldRows(centers) {
|
|
|
10802
10809
|
}
|
|
10803
10810
|
|
|
10804
10811
|
// src/components/QueryFormSettings.tsx
|
|
10805
|
-
import { Fragment as Fragment11, jsx as
|
|
10812
|
+
import { Fragment as Fragment11, jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10806
10813
|
function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed, disabled) {
|
|
10807
10814
|
const [snapshot, setSnapshot] = useState26();
|
|
10808
10815
|
const [draft, setDraft] = useState26({ fields: [], defaultCollapsed: defaultCollapsed ?? false });
|
|
@@ -10897,7 +10904,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10897
10904
|
const items = new Map(visibleDraft.map((item) => [item.key, item]));
|
|
10898
10905
|
setDraft((current) => ({ ...current, fields: keys.map((key, order) => ({ ...items.get(key), order })) }));
|
|
10899
10906
|
});
|
|
10900
|
-
const control = config ? /* @__PURE__ */
|
|
10907
|
+
const control = config ? /* @__PURE__ */ jsx31(
|
|
10901
10908
|
Button,
|
|
10902
10909
|
{
|
|
10903
10910
|
type: "button",
|
|
@@ -10906,7 +10913,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10906
10913
|
"aria-label": "\u67E5\u8BE2\u8BBE\u7F6E",
|
|
10907
10914
|
disabled: disabled || saving,
|
|
10908
10915
|
loading: loading && !open,
|
|
10909
|
-
icon: /* @__PURE__ */
|
|
10916
|
+
icon: /* @__PURE__ */ jsx31(Icon, { name: "more-vertical" }),
|
|
10910
10917
|
onClick: () => {
|
|
10911
10918
|
setOpen(true);
|
|
10912
10919
|
void load(true);
|
|
@@ -10914,8 +10921,8 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10914
10921
|
}
|
|
10915
10922
|
) : null;
|
|
10916
10923
|
const panel = config ? /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
10917
|
-
!open && error ? /* @__PURE__ */
|
|
10918
|
-
/* @__PURE__ */
|
|
10924
|
+
!open && error ? /* @__PURE__ */ jsx31("span", { className: "sia-query-form__error", role: "alert", children: "\u67E5\u8BE2\u8BBE\u7F6E\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u6253\u5F00\u8BBE\u7F6E\u91CD\u8BD5" }) : null,
|
|
10925
|
+
/* @__PURE__ */ jsx31(
|
|
10919
10926
|
Modal,
|
|
10920
10927
|
{
|
|
10921
10928
|
title: "\u67E5\u8BE2\u8BBE\u7F6E",
|
|
@@ -10929,14 +10936,14 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10929
10936
|
if (!saveLock.current) setOpen(next);
|
|
10930
10937
|
},
|
|
10931
10938
|
children: /* @__PURE__ */ jsxs27("div", { className: "sia-query-settings", children: [
|
|
10932
|
-
loading ? /* @__PURE__ */
|
|
10939
|
+
loading ? /* @__PURE__ */ jsx31("p", { role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u67E5\u8BE2\u8BBE\u7F6E\u2026" }) : null,
|
|
10933
10940
|
error ? /* @__PURE__ */ jsxs27("div", { role: "alert", className: "sia-query-form__error", children: [
|
|
10934
10941
|
error,
|
|
10935
|
-
loadFailed ? /* @__PURE__ */
|
|
10942
|
+
loadFailed ? /* @__PURE__ */ jsx31(Button, { type: "button", variant: "link", onClick: () => void load(true), children: "\u91CD\u8BD5" }) : null
|
|
10936
10943
|
] }) : null,
|
|
10937
|
-
/* @__PURE__ */
|
|
10938
|
-
/* @__PURE__ */
|
|
10939
|
-
/* @__PURE__ */
|
|
10944
|
+
/* @__PURE__ */ jsx31(Checkbox, { checked: draft.defaultCollapsed, disabled: locked, onChange: (checked) => setDraft((current) => ({ ...current, defaultCollapsed: checked })), children: "\u9ED8\u8BA4\u6536\u8D77\u67E5\u8BE2\u6761\u4EF6" }),
|
|
10945
|
+
/* @__PURE__ */ jsx31("p", { className: "sia-query-settings__hint", children: "\u52FE\u9009\u9700\u8981\u663E\u793A\u7684\u6761\u4EF6\uFF0C\u62D6\u52A8\u6216\u4F7F\u7528\u4E0A\u4E0B\u6309\u94AE\u8C03\u6574\u987A\u5E8F\u3002" }),
|
|
10946
|
+
/* @__PURE__ */ jsx31("div", { ref: sort.listRef, className: `sia-query-settings__list${sort.preview ? " is-sorting" : ""}`, children: visibleDraft.map((item, index) => /* @__PURE__ */ jsxs27(
|
|
10940
10947
|
"div",
|
|
10941
10948
|
{
|
|
10942
10949
|
"data-query-field-key": item.key,
|
|
@@ -10944,18 +10951,18 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10944
10951
|
style: sort.preview ? { transform: `translateY(${sort.preview.offsets[item.key] ?? 0}px)` } : void 0,
|
|
10945
10952
|
onPointerDown: (event) => sort.start(event, item.key),
|
|
10946
10953
|
children: [
|
|
10947
|
-
/* @__PURE__ */
|
|
10948
|
-
/* @__PURE__ */
|
|
10949
|
-
/* @__PURE__ */
|
|
10954
|
+
/* @__PURE__ */ jsx31(Icon, { name: "menu", size: 15 }),
|
|
10955
|
+
/* @__PURE__ */ jsx31(Checkbox, { "aria-label": `\u663E\u793A ${item.key}`, checked: item.visible, disabled: locked || hideDisabledKeys.has(item.key), onChange: (checked) => setDraft((current) => ({ ...current, fields: visibleDraft.map((field) => field.key === item.key ? { ...field, visible: checked } : field) })) }),
|
|
10956
|
+
/* @__PURE__ */ jsx31("span", { className: "sia-query-settings__name", children: labels.get(item.key) ?? item.key }),
|
|
10950
10957
|
/* @__PURE__ */ jsxs27("div", { className: "sia-query-settings__order", children: [
|
|
10951
|
-
/* @__PURE__ */
|
|
10952
|
-
/* @__PURE__ */
|
|
10958
|
+
/* @__PURE__ */ jsx31(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0A\u79FB ${item.key}`, disabled: locked || index === 0, icon: /* @__PURE__ */ jsx31(Icon, { name: "chevron-up" }), onClick: () => move(index, index - 1) }),
|
|
10959
|
+
/* @__PURE__ */ jsx31(Button, { type: "button", size: "small", variant: "text", "aria-label": `\u4E0B\u79FB ${item.key}`, disabled: locked || index === visibleDraft.length - 1, icon: /* @__PURE__ */ jsx31(Icon, { name: "chevron-down" }), onClick: () => move(index, index + 1) })
|
|
10953
10960
|
] })
|
|
10954
10961
|
]
|
|
10955
10962
|
},
|
|
10956
10963
|
item.key
|
|
10957
10964
|
)) }),
|
|
10958
|
-
/* @__PURE__ */
|
|
10965
|
+
/* @__PURE__ */ jsx31(Button, { type: "button", disabled: locked, onClick: () => setDraft({ fields: reconcileQueryFields(fields.map((field) => field.key)), defaultCollapsed: defaultCollapsed ?? false }), children: "\u6062\u590D\u9ED8\u8BA4" })
|
|
10959
10966
|
] })
|
|
10960
10967
|
}
|
|
10961
10968
|
)
|
|
@@ -10964,7 +10971,7 @@ function useQueryFormSettings(config, fields, defaultCollapsed, applyCollapsed,
|
|
|
10964
10971
|
}
|
|
10965
10972
|
|
|
10966
10973
|
// src/components/QueryForm.tsx
|
|
10967
|
-
import { jsx as
|
|
10974
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10968
10975
|
function QueryForm({
|
|
10969
10976
|
fields,
|
|
10970
10977
|
settings,
|
|
@@ -11027,7 +11034,7 @@ function QueryForm({
|
|
|
11027
11034
|
width,
|
|
11028
11035
|
hideDisabled: settingsHideDisabled,
|
|
11029
11036
|
label: settingsLabel ?? item.label ?? (typeof item.children === "function" ? void 0 : fieldLabel(item.children)) ?? key,
|
|
11030
|
-
content: /* @__PURE__ */
|
|
11037
|
+
content: /* @__PURE__ */ jsx32(Form.Item, { noStyle: true, ...item })
|
|
11031
11038
|
})) : Children4.toArray(children).map((content, index) => ({
|
|
11032
11039
|
key: isValidElement5(content) && content.key != null ? String(content.key) : String(index),
|
|
11033
11040
|
width: void 0,
|
|
@@ -11231,7 +11238,7 @@ function QueryForm({
|
|
|
11231
11238
|
},
|
|
11232
11239
|
children: [
|
|
11233
11240
|
quickQueries.length ? /* @__PURE__ */ jsxs28("div", { className: "sia-query-form__quick", "aria-label": "\u9884\u8BBE\u5FEB\u6377\u67E5\u8BE2", children: [
|
|
11234
|
-
quickQueries.map((query) => /* @__PURE__ */
|
|
11241
|
+
quickQueries.map((query) => /* @__PURE__ */ jsx32(
|
|
11235
11242
|
Badge,
|
|
11236
11243
|
{
|
|
11237
11244
|
className: "sia-query-form__quick-badge",
|
|
@@ -11240,7 +11247,7 @@ function QueryForm({
|
|
|
11240
11247
|
title: query.count === void 0 ? void 0 : `\u5171 ${query.count} \u6761`,
|
|
11241
11248
|
...query.badgeProps,
|
|
11242
11249
|
count: query.count,
|
|
11243
|
-
children: /* @__PURE__ */
|
|
11250
|
+
children: /* @__PURE__ */ jsx32(
|
|
11244
11251
|
Button,
|
|
11245
11252
|
{
|
|
11246
11253
|
size: query.size ?? quickQuerySize,
|
|
@@ -11256,7 +11263,7 @@ function QueryForm({
|
|
|
11256
11263
|
)),
|
|
11257
11264
|
" "
|
|
11258
11265
|
] }) : null,
|
|
11259
|
-
/* @__PURE__ */
|
|
11266
|
+
/* @__PURE__ */ jsx32("div", { className: "sia-query-form__motion", children: /* @__PURE__ */ jsxs28(
|
|
11260
11267
|
"div",
|
|
11261
11268
|
{
|
|
11262
11269
|
ref: rowRef,
|
|
@@ -11265,7 +11272,7 @@ function QueryForm({
|
|
|
11265
11272
|
"--sia-query-field-width": typeof fieldWidth === "number" ? `${fieldWidth}px` : fieldWidth
|
|
11266
11273
|
},
|
|
11267
11274
|
children: [
|
|
11268
|
-
entries.map((entry) => /* @__PURE__ */
|
|
11275
|
+
entries.map((entry) => /* @__PURE__ */ jsx32(
|
|
11269
11276
|
"div",
|
|
11270
11277
|
{
|
|
11271
11278
|
className: "sia-query-form__field",
|
|
@@ -11281,7 +11288,7 @@ function QueryForm({
|
|
|
11281
11288
|
)),
|
|
11282
11289
|
/* @__PURE__ */ jsxs28("div", { ref: actionsRef, className: "sia-query-form__actions", children: [
|
|
11283
11290
|
/* @__PURE__ */ jsxs28(Space.Compact, { children: [
|
|
11284
|
-
/* @__PURE__ */
|
|
11291
|
+
/* @__PURE__ */ jsx32(
|
|
11285
11292
|
Button,
|
|
11286
11293
|
{
|
|
11287
11294
|
type: "submit",
|
|
@@ -11291,8 +11298,8 @@ function QueryForm({
|
|
|
11291
11298
|
children: searchText
|
|
11292
11299
|
}
|
|
11293
11300
|
),
|
|
11294
|
-
/* @__PURE__ */
|
|
11295
|
-
onSaveQuery ? /* @__PURE__ */
|
|
11301
|
+
/* @__PURE__ */ jsx32(Button, { disabled: busy, onClick: reset, children: resetText }),
|
|
11302
|
+
onSaveQuery ? /* @__PURE__ */ jsx32(
|
|
11296
11303
|
Button,
|
|
11297
11304
|
{
|
|
11298
11305
|
disabled: shortcutBusy,
|
|
@@ -11307,12 +11314,12 @@ function QueryForm({
|
|
|
11307
11314
|
) : null,
|
|
11308
11315
|
showSettings ?? settingsRows > 2 ? cloudSettings.control : null
|
|
11309
11316
|
] }),
|
|
11310
|
-
collapsible && entries.length > 0 ? /* @__PURE__ */
|
|
11317
|
+
collapsible && entries.length > 0 ? /* @__PURE__ */ jsx32("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ jsx32(
|
|
11311
11318
|
Button,
|
|
11312
11319
|
{
|
|
11313
11320
|
variant: "link",
|
|
11314
11321
|
"aria-expanded": !collapsed,
|
|
11315
|
-
icon: /* @__PURE__ */
|
|
11322
|
+
icon: /* @__PURE__ */ jsx32(Icon, { name: collapsed ? "chevron-down" : "chevron-up" }),
|
|
11316
11323
|
iconPosition: "end",
|
|
11317
11324
|
onClick: () => {
|
|
11318
11325
|
setInternalCollapsed(!collapsed);
|
|
@@ -11328,7 +11335,7 @@ function QueryForm({
|
|
|
11328
11335
|
}
|
|
11329
11336
|
) }),
|
|
11330
11337
|
savedQueries.length ? /* @__PURE__ */ jsxs28("div", { className: "sia-query-form__saved", "aria-label": "\u5DF2\u4FDD\u5B58\u5FEB\u6377\u67E5\u8BE2", children: [
|
|
11331
|
-
savedQueries.map((query, index) => /* @__PURE__ */
|
|
11338
|
+
savedQueries.map((query, index) => /* @__PURE__ */ jsx32(
|
|
11332
11339
|
Tag,
|
|
11333
11340
|
{
|
|
11334
11341
|
status: query.status ?? ["processing", "success", "warning", "error"][index % 4],
|
|
@@ -11354,7 +11361,7 @@ function QueryForm({
|
|
|
11354
11361
|
)),
|
|
11355
11362
|
" "
|
|
11356
11363
|
] }) : null,
|
|
11357
|
-
error ? /* @__PURE__ */
|
|
11364
|
+
error ? /* @__PURE__ */ jsx32("p", { className: "sia-query-form__error", role: "alert", children: error }) : null
|
|
11358
11365
|
]
|
|
11359
11366
|
}
|
|
11360
11367
|
),
|
|
@@ -11370,7 +11377,7 @@ function QueryForm({
|
|
|
11370
11377
|
if (!saveLock.current) setSaveOpen(next);
|
|
11371
11378
|
},
|
|
11372
11379
|
children: [
|
|
11373
|
-
/* @__PURE__ */
|
|
11380
|
+
/* @__PURE__ */ jsx32(
|
|
11374
11381
|
Input,
|
|
11375
11382
|
{
|
|
11376
11383
|
autoFocus: true,
|
|
@@ -11389,7 +11396,7 @@ function QueryForm({
|
|
|
11389
11396
|
}
|
|
11390
11397
|
}
|
|
11391
11398
|
),
|
|
11392
|
-
saveError ? /* @__PURE__ */
|
|
11399
|
+
saveError ? /* @__PURE__ */ jsx32("p", { className: "sia-query-form__error", role: "alert", children: saveError }) : null
|
|
11393
11400
|
]
|
|
11394
11401
|
}
|
|
11395
11402
|
)
|
|
@@ -11397,9 +11404,9 @@ function QueryForm({
|
|
|
11397
11404
|
}
|
|
11398
11405
|
|
|
11399
11406
|
// src/components/NumberRange.tsx
|
|
11400
|
-
import { forwardRef as
|
|
11401
|
-
import { jsx as
|
|
11402
|
-
var NumberRange =
|
|
11407
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
11408
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11409
|
+
var NumberRange = forwardRef9(function NumberRange2({
|
|
11403
11410
|
value,
|
|
11404
11411
|
defaultValue = [null, null],
|
|
11405
11412
|
onChange,
|
|
@@ -11436,7 +11443,7 @@ var NumberRange = forwardRef8(function NumberRange2({
|
|
|
11436
11443
|
"aria-disabled": disabled || void 0,
|
|
11437
11444
|
className: `sia-number-range sia-number-range--${size} sia-number-range--${status}${disabled ? " is-disabled" : ""} ${className}`.trim(),
|
|
11438
11445
|
children: [
|
|
11439
|
-
/* @__PURE__ */
|
|
11446
|
+
/* @__PURE__ */ jsx33(
|
|
11440
11447
|
InputNumber,
|
|
11441
11448
|
{
|
|
11442
11449
|
...inputProps,
|
|
@@ -11448,8 +11455,8 @@ var NumberRange = forwardRef8(function NumberRange2({
|
|
|
11448
11455
|
onChange: (next) => change(0, next)
|
|
11449
11456
|
}
|
|
11450
11457
|
),
|
|
11451
|
-
/* @__PURE__ */
|
|
11452
|
-
/* @__PURE__ */
|
|
11458
|
+
/* @__PURE__ */ jsx33(Icon, { className: "sia-number-range__separator", name: "tilde", size: 12, strokeWidth: 1.5, "aria-hidden": "true" }),
|
|
11459
|
+
/* @__PURE__ */ jsx33(
|
|
11453
11460
|
InputNumber,
|
|
11454
11461
|
{
|
|
11455
11462
|
...inputProps,
|
|
@@ -11461,12 +11468,109 @@ var NumberRange = forwardRef8(function NumberRange2({
|
|
|
11461
11468
|
onChange: (next) => change(1, next)
|
|
11462
11469
|
}
|
|
11463
11470
|
),
|
|
11464
|
-
allowClear && !disabled && !readOnly && range.some((item) => item !== null) ? /* @__PURE__ */
|
|
11471
|
+
allowClear && !disabled && !readOnly && range.some((item) => item !== null) ? /* @__PURE__ */ jsx33("button", { type: "button", className: "sia-number-range__clear", "aria-label": "\u6E05\u9664\u6570\u5B57\u533A\u95F4", onClick: () => setValue2([null, null]), children: /* @__PURE__ */ jsx33(Icon, { name: "circle-close", variant: "filled", size: 15 }) }) : null
|
|
11465
11472
|
]
|
|
11466
11473
|
}
|
|
11467
11474
|
);
|
|
11468
11475
|
});
|
|
11469
11476
|
|
|
11477
|
+
// src/components/VirtualGrid.tsx
|
|
11478
|
+
import { useEffect as useEffect19, useLayoutEffect as useLayoutEffect10, useRef as useRef28, useState as useState28 } from "react";
|
|
11479
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11480
|
+
function VirtualGrid({
|
|
11481
|
+
items,
|
|
11482
|
+
itemKey,
|
|
11483
|
+
renderItem,
|
|
11484
|
+
rowHeight,
|
|
11485
|
+
minColumnWidth = 200,
|
|
11486
|
+
gap = 8,
|
|
11487
|
+
overscan = 2,
|
|
11488
|
+
hasMore = false,
|
|
11489
|
+
loading = false,
|
|
11490
|
+
loadMoreThreshold = 120,
|
|
11491
|
+
onLoadMore,
|
|
11492
|
+
empty,
|
|
11493
|
+
className = "",
|
|
11494
|
+
onScroll,
|
|
11495
|
+
tabIndex = 0,
|
|
11496
|
+
...props
|
|
11497
|
+
}) {
|
|
11498
|
+
const viewport = useRef28(null);
|
|
11499
|
+
const [size, setSize] = useState28({ width: 0, height: 0 });
|
|
11500
|
+
const [scrollTop, setScrollTop] = useState28(0);
|
|
11501
|
+
const frame = useRef28();
|
|
11502
|
+
const requestedLength = useRef28();
|
|
11503
|
+
const height = Math.max(1, rowHeight);
|
|
11504
|
+
const spacing = Math.max(0, gap);
|
|
11505
|
+
const columns = Math.max(1, Math.floor((size.width + spacing) / (Math.max(1, minColumnWidth) + spacing)));
|
|
11506
|
+
const rowCount = Math.ceil(items.length / columns);
|
|
11507
|
+
const stride = height + spacing;
|
|
11508
|
+
const totalHeight = Math.max(0, rowCount * stride - spacing);
|
|
11509
|
+
const paddingRows = Math.max(0, Math.floor(overscan));
|
|
11510
|
+
const startRow = Math.max(0, Math.min(rowCount - 1, Math.floor(scrollTop / stride)) - paddingRows);
|
|
11511
|
+
const endRow = Math.min(rowCount, Math.ceil((scrollTop + size.height) / stride) + paddingRows);
|
|
11512
|
+
useLayoutEffect10(() => {
|
|
11513
|
+
const el = viewport.current;
|
|
11514
|
+
if (!el) return;
|
|
11515
|
+
const measure = () => setSize((previous) => previous.width === el.clientWidth && previous.height === el.clientHeight ? previous : { width: el.clientWidth, height: el.clientHeight });
|
|
11516
|
+
measure();
|
|
11517
|
+
const observer = new ResizeObserver(measure);
|
|
11518
|
+
observer.observe(el);
|
|
11519
|
+
return () => {
|
|
11520
|
+
observer.disconnect();
|
|
11521
|
+
if (frame.current !== void 0) cancelAnimationFrame(frame.current);
|
|
11522
|
+
};
|
|
11523
|
+
}, []);
|
|
11524
|
+
useLayoutEffect10(() => {
|
|
11525
|
+
const el = viewport.current;
|
|
11526
|
+
if (!el) return;
|
|
11527
|
+
const next = Math.min(el.scrollTop, Math.max(0, totalHeight - size.height));
|
|
11528
|
+
if (el.scrollTop !== next) el.scrollTop = next;
|
|
11529
|
+
setScrollTop(next);
|
|
11530
|
+
}, [totalHeight, size.height]);
|
|
11531
|
+
useEffect19(() => {
|
|
11532
|
+
if (!onLoadMore || !hasMore || loading || size.height <= 0) return;
|
|
11533
|
+
if (totalHeight - scrollTop - size.height > Math.max(0, loadMoreThreshold)) return;
|
|
11534
|
+
if (requestedLength.current === items.length) return;
|
|
11535
|
+
requestedLength.current = items.length;
|
|
11536
|
+
onLoadMore();
|
|
11537
|
+
}, [items.length, hasMore, loading, size.height, scrollTop, totalHeight, loadMoreThreshold, onLoadMore]);
|
|
11538
|
+
return /* @__PURE__ */ jsxs30(
|
|
11539
|
+
"div",
|
|
11540
|
+
{
|
|
11541
|
+
...props,
|
|
11542
|
+
ref: viewport,
|
|
11543
|
+
className: `sia-virtual-grid ${className}`.trim(),
|
|
11544
|
+
role: props.role ?? "list",
|
|
11545
|
+
tabIndex,
|
|
11546
|
+
"aria-busy": loading,
|
|
11547
|
+
onScroll: (event) => {
|
|
11548
|
+
onScroll?.(event);
|
|
11549
|
+
if (frame.current !== void 0) return;
|
|
11550
|
+
frame.current = requestAnimationFrame(() => {
|
|
11551
|
+
frame.current = void 0;
|
|
11552
|
+
setScrollTop(viewport.current?.scrollTop ?? 0);
|
|
11553
|
+
});
|
|
11554
|
+
},
|
|
11555
|
+
children: [
|
|
11556
|
+
/* @__PURE__ */ jsx34("div", { className: "sia-virtual-grid__spacer", style: { height: totalHeight }, children: Array.from({ length: Math.max(0, endRow - startRow) }, (_, offset) => {
|
|
11557
|
+
const row = startRow + offset;
|
|
11558
|
+
return /* @__PURE__ */ jsx34("div", { className: "sia-virtual-grid__row", role: "presentation", style: {
|
|
11559
|
+
top: row * stride,
|
|
11560
|
+
height,
|
|
11561
|
+
columnGap: spacing,
|
|
11562
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`
|
|
11563
|
+
}, children: items.slice(row * columns, (row + 1) * columns).map((item, column) => {
|
|
11564
|
+
const index = row * columns + column;
|
|
11565
|
+
return /* @__PURE__ */ jsx34("div", { className: "sia-virtual-grid__item", role: "listitem", "aria-posinset": index + 1, "aria-setsize": hasMore ? -1 : items.length, children: renderItem(item, index) }, itemKey(item, index));
|
|
11566
|
+
}) }, row);
|
|
11567
|
+
}) }),
|
|
11568
|
+
!items.length && !loading ? empty : null
|
|
11569
|
+
]
|
|
11570
|
+
}
|
|
11571
|
+
);
|
|
11572
|
+
}
|
|
11573
|
+
|
|
11470
11574
|
// src/index.ts
|
|
11471
11575
|
initializeDefaultScrollbars();
|
|
11472
11576
|
export {
|
|
@@ -11590,6 +11694,8 @@ export {
|
|
|
11590
11694
|
Typography,
|
|
11591
11695
|
Upload,
|
|
11592
11696
|
VennChart,
|
|
11697
|
+
Video,
|
|
11698
|
+
VirtualGrid,
|
|
11593
11699
|
Watermark,
|
|
11594
11700
|
WindowControls,
|
|
11595
11701
|
WindowFrame,
|
package/dist/markdown-editor.cjs
CHANGED
|
@@ -499,6 +499,7 @@ function startFloatingScrollbars(targetRef) {
|
|
|
499
499
|
const onResize = () => scheduleScan();
|
|
500
500
|
window.addEventListener("resize", onResize);
|
|
501
501
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
502
|
+
window.addEventListener("sia-overlay-motion-end", scheduleUpdateAll);
|
|
502
503
|
scheduleScan();
|
|
503
504
|
return () => {
|
|
504
505
|
releaseProximity();
|
|
@@ -506,6 +507,7 @@ function startFloatingScrollbars(targetRef) {
|
|
|
506
507
|
resizeObserver.disconnect();
|
|
507
508
|
window.removeEventListener("resize", onResize);
|
|
508
509
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
510
|
+
window.removeEventListener("sia-overlay-motion-end", scheduleUpdateAll);
|
|
509
511
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
510
512
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
511
513
|
entries.forEach((entry) => entry.cleanup());
|
package/dist/markdown-editor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MarkdownEditor
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XXFYFLZA.js";
|
|
4
|
+
import "./chunk-YO5OJQEH.js";
|
|
5
5
|
import {
|
|
6
6
|
initializeDefaultScrollbars
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SRWUDTCS.js";
|
|
8
8
|
|
|
9
9
|
// src/markdown-editor.ts
|
|
10
10
|
initializeDefaultScrollbars();
|
|
@@ -508,6 +508,7 @@ function startFloatingScrollbars(targetRef) {
|
|
|
508
508
|
const onResize = () => scheduleScan();
|
|
509
509
|
window.addEventListener("resize", onResize);
|
|
510
510
|
window.addEventListener("scroll", scheduleUpdateAll, true);
|
|
511
|
+
window.addEventListener("sia-overlay-motion-end", scheduleUpdateAll);
|
|
511
512
|
scheduleScan();
|
|
512
513
|
return () => {
|
|
513
514
|
releaseProximity();
|
|
@@ -515,6 +516,7 @@ function startFloatingScrollbars(targetRef) {
|
|
|
515
516
|
resizeObserver.disconnect();
|
|
516
517
|
window.removeEventListener("resize", onResize);
|
|
517
518
|
window.removeEventListener("scroll", scheduleUpdateAll, true);
|
|
519
|
+
window.removeEventListener("sia-overlay-motion-end", scheduleUpdateAll);
|
|
518
520
|
if (scanFrame) window.cancelAnimationFrame(scanFrame);
|
|
519
521
|
if (updateFrame) window.cancelAnimationFrame(updateFrame);
|
|
520
522
|
entries.forEach((entry) => entry.cleanup());
|
|
@@ -1058,32 +1060,10 @@ var Button = (0, import_react6.forwardRef)(function Button2({
|
|
|
1058
1060
|
}, forwardedRef) {
|
|
1059
1061
|
const size = useControlSize(sizeProp);
|
|
1060
1062
|
const localRef = (0, import_react6.useRef)(null);
|
|
1061
|
-
const bounceRef = (0, import_react6.useRef)(null);
|
|
1062
1063
|
const waveTimerRef = (0, import_react6.useRef)();
|
|
1063
1064
|
(0, import_react6.useEffect)(() => () => {
|
|
1064
|
-
bounceRef.current?.cancel();
|
|
1065
1065
|
window.clearTimeout(waveTimerRef.current);
|
|
1066
1066
|
}, []);
|
|
1067
|
-
function playBounce(button) {
|
|
1068
|
-
if (!button.animate || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
1069
|
-
const current = getComputedStyle(button).scale;
|
|
1070
|
-
bounceRef.current?.cancel();
|
|
1071
|
-
const base = getComputedStyle(button).scale;
|
|
1072
|
-
const [x = 1, y = x] = base === "none" ? [] : base.split(/\s+/).map(Number);
|
|
1073
|
-
const scaled = (factor) => `${x * factor} ${y * factor}`;
|
|
1074
|
-
const animation = button.animate([
|
|
1075
|
-
{ scale: current === "none" ? "1" : current, offset: 0 },
|
|
1076
|
-
// 宽按钮保持等比缩放,以更明显的过冲表现弹性但不改变布局占位。
|
|
1077
|
-
{ scale: scaled(0.9), offset: 0.2 },
|
|
1078
|
-
{ scale: scaled(1.09), offset: 0.52 },
|
|
1079
|
-
{ scale: scaled(0.96), offset: 0.78 },
|
|
1080
|
-
{ scale: scaled(1), offset: 1 }
|
|
1081
|
-
], { duration: 320, easing: "cubic-bezier(.3, 0, .25, 1)" });
|
|
1082
|
-
bounceRef.current = animation;
|
|
1083
|
-
animation.onfinish = () => {
|
|
1084
|
-
if (bounceRef.current === animation) bounceRef.current = null;
|
|
1085
|
-
};
|
|
1086
|
-
}
|
|
1087
1067
|
function setRef(node) {
|
|
1088
1068
|
localRef.current = node;
|
|
1089
1069
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -1092,7 +1072,6 @@ var Button = (0, import_react6.forwardRef)(function Button2({
|
|
|
1092
1072
|
function handleClick(event) {
|
|
1093
1073
|
const button = localRef.current;
|
|
1094
1074
|
if (disabled || loading) return;
|
|
1095
|
-
if (button) playBounce(button);
|
|
1096
1075
|
if (button && variant === "primary") {
|
|
1097
1076
|
const rect = button.getBoundingClientRect();
|
|
1098
1077
|
button.style.setProperty("--sia-wave-x", `${event.detail === 0 ? button.offsetWidth / 2 : (event.clientX - rect.left) * button.offsetWidth / rect.width}px`);
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RichTextContent,
|
|
3
3
|
RichTextEditor
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-W4HDN7MD.js";
|
|
5
|
+
import "./chunk-EZTF5TA2.js";
|
|
6
|
+
import "./chunk-NRLIOMXY.js";
|
|
7
|
+
import "./chunk-YHVFLSZW.js";
|
|
8
|
+
import "./chunk-PU2V3VB5.js";
|
|
9
|
+
import "./chunk-YO5OJQEH.js";
|
|
10
10
|
import {
|
|
11
11
|
initializeDefaultScrollbars
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SRWUDTCS.js";
|
|
13
13
|
|
|
14
14
|
// src/rich-text-editor.ts
|
|
15
15
|
initializeDefaultScrollbars();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties } from 'react';
|
|
3
3
|
import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
4
|
-
import { S as SelectOption, j as SelectValue } from './Select-
|
|
4
|
+
import { S as SelectOption, j as SelectValue } from './Select-DKfT3fJR.cjs';
|
|
5
5
|
|
|
6
6
|
/** 日期选择附带的时间选择配置。 */
|
|
7
7
|
type DatePickerShowTime = boolean | {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties } from 'react';
|
|
3
3
|
import { I as InputPlaceholderMode, C as ControlSize, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
4
|
-
import { S as SelectOption, j as SelectValue } from './Select-
|
|
4
|
+
import { S as SelectOption, j as SelectValue } from './Select-Wolx4zNc.js';
|
|
5
5
|
|
|
6
6
|
/** 日期选择附带的时间选择配置。 */
|
|
7
7
|
type DatePickerShowTime = boolean | {
|