holyes-table 1.0.10 → 1.0.12
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/README.md +8 -2
- package/dist/index.mjs +728 -623
- package/dist/lib/pretextTable/config.d.ts +12 -0
- package/dist/lib/pretextTable/hook/useCheckbox.d.ts +12 -5
- package/dist/lib/pretextTable/hook/useExpand.d.ts +1 -2
- package/dist/lib/pretextTable/hook/useFilter.d.ts +1 -3
- package/dist/lib/pretextTable/hook/useSort.d.ts +1 -2
- package/dist/lib/pretextTable/hook/useTree.d.ts +2 -14
- package/dist/lib/pretextTable/pretextTable.vue.d.ts +1 -1
- package/dist/lib/pretextTable/type.d.ts +15 -3
- package/dist/lib/pretextTable/useHolyesTable.d.ts +6 -17
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HolyesTableKeyNames, HolyesTableTreeConfig } from './type';
|
|
2
|
+
/** 特殊字段的名称 */
|
|
3
|
+
export declare const keyNames: HolyesTableKeyNames;
|
|
4
|
+
/** 默认的树形结构配置项 */
|
|
5
|
+
export declare const defaultTreeConfig: HolyesTableTreeConfig;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
/** 特殊字段的名称 */
|
|
8
|
+
keyNames: HolyesTableKeyNames;
|
|
9
|
+
/** 默认的树形结构配置项 */
|
|
10
|
+
defaultTreeConfig: HolyesTableTreeConfig;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Ref, ShallowRef } from 'vue';
|
|
2
|
+
import { HolyesTableTreeConfig } from '../type';
|
|
2
3
|
export declare function useCheckbox(dataObj: {
|
|
3
4
|
pretextId: string;
|
|
4
5
|
columns: Ref<any[]>;
|
|
@@ -6,17 +7,23 @@ export declare function useCheckbox(dataObj: {
|
|
|
6
7
|
nowDataSource: ShallowRef<any[]>;
|
|
7
8
|
baseDataSource: ShallowRef<any[]>;
|
|
8
9
|
emits: any;
|
|
10
|
+
/** 多选框列, 是否父子关联选择, 默认是true */
|
|
11
|
+
treeConfig?: HolyesTableTreeConfig;
|
|
9
12
|
}): {
|
|
10
13
|
/** 获取多选列字段 */
|
|
11
|
-
getCheckField: () => string
|
|
14
|
+
getCheckField: () => string[];
|
|
12
15
|
/** 表头多选列 */
|
|
13
|
-
headerChecked: Ref<boolean, boolean
|
|
16
|
+
headerChecked: Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
14
17
|
/** 表头多选列是否半选 */
|
|
15
|
-
headerCheckedIndeterminate: Ref<boolean, boolean
|
|
18
|
+
headerCheckedIndeterminate: Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
16
19
|
/** 表头多选列选中 */
|
|
17
|
-
onHeaderChecked: () => void;
|
|
20
|
+
onHeaderChecked: (field: string) => void;
|
|
21
|
+
/** 更新表头多选列选中状态 */
|
|
22
|
+
upDataHeaderChecked: (tempField?: string) => void;
|
|
23
|
+
/** 更新筛选后的父级行选中状态 */
|
|
24
|
+
upDataAllRowCheckedDeep: () => void;
|
|
18
25
|
/** 单元格选中 */
|
|
19
|
-
onCellChecked: (item: any) => void;
|
|
26
|
+
onCellChecked: (item: any, field?: string) => void;
|
|
20
27
|
/** 获取选中的数据 */
|
|
21
28
|
getCheckboxRecords: (isFull: boolean) => any[];
|
|
22
29
|
/** 清空多选列选中状态,给内部初始化用的 */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { HolyesTableExpandConfig
|
|
1
|
+
import { HolyesTableExpandConfig } from '../type';
|
|
2
2
|
/** 展开行配置项 */
|
|
3
3
|
export declare const useExpand: (dataObj: {
|
|
4
|
-
keyNames: HolyesTableKeyNames;
|
|
5
4
|
expandConfig: HolyesTableExpandConfig;
|
|
6
5
|
/** 展开/收起后, 执行的操作 */
|
|
7
6
|
afterRowExpand: (rows: any[], expanded: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
|
-
import { HolyesTableColumnPropsType, HolyesTableFilterlistOptions, HolyesTableFilterType,
|
|
2
|
+
import { HolyesTableColumnPropsType, HolyesTableFilterlistOptions, HolyesTableFilterType, HolyesTableTreeConfig } from '../type';
|
|
3
3
|
/** 筛选字段 类型 */
|
|
4
4
|
export type FilterFieldsType = {
|
|
5
5
|
field: string;
|
|
@@ -30,8 +30,6 @@ export type FilterFieldsType = {
|
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
export declare function useFilter(dataObj: {
|
|
33
|
-
/** 特殊字段的名称 */
|
|
34
|
-
keyNames: HolyesTableKeyNames;
|
|
35
33
|
/** 表格列属性 */
|
|
36
34
|
columns: ShallowRef<HolyesTableColumnPropsType[]>;
|
|
37
35
|
/** 基础数据 */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ShallowRef } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { HolyesTableTreeConfig } from '../type';
|
|
3
3
|
/** 排序 */
|
|
4
4
|
export declare function useSort(dataObj: {
|
|
5
|
-
keyNames: HolyesTableKeyNames;
|
|
6
5
|
nowDataSource: ShallowRef<any[]>;
|
|
7
6
|
getVisibleData: () => void;
|
|
8
7
|
setNowDataSource: (tempData: any[]) => void;
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HolyesTableTreeConfig } from '../type';
|
|
2
2
|
/** 树形结构配置项 */
|
|
3
3
|
export declare const useTree: (dataObj: {
|
|
4
4
|
treeConfig: HolyesTableTreeConfig;
|
|
5
|
-
keyNames: HolyesTableKeyNames;
|
|
6
5
|
afterTreeExpand: (rows: any[], expanded: boolean) => void;
|
|
7
6
|
insertChild: (records: any[], parentRowOrParentId: any) => Promise<void>;
|
|
8
7
|
}) => {
|
|
9
8
|
/** 默认的树形结构配置项 */
|
|
10
|
-
defaultTreeConfig:
|
|
11
|
-
isOpenTree: boolean;
|
|
12
|
-
transform: boolean;
|
|
13
|
-
idField: string;
|
|
14
|
-
parentField: string;
|
|
15
|
-
childrenField: string;
|
|
16
|
-
indent: number;
|
|
17
|
-
trigger: string;
|
|
18
|
-
lazy: boolean;
|
|
19
|
-
hasChildField: string;
|
|
20
|
-
showIcon: boolean;
|
|
21
|
-
};
|
|
9
|
+
defaultTreeConfig: HolyesTableTreeConfig;
|
|
22
10
|
/** 树形结构, 展开的行Map, 键是行的idField 或 keyNames.id, 值是行数据 */
|
|
23
11
|
treeExpandMap: Map<string, any>;
|
|
24
12
|
/** 处理树形结构 */
|
|
@@ -85,7 +85,7 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<import('vu
|
|
|
85
85
|
loadData: (tempData: any[]) => Promise<void>;
|
|
86
86
|
reloadData: (tempData: any[]) => Promise<void>;
|
|
87
87
|
getCheckboxRecords: (isFull: boolean) => any[];
|
|
88
|
-
clearCheckboxRow: () => void;
|
|
88
|
+
clearCheckboxRow: (field?: string) => void;
|
|
89
89
|
updateFooter: (field?: string) => void;
|
|
90
90
|
updateFooterCellLabel: (field: string, rowIndex: number, label: string) => void;
|
|
91
91
|
getFooterHeight: (footerProps: HolyesTableFooterProps[]) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeIconPropTypes } from 'vxe-pc-ui';
|
|
2
2
|
/** 列插槽类型 */
|
|
3
|
-
export type HolyesTableSlotDefaultType = "a" | "tag" | "icon" | "buttons" | "switch";
|
|
3
|
+
export type HolyesTableSlotDefaultType = "a" | "tag" | "icon" | "buttons" | "switch" | "checkbox";
|
|
4
4
|
/** 表格列属性,额外属性 */
|
|
5
5
|
export type HolyesTableColumnPropsTypeOption = {
|
|
6
6
|
/** 列宽度 */
|
|
@@ -51,7 +51,7 @@ export type HolyesTableColumnPropsTypeOption = {
|
|
|
51
51
|
};
|
|
52
52
|
/** 图标 插槽默认属性 */
|
|
53
53
|
icon?: {
|
|
54
|
-
/** 图标名称, 参考 vxe-icon 图标名称 */
|
|
54
|
+
/** 图标名称, 参考 vxe-icon 图标名称 https://vxeui.com/#/component/icon/base */
|
|
55
55
|
name?: VxeIconPropTypes.Name;
|
|
56
56
|
/** 图标样式 */
|
|
57
57
|
style?: any;
|
|
@@ -111,6 +111,12 @@ export type HolyesTableColumnPropsTypeOption = {
|
|
|
111
111
|
/** 开关点击事件 */
|
|
112
112
|
onChange?: (row: any, index: number) => void;
|
|
113
113
|
};
|
|
114
|
+
checkbox?: {
|
|
115
|
+
/** 多选框是否半选,取决于row的哪个字段 */
|
|
116
|
+
checkedIndeterminateField?: string;
|
|
117
|
+
/** 多选框点击事件 */
|
|
118
|
+
onChange?: (row: any, index: number) => void;
|
|
119
|
+
};
|
|
114
120
|
};
|
|
115
121
|
/** 列表头插槽 */
|
|
116
122
|
header?: string;
|
|
@@ -166,6 +172,10 @@ export interface HolyesTableKeyNames {
|
|
|
166
172
|
isExpandRow: string;
|
|
167
173
|
/** 展开行是否有子展开项 */
|
|
168
174
|
expandChildren: string;
|
|
175
|
+
/** 父级行 */
|
|
176
|
+
parentRow: string;
|
|
177
|
+
/** 多选框是否半选中 */
|
|
178
|
+
checkedIndeterminate: string;
|
|
169
179
|
}
|
|
170
180
|
/** 展开行配置项 */
|
|
171
181
|
export interface HolyesTableExpandConfig {
|
|
@@ -226,7 +236,7 @@ export type HolyesTableFooterColumns = {
|
|
|
226
236
|
};
|
|
227
237
|
/** 树形结构配置项 */
|
|
228
238
|
export type HolyesTableTreeConfig = {
|
|
229
|
-
/**
|
|
239
|
+
/** 是否开启树形结构功能 */
|
|
230
240
|
isOpenTree: boolean;
|
|
231
241
|
/** 自动将列表转为树结构 */
|
|
232
242
|
transform?: boolean;
|
|
@@ -250,6 +260,8 @@ export type HolyesTableTreeConfig = {
|
|
|
250
260
|
reserve?: boolean;
|
|
251
261
|
/** 是否显示树形图标, 默认是true */
|
|
252
262
|
showIcon?: boolean;
|
|
263
|
+
/** 多选框列, 是否父子关联选择, 默认是true */
|
|
264
|
+
checkStrictly?: boolean;
|
|
253
265
|
};
|
|
254
266
|
/** 计算表格每行的高度的 worker 选项 */
|
|
255
267
|
export type HolyesTableGetItemHeightOptions = {
|
|
@@ -63,12 +63,12 @@ export declare const useHolyesTable: (dataObj: {
|
|
|
63
63
|
headerClick: (column: any) => void;
|
|
64
64
|
hoverRow: import('vue').ShallowRef<any, any>;
|
|
65
65
|
cellMousemove: (item: any) => void;
|
|
66
|
-
headerChecked: import('vue').Ref<boolean, boolean
|
|
67
|
-
headerCheckedIndeterminate: import('vue').Ref<boolean, boolean
|
|
68
|
-
onHeaderChecked: () => void;
|
|
69
|
-
onCellChecked: (item: any) => void;
|
|
66
|
+
headerChecked: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
67
|
+
headerCheckedIndeterminate: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
68
|
+
onHeaderChecked: (field: string) => void;
|
|
69
|
+
onCellChecked: (item: any, field?: string) => void;
|
|
70
70
|
getCheckboxRecords: (isFull: boolean) => any[];
|
|
71
|
-
clearCheckboxRow: () => void;
|
|
71
|
+
clearCheckboxRow: (field?: string) => void;
|
|
72
72
|
sortField: import('vue').Ref<string, string>;
|
|
73
73
|
sortOrder: import('vue').Ref<"asc" | "desc" | null, "asc" | "desc" | null>;
|
|
74
74
|
sort: (field: string, order: "desc" | "asc" | null | "auto") => void;
|
|
@@ -140,18 +140,7 @@ export declare const useHolyesTable: (dataObj: {
|
|
|
140
140
|
/** 清除树形结构展开状态 */
|
|
141
141
|
clearTreeExpand: () => void;
|
|
142
142
|
/** 默认的树形结构配置项 */
|
|
143
|
-
defaultTreeConfig:
|
|
144
|
-
isOpenTree: boolean;
|
|
145
|
-
transform: boolean;
|
|
146
|
-
idField: string;
|
|
147
|
-
parentField: string;
|
|
148
|
-
childrenField: string;
|
|
149
|
-
indent: number;
|
|
150
|
-
trigger: string;
|
|
151
|
-
lazy: boolean;
|
|
152
|
-
hasChildField: string;
|
|
153
|
-
showIcon: boolean;
|
|
154
|
-
};
|
|
143
|
+
defaultTreeConfig: import('./type').HolyesTableTreeConfig;
|
|
155
144
|
/** 用于 expand-config,设置展开行,二个参数设置这一行展开与否 */
|
|
156
145
|
setRowExpand: (rows: any[], expanded: boolean) => void;
|
|
157
146
|
slotShowTimestamp: import('vue').Ref<number, number>;
|