@sia.soul/sia-react-ui 0.1.53 → 0.1.55
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/{chunk-MFR2FYQA.js → chunk-5OGT4AAS.js} +1 -1
- package/dist/{chunk-ZX2YNHQJ.js → chunk-7CAQPLKC.js} +1 -1
- package/dist/{chunk-PJT676UK.js → chunk-F4XMRO6G.js} +11 -2
- package/dist/{core-DtGYdU61.d.cts → core-1iaQY0Is.d.cts} +1 -1
- package/dist/{core-DXJ4b0lT.d.ts → core-DoFob1fF.d.ts} +1 -1
- package/dist/core.cjs +11 -2
- package/dist/core.css +50 -0
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +2 -2
- package/dist/index.cjs +51 -29
- package/dist/index.css +50 -0
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +43 -30
- package/dist/select-date-range.cjs +11 -2
- package/dist/select-date-range.js +2 -2
- package/package.json +1 -1
|
@@ -253,6 +253,11 @@ function Floating({
|
|
|
253
253
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
254
254
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
255
255
|
const [position, setPosition] = useState();
|
|
256
|
+
const [portalContainer, setPortalContainer] = useState(null);
|
|
257
|
+
useLayoutEffect(() => {
|
|
258
|
+
if (!visible) return;
|
|
259
|
+
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
260
|
+
});
|
|
256
261
|
const setVisibleRef = useRef2(setVisible);
|
|
257
262
|
setVisibleRef.current = setVisible;
|
|
258
263
|
const closeSelfRef = useRef2();
|
|
@@ -315,6 +320,8 @@ function Floating({
|
|
|
315
320
|
update();
|
|
316
321
|
window.addEventListener("resize", update);
|
|
317
322
|
window.addEventListener("scroll", update, true);
|
|
323
|
+
window.addEventListener("animationend", update, true);
|
|
324
|
+
window.addEventListener("transitionend", update, true);
|
|
318
325
|
const observer = new ResizeObserver(update);
|
|
319
326
|
if (rootRef.current) observer.observe(rootRef.current);
|
|
320
327
|
const anchor = getAnchor();
|
|
@@ -323,9 +330,11 @@ function Floating({
|
|
|
323
330
|
return () => {
|
|
324
331
|
window.removeEventListener("resize", update);
|
|
325
332
|
window.removeEventListener("scroll", update, true);
|
|
333
|
+
window.removeEventListener("animationend", update, true);
|
|
334
|
+
window.removeEventListener("transitionend", update, true);
|
|
326
335
|
observer.disconnect();
|
|
327
336
|
};
|
|
328
|
-
}, [children, content, placement, visible, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
337
|
+
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
329
338
|
useEffect2(() => () => {
|
|
330
339
|
clearTimers();
|
|
331
340
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
@@ -380,7 +389,7 @@ function Floating({
|
|
|
380
389
|
]
|
|
381
390
|
}
|
|
382
391
|
),
|
|
383
|
-
document.body
|
|
392
|
+
portalContainer ?? document.body
|
|
384
393
|
) : null;
|
|
385
394
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
386
395
|
/* @__PURE__ */ jsx2("span", { ref: rootRef, className: `sia-floating ${className}`.trim(), children: child }),
|
|
@@ -877,7 +877,7 @@ declare const Dropdown: typeof DropdownRoot & {
|
|
|
877
877
|
type FloatingPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
878
878
|
/** 触发浮层显示的交互方式。 */
|
|
879
879
|
type FloatingTrigger = "hover" | "focus" | "click";
|
|
880
|
-
/**
|
|
880
|
+
/** 文字提示的属性配置;弹框或抽屉内的提示遵循所属容器的层级,不覆盖后续打开的子弹层。 */
|
|
881
881
|
interface TooltipProps {
|
|
882
882
|
/** 标题内容,可传入文本或 React 节点。 */
|
|
883
883
|
title?: ReactNode;
|
|
@@ -877,7 +877,7 @@ declare const Dropdown: typeof DropdownRoot & {
|
|
|
877
877
|
type FloatingPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
878
878
|
/** 触发浮层显示的交互方式。 */
|
|
879
879
|
type FloatingTrigger = "hover" | "focus" | "click";
|
|
880
|
-
/**
|
|
880
|
+
/** 文字提示的属性配置;弹框或抽屉内的提示遵循所属容器的层级,不覆盖后续打开的子弹层。 */
|
|
881
881
|
interface TooltipProps {
|
|
882
882
|
/** 标题内容,可传入文本或 React 节点。 */
|
|
883
883
|
title?: ReactNode;
|
package/dist/core.cjs
CHANGED
|
@@ -2355,6 +2355,11 @@ function Floating({
|
|
|
2355
2355
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
2356
2356
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
2357
2357
|
const [position, setPosition] = (0, import_react13.useState)();
|
|
2358
|
+
const [portalContainer, setPortalContainer] = (0, import_react13.useState)(null);
|
|
2359
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
2360
|
+
if (!visible) return;
|
|
2361
|
+
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
2362
|
+
});
|
|
2358
2363
|
const setVisibleRef = (0, import_react13.useRef)(setVisible);
|
|
2359
2364
|
setVisibleRef.current = setVisible;
|
|
2360
2365
|
const closeSelfRef = (0, import_react13.useRef)();
|
|
@@ -2417,6 +2422,8 @@ function Floating({
|
|
|
2417
2422
|
update();
|
|
2418
2423
|
window.addEventListener("resize", update);
|
|
2419
2424
|
window.addEventListener("scroll", update, true);
|
|
2425
|
+
window.addEventListener("animationend", update, true);
|
|
2426
|
+
window.addEventListener("transitionend", update, true);
|
|
2420
2427
|
const observer = new ResizeObserver(update);
|
|
2421
2428
|
if (rootRef.current) observer.observe(rootRef.current);
|
|
2422
2429
|
const anchor = getAnchor();
|
|
@@ -2425,9 +2432,11 @@ function Floating({
|
|
|
2425
2432
|
return () => {
|
|
2426
2433
|
window.removeEventListener("resize", update);
|
|
2427
2434
|
window.removeEventListener("scroll", update, true);
|
|
2435
|
+
window.removeEventListener("animationend", update, true);
|
|
2436
|
+
window.removeEventListener("transitionend", update, true);
|
|
2428
2437
|
observer.disconnect();
|
|
2429
2438
|
};
|
|
2430
|
-
}, [children, content, placement, visible, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
2439
|
+
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
2431
2440
|
(0, import_react13.useEffect)(() => () => {
|
|
2432
2441
|
clearTimers();
|
|
2433
2442
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
@@ -2482,7 +2491,7 @@ function Floating({
|
|
|
2482
2491
|
]
|
|
2483
2492
|
}
|
|
2484
2493
|
),
|
|
2485
|
-
document.body
|
|
2494
|
+
portalContainer ?? document.body
|
|
2486
2495
|
) : null;
|
|
2487
2496
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
2488
2497
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { ref: rootRef, className: `sia-floating ${className}`.trim(), children: child }),
|
package/dist/core.css
CHANGED
|
@@ -4176,6 +4176,56 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
4176
4176
|
align-items: center;
|
|
4177
4177
|
min-width: 0;
|
|
4178
4178
|
}
|
|
4179
|
+
.sia-table__cell--tree-lines {
|
|
4180
|
+
padding-block: 0;
|
|
4181
|
+
}
|
|
4182
|
+
.sia-table__cell--tree-lines > .sia-table__cell-content {
|
|
4183
|
+
position: absolute;
|
|
4184
|
+
inset: 0 12px;
|
|
4185
|
+
}
|
|
4186
|
+
.sia-table__tree-cell--lines {
|
|
4187
|
+
height: 100%;
|
|
4188
|
+
}
|
|
4189
|
+
.sia-table__tree-guide {
|
|
4190
|
+
position: relative;
|
|
4191
|
+
align-self: stretch;
|
|
4192
|
+
flex: 0 0 18px;
|
|
4193
|
+
width: 18px;
|
|
4194
|
+
}
|
|
4195
|
+
.sia-table__tree-guide--branch::before,
|
|
4196
|
+
.sia-table__tree-guide--continued::before {
|
|
4197
|
+
position: absolute;
|
|
4198
|
+
content: "";
|
|
4199
|
+
left: 10px;
|
|
4200
|
+
top: 0;
|
|
4201
|
+
height: 50%;
|
|
4202
|
+
border-left: 1px solid var(--sia-color-border);
|
|
4203
|
+
}
|
|
4204
|
+
.sia-table__tree-guide--continued::before {
|
|
4205
|
+
height: 100%;
|
|
4206
|
+
}
|
|
4207
|
+
.sia-table__tree-guide--branch::after {
|
|
4208
|
+
position: absolute;
|
|
4209
|
+
content: "";
|
|
4210
|
+
left: 10px;
|
|
4211
|
+
right: 0;
|
|
4212
|
+
top: 50%;
|
|
4213
|
+
border-top: 1px solid var(--sia-color-border);
|
|
4214
|
+
}
|
|
4215
|
+
.sia-table__tree-node {
|
|
4216
|
+
position: relative;
|
|
4217
|
+
align-self: stretch;
|
|
4218
|
+
display: inline-flex;
|
|
4219
|
+
align-items: center;
|
|
4220
|
+
flex: 0 0 20px;
|
|
4221
|
+
}
|
|
4222
|
+
.sia-table__tree-stem {
|
|
4223
|
+
position: absolute;
|
|
4224
|
+
left: 10px;
|
|
4225
|
+
top: calc(50% + 10px);
|
|
4226
|
+
bottom: 0;
|
|
4227
|
+
border-left: 1px solid var(--sia-color-border);
|
|
4228
|
+
}
|
|
4179
4229
|
.sia-table__tree-toggle,
|
|
4180
4230
|
.sia-table__tree-placeholder {
|
|
4181
4231
|
display: inline-grid;
|
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-
|
|
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-1iaQY0Is.cjs';
|
|
2
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-YJbT-MF1.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-
|
|
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-DoFob1fF.js';
|
|
2
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-CCrPqULn.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './shared-Bx4B28Wh.js';
|
package/dist/core.js
CHANGED
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
Upload,
|
|
12
12
|
message
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5OGT4AAS.js";
|
|
14
14
|
import "./chunk-SMCYEPBL.js";
|
|
15
15
|
import {
|
|
16
16
|
Modal,
|
|
17
17
|
Select
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-F4XMRO6G.js";
|
|
19
19
|
import {
|
|
20
20
|
Icon,
|
|
21
21
|
Input,
|
package/dist/index.cjs
CHANGED
|
@@ -2639,6 +2639,11 @@ function Floating({
|
|
|
2639
2639
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
2640
2640
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
2641
2641
|
const [position, setPosition] = (0, import_react14.useState)();
|
|
2642
|
+
const [portalContainer, setPortalContainer] = (0, import_react14.useState)(null);
|
|
2643
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
2644
|
+
if (!visible) return;
|
|
2645
|
+
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
2646
|
+
});
|
|
2642
2647
|
const setVisibleRef = (0, import_react14.useRef)(setVisible);
|
|
2643
2648
|
setVisibleRef.current = setVisible;
|
|
2644
2649
|
const closeSelfRef = (0, import_react14.useRef)();
|
|
@@ -2701,6 +2706,8 @@ function Floating({
|
|
|
2701
2706
|
update();
|
|
2702
2707
|
window.addEventListener("resize", update);
|
|
2703
2708
|
window.addEventListener("scroll", update, true);
|
|
2709
|
+
window.addEventListener("animationend", update, true);
|
|
2710
|
+
window.addEventListener("transitionend", update, true);
|
|
2704
2711
|
const observer = new ResizeObserver(update);
|
|
2705
2712
|
if (rootRef.current) observer.observe(rootRef.current);
|
|
2706
2713
|
const anchor = getAnchor();
|
|
@@ -2709,9 +2716,11 @@ function Floating({
|
|
|
2709
2716
|
return () => {
|
|
2710
2717
|
window.removeEventListener("resize", update);
|
|
2711
2718
|
window.removeEventListener("scroll", update, true);
|
|
2719
|
+
window.removeEventListener("animationend", update, true);
|
|
2720
|
+
window.removeEventListener("transitionend", update, true);
|
|
2712
2721
|
observer.disconnect();
|
|
2713
2722
|
};
|
|
2714
|
-
}, [children, content, placement, visible, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
2723
|
+
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
2715
2724
|
(0, import_react14.useEffect)(() => () => {
|
|
2716
2725
|
clearTimers();
|
|
2717
2726
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
@@ -2766,7 +2775,7 @@ function Floating({
|
|
|
2766
2775
|
]
|
|
2767
2776
|
}
|
|
2768
2777
|
),
|
|
2769
|
-
document.body
|
|
2778
|
+
portalContainer ?? document.body
|
|
2770
2779
|
) : null;
|
|
2771
2780
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2772
2781
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref: rootRef, className: `sia-floating ${className}`.trim(), children: child }),
|
|
@@ -13612,14 +13621,15 @@ function createTreePlugin(options = {}) {
|
|
|
13612
13621
|
transformRows(rows, context) {
|
|
13613
13622
|
if (options.ignoreChildrenColumn ?? true) return rows;
|
|
13614
13623
|
const result = [];
|
|
13615
|
-
const walk = (items, depth) => {
|
|
13616
|
-
for (const row of items) {
|
|
13624
|
+
const walk = (items, depth, guides) => {
|
|
13625
|
+
for (const [rowIndex, row] of items.entries()) {
|
|
13626
|
+
const hasNextSibling = rowIndex < items.length - 1;
|
|
13617
13627
|
const children = row.record[childKey];
|
|
13618
13628
|
const hasChildren = Array.isArray(children) && children.length > 0 && (options.canExpand?.(row.record) ?? true);
|
|
13619
13629
|
result.push({
|
|
13620
13630
|
...row,
|
|
13621
13631
|
depth,
|
|
13622
|
-
meta: { ...row.meta, treeHasChildren: hasChildren }
|
|
13632
|
+
meta: { ...row.meta, treeHasChildren: hasChildren, treeGuides: guides, treeHasNextSibling: hasNextSibling }
|
|
13623
13633
|
});
|
|
13624
13634
|
if (hasChildren && current(context).includes(row.key)) {
|
|
13625
13635
|
walk(
|
|
@@ -13630,12 +13640,13 @@ function createTreePlugin(options = {}) {
|
|
|
13630
13640
|
depth: depth + 1,
|
|
13631
13641
|
meta: {}
|
|
13632
13642
|
})),
|
|
13633
|
-
depth + 1
|
|
13643
|
+
depth + 1,
|
|
13644
|
+
depth > 0 ? [...guides, hasNextSibling] : guides
|
|
13634
13645
|
);
|
|
13635
13646
|
}
|
|
13636
13647
|
}
|
|
13637
13648
|
};
|
|
13638
|
-
walk(rows, 0);
|
|
13649
|
+
walk(rows, 0, []);
|
|
13639
13650
|
return result;
|
|
13640
13651
|
},
|
|
13641
13652
|
transformColumns(columns, context) {
|
|
@@ -13647,32 +13658,40 @@ function createTreePlugin(options = {}) {
|
|
|
13647
13658
|
const previousRender = column.render;
|
|
13648
13659
|
return {
|
|
13649
13660
|
...column,
|
|
13661
|
+
...options.showLine ? { ellipsis: false, meta: { ...column.meta, treeLines: true } } : {},
|
|
13650
13662
|
render: (value, record, index, info) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
13651
13663
|
"span",
|
|
13652
13664
|
{
|
|
13653
|
-
className: "sia-table__tree-cell"
|
|
13654
|
-
style: { paddingLeft: info.row.depth * 18 },
|
|
13665
|
+
className: `sia-table__tree-cell${options.showLine ? " sia-table__tree-cell--lines" : ""}`,
|
|
13666
|
+
style: options.showLine ? void 0 : { paddingLeft: info.row.depth * 18 },
|
|
13655
13667
|
children: [
|
|
13656
|
-
info.row.
|
|
13657
|
-
"
|
|
13658
|
-
{
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
{
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
}
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13668
|
+
options.showLine && info.row.depth > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
13669
|
+
info.row.meta.treeGuides.map((continued, level) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", className: `sia-table__tree-guide${continued ? " sia-table__tree-guide--continued" : ""}` }, level)),
|
|
13670
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", className: `sia-table__tree-guide sia-table__tree-guide--branch${info.row.meta.treeHasNextSibling ? " sia-table__tree-guide--continued" : ""}` })
|
|
13671
|
+
] }),
|
|
13672
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: options.showLine ? "sia-table__tree-node" : void 0, style: options.showLine ? void 0 : { display: "contents" }, children: [
|
|
13673
|
+
options.showLine && !!info.row.meta.treeHasChildren && current(context).includes(info.row.key) && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", className: "sia-table__tree-stem" }),
|
|
13674
|
+
info.row.meta.treeHasChildren ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
13675
|
+
"button",
|
|
13676
|
+
{
|
|
13677
|
+
type: "button",
|
|
13678
|
+
className: "sia-table__tree-toggle",
|
|
13679
|
+
"aria-label": current(context).includes(info.row.key) ? "\u6536\u8D77\u5B50\u8282\u70B9" : "\u5C55\u5F00\u5B50\u8282\u70B9",
|
|
13680
|
+
"aria-expanded": current(context).includes(info.row.key),
|
|
13681
|
+
onClick: (event) => {
|
|
13682
|
+
event.stopPropagation();
|
|
13683
|
+
toggle(info.row.key, context);
|
|
13684
|
+
},
|
|
13685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
13686
|
+
Icon,
|
|
13687
|
+
{
|
|
13688
|
+
name: current(context).includes(info.row.key) ? "chevron-down" : "chevron-right",
|
|
13689
|
+
size: 13
|
|
13690
|
+
}
|
|
13691
|
+
)
|
|
13692
|
+
}
|
|
13693
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "sia-table__tree-placeholder" })
|
|
13694
|
+
] }),
|
|
13676
13695
|
previousRender ? previousRender(value, record, index, info) : value
|
|
13677
13696
|
]
|
|
13678
13697
|
}
|
|
@@ -13680,6 +13699,9 @@ function createTreePlugin(options = {}) {
|
|
|
13680
13699
|
};
|
|
13681
13700
|
});
|
|
13682
13701
|
},
|
|
13702
|
+
getCellProps(_row, column) {
|
|
13703
|
+
return column.meta?.treeLines ? { className: "sia-table__cell--tree-lines" } : void 0;
|
|
13704
|
+
},
|
|
13683
13705
|
getApi: (context) => ({
|
|
13684
13706
|
getExpandedKeys: () => current(context),
|
|
13685
13707
|
setExpandedKeys: (keys) => setKeys(keys, context),
|
package/dist/index.css
CHANGED
|
@@ -4176,6 +4176,56 @@ fieldset:disabled .sia-input-number__floating-placeholder {
|
|
|
4176
4176
|
align-items: center;
|
|
4177
4177
|
min-width: 0;
|
|
4178
4178
|
}
|
|
4179
|
+
.sia-table__cell--tree-lines {
|
|
4180
|
+
padding-block: 0;
|
|
4181
|
+
}
|
|
4182
|
+
.sia-table__cell--tree-lines > .sia-table__cell-content {
|
|
4183
|
+
position: absolute;
|
|
4184
|
+
inset: 0 12px;
|
|
4185
|
+
}
|
|
4186
|
+
.sia-table__tree-cell--lines {
|
|
4187
|
+
height: 100%;
|
|
4188
|
+
}
|
|
4189
|
+
.sia-table__tree-guide {
|
|
4190
|
+
position: relative;
|
|
4191
|
+
align-self: stretch;
|
|
4192
|
+
flex: 0 0 18px;
|
|
4193
|
+
width: 18px;
|
|
4194
|
+
}
|
|
4195
|
+
.sia-table__tree-guide--branch::before,
|
|
4196
|
+
.sia-table__tree-guide--continued::before {
|
|
4197
|
+
position: absolute;
|
|
4198
|
+
content: "";
|
|
4199
|
+
left: 10px;
|
|
4200
|
+
top: 0;
|
|
4201
|
+
height: 50%;
|
|
4202
|
+
border-left: 1px solid var(--sia-color-border);
|
|
4203
|
+
}
|
|
4204
|
+
.sia-table__tree-guide--continued::before {
|
|
4205
|
+
height: 100%;
|
|
4206
|
+
}
|
|
4207
|
+
.sia-table__tree-guide--branch::after {
|
|
4208
|
+
position: absolute;
|
|
4209
|
+
content: "";
|
|
4210
|
+
left: 10px;
|
|
4211
|
+
right: 0;
|
|
4212
|
+
top: 50%;
|
|
4213
|
+
border-top: 1px solid var(--sia-color-border);
|
|
4214
|
+
}
|
|
4215
|
+
.sia-table__tree-node {
|
|
4216
|
+
position: relative;
|
|
4217
|
+
align-self: stretch;
|
|
4218
|
+
display: inline-flex;
|
|
4219
|
+
align-items: center;
|
|
4220
|
+
flex: 0 0 20px;
|
|
4221
|
+
}
|
|
4222
|
+
.sia-table__tree-stem {
|
|
4223
|
+
position: absolute;
|
|
4224
|
+
left: 10px;
|
|
4225
|
+
top: calc(50% + 10px);
|
|
4226
|
+
bottom: 0;
|
|
4227
|
+
border-left: 1px solid var(--sia-color-border);
|
|
4228
|
+
}
|
|
4179
4229
|
.sia-table__tree-toggle,
|
|
4180
4230
|
.sia-table__tree-placeholder {
|
|
4181
4231
|
display: inline-grid;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-1iaQY0Is.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-1iaQY0Is.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';
|
|
@@ -2587,6 +2587,8 @@ interface TableIndexPluginOptions {
|
|
|
2587
2587
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2588
2588
|
/** TableTree的插件配置。 */
|
|
2589
2589
|
interface TableTreePluginOptions<T> {
|
|
2590
|
+
/** 显示树形层级连接线;仅在 ignoreChildrenColumn=false 时生效,默认 false。 */
|
|
2591
|
+
showLine?: boolean;
|
|
2590
2592
|
/** 行数据中存放子行的字段名。 */
|
|
2591
2593
|
childrenColumnName?: string;
|
|
2592
2594
|
/** 是否忽略数据内的子行字段。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-DoFob1fF.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-DoFob1fF.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';
|
|
@@ -2587,6 +2587,8 @@ interface TableIndexPluginOptions {
|
|
|
2587
2587
|
declare function createIndexPlugin<T extends Record<string, unknown>>(options?: TableIndexPluginOptions): TablePlugin<T, undefined>;
|
|
2588
2588
|
/** TableTree的插件配置。 */
|
|
2589
2589
|
interface TableTreePluginOptions<T> {
|
|
2590
|
+
/** 显示树形层级连接线;仅在 ignoreChildrenColumn=false 时生效,默认 false。 */
|
|
2591
|
+
showLine?: boolean;
|
|
2590
2592
|
/** 行数据中存放子行的字段名。 */
|
|
2591
2593
|
childrenColumnName?: string;
|
|
2592
2594
|
/** 是否忽略数据内的子行字段。 */
|
package/dist/index.js
CHANGED
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
Watermark,
|
|
81
81
|
message,
|
|
82
82
|
notification
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-5OGT4AAS.js";
|
|
84
84
|
import {
|
|
85
85
|
TextArea
|
|
86
86
|
} from "./chunk-SMCYEPBL.js";
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-7CAQPLKC.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
FloatingScrollbarProvider,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
Tree,
|
|
111
111
|
useOverlayLifecycle,
|
|
112
112
|
useScrollbarProximity
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-F4XMRO6G.js";
|
|
114
114
|
import {
|
|
115
115
|
Dropdown,
|
|
116
116
|
FILLED_ICON_NAMES,
|
|
@@ -6359,14 +6359,15 @@ function createTreePlugin(options = {}) {
|
|
|
6359
6359
|
transformRows(rows, context) {
|
|
6360
6360
|
if (options.ignoreChildrenColumn ?? true) return rows;
|
|
6361
6361
|
const result = [];
|
|
6362
|
-
const walk = (items, depth) => {
|
|
6363
|
-
for (const row of items) {
|
|
6362
|
+
const walk = (items, depth, guides) => {
|
|
6363
|
+
for (const [rowIndex, row] of items.entries()) {
|
|
6364
|
+
const hasNextSibling = rowIndex < items.length - 1;
|
|
6364
6365
|
const children = row.record[childKey];
|
|
6365
6366
|
const hasChildren = Array.isArray(children) && children.length > 0 && (options.canExpand?.(row.record) ?? true);
|
|
6366
6367
|
result.push({
|
|
6367
6368
|
...row,
|
|
6368
6369
|
depth,
|
|
6369
|
-
meta: { ...row.meta, treeHasChildren: hasChildren }
|
|
6370
|
+
meta: { ...row.meta, treeHasChildren: hasChildren, treeGuides: guides, treeHasNextSibling: hasNextSibling }
|
|
6370
6371
|
});
|
|
6371
6372
|
if (hasChildren && current(context).includes(row.key)) {
|
|
6372
6373
|
walk(
|
|
@@ -6377,12 +6378,13 @@ function createTreePlugin(options = {}) {
|
|
|
6377
6378
|
depth: depth + 1,
|
|
6378
6379
|
meta: {}
|
|
6379
6380
|
})),
|
|
6380
|
-
depth + 1
|
|
6381
|
+
depth + 1,
|
|
6382
|
+
depth > 0 ? [...guides, hasNextSibling] : guides
|
|
6381
6383
|
);
|
|
6382
6384
|
}
|
|
6383
6385
|
}
|
|
6384
6386
|
};
|
|
6385
|
-
walk(rows, 0);
|
|
6387
|
+
walk(rows, 0, []);
|
|
6386
6388
|
return result;
|
|
6387
6389
|
},
|
|
6388
6390
|
transformColumns(columns, context) {
|
|
@@ -6394,32 +6396,40 @@ function createTreePlugin(options = {}) {
|
|
|
6394
6396
|
const previousRender = column.render;
|
|
6395
6397
|
return {
|
|
6396
6398
|
...column,
|
|
6399
|
+
...options.showLine ? { ellipsis: false, meta: { ...column.meta, treeLines: true } } : {},
|
|
6397
6400
|
render: (value, record, index, info) => /* @__PURE__ */ jsxs20(
|
|
6398
6401
|
"span",
|
|
6399
6402
|
{
|
|
6400
|
-
className: "sia-table__tree-cell"
|
|
6401
|
-
style: { paddingLeft: info.row.depth * 18 },
|
|
6403
|
+
className: `sia-table__tree-cell${options.showLine ? " sia-table__tree-cell--lines" : ""}`,
|
|
6404
|
+
style: options.showLine ? void 0 : { paddingLeft: info.row.depth * 18 },
|
|
6402
6405
|
children: [
|
|
6403
|
-
info.row.
|
|
6404
|
-
"
|
|
6405
|
-
{
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
{
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
}
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6406
|
+
options.showLine && info.row.depth > 0 && /* @__PURE__ */ jsxs20(Fragment7, { children: [
|
|
6407
|
+
info.row.meta.treeGuides.map((continued, level) => /* @__PURE__ */ jsx22("span", { "aria-hidden": "true", className: `sia-table__tree-guide${continued ? " sia-table__tree-guide--continued" : ""}` }, level)),
|
|
6408
|
+
/* @__PURE__ */ jsx22("span", { "aria-hidden": "true", className: `sia-table__tree-guide sia-table__tree-guide--branch${info.row.meta.treeHasNextSibling ? " sia-table__tree-guide--continued" : ""}` })
|
|
6409
|
+
] }),
|
|
6410
|
+
/* @__PURE__ */ jsxs20("span", { className: options.showLine ? "sia-table__tree-node" : void 0, style: options.showLine ? void 0 : { display: "contents" }, children: [
|
|
6411
|
+
options.showLine && !!info.row.meta.treeHasChildren && current(context).includes(info.row.key) && /* @__PURE__ */ jsx22("span", { "aria-hidden": "true", className: "sia-table__tree-stem" }),
|
|
6412
|
+
info.row.meta.treeHasChildren ? /* @__PURE__ */ jsx22(
|
|
6413
|
+
"button",
|
|
6414
|
+
{
|
|
6415
|
+
type: "button",
|
|
6416
|
+
className: "sia-table__tree-toggle",
|
|
6417
|
+
"aria-label": current(context).includes(info.row.key) ? "\u6536\u8D77\u5B50\u8282\u70B9" : "\u5C55\u5F00\u5B50\u8282\u70B9",
|
|
6418
|
+
"aria-expanded": current(context).includes(info.row.key),
|
|
6419
|
+
onClick: (event) => {
|
|
6420
|
+
event.stopPropagation();
|
|
6421
|
+
toggle(info.row.key, context);
|
|
6422
|
+
},
|
|
6423
|
+
children: /* @__PURE__ */ jsx22(
|
|
6424
|
+
Icon,
|
|
6425
|
+
{
|
|
6426
|
+
name: current(context).includes(info.row.key) ? "chevron-down" : "chevron-right",
|
|
6427
|
+
size: 13
|
|
6428
|
+
}
|
|
6429
|
+
)
|
|
6430
|
+
}
|
|
6431
|
+
) : /* @__PURE__ */ jsx22("span", { className: "sia-table__tree-placeholder" })
|
|
6432
|
+
] }),
|
|
6423
6433
|
previousRender ? previousRender(value, record, index, info) : value
|
|
6424
6434
|
]
|
|
6425
6435
|
}
|
|
@@ -6427,6 +6437,9 @@ function createTreePlugin(options = {}) {
|
|
|
6427
6437
|
};
|
|
6428
6438
|
});
|
|
6429
6439
|
},
|
|
6440
|
+
getCellProps(_row, column) {
|
|
6441
|
+
return column.meta?.treeLines ? { className: "sia-table__cell--tree-lines" } : void 0;
|
|
6442
|
+
},
|
|
6430
6443
|
getApi: (context) => ({
|
|
6431
6444
|
getExpandedKeys: () => current(context),
|
|
6432
6445
|
setExpandedKeys: (keys) => setKeys(keys, context),
|
|
@@ -3010,6 +3010,11 @@ function Floating({
|
|
|
3010
3010
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
3011
3011
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
3012
3012
|
const [position, setPosition] = (0, import_react13.useState)();
|
|
3013
|
+
const [portalContainer, setPortalContainer] = (0, import_react13.useState)(null);
|
|
3014
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
3015
|
+
if (!visible) return;
|
|
3016
|
+
setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
|
|
3017
|
+
});
|
|
3013
3018
|
const setVisibleRef = (0, import_react13.useRef)(setVisible);
|
|
3014
3019
|
setVisibleRef.current = setVisible;
|
|
3015
3020
|
const closeSelfRef = (0, import_react13.useRef)();
|
|
@@ -3072,6 +3077,8 @@ function Floating({
|
|
|
3072
3077
|
update();
|
|
3073
3078
|
window.addEventListener("resize", update);
|
|
3074
3079
|
window.addEventListener("scroll", update, true);
|
|
3080
|
+
window.addEventListener("animationend", update, true);
|
|
3081
|
+
window.addEventListener("transitionend", update, true);
|
|
3075
3082
|
const observer = new ResizeObserver(update);
|
|
3076
3083
|
if (rootRef.current) observer.observe(rootRef.current);
|
|
3077
3084
|
const anchor = getAnchor();
|
|
@@ -3080,9 +3087,11 @@ function Floating({
|
|
|
3080
3087
|
return () => {
|
|
3081
3088
|
window.removeEventListener("resize", update);
|
|
3082
3089
|
window.removeEventListener("scroll", update, true);
|
|
3090
|
+
window.removeEventListener("animationend", update, true);
|
|
3091
|
+
window.removeEventListener("transitionend", update, true);
|
|
3083
3092
|
observer.disconnect();
|
|
3084
3093
|
};
|
|
3085
|
-
}, [children, content, placement, visible, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
3094
|
+
}, [children, content, placement, visible, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
|
|
3086
3095
|
(0, import_react13.useEffect)(() => () => {
|
|
3087
3096
|
clearTimers();
|
|
3088
3097
|
if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
|
|
@@ -3137,7 +3146,7 @@ function Floating({
|
|
|
3137
3146
|
]
|
|
3138
3147
|
}
|
|
3139
3148
|
),
|
|
3140
|
-
document.body
|
|
3149
|
+
portalContainer ?? document.body
|
|
3141
3150
|
) : null;
|
|
3142
3151
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
3143
3152
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { ref: rootRef, className: `sia-floating ${className}`.trim(), children: child }),
|