@kp-ui/lowcode 2.14.0-beta.22 → 2.14.0-beta.23

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