holyes-table 1.0.23 → 1.0.25

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.
@@ -6,6 +6,7 @@ export declare function useCheckbox(dataObj: {
6
6
  blurAnyElement: () => void;
7
7
  nowDataSource: ShallowRef<any[]>;
8
8
  baseDataSource: ShallowRef<any[]>;
9
+ baseDataMap: Map<string, any>;
9
10
  emits: any;
10
11
  /** 多选框列, 是否父子关联选择, 默认是true */
11
12
  treeConfig?: HolyesTableTreeConfig;
@@ -108,6 +108,7 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<import('vu
108
108
  getTableData: () => {
109
109
  fullData: any[];
110
110
  visibleData: any[];
111
+ baseDataMap: Map<string, any>;
111
112
  };
112
113
  setTreeExpand: (rows: any[], expanded: boolean) => Promise<void>;
113
114
  setAllTreeExpand: (isExpand: boolean) => void;
@@ -15,7 +15,7 @@ export type HolyesTableColumnPropsTypeOption = {
15
15
  sortField?: string;
16
16
  /** 列类型 */
17
17
  type?: "seq" | "checkbox" | "expand";
18
- /** 列样式 */
18
+ /** 表头列样式 */
19
19
  style?: any;
20
20
  /** 列是否可筛选 */
21
21
  isFilter?: {
@@ -119,6 +119,7 @@ export type HolyesTableColumnPropsTypeOption = {
119
119
  /** 开关点击事件 */
120
120
  onChange?: (row: any, index: number) => void;
121
121
  };
122
+ /** 多选框 插槽默认属性 */
122
123
  checkbox?: {
123
124
  /** 多选框是否半选,取决于row的哪个字段 */
124
125
  checkedIndeterminateField?: string;
@@ -127,6 +128,11 @@ export type HolyesTableColumnPropsTypeOption = {
127
128
  /** 多选框点击事件 */
128
129
  onChange?: (row: any, index: number) => void;
129
130
  };
131
+ /** 链接 插槽默认属性 */
132
+ a?: {
133
+ /** 链接点击事件 */
134
+ onClick?: (row: any, index: number) => void;
135
+ };
130
136
  };
131
137
  /** 列表头插槽 */
132
138
  header?: string;
@@ -135,6 +141,13 @@ export type HolyesTableColumnPropsTypeOption = {
135
141
  /** 表尾插槽 */
136
142
  footer?: string;
137
143
  };
144
+ /** 单元格类名,最好里面不要涉及到改字体大小 */
145
+ cellClassName?: string | ((obj: {
146
+ column: HolyesTableColumnPropsType;
147
+ row: any;
148
+ index: number;
149
+ }) => string);
150
+ /** 表尾配置 */
138
151
  footer?: {
139
152
  /** 表尾行高度 */
140
153
  height?: number;
@@ -65,6 +65,11 @@ export declare const useHolyesTable: (dataObj: {
65
65
  headerClick: (column: any) => void;
66
66
  hoverRow: import('vue').ShallowRef<any, any>;
67
67
  cellMousemove: (item: any) => void;
68
+ resolveCellClassName: (obj: {
69
+ column: HolyesTableColumnPropsType;
70
+ row: any;
71
+ index: number;
72
+ }) => string;
68
73
  headerChecked: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
69
74
  headerCheckedIndeterminate: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
70
75
  onHeaderChecked: (field: string) => void;
@@ -158,5 +163,7 @@ export declare const useHolyesTable: (dataObj: {
158
163
  fullData: any[];
159
164
  /** 当前筛选后数据 */
160
165
  visibleData: any[];
166
+ /** 表格数据映射 */
167
+ baseDataMap: Map<string, any>;
161
168
  };
162
169
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holyes-table",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "合力思虚拟滚动表格组件",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -309,6 +309,7 @@ interface HolyesTableColumnPropsType {
309
309
  /** 开关点击事件 */
310
310
  onChange?: (row: any, index: number) => void
311
311
  }
312
+ /** 多选框 插槽默认属性 */
312
313
  checkbox?: {
313
314
  /** 多选框是否半选,取决于row的哪个字段 */
314
315
  checkedIndeterminateField?: string
@@ -316,6 +317,11 @@ interface HolyesTableColumnPropsType {
316
317
  disabledField?: string
317
318
  /** 多选框点击事件 */
318
319
  onChange?: (row: any, index: number) => void
320
+ },
321
+ /** 链接 插槽默认属性 */
322
+ a?: {
323
+ /** 链接点击事件 */
324
+ onClick?: (row: any, index: number) => void
319
325
  }
320
326
  }
321
327
  /** 列表头插槽 */
@@ -542,7 +548,7 @@ type HolyesTableFooterProps = {
542
548
  | 方法名 | 参数 | 返回值 | 说明 |
543
549
  | -------- | ------ | -------- | -------- |
544
550
  | reloadData | `(data: any[])` | `Promise<void>` | 重新设置表格数据 |
545
- | getTableData | `()` | `{ fullData, visibleData }` | 获取表格数据(包含全部数据、当前可见数据) |
551
+ | getTableData | `()` | `{ fullData, visibleData, baseDataMap }` | 获取表格数据(包含全部数据、当前可见数据、表格数据映射) |
546
552
  | getCheckboxRecords | `(isFull: boolean, field?: string)` | `any[]` | 获取所有选中的行数据,isFull 为false时, 只获取当前可见数据的选中行; field 为选中列字段, 默认第一个选中列字段 |
547
553
  | clearCheckboxRow | `()` | `void` | 清空多选列选中状态 |
548
554
  | updateFooter | `()` | `void` | 更新表尾行数据 |
@@ -586,6 +592,7 @@ const getTableData = () => {
586
592
  const tableData = pretextTableRef.value?.getTableData()
587
593
  console.log('全部数据:', tableData.fullData)
588
594
  console.log('当前可见数据:', tableData.visibleData)
595
+ console.log('表格数据映射:', tableData.baseDataMap)
589
596
  }
590
597
 
591
598
  /** 获取所有选中的行数据 */
@@ -1,5 +1,13 @@
1
1
  # 更新日志
2
2
 
3
+ ## v1.0.25 (2026-07-03)
4
+
5
+ - 调整表格样式,增加样式相关列属性cellClassName
6
+
7
+ ## v1.0.24 (2026-07-03)
8
+
9
+ - 调整表格数据,避免外面用时,引起循环引用问题
10
+
3
11
  ## v1.0.23 (2026-06-29)
4
12
 
5
13
  - 增加列插槽icon的nameField属性,和styleField属性,用于显示图标名称和图标样式