cnhis-design-vue 3.1.30-beta.5 → 3.1.30-beta.7
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 +0 -1
- package/es/components/big-table/index.js +0 -1
- package/es/components/iho-table/index.d.ts +4 -2
- package/es/components/iho-table/index.js +1 -0
- package/es/components/iho-table/src/IhoTable.js +32 -21
- package/es/components/iho-table/src/IhoTable.vue.d.ts +3 -1
- package/es/components/iho-table/src/components/IhoTableColumn.js +9 -6
- package/es/components/iho-table/src/constants/index.d.ts +1 -1
- package/es/components/{big-table → iho-table}/src/hooks/export.d.ts +1 -0
- package/es/components/iho-table/src/hooks/export.js +2 -0
- package/es/components/{big-table → iho-table}/src/hooks/useColumnConfigAdaptor.d.ts +0 -0
- package/es/components/{big-table → iho-table}/src/hooks/useColumnConfigAdaptor.js +0 -0
- package/es/components/iho-table/src/hooks/useTableContext.d.ts +1 -1
- package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +7 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +6 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +11 -13
- package/es/components/iho-table/src/types/index.d.ts +9 -3
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +2 -2
- package/es/components/keyboard/index.d.ts +81 -12
- package/es/components/keyboard/src/Keyboard.js +196 -171
- package/es/components/keyboard/src/Keyboard.vue.d.ts +83 -22
- package/es/components/keyboard/src/components/InputNumber.js +13 -6
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +17 -2
- package/es/components/keyboard/style/index.css +1 -1
- package/package.json +2 -2
- package/es/components/big-table/src/hooks/export.js +0 -1
|
@@ -3,7 +3,6 @@ import { safeComponentRegister } from '../../shared/utils/index.js';
|
|
|
3
3
|
import { expandXEUtils } from '../../shared/utils/utilExpand.js';
|
|
4
4
|
import '../index.js';
|
|
5
5
|
import script from './src/BigTable.js';
|
|
6
|
-
export { useColumnConfigAdaptor } from './src/hooks/useColumnConfigAdaptor.js';
|
|
7
6
|
import Grid from '../grid/index.js';
|
|
8
7
|
|
|
9
8
|
const BigTable = script;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../../../es/shared/types';
|
|
2
2
|
import { IhoTableInstance } from '../../../es/components/iho-table/src/types';
|
|
3
|
-
export * from './src/hooks/
|
|
3
|
+
export * from './src/hooks/export';
|
|
4
4
|
export * from './src/types';
|
|
5
5
|
export declare const useIhoTablePresetPlugins: (instance: IhoTableInstance) => void;
|
|
6
6
|
declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
@@ -101,7 +101,6 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
101
101
|
}>>;
|
|
102
102
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "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
103
|
uuid: string;
|
|
104
|
-
uuidRef: import("vue").Ref<string>;
|
|
105
104
|
$table: import("vue").Ref<import("vxe-table").VxeTableInstance | undefined>;
|
|
106
105
|
hooks: Readonly<{
|
|
107
106
|
configHooks: import("../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
@@ -2130,6 +2129,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2130
2129
|
anchorList?: string[] | undefined;
|
|
2131
2130
|
}>;
|
|
2132
2131
|
updateConfigRef: () => void;
|
|
2132
|
+
_updateConfigRef: () => void;
|
|
2133
2133
|
fieldListRef: import("vue").Ref<{
|
|
2134
2134
|
[x: string]: unknown;
|
|
2135
2135
|
property?: string | undefined;
|
|
@@ -2431,9 +2431,11 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2431
2431
|
annotation?: boolean | undefined;
|
|
2432
2432
|
}[]>;
|
|
2433
2433
|
updateFieldListRef: () => void;
|
|
2434
|
+
_updateFieldListRef: () => void;
|
|
2434
2435
|
dataTransfer: (data: import("../../../es/shared/types").AnyObject[]) => Promise<import("../../../es/shared/types").AnyObject[]>;
|
|
2435
2436
|
tableDataRef: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
|
|
2436
2437
|
updateTableDataRef: () => Promise<void>;
|
|
2438
|
+
_updateTableDataRef: () => Promise<void>;
|
|
2437
2439
|
tableHandler: import("../../../es/components/iho-table/src/types").IhoTableHandler;
|
|
2438
2440
|
eventListener: import("./src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
2439
2441
|
eventHookHandler: Record<keyof import("vxe-table").VxeTableEventProps, any>;
|
|
@@ -18,6 +18,7 @@ import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
|
18
18
|
export { AbstractConfigHooks, AbstractDataHooks, AbstractDomInsertHooks, AbstractEventHooks, AbstractFieldHooks, AbstractSetupHooks } from './src/types/pluginType.js';
|
|
19
19
|
import { useTablePlugin } from './src/hooks/useTablePlugin.js';
|
|
20
20
|
export { defineTablePlugin, useTablePlugin } from './src/hooks/useTablePlugin.js';
|
|
21
|
+
export { useColumnConfigAdaptor } from './src/hooks/useColumnConfigAdaptor.js';
|
|
21
22
|
|
|
22
23
|
const { use } = useTablePlugin();
|
|
23
24
|
const useIhoTablePresetPlugins = (instance) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, provide, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, createVNode, mergeProps, withCtx, Fragment, renderList } from 'vue';
|
|
1
|
+
import { defineComponent, provide, ref, computed, watch, resolveComponent, openBlock, createElementBlock, createBlock, resolveDynamicComponent, unref, createVNode, mergeProps, createSlots, withCtx, Fragment, renderList, renderSlot } from 'vue';
|
|
2
2
|
import { uuidGenerator } from '../../../shared/utils/index.js';
|
|
3
3
|
import { useDebounceFn } from '@vueuse/core';
|
|
4
4
|
import { VxeEventListenerNameList, InjectionIhoTableEmits, InjectionIhoTableUUID, InjectionIhoTableInstance, InjectionIhoTableConfig, InjectionIhoTableFieldList, InjectionIhoTableHandler } from './constants/index.js';
|
|
@@ -24,36 +24,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
24
|
...VxeEventListenerNameList.map(getEventName)
|
|
25
25
|
],
|
|
26
26
|
setup(__props, { expose, emit: emits }) {
|
|
27
|
-
var _a, _b
|
|
27
|
+
var _a, _b;
|
|
28
28
|
const props = __props;
|
|
29
29
|
provide(InjectionIhoTableEmits, emits);
|
|
30
30
|
const uuid = uuidGenerator();
|
|
31
|
-
|
|
32
|
-
provide(InjectionIhoTableUUID, uuidRef);
|
|
31
|
+
provide(InjectionIhoTableUUID, uuid);
|
|
33
32
|
const $table = ref();
|
|
34
33
|
provide(InjectionIhoTableInstance, $table);
|
|
35
34
|
const hooks = createTableHooks();
|
|
36
|
-
const configRef = ref({
|
|
37
|
-
uuid: (_b = (_a = props.tableConfig) == null ? void 0 : _a.uuid) != null ? _b : uuid,
|
|
38
|
-
menuConfig: (_c = props.tableConfig) == null ? void 0 : _c.menuConfig
|
|
39
|
-
});
|
|
35
|
+
const configRef = ref({ uuid: (_b = (_a = props.tableConfig) == null ? void 0 : _a.uuid) != null ? _b : uuid });
|
|
40
36
|
provide(InjectionIhoTableConfig, configRef);
|
|
41
|
-
const updateConfigRef = useDebounceFn(
|
|
37
|
+
const updateConfigRef = useDebounceFn(_updateConfigRef, 10);
|
|
38
|
+
function _updateConfigRef() {
|
|
42
39
|
configRef.value = applyTableConfigHooks(hooks, props.tableConfig);
|
|
43
|
-
configRef.value.uuid =
|
|
44
|
-
}
|
|
40
|
+
configRef.value.uuid = uuid;
|
|
41
|
+
}
|
|
45
42
|
const fieldListRef = ref([]);
|
|
46
43
|
provide(InjectionIhoTableFieldList, fieldListRef);
|
|
47
|
-
const updateFieldListRef = useDebounceFn(
|
|
44
|
+
const updateFieldListRef = useDebounceFn(_updateFieldListRef, 10);
|
|
45
|
+
function _updateFieldListRef() {
|
|
48
46
|
fieldListRef.value = applyTableFieldHooks(hooks, props.fieldList, configRef.value);
|
|
49
|
-
}
|
|
47
|
+
}
|
|
50
48
|
const dataTransfer = createDataTransfer(hooks, configRef, $table);
|
|
51
49
|
const tableDataRef = ref([]);
|
|
52
|
-
const updateTableDataRef = useDebounceFn(
|
|
50
|
+
const updateTableDataRef = useDebounceFn(_updateTableDataRef, 10);
|
|
51
|
+
async function _updateTableDataRef() {
|
|
53
52
|
var _a2;
|
|
54
53
|
tableDataRef.value = await dataTransfer(props.tableData);
|
|
55
54
|
(_a2 = $table.value) == null ? void 0 : _a2.recalculate(true);
|
|
56
|
-
}
|
|
55
|
+
}
|
|
57
56
|
const tableHandler = { updateTableDataRef, updateConfigRef, updateFieldListRef };
|
|
58
57
|
provide(InjectionIhoTableHandler, tableHandler);
|
|
59
58
|
const eventListener = provideIhoTableEventListener();
|
|
@@ -73,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
72
|
updateFieldListRef();
|
|
74
73
|
updateTableDataRef();
|
|
75
74
|
},
|
|
76
|
-
{
|
|
75
|
+
{ deep: true }
|
|
77
76
|
);
|
|
78
77
|
watch(
|
|
79
78
|
() => props.fieldList,
|
|
@@ -81,9 +80,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
81
80
|
updateFieldListRef();
|
|
82
81
|
updateTableDataRef();
|
|
83
82
|
},
|
|
84
|
-
{
|
|
83
|
+
{ deep: true }
|
|
85
84
|
);
|
|
86
|
-
watch(() => props.tableData, updateTableDataRef
|
|
85
|
+
watch(() => props.tableData, updateTableDataRef);
|
|
86
|
+
_updateConfigRef();
|
|
87
|
+
_updateFieldListRef();
|
|
88
|
+
_updateTableDataRef();
|
|
87
89
|
const { header, footer } = createDomInsertComponent(hooks);
|
|
88
90
|
expose({ $table });
|
|
89
91
|
hooks.setupHooks.setup.call(configRef, fieldListRef);
|
|
@@ -94,7 +96,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
94
96
|
createVNode(_component_vxe_table, mergeProps({
|
|
95
97
|
ref_key: "$table",
|
|
96
98
|
ref: $table
|
|
97
|
-
}, unref(bindProperties), { data: tableDataRef.value }), {
|
|
99
|
+
}, unref(bindProperties), { data: tableDataRef.value }), createSlots({
|
|
98
100
|
default: withCtx(() => [
|
|
99
101
|
(openBlock(true), createElementBlock(Fragment, null, renderList(fieldListRef.value, (field) => {
|
|
100
102
|
return openBlock(), createBlock(unref(ColumnComponent), {
|
|
@@ -104,8 +106,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
104
106
|
}, null, 8, ["field", "annotation"]);
|
|
105
107
|
}), 128))
|
|
106
108
|
]),
|
|
107
|
-
_:
|
|
108
|
-
},
|
|
109
|
+
_: 2
|
|
110
|
+
}, [
|
|
111
|
+
renderList(_ctx.$slots, (k, v) => {
|
|
112
|
+
return {
|
|
113
|
+
name: v,
|
|
114
|
+
fn: withCtx(() => [
|
|
115
|
+
renderSlot(_ctx.$slots, v)
|
|
116
|
+
])
|
|
117
|
+
};
|
|
118
|
+
})
|
|
119
|
+
]), 1040, ["data"]),
|
|
109
120
|
(openBlock(), createBlock(resolveDynamicComponent(unref(footer))))
|
|
110
121
|
]);
|
|
111
122
|
};
|
|
@@ -100,7 +100,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
100
100
|
}>>;
|
|
101
101
|
emits: (event: "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "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;
|
|
102
102
|
uuid: string;
|
|
103
|
-
uuidRef: import("vue").Ref<string>;
|
|
104
103
|
$table: import("vue").Ref<VxeTableInstance | undefined>;
|
|
105
104
|
hooks: Readonly<{
|
|
106
105
|
configHooks: import("../../../../es/components/iho-table/src/types").AbstractConfigHooks;
|
|
@@ -2129,6 +2128,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2129
2128
|
anchorList?: string[] | undefined;
|
|
2130
2129
|
}>;
|
|
2131
2130
|
updateConfigRef: () => void;
|
|
2131
|
+
_updateConfigRef: () => void;
|
|
2132
2132
|
fieldListRef: import("vue").Ref<{
|
|
2133
2133
|
[x: string]: unknown;
|
|
2134
2134
|
property?: string | undefined;
|
|
@@ -2430,9 +2430,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2430
2430
|
annotation?: boolean | undefined;
|
|
2431
2431
|
}[]>;
|
|
2432
2432
|
updateFieldListRef: () => void;
|
|
2433
|
+
_updateFieldListRef: () => void;
|
|
2433
2434
|
dataTransfer: (data: AnyObject[]) => Promise<AnyObject[]>;
|
|
2434
2435
|
tableDataRef: import("vue").Ref<AnyObject[]>;
|
|
2435
2436
|
updateTableDataRef: () => Promise<void>;
|
|
2437
|
+
_updateTableDataRef: () => Promise<void>;
|
|
2436
2438
|
tableHandler: IhoTableHandler;
|
|
2437
2439
|
eventListener: import("../../../../es/components/iho-table/src/hooks/tapHooks/useEventHooks").IhoTableEventListener;
|
|
2438
2440
|
eventHookHandler: Record<keyof import("vxe-table").VxeTableEventProps, any>;
|
|
@@ -36,13 +36,16 @@ const ColumnComponent = defineComponent({
|
|
|
36
36
|
}, null) : null]);
|
|
37
37
|
}
|
|
38
38
|
function columnSlot({
|
|
39
|
-
slots
|
|
39
|
+
slots,
|
|
40
|
+
annotation
|
|
40
41
|
}) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const result = {
|
|
43
|
+
...slots
|
|
44
|
+
};
|
|
45
|
+
if (annotation !== false) {
|
|
46
|
+
result.header = (payload) => renderHeader(payload, slots == null ? void 0 : slots.header);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
46
49
|
}
|
|
47
50
|
function renderColumn(field) {
|
|
48
51
|
return createVNode(VxeColumn, omit(field, ["slots"]), columnSlot(field));
|
|
@@ -60,7 +60,7 @@ export declare const IhoTableEventNameTuple: readonly ["formChange", "settingCli
|
|
|
60
60
|
export declare const InjectionIhoTableConfig: InjectionKey<Ref<IhoTableConfig>>;
|
|
61
61
|
export declare const InjectionIhoTableFieldList: InjectionKey<Ref<IhoTableFieldItem[]>>;
|
|
62
62
|
export declare const InjectionIhoTableEmits: InjectionKey<(<T extends typeof IhoTableEventNameTuple[number]>(event: T, ...args: IhoTableEmitPayload<T>) => void)>;
|
|
63
|
-
export declare const InjectionIhoTableUUID: InjectionKey<
|
|
63
|
+
export declare const InjectionIhoTableUUID: InjectionKey<string>;
|
|
64
64
|
export declare const InjectionIhoTableInstance: InjectionKey<Ref<UndefinedAble<VxeTableInstance>>>;
|
|
65
65
|
export declare const InjectionIhoTableHandler: InjectionKey<IhoTableHandler>;
|
|
66
66
|
export declare const InjectionIhoTableEventListener: InjectionKey<IhoTableEventListener>;
|
|
File without changes
|
|
File without changes
|
|
@@ -5,5 +5,5 @@ export declare function useTableContext(): {
|
|
|
5
5
|
tableEmit: <T extends "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "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">(event: T, ...args: import("../types").IhoTableEmitPayload<T>) => void;
|
|
6
6
|
eventListener: import("./tapHooks/useEventHooks").IhoTableEventListener;
|
|
7
7
|
$table: import("vue").Ref<import("../../../../shared/types").UndefinedAble<import("vxe-table").VxeTableInstance>>;
|
|
8
|
-
uuid:
|
|
8
|
+
uuid: string;
|
|
9
9
|
};
|
|
@@ -17,6 +17,7 @@ function defaultConfigPlugin() {
|
|
|
17
17
|
columnConfig: { resizable: true },
|
|
18
18
|
rowConfig: { height: 48, isHover: true, isCurrent: true, keyField: "theUniqueKey" },
|
|
19
19
|
mouseConfig: { selected: true },
|
|
20
|
+
showOverflow: "tooltip",
|
|
20
21
|
editConfig: {
|
|
21
22
|
trigger: "click",
|
|
22
23
|
mode: "cell",
|
|
@@ -11,12 +11,12 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
11
11
|
hooks.fieldHooks.field.tap({ name: pluginName, stage: HIGHEST_PRIORITY }, (field) => {
|
|
12
12
|
const _field = field;
|
|
13
13
|
const result = {
|
|
14
|
+
className: _field.bold ? "iho-table__boldCell" : "",
|
|
14
15
|
field: _field.columnName,
|
|
15
|
-
|
|
16
|
-
showOverflow: "tooltip",
|
|
16
|
+
showOverflow: Reflect.has(_field, "showOverflow") ? _field.showOverflow : "tooltip",
|
|
17
17
|
visible: _field.isShow !== IHO_TABLE_NUMBER_STATUS.NEGATIVE,
|
|
18
|
-
|
|
19
|
-
...pick(_field, ["title", "treeNode", "
|
|
18
|
+
width: _field.colWidth,
|
|
19
|
+
...pick(_field, ["title", "treeNode", "resizable"])
|
|
20
20
|
};
|
|
21
21
|
settingObjAdaptor(result, _field);
|
|
22
22
|
return result;
|
|
@@ -25,15 +25,14 @@ function lowCodeFieldAdaptorPlugin() {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function settingObjAdaptor(fieldItem, lowCodeField) {
|
|
28
|
-
|
|
29
|
-
return;
|
|
28
|
+
var _a, _b;
|
|
30
29
|
fieldItem.editRender = {
|
|
31
30
|
autofocus: "input",
|
|
32
|
-
name: lowCodeField.settingObj.attr || "DEFAULT",
|
|
31
|
+
name: (((_a = lowCodeField.settingObj) == null ? void 0 : _a.attr) || lowCodeField.formType || "DEFAULT").toUpperCase(),
|
|
33
32
|
props: cloneDeep(toRaw(lowCodeField))
|
|
34
33
|
};
|
|
35
34
|
fieldItem.editRender.enabled = !Reflect.get(WIDGET_TYPE, fieldItem.editRender.name);
|
|
36
|
-
fieldItem.visible = lowCodeField.settingObj.isHide !== IHO_TABLE_STRING_STATUS.POSITIVE;
|
|
35
|
+
fieldItem.visible = ((_b = lowCodeField.settingObj) == null ? void 0 : _b.isHide) !== IHO_TABLE_STRING_STATUS.POSITIVE;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
export { lowCodeFieldAdaptorPlugin };
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVNode, inject } from 'vue';
|
|
1
|
+
import { createVNode, inject, mergeProps } from 'vue';
|
|
2
2
|
import { NInput } from 'naive-ui';
|
|
3
3
|
import '../../../../index.js';
|
|
4
4
|
import { EDITABLE_WIDGET_TYPE, InjectionIhoTableEmits } from '../../../constants/index.js';
|
|
@@ -16,7 +16,9 @@ function inputRendererPlugin() {
|
|
|
16
16
|
}) {
|
|
17
17
|
return [createVNode("span", null, [row[column.field]])];
|
|
18
18
|
},
|
|
19
|
-
renderEdit(
|
|
19
|
+
renderEdit({
|
|
20
|
+
props
|
|
21
|
+
}, {
|
|
20
22
|
row,
|
|
21
23
|
column,
|
|
22
24
|
$rowIndex
|
|
@@ -30,11 +32,11 @@ function inputRendererPlugin() {
|
|
|
30
32
|
index: $rowIndex
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
return [createVNode(NInput, {
|
|
35
|
+
return [createVNode(NInput, mergeProps({
|
|
34
36
|
"value": row[column.field],
|
|
35
37
|
"onUpdate:value": ($event) => row[column.field] = $event,
|
|
36
38
|
"onBlur": onBlur
|
|
37
|
-
}, null)];
|
|
39
|
+
}, props == null ? void 0 : props.componentProps), null)];
|
|
38
40
|
}
|
|
39
41
|
});
|
|
40
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { reactive, inject,
|
|
1
|
+
import { reactive, inject, createVNode, toRaw, h, onBeforeUnmount } from 'vue';
|
|
2
2
|
import { traverse } from '../../../../../../../shared/utils/index.js';
|
|
3
|
-
import { isFunction } from 'lodash-es';
|
|
3
|
+
import { isFunction, isObject } from 'lodash-es';
|
|
4
4
|
import '../../../../../index.js';
|
|
5
5
|
import { EDITABLE_WIDGET_TYPE, InjectionIhoTableUUID } from '../../../../constants/index.js';
|
|
6
6
|
import { getRowHeight } from '../../../../utils/index.js';
|
|
@@ -29,10 +29,11 @@ function separateRendererPlugins() {
|
|
|
29
29
|
column,
|
|
30
30
|
row
|
|
31
31
|
}) {
|
|
32
|
-
var _a;
|
|
33
32
|
const uuid = inject(InjectionIhoTableUUID);
|
|
34
|
-
const separateRow = getSeparateRowData(
|
|
35
|
-
|
|
33
|
+
const separateRow = getSeparateRowData(uuid, row) || {
|
|
34
|
+
separateData: {}
|
|
35
|
+
};
|
|
36
|
+
return createVNode("section", null, [separateRow.separateData[column.field]]);
|
|
36
37
|
},
|
|
37
38
|
renderEdit(renderOpts, {
|
|
38
39
|
column,
|
|
@@ -40,11 +41,12 @@ function separateRendererPlugins() {
|
|
|
40
41
|
}) {
|
|
41
42
|
var _a, _b;
|
|
42
43
|
const uuid = inject(InjectionIhoTableUUID);
|
|
43
|
-
const separateRow = getSeparateRowData(
|
|
44
|
+
const separateRow = getSeparateRowData(uuid, row);
|
|
44
45
|
const height = getRowHeight();
|
|
45
46
|
const slots = {};
|
|
46
|
-
if (
|
|
47
|
-
|
|
47
|
+
if ((_a = renderOpts.props) == null ? void 0 : _a.separateSlot) {
|
|
48
|
+
const separate = toRaw(renderOpts.props.separateSlot);
|
|
49
|
+
slots.menu = isFunction(separate) ? separate : isObject(separate) ? (props) => h(separate, props) : void 0;
|
|
48
50
|
}
|
|
49
51
|
return [createVNode(EditSeparate, {
|
|
50
52
|
"value": row[column.field],
|
|
@@ -67,7 +69,7 @@ function separateRendererPlugins() {
|
|
|
67
69
|
function getSeparateColumn(fieldList2) {
|
|
68
70
|
return fieldList2.reduce((res, field) => {
|
|
69
71
|
traverse(field, (item) => {
|
|
70
|
-
isSeparateColumn(item) && res.push(item);
|
|
72
|
+
isSeparateColumn(item) && res.push(toRaw(item));
|
|
71
73
|
});
|
|
72
74
|
return res;
|
|
73
75
|
}, []);
|
|
@@ -144,10 +146,6 @@ function separateRendererPlugins() {
|
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
hooks.setupHooks.setup.tap(pluginName, (config) => {
|
|
147
|
-
if (config.value.uuid) {
|
|
148
|
-
separateRowMap.set(config.value.uuid, /* @__PURE__ */ new WeakMap());
|
|
149
|
-
separateColumnMap.set(config.value.uuid, []);
|
|
150
|
-
}
|
|
151
149
|
onBeforeUnmount(() => {
|
|
152
150
|
if (config.value.uuid) {
|
|
153
151
|
separateRowMap.delete(config.value.uuid);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyObject, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
|
-
import { VxeTableProps, VxeTableDefines } from 'vxe-table';
|
|
2
|
+
import { VxeTableProps, VxeTableDefines, VxeTableInstance } from 'vxe-table';
|
|
3
3
|
import { VxeTableEventProps } from 'vxe-table/types/table';
|
|
4
4
|
import { IhoTableEventNameTuple, IhoTableRowGroupSequence, VxeEventListenerNameList } from '../../../../../es/components/iho-table/src/constants';
|
|
5
5
|
export * from './pluginType';
|
|
@@ -36,11 +36,14 @@ export declare type LowCodeTableFieldItem = {
|
|
|
36
36
|
} & Partial<{
|
|
37
37
|
id: number | string;
|
|
38
38
|
title: string;
|
|
39
|
-
colWidth:
|
|
39
|
+
colWidth: VxeTableDefines.ColumnInfo['width'];
|
|
40
40
|
settingObj: LowCodeTableSettingObj;
|
|
41
41
|
treeNode: boolean;
|
|
42
42
|
isShow: 0 | 1;
|
|
43
|
-
|
|
43
|
+
formType: string;
|
|
44
|
+
componentProps: AnyObject;
|
|
45
|
+
showOverflow: VxeTableDefines.ColumnInfo['showOverflow'];
|
|
46
|
+
}> & Partial<Pick<VxeTableDefines.ColumnInfo, 'resizable'>>;
|
|
44
47
|
export declare type IhoFormChangePayload = {
|
|
45
48
|
column: IhoTableFieldItem;
|
|
46
49
|
row: AnyObject;
|
|
@@ -58,3 +61,6 @@ export declare type IhoTableAnchorItem = {
|
|
|
58
61
|
title: string;
|
|
59
62
|
left: number;
|
|
60
63
|
};
|
|
64
|
+
export declare type IhoTableExpose = {
|
|
65
|
+
$table: VxeTableInstance;
|
|
66
|
+
};
|