@kp-ui/lowcode 2.15.0-alpha.1 → 2.15.0-alpha.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/install.js +16 -17
- package/package.json +1 -4
- package/src/components/FormRender/FormContainer.js +15 -14
- package/src/components/FormRender/index.vue2.js +26 -22
- package/src/components/FormRender/useFormContext.js +51 -50
- 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/checkbox-widget.vue.js +19 -18
- package/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue2.js +18 -17
- package/src/components/form-designer/form-widget/field-widget/input-widget.vue2.js +20 -21
- package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue2.js +11 -11
- package/src/components/form-designer/form-widget/field-widget/time-widget.vue2.js +16 -16
- package/src/components/form-designer/form-widget/field-widget/useField.js +204 -186
- 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 +58 -55
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +70 -65
- package/src/components/form-designer/useAppRef.js +17 -17
- package/src/components/form-render/container-items/grid-col-widget.vue.js +11 -11
- package/src/components/form-render/container-items/grid-col-widget.vue2.js +14 -16
- package/src/components/form-render/container-items/grid-widget.vue.js +20 -17
- package/src/components/form-render/container-items/grid-widget.vue2.js +13 -12
- package/src/components/form-render/container-items/vf-box-widget.vue2.js +9 -9
- package/src/components/form-render/dynamic-dialog.vue.js +1 -1
- package/src/components/form-render/dynamic-dialog.vue2.js +56 -53
- package/src/components/public/CustomerModal/useCustomerModal.js +7 -8
- package/stats.html +1 -1
- package/styles/style.css +1 -1
package/install.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import "./_virtual/virtual_svg-icons-register.js";
|
|
3
|
-
import { VxeTooltip as f } from "
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
o.config.globalProperties.$http = r, o.config.globalProperties.$getUserInfo = s, o.config.globalProperties.$factoryRender = t, o.config.globalProperties.$openCustomerModal = (i) => m(i, p), o.use(f);
|
|
3
|
+
import { VxeTooltip as f } from "vxe-pc-ui";
|
|
4
|
+
import { basicFieldsEnums as u } from "./src/components/form-designer/widget-panel/basicFieldsEnums.js";
|
|
5
|
+
import { default as b } from "./src/components/form-designer/index.vue.js";
|
|
6
|
+
import { openCustomerModal as i } from "./src/components/public/CustomerModal/useCustomerModal.js";
|
|
7
|
+
import { default as R } from "./src/components/form-render/SubmitButtonRender.vue.js";
|
|
8
|
+
import { useLowcode as C } from "./src/hooks/useLowcode.js";
|
|
9
|
+
import { default as V } from "./src/components/FormRender/index.vue.js";
|
|
10
|
+
const d = (e) => {
|
|
11
|
+
const { app: o, http: r, factoryRender: t, getUserInfo: p } = e;
|
|
12
|
+
o.config.globalProperties.$http = r, o.config.globalProperties.$getUserInfo = p, o.config.globalProperties.$factoryRender = t, o.config.globalProperties.$openCustomerModal = (s) => i(s, o), o.use(f);
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
R as SubmitButtonRender,
|
|
16
|
+
b as VFormDesigner,
|
|
17
|
+
V as VFormRender,
|
|
18
|
+
u as basicFieldsEnums,
|
|
19
|
+
d as registerLowcodeCore,
|
|
20
|
+
C as useLowcode
|
|
22
21
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kp-ui/lowcode",
|
|
3
|
-
"version": "2.15.0-alpha.
|
|
3
|
+
"version": "2.15.0-alpha.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"module": "install.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@kp-ui/i18n": "0.0.12",
|
|
10
|
-
"@surely-vue/table": "5.0.3",
|
|
11
|
-
"monaco-editor": "^0.44.0",
|
|
12
9
|
"animate.css": "^4.1.1",
|
|
13
10
|
"ant-design-vue": "4.2.6",
|
|
14
11
|
"axios": "^1.3.5",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as w, ref as D, computed as o, onMounted as F, createVNode as
|
|
1
|
+
import { defineComponent as w, ref as D, computed as o, onMounted as F, createVNode as i } from "vue";
|
|
2
2
|
import { Form as h } from "ant-design-vue";
|
|
3
3
|
import E from "../form-render/RenderWigetList.vue.js";
|
|
4
4
|
import { useEmitter as L } from "../../utils/useEmitter.js";
|
|
@@ -11,42 +11,43 @@ const P = /* @__PURE__ */ w({
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["form-submit", "form-cancel"],
|
|
13
13
|
setup(e, {
|
|
14
|
-
emit:
|
|
15
|
-
expose:
|
|
14
|
+
emit: m,
|
|
15
|
+
expose: c
|
|
16
16
|
}) {
|
|
17
|
-
var
|
|
18
|
-
const
|
|
17
|
+
var l;
|
|
18
|
+
const n = D(), {
|
|
19
19
|
emit$: d,
|
|
20
20
|
on$: u,
|
|
21
21
|
off$: f
|
|
22
|
-
} = L(), a = o(() => e.context.formDataModel.value), s = o(() => e.context.readModeFlag.value), v = o(() => e.context.formConfig.value), g = o(() => e.context.widgetList.value), x = o(() => e.context.labelPosition.value), y = o(() => e.context.customClass.value), b = (
|
|
22
|
+
} = L(), a = o(() => e.context.formDataModel.value), s = o(() => e.context.readModeFlag.value), v = o(() => e.context.formConfig.value), g = o(() => e.context.widgetList.value), x = o(() => e.context.labelPosition.value), y = o(() => e.context.customClass.value), b = (l = e == null ? void 0 : e.context) == null ? void 0 : l.formValidator, C = () => {
|
|
23
23
|
var t;
|
|
24
|
-
((t = v.value) == null ? void 0 : t.isEnterSubmit) === 1 &&
|
|
25
|
-
},
|
|
24
|
+
((t = v.value) == null ? void 0 : t.isEnterSubmit) === 1 && r();
|
|
25
|
+
}, r = async () => {
|
|
26
26
|
try {
|
|
27
27
|
if (await b.validate()) {
|
|
28
28
|
const M = e.context.getFormData();
|
|
29
|
-
|
|
29
|
+
m("form-submit", M);
|
|
30
30
|
}
|
|
31
31
|
} catch (t) {
|
|
32
32
|
console.error("表单验证失败:", t);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
return F(() => {
|
|
36
|
-
}),
|
|
36
|
+
}), c({
|
|
37
|
+
renderForm: n,
|
|
37
38
|
off$: f,
|
|
38
39
|
on$: u,
|
|
39
40
|
emit$: d,
|
|
40
|
-
handleOnSubmit:
|
|
41
|
-
}), () =>
|
|
42
|
-
ref:
|
|
41
|
+
handleOnSubmit: r
|
|
42
|
+
}), () => i(h, {
|
|
43
|
+
ref: n,
|
|
43
44
|
layout: x.value,
|
|
44
45
|
class: ["render-form", "tpf-form", y.value, s.value ? "readonly-mode-form" : ""],
|
|
45
46
|
validateOnRuleChange: !1,
|
|
46
47
|
model: a.value,
|
|
47
48
|
onKeydown: (t) => t.key === "Enter" && C()
|
|
48
49
|
}, {
|
|
49
|
-
default: () => [
|
|
50
|
+
default: () => [i(E, {
|
|
50
51
|
"parent-widget": null,
|
|
51
52
|
"widget-list": g.value,
|
|
52
53
|
formDataModel: a.value,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as v } from "../../../node_modules/.pnpm/vue-router@4.2.4_vue@3.5.17_typescript@5.8.2_/node_modules/vue-router/dist/vue-router.js";
|
|
1
|
+
import { defineComponent as j, computed as x, ref as d, getCurrentInstance as L, onMounted as O, watch as R } from "vue";
|
|
3
2
|
import S from "../form-render/dynamic-dialog.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import { useFormContext as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { storeToRefs as
|
|
8
|
-
import { useLocaleStore as
|
|
9
|
-
import V from "
|
|
10
|
-
|
|
3
|
+
import c from "./FormContainer.js";
|
|
4
|
+
import { useFormContext as N } 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 V } from "@kp-ui/tool";
|
|
9
|
+
import w from "./Debugger.vue.js";
|
|
10
|
+
import { useComRef as I } from "tmgc2-share";
|
|
11
|
+
const Q = /* @__PURE__ */ j({
|
|
11
12
|
name: "VFormRender",
|
|
12
13
|
componentName: "VFormRender",
|
|
13
14
|
__name: "index",
|
|
@@ -24,13 +25,13 @@ const G = /* @__PURE__ */ D({
|
|
|
24
25
|
debug: { type: Boolean, required: !1 }
|
|
25
26
|
},
|
|
26
27
|
emits: ["form-submit", "form-cancel"],
|
|
27
|
-
setup(
|
|
28
|
-
const { initLocale: a } =
|
|
28
|
+
setup(p, { expose: g, emit: b }) {
|
|
29
|
+
const { initLocale: a } = h(), m = J(), { locale: t } = B(m), y = x(() => V().debug === "1"), C = d(!1), _ = L(), o = p, r = d(), n = I(c), s = b, e = N({
|
|
29
30
|
props: o,
|
|
30
31
|
renderForm: r
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
};
|
|
32
|
+
}), q = (D) => {
|
|
33
|
+
s("form-submit", D);
|
|
34
|
+
}, i = () => (console.log(n.value), n.value);
|
|
34
35
|
O(() => {
|
|
35
36
|
e.registerToRefList("v_form_ref");
|
|
36
37
|
}), R(
|
|
@@ -42,19 +43,22 @@ const G = /* @__PURE__ */ D({
|
|
|
42
43
|
immediate: !0
|
|
43
44
|
}
|
|
44
45
|
);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const f = () => {
|
|
47
|
+
}, { dynamicDialgRef: F, dialogProps: v, emitter: l } = e;
|
|
48
|
+
g({
|
|
49
|
+
...l,
|
|
48
50
|
...e,
|
|
51
|
+
getNativeForm: i,
|
|
52
|
+
setLoading: f,
|
|
49
53
|
formJson: o.formJson,
|
|
50
54
|
renderForm: r
|
|
51
55
|
});
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
}, Debugger:
|
|
55
|
-
return Object.defineProperty(
|
|
56
|
+
const u = { initLocale: a, localeStore: m, locale: t, debug: y, debugVisible: C, instance: _, props: o, renderForm: r, formContainer: n, emit: s, formContext: e, handleFormSubmit: q, getNativeForm: i, setLoading: f, dynamicDialgRef: F, dialogProps: v, emitter: l, DynamicDialog: S, get FormContainer() {
|
|
57
|
+
return c;
|
|
58
|
+
}, Debugger: w };
|
|
59
|
+
return Object.defineProperty(u, "__isScriptSetup", { enumerable: !1, value: !0 }), u;
|
|
56
60
|
}
|
|
57
61
|
});
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
Q as default
|
|
60
64
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ref as a, provide as
|
|
2
|
-
import { useFormValidation as
|
|
3
|
-
import { useFormDataProcessor as
|
|
4
|
-
import { insertCustomCssToHead as
|
|
5
|
-
import { set as
|
|
1
|
+
import { ref as a, provide as f, computed as u, watchEffect as ie, onMounted as le, nextTick as fe } from "vue";
|
|
2
|
+
import { useFormValidation as E } from "./formValidation.js";
|
|
3
|
+
import { useFormDataProcessor as ce } from "./useFormDataProcessor.js";
|
|
4
|
+
import { insertCustomCssToHead as ue, insertGlobalFunctionsToHtml as me, getContainerWidgetByName as V, cloneFormConfigWithoutEventHandler as de, generateId as ve } from "../../utils/util.js";
|
|
5
|
+
import { set as ge, cloneDeep as Fe } from "lodash-es";
|
|
6
6
|
import { message as W } from "ant-design-vue";
|
|
7
7
|
import { useI18n as pe } from "../../utils/i18n.js";
|
|
8
|
-
import { getUuidKey as
|
|
9
|
-
import { useComRef as
|
|
10
|
-
import
|
|
11
|
-
import { useEmitter as
|
|
12
|
-
import { useAppRef as
|
|
13
|
-
const
|
|
14
|
-
const { formJson: C, formData: H } =
|
|
15
|
-
|
|
16
|
-
const b = a(), { executeFunction: T, context: x, execHttpFunction: j } =
|
|
8
|
+
import { getUuidKey as Ce } from "@kp-ui/tool";
|
|
9
|
+
import { useComRef as De, useRef as he, useExecFunction as Re } from "tmgc2-share";
|
|
10
|
+
import we from "../form-render/dynamic-dialog.vue.js";
|
|
11
|
+
import { useEmitter as be } from "../../utils/useEmitter.js";
|
|
12
|
+
import { useAppRef as xe } from "../form-designer/useAppRef.js";
|
|
13
|
+
const je = ({ renderForm: p, props: i }) => {
|
|
14
|
+
const { formJson: C, formData: H } = i, v = De(we), { i18nt: D } = pe(), [h, I] = he(!1), g = be(), c = a(), n = a({}), R = a(!1), F = a(/* @__PURE__ */ new Map()), w = a({}), J = a();
|
|
15
|
+
f("refList", F), f("getFormConfig", () => t.value), f("formData", n), f("getReadMode", () => h.value), f("designState", !1);
|
|
16
|
+
const b = a(), { executeFunction: T, context: x, execHttpFunction: j } = Re(), { getFormRef: M, getWidgetRef: $, registerToRefList: B } = xe(F, !0), t = u(() => {
|
|
17
17
|
var e;
|
|
18
18
|
return ((e = c.value) == null ? void 0 : e.formConfig) || {};
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
f("formConfig", t);
|
|
21
21
|
const m = u(() => {
|
|
22
22
|
var e;
|
|
23
23
|
return ((e = c.value) == null ? void 0 : e.widgetList) || [];
|
|
@@ -32,14 +32,14 @@ const Te = ({ renderForm: F, props: f }) => {
|
|
|
32
32
|
}), K = u(() => {
|
|
33
33
|
var e;
|
|
34
34
|
return ((e = t.value) == null ? void 0 : e.customClass) || "";
|
|
35
|
-
}), L =
|
|
36
|
-
let d =
|
|
37
|
-
|
|
38
|
-
d =
|
|
35
|
+
}), L = ce();
|
|
36
|
+
let d = E(p, m.value || []);
|
|
37
|
+
ie(() => {
|
|
38
|
+
d = E(p, m.value || []);
|
|
39
39
|
});
|
|
40
40
|
const y = async (e) => {
|
|
41
41
|
var o;
|
|
42
|
-
c.value = e || { widgetList: [], formConfig: {} }, n.value = {}, S(((o = c.value) == null ? void 0 : o.widgetList) || []), await
|
|
42
|
+
c.value = e || { widgetList: [], formConfig: {} }, n.value = {}, S(((o = c.value) == null ? void 0 : o.widgetList) || []), await fe(), ne();
|
|
43
43
|
}, S = (e) => {
|
|
44
44
|
if ((e == null ? void 0 : e.length) > 0) {
|
|
45
45
|
const o = L.buildFormModel(e, H);
|
|
@@ -58,46 +58,46 @@ const Te = ({ renderForm: F, props: f }) => {
|
|
|
58
58
|
}, Y = (e) => {
|
|
59
59
|
b.value = e;
|
|
60
60
|
}, Z = () => {
|
|
61
|
-
if (!
|
|
61
|
+
if (!i.parentForm)
|
|
62
62
|
return M();
|
|
63
|
-
let e =
|
|
63
|
+
let e = i.parentForm;
|
|
64
64
|
for (; e.parentForm; )
|
|
65
65
|
e = e.parentForm;
|
|
66
66
|
return e;
|
|
67
67
|
}, _ = (e, o = {}, s = {}) => {
|
|
68
|
-
var O,
|
|
69
|
-
const r = Z(),
|
|
70
|
-
if (
|
|
68
|
+
var O, P;
|
|
69
|
+
const r = Z(), l = V((r == null ? void 0 : r.widgetList) || [], e) || V(m.value || [], e);
|
|
70
|
+
if (l === null) {
|
|
71
71
|
W.error(D("render.hint.refNotFound") + e);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
if (!e ||
|
|
74
|
+
if (!e || l.type !== "vf-dialog") {
|
|
75
75
|
W.error(D("render.hint.refNotFound") + e);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
widgetList:
|
|
80
|
-
formConfig:
|
|
81
|
-
},
|
|
78
|
+
const se = {
|
|
79
|
+
widgetList: Fe((l == null ? void 0 : l.widgetList) || []),
|
|
80
|
+
formConfig: de(((O = r == null ? void 0 : r.formConfig) == null ? void 0 : O.value) || {})
|
|
81
|
+
}, ae = Ce();
|
|
82
82
|
w.value = {
|
|
83
|
-
options:
|
|
84
|
-
formJson:
|
|
83
|
+
options: l.options,
|
|
84
|
+
formJson: se,
|
|
85
85
|
formData: { ...o },
|
|
86
86
|
optionData: r.optionData,
|
|
87
87
|
globalDsv: r.globalDsv,
|
|
88
88
|
parentFormRef: x.value,
|
|
89
89
|
extraData: s,
|
|
90
|
-
wrapperId:
|
|
90
|
+
wrapperId: ae,
|
|
91
91
|
vfCtx: { ...o }
|
|
92
|
-
}, (
|
|
93
|
-
}, N = () => {
|
|
92
|
+
}, (P = v.value) == null || P.show();
|
|
93
|
+
}, N = () => i.parentForm, ee = () => {
|
|
94
94
|
var e;
|
|
95
95
|
return (e = v.value) == null ? void 0 : e.getFormRef();
|
|
96
|
-
},
|
|
96
|
+
}, oe = () => {
|
|
97
97
|
g.off$("fieldChange"), g.on$("fieldChange", ({ fieldName: e, value: o }) => {
|
|
98
|
-
|
|
98
|
+
ge(n.value, e, o);
|
|
99
99
|
});
|
|
100
|
-
},
|
|
100
|
+
}, te = async () => {
|
|
101
101
|
var o;
|
|
102
102
|
const e = t.value.serveList;
|
|
103
103
|
if ((o = e.vformDetail.http) != null && o.url) {
|
|
@@ -106,24 +106,25 @@ const Te = ({ renderForm: F, props: f }) => {
|
|
|
106
106
|
...e.vformDetail
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
...
|
|
109
|
+
...i.vfCtx
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
return console.log("res: ", s), s;
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, ne = () => {
|
|
115
115
|
var e, o;
|
|
116
116
|
(e = t.value) != null && e.onFormMounted && T({
|
|
117
117
|
functionBody: (o = t.value) == null ? void 0 : o.onFormMounted
|
|
118
118
|
});
|
|
119
|
-
},
|
|
120
|
-
const e = "vfRender" +
|
|
121
|
-
o &&
|
|
119
|
+
}, re = () => {
|
|
120
|
+
const e = "vfRender" + ve(), { cssCode: o, functions: s } = t.value;
|
|
121
|
+
o && ue(o, e || ""), s && me(s, e || "");
|
|
122
122
|
};
|
|
123
|
-
return
|
|
124
|
-
C && y(C),
|
|
123
|
+
return le(() => {
|
|
124
|
+
C && y(C), oe(), re();
|
|
125
125
|
}), {
|
|
126
|
-
vfCtx:
|
|
126
|
+
vfCtx: i.vfCtx,
|
|
127
|
+
getParentFormRef: N,
|
|
127
128
|
getFormRef: M,
|
|
128
129
|
getWidgetRef: $,
|
|
129
130
|
registerToRefList: B,
|
|
@@ -134,18 +135,18 @@ const Te = ({ renderForm: F, props: f }) => {
|
|
|
134
135
|
setReadMode: I,
|
|
135
136
|
setFormJson: y,
|
|
136
137
|
setLoading: q,
|
|
137
|
-
onFormDetail:
|
|
138
|
+
onFormDetail: te,
|
|
138
139
|
emitter: g,
|
|
139
140
|
context: x,
|
|
140
141
|
getFormData: U,
|
|
141
|
-
getChildFormRef:
|
|
142
|
+
getChildFormRef: ee,
|
|
142
143
|
// 状态
|
|
143
144
|
formJsonObj: c,
|
|
144
145
|
formDataModel: n,
|
|
145
146
|
isLoading: R,
|
|
146
147
|
readModeFlag: h,
|
|
147
148
|
// 引用
|
|
148
|
-
widgetRefList:
|
|
149
|
+
widgetRefList: F,
|
|
149
150
|
// 处理器
|
|
150
151
|
formDataProcessor: L,
|
|
151
152
|
formValidator: d,
|
|
@@ -163,5 +164,5 @@ const Te = ({ renderForm: F, props: f }) => {
|
|
|
163
164
|
};
|
|
164
165
|
};
|
|
165
166
|
export {
|
|
166
|
-
|
|
167
|
+
je as useFormContext
|
|
167
168
|
};
|
|
@@ -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
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import m from "./checkbox-widget.vue2.js";
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
2
|
+
import { resolveComponent as a, createBlock as d, createCommentVNode as _, openBlock as r, mergeProps as b, withCtx as n, createElementBlock as t, Fragment as p, renderList as g, createTextVNode as h, toDisplayString as i } from "vue";
|
|
3
|
+
import k from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
const v = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "readonly-mode-field"
|
|
7
7
|
};
|
|
8
|
-
function x(
|
|
9
|
-
const c =
|
|
10
|
-
return e.handleHidden ? _("v-if", !0) : (r(), d(e.FormItemWrapper,
|
|
11
|
-
default:
|
|
12
|
-
e.isReadMode ? (r(),
|
|
8
|
+
function x(u, l, y, e, C, w) {
|
|
9
|
+
const c = a("a-checkbox"), s = a("a-checkbox-group");
|
|
10
|
+
return e.handleHidden ? _("v-if", !0) : (r(), d(e.FormItemWrapper, b({ key: 0 }, e.props, { rules: e.rules }), {
|
|
11
|
+
default: n(() => [
|
|
12
|
+
e.isReadMode ? (r(), t(
|
|
13
13
|
"span",
|
|
14
14
|
v,
|
|
15
15
|
i(e.optionLabel),
|
|
@@ -19,22 +19,23 @@ function x(h, n, y, e, w, B) {
|
|
|
19
19
|
key: 0,
|
|
20
20
|
ref: "fieldEditor",
|
|
21
21
|
value: e.fieldModel,
|
|
22
|
-
"onUpdate:value":
|
|
23
|
-
disabled: e.handleDisabled
|
|
22
|
+
"onUpdate:value": l[0] || (l[0] = (o) => e.fieldModel = o),
|
|
23
|
+
disabled: e.handleDisabled,
|
|
24
|
+
onChange: e.handleChangeEvent
|
|
24
25
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
(r(!0),
|
|
27
|
-
|
|
26
|
+
default: n(() => [
|
|
27
|
+
(r(!0), t(
|
|
28
|
+
p,
|
|
28
29
|
null,
|
|
29
|
-
|
|
30
|
+
g(e.field.options.optionItems, (o, f) => (r(), d(c, {
|
|
30
31
|
key: f,
|
|
31
32
|
value: o[e.field.options.valueKey],
|
|
32
33
|
disabled: o.disabled,
|
|
33
34
|
border: e.field.options.border,
|
|
34
35
|
style: {}
|
|
35
36
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
|
|
37
|
+
default: n(() => [
|
|
38
|
+
h(
|
|
38
39
|
i(o[e.field.options.labelKey]),
|
|
39
40
|
1
|
|
40
41
|
/* TEXT */
|
|
@@ -49,13 +50,13 @@ function x(h, n, y, e, w, B) {
|
|
|
49
50
|
]),
|
|
50
51
|
_: 1
|
|
51
52
|
/* STABLE */
|
|
52
|
-
}, 8, ["value", "disabled"]))
|
|
53
|
+
}, 8, ["value", "disabled", "onChange"]))
|
|
53
54
|
]),
|
|
54
55
|
_: 1
|
|
55
56
|
/* STABLE */
|
|
56
57
|
}, 16, ["rules"]));
|
|
57
58
|
}
|
|
58
|
-
const
|
|
59
|
+
const D = /* @__PURE__ */ k(m, [["render", x], ["__file", "/Users/zhaopeng/dev/kunpeng/tmgc2-web-vfrom/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue"]]);
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
D as default
|
|
61
62
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useSelect as
|
|
4
|
-
import { useField as
|
|
5
|
-
import { ComponentNameEnum as q, WidgetTypeEnum as
|
|
6
|
-
const w = /* @__PURE__ */
|
|
7
|
-
name:
|
|
1
|
+
import { defineComponent as b } from "vue";
|
|
2
|
+
import y from "./form-item-wrapper.vue.js";
|
|
3
|
+
import { useSelect as _ } from "./hooks/useSelect.js";
|
|
4
|
+
import { useField as g } from "./useField.js";
|
|
5
|
+
import { ComponentNameEnum as q, WidgetTypeEnum as x } from "../../../../constants/WidgetTypeEnum.js";
|
|
6
|
+
const w = /* @__PURE__ */ b({
|
|
7
|
+
name: x.checkbox,
|
|
8
8
|
componentName: q.FieldWidget,
|
|
9
9
|
__name: "checkbox-widget",
|
|
10
10
|
props: {
|
|
@@ -18,27 +18,28 @@ const w = /* @__PURE__ */ c({
|
|
|
18
18
|
subFormRowId: { type: String, required: !1 },
|
|
19
19
|
subFormColIndex: { type: Number, required: !1 }
|
|
20
20
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const e =
|
|
21
|
+
setup(n, { expose: o }) {
|
|
22
|
+
const e = n, {
|
|
23
23
|
rules: l,
|
|
24
24
|
field: u,
|
|
25
25
|
designState: r,
|
|
26
26
|
fieldModel: t,
|
|
27
27
|
isReadMode: p,
|
|
28
28
|
fieldEditor: s,
|
|
29
|
-
handleHidden:
|
|
30
|
-
handleDisabled:
|
|
31
|
-
defineExposed:
|
|
32
|
-
|
|
29
|
+
handleHidden: a,
|
|
30
|
+
handleDisabled: m,
|
|
31
|
+
defineExposed: d,
|
|
32
|
+
handleChangeEvent: f
|
|
33
|
+
} = g(e), { optionLabel: c } = _({
|
|
33
34
|
fieldModel: t,
|
|
34
35
|
field: e.field,
|
|
35
36
|
designState: r
|
|
36
37
|
});
|
|
37
|
-
|
|
38
|
-
...
|
|
38
|
+
o({
|
|
39
|
+
...d
|
|
39
40
|
});
|
|
40
|
-
const
|
|
41
|
-
return Object.defineProperty(
|
|
41
|
+
const i = { props: e, rules: l, field: u, designState: r, fieldModel: t, isReadMode: p, fieldEditor: s, handleHidden: a, handleDisabled: m, defineExposed: d, handleChangeEvent: f, optionLabel: c, FormItemWrapper: y };
|
|
42
|
+
return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as g, computed as _ } from "vue";
|
|
2
|
+
import q from "./form-item-wrapper.vue.js";
|
|
3
3
|
import { SvgIcon as x } from "tmgc2-share";
|
|
4
|
-
import { useField as
|
|
5
|
-
import { ComponentNameEnum as
|
|
6
|
-
const
|
|
7
|
-
name:
|
|
8
|
-
componentName:
|
|
4
|
+
import { useField as F } from "./useField.js";
|
|
5
|
+
import { ComponentNameEnum as I, WidgetTypeEnum as C } from "../../../../constants/WidgetTypeEnum.js";
|
|
6
|
+
const w = /* @__PURE__ */ g({
|
|
7
|
+
name: C.input,
|
|
8
|
+
componentName: I.FieldWidget,
|
|
9
9
|
__name: "input-widget",
|
|
10
10
|
props: {
|
|
11
11
|
widget: { type: null, required: !0 },
|
|
@@ -20,29 +20,28 @@ const W = /* @__PURE__ */ _({
|
|
|
20
20
|
},
|
|
21
21
|
setup(i, { expose: o }) {
|
|
22
22
|
const r = i, {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
fieldEditor: p,
|
|
23
|
+
rules: u,
|
|
24
|
+
fieldEditor: d,
|
|
26
25
|
field: e,
|
|
27
|
-
fieldModel:
|
|
28
|
-
isReadMode:
|
|
29
|
-
size:
|
|
30
|
-
handleHidden:
|
|
31
|
-
handleDisabled:
|
|
32
|
-
handleClickIcon:
|
|
33
|
-
handleFocusCustomEvent:
|
|
34
|
-
handleBlurCustomEvent:
|
|
26
|
+
fieldModel: p,
|
|
27
|
+
isReadMode: l,
|
|
28
|
+
size: s,
|
|
29
|
+
handleHidden: m,
|
|
30
|
+
handleDisabled: a,
|
|
31
|
+
handleClickIcon: f,
|
|
32
|
+
handleFocusCustomEvent: c,
|
|
33
|
+
handleBlurCustomEvent: y,
|
|
35
34
|
defineExposed: t
|
|
36
|
-
} =
|
|
35
|
+
} = F(r), b = _(() => e.options.type === "number" ? "text" : e.options.type);
|
|
37
36
|
o({
|
|
38
37
|
...t
|
|
39
38
|
});
|
|
40
|
-
const n = { props: r,
|
|
39
|
+
const n = { props: r, rules: u, fieldEditor: d, field: e, fieldModel: p, isReadMode: l, size: s, handleHidden: m, handleDisabled: a, handleClickIcon: f, handleFocusCustomEvent: c, handleBlurCustomEvent: y, defineExposed: t, inputType: b, FormItemWrapper: q, get SvgIcon() {
|
|
41
40
|
return x;
|
|
42
41
|
} };
|
|
43
42
|
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
44
43
|
}
|
|
45
44
|
});
|
|
46
45
|
export {
|
|
47
|
-
|
|
46
|
+
w as default
|
|
48
47
|
};
|