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.
- package/es/components/big-table/index.d.ts +8 -0
- package/es/components/big-table/src/BigTable.vue.d.ts +8 -0
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -23
- 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/edit-separate.js +4 -1
- package/es/components/big-table/src/hooks/useEdit.d.ts +1 -1
- package/es/components/big-table/src/hooks/useEdit2.js +6 -3
- package/es/components/big-table/src/hooks/useSeparateRow2.js +1 -41
- package/es/components/big-table/src/utils2.js +0 -1
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/field-set/src/FieldSet.js +5 -1
- package/es/components/form-render/src/hooks/useFormContext2.js +2 -1
- package/es/components/form-render/src/utils/index.d.ts +0 -1
- package/es/components/form-render/src/utils/index.js +1 -10
- package/es/components/iho-table/index.d.ts +142 -276
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.js +52 -31
- package/es/components/iho-table/src/IhoTable.vue.d.ts +143 -277
- package/es/components/iho-table/src/components/IhoTableColumn.js +2 -2
- package/es/components/iho-table/src/constants/index.d.ts +5 -2
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +8 -5
- package/es/components/iho-table/src/hooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +12 -3
- package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/index2.js +41 -6
- package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +16 -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 +177 -60
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks2.js +223 -59
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +10 -0
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -0
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks2.js +27 -0
- package/es/components/iho-table/src/plugins/index.js +2 -1
- package/es/components/iho-table/src/plugins/index2.js +2 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.d.ts +0 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/{inputs → editableWidgets}/inputRendererPlugins.js +0 -5
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.js +110 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/edit-separate.vue.d.ts +107 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +158 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.d.ts +14 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separate-utils2.js +54 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/index.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/index.js +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +2 -1
- package/es/components/iho-table/src/types/index.d.ts +8 -3
- package/es/components/iho-table/src/types/index.js +1 -1
- package/es/components/iho-table/src/types/pluginType.d.ts +105 -81
- package/es/components/iho-table/src/types/pluginType.js +1 -1
- package/es/components/iho-table/src/types/pluginType2.js +5 -1
- package/es/components/iho-table/src/utils/index2.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +2 -0
- package/es/components/info-header/src/InfoHeader.js +3 -1
- package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -0
- package/es/components/info-header/style/iconfont.ttf +0 -0
- package/es/components/info-header/style/index.css +1 -1
- package/es/shared/utils/index.d.ts +4 -0
- package/es/shared/utils/index.js +1 -1
- package/es/shared/utils/index2.js +60 -2
- package/es/shared/utils/tapable/AsyncSeriesHook.js +17 -2
- package/es/shared/utils/tapable/SyncHook.js +23 -2
- package/package.json +2 -2
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/inputs/index.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, createVNode } from 'vue';
|
|
2
|
-
import { omit } from 'lodash-es';
|
|
2
|
+
import { isEmpty, omit } from 'lodash-es';
|
|
3
3
|
|
|
4
4
|
const ColumnComponent = defineComponent({
|
|
5
5
|
name: "IhoTableColumn",
|
|
@@ -23,7 +23,7 @@ const ColumnComponent = defineComponent({
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
return () => {
|
|
26
|
-
return
|
|
26
|
+
return !isEmpty(children()) ? renderColumnGroup(field(), children()) : renderColumn(field());
|
|
27
27
|
function field() {
|
|
28
28
|
return props.field;
|
|
29
29
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../es/shared/types';
|
|
2
2
|
import { InjectionKey, Ref } from 'vue';
|
|
3
3
|
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
4
|
-
import { IhoTableConfig, UnionToTuple } from '../../../../../es/components/iho-table';
|
|
4
|
+
import { IhoTableConfig, IhoTableHandler, UnionToTuple } from '../../../../../es/components/iho-table';
|
|
5
5
|
export declare enum WIDGET_TYPE {
|
|
6
6
|
DEFAULT = "DEFAULT",
|
|
7
7
|
PICTURE = "PICTURE",
|
|
@@ -41,7 +41,10 @@ export declare const VxeEventListenerNameList: Readonly<UnionToTuple<keyof VxeTa
|
|
|
41
41
|
export declare const IhoTableRowGroupSequence: readonly ["firstRowGroup", "secondRowGroup", "thirdRowGroup", "fourthRowGroup", "fifthRowGroup", "sixthRowGroup", "seventhRowGroup", "eighthRowGroup", "ninthRowGroup", "tenthRowGroup"];
|
|
42
42
|
export declare const HIGHEST_PRIORITY: number;
|
|
43
43
|
export declare enum INPUT_TYPE {
|
|
44
|
-
INPUT = "INPUT"
|
|
44
|
+
INPUT = "INPUT",
|
|
45
|
+
SEPARATE = "SEPARATE"
|
|
45
46
|
}
|
|
46
47
|
export declare const InjectionIhoTableConfig: InjectionKey<Ref<Nullable<IhoTableConfig>>>;
|
|
47
48
|
export declare const InjectionIhoTableEmits: InjectionKey<(event: string, ...args: unknown[]) => void>;
|
|
49
|
+
export declare const InjectionIhoTableUUID: InjectionKey<Ref<string>>;
|
|
50
|
+
export declare const InjectionIhoTableHandler: InjectionKey<IhoTableHandler>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, VxeEventListenerNameList, WIDGET_TYPE } from './index2.js';
|
|
1
|
+
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, InjectionIhoTableHandler, InjectionIhoTableUUID, VxeEventListenerNameList, WIDGET_TYPE } from './index2.js';
|
|
@@ -95,7 +95,7 @@ const VxeEventListenerNameList = Object.freeze([
|
|
|
95
95
|
"onActiveCellChangeStart",
|
|
96
96
|
"onActiveCellChangeEnd"
|
|
97
97
|
]);
|
|
98
|
-
const IhoTableRowGroupSequence = [
|
|
98
|
+
const IhoTableRowGroupSequence = Object.freeze([
|
|
99
99
|
"firstRowGroup",
|
|
100
100
|
"secondRowGroup",
|
|
101
101
|
"thirdRowGroup",
|
|
@@ -106,13 +106,16 @@ const IhoTableRowGroupSequence = [
|
|
|
106
106
|
"eighthRowGroup",
|
|
107
107
|
"ninthRowGroup",
|
|
108
108
|
"tenthRowGroup"
|
|
109
|
-
];
|
|
109
|
+
]);
|
|
110
110
|
const HIGHEST_PRIORITY = -Infinity;
|
|
111
111
|
var INPUT_TYPE = /* @__PURE__ */ ((INPUT_TYPE2) => {
|
|
112
112
|
INPUT_TYPE2["INPUT"] = "INPUT";
|
|
113
|
+
INPUT_TYPE2["SEPARATE"] = "SEPARATE";
|
|
113
114
|
return INPUT_TYPE2;
|
|
114
115
|
})(INPUT_TYPE || {});
|
|
115
|
-
const InjectionIhoTableConfig = Symbol("injectionIhoTableConfig
|
|
116
|
-
const InjectionIhoTableEmits = Symbol("InjectionIhoTableEmits
|
|
116
|
+
const InjectionIhoTableConfig = Symbol("injectionIhoTableConfig");
|
|
117
|
+
const InjectionIhoTableEmits = Symbol("InjectionIhoTableEmits");
|
|
118
|
+
const InjectionIhoTableUUID = Symbol("InjectionIhoTableUUID");
|
|
119
|
+
const InjectionIhoTableHandler = Symbol("InjectionIhoTableHandler");
|
|
117
120
|
|
|
118
|
-
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, VxeEventListenerNameList, WIDGET_TYPE };
|
|
121
|
+
export { HIGHEST_PRIORITY, INPUT_TYPE, IhoTableRowGroupSequence, InjectionIhoTableConfig, InjectionIhoTableEmits, InjectionIhoTableHandler, InjectionIhoTableUUID, VxeEventListenerNameList, WIDGET_TYPE };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableEventHandlers, 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,13 +1,22 @@
|
|
|
1
|
-
import { Func, Nullable } from '../../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, Func, Nullable } from '../../../../../../es/shared/types';
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
3
|
import { VxeTableInstance } from 'vxe-table';
|
|
4
4
|
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
5
|
-
import { IhoTableConfig, IhoTableFieldItem, TableHooks } from '../../../../../../es/components/iho-table/src/types';
|
|
5
|
+
import { IhoTableConfig, IhoTableEventContext, IhoTableFieldItem, TableHooks } from '../../../../../../es/components/iho-table/src/types';
|
|
6
6
|
export declare const createTableHooks: () => Readonly<{
|
|
7
7
|
configHooks: import("../../../../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
8
8
|
fieldHooks: import("../../../../../../es/components/iho-table/src/types").AbstractFieldHooks;
|
|
9
9
|
eventHooks: import("../../../../../../es/components/iho-table/src/types").AbstractEventHooks;
|
|
10
|
+
dataHooks: import("../../../../../../es/components/iho-table/src/types").AbstractDataHooks;
|
|
11
|
+
setupHooks: import("../../../../../../es/components/iho-table/src/types").AbstractSetupHooks;
|
|
10
12
|
}>;
|
|
11
13
|
export declare function applyTableConfigHooks(hooks: TableHooks, config: IhoTableConfig): IhoTableConfig;
|
|
12
14
|
export declare function applyTableFieldHooks(hooks: TableHooks, fieldList: IhoTableFieldItem[], config: IhoTableConfig): IhoTableFieldItem[];
|
|
13
|
-
export declare function createTableEventHandlers(hooks
|
|
15
|
+
export declare function createTableEventHandlers({ hooks, config, $table, emits, context }: {
|
|
16
|
+
hooks: TableHooks;
|
|
17
|
+
config: MaybeRef<IhoTableConfig>;
|
|
18
|
+
$table: MaybeRef<Nullable<VxeTableInstance>>;
|
|
19
|
+
emits: Func;
|
|
20
|
+
context: IhoTableEventContext;
|
|
21
|
+
}): Record<keyof VxeTableEventProps, any>;
|
|
22
|
+
export declare function createDataTransfer(hooks: TableHooks, config: MaybeRef<IhoTableConfig>, $table: MaybeRef<Nullable<VxeTableInstance>>): (data: AnyObject[]) => Promise<AnyObject[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableEventHandlers, createTableHooks } from './index2.js';
|
|
1
|
+
export { applyTableConfigHooks, applyTableFieldHooks, createDataTransfer, createTableEventHandlers, createTableHooks } from './index2.js';
|
|
@@ -2,7 +2,9 @@ import { arrayed } from '../../../../../shared/utils/index2.js';
|
|
|
2
2
|
import { unref } from 'vue';
|
|
3
3
|
import { cloneDeep, isArray } from 'lodash-es';
|
|
4
4
|
import { VxeEventListenerNameList } from '../../constants/index2.js';
|
|
5
|
+
import { useDataHooks } from './useDataHooks2.js';
|
|
5
6
|
import { useEventHooks } from './useEventHooks2.js';
|
|
7
|
+
import { useSetupHooks } from './useSetupHooks2.js';
|
|
6
8
|
import { getEventName } from '../../utils/index2.js';
|
|
7
9
|
import { useConfigHooks } from './useConfigHooks2.js';
|
|
8
10
|
import { useFieldHooks } from './useFieldHooks2.js';
|
|
@@ -13,7 +15,9 @@ const createTableHooks = (() => {
|
|
|
13
15
|
return Object.freeze({
|
|
14
16
|
configHooks: useConfigHooks().create(),
|
|
15
17
|
fieldHooks: useFieldHooks().create(),
|
|
16
|
-
eventHooks: useEventHooks().create()
|
|
18
|
+
eventHooks: useEventHooks().create(),
|
|
19
|
+
dataHooks: useDataHooks().create(),
|
|
20
|
+
setupHooks: useSetupHooks().create()
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
23
|
return () => {
|
|
@@ -69,29 +73,60 @@ function applyTableFieldHooks(hooks, fieldList, config) {
|
|
|
69
73
|
before.push(...arrayed(field2));
|
|
70
74
|
}
|
|
71
75
|
}, config);
|
|
72
|
-
finFieldList
|
|
76
|
+
finFieldList.push(...before);
|
|
73
77
|
if (!removed) {
|
|
74
78
|
finFieldList.push(field);
|
|
75
79
|
if (isArray(field.children)) {
|
|
76
80
|
field.children = traverseFieldList(field.children);
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
|
-
finFieldList
|
|
83
|
+
finFieldList.push(...after);
|
|
80
84
|
return finFieldList;
|
|
81
85
|
}, []);
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
|
-
function createTableEventHandlers(
|
|
88
|
+
function createTableEventHandlers({
|
|
89
|
+
hooks,
|
|
90
|
+
config,
|
|
91
|
+
$table,
|
|
92
|
+
emits,
|
|
93
|
+
context
|
|
94
|
+
}) {
|
|
85
95
|
const handler = (eventListenerName, payload) => {
|
|
86
96
|
var _a;
|
|
87
97
|
if (VxeEventListenerNameList.includes(eventListenerName))
|
|
88
98
|
emits(getEventName(eventListenerName), payload);
|
|
89
|
-
(_a = hooks.eventHooks[eventListenerName]) == null ? void 0 : _a.promise(payload, unref(
|
|
99
|
+
(_a = hooks.eventHooks[eventListenerName]) == null ? void 0 : _a.promise(payload, { $table: unref($table), ...context }, unref(config));
|
|
90
100
|
};
|
|
91
101
|
return VxeEventListenerNameList.reduce((result, eventName) => {
|
|
92
102
|
result[eventName] = (payload) => handler(eventName, payload);
|
|
93
103
|
return result;
|
|
94
104
|
}, {});
|
|
95
105
|
}
|
|
106
|
+
function createDataTransfer(hooks, config, $table) {
|
|
107
|
+
return async (data) => await data.reduce(async (res, rowData, index) => {
|
|
108
|
+
const before = [];
|
|
109
|
+
const after = [];
|
|
110
|
+
let removed = false;
|
|
111
|
+
await hooks.dataHooks.data.promise(rowData, {
|
|
112
|
+
index,
|
|
113
|
+
$table,
|
|
114
|
+
insertBefore(data2) {
|
|
115
|
+
before.push(...arrayed(data2));
|
|
116
|
+
},
|
|
117
|
+
insertAfter(data2) {
|
|
118
|
+
after.push(...arrayed(data2));
|
|
119
|
+
},
|
|
120
|
+
remove() {
|
|
121
|
+
removed = true;
|
|
122
|
+
}
|
|
123
|
+
}, unref(config));
|
|
124
|
+
const nextRes = await res;
|
|
125
|
+
nextRes.push(...before);
|
|
126
|
+
!removed && nextRes.push(rowData);
|
|
127
|
+
nextRes.push(...after);
|
|
128
|
+
return nextRes;
|
|
129
|
+
}, Promise.resolve([]));
|
|
130
|
+
}
|
|
96
131
|
|
|
97
|
-
export { applyTableConfigHooks, applyTableFieldHooks, createTableEventHandlers, createTableHooks };
|
|
132
|
+
export { applyTableConfigHooks, applyTableFieldHooks, createDataTransfer, createTableEventHandlers, createTableHooks };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AnyObject } from '../../../../../../es/shared/types';
|
|
2
|
+
import { AsyncSeriesHook } from '../../../../../../es/shared/utils/tapable';
|
|
3
|
+
import { AbstractDataHooks } from '../../../../../../es/components/iho-table/src/types';
|
|
4
|
+
declare class TableDataHooks extends AbstractDataHooks {
|
|
5
|
+
readonly data: AsyncSeriesHook<[AnyObject, {
|
|
6
|
+
remove(): void;
|
|
7
|
+
$table: import("@vueuse/shared").MaybeRef<import("../../../../../../es/shared/types").Nullable<import("vxe-table").VxeTableInstance>>;
|
|
8
|
+
index: number;
|
|
9
|
+
insertBefore(data: import("../../../../../../es/shared/types").ArrayAble<AnyObject>): void;
|
|
10
|
+
insertAfter(data: import("../../../../../../es/shared/types").ArrayAble<AnyObject>): void;
|
|
11
|
+
}, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
12
|
+
}
|
|
13
|
+
export declare function useDataHooks(): {
|
|
14
|
+
create: () => TableDataHooks;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useDataHooks } from './useDataHooks2.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import '../../../../../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 AsyncSeriesHook from '../../../../../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 AsyncSeriesHook(["rowData", "context", "config"]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function useDataHooks() {
|
|
20
|
+
function create() {
|
|
21
|
+
return new TableDataHooks();
|
|
22
|
+
}
|
|
23
|
+
return { create };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useDataHooks };
|