@sia.soul/sia-react-ui 0.1.91 → 0.1.94
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-Bv2AmXRD.d.cts → Select-DQpfyK7I.d.cts} +5 -0
- package/dist/{Select-Cc1owuvN.d.ts → Select-DmT9pFRW.d.ts} +5 -0
- package/dist/{chunk-GLXGN5SO.js → chunk-4TTHPU2S.js} +2 -2
- package/dist/{chunk-7BJPQCRG.js → chunk-DJTV4X6L.js} +51 -7
- package/dist/{chunk-AG2VFAZR.js → chunk-FGGBNWBT.js} +2 -2
- package/dist/{chunk-G5K72R4O.js → chunk-X5BFQUFX.js} +9 -4
- package/dist/{chunk-OPYA3PMD.js → chunk-YPHUBD4F.js} +1 -1
- package/dist/{core-OIIkAeiG.d.cts → core-CkK9RRi0.d.cts} +9 -3
- package/dist/{core-BGA9VB0L.d.ts → core-uAx1caJB.d.ts} +9 -3
- package/dist/core.cjs +59 -10
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +3 -3
- package/dist/index.cjs +86 -12
- package/dist/index.d.cts +22 -8
- package/dist/index.d.ts +22 -8
- package/dist/index.js +32 -7
- package/dist/rich-text-editor.cjs +9 -4
- package/dist/rich-text-editor.js +2 -2
- package/dist/{select-date-range-CRWxqHFp.d.cts → select-date-range-BT71tp7y.d.cts} +1 -1
- package/dist/{select-date-range-rtYL9egr.d.ts → select-date-range-CFGzoyLs.d.ts} +1 -1
- package/dist/select-date-range.cjs +50 -6
- 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
|
@@ -177,6 +177,8 @@ type SelectOption = {
|
|
|
177
177
|
disabled?: boolean;
|
|
178
178
|
/** 弹框模式中的分组标题。 */
|
|
179
179
|
group?: string;
|
|
180
|
+
/** 弹框模式中显示在选项名称旁的帮助说明,不参与搜索或回填。 */
|
|
181
|
+
description?: ReactNode;
|
|
180
182
|
};
|
|
181
183
|
/** 选择器的属性配置。 */
|
|
182
184
|
interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "defaultValue" | "onChange" | "value"> {
|
|
@@ -196,6 +198,9 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
|
|
|
196
198
|
modalThreshold?: number;
|
|
197
199
|
/** 弹框标题、布局及顶部/底部扩展内容。 */
|
|
198
200
|
modalConfig?: {
|
|
201
|
+
/** 多选弹框显示分组复选框,仅切换当前搜索及已选视图中该组的可用项。
|
|
202
|
+
* @defaultValue false */
|
|
203
|
+
groupCheckable?: boolean;
|
|
199
204
|
/** 弹框标题,未设置时使用 Select 的 placeholder。 */
|
|
200
205
|
title?: ReactNode;
|
|
201
206
|
/** 弹框宽度,默认 900px。 */
|
|
@@ -177,6 +177,8 @@ type SelectOption = {
|
|
|
177
177
|
disabled?: boolean;
|
|
178
178
|
/** 弹框模式中的分组标题。 */
|
|
179
179
|
group?: string;
|
|
180
|
+
/** 弹框模式中显示在选项名称旁的帮助说明,不参与搜索或回填。 */
|
|
181
|
+
description?: ReactNode;
|
|
180
182
|
};
|
|
181
183
|
/** 选择器的属性配置。 */
|
|
182
184
|
interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "defaultValue" | "onChange" | "value"> {
|
|
@@ -196,6 +198,9 @@ interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "def
|
|
|
196
198
|
modalThreshold?: number;
|
|
197
199
|
/** 弹框标题、布局及顶部/底部扩展内容。 */
|
|
198
200
|
modalConfig?: {
|
|
201
|
+
/** 多选弹框显示分组复选框,仅切换当前搜索及已选视图中该组的可用项。
|
|
202
|
+
* @defaultValue false */
|
|
203
|
+
groupCheckable?: boolean;
|
|
199
204
|
/** 弹框标题,未设置时使用 Select 的 placeholder。 */
|
|
200
205
|
title?: ReactNode;
|
|
201
206
|
/** 弹框宽度,默认 900px。 */
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Icon,
|
|
4
4
|
Input,
|
|
5
5
|
Modal
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X5BFQUFX.js";
|
|
7
7
|
import {
|
|
8
8
|
Button
|
|
9
9
|
} from "./chunk-SJFT5OSX.js";
|
|
@@ -1170,7 +1170,8 @@ function SelectionPanel({
|
|
|
1170
1170
|
displayField = "label",
|
|
1171
1171
|
columns = 1,
|
|
1172
1172
|
maxHeight = 250,
|
|
1173
|
-
autoFocusSearch = false
|
|
1173
|
+
autoFocusSearch = false,
|
|
1174
|
+
groupCheckable = false
|
|
1174
1175
|
}) {
|
|
1175
1176
|
const [localSearch, setLocalSearch] = useState2("");
|
|
1176
1177
|
const search = searchValue ?? localSearch;
|
|
@@ -1202,7 +1203,7 @@ function SelectionPanel({
|
|
|
1202
1203
|
let top = 0;
|
|
1203
1204
|
for (const [group, items] of groups) {
|
|
1204
1205
|
if (group) {
|
|
1205
|
-
rows2.push({ key: `group-${rows2.length}`, title: group, top, height: 30 });
|
|
1206
|
+
rows2.push({ key: `group-${rows2.length}`, title: group, items, top, height: 30 });
|
|
1206
1207
|
top += 30;
|
|
1207
1208
|
}
|
|
1208
1209
|
for (let index = 0; index < items.length; index += count) {
|
|
@@ -1240,6 +1241,42 @@ function SelectionPanel({
|
|
|
1240
1241
|
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
1241
1242
|
onChange([...retained, ...add]);
|
|
1242
1243
|
}
|
|
1244
|
+
function groupHeading(title, items) {
|
|
1245
|
+
if (!multiple || !groupCheckable) return title;
|
|
1246
|
+
const editable = items.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
1247
|
+
const all = editable.length > 0 && editable.every((option) => selected.has(option.value));
|
|
1248
|
+
return /* @__PURE__ */ jsx3(
|
|
1249
|
+
Checkbox2,
|
|
1250
|
+
{
|
|
1251
|
+
checked: all,
|
|
1252
|
+
indeterminate: !all && editable.some((option) => selected.has(option.value)),
|
|
1253
|
+
disabled: disabled || loading || !editable.length,
|
|
1254
|
+
onChange: (checked) => {
|
|
1255
|
+
const next = new Set(value);
|
|
1256
|
+
editable.forEach((option) => checked ? next.add(option.value) : next.delete(option.value));
|
|
1257
|
+
onChange([...next]);
|
|
1258
|
+
},
|
|
1259
|
+
children: title
|
|
1260
|
+
}
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
function help(option) {
|
|
1264
|
+
return option.description != null && option.description !== false ? /* @__PURE__ */ jsx3(Tooltip, { title: option.description, children: /* @__PURE__ */ jsx3(
|
|
1265
|
+
"span",
|
|
1266
|
+
{
|
|
1267
|
+
role: "img",
|
|
1268
|
+
"aria-label": "\u9009\u9879\u8BF4\u660E",
|
|
1269
|
+
tabIndex: 0,
|
|
1270
|
+
onClick: (event) => {
|
|
1271
|
+
event.preventDefault();
|
|
1272
|
+
event.stopPropagation();
|
|
1273
|
+
},
|
|
1274
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
1275
|
+
style: { display: "inline-flex", marginInlineStart: 4 },
|
|
1276
|
+
children: /* @__PURE__ */ jsx3(Icon, { name: "help-circle", size: 14 })
|
|
1277
|
+
}
|
|
1278
|
+
) }) : null;
|
|
1279
|
+
}
|
|
1243
1280
|
return /* @__PURE__ */ jsxs3("div", { className: "sia-selection-panel", children: [
|
|
1244
1281
|
/* @__PURE__ */ jsx3(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
1245
1282
|
showSearch && /* @__PURE__ */ jsx3(
|
|
@@ -1293,7 +1330,7 @@ function SelectionPanel({
|
|
|
1293
1330
|
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
|
|
1294
1331
|
const option = enabled[next];
|
|
1295
1332
|
setActive(option.value);
|
|
1296
|
-
const row = rows.find((row2) => row2.items?.includes(option));
|
|
1333
|
+
const row = rows.find((row2) => row2.title === void 0 && row2.items?.includes(option));
|
|
1297
1334
|
if (row && listRef.current) {
|
|
1298
1335
|
listRef.current.scrollTop = Math.max(0, row.top - maxHeight / 2);
|
|
1299
1336
|
setScrollTop(listRef.current.scrollTop);
|
|
@@ -1308,7 +1345,7 @@ function SelectionPanel({
|
|
|
1308
1345
|
{
|
|
1309
1346
|
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
1310
1347
|
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
1311
|
-
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ jsx3("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ jsx3(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ jsx3(
|
|
1348
|
+
children: row.title !== void 0 ? groupHeading(row.title, row.items ?? []) : row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ jsx3("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ jsx3(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ jsx3(
|
|
1312
1349
|
"div",
|
|
1313
1350
|
{
|
|
1314
1351
|
role: "option",
|
|
@@ -1325,10 +1362,16 @@ function SelectionPanel({
|
|
|
1325
1362
|
if (!event.target.closest(".sia-checkbox")) toggle(option);
|
|
1326
1363
|
},
|
|
1327
1364
|
children: multiple ? /* @__PURE__ */ jsx3(Checkbox2, { checked: selected.has(option.value), disabled: disabled || loading || option.disabled, tabIndex: -1, onChange: () => toggle(option), children: /* @__PURE__ */ jsxs3("span", { className: "sia-selection-panel__text", children: [
|
|
1328
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ jsxs3("span", { className: "sia-selection-panel__label", children: [
|
|
1366
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
1367
|
+
help(option)
|
|
1368
|
+
] }),
|
|
1329
1369
|
showValue && /* @__PURE__ */ jsx3("small", { children: String(option.value) })
|
|
1330
1370
|
] }) }) : /* @__PURE__ */ jsxs3("span", { className: "sia-selection-panel__text", children: [
|
|
1331
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ jsxs3("span", { className: "sia-selection-panel__label", children: [
|
|
1372
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
1373
|
+
help(option)
|
|
1374
|
+
] }),
|
|
1332
1375
|
showValue && /* @__PURE__ */ jsx3("small", { children: String(option.value) })
|
|
1333
1376
|
] })
|
|
1334
1377
|
}
|
|
@@ -1852,6 +1895,7 @@ var Select = forwardRef2(function Select2({
|
|
|
1852
1895
|
value: modalValues,
|
|
1853
1896
|
onChange: setModalValues,
|
|
1854
1897
|
multiple,
|
|
1898
|
+
groupCheckable: modalConfig?.groupCheckable,
|
|
1855
1899
|
allowDeselect: allowClear,
|
|
1856
1900
|
selectedOnly,
|
|
1857
1901
|
showValue,
|
|
@@ -1351,7 +1351,8 @@ var placementMap = {
|
|
|
1351
1351
|
topLeft: "top-start",
|
|
1352
1352
|
topRight: "top-end"
|
|
1353
1353
|
};
|
|
1354
|
-
function
|
|
1354
|
+
function DropdownInternal({
|
|
1355
|
+
popupAnchorRef,
|
|
1355
1356
|
menu,
|
|
1356
1357
|
children,
|
|
1357
1358
|
trigger = ["hover"],
|
|
@@ -1564,7 +1565,7 @@ function DropdownRoot({
|
|
|
1564
1565
|
PopupPortal,
|
|
1565
1566
|
{
|
|
1566
1567
|
ref: popupRef,
|
|
1567
|
-
anchorRef: contextPoint ? contextAnchorRef : rootRef,
|
|
1568
|
+
anchorRef: contextPoint ? contextAnchorRef : popupAnchorRef ?? rootRef,
|
|
1568
1569
|
open: mounted,
|
|
1569
1570
|
placement: contextPoint ? "bottom-start" : placementMap[placement],
|
|
1570
1571
|
offset: contextPoint ? 2 : 6,
|
|
@@ -1586,6 +1587,9 @@ function DropdownRoot({
|
|
|
1586
1587
|
}
|
|
1587
1588
|
);
|
|
1588
1589
|
}
|
|
1590
|
+
function DropdownRoot(props) {
|
|
1591
|
+
return /* @__PURE__ */ jsx5(DropdownInternal, { ...props });
|
|
1592
|
+
}
|
|
1589
1593
|
function DropdownButton({
|
|
1590
1594
|
children,
|
|
1591
1595
|
className = "",
|
|
@@ -1597,9 +1601,10 @@ function DropdownButton({
|
|
|
1597
1601
|
trigger = ["click"],
|
|
1598
1602
|
...dropdownProps
|
|
1599
1603
|
}) {
|
|
1600
|
-
|
|
1604
|
+
const groupRef = useRef2(null);
|
|
1605
|
+
return /* @__PURE__ */ jsxs4("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
|
|
1601
1606
|
/* @__PURE__ */ jsx5(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
|
|
1602
|
-
/* @__PURE__ */ jsx5(
|
|
1607
|
+
/* @__PURE__ */ jsx5(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ jsx5(
|
|
1603
1608
|
Button,
|
|
1604
1609
|
{
|
|
1605
1610
|
...buttonProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
|
-
import { B as ButtonProps, f as Button } from './Select-
|
|
3
|
+
import { B as ButtonProps, f as Button } from './Select-DQpfyK7I.cjs';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.cjs';
|
|
5
5
|
|
|
6
6
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
@@ -875,9 +875,15 @@ interface DropdownProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"
|
|
|
875
875
|
source: DropdownOpenSource;
|
|
876
876
|
}) => void;
|
|
877
877
|
}
|
|
878
|
-
|
|
879
|
-
|
|
878
|
+
/** 普通下拉菜单使用自身触发器定位,不对外暴露组合按钮的内部锚点。 */
|
|
879
|
+
declare function DropdownRoot(props: DropdownProps): react.JSX.Element;
|
|
880
|
+
/** 组合下拉按钮的属性配置;菜单相对于整组按钮定位,主操作和箭头触发保持独立。 */
|
|
880
881
|
interface DropdownButtonProps extends Omit<DropdownProps, "children" | "className"> {
|
|
882
|
+
/**
|
|
883
|
+
* 相对于整组按钮的弹出方向和对齐位置;默认优先与主按钮左侧对齐,视口空间不足时自动调整位置。
|
|
884
|
+
* @defaultValue "bottomLeft"
|
|
885
|
+
*/
|
|
886
|
+
placement?: DropdownPlacement;
|
|
881
887
|
/** 子内容;组件嵌套内容或当前节点的子项。 */
|
|
882
888
|
children?: ReactNode;
|
|
883
889
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
3
|
-
import { B as ButtonProps, f as Button } from './Select-
|
|
3
|
+
import { B as ButtonProps, f as Button } from './Select-DmT9pFRW.js';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.js';
|
|
5
5
|
|
|
6
6
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
@@ -875,9 +875,15 @@ interface DropdownProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"
|
|
|
875
875
|
source: DropdownOpenSource;
|
|
876
876
|
}) => void;
|
|
877
877
|
}
|
|
878
|
-
|
|
879
|
-
|
|
878
|
+
/** 普通下拉菜单使用自身触发器定位,不对外暴露组合按钮的内部锚点。 */
|
|
879
|
+
declare function DropdownRoot(props: DropdownProps): react.JSX.Element;
|
|
880
|
+
/** 组合下拉按钮的属性配置;菜单相对于整组按钮定位,主操作和箭头触发保持独立。 */
|
|
880
881
|
interface DropdownButtonProps extends Omit<DropdownProps, "children" | "className"> {
|
|
882
|
+
/**
|
|
883
|
+
* 相对于整组按钮的弹出方向和对齐位置;默认优先与主按钮左侧对齐,视口空间不足时自动调整位置。
|
|
884
|
+
* @defaultValue "bottomLeft"
|
|
885
|
+
*/
|
|
886
|
+
placement?: DropdownPlacement;
|
|
881
887
|
/** 子内容;组件嵌套内容或当前节点的子项。 */
|
|
882
888
|
children?: ReactNode;
|
|
883
889
|
/**
|
package/dist/core.cjs
CHANGED
|
@@ -1707,7 +1707,8 @@ var placementMap = {
|
|
|
1707
1707
|
topLeft: "top-start",
|
|
1708
1708
|
topRight: "top-end"
|
|
1709
1709
|
};
|
|
1710
|
-
function
|
|
1710
|
+
function DropdownInternal({
|
|
1711
|
+
popupAnchorRef,
|
|
1711
1712
|
menu,
|
|
1712
1713
|
children,
|
|
1713
1714
|
trigger = ["hover"],
|
|
@@ -1920,7 +1921,7 @@ function DropdownRoot({
|
|
|
1920
1921
|
PopupPortal,
|
|
1921
1922
|
{
|
|
1922
1923
|
ref: popupRef,
|
|
1923
|
-
anchorRef: contextPoint ? contextAnchorRef : rootRef,
|
|
1924
|
+
anchorRef: contextPoint ? contextAnchorRef : popupAnchorRef ?? rootRef,
|
|
1924
1925
|
open: mounted,
|
|
1925
1926
|
placement: contextPoint ? "bottom-start" : placementMap[placement],
|
|
1926
1927
|
offset: contextPoint ? 2 : 6,
|
|
@@ -1942,6 +1943,9 @@ function DropdownRoot({
|
|
|
1942
1943
|
}
|
|
1943
1944
|
);
|
|
1944
1945
|
}
|
|
1946
|
+
function DropdownRoot(props) {
|
|
1947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownInternal, { ...props });
|
|
1948
|
+
}
|
|
1945
1949
|
function DropdownButton({
|
|
1946
1950
|
children,
|
|
1947
1951
|
className = "",
|
|
@@ -1953,9 +1957,10 @@ function DropdownButton({
|
|
|
1953
1957
|
trigger = ["click"],
|
|
1954
1958
|
...dropdownProps
|
|
1955
1959
|
}) {
|
|
1956
|
-
|
|
1960
|
+
const groupRef = (0, import_react8.useRef)(null);
|
|
1961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
|
|
1957
1962
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
|
|
1958
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1959
1964
|
Button,
|
|
1960
1965
|
{
|
|
1961
1966
|
...buttonProps,
|
|
@@ -3985,7 +3990,8 @@ function SelectionPanel({
|
|
|
3985
3990
|
displayField = "label",
|
|
3986
3991
|
columns = 1,
|
|
3987
3992
|
maxHeight = 250,
|
|
3988
|
-
autoFocusSearch = false
|
|
3993
|
+
autoFocusSearch = false,
|
|
3994
|
+
groupCheckable = false
|
|
3989
3995
|
}) {
|
|
3990
3996
|
const [localSearch, setLocalSearch] = (0, import_react23.useState)("");
|
|
3991
3997
|
const search = searchValue ?? localSearch;
|
|
@@ -4017,7 +4023,7 @@ function SelectionPanel({
|
|
|
4017
4023
|
let top = 0;
|
|
4018
4024
|
for (const [group, items] of groups) {
|
|
4019
4025
|
if (group) {
|
|
4020
|
-
rows2.push({ key: `group-${rows2.length}`, title: group, top, height: 30 });
|
|
4026
|
+
rows2.push({ key: `group-${rows2.length}`, title: group, items, top, height: 30 });
|
|
4021
4027
|
top += 30;
|
|
4022
4028
|
}
|
|
4023
4029
|
for (let index = 0; index < items.length; index += count) {
|
|
@@ -4055,6 +4061,42 @@ function SelectionPanel({
|
|
|
4055
4061
|
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
4056
4062
|
onChange([...retained, ...add]);
|
|
4057
4063
|
}
|
|
4064
|
+
function groupHeading(title, items) {
|
|
4065
|
+
if (!multiple || !groupCheckable) return title;
|
|
4066
|
+
const editable = items.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
4067
|
+
const all = editable.length > 0 && editable.every((option) => selected.has(option.value));
|
|
4068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4069
|
+
Checkbox2,
|
|
4070
|
+
{
|
|
4071
|
+
checked: all,
|
|
4072
|
+
indeterminate: !all && editable.some((option) => selected.has(option.value)),
|
|
4073
|
+
disabled: disabled || loading || !editable.length,
|
|
4074
|
+
onChange: (checked) => {
|
|
4075
|
+
const next = new Set(value);
|
|
4076
|
+
editable.forEach((option) => checked ? next.add(option.value) : next.delete(option.value));
|
|
4077
|
+
onChange([...next]);
|
|
4078
|
+
},
|
|
4079
|
+
children: title
|
|
4080
|
+
}
|
|
4081
|
+
);
|
|
4082
|
+
}
|
|
4083
|
+
function help(option) {
|
|
4084
|
+
return option.description != null && option.description !== false ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tooltip, { title: option.description, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4085
|
+
"span",
|
|
4086
|
+
{
|
|
4087
|
+
role: "img",
|
|
4088
|
+
"aria-label": "\u9009\u9879\u8BF4\u660E",
|
|
4089
|
+
tabIndex: 0,
|
|
4090
|
+
onClick: (event) => {
|
|
4091
|
+
event.preventDefault();
|
|
4092
|
+
event.stopPropagation();
|
|
4093
|
+
},
|
|
4094
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
4095
|
+
style: { display: "inline-flex", marginInlineStart: 4 },
|
|
4096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { name: "help-circle", size: 14 })
|
|
4097
|
+
}
|
|
4098
|
+
) }) : null;
|
|
4099
|
+
}
|
|
4058
4100
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "sia-selection-panel", children: [
|
|
4059
4101
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
4060
4102
|
showSearch && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -4108,7 +4150,7 @@ function SelectionPanel({
|
|
|
4108
4150
|
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
|
|
4109
4151
|
const option = enabled[next];
|
|
4110
4152
|
setActive(option.value);
|
|
4111
|
-
const row = rows.find((row2) => row2.items?.includes(option));
|
|
4153
|
+
const row = rows.find((row2) => row2.title === void 0 && row2.items?.includes(option));
|
|
4112
4154
|
if (row && listRef.current) {
|
|
4113
4155
|
listRef.current.scrollTop = Math.max(0, row.top - maxHeight / 2);
|
|
4114
4156
|
setScrollTop(listRef.current.scrollTop);
|
|
@@ -4123,7 +4165,7 @@ function SelectionPanel({
|
|
|
4123
4165
|
{
|
|
4124
4166
|
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
4125
4167
|
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
4126
|
-
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4168
|
+
children: row.title !== void 0 ? groupHeading(row.title, row.items ?? []) : row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4127
4169
|
"div",
|
|
4128
4170
|
{
|
|
4129
4171
|
role: "option",
|
|
@@ -4140,10 +4182,16 @@ function SelectionPanel({
|
|
|
4140
4182
|
if (!event.target.closest(".sia-checkbox")) toggle(option);
|
|
4141
4183
|
},
|
|
4142
4184
|
children: multiple ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Checkbox2, { checked: selected.has(option.value), disabled: disabled || loading || option.disabled, tabIndex: -1, onChange: () => toggle(option), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4143
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
4186
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
4187
|
+
help(option)
|
|
4188
|
+
] }),
|
|
4144
4189
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: String(option.value) })
|
|
4145
4190
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4146
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
4192
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
4193
|
+
help(option)
|
|
4194
|
+
] }),
|
|
4147
4195
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: String(option.value) })
|
|
4148
4196
|
] })
|
|
4149
4197
|
}
|
|
@@ -4664,6 +4712,7 @@ var Select = (0, import_react25.forwardRef)(function Select2({
|
|
|
4664
4712
|
value: modalValues,
|
|
4665
4713
|
onChange: setModalValues,
|
|
4666
4714
|
multiple,
|
|
4715
|
+
groupCheckable: modalConfig?.groupCheckable,
|
|
4667
4716
|
allowDeselect: allowClear,
|
|
4668
4717
|
selectedOnly,
|
|
4669
4718
|
showValue,
|
package/dist/core.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, 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 Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
2
|
-
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-
|
|
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 Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-CkK9RRi0.cjs';
|
|
2
|
+
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-DQpfyK7I.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.cjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, h as Card, i as CardAccent, j as CardProps, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, 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 Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-
|
|
2
|
-
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-
|
|
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 Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, aq as TabItem, ar as Tabs, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, T as TagStatus, aA as TagVariant, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, b1 as UploadProps, b5 as UploadRequestOptions, b9 as message } from './core-uAx1caJB.js';
|
|
2
|
+
export { f as Button, B as ButtonProps, e as ButtonSize, g as ButtonVariant, h as Modal, d as ModalActionResult, M as ModalOpenConfig, i as ModalProps, j as ModalType, a as OverlayApiHandle, k as Select, S as SelectOption, c as SelectProps, m as SelectValue } from './Select-DmT9pFRW.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.js';
|
package/dist/core.js
CHANGED
|
@@ -10,16 +10,16 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
Upload,
|
|
12
12
|
message
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FGGBNWBT.js";
|
|
14
14
|
import {
|
|
15
15
|
Select
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DJTV4X6L.js";
|
|
17
17
|
import {
|
|
18
18
|
Icon,
|
|
19
19
|
Input,
|
|
20
20
|
Modal,
|
|
21
21
|
Segmented
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-X5BFQUFX.js";
|
|
23
23
|
import {
|
|
24
24
|
Button
|
|
25
25
|
} from "./chunk-SJFT5OSX.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1877,7 +1877,8 @@ var placementMap = {
|
|
|
1877
1877
|
topLeft: "top-start",
|
|
1878
1878
|
topRight: "top-end"
|
|
1879
1879
|
};
|
|
1880
|
-
function
|
|
1880
|
+
function DropdownInternal({
|
|
1881
|
+
popupAnchorRef,
|
|
1881
1882
|
menu,
|
|
1882
1883
|
children,
|
|
1883
1884
|
trigger = ["hover"],
|
|
@@ -2090,7 +2091,7 @@ function DropdownRoot({
|
|
|
2090
2091
|
PopupPortal,
|
|
2091
2092
|
{
|
|
2092
2093
|
ref: popupRef,
|
|
2093
|
-
anchorRef: contextPoint ? contextAnchorRef : rootRef,
|
|
2094
|
+
anchorRef: contextPoint ? contextAnchorRef : popupAnchorRef ?? rootRef,
|
|
2094
2095
|
open: mounted,
|
|
2095
2096
|
placement: contextPoint ? "bottom-start" : placementMap[placement],
|
|
2096
2097
|
offset: contextPoint ? 2 : 6,
|
|
@@ -2112,6 +2113,9 @@ function DropdownRoot({
|
|
|
2112
2113
|
}
|
|
2113
2114
|
);
|
|
2114
2115
|
}
|
|
2116
|
+
function DropdownRoot(props) {
|
|
2117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownInternal, { ...props });
|
|
2118
|
+
}
|
|
2115
2119
|
function DropdownButton({
|
|
2116
2120
|
children,
|
|
2117
2121
|
className = "",
|
|
@@ -2123,9 +2127,10 @@ function DropdownButton({
|
|
|
2123
2127
|
trigger = ["click"],
|
|
2124
2128
|
...dropdownProps
|
|
2125
2129
|
}) {
|
|
2126
|
-
|
|
2130
|
+
const groupRef = (0, import_react8.useRef)(null);
|
|
2131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
|
|
2127
2132
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
|
|
2128
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2129
2134
|
Button,
|
|
2130
2135
|
{
|
|
2131
2136
|
...buttonProps,
|
|
@@ -3982,7 +3987,8 @@ function SelectionPanel({
|
|
|
3982
3987
|
displayField = "label",
|
|
3983
3988
|
columns = 1,
|
|
3984
3989
|
maxHeight = 250,
|
|
3985
|
-
autoFocusSearch = false
|
|
3990
|
+
autoFocusSearch = false,
|
|
3991
|
+
groupCheckable = false
|
|
3986
3992
|
}) {
|
|
3987
3993
|
const [localSearch, setLocalSearch] = (0, import_react19.useState)("");
|
|
3988
3994
|
const search = searchValue ?? localSearch;
|
|
@@ -4014,7 +4020,7 @@ function SelectionPanel({
|
|
|
4014
4020
|
let top = 0;
|
|
4015
4021
|
for (const [group, items] of groups) {
|
|
4016
4022
|
if (group) {
|
|
4017
|
-
rows2.push({ key: `group-${rows2.length}`, title: group, top, height: 30 });
|
|
4023
|
+
rows2.push({ key: `group-${rows2.length}`, title: group, items, top, height: 30 });
|
|
4018
4024
|
top += 30;
|
|
4019
4025
|
}
|
|
4020
4026
|
for (let index = 0; index < items.length; index += count) {
|
|
@@ -4052,6 +4058,42 @@ function SelectionPanel({
|
|
|
4052
4058
|
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
4053
4059
|
onChange([...retained, ...add]);
|
|
4054
4060
|
}
|
|
4061
|
+
function groupHeading(title, items) {
|
|
4062
|
+
if (!multiple || !groupCheckable) return title;
|
|
4063
|
+
const editable = items.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
4064
|
+
const all = editable.length > 0 && editable.every((option) => selected.has(option.value));
|
|
4065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4066
|
+
Checkbox2,
|
|
4067
|
+
{
|
|
4068
|
+
checked: all,
|
|
4069
|
+
indeterminate: !all && editable.some((option) => selected.has(option.value)),
|
|
4070
|
+
disabled: disabled || loading || !editable.length,
|
|
4071
|
+
onChange: (checked) => {
|
|
4072
|
+
const next = new Set(value);
|
|
4073
|
+
editable.forEach((option) => checked ? next.add(option.value) : next.delete(option.value));
|
|
4074
|
+
onChange([...next]);
|
|
4075
|
+
},
|
|
4076
|
+
children: title
|
|
4077
|
+
}
|
|
4078
|
+
);
|
|
4079
|
+
}
|
|
4080
|
+
function help(option) {
|
|
4081
|
+
return option.description != null && option.description !== false ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip, { title: option.description, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4082
|
+
"span",
|
|
4083
|
+
{
|
|
4084
|
+
role: "img",
|
|
4085
|
+
"aria-label": "\u9009\u9879\u8BF4\u660E",
|
|
4086
|
+
tabIndex: 0,
|
|
4087
|
+
onClick: (event) => {
|
|
4088
|
+
event.preventDefault();
|
|
4089
|
+
event.stopPropagation();
|
|
4090
|
+
},
|
|
4091
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
4092
|
+
style: { display: "inline-flex", marginInlineStart: 4 },
|
|
4093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { name: "help-circle", size: 14 })
|
|
4094
|
+
}
|
|
4095
|
+
) }) : null;
|
|
4096
|
+
}
|
|
4055
4097
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "sia-selection-panel", children: [
|
|
4056
4098
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
4057
4099
|
showSearch && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -4105,7 +4147,7 @@ function SelectionPanel({
|
|
|
4105
4147
|
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
|
|
4106
4148
|
const option = enabled[next];
|
|
4107
4149
|
setActive(option.value);
|
|
4108
|
-
const row = rows.find((row2) => row2.items?.includes(option));
|
|
4150
|
+
const row = rows.find((row2) => row2.title === void 0 && row2.items?.includes(option));
|
|
4109
4151
|
if (row && listRef.current) {
|
|
4110
4152
|
listRef.current.scrollTop = Math.max(0, row.top - maxHeight / 2);
|
|
4111
4153
|
setScrollTop(listRef.current.scrollTop);
|
|
@@ -4120,7 +4162,7 @@ function SelectionPanel({
|
|
|
4120
4162
|
{
|
|
4121
4163
|
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
4122
4164
|
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
4123
|
-
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4165
|
+
children: row.title !== void 0 ? groupHeading(row.title, row.items ?? []) : row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
4124
4166
|
"div",
|
|
4125
4167
|
{
|
|
4126
4168
|
role: "option",
|
|
@@ -4137,10 +4179,16 @@ function SelectionPanel({
|
|
|
4137
4179
|
if (!event.target.closest(".sia-checkbox")) toggle(option);
|
|
4138
4180
|
},
|
|
4139
4181
|
children: multiple ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Checkbox2, { checked: selected.has(option.value), disabled: disabled || loading || option.disabled, tabIndex: -1, onChange: () => toggle(option), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4140
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
4183
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
4184
|
+
help(option)
|
|
4185
|
+
] }),
|
|
4141
4186
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: String(option.value) })
|
|
4142
4187
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
4143
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
4189
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
4190
|
+
help(option)
|
|
4191
|
+
] }),
|
|
4144
4192
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: String(option.value) })
|
|
4145
4193
|
] })
|
|
4146
4194
|
}
|
|
@@ -4661,6 +4709,7 @@ var Select = (0, import_react21.forwardRef)(function Select2({
|
|
|
4661
4709
|
value: modalValues,
|
|
4662
4710
|
onChange: setModalValues,
|
|
4663
4711
|
multiple,
|
|
4712
|
+
groupCheckable: modalConfig?.groupCheckable,
|
|
4664
4713
|
allowDeselect: allowClear,
|
|
4665
4714
|
selectedOnly,
|
|
4666
4715
|
showValue,
|
|
@@ -11821,6 +11870,7 @@ function SelectModalBody({ config, values, disabled, onChange }) {
|
|
|
11821
11870
|
value: values,
|
|
11822
11871
|
onChange,
|
|
11823
11872
|
multiple,
|
|
11873
|
+
groupCheckable: config.groupCheckable,
|
|
11824
11874
|
disabled,
|
|
11825
11875
|
selectedOnly,
|
|
11826
11876
|
showValue: config.showValue,
|
|
@@ -11846,7 +11896,7 @@ function openSelectModal(config) {
|
|
|
11846
11896
|
} });
|
|
11847
11897
|
}
|
|
11848
11898
|
function modalConfig() {
|
|
11849
|
-
const { options, value, mode, showValue, columns, maxHeight, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
|
|
11899
|
+
const { options, value, mode, groupCheckable, showValue, columns, maxHeight, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
|
|
11850
11900
|
return {
|
|
11851
11901
|
...modal,
|
|
11852
11902
|
title: current.title ?? "\u8BF7\u9009\u62E9",
|
|
@@ -24435,6 +24485,13 @@ function mergeQueryFields(saved, active) {
|
|
|
24435
24485
|
const current = new Set(active.map((item) => item.key));
|
|
24436
24486
|
return [...active, ...saved.filter((item) => !current.has(item.key))];
|
|
24437
24487
|
}
|
|
24488
|
+
function countQueryFieldRows(centers) {
|
|
24489
|
+
const rows = [];
|
|
24490
|
+
for (const top of centers) {
|
|
24491
|
+
if (!rows.some((value) => Math.abs(value - top) <= 0.5)) rows.push(top);
|
|
24492
|
+
}
|
|
24493
|
+
return rows.length;
|
|
24494
|
+
}
|
|
24438
24495
|
|
|
24439
24496
|
// src/components/QueryFormSettings.tsx
|
|
24440
24497
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
@@ -24602,6 +24659,7 @@ var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
|
24602
24659
|
function QueryForm({
|
|
24603
24660
|
fields,
|
|
24604
24661
|
settings,
|
|
24662
|
+
showSettings,
|
|
24605
24663
|
children,
|
|
24606
24664
|
form: providedForm,
|
|
24607
24665
|
onSearch,
|
|
@@ -24676,6 +24734,7 @@ function QueryForm({
|
|
|
24676
24734
|
const actionsRef = (0, import_react97.useRef)(null);
|
|
24677
24735
|
const toggleRef = (0, import_react97.useRef)(null);
|
|
24678
24736
|
const [fittingCount, setFittingCount] = (0, import_react97.useState)(limit);
|
|
24737
|
+
const [settingsRows, setSettingsRows] = (0, import_react97.useState)(0);
|
|
24679
24738
|
(0, import_react97.useLayoutEffect)(() => {
|
|
24680
24739
|
const row = rowRef.current;
|
|
24681
24740
|
const actions = actionsRef.current;
|
|
@@ -24683,6 +24742,21 @@ function QueryForm({
|
|
|
24683
24742
|
function measure() {
|
|
24684
24743
|
if (!row || !actions) return;
|
|
24685
24744
|
const gap = parseFloat(getComputedStyle(row).columnGap) || 0;
|
|
24745
|
+
const sourceFields = Array.from(row.querySelectorAll(":scope > .sia-query-form__field"));
|
|
24746
|
+
const sourceHidden = sourceFields.map((field) => field.hidden);
|
|
24747
|
+
const sourceCollapsed = row.classList.contains("is-collapsed");
|
|
24748
|
+
row.classList.remove("is-collapsed");
|
|
24749
|
+
sourceFields.forEach((field) => {
|
|
24750
|
+
field.hidden = false;
|
|
24751
|
+
});
|
|
24752
|
+
if (row.clientWidth > 0) setSettingsRows(countQueryFieldRows(sourceFields.map((field) => {
|
|
24753
|
+
const rect = field.getBoundingClientRect();
|
|
24754
|
+
return rect.top + rect.height / 2;
|
|
24755
|
+
})));
|
|
24756
|
+
sourceFields.forEach((field, index) => {
|
|
24757
|
+
field.hidden = sourceHidden[index];
|
|
24758
|
+
});
|
|
24759
|
+
row.classList.toggle("is-collapsed", sourceCollapsed);
|
|
24686
24760
|
const allFields = Array.from(
|
|
24687
24761
|
row.querySelectorAll(":scope > .sia-query-form__field:not([data-settings-hidden])")
|
|
24688
24762
|
);
|
|
@@ -24909,7 +24983,7 @@ function QueryForm({
|
|
|
24909
24983
|
children: saveText
|
|
24910
24984
|
}
|
|
24911
24985
|
) : null,
|
|
24912
|
-
cloudSettings.control
|
|
24986
|
+
showSettings ?? settingsRows > 2 ? cloudSettings.control : null
|
|
24913
24987
|
] }),
|
|
24914
24988
|
collapsible && entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
24915
24989
|
Button,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-CkK9RRi0.cjs';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-CkK9RRi0.cjs';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
6
|
-
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-
|
|
7
|
-
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-
|
|
8
|
-
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
6
|
+
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-DQpfyK7I.cjs';
|
|
7
|
+
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-DQpfyK7I.cjs';
|
|
8
|
+
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-BT71tp7y.cjs';
|
|
9
9
|
export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.cjs';
|
|
10
10
|
export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.cjs';
|
|
11
11
|
import * as Monaco from 'monaco-editor';
|
|
@@ -1683,6 +1683,9 @@ interface SelectModalConfig extends Omit<ModalOpenConfig, "children" | "footer"
|
|
|
1683
1683
|
/** 单选或多选模式;single 确认时返回单值,multiple 返回数组。
|
|
1684
1684
|
* @defaultValue "single" */
|
|
1685
1685
|
mode?: SelectProps["mode"];
|
|
1686
|
+
/** 多选时显示分组复选框,仅切换当前搜索及已选视图中该组的可用项。
|
|
1687
|
+
* @defaultValue false */
|
|
1688
|
+
groupCheckable?: boolean;
|
|
1686
1689
|
/** 在选项名称下方另起一行显示 value;关闭此项仍可按 value 搜索。
|
|
1687
1690
|
* @defaultValue false */
|
|
1688
1691
|
showValue?: boolean;
|
|
@@ -2943,6 +2946,8 @@ interface SelectionOption {
|
|
|
2943
2946
|
disabledTip?: ReactNode;
|
|
2944
2947
|
/** 选项所属分组名称。 */
|
|
2945
2948
|
group?: string;
|
|
2949
|
+
/** 选项名称旁帮助图标的悬停说明,不参与搜索及值回填。 */
|
|
2950
|
+
description?: ReactNode;
|
|
2946
2951
|
/** 普通或按钮形态 */
|
|
2947
2952
|
optionType?: "divider";
|
|
2948
2953
|
}
|
|
@@ -2959,6 +2964,9 @@ interface SelectionPanelProps {
|
|
|
2959
2964
|
* @defaultValue false
|
|
2960
2965
|
*/
|
|
2961
2966
|
multiple?: boolean;
|
|
2967
|
+
/** 多选时在分组标题前显示复选框,仅切换当前搜索及已选视图中该组的可用选项;保留组外、隐藏及禁用的已选值。
|
|
2968
|
+
* @defaultValue false */
|
|
2969
|
+
groupCheckable?: boolean;
|
|
2962
2970
|
/** 单选时允许再次点击已选项以清空选择。 */
|
|
2963
2971
|
allowDeselect?: boolean;
|
|
2964
2972
|
/**
|
|
@@ -3022,7 +3030,7 @@ interface SelectionPanelProps {
|
|
|
3022
3030
|
autoFocusSearch?: boolean;
|
|
3023
3031
|
}
|
|
3024
3032
|
/** 可嵌入下拉或弹窗的分组选择面板,长列表按行虚拟化。 */
|
|
3025
|
-
declare function SelectionPanel({ options, value, onChange, multiple, allowDeselect, disabled, loading, showSearch, showActions, includeUnknownValues, searchValue, onSearch, selectedOnly, showValue, displayField, columns, maxHeight, autoFocusSearch }: SelectionPanelProps): react.JSX.Element;
|
|
3033
|
+
declare function SelectionPanel({ options, value, onChange, multiple, allowDeselect, disabled, loading, showSearch, showActions, includeUnknownValues, searchValue, onSearch, selectedOnly, showValue, displayField, columns, maxHeight, autoFocusSearch, groupCheckable }: SelectionPanelProps): react.JSX.Element;
|
|
3026
3034
|
|
|
3027
3035
|
/** 输入选择组合控件的属性配置。 */
|
|
3028
3036
|
interface InputSelectProps {
|
|
@@ -3152,8 +3160,14 @@ interface QueryFormSearchInfo {
|
|
|
3152
3160
|
interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormProps, "onFinish" | "children" | "onError"> {
|
|
3153
3161
|
/** 查询字段配置,每项包含稳定 key、可选宽度以及 Form.Item 属性;提供后优先于 children。 */
|
|
3154
3162
|
fields?: readonly QueryFormField[];
|
|
3155
|
-
/** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm
|
|
3163
|
+
/** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时不显示入口;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
|
|
3156
3164
|
settings?: QueryFormSettingsConfig;
|
|
3165
|
+
/**
|
|
3166
|
+
* 是否显示查询设置入口,需同时提供 settings。true 始终显示,false 始终隐藏;未指定时,全部条件在当前宽度下展开超过两行才显示。
|
|
3167
|
+
* 行数不包含操作按钮和快捷查询;按未隐藏条件前的完整字段测量,收起或保存字段显隐后仍可恢复设置。
|
|
3168
|
+
* @defaultValue undefined
|
|
3169
|
+
*/
|
|
3170
|
+
showSettings?: boolean;
|
|
3157
3171
|
/** 也可直接放入 Form.Item 或 Space.Compact,每个直接子项视为一个查询字段。 */
|
|
3158
3172
|
children?: ReactNode;
|
|
3159
3173
|
/** 表单校验通过后执行查询。values 是完整条件;info.source 区分 submit(查询)、reset(重置)、quick(顶部预设)和 saved(已保存条件)。返回 Promise 时自动显示加载状态并阻止重复提交。 */
|
|
@@ -3242,7 +3256,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3242
3256
|
actionsExtra?: ReactNode;
|
|
3243
3257
|
}
|
|
3244
3258
|
/** 可复用的业务查询表单;快捷查询的存储和结果数据由业务方管理。 */
|
|
3245
|
-
declare function QueryForm<T extends FormValues = FormValues>({ fields, settings, children, form: providedForm, onSearch, loading, fieldWidth, collapsible, collapsed: controlledCollapsed, defaultCollapsed, collapsedCount, onCollapsedChange, quickQueries, quickQuerySize, savedQueries, shortcutsLoading, onSaveQuery, onRemoveQuery, onError, searchText, resetText, saveText, resetSearch, actionsExtra, disabled, className, placeholderMode, onValuesChange, onFinishFailed, ...formProps }: QueryFormProps<T>): react.JSX.Element;
|
|
3259
|
+
declare function QueryForm<T extends FormValues = FormValues>({ fields, settings, showSettings, children, form: providedForm, onSearch, loading, fieldWidth, collapsible, collapsed: controlledCollapsed, defaultCollapsed, collapsedCount, onCollapsedChange, quickQueries, quickQuerySize, savedQueries, shortcutsLoading, onSaveQuery, onRemoveQuery, onError, searchText, resetText, saveText, resetSearch, actionsExtra, disabled, className, placeholderMode, onValuesChange, onFinishFailed, ...formProps }: QueryFormProps<T>): react.JSX.Element;
|
|
3246
3260
|
|
|
3247
3261
|
/** 数字区间,依次为下限和上限;null 表示该端未填写,0 是有效数值。 */
|
|
3248
3262
|
type NumberRangeValue = [number | null, number | null];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
2
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-
|
|
1
|
+
import { T as TagStatus, B as BadgeProps } from './core-uAx1caJB.js';
|
|
2
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-uAx1caJB.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
6
|
-
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-
|
|
7
|
-
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-
|
|
8
|
-
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
6
|
+
import { O as OverlayContainer, a as OverlayApiHandle, M as ModalOpenConfig, S as SelectOption, b as SelectChangeValue, c as SelectProps, d as ModalActionResult, B as ButtonProps, e as ButtonSize } from './Select-DmT9pFRW.js';
|
|
7
|
+
export { f as Button, g as ButtonVariant, h as Modal, i as ModalProps, j as ModalType, k as Select, l as SelectMode, m as SelectValue } from './Select-DmT9pFRW.js';
|
|
8
|
+
export { D as DatePicker, a as DatePickerDisabledInfo, b as DatePickerPreset, c as DatePickerProps, d as DatePickerShowTime, e as DatePickerType, f as DatePickerValue, g as DateRangePickerPreset, h as DateRangePickerProps, S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-CFGzoyLs.js';
|
|
9
9
|
export { RichTextContent, RichTextContentFormat, RichTextContentProps, RichTextEditor, RichTextEditorProps, RichTextImagePasteHandler, RichTextToolbar } from './rich-text-editor.js';
|
|
10
10
|
export { MarkdownEditor, MarkdownEditorMode, MarkdownEditorProps } from './markdown-editor.js';
|
|
11
11
|
import * as Monaco from 'monaco-editor';
|
|
@@ -1683,6 +1683,9 @@ interface SelectModalConfig extends Omit<ModalOpenConfig, "children" | "footer"
|
|
|
1683
1683
|
/** 单选或多选模式;single 确认时返回单值,multiple 返回数组。
|
|
1684
1684
|
* @defaultValue "single" */
|
|
1685
1685
|
mode?: SelectProps["mode"];
|
|
1686
|
+
/** 多选时显示分组复选框,仅切换当前搜索及已选视图中该组的可用项。
|
|
1687
|
+
* @defaultValue false */
|
|
1688
|
+
groupCheckable?: boolean;
|
|
1686
1689
|
/** 在选项名称下方另起一行显示 value;关闭此项仍可按 value 搜索。
|
|
1687
1690
|
* @defaultValue false */
|
|
1688
1691
|
showValue?: boolean;
|
|
@@ -2943,6 +2946,8 @@ interface SelectionOption {
|
|
|
2943
2946
|
disabledTip?: ReactNode;
|
|
2944
2947
|
/** 选项所属分组名称。 */
|
|
2945
2948
|
group?: string;
|
|
2949
|
+
/** 选项名称旁帮助图标的悬停说明,不参与搜索及值回填。 */
|
|
2950
|
+
description?: ReactNode;
|
|
2946
2951
|
/** 普通或按钮形态 */
|
|
2947
2952
|
optionType?: "divider";
|
|
2948
2953
|
}
|
|
@@ -2959,6 +2964,9 @@ interface SelectionPanelProps {
|
|
|
2959
2964
|
* @defaultValue false
|
|
2960
2965
|
*/
|
|
2961
2966
|
multiple?: boolean;
|
|
2967
|
+
/** 多选时在分组标题前显示复选框,仅切换当前搜索及已选视图中该组的可用选项;保留组外、隐藏及禁用的已选值。
|
|
2968
|
+
* @defaultValue false */
|
|
2969
|
+
groupCheckable?: boolean;
|
|
2962
2970
|
/** 单选时允许再次点击已选项以清空选择。 */
|
|
2963
2971
|
allowDeselect?: boolean;
|
|
2964
2972
|
/**
|
|
@@ -3022,7 +3030,7 @@ interface SelectionPanelProps {
|
|
|
3022
3030
|
autoFocusSearch?: boolean;
|
|
3023
3031
|
}
|
|
3024
3032
|
/** 可嵌入下拉或弹窗的分组选择面板,长列表按行虚拟化。 */
|
|
3025
|
-
declare function SelectionPanel({ options, value, onChange, multiple, allowDeselect, disabled, loading, showSearch, showActions, includeUnknownValues, searchValue, onSearch, selectedOnly, showValue, displayField, columns, maxHeight, autoFocusSearch }: SelectionPanelProps): react.JSX.Element;
|
|
3033
|
+
declare function SelectionPanel({ options, value, onChange, multiple, allowDeselect, disabled, loading, showSearch, showActions, includeUnknownValues, searchValue, onSearch, selectedOnly, showValue, displayField, columns, maxHeight, autoFocusSearch, groupCheckable }: SelectionPanelProps): react.JSX.Element;
|
|
3026
3034
|
|
|
3027
3035
|
/** 输入选择组合控件的属性配置。 */
|
|
3028
3036
|
interface InputSelectProps {
|
|
@@ -3152,8 +3160,14 @@ interface QueryFormSearchInfo {
|
|
|
3152
3160
|
interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormProps, "onFinish" | "children" | "onError"> {
|
|
3153
3161
|
/** 查询字段配置,每项包含稳定 key、可选宽度以及 Form.Item 属性;提供后优先于 children。 */
|
|
3154
3162
|
fields?: readonly QueryFormField[];
|
|
3155
|
-
/** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm
|
|
3163
|
+
/** 云设置入口,在查询操作按钮组末尾显示竖向三点图标;复用表格 adapter 和 scope,读写共用快照的 queryForm 属性。未提供时不显示入口;入口显隐由 showSettings 控制。隐藏字段保留挂载和值;children 模式需提供稳定 React key。 */
|
|
3156
3164
|
settings?: QueryFormSettingsConfig;
|
|
3165
|
+
/**
|
|
3166
|
+
* 是否显示查询设置入口,需同时提供 settings。true 始终显示,false 始终隐藏;未指定时,全部条件在当前宽度下展开超过两行才显示。
|
|
3167
|
+
* 行数不包含操作按钮和快捷查询;按未隐藏条件前的完整字段测量,收起或保存字段显隐后仍可恢复设置。
|
|
3168
|
+
* @defaultValue undefined
|
|
3169
|
+
*/
|
|
3170
|
+
showSettings?: boolean;
|
|
3157
3171
|
/** 也可直接放入 Form.Item 或 Space.Compact,每个直接子项视为一个查询字段。 */
|
|
3158
3172
|
children?: ReactNode;
|
|
3159
3173
|
/** 表单校验通过后执行查询。values 是完整条件;info.source 区分 submit(查询)、reset(重置)、quick(顶部预设)和 saved(已保存条件)。返回 Promise 时自动显示加载状态并阻止重复提交。 */
|
|
@@ -3242,7 +3256,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3242
3256
|
actionsExtra?: ReactNode;
|
|
3243
3257
|
}
|
|
3244
3258
|
/** 可复用的业务查询表单;快捷查询的存储和结果数据由业务方管理。 */
|
|
3245
|
-
declare function QueryForm<T extends FormValues = FormValues>({ fields, settings, children, form: providedForm, onSearch, loading, fieldWidth, collapsible, collapsed: controlledCollapsed, defaultCollapsed, collapsedCount, onCollapsedChange, quickQueries, quickQuerySize, savedQueries, shortcutsLoading, onSaveQuery, onRemoveQuery, onError, searchText, resetText, saveText, resetSearch, actionsExtra, disabled, className, placeholderMode, onValuesChange, onFinishFailed, ...formProps }: QueryFormProps<T>): react.JSX.Element;
|
|
3259
|
+
declare function QueryForm<T extends FormValues = FormValues>({ fields, settings, showSettings, children, form: providedForm, onSearch, loading, fieldWidth, collapsible, collapsed: controlledCollapsed, defaultCollapsed, collapsedCount, onCollapsedChange, quickQueries, quickQuerySize, savedQueries, shortcutsLoading, onSaveQuery, onRemoveQuery, onError, searchText, resetText, saveText, resetSearch, actionsExtra, disabled, className, placeholderMode, onValuesChange, onFinishFailed, ...formProps }: QueryFormProps<T>): react.JSX.Element;
|
|
3246
3260
|
|
|
3247
3261
|
/** 数字区间,依次为下限和上限;null 表示该端未填写,0 是有效数值。 */
|
|
3248
3262
|
type NumberRangeValue = [number | null, number | null];
|
package/dist/index.js
CHANGED
|
@@ -80,19 +80,19 @@ import {
|
|
|
80
80
|
Watermark,
|
|
81
81
|
message,
|
|
82
82
|
notification
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-FGGBNWBT.js";
|
|
84
84
|
import {
|
|
85
85
|
MarkdownEditor
|
|
86
86
|
} from "./chunk-TUXNOSCT.js";
|
|
87
87
|
import {
|
|
88
88
|
RichTextContent,
|
|
89
89
|
RichTextEditor
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-YPHUBD4F.js";
|
|
91
91
|
import {
|
|
92
92
|
DatePicker,
|
|
93
93
|
SelectDateRange,
|
|
94
94
|
TimePanel
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-4TTHPU2S.js";
|
|
96
96
|
import {
|
|
97
97
|
Checkbox,
|
|
98
98
|
FloatingScrollbarProvider,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
Tooltip,
|
|
105
105
|
Tree,
|
|
106
106
|
useScrollbarProximity
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-DJTV4X6L.js";
|
|
108
108
|
import {
|
|
109
109
|
Dropdown,
|
|
110
110
|
FILLED_ICON_NAMES,
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
Segmented,
|
|
118
118
|
Steps,
|
|
119
119
|
useOverlayLifecycle
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-X5BFQUFX.js";
|
|
121
121
|
import {
|
|
122
122
|
Button,
|
|
123
123
|
TextArea
|
|
@@ -4378,6 +4378,7 @@ function SelectModalBody({ config, values, disabled, onChange }) {
|
|
|
4378
4378
|
value: values,
|
|
4379
4379
|
onChange,
|
|
4380
4380
|
multiple,
|
|
4381
|
+
groupCheckable: config.groupCheckable,
|
|
4381
4382
|
disabled,
|
|
4382
4383
|
selectedOnly,
|
|
4383
4384
|
showValue: config.showValue,
|
|
@@ -4403,7 +4404,7 @@ function openSelectModal(config) {
|
|
|
4403
4404
|
} });
|
|
4404
4405
|
}
|
|
4405
4406
|
function modalConfig() {
|
|
4406
|
-
const { options, value, mode, showValue, columns, maxHeight, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
|
|
4407
|
+
const { options, value, mode, groupCheckable, showValue, columns, maxHeight, headerExtra, extraValues, searchPlaceholder, filterOption, onSearch, onConfirm, ...modal } = current;
|
|
4407
4408
|
return {
|
|
4408
4409
|
...modal,
|
|
4409
4410
|
title: current.title ?? "\u8BF7\u9009\u62E9",
|
|
@@ -9092,6 +9093,13 @@ function mergeQueryFields(saved, active) {
|
|
|
9092
9093
|
const current = new Set(active.map((item) => item.key));
|
|
9093
9094
|
return [...active, ...saved.filter((item) => !current.has(item.key))];
|
|
9094
9095
|
}
|
|
9096
|
+
function countQueryFieldRows(centers) {
|
|
9097
|
+
const rows = [];
|
|
9098
|
+
for (const top of centers) {
|
|
9099
|
+
if (!rows.some((value) => Math.abs(value - top) <= 0.5)) rows.push(top);
|
|
9100
|
+
}
|
|
9101
|
+
return rows.length;
|
|
9102
|
+
}
|
|
9095
9103
|
|
|
9096
9104
|
// src/components/QueryFormSettings.tsx
|
|
9097
9105
|
import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
@@ -9259,6 +9267,7 @@ import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
|
9259
9267
|
function QueryForm({
|
|
9260
9268
|
fields,
|
|
9261
9269
|
settings,
|
|
9270
|
+
showSettings,
|
|
9262
9271
|
children,
|
|
9263
9272
|
form: providedForm,
|
|
9264
9273
|
onSearch,
|
|
@@ -9333,6 +9342,7 @@ function QueryForm({
|
|
|
9333
9342
|
const actionsRef = useRef20(null);
|
|
9334
9343
|
const toggleRef = useRef20(null);
|
|
9335
9344
|
const [fittingCount, setFittingCount] = useState23(limit);
|
|
9345
|
+
const [settingsRows, setSettingsRows] = useState23(0);
|
|
9336
9346
|
useLayoutEffect6(() => {
|
|
9337
9347
|
const row = rowRef.current;
|
|
9338
9348
|
const actions = actionsRef.current;
|
|
@@ -9340,6 +9350,21 @@ function QueryForm({
|
|
|
9340
9350
|
function measure() {
|
|
9341
9351
|
if (!row || !actions) return;
|
|
9342
9352
|
const gap = parseFloat(getComputedStyle(row).columnGap) || 0;
|
|
9353
|
+
const sourceFields = Array.from(row.querySelectorAll(":scope > .sia-query-form__field"));
|
|
9354
|
+
const sourceHidden = sourceFields.map((field) => field.hidden);
|
|
9355
|
+
const sourceCollapsed = row.classList.contains("is-collapsed");
|
|
9356
|
+
row.classList.remove("is-collapsed");
|
|
9357
|
+
sourceFields.forEach((field) => {
|
|
9358
|
+
field.hidden = false;
|
|
9359
|
+
});
|
|
9360
|
+
if (row.clientWidth > 0) setSettingsRows(countQueryFieldRows(sourceFields.map((field) => {
|
|
9361
|
+
const rect = field.getBoundingClientRect();
|
|
9362
|
+
return rect.top + rect.height / 2;
|
|
9363
|
+
})));
|
|
9364
|
+
sourceFields.forEach((field, index) => {
|
|
9365
|
+
field.hidden = sourceHidden[index];
|
|
9366
|
+
});
|
|
9367
|
+
row.classList.toggle("is-collapsed", sourceCollapsed);
|
|
9343
9368
|
const allFields = Array.from(
|
|
9344
9369
|
row.querySelectorAll(":scope > .sia-query-form__field:not([data-settings-hidden])")
|
|
9345
9370
|
);
|
|
@@ -9566,7 +9591,7 @@ function QueryForm({
|
|
|
9566
9591
|
children: saveText
|
|
9567
9592
|
}
|
|
9568
9593
|
) : null,
|
|
9569
|
-
cloudSettings.control
|
|
9594
|
+
showSettings ?? settingsRows > 2 ? cloudSettings.control : null
|
|
9570
9595
|
] }),
|
|
9571
9596
|
collapsible && entries.length > 0 ? /* @__PURE__ */ jsx27("span", { ref: toggleRef, hidden: !needsCollapse, children: /* @__PURE__ */ jsx27(
|
|
9572
9597
|
Button,
|
|
@@ -1710,7 +1710,8 @@ var placementMap = {
|
|
|
1710
1710
|
topLeft: "top-start",
|
|
1711
1711
|
topRight: "top-end"
|
|
1712
1712
|
};
|
|
1713
|
-
function
|
|
1713
|
+
function DropdownInternal({
|
|
1714
|
+
popupAnchorRef,
|
|
1714
1715
|
menu,
|
|
1715
1716
|
children,
|
|
1716
1717
|
trigger = ["hover"],
|
|
@@ -1923,7 +1924,7 @@ function DropdownRoot({
|
|
|
1923
1924
|
PopupPortal,
|
|
1924
1925
|
{
|
|
1925
1926
|
ref: popupRef,
|
|
1926
|
-
anchorRef: contextPoint ? contextAnchorRef : rootRef,
|
|
1927
|
+
anchorRef: contextPoint ? contextAnchorRef : popupAnchorRef ?? rootRef,
|
|
1927
1928
|
open: mounted,
|
|
1928
1929
|
placement: contextPoint ? "bottom-start" : placementMap[placement],
|
|
1929
1930
|
offset: contextPoint ? 2 : 6,
|
|
@@ -1945,6 +1946,9 @@ function DropdownRoot({
|
|
|
1945
1946
|
}
|
|
1946
1947
|
);
|
|
1947
1948
|
}
|
|
1949
|
+
function DropdownRoot(props) {
|
|
1950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DropdownInternal, { ...props });
|
|
1951
|
+
}
|
|
1948
1952
|
function DropdownButton({
|
|
1949
1953
|
children,
|
|
1950
1954
|
className = "",
|
|
@@ -1956,9 +1960,10 @@ function DropdownButton({
|
|
|
1956
1960
|
trigger = ["click"],
|
|
1957
1961
|
...dropdownProps
|
|
1958
1962
|
}) {
|
|
1959
|
-
|
|
1963
|
+
const groupRef = (0, import_react8.useRef)(null);
|
|
1964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
|
|
1960
1965
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
|
|
1961
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1962
1967
|
Button,
|
|
1963
1968
|
{
|
|
1964
1969
|
...buttonProps,
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -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, m as SelectValue } from './Select-
|
|
4
|
+
import { S as SelectOption, m as SelectValue } from './Select-DQpfyK7I.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, m as SelectValue } from './Select-
|
|
4
|
+
import { S as SelectOption, m as SelectValue } from './Select-DmT9pFRW.js';
|
|
5
5
|
|
|
6
6
|
/** 日期选择附带的时间选择配置。 */
|
|
7
7
|
type DatePickerShowTime = boolean | {
|
|
@@ -3623,7 +3623,8 @@ function SelectionPanel({
|
|
|
3623
3623
|
displayField = "label",
|
|
3624
3624
|
columns = 1,
|
|
3625
3625
|
maxHeight = 250,
|
|
3626
|
-
autoFocusSearch = false
|
|
3626
|
+
autoFocusSearch = false,
|
|
3627
|
+
groupCheckable = false
|
|
3627
3628
|
}) {
|
|
3628
3629
|
const [localSearch, setLocalSearch] = (0, import_react16.useState)("");
|
|
3629
3630
|
const search = searchValue ?? localSearch;
|
|
@@ -3655,7 +3656,7 @@ function SelectionPanel({
|
|
|
3655
3656
|
let top = 0;
|
|
3656
3657
|
for (const [group, items] of groups) {
|
|
3657
3658
|
if (group) {
|
|
3658
|
-
rows2.push({ key: `group-${rows2.length}`, title: group, top, height: 30 });
|
|
3659
|
+
rows2.push({ key: `group-${rows2.length}`, title: group, items, top, height: 30 });
|
|
3659
3660
|
top += 30;
|
|
3660
3661
|
}
|
|
3661
3662
|
for (let index = 0; index < items.length; index += count) {
|
|
@@ -3693,6 +3694,42 @@ function SelectionPanel({
|
|
|
3693
3694
|
const add = enabled.filter((option) => operation === "all" || !selected.has(option.value)).map((option) => option.value);
|
|
3694
3695
|
onChange([...retained, ...add]);
|
|
3695
3696
|
}
|
|
3697
|
+
function groupHeading(title, items) {
|
|
3698
|
+
if (!multiple || !groupCheckable) return title;
|
|
3699
|
+
const editable = items.filter((option) => !option.disabled && option.optionType !== "divider");
|
|
3700
|
+
const all = editable.length > 0 && editable.every((option) => selected.has(option.value));
|
|
3701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3702
|
+
Checkbox2,
|
|
3703
|
+
{
|
|
3704
|
+
checked: all,
|
|
3705
|
+
indeterminate: !all && editable.some((option) => selected.has(option.value)),
|
|
3706
|
+
disabled: disabled || loading || !editable.length,
|
|
3707
|
+
onChange: (checked) => {
|
|
3708
|
+
const next = new Set(value);
|
|
3709
|
+
editable.forEach((option) => checked ? next.add(option.value) : next.delete(option.value));
|
|
3710
|
+
onChange([...next]);
|
|
3711
|
+
},
|
|
3712
|
+
children: title
|
|
3713
|
+
}
|
|
3714
|
+
);
|
|
3715
|
+
}
|
|
3716
|
+
function help(option) {
|
|
3717
|
+
return option.description != null && option.description !== false ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip, { title: option.description, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3718
|
+
"span",
|
|
3719
|
+
{
|
|
3720
|
+
role: "img",
|
|
3721
|
+
"aria-label": "\u9009\u9879\u8BF4\u660E",
|
|
3722
|
+
tabIndex: 0,
|
|
3723
|
+
onClick: (event) => {
|
|
3724
|
+
event.preventDefault();
|
|
3725
|
+
event.stopPropagation();
|
|
3726
|
+
},
|
|
3727
|
+
onKeyDown: (event) => event.stopPropagation(),
|
|
3728
|
+
style: { display: "inline-flex", marginInlineStart: 4 },
|
|
3729
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { name: "help-circle", size: 14 })
|
|
3730
|
+
}
|
|
3731
|
+
) }) : null;
|
|
3732
|
+
}
|
|
3696
3733
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sia-selection-panel", children: [
|
|
3697
3734
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FloatingScrollbarProvider, { targetRef: listRef }),
|
|
3698
3735
|
showSearch && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -3746,7 +3783,7 @@ function SelectionPanel({
|
|
|
3746
3783
|
const next = event.key === "Home" ? 0 : event.key === "End" ? enabled.length - 1 : Math.max(0, Math.min(enabled.length - 1, index + (event.key === "ArrowDown" ? 1 : -1)));
|
|
3747
3784
|
const option = enabled[next];
|
|
3748
3785
|
setActive(option.value);
|
|
3749
|
-
const row = rows.find((row2) => row2.items?.includes(option));
|
|
3786
|
+
const row = rows.find((row2) => row2.title === void 0 && row2.items?.includes(option));
|
|
3750
3787
|
if (row && listRef.current) {
|
|
3751
3788
|
listRef.current.scrollTop = Math.max(0, row.top - maxHeight / 2);
|
|
3752
3789
|
setScrollTop(listRef.current.scrollTop);
|
|
@@ -3761,7 +3798,7 @@ function SelectionPanel({
|
|
|
3761
3798
|
{
|
|
3762
3799
|
className: row.title !== void 0 ? "sia-selection-panel__group" : "sia-selection-panel__row",
|
|
3763
3800
|
style: { position: "absolute", top: row.top, height: row.height, width: "100%", gridTemplateColumns: `repeat(${count}, minmax(0, 1fr))` },
|
|
3764
|
-
children: row.title ?? row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3801
|
+
children: row.title !== void 0 ? groupHeading(row.title, row.items ?? []) : row.items?.map((option, index) => option.optionType === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "separator", className: "sia-selection-panel__divider" }, `divider-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Tooltip, { title: option.disabled ? option.disabledTip : void 0, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3765
3802
|
"div",
|
|
3766
3803
|
{
|
|
3767
3804
|
role: "option",
|
|
@@ -3778,10 +3815,16 @@ function SelectionPanel({
|
|
|
3778
3815
|
if (!event.target.closest(".sia-checkbox")) toggle(option);
|
|
3779
3816
|
},
|
|
3780
3817
|
children: multiple ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Checkbox2, { checked: selected.has(option.value), disabled: disabled || loading || option.disabled, tabIndex: -1, onChange: () => toggle(option), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
3781
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
3819
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
3820
|
+
help(option)
|
|
3821
|
+
] }),
|
|
3782
3822
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: String(option.value) })
|
|
3783
3823
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "sia-selection-panel__text", children: [
|
|
3784
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
3824
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "sia-selection-panel__label", children: [
|
|
3825
|
+
showValue || displayField === "label" ? option.label : String(option.value),
|
|
3826
|
+
help(option)
|
|
3827
|
+
] }),
|
|
3785
3828
|
showValue && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: String(option.value) })
|
|
3786
3829
|
] })
|
|
3787
3830
|
}
|
|
@@ -4302,6 +4345,7 @@ var Select = (0, import_react18.forwardRef)(function Select2({
|
|
|
4302
4345
|
value: modalValues,
|
|
4303
4346
|
onChange: setModalValues,
|
|
4304
4347
|
multiple,
|
|
4348
|
+
groupCheckable: modalConfig?.groupCheckable,
|
|
4305
4349
|
allowDeselect: allowClear,
|
|
4306
4350
|
selectedOnly,
|
|
4307
4351
|
showValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-BT71tp7y.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-Bx4B28Wh.cjs';
|
|
4
|
-
import './Select-
|
|
4
|
+
import './Select-DQpfyK7I.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-
|
|
1
|
+
export { S as SelectDateRange, i as SelectDateRangeProps, j as SelectDateRangeValue } from './select-date-range-CFGzoyLs.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './shared-Bx4B28Wh.js';
|
|
4
|
-
import './Select-
|
|
4
|
+
import './Select-DmT9pFRW.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectDateRange
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-4TTHPU2S.js";
|
|
4
|
+
import "./chunk-DJTV4X6L.js";
|
|
5
|
+
import "./chunk-X5BFQUFX.js";
|
|
6
6
|
import "./chunk-SJFT5OSX.js";
|
|
7
7
|
import "./chunk-PUZWLIIJ.js";
|
|
8
8
|
export {
|