react-public-components 0.1.1 → 0.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/LICENSE +21 -0
- package/README.md +133 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +66 -56
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xhua007
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# react-public-components
|
|
2
|
+
|
|
3
|
+
封装 react 常用的组件,欢迎更多同学提出大众化普遍存在的业务场景。
|
|
2
4
|
|
|
3
5
|
本仓库包含两个独立的 React 组件:
|
|
4
6
|
|
|
@@ -16,64 +18,51 @@
|
|
|
16
18
|
### 引入方式
|
|
17
19
|
|
|
18
20
|
```tsx
|
|
19
|
-
import
|
|
21
|
+
import { CollapseBox } from 'react-public-components';
|
|
22
|
+
// 导入组件样式
|
|
23
|
+
import 'react-public-components/styles.css';
|
|
20
24
|
```
|
|
21
25
|
|
|
22
26
|
### Props
|
|
23
27
|
|
|
24
|
-
| 属性 | 类型
|
|
25
|
-
| ---------------- |
|
|
26
|
-
| `children` | `ReactNode`
|
|
27
|
-
| `title` | `string`
|
|
28
|
-
| `direction` | `'horizontal' \| 'vertical'`
|
|
29
|
-
| `buttonPosition` | `'right' \| 'left' \| 'top' \| 'bottom'`
|
|
30
|
-
| `defaultWidth` | `number \| string`
|
|
31
|
-
| `defaultHeight` | `number \| string`
|
|
32
|
-
| `contentPadding` | `string`
|
|
33
|
-
| `headerHeight` | `number`
|
|
28
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
29
|
+
| ---------------- | ---------------------------------------- | -------------- | ---------------------------------------------------------------------------------- |
|
|
30
|
+
| `children` | `ReactNode` | - | 容器内部渲染的内容 |
|
|
31
|
+
| `title` | `string` | `'内容区域'` | 标题(当前版本内部隐藏渲染,仅作为占位属性保留) |
|
|
32
|
+
| `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` | 折叠方向:`horizontal` 沿 X 轴收起,`vertical` 沿 Y 轴收起 |
|
|
33
|
+
| `buttonPosition` | `'right' \| 'left' \| 'top' \| 'bottom'` | `'right'` | 切换按钮位置。`horizontal` 时建议 `left`/`right`,`vertical` 时建议 `top`/`bottom` |
|
|
34
|
+
| `defaultWidth` | `number \| string` | `600` | 容器宽度(支持像素数字如 `500` 或百分比字符串如 `'50%'`) |
|
|
35
|
+
| `defaultHeight` | `number \| string` | `300` | 容器高度(支持像素数字如 `300` 或百分比字符串如 `'50%'`) |
|
|
36
|
+
| `contentPadding` | `string` | `'16px'` | 内容区内边距 |
|
|
37
|
+
| `headerHeight` | `number` | `16` | 头部预留高度,用于计算内容区最大高度 |
|
|
34
38
|
|
|
35
39
|
### 基础用法
|
|
36
40
|
|
|
37
41
|
```tsx
|
|
38
|
-
import
|
|
42
|
+
import { CollapseBox } from 'react-public-components';
|
|
39
43
|
|
|
40
44
|
export default function Demo() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
return (
|
|
46
|
+
<CollapseBox
|
|
47
|
+
direction="horizontal"
|
|
48
|
+
buttonPosition="right"
|
|
49
|
+
defaultWidth="50%"
|
|
50
|
+
defaultHeight={400}
|
|
51
|
+
>
|
|
52
|
+
<p>这里是折叠容器中的内容。</p>
|
|
53
|
+
</CollapseBox>
|
|
54
|
+
);
|
|
51
55
|
}
|
|
52
56
|
```
|
|
53
57
|
|
|
54
58
|
### 垂直方向示例
|
|
55
59
|
|
|
56
60
|
```tsx
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
</
|
|
61
|
+
<CollapseBox direction="vertical" buttonPosition="bottom" defaultHeight={300}>
|
|
62
|
+
<p>上下方向折叠的内容。</p>
|
|
63
|
+
</CollapseBox>
|
|
60
64
|
```
|
|
61
65
|
|
|
62
|
-
### 依赖说明
|
|
63
|
-
|
|
64
|
-
组件内部引入了以下静态资源(位于 `@/assets/images/`):
|
|
65
|
-
|
|
66
|
-
- `arrow_down.png`
|
|
67
|
-
- `arrow_up.png`
|
|
68
|
-
- `arrow_left.png`
|
|
69
|
-
- `arrow_right.png`
|
|
70
|
-
|
|
71
|
-
并使用了 `lodash` 的 `isNumber`。在使用前请确保:
|
|
72
|
-
|
|
73
|
-
1. 项目中已配置 `@` 路径别名指向 `src`;
|
|
74
|
-
2. 已安装 `lodash`;
|
|
75
|
-
3. 已配置 less 加载器(`.less` 文件使用 less 编写)。
|
|
76
|
-
|
|
77
66
|
---
|
|
78
67
|
|
|
79
68
|
## 二、Splitter 分屏面板
|
|
@@ -85,68 +74,65 @@ export default function Demo() {
|
|
|
85
74
|
### 引入方式
|
|
86
75
|
|
|
87
76
|
```tsx
|
|
88
|
-
import Splitter from '
|
|
77
|
+
import { Splitter } from 'react-public-components';
|
|
89
78
|
```
|
|
90
79
|
|
|
91
80
|
### Splitter Props
|
|
92
81
|
|
|
93
|
-
| 属性 | 类型
|
|
94
|
-
| --------------- |
|
|
95
|
-
| `children` | `ReactNode`(必须为 `Splitter.Panel
|
|
96
|
-
| `className` | `string`
|
|
97
|
-
| `style` | `CSSProperties`
|
|
98
|
-
| `orientation` | `'horizontal' \| 'vertical'`
|
|
99
|
-
| `vertical` | `boolean`
|
|
100
|
-
| `lazy` | `boolean`
|
|
101
|
-
| `onResizeStart` | `(sizes: number[]) => void`
|
|
102
|
-
| `onResize` | `(sizes: number[]) => void`
|
|
103
|
-
| `onResizeEnd` | `(sizes: number[]) => void`
|
|
82
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
83
|
+
| --------------- | -------------------------------------- | -------------- | -------------------------------------- |
|
|
84
|
+
| `children` | `ReactNode`(必须为 `Splitter.Panel`) | - | 面板集合,建议 2 个及以上 |
|
|
85
|
+
| `className` | `string` | - | 根节点自定义类名 |
|
|
86
|
+
| `style` | `CSSProperties` | - | 根节点自定义样式 |
|
|
87
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | 分屏方向(优先级高于 `vertical`) |
|
|
88
|
+
| `vertical` | `boolean` | `false` | 是否垂直分屏(兼容写法) |
|
|
89
|
+
| `lazy` | `boolean` | `false` | 是否在拖拽结束时才更新视图(提升性能) |
|
|
90
|
+
| `onResizeStart` | `(sizes: number[]) => void` | - | 拖拽开始回调 |
|
|
91
|
+
| `onResize` | `(sizes: number[]) => void` | - | 拖拽过程中尺寸变化回调 |
|
|
92
|
+
| `onResizeEnd` | `(sizes: number[]) => void` | - | 拖拽/折叠/重置结束回调 |
|
|
104
93
|
|
|
105
94
|
### Splitter.Panel Props
|
|
106
95
|
|
|
107
|
-
| 属性
|
|
108
|
-
|
|
|
109
|
-
| `children`
|
|
110
|
-
| `size`
|
|
111
|
-
| `defaultSize`
|
|
112
|
-
| `min`
|
|
113
|
-
| `max`
|
|
114
|
-
| `collapsible`
|
|
115
|
-
| `resizable`
|
|
116
|
-
| `style`
|
|
96
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
97
|
+
| ------------- | ------------------------ | ------- | --------------------------------------------------------- |
|
|
98
|
+
| `children` | `ReactNode` | - | 面板内容 |
|
|
99
|
+
| `size` | `number \| '${number}%'` | - | 受控尺寸 |
|
|
100
|
+
| `defaultSize` | `number \| '${number}%'` | - | 初始尺寸(未设置时按剩余空间平均分配) |
|
|
101
|
+
| `min` | `number \| '${number}%'` | `0` | 最小尺寸 |
|
|
102
|
+
| `max` | `number \| '${number}%'` | - | 最大尺寸 |
|
|
103
|
+
| `collapsible` | `boolean` | `false` | 是否显示折叠按钮 |
|
|
104
|
+
| `resizable` | `boolean` | `true` | 是否允许拖拽调整(两侧任一为 `false` 都会禁用对应分隔条) |
|
|
105
|
+
| `style` | `CSSProperties` | - | 面板自定义样式 |
|
|
117
106
|
|
|
118
107
|
### 基础用法
|
|
119
108
|
|
|
120
109
|
```tsx
|
|
121
|
-
import Splitter from '
|
|
110
|
+
import { Splitter } from 'react-public-components';
|
|
122
111
|
|
|
123
112
|
export default function Demo() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
113
|
+
return (
|
|
114
|
+
<Splitter style={{ height: 400 }}>
|
|
115
|
+
<Splitter.Panel defaultSize="40%" min="20%">
|
|
116
|
+
<p>左侧面板</p>
|
|
117
|
+
</Splitter.Panel>
|
|
118
|
+
<Splitter.Panel>
|
|
119
|
+
<p>右侧面板</p>
|
|
120
|
+
</Splitter.Panel>
|
|
121
|
+
</Splitter>
|
|
122
|
+
);
|
|
134
123
|
}
|
|
135
124
|
```
|
|
136
125
|
|
|
137
126
|
### 可折叠 + 受控尺寸示例
|
|
138
127
|
|
|
139
128
|
```tsx
|
|
140
|
-
<Splitter
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<Splitter.Panel collapsible>
|
|
148
|
-
<p>下方面板(可折叠)</p>
|
|
149
|
-
</Splitter.Panel>
|
|
129
|
+
<Splitter orientation="vertical" onResizeEnd={(sizes) => console.log('最终尺寸:', sizes)}>
|
|
130
|
+
<Splitter.Panel defaultSize="30%" collapsible min="10%">
|
|
131
|
+
<p>上方面板(可折叠)</p>
|
|
132
|
+
</Splitter.Panel>
|
|
133
|
+
<Splitter.Panel collapsible>
|
|
134
|
+
<p>下方面板(可折叠)</p>
|
|
135
|
+
</Splitter.Panel>
|
|
150
136
|
</Splitter>
|
|
151
137
|
```
|
|
152
138
|
|
|
@@ -161,7 +147,6 @@ export default function Demo() {
|
|
|
161
147
|
### 依赖说明
|
|
162
148
|
|
|
163
149
|
- `react`(含 hooks、Children API)
|
|
164
|
-
- `antd`(`Space`、`Tooltip`)
|
|
165
150
|
- `@ant-design/icons`(折叠方向图标)
|
|
166
151
|
|
|
167
152
|
---
|
|
@@ -176,3 +161,66 @@ export default function Demo() {
|
|
|
176
161
|
└── Splitter/
|
|
177
162
|
└── index.tsx
|
|
178
163
|
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 四、发布到 npm
|
|
168
|
+
|
|
169
|
+
### 1. 前置准备
|
|
170
|
+
|
|
171
|
+
1. **登录 npm**:确保已注册 npm 账号,并在终端中完成登录:
|
|
172
|
+
```bash
|
|
173
|
+
npm login --auth-type=web
|
|
174
|
+
```
|
|
175
|
+
*检查当前登录状态:*
|
|
176
|
+
```bash
|
|
177
|
+
npm whoami
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
2. **检查镜像源**:发布必须使用 npm 官方镜像源,如果使用了国内镜像源(如淘宝/npmmirror),请切换回官方源:
|
|
181
|
+
```bash
|
|
182
|
+
# 查看当前镜像源
|
|
183
|
+
npm config get registry
|
|
184
|
+
|
|
185
|
+
# 切换为官方源
|
|
186
|
+
npm config set registry https://registry.npmjs.org/
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 2. 更新版本号
|
|
190
|
+
|
|
191
|
+
根据 [语义化版本 (SemVer)](https://semver.org/lang/zh-CN/) 规范更新 `package.json` 中的版本号:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# 小修复(Patch):0.1.1 -> 0.1.2
|
|
195
|
+
npm version patch
|
|
196
|
+
|
|
197
|
+
# 新功能(Minor):0.1.1 -> 0.2.0
|
|
198
|
+
npm version minor
|
|
199
|
+
|
|
200
|
+
# 破坏性更新(Major):0.1.1 -> 1.0.0
|
|
201
|
+
npm version major
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 3. 构建与发布
|
|
205
|
+
|
|
206
|
+
推荐先在本地手动运行构建命令验证代码无误,再运行发布命令:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# 1. 手动构建打包(验证代码是否有编译错误)
|
|
210
|
+
npm run build
|
|
211
|
+
|
|
212
|
+
# 2. (可选)预览发布内容,检查打入包的文件列表
|
|
213
|
+
npm publish --dry-run
|
|
214
|
+
|
|
215
|
+
# 3. 正式发布(注意是 npm publish,不需要加 run)
|
|
216
|
+
npm publish
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
> **自动化保障**:本项目已在 `package.json` 中配置了 `"prepublishOnly": "npm run build"` 生命周期钩子。即便你忘记手动运行 `npm run build`,在直接执行 `npm publish` 时,npm 也会**自动先帮你打包构建**,确保发布的始终是最新代码。
|
|
220
|
+
>
|
|
221
|
+
> **提示**:如果是首发公开包,可显式指定访问级别:
|
|
222
|
+
> ```bash
|
|
223
|
+
> npm publish --access public
|
|
224
|
+
> ```
|
|
225
|
+
|
|
226
|
+
|
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 CollapseBoxProps,\n CollapseBoxDirection,\n CollapseBoxButtonPosition,\n} from '../CollapseBox';\n\nexport { default as Splitter } from '../Splitter';\nexport type {\n SplitterProps,\n SplitterPanelProps,\n SplitterSize,\n SplitterOrientation,\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 children?: ReactNode;\n title?: string;\n direction?: CollapseBoxDirection;\n buttonPosition?: CollapseBoxButtonPosition;\n defaultWidth?: number | string;\n defaultHeight?: number | string;\n contentPadding?: string;\n headerHeight?: number;\n}\n\nconst isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\n\nconst formatDimension = (value?: number | string): string | undefined => {\n if (value === undefined || value === null) return undefined;\n return 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 children,\n title = '内容区域',\n direction = 'horizontal',\n buttonPosition = 'right',\n defaultWidth = 600,\n defaultHeight = 300,\n contentPadding = '16px',\n headerHeight = 16,\n}: CollapseBoxProps) => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const getContentMaxHeight = () => {\n if (typeof defaultHeight === 'number') {\n return `${defaultHeight - headerHeight}px`;\n }\n if (typeof defaultHeight === 'string') {\n return headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n }\n return '100%';\n };\n\n const getIcon = () => {\n if (direction === 'horizontal') {\n if (buttonPosition === 'right') {\n return isExpanded ? <ChevronRight /> : <ChevronLeft />;\n } else {\n return isExpanded ? <ChevronLeft /> : <ChevronRight />;\n }\n } else {\n if (buttonPosition === 'bottom') {\n return isExpanded ? <ChevronUp /> : <ChevronDown />;\n } else {\n return isExpanded ? <ChevronDown /> : <ChevronUp />;\n }\n }\n };\n\n const getButtonClass = () => {\n if (direction === 'horizontal') {\n return buttonPosition === 'right' ? 'button-right' : 'button-left';\n } else {\n return buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n }\n };\n\n const getContainerStyle = (): CSSProperties => {\n const resolvedHeight = formatDimension(defaultHeight);\n const resolvedWidth = formatDimension(defaultWidth);\n if (direction === 'horizontal') {\n return {\n width: isExpanded ? resolvedWidth : '0px',\n height: resolvedHeight,\n minWidth: 0,\n };\n } else {\n return {\n height: isExpanded ? resolvedHeight : '0px',\n width: resolvedWidth,\n minHeight: 0,\n };\n }\n };\n\n const wrapperClass =\n direction === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\n const containerClass =\n direction === 'horizontal' && buttonPosition === 'right'\n ? 'collapsible-container align-right'\n : 'collapsible-container';\n const height = getContentMaxHeight();\n const contentStyle: CSSProperties = {\n maxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n overflowY: 'auto',\n padding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n boxSizing: 'border-box',\n };\n\n // 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n const buttonStyle: CSSProperties =\n direction === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n ? { top: '0px', bottom: 'auto' }\n : {};\n\n // 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n // 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n const formattedWidth = formatDimension(defaultWidth);\n const formattedHeight = formatDimension(defaultHeight);\n const wrapperStyle: CSSProperties | undefined =\n direction === 'vertical'\n ? isExpanded\n ? {\n height: formattedHeight,\n width: formattedWidth,\n }\n : { height: 0, width: formattedWidth }\n : undefined;\n\n return (\n <div className={wrapperClass} style={wrapperStyle}>\n <div style={getContainerStyle()} className={containerClass}>\n {title && (\n <div className=\"collapsible-header\" style={{ display: 'none' }}>\n <h3>{title}</h3>\n </div>\n )}\n\n <div className=\"collapsible-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n\n <div\n onClick={() => setIsExpanded(!isExpanded)}\n className={`toggle-button ${getButtonClass()}`}\n style={buttonStyle}\n title={isExpanded ? '隐藏' : '展开'}\n >\n {getIcon()}\n </div>\n </div>\n );\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n style?: CSSProperties;\n className?: string;\n}\n\nconst baseStyle: CSSProperties = {\n display: 'inline-block',\n width: '1em',\n height: '1em',\n verticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"left\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"right\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"up\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"down\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\r\nimport type {\r\n CSSProperties,\r\n ReactElement,\r\n ReactNode,\r\n PointerEvent as ReactPointerEvent,\r\n} from 'react';\r\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\n\r\nexport type SplitterSize = number | `${number}%`;\r\nexport type SplitterOrientation = 'horizontal' | 'vertical';\r\n\r\nexport type SplitterPanelProps = {\r\n children?: ReactNode;\r\n collapsible?: boolean;\r\n defaultSize?: SplitterSize;\r\n max?: SplitterSize;\r\n min?: SplitterSize;\r\n resizable?: boolean;\r\n size?: SplitterSize;\r\n style?: CSSProperties;\r\n};\r\n\r\nexport type SplitterProps = {\r\n children: ReactNode;\r\n className?: string;\r\n lazy?: boolean;\r\n onResize?: (sizes: number[]) => void;\r\n onResizeEnd?: (sizes: number[]) => void;\r\n onResizeStart?: (sizes: number[]) => void;\r\n orientation?: SplitterOrientation;\r\n style?: CSSProperties;\r\n vertical?: boolean;\r\n};\r\n\r\ntype SplitterComponent = React.FC<SplitterProps> & {\r\n Panel: React.FC<SplitterPanelProps>;\r\n};\r\n\r\nconst DRAGGER_SIZE = 8;\r\nconst MIN_PANEL_SIZE = 0;\r\n\r\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\r\n\r\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\r\n typeof value === 'string' && value.endsWith('%');\r\n\r\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\r\n if (value === undefined) {\r\n return fallback;\r\n }\r\n\r\n if (isPercentSize(value)) {\r\n return (Number.parseFloat(value) / 100) * total;\r\n }\r\n\r\n return Number(value);\r\n};\r\n\r\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\r\n\r\nconst getPointerPosition = (\r\n event: PointerEvent | ReactPointerEvent,\r\n orientation: SplitterOrientation,\r\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\r\n\r\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\r\n\r\nconst CustomSplitter: SplitterComponent = ({\r\n children,\r\n className,\r\n lazy = false,\r\n onResize,\r\n onResizeEnd,\r\n onResizeStart,\r\n orientation,\r\n style,\r\n vertical = false,\r\n}) => {\r\n const resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\r\n const rootRef = useRef<HTMLDivElement>(null);\r\n const sizesRef = useRef<number[]>([]);\r\n const lastNonZeroSizesRef = useRef<number[]>([]);\r\n const [containerSize, setContainerSize] = useState(0);\r\n const [draggingIndex, setDraggingIndex] = useState<number | null>(null);\r\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\r\n const [sizes, setSizes] = useState<number[]>([]);\r\n\r\n const panels = useMemo(\r\n () =>\r\n React.Children.toArray(children).filter(\r\n React.isValidElement,\r\n ) as ReactElement<SplitterPanelProps>[],\r\n [children],\r\n );\r\n\r\n const trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\r\n\r\n const getPanelMin = useCallback(\r\n (index: number) => parseSize(panels[index]?.props.min, trackSize, MIN_PANEL_SIZE),\r\n [panels, trackSize],\r\n );\r\n\r\n const getPanelMax = useCallback(\r\n (index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\r\n [panels, trackSize],\r\n );\r\n\r\n const normalizeToTrack = useCallback(\r\n (nextSizes: number[]) => {\r\n if (!trackSize || !nextSizes.length) {\r\n return nextSizes;\r\n }\r\n\r\n const normalized = [...nextSizes];\r\n const diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\r\n const flexibleIndex = normalized.findIndex((size) => size > 0);\r\n normalized[flexibleIndex === -1 ? 0 : flexibleIndex] += diff;\r\n return normalized.map((size, index) => clamp(size, 0, getPanelMax(index)));\r\n },\r\n [getPanelMax, trackSize],\r\n );\r\n\r\n const buildInitialSizes = useCallback(\r\n (previous?: number[]) => {\r\n if (!trackSize || !panels.length) {\r\n return [];\r\n }\r\n\r\n if (previous?.length === panels.length) {\r\n const previousTotal = previous.reduce((sum, size) => sum + size, 0);\r\n if (previousTotal > 0) {\r\n return normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\r\n }\r\n }\r\n\r\n const explicitSizes = panels.map((panel) =>\r\n parseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\r\n );\r\n const usedSize = explicitSizes\r\n .filter((size) => size >= 0)\r\n .reduce((sum, size) => sum + size, 0);\r\n const unsetCount = explicitSizes.filter((size) => size < 0).length;\r\n const fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\r\n\r\n return normalizeToTrack(\r\n explicitSizes.map((size, index) =>\r\n clamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\r\n ),\r\n );\r\n },\r\n [getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\r\n );\r\n\r\n const updateSizes = useCallback(\r\n (nextSizes: number[], notify = true) => {\r\n const normalized = normalizeToTrack(nextSizes);\r\n setSizes(normalized);\r\n sizesRef.current = normalized;\r\n normalized.forEach((size, index) => {\r\n if (size > 1) {\r\n lastNonZeroSizesRef.current[index] = size;\r\n }\r\n });\r\n if (notify) {\r\n onResize?.(roundSizes(normalized));\r\n }\r\n },\r\n [normalizeToTrack, onResize],\r\n );\r\n\r\n useEffect(() => {\r\n const node = rootRef.current;\r\n if (!node) {\r\n return undefined;\r\n }\r\n\r\n const syncSize = () => {\r\n const rect = node.getBoundingClientRect();\r\n setContainerSize(resolvedOrientation === 'horizontal' ? rect.width : rect.height);\r\n };\r\n syncSize();\r\n\r\n const observer = new ResizeObserver(syncSize);\r\n observer.observe(node);\r\n return () => observer.disconnect();\r\n }, [resolvedOrientation]);\r\n\r\n useEffect(() => {\r\n setSizes((previous) => {\r\n const nextSizes = buildInitialSizes(previous);\r\n sizesRef.current = nextSizes;\r\n lastNonZeroSizesRef.current = nextSizes.map((size) =>\r\n Math.max(size, trackSize / Math.max(panels.length, 1)),\r\n );\r\n return nextSizes;\r\n });\r\n }, [buildInitialSizes, panels.length, trackSize]);\r\n\r\n const getResizedPair = useCallback(\r\n (sourceSizes: number[], index: number, delta: number) => {\r\n const nextSizes = [...sourceSizes];\r\n const leftSize = nextSizes[index];\r\n const rightSize = nextSizes[index + 1];\r\n const leftMin = getPanelMin(index);\r\n const rightMin = getPanelMin(index + 1);\r\n const leftMax = getPanelMax(index);\r\n const rightMax = getPanelMax(index + 1);\r\n const minDelta = Math.max(leftMin - leftSize, rightSize - rightMax);\r\n const maxDelta = Math.min(leftMax - leftSize, rightSize - rightMin);\r\n const safeDelta = clamp(delta, minDelta, maxDelta);\r\n\r\n nextSizes[index] = leftSize + safeDelta;\r\n nextSizes[index + 1] = rightSize - safeDelta;\r\n return normalizeToTrack(nextSizes);\r\n },\r\n [getPanelMax, getPanelMin, normalizeToTrack],\r\n );\r\n\r\n const resizePair = useCallback(\r\n (index: number, delta: number, notify = true) => {\r\n updateSizes(getResizedPair(sizesRef.current, index, delta), notify);\r\n },\r\n [getResizedPair, updateSizes],\r\n );\r\n\r\n const startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\r\n if (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n const startPosition = getPointerPosition(event, resolvedOrientation);\r\n const startSizes = [...sizesRef.current];\r\n let latestSizes = startSizes;\r\n\r\n setDraggingIndex(index);\r\n onResizeStart?.(roundSizes(startSizes));\r\n\r\n const handlePointerMove = (moveEvent: PointerEvent) => {\r\n const delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\r\n latestSizes = getResizedPair(startSizes, index, delta);\r\n if (!lazy) {\r\n updateSizes(latestSizes, true);\r\n }\r\n };\r\n\r\n const handlePointerUp = () => {\r\n document.removeEventListener('pointermove', handlePointerMove);\r\n document.removeEventListener('pointerup', handlePointerUp);\r\n setDraggingIndex(null);\r\n if (lazy) {\r\n updateSizes(latestSizes, true);\r\n }\r\n onResizeEnd?.(roundSizes(sizesRef.current));\r\n };\r\n\r\n document.addEventListener('pointermove', handlePointerMove);\r\n document.addEventListener('pointerup', handlePointerUp);\r\n };\r\n\r\n const toggleCollapse = (index: number, neighborIndex: number) => {\r\n const nextSizes = [...sizesRef.current];\r\n\r\n if (nextSizes[index] > 1) {\r\n lastNonZeroSizesRef.current[index] = nextSizes[index];\r\n nextSizes[neighborIndex] += nextSizes[index];\r\n nextSizes[index] = 0;\r\n } else {\r\n const restoredSize =\r\n lastNonZeroSizesRef.current[index] ||\r\n parseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\r\n nextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\r\n nextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\r\n }\r\n\r\n updateSizes(nextSizes);\r\n onResizeEnd?.(roundSizes(sizesRef.current));\r\n };\r\n\r\n const resetSizes = () => {\r\n const nextSizes = buildInitialSizes();\r\n updateSizes(nextSizes);\r\n onResizeEnd?.(roundSizes(nextSizes));\r\n };\r\n\r\n const rootStyle: CSSProperties = {\r\n border: '1px solid #f0f0f0',\r\n borderRadius: 8,\r\n display: 'flex',\r\n flexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\r\n height: 360,\r\n minHeight: 0,\r\n overflow: 'hidden',\r\n width: '100%',\r\n ...style,\r\n };\r\n\r\n const renderCollapseButton = (\r\n draggerIndex: number,\r\n panelIndex: number,\r\n direction: 'start' | 'end',\r\n ) => {\r\n const panel = panels[panelIndex];\r\n if (!panel?.props.collapsible) {\r\n return null;\r\n }\r\n\r\n const neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\r\n const isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\r\n const isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\r\n\r\n // 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\r\n if (isCollapsed || isNeighborCollapsed) {\r\n return null;\r\n }\r\n\r\n // 展开时箭头指向面板将被折叠到的方向\r\n const Icon =\r\n resolvedOrientation === 'horizontal'\r\n ? direction === 'start'\r\n ? LeftOutlined\r\n : RightOutlined\r\n : direction === 'start'\r\n ? UpOutlined\r\n : DownOutlined;\r\n\r\n return (\r\n <button\r\n aria-label=\"折叠面板\"\r\n title=\"折叠面板\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n toggleCollapse(panelIndex, neighborIndex);\r\n }}\r\n style={{\r\n alignItems: 'center',\r\n background: '#fff',\r\n border: '1px solid #d9d9d9',\r\n borderRadius: 4,\r\n color: '#595959',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n height: 20,\r\n justifyContent: 'center',\r\n padding: 0,\r\n width: 20,\r\n fontSize: 12,\r\n }}\r\n type=\"button\"\r\n >\r\n <Icon />\r\n </button>\r\n );\r\n };\r\n\r\n // 渲染\"展开\"按钮:当某个面板被折叠时显示在分隔条上,箭头指向展开方向\r\n const renderExpandButton = (panelIndex: number, direction: 'start' | 'end') => {\r\n const panel = panels[panelIndex];\r\n if (!panel?.props.collapsible) {\r\n return null;\r\n }\r\n\r\n const isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\r\n if (!isCollapsed) {\r\n return null;\r\n }\r\n\r\n const neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\r\n\r\n // 折叠后面板展开的方向与折叠方向相反\r\n const Icon =\r\n resolvedOrientation === 'horizontal'\r\n ? direction === 'start'\r\n ? RightOutlined // 左面板折叠后,展开方向朝右\r\n : LeftOutlined // 右面板折叠后,展开方向朝左\r\n : direction === 'start'\r\n ? DownOutlined\r\n : UpOutlined;\r\n\r\n return (\r\n <button\r\n aria-label=\"展开面板\"\r\n title=\"展开面板\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n toggleCollapse(panelIndex, neighborIndex);\r\n }}\r\n style={{\r\n alignItems: 'center',\r\n background: '#fff',\r\n border: '1px solid #d9d9d9',\r\n borderRadius: 4,\r\n color: '#595959',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n height: 20,\r\n justifyContent: 'center',\r\n padding: 0,\r\n width: 20,\r\n fontSize: 12,\r\n }}\r\n type=\"button\"\r\n >\r\n <Icon />\r\n </button>\r\n );\r\n };\r\n\r\n return (\r\n <div className={className} ref={rootRef} style={rootStyle}>\r\n {panels.map((panel, index) => {\r\n const isHidden = sizes[index] <= 1;\r\n\r\n return (\r\n <React.Fragment key={index}>\r\n <div\r\n style={{\r\n background: index % 2 ? '#fff' : '#fafafa',\r\n flex: `0 0 ${sizes[index] ?? 0}px`,\r\n minHeight: 0,\r\n minWidth: 0,\r\n overflow: 'auto',\r\n padding: isHidden ? 0 : 16,\r\n transition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\r\n ...panel.props.style,\r\n }}\r\n >\r\n {!isHidden && panel.props.children}\r\n </div>\r\n\r\n {index < panels.length - 1 && (\r\n <div\r\n aria-orientation={resolvedOrientation}\r\n onDoubleClick={resetSizes}\r\n onKeyDown={(event) => {\r\n const step = event.shiftKey ? 40 : 10;\r\n const directionMap =\r\n resolvedOrientation === 'horizontal'\r\n ? { ArrowLeft: -step, ArrowRight: step }\r\n : { ArrowUp: -step, ArrowDown: step };\r\n const delta = directionMap[event.key as keyof typeof directionMap];\r\n if (delta !== undefined) {\r\n event.preventDefault();\r\n resizePair(index, delta);\r\n }\r\n }}\r\n onPointerDown={(event) => startResize(index, event)}\r\n onPointerEnter={() => setHoveredIndex(index)}\r\n onPointerLeave={() => setHoveredIndex(null)}\r\n role=\"separator\"\r\n style={{\r\n alignItems: 'center',\r\n background:\r\n hoveredIndex === index || draggingIndex === index ? '#e6f4ff' : '#f5f5f5',\r\n cursor: resolvedOrientation === 'horizontal' ? 'col-resize' : 'row-resize',\r\n display: 'flex',\r\n flex: `0 0 ${DRAGGER_SIZE}px`,\r\n justifyContent: 'center',\r\n outline: 'none',\r\n position: 'relative',\r\n userSelect: 'none',\r\n zIndex: 1,\r\n }}\r\n tabIndex={0}\r\n >\r\n <div\r\n style={{\r\n background:\r\n hoveredIndex === index || draggingIndex === index ? '#1677ff' : '#d9d9d9',\r\n borderRadius: 2,\r\n height: resolvedOrientation === 'horizontal' ? 48 : 2,\r\n width: resolvedOrientation === 'horizontal' ? 2 : 48,\r\n }}\r\n />\r\n <div\r\n style={{\r\n position: 'absolute',\r\n display: 'flex',\r\n flexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\r\n gap: 2,\r\n opacity:\r\n hoveredIndex === index ||\r\n (sizes[index] ?? 0) <= 1 ||\r\n (sizes[index + 1] ?? 0) <= 1\r\n ? 1\r\n : 0,\r\n transition: 'opacity 0.15s ease',\r\n pointerEvents:\r\n hoveredIndex === index ||\r\n (sizes[index] ?? 0) <= 1 ||\r\n (sizes[index + 1] ?? 0) <= 1\r\n ? 'auto'\r\n : 'none',\r\n }}\r\n >\r\n {renderCollapseButton(index, index, 'start')}\r\n {renderCollapseButton(index, index + 1, 'end')}\r\n {renderExpandButton(index, 'start')}\r\n {renderExpandButton(index + 1, 'end')}\r\n </div>\r\n </div>\r\n )}\r\n </React.Fragment>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n\r\nCustomSplitter.Panel = SplitterPanel;\r\n\r\nexport default CustomSplitter;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA6D;;;AC0BzD;AAnBJ,IAAM,YAA2B;AAAA,EAC/B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AACjB;AAEO,IAAM,eAAe,CAAC,EAAE,OAAO,UAAU,MAC9C;AAAA,EAAC;AAAA;AAAA,IACC,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;AAClM;AAGK,IAAM,gBAAgB,CAAC,EAAE,OAAO,UAAU,MAC/C;AAAA,EAAC;AAAA;AAAA,IACC,SAAQ;AAAA,IACR,WAAU;AAAA,IACV,aAAU;AAAA,IACV,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,e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BACV,SAAS;AAAA,kBACT,eAAe,wBAAwB,eAAe,WAAW;AAAA,kBACjE,KAAK;AAAA,kBACL,SACE,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACvB,IACA;AAAA,kBACN,YAAY;AAAA,kBACZ,eACE,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACvB,SACA;AAAA,gBACR;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,YACtC;AAAA;AAAA;AAAA,MACF;AAAA,SAtFiB,KAwFrB;AAAA,EAEJ,CAAC,GACH;AAEJ;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}\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}: 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 wrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\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\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O,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"]}
|
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 children?: ReactNode;\n title?: string;\n direction?: CollapseBoxDirection;\n buttonPosition?: CollapseBoxButtonPosition;\n defaultWidth?: number | string;\n defaultHeight?: number | string;\n contentPadding?: string;\n headerHeight?: number;\n}\n\nconst isNumber = (value: unknown): value is number => typeof value === 'number' && !Number.isNaN(value);\n\nconst formatDimension = (value?: number | string): string | undefined => {\n if (value === undefined || value === null) return undefined;\n return 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 children,\n title = '内容区域',\n direction = 'horizontal',\n buttonPosition = 'right',\n defaultWidth = 600,\n defaultHeight = 300,\n contentPadding = '16px',\n headerHeight = 16,\n}: CollapseBoxProps) => {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const getContentMaxHeight = () => {\n if (typeof defaultHeight === 'number') {\n return `${defaultHeight - headerHeight}px`;\n }\n if (typeof defaultHeight === 'string') {\n return headerHeight ? `calc(${defaultHeight} - ${headerHeight}px)` : defaultHeight;\n }\n return '100%';\n };\n\n const getIcon = () => {\n if (direction === 'horizontal') {\n if (buttonPosition === 'right') {\n return isExpanded ? <ChevronRight /> : <ChevronLeft />;\n } else {\n return isExpanded ? <ChevronLeft /> : <ChevronRight />;\n }\n } else {\n if (buttonPosition === 'bottom') {\n return isExpanded ? <ChevronUp /> : <ChevronDown />;\n } else {\n return isExpanded ? <ChevronDown /> : <ChevronUp />;\n }\n }\n };\n\n const getButtonClass = () => {\n if (direction === 'horizontal') {\n return buttonPosition === 'right' ? 'button-right' : 'button-left';\n } else {\n return buttonPosition === 'bottom' ? 'button-bottom' : 'button-top';\n }\n };\n\n const getContainerStyle = (): CSSProperties => {\n const resolvedHeight = formatDimension(defaultHeight);\n const resolvedWidth = formatDimension(defaultWidth);\n if (direction === 'horizontal') {\n return {\n width: isExpanded ? resolvedWidth : '0px',\n height: resolvedHeight,\n minWidth: 0,\n };\n } else {\n return {\n height: isExpanded ? resolvedHeight : '0px',\n width: resolvedWidth,\n minHeight: 0,\n };\n }\n };\n\n const wrapperClass =\n direction === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\n\n const containerClass =\n direction === 'horizontal' && buttonPosition === 'right'\n ? 'collapsible-container align-right'\n : 'collapsible-container';\n const height = getContentMaxHeight();\n const contentStyle: CSSProperties = {\n maxHeight: direction === 'vertical' ? (isExpanded ? height : '0px') : height,\n overflowY: 'auto',\n padding: direction === 'vertical' && !isExpanded ? '0px' : contentPadding,\n boxSizing: 'border-box',\n };\n\n // 折叠时(纵向 + 底部按钮):按钮需切换为 top:0 定位,使其显示在折叠线下方\n const buttonStyle: CSSProperties =\n direction === 'vertical' && buttonPosition === 'bottom' && !isExpanded\n ? { top: '0px', bottom: 'auto' }\n : {};\n\n // 让 wrapper 高度跟随容器,确保 bottom:0 的按钮贴住容器底部\n // 折叠时 wrapper 高度为 0,配合按钮的 translateY(-100%) 让按钮显示在折叠线上方\n const formattedWidth = formatDimension(defaultWidth);\n const formattedHeight = formatDimension(defaultHeight);\n const wrapperStyle: CSSProperties | undefined =\n direction === 'vertical'\n ? isExpanded\n ? {\n height: formattedHeight,\n width: formattedWidth,\n }\n : { height: 0, width: formattedWidth }\n : undefined;\n\n return (\n <div className={wrapperClass} style={wrapperStyle}>\n <div style={getContainerStyle()} className={containerClass}>\n {title && (\n <div className=\"collapsible-header\" style={{ display: 'none' }}>\n <h3>{title}</h3>\n </div>\n )}\n\n <div className=\"collapsible-content\" style={contentStyle}>\n {children}\n </div>\n </div>\n\n <div\n onClick={() => setIsExpanded(!isExpanded)}\n className={`toggle-button ${getButtonClass()}`}\n style={buttonStyle}\n title={isExpanded ? '隐藏' : '展开'}\n >\n {getIcon()}\n </div>\n </div>\n );\n};\n\nexport default CollapsibleBox;\n","import type { CSSProperties } from 'react';\n\ninterface IconProps {\n style?: CSSProperties;\n className?: string;\n}\n\nconst baseStyle: CSSProperties = {\n display: 'inline-block',\n width: '1em',\n height: '1em',\n verticalAlign: '-0.125em',\n};\n\nexport const LeftOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"left\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const RightOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"right\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const UpOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"up\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n\nexport const DownOutlined = ({ style, className }: IconProps) => (\n <svg\n viewBox=\"0 0 1024 1024\"\n focusable=\"false\"\n data-icon=\"down\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n style={{ ...baseStyle, ...style }}\n className={className}\n >\n <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 </svg>\n);\n","import { DownOutlined, LeftOutlined, RightOutlined, UpOutlined } from '../src/icons';\r\nimport type {\r\n CSSProperties,\r\n ReactElement,\r\n ReactNode,\r\n PointerEvent as ReactPointerEvent,\r\n} from 'react';\r\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\n\r\nexport type SplitterSize = number | `${number}%`;\r\nexport type SplitterOrientation = 'horizontal' | 'vertical';\r\n\r\nexport type SplitterPanelProps = {\r\n children?: ReactNode;\r\n collapsible?: boolean;\r\n defaultSize?: SplitterSize;\r\n max?: SplitterSize;\r\n min?: SplitterSize;\r\n resizable?: boolean;\r\n size?: SplitterSize;\r\n style?: CSSProperties;\r\n};\r\n\r\nexport type SplitterProps = {\r\n children: ReactNode;\r\n className?: string;\r\n lazy?: boolean;\r\n onResize?: (sizes: number[]) => void;\r\n onResizeEnd?: (sizes: number[]) => void;\r\n onResizeStart?: (sizes: number[]) => void;\r\n orientation?: SplitterOrientation;\r\n style?: CSSProperties;\r\n vertical?: boolean;\r\n};\r\n\r\ntype SplitterComponent = React.FC<SplitterProps> & {\r\n Panel: React.FC<SplitterPanelProps>;\r\n};\r\n\r\nconst DRAGGER_SIZE = 8;\r\nconst MIN_PANEL_SIZE = 0;\r\n\r\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({ children }) => <>{children}</>;\r\n\r\nconst isPercentSize = (value: SplitterSize): value is `${number}%` =>\r\n typeof value === 'string' && value.endsWith('%');\r\n\r\nconst parseSize = (value: SplitterSize | undefined, total: number, fallback: number) => {\r\n if (value === undefined) {\r\n return fallback;\r\n }\r\n\r\n if (isPercentSize(value)) {\r\n return (Number.parseFloat(value) / 100) * total;\r\n }\r\n\r\n return Number(value);\r\n};\r\n\r\nconst roundSizes = (sizes: number[]) => sizes.map((size) => Math.round(size));\r\n\r\nconst getPointerPosition = (\r\n event: PointerEvent | ReactPointerEvent,\r\n orientation: SplitterOrientation,\r\n) => (orientation === 'horizontal' ? event.clientX : event.clientY);\r\n\r\nconst clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max);\r\n\r\nconst CustomSplitter: SplitterComponent = ({\r\n children,\r\n className,\r\n lazy = false,\r\n onResize,\r\n onResizeEnd,\r\n onResizeStart,\r\n orientation,\r\n style,\r\n vertical = false,\r\n}) => {\r\n const resolvedOrientation = orientation ?? (vertical ? 'vertical' : 'horizontal');\r\n const rootRef = useRef<HTMLDivElement>(null);\r\n const sizesRef = useRef<number[]>([]);\r\n const lastNonZeroSizesRef = useRef<number[]>([]);\r\n const [containerSize, setContainerSize] = useState(0);\r\n const [draggingIndex, setDraggingIndex] = useState<number | null>(null);\r\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\r\n const [sizes, setSizes] = useState<number[]>([]);\r\n\r\n const panels = useMemo(\r\n () =>\r\n React.Children.toArray(children).filter(\r\n React.isValidElement,\r\n ) as ReactElement<SplitterPanelProps>[],\r\n [children],\r\n );\r\n\r\n const trackSize = Math.max(0, containerSize - Math.max(0, panels.length - 1) * DRAGGER_SIZE);\r\n\r\n const getPanelMin = useCallback(\r\n (index: number) => parseSize(panels[index]?.props.min, trackSize, MIN_PANEL_SIZE),\r\n [panels, trackSize],\r\n );\r\n\r\n const getPanelMax = useCallback(\r\n (index: number) => parseSize(panels[index]?.props.max, trackSize, trackSize),\r\n [panels, trackSize],\r\n );\r\n\r\n const normalizeToTrack = useCallback(\r\n (nextSizes: number[]) => {\r\n if (!trackSize || !nextSizes.length) {\r\n return nextSizes;\r\n }\r\n\r\n const normalized = [...nextSizes];\r\n const diff = trackSize - normalized.reduce((sum, size) => sum + size, 0);\r\n const flexibleIndex = normalized.findIndex((size) => size > 0);\r\n normalized[flexibleIndex === -1 ? 0 : flexibleIndex] += diff;\r\n return normalized.map((size, index) => clamp(size, 0, getPanelMax(index)));\r\n },\r\n [getPanelMax, trackSize],\r\n );\r\n\r\n const buildInitialSizes = useCallback(\r\n (previous?: number[]) => {\r\n if (!trackSize || !panels.length) {\r\n return [];\r\n }\r\n\r\n if (previous?.length === panels.length) {\r\n const previousTotal = previous.reduce((sum, size) => sum + size, 0);\r\n if (previousTotal > 0) {\r\n return normalizeToTrack(previous.map((size) => (size / previousTotal) * trackSize));\r\n }\r\n }\r\n\r\n const explicitSizes = panels.map((panel) =>\r\n parseSize(panel.props.size ?? panel.props.defaultSize, trackSize, -1),\r\n );\r\n const usedSize = explicitSizes\r\n .filter((size) => size >= 0)\r\n .reduce((sum, size) => sum + size, 0);\r\n const unsetCount = explicitSizes.filter((size) => size < 0).length;\r\n const fallbackSize = unsetCount ? Math.max(0, (trackSize - usedSize) / unsetCount) : 0;\r\n\r\n return normalizeToTrack(\r\n explicitSizes.map((size, index) =>\r\n clamp(size >= 0 ? size : fallbackSize, getPanelMin(index), getPanelMax(index)),\r\n ),\r\n );\r\n },\r\n [getPanelMax, getPanelMin, normalizeToTrack, panels, trackSize],\r\n );\r\n\r\n const updateSizes = useCallback(\r\n (nextSizes: number[], notify = true) => {\r\n const normalized = normalizeToTrack(nextSizes);\r\n setSizes(normalized);\r\n sizesRef.current = normalized;\r\n normalized.forEach((size, index) => {\r\n if (size > 1) {\r\n lastNonZeroSizesRef.current[index] = size;\r\n }\r\n });\r\n if (notify) {\r\n onResize?.(roundSizes(normalized));\r\n }\r\n },\r\n [normalizeToTrack, onResize],\r\n );\r\n\r\n useEffect(() => {\r\n const node = rootRef.current;\r\n if (!node) {\r\n return undefined;\r\n }\r\n\r\n const syncSize = () => {\r\n const rect = node.getBoundingClientRect();\r\n setContainerSize(resolvedOrientation === 'horizontal' ? rect.width : rect.height);\r\n };\r\n syncSize();\r\n\r\n const observer = new ResizeObserver(syncSize);\r\n observer.observe(node);\r\n return () => observer.disconnect();\r\n }, [resolvedOrientation]);\r\n\r\n useEffect(() => {\r\n setSizes((previous) => {\r\n const nextSizes = buildInitialSizes(previous);\r\n sizesRef.current = nextSizes;\r\n lastNonZeroSizesRef.current = nextSizes.map((size) =>\r\n Math.max(size, trackSize / Math.max(panels.length, 1)),\r\n );\r\n return nextSizes;\r\n });\r\n }, [buildInitialSizes, panels.length, trackSize]);\r\n\r\n const getResizedPair = useCallback(\r\n (sourceSizes: number[], index: number, delta: number) => {\r\n const nextSizes = [...sourceSizes];\r\n const leftSize = nextSizes[index];\r\n const rightSize = nextSizes[index + 1];\r\n const leftMin = getPanelMin(index);\r\n const rightMin = getPanelMin(index + 1);\r\n const leftMax = getPanelMax(index);\r\n const rightMax = getPanelMax(index + 1);\r\n const minDelta = Math.max(leftMin - leftSize, rightSize - rightMax);\r\n const maxDelta = Math.min(leftMax - leftSize, rightSize - rightMin);\r\n const safeDelta = clamp(delta, minDelta, maxDelta);\r\n\r\n nextSizes[index] = leftSize + safeDelta;\r\n nextSizes[index + 1] = rightSize - safeDelta;\r\n return normalizeToTrack(nextSizes);\r\n },\r\n [getPanelMax, getPanelMin, normalizeToTrack],\r\n );\r\n\r\n const resizePair = useCallback(\r\n (index: number, delta: number, notify = true) => {\r\n updateSizes(getResizedPair(sizesRef.current, index, delta), notify);\r\n },\r\n [getResizedPair, updateSizes],\r\n );\r\n\r\n const startResize = (index: number, event: ReactPointerEvent<HTMLDivElement>) => {\r\n if (panels[index].props.resizable === false || panels[index + 1].props.resizable === false) {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n const startPosition = getPointerPosition(event, resolvedOrientation);\r\n const startSizes = [...sizesRef.current];\r\n let latestSizes = startSizes;\r\n\r\n setDraggingIndex(index);\r\n onResizeStart?.(roundSizes(startSizes));\r\n\r\n const handlePointerMove = (moveEvent: PointerEvent) => {\r\n const delta = getPointerPosition(moveEvent, resolvedOrientation) - startPosition;\r\n latestSizes = getResizedPair(startSizes, index, delta);\r\n if (!lazy) {\r\n updateSizes(latestSizes, true);\r\n }\r\n };\r\n\r\n const handlePointerUp = () => {\r\n document.removeEventListener('pointermove', handlePointerMove);\r\n document.removeEventListener('pointerup', handlePointerUp);\r\n setDraggingIndex(null);\r\n if (lazy) {\r\n updateSizes(latestSizes, true);\r\n }\r\n onResizeEnd?.(roundSizes(sizesRef.current));\r\n };\r\n\r\n document.addEventListener('pointermove', handlePointerMove);\r\n document.addEventListener('pointerup', handlePointerUp);\r\n };\r\n\r\n const toggleCollapse = (index: number, neighborIndex: number) => {\r\n const nextSizes = [...sizesRef.current];\r\n\r\n if (nextSizes[index] > 1) {\r\n lastNonZeroSizesRef.current[index] = nextSizes[index];\r\n nextSizes[neighborIndex] += nextSizes[index];\r\n nextSizes[index] = 0;\r\n } else {\r\n const restoredSize =\r\n lastNonZeroSizesRef.current[index] ||\r\n parseSize(panels[index].props.defaultSize, trackSize, trackSize / panels.length);\r\n nextSizes[index] = clamp(restoredSize, getPanelMin(index), getPanelMax(index));\r\n nextSizes[neighborIndex] = Math.max(0, nextSizes[neighborIndex] - nextSizes[index]);\r\n }\r\n\r\n updateSizes(nextSizes);\r\n onResizeEnd?.(roundSizes(sizesRef.current));\r\n };\r\n\r\n const resetSizes = () => {\r\n const nextSizes = buildInitialSizes();\r\n updateSizes(nextSizes);\r\n onResizeEnd?.(roundSizes(nextSizes));\r\n };\r\n\r\n const rootStyle: CSSProperties = {\r\n border: '1px solid #f0f0f0',\r\n borderRadius: 8,\r\n display: 'flex',\r\n flexDirection: resolvedOrientation === 'horizontal' ? 'row' : 'column',\r\n height: 360,\r\n minHeight: 0,\r\n overflow: 'hidden',\r\n width: '100%',\r\n ...style,\r\n };\r\n\r\n const renderCollapseButton = (\r\n draggerIndex: number,\r\n panelIndex: number,\r\n direction: 'start' | 'end',\r\n ) => {\r\n const panel = panels[panelIndex];\r\n if (!panel?.props.collapsible) {\r\n return null;\r\n }\r\n\r\n const neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\r\n const isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\r\n const isNeighborCollapsed = (sizes[neighborIndex] ?? 0) <= 1;\r\n\r\n // 自己折叠后隐藏;对侧面板折叠后也隐藏(避免与展开按钮重复/语义冲突)\r\n if (isCollapsed || isNeighborCollapsed) {\r\n return null;\r\n }\r\n\r\n // 展开时箭头指向面板将被折叠到的方向\r\n const Icon =\r\n resolvedOrientation === 'horizontal'\r\n ? direction === 'start'\r\n ? LeftOutlined\r\n : RightOutlined\r\n : direction === 'start'\r\n ? UpOutlined\r\n : DownOutlined;\r\n\r\n return (\r\n <button\r\n aria-label=\"折叠面板\"\r\n title=\"折叠面板\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n toggleCollapse(panelIndex, neighborIndex);\r\n }}\r\n style={{\r\n alignItems: 'center',\r\n background: '#fff',\r\n border: '1px solid #d9d9d9',\r\n borderRadius: 4,\r\n color: '#595959',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n height: 20,\r\n justifyContent: 'center',\r\n padding: 0,\r\n width: 20,\r\n fontSize: 12,\r\n }}\r\n type=\"button\"\r\n >\r\n <Icon />\r\n </button>\r\n );\r\n };\r\n\r\n // 渲染\"展开\"按钮:当某个面板被折叠时显示在分隔条上,箭头指向展开方向\r\n const renderExpandButton = (panelIndex: number, direction: 'start' | 'end') => {\r\n const panel = panels[panelIndex];\r\n if (!panel?.props.collapsible) {\r\n return null;\r\n }\r\n\r\n const isCollapsed = (sizes[panelIndex] ?? 0) <= 1;\r\n if (!isCollapsed) {\r\n return null;\r\n }\r\n\r\n const neighborIndex = direction === 'start' ? panelIndex + 1 : panelIndex - 1;\r\n\r\n // 折叠后面板展开的方向与折叠方向相反\r\n const Icon =\r\n resolvedOrientation === 'horizontal'\r\n ? direction === 'start'\r\n ? RightOutlined // 左面板折叠后,展开方向朝右\r\n : LeftOutlined // 右面板折叠后,展开方向朝左\r\n : direction === 'start'\r\n ? DownOutlined\r\n : UpOutlined;\r\n\r\n return (\r\n <button\r\n aria-label=\"展开面板\"\r\n title=\"展开面板\"\r\n onClick={(event) => {\r\n event.stopPropagation();\r\n toggleCollapse(panelIndex, neighborIndex);\r\n }}\r\n style={{\r\n alignItems: 'center',\r\n background: '#fff',\r\n border: '1px solid #d9d9d9',\r\n borderRadius: 4,\r\n color: '#595959',\r\n cursor: 'pointer',\r\n display: 'flex',\r\n height: 20,\r\n justifyContent: 'center',\r\n padding: 0,\r\n width: 20,\r\n fontSize: 12,\r\n }}\r\n type=\"button\"\r\n >\r\n <Icon />\r\n </button>\r\n );\r\n };\r\n\r\n return (\r\n <div className={className} ref={rootRef} style={rootStyle}>\r\n {panels.map((panel, index) => {\r\n const isHidden = sizes[index] <= 1;\r\n\r\n return (\r\n <React.Fragment key={index}>\r\n <div\r\n style={{\r\n background: index % 2 ? '#fff' : '#fafafa',\r\n flex: `0 0 ${sizes[index] ?? 0}px`,\r\n minHeight: 0,\r\n minWidth: 0,\r\n overflow: 'auto',\r\n padding: isHidden ? 0 : 16,\r\n transition: draggingIndex === null ? 'flex-basis 0.2s ease' : undefined,\r\n ...panel.props.style,\r\n }}\r\n >\r\n {!isHidden && panel.props.children}\r\n </div>\r\n\r\n {index < panels.length - 1 && (\r\n <div\r\n aria-orientation={resolvedOrientation}\r\n onDoubleClick={resetSizes}\r\n onKeyDown={(event) => {\r\n const step = event.shiftKey ? 40 : 10;\r\n const directionMap =\r\n resolvedOrientation === 'horizontal'\r\n ? { ArrowLeft: -step, ArrowRight: step }\r\n : { ArrowUp: -step, ArrowDown: step };\r\n const delta = directionMap[event.key as keyof typeof directionMap];\r\n if (delta !== undefined) {\r\n event.preventDefault();\r\n resizePair(index, delta);\r\n }\r\n }}\r\n onPointerDown={(event) => startResize(index, event)}\r\n onPointerEnter={() => setHoveredIndex(index)}\r\n onPointerLeave={() => setHoveredIndex(null)}\r\n role=\"separator\"\r\n style={{\r\n alignItems: 'center',\r\n background:\r\n hoveredIndex === index || draggingIndex === index ? '#e6f4ff' : '#f5f5f5',\r\n cursor: resolvedOrientation === 'horizontal' ? 'col-resize' : 'row-resize',\r\n display: 'flex',\r\n flex: `0 0 ${DRAGGER_SIZE}px`,\r\n justifyContent: 'center',\r\n outline: 'none',\r\n position: 'relative',\r\n userSelect: 'none',\r\n zIndex: 1,\r\n }}\r\n tabIndex={0}\r\n >\r\n <div\r\n style={{\r\n background:\r\n hoveredIndex === index || draggingIndex === index ? '#1677ff' : '#d9d9d9',\r\n borderRadius: 2,\r\n height: resolvedOrientation === 'horizontal' ? 48 : 2,\r\n width: resolvedOrientation === 'horizontal' ? 2 : 48,\r\n }}\r\n />\r\n <div\r\n style={{\r\n position: 'absolute',\r\n display: 'flex',\r\n flexDirection: resolvedOrientation === 'horizontal' ? 'column' : 'row',\r\n gap: 2,\r\n opacity:\r\n hoveredIndex === index ||\r\n (sizes[index] ?? 0) <= 1 ||\r\n (sizes[index + 1] ?? 0) <= 1\r\n ? 1\r\n : 0,\r\n transition: 'opacity 0.15s ease',\r\n pointerEvents:\r\n hoveredIndex === index ||\r\n (sizes[index] ?? 0) <= 1 ||\r\n (sizes[index + 1] ?? 0) <= 1\r\n ? 'auto'\r\n : 'none',\r\n }}\r\n >\r\n {renderCollapseButton(index, index, 'start')}\r\n {renderCollapseButton(index, index + 1, 'end')}\r\n {renderExpandButton(index, 'start')}\r\n {renderExpandButton(index + 1, 'end')}\r\n </div>\r\n </div>\r\n )}\r\n </React.Fragment>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n\r\nCustomSplitter.Panel = SplitterPanel;\r\n\r\nexport default CustomSplitter;\r\n"],"mappings":";AAAA,SAAS,gBAAoD;;;AC0BzD;AAnBJ,IAAM,YAA2B;AAAA,EAC/B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AACjB;AAEO,IAAM,eAAe,CAAC,EAAE,OAAO,UAAU,MAC9C;AAAA,EAAC;AAAA;AAAA,IACC,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;AAClM;AAGK,IAAM,gBAAgB,CAAC,EAAE,OAAO,UAAU,MAC/C;AAAA,EAAC;AAAA;AAAA,IACC,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,UA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K;AAAA,kBACpD,OAAO,wBAAwB,eAAe,IAAI;AAAA,gBACpD;AAAA;AAAA,YACF;AAAA,YACA,gBAAAC;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,kBACL,UAAU;AAAA,kBACV,SAAS;AAAA,kBACT,eAAe,wBAAwB,eAAe,WAAW;AAAA,kBACjE,KAAK;AAAA,kBACL,SACE,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACvB,IACA;AAAA,kBACN,YAAY;AAAA,kBACZ,eACE,iBAAiB,WAChB,WAAM,KAAK,MAAX,YAAgB,MAAM,OACtB,WAAM,QAAQ,CAAC,MAAf,YAAoB,MAAM,IACvB,SACA;AAAA,gBACR;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,YACtC;AAAA;AAAA;AAAA,MACF;AAAA,SAtFiB,KAwFrB;AAAA,EAEJ,CAAC,GACH;AAEJ;AAEA,eAAe,QAAQ;AAEvB,IAAO,mBAAQ;","names":["jsx","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}\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}: 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 wrapperClass =\n\t\tdirection === 'horizontal' ? 'collapsible-wrapper horizontal' : 'collapsible-wrapper vertical';\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})}\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AAA,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"]}
|
package/package.json
CHANGED
|
@@ -1,57 +1,67 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
2
|
+
"name": "react-public-components",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "React 折叠容器(CollapseBox)与分屏面板(Splitter)组件,零 UI 库依赖",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./styles.css": "./dist/index.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"**/*.less",
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"build:demo": "vite build",
|
|
28
|
+
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext ts,tsx --report-unused-disable-directives",
|
|
29
|
+
"format": "prettier --write \"**/*.{ts,tsx,json,md,less,css}\"",
|
|
30
|
+
"prepublishOnly": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"react",
|
|
34
|
+
"splitter",
|
|
35
|
+
"collapse",
|
|
36
|
+
"layout",
|
|
37
|
+
"component"
|
|
38
|
+
],
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": ">=16.8.0",
|
|
42
|
+
"react-dom": ">=16.8.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/react": "^18.2.0",
|
|
46
|
+
"@types/react-dom": "^18.2.0",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
48
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
49
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
50
|
+
"esbuild-plugin-less": "^1.3.1",
|
|
51
|
+
"eslint": "^9.39.5",
|
|
52
|
+
"eslint-config-prettier": "^10.1.8",
|
|
53
|
+
"eslint-plugin-react": "^7.37.5",
|
|
54
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
55
|
+
"eslint-plugin-react-refresh": "^0.5.3",
|
|
56
|
+
"less": "^4.2.0",
|
|
57
|
+
"prettier": "^3.9.6",
|
|
58
|
+
"react": "^18.2.0",
|
|
59
|
+
"react-dom": "^18.2.0",
|
|
60
|
+
"tsup": "^8.0.0",
|
|
61
|
+
"typescript": "^5.4.0",
|
|
62
|
+
"vite": "^8.1.5"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
}
|
|
67
|
+
}
|