@wx-design/components 1.0.0-alpha.7 → 1.0.0-alpha.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-design/components",
3
- "version": "1.0.0-alpha.7",
3
+ "version": "1.0.0-alpha.8",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -1,4 +1,4 @@
1
- import { Ref } from 'vue'
1
+ import { Ref } from "vue";
2
2
  import {
3
3
  VxeTableDataRow,
4
4
  VxeColumnProps,
@@ -14,6 +14,7 @@ import type {
14
14
  CheckboxProps,
15
15
  SwitchProps,
16
16
  PopoverInstance,
17
+ ImageProps,
17
18
  } from "element-plus";
18
19
  import type { SabHeaderFilterProps } from "./";
19
20
 
@@ -26,7 +27,8 @@ export interface SabColumnSlots<D = VxeTableDataRow> {
26
27
  params: VxeColumnSlotTypes.DefaultSlotParams<D> & {
27
28
  column: SabColumnProps<D>;
28
29
  },
29
- editorProps?: SabCellEditorParams
30
+ editorProps?: SabCellEditorParams,
31
+ column?: SabColumnProps<D>
30
32
  ) => any)
31
33
  | string;
32
34
  /**
@@ -119,7 +121,7 @@ export type SabCellSelectProps<D = VxeTableDataRow> = {
119
121
  }
120
122
  ) => Promise<any[]> | any[];
121
123
  // 只有配置了 dynamicOptions 才有效,聚焦时重新获取数据
122
- revalidateOnFocus?: boolean
124
+ revalidateOnFocus?: boolean;
123
125
  // 动态获取方法的防抖配置
124
126
  dynamicDebounce?: {
125
127
  // 延迟时间, 毫秒,默认300
@@ -171,6 +173,14 @@ export type BooleanEditorProps<D = VxeTableDataRow> = Partial<SwitchProps> &
171
173
  }): void;
172
174
  };
173
175
 
176
+ // 图片类型参数
177
+ export type ImageViewProps<D = VxeTableDataRow> = Partial<ImageProps> & {
178
+ // 在表格内直接展示图片
179
+ showThumb?: boolean
180
+ // 最多显示几张图片,默认3张, -1则不限制
181
+ maxCount?: number
182
+ };
183
+
174
184
  // 单元格编辑器参数
175
185
  export type SabCellEditorParams =
176
186
  | Partial<InputProps>
@@ -180,7 +190,8 @@ export type SabCellEditorParams =
180
190
  | Partial<PopoverProps>
181
191
  | Partial<SabPopoverParams>
182
192
  | Partial<DynamicCellProps>
183
- | Partial<BooleanEditorProps>;
193
+ | Partial<BooleanEditorProps>
194
+ | Partial<ImageViewProps>;
184
195
 
185
196
  // 弹出层配置
186
197
  export type SabPopoverParams = Partial<PopoverProps & DialogProps> & {
@@ -242,14 +253,22 @@ export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
242
253
 
243
254
  // 其他
244
255
  // 不参与批量操作
245
- batchForbidden?: boolean
256
+ batchForbidden?: boolean;
246
257
  // 不参与动态表头控制
247
- noHeaderSet?: boolean
258
+ noHeaderSet?: boolean;
248
259
  // 参与表格尾部汇总
249
- withSummary?: boolean
260
+ withSummary?: boolean;
250
261
  // 自定义表格尾部数据汇总处理
251
- footerMethod?(column: SabColumnProps<D>, data: D[]): any
262
+ footerMethod?(column: SabColumnProps<D>, data: D[]): any;
252
263
 
253
264
  // 表头分组
254
- children?: SabColumnProps<D>[]
265
+ children?: SabColumnProps<D>[];
266
+
267
+ // 在被单元格渲染前转换数据
268
+ // 测试中,不要滥用,目前只推荐 `Image` 使用
269
+ transformRowDataToCell?(
270
+ scope:
271
+ | VxeColumnSlotTypes.DefaultSlotParams<D>
272
+ | VxeColumnSlotTypes.EditSlotParams<D>
273
+ ): any;
255
274
  };