cnhis-design-vue 3.1.17-beta.2 → 3.1.17-beta.3
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/packages/big-table/src/components/separate.js +1 -1
- package/es/packages/big-table/src/hooks/useSeparateRow.js +2 -2
- package/es/packages/form-config/index.d.ts +115 -1
- package/es/packages/form-config/src/FormConfig.js +11 -17
- package/es/packages/form-config/src/FormConfig.vue.d.ts +115 -1
- package/es/packages/form-config/src/components/CloseButton.js +45 -0
- package/es/packages/form-config/src/components/CloseButton.vue.d.ts +1499 -0
- package/es/packages/form-config/src/components/ComplexNode.js +45 -0
- package/es/packages/form-config/src/components/ComplexNode.vue.d.ts +1661 -0
- package/es/packages/form-config/src/components/DefaultNode.js +54 -0
- package/es/packages/form-config/src/components/DefaultNode.vue.d.ts +1543 -0
- package/es/packages/form-config/src/components/FormConfigCreator.js +3 -3
- package/es/packages/form-config/src/components/FormConfigDragDisplay.js +43 -0
- package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +114 -0
- package/es/packages/form-config/src/components/FormConfigEdit.js +1 -1
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.d.ts +2 -0
- package/es/packages/form-config/src/constants/index.js +5 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +6 -84
- package/es/packages/form-config/src/hooks/useSortable.js +3 -7
- package/es/packages/form-config/src/types/index.d.ts +2 -1
- package/es/packages/form-config/src/utils/index.d.ts +8 -1
- package/es/packages/form-config/src/utils/index.js +23 -9
- package/es/packages/form-config/style/index.css +26 -5
- package/es/packages/index.css +26 -5
- package/global.d.ts +8 -8
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
return;
|
|
30
30
|
await formRef.validate();
|
|
31
31
|
const formData = formRef.getFormValues();
|
|
32
|
-
emit("submit", { layoutWidthEnum: "ALL_LINE", ...formData, type, key: formData.name });
|
|
32
|
+
emit("submit", { layoutWidthEnum: "ALL_LINE", ...formData, type, key: formData.name, __new: true });
|
|
33
33
|
}
|
|
34
34
|
return (_ctx, _cache) => {
|
|
35
35
|
return openBlock(), createBlock(unref(NButtonGroup), { size: "small" }, {
|
|
@@ -50,7 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
50
|
]),
|
|
51
51
|
default: withCtx(() => [
|
|
52
52
|
createVNode(unref(FormRender), {
|
|
53
|
-
column:
|
|
53
|
+
column: 12,
|
|
54
54
|
ref_key: "lineBreakFormRef",
|
|
55
55
|
ref: lineBreakFormRef,
|
|
56
56
|
"initial-data": unref(pick)(initialData, ["layoutWidthEnum"]),
|
|
@@ -78,7 +78,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
78
|
]),
|
|
79
79
|
default: withCtx(() => [
|
|
80
80
|
createVNode(unref(FormRender), {
|
|
81
|
-
column:
|
|
81
|
+
column: 12,
|
|
82
82
|
ref_key: "linebarFormRef",
|
|
83
83
|
ref: linebarFormRef,
|
|
84
84
|
"initial-data": initialData,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeStyle, resolveDynamicComponent } from 'vue';
|
|
2
|
+
import Draggable from 'vuedraggable';
|
|
3
|
+
import { useSortable } from '../../../../packages/form-config/src/hooks';
|
|
4
|
+
import { layoutWidthEnum2Column } from '../../../../packages/form-config/src/utils';
|
|
5
|
+
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
6
|
+
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "FormConfigDragDisplay",
|
|
9
|
+
props: {
|
|
10
|
+
fieldItem: { type: Object },
|
|
11
|
+
getRenderer: { type: Function, require: true },
|
|
12
|
+
textFormatter: { type: Function, required: true }
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
function getItemColumnStyle(fieldItem) {
|
|
16
|
+
return { "--item-column": fieldItem ? layoutWidthEnum2Column(fieldItem.layoutWidthEnum) : 24 };
|
|
17
|
+
}
|
|
18
|
+
const { commonConfig } = useSortable();
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createBlock(unref(Draggable), mergeProps(unref(commonConfig), {
|
|
21
|
+
style: getItemColumnStyle(__props.fieldItem),
|
|
22
|
+
group: "__display"
|
|
23
|
+
}), {
|
|
24
|
+
item: withCtx(({ element }) => [
|
|
25
|
+
createElementVNode("div", {
|
|
26
|
+
class: "form-config__displayContentItem",
|
|
27
|
+
style: normalizeStyle(getItemColumnStyle(element))
|
|
28
|
+
}, [
|
|
29
|
+
(openBlock(), createBlock(resolveDynamicComponent(__props.getRenderer(element)), {
|
|
30
|
+
"get-renderer": __props.getRenderer,
|
|
31
|
+
"field-item": element,
|
|
32
|
+
textFormatter: __props.textFormatter
|
|
33
|
+
}, null, 8, ["get-renderer", "field-item", "textFormatter"]))
|
|
34
|
+
], 4)
|
|
35
|
+
]),
|
|
36
|
+
_: 1
|
|
37
|
+
}, 16, ["style"]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var FormConfigDragDisplay = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "FormConfigDragDisplay.vue"]]);
|
|
42
|
+
|
|
43
|
+
export { FormConfigDragDisplay as default };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Func } from '../../../../../es/src/types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
import { FormConfigItem, FormConfigTextFormatter } from '../../../../../es/packages/form-config';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
fieldItem: {
|
|
6
|
+
type: PropType<FormConfigItem>;
|
|
7
|
+
};
|
|
8
|
+
getRenderer: {
|
|
9
|
+
type: Func<any[], any>;
|
|
10
|
+
require: boolean;
|
|
11
|
+
};
|
|
12
|
+
textFormatter: {
|
|
13
|
+
type: PropType<FormConfigTextFormatter>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
getItemColumnStyle: (fieldItem?: FormConfigItem) => {
|
|
18
|
+
'--item-column': number;
|
|
19
|
+
};
|
|
20
|
+
commonConfig: {
|
|
21
|
+
onMove: ({ to, from }: import("sortablejs").SortableEvent) => void;
|
|
22
|
+
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
23
|
+
onUnchoose: ({ from, to, target, item }: import("sortablejs").SortableEvent) => void;
|
|
24
|
+
tag: string;
|
|
25
|
+
animation: string;
|
|
26
|
+
'item-key': string;
|
|
27
|
+
};
|
|
28
|
+
Draggable: import("vue").DefineComponent<{
|
|
29
|
+
list: {
|
|
30
|
+
type: ArrayConstructor;
|
|
31
|
+
required: boolean;
|
|
32
|
+
default: any;
|
|
33
|
+
};
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: ArrayConstructor;
|
|
36
|
+
required: boolean;
|
|
37
|
+
default: any;
|
|
38
|
+
};
|
|
39
|
+
itemKey: {
|
|
40
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
41
|
+
required: boolean;
|
|
42
|
+
};
|
|
43
|
+
clone: {
|
|
44
|
+
type: FunctionConstructor;
|
|
45
|
+
default: (original: any) => any;
|
|
46
|
+
};
|
|
47
|
+
tag: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
move: {
|
|
52
|
+
type: FunctionConstructor;
|
|
53
|
+
default: any;
|
|
54
|
+
};
|
|
55
|
+
componentData: {
|
|
56
|
+
type: ObjectConstructor;
|
|
57
|
+
required: boolean;
|
|
58
|
+
default: any;
|
|
59
|
+
};
|
|
60
|
+
}, unknown, {
|
|
61
|
+
error: boolean;
|
|
62
|
+
}, {
|
|
63
|
+
realList(): any;
|
|
64
|
+
getKey(): any;
|
|
65
|
+
}, {
|
|
66
|
+
getUnderlyingVm(domElement: any): any;
|
|
67
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
68
|
+
emitChanges(evt: any): void;
|
|
69
|
+
alterList(onList: any): void;
|
|
70
|
+
spliceList(): void;
|
|
71
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
72
|
+
getRelatedContextFromMoveEvent({ to, related }: {
|
|
73
|
+
to: any;
|
|
74
|
+
related: any;
|
|
75
|
+
}): any;
|
|
76
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
77
|
+
onDragStart(evt: any): void;
|
|
78
|
+
onDragAdd(evt: any): void;
|
|
79
|
+
onDragRemove(evt: any): void;
|
|
80
|
+
onDragUpdate(evt: any): void;
|
|
81
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
82
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
83
|
+
onDragEnd(): void;
|
|
84
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
85
|
+
move: Function;
|
|
86
|
+
tag: string;
|
|
87
|
+
clone: Function;
|
|
88
|
+
list: unknown[];
|
|
89
|
+
modelValue: unknown[];
|
|
90
|
+
componentData: Record<string, any>;
|
|
91
|
+
} & {
|
|
92
|
+
itemKey?: string | Function | undefined;
|
|
93
|
+
}>, {
|
|
94
|
+
move: Function;
|
|
95
|
+
tag: string;
|
|
96
|
+
clone: Function;
|
|
97
|
+
list: unknown[];
|
|
98
|
+
modelValue: unknown[];
|
|
99
|
+
componentData: Record<string, any>;
|
|
100
|
+
}>;
|
|
101
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
102
|
+
fieldItem: {
|
|
103
|
+
type: PropType<FormConfigItem>;
|
|
104
|
+
};
|
|
105
|
+
getRenderer: {
|
|
106
|
+
type: Func<any[], any>;
|
|
107
|
+
require: boolean;
|
|
108
|
+
};
|
|
109
|
+
textFormatter: {
|
|
110
|
+
type: PropType<FormConfigTextFormatter>;
|
|
111
|
+
required: true;
|
|
112
|
+
};
|
|
113
|
+
}>>, {}>;
|
|
114
|
+
export default _default;
|
|
@@ -54,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
55
55
|
(openBlock(), createBlock(unref(CFormRender), {
|
|
56
56
|
key: key.value,
|
|
57
|
-
column:
|
|
57
|
+
column: 12,
|
|
58
58
|
ref_key: "formRenderRef",
|
|
59
59
|
ref: formRenderRef,
|
|
60
60
|
size: "small",
|
|
@@ -1687,7 +1687,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
1687
1687
|
notes?: string | undefined;
|
|
1688
1688
|
desc?: string | undefined;
|
|
1689
1689
|
children?: any[] | undefined;
|
|
1690
|
+
__new?: boolean | undefined;
|
|
1690
1691
|
}[] | undefined;
|
|
1692
|
+
__new?: boolean | undefined;
|
|
1691
1693
|
}>;
|
|
1692
1694
|
generateFieldListByFieldItem: (fieldItem: FormConfigItem) => FieldItem[];
|
|
1693
1695
|
showModal: import("vue").Ref<boolean>;
|
|
@@ -59,4 +59,6 @@ export declare function isNullOptionConfig(): {
|
|
|
59
59
|
value: boolean;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
export declare const InjectionFieldList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
63
|
+
export declare const InjectionMaterialList: InjectionKey<Ref<FormConfigItem[]>>;
|
|
62
64
|
export declare const InjectionActiveFieldItem: InjectionKey<Ref<UndefinedAble<FormConfigItem>>>;
|
|
@@ -24,7 +24,8 @@ function widgetWidthOptionConfig() {
|
|
|
24
24
|
{ text: "1/3", value: "ONE_THREE" },
|
|
25
25
|
{ text: "3/4", value: "THREE_FOUR" },
|
|
26
26
|
{ text: "1/4", value: "ONE_FOUR" },
|
|
27
|
-
{ text: "1/6", value: "ONE_SIX" }
|
|
27
|
+
{ text: "1/6", value: "ONE_SIX" },
|
|
28
|
+
{ text: "1/8", value: "ONE_EIGHT" }
|
|
28
29
|
]
|
|
29
30
|
};
|
|
30
31
|
}
|
|
@@ -52,6 +53,8 @@ function isNullOptionConfig() {
|
|
|
52
53
|
close: { describe: "\u4E0D\u5FC5\u586B", value: false }
|
|
53
54
|
};
|
|
54
55
|
}
|
|
56
|
+
const InjectionFieldList = Symbol("InjectionFieldList");
|
|
57
|
+
const InjectionMaterialList = Symbol("InjectionMaterialList");
|
|
55
58
|
const InjectionActiveFieldItem = Symbol("InjectionActiveFieldItem");
|
|
56
59
|
|
|
57
|
-
export { EditAbleField, InjectionActiveFieldItem, WidgetTextMap, isEditOptionConfig, isNotFoldOptionConfig, isNullOptionConfig, isShowOptionConfig, widgetWidthOptionConfig };
|
|
60
|
+
export { EditAbleField, InjectionActiveFieldItem, InjectionFieldList, InjectionMaterialList, WidgetTextMap, isEditOptionConfig, isNotFoldOptionConfig, isNullOptionConfig, isShowOptionConfig, widgetWidthOptionConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormConfigItem
|
|
2
|
-
export declare function usePresetRenderer(
|
|
1
|
+
import { FormConfigItem } from '../types';
|
|
2
|
+
export declare function usePresetRenderer(): {
|
|
3
3
|
getRenderer: (fieldItem: FormConfigItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
|
|
4
4
|
};
|
|
@@ -1,94 +1,16 @@
|
|
|
1
|
-
import { defineComponent, computed, createVNode, mergeProps, inject } from 'vue';
|
|
2
1
|
import { isString, isArray, isFunction } from 'lodash-es';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { layoutWidthEnum2Column } from '../../../../packages/form-config/src/utils';
|
|
7
|
-
import { NEllipsis } from 'naive-ui';
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import DefaultNode from '../components/DefaultNode.js';
|
|
4
|
+
import ComplexNode from '../components/ComplexNode.js';
|
|
8
5
|
|
|
9
|
-
function usePresetRenderer(
|
|
6
|
+
function usePresetRenderer() {
|
|
10
7
|
const renderDefaultNode = {
|
|
11
8
|
matcher: () => true,
|
|
12
|
-
renderer
|
|
13
|
-
fieldItem
|
|
14
|
-
}) {
|
|
15
|
-
const currentActiveEditField = inject(InjectionActiveFieldItem);
|
|
16
|
-
return createVNode("section", {
|
|
17
|
-
"onClick": () => currentActiveEditField.value = fieldItem,
|
|
18
|
-
"class": {
|
|
19
|
-
"is-active": currentActiveEditField.value === fieldItem
|
|
20
|
-
}
|
|
21
|
-
}, [createVNode(NEllipsis, {
|
|
22
|
-
"class": ["form-config__renderer--default", {
|
|
23
|
-
"is-required": fieldItem.required,
|
|
24
|
-
"is-disabled": fieldItem.editable === false
|
|
25
|
-
}]
|
|
26
|
-
}, {
|
|
27
|
-
default: () => getDisplayText()
|
|
28
|
-
})]);
|
|
29
|
-
function getDisplayText() {
|
|
30
|
-
const type = WidgetTextMap.get(fieldItem.type);
|
|
31
|
-
return textFormatter(fieldItem, `${fieldItem.name}${type ? `(${type})` : ""}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
9
|
+
renderer: DefaultNode
|
|
34
10
|
};
|
|
35
11
|
const renderComplexNode = {
|
|
36
12
|
matcher: ["COMPLEX", "COMBINATION"],
|
|
37
|
-
renderer:
|
|
38
|
-
props: {
|
|
39
|
-
fieldItem: {
|
|
40
|
-
type: Object,
|
|
41
|
-
required: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
setup(props) {
|
|
45
|
-
function fieldFor(key) {
|
|
46
|
-
return props.fieldItem[key];
|
|
47
|
-
}
|
|
48
|
-
const classList = computed(() => {
|
|
49
|
-
return "form-config__renderer--complex form-config__renderer--complex--grid";
|
|
50
|
-
});
|
|
51
|
-
const style = computed(() => {
|
|
52
|
-
return {
|
|
53
|
-
"--item-column": layoutWidthEnum2Column(fieldFor("layoutWidthEnum"))
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
function renderField(fieldItem) {
|
|
57
|
-
const Renderer = getRenderer(fieldItem);
|
|
58
|
-
return createVNode("div", {
|
|
59
|
-
"class": "form-config__displayContentItem",
|
|
60
|
-
"style": {
|
|
61
|
-
"--item-column": layoutWidthEnum2Column(fieldItem.layoutWidthEnum)
|
|
62
|
-
}
|
|
63
|
-
}, [createVNode(Renderer, {
|
|
64
|
-
"fieldItem": fieldItem
|
|
65
|
-
}, null)]);
|
|
66
|
-
}
|
|
67
|
-
const childrenList = computed({
|
|
68
|
-
get() {
|
|
69
|
-
return fieldFor("children");
|
|
70
|
-
},
|
|
71
|
-
set(v) {
|
|
72
|
-
props.fieldItem.children = v;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const {
|
|
76
|
-
commonConfig
|
|
77
|
-
} = useSortable();
|
|
78
|
-
const DraggableComponent = Draggable;
|
|
79
|
-
return () => createVNode(DraggableComponent, mergeProps(commonConfig, {
|
|
80
|
-
"class": classList.value,
|
|
81
|
-
"style": style.value,
|
|
82
|
-
"group": fieldFor("key"),
|
|
83
|
-
"modelValue": childrenList.value,
|
|
84
|
-
"onUpdate:modelValue": ($event) => childrenList.value = $event
|
|
85
|
-
}), {
|
|
86
|
-
item: ({
|
|
87
|
-
element
|
|
88
|
-
}) => renderField(element)
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
})
|
|
13
|
+
renderer: ComplexNode
|
|
92
14
|
};
|
|
93
15
|
const rendererWithPreset = computed(() => {
|
|
94
16
|
return [renderComplexNode, renderDefaultNode];
|
|
@@ -15,13 +15,9 @@ function useSortable() {
|
|
|
15
15
|
}
|
|
16
16
|
let prevTo;
|
|
17
17
|
function onMove({ to, from }) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} else {
|
|
22
|
-
from.classList.remove("is-choosing-area");
|
|
23
|
-
prevTo = to;
|
|
24
|
-
}
|
|
18
|
+
prevTo == null ? void 0 : prevTo.classList.remove("is-choosing-area");
|
|
19
|
+
prevTo = to;
|
|
20
|
+
from.classList.remove("is-choosing-area");
|
|
25
21
|
to.classList.add("is-choosing-area");
|
|
26
22
|
}
|
|
27
23
|
const commonConfig = { onMove, onChoose, onUnchoose, tag: "section", animation: "150", "item-key": "key" };
|
|
@@ -8,7 +8,7 @@ export declare type FormConfigRenderer = {
|
|
|
8
8
|
renderer: Component | FunctionalComponent;
|
|
9
9
|
};
|
|
10
10
|
export declare type FormConfigType = 'NEWLINE' | 'LINE_BAR' | 'OTHER' | string;
|
|
11
|
-
export declare type FormConfigWidth = 'ALL_LINE' | 'HALF_LINE' | 'FIVE_SIX' | 'TWO_THREE' | 'ONE_THREE' | 'THREE_FOUR' | 'ONE_FOUR' | 'ONE_SIX';
|
|
11
|
+
export declare type FormConfigWidth = 'ALL_LINE' | 'HALF_LINE' | 'FIVE_SIX' | 'TWO_THREE' | 'ONE_THREE' | 'THREE_FOUR' | 'ONE_FOUR' | 'ONE_SIX' | 'ONE_EIGHT';
|
|
12
12
|
export declare type FormConfigItem = {
|
|
13
13
|
key: string;
|
|
14
14
|
layoutWidthEnum: FormConfigWidth;
|
|
@@ -24,6 +24,7 @@ export declare type FormConfigItem = {
|
|
|
24
24
|
notes: string;
|
|
25
25
|
desc: string;
|
|
26
26
|
children: FormConfigItem[];
|
|
27
|
+
__new: boolean;
|
|
27
28
|
}>;
|
|
28
29
|
export interface FormConfigTextFormatter {
|
|
29
30
|
(fieldItem: FormConfigItem, parsedText: string): string;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Func } from '../../../../../es/src/types';
|
|
2
|
+
import { FormConfigItem, FormConfigWidth } from '../../../../../es/packages/form-config';
|
|
2
3
|
export declare function layoutWidthEnum2Column(layoutWidthEnum: FormConfigWidth): number;
|
|
4
|
+
export declare function stopModifier(fn: Func): (event: Event, ...args: unknown[]) => any;
|
|
5
|
+
export declare function bindHover(fieldItem: FormConfigItem): {
|
|
6
|
+
onMouseenter: () => FormConfigItem;
|
|
7
|
+
onMouseleave: () => undefined;
|
|
8
|
+
'is-hovering': boolean;
|
|
9
|
+
};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
+
import { ref, withModifiers } from 'vue';
|
|
2
|
+
|
|
1
3
|
function layoutWidthEnum2Column(layoutWidthEnum) {
|
|
2
4
|
const transferMap = {
|
|
3
|
-
ALL_LINE:
|
|
4
|
-
HALF_LINE:
|
|
5
|
-
FIVE_SIX:
|
|
6
|
-
TWO_THREE:
|
|
7
|
-
ONE_THREE:
|
|
8
|
-
THREE_FOUR:
|
|
9
|
-
ONE_FOUR:
|
|
10
|
-
ONE_SIX:
|
|
5
|
+
ALL_LINE: 24,
|
|
6
|
+
HALF_LINE: 12,
|
|
7
|
+
FIVE_SIX: 20,
|
|
8
|
+
TWO_THREE: 16,
|
|
9
|
+
ONE_THREE: 8,
|
|
10
|
+
THREE_FOUR: 18,
|
|
11
|
+
ONE_FOUR: 6,
|
|
12
|
+
ONE_SIX: 4,
|
|
13
|
+
ONE_EIGHT: 3
|
|
11
14
|
};
|
|
12
15
|
return transferMap[layoutWidthEnum] || 12;
|
|
13
16
|
}
|
|
17
|
+
function stopModifier(fn) {
|
|
18
|
+
return withModifiers(fn, ["stop"]);
|
|
19
|
+
}
|
|
20
|
+
const hovering = ref();
|
|
21
|
+
function bindHover(fieldItem) {
|
|
22
|
+
return {
|
|
23
|
+
onMouseenter: () => hovering.value = fieldItem,
|
|
24
|
+
onMouseleave: () => hovering.value = void 0,
|
|
25
|
+
"is-hovering": hovering.value === fieldItem
|
|
26
|
+
};
|
|
27
|
+
}
|
|
14
28
|
|
|
15
|
-
export { layoutWidthEnum2Column };
|
|
29
|
+
export { bindHover, layoutWidthEnum2Column, stopModifier };
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
padding: 8px;
|
|
33
|
+
cursor: move;
|
|
33
34
|
border: 1px dashed #d9d9d9;
|
|
34
35
|
box-sizing: border-box;
|
|
35
36
|
background-color: #fafafa;
|
|
@@ -58,8 +59,8 @@
|
|
|
58
59
|
height: fit-content;
|
|
59
60
|
background: #eeeeee;
|
|
60
61
|
display: grid !important;
|
|
61
|
-
grid-template-columns: repeat(
|
|
62
|
-
gap: 8px
|
|
62
|
+
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
63
|
+
gap: 8px;
|
|
63
64
|
}
|
|
64
65
|
.form-config__displayContentItem {
|
|
65
66
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
@@ -85,6 +86,9 @@
|
|
|
85
86
|
overflow-y: auto;
|
|
86
87
|
max-height: var(--max-height);
|
|
87
88
|
}
|
|
89
|
+
.form-config__renderer {
|
|
90
|
+
cursor: move;
|
|
91
|
+
}
|
|
88
92
|
.form-config__renderer--default {
|
|
89
93
|
display: flex;
|
|
90
94
|
align-items: center;
|
|
@@ -97,13 +101,21 @@
|
|
|
97
101
|
width: 100%;
|
|
98
102
|
}
|
|
99
103
|
.form-config__renderer--complex {
|
|
100
|
-
border: 1px dashed
|
|
104
|
+
border: 1px dashed skyblue;
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
padding: 8px;
|
|
107
|
+
}
|
|
108
|
+
.form-config__renderer--complexHeader {
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
101
111
|
padding: 8px;
|
|
112
|
+
margin-top: -8px;
|
|
113
|
+
position: relative;
|
|
102
114
|
}
|
|
103
115
|
.form-config__renderer--complex--grid {
|
|
104
116
|
display: grid !important;
|
|
105
|
-
grid-template-columns: repeat(
|
|
106
|
-
gap: 8px
|
|
117
|
+
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
118
|
+
gap: 8px;
|
|
107
119
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
108
120
|
}
|
|
109
121
|
.form-config__renderer--complex--flex {
|
|
@@ -130,3 +142,12 @@
|
|
|
130
142
|
.form-config .is-choosing-area {
|
|
131
143
|
background: #f0f7ff;
|
|
132
144
|
}
|
|
145
|
+
.form-config [is-hovering='true'] > .form-config__renderer--closeButton {
|
|
146
|
+
visibility: visible;
|
|
147
|
+
}
|
|
148
|
+
.form-config .form-config__renderer--closeButton {
|
|
149
|
+
position: absolute;
|
|
150
|
+
visibility: hidden;
|
|
151
|
+
top: 12px;
|
|
152
|
+
right: 5px;
|
|
153
|
+
}
|
package/es/packages/index.css
CHANGED
|
@@ -3212,6 +3212,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3212
3212
|
display: flex;
|
|
3213
3213
|
align-items: center;
|
|
3214
3214
|
padding: 8px;
|
|
3215
|
+
cursor: move;
|
|
3215
3216
|
border: 1px dashed #d9d9d9;
|
|
3216
3217
|
box-sizing: border-box;
|
|
3217
3218
|
background-color: #fafafa;
|
|
@@ -3240,8 +3241,8 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3240
3241
|
height: fit-content;
|
|
3241
3242
|
background: #eeeeee;
|
|
3242
3243
|
display: grid !important;
|
|
3243
|
-
grid-template-columns: repeat(
|
|
3244
|
-
gap: 8px
|
|
3244
|
+
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
3245
|
+
gap: 8px;
|
|
3245
3246
|
}
|
|
3246
3247
|
.form-config__displayContentItem {
|
|
3247
3248
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
@@ -3267,6 +3268,9 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3267
3268
|
overflow-y: auto;
|
|
3268
3269
|
max-height: var(--max-height);
|
|
3269
3270
|
}
|
|
3271
|
+
.form-config__renderer {
|
|
3272
|
+
cursor: move;
|
|
3273
|
+
}
|
|
3270
3274
|
.form-config__renderer--default {
|
|
3271
3275
|
display: flex;
|
|
3272
3276
|
align-items: center;
|
|
@@ -3279,13 +3283,21 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3279
3283
|
width: 100%;
|
|
3280
3284
|
}
|
|
3281
3285
|
.form-config__renderer--complex {
|
|
3282
|
-
border: 1px dashed
|
|
3286
|
+
border: 1px dashed skyblue;
|
|
3287
|
+
border-radius: 8px;
|
|
3283
3288
|
padding: 8px;
|
|
3284
3289
|
}
|
|
3290
|
+
.form-config__renderer--complexHeader {
|
|
3291
|
+
display: flex;
|
|
3292
|
+
justify-content: center;
|
|
3293
|
+
padding: 8px;
|
|
3294
|
+
margin-top: -8px;
|
|
3295
|
+
position: relative;
|
|
3296
|
+
}
|
|
3285
3297
|
.form-config__renderer--complex--grid {
|
|
3286
3298
|
display: grid !important;
|
|
3287
|
-
grid-template-columns: repeat(
|
|
3288
|
-
gap: 8px
|
|
3299
|
+
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
3300
|
+
gap: 8px;
|
|
3289
3301
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
3290
3302
|
}
|
|
3291
3303
|
.form-config__renderer--complex--flex {
|
|
@@ -3312,3 +3324,12 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3312
3324
|
.form-config .is-choosing-area {
|
|
3313
3325
|
background: #f0f7ff;
|
|
3314
3326
|
}
|
|
3327
|
+
.form-config [is-hovering='true'] > .form-config__renderer--closeButton {
|
|
3328
|
+
visibility: visible;
|
|
3329
|
+
}
|
|
3330
|
+
.form-config .form-config__renderer--closeButton {
|
|
3331
|
+
position: absolute;
|
|
3332
|
+
visibility: hidden;
|
|
3333
|
+
top: 12px;
|
|
3334
|
+
right: 5px;
|
|
3335
|
+
}
|
package/global.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as NaiveUI from 'naive-ui';
|
|
2
|
-
|
|
3
|
-
declare module 'naive-ui' {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
export const NTree: any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {};
|
|
1
|
+
import * as NaiveUI from 'naive-ui';
|
|
2
|
+
|
|
3
|
+
declare module 'naive-ui' {
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
export const NTree: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export {};
|