cnhis-design-vue 3.1.23-beta.0 → 3.1.23-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 -3
- package/es/components/big-table/src/BigTable.vue.d.ts +0 -3
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +9 -20
- package/es/components/big-table/src/utils.d.ts +1 -1
- package/es/components/big-table/src/utils2.js +11 -37
- package/es/components/fabric-chart/src/components/PopupMenu.js +7 -2
- package/es/components/fabric-chart/src/hooks/useCenter2.js +9 -5
- package/es/components/fabric-chart/src/hooks/useEvent2.js +40 -8
- package/es/components/field-set/index.d.ts +1 -0
- package/es/components/field-set/src/FieldSet.js +16 -10
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -0
- package/es/components/form-config/index.d.ts +6 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +6 -0
- package/es/components/form-render/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/index.d.ts +2 -1
- package/es/components/form-render/src/components/renderer/index.js +2 -1
- package/es/components/form-render/src/components/renderer/index2.js +2 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascade.d.ts +86 -0
- package/es/components/form-render/src/components/renderer/levelSearchCascade.js +229 -0
- package/es/components/form-render/src/components/renderer/search.d.ts +13 -1
- package/es/components/form-render/src/components/renderer/search.js +2 -1
- package/es/components/form-render/src/components/renderer/{cascader.d.ts → searchCascade.d.ts} +0 -0
- package/es/components/form-render/src/components/renderer/{cascader.js → searchCascade.js} +1 -0
- package/es/components/form-render/src/components/renderer/select.js +2 -1
- package/es/components/form-render/src/hooks/useAsyncQueue2.js +4 -4
- package/es/components/form-render/src/hooks/useFieldListAdaptor2.js +11 -4
- package/es/components/form-render/src/hooks/useFormRequest.d.ts +2 -0
- package/es/components/form-render/src/hooks/useFormRequest2.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +6 -0
- package/es/components/form-render/src/utils/schema2.js +1 -4
- package/es/components/iho-table/index.d.ts +270 -101
- package/es/components/iho-table/src/IhoTable.vue.d.ts +270 -101
- package/es/components/iho-table/src/constants/index.d.ts +5 -3
- package/es/components/iho-table/src/constants/index.js +1 -1
- package/es/components/iho-table/src/constants/index2.js +9 -7
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +2 -2
- package/es/components/iho-table/src/plugins/index.js +4 -1
- package/es/components/iho-table/src/plugins/index2.js +4 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index2.js +11 -8
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.js +205 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +39 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useCommon2.js +17 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.d.ts +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/index.js +4 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/{inputRendererPlugins.js → inputRendererPlugin.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +60 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +40 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils2.js +20 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.js → editSeparate.js} +20 -22
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{edit-separate.vue.d.ts → editSeparate.vue.d.ts} +1 -17
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +13 -9
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.d.ts → separateUtils.d.ts} +0 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils.js → separateUtils.js} +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/{separate-utils2.js → separateUtils2.js} +4 -4
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.d.ts +31 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.js +60 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +39 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/index.js +4 -1
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/index2.js +1 -46
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.d.ts +11 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js +1 -0
- package/es/components/iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils2.js +50 -0
- package/es/components/iho-table/src/types/index.d.ts +0 -3
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +1 -0
- package/es/components/search-cascader/index.d.ts +196 -0
- package/es/components/search-cascader/index.js +1 -0
- package/es/components/search-cascader/index2.js +10 -0
- package/es/components/search-cascader/src/SearchCascader.js +168 -0
- package/es/components/search-cascader/src/SearchCascader.vue.d.ts +198 -0
- package/es/components/search-cascader/src/components/SearchMenu.d.ts +45 -0
- package/es/components/search-cascader/src/components/SearchMenu.js +134 -0
- package/es/components/search-cascader/src/components/index.d.ts +1 -0
- package/es/components/search-cascader/src/components/index.js +1 -0
- package/es/components/search-cascader/src/constants/index.d.ts +3 -0
- package/es/components/search-cascader/src/constants/index.js +1 -0
- package/es/components/search-cascader/src/constants/index2.js +3 -0
- package/es/components/search-cascader/src/hooks/index.d.ts +1 -0
- package/es/components/search-cascader/src/hooks/index.js +1 -0
- package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +3 -0
- package/es/components/search-cascader/src/hooks/useCssVariable.js +1 -0
- package/es/components/search-cascader/src/hooks/useCssVariable2.js +7 -0
- package/es/components/search-cascader/src/utils/index.d.ts +2 -0
- package/es/components/search-cascader/src/utils/index.js +1 -0
- package/es/components/search-cascader/src/utils/index2.js +11 -0
- package/es/components/search-cascader/style/index.css +1 -0
- package/es/components/select-label/index.d.ts +1 -0
- package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -0
- package/es/components/select-label/src/SelectLabel.vue_vue_type_script_setup_true_lang.js +16 -4
- package/es/components/select-person/index.d.ts +41 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +41 -0
- package/es/components/select-person/src/SelectPerson.vue_vue_type_script_setup_true_lang.js +45 -10
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.js +2 -1
- package/es/components/shortcut-setter/index.d.ts +6 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -0
- package/es/shared/components/no-data/NoData.js +74 -0
- package/es/shared/components/no-data/NoData.vue.d.ts +51 -0
- package/es/shared/components/no-data/index.d.ts +2 -0
- package/es/shared/components/no-data/index.js +1 -0
- package/es/shared/components/no-data/index2.js +2 -0
- package/es/shared/utils/index.d.ts +1 -1
- package/es/shared/utils/index2.js +14 -5
- package/package.json +2 -2
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +0 -4
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugins.d.ts +0 -1
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
tableHandler: import("../../../../../../../../es/components/iho-table").IhoTableHandler;
|
|
52
52
|
popoverRef: import("vue").Ref<any>;
|
|
53
53
|
editContent: import("vue").Ref<any>;
|
|
54
|
+
setEditContent: (value: any) => void;
|
|
54
55
|
show: import("vue").Ref<boolean>;
|
|
55
56
|
setShow: (v: boolean) => void;
|
|
56
57
|
emit: (event: "update:value", ...args: any[]) => void;
|
|
@@ -59,23 +60,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
59
60
|
updateShow: (show: boolean) => void;
|
|
60
61
|
style: import("vue").ComputedRef<CSSProperties>;
|
|
61
62
|
elementRef: import("vue").Ref<any>;
|
|
62
|
-
SlotRender: import("vue").DefineComponent<{
|
|
63
|
-
renderer: {
|
|
64
|
-
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../../../es/shared/types").Func<any[], any>>;
|
|
65
|
-
required: true;
|
|
66
|
-
};
|
|
67
|
-
rootSlots: {
|
|
68
|
-
type: PropType<Record<string, import("../../../../../../../../es/shared/types").Func<any[], any>>>;
|
|
69
|
-
};
|
|
70
|
-
}, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
71
|
-
renderer: {
|
|
72
|
-
type: PropType<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("../../../../../../../../es/shared/types").Func<any[], any>>;
|
|
73
|
-
required: true;
|
|
74
|
-
};
|
|
75
|
-
rootSlots: {
|
|
76
|
-
type: PropType<Record<string, import("../../../../../../../../es/shared/types").Func<any[], any>>>;
|
|
77
|
-
};
|
|
78
|
-
}>>, {}>;
|
|
79
63
|
NPopover: any;
|
|
80
64
|
NInput: any;
|
|
81
65
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -2,10 +2,10 @@ import { reactive, inject, unref, createVNode, onBeforeUnmount } from 'vue';
|
|
|
2
2
|
import { traverse } from '../../../../../../../shared/utils/index2.js';
|
|
3
3
|
import { isFunction } from 'lodash-es';
|
|
4
4
|
import '../../../../../index2.js';
|
|
5
|
-
import {
|
|
5
|
+
import { EDITABLE_WIDGET_TYPE, InjectionIhoTableUUID } from '../../../../constants/index2.js';
|
|
6
6
|
import { getRowHeight } from '../../../../utils/index2.js';
|
|
7
|
-
import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './
|
|
8
|
-
import EditSeparate from './
|
|
7
|
+
import { isSeparateColumn, getColumnRenderWidth, contentSeparate, getColumnInfoMaxLength, generateSeparateRowData } from './separateUtils2.js';
|
|
8
|
+
import EditSeparate from './editSeparate.js';
|
|
9
9
|
import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
|
|
10
10
|
|
|
11
11
|
function separateRendererPlugins() {
|
|
@@ -24,8 +24,8 @@ function separateRendererPlugins() {
|
|
|
24
24
|
return defineTablePlugin({
|
|
25
25
|
name: pluginName,
|
|
26
26
|
vxe(instance) {
|
|
27
|
-
instance.renderer.add(
|
|
28
|
-
renderCell(
|
|
27
|
+
instance.renderer.add(EDITABLE_WIDGET_TYPE.SEPARATE, {
|
|
28
|
+
renderCell(renderOpts, {
|
|
29
29
|
column,
|
|
30
30
|
row
|
|
31
31
|
}) {
|
|
@@ -34,14 +34,18 @@ function separateRendererPlugins() {
|
|
|
34
34
|
const separateRow = getSeparateRowData(unref(uuid), row);
|
|
35
35
|
return createVNode("section", null, [(_a = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _a[column.field]]);
|
|
36
36
|
},
|
|
37
|
-
renderEdit(
|
|
37
|
+
renderEdit(renderOpts, {
|
|
38
38
|
column,
|
|
39
39
|
row
|
|
40
40
|
}) {
|
|
41
|
-
var _a;
|
|
41
|
+
var _a, _b;
|
|
42
42
|
const uuid = inject(InjectionIhoTableUUID);
|
|
43
43
|
const separateRow = getSeparateRowData(unref(uuid), row);
|
|
44
44
|
const height = getRowHeight();
|
|
45
|
+
const slots = {};
|
|
46
|
+
if (isFunction((_a = renderOpts.props) == null ? void 0 : _a.separateSlot)) {
|
|
47
|
+
slots.menu = renderOpts.props.separateSlot;
|
|
48
|
+
}
|
|
45
49
|
return [createVNode(EditSeparate, {
|
|
46
50
|
"value": row[column.field],
|
|
47
51
|
"onUpdate:value": ($event) => row[column.field] = $event,
|
|
@@ -49,8 +53,8 @@ function separateRendererPlugins() {
|
|
|
49
53
|
"height": height,
|
|
50
54
|
"column": column,
|
|
51
55
|
"row": row,
|
|
52
|
-
"displayContent": (
|
|
53
|
-
},
|
|
56
|
+
"displayContent": (_b = separateRow == null ? void 0 : separateRow.separateData) == null ? void 0 : _b[column.field]
|
|
57
|
+
}, slots)];
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
},
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn } from './
|
|
1
|
+
export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn } from './separateUtils2.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getStringWidth } from '../../../../../../../shared/utils/index2.js';
|
|
2
2
|
import { isNumber, isArray, cloneDeep, isString } from 'lodash-es';
|
|
3
3
|
import { nextTick, unref } from 'vue';
|
|
4
|
-
import {
|
|
4
|
+
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
|
|
5
5
|
|
|
6
6
|
function getColumnInfoMaxLength(parsedRowDataInfo) {
|
|
7
7
|
return Math.max(...parsedRowDataInfo.map((r) => r.data.length), 1);
|
|
@@ -29,8 +29,8 @@ function generateSeparateRowData(parsedRowDataInfo, index) {
|
|
|
29
29
|
function contentSeparate(value, field, width) {
|
|
30
30
|
if (isArray(value)) {
|
|
31
31
|
return value.map((row) => {
|
|
32
|
-
var _a, _b, _c;
|
|
33
|
-
return (_c = (_b = (_a = field.
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
|
+
return (_d = (_c = (_b = (_a = field.editRender) == null ? void 0 : _a.props) == null ? void 0 : _b.separateFormatter) == null ? void 0 : _c.call(_b, cloneDeep(row))) != null ? _d : row;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
if (!isString(value) || !isNumber(width))
|
|
@@ -48,7 +48,7 @@ function contentSeparate(value, field, width) {
|
|
|
48
48
|
}
|
|
49
49
|
function isSeparateColumn(field) {
|
|
50
50
|
var _a;
|
|
51
|
-
return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) ===
|
|
51
|
+
return field.field && ((_a = field.editRender) == null ? void 0 : _a.name) === EDITABLE_WIDGET_TYPE.SEPARATE;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export { contentSeparate, generateSeparateRowData, getColumnInfoMaxLength, getColumnRenderWidth, isSeparateColumn };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IhoTableFieldItem } from '../../../../../../../../es/components/iho-table';
|
|
3
|
+
import { AnyObject } from '../../../../../../../../es/shared/types';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
column: {
|
|
6
|
+
type: PropType<IhoTableFieldItem>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
row: {
|
|
10
|
+
type: PropType<AnyObject>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
index: {
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
column: {
|
|
19
|
+
type: PropType<IhoTableFieldItem>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
row: {
|
|
23
|
+
type: PropType<AnyObject>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
index: {
|
|
27
|
+
type: NumberConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>>, {}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent, inject, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import { NTimePicker } from 'naive-ui';
|
|
3
|
+
import { InjectionIhoTableEmits } from '../../../../constants/index2.js';
|
|
4
|
+
import { useCommon } from '../hooks/useCommon2.js';
|
|
5
|
+
|
|
6
|
+
var EditTime = defineComponent({
|
|
7
|
+
name: "EditTime",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
components: {
|
|
10
|
+
NTimePicker
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
column: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
row: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
index: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(props, {
|
|
27
|
+
attrs,
|
|
28
|
+
emit
|
|
29
|
+
}) {
|
|
30
|
+
const globEmit = inject(InjectionIhoTableEmits);
|
|
31
|
+
const {
|
|
32
|
+
formRef,
|
|
33
|
+
isShow
|
|
34
|
+
} = useCommon();
|
|
35
|
+
const onUpdateValue = (value) => {
|
|
36
|
+
globEmit("formChange", {
|
|
37
|
+
value,
|
|
38
|
+
row: props.row,
|
|
39
|
+
column: props.column,
|
|
40
|
+
index: props.index
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const timeConfig = {
|
|
44
|
+
placeholder: attrs.placeholder || "\u8BF7\u9009\u62E9",
|
|
45
|
+
valueFormat: attrs.valueFormat || "HH:mm",
|
|
46
|
+
format: attrs.valueFormat || "yyyy-MM-dd HH:mm:ss",
|
|
47
|
+
...attrs,
|
|
48
|
+
onUpdateFormattedValue: onUpdateValue
|
|
49
|
+
};
|
|
50
|
+
return () => createVNode(NTimePicker, mergeProps({
|
|
51
|
+
"ref": formRef,
|
|
52
|
+
"show": isShow.value,
|
|
53
|
+
"onUpdate:show": ($event) => isShow.value = $event,
|
|
54
|
+
"formattedValue": props.row[props.column.field],
|
|
55
|
+
"onUpdate:formattedValue": ($event) => props.row[props.column.field] = $event
|
|
56
|
+
}, timeConfig), null);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export { EditTime as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function timeRendererPlugin(): import("../../../../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createVNode, mergeProps } from 'vue';
|
|
2
|
+
import '../../../../../index2.js';
|
|
3
|
+
import { EDITABLE_WIDGET_TYPE } from '../../../../constants/index2.js';
|
|
4
|
+
import EditTime from './editTime.js';
|
|
5
|
+
import { defineTablePlugin } from '../../../../hooks/useTablePlugin2.js';
|
|
6
|
+
|
|
7
|
+
function timeRendererPlugin() {
|
|
8
|
+
const pluginName = "timeRendererPlugin";
|
|
9
|
+
return defineTablePlugin({
|
|
10
|
+
name: pluginName,
|
|
11
|
+
vxe(instance) {
|
|
12
|
+
instance.renderer.add(EDITABLE_WIDGET_TYPE.TIME, {
|
|
13
|
+
renderCell({
|
|
14
|
+
props
|
|
15
|
+
}, {
|
|
16
|
+
row,
|
|
17
|
+
column
|
|
18
|
+
}) {
|
|
19
|
+
return [createVNode("span", null, [row[column.field]])];
|
|
20
|
+
},
|
|
21
|
+
renderEdit({
|
|
22
|
+
props
|
|
23
|
+
}, {
|
|
24
|
+
row,
|
|
25
|
+
column,
|
|
26
|
+
$rowIndex
|
|
27
|
+
}) {
|
|
28
|
+
return [createVNode(EditTime, mergeProps((props == null ? void 0 : props.componentProps) || {}, {
|
|
29
|
+
"column": column,
|
|
30
|
+
"row": row,
|
|
31
|
+
"index": $rowIndex
|
|
32
|
+
}), null)];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { timeRendererPlugin };
|
|
@@ -4,5 +4,8 @@ export { colorRendererPlugin } from './widgets/colorRendererPlugin.js';
|
|
|
4
4
|
export { seqRendererPlugin } from './widgets/seqRendererPlugin.js';
|
|
5
5
|
export { checkRendererPlugin } from './widgets/checkRendererPlugin.js';
|
|
6
6
|
export { pictureRendererPlugin } from './widgets/pictureRendererPlugin.js';
|
|
7
|
-
export {
|
|
7
|
+
export { inputRendererPlugin } from './editableWidgets/inputRendererPlugin.js';
|
|
8
8
|
export { separateRendererPlugins } from './editableWidgets/separateRendererPlugin/index.js';
|
|
9
|
+
export { selectRendererPlugin } from './editableWidgets/selectRendererPlugin/index.js';
|
|
10
|
+
export { dateRendererPlugin } from './editableWidgets/dateRendererPlugin/index.js';
|
|
11
|
+
export { timeRendererPlugin } from './editableWidgets/timeRendererPlugin/index.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isObject } from '@vue/shared';
|
|
2
|
-
import { isArray, isString } from 'lodash-es';
|
|
3
2
|
import '../../../index2.js';
|
|
4
|
-
import {
|
|
3
|
+
import { groupTraverser, createRowGroupList } from './rowGroupUtils2.js';
|
|
5
4
|
import { defineTablePlugin } from '../../hooks/useTablePlugin2.js';
|
|
6
5
|
|
|
7
6
|
function rowGroupSettingPlugin() {
|
|
@@ -24,49 +23,5 @@ function rowGroupSettingPlugin() {
|
|
|
24
23
|
function fieldSearcher(fieldName, fieldList) {
|
|
25
24
|
return fieldList.find((field) => field.field === fieldName);
|
|
26
25
|
}
|
|
27
|
-
function createRowGroupList(rowGroupSetting, fieldList) {
|
|
28
|
-
const result = fieldList.map((field) => field.field);
|
|
29
|
-
IhoTableRowGroupSequence.some((sequence) => {
|
|
30
|
-
const currentLevelGroup = rowGroupSetting[sequence];
|
|
31
|
-
if (!isArray(currentLevelGroup))
|
|
32
|
-
return true;
|
|
33
|
-
currentLevelGroup.forEach((groupSetting) => {
|
|
34
|
-
if (!isArray(groupSetting.list) || !groupSetting.list.length)
|
|
35
|
-
return;
|
|
36
|
-
const children = [];
|
|
37
|
-
groupSetting.list.forEach((fieldName, idx) => {
|
|
38
|
-
const groupIdx = groupIndexSearcher(fieldName, result);
|
|
39
|
-
if (!~groupIdx)
|
|
40
|
-
return;
|
|
41
|
-
children.push(result[groupIdx]);
|
|
42
|
-
if (idx === 0) {
|
|
43
|
-
result.splice(groupIdx, 1, { fieldName: groupSetting.title, children });
|
|
44
|
-
} else {
|
|
45
|
-
result.splice(groupIdx, 1);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return result;
|
|
51
|
-
function groupIndexSearcher(fieldName, groupList) {
|
|
52
|
-
return groupList.findIndex((group) => (isObject(group) ? group.fieldName : group) === fieldName);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function groupTraverser(groupList, replacer) {
|
|
56
|
-
return groupList.reduce((result, group) => {
|
|
57
|
-
if (isString(group)) {
|
|
58
|
-
const item = replacer(group);
|
|
59
|
-
item && result.push(item);
|
|
60
|
-
}
|
|
61
|
-
if (isObject(group) && group.children) {
|
|
62
|
-
const item = replacer(group.fieldName, true);
|
|
63
|
-
if (item) {
|
|
64
|
-
item.children = groupTraverser(group.children, replacer);
|
|
65
|
-
result.push(item);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}, []);
|
|
70
|
-
}
|
|
71
26
|
|
|
72
27
|
export { rowGroupSettingPlugin };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NotNull, Nullable } from '../../../../../../es/shared/types';
|
|
2
|
+
import { IhoTableConfig, IhoTableFieldItem } from '../../../../../../es/components/iho-table';
|
|
3
|
+
declare type GroupItem = string | {
|
|
4
|
+
fieldName: string;
|
|
5
|
+
children?: GroupItem[];
|
|
6
|
+
};
|
|
7
|
+
export declare function createRowGroupList(rowGroupSetting: NotNull<IhoTableConfig['rowGroupSetting']>, fieldList: IhoTableFieldItem[], getKey?: (field: IhoTableFieldItem) => string): GroupItem[];
|
|
8
|
+
export declare function groupTraverser<T extends Nullable<{
|
|
9
|
+
children?: T[];
|
|
10
|
+
}>>(groupList: GroupItem[], replacer: (fieldName: string, isBlock?: boolean) => T): NotNull<T>[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createRowGroupList, groupTraverser } from './rowGroupUtils2.js';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isObject } from '@vue/shared';
|
|
2
|
+
import { isArray, isString } from 'lodash-es';
|
|
3
|
+
import { IhoTableRowGroupSequence } from '../../constants/index2.js';
|
|
4
|
+
|
|
5
|
+
function createRowGroupList(rowGroupSetting, fieldList, getKey = (field) => field.field) {
|
|
6
|
+
const result = fieldList.map((field) => getKey(field));
|
|
7
|
+
IhoTableRowGroupSequence.some((sequence) => {
|
|
8
|
+
const currentLevelGroup = rowGroupSetting[sequence];
|
|
9
|
+
if (!isArray(currentLevelGroup))
|
|
10
|
+
return true;
|
|
11
|
+
currentLevelGroup.forEach((groupSetting) => {
|
|
12
|
+
if (!isArray(groupSetting.list) || !groupSetting.list.length)
|
|
13
|
+
return;
|
|
14
|
+
const children = [];
|
|
15
|
+
groupSetting.list.forEach((fieldName, idx) => {
|
|
16
|
+
const groupIdx = groupIndexSearcher(fieldName, result);
|
|
17
|
+
if (!~groupIdx)
|
|
18
|
+
return;
|
|
19
|
+
children.push(result[groupIdx]);
|
|
20
|
+
if (idx === 0) {
|
|
21
|
+
result.splice(groupIdx, 1, { fieldName: groupSetting.title, children });
|
|
22
|
+
} else {
|
|
23
|
+
result.splice(groupIdx, 1);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return result;
|
|
29
|
+
function groupIndexSearcher(fieldName, groupList) {
|
|
30
|
+
return groupList.findIndex((group) => (isObject(group) ? group.fieldName : group) === fieldName);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function groupTraverser(groupList, replacer) {
|
|
34
|
+
return groupList.reduce((result, group) => {
|
|
35
|
+
if (isString(group)) {
|
|
36
|
+
const item = replacer(group);
|
|
37
|
+
item && result.push(item);
|
|
38
|
+
}
|
|
39
|
+
if (isObject(group) && group.children) {
|
|
40
|
+
const item = replacer(group.fieldName, true);
|
|
41
|
+
if (item) {
|
|
42
|
+
item.children = groupTraverser(group.children, replacer);
|
|
43
|
+
result.push(item);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}, []);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { createRowGroupList, groupTraverser };
|
|
@@ -21,8 +21,6 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
|
|
|
21
21
|
}>;
|
|
22
22
|
export declare type IhoTableFieldItem = {
|
|
23
23
|
[K in keyof VxeTableDefines.ColumnInfo]?: K extends 'children' ? IhoTableFieldItem[] : K extends keyof VxeTableDefines.ColumnInfo ? VxeTableDefines.ColumnInfo[K] : never;
|
|
24
|
-
} & {
|
|
25
|
-
context?: AnyObject;
|
|
26
24
|
} & {
|
|
27
25
|
[K: string]: unknown;
|
|
28
26
|
};
|
|
@@ -39,7 +37,6 @@ export declare type LowCodeTableFieldItem = {
|
|
|
39
37
|
title: string;
|
|
40
38
|
colWidth: string | number;
|
|
41
39
|
settingObj: LowCodeTableSettingObj;
|
|
42
|
-
context: AnyObject;
|
|
43
40
|
}>;
|
|
44
41
|
export declare type IhoFormChangePayload = {
|
|
45
42
|
column: VxeTableDefines.ColumnInfo;
|