@kp-ui/lowcode 2.15.0-alpha.17 → 2.15.0-alpha.18

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.
@@ -1,12 +1,12 @@
1
- import { defineComponent as l, resolveComponent as g, createBlock as n, openBlock as t, normalizeProps as u, guardReactiveProps as c, withCtx as i, createElementBlock as d, createCommentVNode as f, unref as w, createVNode as h, Fragment as C, renderList as _ } from "vue";
2
- import k from "./container-wrapper.vue.js";
1
+ import { defineComponent as u, resolveComponent as c, createBlock as n, openBlock as t, normalizeProps as f, guardReactiveProps as w, withCtx as i, createElementBlock as d, createCommentVNode as h, unref as C, createVNode as _, Fragment as k, renderList as x } from "vue";
2
+ import E from "./container-wrapper.vue.js";
3
3
  import F from "./grid-col-widget.vue.js";
4
4
  import { ComponentNameEnum as N, ContainerTypeEnum as v } from "../../../constants/WidgetTypeEnum.js";
5
5
  import { useField as y } from "../../form-designer/form-widget/field-widget/useField.js";
6
6
  const B = {
7
7
  key: 0,
8
8
  class: "grid-container"
9
- }, H = /* @__PURE__ */ l({
9
+ }, V = /* @__PURE__ */ u({
10
10
  name: v.grid,
11
11
  componentName: N.ContainerWidget,
12
12
  __name: "grid-widget",
@@ -20,23 +20,25 @@ const B = {
20
20
  subFormRowId: {},
21
21
  designer: {}
22
22
  },
23
- setup(a) {
24
- const o = a, { handleHidden: p } = y(o);
25
- return (e, E) => {
26
- const s = g("a-row");
27
- return t(), n(k, u(c(o)), {
23
+ setup(a, { expose: p }) {
24
+ const r = a, { handleHidden: s, defineExposed: m } = y(r);
25
+ return p({
26
+ ...m
27
+ }), (e, L) => {
28
+ const l = c("a-row");
29
+ return t(), n(E, f(w(r)), {
28
30
  default: i(() => [
29
- w(p) ? f("", !0) : (t(), d("div", B, [
30
- h(s, {
31
+ C(s) ? h("", !0) : (t(), d("div", B, [
32
+ _(l, {
31
33
  gutter: e.widget.options.gutter
32
34
  }, {
33
35
  default: i(() => [
34
- (t(!0), d(C, null, _(e.widget.cols, (r, m) => (t(), n(F, {
35
- key: r.id,
36
- field: r,
37
- widget: r,
36
+ (t(!0), d(k, null, x(e.widget.cols, (o, g) => (t(), n(F, {
37
+ key: o.id,
38
+ field: o,
39
+ widget: o,
38
40
  "parent-list": e.widget.cols || [],
39
- "index-of-parent-list": m,
41
+ "index-of-parent-list": g,
40
42
  "parent-widget": e.widget,
41
43
  "col-height": e.widget.options.colHeight
42
44
  }, null, 8, ["field", "widget", "parent-list", "index-of-parent-list", "parent-widget", "col-height"]))), 128))
@@ -51,5 +53,5 @@ const B = {
51
53
  }
52
54
  });
53
55
  export {
54
- H as default
56
+ V as default
55
57
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as M, computed as f, ref as u, onBeforeUnmount as S, createBlock as V, openBlock as N, unref as i, mergeProps as H, withCtx as y, createElementVNode as J, createVNode as x, nextTick as L } from "vue";
2
- import { useExecFunction as P, TpfModal as U } from "tmgc2-share";
3
- import A from "./SubmitButtonRender.vue.js";
4
- import { useLowcode as I } from "../../hooks/useLowcode.js";
5
- import $ from "../FormRender/index.vue.js";
6
- const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
1
+ import { defineComponent as L, computed as d, ref as u, onBeforeUnmount as P, createBlock as U, openBlock as A, unref as f, mergeProps as I, withCtx as x, createElementVNode as $, createVNode as C, nextTick as q } from "vue";
2
+ import { useExecFunction as z, TpfModal as G } from "tmgc2-share";
3
+ import K from "./SubmitButtonRender.vue.js";
4
+ import { useLowcode as Q } from "../../hooks/useLowcode.js";
5
+ import W from "../FormRender/index.vue.js";
6
+ const X = { class: "dialog-content" }, oe = /* @__PURE__ */ L({
7
7
  name: "dynamic-dialog",
8
8
  __name: "dynamic-dialog",
9
9
  props: {
@@ -45,16 +45,16 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
45
45
  default: null
46
46
  }
47
47
  },
48
- setup(n, { expose: C }) {
49
- const e = n, D = f(() => e.options.height || "500px"), c = u(null), p = u(!1), l = u(!1), { context: r, asyncExecuteFunction: m, executeFunction: R } = P(), { vfdRef: s, formConfig: z, isLoading: v, getComponentJson: F, goBack: G } = I({
48
+ setup(n, { expose: D }) {
49
+ const e = n, F = d(() => e.options.height || "500px"), c = u(null), p = u(!1), l = u(!1), { context: i, asyncExecuteFunction: m, executeFunction: O } = z(), { vfdRef: s, isLoading: v, getComponentJson: R } = Q({
50
50
  formCode: e.options.formCode,
51
51
  ...e.vfCtx
52
- }), O = f(() => ({
52
+ }), h = d(() => ({
53
53
  ...e.parentFormRef,
54
- parentDom: r.value,
55
- getParentFormRef: E
56
- })), h = f(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
57
- S(() => {
54
+ parentDom: i.value,
55
+ getParentFormRef: y
56
+ })), w = d(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
57
+ P(() => {
58
58
  var t, o;
59
59
  console.log(e.parentFormRef), (o = (t = e.parentFormRef) == null ? void 0 : t.setChildFormRef) == null || o.call(t, null);
60
60
  });
@@ -62,56 +62,60 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
62
62
  v.value = t;
63
63
  }, k = (t) => {
64
64
  e.options.title = t;
65
- }, w = () => {
65
+ }, j = () => {
66
66
  l.value = !0;
67
- }, T = () => {
68
- l.value = !0, L(async () => {
67
+ }, E = () => {
68
+ l.value = !0, q(async () => {
69
69
  var t, o, a;
70
- (t = e.options) != null && t.readMode && ((o = s.value) == null || o.setReadMode(!0)), await F([], e.options.formCode), (a = s.value) == null || a.setDialogOrDrawerRef(r.value), e.parentFormRef && e.parentFormRef.setChildFormRef(s.value), g();
70
+ (t = e.options) != null && t.readMode && ((o = s.value) == null || o.setReadMode(!0)), await R([], e.options.formCode), (a = s.value) == null || a.setDialogOrDrawerRef(i.value), e.parentFormRef && e.parentFormRef.setChildFormRef(s.value), g();
71
71
  });
72
- }, j = async () => {
72
+ }, T = async () => {
73
73
  if (e.options.onDialogBeforeClose)
74
74
  return await m({
75
75
  functionBody: e.options.onDialogBeforeClose
76
76
  });
77
77
  l.value = !1;
78
78
  }, b = () => {
79
- d() && (l.value = !1);
80
- }, d = async () => e.options.onDialogBeforeClose ? R({
79
+ r() && (l.value = !1);
80
+ }, r = async () => e.options.onDialogBeforeClose ? O({
81
81
  functionBody: e.options.onDialogBeforeClose
82
82
  }) : !0, g = async () => {
83
83
  if (e.options.onDialogOpened)
84
84
  return await m({
85
85
  functionBody: e.options.onDialogOpened
86
86
  });
87
- }, E = () => e.parentFormRef;
88
- return C({
89
- getFormRef: () => s.value,
90
- setDisabled: (t) => {
91
- p.value = t;
92
- },
93
- setleftText: (t) => {
94
- c.value = t;
95
- },
87
+ }, y = () => e.parentFormRef, M = () => {
88
+ var t, o, a;
89
+ (a = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && a.updateTable && e.vfCtx.parent.exposed.updateTable();
90
+ }, S = () => e.extraData, V = (t) => {
91
+ c.value = t;
92
+ }, N = (t) => {
93
+ p.value = t;
94
+ }, H = () => s.value, J = () => {
95
+ var t;
96
+ return (t = s.value) == null ? void 0 : t.context;
97
+ };
98
+ return D({
99
+ getParentFormRef: y,
100
+ getFormRef: H,
101
+ setDisabled: N,
102
+ setleftText: V,
96
103
  setLoading: B,
97
104
  setTitle: k,
98
- beforeOpen: w,
99
- show: T,
100
- close: j,
101
- handleBeforeClose: d,
105
+ beforeOpen: j,
106
+ show: E,
107
+ close: T,
108
+ handleBeforeClose: r,
102
109
  handleCloseEvent: b,
103
110
  handleOpenedEvent: g,
104
- updateTable: () => {
105
- var t, o, a;
106
- (a = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && a.updateTable && e.vfCtx.parent.exposed.updateTable();
107
- },
108
- getExtraData: () => e.extraData
109
- }), (t, o) => (N(), V(i(U), H({
111
+ updateTable: M,
112
+ getExtraData: S
113
+ }), (t, o) => (A(), U(f(G), I({
110
114
  class: "tpf-model design-model",
111
115
  destroyOnClose: !0,
112
116
  title: n.options.title,
113
117
  bodyStyle: {
114
- height: D.value,
118
+ height: F.value,
115
119
  overflow: "auto",
116
120
  ...JSON.parse(n.options.bodyStyle || "{}")
117
121
  },
@@ -124,28 +128,28 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
124
128
  keyboard: n.options.closeOnPressEscape,
125
129
  onCancel: b,
126
130
  "left-num": c.value
127
- }, h.value), {
128
- footerRight: y(() => [
129
- x(A, {
131
+ }, w.value), {
132
+ footerRight: x(() => [
133
+ C(K, {
130
134
  disabled: p.value,
131
135
  "dialog-visible": l.value,
132
136
  "onUpdate:dialogVisible": o[0] || (o[0] = (a) => l.value = a),
133
- handleBeforeClose: d,
137
+ handleBeforeClose: r,
134
138
  options: n.options,
135
- ctx: i(s)
139
+ ctx: J()
136
140
  }, null, 8, ["disabled", "dialog-visible", "options", "ctx"])
137
141
  ]),
138
- default: y(() => [
139
- J("div", q, [
140
- x($, {
142
+ default: x(() => [
143
+ $("div", X, [
144
+ C(W, {
141
145
  ref_key: "vfdRef",
142
146
  ref: s,
143
- loading: i(v),
147
+ loading: f(v),
144
148
  vfCtx: {
145
149
  ...n.vfCtx,
146
- instance: i(r)
150
+ instance: f(i)
147
151
  },
148
- "parent-form": O.value,
152
+ "parent-form": h.value,
149
153
  "disabled-mode": n.options.disabledMode,
150
154
  "dynamic-creation": !0
151
155
  }, null, 8, ["loading", "vfCtx", "parent-form", "disabled-mode"])
@@ -156,5 +160,5 @@ const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
156
160
  }
157
161
  });
158
162
  export {
159
- ne as default
163
+ oe as default
160
164
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as N, getCurrentInstance as R, useAttrs as T, ref as f, computed as c, onMounted as $, createBlock as M, openBlock as B, unref as r, withCtx as n, createVNode as s, mergeProps as D, nextTick as L } from "vue";
2
- import { useLowcode as P } from "../../../hooks/useLowcode.js";
3
- import U from "../../form-render/SubmitButtonRender.vue.js";
4
- import A from "../../FormRender/index.vue.js";
5
- import { TpfConfigProvider as F, TpfModal as I } from "tmgc2-share";
6
- import { Skeleton as J } from "ant-design-vue";
1
+ import { defineComponent as R, getCurrentInstance as T, useAttrs as $, ref as f, computed as c, onMounted as M, createBlock as B, openBlock as D, unref as r, withCtx as s, createVNode as a, mergeProps as L, nextTick as P } from "vue";
2
+ import { useLowcode as U } from "../../../hooks/useLowcode.js";
3
+ import A from "../../form-render/SubmitButtonRender.vue.js";
4
+ import F from "../../FormRender/index.vue.js";
5
+ import { TpfConfigProvider as I, TpfModal as J } from "tmgc2-share";
6
+ import { Skeleton as S } from "ant-design-vue";
7
7
  import "../../../utils/i18n.js";
8
- const H = /* @__PURE__ */ N({
8
+ const K = /* @__PURE__ */ R({
9
9
  __name: "CustomerModal",
10
10
  props: {
11
11
  title: {},
@@ -15,7 +15,7 @@ const H = /* @__PURE__ */ N({
15
15
  setup(v, {
16
16
  expose: g
17
17
  }) {
18
- const u = R(), i = T() || {}, l = f(!1), e = v, C = c(() => {
18
+ const u = T(), i = $() || {}, l = f(!1), e = v, C = c(() => {
19
19
  var t, o;
20
20
  return {
21
21
  $router: u.proxy.$router,
@@ -26,44 +26,47 @@ const H = /* @__PURE__ */ N({
26
26
  };
27
27
  }), d = f(!1), {
28
28
  vfdRef: p,
29
- formConfig: b,
30
- getComponentJson: x,
29
+ formConfig: x,
30
+ getComponentJson: b,
31
31
  isLoading: y
32
- } = P({
32
+ } = U({
33
33
  formCode: e.formCode,
34
34
  type: e.type
35
35
  }), m = f(null), _ = c(() => e.title ? e.title : e.type === "add" ? "新增" : e.type === "edit" ? "编辑" : e.type === "view" ? "查看" : "新增"), w = async () => {
36
- l.value = !0, await L(), await x([]), console.log("attrs", i);
36
+ l.value = !0, await P(), await b([]), console.log("attrs", i);
37
37
  }, k = (t) => {
38
38
  m.value = t;
39
39
  }, V = (t) => {
40
40
  d.value = t;
41
41
  };
42
- return $(() => {
42
+ return M(() => {
43
43
  w();
44
44
  }), g({
45
45
  setDisabled: V,
46
46
  setleftText: k
47
- }), (t, o) => (B(), M(r(F), null, {
48
- default: n(() => [s(r(I), D({
47
+ }), (t, o) => (D(), B(r(I), null, {
48
+ default: s(() => [a(r(J), L({
49
49
  visible: l.value,
50
- "onUpdate:visible": o[1] || (o[1] = (a) => l.value = a)
50
+ "onUpdate:visible": o[1] || (o[1] = (n) => l.value = n)
51
51
  }, t.$attrs, {
52
52
  title: _.value,
53
53
  leftNum: m.value
54
54
  }), {
55
- footerRight: n(() => [s(U, {
56
- disabled: d.value,
57
- dialogVisible: l.value,
58
- "onUpdate:dialogVisible": o[0] || (o[0] = (a) => l.value = a),
59
- options: r(b),
60
- ctx: r(p)
61
- }, null, 8, ["disabled", "dialogVisible", "options", "ctx"])]),
62
- default: n(() => [s(r(J), {
55
+ footerRight: s(() => {
56
+ var n;
57
+ return [a(A, {
58
+ disabled: d.value,
59
+ dialogVisible: l.value,
60
+ "onUpdate:dialogVisible": o[0] || (o[0] = (N) => l.value = N),
61
+ options: r(x),
62
+ ctx: (n = r(p)) == null ? void 0 : n.context
63
+ }, null, 8, ["disabled", "dialogVisible", "options", "ctx"])];
64
+ }),
65
+ default: s(() => [a(r(S), {
63
66
  active: "",
64
67
  loading: r(y)
65
68
  }, {
66
- default: n(() => [s(A, {
69
+ default: s(() => [a(F, {
67
70
  vfCtx: C.value,
68
71
  ref_key: "vfdRef",
69
72
  ref: p
@@ -77,5 +80,5 @@ const H = /* @__PURE__ */ N({
77
80
  }
78
81
  });
79
82
  export {
80
- H as default
83
+ K as default
81
84
  };