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.
- package/README.md +2 -1
- package/dist/index.mjs +363 -348
- package/dist/lib/pretextTable/hook/useCheckbox.d.ts +1 -0
- package/dist/lib/pretextTable/pretextTable.vue.d.ts +1 -0
- package/dist/lib/pretextTable/type.d.ts +14 -1
- package/dist/lib/pretextTable/useHolyesTable.d.ts +7 -0
- package/package.json +1 -1
- package/skills/holyes-table/SKILL.md +8 -1
- package//346/233/264/346/226/260/346/227/245/345/277/227.md +8 -0
|
@@ -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
|
@@ -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
|
/** 获取所有选中的行数据 */
|