@wx-design/components 0.1.4 → 0.1.6

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.
Files changed (47) hide show
  1. package/es/core/Table/components/CellEditors/Boolean.d.ts +1 -1
  2. package/es/core/Table/components/CellEditors/Color.d.ts +1 -1
  3. package/es/core/Table/components/CellEditors/DatePicker.d.ts +1 -1
  4. package/es/core/Table/components/CellEditors/Image.d.ts +1 -1
  5. package/es/core/Table/components/CellEditors/Input.d.ts +1 -1
  6. package/es/core/Table/components/CellEditors/InputNumber.d.ts +1 -1
  7. package/es/core/Table/components/CellEditors/PopOver.d.ts +1 -0
  8. package/es/core/Table/components/CellEditors/Select.d.ts +1 -1
  9. package/es/core/Table/components/CellRender.d.ts +1 -1
  10. package/es/core/Table/components/Toolbar/index.vue.d.ts +1 -1
  11. package/es/core/Table/configs/column.d.ts +1 -1
  12. package/es/core/Table/configs/table.d.ts +1 -1
  13. package/es/core/Table/constants.d.ts +9 -0
  14. package/es/core/Table/index.d.ts +1 -1
  15. package/es/core/Table/index.vue.d.ts +2 -2
  16. package/es/index.mjs +264 -18450
  17. package/lib/core/Table/components/CellEditors/Boolean.d.ts +1 -1
  18. package/lib/core/Table/components/CellEditors/Color.d.ts +1 -1
  19. package/lib/core/Table/components/CellEditors/DatePicker.d.ts +1 -1
  20. package/lib/core/Table/components/CellEditors/Image.d.ts +1 -1
  21. package/lib/core/Table/components/CellEditors/Input.d.ts +1 -1
  22. package/lib/core/Table/components/CellEditors/InputNumber.d.ts +1 -1
  23. package/lib/core/Table/components/CellEditors/PopOver.d.ts +1 -0
  24. package/lib/core/Table/components/CellEditors/Select.d.ts +1 -1
  25. package/lib/core/Table/components/CellRender.d.ts +1 -1
  26. package/lib/core/Table/components/Toolbar/index.vue.d.ts +1 -1
  27. package/lib/core/Table/configs/column.d.ts +1 -1
  28. package/lib/core/Table/configs/table.d.ts +1 -1
  29. package/lib/core/Table/constants.d.ts +9 -0
  30. package/lib/core/Table/index.d.ts +1 -1
  31. package/lib/core/Table/index.vue.d.ts +2 -2
  32. package/lib/index.js +1 -4
  33. package/package.json +3 -3
  34. package/types/index.d.ts +8 -0
  35. package/types/table/column.d.ts +98 -0
  36. package/types/table/index.d.ts +10 -0
  37. package/types/table/table.d.ts +19 -0
  38. package/types/table/toolbar.d.ts +22 -0
  39. package/es/core/Table/types/column.d.ts +0 -74
  40. package/es/core/Table/types/index.d.ts +0 -3
  41. package/es/core/Table/types/table.d.ts +0 -11
  42. package/es/core/Table/types/toolbar.d.ts +0 -11
  43. package/index.d.ts +0 -1
  44. package/lib/core/Table/types/column.d.ts +0 -74
  45. package/lib/core/Table/types/index.d.ts +0 -3
  46. package/lib/core/Table/types/table.d.ts +0 -11
  47. package/lib/core/Table/types/toolbar.d.ts +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-design/components",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -8,7 +8,7 @@
8
8
  "files": [
9
9
  "es",
10
10
  "lib",
11
- "*.d.ts"
11
+ "types"
12
12
  ],
13
13
  "scripts": {
14
14
  "build:lib": "vite build",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "keywords": [],
20
20
  "author": "",
21
- "typings": "index.d.ts",
21
+ "typings": "types/index.d.ts",
22
22
  "license": "ISC",
23
23
  "devDependencies": {
24
24
  "@types/lodash": "^4.14.196",
@@ -0,0 +1,8 @@
1
+ export * from './table'
2
+ import { SabTable } from './table'
3
+
4
+ declare module '@vue/runtime-core' {
5
+ export interface GlobalComponents {
6
+ SabTable: typeof SabTable
7
+ }
8
+ }
@@ -0,0 +1,98 @@
1
+ import { VxeTableDataRow, VxeColumnProps, VxeColumnSlotTypes } from "vxe-table";
2
+ import type {
3
+ InputProps,
4
+ InputNumberProps,
5
+ DatePickerProps,
6
+ } from "element-plus";
7
+
8
+ export interface SabColumnSlots<D = VxeTableDataRow> {
9
+ /**
10
+ * 自定义显示内容模板
11
+ */
12
+ default: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
13
+ /**
14
+ * 自定义表头内容的模板
15
+ */
16
+ header: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
17
+ /**
18
+ * 自定义表尾内容的模板
19
+ */
20
+ footer: ((params: VxeColumnSlotTypes.FooterSlotParams<D>) => any) | string;
21
+ /**
22
+ * 只对 type=checkbox,radio 有效,自定义标题模板
23
+ */
24
+ title: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
25
+ /**
26
+ * 只对 type=checkbox 有效,自定义复选框模板
27
+ */
28
+ checkbox: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
29
+ /**
30
+ * 只对 type=radio 有效,自定义单选框模板
31
+ */
32
+ radio: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
33
+ /**
34
+ * 只对 type=expand 有效,自定义展开后的内容模板
35
+ */
36
+ content: ((params: VxeColumnSlotTypes.ContentSlotParams<D>) => any) | string;
37
+ /**
38
+ * 只对 filter-render 启用时有效,自定义筛选模板
39
+ */
40
+ filter: ((params: VxeColumnSlotTypes.FilterSlotParams<D>) => any) | string;
41
+ /**
42
+ * 只对 edit-render 启用时有效,自定义可编辑组件模板
43
+ */
44
+ edit:
45
+ | ((
46
+ params: VxeColumnSlotTypes.EditSlotParams<D>,
47
+ editorProps: SabCellEditorParams
48
+ ) => any)
49
+ | string;
50
+ /**
51
+ * 已废弃
52
+ * @deprecated
53
+ */
54
+ icon: (params: VxeColumnSlotTypes.IconSlotParams<D>) => any;
55
+ }
56
+
57
+ // 单选框属性
58
+ export type SabCellSelectProps = {
59
+ // 禁用状态
60
+ disabled?: boolean;
61
+ // 只读模式
62
+ readonly?: boolean;
63
+ // 是否多选
64
+ multiple?: boolean;
65
+ // 选项列表
66
+ options: any[];
67
+ // 用于展示的字段名,默认 label
68
+ labelKey?: string;
69
+ // 用于取值的字段名,默认 value
70
+ valueKey?: string;
71
+ // 用于禁用状态的字段名,默认 disabled
72
+ disabledKey?: string;
73
+ };
74
+ // 单元格编辑器参数
75
+ export type SabCellEditorParams =
76
+ | Partial<InputProps>
77
+ | Partial<InputNumberProps>
78
+ | Partial<DatePickerProps>
79
+ | Partial<SabCellSelectProps>
80
+
81
+ // 表格列设置
82
+ export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
83
+ // 单元格类型
84
+ sabCellType?: SabCellType;
85
+ // 附加的单元格编辑器参数
86
+ editorProps?: Partial<SabCellEditorParams>;
87
+ // 单元格是否可编辑
88
+ editable?: boolean;
89
+ // 自定义插槽
90
+ slots?: Partial<SabColumnSlots<D>>;
91
+ // 是否隐藏列
92
+ hidden?: boolean;
93
+ // 筛选控制
94
+ sabFilter?: {
95
+ // 是否自动收集筛选条件
96
+ autoCollectFilterOptions?: boolean;
97
+ };
98
+ };
@@ -0,0 +1,10 @@
1
+
2
+ import { VXEComponent, VxeTableEventProps } from 'vxe-table'
3
+ import { SabTableProps } from './table'
4
+ import { SabColumnSlots } from './column'
5
+
6
+ export const SabTable: VXEComponent<SabTableProps<any>, VxeTableEventProps<any>, SabColumnSlots<any>>
7
+
8
+ export * from './column'
9
+ export * from './table'
10
+ export * from './toolbar'
@@ -0,0 +1,19 @@
1
+ import { VxeTableProps, VxeTableDataRow } from "vxe-table";
2
+ import { SabColumnProps } from "./";
3
+
4
+ export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
5
+ // 表格 css 类名
6
+ class?: any;
7
+ // 列配置
8
+ columns?: Partial<SabColumnProps<D>>[];
9
+ // 表格可编辑
10
+ editable?: boolean;
11
+ // 默认带上序号列
12
+ withSeq?: boolean;
13
+ // 带上选项框
14
+ withCheckbox?: boolean;
15
+ // 展示工具栏
16
+ showToolbar?: boolean;
17
+ // 点击未选中行的单元格自动取消选择选中行
18
+ autoClearSelected?: boolean;
19
+ }
@@ -0,0 +1,22 @@
1
+ import { VxeTableInstance, VxeTableDataRow } from "vxe-table";
2
+
3
+ import { SabColumnProps } from "./";
4
+
5
+ // 支持的能力
6
+ // clearSelect - 清空选择行
7
+ // saveSelect - 保存选择行
8
+ type ToolbarFeatures = 'clearSelect' | 'saveSelect'
9
+
10
+ export interface ToolbarProps<D = VxeTableDataRow> {
11
+ // css 类名
12
+ class?: any;
13
+ // vxe-table 实例
14
+ tableRef?: VxeTableInstance;
15
+ // 功能列表
16
+ features?: ToolbarFeatures[];
17
+ // 列配置项
18
+ columns?: SabColumnProps[];
19
+
20
+ // 保存选择行回调
21
+ saveSelectRecords?: (rows: D[]) => void;
22
+ }
@@ -1,74 +0,0 @@
1
- import { VxeTableDataRow, VxeColumnProps, VxeColumnSlotTypes } from "vxe-table";
2
- import type { InputNumberProps, DatePickerProps } from "element-plus";
3
- export interface SabColumnSlots<D = VxeTableDataRow> {
4
- /**
5
- * 自定义显示内容模板
6
- */
7
- default: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
8
- /**
9
- * 自定义表头内容的模板
10
- */
11
- header: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
12
- /**
13
- * 自定义表尾内容的模板
14
- */
15
- footer: ((params: VxeColumnSlotTypes.FooterSlotParams<D>) => any) | string;
16
- /**
17
- * 只对 type=checkbox,radio 有效,自定义标题模板
18
- */
19
- title: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
20
- /**
21
- * 只对 type=checkbox 有效,自定义复选框模板
22
- */
23
- checkbox: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
24
- /**
25
- * 只对 type=radio 有效,自定义单选框模板
26
- */
27
- radio: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
28
- /**
29
- * 只对 type=expand 有效,自定义展开后的内容模板
30
- */
31
- content: ((params: VxeColumnSlotTypes.ContentSlotParams<D>) => any) | string;
32
- /**
33
- * 只对 filter-render 启用时有效,自定义筛选模板
34
- */
35
- filter: ((params: VxeColumnSlotTypes.FilterSlotParams<D>) => any) | string;
36
- /**
37
- * 只对 edit-render 启用时有效,自定义可编辑组件模板
38
- */
39
- edit: ((params: VxeColumnSlotTypes.EditSlotParams<D>, editorProps: SabCellEditorParams) => any) | string;
40
- /**
41
- * 已废弃
42
- * @deprecated
43
- */
44
- icon: (params: VxeColumnSlotTypes.IconSlotParams<D>) => any;
45
- }
46
- export declare enum SabCellType {
47
- Input = "input",
48
- InputNumber = "input-number",
49
- Select = "select",
50
- DatePciker = "date-picker",
51
- Image = "image",
52
- Color = "color",
53
- Boolean = "boolean"
54
- }
55
- export type SabCellSelectProps = {
56
- disabled?: boolean;
57
- readonly?: boolean;
58
- multiple?: boolean;
59
- options: any[];
60
- labelKey?: string;
61
- valueKey?: string;
62
- disabledKey?: string;
63
- };
64
- export type SabCellEditorParams = Partial<InputNumberProps> | Partial<DatePickerProps> | Partial<SabCellSelectProps>;
65
- export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
66
- sabCellType?: SabCellType;
67
- editorProps?: Partial<SabCellEditorParams>;
68
- editable?: boolean;
69
- slots?: Partial<SabColumnSlots<D>>;
70
- hidden?: boolean;
71
- sabFilter?: {
72
- autoCollectFilterOptions?: boolean;
73
- };
74
- };
@@ -1,3 +0,0 @@
1
- export * from './column';
2
- export * from './table';
3
- export * from './toolbar';
@@ -1,11 +0,0 @@
1
- import { VxeTableProps, VxeTableDataRow } from "vxe-table";
2
- import { SabColumnProps } from "./";
3
- export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
4
- class?: any;
5
- columns?: Partial<SabColumnProps<D>>[];
6
- editable?: boolean;
7
- withSeq?: boolean;
8
- withCheckbox?: boolean;
9
- showToolbar?: boolean;
10
- autoClearSelected?: boolean;
11
- };
@@ -1,11 +0,0 @@
1
- import { VxeTableInstance, VxeTableDataRow } from "vxe-table";
2
- import { SabColumnProps } from "./";
3
- type ToolbarFeatures = 'clearSelect' | 'saveSelect';
4
- export interface ToolbarProps<D = VxeTableDataRow> {
5
- class?: any;
6
- tableRef?: VxeTableInstance;
7
- features?: ToolbarFeatures[];
8
- columns?: SabColumnProps[];
9
- saveSelectRecords?: (rows: D[]) => void;
10
- }
11
- export {};
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './core/Table/types/index.d'
@@ -1,74 +0,0 @@
1
- import { VxeTableDataRow, VxeColumnProps, VxeColumnSlotTypes } from "vxe-table";
2
- import type { InputNumberProps, DatePickerProps } from "element-plus";
3
- export interface SabColumnSlots<D = VxeTableDataRow> {
4
- /**
5
- * 自定义显示内容模板
6
- */
7
- default: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
8
- /**
9
- * 自定义表头内容的模板
10
- */
11
- header: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
12
- /**
13
- * 自定义表尾内容的模板
14
- */
15
- footer: ((params: VxeColumnSlotTypes.FooterSlotParams<D>) => any) | string;
16
- /**
17
- * 只对 type=checkbox,radio 有效,自定义标题模板
18
- */
19
- title: ((params: VxeColumnSlotTypes.HeaderSlotParams<D>) => any) | string;
20
- /**
21
- * 只对 type=checkbox 有效,自定义复选框模板
22
- */
23
- checkbox: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
24
- /**
25
- * 只对 type=radio 有效,自定义单选框模板
26
- */
27
- radio: ((params: VxeColumnSlotTypes.DefaultSlotParams<D>) => any) | string;
28
- /**
29
- * 只对 type=expand 有效,自定义展开后的内容模板
30
- */
31
- content: ((params: VxeColumnSlotTypes.ContentSlotParams<D>) => any) | string;
32
- /**
33
- * 只对 filter-render 启用时有效,自定义筛选模板
34
- */
35
- filter: ((params: VxeColumnSlotTypes.FilterSlotParams<D>) => any) | string;
36
- /**
37
- * 只对 edit-render 启用时有效,自定义可编辑组件模板
38
- */
39
- edit: ((params: VxeColumnSlotTypes.EditSlotParams<D>, editorProps: SabCellEditorParams) => any) | string;
40
- /**
41
- * 已废弃
42
- * @deprecated
43
- */
44
- icon: (params: VxeColumnSlotTypes.IconSlotParams<D>) => any;
45
- }
46
- export declare enum SabCellType {
47
- Input = "input",
48
- InputNumber = "input-number",
49
- Select = "select",
50
- DatePciker = "date-picker",
51
- Image = "image",
52
- Color = "color",
53
- Boolean = "boolean"
54
- }
55
- export type SabCellSelectProps = {
56
- disabled?: boolean;
57
- readonly?: boolean;
58
- multiple?: boolean;
59
- options: any[];
60
- labelKey?: string;
61
- valueKey?: string;
62
- disabledKey?: string;
63
- };
64
- export type SabCellEditorParams = Partial<InputNumberProps> | Partial<DatePickerProps> | Partial<SabCellSelectProps>;
65
- export type SabColumnProps<D = VxeTableDataRow> = VxeColumnProps<D> & {
66
- sabCellType?: SabCellType;
67
- editorProps?: Partial<SabCellEditorParams>;
68
- editable?: boolean;
69
- slots?: Partial<SabColumnSlots<D>>;
70
- hidden?: boolean;
71
- sabFilter?: {
72
- autoCollectFilterOptions?: boolean;
73
- };
74
- };
@@ -1,3 +0,0 @@
1
- export * from './column';
2
- export * from './table';
3
- export * from './toolbar';
@@ -1,11 +0,0 @@
1
- import { VxeTableProps, VxeTableDataRow } from "vxe-table";
2
- import { SabColumnProps } from "./";
3
- export type SabTableProps<D = VxeTableDataRow> = VxeTableProps<D> & {
4
- class?: any;
5
- columns?: Partial<SabColumnProps<D>>[];
6
- editable?: boolean;
7
- withSeq?: boolean;
8
- withCheckbox?: boolean;
9
- showToolbar?: boolean;
10
- autoClearSelected?: boolean;
11
- };
@@ -1,11 +0,0 @@
1
- import { VxeTableInstance, VxeTableDataRow } from "vxe-table";
2
- import { SabColumnProps } from "./";
3
- type ToolbarFeatures = 'clearSelect' | 'saveSelect';
4
- export interface ToolbarProps<D = VxeTableDataRow> {
5
- class?: any;
6
- tableRef?: VxeTableInstance;
7
- features?: ToolbarFeatures[];
8
- columns?: SabColumnProps[];
9
- saveSelectRecords?: (rows: D[]) => void;
10
- }
11
- export {};