@wx-design/components 0.8.16 → 0.8.17

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": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@vueuse/core": "^10.6.1",
35
+ "classnames": "^2.5.1",
35
36
  "deepmerge": "^4.3.1",
36
37
  "element-plus": "^2.4.2",
37
38
  "lodash": "^4.17.21",
@@ -1,4 +1,4 @@
1
- import { VxeTableDataRow, VxeColumnProps, VxeColumnSlotTypes } from "vxe-table";
1
+ import { VxeTableDataRow, VxeColumnProps, VxeColumnSlotTypes, VxeTableInstance } from "vxe-table";
2
2
  import type {
3
3
  InputProps,
4
4
  InputNumberProps,
@@ -6,6 +6,7 @@ import type {
6
6
  PopoverProps,
7
7
  CheckboxProps,
8
8
  } from "element-plus";
9
+ import type { SabHeaderFilterProps } from './'
9
10
 
10
11
  export interface SabColumnSlots<D = VxeTableDataRow> {
11
12
  /**
@@ -102,6 +103,17 @@ export type SabCellSelectProps<D = VxeTableDataRow> = {
102
103
  keywords?: string
103
104
  }
104
105
  ) => Promise<any[]>;
106
+ // 动态获取方法的防抖配置
107
+ dynamicDebounce?: {
108
+ // 延迟时间, 毫秒,默认300
109
+ delay?: number;
110
+ // 前导, 默认 false
111
+ leading?: boolean;
112
+ // 后导, 默认 true
113
+ trailing?: boolean;
114
+ // 最大等待时间
115
+ maxWait?: number;
116
+ },
105
117
  // 渲染选项展示
106
118
  renderOption?(option: D): any;
107
119
  // 渲染选项的label
@@ -148,8 +160,20 @@ export type SabPopoverParams = Partial<PopoverProps> & {
148
160
  hideButton?: boolean;
149
161
  };
150
162
 
163
+ // 列表头筛选配置
164
+ export type SabColumnFilterParams = SabHeaderFilterProps & {
165
+ // 默认从 column.sabCellType 继承
166
+ // 只支持 input, input-number, date-picker
167
+ // 其他默认当做 input
168
+ sabCellType?: string,
169
+ // 附加给头部筛选的参数
170
+ editorProps?: Partial<SabCellEditorParams>;
171
+ }
172
+
151
173
  // 表格列设置
152
174
  export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
175
+ // 字段名
176
+ field?: keyof D;
153
177
  // 单元格类型
154
178
  sabCellType?:
155
179
  | "input"
@@ -184,6 +208,8 @@ export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
184
208
  enablePopover?: boolean;
185
209
  // TODO: 弹出层配置
186
210
  popoverConfig?: SabPopoverParams;
187
- // 字段名
188
- field?: keyof D;
211
+ // 自定义头部的筛选
212
+ headerFilterConfig?: SabColumnFilterParams;
213
+ // vxe-table 实例
214
+ xTable?: VxeTableInstance
189
215
  };
@@ -1,5 +1,27 @@
1
- import { VxeTableProps, VxeTableDataRow, VxeTableInstance } from "vxe-table";
2
- import { SabColumnProps, SabPopoverParams, TableSetProps } from "./";
1
+ import {
2
+ VxeTableProps,
3
+ VxeTableDataRow,
4
+ VxeTableInstance,
5
+ VxeColumnPropTypes,
6
+ VxeTableDefines
7
+ } from "vxe-table";
8
+ import {
9
+ SabColumnProps,
10
+ SabPopoverParams,
11
+ TableSetProps,
12
+ SabCellEditorParams,
13
+ } from "./";
14
+
15
+ // 头部筛选条,默认不展示
16
+ export type SabHeaderFilterProps = {
17
+ // 是否启用筛选条,默认 true
18
+ enable?: boolean;
19
+ // 触发方式
20
+ // change - 当筛选项发生变动后立即触发
21
+ trigger?: "change";
22
+ // 筛选方法调用
23
+ filterMethod?: VxeColumnPropTypes.FilterMethod<D>;
24
+ };
3
25
 
4
26
  export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
5
27
  // 表名,如果你想保存表格的配置,则 name 必传
@@ -21,6 +43,10 @@ export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
21
43
  };
22
44
  // 带上选项框
23
45
  withCheckbox?: boolean;
46
+ // 头部筛选条,默认不展示
47
+ headerFilterConfig?: SabHeaderFilterProps;
48
+ // 头部筛选条数据 model
49
+ headerFilterModel?: any;
24
50
  // 展示工具栏
25
51
  showToolbar?: boolean;
26
52
  // 点击未选中行的单元格自动取消选择选中行
@@ -39,7 +65,7 @@ export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
39
65
  rowBorderHighlight?: boolean;
40
66
  // 表格设置控件配置
41
67
  tableSetConfig?: Partial<TableSetProps>;
42
- }
68
+ };
43
69
 
44
70
  // 表格插槽
45
71
  export interface TableSlots {
@@ -63,4 +89,6 @@ export interface SabTableInstance<D = VxeTableDataRow> {
63
89
  getInstance(): VxeTableInstance<D>;
64
90
  // 重新加载某行数据
65
91
  reloadRow(row: D | Array<D>): void;
92
+ // 获取表头筛选数据
93
+ getCheckedFilters(): VxeTableDefines.FilterCheckedParams<D>;
66
94
  }
@@ -1,12 +0,0 @@
1
- import { PropType } from "vue";
2
- import type { SabColumnProps } from "../../../types/table";
3
- declare const HeaderFilterRender: import("vue").DefineComponent<{
4
- column: PropType<SabColumnProps>;
5
- headerFilterModel: any;
6
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
- column: PropType<SabColumnProps>;
8
- headerFilterModel: any;
9
- }>>, {
10
- headerFilterModel: any;
11
- }, {}>;
12
- export default HeaderFilterRender;
@@ -1,12 +0,0 @@
1
- import { PropType } from "vue";
2
- import type { SabColumnProps } from "../../../types/table";
3
- declare const HeaderFilterRender: import("vue").DefineComponent<{
4
- column: PropType<SabColumnProps>;
5
- headerFilterModel: any;
6
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
- column: PropType<SabColumnProps>;
8
- headerFilterModel: any;
9
- }>>, {
10
- headerFilterModel: any;
11
- }, {}>;
12
- export default HeaderFilterRender;