react-public-components 1.1.0 → 1.1.2
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/index.cjs +157 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +157 -114
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -217,7 +217,6 @@ var CollapseBox_default = CollapsibleBox;
|
|
|
217
217
|
var import_react2 = __toESM(require("react"), 1);
|
|
218
218
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
219
219
|
var DRAGGER_SIZE = 8;
|
|
220
|
-
var MIN_PANEL_SIZE = 0;
|
|
221
220
|
var SplitterPanel = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
|
|
222
221
|
var isPercentSize = (value) => typeof value === "string" && value.endsWith("%");
|
|
223
222
|
var parseSize = (value, total, fallback) => {
|
|
@@ -261,7 +260,7 @@ var CustomSplitter = ({
|
|
|
261
260
|
const getPanelMin = (0, import_react2.useCallback)(
|
|
262
261
|
(index) => {
|
|
263
262
|
var _a;
|
|
264
|
-
return parseSize((_a = panels[index]) == null ? void 0 : _a.props.min, trackSize,
|
|
263
|
+
return parseSize((_a = panels[index]) == null ? void 0 : _a.props.min, trackSize, 0);
|
|
265
264
|
},
|
|
266
265
|
[panels, trackSize]
|
|
267
266
|
);
|
|
@@ -280,10 +279,17 @@ var CustomSplitter = ({
|
|
|
280
279
|
const normalized = [...nextSizes];
|
|
281
280
|
const diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);
|
|
282
281
|
const flexibleIndex = normalized.findIndex((size) => size > 0);
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
if (flexibleIndex !== -1) {
|
|
283
|
+
normalized[flexibleIndex] += diff;
|
|
284
|
+
}
|
|
285
|
+
return normalized.map((size, index) => {
|
|
286
|
+
if (size <= 1) {
|
|
287
|
+
return 0;
|
|
288
|
+
}
|
|
289
|
+
return clamp(size, getPanelMin(index), getPanelMax(index));
|
|
290
|
+
});
|
|
285
291
|
},
|
|
286
|
-
[getPanelMax, trackSize]
|
|
292
|
+
[getPanelMax, getPanelMin, trackSize]
|
|
287
293
|
);
|
|
288
294
|
const buildInitialSizes = (0, import_react2.useCallback)(
|
|
289
295
|
(previous) => {
|
|
@@ -335,8 +341,7 @@ var CustomSplitter = ({
|
|
|
335
341
|
return void 0;
|
|
336
342
|
}
|
|
337
343
|
const syncSize = () => {
|
|
338
|
-
|
|
339
|
-
setContainerSize(resolvedOrientation === "horizontal" ? rect.width : rect.height);
|
|
344
|
+
setContainerSize(resolvedOrientation === "horizontal" ? node.clientWidth : node.clientHeight);
|
|
340
345
|
};
|
|
341
346
|
syncSize();
|
|
342
347
|
const observer = new ResizeObserver(syncSize);
|
|
@@ -356,20 +361,32 @@ var CustomSplitter = ({
|
|
|
356
361
|
const getResizedPair = (0, import_react2.useCallback)(
|
|
357
362
|
(sourceSizes, index, delta) => {
|
|
358
363
|
const nextSizes = [...sourceSizes];
|
|
359
|
-
const
|
|
360
|
-
const
|
|
364
|
+
const leftPanel = panels[index];
|
|
365
|
+
const rightPanel = panels[index + 1];
|
|
361
366
|
const leftMin = getPanelMin(index);
|
|
362
367
|
const rightMin = getPanelMin(index + 1);
|
|
363
368
|
const leftMax = getPanelMax(index);
|
|
364
369
|
const rightMax = getPanelMax(index + 1);
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
+
let targetLeft = sourceSizes[index] + delta;
|
|
371
|
+
let targetRight = sourceSizes[index + 1] - delta;
|
|
372
|
+
if ((leftPanel == null ? void 0 : leftPanel.props.collapsible) && leftMin > 0 && targetLeft < leftMin / 2) {
|
|
373
|
+
targetLeft = 0;
|
|
374
|
+
targetRight = sourceSizes[index] + sourceSizes[index + 1];
|
|
375
|
+
} else if ((rightPanel == null ? void 0 : rightPanel.props.collapsible) && rightMin > 0 && targetRight < rightMin / 2) {
|
|
376
|
+
targetRight = 0;
|
|
377
|
+
targetLeft = sourceSizes[index] + sourceSizes[index + 1];
|
|
378
|
+
} else {
|
|
379
|
+
const minDelta = Math.max(leftMin - sourceSizes[index], sourceSizes[index + 1] - rightMax);
|
|
380
|
+
const maxDelta = Math.min(leftMax - sourceSizes[index], sourceSizes[index + 1] - rightMin);
|
|
381
|
+
const safeDelta = clamp(delta, minDelta, maxDelta);
|
|
382
|
+
targetLeft = sourceSizes[index] + safeDelta;
|
|
383
|
+
targetRight = sourceSizes[index + 1] - safeDelta;
|
|
384
|
+
}
|
|
385
|
+
nextSizes[index] = targetLeft;
|
|
386
|
+
nextSizes[index + 1] = targetRight;
|
|
370
387
|
return normalizeToTrack(nextSizes);
|
|
371
388
|
},
|
|
372
|
-
[getPanelMax, getPanelMin, normalizeToTrack]
|
|
389
|
+
[getPanelMax, getPanelMin, normalizeToTrack, panels]
|
|
373
390
|
);
|
|
374
391
|
const resizePair = (0, import_react2.useCallback)(
|
|
375
392
|
(index, delta, notify = true) => {
|
|
@@ -428,11 +445,13 @@ var CustomSplitter = ({
|
|
|
428
445
|
const rootStyle = {
|
|
429
446
|
border: "1px solid #f0f0f0",
|
|
430
447
|
borderRadius: 8,
|
|
448
|
+
boxSizing: "border-box",
|
|
431
449
|
display: "flex",
|
|
432
450
|
flexDirection: resolvedOrientation === "horizontal" ? "row" : "column",
|
|
433
451
|
height: 360,
|
|
434
452
|
minHeight: 0,
|
|
435
453
|
overflow: "hidden",
|
|
454
|
+
position: "relative",
|
|
436
455
|
width: "100%",
|
|
437
456
|
...style
|
|
438
457
|
};
|
|
@@ -470,141 +489,165 @@ var CustomSplitter = ({
|
|
|
470
489
|
justifyContent: "center",
|
|
471
490
|
padding: 0,
|
|
472
491
|
width: 20,
|
|
473
|
-
fontSize: 12
|
|
492
|
+
fontSize: 12,
|
|
493
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.08)"
|
|
474
494
|
},
|
|
475
495
|
type: "button",
|
|
476
496
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, {})
|
|
477
497
|
}
|
|
478
498
|
);
|
|
479
499
|
};
|
|
480
|
-
const
|
|
500
|
+
const renderCollapsedExpandHandle = (panelIndex) => {
|
|
481
501
|
var _a;
|
|
482
502
|
const panel = panels[panelIndex];
|
|
483
503
|
if (!(panel == null ? void 0 : panel.props.collapsible)) {
|
|
484
504
|
return null;
|
|
485
505
|
}
|
|
486
|
-
const isCollapsed = ((_a = sizes[panelIndex]) != null ? _a : 0) <= 1;
|
|
506
|
+
const isCollapsed = sizes.length > 0 && ((_a = sizes[panelIndex]) != null ? _a : 0) <= 1;
|
|
487
507
|
if (!isCollapsed) {
|
|
488
508
|
return null;
|
|
489
509
|
}
|
|
490
|
-
const
|
|
491
|
-
const
|
|
510
|
+
const isFirstPanel = panelIndex === 0;
|
|
511
|
+
const neighborIndex = isFirstPanel ? panelIndex + 1 : panelIndex - 1;
|
|
512
|
+
const Icon = resolvedOrientation === "horizontal" ? isFirstPanel ? RightOutlined : LeftOutlined : isFirstPanel ? DownOutlined : UpOutlined;
|
|
513
|
+
const label = resolvedOrientation === "horizontal" ? isFirstPanel ? "\u5C55\u5F00\u5DE6\u4FA7\u9762\u677F" : "\u5C55\u5F00\u53F3\u4FA7\u9762\u677F" : isFirstPanel ? "\u5C55\u5F00\u4E0A\u65B9\u9762\u677F" : "\u5C55\u5F00\u4E0B\u65B9\u9762\u677F";
|
|
514
|
+
const positionStyle = resolvedOrientation === "horizontal" ? isFirstPanel ? { left: 8, top: "50%", transform: "translateY(-50%)" } : { right: 8, top: "50%", transform: "translateY(-50%)" } : isFirstPanel ? { top: 8, left: "50%", transform: "translateX(-50%)" } : { bottom: 8, left: "50%", transform: "translateX(-50%)" };
|
|
492
515
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
493
516
|
"button",
|
|
494
517
|
{
|
|
495
|
-
"aria-label":
|
|
496
|
-
title:
|
|
518
|
+
"aria-label": label,
|
|
519
|
+
title: label,
|
|
497
520
|
onClick: (event) => {
|
|
498
521
|
event.stopPropagation();
|
|
499
522
|
toggleCollapse(panelIndex, neighborIndex);
|
|
500
523
|
},
|
|
501
524
|
style: {
|
|
525
|
+
position: "absolute",
|
|
502
526
|
alignItems: "center",
|
|
503
527
|
background: "#fff",
|
|
504
|
-
border: "1px solid #
|
|
528
|
+
border: "1px solid #1677ff",
|
|
505
529
|
borderRadius: 4,
|
|
506
|
-
color: "#
|
|
530
|
+
color: "#1677ff",
|
|
507
531
|
cursor: "pointer",
|
|
508
532
|
display: "flex",
|
|
509
|
-
height:
|
|
533
|
+
height: 24,
|
|
510
534
|
justifyContent: "center",
|
|
511
535
|
padding: 0,
|
|
512
|
-
width:
|
|
513
|
-
fontSize: 12
|
|
536
|
+
width: 24,
|
|
537
|
+
fontSize: 12,
|
|
538
|
+
boxShadow: "0 2px 8px rgba(22, 119, 255, 0.35)",
|
|
539
|
+
zIndex: 20,
|
|
540
|
+
...positionStyle
|
|
514
541
|
},
|
|
515
542
|
type: "button",
|
|
516
543
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Icon, {})
|
|
517
|
-
}
|
|
544
|
+
},
|
|
545
|
+
`collapsed-handle-${panelIndex}`
|
|
518
546
|
);
|
|
519
547
|
};
|
|
520
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
onPointerDown: (event) => startResize(index, event),
|
|
555
|
-
onPointerEnter: () => setHoveredIndex(index),
|
|
556
|
-
onPointerLeave: () => setHoveredIndex(null),
|
|
557
|
-
role: "separator",
|
|
558
|
-
style: {
|
|
559
|
-
alignItems: "center",
|
|
560
|
-
background: hoveredIndex === index || draggingIndex === index ? "#e6f4ff" : "#f5f5f5",
|
|
561
|
-
cursor: resolvedOrientation === "horizontal" ? "col-resize" : "row-resize",
|
|
562
|
-
display: "flex",
|
|
563
|
-
flex: `0 0 ${DRAGGER_SIZE}px`,
|
|
564
|
-
justifyContent: "center",
|
|
565
|
-
outline: "none",
|
|
566
|
-
position: "relative",
|
|
567
|
-
userSelect: "none",
|
|
568
|
-
zIndex: 1
|
|
569
|
-
},
|
|
570
|
-
tabIndex: 0,
|
|
571
|
-
children: [
|
|
572
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
573
|
-
"div",
|
|
574
|
-
{
|
|
575
|
-
style: {
|
|
576
|
-
background: hoveredIndex === index || draggingIndex === index ? "#1677ff" : "#d9d9d9",
|
|
577
|
-
borderRadius: 2,
|
|
578
|
-
height: resolvedOrientation === "horizontal" ? 48 : 2,
|
|
579
|
-
width: resolvedOrientation === "horizontal" ? 2 : 48
|
|
580
|
-
}
|
|
548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className, ref: rootRef, style: rootStyle, children: [
|
|
549
|
+
panels.map((panel, index) => {
|
|
550
|
+
var _a, _b, _c;
|
|
551
|
+
const isHidden = sizes[index] <= 1;
|
|
552
|
+
const isLeftOrTopCollapsed = ((_a = sizes[index]) != null ? _a : 0) <= 1;
|
|
553
|
+
const isRightOrBottomCollapsed = ((_b = sizes[index + 1]) != null ? _b : 0) <= 1;
|
|
554
|
+
const isAnyCollapsed = isLeftOrTopCollapsed || isRightOrBottomCollapsed;
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react2.default.Fragment, { children: [
|
|
556
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
557
|
+
"div",
|
|
558
|
+
{
|
|
559
|
+
style: {
|
|
560
|
+
background: index % 2 ? "#fff" : "#fafafa",
|
|
561
|
+
boxSizing: "border-box",
|
|
562
|
+
flex: `0 0 ${(_c = sizes[index]) != null ? _c : 0}px`,
|
|
563
|
+
minHeight: 0,
|
|
564
|
+
minWidth: 0,
|
|
565
|
+
overflow: "auto",
|
|
566
|
+
padding: isHidden ? 0 : 16,
|
|
567
|
+
transition: draggingIndex === null ? "flex-basis 0.2s ease" : void 0,
|
|
568
|
+
...panel.props.style
|
|
569
|
+
},
|
|
570
|
+
children: !isHidden && panel.props.children
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
index < panels.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
574
|
+
"div",
|
|
575
|
+
{
|
|
576
|
+
"aria-orientation": resolvedOrientation,
|
|
577
|
+
onClick: () => {
|
|
578
|
+
if (isRightOrBottomCollapsed) {
|
|
579
|
+
toggleCollapse(index + 1, index);
|
|
580
|
+
} else if (isLeftOrTopCollapsed) {
|
|
581
|
+
toggleCollapse(index, index + 1);
|
|
581
582
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
opacity: hoveredIndex === index || ((_b = sizes[index]) != null ? _b : 0) <= 1 || ((_c = sizes[index + 1]) != null ? _c : 0) <= 1 ? 1 : 0,
|
|
592
|
-
transition: "opacity 0.15s ease",
|
|
593
|
-
pointerEvents: hoveredIndex === index || ((_d = sizes[index]) != null ? _d : 0) <= 1 || ((_e = sizes[index + 1]) != null ? _e : 0) <= 1 ? "auto" : "none"
|
|
594
|
-
},
|
|
595
|
-
children: [
|
|
596
|
-
renderCollapseButton(index, index, "start"),
|
|
597
|
-
renderCollapseButton(index, index + 1, "end"),
|
|
598
|
-
renderExpandButton(index, "start"),
|
|
599
|
-
renderExpandButton(index + 1, "end")
|
|
600
|
-
]
|
|
583
|
+
},
|
|
584
|
+
onDoubleClick: resetSizes,
|
|
585
|
+
onKeyDown: (event) => {
|
|
586
|
+
const step = event.shiftKey ? 40 : 10;
|
|
587
|
+
const directionMap = resolvedOrientation === "horizontal" ? { ArrowLeft: -step, ArrowRight: step } : { ArrowUp: -step, ArrowDown: step };
|
|
588
|
+
const delta = directionMap[event.key];
|
|
589
|
+
if (delta !== void 0) {
|
|
590
|
+
event.preventDefault();
|
|
591
|
+
resizePair(index, delta);
|
|
601
592
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
593
|
+
},
|
|
594
|
+
onPointerDown: (event) => startResize(index, event),
|
|
595
|
+
onPointerEnter: () => setHoveredIndex(index),
|
|
596
|
+
onPointerLeave: () => setHoveredIndex(null),
|
|
597
|
+
role: "separator",
|
|
598
|
+
title: isAnyCollapsed ? "\u70B9\u51FB\u53EF\u5C55\u5F00\u6062\u590D\u9762\u677F" : "\u62D6\u52A8\u8C03\u6574\u5927\u5C0F\uFF0C\u53CC\u51FB\u91CD\u7F6E",
|
|
599
|
+
style: {
|
|
600
|
+
alignItems: "center",
|
|
601
|
+
background: hoveredIndex === index || draggingIndex === index || isAnyCollapsed ? "#e6f4ff" : "#f5f5f5",
|
|
602
|
+
boxSizing: "border-box",
|
|
603
|
+
cursor: isAnyCollapsed ? "pointer" : resolvedOrientation === "horizontal" ? "col-resize" : "row-resize",
|
|
604
|
+
display: "flex",
|
|
605
|
+
flex: `0 0 ${DRAGGER_SIZE}px`,
|
|
606
|
+
justifyContent: "center",
|
|
607
|
+
outline: "none",
|
|
608
|
+
position: "relative",
|
|
609
|
+
userSelect: "none",
|
|
610
|
+
zIndex: isAnyCollapsed ? 2 : 1
|
|
611
|
+
},
|
|
612
|
+
tabIndex: 0,
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
615
|
+
"div",
|
|
616
|
+
{
|
|
617
|
+
style: {
|
|
618
|
+
background: hoveredIndex === index || draggingIndex === index || isAnyCollapsed ? "#1677ff" : "#d9d9d9",
|
|
619
|
+
borderRadius: 2,
|
|
620
|
+
height: resolvedOrientation === "horizontal" ? 48 : 2,
|
|
621
|
+
width: resolvedOrientation === "horizontal" ? 2 : 48
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
),
|
|
625
|
+
!isAnyCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
626
|
+
"div",
|
|
627
|
+
{
|
|
628
|
+
style: {
|
|
629
|
+
position: "absolute",
|
|
630
|
+
display: "flex",
|
|
631
|
+
flexDirection: resolvedOrientation === "horizontal" ? "column" : "row",
|
|
632
|
+
gap: 4,
|
|
633
|
+
opacity: hoveredIndex === index ? 1 : 0.85,
|
|
634
|
+
transition: "opacity 0.15s ease",
|
|
635
|
+
pointerEvents: "auto",
|
|
636
|
+
zIndex: 5
|
|
637
|
+
},
|
|
638
|
+
children: [
|
|
639
|
+
renderCollapseButton(index, index, "start"),
|
|
640
|
+
renderCollapseButton(index, index + 1, "end")
|
|
641
|
+
]
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
)
|
|
647
|
+
] }, index);
|
|
648
|
+
}),
|
|
649
|
+
panels.map((_, index) => renderCollapsedExpandHandle(index))
|
|
650
|
+
] });
|
|
608
651
|
};
|
|
609
652
|
CustomSplitter.Panel = SplitterPanel;
|
|
610
653
|
var Splitter_default = CustomSplitter;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../CollapseBox/index.tsx","../src/icons.tsx","../Splitter/index.tsx"],"sourcesContent":["// 统一入口\nexport { default as CollapseBox } from '../CollapseBox';\nexport type {\n\tCollapseBoxProps,\n\tCollapseBoxDirection,\n\tCollapseBoxButtonPosition,\n} from '../CollapseBox';\n\nexport { default as Splitter } from '../Splitter';\nexport type {\n\tSplitterProps,\n\tSplitterPanelProps,\n\tSplitterSize,\n\tSplitterOrientation,\n} from '../Splitter';\n","import { useState, type CSSProperties, type ReactNode } from 'react';\nimport { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport './index.less';\n\nexport type CollapseBoxDirection = 'horizontal' | 'vertical';\nexport type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport interface CollapseBoxProps {\n\tchildren?: ReactNode;\n\ttitle?: string;\n\tdirection?: CollapseBoxDirection;\n\tbuttonPosition?: CollapseBoxButtonPosition;\n\tdefaultWidth?: number | string;\n\tdefaultHeight?: number | string;\n\tcontentPadding?: string;\n\theaderHeight?: number;\n\tclassName?: string;\n}\n\nconst formatDimension = (value?: number | string): string | undefined => {\n\tif (value === undefined || value === null) return undefined;\n\treturn typeof value === 'number' ? `${value}px` : value;\n};\n\nconst ChevronLeft = () => <LeftOutlined />;\n\nconst ChevronRight = () => <RightOutlined />;\n\nconst ChevronUp = () => <UpOutlined />;\n\nconst ChevronDown = () => <DownOutlined />;\n\nconst CollapsibleBox = ({\n\tchildren,\n\ttitle = '内容区域',\n\tdirection = 'horizontal',\n\tbuttonPosition = 'right',\n\tdefaultWidth = 600,\n\tdefaultHeight = 300,\n\tcontentPadding = '16px',\n\theaderHeight = 16,\n\tclassName,\n}: CollapseBoxProps) => {\n\tconst [isExpanded, setIsExpanded] = useState(true);\n\n\tconst getContentMaxHeight = () => {\n\t\tif (typeof defaultHeight === 'number') {\n\t\t\treturn `${defaultHeight - headerHeight}px`;\n\t\t}\n\t\tif (typeof defaultHeight === 'string') {\n\t\t\treturn headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n\t\t}\n\t\treturn '100%';\n\t};\n\n\tconst getIcon = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\tif (buttonPosition === 'right') {\n\t\t\t\treturn isExpanded ? <ChevronRight /> : <ChevronLeft />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronLeft /> : <ChevronRight />;\n\t\t\t}\n\t\t} else {\n\t\t\tif (buttonPosition === 'bottom') {\n\t\t\t\treturn isExpanded ? <ChevronUp /> : <ChevronDown />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronDown /> : <ChevronUp />;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst getButtonClass = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\treturn buttonPosition === 'right' ? 'button-right' : 'button-left';\n\t\t} else {\n\t\t\treturn buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n\t\t}\n\t};\n\n\tconst getContainerStyle = (): CSSProperties => {\n\t\tconst resolvedHeight = formatDimension(defaultHeight);\n\t\tconst resolvedWidth = formatDimension(defaultWidth);\n\t\tif (direction === 'horizontal') {\n\t\t\treturn {\n\t\t\t\twidth: isExpanded ? resolvedWidth : '0px',\n\t\t\t\theight: resolvedHeight,\n\t\t\t\tminWidth: 0,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\theight: isExpanded ? resolvedHeight : '0px',\n\t\t\t\twidth: resolvedWidth,\n\t\t\t\tminHeight: 0,\n\t\t\t};\n\t\t}\n\t};\n\n\tconst baseWrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\tconst wrapperClass = className ? `${baseWrapperClass} ${className}` : baseWrapperClass;\n\n\tconst containerClass =\n\t\tdirection === 'horizontal' && buttonPosition === 'right'\n\t\t\t? 'collapsible-container align-right'\n\t\t\t: 'collapsible-container';\n\tconst height = getContentMaxHeight();\n\tconst contentStyle: CSSProperties = {\n\t\tmaxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n\t\toverflowY: 'auto',\n\t\tpadding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n\t\tboxSizing: 'border-box',\n\t};\n\n\t// 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n\tconst buttonStyle: CSSProperties =\n\t\tdirection === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n\t\t\t? { top: '0px', bottom: 'auto' }\n\t\t\t: {};\n\n\t// 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n\t// 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n\tconst formattedWidth = formatDimension(defaultWidth);\n\tconst formattedHeight = formatDimension(defaultHeight);\n\tconst wrapperStyle: CSSProperties | undefined =\n\t\tdirection === 'vertical'\n\t\t\t? isExpanded\n\t\t\t\t? {\n\t\t\t\t\t\theight: formattedHeight,\n\t\t\t\t\t\twidth: formattedWidth,\n\t\t\t\t\t}\n\t\t\t\t: { height: 0, width: formattedWidth }\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div className={wrapperClass} style={wrapperStyle}>\n\t\t\t<div style={getContainerStyle()} className={containerClass}>\n\t\t\t\t{title && (\n\t\t\t\t\t<div className=\"collapsible-header\" style={{ display: 'none' }}>\n\t\t\t\t\t\t<h3>{title}</h3>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"collapsible-content\" style={contentStyle}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tonClick={() => setIsExpanded(!isExpanded)}\n\t\t\t\tclassName={`toggle-button ${getButtonClass()}`}\n\t\t\t\tstyle={buttonStyle}\n\t\t\t\ttitle={isExpanded ? '隐藏' : '展开'}\n\t\t\t>\n\t\t\t\t{getIcon()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n}\n\nconst baseStyle: CSSProperties = {\n\tdisplay: 'inline-block',\n\twidth: '1em',\n\theight: '1em',\n\tverticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"left\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" />\n\t</svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"right\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" />\n\t</svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"up\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M890.5 755.3L537.4 268a31.96 31.96 0 00-50.8 0L133.5 755.3a7.95 7.95 0 006.3 12.7h75.5c4.9 0 9.6-2.3 12.6-6.1l281-360 281 360c3 3.8 7.7 6.1 12.6 6.1h75.5c6.7 0 10.4-7.6 6.1-12.7z\" />\n\t</svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"down\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 37 17.6 49.8 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" />\n\t</svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport type {\n\tCSSProperties,\n\tReactElement,\n\tReactNode,\n\tPointerEvent as ReactPointerEvent,\n} from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type SplitterSize = number | `${number}%`;\nexport type SplitterOrientation = 'horizontal' | 'vertical';\n\nexport type SplitterPanelProps = {\n\tchildren?: ReactNode;\n\tcollapsible?: boolean;\n\tdefaultSize?: SplitterSize;\n\tmax?: SplitterSize;\n\tmin?: SplitterSize;\n\tresizable?: boolean;\n\tsize?: SplitterSize;\n\tstyle?: CSSProperties;\n};\n\nexport type SplitterProps = {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tlazy?: boolean;\n\tonResize?: (sizes: number[]) => void;\n\tonResizeEnd?: (sizes: number[]) => void;\n\tonResizeStart?: (sizes: number[]) => void;\n\torientation?: SplitterOrientation;\n\tstyle?: CSSProperties;\n\tvertical?: boolean;\n};\n\ntype SplitterComponent = React.FC<SplitterProps> & {\n\tPanel: React.FC<SplitterPanelProps>;\n};\n\nconst DRAGGER_SIZE = 8;\nconst MIN_PANEL_SIZE = 0;\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\n\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\n\ttypeof value === 'string' && value.endsWith('%');\n\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\n\tif (value === undefined) {\n\t\treturn fallback;\n\t}\n\n\tif (isPercentSize(value)) {\n\t\treturn (Number.parseFloat(value) / 100) * total;\n\t}\n\n\treturn Number(value);\n};\n\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\n\nconst getPointerPosition = (\n\tevent: PointerEvent | ReactPointerEvent,\n\torientation: SplitterOrientation,\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nconst CustomSplitter: SplitterComponent = ({\n\tchildren,\n\tclassName,\n\tlazy = false,\n\tonResize,\n\tonResizeEnd,\n\tonResizeStart,\n\torientation,\n\tstyle,\n\tvertical = false,\n}) => {\n\tconst resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\n\tconst rootRef = useRef<HTMLDivElement>(null);\n\tconst sizesRef = useRef<number[]>([]);\n\tconst lastNonZeroSizesRef = useRef<number[]>([]);\n\tconst [containerSize, setContainerSize] = useState(0);\n\tconst [draggingIndex, setDraggingIndex] = useState<number | null>(null);\n\tconst [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\tconst [sizes, setSizes] = useState<number[]>([]);\n\n\tconst panels = useMemo(\n\t\t() =>\n\t\t\tReact.Children.toArray(children).filter(\n\t\t\t\tReact.isValidElement,\n\t\t\t) as ReactElement<SplitterPanelProps>[],\n\t\t[children],\n\t);\n\n\tconst trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\n\n\tconst getPanelMin = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.min, trackSize, MIN_PANEL_SIZE),\n\t\t[panels, trackSize],\n\t);\n\n\tconst getPanelMax = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\n\t\t[panels, trackSize],\n\t);\n\n\tconst normalizeToTrack = useCallback(\n\t\t(nextSizes: number[]) => {\n\t\t\tif (!trackSize || !nextSizes.length) {\n\t\t\t\treturn nextSizes;\n\t\t\t}\n\n\t\t\tconst normalized = [...nextSizes];\n\t\t\tconst diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\n\t\t\tconst flexibleIndex = normalized.findIndex((size) => size > 0);\n\t\t\tnormalized[flexibleIndex === -1 ? 0 : flexibleIndex] += diff;\n\t\t\treturn normalized.map((size, index) => clamp(size, 0, getPanelMax(index)));\n\t\t},\n\t\t[getPanelMax, trackSize],\n\t);\n\n\tconst buildInitialSizes = useCallback(\n\t\t(previous?: number[]) => {\n\t\t\tif (!trackSize || !panels.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif (previous?.length === panels.length) {\n\t\t\t\tconst previousTotal = previous.reduce((sum, size) => sum + size, 0);\n\t\t\t\tif (previousTotal > 0) {\n\t\t\t\t\treturn normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst explicitSizes = panels.map((panel) =>\n\t\t\t\tparseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\n\t\t\t);\n\t\t\tconst usedSize = explicitSizes\n\t\t\t\t.filter((size) => size >= 0)\n\t\t\t\t.reduce((sum, size) => sum + size, 0);\n\t\t\tconst unsetCount = explicitSizes.filter((size) => size < 0).length;\n\t\t\tconst fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\n\n\t\t\treturn normalizeToTrack(\n\t\t\t\texplicitSizes.map((size, index) =>\n\t\t\t\t\tclamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\n\t);\n\n\tconst updateSizes = useCallback(\n\t\t(nextSizes: number[], notify = true) => {\n\t\t\tconst normalized = normalizeToTrack(nextSizes);\n\t\t\tsetSizes(normalized);\n\t\t\tsizesRef.current = normalized;\n\t\t\tnormalized.forEach((size, index) => {\n\t\t\t\tif (size > 1) {\n\t\t\t\t\tlastNonZeroSizesRef.current[index] = size;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (notify) {\n\t\t\t\tonResize?.(roundSizes(normalized));\n\t\t\t}\n\t\t},\n\t\t[normalizeToTrack, onResize],\n\t);\n\n\tuseEffect(() => {\n\t\tconst node = rootRef.current;\n\t\tif (!node) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst syncSize = () => {\n\t\t\tconst rect = node.getBoundingClientRect();\n\t\t\tsetContainerSize(resolvedOrientation === 'horizontal' ? rect.width : rect.height);\n\t\t};\n\t\tsyncSize();\n\n\t\tconst observer = new ResizeObserver(syncSize);\n\t\tobserver.observe(node);\n\t\treturn () => observer.disconnect();\n\t}, [resolvedOrientation]);\n\n\tuseEffect(() => {\n\t\tsetSizes((previous) => {\n\t\t\tconst nextSizes = buildInitialSizes(previous);\n\t\t\tsizesRef.current = nextSizes;\n\t\t\tlastNonZeroSizesRef.current = nextSizes.map((size) =>\n\t\t\t\tMath.max(size, trackSize / Math.max(panels.length, 1)),\n\t\t\t);\n\t\t\treturn nextSizes;\n\t\t});\n\t}, [buildInitialSizes, panels.length, trackSize]);\n\n\tconst getResizedPair = useCallback(\n\t\t(sourceSizes: number[], index: number, delta: number) => {\n\t\t\tconst nextSizes = [...sourceSizes];\n\t\t\tconst leftSize = nextSizes[index];\n\t\t\tconst rightSize = nextSizes[index + 1];\n\t\t\tconst leftMin = getPanelMin(index);\n\t\t\tconst rightMin = getPanelMin(index + 1);\n\t\t\tconst leftMax = getPanelMax(index);\n\t\t\tconst rightMax = getPanelMax(index + 1);\n\t\t\tconst minDelta = Math.max(leftMin - leftSize, rightSize - rightMax);\n\t\t\tconst maxDelta = Math.min(leftMax - leftSize, rightSize - rightMin);\n\t\t\tconst safeDelta = clamp(delta, minDelta, maxDelta);\n\n\t\t\tnextSizes[index] = leftSize + safeDelta;\n\t\t\tnextSizes[index + 1] = rightSize - safeDelta;\n\t\t\treturn normalizeToTrack(nextSizes);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack],\n\t);\n\n\tconst resizePair = useCallback(\n\t\t(index: number, delta: number, notify = true) => {\n\t\t\tupdateSizes(getResizedPair(sizesRef.current, index, delta), notify);\n\t\t},\n\t\t[getResizedPair, updateSizes],\n\t);\n\n\tconst startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst startPosition = getPointerPosition(event, resolvedOrientation);\n\t\tconst startSizes = [...sizesRef.current];\n\t\tlet latestSizes = startSizes;\n\n\t\tsetDraggingIndex(index);\n\t\tonResizeStart?.(roundSizes(startSizes));\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\n\t\t\tlatestSizes = getResizedPair(startSizes, index, delta);\n\t\t\tif (!lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tdocument.removeEventListener('pointermove', handlePointerMove);\n\t\t\tdocument.removeEventListener('pointerup', handlePointerUp);\n\t\t\tsetDraggingIndex(null);\n\t\t\tif (lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t\t};\n\n\t\tdocument.addEventListener('pointermove', handlePointerMove);\n\t\tdocument.addEventListener('pointerup', handlePointerUp);\n\t};\n\n\tconst toggleCollapse = (index: number, neighborIndex: number) => {\n\t\tconst nextSizes = [...sizesRef.current];\n\n\t\tif (nextSizes[index] > 1) {\n\t\t\tlastNonZeroSizesRef.current[index] = nextSizes[index];\n\t\t\tnextSizes[neighborIndex] += nextSizes[index];\n\t\t\tnextSizes[index] = 0;\n\t\t} else {\n\t\t\tconst restoredSize =\n\t\t\t\tlastNonZeroSizesRef.current[index] ||\n\t\t\t\tparseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\n\t\t\tnextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\n\t\t\tnextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\n\t\t}\n\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t};\n\n\tconst resetSizes = () => {\n\t\tconst nextSizes = buildInitialSizes();\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(nextSizes));\n\t};\n\n\tconst rootStyle: CSSProperties = {\n\t\tborder: '1px solid #f0f0f0',\n\t\tborderRadius: 8,\n\t\tdisplay: 'flex',\n\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\n\t\theight: 360,\n\t\tminHeight: 0,\n\t\toverflow: 'hidden',\n\t\twidth: '100%',\n\t\t...style,\n\t};\n\n\tconst renderCollapseButton = (\n\t\tdraggerIndex: number,\n\t\tpanelIndex: number,\n\t\tdirection: 'start' | 'end',\n\t) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tconst isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\n\n\t\t// 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\n\t\tif (isCollapsed || isNeighborCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// 展开时箭头指向面板将被折叠到的方向\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? LeftOutlined\n\t\t\t\t\t: RightOutlined\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? UpOutlined\n\t\t\t\t\t: DownOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"折叠面板\"\n\t\t\t\ttitle=\"折叠面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\t// 渲染\"展开\"按钮:当某个面板被折叠时显示在分隔条上,箭头指向展开方向\n\tconst renderExpandButton = (panelIndex: number, direction: 'start' | 'end') => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tif (!isCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\n\t\t// 折叠后面板展开的方向与折叠方向相反\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? RightOutlined // 左面板折叠后,展开方向朝右\n\t\t\t\t\t: LeftOutlined // 右面板折叠后,展开方向朝左\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? DownOutlined\n\t\t\t\t\t: UpOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"展开面板\"\n\t\t\t\ttitle=\"展开面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className={className} ref={rootRef} style={rootStyle}>\n\t\t\t{panels.map((panel, index) => {\n\t\t\t\tconst isHidden = sizes[index] <= 1;\n\n\t\t\t\treturn (\n\t\t\t\t\t<React.Fragment key={index}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackground: index % 2 ? '#fff' : '#fafafa',\n\t\t\t\t\t\t\t\tflex: `0 0 ${sizes[index] ?? 0}px`,\n\t\t\t\t\t\t\t\tminHeight: 0,\n\t\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpadding: isHidden ? 0 : 16,\n\t\t\t\t\t\t\t\ttransition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\n\t\t\t\t\t\t\t\t...panel.props.style,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!isHidden && panel.props.children}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{index < panels.length - 1 && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t\t\t\t\tonDoubleClick={resetSizes}\n\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\tconst step = event.shiftKey ? 40 : 10;\n\t\t\t\t\t\t\t\t\tconst directionMap =\n\t\t\t\t\t\t\t\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? { ArrowLeft: -step, ArrowRight: step }\n\t\t\t\t\t\t\t\t\t\t\t: { ArrowUp: -step, ArrowDown: step };\n\t\t\t\t\t\t\t\t\tconst delta = directionMap[event.key as keyof typeof directionMap];\n\t\t\t\t\t\t\t\t\tif (delta !== undefined) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tresizePair(index, delta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonPointerDown={(event) => startResize(index, event)}\n\t\t\t\t\t\t\t\tonPointerEnter={() => setHoveredIndex(index)}\n\t\t\t\t\t\t\t\tonPointerLeave={() => setHoveredIndex(null)}\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index ? '#e6f4ff' : '#f5f5f5',\n\t\t\t\t\t\t\t\t\tcursor: resolvedOrientation === 'horizontal' ? 'col-resize' : 'row-resize',\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflex: `0 0 ${DRAGGER_SIZE}px`,\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\toutline: 'none',\n\t\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\t\tuserSelect: 'none',\n\t\t\t\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index ? '#1677ff' : '#d9d9d9',\n\t\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\t\theight: resolvedOrientation === 'horizontal' ? 48 : 2,\n\t\t\t\t\t\t\t\t\t\twidth: resolvedOrientation === 'horizontal' ? 2 : 48,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\n\t\t\t\t\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t\t\t\t\t\topacity:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index] ?? 0) <= 1 ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index + 1] ?? 0) <= 1\n\t\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\t\t\t\t\ttransition: 'opacity 0.15s ease',\n\t\t\t\t\t\t\t\t\t\tpointerEvents:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index] ?? 0) <= 1 ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index + 1] ?? 0) <= 1\n\t\t\t\t\t\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'none',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index, 'start')}\n\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index + 1, 'end')}\n\t\t\t\t\t\t\t\t\t{renderExpandButton(index, 'start')}\n\t\t\t\t\t\t\t\t\t{renderExpandButton(index + 1, 'end')}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</React.Fragment>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n};\n\nCustomSplitter.Panel = SplitterPanel;\n\nexport default CustomSplitter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA6D;;;AC0B3D;AAnBF,IAAM,YAA2B;AAAA,EAChC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AAChB;AAEO,IAAM,eAAe,CAAC,EAAE,OAAO,UAAU,MAC/C;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,OAAO,EAAE,GAAG,WAAW,GAAG,MAAM;AAAA,IAChC;AAAA,IAEA,sDAAC,UAAK,GAAE,yLAAwL;AAAA;AACjM;AAGM,IAAM,gBAAgB,CAAC,EAAE,OAAO,UAAU,MAChD;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;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;AAAA,kBACpD,OAAO,wBAAwB,eAAe,IAAI;AAAA,gBACnD;AAAA;AAAA,YACD;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAO;AAAA,kBACN,UAAU;AAAA,kBACV,SAAS;AAAA,kBACT,eAAe,wBAAwB,eAAe,WAAW;AAAA,kBACjE,KAAK;AAAA,kBACL,SACC,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACxB,IACA;AAAA,kBACJ,YAAY;AAAA,kBACZ,eACC,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACxB,SACA;AAAA,gBACL;AAAA,gBAEC;AAAA,uCAAqB,OAAO,OAAO,OAAO;AAAA,kBAC1C,qBAAqB,OAAO,QAAQ,GAAG,KAAK;AAAA,kBAC5C,mBAAmB,OAAO,OAAO;AAAA,kBACjC,mBAAmB,QAAQ,GAAG,KAAK;AAAA;AAAA;AAAA,YACrC;AAAA;AAAA;AAAA,MACD;AAAA,SAtFmB,KAwFrB;AAAA,EAEF,CAAC,GACF;AAEF;AAEA,eAAe,QAAQ;AAEvB,IAAO,mBAAQ;","names":["import_jsx_runtime","import_react","import_jsx_runtime","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../CollapseBox/index.tsx","../src/icons.tsx","../Splitter/index.tsx"],"sourcesContent":["// 统一入口\nexport { default as CollapseBox } from '../CollapseBox';\nexport type {\n\tCollapseBoxProps,\n\tCollapseBoxDirection,\n\tCollapseBoxButtonPosition,\n} from '../CollapseBox';\n\nexport { default as Splitter } from '../Splitter';\nexport type {\n\tSplitterProps,\n\tSplitterPanelProps,\n\tSplitterSize,\n\tSplitterOrientation,\n} from '../Splitter';\n","import { useState, type CSSProperties, type ReactNode } from 'react';\nimport { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport './index.less';\n\nexport type CollapseBoxDirection = 'horizontal' | 'vertical';\nexport type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport interface CollapseBoxProps {\n\tchildren?: ReactNode;\n\ttitle?: string;\n\tdirection?: CollapseBoxDirection;\n\tbuttonPosition?: CollapseBoxButtonPosition;\n\tdefaultWidth?: number | string;\n\tdefaultHeight?: number | string;\n\tcontentPadding?: string;\n\theaderHeight?: number;\n\tclassName?: string;\n}\n\nconst formatDimension = (value?: number | string): string | undefined => {\n\tif (value === undefined || value === null) return undefined;\n\treturn typeof value === 'number' ? `${value}px` : value;\n};\n\nconst ChevronLeft = () => <LeftOutlined />;\n\nconst ChevronRight = () => <RightOutlined />;\n\nconst ChevronUp = () => <UpOutlined />;\n\nconst ChevronDown = () => <DownOutlined />;\n\nconst CollapsibleBox = ({\n\tchildren,\n\ttitle = '内容区域',\n\tdirection = 'horizontal',\n\tbuttonPosition = 'right',\n\tdefaultWidth = 600,\n\tdefaultHeight = 300,\n\tcontentPadding = '16px',\n\theaderHeight = 16,\n\tclassName,\n}: CollapseBoxProps) => {\n\tconst [isExpanded, setIsExpanded] = useState(true);\n\n\tconst getContentMaxHeight = () => {\n\t\tif (typeof defaultHeight === 'number') {\n\t\t\treturn `${defaultHeight - headerHeight}px`;\n\t\t}\n\t\tif (typeof defaultHeight === 'string') {\n\t\t\treturn headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n\t\t}\n\t\treturn '100%';\n\t};\n\n\tconst getIcon = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\tif (buttonPosition === 'right') {\n\t\t\t\treturn isExpanded ? <ChevronRight /> : <ChevronLeft />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronLeft /> : <ChevronRight />;\n\t\t\t}\n\t\t} else {\n\t\t\tif (buttonPosition === 'bottom') {\n\t\t\t\treturn isExpanded ? <ChevronUp /> : <ChevronDown />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronDown /> : <ChevronUp />;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst getButtonClass = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\treturn buttonPosition === 'right' ? 'button-right' : 'button-left';\n\t\t} else {\n\t\t\treturn buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n\t\t}\n\t};\n\n\tconst getContainerStyle = (): CSSProperties => {\n\t\tconst resolvedHeight = formatDimension(defaultHeight);\n\t\tconst resolvedWidth = formatDimension(defaultWidth);\n\t\tif (direction === 'horizontal') {\n\t\t\treturn {\n\t\t\t\twidth: isExpanded ? resolvedWidth : '0px',\n\t\t\t\theight: resolvedHeight,\n\t\t\t\tminWidth: 0,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\theight: isExpanded ? resolvedHeight : '0px',\n\t\t\t\twidth: resolvedWidth,\n\t\t\t\tminHeight: 0,\n\t\t\t};\n\t\t}\n\t};\n\n\tconst baseWrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\tconst wrapperClass = className ? `${baseWrapperClass} ${className}` : baseWrapperClass;\n\n\tconst containerClass =\n\t\tdirection === 'horizontal' && buttonPosition === 'right'\n\t\t\t? 'collapsible-container align-right'\n\t\t\t: 'collapsible-container';\n\tconst height = getContentMaxHeight();\n\tconst contentStyle: CSSProperties = {\n\t\tmaxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n\t\toverflowY: 'auto',\n\t\tpadding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n\t\tboxSizing: 'border-box',\n\t};\n\n\t// 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n\tconst buttonStyle: CSSProperties =\n\t\tdirection === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n\t\t\t? { top: '0px', bottom: 'auto' }\n\t\t\t: {};\n\n\t// 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n\t// 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n\tconst formattedWidth = formatDimension(defaultWidth);\n\tconst formattedHeight = formatDimension(defaultHeight);\n\tconst wrapperStyle: CSSProperties | undefined =\n\t\tdirection === 'vertical'\n\t\t\t? isExpanded\n\t\t\t\t? {\n\t\t\t\t\t\theight: formattedHeight,\n\t\t\t\t\t\twidth: formattedWidth,\n\t\t\t\t\t}\n\t\t\t\t: { height: 0, width: formattedWidth }\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div className={wrapperClass} style={wrapperStyle}>\n\t\t\t<div style={getContainerStyle()} className={containerClass}>\n\t\t\t\t{title && (\n\t\t\t\t\t<div className=\"collapsible-header\" style={{ display: 'none' }}>\n\t\t\t\t\t\t<h3>{title}</h3>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"collapsible-content\" style={contentStyle}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tonClick={() => setIsExpanded(!isExpanded)}\n\t\t\t\tclassName={`toggle-button ${getButtonClass()}`}\n\t\t\t\tstyle={buttonStyle}\n\t\t\t\ttitle={isExpanded ? '隐藏' : '展开'}\n\t\t\t>\n\t\t\t\t{getIcon()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n}\n\nconst baseStyle: CSSProperties = {\n\tdisplay: 'inline-block',\n\twidth: '1em',\n\theight: '1em',\n\tverticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"left\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" />\n\t</svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"right\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" />\n\t</svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"up\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M890.5 755.3L537.4 268a31.96 31.96 0 00-50.8 0L133.5 755.3a7.95 7.95 0 006.3 12.7h75.5c4.9 0 9.6-2.3 12.6-6.1l281-360 281 360c3 3.8 7.7 6.1 12.6 6.1h75.5c6.7 0 10.4-7.6 6.1-12.7z\" />\n\t</svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"down\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 37 17.6 49.8 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" />\n\t</svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport type {\n\tCSSProperties,\n\tReactElement,\n\tReactNode,\n\tPointerEvent as ReactPointerEvent,\n} from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type SplitterSize = number | `${number}%`;\nexport type SplitterOrientation = 'horizontal' | 'vertical';\n\nexport type SplitterPanelProps = {\n\tchildren?: ReactNode;\n\tcollapsible?: boolean;\n\tdefaultSize?: SplitterSize;\n\tmax?: SplitterSize;\n\tmin?: SplitterSize;\n\tresizable?: boolean;\n\tsize?: SplitterSize;\n\tstyle?: CSSProperties;\n};\n\nexport type SplitterProps = {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tlazy?: boolean;\n\tonResize?: (sizes: number[]) => void;\n\tonResizeEnd?: (sizes: number[]) => void;\n\tonResizeStart?: (sizes: number[]) => void;\n\torientation?: SplitterOrientation;\n\tstyle?: CSSProperties;\n\tvertical?: boolean;\n};\n\ntype SplitterComponent = React.FC<SplitterProps> & {\n\tPanel: React.FC<SplitterPanelProps>;\n};\n\nconst DRAGGER_SIZE = 8;\nconst MIN_DRAG_SIZE = 40; // 手动拖拽调整大小时的默认最小限制 (px)\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\n\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\n\ttypeof value === 'string' && value.endsWith('%');\n\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\n\tif (value === undefined) {\n\t\treturn fallback;\n\t}\n\n\tif (isPercentSize(value)) {\n\t\treturn (Number.parseFloat(value) / 100) * total;\n\t}\n\n\treturn Number(value);\n};\n\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\n\nconst getPointerPosition = (\n\tevent: PointerEvent | ReactPointerEvent,\n\torientation: SplitterOrientation,\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nconst CustomSplitter: SplitterComponent = ({\n\tchildren,\n\tclassName,\n\tlazy = false,\n\tonResize,\n\tonResizeEnd,\n\tonResizeStart,\n\torientation,\n\tstyle,\n\tvertical = false,\n}) => {\n\tconst resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\n\tconst rootRef = useRef<HTMLDivElement>(null);\n\tconst sizesRef = useRef<number[]>([]);\n\tconst lastNonZeroSizesRef = useRef<number[]>([]);\n\tconst [containerSize, setContainerSize] = useState(0);\n\tconst [draggingIndex, setDraggingIndex] = useState<number | null>(null);\n\tconst [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\tconst [sizes, setSizes] = useState<number[]>([]);\n\n\tconst panels = useMemo(\n\t\t() =>\n\t\t\tReact.Children.toArray(children).filter(\n\t\t\t\tReact.isValidElement,\n\t\t\t) as ReactElement<SplitterPanelProps>[],\n\t\t[children],\n\t);\n\n\tconst trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\n\n\tconst getPanelMin = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.min, trackSize, 0),\n\t\t[panels, trackSize],\n\t);\n\n\tconst getPanelMax = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\n\t\t[panels, trackSize],\n\t);\n\n\tconst normalizeToTrack = useCallback(\n\t\t(nextSizes: number[]) => {\n\t\t\tif (!trackSize || !nextSizes.length) {\n\t\t\t\treturn nextSizes;\n\t\t\t}\n\n\t\t\tconst normalized = [...nextSizes];\n\t\t\tconst diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\n\t\t\tconst flexibleIndex = normalized.findIndex((size) => size > 0);\n\t\t\tif (flexibleIndex !== -1) {\n\t\t\t\tnormalized[flexibleIndex] += diff;\n\t\t\t}\n\n\t\t\treturn normalized.map((size, index) => {\n\t\t\t\t// 折叠状态(size <= 1)保持为 0,不受 min 限制干扰\n\t\t\t\tif (size <= 1) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn clamp(size, getPanelMin(index), getPanelMax(index));\n\t\t\t});\n\t\t},\n\t\t[getPanelMax, getPanelMin, trackSize],\n\t);\n\n\tconst buildInitialSizes = useCallback(\n\t\t(previous?: number[]) => {\n\t\t\tif (!trackSize || !panels.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif (previous?.length === panels.length) {\n\t\t\t\tconst previousTotal = previous.reduce((sum, size) => sum + size, 0);\n\t\t\t\tif (previousTotal > 0) {\n\t\t\t\t\treturn normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst explicitSizes = panels.map((panel) =>\n\t\t\t\tparseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\n\t\t\t);\n\t\t\tconst usedSize = explicitSizes\n\t\t\t\t.filter((size) => size >= 0)\n\t\t\t\t.reduce((sum, size) => sum + size, 0);\n\t\t\tconst unsetCount = explicitSizes.filter((size) => size < 0).length;\n\t\t\tconst fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\n\n\t\t\treturn normalizeToTrack(\n\t\t\t\texplicitSizes.map((size, index) =>\n\t\t\t\t\tclamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\n\t);\n\n\tconst updateSizes = useCallback(\n\t\t(nextSizes: number[], notify = true) => {\n\t\t\tconst normalized = normalizeToTrack(nextSizes);\n\t\t\tsetSizes(normalized);\n\t\t\tsizesRef.current = normalized;\n\t\t\tnormalized.forEach((size, index) => {\n\t\t\t\tif (size > 1) {\n\t\t\t\t\tlastNonZeroSizesRef.current[index] = size;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (notify) {\n\t\t\t\tonResize?.(roundSizes(normalized));\n\t\t\t}\n\t\t},\n\t\t[normalizeToTrack, onResize],\n\t);\n\n\tuseEffect(() => {\n\t\tconst node = rootRef.current;\n\t\tif (!node) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst syncSize = () => {\n\t\t\tsetContainerSize(resolvedOrientation === 'horizontal' ? node.clientWidth : node.clientHeight);\n\t\t};\n\t\tsyncSize();\n\n\t\tconst observer = new ResizeObserver(syncSize);\n\t\tobserver.observe(node);\n\t\treturn () => observer.disconnect();\n\t}, [resolvedOrientation]);\n\n\tuseEffect(() => {\n\t\tsetSizes((previous) => {\n\t\t\tconst nextSizes = buildInitialSizes(previous);\n\t\t\tsizesRef.current = nextSizes;\n\t\t\tlastNonZeroSizesRef.current = nextSizes.map((size) =>\n\t\t\t\tMath.max(size, trackSize / Math.max(panels.length, 1)),\n\t\t\t);\n\t\t\treturn nextSizes;\n\t\t});\n\t}, [buildInitialSizes, panels.length, trackSize]);\n\n\tconst getResizedPair = useCallback(\n\t\t(sourceSizes: number[], index: number, delta: number) => {\n\t\t\tconst nextSizes = [...sourceSizes];\n\t\t\tconst leftPanel = panels[index];\n\t\t\tconst rightPanel = panels[index + 1];\n\n\t\t\tconst leftMin = getPanelMin(index);\n\t\t\tconst rightMin = getPanelMin(index + 1);\n\t\t\tconst leftMax = getPanelMax(index);\n\t\t\tconst rightMax = getPanelMax(index + 1);\n\n\t\t\tlet targetLeft = sourceSizes[index] + delta;\n\t\t\tlet targetRight = sourceSizes[index + 1] - delta;\n\n\t\t\t// 如果面板可折叠且设置了 min > 0,当拖拽目标尺寸小于 min / 2 时可自动吸附折叠到 0\n\t\t\tif (leftPanel?.props.collapsible && leftMin > 0 && targetLeft < leftMin / 2) {\n\t\t\t\ttargetLeft = 0;\n\t\t\t\ttargetRight = sourceSizes[index] + sourceSizes[index + 1];\n\t\t\t} else if (rightPanel?.props.collapsible && rightMin > 0 && targetRight < rightMin / 2) {\n\t\t\t\ttargetRight = 0;\n\t\t\t\ttargetLeft = sourceSizes[index] + sourceSizes[index + 1];\n\t\t\t} else {\n\t\t\t\tconst minDelta = Math.max(leftMin - sourceSizes[index], sourceSizes[index + 1] - rightMax);\n\t\t\t\tconst maxDelta = Math.min(leftMax - sourceSizes[index], sourceSizes[index + 1] - rightMin);\n\t\t\t\tconst safeDelta = clamp(delta, minDelta, maxDelta);\n\n\t\t\t\ttargetLeft = sourceSizes[index] + safeDelta;\n\t\t\t\ttargetRight = sourceSizes[index + 1] - safeDelta;\n\t\t\t}\n\n\t\t\tnextSizes[index] = targetLeft;\n\t\t\tnextSizes[index + 1] = targetRight;\n\t\t\treturn normalizeToTrack(nextSizes);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels],\n\t);\n\n\tconst resizePair = useCallback(\n\t\t(index: number, delta: number, notify = true) => {\n\t\t\tupdateSizes(getResizedPair(sizesRef.current, index, delta), notify);\n\t\t},\n\t\t[getResizedPair, updateSizes],\n\t);\n\n\tconst startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst startPosition = getPointerPosition(event, resolvedOrientation);\n\t\tconst startSizes = [...sizesRef.current];\n\t\tlet latestSizes = startSizes;\n\n\t\tsetDraggingIndex(index);\n\t\tonResizeStart?.(roundSizes(startSizes));\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\n\t\t\tlatestSizes = getResizedPair(startSizes, index, delta);\n\t\t\tif (!lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tdocument.removeEventListener('pointermove', handlePointerMove);\n\t\t\tdocument.removeEventListener('pointerup', handlePointerUp);\n\t\t\tsetDraggingIndex(null);\n\t\t\tif (lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t\t};\n\n\t\tdocument.addEventListener('pointermove', handlePointerMove);\n\t\tdocument.addEventListener('pointerup', handlePointerUp);\n\t};\n\n\tconst toggleCollapse = (index: number, neighborIndex: number) => {\n\t\tconst nextSizes = [...sizesRef.current];\n\n\t\tif (nextSizes[index] > 1) {\n\t\t\tlastNonZeroSizesRef.current[index] = nextSizes[index];\n\t\t\tnextSizes[neighborIndex] += nextSizes[index];\n\t\t\tnextSizes[index] = 0;\n\t\t} else {\n\t\t\tconst restoredSize =\n\t\t\t\tlastNonZeroSizesRef.current[index] ||\n\t\t\t\tparseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\n\t\t\tnextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\n\t\t\tnextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\n\t\t}\n\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t};\n\n\tconst resetSizes = () => {\n\t\tconst nextSizes = buildInitialSizes();\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(nextSizes));\n\t};\n\n\tconst rootStyle: CSSProperties = {\n\t\tborder: '1px solid #f0f0f0',\n\t\tborderRadius: 8,\n\t\tboxSizing: 'border-box',\n\t\tdisplay: 'flex',\n\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\n\t\theight: 360,\n\t\tminHeight: 0,\n\t\toverflow: 'hidden',\n\t\tposition: 'relative',\n\t\twidth: '100%',\n\t\t...style,\n\t};\n\n\tconst renderCollapseButton = (\n\t\tdraggerIndex: number,\n\t\tpanelIndex: number,\n\t\tdirection: 'start' | 'end',\n\t) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tconst isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\n\n\t\t// 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\n\t\tif (isCollapsed || isNeighborCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// 展开时箭头指向面板将被折叠到的方向\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? LeftOutlined\n\t\t\t\t\t: RightOutlined\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? UpOutlined\n\t\t\t\t\t: DownOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"折叠面板\"\n\t\t\t\ttitle=\"折叠面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t\tboxShadow: '0 2px 4px rgba(0,0,0,0.08)',\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\t// 渲染处于折叠状态下的“展开”触发手柄(挂载在根容器内侧 8px 处,100% 常显、绝对不被裁剪)\n\tconst renderCollapsedExpandHandle = (panelIndex: number) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isCollapsed = sizes.length > 0 && (sizes[panelIndex] ?? 0) <= 1;\n\t\tif (!isCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isFirstPanel = panelIndex === 0;\n\t\tconst neighborIndex = isFirstPanel ? panelIndex + 1 : panelIndex - 1;\n\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? RightOutlined // 左面板折叠后,图标指向右 > (展开左面板)\n\t\t\t\t\t: LeftOutlined // 右面板折叠后,图标指向左 < (展开右面板)\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? DownOutlined\n\t\t\t\t\t: UpOutlined;\n\n\t\tconst label =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? '展开左侧面板'\n\t\t\t\t\t: '展开右侧面板'\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? '展开上方面板'\n\t\t\t\t\t: '展开下方面板';\n\n\t\tconst positionStyle: CSSProperties =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? { left: 8, top: '50%', transform: 'translateY(-50%)' }\n\t\t\t\t\t: { right: 8, top: '50%', transform: 'translateY(-50%)' }\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? { top: 8, left: '50%', transform: 'translateX(-50%)' }\n\t\t\t\t\t: { bottom: 8, left: '50%', transform: 'translateX(-50%)' };\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label={label}\n\t\t\t\tkey={`collapsed-handle-${panelIndex}`}\n\t\t\t\ttitle={label}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #1677ff',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#1677ff',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 24,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 24,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t\tboxShadow: '0 2px 8px rgba(22, 119, 255, 0.35)',\n\t\t\t\t\tzIndex: 20,\n\t\t\t\t\t...positionStyle,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className={className} ref={rootRef} style={rootStyle}>\n\t\t\t{panels.map((panel, index) => {\n\t\t\t\tconst isHidden = sizes[index] <= 1;\n\t\t\t\tconst isLeftOrTopCollapsed = (sizes[index] ?? 0) <= 1;\n\t\t\t\tconst isRightOrBottomCollapsed = (sizes[index + 1] ?? 0) <= 1;\n\t\t\t\tconst isAnyCollapsed = isLeftOrTopCollapsed || isRightOrBottomCollapsed;\n\n\t\t\t\treturn (\n\t\t\t\t\t<React.Fragment key={index}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackground: index % 2 ? '#fff' : '#fafafa',\n\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\tflex: `0 0 ${sizes[index] ?? 0}px`,\n\t\t\t\t\t\t\t\tminHeight: 0,\n\t\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpadding: isHidden ? 0 : 16,\n\t\t\t\t\t\t\t\ttransition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\n\t\t\t\t\t\t\t\t...panel.props.style,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!isHidden && panel.props.children}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{index < panels.length - 1 && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tif (isRightOrBottomCollapsed) {\n\t\t\t\t\t\t\t\t\t\ttoggleCollapse(index + 1, index);\n\t\t\t\t\t\t\t\t\t} else if (isLeftOrTopCollapsed) {\n\t\t\t\t\t\t\t\t\t\ttoggleCollapse(index, index + 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonDoubleClick={resetSizes}\n\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\tconst step = event.shiftKey ? 40 : 10;\n\t\t\t\t\t\t\t\t\tconst directionMap =\n\t\t\t\t\t\t\t\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? { ArrowLeft: -step, ArrowRight: step }\n\t\t\t\t\t\t\t\t\t\t\t: { ArrowUp: -step, ArrowDown: step };\n\t\t\t\t\t\t\t\t\tconst delta = directionMap[event.key as keyof typeof directionMap];\n\t\t\t\t\t\t\t\t\tif (delta !== undefined) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tresizePair(index, delta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonPointerDown={(event) => startResize(index, event)}\n\t\t\t\t\t\t\t\tonPointerEnter={() => setHoveredIndex(index)}\n\t\t\t\t\t\t\t\tonPointerLeave={() => setHoveredIndex(null)}\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\ttitle={isAnyCollapsed ? '点击可展开恢复面板' : '拖动调整大小,双击重置'}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index || isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t\t? '#e6f4ff'\n\t\t\t\t\t\t\t\t\t\t\t: '#f5f5f5',\n\t\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\t\tcursor: isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t? 'pointer'\n\t\t\t\t\t\t\t\t\t\t: resolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? 'col-resize'\n\t\t\t\t\t\t\t\t\t\t\t: 'row-resize',\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflex: `0 0 ${DRAGGER_SIZE}px`,\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\toutline: 'none',\n\t\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\t\tuserSelect: 'none',\n\t\t\t\t\t\t\t\t\tzIndex: isAnyCollapsed ? 2 : 1,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index || isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t\t\t? '#1677ff'\n\t\t\t\t\t\t\t\t\t\t\t\t: '#d9d9d9',\n\t\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\t\theight: resolvedOrientation === 'horizontal' ? 48 : 2,\n\t\t\t\t\t\t\t\t\t\twidth: resolvedOrientation === 'horizontal' ? 2 : 48,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t{/* 未折叠状态下呈现折叠按钮 */}\n\t\t\t\t\t\t\t\t{!isAnyCollapsed && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\n\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t\topacity: hoveredIndex === index ? 1 : 0.85,\n\t\t\t\t\t\t\t\t\t\t\ttransition: 'opacity 0.15s ease',\n\t\t\t\t\t\t\t\t\t\t\tpointerEvents: 'auto',\n\t\t\t\t\t\t\t\t\t\t\tzIndex: 5,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index, 'start')}\n\t\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index + 1, 'end')}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</React.Fragment>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{/* 当有面板处于折叠状态时,在根容器内部边缘常显渲染展开手柄 */}\n\t\t\t{panels.map((_, index) => renderCollapsedExpandHandle(index))}\n\t\t</div>\n\t);\n};\n\nCustomSplitter.Panel = SplitterPan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,KAAK;AAAA;AAAA;AAAA,cAC9C;AAAA;AAAA;AAAA,QAEF;AAAA,WAjGmB,KAmGrB;AAAA,IAEF,CAAC;AAAA,IAGA,OAAO,IAAI,CAAC,GAAG,UAAU,4BAA4B,KAAK,CAAC;AAAA,KAC7D;AAEF;AAEA,eAAe,QAAQ;AAEvB,IAAO,mBAAQ;","names":["import_jsx_runtime","import_react","import_jsx_runtime","React"]}
|
package/dist/index.js
CHANGED
|
@@ -180,7 +180,6 @@ var CollapseBox_default = CollapsibleBox;
|
|
|
180
180
|
import React, { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
|
|
181
181
|
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
182
182
|
var DRAGGER_SIZE = 8;
|
|
183
|
-
var MIN_PANEL_SIZE = 0;
|
|
184
183
|
var SplitterPanel = ({ children }) => /* @__PURE__ */ jsx3(Fragment, { children });
|
|
185
184
|
var isPercentSize = (value) => typeof value === "string" && value.endsWith("%");
|
|
186
185
|
var parseSize = (value, total, fallback) => {
|
|
@@ -224,7 +223,7 @@ var CustomSplitter = ({
|
|
|
224
223
|
const getPanelMin = useCallback(
|
|
225
224
|
(index) => {
|
|
226
225
|
var _a;
|
|
227
|
-
return parseSize((_a = panels[index]) == null ? void 0 : _a.props.min, trackSize,
|
|
226
|
+
return parseSize((_a = panels[index]) == null ? void 0 : _a.props.min, trackSize, 0);
|
|
228
227
|
},
|
|
229
228
|
[panels, trackSize]
|
|
230
229
|
);
|
|
@@ -243,10 +242,17 @@ var CustomSplitter = ({
|
|
|
243
242
|
const normalized = [...nextSizes];
|
|
244
243
|
const diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);
|
|
245
244
|
const flexibleIndex = normalized.findIndex((size) => size > 0);
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
if (flexibleIndex !== -1) {
|
|
246
|
+
normalized[flexibleIndex] += diff;
|
|
247
|
+
}
|
|
248
|
+
return normalized.map((size, index) => {
|
|
249
|
+
if (size <= 1) {
|
|
250
|
+
return 0;
|
|
251
|
+
}
|
|
252
|
+
return clamp(size, getPanelMin(index), getPanelMax(index));
|
|
253
|
+
});
|
|
248
254
|
},
|
|
249
|
-
[getPanelMax, trackSize]
|
|
255
|
+
[getPanelMax, getPanelMin, trackSize]
|
|
250
256
|
);
|
|
251
257
|
const buildInitialSizes = useCallback(
|
|
252
258
|
(previous) => {
|
|
@@ -298,8 +304,7 @@ var CustomSplitter = ({
|
|
|
298
304
|
return void 0;
|
|
299
305
|
}
|
|
300
306
|
const syncSize = () => {
|
|
301
|
-
|
|
302
|
-
setContainerSize(resolvedOrientation === "horizontal" ? rect.width : rect.height);
|
|
307
|
+
setContainerSize(resolvedOrientation === "horizontal" ? node.clientWidth : node.clientHeight);
|
|
303
308
|
};
|
|
304
309
|
syncSize();
|
|
305
310
|
const observer = new ResizeObserver(syncSize);
|
|
@@ -319,20 +324,32 @@ var CustomSplitter = ({
|
|
|
319
324
|
const getResizedPair = useCallback(
|
|
320
325
|
(sourceSizes, index, delta) => {
|
|
321
326
|
const nextSizes = [...sourceSizes];
|
|
322
|
-
const
|
|
323
|
-
const
|
|
327
|
+
const leftPanel = panels[index];
|
|
328
|
+
const rightPanel = panels[index + 1];
|
|
324
329
|
const leftMin = getPanelMin(index);
|
|
325
330
|
const rightMin = getPanelMin(index + 1);
|
|
326
331
|
const leftMax = getPanelMax(index);
|
|
327
332
|
const rightMax = getPanelMax(index + 1);
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
+
let targetLeft = sourceSizes[index] + delta;
|
|
334
|
+
let targetRight = sourceSizes[index + 1] - delta;
|
|
335
|
+
if ((leftPanel == null ? void 0 : leftPanel.props.collapsible) && leftMin > 0 && targetLeft < leftMin / 2) {
|
|
336
|
+
targetLeft = 0;
|
|
337
|
+
targetRight = sourceSizes[index] + sourceSizes[index + 1];
|
|
338
|
+
} else if ((rightPanel == null ? void 0 : rightPanel.props.collapsible) && rightMin > 0 && targetRight < rightMin / 2) {
|
|
339
|
+
targetRight = 0;
|
|
340
|
+
targetLeft = sourceSizes[index] + sourceSizes[index + 1];
|
|
341
|
+
} else {
|
|
342
|
+
const minDelta = Math.max(leftMin - sourceSizes[index], sourceSizes[index + 1] - rightMax);
|
|
343
|
+
const maxDelta = Math.min(leftMax - sourceSizes[index], sourceSizes[index + 1] - rightMin);
|
|
344
|
+
const safeDelta = clamp(delta, minDelta, maxDelta);
|
|
345
|
+
targetLeft = sourceSizes[index] + safeDelta;
|
|
346
|
+
targetRight = sourceSizes[index + 1] - safeDelta;
|
|
347
|
+
}
|
|
348
|
+
nextSizes[index] = targetLeft;
|
|
349
|
+
nextSizes[index + 1] = targetRight;
|
|
333
350
|
return normalizeToTrack(nextSizes);
|
|
334
351
|
},
|
|
335
|
-
[getPanelMax, getPanelMin, normalizeToTrack]
|
|
352
|
+
[getPanelMax, getPanelMin, normalizeToTrack, panels]
|
|
336
353
|
);
|
|
337
354
|
const resizePair = useCallback(
|
|
338
355
|
(index, delta, notify = true) => {
|
|
@@ -391,11 +408,13 @@ var CustomSplitter = ({
|
|
|
391
408
|
const rootStyle = {
|
|
392
409
|
border: "1px solid #f0f0f0",
|
|
393
410
|
borderRadius: 8,
|
|
411
|
+
boxSizing: "border-box",
|
|
394
412
|
display: "flex",
|
|
395
413
|
flexDirection: resolvedOrientation === "horizontal" ? "row" : "column",
|
|
396
414
|
height: 360,
|
|
397
415
|
minHeight: 0,
|
|
398
416
|
overflow: "hidden",
|
|
417
|
+
position: "relative",
|
|
399
418
|
width: "100%",
|
|
400
419
|
...style
|
|
401
420
|
};
|
|
@@ -433,141 +452,165 @@ var CustomSplitter = ({
|
|
|
433
452
|
justifyContent: "center",
|
|
434
453
|
padding: 0,
|
|
435
454
|
width: 20,
|
|
436
|
-
fontSize: 12
|
|
455
|
+
fontSize: 12,
|
|
456
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.08)"
|
|
437
457
|
},
|
|
438
458
|
type: "button",
|
|
439
459
|
children: /* @__PURE__ */ jsx3(Icon, {})
|
|
440
460
|
}
|
|
441
461
|
);
|
|
442
462
|
};
|
|
443
|
-
const
|
|
463
|
+
const renderCollapsedExpandHandle = (panelIndex) => {
|
|
444
464
|
var _a;
|
|
445
465
|
const panel = panels[panelIndex];
|
|
446
466
|
if (!(panel == null ? void 0 : panel.props.collapsible)) {
|
|
447
467
|
return null;
|
|
448
468
|
}
|
|
449
|
-
const isCollapsed = ((_a = sizes[panelIndex]) != null ? _a : 0) <= 1;
|
|
469
|
+
const isCollapsed = sizes.length > 0 && ((_a = sizes[panelIndex]) != null ? _a : 0) <= 1;
|
|
450
470
|
if (!isCollapsed) {
|
|
451
471
|
return null;
|
|
452
472
|
}
|
|
453
|
-
const
|
|
454
|
-
const
|
|
473
|
+
const isFirstPanel = panelIndex === 0;
|
|
474
|
+
const neighborIndex = isFirstPanel ? panelIndex + 1 : panelIndex - 1;
|
|
475
|
+
const Icon = resolvedOrientation === "horizontal" ? isFirstPanel ? RightOutlined : LeftOutlined : isFirstPanel ? DownOutlined : UpOutlined;
|
|
476
|
+
const label = resolvedOrientation === "horizontal" ? isFirstPanel ? "\u5C55\u5F00\u5DE6\u4FA7\u9762\u677F" : "\u5C55\u5F00\u53F3\u4FA7\u9762\u677F" : isFirstPanel ? "\u5C55\u5F00\u4E0A\u65B9\u9762\u677F" : "\u5C55\u5F00\u4E0B\u65B9\u9762\u677F";
|
|
477
|
+
const positionStyle = resolvedOrientation === "horizontal" ? isFirstPanel ? { left: 8, top: "50%", transform: "translateY(-50%)" } : { right: 8, top: "50%", transform: "translateY(-50%)" } : isFirstPanel ? { top: 8, left: "50%", transform: "translateX(-50%)" } : { bottom: 8, left: "50%", transform: "translateX(-50%)" };
|
|
455
478
|
return /* @__PURE__ */ jsx3(
|
|
456
479
|
"button",
|
|
457
480
|
{
|
|
458
|
-
"aria-label":
|
|
459
|
-
title:
|
|
481
|
+
"aria-label": label,
|
|
482
|
+
title: label,
|
|
460
483
|
onClick: (event) => {
|
|
461
484
|
event.stopPropagation();
|
|
462
485
|
toggleCollapse(panelIndex, neighborIndex);
|
|
463
486
|
},
|
|
464
487
|
style: {
|
|
488
|
+
position: "absolute",
|
|
465
489
|
alignItems: "center",
|
|
466
490
|
background: "#fff",
|
|
467
|
-
border: "1px solid #
|
|
491
|
+
border: "1px solid #1677ff",
|
|
468
492
|
borderRadius: 4,
|
|
469
|
-
color: "#
|
|
493
|
+
color: "#1677ff",
|
|
470
494
|
cursor: "pointer",
|
|
471
495
|
display: "flex",
|
|
472
|
-
height:
|
|
496
|
+
height: 24,
|
|
473
497
|
justifyContent: "center",
|
|
474
498
|
padding: 0,
|
|
475
|
-
width:
|
|
476
|
-
fontSize: 12
|
|
499
|
+
width: 24,
|
|
500
|
+
fontSize: 12,
|
|
501
|
+
boxShadow: "0 2px 8px rgba(22, 119, 255, 0.35)",
|
|
502
|
+
zIndex: 20,
|
|
503
|
+
...positionStyle
|
|
477
504
|
},
|
|
478
505
|
type: "button",
|
|
479
506
|
children: /* @__PURE__ */ jsx3(Icon, {})
|
|
480
|
-
}
|
|
507
|
+
},
|
|
508
|
+
`collapsed-handle-${panelIndex}`
|
|
481
509
|
);
|
|
482
510
|
};
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
onPointerDown: (event) => startResize(index, event),
|
|
518
|
-
onPointerEnter: () => setHoveredIndex(index),
|
|
519
|
-
onPointerLeave: () => setHoveredIndex(null),
|
|
520
|
-
role: "separator",
|
|
521
|
-
style: {
|
|
522
|
-
alignItems: "center",
|
|
523
|
-
background: hoveredIndex === index || draggingIndex === index ? "#e6f4ff" : "#f5f5f5",
|
|
524
|
-
cursor: resolvedOrientation === "horizontal" ? "col-resize" : "row-resize",
|
|
525
|
-
display: "flex",
|
|
526
|
-
flex: `0 0 ${DRAGGER_SIZE}px`,
|
|
527
|
-
justifyContent: "center",
|
|
528
|
-
outline: "none",
|
|
529
|
-
position: "relative",
|
|
530
|
-
userSelect: "none",
|
|
531
|
-
zIndex: 1
|
|
532
|
-
},
|
|
533
|
-
tabIndex: 0,
|
|
534
|
-
children: [
|
|
535
|
-
/* @__PURE__ */ jsx3(
|
|
536
|
-
"div",
|
|
537
|
-
{
|
|
538
|
-
style: {
|
|
539
|
-
background: hoveredIndex === index || draggingIndex === index ? "#1677ff" : "#d9d9d9",
|
|
540
|
-
borderRadius: 2,
|
|
541
|
-
height: resolvedOrientation === "horizontal" ? 48 : 2,
|
|
542
|
-
width: resolvedOrientation === "horizontal" ? 2 : 48
|
|
543
|
-
}
|
|
511
|
+
return /* @__PURE__ */ jsxs2("div", { className, ref: rootRef, style: rootStyle, children: [
|
|
512
|
+
panels.map((panel, index) => {
|
|
513
|
+
var _a, _b, _c;
|
|
514
|
+
const isHidden = sizes[index] <= 1;
|
|
515
|
+
const isLeftOrTopCollapsed = ((_a = sizes[index]) != null ? _a : 0) <= 1;
|
|
516
|
+
const isRightOrBottomCollapsed = ((_b = sizes[index + 1]) != null ? _b : 0) <= 1;
|
|
517
|
+
const isAnyCollapsed = isLeftOrTopCollapsed || isRightOrBottomCollapsed;
|
|
518
|
+
return /* @__PURE__ */ jsxs2(React.Fragment, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx3(
|
|
520
|
+
"div",
|
|
521
|
+
{
|
|
522
|
+
style: {
|
|
523
|
+
background: index % 2 ? "#fff" : "#fafafa",
|
|
524
|
+
boxSizing: "border-box",
|
|
525
|
+
flex: `0 0 ${(_c = sizes[index]) != null ? _c : 0}px`,
|
|
526
|
+
minHeight: 0,
|
|
527
|
+
minWidth: 0,
|
|
528
|
+
overflow: "auto",
|
|
529
|
+
padding: isHidden ? 0 : 16,
|
|
530
|
+
transition: draggingIndex === null ? "flex-basis 0.2s ease" : void 0,
|
|
531
|
+
...panel.props.style
|
|
532
|
+
},
|
|
533
|
+
children: !isHidden && panel.props.children
|
|
534
|
+
}
|
|
535
|
+
),
|
|
536
|
+
index < panels.length - 1 && /* @__PURE__ */ jsxs2(
|
|
537
|
+
"div",
|
|
538
|
+
{
|
|
539
|
+
"aria-orientation": resolvedOrientation,
|
|
540
|
+
onClick: () => {
|
|
541
|
+
if (isRightOrBottomCollapsed) {
|
|
542
|
+
toggleCollapse(index + 1, index);
|
|
543
|
+
} else if (isLeftOrTopCollapsed) {
|
|
544
|
+
toggleCollapse(index, index + 1);
|
|
544
545
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
opacity: hoveredIndex === index || ((_b = sizes[index]) != null ? _b : 0) <= 1 || ((_c = sizes[index + 1]) != null ? _c : 0) <= 1 ? 1 : 0,
|
|
555
|
-
transition: "opacity 0.15s ease",
|
|
556
|
-
pointerEvents: hoveredIndex === index || ((_d = sizes[index]) != null ? _d : 0) <= 1 || ((_e = sizes[index + 1]) != null ? _e : 0) <= 1 ? "auto" : "none"
|
|
557
|
-
},
|
|
558
|
-
children: [
|
|
559
|
-
renderCollapseButton(index, index, "start"),
|
|
560
|
-
renderCollapseButton(index, index + 1, "end"),
|
|
561
|
-
renderExpandButton(index, "start"),
|
|
562
|
-
renderExpandButton(index + 1, "end")
|
|
563
|
-
]
|
|
546
|
+
},
|
|
547
|
+
onDoubleClick: resetSizes,
|
|
548
|
+
onKeyDown: (event) => {
|
|
549
|
+
const step = event.shiftKey ? 40 : 10;
|
|
550
|
+
const directionMap = resolvedOrientation === "horizontal" ? { ArrowLeft: -step, ArrowRight: step } : { ArrowUp: -step, ArrowDown: step };
|
|
551
|
+
const delta = directionMap[event.key];
|
|
552
|
+
if (delta !== void 0) {
|
|
553
|
+
event.preventDefault();
|
|
554
|
+
resizePair(index, delta);
|
|
564
555
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
556
|
+
},
|
|
557
|
+
onPointerDown: (event) => startResize(index, event),
|
|
558
|
+
onPointerEnter: () => setHoveredIndex(index),
|
|
559
|
+
onPointerLeave: () => setHoveredIndex(null),
|
|
560
|
+
role: "separator",
|
|
561
|
+
title: isAnyCollapsed ? "\u70B9\u51FB\u53EF\u5C55\u5F00\u6062\u590D\u9762\u677F" : "\u62D6\u52A8\u8C03\u6574\u5927\u5C0F\uFF0C\u53CC\u51FB\u91CD\u7F6E",
|
|
562
|
+
style: {
|
|
563
|
+
alignItems: "center",
|
|
564
|
+
background: hoveredIndex === index || draggingIndex === index || isAnyCollapsed ? "#e6f4ff" : "#f5f5f5",
|
|
565
|
+
boxSizing: "border-box",
|
|
566
|
+
cursor: isAnyCollapsed ? "pointer" : resolvedOrientation === "horizontal" ? "col-resize" : "row-resize",
|
|
567
|
+
display: "flex",
|
|
568
|
+
flex: `0 0 ${DRAGGER_SIZE}px`,
|
|
569
|
+
justifyContent: "center",
|
|
570
|
+
outline: "none",
|
|
571
|
+
position: "relative",
|
|
572
|
+
userSelect: "none",
|
|
573
|
+
zIndex: isAnyCollapsed ? 2 : 1
|
|
574
|
+
},
|
|
575
|
+
tabIndex: 0,
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ jsx3(
|
|
578
|
+
"div",
|
|
579
|
+
{
|
|
580
|
+
style: {
|
|
581
|
+
background: hoveredIndex === index || draggingIndex === index || isAnyCollapsed ? "#1677ff" : "#d9d9d9",
|
|
582
|
+
borderRadius: 2,
|
|
583
|
+
height: resolvedOrientation === "horizontal" ? 48 : 2,
|
|
584
|
+
width: resolvedOrientation === "horizontal" ? 2 : 48
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
),
|
|
588
|
+
!isAnyCollapsed && /* @__PURE__ */ jsxs2(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
style: {
|
|
592
|
+
position: "absolute",
|
|
593
|
+
display: "flex",
|
|
594
|
+
flexDirection: resolvedOrientation === "horizontal" ? "column" : "row",
|
|
595
|
+
gap: 4,
|
|
596
|
+
opacity: hoveredIndex === index ? 1 : 0.85,
|
|
597
|
+
transition: "opacity 0.15s ease",
|
|
598
|
+
pointerEvents: "auto",
|
|
599
|
+
zIndex: 5
|
|
600
|
+
},
|
|
601
|
+
children: [
|
|
602
|
+
renderCollapseButton(index, index, "start"),
|
|
603
|
+
renderCollapseButton(index, index + 1, "end")
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
] }, index);
|
|
611
|
+
}),
|
|
612
|
+
panels.map((_, index) => renderCollapsedExpandHandle(index))
|
|
613
|
+
] });
|
|
571
614
|
};
|
|
572
615
|
CustomSplitter.Panel = SplitterPanel;
|
|
573
616
|
var Splitter_default = CustomSplitter;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../CollapseBox/index.tsx","../src/icons.tsx","../Splitter/index.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\nimport { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport './index.less';\n\nexport type CollapseBoxDirection = 'horizontal' | 'vertical';\nexport type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport interface CollapseBoxProps {\n\tchildren?: ReactNode;\n\ttitle?: string;\n\tdirection?: CollapseBoxDirection;\n\tbuttonPosition?: CollapseBoxButtonPosition;\n\tdefaultWidth?: number | string;\n\tdefaultHeight?: number | string;\n\tcontentPadding?: string;\n\theaderHeight?: number;\n\tclassName?: string;\n}\n\nconst formatDimension = (value?: number | string): string | undefined => {\n\tif (value === undefined || value === null) return undefined;\n\treturn typeof value === 'number' ? `${value}px` : value;\n};\n\nconst ChevronLeft = () => <LeftOutlined />;\n\nconst ChevronRight = () => <RightOutlined />;\n\nconst ChevronUp = () => <UpOutlined />;\n\nconst ChevronDown = () => <DownOutlined />;\n\nconst CollapsibleBox = ({\n\tchildren,\n\ttitle = '内容区域',\n\tdirection = 'horizontal',\n\tbuttonPosition = 'right',\n\tdefaultWidth = 600,\n\tdefaultHeight = 300,\n\tcontentPadding = '16px',\n\theaderHeight = 16,\n\tclassName,\n}: CollapseBoxProps) => {\n\tconst [isExpanded, setIsExpanded] = useState(true);\n\n\tconst getContentMaxHeight = () => {\n\t\tif (typeof defaultHeight === 'number') {\n\t\t\treturn `${defaultHeight - headerHeight}px`;\n\t\t}\n\t\tif (typeof defaultHeight === 'string') {\n\t\t\treturn headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n\t\t}\n\t\treturn '100%';\n\t};\n\n\tconst getIcon = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\tif (buttonPosition === 'right') {\n\t\t\t\treturn isExpanded ? <ChevronRight /> : <ChevronLeft />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronLeft /> : <ChevronRight />;\n\t\t\t}\n\t\t} else {\n\t\t\tif (buttonPosition === 'bottom') {\n\t\t\t\treturn isExpanded ? <ChevronUp /> : <ChevronDown />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronDown /> : <ChevronUp />;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst getButtonClass = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\treturn buttonPosition === 'right' ? 'button-right' : 'button-left';\n\t\t} else {\n\t\t\treturn buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n\t\t}\n\t};\n\n\tconst getContainerStyle = (): CSSProperties => {\n\t\tconst resolvedHeight = formatDimension(defaultHeight);\n\t\tconst resolvedWidth = formatDimension(defaultWidth);\n\t\tif (direction === 'horizontal') {\n\t\t\treturn {\n\t\t\t\twidth: isExpanded ? resolvedWidth : '0px',\n\t\t\t\theight: resolvedHeight,\n\t\t\t\tminWidth: 0,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\theight: isExpanded ? resolvedHeight : '0px',\n\t\t\t\twidth: resolvedWidth,\n\t\t\t\tminHeight: 0,\n\t\t\t};\n\t\t}\n\t};\n\n\tconst baseWrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\tconst wrapperClass = className ? `${baseWrapperClass} ${className}` : baseWrapperClass;\n\n\tconst containerClass =\n\t\tdirection === 'horizontal' && buttonPosition === 'right'\n\t\t\t? 'collapsible-container align-right'\n\t\t\t: 'collapsible-container';\n\tconst height = getContentMaxHeight();\n\tconst contentStyle: CSSProperties = {\n\t\tmaxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n\t\toverflowY: 'auto',\n\t\tpadding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n\t\tboxSizing: 'border-box',\n\t};\n\n\t// 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n\tconst buttonStyle: CSSProperties =\n\t\tdirection === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n\t\t\t? { top: '0px', bottom: 'auto' }\n\t\t\t: {};\n\n\t// 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n\t// 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n\tconst formattedWidth = formatDimension(defaultWidth);\n\tconst formattedHeight = formatDimension(defaultHeight);\n\tconst wrapperStyle: CSSProperties | undefined =\n\t\tdirection === 'vertical'\n\t\t\t? isExpanded\n\t\t\t\t? {\n\t\t\t\t\t\theight: formattedHeight,\n\t\t\t\t\t\twidth: formattedWidth,\n\t\t\t\t\t}\n\t\t\t\t: { height: 0, width: formattedWidth }\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div className={wrapperClass} style={wrapperStyle}>\n\t\t\t<div style={getContainerStyle()} className={containerClass}>\n\t\t\t\t{title && (\n\t\t\t\t\t<div className=\"collapsible-header\" style={{ display: 'none' }}>\n\t\t\t\t\t\t<h3>{title}</h3>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"collapsible-content\" style={contentStyle}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tonClick={() => setIsExpanded(!isExpanded)}\n\t\t\t\tclassName={`toggle-button ${getButtonClass()}`}\n\t\t\t\tstyle={buttonStyle}\n\t\t\t\ttitle={isExpanded ? '隐藏' : '展开'}\n\t\t\t>\n\t\t\t\t{getIcon()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n}\n\nconst baseStyle: CSSProperties = {\n\tdisplay: 'inline-block',\n\twidth: '1em',\n\theight: '1em',\n\tverticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"left\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" />\n\t</svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"right\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" />\n\t</svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"up\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M890.5 755.3L537.4 268a31.96 31.96 0 00-50.8 0L133.5 755.3a7.95 7.95 0 006.3 12.7h75.5c4.9 0 9.6-2.3 12.6-6.1l281-360 281 360c3 3.8 7.7 6.1 12.6 6.1h75.5c6.7 0 10.4-7.6 6.1-12.7z\" />\n\t</svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"down\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 37 17.6 49.8 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" />\n\t</svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport type {\n\tCSSProperties,\n\tReactElement,\n\tReactNode,\n\tPointerEvent as ReactPointerEvent,\n} from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type SplitterSize = number | `${number}%`;\nexport type SplitterOrientation = 'horizontal' | 'vertical';\n\nexport type SplitterPanelProps = {\n\tchildren?: ReactNode;\n\tcollapsible?: boolean;\n\tdefaultSize?: SplitterSize;\n\tmax?: SplitterSize;\n\tmin?: SplitterSize;\n\tresizable?: boolean;\n\tsize?: SplitterSize;\n\tstyle?: CSSProperties;\n};\n\nexport type SplitterProps = {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tlazy?: boolean;\n\tonResize?: (sizes: number[]) => void;\n\tonResizeEnd?: (sizes: number[]) => void;\n\tonResizeStart?: (sizes: number[]) => void;\n\torientation?: SplitterOrientation;\n\tstyle?: CSSProperties;\n\tvertical?: boolean;\n};\n\ntype SplitterComponent = React.FC<SplitterProps> & {\n\tPanel: React.FC<SplitterPanelProps>;\n};\n\nconst DRAGGER_SIZE = 8;\nconst MIN_PANEL_SIZE = 0;\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\n\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\n\ttypeof value === 'string' && value.endsWith('%');\n\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\n\tif (value === undefined) {\n\t\treturn fallback;\n\t}\n\n\tif (isPercentSize(value)) {\n\t\treturn (Number.parseFloat(value) / 100) * total;\n\t}\n\n\treturn Number(value);\n};\n\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\n\nconst getPointerPosition = (\n\tevent: PointerEvent | ReactPointerEvent,\n\torientation: SplitterOrientation,\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nconst CustomSplitter: SplitterComponent = ({\n\tchildren,\n\tclassName,\n\tlazy = false,\n\tonResize,\n\tonResizeEnd,\n\tonResizeStart,\n\torientation,\n\tstyle,\n\tvertical = false,\n}) => {\n\tconst resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\n\tconst rootRef = useRef<HTMLDivElement>(null);\n\tconst sizesRef = useRef<number[]>([]);\n\tconst lastNonZeroSizesRef = useRef<number[]>([]);\n\tconst [containerSize, setContainerSize] = useState(0);\n\tconst [draggingIndex, setDraggingIndex] = useState<number | null>(null);\n\tconst [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\tconst [sizes, setSizes] = useState<number[]>([]);\n\n\tconst panels = useMemo(\n\t\t() =>\n\t\t\tReact.Children.toArray(children).filter(\n\t\t\t\tReact.isValidElement,\n\t\t\t) as ReactElement<SplitterPanelProps>[],\n\t\t[children],\n\t);\n\n\tconst trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\n\n\tconst getPanelMin = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.min, trackSize, MIN_PANEL_SIZE),\n\t\t[panels, trackSize],\n\t);\n\n\tconst getPanelMax = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\n\t\t[panels, trackSize],\n\t);\n\n\tconst normalizeToTrack = useCallback(\n\t\t(nextSizes: number[]) => {\n\t\t\tif (!trackSize || !nextSizes.length) {\n\t\t\t\treturn nextSizes;\n\t\t\t}\n\n\t\t\tconst normalized = [...nextSizes];\n\t\t\tconst diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\n\t\t\tconst flexibleIndex = normalized.findIndex((size) => size > 0);\n\t\t\tnormalized[flexibleIndex === -1 ? 0 : flexibleIndex] += diff;\n\t\t\treturn normalized.map((size, index) => clamp(size, 0, getPanelMax(index)));\n\t\t},\n\t\t[getPanelMax, trackSize],\n\t);\n\n\tconst buildInitialSizes = useCallback(\n\t\t(previous?: number[]) => {\n\t\t\tif (!trackSize || !panels.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif (previous?.length === panels.length) {\n\t\t\t\tconst previousTotal = previous.reduce((sum, size) => sum + size, 0);\n\t\t\t\tif (previousTotal > 0) {\n\t\t\t\t\treturn normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst explicitSizes = panels.map((panel) =>\n\t\t\t\tparseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\n\t\t\t);\n\t\t\tconst usedSize = explicitSizes\n\t\t\t\t.filter((size) => size >= 0)\n\t\t\t\t.reduce((sum, size) => sum + size, 0);\n\t\t\tconst unsetCount = explicitSizes.filter((size) => size < 0).length;\n\t\t\tconst fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\n\n\t\t\treturn normalizeToTrack(\n\t\t\t\texplicitSizes.map((size, index) =>\n\t\t\t\t\tclamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\n\t);\n\n\tconst updateSizes = useCallback(\n\t\t(nextSizes: number[], notify = true) => {\n\t\t\tconst normalized = normalizeToTrack(nextSizes);\n\t\t\tsetSizes(normalized);\n\t\t\tsizesRef.current = normalized;\n\t\t\tnormalized.forEach((size, index) => {\n\t\t\t\tif (size > 1) {\n\t\t\t\t\tlastNonZeroSizesRef.current[index] = size;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (notify) {\n\t\t\t\tonResize?.(roundSizes(normalized));\n\t\t\t}\n\t\t},\n\t\t[normalizeToTrack, onResize],\n\t);\n\n\tuseEffect(() => {\n\t\tconst node = rootRef.current;\n\t\tif (!node) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst syncSize = () => {\n\t\t\tconst rect = node.getBoundingClientRect();\n\t\t\tsetContainerSize(resolvedOrientation === 'horizontal' ? rect.width : rect.height);\n\t\t};\n\t\tsyncSize();\n\n\t\tconst observer = new ResizeObserver(syncSize);\n\t\tobserver.observe(node);\n\t\treturn () => observer.disconnect();\n\t}, [resolvedOrientation]);\n\n\tuseEffect(() => {\n\t\tsetSizes((previous) => {\n\t\t\tconst nextSizes = buildInitialSizes(previous);\n\t\t\tsizesRef.current = nextSizes;\n\t\t\tlastNonZeroSizesRef.current = nextSizes.map((size) =>\n\t\t\t\tMath.max(size, trackSize / Math.max(panels.length, 1)),\n\t\t\t);\n\t\t\treturn nextSizes;\n\t\t});\n\t}, [buildInitialSizes, panels.length, trackSize]);\n\n\tconst getResizedPair = useCallback(\n\t\t(sourceSizes: number[], index: number, delta: number) => {\n\t\t\tconst nextSizes = [...sourceSizes];\n\t\t\tconst leftSize = nextSizes[index];\n\t\t\tconst rightSize = nextSizes[index + 1];\n\t\t\tconst leftMin = getPanelMin(index);\n\t\t\tconst rightMin = getPanelMin(index + 1);\n\t\t\tconst leftMax = getPanelMax(index);\n\t\t\tconst rightMax = getPanelMax(index + 1);\n\t\t\tconst minDelta = Math.max(leftMin - leftSize, rightSize - rightMax);\n\t\t\tconst maxDelta = Math.min(leftMax - leftSize, rightSize - rightMin);\n\t\t\tconst safeDelta = clamp(delta, minDelta, maxDelta);\n\n\t\t\tnextSizes[index] = leftSize + safeDelta;\n\t\t\tnextSizes[index + 1] = rightSize - safeDelta;\n\t\t\treturn normalizeToTrack(nextSizes);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack],\n\t);\n\n\tconst resizePair = useCallback(\n\t\t(index: number, delta: number, notify = true) => {\n\t\t\tupdateSizes(getResizedPair(sizesRef.current, index, delta), notify);\n\t\t},\n\t\t[getResizedPair, updateSizes],\n\t);\n\n\tconst startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst startPosition = getPointerPosition(event, resolvedOrientation);\n\t\tconst startSizes = [...sizesRef.current];\n\t\tlet latestSizes = startSizes;\n\n\t\tsetDraggingIndex(index);\n\t\tonResizeStart?.(roundSizes(startSizes));\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\n\t\t\tlatestSizes = getResizedPair(startSizes, index, delta);\n\t\t\tif (!lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tdocument.removeEventListener('pointermove', handlePointerMove);\n\t\t\tdocument.removeEventListener('pointerup', handlePointerUp);\n\t\t\tsetDraggingIndex(null);\n\t\t\tif (lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t\t};\n\n\t\tdocument.addEventListener('pointermove', handlePointerMove);\n\t\tdocument.addEventListener('pointerup', handlePointerUp);\n\t};\n\n\tconst toggleCollapse = (index: number, neighborIndex: number) => {\n\t\tconst nextSizes = [...sizesRef.current];\n\n\t\tif (nextSizes[index] > 1) {\n\t\t\tlastNonZeroSizesRef.current[index] = nextSizes[index];\n\t\t\tnextSizes[neighborIndex] += nextSizes[index];\n\t\t\tnextSizes[index] = 0;\n\t\t} else {\n\t\t\tconst restoredSize =\n\t\t\t\tlastNonZeroSizesRef.current[index] ||\n\t\t\t\tparseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\n\t\t\tnextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\n\t\t\tnextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\n\t\t}\n\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t};\n\n\tconst resetSizes = () => {\n\t\tconst nextSizes = buildInitialSizes();\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(nextSizes));\n\t};\n\n\tconst rootStyle: CSSProperties = {\n\t\tborder: '1px solid #f0f0f0',\n\t\tborderRadius: 8,\n\t\tdisplay: 'flex',\n\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\n\t\theight: 360,\n\t\tminHeight: 0,\n\t\toverflow: 'hidden',\n\t\twidth: '100%',\n\t\t...style,\n\t};\n\n\tconst renderCollapseButton = (\n\t\tdraggerIndex: number,\n\t\tpanelIndex: number,\n\t\tdirection: 'start' | 'end',\n\t) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tconst isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\n\n\t\t// 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\n\t\tif (isCollapsed || isNeighborCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// 展开时箭头指向面板将被折叠到的方向\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? LeftOutlined\n\t\t\t\t\t: RightOutlined\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? UpOutlined\n\t\t\t\t\t: DownOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"折叠面板\"\n\t\t\t\ttitle=\"折叠面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\t// 渲染\"展开\"按钮:当某个面板被折叠时显示在分隔条上,箭头指向展开方向\n\tconst renderExpandButton = (panelIndex: number, direction: 'start' | 'end') => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tif (!isCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\n\t\t// 折叠后面板展开的方向与折叠方向相反\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? RightOutlined // 左面板折叠后,展开方向朝右\n\t\t\t\t\t: LeftOutlined // 右面板折叠后,展开方向朝左\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? DownOutlined\n\t\t\t\t\t: UpOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"展开面板\"\n\t\t\t\ttitle=\"展开面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className={className} ref={rootRef} style={rootStyle}>\n\t\t\t{panels.map((panel, index) => {\n\t\t\t\tconst isHidden = sizes[index] <= 1;\n\n\t\t\t\treturn (\n\t\t\t\t\t<React.Fragment key={index}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackground: index % 2 ? '#fff' : '#fafafa',\n\t\t\t\t\t\t\t\tflex: `0 0 ${sizes[index] ?? 0}px`,\n\t\t\t\t\t\t\t\tminHeight: 0,\n\t\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpadding: isHidden ? 0 : 16,\n\t\t\t\t\t\t\t\ttransition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\n\t\t\t\t\t\t\t\t...panel.props.style,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!isHidden && panel.props.children}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{index < panels.length - 1 && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t\t\t\t\tonDoubleClick={resetSizes}\n\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\tconst step = event.shiftKey ? 40 : 10;\n\t\t\t\t\t\t\t\t\tconst directionMap =\n\t\t\t\t\t\t\t\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? { ArrowLeft: -step, ArrowRight: step }\n\t\t\t\t\t\t\t\t\t\t\t: { ArrowUp: -step, ArrowDown: step };\n\t\t\t\t\t\t\t\t\tconst delta = directionMap[event.key as keyof typeof directionMap];\n\t\t\t\t\t\t\t\t\tif (delta !== undefined) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tresizePair(index, delta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonPointerDown={(event) => startResize(index, event)}\n\t\t\t\t\t\t\t\tonPointerEnter={() => setHoveredIndex(index)}\n\t\t\t\t\t\t\t\tonPointerLeave={() => setHoveredIndex(null)}\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index ? '#e6f4ff' : '#f5f5f5',\n\t\t\t\t\t\t\t\t\tcursor: resolvedOrientation === 'horizontal' ? 'col-resize' : 'row-resize',\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflex: `0 0 ${DRAGGER_SIZE}px`,\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\toutline: 'none',\n\t\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\t\tuserSelect: 'none',\n\t\t\t\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index ? '#1677ff' : '#d9d9d9',\n\t\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\t\theight: resolvedOrientation === 'horizontal' ? 48 : 2,\n\t\t\t\t\t\t\t\t\t\twidth: resolvedOrientation === 'horizontal' ? 2 : 48,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\n\t\t\t\t\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t\t\t\t\t\topacity:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index] ?? 0) <= 1 ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index + 1] ?? 0) <= 1\n\t\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t\t: 0,\n\t\t\t\t\t\t\t\t\t\ttransition: 'opacity 0.15s ease',\n\t\t\t\t\t\t\t\t\t\tpointerEvents:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index] ?? 0) <= 1 ||\n\t\t\t\t\t\t\t\t\t\t\t(sizes[index + 1] ?? 0) <= 1\n\t\t\t\t\t\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'none',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index, 'start')}\n\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index + 1, 'end')}\n\t\t\t\t\t\t\t\t\t{renderExpandButton(index, 'start')}\n\t\t\t\t\t\t\t\t\t{renderExpandButton(index + 1, 'end')}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</React.Fragment>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n};\n\nCustomSplitter.Panel = SplitterPanel;\n\nexport default CustomSplitter;\n"],"mappings":";AAAA,SAAS,gBAAoD;;;AC0B3D;AAnBF,IAAM,YAA2B;AAAA,EAChC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AAChB;AAEO,IAAM,eAAe,CAAC,EAAE,OAAO,UAAU,MAC/C;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,OAAO,EAAE,GAAG,WAAW,GAAG,MAAM;AAAA,IAChC;AAAA,IAEA,8BAAC,UAAK,GAAE,yLAAwL;AAAA;AACjM;AAGM,IAAM,gBAAgB,CAAC,EAAE,OAAO,UAAU,MAChD;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,OAAO,EAAE,GAAG,WAAW,GAAG,MAAM;AAAA,IAChC;AAAA,IAEA,8BAAC,UAAK,GAAE,0LAAyL;AAAA;AAClM;AAGM,IAAM,aAAa,CAAC,EAAE,OAAO,UAAU,MAC7C;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,OAAO,EAAE,GAAG,WAAW,GAAG,MAAM;AAAA,IAChC;AAAA,IAEA,8BAAC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AChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACxB,IACA;AAAA,kBACJ,YAAY;AAAA,kBACZ,eACC,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACxB,SACA;AAAA,gBACL;AAAA,gBAEC;AAAA,uCAAqB,OAAO,OAAO,OAAO;AAAA,kBAC1C,qBAAqB,OAAO,QAAQ,GAAG,KAAK;AAAA,kBAC5C,mBAAmB,OAAO,OAAO;AAAA,kBACjC,mBAAmB,QAAQ,GAAG,KAAK;AAAA;AAAA;AAAA,YACrC;AAAA;AAAA;AAAA,MACD;AAAA,SAtFmB,KAwFrB;AAAA,EAEF,CAAC,GACF;AAEF;AAEA,eAAe,QAAQ;AAEvB,IAAO,mBAAQ;","names":["jsx","useState","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../CollapseBox/index.tsx","../src/icons.tsx","../Splitter/index.tsx"],"sourcesContent":["import { useState, type CSSProperties, type ReactNode } from 'react';\nimport { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport './index.less';\n\nexport type CollapseBoxDirection = 'horizontal' | 'vertical';\nexport type CollapseBoxButtonPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport interface CollapseBoxProps {\n\tchildren?: ReactNode;\n\ttitle?: string;\n\tdirection?: CollapseBoxDirection;\n\tbuttonPosition?: CollapseBoxButtonPosition;\n\tdefaultWidth?: number | string;\n\tdefaultHeight?: number | string;\n\tcontentPadding?: string;\n\theaderHeight?: number;\n\tclassName?: string;\n}\n\nconst formatDimension = (value?: number | string): string | undefined => {\n\tif (value === undefined || value === null) return undefined;\n\treturn typeof value === 'number' ? `${value}px` : value;\n};\n\nconst ChevronLeft = () => <LeftOutlined />;\n\nconst ChevronRight = () => <RightOutlined />;\n\nconst ChevronUp = () => <UpOutlined />;\n\nconst ChevronDown = () => <DownOutlined />;\n\nconst CollapsibleBox = ({\n\tchildren,\n\ttitle = '内容区域',\n\tdirection = 'horizontal',\n\tbuttonPosition = 'right',\n\tdefaultWidth = 600,\n\tdefaultHeight = 300,\n\tcontentPadding = '16px',\n\theaderHeight = 16,\n\tclassName,\n}: CollapseBoxProps) => {\n\tconst [isExpanded, setIsExpanded] = useState(true);\n\n\tconst getContentMaxHeight = () => {\n\t\tif (typeof defaultHeight === 'number') {\n\t\t\treturn `${defaultHeight - headerHeight}px`;\n\t\t}\n\t\tif (typeof defaultHeight === 'string') {\n\t\t\treturn headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n\t\t}\n\t\treturn '100%';\n\t};\n\n\tconst getIcon = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\tif (buttonPosition === 'right') {\n\t\t\t\treturn isExpanded ? <ChevronRight /> : <ChevronLeft />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronLeft /> : <ChevronRight />;\n\t\t\t}\n\t\t} else {\n\t\t\tif (buttonPosition === 'bottom') {\n\t\t\t\treturn isExpanded ? <ChevronUp /> : <ChevronDown />;\n\t\t\t} else {\n\t\t\t\treturn isExpanded ? <ChevronDown /> : <ChevronUp />;\n\t\t\t}\n\t\t}\n\t};\n\n\tconst getButtonClass = () => {\n\t\tif (direction === 'horizontal') {\n\t\t\treturn buttonPosition === 'right' ? 'button-right' : 'button-left';\n\t\t} else {\n\t\t\treturn buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n\t\t}\n\t};\n\n\tconst getContainerStyle = (): CSSProperties => {\n\t\tconst resolvedHeight = formatDimension(defaultHeight);\n\t\tconst resolvedWidth = formatDimension(defaultWidth);\n\t\tif (direction === 'horizontal') {\n\t\t\treturn {\n\t\t\t\twidth: isExpanded ? resolvedWidth : '0px',\n\t\t\t\theight: resolvedHeight,\n\t\t\t\tminWidth: 0,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\theight: isExpanded ? resolvedHeight : '0px',\n\t\t\t\twidth: resolvedWidth,\n\t\t\t\tminHeight: 0,\n\t\t\t};\n\t\t}\n\t};\n\n\tconst baseWrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\tconst wrapperClass = className ? `${baseWrapperClass} ${className}` : baseWrapperClass;\n\n\tconst containerClass =\n\t\tdirection === 'horizontal' && buttonPosition === 'right'\n\t\t\t? 'collapsible-container align-right'\n\t\t\t: 'collapsible-container';\n\tconst height = getContentMaxHeight();\n\tconst contentStyle: CSSProperties = {\n\t\tmaxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n\t\toverflowY: 'auto',\n\t\tpadding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n\t\tboxSizing: 'border-box',\n\t};\n\n\t// 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n\tconst buttonStyle: CSSProperties =\n\t\tdirection === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n\t\t\t? { top: '0px', bottom: 'auto' }\n\t\t\t: {};\n\n\t// 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n\t// 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n\tconst formattedWidth = formatDimension(defaultWidth);\n\tconst formattedHeight = formatDimension(defaultHeight);\n\tconst wrapperStyle: CSSProperties | undefined =\n\t\tdirection === 'vertical'\n\t\t\t? isExpanded\n\t\t\t\t? {\n\t\t\t\t\t\theight: formattedHeight,\n\t\t\t\t\t\twidth: formattedWidth,\n\t\t\t\t\t}\n\t\t\t\t: { height: 0, width: formattedWidth }\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div className={wrapperClass} style={wrapperStyle}>\n\t\t\t<div style={getContainerStyle()} className={containerClass}>\n\t\t\t\t{title && (\n\t\t\t\t\t<div className=\"collapsible-header\" style={{ display: 'none' }}>\n\t\t\t\t\t\t<h3>{title}</h3>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div className=\"collapsible-content\" style={contentStyle}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tonClick={() => setIsExpanded(!isExpanded)}\n\t\t\t\tclassName={`toggle-button ${getButtonClass()}`}\n\t\t\t\tstyle={buttonStyle}\n\t\t\t\ttitle={isExpanded ? '隐藏' : '展开'}\n\t\t\t>\n\t\t\t\t{getIcon()}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n\tstyle?: CSSProperties;\n\tclassName?: string;\n}\n\nconst baseStyle: CSSProperties = {\n\tdisplay: 'inline-block',\n\twidth: '1em',\n\theight: '1em',\n\tverticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"left\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z\" />\n\t</svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"right\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\" />\n\t</svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"up\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M890.5 755.3L537.4 268a31.96 31.96 0 00-50.8 0L133.5 755.3a7.95 7.95 0 006.3 12.7h75.5c4.9 0 9.6-2.3 12.6-6.1l281-360 281 360c3 3.8 7.7 6.1 12.6 6.1h75.5c6.7 0 10.4-7.6 6.1-12.7z\" />\n\t</svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n\t<svg\n\t\tviewBox=\"0 0 1024 1024\"\n\t\tfocusable=\"false\"\n\t\tdata-icon=\"down\"\n\t\twidth=\"1em\"\n\t\theight=\"1em\"\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t\tstyle={{ ...baseStyle, ...style }}\n\t\tclassName={className}\n\t>\n\t\t<path d=\"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 37 17.6 49.8 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z\" />\n\t</svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\nimport type {\n\tCSSProperties,\n\tReactElement,\n\tReactNode,\n\tPointerEvent as ReactPointerEvent,\n} from 'react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nexport type SplitterSize = number | `${number}%`;\nexport type SplitterOrientation = 'horizontal' | 'vertical';\n\nexport type SplitterPanelProps = {\n\tchildren?: ReactNode;\n\tcollapsible?: boolean;\n\tdefaultSize?: SplitterSize;\n\tmax?: SplitterSize;\n\tmin?: SplitterSize;\n\tresizable?: boolean;\n\tsize?: SplitterSize;\n\tstyle?: CSSProperties;\n};\n\nexport type SplitterProps = {\n\tchildren: ReactNode;\n\tclassName?: string;\n\tlazy?: boolean;\n\tonResize?: (sizes: number[]) => void;\n\tonResizeEnd?: (sizes: number[]) => void;\n\tonResizeStart?: (sizes: number[]) => void;\n\torientation?: SplitterOrientation;\n\tstyle?: CSSProperties;\n\tvertical?: boolean;\n};\n\ntype SplitterComponent = React.FC<SplitterProps> & {\n\tPanel: React.FC<SplitterPanelProps>;\n};\n\nconst DRAGGER_SIZE = 8;\nconst MIN_DRAG_SIZE = 40; // 手动拖拽调整大小时的默认最小限制 (px)\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\n\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\n\ttypeof value === 'string' && value.endsWith('%');\n\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\n\tif (value === undefined) {\n\t\treturn fallback;\n\t}\n\n\tif (isPercentSize(value)) {\n\t\treturn (Number.parseFloat(value) / 100) * total;\n\t}\n\n\treturn Number(value);\n};\n\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\n\nconst getPointerPosition = (\n\tevent: PointerEvent | ReactPointerEvent,\n\torientation: SplitterOrientation,\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\n\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\n\nconst CustomSplitter: SplitterComponent = ({\n\tchildren,\n\tclassName,\n\tlazy = false,\n\tonResize,\n\tonResizeEnd,\n\tonResizeStart,\n\torientation,\n\tstyle,\n\tvertical = false,\n}) => {\n\tconst resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\n\tconst rootRef = useRef<HTMLDivElement>(null);\n\tconst sizesRef = useRef<number[]>([]);\n\tconst lastNonZeroSizesRef = useRef<number[]>([]);\n\tconst [containerSize, setContainerSize] = useState(0);\n\tconst [draggingIndex, setDraggingIndex] = useState<number | null>(null);\n\tconst [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\tconst [sizes, setSizes] = useState<number[]>([]);\n\n\tconst panels = useMemo(\n\t\t() =>\n\t\t\tReact.Children.toArray(children).filter(\n\t\t\t\tReact.isValidElement,\n\t\t\t) as ReactElement<SplitterPanelProps>[],\n\t\t[children],\n\t);\n\n\tconst trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\n\n\tconst getPanelMin = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.min, trackSize, 0),\n\t\t[panels, trackSize],\n\t);\n\n\tconst getPanelMax = useCallback(\n\t\t(index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\n\t\t[panels, trackSize],\n\t);\n\n\tconst normalizeToTrack = useCallback(\n\t\t(nextSizes: number[]) => {\n\t\t\tif (!trackSize || !nextSizes.length) {\n\t\t\t\treturn nextSizes;\n\t\t\t}\n\n\t\t\tconst normalized = [...nextSizes];\n\t\t\tconst diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\n\t\t\tconst flexibleIndex = normalized.findIndex((size) => size > 0);\n\t\t\tif (flexibleIndex !== -1) {\n\t\t\t\tnormalized[flexibleIndex] += diff;\n\t\t\t}\n\n\t\t\treturn normalized.map((size, index) => {\n\t\t\t\t// 折叠状态(size <= 1)保持为 0,不受 min 限制干扰\n\t\t\t\tif (size <= 1) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn clamp(size, getPanelMin(index), getPanelMax(index));\n\t\t\t});\n\t\t},\n\t\t[getPanelMax, getPanelMin, trackSize],\n\t);\n\n\tconst buildInitialSizes = useCallback(\n\t\t(previous?: number[]) => {\n\t\t\tif (!trackSize || !panels.length) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif (previous?.length === panels.length) {\n\t\t\t\tconst previousTotal = previous.reduce((sum, size) => sum + size, 0);\n\t\t\t\tif (previousTotal > 0) {\n\t\t\t\t\treturn normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst explicitSizes = panels.map((panel) =>\n\t\t\t\tparseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\n\t\t\t);\n\t\t\tconst usedSize = explicitSizes\n\t\t\t\t.filter((size) => size >= 0)\n\t\t\t\t.reduce((sum, size) => sum + size, 0);\n\t\t\tconst unsetCount = explicitSizes.filter((size) => size < 0).length;\n\t\t\tconst fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\n\n\t\t\treturn normalizeToTrack(\n\t\t\t\texplicitSizes.map((size, index) =>\n\t\t\t\t\tclamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\n\t);\n\n\tconst updateSizes = useCallback(\n\t\t(nextSizes: number[], notify = true) => {\n\t\t\tconst normalized = normalizeToTrack(nextSizes);\n\t\t\tsetSizes(normalized);\n\t\t\tsizesRef.current = normalized;\n\t\t\tnormalized.forEach((size, index) => {\n\t\t\t\tif (size > 1) {\n\t\t\t\t\tlastNonZeroSizesRef.current[index] = size;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (notify) {\n\t\t\t\tonResize?.(roundSizes(normalized));\n\t\t\t}\n\t\t},\n\t\t[normalizeToTrack, onResize],\n\t);\n\n\tuseEffect(() => {\n\t\tconst node = rootRef.current;\n\t\tif (!node) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst syncSize = () => {\n\t\t\tsetContainerSize(resolvedOrientation === 'horizontal' ? node.clientWidth : node.clientHeight);\n\t\t};\n\t\tsyncSize();\n\n\t\tconst observer = new ResizeObserver(syncSize);\n\t\tobserver.observe(node);\n\t\treturn () => observer.disconnect();\n\t}, [resolvedOrientation]);\n\n\tuseEffect(() => {\n\t\tsetSizes((previous) => {\n\t\t\tconst nextSizes = buildInitialSizes(previous);\n\t\t\tsizesRef.current = nextSizes;\n\t\t\tlastNonZeroSizesRef.current = nextSizes.map((size) =>\n\t\t\t\tMath.max(size, trackSize / Math.max(panels.length, 1)),\n\t\t\t);\n\t\t\treturn nextSizes;\n\t\t});\n\t}, [buildInitialSizes, panels.length, trackSize]);\n\n\tconst getResizedPair = useCallback(\n\t\t(sourceSizes: number[], index: number, delta: number) => {\n\t\t\tconst nextSizes = [...sourceSizes];\n\t\t\tconst leftPanel = panels[index];\n\t\t\tconst rightPanel = panels[index + 1];\n\n\t\t\tconst leftMin = getPanelMin(index);\n\t\t\tconst rightMin = getPanelMin(index + 1);\n\t\t\tconst leftMax = getPanelMax(index);\n\t\t\tconst rightMax = getPanelMax(index + 1);\n\n\t\t\tlet targetLeft = sourceSizes[index] + delta;\n\t\t\tlet targetRight = sourceSizes[index + 1] - delta;\n\n\t\t\t// 如果面板可折叠且设置了 min > 0,当拖拽目标尺寸小于 min / 2 时可自动吸附折叠到 0\n\t\t\tif (leftPanel?.props.collapsible && leftMin > 0 && targetLeft < leftMin / 2) {\n\t\t\t\ttargetLeft = 0;\n\t\t\t\ttargetRight = sourceSizes[index] + sourceSizes[index + 1];\n\t\t\t} else if (rightPanel?.props.collapsible && rightMin > 0 && targetRight < rightMin / 2) {\n\t\t\t\ttargetRight = 0;\n\t\t\t\ttargetLeft = sourceSizes[index] + sourceSizes[index + 1];\n\t\t\t} else {\n\t\t\t\tconst minDelta = Math.max(leftMin - sourceSizes[index], sourceSizes[index + 1] - rightMax);\n\t\t\t\tconst maxDelta = Math.min(leftMax - sourceSizes[index], sourceSizes[index + 1] - rightMin);\n\t\t\t\tconst safeDelta = clamp(delta, minDelta, maxDelta);\n\n\t\t\t\ttargetLeft = sourceSizes[index] + safeDelta;\n\t\t\t\ttargetRight = sourceSizes[index + 1] - safeDelta;\n\t\t\t}\n\n\t\t\tnextSizes[index] = targetLeft;\n\t\t\tnextSizes[index + 1] = targetRight;\n\t\t\treturn normalizeToTrack(nextSizes);\n\t\t},\n\t\t[getPanelMax, getPanelMin, normalizeToTrack, panels],\n\t);\n\n\tconst resizePair = useCallback(\n\t\t(index: number, delta: number, notify = true) => {\n\t\t\tupdateSizes(getResizedPair(sizesRef.current, index, delta), notify);\n\t\t},\n\t\t[getResizedPair, updateSizes],\n\t);\n\n\tconst startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tconst startPosition = getPointerPosition(event, resolvedOrientation);\n\t\tconst startSizes = [...sizesRef.current];\n\t\tlet latestSizes = startSizes;\n\n\t\tsetDraggingIndex(index);\n\t\tonResizeStart?.(roundSizes(startSizes));\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\n\t\t\tlatestSizes = getResizedPair(startSizes, index, delta);\n\t\t\tif (!lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tdocument.removeEventListener('pointermove', handlePointerMove);\n\t\t\tdocument.removeEventListener('pointerup', handlePointerUp);\n\t\t\tsetDraggingIndex(null);\n\t\t\tif (lazy) {\n\t\t\t\tupdateSizes(latestSizes, true);\n\t\t\t}\n\t\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t\t};\n\n\t\tdocument.addEventListener('pointermove', handlePointerMove);\n\t\tdocument.addEventListener('pointerup', handlePointerUp);\n\t};\n\n\tconst toggleCollapse = (index: number, neighborIndex: number) => {\n\t\tconst nextSizes = [...sizesRef.current];\n\n\t\tif (nextSizes[index] > 1) {\n\t\t\tlastNonZeroSizesRef.current[index] = nextSizes[index];\n\t\t\tnextSizes[neighborIndex] += nextSizes[index];\n\t\t\tnextSizes[index] = 0;\n\t\t} else {\n\t\t\tconst restoredSize =\n\t\t\t\tlastNonZeroSizesRef.current[index] ||\n\t\t\t\tparseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\n\t\t\tnextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\n\t\t\tnextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\n\t\t}\n\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(sizesRef.current));\n\t};\n\n\tconst resetSizes = () => {\n\t\tconst nextSizes = buildInitialSizes();\n\t\tupdateSizes(nextSizes);\n\t\tonResizeEnd?.(roundSizes(nextSizes));\n\t};\n\n\tconst rootStyle: CSSProperties = {\n\t\tborder: '1px solid #f0f0f0',\n\t\tborderRadius: 8,\n\t\tboxSizing: 'border-box',\n\t\tdisplay: 'flex',\n\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\n\t\theight: 360,\n\t\tminHeight: 0,\n\t\toverflow: 'hidden',\n\t\tposition: 'relative',\n\t\twidth: '100%',\n\t\t...style,\n\t};\n\n\tconst renderCollapseButton = (\n\t\tdraggerIndex: number,\n\t\tpanelIndex: number,\n\t\tdirection: 'start' | 'end',\n\t) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\n\t\tconst isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\n\t\tconst isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\n\n\t\t// 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\n\t\tif (isCollapsed || isNeighborCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// 展开时箭头指向面板将被折叠到的方向\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? direction === 'start'\n\t\t\t\t\t? LeftOutlined\n\t\t\t\t\t: RightOutlined\n\t\t\t\t: direction === 'start'\n\t\t\t\t\t? UpOutlined\n\t\t\t\t\t: DownOutlined;\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label=\"折叠面板\"\n\t\t\t\ttitle=\"折叠面板\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #d9d9d9',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#595959',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 20,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 20,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t\tboxShadow: '0 2px 4px rgba(0,0,0,0.08)',\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\t// 渲染处于折叠状态下的“展开”触发手柄(挂载在根容器内侧 8px 处,100% 常显、绝对不被裁剪)\n\tconst renderCollapsedExpandHandle = (panelIndex: number) => {\n\t\tconst panel = panels[panelIndex];\n\t\tif (!panel?.props.collapsible) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isCollapsed = sizes.length > 0 && (sizes[panelIndex] ?? 0) <= 1;\n\t\tif (!isCollapsed) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst isFirstPanel = panelIndex === 0;\n\t\tconst neighborIndex = isFirstPanel ? panelIndex + 1 : panelIndex - 1;\n\n\t\tconst Icon =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? RightOutlined // 左面板折叠后,图标指向右 > (展开左面板)\n\t\t\t\t\t: LeftOutlined // 右面板折叠后,图标指向左 < (展开右面板)\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? DownOutlined\n\t\t\t\t\t: UpOutlined;\n\n\t\tconst label =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? '展开左侧面板'\n\t\t\t\t\t: '展开右侧面板'\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? '展开上方面板'\n\t\t\t\t\t: '展开下方面板';\n\n\t\tconst positionStyle: CSSProperties =\n\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t? isFirstPanel\n\t\t\t\t\t? { left: 8, top: '50%', transform: 'translateY(-50%)' }\n\t\t\t\t\t: { right: 8, top: '50%', transform: 'translateY(-50%)' }\n\t\t\t\t: isFirstPanel\n\t\t\t\t\t? { top: 8, left: '50%', transform: 'translateX(-50%)' }\n\t\t\t\t\t: { bottom: 8, left: '50%', transform: 'translateX(-50%)' };\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\taria-label={label}\n\t\t\t\tkey={`collapsed-handle-${panelIndex}`}\n\t\t\t\ttitle={label}\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\ttoggleCollapse(panelIndex, neighborIndex);\n\t\t\t\t}}\n\t\t\t\tstyle={{\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\tbackground: '#fff',\n\t\t\t\t\tborder: '1px solid #1677ff',\n\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\tcolor: '#1677ff',\n\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\theight: 24,\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\tpadding: 0,\n\t\t\t\t\twidth: 24,\n\t\t\t\t\tfontSize: 12,\n\t\t\t\t\tboxShadow: '0 2px 8px rgba(22, 119, 255, 0.35)',\n\t\t\t\t\tzIndex: 20,\n\t\t\t\t\t...positionStyle,\n\t\t\t\t}}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t</button>\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className={className} ref={rootRef} style={rootStyle}>\n\t\t\t{panels.map((panel, index) => {\n\t\t\t\tconst isHidden = sizes[index] <= 1;\n\t\t\t\tconst isLeftOrTopCollapsed = (sizes[index] ?? 0) <= 1;\n\t\t\t\tconst isRightOrBottomCollapsed = (sizes[index + 1] ?? 0) <= 1;\n\t\t\t\tconst isAnyCollapsed = isLeftOrTopCollapsed || isRightOrBottomCollapsed;\n\n\t\t\t\treturn (\n\t\t\t\t\t<React.Fragment key={index}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackground: index % 2 ? '#fff' : '#fafafa',\n\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\tflex: `0 0 ${sizes[index] ?? 0}px`,\n\t\t\t\t\t\t\t\tminHeight: 0,\n\t\t\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t\t\tpadding: isHidden ? 0 : 16,\n\t\t\t\t\t\t\t\ttransition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\n\t\t\t\t\t\t\t\t...panel.props.style,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!isHidden && panel.props.children}\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{index < panels.length - 1 && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\taria-orientation={resolvedOrientation}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tif (isRightOrBottomCollapsed) {\n\t\t\t\t\t\t\t\t\t\ttoggleCollapse(index + 1, index);\n\t\t\t\t\t\t\t\t\t} else if (isLeftOrTopCollapsed) {\n\t\t\t\t\t\t\t\t\t\ttoggleCollapse(index, index + 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonDoubleClick={resetSizes}\n\t\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\t\tconst step = event.shiftKey ? 40 : 10;\n\t\t\t\t\t\t\t\t\tconst directionMap =\n\t\t\t\t\t\t\t\t\t\tresolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? { ArrowLeft: -step, ArrowRight: step }\n\t\t\t\t\t\t\t\t\t\t\t: { ArrowUp: -step, ArrowDown: step };\n\t\t\t\t\t\t\t\t\tconst delta = directionMap[event.key as keyof typeof directionMap];\n\t\t\t\t\t\t\t\t\tif (delta !== undefined) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tresizePair(index, delta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonPointerDown={(event) => startResize(index, event)}\n\t\t\t\t\t\t\t\tonPointerEnter={() => setHoveredIndex(index)}\n\t\t\t\t\t\t\t\tonPointerLeave={() => setHoveredIndex(null)}\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\ttitle={isAnyCollapsed ? '点击可展开恢复面板' : '拖动调整大小,双击重置'}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index || isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t\t? '#e6f4ff'\n\t\t\t\t\t\t\t\t\t\t\t: '#f5f5f5',\n\t\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\t\tcursor: isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t? 'pointer'\n\t\t\t\t\t\t\t\t\t\t: resolvedOrientation === 'horizontal'\n\t\t\t\t\t\t\t\t\t\t\t? 'col-resize'\n\t\t\t\t\t\t\t\t\t\t\t: 'row-resize',\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflex: `0 0 ${DRAGGER_SIZE}px`,\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\toutline: 'none',\n\t\t\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t\t\tuserSelect: 'none',\n\t\t\t\t\t\t\t\t\tzIndex: isAnyCollapsed ? 2 : 1,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttabIndex={0}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\thoveredIndex === index || draggingIndex === index || isAnyCollapsed\n\t\t\t\t\t\t\t\t\t\t\t\t? '#1677ff'\n\t\t\t\t\t\t\t\t\t\t\t\t: '#d9d9d9',\n\t\t\t\t\t\t\t\t\t\tborderRadius: 2,\n\t\t\t\t\t\t\t\t\t\theight: resolvedOrientation === 'horizontal' ? 48 : 2,\n\t\t\t\t\t\t\t\t\t\twidth: resolvedOrientation === 'horizontal' ? 2 : 48,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t{/* 未折叠状态下呈现折叠按钮 */}\n\t\t\t\t\t\t\t\t{!isAnyCollapsed && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\t\t\tflexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\n\t\t\t\t\t\t\t\t\t\t\tgap: 4,\n\t\t\t\t\t\t\t\t\t\t\topacity: hoveredIndex === index ? 1 : 0.85,\n\t\t\t\t\t\t\t\t\t\t\ttransition: 'opacity 0.15s ease',\n\t\t\t\t\t\t\t\t\t\t\tpointerEvents: 'auto',\n\t\t\t\t\t\t\t\t\t\t\tzIndex: 5,\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index, 'start')}\n\t\t\t\t\t\t\t\t\t\t{renderCollapseButton(index, index + 1, 'end')}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</React.Fragment>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{/* 当有面板处于折叠状态时,在根容器内部边缘常显渲染展开手柄 */}\n\t\t\t{panels.map((_, index) => renderCollapsedExpandHandle(index))}\n\t\t</div>\n\t);\n};\n\nCustomSplitter.Panel = SplitterPanel;\n\nexport default CustomSplitter;\n"],"mappings":";AAAA,SAAS,gBAAoD;;;AC0B3D;AAnBF,IAAM,YAA2B;AAAA,EAChC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AAChB;AAEO,IAAM,eAAe,CAAC,EAAE,OAAO,UAAU,MAC/C;AAAA,EAAC;AAAA;AAAA,IACA,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAY;AAAA,IACZ,OAAO,EAAE,GAAG,WAAW,GAAG,MAAM;AAAA,IAChC;AAAA,IAEA,8BAAC,UAAK,GAAE,yLAAwL;AAAA;AACjM;AAGM,IAAM,gBAAgB,CAAC,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