cnhis-design-vue 3.1.17-beta.3 → 3.1.17-beta.4
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/form-config/index.d.ts +8614 -7222
- package/es/packages/form-config/src/FormConfig.js +19 -16
- package/es/packages/form-config/src/FormConfig.vue.d.ts +8615 -7223
- package/es/packages/form-config/src/components/FormConfigDragDisplay.js +6 -7
- package/es/packages/form-config/src/components/FormConfigDragDisplay.vue.d.ts +2 -10
- 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/{CloseButton.js → renderer/CloseButton.js} +2 -2
- package/es/packages/form-config/src/components/{CloseButton.vue.d.ts → renderer/CloseButton.vue.d.ts} +1 -1
- package/es/packages/form-config/src/components/{ComplexNode.js → renderer/ComplexNode.js} +16 -17
- package/es/packages/form-config/src/components/{ComplexNode.vue.d.ts → renderer/ComplexNode.vue.d.ts} +5 -25
- 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/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.js +1 -2
- 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} +5 -5
- package/es/packages/form-config/src/utils/index.d.ts +0 -2
- package/es/packages/form-config/src/utils/index.js +2 -5
- package/es/packages/form-config/style/index.css +11 -17
- 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/index.css +11 -17
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +2 -1
- package/package.json +1 -1
- package/es/packages/form-config/src/components/DefaultNode.js +0 -54
- package/es/packages/form-config/src/components/DefaultNode.vue.d.ts +0 -1543
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isString, isArray, isFunction } from 'lodash-es';
|
|
2
2
|
import { computed } from 'vue';
|
|
3
|
-
import DefaultNode from '
|
|
4
|
-
import ComplexNode from '../components/ComplexNode.js';
|
|
3
|
+
import { DefaultNode, ComplexNode } from '../../../../packages/form-config/src/components';
|
|
5
4
|
|
|
6
5
|
function usePresetRenderer() {
|
|
7
6
|
const renderDefaultNode = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
2
|
+
export declare function useSortableConfig(): {
|
|
3
|
+
getCommonConfig: () => {
|
|
4
4
|
onMove: ({ to, from }: Sortable.SortableEvent) => void;
|
|
5
5
|
onChoose: ({ target, item }: Sortable.SortableEvent) => void;
|
|
6
6
|
onUnchoose: ({ from, to, target, item }: Sortable.SortableEvent) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function useSortableConfig() {
|
|
2
2
|
let timer = null;
|
|
3
3
|
function onChoose({ target, item }) {
|
|
4
4
|
timer = setTimeout(() => {
|
|
@@ -17,11 +17,11 @@ function useSortable() {
|
|
|
17
17
|
function onMove({ to, from }) {
|
|
18
18
|
prevTo == null ? void 0 : prevTo.classList.remove("is-choosing-area");
|
|
19
19
|
prevTo = to;
|
|
20
|
-
from.classList.remove("is-choosing-area");
|
|
20
|
+
to !== from && from.classList.remove("is-choosing-area");
|
|
21
21
|
to.classList.add("is-choosing-area");
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
return {
|
|
23
|
+
const getCommonConfig = () => ({ onMove, onChoose, onUnchoose, tag: "section", animation: "150", "item-key": "key" });
|
|
24
|
+
return { getCommonConfig };
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export {
|
|
27
|
+
export { useSortableConfig };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Func } from '../../../../../es/src/types';
|
|
2
1
|
import { FormConfigItem, FormConfigWidth } from '../../../../../es/packages/form-config';
|
|
3
2
|
export declare function layoutWidthEnum2Column(layoutWidthEnum: FormConfigWidth): number;
|
|
4
|
-
export declare function stopModifier(fn: Func): (event: Event, ...args: unknown[]) => any;
|
|
5
3
|
export declare function bindHover(fieldItem: FormConfigItem): {
|
|
6
4
|
onMouseenter: () => FormConfigItem;
|
|
7
5
|
onMouseleave: () => undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref
|
|
1
|
+
import { ref } from 'vue';
|
|
2
2
|
|
|
3
3
|
function layoutWidthEnum2Column(layoutWidthEnum) {
|
|
4
4
|
const transferMap = {
|
|
@@ -14,9 +14,6 @@ function layoutWidthEnum2Column(layoutWidthEnum) {
|
|
|
14
14
|
};
|
|
15
15
|
return transferMap[layoutWidthEnum] || 12;
|
|
16
16
|
}
|
|
17
|
-
function stopModifier(fn) {
|
|
18
|
-
return withModifiers(fn, ["stop"]);
|
|
19
|
-
}
|
|
20
17
|
const hovering = ref();
|
|
21
18
|
function bindHover(fieldItem) {
|
|
22
19
|
return {
|
|
@@ -26,4 +23,4 @@ function bindHover(fieldItem) {
|
|
|
26
23
|
};
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
export { bindHover, layoutWidthEnum2Column
|
|
26
|
+
export { bindHover, layoutWidthEnum2Column };
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
flex-shrink: 0;
|
|
9
9
|
width: 200px;
|
|
10
|
-
background: white;
|
|
11
10
|
}
|
|
12
11
|
.form-config__materialHeader {
|
|
13
12
|
display: flex;
|
|
@@ -27,13 +26,7 @@
|
|
|
27
26
|
gap: 8px;
|
|
28
27
|
}
|
|
29
28
|
.form-config__materialContentItem {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
padding: 8px;
|
|
33
29
|
cursor: move;
|
|
34
|
-
border: 1px dashed #d9d9d9;
|
|
35
|
-
box-sizing: border-box;
|
|
36
|
-
background-color: #fafafa;
|
|
37
30
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
38
31
|
}
|
|
39
32
|
.form-config__displayWrapper {
|
|
@@ -57,7 +50,6 @@
|
|
|
57
50
|
overflow-y: auto;
|
|
58
51
|
max-height: var(--max-height);
|
|
59
52
|
height: fit-content;
|
|
60
|
-
background: #eeeeee;
|
|
61
53
|
display: grid !important;
|
|
62
54
|
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
63
55
|
gap: 8px;
|
|
@@ -71,7 +63,6 @@
|
|
|
71
63
|
box-sizing: border-box;
|
|
72
64
|
flex-shrink: 0;
|
|
73
65
|
width: 240px;
|
|
74
|
-
background: white;
|
|
75
66
|
}
|
|
76
67
|
.form-config__configHeader {
|
|
77
68
|
display: flex;
|
|
@@ -88,17 +79,18 @@
|
|
|
88
79
|
}
|
|
89
80
|
.form-config__renderer {
|
|
90
81
|
cursor: move;
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
justify-content: flex-start;
|
|
91
85
|
}
|
|
92
86
|
.form-config__renderer--default {
|
|
87
|
+
width: 100%;
|
|
93
88
|
display: flex;
|
|
94
89
|
align-items: center;
|
|
95
90
|
padding: 8px;
|
|
96
|
-
border: 1px dashed #d9d9d9;
|
|
97
91
|
box-sizing: border-box;
|
|
98
|
-
background-color: #fafafa;
|
|
99
92
|
user-select: none;
|
|
100
93
|
position: relative;
|
|
101
|
-
width: 100%;
|
|
102
94
|
}
|
|
103
95
|
.form-config__renderer--complex {
|
|
104
96
|
border: 1px dashed skyblue;
|
|
@@ -122,7 +114,7 @@
|
|
|
122
114
|
display: flex;
|
|
123
115
|
}
|
|
124
116
|
.form-config .is-disabled {
|
|
125
|
-
background: #e5e5e5;
|
|
117
|
+
background: #e5e5e5 !important;
|
|
126
118
|
}
|
|
127
119
|
.form-config .is-required {
|
|
128
120
|
padding-left: 16px !important;
|
|
@@ -134,20 +126,22 @@
|
|
|
134
126
|
color: red;
|
|
135
127
|
}
|
|
136
128
|
.form-config .is-active {
|
|
137
|
-
color: #5585f5;
|
|
129
|
+
color: #5585f5 !important;
|
|
138
130
|
}
|
|
139
131
|
.form-config .is-choosing {
|
|
140
132
|
box-shadow: #5585f5 0 0 0 2px !important;
|
|
133
|
+
opacity: 0.7;
|
|
141
134
|
}
|
|
142
135
|
.form-config .is-choosing-area {
|
|
143
|
-
background:
|
|
136
|
+
background: rgba(128, 128, 128, 0.1);
|
|
144
137
|
}
|
|
145
|
-
.form-config [is-hovering='true']
|
|
138
|
+
.form-config [is-hovering='true'] .form-config__renderer--closeButton {
|
|
146
139
|
visibility: visible;
|
|
147
140
|
}
|
|
148
141
|
.form-config .form-config__renderer--closeButton {
|
|
149
142
|
position: absolute;
|
|
150
143
|
visibility: hidden;
|
|
151
|
-
top:
|
|
144
|
+
top: 50%;
|
|
145
|
+
transform: translateY(-50%);
|
|
152
146
|
right: 5px;
|
|
153
147
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, openBlock, createBlock, unref, withCtx, createElementBlock, createVNode, isRef, Fragment, renderList, createCommentVNode, createElementVNode, normalizeStyle,
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createBlock, unref, withCtx, createElementBlock, createVNode, isRef, Fragment, renderList, createCommentVNode, createElementVNode, normalizeStyle, toDisplayString, nextTick } from 'vue';
|
|
2
2
|
import { createForm, onFieldValueChange, isField } from '@formily/core';
|
|
3
3
|
import { FormProvider, FormConsumer } from '@formily/vue';
|
|
4
4
|
import { isObject } from '@vue/shared';
|
|
@@ -183,9 +183,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
183
183
|
}, [
|
|
184
184
|
createVNode(unref(FormProvider), { form: unref(formModel) }, {
|
|
185
185
|
default: withCtx(() => [
|
|
186
|
-
|
|
187
|
-
createVNode(unref(SchemaField), { schema: unref(parsedSchema) }, null, 8, ["schema"])
|
|
188
|
-
]),
|
|
186
|
+
createVNode(unref(SchemaField), { schema: unref(parsedSchema) }, null, 8, ["schema"]),
|
|
189
187
|
__props.consumer ? (openBlock(), createBlock(unref(FormConsumer), { key: 0 }, {
|
|
190
188
|
default: withCtx(({ form }) => [
|
|
191
189
|
createElementVNode("div", _hoisted_2, toDisplayString(JSON.stringify(form.values, null, 2)), 1)
|
|
@@ -193,14 +191,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
193
191
|
_: 1
|
|
194
192
|
})) : createCommentVNode("v-if", true)
|
|
195
193
|
]),
|
|
196
|
-
_:
|
|
194
|
+
_: 1
|
|
197
195
|
}, 8, ["form"])
|
|
198
196
|
], 36)
|
|
199
197
|
]),
|
|
200
|
-
_:
|
|
198
|
+
_: 1
|
|
201
199
|
}, 8, ["theme-overrides"])
|
|
202
200
|
]),
|
|
203
|
-
_:
|
|
201
|
+
_: 1
|
|
204
202
|
});
|
|
205
203
|
};
|
|
206
204
|
}
|
|
@@ -228,8 +228,7 @@ function useFieldListAdaptor(collector) {
|
|
|
228
228
|
return fin;
|
|
229
229
|
}, {});
|
|
230
230
|
function bindIndex(schema, idx) {
|
|
231
|
-
schema
|
|
232
|
-
return schema;
|
|
231
|
+
return { ...schema, "x-index": idx };
|
|
233
232
|
}
|
|
234
233
|
function createFieldName(fieldItem) {
|
|
235
234
|
if (fieldItem.suffixConfig) {
|
|
@@ -28,10 +28,7 @@ function useFormContext(props, formModel) {
|
|
|
28
28
|
}
|
|
29
29
|
}));
|
|
30
30
|
const SchemaField = injectOrProvide(InjectionSchemaField, () => createSchemaField({
|
|
31
|
-
components: {
|
|
32
|
-
...components,
|
|
33
|
-
...props.components
|
|
34
|
-
},
|
|
31
|
+
components: { ...components, ...props.components },
|
|
35
32
|
scope: Object.assign({}, usePresetScope(), props.scope)
|
|
36
33
|
}).SchemaField);
|
|
37
34
|
const businessCollector = useBusinessBinding().create(formModel, props.businessFormatter);
|
|
@@ -3,6 +3,7 @@ import { DependKeyType } from '../../../../../es/packages/form-render';
|
|
|
3
3
|
export declare class FormItemDepsCollector {
|
|
4
4
|
private readonly collector;
|
|
5
5
|
setDeps(key: string, dependKeys: DependKeyType, callback: Func): void;
|
|
6
|
+
getDeps(dependKey: string): Map<string, Func<any[], any>> | undefined;
|
|
6
7
|
trigger(dependKey: string, payload?: unknown): void;
|
|
7
8
|
}
|
|
8
9
|
export declare function useFormItemDeps(): {
|
|
@@ -12,9 +12,12 @@ class FormItemDepsCollector {
|
|
|
12
12
|
this.collector.set(dependKey, map);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
getDeps(dependKey) {
|
|
16
|
+
return this.collector.get(dependKey);
|
|
17
|
+
}
|
|
15
18
|
trigger(dependKey, payload) {
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = this.getDeps(dependKey)) == null ? void 0 : _a.forEach((cb) => isFunction(cb) && cb(payload));
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
function useFormItemDeps() {
|
|
@@ -4,7 +4,7 @@ import { isObject } from '@vue/shared';
|
|
|
4
4
|
import { isNumber, isString, isFunction } from 'lodash-es';
|
|
5
5
|
export { isIdCard, isMobile, parseAge2Birthday, parseAge2FromContext, parseBirthday, parseIdCard, transformDateFormat } from './business.js';
|
|
6
6
|
export { queryDecorator, queryInput } from './dom.js';
|
|
7
|
-
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey,
|
|
7
|
+
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema } from './schema.js';
|
|
8
8
|
|
|
9
9
|
function formRenderLog(message, type = "log") {
|
|
10
10
|
console[type](`[FormRender]: ${message}`);
|
|
@@ -13,7 +13,6 @@ export declare function getParentLinebar(key: string, fieldList: FieldItem[]): s
|
|
|
13
13
|
export declare function assignUpdateValue(props: AnyObject, field: GeneralField): {
|
|
14
14
|
[x: string]: any;
|
|
15
15
|
};
|
|
16
|
-
export declare function traverseFieldList(fieldList: FieldItem[], handler: (field: FieldItem) => void): void;
|
|
17
16
|
export declare function createObjSchema(properties: Record<string, ISchema>): {
|
|
18
17
|
type: string;
|
|
19
18
|
properties: Record<string, import("@formily/json-schema/esm/types").Stringify<{
|
|
@@ -79,19 +79,8 @@ function assignUpdateValue(props, field) {
|
|
|
79
79
|
}
|
|
80
80
|
return _props;
|
|
81
81
|
}
|
|
82
|
-
function traverseFieldList(fieldList, handler) {
|
|
83
|
-
function traverse(fieldList2) {
|
|
84
|
-
if (!isArray(fieldList2))
|
|
85
|
-
return;
|
|
86
|
-
fieldList2.forEach((field) => {
|
|
87
|
-
handler(field);
|
|
88
|
-
traverse(field.properties);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
traverse(fieldList);
|
|
92
|
-
}
|
|
93
82
|
function createObjSchema(properties) {
|
|
94
83
|
return { type: "object", properties };
|
|
95
84
|
}
|
|
96
85
|
|
|
97
|
-
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey,
|
|
86
|
+
export { assignUpdateValue, createLinebarId, createObjSchema, elementIdEscape, fieldKeyEscape, getParentLinebar, traverseDependKey, traverseSchema };
|
package/es/packages/index.css
CHANGED
|
@@ -3189,7 +3189,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3189
3189
|
box-sizing: border-box;
|
|
3190
3190
|
flex-shrink: 0;
|
|
3191
3191
|
width: 200px;
|
|
3192
|
-
background: white;
|
|
3193
3192
|
}
|
|
3194
3193
|
.form-config__materialHeader {
|
|
3195
3194
|
display: flex;
|
|
@@ -3209,13 +3208,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3209
3208
|
gap: 8px;
|
|
3210
3209
|
}
|
|
3211
3210
|
.form-config__materialContentItem {
|
|
3212
|
-
display: flex;
|
|
3213
|
-
align-items: center;
|
|
3214
|
-
padding: 8px;
|
|
3215
3211
|
cursor: move;
|
|
3216
|
-
border: 1px dashed #d9d9d9;
|
|
3217
|
-
box-sizing: border-box;
|
|
3218
|
-
background-color: #fafafa;
|
|
3219
3212
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
3220
3213
|
}
|
|
3221
3214
|
.form-config__displayWrapper {
|
|
@@ -3239,7 +3232,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3239
3232
|
overflow-y: auto;
|
|
3240
3233
|
max-height: var(--max-height);
|
|
3241
3234
|
height: fit-content;
|
|
3242
|
-
background: #eeeeee;
|
|
3243
3235
|
display: grid !important;
|
|
3244
3236
|
grid-template-columns: repeat(24, minmax(0px, 1fr));
|
|
3245
3237
|
gap: 8px;
|
|
@@ -3253,7 +3245,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3253
3245
|
box-sizing: border-box;
|
|
3254
3246
|
flex-shrink: 0;
|
|
3255
3247
|
width: 240px;
|
|
3256
|
-
background: white;
|
|
3257
3248
|
}
|
|
3258
3249
|
.form-config__configHeader {
|
|
3259
3250
|
display: flex;
|
|
@@ -3270,17 +3261,18 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3270
3261
|
}
|
|
3271
3262
|
.form-config__renderer {
|
|
3272
3263
|
cursor: move;
|
|
3264
|
+
width: 100%;
|
|
3265
|
+
height: 100%;
|
|
3266
|
+
justify-content: flex-start;
|
|
3273
3267
|
}
|
|
3274
3268
|
.form-config__renderer--default {
|
|
3269
|
+
width: 100%;
|
|
3275
3270
|
display: flex;
|
|
3276
3271
|
align-items: center;
|
|
3277
3272
|
padding: 8px;
|
|
3278
|
-
border: 1px dashed #d9d9d9;
|
|
3279
3273
|
box-sizing: border-box;
|
|
3280
|
-
background-color: #fafafa;
|
|
3281
3274
|
user-select: none;
|
|
3282
3275
|
position: relative;
|
|
3283
|
-
width: 100%;
|
|
3284
3276
|
}
|
|
3285
3277
|
.form-config__renderer--complex {
|
|
3286
3278
|
border: 1px dashed skyblue;
|
|
@@ -3304,7 +3296,7 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3304
3296
|
display: flex;
|
|
3305
3297
|
}
|
|
3306
3298
|
.form-config .is-disabled {
|
|
3307
|
-
background: #e5e5e5;
|
|
3299
|
+
background: #e5e5e5 !important;
|
|
3308
3300
|
}
|
|
3309
3301
|
.form-config .is-required {
|
|
3310
3302
|
padding-left: 16px !important;
|
|
@@ -3316,20 +3308,22 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
3316
3308
|
color: red;
|
|
3317
3309
|
}
|
|
3318
3310
|
.form-config .is-active {
|
|
3319
|
-
color: #5585f5;
|
|
3311
|
+
color: #5585f5 !important;
|
|
3320
3312
|
}
|
|
3321
3313
|
.form-config .is-choosing {
|
|
3322
3314
|
box-shadow: #5585f5 0 0 0 2px !important;
|
|
3315
|
+
opacity: 0.7;
|
|
3323
3316
|
}
|
|
3324
3317
|
.form-config .is-choosing-area {
|
|
3325
|
-
background:
|
|
3318
|
+
background: rgba(128, 128, 128, 0.1);
|
|
3326
3319
|
}
|
|
3327
|
-
.form-config [is-hovering='true']
|
|
3320
|
+
.form-config [is-hovering='true'] .form-config__renderer--closeButton {
|
|
3328
3321
|
visibility: visible;
|
|
3329
3322
|
}
|
|
3330
3323
|
.form-config .form-config__renderer--closeButton {
|
|
3331
3324
|
position: absolute;
|
|
3332
3325
|
visibility: hidden;
|
|
3333
|
-
top:
|
|
3326
|
+
top: 50%;
|
|
3327
|
+
transform: translateY(-50%);
|
|
3334
3328
|
right: 5px;
|
|
3335
3329
|
}
|
|
@@ -44,7 +44,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
placeholder: shortcut.placeholder,
|
|
45
45
|
operation: shortcut.operation
|
|
46
46
|
},
|
|
47
|
-
elem_width:
|
|
47
|
+
elem_width: 6
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
key.value++;
|
|
@@ -83,6 +83,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
83
83
|
});
|
|
84
84
|
return (_ctx, _cache) => {
|
|
85
85
|
return openBlock(), createBlock(unref(FormRender), {
|
|
86
|
+
column: 12,
|
|
86
87
|
key: key.value,
|
|
87
88
|
"label-placement": "left",
|
|
88
89
|
"field-list": fieldList.value,
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineComponent, inject, computed, resolveComponent, openBlock, createElementBlock, mergeProps, unref, withModifiers, createVNode, normalizeClass, withCtx, createTextVNode, toDisplayString } from 'vue';
|
|
2
|
-
import { InjectionActiveFieldItem, WidgetTextMap } from '../../../../packages/form-config/src/constants';
|
|
3
|
-
import { bindHover } from '../../../../packages/form-config/src/utils';
|
|
4
|
-
import CloseButton from '../../../../packages/form-config/src/components/CloseButton';
|
|
5
|
-
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.js';
|
|
6
|
-
|
|
7
|
-
const _hoisted_1 = ["onClick"];
|
|
8
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "DefaultNode",
|
|
10
|
-
props: {
|
|
11
|
-
fieldItem: { type: Object, required: true },
|
|
12
|
-
textFormatter: { type: Function, required: true }
|
|
13
|
-
},
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const props = __props;
|
|
16
|
-
const currentActiveEditField = inject(InjectionActiveFieldItem);
|
|
17
|
-
function active() {
|
|
18
|
-
currentActiveEditField.value = props.fieldItem;
|
|
19
|
-
}
|
|
20
|
-
const classList = computed(() => {
|
|
21
|
-
return [{ "is-active": currentActiveEditField.value === props.fieldItem }, "form-config__renderer"];
|
|
22
|
-
});
|
|
23
|
-
const ellipsisClassList = computed(() => {
|
|
24
|
-
return [
|
|
25
|
-
"form-config__renderer--default",
|
|
26
|
-
{ "is-required": props.fieldItem.required, "is-disabled": props.fieldItem.editable === false }
|
|
27
|
-
];
|
|
28
|
-
});
|
|
29
|
-
function getDisplayText() {
|
|
30
|
-
const type = WidgetTextMap.get(props.fieldItem.type);
|
|
31
|
-
return props.textFormatter(props.fieldItem, `${props.fieldItem.name}${type ? `(${type})` : ""}`);
|
|
32
|
-
}
|
|
33
|
-
return (_ctx, _cache) => {
|
|
34
|
-
const _component_n_ellipsis = resolveComponent("n-ellipsis");
|
|
35
|
-
return openBlock(), createElementBlock("section", mergeProps(unref(bindHover)(__props.fieldItem), {
|
|
36
|
-
onClick: withModifiers(active, ["stop"]),
|
|
37
|
-
class: unref(classList)
|
|
38
|
-
}), [
|
|
39
|
-
createVNode(_component_n_ellipsis, {
|
|
40
|
-
class: normalizeClass(unref(ellipsisClassList))
|
|
41
|
-
}, {
|
|
42
|
-
default: withCtx(() => [
|
|
43
|
-
createTextVNode(toDisplayString(getDisplayText()), 1)
|
|
44
|
-
]),
|
|
45
|
-
_: 1
|
|
46
|
-
}, 8, ["class"]),
|
|
47
|
-
createVNode(CloseButton, { "field-item": __props.fieldItem }, null, 8, ["field-item"])
|
|
48
|
-
], 16, _hoisted_1);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
var DefaultNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "DefaultNode.vue"]]);
|
|
53
|
-
|
|
54
|
-
export { DefaultNode as default };
|