@kp-ui/lowcode 2.15.0-alpha.5 → 2.15.0-alpha.6
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/package.json +1 -1
- package/src/components/FormRender/index.vue2.js +24 -22
- package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue2.js +19 -19
- package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue2.js +16 -16
- package/src/components/form-designer/index.vue.js +24 -22
- package/src/components/form-designer/index.vue2.js +38 -33
- package/src/components/form-designer/setting-panel/index.vue2.js +18 -18
- package/src/components/form-render/container-items/grid-col-widget.vue2.js +9 -9
- package/stats.html +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, computed as j, ref as n, getCurrentInstance as x, onMounted as L, watch as O } from "vue";
|
|
2
2
|
import v from "../form-render/dynamic-dialog.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { storeToRefs as
|
|
7
|
-
import { useLocaleStore as
|
|
8
|
-
import { getLocat as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
3
|
+
import R from "./FormContainer.js";
|
|
4
|
+
import { useFormContext as S } from "./useFormContext.js";
|
|
5
|
+
import { useI18n as h } from "../../utils/i18n.js";
|
|
6
|
+
import { storeToRefs as B } from "pinia";
|
|
7
|
+
import { useLocaleStore as J } from "@kp-ui/i18n";
|
|
8
|
+
import { getLocat as N } from "@kp-ui/tool";
|
|
9
|
+
import V from "./Debugger.vue.js";
|
|
10
|
+
const G = /* @__PURE__ */ D({
|
|
11
11
|
name: "VFormRender",
|
|
12
12
|
componentName: "VFormRender",
|
|
13
13
|
__name: "index",
|
|
@@ -24,14 +24,14 @@ const E = /* @__PURE__ */ F({
|
|
|
24
24
|
debug: { type: Boolean, required: !1 }
|
|
25
25
|
},
|
|
26
26
|
emits: ["form-submit", "form-cancel"],
|
|
27
|
-
setup(
|
|
28
|
-
const { initLocale: a } =
|
|
27
|
+
setup(u, { expose: d, emit: c }) {
|
|
28
|
+
const { initLocale: a } = h(), i = J(), { locale: t } = B(i), p = j(() => N().debug === "1"), g = n(!1), b = x(), o = u, r = n(), y = n(), m = c, e = S({
|
|
29
29
|
props: o,
|
|
30
30
|
renderForm: r
|
|
31
|
-
}),
|
|
32
|
-
|
|
31
|
+
}), C = (F) => {
|
|
32
|
+
m("form-submit", F);
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
L(() => {
|
|
35
35
|
e.registerToRefList("v_form_ref");
|
|
36
36
|
}), O(
|
|
37
37
|
t,
|
|
@@ -42,19 +42,21 @@ const E = /* @__PURE__ */ F({
|
|
|
42
42
|
immediate: !0
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const s = () => {
|
|
46
|
+
}, { dynamicDialgRef: _, dialogProps: q, emitter: f } = e;
|
|
47
|
+
d({
|
|
48
|
+
...f,
|
|
48
49
|
...e,
|
|
50
|
+
setLoading: s,
|
|
49
51
|
formJson: o.formJson,
|
|
50
52
|
renderForm: r
|
|
51
53
|
});
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
}, Debugger:
|
|
55
|
-
return Object.defineProperty(
|
|
54
|
+
const l = { initLocale: a, localeStore: i, locale: t, debug: p, debugVisible: g, instance: b, props: o, renderForm: r, formContainer: y, emit: m, formContext: e, handleFormSubmit: C, setLoading: s, dynamicDialgRef: _, dialogProps: q, emitter: f, DynamicDialog: v, get FormContainer() {
|
|
55
|
+
return R;
|
|
56
|
+
}, Debugger: V };
|
|
57
|
+
return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
|
|
56
58
|
}
|
|
57
59
|
});
|
|
58
60
|
export {
|
|
59
|
-
|
|
61
|
+
G as default
|
|
60
62
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useContainerWidget as
|
|
6
|
-
import { useAppRef as
|
|
7
|
-
import { ComponentNameEnum as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as c, computed as g, ref as y } from "vue";
|
|
2
|
+
import { useI18n as b } from "../../../../utils/i18n.js";
|
|
3
|
+
import _ from "../RenderDesignerWigetList.vue.js";
|
|
4
|
+
import h from "../widgetAction.vue.js";
|
|
5
|
+
import { useContainerWidget as C } from "./useContainerWidget.js";
|
|
6
|
+
import { useAppRef as q } from "../../useAppRef.js";
|
|
7
|
+
import { ComponentNameEnum as w, ContainerTypeEnum as W } from "../../../../constants/WidgetTypeEnum.js";
|
|
8
|
+
const H = /* @__PURE__ */ c({
|
|
9
9
|
name: W.GridColWidget,
|
|
10
|
-
componentName:
|
|
10
|
+
componentName: w.ContainerWidget,
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "grid-col-widget",
|
|
13
13
|
props: {
|
|
14
|
-
widget: { type:
|
|
15
|
-
field: { type:
|
|
16
|
-
parentWidget: { type: null, required: !0 },
|
|
14
|
+
widget: { type: Object, required: !0 },
|
|
15
|
+
field: { type: Object, required: !0 },
|
|
16
|
+
parentWidget: { type: [Object, null], required: !0 },
|
|
17
17
|
parentList: { type: Array, required: !0 },
|
|
18
18
|
indexOfParentList: { type: Number, required: !1 },
|
|
19
19
|
subFormRowIndex: { type: Number, required: !1 },
|
|
@@ -22,24 +22,24 @@ const D = /* @__PURE__ */ g({
|
|
|
22
22
|
},
|
|
23
23
|
setup(i, { expose: o }) {
|
|
24
24
|
o();
|
|
25
|
-
const e = i, { i18nt: n } =
|
|
25
|
+
const e = i, { i18nt: n } = b(), {
|
|
26
26
|
designState: s,
|
|
27
27
|
selected: p,
|
|
28
28
|
selectWidget: u,
|
|
29
29
|
customClass: d,
|
|
30
|
-
onContainerDragAdd:
|
|
31
|
-
onContainerDragUpdate:
|
|
32
|
-
} =
|
|
30
|
+
onContainerDragAdd: a,
|
|
31
|
+
onContainerDragUpdate: l
|
|
32
|
+
} = C(e), m = g(() => e.colHeight ? { height: e.colHeight } : {}), f = y({
|
|
33
33
|
span: e.widget.options.span || 12,
|
|
34
34
|
offset: e.widget.options.offset || 0,
|
|
35
35
|
push: e.widget.options.push || 0,
|
|
36
36
|
pull: e.widget.options.pull || 0
|
|
37
|
-
}), { initRefList: t } =
|
|
37
|
+
}), { initRefList: t } = q(e);
|
|
38
38
|
t();
|
|
39
|
-
const r = { props: e, i18nt: n, designState: s, selected: p, selectWidget: u, customClass: d, onContainerDragAdd:
|
|
39
|
+
const r = { props: e, i18nt: n, designState: s, selected: p, selectWidget: u, customClass: d, onContainerDragAdd: a, onContainerDragUpdate: l, colHeightStyle: m, layoutProps: f, initRefList: t, RenderDesignerWigetList: _, WidgetAction: h };
|
|
40
40
|
return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
H as default
|
|
45
45
|
};
|
|
@@ -3,13 +3,13 @@ import { useEmitter as q } from "../../../../utils/useEmitter.js";
|
|
|
3
3
|
import F from "./form-item-wrapper.vue.js";
|
|
4
4
|
import { useField as x } from "./useField.js";
|
|
5
5
|
import { ComponentNameEnum as N, WidgetTypeEnum as h } from "../../../../constants/WidgetTypeEnum.js";
|
|
6
|
-
const
|
|
6
|
+
const j = /* @__PURE__ */ _({
|
|
7
7
|
name: h.textarea,
|
|
8
8
|
componentName: N.FieldWidget,
|
|
9
9
|
__name: "textarea-widget",
|
|
10
10
|
props: {
|
|
11
|
-
widget: { type:
|
|
12
|
-
field: { type:
|
|
11
|
+
widget: { type: Object, required: !0 },
|
|
12
|
+
field: { type: Object, required: !0 },
|
|
13
13
|
designer: { type: null, required: !1 },
|
|
14
14
|
parentWidget: { type: [Object, null], required: !1 },
|
|
15
15
|
parentList: { type: [Array, null], required: !1 },
|
|
@@ -19,32 +19,32 @@ const I = /* @__PURE__ */ _({
|
|
|
19
19
|
subFormColIndex: { type: Number, required: !1 }
|
|
20
20
|
},
|
|
21
21
|
setup(u, { expose: s }) {
|
|
22
|
-
const { dispatch:
|
|
23
|
-
rules:
|
|
22
|
+
const { dispatch: a } = q(), e = u, {
|
|
23
|
+
rules: m,
|
|
24
24
|
i18nt: r,
|
|
25
25
|
field: t,
|
|
26
26
|
fieldModel: i,
|
|
27
|
-
isReadMode:
|
|
28
|
-
size:
|
|
27
|
+
isReadMode: p,
|
|
28
|
+
size: l,
|
|
29
29
|
handleHidden: f,
|
|
30
30
|
handleDisabled: c,
|
|
31
|
-
handleFocusCustomEvent:
|
|
32
|
-
handleBlurCustomEvent:
|
|
33
|
-
getWidgetRef:
|
|
34
|
-
getFormRef:
|
|
35
|
-
getPropName:
|
|
31
|
+
handleFocusCustomEvent: b,
|
|
32
|
+
handleBlurCustomEvent: y,
|
|
33
|
+
getWidgetRef: d,
|
|
34
|
+
getFormRef: n,
|
|
35
|
+
getPropName: g
|
|
36
36
|
} = x(e);
|
|
37
37
|
s({
|
|
38
38
|
i18nt: r,
|
|
39
39
|
field: t,
|
|
40
40
|
fieldModel: i,
|
|
41
|
-
getFormRef:
|
|
42
|
-
getWidgetRef:
|
|
41
|
+
getFormRef: n,
|
|
42
|
+
getWidgetRef: d
|
|
43
43
|
});
|
|
44
|
-
const o = { dispatch:
|
|
44
|
+
const o = { dispatch: a, props: e, rules: m, i18nt: r, field: t, fieldModel: i, isReadMode: p, size: l, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: b, handleBlurCustomEvent: y, getWidgetRef: d, getFormRef: n, getPropName: g, FormItemWrapper: F };
|
|
45
45
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
j as default
|
|
50
50
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
1
|
+
import _ from "./index.vue2.js";
|
|
2
|
+
import { resolveComponent as d, resolveDirective as h, createBlock as v, openBlock as W, withCtx as o, createVNode as t, createSlots as b, renderList as u, renderSlot as w, createElementVNode as y, withDirectives as x } from "vue";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const r =
|
|
8
|
-
return
|
|
4
|
+
import D from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const C = { class: "container-scroll-bar" };
|
|
6
|
+
function U(a, i, n, e, k, p) {
|
|
7
|
+
const r = d("a-layout-sider"), c = d("a-layout-header"), s = d("a-layout-content"), f = d("a-layout"), m = h("loading");
|
|
8
|
+
return W(), v(f, { class: "main-container full-height" }, {
|
|
9
9
|
default: o(() => [
|
|
10
10
|
t(f, null, {
|
|
11
11
|
default: o(() => [
|
|
@@ -24,21 +24,21 @@ function x(a, l, d, e, p, C) {
|
|
|
24
24
|
t(c, { class: "toolbar-header" }, {
|
|
25
25
|
default: o(() => [
|
|
26
26
|
t(e.ToolbarPanel, {
|
|
27
|
-
saveJsonApi:
|
|
28
|
-
"global-dsv":
|
|
27
|
+
saveJsonApi: n.saveJsonApi,
|
|
28
|
+
"global-dsv": n.globalDsv,
|
|
29
29
|
leftWidth: e.leftWidth,
|
|
30
|
-
"onUpdate:leftWidth":
|
|
30
|
+
"onUpdate:leftWidth": i[0] || (i[0] = (l) => e.leftWidth = l),
|
|
31
31
|
rightWidth: e.rightWidth,
|
|
32
|
-
"onUpdate:rightWidth":
|
|
32
|
+
"onUpdate:rightWidth": i[1] || (i[1] = (l) => e.rightWidth = l),
|
|
33
33
|
ref: "toolbarRef"
|
|
34
|
-
},
|
|
34
|
+
}, b({
|
|
35
35
|
_: 2
|
|
36
36
|
/* DYNAMIC */
|
|
37
37
|
}, [
|
|
38
|
-
|
|
38
|
+
u(a.$slots, (l, g) => ({
|
|
39
39
|
name: g,
|
|
40
40
|
fn: o(() => [
|
|
41
|
-
|
|
41
|
+
w(a.$slots, g)
|
|
42
42
|
])
|
|
43
43
|
}))
|
|
44
44
|
]), 1032, ["saveJsonApi", "global-dsv", "leftWidth", "rightWidth"])
|
|
@@ -48,12 +48,14 @@ function x(a, l, d, e, p, C) {
|
|
|
48
48
|
}),
|
|
49
49
|
t(s, { class: "form-widget-main" }, {
|
|
50
50
|
default: o(() => [
|
|
51
|
-
|
|
52
|
-
t(e.VFormWidget, {
|
|
53
|
-
"global-dsv":
|
|
51
|
+
y("div", C, [
|
|
52
|
+
x(t(e.VFormWidget, {
|
|
53
|
+
"global-dsv": n.globalDsv,
|
|
54
54
|
"form-config": e.designer.formConfig,
|
|
55
55
|
ref: "formRef"
|
|
56
|
-
}, null, 8, ["global-dsv", "form-config"])
|
|
56
|
+
}, null, 8, ["global-dsv", "form-config"]), [
|
|
57
|
+
[m, e.isLoading]
|
|
58
|
+
])
|
|
57
59
|
])
|
|
58
60
|
]),
|
|
59
61
|
_: 1
|
|
@@ -67,8 +69,8 @@ function x(a, l, d, e, p, C) {
|
|
|
67
69
|
default: o(() => [
|
|
68
70
|
t(e.SettingPanel, {
|
|
69
71
|
"selected-widget": e.designer.selectedWidget,
|
|
70
|
-
"onUpdate:selectedWidget":
|
|
71
|
-
"global-dsv":
|
|
72
|
+
"onUpdate:selectedWidget": i[2] || (i[2] = (l) => e.designer.selectedWidget = l),
|
|
73
|
+
"global-dsv": n.globalDsv,
|
|
72
74
|
"form-config": e.designer.formConfig
|
|
73
75
|
}, null, 8, ["selected-widget", "global-dsv", "form-config"])
|
|
74
76
|
]),
|
|
@@ -84,7 +86,7 @@ function x(a, l, d, e, p, C) {
|
|
|
84
86
|
/* FORWARDED */
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
|
-
const
|
|
89
|
+
const V = /* @__PURE__ */ D(_, [["render", U], ["__file", "/Users/zhaopeng/dev/kunpeng/tmgc2-web-vfrom/src/components/form-designer/index.vue"]]);
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
V as default
|
|
90
92
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createDesigner as
|
|
7
|
-
import { useLocaleStore as
|
|
8
|
-
import { deepClone as
|
|
9
|
-
import { isEmpty as
|
|
10
|
-
import { useI18n as
|
|
11
|
-
import { message as
|
|
12
|
-
import { storeToRefs as
|
|
13
|
-
|
|
1
|
+
import { defineComponent as P, ref as o, provide as i, getCurrentInstance as E, computed as I, watch as N, onMounted as V } from "vue";
|
|
2
|
+
import j from "./widget-panel/index.vue.js";
|
|
3
|
+
import H from "./toolbar-panel/index.vue.js";
|
|
4
|
+
import O from "./setting-panel/index.vue.js";
|
|
5
|
+
import T from "./form-widget/index.vue.js";
|
|
6
|
+
import { createDesigner as M } from "./designer.js";
|
|
7
|
+
import { useLocaleStore as k } from "@kp-ui/i18n";
|
|
8
|
+
import { deepClone as w, getAllFieldWidgets as S, getAllContainerWidgets as D } from "../../utils/util.js";
|
|
9
|
+
import { isEmpty as J } from "lodash-es";
|
|
10
|
+
import { useI18n as A } from "../../utils/i18n.js";
|
|
11
|
+
import { message as R } from "ant-design-vue";
|
|
12
|
+
import { storeToRefs as z } from "pinia";
|
|
13
|
+
import { useRef as G } from "tmgc2-share";
|
|
14
|
+
const se = /* @__PURE__ */ P({
|
|
14
15
|
name: "VFormDesigner",
|
|
15
16
|
componentName: "VFormDesigner",
|
|
16
17
|
__name: "index",
|
|
17
18
|
props: {
|
|
18
19
|
saveJsonApi: { type: Function, required: !0 },
|
|
19
20
|
fieldListApi: { type: Function, required: !0 },
|
|
20
|
-
designerConfig: { type: Object, required: !
|
|
21
|
+
designerConfig: { type: Object, required: !1, default: () => ({
|
|
21
22
|
eventCollapse: !0,
|
|
22
23
|
//是否显示组件事件属性折叠面板
|
|
23
24
|
widgetNameReadonly: !1,
|
|
@@ -31,47 +32,51 @@ const re = /* @__PURE__ */ x({
|
|
|
31
32
|
exportJsonButton: !0
|
|
32
33
|
//是否显示导出JSON器按钮
|
|
33
34
|
}) },
|
|
34
|
-
globalDsv: { type: Object, required: !
|
|
35
|
+
globalDsv: { type: Object, required: !1, default: () => ({}) }
|
|
35
36
|
},
|
|
36
|
-
setup(
|
|
37
|
-
const l = o(), { i18nt:
|
|
37
|
+
setup(b, { expose: q }) {
|
|
38
|
+
const l = o(), { i18nt: f } = A(), u = k(), { locale: s } = z(u), n = b;
|
|
38
39
|
i("serverFieldList", () => a.value), i("designState", !0);
|
|
39
|
-
const
|
|
40
|
+
const x = o(270), B = o(300), a = o([]), { initLocale: m } = A(), d = E(), t = o(M(d)), g = I(() => t.value.formConfig);
|
|
40
41
|
i("formConfig", g), i("designer", t), i("getDesignerConfig", () => n.designerConfig);
|
|
41
42
|
const c = (e) => {
|
|
42
|
-
if (!
|
|
43
|
+
if (!J(e))
|
|
43
44
|
try {
|
|
44
45
|
if (!e || !e.formConfig)
|
|
45
|
-
throw new Error(
|
|
46
|
+
throw new Error(f("designer.hint.invalidJsonFormat"));
|
|
46
47
|
t.value.loadFormJson(e), t.value.emitHistoryChange(), t.value.emitEvent("form-json-imported", []);
|
|
47
48
|
} catch (r) {
|
|
48
|
-
|
|
49
|
+
R.error(r + "");
|
|
49
50
|
}
|
|
50
51
|
}, p = async () => {
|
|
51
52
|
n.fieldListApi && (a.value = await n.fieldListApi());
|
|
52
53
|
}, v = (e) => {
|
|
53
|
-
if (!
|
|
54
|
+
if (!J(e))
|
|
54
55
|
try {
|
|
55
56
|
let r = !1;
|
|
56
57
|
typeof e == "string" ? r = t.value.loadFormJson(JSON.parse(e)) : e.constructor === Object && (r = t.value.loadFormJson(e)), r && t.value.emitHistoryChange();
|
|
57
58
|
} catch (r) {
|
|
58
|
-
|
|
59
|
+
R.error(r + "");
|
|
59
60
|
}
|
|
60
61
|
}, F = () => ({
|
|
61
|
-
widgetList:
|
|
62
|
-
formConfig:
|
|
63
|
-
}), C = (e = []) => e.length ?
|
|
64
|
-
|
|
62
|
+
widgetList: w(t.value.widgetList),
|
|
63
|
+
formConfig: w(t.value.formConfig)
|
|
64
|
+
}), C = (e = []) => e.length ? S(e) : S(t.value.widgetList), y = (e = []) => e.length ? D(e) : D(t.value.widgetList), h = (e, r = !1) => l.value.getWidgetRef(e, r);
|
|
65
|
+
N(
|
|
65
66
|
s,
|
|
66
67
|
() => {
|
|
67
|
-
|
|
68
|
+
m(s.value);
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
immediate: !0
|
|
71
72
|
}
|
|
72
|
-
)
|
|
73
|
+
);
|
|
74
|
+
const [L, W] = G(!1);
|
|
75
|
+
V(() => {
|
|
73
76
|
t.value.initDesigner(), p();
|
|
74
|
-
}),
|
|
77
|
+
}), q({
|
|
78
|
+
isLoading: L,
|
|
79
|
+
setLoading: W,
|
|
75
80
|
getWidgetRef: h,
|
|
76
81
|
getContainerWidgets: y,
|
|
77
82
|
getFieldWidgets: C,
|
|
@@ -79,10 +84,10 @@ const re = /* @__PURE__ */ x({
|
|
|
79
84
|
setFormJson: v,
|
|
80
85
|
setJsonImport: c
|
|
81
86
|
});
|
|
82
|
-
const
|
|
83
|
-
return Object.defineProperty(
|
|
87
|
+
const _ = { formRef: l, i18nt: f, localeStore: u, locale: s, props: n, leftWidth: x, rightWidth: B, fieldList: a, initLocale: m, instance: d, designer: t, formConfig: g, setJsonImport: c, loadFieldListFromServer: p, setFormJson: v, getFormJson: F, getFieldWidgets: C, getContainerWidgets: y, getWidgetRef: h, isLoading: L, setLoading: W, WidgetPanel: j, ToolbarPanel: H, SettingPanel: O, VFormWidget: T };
|
|
88
|
+
return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
91
|
export {
|
|
87
|
-
|
|
92
|
+
se as default
|
|
88
93
|
};
|
|
@@ -18,12 +18,12 @@ const be = /* @__PURE__ */ B({
|
|
|
18
18
|
props: /* @__PURE__ */ z({
|
|
19
19
|
globalDsv: { type: Object, required: !1 }
|
|
20
20
|
}, {
|
|
21
|
-
"selected-widget": { type: Object, default: () => ({}) },
|
|
21
|
+
"selected-widget": { type: [Object, null], required: !0, default: () => ({}) },
|
|
22
22
|
"selected-widgetModifiers": {}
|
|
23
23
|
}),
|
|
24
24
|
emits: ["update:selected-widget"],
|
|
25
25
|
setup($, { expose: A }) {
|
|
26
|
-
const { formConfig: S, designer: a } = ae(), { i18nt:
|
|
26
|
+
const { formConfig: S, designer: a } = ae(), { i18nt: u } = re(), { COMMON_PROPERTIES: H, ADVANCED_PROPERTIES: M, EVENT_PROPERTIES: T } = se, _ = $, v = oe(), F = _.globalDsv || {}, N = G("getDesignerConfig"), C = i(!1);
|
|
27
27
|
Q("isSubFormChildWidget", () => C.value);
|
|
28
28
|
const P = i(), k = i(), p = i("javascript"), R = i("2"), J = i(["1", "2", "3"]), s = i(""), g = i(""), b = i(""), o = U($, "selected-widget"), I = E(() => N()), l = E({
|
|
29
29
|
get() {
|
|
@@ -41,22 +41,22 @@ const be = /* @__PURE__ */ B({
|
|
|
41
41
|
), m = (e) => {
|
|
42
42
|
const n = o.value.type;
|
|
43
43
|
let t = {};
|
|
44
|
-
return Object.entries(e).map(([r,
|
|
44
|
+
return Object.entries(e).map(([r, d]) => {
|
|
45
45
|
for (let c = 0; c < h.value.length; c++) {
|
|
46
|
-
const
|
|
47
|
-
if (r ===
|
|
48
|
-
const f =
|
|
46
|
+
const Y = h.value[c];
|
|
47
|
+
if (r === Y) {
|
|
48
|
+
const f = d, j = `${n}-${f}`;
|
|
49
49
|
y[j] ? t[j] = y[j] : y[f] && (t[f] = y[f]);
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}), t;
|
|
54
|
-
},
|
|
54
|
+
}, q = E(() => {
|
|
55
55
|
const e = m(H), n = m(M), t = m(T);
|
|
56
56
|
return [
|
|
57
57
|
{
|
|
58
58
|
key: "1",
|
|
59
|
-
headerKey:
|
|
59
|
+
headerKey: u("designer.setting.常见属性"),
|
|
60
60
|
props: e,
|
|
61
61
|
type: O.Common,
|
|
62
62
|
className: "",
|
|
@@ -66,7 +66,7 @@ const be = /* @__PURE__ */ B({
|
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
key: "2",
|
|
69
|
-
headerKey:
|
|
69
|
+
headerKey: u("designer.setting.高级属性"),
|
|
70
70
|
props: n,
|
|
71
71
|
type: O.Advanced,
|
|
72
72
|
className: "",
|
|
@@ -76,7 +76,7 @@ const be = /* @__PURE__ */ B({
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
key: "3",
|
|
79
|
-
headerKey:
|
|
79
|
+
headerKey: u("designer.setting.事件属性"),
|
|
80
80
|
props: t,
|
|
81
81
|
type: O.Event,
|
|
82
82
|
className: "eventPanel",
|
|
@@ -87,11 +87,11 @@ const be = /* @__PURE__ */ B({
|
|
|
87
87
|
].filter((r) => r.visible);
|
|
88
88
|
}), V = () => {
|
|
89
89
|
v.off$("onChangeEventHandler"), v.on$("onChangeEventHandler", ({ title: e, attr: n, eventParams: t = [], mode: r }) => {
|
|
90
|
-
k.value = e ||
|
|
91
|
-
const
|
|
90
|
+
k.value = e || u("designer.setting.editWidgetEventHandler");
|
|
91
|
+
const d = r === "json";
|
|
92
92
|
g.value = n, p.value = r;
|
|
93
93
|
const c = `${l.value.name}.${n}`;
|
|
94
|
-
b.value =
|
|
94
|
+
b.value = d ? `${c}{` : `${c}(${t.join(", ")}) {`, s.value = W(o.value.options, n) || "", r === "json" && (s.value = JSON.stringify(s.value, null, " ")), n === "onValidate" && !l.value.onValidate && (s.value = ` /* sample code */
|
|
95
95
|
/*
|
|
96
96
|
if ((value > 100) || (value < 0)) {
|
|
97
97
|
return Promise.reject('error message') //fail
|
|
@@ -103,8 +103,8 @@ const be = /* @__PURE__ */ B({
|
|
|
103
103
|
}, w = (e, n, t = "javascript") => {
|
|
104
104
|
const r = t === "json";
|
|
105
105
|
g.value = e, p.value = t;
|
|
106
|
-
const
|
|
107
|
-
b.value = r ? `${
|
|
106
|
+
const d = `${l.value.name}.${e}`;
|
|
107
|
+
b.value = r ? `${d}{` : `${d}(${n.join(", ")}) {`, s.value = W(o.value.options, e) || "", t === "json" && (s.value = JSON.stringify(l.value.menuList, null, " ")), e === "onValidate" && !l.value.onValidate && (s.value = ` /* sample code */
|
|
108
108
|
/*
|
|
109
109
|
if ((value > 100) || (value < 0)) {
|
|
110
110
|
return Promise.reject('error message') //fail
|
|
@@ -112,12 +112,12 @@ const be = /* @__PURE__ */ B({
|
|
|
112
112
|
return Promise.resolve(); //pass
|
|
113
113
|
}
|
|
114
114
|
*/`), P.value.open(s.value);
|
|
115
|
-
},
|
|
115
|
+
}, L = (e) => {
|
|
116
116
|
if (e != null && e.length && p.value === "json")
|
|
117
117
|
try {
|
|
118
118
|
e = JSON.parse(e);
|
|
119
119
|
} catch {
|
|
120
|
-
return le.error(
|
|
120
|
+
return le.error(u("designer.setting.syntaxCheckWarning"));
|
|
121
121
|
}
|
|
122
122
|
ie(o.value.options, g.value, e);
|
|
123
123
|
};
|
|
@@ -149,7 +149,7 @@ const be = /* @__PURE__ */ B({
|
|
|
149
149
|
}), A({
|
|
150
150
|
emit$: v.emit$
|
|
151
151
|
});
|
|
152
|
-
const D = { formConfig: S, designer: a, i18nt:
|
|
152
|
+
const D = { formConfig: S, designer: a, i18nt: u, COMMON_PROPERTIES: H, ADVANCED_PROPERTIES: M, EVENT_PROPERTIES: T, props: _, emitter: v, globalDsv: F, getDesignerConfig: N, subFormChildWidgetFlag: C, CodeModalEditorRef: P, dialogTitle: k, currentMode: p, activeTab: R, widgetActiveCollapseNames: J, eventHandlerCode: s, curEventName: g, eventHeader: b, selectedWidget: o, designerConfig: I, optionModel: l, getEventHandled: K, selectedWidgetOptionsEditor: h, getPropEditor: m, collapsePanels: q, onChangeEventHandler: V, editEventHandler: w, saveEventHandler: L, get TpfCodeEditor() {
|
|
153
153
|
return ee;
|
|
154
154
|
}, FormSetting: te, FormCrudSetting: ne };
|
|
155
155
|
return Object.defineProperty(D, "__isScriptSetup", { enumerable: !1, value: !0 }), D;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as u, computed as s, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as u, computed as s, ref as l } from "vue";
|
|
2
|
+
import d from "../RenderWigetList.vue.js";
|
|
3
3
|
import { ComponentNameEnum as m, ContainerTypeEnum as a } from "../../../constants/WidgetTypeEnum.js";
|
|
4
4
|
import { useAppRef as f } from "../../form-designer/useAppRef.js";
|
|
5
|
-
const
|
|
5
|
+
const h = /* @__PURE__ */ u({
|
|
6
6
|
name: a.GridColWidget,
|
|
7
7
|
componentName: m.ContainerWidget,
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "grid-col-widget",
|
|
10
10
|
props: {
|
|
11
|
-
widget: { type:
|
|
12
|
-
field: { type:
|
|
13
|
-
parentWidget: { type:
|
|
11
|
+
widget: { type: null, required: !0 },
|
|
12
|
+
field: { type: null, required: !0 },
|
|
13
|
+
parentWidget: { type: null, required: !0 },
|
|
14
14
|
parentList: { type: Array, required: !0 },
|
|
15
15
|
indexOfParentList: { type: Number, required: !1 },
|
|
16
16
|
subFormRowIndex: { type: Number, required: !1 },
|
|
@@ -19,17 +19,17 @@ const _ = /* @__PURE__ */ u({
|
|
|
19
19
|
},
|
|
20
20
|
setup(i, { expose: o }) {
|
|
21
21
|
o();
|
|
22
|
-
const e = i, n = s(() => e.colHeight ? { height: e.colHeight } : {}), p =
|
|
22
|
+
const e = i, n = s(() => e.colHeight ? { height: e.colHeight } : {}), p = l({
|
|
23
23
|
span: e.widget.options.span || 12,
|
|
24
24
|
offset: e.widget.options.offset || 0,
|
|
25
25
|
push: e.widget.options.push || 0,
|
|
26
26
|
pull: e.widget.options.pull || 0
|
|
27
27
|
}), { initRefList: t } = f();
|
|
28
28
|
t();
|
|
29
|
-
const r = { props: e, colHeightStyle: n, layoutProps: p, initRefList: t, RenderWigetList:
|
|
29
|
+
const r = { props: e, colHeightStyle: n, layoutProps: p, initRefList: t, RenderWigetList: d };
|
|
30
30
|
return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
h as default
|
|
35
35
|
};
|