cnhis-design-vue 3.1.22-beta.1 → 3.1.22-beta.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.
- package/README.md +123 -123
- package/es/components/big-table/index.d.ts +0 -8
- package/es/components/big-table/index2.js +0 -2
- package/es/components/big-table/src/BigTable.vue.d.ts +0 -8
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +22 -30
- package/es/components/big-table/src/components/edit-form/edit-date.js +81 -10
- package/es/components/big-table/src/components/edit-form/edit-input.js +1 -0
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +4 -0
- package/es/components/big-table/src/hooks/useEdit2.js +2 -2
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/{form-render/src/components/index.d.ts → bpmn-workflow/src/BpmnWorkflow.d.ts} +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/index.d.ts +1 -0
- package/es/components/fabric-chart/src/FabricChart.js +3 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCenter.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/useCenter2.js +15 -3
- package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useLeft2.js +7 -5
- package/es/components/fabric-chart/src/interface.d.ts +2 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +6823 -0
- package/es/components/form-render/src/components/renderer/cascader.js +10 -7
- package/es/components/form-render/src/components/renderer/combination.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/combination.js +4 -1
- package/es/components/form-render/src/components/renderer/date.js +11 -4
- package/es/components/form-render/src/components/renderer/input.js +2 -2
- package/es/components/form-render/src/components/renderer/inputNumber.js +2 -2
- package/es/components/form-render/src/components/renderer/search.js +3 -3
- package/es/components/form-render/src/components/renderer/select.js +3 -3
- package/es/components/form-render/src/components/renderer/textarea.js +2 -2
- package/es/components/form-render/src/hooks/useCommonInjection2.js +6 -2
- package/es/components/form-render/src/utils/schema.d.ts +4 -1
- package/es/components/form-render/src/utils/schema.js +1 -1
- package/es/components/form-render/src/utils/schema2.js +9 -2
- package/es/components/grid/index2.js +0 -2
- package/es/components/iho-table/index.d.ts +4248 -337
- package/es/components/iho-table/index.js +2 -2
- package/es/components/iho-table/index2.js +9 -4
- package/es/components/iho-table/src/IhoTable.js +39 -13
- package/es/components/iho-table/src/IhoTable.vue.d.ts +4236 -326
- package/es/components/iho-table/src/components/IhoTableColumn.d.ts +2 -2
- package/es/components/iho-table/src/components/IhoTableColumn.js +25 -5
- package/es/components/iho-table/src/constants/index.d.ts +8 -1
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +79 -1
- package/es/components/iho-table/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +7 -0
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index2.js +92 -21
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +14 -0
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks2.js +39 -1
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +14 -0
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks2.js +26 -0
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +61 -60
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +62 -60
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks.d.ts +4 -1
- package/es/components/iho-table/src/hooks/tapHooks/useFieldHooks2.js +4 -1
- package/es/components/iho-table/src/hooks/useTablePlugin.d.ts +2 -2
- package/es/components/iho-table/src/hooks/useTablePlugin2.js +2 -3
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index2.js +3 -2
- package/es/components/iho-table/src/plugins/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/index.js +8 -5
- package/es/components/iho-table/src/plugins/index2.js +8 -5
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +10 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +2 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/index.js +7 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/inputRendererPlugins.js +49 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.d.ts → widgets/checkRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{checkRendererPlugin.js → widgets/checkRendererPlugin.js} +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.d.ts → widgets/colorRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{colorRendererPlugin.js → widgets/colorRendererPlugin.js} +6 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.d.ts → widgets/defaultRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{defaultRendererPlugin.js → widgets/defaultRendererPlugin.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.d.ts +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/index.js +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.d.ts → widgets/labelRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{labelRendererPlugin.js → widgets/labelRendererPlugin.js} +3 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +89 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.d.ts → widgets/seqRendererPlugin.d.ts} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/{seqRendererPlugin.js → widgets/seqRendererPlugin.js} +3 -3
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +72 -0
- package/es/components/iho-table/src/types/index.d.ts +31 -8
- package/es/components/iho-table/src/types/index.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +102 -65
- package/es/components/iho-table/src/types/pluginType.js +1 -1
- package/es/components/iho-table/src/types/pluginType2.js +3 -1
- package/es/components/iho-table/src/utils/index.d.ts +3 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/src/utils/index2.js +16 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +2 -2
- package/es/components/index2.js +1 -1
- package/es/components/info-header/style/iconfont.ttf +0 -0
- package/es/components/info-header/style/index.css +1 -1
- package/es/shared/utils/tapable/SyncHook.js +23 -2
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +4 -4
- package/es/components/form-render/src/components/index.js +0 -1
- package/es/shared/utils/loadVxe.d.ts +0 -2
- package/es/shared/utils/loadVxe.js +0 -1
- package/es/shared/utils/loadVxe2.js +0 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { IhoTableFieldItem } from '../../../../../es/components/iho-table/src/types';
|
|
3
|
-
declare const
|
|
3
|
+
declare const ColumnComponent: import("vue").DefineComponent<{
|
|
4
4
|
field: {
|
|
5
5
|
type: PropType<IhoTableFieldItem>;
|
|
6
6
|
required: true;
|
|
@@ -11,4 +11,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
13
|
}>>, {}>;
|
|
14
|
-
export default
|
|
14
|
+
export default ColumnComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, resolveComponent, createVNode } from 'vue';
|
|
2
|
+
import { isEmpty, omit } from 'lodash-es';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const ColumnComponent = defineComponent({
|
|
5
5
|
name: "IhoTableColumn",
|
|
6
6
|
props: {
|
|
7
7
|
field: {
|
|
@@ -10,8 +10,28 @@ var IhoTableColumn = defineComponent({
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
setup(props) {
|
|
13
|
-
|
|
13
|
+
const VxeColumn = resolveComponent("vxe-column");
|
|
14
|
+
const VxeColumnGroup = resolveComponent("vxe-colgroup");
|
|
15
|
+
function renderColumn(field) {
|
|
16
|
+
return createVNode(VxeColumn, field, null);
|
|
17
|
+
}
|
|
18
|
+
function renderColumnGroup(group, children) {
|
|
19
|
+
return createVNode(VxeColumnGroup, omit(group, ["children"]), {
|
|
20
|
+
default: () => children.map((child) => createVNode(ColumnComponent, {
|
|
21
|
+
"field": child
|
|
22
|
+
}, null))
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return () => {
|
|
26
|
+
return !isEmpty(children()) ? renderColumnGroup(field(), children()) : renderColumn(field());
|
|
27
|
+
function field() {
|
|
28
|
+
return props.field;
|
|
29
|
+
}
|
|
30
|
+
function children() {
|
|
31
|
+
return props.field.children;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
14
34
|
}
|
|
15
35
|
});
|
|
16
36
|
|
|
17
|
-
export {
|
|
37
|
+
export { ColumnComponent as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { InjectionKey, Ref } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
4
|
+
import { IhoTableConfig, UnionToTuple } from '../../../../../es/components/iho-table';
|
|
4
5
|
export declare enum WIDGET_TYPE {
|
|
5
6
|
DEFAULT = "DEFAULT",
|
|
6
7
|
PICTURE = "PICTURE",
|
|
@@ -36,5 +37,11 @@ export declare enum WIDGET_TYPE {
|
|
|
36
37
|
BANK_CARD = "BANK_CARD",
|
|
37
38
|
SEQUENCE = "SEQUENCE"
|
|
38
39
|
}
|
|
40
|
+
export declare const VxeEventListenerNameList: Readonly<UnionToTuple<keyof VxeTableEventProps>>;
|
|
41
|
+
export declare const IhoTableRowGroupSequence: readonly ["firstRowGroup", "secondRowGroup", "thirdRowGroup", "fourthRowGroup", "fifthRowGroup", "sixthRowGroup", "seventhRowGroup", "eighthRowGroup", "ninthRowGroup", "tenthRowGroup"];
|
|
42
|
+
export declare const HIGHEST_PRIORITY: number;
|
|
43
|
+
export declare enum INPUT_TYPE {
|
|
44
|
+
INPUT = "INPUT"
|
|
45
|
+
}
|
|
39
46
|
export declare const InjectionIhoTableConfig: InjectionKey<Ref<Nullable<IhoTableConfig>>>;
|
|
40
47
|
export declare const InjectionIhoTableEmits: InjectionKey<(event: string, ...args: unknown[]) => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { InjectionIhoTableConfig, InjectionIhoTableEmits, WIDGET_TYPE } from './index2.js';
|
|
1
|
+
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, VxeEventListenerNameList, WIDGET_TYPE } from './index2.js';
|
|
@@ -34,7 +34,85 @@ var WIDGET_TYPE = /* @__PURE__ */ ((WIDGET_TYPE2) => {
|
|
|
34
34
|
WIDGET_TYPE2["SEQUENCE"] = "SEQUENCE";
|
|
35
35
|
return WIDGET_TYPE2;
|
|
36
36
|
})(WIDGET_TYPE || {});
|
|
37
|
+
const VxeEventListenerNameList = Object.freeze([
|
|
38
|
+
"onKeydownStart",
|
|
39
|
+
"onKeydown",
|
|
40
|
+
"onKeydownEnd",
|
|
41
|
+
"onPaste",
|
|
42
|
+
"onCopy",
|
|
43
|
+
"onCut",
|
|
44
|
+
"onCurrentChange",
|
|
45
|
+
"onRadioChange",
|
|
46
|
+
"onCheckboxChange",
|
|
47
|
+
"onCheckboxAll",
|
|
48
|
+
"onCheckboxRangeStart",
|
|
49
|
+
"onCheckboxRangeChange",
|
|
50
|
+
"onCheckboxRangeEnd",
|
|
51
|
+
"onCellClick",
|
|
52
|
+
"onCellDblclick",
|
|
53
|
+
"onCellMenu",
|
|
54
|
+
"onCellMouseenter",
|
|
55
|
+
"onCellMouseleave",
|
|
56
|
+
"onHeaderCellClick",
|
|
57
|
+
"onHeaderCellDblclick",
|
|
58
|
+
"onHeaderCellMenu",
|
|
59
|
+
"onFooterCellClick",
|
|
60
|
+
"onFooterCellDblclick",
|
|
61
|
+
"onFooterCellMenu",
|
|
62
|
+
"onSortChange",
|
|
63
|
+
"onFilterChange",
|
|
64
|
+
"onFilterVisible",
|
|
65
|
+
"onResizableChange",
|
|
66
|
+
"onToggleRowExpand",
|
|
67
|
+
"onToggleTreeExpand",
|
|
68
|
+
"onMenuClick",
|
|
69
|
+
"onEditClosed",
|
|
70
|
+
"onEditActived",
|
|
71
|
+
"onEditDisabled",
|
|
72
|
+
"onValidError",
|
|
73
|
+
"onScroll",
|
|
74
|
+
"onCustom",
|
|
75
|
+
"onOpenFnr",
|
|
76
|
+
"onFnrChange",
|
|
77
|
+
"onFnrFind",
|
|
78
|
+
"onFnrFindAll",
|
|
79
|
+
"onFnrReplace",
|
|
80
|
+
"onFnrReplaceAll",
|
|
81
|
+
"onCellAreaCopy",
|
|
82
|
+
"onCellAreaCut",
|
|
83
|
+
"onCellAreaPaste",
|
|
84
|
+
"onCellAreaMerge",
|
|
85
|
+
"onClearCellAreaMerge",
|
|
86
|
+
"onHeaderCellAreaSelection",
|
|
87
|
+
"onCellAreaSelectionStart",
|
|
88
|
+
"onCellAreaSelectionDrag",
|
|
89
|
+
"onCellAreaSelectionEnd",
|
|
90
|
+
"onCellAreaExtensionStart",
|
|
91
|
+
"onCellAreaExtensionDrag",
|
|
92
|
+
"onCellAreaExtensionEnd",
|
|
93
|
+
"onCellAreaArrowsStart",
|
|
94
|
+
"onCellAreaArrowsEnd",
|
|
95
|
+
"onActiveCellChangeStart",
|
|
96
|
+
"onActiveCellChangeEnd"
|
|
97
|
+
]);
|
|
98
|
+
const IhoTableRowGroupSequence = [
|
|
99
|
+
"firstRowGroup",
|
|
100
|
+
"secondRowGroup",
|
|
101
|
+
"thirdRowGroup",
|
|
102
|
+
"fourthRowGroup",
|
|
103
|
+
"fifthRowGroup",
|
|
104
|
+
"sixthRowGroup",
|
|
105
|
+
"seventhRowGroup",
|
|
106
|
+
"eighthRowGroup",
|
|
107
|
+
"ninthRowGroup",
|
|
108
|
+
"tenthRowGroup"
|
|
109
|
+
];
|
|
110
|
+
const HIGHEST_PRIORITY = -Infinity;
|
|
111
|
+
var INPUT_TYPE = /* @__PURE__ */ ((INPUT_TYPE2) => {
|
|
112
|
+
INPUT_TYPE2["INPUT"] = "INPUT";
|
|
113
|
+
return INPUT_TYPE2;
|
|
114
|
+
})(INPUT_TYPE || {});
|
|
37
115
|
const InjectionIhoTableConfig = Symbol("injectionIhoTableConfig ");
|
|
38
116
|
const InjectionIhoTableEmits = Symbol("InjectionIhoTableEmits ");
|
|
39
117
|
|
|
40
|
-
export { InjectionIhoTableConfig, InjectionIhoTableEmits, WIDGET_TYPE };
|
|
118
|
+
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, VxeEventListenerNameList, WIDGET_TYPE };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableHooks } from './tapHooks/index2.js';
|
|
1
|
+
export { applyTableConfigHooks, applyTableFieldHooks, createDataTransfer, createTableEventHandlers, createTableHooks } from './tapHooks/index2.js';
|
|
2
2
|
export { defineTablePlugin, useTablePlugin } from './useTablePlugin2.js';
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import { AnyObject, Func, Nullable } from '../../../../../../es/shared/types';
|
|
2
|
+
import { MaybeRef } from '@vueuse/core';
|
|
3
|
+
import { VxeTableInstance } from 'vxe-table';
|
|
4
|
+
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
1
5
|
import { IhoTableConfig, IhoTableFieldItem, TableHooks } from '../../../../../../es/components/iho-table/src/types';
|
|
2
6
|
export declare const createTableHooks: () => Readonly<{
|
|
3
7
|
configHooks: import("../../../../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
4
8
|
fieldHooks: import("../../../../../../es/components/iho-table/src/types").AbstractFieldHooks;
|
|
5
9
|
eventHooks: import("../../../../../../es/components/iho-table/src/types").AbstractEventHooks;
|
|
10
|
+
dataHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDataHooks;
|
|
6
11
|
}>;
|
|
7
12
|
export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig): IhoTableConfig;
|
|
8
13
|
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig): IhoTableFieldItem[];
|
|
14
|
+
export declare function createTableEventHandlers(hooks: TableHooks, config: MaybeRef<IhoTableConfig>, $table: MaybeRef<Nullable<VxeTableInstance>>, emits: Func): Record<keyof VxeTableEventProps, any>;
|
|
15
|
+
export declare function createDataTransfer(hooks: TableHooks, config: MaybeRef<IhoTableConfig>): (data: AnyObject[]) => AnyObject[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableHooks } from './index2.js';
|
|
1
|
+
export { applyTableConfigHooks, applyTableFieldHooks, createDataTransfer, createTableEventHandlers, createTableHooks } from './index2.js';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { arrayed } from '../../../../../shared/utils/index2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { unref } from 'vue';
|
|
3
|
+
import { cloneDeep, isArray } from 'lodash-es';
|
|
4
|
+
import { VxeEventListenerNameList } from '../../constants/index2.js';
|
|
5
|
+
import { useDataHooks } from './useDataHooks2.js';
|
|
3
6
|
import { useEventHooks } from './useEventHooks2.js';
|
|
7
|
+
import { getEventName } from '../../utils/index2.js';
|
|
4
8
|
import { useConfigHooks } from './useConfigHooks2.js';
|
|
5
9
|
import { useFieldHooks } from './useFieldHooks2.js';
|
|
6
10
|
|
|
@@ -10,7 +14,8 @@ const createTableHooks = (() => {
|
|
|
10
14
|
return Object.freeze({
|
|
11
15
|
configHooks: useConfigHooks().create(),
|
|
12
16
|
fieldHooks: useFieldHooks().create(),
|
|
13
|
-
eventHooks: useEventHooks().create()
|
|
17
|
+
eventHooks: useEventHooks().create(),
|
|
18
|
+
dataHooks: useDataHooks().create()
|
|
14
19
|
});
|
|
15
20
|
}
|
|
16
21
|
return () => {
|
|
@@ -19,32 +24,98 @@ const createTableHooks = (() => {
|
|
|
19
24
|
})();
|
|
20
25
|
function applyTableConfigHooks(hooks, config) {
|
|
21
26
|
const result = hooks.configHooks.config.call(cloneDeep(config));
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
const propertyHooks = [
|
|
28
|
+
"rowConfig",
|
|
29
|
+
"editConfig",
|
|
30
|
+
"columnConfig",
|
|
31
|
+
"resizableConfig",
|
|
32
|
+
"seqConfig",
|
|
33
|
+
"sortConfig",
|
|
34
|
+
"filterConfig",
|
|
35
|
+
"radioConfig",
|
|
36
|
+
"checkboxConfig",
|
|
37
|
+
"expandConfig",
|
|
38
|
+
"treeConfig",
|
|
39
|
+
"mouseConfig",
|
|
40
|
+
"menuConfig",
|
|
41
|
+
"keyboardConfig",
|
|
42
|
+
"scrollY",
|
|
43
|
+
"scrollX",
|
|
44
|
+
"editRules"
|
|
45
|
+
];
|
|
46
|
+
propertyHooks.forEach((hookName) => {
|
|
47
|
+
result[hookName] = hooks.configHooks[hookName].call(result[hookName], result);
|
|
48
|
+
});
|
|
24
49
|
return result;
|
|
25
50
|
}
|
|
26
51
|
function applyTableFieldHooks(hooks, fieldList, config) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
hooks.fieldHooks.fieldStart.promise(config);
|
|
53
|
+
let result = traverseFieldList(cloneDeep(fieldList));
|
|
54
|
+
result = hooks.fieldHooks.fieldList.call(result, config);
|
|
55
|
+
hooks.fieldHooks.fieldEnd.promise(config);
|
|
56
|
+
return result;
|
|
57
|
+
function traverseFieldList(fieldList2) {
|
|
58
|
+
return fieldList2.reduce((finFieldList, field, index) => {
|
|
59
|
+
let before;
|
|
60
|
+
let after;
|
|
61
|
+
let removed = false;
|
|
62
|
+
field = hooks.fieldHooks.field.call(field, {
|
|
63
|
+
index,
|
|
64
|
+
remove() {
|
|
65
|
+
removed = true;
|
|
66
|
+
},
|
|
67
|
+
insertAfter(field2) {
|
|
68
|
+
after = arrayed(field2);
|
|
69
|
+
},
|
|
70
|
+
insertBefore(field2) {
|
|
71
|
+
before = arrayed(field2);
|
|
72
|
+
}
|
|
73
|
+
}, config);
|
|
74
|
+
before && finFieldList.push(...before);
|
|
75
|
+
if (!removed) {
|
|
76
|
+
finFieldList.push(field);
|
|
77
|
+
if (isArray(field.children)) {
|
|
78
|
+
field.children = traverseFieldList(field.children);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
after && finFieldList.push(...after);
|
|
82
|
+
return finFieldList;
|
|
83
|
+
}, []);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function createTableEventHandlers(hooks, config, $table, emits) {
|
|
87
|
+
const handler = (eventListenerName, payload) => {
|
|
88
|
+
var _a;
|
|
89
|
+
if (VxeEventListenerNameList.includes(eventListenerName))
|
|
90
|
+
emits(getEventName(eventListenerName), payload);
|
|
91
|
+
(_a = hooks.eventHooks[eventListenerName]) == null ? void 0 : _a.promise(payload, unref(config), unref($table));
|
|
92
|
+
};
|
|
93
|
+
return VxeEventListenerNameList.reduce((result, eventName) => {
|
|
94
|
+
result[eventName] = (payload) => handler(eventName, payload);
|
|
95
|
+
return result;
|
|
96
|
+
}, {});
|
|
97
|
+
}
|
|
98
|
+
function createDataTransfer(hooks, config) {
|
|
99
|
+
return (data) => data.reduce((res, rowData) => {
|
|
100
|
+
let before;
|
|
101
|
+
let after;
|
|
30
102
|
let removed = false;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
removed = true;
|
|
103
|
+
hooks.dataHooks.data.call(rowData, {
|
|
104
|
+
insertBefore(data2) {
|
|
105
|
+
before = arrayed(data2);
|
|
35
106
|
},
|
|
36
|
-
insertAfter(
|
|
37
|
-
after
|
|
107
|
+
insertAfter(data2) {
|
|
108
|
+
after = arrayed(data2);
|
|
38
109
|
},
|
|
39
|
-
|
|
40
|
-
|
|
110
|
+
remove() {
|
|
111
|
+
removed = true;
|
|
41
112
|
}
|
|
42
|
-
}, config);
|
|
43
|
-
|
|
44
|
-
!removed &&
|
|
45
|
-
|
|
46
|
-
return
|
|
113
|
+
}, unref(config));
|
|
114
|
+
before && res.push(...before);
|
|
115
|
+
!removed && res.push(rowData);
|
|
116
|
+
after && res.push(...after);
|
|
117
|
+
return res;
|
|
47
118
|
}, []);
|
|
48
119
|
}
|
|
49
120
|
|
|
50
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableHooks };
|
|
121
|
+
export { applyTableConfigHooks, applyTableFieldHooks, createDataTransfer, createTableEventHandlers, createTableHooks };
|
|
@@ -6,6 +6,20 @@ declare class ConfigHooks extends AbstractConfigHooks {
|
|
|
6
6
|
readonly rowConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.RowConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
7
7
|
readonly editConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.EditConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
8
8
|
readonly columnConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.ColumnConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
9
|
+
readonly resizableConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.ResizableConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
10
|
+
readonly seqConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.SeqConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
11
|
+
readonly sortConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.SortConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
12
|
+
readonly filterConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.FilterConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
13
|
+
readonly radioConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.RadioConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
14
|
+
readonly checkboxConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.CheckboxConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
15
|
+
readonly expandConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.ExpandConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
16
|
+
readonly treeConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.TreeConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
17
|
+
readonly mouseConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.MouseConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
18
|
+
readonly menuConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.MenuConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
19
|
+
readonly keyboardConfig: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.KeyboardConfig, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
20
|
+
readonly scrollY: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.ScrollY, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
21
|
+
readonly scrollX: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.ScrollX, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
22
|
+
readonly editRules: SyncWaterfallHook<[undefined, IhoTableConfig] | [import("vxe-table").VxeTablePropTypes.EditRules, IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
9
23
|
}
|
|
10
24
|
export declare function useConfigHooks(): {
|
|
11
25
|
create: () => ConfigHooks;
|
|
@@ -16,7 +16,45 @@ class ConfigHooks extends AbstractConfigHooks {
|
|
|
16
16
|
this.config = new SyncWaterfallHook(["config"]);
|
|
17
17
|
this.rowConfig = new SyncWaterfallHook(["rowConfig", "config"]);
|
|
18
18
|
this.editConfig = new SyncWaterfallHook(["editConfig", "config"]);
|
|
19
|
-
this.columnConfig = new SyncWaterfallHook([
|
|
19
|
+
this.columnConfig = new SyncWaterfallHook([
|
|
20
|
+
"columnConfig",
|
|
21
|
+
"config"
|
|
22
|
+
]);
|
|
23
|
+
this.resizableConfig = new SyncWaterfallHook([
|
|
24
|
+
"resizableConfig",
|
|
25
|
+
"config"
|
|
26
|
+
]);
|
|
27
|
+
this.seqConfig = new SyncWaterfallHook(["seqConfig", "config"]);
|
|
28
|
+
this.sortConfig = new SyncWaterfallHook(["sortConfig", "config"]);
|
|
29
|
+
this.filterConfig = new SyncWaterfallHook([
|
|
30
|
+
"filterConfig",
|
|
31
|
+
"config"
|
|
32
|
+
]);
|
|
33
|
+
this.radioConfig = new SyncWaterfallHook([
|
|
34
|
+
"radioConfig",
|
|
35
|
+
"config"
|
|
36
|
+
]);
|
|
37
|
+
this.checkboxConfig = new SyncWaterfallHook([
|
|
38
|
+
"checkboxConfig",
|
|
39
|
+
"config"
|
|
40
|
+
]);
|
|
41
|
+
this.expandConfig = new SyncWaterfallHook([
|
|
42
|
+
"expandConfig",
|
|
43
|
+
"config"
|
|
44
|
+
]);
|
|
45
|
+
this.treeConfig = new SyncWaterfallHook(["treeConfig", "config"]);
|
|
46
|
+
this.mouseConfig = new SyncWaterfallHook([
|
|
47
|
+
"mouseConfig",
|
|
48
|
+
"config"
|
|
49
|
+
]);
|
|
50
|
+
this.menuConfig = new SyncWaterfallHook(["menuConfig", "config"]);
|
|
51
|
+
this.keyboardConfig = new SyncWaterfallHook([
|
|
52
|
+
"keyboardConfig",
|
|
53
|
+
"config"
|
|
54
|
+
]);
|
|
55
|
+
this.scrollY = new SyncWaterfallHook(["scrollY", "config"]);
|
|
56
|
+
this.scrollX = new SyncWaterfallHook(["scrollX", "config"]);
|
|
57
|
+
this.editRules = new SyncWaterfallHook(["editRules", "config"]);
|
|
20
58
|
}
|
|
21
59
|
}
|
|
22
60
|
function useConfigHooks() {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
|
+
import { SyncHook } from '../../../../../../es/shared/utils/tapable';
|
|
3
|
+
import { AbstractDataHooks } from '../../../../../../es/components/iho-table/src/types';
|
|
4
|
+
declare class TableDataHooks extends AbstractDataHooks {
|
|
5
|
+
readonly data: SyncHook<[AnyObject, {
|
|
6
|
+
remove(): void;
|
|
7
|
+
insertBefore(data: import("../../../../../../es/shared/types").ArrayAble<AnyObject>): void;
|
|
8
|
+
insertAfter(data: import("../../../../../../es/shared/types").ArrayAble<AnyObject>): void;
|
|
9
|
+
}, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], void, import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useDataHooks(): {
|
|
12
|
+
create: () => TableDataHooks;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useDataHooks } from './useDataHooks2.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import SyncHook from '../../../../../shared/utils/tapable/SyncHook.js';
|
|
2
|
+
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
3
|
+
import '../../../../../shared/utils/tapable/SyncWaterfallHook.js';
|
|
4
|
+
import '../../../../../shared/utils/tapable/SyncLoopHook.js';
|
|
5
|
+
import '../../../../../shared/utils/tapable/AsyncParallelHook.js';
|
|
6
|
+
import '../../../../../shared/utils/tapable/AsyncParallelBailHook.js';
|
|
7
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
8
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
9
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
10
|
+
import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
11
|
+
import { AbstractDataHooks } from '../../types/pluginType2.js';
|
|
12
|
+
|
|
13
|
+
class TableDataHooks extends AbstractDataHooks {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.data = new SyncHook(["rowData", "context", "config"]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function useDataHooks() {
|
|
20
|
+
function create() {
|
|
21
|
+
return new TableDataHooks();
|
|
22
|
+
}
|
|
23
|
+
return { create };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useDataHooks };
|