cnhis-design-vue 3.1.22-beta.9 → 3.1.23-beta.0

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 (73) hide show
  1. package/es/components/big-table/index.d.ts +8 -0
  2. package/es/components/big-table/src/BigTable.vue.d.ts +8 -0
  3. package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -23
  4. package/es/components/big-table/src/components/edit-form/edit-date.js +81 -10
  5. package/es/components/big-table/src/components/edit-form/edit-input.js +1 -0
  6. package/es/components/big-table/src/components/edit-form/edit-separate.js +4 -1
  7. package/es/components/big-table/src/hooks/useEdit.d.ts +1 -1
  8. package/es/components/big-table/src/hooks/useEdit2.js +6 -3
  9. package/es/components/big-table/src/hooks/useSeparateRow2.js +1 -41
  10. package/es/components/big-table/src/utils2.js +0 -1
  11. package/es/components/big-table/style/index.css +1 -1
  12. package/es/components/field-set/src/FieldSet.js +5 -1
  13. package/es/components/form-render/src/hooks/useFormContext2.js +2 -1
  14. package/es/components/form-render/src/utils/index.d.ts +0 -1
  15. package/es/components/form-render/src/utils/index.js +1 -10
  16. package/es/components/iho-table/index.d.ts +142 -276
  17. package/es/components/iho-table/index.js +1 -1
  18. package/es/components/iho-table/src/IhoTable.js +52 -31
  19. package/es/components/iho-table/src/IhoTable.vue.d.ts +143 -277
  20. package/es/components/iho-table/src/components/IhoTableColumn.js +2 -2
  21. package/es/components/iho-table/src/constants/index.d.ts +5 -2
  22. package/es/components/iho-table/src/constants/index.js +1 -1
  23. package/es/components/iho-table/src/constants/index2.js +8 -5
  24. package/es/components/iho-table/src/hooks/index.js +1 -1
  25. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +12 -3
  26. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  27. package/es/components/iho-table/src/hooks/tapHooks/index2.js +41 -6
  28. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +16 -0
  29. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -0
  30. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks2.js +26 -0
  31. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +177 -60
  32. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +223 -59
  33. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +10 -0
  34. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -0
  35. package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks2.js +27 -0
  36. package/es/components/iho-table/src/plugins/index.js +2 -1
  37. package/es/components/iho-table/src/plugins/index2.js +2 -1
  38. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +2 -1
  39. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +2 -0
  40. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +2 -0
  41. package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.d.ts +0 -0
  42. package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.js +0 -5
  43. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.js +110 -0
  44. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.vue.d.ts +107 -0
  45. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.d.ts +1 -0
  46. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +158 -0
  47. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.d.ts +14 -0
  48. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.js +1 -0
  49. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils2.js +54 -0
  50. package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +1 -1
  51. package/es/components/iho-table/src/plugins/rendererPlugins/index.js +2 -1
  52. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +2 -1
  53. package/es/components/iho-table/src/types/index.d.ts +8 -3
  54. package/es/components/iho-table/src/types/index.js +1 -1
  55. package/es/components/iho-table/src/types/pluginType.d.ts +105 -81
  56. package/es/components/iho-table/src/types/pluginType.js +1 -1
  57. package/es/components/iho-table/src/types/pluginType2.js +5 -1
  58. package/es/components/iho-table/src/utils/index2.js +1 -1
  59. package/es/components/index.css +1 -1
  60. package/es/components/index.js +1 -1
  61. package/es/components/info-header/index.d.ts +2 -0
  62. package/es/components/info-header/src/InfoHeader.js +3 -1
  63. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -0
  64. package/es/components/info-header/style/iconfont.ttf +0 -0
  65. package/es/components/info-header/style/index.css +1 -1
  66. package/es/shared/utils/index.d.ts +4 -0
  67. package/es/shared/utils/index.js +1 -1
  68. package/es/shared/utils/index2.js +60 -2
  69. package/es/shared/utils/tapable/AsyncSeriesHook.js +17 -2
  70. package/es/shared/utils/tapable/SyncHook.js +23 -2
  71. package/package.json +2 -2
  72. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +0 -1
  73. package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +0 -1
@@ -0,0 +1,158 @@
1
+ import { reactive, inject, unref, createVNode, onBeforeUnmount } from 'vue';
2
+ import { traverse } from '../../../../../../../shared/utils/index2.js';
3
+ import { isFunction } from 'lodash-es';
4
+ import '../../../../../index2.js';
5
+ import { INPUT_TYPE, InjectionIhoTableUUID } from '../../../../constants/index2.js';
6
+ import { getRowHeight } from '../../../../utils/index2.js';
7
+ import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separate-utils2.js';
8
+ import EditSeparate from './edit-separate.js';
9
+ import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
10
+
11
+ function separateRendererPlugins() {
12
+ const pluginName = "separateRendererPlugins";
13
+ const separateRowMap = reactive(/* @__PURE__ */ new Map());
14
+ function getSeparateRowData(uuid, rowData) {
15
+ var _a;
16
+ return (_a = separateRowMap.get(uuid)) == null ? void 0 : _a.get(rowData);
17
+ }
18
+ function setSeparateRowData(uuid, rowData, data) {
19
+ const map = separateRowMap.get(uuid) || /* @__PURE__ */ new WeakMap();
20
+ separateRowMap.set(uuid, map);
21
+ map.set(rowData, data);
22
+ }
23
+ const separateColumnMap = reactive(/* @__PURE__ */ new Map());
24
+ return defineTablePlugin({
25
+ name: pluginName,
26
+ vxe(instance) {
27
+ instance.renderer.add(INPUT_TYPE.SEPARATE, {
28
+ renderCell(renderOpt, {
29
+ column,
30
+ row
31
+ }) {
32
+ var _a;
33
+ const uuid = inject(InjectionIhoTableUUID);
34
+ const separateRow = getSeparateRowData(unref(uuid), row);
35
+ return createVNode("section", null, [(_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]]);
36
+ },
37
+ renderEdit(renderOpt, {
38
+ column,
39
+ row
40
+ }) {
41
+ var _a;
42
+ const uuid = inject(InjectionIhoTableUUID);
43
+ const separateRow = getSeparateRowData(unref(uuid), row);
44
+ const height = getRowHeight();
45
+ return [createVNode(EditSeparate, {
46
+ "value": row[column.field],
47
+ "onUpdate:value": ($event) => row[column.field] = $event,
48
+ "dataIndex": separateRow == null ? void 0 : separateRow.index,
49
+ "height": height,
50
+ "column": column,
51
+ "row": row,
52
+ "displayContent": (_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]
53
+ }, null)];
54
+ }
55
+ });
56
+ },
57
+ apply(hooks) {
58
+ hooks.fieldHooks.fieldList.tap(pluginName, (fieldList, {
59
+ uuid
60
+ }) => {
61
+ uuid && separateColumnMap.set(uuid, getSeparateColumn(fieldList));
62
+ return fieldList;
63
+ function getSeparateColumn(fieldList2) {
64
+ return fieldList2.reduce((res, field) => {
65
+ traverse(field, (item) => {
66
+ isSeparateColumn(item) && res.push(item);
67
+ });
68
+ return res;
69
+ }, []);
70
+ }
71
+ });
72
+ hooks.dataHooks.data.tapPromise(pluginName, async (rowData, {
73
+ insertAfter,
74
+ index: dataIndex,
75
+ $table
76
+ }, config) => {
77
+ if (!config.uuid)
78
+ return;
79
+ const separateColumns = separateColumnMap.get(config.uuid);
80
+ if (!separateColumns || !separateColumns.length)
81
+ return;
82
+ const parsedRowDataInfo = [];
83
+ for (const column of separateColumns) {
84
+ if (!column.field)
85
+ continue;
86
+ const width = await getColumnRenderWidth(column, $table);
87
+ parsedRowDataInfo.push({
88
+ field: column.field,
89
+ data: contentSeparate(rowData[column.field], column, width)
90
+ });
91
+ }
92
+ Array.from({
93
+ length: getColumnInfoMaxLength(parsedRowDataInfo)
94
+ }).forEach((_, index) => {
95
+ const separateData = generateSeparateRowData(parsedRowDataInfo, index);
96
+ if (index === 0) {
97
+ setSeparateRowData(config.uuid, rowData, {
98
+ index: dataIndex,
99
+ separateData
100
+ });
101
+ rowData.$__SEPARATE_DATA = [separateData];
102
+ return;
103
+ }
104
+ const data = {
105
+ $__SEPARATE: true
106
+ };
107
+ setSeparateRowData(config.uuid, data, {
108
+ index: dataIndex,
109
+ separateData
110
+ });
111
+ rowData.$__SEPARATE_DATA.push(separateData);
112
+ insertAfter(data);
113
+ });
114
+ });
115
+ hooks.eventHooks.onResizableChange.tap(pluginName, async ({
116
+ column
117
+ }, context) => {
118
+ if (!isSeparateColumn(column))
119
+ return;
120
+ context.updateTableDataRef();
121
+ });
122
+ hooks.configHooks.editConfig.tap(pluginName, (editConfig = {}, config) => {
123
+ editConfig.activeMethod = avoidOperationDecorator(editConfig.activeMethod);
124
+ return editConfig;
125
+ });
126
+ hooks.configHooks.checkboxConfig.tap(pluginName, (checkboxConfig = {}, config) => {
127
+ checkboxConfig.checkMethod = avoidOperationDecorator(checkboxConfig.checkMethod);
128
+ checkboxConfig.visibleMethod = avoidOperationDecorator(checkboxConfig.visibleMethod);
129
+ return checkboxConfig;
130
+ });
131
+ function avoidOperationDecorator(oldFn) {
132
+ return (...args) => {
133
+ var _a;
134
+ if ((_a = args[0].row) == null ? void 0 : _a.$__SEPARATE)
135
+ return false;
136
+ if (isFunction(oldFn)) {
137
+ return oldFn(...args);
138
+ }
139
+ return true;
140
+ };
141
+ }
142
+ hooks.setupHooks.setup.tap(pluginName, (config) => {
143
+ if (config.value.uuid) {
144
+ separateRowMap.set(config.value.uuid, /* @__PURE__ */ new WeakMap());
145
+ separateColumnMap.set(config.value.uuid, []);
146
+ }
147
+ onBeforeUnmount(() => {
148
+ if (config.value.uuid) {
149
+ separateRowMap.delete(config.value.uuid);
150
+ separateColumnMap.delete(config.value.uuid);
151
+ }
152
+ });
153
+ });
154
+ }
155
+ });
156
+ }
157
+
158
+ export { separateRendererPlugins };
@@ -0,0 +1,14 @@
1
+ import { AnyObject, Nullable } from '../../../../../../../../es/shared/types';
2
+ import { MaybeRef } from '@vueuse/core';
3
+ import { VxeTableDefines, VxeTableInstance } from 'vxe-table';
4
+ import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
5
+ declare type ParsedRowDataInfo = {
6
+ field: string;
7
+ data: string[];
8
+ };
9
+ export declare function getColumnInfoMaxLength(parsedRowDataInfo: ParsedRowDataInfo[]): number;
10
+ export declare function getColumnRenderWidth(column: AnyObject, $table: MaybeRef<Nullable<VxeTableInstance>>): Promise<number>;
11
+ export declare function generateSeparateRowData(parsedRowDataInfo: ParsedRowDataInfo[], index: number): AnyObject;
12
+ export declare function contentSeparate(value: unknown, field: IhoTableFieldItem, width: number): any[];
13
+ export declare function isSeparateColumn(field: IhoTableFieldItem | VxeTableDefines.ColumnInfo): boolean | "" | undefined;
14
+ export {};
@@ -0,0 +1 @@
1
+ export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn } from './separate-utils2.js';
@@ -0,0 +1,54 @@
1
+ import { getStringWidth } from '../../../../../../../shared/utils/index2.js';
2
+ import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
3
+ import { nextTick, unref } from 'vue';
4
+ import { INPUT_TYPE } from '../../../../constants/index2.js';
5
+
6
+ function getColumnInfoMaxLength(parsedRowDataInfo) {
7
+ return Math.max(...parsedRowDataInfo.map((r) => r.data.length), 1);
8
+ }
9
+ async function getColumnRenderWidth(column, $table) {
10
+ const prev = getRenderWidth();
11
+ if (!prev) {
12
+ await nextTick();
13
+ }
14
+ return getRenderWidth() || getColumnWidth();
15
+ function getRenderWidth() {
16
+ var _a, _b;
17
+ return (_b = (_a = unref($table)) == null ? void 0 : _a.getColumnByField(column.field)) == null ? void 0 : _b.renderWidth;
18
+ }
19
+ function getColumnWidth() {
20
+ return isNumber(column.width) ? column.width : 64;
21
+ }
22
+ }
23
+ function generateSeparateRowData(parsedRowDataInfo, index) {
24
+ return parsedRowDataInfo.reduce((res, info) => {
25
+ res[info.field] = info.data[index];
26
+ return res;
27
+ }, {});
28
+ }
29
+ function contentSeparate(value, field, width) {
30
+ if (isArray(value)) {
31
+ return value.map((row) => {
32
+ var _a, _b, _c;
33
+ return (_c = (_b = (_a = field.context) == null ? void 0 : _a.separateFormatter) == null ? void 0 : _b.call(_a, cloneDeep(row))) != null ? _c : row;
34
+ });
35
+ }
36
+ if (!isString(value) || !isNumber(width))
37
+ return [value];
38
+ width -= 24;
39
+ return [...value].reduce((res, char) => {
40
+ const latestString = res[res.length - 1];
41
+ if (getStringWidth(latestString + char) > width) {
42
+ res.push(char);
43
+ } else {
44
+ res[res.length - 1] = latestString + char;
45
+ }
46
+ return res;
47
+ }, [""]);
48
+ }
49
+ function isSeparateColumn(field) {
50
+ var _a;
51
+ return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) === INPUT_TYPE.SEPARATE;
52
+ }
53
+
54
+ export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn };
@@ -1,2 +1,2 @@
1
1
  export * from './widgets';
2
- export * from './inputs';
2
+ export * from './editableWidgets';
@@ -4,4 +4,5 @@ export { colorRendererPlugin } from './widgets/colorRendererPlugin.js';
4
4
  export { seqRendererPlugin } from './widgets/seqRendererPlugin.js';
5
5
  export { checkRendererPlugin } from './widgets/checkRendererPlugin.js';
6
6
  export { pictureRendererPlugin } from './widgets/pictureRendererPlugin.js';
7
- export { inputRendererPlugins } from './inputs/inputRendererPlugins.js';
7
+ export { inputRendererPlugins } from './editableWidgets/inputRendererPlugins.js';
8
+ export { separateRendererPlugins } from './editableWidgets/separateRendererPlugin/index.js';
@@ -1,4 +1,4 @@
1
- import { defineComponent, watch, createVNode } from 'vue';
1
+ import { defineComponent, watch, onBeforeUnmount, createVNode } from 'vue';
2
2
  import { arrayed } from '../../../../../../shared/utils/index2.js';
3
3
  import '../../../../index2.js';
4
4
  import { WIDGET_TYPE } from '../../../constants/index2.js';
@@ -77,6 +77,7 @@ const ViewerImage = defineComponent({
77
77
  }, {
78
78
  deep: true
79
79
  });
80
+ onBeforeUnmount(() => $viewer == null ? void 0 : $viewer.destroy());
80
81
  return () => createVNode("img", {
81
82
  "style": "cursor:pointer",
82
83
  "alt": "",
@@ -13,6 +13,7 @@ declare type GetUnionLast<U> = UnionToIntersectionFn<U> extends () => infer I ?
13
13
  declare type Prepend<Tuple extends unknown[], First> = [First, ...Tuple];
14
14
  export declare type UnionToTuple<Union, T extends unknown[] = [], Last = GetUnionLast<Union>> = [Union] extends [never] ? T : UnionToTuple<Exclude<Union, Last>, Prepend<T, Last>>;
15
15
  export declare type IhoTableConfig = VxeTableProps & Partial<{
16
+ uuid: string;
16
17
  showSeq: boolean;
17
18
  selectType: Exclude<VxeTableDefines.ColumnInfo['type'], 'seq' | 'expand' | 'html'>;
18
19
  rowGroupSetting: Partial<Record<TupleToUnion<typeof IhoTableRowGroupSequence>, IhoTableRowGroupItem[]>>;
@@ -20,6 +21,8 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
20
21
  }>;
21
22
  export declare type IhoTableFieldItem = {
22
23
  [K in keyof VxeTableDefines.ColumnInfo]?: K extends 'children' ? IhoTableFieldItem[] : K extends keyof VxeTableDefines.ColumnInfo ? VxeTableDefines.ColumnInfo[K] : never;
24
+ } & {
25
+ context?: AnyObject;
23
26
  } & {
24
27
  [K: string]: unknown;
25
28
  };
@@ -32,10 +35,11 @@ export declare type LowCodeTableFieldItem = {
32
35
  columnName: string;
33
36
  [K: string]: unknown;
34
37
  } & Partial<{
35
- id?: number | string;
36
- title?: string;
37
- colWidth?: string | number;
38
+ id: number | string;
39
+ title: string;
40
+ colWidth: string | number;
38
41
  settingObj: LowCodeTableSettingObj;
42
+ context: AnyObject;
39
43
  }>;
40
44
  export declare type IhoFormChangePayload = {
41
45
  column: VxeTableDefines.ColumnInfo;
@@ -44,3 +48,4 @@ export declare type IhoFormChangePayload = {
44
48
  index: number;
45
49
  };
46
50
  export declare type EventListenerToEventName<T extends string> = T extends `on${infer R}` ? R extends `${infer F}${infer L}` ? `${Lowercase<F>}${L}` : never : never;
51
+ export declare type IhoTableHandler = Record<'updateConfigRef' | 'updateFieldListRef' | 'updateTableDataRef', () => void>;
@@ -1 +1 @@
1
- export { AbstractConfigHooks, AbstractEventHooks, AbstractFieldHooks } from './pluginType2.js';
1
+ export { AbstractConfigHooks, AbstractDataHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './pluginType2.js';
@@ -1,9 +1,11 @@
1
- import { ArrayAble, Nullable } from '../../../../../es/shared/types';
2
- import { AsyncParallelHook, SyncWaterfallHook } from '../../../../../es/shared/utils/tapable';
1
+ import { AnyObject, ArrayAble, Func, NotNull, Nullable } from '../../../../../es/shared/types';
2
+ import { AsyncParallelHook, AsyncSeriesHook, SyncHook, SyncWaterfallHook } from '../../../../../es/shared/utils/tapable';
3
+ import { MaybeRef } from '@vueuse/core';
4
+ import { Ref } from 'vue';
3
5
  import { VxeGlobalCommands, VxeGlobalFormats, VxeGlobalHooks, VxeGlobalMenus, VxeGlobalRenderer, VxeTableInstance } from 'vxe-table';
4
6
  import { VxeTableEventProps, VxeTableEvents } from 'vxe-table/types/table';
5
7
  import { VxeGlobalInterceptor } from 'vxe-table/types/v-x-e-table';
6
- import { IhoTableConfig, IhoTableFieldItem } from '.';
8
+ import { IhoTableConfig, IhoTableFieldItem, IhoTableHandler } from '.';
7
9
  export declare type IhoTableInstance = {
8
10
  interceptor: VxeGlobalInterceptor;
9
11
  renderer: VxeGlobalRenderer;
@@ -21,27 +23,30 @@ export declare type TableHooks = Readonly<{
21
23
  configHooks: AbstractConfigHooks;
22
24
  fieldHooks: AbstractFieldHooks;
23
25
  eventHooks: AbstractEventHooks;
26
+ dataHooks: AbstractDataHooks;
27
+ setupHooks: AbstractSetupHooks;
24
28
  }>;
25
29
  export declare type WithTableConfig<T = []> = T extends any[] ? [...T, IhoTableConfig] : [T, IhoTableConfig];
30
+ declare type ConfigHookType<T> = SyncWaterfallHook<WithTableConfig<T>>;
26
31
  export declare abstract class AbstractConfigHooks {
27
32
  abstract readonly config: SyncWaterfallHook<IhoTableConfig>;
28
- abstract readonly rowConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['rowConfig']>>;
29
- abstract readonly editConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['editConfig']>>;
30
- abstract readonly columnConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['columnConfig']>>;
31
- abstract readonly resizableConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['resizableConfig']>>;
32
- abstract readonly seqConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['seqConfig']>>;
33
- abstract readonly sortConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['sortConfig']>>;
34
- abstract readonly filterConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['filterConfig']>>;
35
- abstract readonly radioConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['radioConfig']>>;
36
- abstract readonly checkboxConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['checkboxConfig']>>;
37
- abstract readonly expandConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['expandConfig']>>;
38
- abstract readonly treeConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['treeConfig']>>;
39
- abstract readonly mouseConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['mouseConfig']>>;
40
- abstract readonly menuConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['menuConfig']>>;
41
- abstract readonly keyboardConfig: SyncWaterfallHook<WithTableConfig<IhoTableConfig['keyboardConfig']>>;
42
- abstract readonly scrollY: SyncWaterfallHook<WithTableConfig<IhoTableConfig['scrollY']>>;
43
- abstract readonly scrollX: SyncWaterfallHook<WithTableConfig<IhoTableConfig['scrollX']>>;
44
- abstract readonly editRules: SyncWaterfallHook<WithTableConfig<IhoTableConfig['editRules']>>;
33
+ abstract readonly rowConfig: ConfigHookType<IhoTableConfig['rowConfig']>;
34
+ abstract readonly editConfig: ConfigHookType<IhoTableConfig['editConfig']>;
35
+ abstract readonly columnConfig: ConfigHookType<IhoTableConfig['columnConfig']>;
36
+ abstract readonly resizableConfig: ConfigHookType<IhoTableConfig['resizableConfig']>;
37
+ abstract readonly seqConfig: ConfigHookType<IhoTableConfig['seqConfig']>;
38
+ abstract readonly sortConfig: ConfigHookType<IhoTableConfig['sortConfig']>;
39
+ abstract readonly filterConfig: ConfigHookType<IhoTableConfig['filterConfig']>;
40
+ abstract readonly radioConfig: ConfigHookType<IhoTableConfig['radioConfig']>;
41
+ abstract readonly checkboxConfig: ConfigHookType<IhoTableConfig['checkboxConfig']>;
42
+ abstract readonly expandConfig: ConfigHookType<IhoTableConfig['expandConfig']>;
43
+ abstract readonly treeConfig: ConfigHookType<IhoTableConfig['treeConfig']>;
44
+ abstract readonly mouseConfig: ConfigHookType<IhoTableConfig['mouseConfig']>;
45
+ abstract readonly menuConfig: ConfigHookType<IhoTableConfig['menuConfig']>;
46
+ abstract readonly keyboardConfig: ConfigHookType<IhoTableConfig['keyboardConfig']>;
47
+ abstract readonly scrollY: ConfigHookType<IhoTableConfig['scrollY']>;
48
+ abstract readonly scrollX: ConfigHookType<IhoTableConfig['scrollX']>;
49
+ abstract readonly editRules: ConfigHookType<IhoTableConfig['editRules']>;
45
50
  }
46
51
  export interface FieldHookContext {
47
52
  index: number;
@@ -55,69 +60,88 @@ export declare abstract class AbstractFieldHooks {
55
60
  abstract readonly fieldList: SyncWaterfallHook<WithTableConfig<[IhoTableFieldItem[]]>>;
56
61
  abstract readonly fieldEnd: AsyncParallelHook<WithTableConfig>;
57
62
  }
58
- export declare type WithIhoEventContext<T> = T extends any[] ? [...T, IhoTableConfig, Nullable<VxeTableInstance>] : [T, IhoTableConfig, Nullable<VxeTableInstance>];
63
+ export declare type WithIhoEventContext<T> = T extends any[] ? [...T, IhoTableHandler & {
64
+ $table: Nullable<VxeTableInstance>;
65
+ }, IhoTableConfig] : [T, IhoTableHandler & {
66
+ $table: Nullable<VxeTableInstance>;
67
+ }, IhoTableConfig];
68
+ declare type EventHookType<T extends Func> = AsyncParallelHook<WithIhoEventContext<Parameters<T>>>;
59
69
  declare type VxeEventTypes = Required<{
60
- readonly [K in keyof VxeTableEventProps]: AsyncParallelHook<WithIhoEventContext<VxeTableEventProps[K]>>;
70
+ readonly [K in keyof VxeTableEventProps]: EventHookType<NotNull<VxeTableEventProps[K]>>;
61
71
  }>;
62
72
  export declare abstract class AbstractEventHooks implements VxeEventTypes {
63
- abstract readonly onKeydownStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.KeydownStart>>;
64
- abstract readonly onKeydown: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Keydown>>;
65
- abstract readonly onKeydownEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.KeydownEnd>>;
66
- abstract readonly onPaste: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Paste>>;
67
- abstract readonly onCopy: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Copy>>;
68
- abstract readonly onCut: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Cut>>;
69
- abstract readonly onCurrentChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CurrentChange>>;
70
- abstract readonly onRadioChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.RadioChange>>;
71
- abstract readonly onCheckboxChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CheckboxChange>>;
72
- abstract readonly onCheckboxAll: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CheckboxAll>>;
73
- abstract readonly onCheckboxRangeStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CheckboxRangeStart>>;
74
- abstract readonly onCheckboxRangeChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CheckboxRangeChange>>;
75
- abstract readonly onCheckboxRangeEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CheckboxRangeEnd>>;
76
- abstract readonly onCellClick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellClick>>;
77
- abstract readonly onCellDblclick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellDblclick>>;
78
- abstract readonly onCellMenu: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellMenu>>;
79
- abstract readonly onCellMouseenter: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellMouseenter>>;
80
- abstract readonly onCellMouseleave: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellMouseleave>>;
81
- abstract readonly onHeaderCellClick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.HeaderCellClick>>;
82
- abstract readonly onHeaderCellDblclick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.HeaderCellDblclick>>;
83
- abstract readonly onHeaderCellMenu: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.HeaderCellMenu>>;
84
- abstract readonly onFooterCellClick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FooterCellClick>>;
85
- abstract readonly onFooterCellDblclick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FooterCellDblclick>>;
86
- abstract readonly onFooterCellMenu: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FooterCellMenu>>;
87
- abstract readonly onSortChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.SortChange>>;
88
- abstract readonly onFilterChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FilterChange>>;
89
- abstract readonly onFilterVisible: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FilterVisible>>;
90
- abstract readonly onResizableChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ResizableChange>>;
91
- abstract readonly onToggleRowExpand: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ToggleRowExpand>>;
92
- abstract readonly onToggleTreeExpand: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ToggleTreeExpand>>;
93
- abstract readonly onMenuClick: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.MenuClick>>;
94
- abstract readonly onEditClosed: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.EditClosed>>;
95
- abstract readonly onEditActived: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.EditActived>>;
96
- abstract readonly onEditDisabled: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.EditDisabled>>;
97
- abstract readonly onValidError: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ValidError>>;
98
- abstract readonly onScroll: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Scroll>>;
99
- abstract readonly onCustom: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.Custom>>;
100
- abstract readonly onOpenFnr: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.OpenFnr>>;
101
- abstract readonly onFnrChange: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FnrChange>>;
102
- abstract readonly onFnrFind: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FnrFind>>;
103
- abstract readonly onFnrFindAll: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FnrFindAll>>;
104
- abstract readonly onFnrReplace: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FnrReplace>>;
105
- abstract readonly onFnrReplaceAll: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.FnrReplaceAll>>;
106
- abstract readonly onCellAreaCopy: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaCopy>>;
107
- abstract readonly onCellAreaCut: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaCut>>;
108
- abstract readonly onCellAreaPaste: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaPaste>>;
109
- abstract readonly onCellAreaMerge: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaMerge>>;
110
- abstract readonly onClearCellAreaMerge: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ClearCellAreaMerge>>;
111
- abstract readonly onHeaderCellAreaSelection: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.HeaderCellAreaSelection>>;
112
- abstract readonly onCellAreaSelectionStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaSelectionStart>>;
113
- abstract readonly onCellAreaSelectionDrag: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaSelectionDrag>>;
114
- abstract readonly onCellAreaSelectionEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaSelectionEnd>>;
115
- abstract readonly onCellAreaExtensionStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaExtensionStart>>;
116
- abstract readonly onCellAreaExtensionDrag: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaExtensionDrag>>;
117
- abstract readonly onCellAreaExtensionEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaExtensionEnd>>;
118
- abstract readonly onCellAreaArrowsStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaArrowsStart>>;
119
- abstract readonly onCellAreaArrowsEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.CellAreaArrowsEnd>>;
120
- abstract readonly onActiveCellChangeStart: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ActiveCellChangeStart>>;
121
- abstract readonly onActiveCellChangeEnd: AsyncParallelHook<WithIhoEventContext<VxeTableEvents.ActiveCellChangeEnd>>;
73
+ abstract readonly onKeydownStart: EventHookType<VxeTableEvents.KeydownStart>;
74
+ abstract readonly onKeydown: EventHookType<VxeTableEvents.Keydown>;
75
+ abstract readonly onKeydownEnd: EventHookType<VxeTableEvents.KeydownEnd>;
76
+ abstract readonly onPaste: EventHookType<VxeTableEvents.Paste>;
77
+ abstract readonly onCopy: EventHookType<VxeTableEvents.Copy>;
78
+ abstract readonly onCut: EventHookType<VxeTableEvents.Cut>;
79
+ abstract readonly onCurrentChange: EventHookType<VxeTableEvents.CurrentChange>;
80
+ abstract readonly onRadioChange: EventHookType<VxeTableEvents.RadioChange>;
81
+ abstract readonly onCheckboxChange: EventHookType<VxeTableEvents.CheckboxChange>;
82
+ abstract readonly onCheckboxAll: EventHookType<VxeTableEvents.CheckboxAll>;
83
+ abstract readonly onCheckboxRangeStart: EventHookType<VxeTableEvents.CheckboxRangeStart>;
84
+ abstract readonly onCheckboxRangeChange: EventHookType<VxeTableEvents.CheckboxRangeChange>;
85
+ abstract readonly onCheckboxRangeEnd: EventHookType<VxeTableEvents.CheckboxRangeEnd>;
86
+ abstract readonly onCellClick: EventHookType<VxeTableEvents.CellClick>;
87
+ abstract readonly onCellDblclick: EventHookType<VxeTableEvents.CellDblclick>;
88
+ abstract readonly onCellMenu: EventHookType<VxeTableEvents.CellMenu>;
89
+ abstract readonly onCellMouseenter: EventHookType<VxeTableEvents.CellMouseenter>;
90
+ abstract readonly onCellMouseleave: EventHookType<VxeTableEvents.CellMouseleave>;
91
+ abstract readonly onHeaderCellClick: EventHookType<VxeTableEvents.HeaderCellClick>;
92
+ abstract readonly onHeaderCellDblclick: EventHookType<VxeTableEvents.HeaderCellDblclick>;
93
+ abstract readonly onHeaderCellMenu: EventHookType<VxeTableEvents.HeaderCellMenu>;
94
+ abstract readonly onFooterCellClick: EventHookType<VxeTableEvents.FooterCellClick>;
95
+ abstract readonly onFooterCellDblclick: EventHookType<VxeTableEvents.FooterCellDblclick>;
96
+ abstract readonly onFooterCellMenu: EventHookType<VxeTableEvents.FooterCellMenu>;
97
+ abstract readonly onSortChange: EventHookType<VxeTableEvents.SortChange>;
98
+ abstract readonly onFilterChange: EventHookType<VxeTableEvents.FilterChange>;
99
+ abstract readonly onFilterVisible: EventHookType<VxeTableEvents.FilterVisible>;
100
+ abstract readonly onResizableChange: EventHookType<VxeTableEvents.ResizableChange>;
101
+ abstract readonly onToggleRowExpand: EventHookType<VxeTableEvents.ToggleRowExpand>;
102
+ abstract readonly onToggleTreeExpand: EventHookType<VxeTableEvents.ToggleTreeExpand>;
103
+ abstract readonly onMenuClick: EventHookType<VxeTableEvents.MenuClick>;
104
+ abstract readonly onEditClosed: EventHookType<VxeTableEvents.EditClosed>;
105
+ abstract readonly onEditActived: EventHookType<VxeTableEvents.EditActived>;
106
+ abstract readonly onEditDisabled: EventHookType<VxeTableEvents.EditDisabled>;
107
+ abstract readonly onValidError: EventHookType<VxeTableEvents.ValidError>;
108
+ abstract readonly onScroll: EventHookType<VxeTableEvents.Scroll>;
109
+ abstract readonly onCustom: EventHookType<VxeTableEvents.Custom>;
110
+ abstract readonly onOpenFnr: EventHookType<VxeTableEvents.OpenFnr>;
111
+ abstract readonly onFnrChange: EventHookType<VxeTableEvents.FnrChange>;
112
+ abstract readonly onFnrFind: EventHookType<VxeTableEvents.FnrFind>;
113
+ abstract readonly onFnrFindAll: EventHookType<VxeTableEvents.FnrFindAll>;
114
+ abstract readonly onFnrReplace: EventHookType<VxeTableEvents.FnrReplace>;
115
+ abstract readonly onFnrReplaceAll: EventHookType<VxeTableEvents.FnrReplaceAll>;
116
+ abstract readonly onCellAreaCopy: EventHookType<VxeTableEvents.CellAreaCopy>;
117
+ abstract readonly onCellAreaCut: EventHookType<VxeTableEvents.CellAreaCut>;
118
+ abstract readonly onCellAreaPaste: EventHookType<VxeTableEvents.CellAreaPaste>;
119
+ abstract readonly onCellAreaMerge: EventHookType<VxeTableEvents.CellAreaMerge>;
120
+ abstract readonly onClearCellAreaMerge: EventHookType<VxeTableEvents.ClearCellAreaMerge>;
121
+ abstract readonly onHeaderCellAreaSelection: EventHookType<VxeTableEvents.HeaderCellAreaSelection>;
122
+ abstract readonly onCellAreaSelectionStart: EventHookType<VxeTableEvents.CellAreaSelectionStart>;
123
+ abstract readonly onCellAreaSelectionDrag: EventHookType<VxeTableEvents.CellAreaSelectionDrag>;
124
+ abstract readonly onCellAreaSelectionEnd: EventHookType<VxeTableEvents.CellAreaSelectionEnd>;
125
+ abstract readonly onCellAreaExtensionStart: EventHookType<VxeTableEvents.CellAreaExtensionStart>;
126
+ abstract readonly onCellAreaExtensionDrag: EventHookType<VxeTableEvents.CellAreaExtensionDrag>;
127
+ abstract readonly onCellAreaExtensionEnd: EventHookType<VxeTableEvents.CellAreaExtensionEnd>;
128
+ abstract readonly onCellAreaArrowsStart: EventHookType<VxeTableEvents.CellAreaArrowsStart>;
129
+ abstract readonly onCellAreaArrowsEnd: EventHookType<VxeTableEvents.CellAreaArrowsEnd>;
130
+ abstract readonly onActiveCellChangeStart: EventHookType<VxeTableEvents.ActiveCellChangeStart>;
131
+ abstract readonly onActiveCellChangeEnd: EventHookType<VxeTableEvents.ActiveCellChangeEnd>;
132
+ }
133
+ declare type DataHookContext = {
134
+ remove(): void;
135
+ $table: MaybeRef<Nullable<VxeTableInstance>>;
136
+ index: number;
137
+ insertBefore(data: ArrayAble<AnyObject>): void;
138
+ insertAfter(data: ArrayAble<AnyObject>): void;
139
+ };
140
+ export declare type WithTableDataContext<T> = T extends any[] ? [...T, ...WithTableConfig<DataHookContext>] : [T, ...WithTableConfig<DataHookContext>];
141
+ export declare abstract class AbstractDataHooks {
142
+ abstract readonly data: AsyncSeriesHook<WithTableDataContext<[AnyObject]>>;
143
+ }
144
+ export declare abstract class AbstractSetupHooks {
145
+ abstract readonly setup: SyncHook<[Ref<IhoTableConfig>, Ref<IhoTableFieldItem[]>]>;
122
146
  }
123
147
  export {};
@@ -1 +1 @@
1
- export { AbstractConfigHooks, AbstractEventHooks, AbstractFieldHooks } from './pluginType2.js';
1
+ export { AbstractConfigHooks, AbstractDataHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './pluginType2.js';
@@ -4,5 +4,9 @@ class AbstractFieldHooks {
4
4
  }
5
5
  class AbstractEventHooks {
6
6
  }
7
+ class AbstractDataHooks {
8
+ }
9
+ class AbstractSetupHooks {
10
+ }
7
11
 
8
- export { AbstractConfigHooks, AbstractEventHooks, AbstractFieldHooks };
12
+ export { AbstractConfigHooks, AbstractDataHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks };
@@ -11,7 +11,7 @@ function getRowHeight() {
11
11
  var _a, _b, _c;
12
12
  const config = inject(InjectionIhoTableConfig);
13
13
  if (!config) {
14
- IhoTableWarn("please use this function(getRowHeight) in setup environment");
14
+ IhoTableWarn("this function(getRowHeight) only can be used in setup environment");
15
15
  }
16
16
  return (_c = (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.rowConfig) == null ? void 0 : _b.height) != null ? _c : 32;
17
17
  }