holyes-table 1.0.9 → 1.0.11

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.
@@ -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 | undefined;
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, HolyesTableKeyNames } from '../type';
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, HolyesTableKeyNames, HolyesTableTreeConfig } from '../type';
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 { HolyesTableKeyNames, HolyesTableTreeConfig } from '../type';
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 { HolyesTableKeyNames, HolyesTableTreeConfig } from '../type';
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;
@@ -166,6 +166,10 @@ export interface HolyesTableKeyNames {
166
166
  isExpandRow: string;
167
167
  /** 展开行是否有子展开项 */
168
168
  expandChildren: string;
169
+ /** 父级行 */
170
+ parentRow: string;
171
+ /** 多选框是否半选中 */
172
+ checkedIndeterminate: string;
169
173
  }
170
174
  /** 展开行配置项 */
171
175
  export interface HolyesTableExpandConfig {
@@ -226,7 +230,7 @@ export type HolyesTableFooterColumns = {
226
230
  };
227
231
  /** 树形结构配置项 */
228
232
  export type HolyesTableTreeConfig = {
229
- /** 是否开启展开行功能 */
233
+ /** 是否开启树形结构功能 */
230
234
  isOpenTree: boolean;
231
235
  /** 自动将列表转为树结构 */
232
236
  transform?: boolean;
@@ -250,6 +254,8 @@ export type HolyesTableTreeConfig = {
250
254
  reserve?: boolean;
251
255
  /** 是否显示树形图标, 默认是true */
252
256
  showIcon?: boolean;
257
+ /** 多选框列, 是否父子关联选择, 默认是true */
258
+ checkStrictly?: boolean;
253
259
  };
254
260
  /** 计算表格每行的高度的 worker 选项 */
255
261
  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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holyes-table",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "合力思虚拟滚动表格组件",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -44,6 +44,8 @@
44
44
  "vue-tsc": "^2.2.12"
45
45
  },
46
46
  "dependencies": {
47
- "normalize.css": "^8.0.1"
47
+ "normalize.css": "^8.0.1",
48
+ "vxe-pc-ui": "^4.14.11",
49
+ "xe-utils": "^4.0.7"
48
50
  }
49
51
  }