cnhis-design-vue 3.1.17-beta.2 → 3.1.17-beta.5
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/button-print/index.d.ts +1 -1
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +1 -1
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +13 -17
- package/es/packages/fabric-chart/src/hooks/useLeft.js +3 -1
- package/es/packages/fabric-chart/src/hooks/useRight.js +8 -2
- package/es/packages/form-config/index.d.ts +8282 -6776
- package/es/packages/form-config/src/FormConfig.js +23 -26
- package/es/packages/form-config/src/FormConfig.vue.d.ts +8283 -6777
- package/es/packages/form-config/src/components/FormConfigCreator.js +3 -3
- package/es/packages/form-config/src/components/FormConfigDragDisplay.js +42 -0
- package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +106 -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/components/index.d.ts +5 -0
- package/es/packages/form-config/src/components/index.js +6 -0
- package/es/packages/form-config/src/components/renderer/CloseButton.js +45 -0
- package/es/packages/form-config/src/components/renderer/CloseButton.vue.d.ts +1499 -0
- package/es/packages/form-config/src/components/renderer/ComplexNode.js +44 -0
- package/es/packages/form-config/src/components/renderer/ComplexNode.vue.d.ts +1641 -0
- package/es/packages/form-config/src/components/renderer/DefaultNode.js +59 -0
- package/es/packages/form-config/src/components/renderer/DefaultNode.vue.d.ts +3266 -0
- package/es/packages/form-config/src/components/renderer/index.d.ts +4 -0
- package/es/packages/form-config/src/components/renderer/index.js +3 -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/index.d.ts +1 -1
- package/es/packages/form-config/src/hooks/index.js +1 -1
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -2
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +5 -84
- package/es/packages/form-config/src/hooks/{useSortable.d.ts → useSortalbeConfig.d.ts} +2 -2
- package/es/packages/form-config/src/hooks/{useSortable.js → useSortalbeConfig.js} +7 -11
- package/es/packages/form-config/src/types/index.d.ts +2 -1
- package/es/packages/form-config/src/utils/index.d.ts +6 -1
- package/es/packages/form-config/src/utils/index.js +20 -9
- package/es/packages/form-config/style/index.css +35 -20
- package/es/packages/form-render/src/FormRender.js +5 -7
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +1 -2
- package/es/packages/form-render/src/hooks/useFormContext.js +1 -4
- package/es/packages/form-render/src/hooks/useFormItemDeps.d.ts +1 -0
- package/es/packages/form-render/src/hooks/useFormItemDeps.js +5 -2
- package/es/packages/form-render/src/utils/index.js +1 -1
- package/es/packages/form-render/src/utils/schema.d.ts +0 -1
- package/es/packages/form-render/src/utils/schema.js +1 -12
- package/es/packages/form-render/style/index.css +1 -1
- package/es/packages/index.css +36 -21
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +2 -1
- 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,42 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, createElementVNode, normalizeStyle, resolveDynamicComponent } from 'vue';
|
|
2
|
+
import Draggable from 'vuedraggable';
|
|
3
|
+
import { usePresetRenderer, useSortableConfig } 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
|
+
textFormatter: { type: Function, required: true }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
function getItemColumnStyle(fieldItem) {
|
|
15
|
+
return { "--item-column": fieldItem ? layoutWidthEnum2Column(fieldItem.layoutWidthEnum) : 24 };
|
|
16
|
+
}
|
|
17
|
+
const { getRenderer } = usePresetRenderer();
|
|
18
|
+
const { getCommonConfig } = useSortableConfig();
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createBlock(unref(Draggable), mergeProps(unref(getCommonConfig)(), {
|
|
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(unref(getRenderer)(element)), {
|
|
30
|
+
"field-item": element,
|
|
31
|
+
textFormatter: __props.textFormatter
|
|
32
|
+
}, null, 8, ["field-item", "textFormatter"]))
|
|
33
|
+
], 4)
|
|
34
|
+
]),
|
|
35
|
+
_: 1
|
|
36
|
+
}, 16, ["style"]);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var FormConfigDragDisplay = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "FormConfigDragDisplay.vue"]]);
|
|
41
|
+
|
|
42
|
+
export { FormConfigDragDisplay as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { FormConfigItem, FormConfigTextFormatter } from '../../../../../es/packages/form-config';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
fieldItem: {
|
|
5
|
+
type: PropType<FormConfigItem>;
|
|
6
|
+
};
|
|
7
|
+
textFormatter: {
|
|
8
|
+
type: PropType<FormConfigTextFormatter>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
getItemColumnStyle: (fieldItem?: FormConfigItem) => {
|
|
13
|
+
'--item-column': number;
|
|
14
|
+
};
|
|
15
|
+
getRenderer: (fieldItem: FormConfigItem) => import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>;
|
|
16
|
+
getCommonConfig: () => {
|
|
17
|
+
onMove: ({ to, from }: import("sortablejs").SortableEvent) => void;
|
|
18
|
+
onChoose: ({ target, item }: import("sortablejs").SortableEvent) => void;
|
|
19
|
+
onUnchoose: ({ from, to, target, item }: import("sortablejs").SortableEvent) => void;
|
|
20
|
+
tag: string;
|
|
21
|
+
animation: string;
|
|
22
|
+
'item-key': string;
|
|
23
|
+
};
|
|
24
|
+
Draggable: import("vue").DefineComponent<{
|
|
25
|
+
list: {
|
|
26
|
+
type: ArrayConstructor;
|
|
27
|
+
required: boolean;
|
|
28
|
+
default: any;
|
|
29
|
+
};
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: ArrayConstructor;
|
|
32
|
+
required: boolean;
|
|
33
|
+
default: any;
|
|
34
|
+
};
|
|
35
|
+
itemKey: {
|
|
36
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
37
|
+
required: boolean;
|
|
38
|
+
};
|
|
39
|
+
clone: {
|
|
40
|
+
type: FunctionConstructor;
|
|
41
|
+
default: (original: any) => any;
|
|
42
|
+
};
|
|
43
|
+
tag: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
move: {
|
|
48
|
+
type: FunctionConstructor;
|
|
49
|
+
default: any;
|
|
50
|
+
};
|
|
51
|
+
componentData: {
|
|
52
|
+
type: ObjectConstructor;
|
|
53
|
+
required: boolean;
|
|
54
|
+
default: any;
|
|
55
|
+
};
|
|
56
|
+
}, unknown, {
|
|
57
|
+
error: boolean;
|
|
58
|
+
}, {
|
|
59
|
+
realList(): any;
|
|
60
|
+
getKey(): any;
|
|
61
|
+
}, {
|
|
62
|
+
getUnderlyingVm(domElement: any): any;
|
|
63
|
+
getUnderlyingPotencialDraggableComponent(htmElement: any): any;
|
|
64
|
+
emitChanges(evt: any): void;
|
|
65
|
+
alterList(onList: any): void;
|
|
66
|
+
spliceList(): void;
|
|
67
|
+
updatePosition(oldIndex: any, newIndex: any): void;
|
|
68
|
+
getRelatedContextFromMoveEvent({ to, related }: {
|
|
69
|
+
to: any;
|
|
70
|
+
related: any;
|
|
71
|
+
}): any;
|
|
72
|
+
getVmIndexFromDomIndex(domIndex: any): any;
|
|
73
|
+
onDragStart(evt: any): void;
|
|
74
|
+
onDragAdd(evt: any): void;
|
|
75
|
+
onDragRemove(evt: any): void;
|
|
76
|
+
onDragUpdate(evt: any): void;
|
|
77
|
+
computeFutureIndex(relatedContext: any, evt: any): any;
|
|
78
|
+
onDragMove(evt: any, originalEvent: any): any;
|
|
79
|
+
onDragEnd(): void;
|
|
80
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], any, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
81
|
+
move: Function;
|
|
82
|
+
tag: string;
|
|
83
|
+
clone: Function;
|
|
84
|
+
list: unknown[];
|
|
85
|
+
modelValue: unknown[];
|
|
86
|
+
componentData: Record<string, any>;
|
|
87
|
+
} & {
|
|
88
|
+
itemKey?: string | Function | undefined;
|
|
89
|
+
}>, {
|
|
90
|
+
move: Function;
|
|
91
|
+
tag: string;
|
|
92
|
+
clone: Function;
|
|
93
|
+
list: unknown[];
|
|
94
|
+
modelValue: unknown[];
|
|
95
|
+
componentData: Record<string, any>;
|
|
96
|
+
}>;
|
|
97
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
98
|
+
fieldItem: {
|
|
99
|
+
type: PropType<FormConfigItem>;
|
|
100
|
+
};
|
|
101
|
+
textFormatter: {
|
|
102
|
+
type: PropType<FormConfigTextFormatter>;
|
|
103
|
+
required: true;
|
|
104
|
+
};
|
|
105
|
+
}>>, {}>;
|
|
106
|
+
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>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import FormConfigCreator from './FormConfigCreator.vue';
|
|
2
|
+
import FormConfigEdit from './FormConfigEdit.vue';
|
|
3
|
+
import FormConfigDragDisplay from './FormConfigDragDisplay.vue';
|
|
4
|
+
export * from './renderer';
|
|
5
|
+
export { FormConfigCreator, FormConfigEdit, FormConfigDragDisplay };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as FormConfigCreator } from './FormConfigCreator.js';
|
|
2
|
+
export { default as FormConfigEdit } from './FormConfigEdit.js';
|
|
3
|
+
export { default as FormConfigDragDisplay } from './FormConfigDragDisplay.js';
|
|
4
|
+
export { default as CloseButton } from './renderer/CloseButton.js';
|
|
5
|
+
export { default as ComplexNode } from './renderer/ComplexNode.js';
|
|
6
|
+
export { default as DefaultNode } from './renderer/DefaultNode.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, inject, openBlock, createBlock, unref, withModifiers, withCtx, createVNode } from 'vue';
|
|
2
|
+
import { CloseCircle } from '@vicons/ionicons5';
|
|
3
|
+
import { isArray } from 'lodash-es';
|
|
4
|
+
import { NButton, NIcon } from 'naive-ui';
|
|
5
|
+
import { InjectionFieldList, InjectionMaterialList } from '../../../../../packages/form-config/src/constants';
|
|
6
|
+
import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
|
|
7
|
+
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "CloseButton",
|
|
10
|
+
props: {
|
|
11
|
+
fieldItem: { type: Object, required: true }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const fieldList = inject(InjectionFieldList);
|
|
16
|
+
const materialList = inject(InjectionMaterialList);
|
|
17
|
+
const remove = () => {
|
|
18
|
+
traverse(fieldList.value);
|
|
19
|
+
function traverse(_fieldItem) {
|
|
20
|
+
return isArray(_fieldItem) && _fieldItem.some((_fieldItem2, idx, arr) => {
|
|
21
|
+
if (_fieldItem2 !== props.fieldItem)
|
|
22
|
+
return traverse(_fieldItem2.children);
|
|
23
|
+
!_fieldItem2.__new && materialList.value.push(_fieldItem2);
|
|
24
|
+
return arr.splice(idx, 1);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createBlock(unref(NButton), {
|
|
30
|
+
text: "",
|
|
31
|
+
class: "form-config__renderer--closeButton",
|
|
32
|
+
"text-color": "#a5a5a5",
|
|
33
|
+
onClick: withModifiers(remove, ["stop"])
|
|
34
|
+
}, {
|
|
35
|
+
icon: withCtx(() => [
|
|
36
|
+
createVNode(unref(NIcon), { component: unref(CloseCircle) }, null, 8, ["component"])
|
|
37
|
+
]),
|
|
38
|
+
_: 1
|
|
39
|
+
}, 8, ["onClick"]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var CloseButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "CloseButton.vue"]]);
|
|
44
|
+
|
|
45
|
+
export { CloseButton as default };
|