@kp-ui/lowcode 2.14.0-beta.5 → 2.14.0-beta.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.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/src/components/FormRender/useFormRender.js +17 -0
  3. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +12 -12
  4. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +18 -20
  5. package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
  6. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
  7. package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
  8. package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
  9. package/src/components/form-designer/setting-panel/index.vue.js +2 -2
  10. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  11. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -7
  12. package/src/components/form-render/RenderWigetList.vue.js +60 -0
  13. package/src/components/form-render/RenderWigetList.vue2.js +4 -0
  14. package/src/components/form-render/SubmitButtonRender.vue.js +33 -29
  15. package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
  16. package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
  17. package/src/components/form-render/container-item/data-table-item.vue.js +22 -36
  18. package/src/components/form-render/container-item/grid-item.vue.js +7 -7
  19. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +1 -1
  20. package/src/components/form-render/container-item/sub-form-item.vue.js +1 -1
  21. package/src/components/form-render/container-item/tab-item.vue.js +19 -19
  22. package/src/components/form-render/container-item/table-item.vue.js +7 -7
  23. package/src/components/form-render/container-item/vf-collapse-item.vue.js +27 -27
  24. package/src/components/form-render/dynamic-dialog.vue.js +70 -85
  25. package/src/components/form-render/index.vue.js +69 -98
  26. package/src/hooks/useLowcode.js +40 -39
  27. package/src/lang/en-US.js +3 -0
  28. package/src/lang/zh-CN.js +3 -0
  29. package/src/mixins/useDataTableMixin.js +18 -23
  30. package/stats.html +1 -1
  31. package/styles/style.css +1 -1
@@ -1,6 +1,6 @@
1
- import L from "./container-item-wrapper.vue.js";
1
+ import L from "./container-item-wrapper.vue2.js";
2
2
  import I from "../../../utils/emitter.js";
3
- import { defineAsyncComponent as j, resolveComponent as f, withDirectives as F, createBlock as s, openBlock as i, withCtx as d, createElementVNode as C, createVNode as c, createElementBlock as m, createCommentVNode as y, normalizeClass as S, Fragment as u, renderList as l, resolveDynamicComponent as g, createSlots as p, renderSlot as w, mergeProps as h, Transition as D, normalizeStyle as N, vShow as O } from "vue";
3
+ import { defineAsyncComponent as j, resolveComponent as f, withDirectives as F, createBlock as s, openBlock as o, withCtx as d, createElementVNode as C, createVNode as c, createElementBlock as m, createCommentVNode as _, normalizeClass as S, Fragment as u, renderList as l, resolveDynamicComponent as g, createSlots as p, renderSlot as w, mergeProps as h, Transition as D, normalizeStyle as N, vShow as O } from "vue";
4
4
  import M from "../../../utils/i18n.js";
5
5
  import T from "../../form-designer/form-widget/field-widget/index.js";
6
6
  import B from "../refMixin.js";
@@ -106,10 +106,10 @@ const E = {
106
106
  },
107
107
  async loadFormCode(t) {
108
108
  if (t) {
109
- const _ = await this.$http.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
109
+ const y = await this.$http.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
110
110
  params: { code: t }
111
111
  }).then((e) => e.data.object.frontendDefinition || "{}");
112
- this.$refs.dFormRef.setFormJson(JSON.parse(_));
112
+ this.$refs.dFormRef.setFormJson(JSON.parse(y));
113
113
  }
114
114
  },
115
115
  handleOnCreated() {
@@ -123,9 +123,9 @@ const E = {
123
123
  }
124
124
  }
125
125
  }, P = { class: "tpf-collapse" }, q = { class: "tpf-collapse-header" };
126
- function G(t, _, e, Q, U, b) {
126
+ function G(t, y, e, Q, U, b) {
127
127
  const R = f("TpfCollapseTitle"), v = f("SvgIcon"), k = f("a-space"), x = f("container-item-wrapper");
128
- return F((i(), s(x, { widget: e.widget }, {
128
+ return F((o(), s(x, { widget: e.widget }, {
129
129
  default: d(() => [
130
130
  C("div", P, [
131
131
  C("div", q, [
@@ -144,12 +144,12 @@ function G(t, _, e, Q, U, b) {
144
144
  ]),
145
145
  _: 1
146
146
  }),
147
- e.widget.options.isCollapse ? y("", !0) : (i(), m("div", {
147
+ e.widget.options.isCollapse ? _("", !0) : (o(), m("div", {
148
148
  key: 0,
149
149
  class: S(["header-right", b.rightSlotCss])
150
150
  }, [
151
- e.widget.headerRightSlotList && e.widget.headerRightSlotList.length > 0 ? (i(!0), m(u, { key: 0 }, l(e.widget.headerRightSlotList, (n, a) => (i(), m(u, null, [
152
- n.category === "container" ? (i(), s(g(t.getComponentByContainer(n)), {
151
+ e.widget.headerRightSlotList && e.widget.headerRightSlotList.length > 0 ? (o(!0), m(u, { key: 0 }, l(e.widget.headerRightSlotList, (n, a) => (o(), m(u, null, [
152
+ n.category === "container" ? (o(), s(g(t.getComponentByContainer(n)), {
153
153
  widget: n,
154
154
  key: a,
155
155
  "parent-list": e.widget.headerRightSlotList,
@@ -160,13 +160,13 @@ function G(t, _, e, Q, U, b) {
160
160
  "sub-form-col-index": e.subFormColIndex,
161
161
  data: e.model[e.widget.options.name]
162
162
  }, p({ _: 2 }, [
163
- l(Object.keys(t.$slots), (o) => ({
164
- name: o,
163
+ l(Object.keys(t.$slots), (i) => ({
164
+ name: i,
165
165
  fn: d((r) => [
166
- w(t.$slots, o, h({ ref_for: !0 }, r), void 0, !0)
166
+ w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
167
167
  ])
168
168
  }))
169
- ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data"])) : (i(), s(g(n.type + "-widget"), {
169
+ ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data"])) : (o(), s(g(n.type + "-widget"), {
170
170
  field: n,
171
171
  designer: null,
172
172
  key: a,
@@ -174,14 +174,14 @@ function G(t, _, e, Q, U, b) {
174
174
  "index-of-parent-list": a,
175
175
  "parent-widget": e.widget
176
176
  }, p({ _: 2 }, [
177
- l(Object.keys(t.$slots), (o) => ({
178
- name: o,
177
+ l(Object.keys(t.$slots), (i) => ({
178
+ name: i,
179
179
  fn: d((r) => [
180
- w(t.$slots, o, h({ ref_for: !0 }, r), void 0, !0)
180
+ w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
181
181
  ])
182
182
  }))
183
183
  ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget"]))
184
- ], 64))), 256)) : y("", !0)
184
+ ], 64))), 256)) : _("", !0)
185
185
  ], 2))
186
186
  ]),
187
187
  c(D, {
@@ -198,8 +198,8 @@ function G(t, _, e, Q, U, b) {
198
198
  ...JSON.parse(e.widget.options.bodyStyle || "{}")
199
199
  })
200
200
  }, [
201
- e.widget.defaultSlotsList && e.widget.defaultSlotsList.length > 0 ? (i(!0), m(u, { key: 0 }, l(e.widget.defaultSlotsList, (n, a) => (i(), m(u, null, [
202
- n.category === "container" ? (i(), s(g(t.getComponentByContainer(n)), {
201
+ e.widget.defaultSlotsList && e.widget.defaultSlotsList.length > 0 ? (o(!0), m(u, { key: 0 }, l(e.widget.defaultSlotsList, (n, a) => (o(), m(u, null, [
202
+ n.category === "container" ? (o(), s(g(t.getComponentByContainer(n)), {
203
203
  widget: n,
204
204
  key: a,
205
205
  "parent-list": e.widget.defaultSlotsList,
@@ -211,13 +211,13 @@ function G(t, _, e, Q, U, b) {
211
211
  data: e.model[n.options.name],
212
212
  model: e.model
213
213
  }, p({ _: 2 }, [
214
- l(Object.keys(t.$slots), (o) => ({
215
- name: o,
214
+ l(Object.keys(t.$slots), (i) => ({
215
+ name: i,
216
216
  fn: d((r) => [
217
- w(t.$slots, o, h({ ref_for: !0 }, r), void 0, !0)
217
+ w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
218
218
  ])
219
219
  }))
220
- ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data", "model"])) : (i(), s(g(n.type + "-widget"), {
220
+ ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "data", "model"])) : (o(), s(g(n.type + "-widget"), {
221
221
  field: n,
222
222
  designer: null,
223
223
  key: a,
@@ -225,14 +225,14 @@ function G(t, _, e, Q, U, b) {
225
225
  "index-of-parent-list": a,
226
226
  "parent-widget": e.widget
227
227
  }, p({ _: 2 }, [
228
- l(Object.keys(t.$slots), (o) => ({
229
- name: o,
228
+ l(Object.keys(t.$slots), (i) => ({
229
+ name: i,
230
230
  fn: d((r) => [
231
- w(t.$slots, o, h({ ref_for: !0 }, r), void 0, !0)
231
+ w(t.$slots, i, h({ ref_for: !0 }, r), void 0, !0)
232
232
  ])
233
233
  }))
234
234
  ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget"]))
235
- ], 64))), 256)) : y("", !0)
235
+ ], 64))), 256)) : _("", !0)
236
236
  ], 4), [
237
237
  [O, !e.widget.options.isCollapse]
238
238
  ])
@@ -1,7 +1,8 @@
1
- import { defineComponent as T, defineAsyncComponent as E, ref as b, getCurrentInstance as S, computed as F, onBeforeUnmount as L, resolveDirective as V, createBlock as I, openBlock as y, unref as f, mergeProps as N, withCtx as C, withDirectives as P, createElementBlock as U, createVNode as R, nextTick as W } from "vue";
2
- import { useComRef as A, TpfModal as H, http as q } from "tmgc2-share";
3
- import Q from "./SubmitButtonRender.vue.js";
4
- const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
1
+ import { defineComponent as T, defineAsyncComponent as E, ref as g, getCurrentInstance as M, computed as v, onBeforeUnmount as S, resolveDirective as L, createBlock as V, openBlock as b, unref as c, mergeProps as I, withCtx as C, withDirectives as J, createElementBlock as P, createVNode as y, nextTick as U } from "vue";
2
+ import { TpfModal as W } from "tmgc2-share";
3
+ import A from "./SubmitButtonRender.vue.js";
4
+ import { useLowcode as H } from "../../hooks/useLowcode.js";
5
+ const N = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
5
6
  name: "dynamic-dialog",
6
7
  __name: "dynamic-dialog",
7
8
  props: {
@@ -43,71 +44,60 @@ const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
43
44
  default: null
44
45
  }
45
46
  },
46
- setup(n, { expose: D }) {
47
- const u = E(() => import("./index.vue.js")), o = n, i = b(!1), l = b(!1), a = A(u), d = S(), h = F(() => ({
48
- ...o.parentFormRef,
49
- parentDom: d,
50
- getParentFormRef: v
51
- })), x = F(() => o.options.cancelButtonHidden && o.options.okButtonHidden ? { footer: null } : {});
52
- L(() => {
53
- var e, t;
54
- console.log(o.parentFormRef), (t = (e = o.parentFormRef) == null ? void 0 : e.setChildFormRef) == null || t.call(e, null);
47
+ setup(n, { expose: F }) {
48
+ const R = E(() => import("./index.vue.js")), e = n, f = g(!1), a = g(!1), i = M(), { vfdRef: l, formConfig: $, getComponentJson: x, goBack: q } = H({
49
+ formCode: e.options.formCode,
50
+ ...e.vfCtx
51
+ }), D = v(() => ({
52
+ ...e.parentFormRef,
53
+ parentDom: i,
54
+ getParentFormRef: m
55
+ })), O = v(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
56
+ S(() => {
57
+ var t, o;
58
+ console.log(e.parentFormRef), (o = (t = e.parentFormRef) == null ? void 0 : t.setChildFormRef) == null || o.call(t, null);
55
59
  });
56
- const m = async () => {
57
- var e, t;
58
- if (o.options.formCode) {
59
- i.value = !0;
60
- try {
61
- const s = await q.get("/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement", {
62
- params: { code: o.options.formCode }
63
- }).then((M) => M.data.object.frontendDefinition || "{}"), r = JSON.parse(s);
64
- console.log("formJson: ", r), (t = (e = a.value) == null ? void 0 : e.setFormJson) == null || t.call(e, r);
65
- } catch {
66
- }
67
- i.value = !1;
68
- }
69
- }, O = (e) => {
70
- console.log("setLoading", e), i.value = e;
71
- }, w = (e) => {
72
- a.value.setFormJson(e);
73
- }, k = (e) => {
74
- o.options.title = e;
75
- }, j = () => {
76
- l.value = !0;
77
- }, B = () => {
78
- l.value = !0, W(() => {
79
- var e;
80
- o.options.readMode && a.value.setReadMode(!0), m(), console.log(a.value), (e = a.value) == null || e.setDialogOrDrawerRef(d), o.parentFormRef && o.parentFormRef.setChildFormRef(a.value), g();
60
+ const h = (t) => {
61
+ console.log("setLoading", t), f.value = t;
62
+ }, w = (t) => {
63
+ e.options.title = t;
64
+ }, k = () => {
65
+ a.value = !0;
66
+ }, B = async () => {
67
+ a.value = !0, U(async () => {
68
+ var t, o;
69
+ e.options.readMode && ((t = l.value) == null || t.setReadMode(!0)), await x([], e.options.formCode), (o = l.value) == null || o.setDialogOrDrawerRef(i), e.parentFormRef && e.parentFormRef.setChildFormRef(l.value), p();
81
70
  });
82
- }, J = () => {
83
- o.options.onDialogBeforeClose && new Function("done", o.options.onDialogBeforeClose).call(d) === !1 || (l.value = !1);
84
- }, c = () => o.options.onDialogBeforeClose ? new Function(o.options.onDialogBeforeClose).call(d) : !0, p = () => {
85
- c() && (l.value = !1);
86
- }, g = () => {
87
- o.options.onDialogOpened && new Function(o.options.onDialogOpened).call(d);
88
- }, v = () => o.parentFormRef;
89
- return D({
90
- loadFormCode: m,
91
- setLoading: O,
92
- setFormJson: w,
93
- setTitle: k,
94
- beforeOpen: j,
71
+ }, j = () => {
72
+ e.options.onDialogBeforeClose && new Function("done", e.options.onDialogBeforeClose).call(i) === !1 || (a.value = !1);
73
+ }, r = () => e.options.onDialogBeforeClose ? new Function(e.options.onDialogBeforeClose).call(i) : !0, u = () => {
74
+ r() && (a.value = !1);
75
+ }, p = () => {
76
+ e.options.onDialogOpened && new Function(e.options.onDialogOpened).call(i);
77
+ }, m = () => e.parentFormRef;
78
+ return F({
79
+ setLoading: h,
80
+ setTitle: w,
81
+ beforeOpen: k,
95
82
  show: B,
96
- close: J,
97
- handleBeforeClose: c,
98
- handleCloseEvent: p,
99
- handleOpenedEvent: g,
100
- getParentFormRef: v,
101
- getFormRef: () => (console.log("getFormRef"), a.value),
102
- getWidgetRef: (e, t = !1) => a.value.getWidgetRef(e, t),
83
+ close: j,
84
+ handleBeforeClose: r,
85
+ handleCloseEvent: u,
86
+ handleOpenedEvent: p,
87
+ getParentFormRef: m,
88
+ getFormRef: () => (console.log("getFormRef"), l.value),
89
+ getWidgetRef: (t, o = !1) => {
90
+ var s;
91
+ return (s = l.value) == null ? void 0 : s.getWidgetRef(t, o);
92
+ },
103
93
  updateTable: () => {
104
- var e, t, s;
105
- (s = (t = (e = o.vfCtx) == null ? void 0 : e.parent) == null ? void 0 : t.exposed) != null && s.updateTable && o.vfCtx.parent.exposed.updateTable();
94
+ var t, o, s;
95
+ (s = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && s.updateTable && e.vfCtx.parent.exposed.updateTable();
106
96
  },
107
- getExtraData: () => o.extraData
108
- }), (e, t) => {
109
- const s = V("loading");
110
- return y(), I(f(H), N({
97
+ getExtraData: () => e.extraData
98
+ }), (t, o) => {
99
+ const s = L("loading");
100
+ return b(), V(c(W), I({
111
101
  class: "tpf-model design-model",
112
102
  destroyOnClose: !0,
113
103
  title: n.options.title,
@@ -117,40 +107,35 @@ const $ = { class: "dialog-content" }, ee = /* @__PURE__ */ T({
117
107
  ...JSON.parse(n.options.bodyStyle || "{}")
118
108
  },
119
109
  centered: !0,
120
- visible: l.value,
121
- "onUpdate:visible": t[1] || (t[1] = (r) => l.value = r),
110
+ visible: a.value,
111
+ "onUpdate:visible": o[1] || (o[1] = (d) => a.value = d),
122
112
  width: n.options.width,
123
113
  mask: n.options.showModal,
124
114
  maskClosable: n.options.closeOnClickModal,
125
115
  keyboard: n.options.closeOnPressEscape,
126
- onCancel: p
127
- }, x.value), {
116
+ onCancel: u
117
+ }, O.value), {
128
118
  footerRight: C(() => [
129
- R(Q, {
130
- "dialog-visible": l.value,
131
- "onUpdate:dialogVisible": t[0] || (t[0] = (r) => l.value = r),
132
- handleBeforeClose: c,
119
+ y(A, {
120
+ "dialog-visible": a.value,
121
+ "onUpdate:dialogVisible": o[0] || (o[0] = (d) => a.value = d),
122
+ handleBeforeClose: r,
133
123
  options: n.options,
134
- ctx: f(a)
124
+ ctx: c(l)
135
125
  }, null, 8, ["dialog-visible", "options", "ctx"])
136
126
  ]),
137
127
  default: C(() => [
138
- P((y(), U("div", $, [
139
- R(f(u), {
140
- isLoading: i.value,
141
- ref_key: "dFormRef",
142
- ref: a,
143
- "form-json": n.formJson,
144
- "form-data": n.formData,
128
+ J((b(), P("div", N, [
129
+ y(c(R), {
130
+ ref_key: "vfdRef",
131
+ ref: l,
145
132
  vfCtx: n.vfCtx,
146
- "option-data": n.optionData,
147
- "global-dsv": n.globalDsv,
148
- "parent-form": h.value,
133
+ "parent-form": D.value,
149
134
  "disabled-mode": n.options.disabledMode,
150
135
  "dynamic-creation": !0
151
- }, null, 8, ["isLoading", "form-json", "form-data", "vfCtx", "option-data", "global-dsv", "parent-form", "disabled-mode"])
136
+ }, null, 8, ["vfCtx", "parent-form", "disabled-mode"])
152
137
  ])), [
153
- [s, i.value]
138
+ [s, f.value]
154
139
  ])
155
140
  ]),
156
141
  _: 1