@skyfox2000/webui 1.4.25 → 1.4.27

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/src/index.ts CHANGED
@@ -43,6 +43,9 @@ export type {
43
43
  ButtonType,
44
44
  IconTool,
45
45
  RowRecord,
46
+ GroupType,
47
+ ToolGroup,
48
+ ComponentTool,
46
49
  } from '@/typings/tools.d';
47
50
 
48
51
  export type {
@@ -218,6 +221,15 @@ export { default as eventBus } from '@/utils/eventbus';
218
221
  export { MicroOpenApis } from '@/utils/micro-openapis';
219
222
 
220
223
  import router from '@/router';
224
+ import {
225
+ ToolPanelGroup,
226
+ DisplayMode,
227
+ PanelCollapsed,
228
+ ToolPanelConfig,
229
+ ToolPanelEvents,
230
+ ToolPanelProps,
231
+ DragConfig,
232
+ } from './components/content';
221
233
  export { router as AppRouter };
222
234
  export { pendingNavigation, routes } from '@/router';
223
235
 
@@ -250,6 +262,7 @@ export {
250
262
  Toolbar,
251
263
  Icontool,
252
264
  GroupTools,
265
+ ToolPanel,
253
266
  Tree,
254
267
  AutoComplete,
255
268
  Cascader,
@@ -284,4 +297,14 @@ export {
284
297
  MenuTabs,
285
298
  } from '@/components/index';
286
299
 
300
+ export type {
301
+ ToolPanelGroup,
302
+ DisplayMode,
303
+ PanelCollapsed,
304
+ ToolPanelConfig,
305
+ ToolPanelEvents,
306
+ ToolPanelProps,
307
+ DragConfig,
308
+ };
309
+
287
310
  export { uploadTempOpener, uploadTempBtn } from './utils/upload-template';
@@ -16,6 +16,10 @@ export interface ButtonTool {
16
16
  * 字符串配置时,使用默认设置
17
17
  */
18
18
  key: string;
19
+ /**
20
+ * 额外配置参数,用于携带自定义数据
21
+ */
22
+ data?: Record<string, any>;
19
23
  /**
20
24
  * 文字
21
25
  */
@@ -29,6 +33,13 @@ export interface ButtonTool {
29
33
  * 图标
30
34
  */
31
35
  icon?: string;
36
+ /**
37
+ * 显示模式
38
+ * - icon: 仅显示图标
39
+ * - text: 仅显示文字
40
+ * - both: 同时显示图标和文字
41
+ */
42
+ display?: 'icon' | 'text' | 'both';
32
43
  /**
33
44
  * 状态图标
34
45
  */
@@ -102,6 +113,10 @@ export interface ButtonTool {
102
113
  * 图标属性
103
114
  */
104
115
  iconProps?: Record<string, any>;
116
+ /**
117
+ * 图标样式类
118
+ */
119
+ iconClass?: string;
105
120
  /**
106
121
  * 下拉组件
107
122
  */
@@ -129,3 +144,58 @@ export type IconTool = Omit<ButtonTool, 'disabled' | 'children'> & {
129
144
  * 工具/操作按钮定义组
130
145
  */
131
146
  export type ButtonTools = (IconTool | ButtonTool | string)[];
147
+
148
+ /**
149
+ * 工具组类型定义
150
+ */
151
+ export type GroupType = 'tools' | 'split' | 'space';
152
+
153
+ /**
154
+ * 扩展的工具定义,支持自定义组件
155
+ */
156
+ export interface ComponentTool extends ButtonTool {
157
+ /**
158
+ * 自定义组件
159
+ */
160
+ component?: any;
161
+ /**
162
+ * 组件属性
163
+ */
164
+ props?: Record<string, any>;
165
+ }
166
+
167
+ /**
168
+ * 工具组定义
169
+ */
170
+ export interface ToolGroup {
171
+ /**
172
+ * 组类型
173
+ * - tools: 工具组
174
+ * - split: 竖线分割
175
+ * - space: 空白区域
176
+ */
177
+ type: GroupType;
178
+ /**
179
+ * 工具列表,当type为tools时有效
180
+ */
181
+ tools?: ComponentTool[];
182
+ /**
183
+ * 空白区域宽度,当type为space时有效
184
+ */
185
+ width?: string;
186
+ /**
187
+ * 单个组的样式类,当type为tools时有效
188
+ */
189
+ class?: string;
190
+ /**
191
+ * 选中状态,当type为tools时有效
192
+ * 单选模式,存储当前选中工具的key
193
+ */
194
+ selected?: string;
195
+ /**
196
+ * 组按钮模式
197
+ * - normal: 普通按钮模式(默认)
198
+ * - toggle: 切换按钮模式(单选)
199
+ */
200
+ mode?: 'normal' | 'toggle';
201
+ }