cnhis-design-vue 3.1.36 → 3.1.37-beta.1
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/src/BigTable.vue.d.ts +9 -3
- package/es/components/big-table/src/BigTable.vue2.js +5 -8
- package/es/components/big-table/src/components/edit-form/edit-time.js +6 -1
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +22 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +22 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +11 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +11 -0
- package/es/components/form-render/index.d.ts +11 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +12 -1
- package/es/components/form-render/src/FormRender.vue.js +11 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +11 -0
- package/es/components/form-render/src/components/renderer/formItem.js +16 -13
- package/es/components/form-render/src/constants/index.d.ts +12 -0
- package/es/components/form-render/src/constants/index.js +14 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +0 -4
- package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +7 -0
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +84 -0
- package/es/components/form-render/src/types/index.d.ts +17 -0
- package/es/components/iho-table/index.d.ts +9 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +9 -0
- package/es/components/iho-table/src/IhoTable.vue.js +9 -4
- package/es/components/iho-table/src/constants/index.js +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.js +15 -21
- package/es/components/iho-table/src/types/index.d.ts +2 -2
- package/es/components/iho-table/src/utils/index.d.ts +3 -2
- package/es/components/iho-table/src/utils/index.js +5 -2
- package/es/components/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +11 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +11 -0
- package/package.json +2 -2
- package/es/shared/utils/clickoutside.d.ts +0 -18
- package/es/shared/utils/clickoutside.js +0 -52
- package/es/shared/utils/state.d.ts +0 -29
- package/es/shared/utils/state.js +0 -44
|
@@ -41,6 +41,19 @@ var FIELD_AGE_UNIT = /* @__PURE__ */ ((FIELD_AGE_UNIT2) => {
|
|
|
41
41
|
FIELD_AGE_UNIT2["MINUTE"] = "N";
|
|
42
42
|
return FIELD_AGE_UNIT2;
|
|
43
43
|
})(FIELD_AGE_UNIT || {});
|
|
44
|
+
var LOW_CODE_VALUE_RELATION = /* @__PURE__ */ ((LOW_CODE_VALUE_RELATION2) => {
|
|
45
|
+
LOW_CODE_VALUE_RELATION2["EQ"] = "EQ";
|
|
46
|
+
LOW_CODE_VALUE_RELATION2["NEQ"] = "NEQ";
|
|
47
|
+
LOW_CODE_VALUE_RELATION2["CL"] = "CL";
|
|
48
|
+
LOW_CODE_VALUE_RELATION2["NC"] = "NC";
|
|
49
|
+
LOW_CODE_VALUE_RELATION2["NULL"] = "NULL";
|
|
50
|
+
LOW_CODE_VALUE_RELATION2["NOT_NULL"] = "NOT_NULL";
|
|
51
|
+
LOW_CODE_VALUE_RELATION2["BIG"] = "BIG";
|
|
52
|
+
LOW_CODE_VALUE_RELATION2["BIGEQ"] = "BIGEQ";
|
|
53
|
+
LOW_CODE_VALUE_RELATION2["LESS"] = "LESS";
|
|
54
|
+
LOW_CODE_VALUE_RELATION2["LESSEQ"] = "LESSEQ";
|
|
55
|
+
return LOW_CODE_VALUE_RELATION2;
|
|
56
|
+
})(LOW_CODE_VALUE_RELATION || {});
|
|
44
57
|
const NESTED_FORM_ITEM_TYPE = ["COMPLEX", "COMBINATION"];
|
|
45
58
|
|
|
46
|
-
export { FIELD_AGE_UNIT, FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectionAnnotation, InjectionAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField, NESTED_FORM_ITEM_TYPE };
|
|
59
|
+
export { FIELD_AGE_UNIT, FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectionAnnotation, InjectionAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField, LOW_CODE_VALUE_RELATION, NESTED_FORM_ITEM_TYPE };
|
|
@@ -59,10 +59,6 @@ function useFieldNormalize() {
|
|
|
59
59
|
});
|
|
60
60
|
return fieldItem;
|
|
61
61
|
});
|
|
62
|
-
FieldNormalizeWaterfallHook.tap("__elem_width", (fieldItem) => {
|
|
63
|
-
fieldItem.elem_width = ~~((fieldItem.elem_width || 3) * 2);
|
|
64
|
-
return fieldItem;
|
|
65
|
-
});
|
|
66
62
|
return { FieldNormalizeWaterfallHook };
|
|
67
63
|
}
|
|
68
64
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Form } from '@formily/core';
|
|
2
|
+
import { MaybeRef } from '@vueuse/core';
|
|
3
|
+
import { FormLowCodeReactions } from '../../../../../es/components/form-render';
|
|
4
|
+
export declare function useLowCodeReactions(configListRef: MaybeRef<FormLowCodeReactions.Config[] | undefined>, formModel: Form): {
|
|
5
|
+
lowCodeReactionsHandler: (field: string, value: unknown) => void;
|
|
6
|
+
triggerAllReactionsHandler: () => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { isField } from '@formily/core';
|
|
2
|
+
import { isArray, isString, includes, isEmpty, negate, gt, gte, lt, lte } from 'lodash-es';
|
|
3
|
+
import { computed, unref } from 'vue';
|
|
4
|
+
import { Path } from '@formily/path';
|
|
5
|
+
|
|
6
|
+
function useLowCodeReactions(configListRef, formModel) {
|
|
7
|
+
const compareMap = {
|
|
8
|
+
EQ: (v1, v2) => `${v1}` === v2,
|
|
9
|
+
NEQ: (v1, v2) => `${v1}` !== v2,
|
|
10
|
+
CL: (v1, v2) => isArray(v1) || isString(v1) ? includes(v1, v2) : false,
|
|
11
|
+
NC: (v1, v2) => isArray(v1) || isString(v1) ? !includes(v1, v2) : true,
|
|
12
|
+
NULL: isEmpty,
|
|
13
|
+
NOT_NULL: negate(isEmpty),
|
|
14
|
+
BIG: gt,
|
|
15
|
+
BIGEQ: gte,
|
|
16
|
+
LESS: lt,
|
|
17
|
+
LESSEQ: lte
|
|
18
|
+
};
|
|
19
|
+
const triggerMap = {
|
|
20
|
+
hideField: createFieldHandler((field) => field.setDisplay("none")),
|
|
21
|
+
showField: createFieldHandler((field) => field.setDisplay("visible")),
|
|
22
|
+
requiredField: createFieldHandler((field) => field.required = true),
|
|
23
|
+
notRequiredField: createFieldHandler((field) => {
|
|
24
|
+
field.required = false;
|
|
25
|
+
field.validate();
|
|
26
|
+
}),
|
|
27
|
+
enabledField: createFieldHandler((field) => field.editable = true),
|
|
28
|
+
disabledField: createFieldHandler((field) => field.editable = false)
|
|
29
|
+
};
|
|
30
|
+
function createFieldHandler(cb) {
|
|
31
|
+
return (fields) => {
|
|
32
|
+
fields.forEach((field) => {
|
|
33
|
+
const state = formModel.query(field).take();
|
|
34
|
+
state && isField(state) && cb(state);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const reactionKeys = computed(() => {
|
|
39
|
+
if (!unref(configListRef))
|
|
40
|
+
return [];
|
|
41
|
+
return unref(configListRef).reduce((res, config) => {
|
|
42
|
+
isArray(config.conObj) && config.conObj.forEach((conObj) => res.push(conObj.field_key));
|
|
43
|
+
return res;
|
|
44
|
+
}, []);
|
|
45
|
+
});
|
|
46
|
+
function lowCodeReactionsHandler(field, value) {
|
|
47
|
+
const configList = unref(configListRef);
|
|
48
|
+
if (!configList || !reactionKeys.value.includes(field))
|
|
49
|
+
return;
|
|
50
|
+
const matchedConfig = configList.find((config) => reactionMatcher(field, value, config.conObj));
|
|
51
|
+
matchedConfig && trigger(matchedConfig);
|
|
52
|
+
}
|
|
53
|
+
function trigger(config) {
|
|
54
|
+
Object.entries(config).forEach(([k, v]) => triggerMap[k] && triggerMap[k](v));
|
|
55
|
+
}
|
|
56
|
+
function triggerAllReactionsHandler() {
|
|
57
|
+
const configList = unref(configListRef);
|
|
58
|
+
if (!configList)
|
|
59
|
+
return;
|
|
60
|
+
const values = formModel.getFormState().values;
|
|
61
|
+
configList.forEach((config) => {
|
|
62
|
+
if (!isArray(config.conObj))
|
|
63
|
+
return;
|
|
64
|
+
if (!config.conObj.every(matcher))
|
|
65
|
+
return;
|
|
66
|
+
trigger(config);
|
|
67
|
+
});
|
|
68
|
+
function matcher(conObj) {
|
|
69
|
+
return conObjMatcher(conObj.field_key, Path.getIn(values, conObj.field_key), conObj);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function reactionMatcher(field, value, conObjs) {
|
|
73
|
+
return conObjs.every((conObj) => conObjMatcher(field, value, conObj));
|
|
74
|
+
}
|
|
75
|
+
function conObjMatcher(field, value, conObj) {
|
|
76
|
+
if (conObj.field_key !== field)
|
|
77
|
+
return;
|
|
78
|
+
const relation = compareMap[conObj.con] || (() => false);
|
|
79
|
+
return relation(value, `${conObj.value}`);
|
|
80
|
+
}
|
|
81
|
+
return { lowCodeReactionsHandler, triggerAllReactionsHandler };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { useLowCodeReactions };
|
|
@@ -82,3 +82,20 @@ export declare type FormBusinessFormatter = (payload: {
|
|
|
82
82
|
value: unknown;
|
|
83
83
|
type: FIELD_BUSINESS_TYPE;
|
|
84
84
|
}) => unknown;
|
|
85
|
+
export declare namespace FormLowCodeReactions {
|
|
86
|
+
type ConObj = {
|
|
87
|
+
con: string;
|
|
88
|
+
field_key: string;
|
|
89
|
+
value: unknown;
|
|
90
|
+
};
|
|
91
|
+
type Config = {
|
|
92
|
+
conObj: ConObj[];
|
|
93
|
+
} & Partial<{
|
|
94
|
+
showField: string[];
|
|
95
|
+
hideField: string[];
|
|
96
|
+
requiredField: string[];
|
|
97
|
+
notRequiredField: string[];
|
|
98
|
+
enabledField: string[];
|
|
99
|
+
disabledField: string[];
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
@@ -101,6 +101,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
101
101
|
onFormClick?: ((...args: any[]) => any) | undefined;
|
|
102
102
|
onKeyboard?: ((...args: any[]) => any) | undefined;
|
|
103
103
|
}>>;
|
|
104
|
+
__emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
104
105
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
105
106
|
uuid: string;
|
|
106
107
|
$table: import("vue").Ref<import("vxe-table").VxeTableInstance | undefined>;
|
|
@@ -2028,6 +2029,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2028
2029
|
adaptive?: boolean | undefined;
|
|
2029
2030
|
} | undefined;
|
|
2030
2031
|
params?: any;
|
|
2032
|
+
onFormChange?: ((payload_0: import("../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
2031
2033
|
onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
|
|
2032
2034
|
onCut?: ((params: import("vxe-table").VxeTableDefines.CutEventParams) => void) | undefined;
|
|
2033
2035
|
onPaste?: ((params: import("vxe-table").VxeTableDefines.PasteEventParams) => void) | undefined;
|
|
@@ -2087,6 +2089,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2087
2089
|
onCellAreaArrowsEnd?: ((params: import("vxe-table").VxeTableProDefines.CellAreaArrowsEndEventParams) => void) | undefined;
|
|
2088
2090
|
onActiveCellChangeStart?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeStartEventParams) => void) | undefined;
|
|
2089
2091
|
onActiveCellChangeEnd?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeEndEventParams) => void) | undefined;
|
|
2092
|
+
onSettingClick?: (() => void) | undefined;
|
|
2093
|
+
onFormClick?: ((payload_0: import("../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
2094
|
+
onKeyboard?: ((payload_0: import("../../../es/components/iho-table/src/types").IHoTableKeyboardPayload) => void) | undefined;
|
|
2090
2095
|
uuid?: string | undefined;
|
|
2091
2096
|
isTree?: import("../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
2092
2097
|
isBatchSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
|
|
@@ -4489,6 +4494,10 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4489
4494
|
adaptive?: boolean | undefined;
|
|
4490
4495
|
} | undefined;
|
|
4491
4496
|
params?: any;
|
|
4497
|
+
onFormChange?: ((payload_0: import("../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
4498
|
+
onSettingClick?: (() => void) | undefined;
|
|
4499
|
+
onFormClick?: ((payload_0: import("../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
4500
|
+
onKeyboard?: ((payload_0: import("../../../es/components/iho-table/src/types").IHoTableKeyboardPayload) => void) | undefined;
|
|
4492
4501
|
uuid?: string | undefined;
|
|
4493
4502
|
isTree?: import("../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
4494
4503
|
isBatchSelect?: import("../../../es/shared/types").MaybeString<0 | 1> | undefined;
|
|
@@ -100,6 +100,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
100
|
onFormClick?: ((...args: any[]) => any) | undefined;
|
|
101
101
|
onKeyboard?: ((...args: any[]) => any) | undefined;
|
|
102
102
|
}>>;
|
|
103
|
+
__emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
103
104
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", ...args: any[]) => void;
|
|
104
105
|
uuid: string;
|
|
105
106
|
$table: import("vue").Ref<VxeTableInstance | undefined>;
|
|
@@ -2027,6 +2028,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2027
2028
|
adaptive?: boolean | undefined;
|
|
2028
2029
|
} | undefined;
|
|
2029
2030
|
params?: any;
|
|
2031
|
+
onFormChange?: ((payload_0: import("../../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
2030
2032
|
onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
|
|
2031
2033
|
onCut?: ((params: import("vxe-table").VxeTableDefines.CutEventParams) => void) | undefined;
|
|
2032
2034
|
onPaste?: ((params: import("vxe-table").VxeTableDefines.PasteEventParams) => void) | undefined;
|
|
@@ -2086,6 +2088,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2086
2088
|
onCellAreaArrowsEnd?: ((params: import("vxe-table").VxeTableProDefines.CellAreaArrowsEndEventParams) => void) | undefined;
|
|
2087
2089
|
onActiveCellChangeStart?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeStartEventParams) => void) | undefined;
|
|
2088
2090
|
onActiveCellChangeEnd?: ((params: import("vxe-table").VxeTableProDefines.ActiveCellChangeEndEventParams) => void) | undefined;
|
|
2091
|
+
onSettingClick?: (() => void) | undefined;
|
|
2092
|
+
onFormClick?: ((payload_0: import("../../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
2093
|
+
onKeyboard?: ((payload_0: import("../../../../es/components/iho-table/src/types").IHoTableKeyboardPayload) => void) | undefined;
|
|
2089
2094
|
uuid?: string | undefined;
|
|
2090
2095
|
isTree?: import("../../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
2091
2096
|
isBatchSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
|
|
@@ -4488,6 +4493,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4488
4493
|
adaptive?: boolean | undefined;
|
|
4489
4494
|
} | undefined;
|
|
4490
4495
|
params?: any;
|
|
4496
|
+
onFormChange?: ((payload_0: import("../../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
4497
|
+
onSettingClick?: (() => void) | undefined;
|
|
4498
|
+
onFormClick?: ((payload_0: import("../../../../es/components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
|
4499
|
+
onKeyboard?: ((payload_0: import("../../../../es/components/iho-table/src/types").IHoTableKeyboardPayload) => void) | undefined;
|
|
4491
4500
|
uuid?: string | undefined;
|
|
4492
4501
|
isTree?: import("../../../../es/shared/types").MaybeString<0 | 2 | 1 | 3> | undefined;
|
|
4493
4502
|
isBatchSelect?: import("../../../../es/shared/types").MaybeString<0 | 1> | undefined;
|
|
@@ -2,11 +2,11 @@ import { defineComponent, provide, computed, ref, watch, resolveComponent, openB
|
|
|
2
2
|
import { uuidGenerator } from '../../../shared/utils/index.js';
|
|
3
3
|
import { useDebounceFn } from '@vueuse/core';
|
|
4
4
|
import { promiseTimeout } from '@vueuse/shared';
|
|
5
|
+
import { isFunction } from 'lodash-es';
|
|
5
6
|
import { VxeEventListenerNameList, InjectionIhoTableEmits, InjectionIhoTableAnnotation, InjectionIhoTableUUID, InjectionIhoTableInstance, InjectionIhoTableConfig, InjectionIhoTableFieldList, InjectionIhoTableHandler } from './constants/index.js';
|
|
6
7
|
import { createTableHooks, applyTableConfigHooks, applyTableFieldHooks, createTableEventHandlers, createDomInsertComponent, createDataTransfer } from './hooks/tapHooks/index.js';
|
|
7
|
-
import 'lodash-es';
|
|
8
8
|
import { provideIhoTableEventListener } from './hooks/tapHooks/useEventHooks.js';
|
|
9
|
-
import {
|
|
9
|
+
import { eventListener2EventName, eventName2EventListener } from './utils/index.js';
|
|
10
10
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
11
11
|
|
|
12
12
|
const _hoisted_1 = ["id"];
|
|
@@ -23,11 +23,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
23
|
"settingClick",
|
|
24
24
|
"formClick",
|
|
25
25
|
"keyboard",
|
|
26
|
-
...VxeEventListenerNameList.map(
|
|
26
|
+
...VxeEventListenerNameList.map(eventListener2EventName)
|
|
27
27
|
],
|
|
28
|
-
setup(__props, { expose, emit:
|
|
28
|
+
setup(__props, { expose, emit: __emits }) {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
const props = __props;
|
|
31
|
+
const emits = function(eventName, ...args) {
|
|
32
|
+
__emits(eventName, ...args);
|
|
33
|
+
const eventHandler = unref(configRef)[eventName2EventListener(eventName)];
|
|
34
|
+
isFunction(eventHandler) && eventHandler(...args);
|
|
35
|
+
};
|
|
31
36
|
provide(InjectionIhoTableEmits, emits);
|
|
32
37
|
provide(
|
|
33
38
|
InjectionIhoTableAnnotation,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { eventListener2EventName } from '../utils/index.js';
|
|
2
2
|
|
|
3
3
|
var WIDGET_TYPE = /* @__PURE__ */ ((WIDGET_TYPE2) => {
|
|
4
4
|
WIDGET_TYPE2["DEFAULT"] = "DEFAULT";
|
|
@@ -95,7 +95,7 @@ const VxeEventListenerNameList = Object.freeze([
|
|
|
95
95
|
"onActiveCellChangeStart",
|
|
96
96
|
"onActiveCellChangeEnd"
|
|
97
97
|
]);
|
|
98
|
-
const VxeTableEventNameList = VxeEventListenerNameList.map(
|
|
98
|
+
const VxeTableEventNameList = VxeEventListenerNameList.map(eventListener2EventName);
|
|
99
99
|
const IhoTableRowGroupSequence = Object.freeze([
|
|
100
100
|
"firstRowGroup",
|
|
101
101
|
"secondRowGroup",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { arrayed } from '../../../../../shared/utils/index.js';
|
|
2
|
-
import { cloneDeep, isArray
|
|
2
|
+
import { cloneDeep, isArray } from 'lodash-es';
|
|
3
3
|
import { unref, defineComponent } from 'vue';
|
|
4
4
|
import { VxeEventListenerNameList } from '../../constants/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { eventListener2EventName } from '../../utils/index.js';
|
|
6
6
|
import { useConfigHooks } from './useConfigHooks.js';
|
|
7
7
|
import { useDataHooks } from './useDataHooks.js';
|
|
8
8
|
import { useDomInsertHooks } from './useDomInsertHooks.js';
|
|
@@ -111,13 +111,11 @@ function createTableEventHandlers({
|
|
|
111
111
|
);
|
|
112
112
|
function handler(eventListenerName, payload) {
|
|
113
113
|
var _a;
|
|
114
|
-
const eventName =
|
|
114
|
+
const eventName = eventListener2EventName(eventListenerName);
|
|
115
115
|
if (VxeEventListenerNameList.includes(eventListenerName)) {
|
|
116
116
|
emits(eventName, payload);
|
|
117
117
|
eventListener.trigger(eventName, payload);
|
|
118
118
|
}
|
|
119
|
-
const configEvent = unref(config)[eventListenerName];
|
|
120
|
-
isFunction(configEvent) && configEvent(payload);
|
|
121
119
|
(_a = hooks.eventHooks[eventListenerName]) == null ? void 0 : _a.promise(
|
|
122
120
|
payload,
|
|
123
121
|
unref(config),
|
|
@@ -130,23 +128,19 @@ function createDataTransfer(hooks, config, $table) {
|
|
|
130
128
|
const before = [];
|
|
131
129
|
const after = [];
|
|
132
130
|
let removed = false;
|
|
133
|
-
await hooks.dataHooks.data.promise(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
remove() {
|
|
146
|
-
removed = true;
|
|
147
|
-
}
|
|
131
|
+
await hooks.dataHooks.data.promise(rowData, unref(config), {
|
|
132
|
+
index,
|
|
133
|
+
$table,
|
|
134
|
+
insertBefore(data2) {
|
|
135
|
+
before.push(...arrayed(data2));
|
|
136
|
+
},
|
|
137
|
+
insertAfter(data2) {
|
|
138
|
+
after.push(...arrayed(data2));
|
|
139
|
+
},
|
|
140
|
+
remove() {
|
|
141
|
+
removed = true;
|
|
148
142
|
}
|
|
149
|
-
);
|
|
143
|
+
});
|
|
150
144
|
const nextRes = await res;
|
|
151
145
|
nextRes.push(...before);
|
|
152
146
|
!removed && nextRes.push(rowData);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyObject, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
2
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes } from 'vxe-table';
|
|
3
3
|
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
4
|
-
import { IHO_TABLE_STRING_STATUS, IhoTableCustomEventNameTuple, IhoTableEventNameTuple, IhoTableRowGroupSequence
|
|
4
|
+
import { IHO_TABLE_STRING_STATUS, IhoTableCustomEventNameTuple, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
5
5
|
import { FilterState } from '../../../../../es/components/iho-table/src/plugins/filterPlugin/types';
|
|
6
6
|
export * from './pluginType';
|
|
7
7
|
export interface IhoTableRowGroupItem {
|
|
@@ -10,7 +10,7 @@ export interface IhoTableRowGroupItem {
|
|
|
10
10
|
list: string[];
|
|
11
11
|
}
|
|
12
12
|
export declare type IhoTableConfig = VxeTableProps & Partial<{
|
|
13
|
-
[K in typeof
|
|
13
|
+
[K in EventNameToEventListener<typeof IhoTableEventNameTuple[number]>]: (...payload: IhoTableEmitPayload<EventListenerToEventName<K>>) => void;
|
|
14
14
|
}> & Partial<{
|
|
15
15
|
uuid: string;
|
|
16
16
|
isTree: MaybeString<0 | 1 | 2 | 3>;
|
|
@@ -2,7 +2,7 @@ import { AnyObject, Nullable } from '../../../../../es/shared/types';
|
|
|
2
2
|
import { MaybeRef } from '@vueuse/core';
|
|
3
3
|
import { VxeTableDefines, VxeTableInstance } from 'vxe-table';
|
|
4
4
|
import { VxeGlobalRendererHandles } from 'vxe-table/types/v-x-e-table/renderer';
|
|
5
|
-
import { EventListenerToEventName, IhoTableConfig, IhoTableFieldItem, LowCodeTableFieldItem } from '../../../../../es/components/iho-table';
|
|
5
|
+
import { EventListenerToEventName, EventNameToEventListener, IhoTableConfig, IhoTableFieldItem, LowCodeTableFieldItem } from '../../../../../es/components/iho-table';
|
|
6
6
|
import { EDITABLE_WIDGET_TYPE } from '../../../../../es/components/iho-table/src/constants';
|
|
7
7
|
export declare function IhoTableLog(message: string): void;
|
|
8
8
|
export declare function IhoTableWarn(message: string): void;
|
|
@@ -10,7 +10,8 @@ export declare const IhoTableUtils: Readonly<{
|
|
|
10
10
|
getCellType(lowCodeField: LowCodeTableFieldItem): string;
|
|
11
11
|
}>;
|
|
12
12
|
export declare function getRowHeight(): number;
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function eventListener2EventName<T extends string>(eventListenerName: T): EventListenerToEventName<T>;
|
|
14
|
+
export declare function eventName2EventListener<T extends string>(eventName: T): EventNameToEventListener<T>;
|
|
14
15
|
export declare function useUUIDMap<T>(creator: () => T, isReactive?: boolean): {
|
|
15
16
|
getItemFromUUID: (uuid: string) => T;
|
|
16
17
|
removeItemFromUUID: (uuid: string) => void;
|
|
@@ -21,10 +21,13 @@ function getRowHeight() {
|
|
|
21
21
|
}
|
|
22
22
|
return (_c = (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.rowConfig) == null ? void 0 : _b.height) != null ? _c : 32;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function eventListener2EventName(eventListenerName) {
|
|
25
25
|
const eventName = eventListenerName.slice(2);
|
|
26
26
|
return `${eventName[0].toLowerCase()}${eventName.slice(1)}`;
|
|
27
27
|
}
|
|
28
|
+
function eventName2EventListener(eventName) {
|
|
29
|
+
return `on${eventName[0].toUpperCase()}${eventName.slice(1)}`;
|
|
30
|
+
}
|
|
28
31
|
function useUUIDMap(creator, isReactive = true) {
|
|
29
32
|
const uuidMap = isReactive ? reactive(/* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
|
|
30
33
|
function getItemFromUUID(uuid) {
|
|
@@ -163,4 +166,4 @@ const createIhoTableClearActivedInterceptor = (type, solution) => {
|
|
|
163
166
|
};
|
|
164
167
|
};
|
|
165
168
|
|
|
166
|
-
export { IhoTableRenderHelper, IhoTableStatusHelper, IhoTableUtils, IhoTableWarn, createIhoTableClearActivedInterceptor,
|
|
169
|
+
export { IhoTableRenderHelper, IhoTableStatusHelper, IhoTableUtils, IhoTableWarn, createIhoTableClearActivedInterceptor, eventListener2EventName, eventName2EventListener, getColumnRenderWidth, getRowHeight, useIhoTableFormEvent, useUUIDMap };
|