sy-form-designer 1.0.21 → 1.0.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.
@@ -0,0 +1,296 @@
1
+ import { mergeModels as Q, useModel as X, ref as a, computed as Y, onMounted as Z, provide as S, resolveComponent as n, createElementBlock as U, openBlock as _, createVNode as o, withCtx as l, createElementVNode as c, createTextVNode as s, createBlock as J, createCommentVNode as h, Fragment as ee, renderList as oe } from "vue";
2
+ import le from "./settings-EOHsUDJM.js";
3
+ import { _ as te } from "./index-DYcISXeA.js";
4
+ const ne = { class: "form-designer" }, ae = { class: "toolbar-container" }, de = {
5
+ class: "right-toolbar",
6
+ style: { float: "right", display: "flex", "line-height": "42px" }
7
+ }, ue = { class: "right-toolbar-con" }, se = { class: "dialog-footer" }, fe = {
8
+ __name: "designer",
9
+ props: /* @__PURE__ */ Q({
10
+ mode: {
11
+ type: String,
12
+ default: () => "edit"
13
+ }
14
+ }, {
15
+ conf: {
16
+ type: Object,
17
+ default: () => {
18
+ }
19
+ },
20
+ confModifiers: {}
21
+ }),
22
+ emits: ["update:conf"],
23
+ setup(V) {
24
+ const r = X(V, "conf"), i = a(null), b = a(null), f = a(""), F = a({
25
+ fontSize: "14px",
26
+ // 设置字体大小
27
+ showPrintMargin: !1,
28
+ // 是否显示打印边距
29
+ enableLiveAutocompletion: !0
30
+ // 启用实时自动补全功能
31
+ }), m = a(!1), R = () => {
32
+ f.value = JSON.stringify(r.value, null, 2), m.value = !0;
33
+ }, M = () => {
34
+ r.value = JSON.parse(f.value), m.value = !1;
35
+ }, j = a({}), p = a(null), w = a({}), v = a(!1), D = () => {
36
+ w.value = JSON.parse(JSON.stringify(r.value)), v.value = !0;
37
+ }, B = () => {
38
+ p.value.getWidgetForm().validate(() => {
39
+ });
40
+ }, G = () => {
41
+ console.log(p.value.getFormData());
42
+ }, T = () => {
43
+ console.log(p.value.getFormInfo());
44
+ }, g = a(null), $ = Y(() => g.value.allCustomComps.map((y) => ({
45
+ label: y.name,
46
+ value: y.name
47
+ }))), d = a({
48
+ show: !1,
49
+ data: {
50
+ cateName: ""
51
+ }
52
+ }), E = () => {
53
+ d.value.show = !0;
54
+ }, I = () => {
55
+ g.value.defineCustomComponent(i.value, d.value.data.cateName), d.value.show = !1;
56
+ };
57
+ return Z(() => {
58
+ }), S("renderConf", r), S("designerRender", b), (y, e) => {
59
+ const L = n("sy-widgets"), k = n("el-aside"), u = n("el-button"), x = n("el-button-group"), P = n("el-header"), N = n("sy-render"), z = n("el-scrollbar"), A = n("el-main"), O = n("el-container"), C = n("el-dialog"), H = n("el-option"), W = n("el-select"), q = n("el-form-item"), K = n("el-form");
60
+ return _(), U("div", ne, [
61
+ o(O, null, {
62
+ default: l(() => [
63
+ o(k, {
64
+ class: "aside-component",
65
+ style: { display: "flex", "flex-direction": "column" }
66
+ }, {
67
+ default: l(() => [
68
+ o(L, {
69
+ ref_key: "widgetTools",
70
+ ref: g
71
+ }, null, 512)
72
+ ]),
73
+ _: 1
74
+ }),
75
+ o(O, {
76
+ direction: "vertical",
77
+ style: { "min-width": "500px" }
78
+ }, {
79
+ default: l(() => [
80
+ o(P, { style: { height: "42px", padding: "0 8px" } }, {
81
+ default: l(() => [
82
+ c("div", ae, [
83
+ c("div", de, [
84
+ c("div", ue, [
85
+ o(x, { style: { "margin-right": "4px" } }, {
86
+ default: l(() => [
87
+ o(u, {
88
+ type: "primary",
89
+ icon: "el-icon-edit",
90
+ onClick: R
91
+ }, {
92
+ default: l(() => e[11] || (e[11] = [
93
+ s("编辑JSON")
94
+ ])),
95
+ _: 1
96
+ }),
97
+ o(u, {
98
+ type: "primary",
99
+ icon: "el-icon-edit",
100
+ onClick: D
101
+ }, {
102
+ default: l(() => e[12] || (e[12] = [
103
+ s("预览")
104
+ ])),
105
+ _: 1
106
+ })
107
+ ]),
108
+ _: 1
109
+ }),
110
+ o(x, null, {
111
+ default: l(() => [
112
+ o(u, {
113
+ type: "primary",
114
+ icon: "el-icon-delete"
115
+ }, {
116
+ default: l(() => e[13] || (e[13] = [
117
+ s("清空")
118
+ ])),
119
+ _: 1
120
+ })
121
+ ]),
122
+ _: 1
123
+ })
124
+ ])
125
+ ])
126
+ ])
127
+ ]),
128
+ _: 1
129
+ }),
130
+ o(A, { style: { padding: "0px" } }, {
131
+ default: l(() => [
132
+ o(z, null, {
133
+ default: l(() => [
134
+ o(N, {
135
+ ref_key: "designerRender",
136
+ ref: b,
137
+ conf: r.value,
138
+ mode: V.mode,
139
+ active: i.value,
140
+ "onUpdate:active": e[0] || (e[0] = (t) => i.value = t),
141
+ onCustomComp: E
142
+ }, null, 8, ["conf", "mode", "active"])
143
+ ]),
144
+ _: 1
145
+ })
146
+ ]),
147
+ _: 1
148
+ })
149
+ ]),
150
+ _: 1
151
+ }),
152
+ o(k, null, {
153
+ default: l(() => [
154
+ o(le, {
155
+ conf: i.value,
156
+ "onUpdate:conf": e[1] || (e[1] = (t) => i.value = t),
157
+ form: r.value.formConfig,
158
+ "onUpdate:form": e[2] || (e[2] = (t) => r.value.formConfig = t)
159
+ }, null, 8, ["conf", "form"])
160
+ ]),
161
+ _: 1
162
+ })
163
+ ]),
164
+ _: 1
165
+ }),
166
+ o(C, {
167
+ title: "编辑JSON",
168
+ modelValue: m.value,
169
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => m.value = t)
170
+ }, {
171
+ footer: l(() => [
172
+ c("div", se, [
173
+ o(u, {
174
+ onClick: e[4] || (e[4] = (t) => m.value = !1)
175
+ }, {
176
+ default: l(() => e[14] || (e[14] = [
177
+ s("取消")
178
+ ])),
179
+ _: 1
180
+ }),
181
+ o(u, {
182
+ type: "primary",
183
+ onClick: M
184
+ }, {
185
+ default: l(() => e[15] || (e[15] = [
186
+ s("确定")
187
+ ])),
188
+ _: 1
189
+ })
190
+ ])
191
+ ]),
192
+ default: l(() => [
193
+ o(te, {
194
+ lang: "json",
195
+ options: F.value,
196
+ modelValue: f.value,
197
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => f.value = t)
198
+ }, null, 8, ["options", "modelValue"])
199
+ ]),
200
+ _: 1
201
+ }, 8, ["modelValue"]),
202
+ o(C, {
203
+ title: "表单预览",
204
+ modelValue: v.value,
205
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => v.value = t)
206
+ }, {
207
+ footer: l(() => [
208
+ o(u, { onClick: T }, {
209
+ default: l(() => e[16] || (e[16] = [
210
+ s("获取表单文本")
211
+ ])),
212
+ _: 1
213
+ }),
214
+ o(u, { onClick: G }, {
215
+ default: l(() => e[17] || (e[17] = [
216
+ s("获取表单数据")
217
+ ])),
218
+ _: 1
219
+ }),
220
+ o(u, { onClick: B }, {
221
+ default: l(() => e[18] || (e[18] = [
222
+ s("验证")
223
+ ])),
224
+ _: 1
225
+ })
226
+ ]),
227
+ default: l(() => [
228
+ v.value ? (_(), J(N, {
229
+ key: 0,
230
+ ref_key: "previewRenderRef",
231
+ ref: p,
232
+ "form-data": j.value,
233
+ conf: w.value,
234
+ mode: "view"
235
+ }, null, 8, ["form-data", "conf"])) : h("", !0)
236
+ ]),
237
+ _: 1
238
+ }, 8, ["modelValue"]),
239
+ o(C, {
240
+ title: "自定义组件",
241
+ modelValue: d.value.show,
242
+ "onUpdate:modelValue": e[10] || (e[10] = (t) => d.value.show = t)
243
+ }, {
244
+ footer: l(() => [
245
+ o(u, {
246
+ onClick: e[9] || (e[9] = (t) => d.value.show = !1)
247
+ }, {
248
+ default: l(() => e[19] || (e[19] = [
249
+ s("取消")
250
+ ])),
251
+ _: 1
252
+ }),
253
+ o(u, { onClick: I }, {
254
+ default: l(() => e[20] || (e[20] = [
255
+ s("确定")
256
+ ])),
257
+ _: 1
258
+ })
259
+ ]),
260
+ default: l(() => [
261
+ o(K, {
262
+ modelValue: d.value.data,
263
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => d.value.data = t)
264
+ }, {
265
+ default: l(() => [
266
+ o(q, { label: "分类名称" }, {
267
+ default: l(() => [
268
+ o(W, {
269
+ modelValue: d.value.data.cateName,
270
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => d.value.data.cateName = t),
271
+ clearable: ""
272
+ }, {
273
+ default: l(() => [
274
+ (_(!0), U(ee, null, oe($.value, (t) => (_(), J(H, {
275
+ label: t.label,
276
+ value: t.value
277
+ }, null, 8, ["label", "value"]))), 256))
278
+ ]),
279
+ _: 1
280
+ }, 8, ["modelValue"])
281
+ ]),
282
+ _: 1
283
+ })
284
+ ]),
285
+ _: 1
286
+ }, 8, ["modelValue"])
287
+ ]),
288
+ _: 1
289
+ }, 8, ["modelValue"])
290
+ ]);
291
+ };
292
+ }
293
+ };
294
+ export {
295
+ fe as default
296
+ };
@@ -1,5 +1,5 @@
1
1
  import { useAttrs as F, ref as c, computed as N, inject as j, watch as b, resolveComponent as m, createElementBlock as f, openBlock as u, createVNode as M, unref as n, withCtx as y, createCommentVNode as g, createTextVNode as a, Fragment as v, createElementVNode as p, toDisplayString as U, createBlock as L } from "vue";
2
- import { u as z } from "./ossHook-g6Eqk_cJ.js";
2
+ import { u as z } from "./ossHook-WDd0RZ0t.js";
3
3
  const A = { class: "flex justify-center" }, O = {
4
4
  key: 0,
5
5
  class: "el-upload__tip font-bold"
@@ -1,10 +1,10 @@
1
- import { getCurrentInstance as A, inject as z, ref as O, computed as d, unref as l, watch as W, isRef as ct, warn as ut, provide as dt, defineComponent as $, createElementBlock as U, openBlock as T, mergeProps as pt, renderSlot as L, normalizeClass as I, createVNode as se, Transition as je, withCtx as H, withDirectives as Me, createElementVNode as re, normalizeStyle as De, createTextVNode as ft, toDisplayString as Fe, vShow as Be, shallowReactive as gt, onMounted as mt, createBlock as F, createCommentVNode as R, resolveDynamicComponent as yt, Fragment as ht, withModifiers as vt, isVNode as Ae, render as ge } from "vue";
2
- import { i as bt, n as _t, r as Le, t as ke, c as Y, d as Ct, e as Ot, f as Z, g as N, h as Ve, j as me, k as J, l as wt, m as St, o as Tt, q as It, w as xt, s as Nt, v as Et, x as $t, y as Pt, z as ye } from "./index-CHjKzgsu.js";
1
+ import { getCurrentInstance as B, inject as z, ref as O, computed as d, unref as l, watch as W, isRef as ct, warn as ut, provide as dt, defineComponent as $, createElementBlock as U, openBlock as T, mergeProps as pt, renderSlot as L, normalizeClass as I, createVNode as se, Transition as je, withCtx as H, withDirectives as Me, createElementVNode as re, normalizeStyle as De, createTextVNode as ft, toDisplayString as Fe, vShow as Ae, shallowReactive as gt, onMounted as mt, createBlock as F, createCommentVNode as R, resolveDynamicComponent as yt, Fragment as ht, withModifiers as vt, isVNode as Be, render as ge } from "vue";
2
+ import { i as bt, n as _t, r as Le, t as ke, d as Y, e as Ct, f as Ot, g as Z, h as N, j as Ve, k as me, l as J, m as wt, o as St, q as Tt, s as It, w as xt, v as Nt, x as Et, y as $t, z as Pt, A as ye } from "./index-DWbO-nXt.js";
3
3
  const Ke = Symbol(), G = "el", zt = "is-", x = (e, n, t, o, r) => {
4
4
  let s = `${e}-${n}`;
5
5
  return t && (s += `-${t}`), o && (s += `__${o}`), r && (s += `--${r}`), s;
6
6
  }, Re = Symbol("namespaceContextKey"), jt = (e) => {
7
- const n = e || (A() ? z(Re, O(G)) : O(G));
7
+ const n = e || (B() ? z(Re, O(G)) : O(G));
8
8
  return d(() => l(n) || G);
9
9
  }, ie = (e, n) => {
10
10
  const t = jt(n);
@@ -37,16 +37,16 @@ const Ke = Symbol(), G = "el", zt = "is-", x = (e, n, t, o, r) => {
37
37
  cssVarBlockName: (c) => `--${t.value}-${e}-${c}`
38
38
  };
39
39
  };
40
- var Mt = typeof global == "object" && global && global.Object === Object && global, Dt = typeof self == "object" && self && self.Object === Object && self, le = Mt || Dt || Function("return this")(), j = le.Symbol, He = Object.prototype, Ft = He.hasOwnProperty, Bt = He.toString, B = j ? j.toStringTag : void 0;
41
- function At(e) {
42
- var n = Ft.call(e, B), t = e[B];
40
+ var Mt = typeof global == "object" && global && global.Object === Object && global, Dt = typeof self == "object" && self && self.Object === Object && self, le = Mt || Dt || Function("return this")(), j = le.Symbol, He = Object.prototype, Ft = He.hasOwnProperty, At = He.toString, A = j ? j.toStringTag : void 0;
41
+ function Bt(e) {
42
+ var n = Ft.call(e, A), t = e[A];
43
43
  try {
44
- e[B] = void 0;
44
+ e[A] = void 0;
45
45
  var o = !0;
46
46
  } catch {
47
47
  }
48
- var r = Bt.call(e);
49
- return o && (n ? e[B] = t : delete e[B]), r;
48
+ var r = At.call(e);
49
+ return o && (n ? e[A] = t : delete e[A]), r;
50
50
  }
51
51
  var Lt = Object.prototype, kt = Lt.toString;
52
52
  function Vt(e) {
@@ -54,7 +54,7 @@ function Vt(e) {
54
54
  }
55
55
  var Kt = "[object Null]", Rt = "[object Undefined]", he = j ? j.toStringTag : void 0;
56
56
  function Ge(e) {
57
- return e == null ? e === void 0 ? Rt : Kt : he && he in Object(e) ? At(e) : Vt(e);
57
+ return e == null ? e === void 0 ? Rt : Kt : he && he in Object(e) ? Bt(e) : Vt(e);
58
58
  }
59
59
  function Ht(e) {
60
60
  return e != null && typeof e == "object";
@@ -232,11 +232,11 @@ function X(e, n) {
232
232
  var t = e.__data__;
233
233
  return Fn(n) ? t[typeof n == "string" ? "string" : "hash"] : t.map;
234
234
  }
235
- function Bn(e) {
235
+ function An(e) {
236
236
  var n = X(this, e).delete(e);
237
237
  return this.size -= n ? 1 : 0, n;
238
238
  }
239
- function An(e) {
239
+ function Bn(e) {
240
240
  return X(this, e).get(e);
241
241
  }
242
242
  function Ln(e) {
@@ -254,8 +254,8 @@ function P(e) {
254
254
  }
255
255
  }
256
256
  P.prototype.clear = Dn;
257
- P.prototype.delete = Bn;
258
- P.prototype.get = An;
257
+ P.prototype.delete = An;
258
+ P.prototype.get = Bn;
259
259
  P.prototype.has = Ln;
260
260
  P.prototype.set = kn;
261
261
  var Vn = "Expected a function";
@@ -419,7 +419,7 @@ function ee(e, n) {
419
419
  const xe = {
420
420
  current: 0
421
421
  }, Ne = O(0), Ye = 2e3, Ee = Symbol("elZIndexContextKey"), qe = Symbol("zIndexContextKey"), po = (e) => {
422
- const n = A() ? z(Ee, xe) : xe, t = e || (A() ? z(qe, void 0) : void 0), o = d(() => {
422
+ const n = B() ? z(Ee, xe) : xe, t = e || (B() ? z(qe, void 0) : void 0), o = d(() => {
423
423
  const a = l(t);
424
424
  return N(a) ? a : Ye;
425
425
  }), r = d(() => o.value + Ne.value), s = () => (n.current++, Ne.value = n.current, r.value);
@@ -655,7 +655,7 @@ const go = (e) => (n, t) => mo(n, t, l(e)), mo = (e, n, t) => Yn(t, e, e).replac
655
655
  }
656
656
  }), $e = (e) => Object.keys(e), Q = O();
657
657
  function nt(e, n = void 0) {
658
- return A() ? z(Ke, Q) : Q;
658
+ return B() ? z(Ke, Q) : Q;
659
659
  }
660
660
  function So(e, n) {
661
661
  const t = nt(), o = ie(e, d(() => {
@@ -680,7 +680,7 @@ function So(e, n) {
680
680
  }
681
681
  const ot = (e, n, t = !1) => {
682
682
  var o;
683
- const r = !!A(), s = r ? nt() : void 0, a = (o = void 0) != null ? o : r ? dt : void 0;
683
+ const r = !!B(), s = r ? nt() : void 0, a = (o = void 0) != null ? o : r ? dt : void 0;
684
684
  if (!a) {
685
685
  ee("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
686
686
  return;
@@ -796,10 +796,10 @@ const Pe = rt(Po), zo = C([
796
796
  badgeClass: {
797
797
  type: String
798
798
  }
799
- }), Bo = $({
799
+ }), Ao = $({
800
800
  name: "ElBadge"
801
- }), Ao = /* @__PURE__ */ $({
802
- ...Bo,
801
+ }), Bo = /* @__PURE__ */ $({
802
+ ...Ao,
803
803
  props: Fo,
804
804
  setup(e, { expose: n }) {
805
805
  const t = e, o = ie("badge"), r = d(() => t.isDot ? "" : N(t.value) && N(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = d(() => {
@@ -839,7 +839,7 @@ const Pe = rt(Po), zo = C([
839
839
  ft(Fe(l(r)), 1)
840
840
  ])
841
841
  ], 6), [
842
- [Be, !a.hidden && (l(r) || a.isDot || a.$slots.content)]
842
+ [Ae, !a.hidden && (l(r) || a.isDot || a.$slots.content)]
843
843
  ])
844
844
  ]),
845
845
  _: 3
@@ -847,7 +847,7 @@ const Pe = rt(Po), zo = C([
847
847
  ], 2));
848
848
  }
849
849
  });
850
- var Lo = /* @__PURE__ */ pe(Ao, [["__file", "badge.vue"]]);
850
+ var Lo = /* @__PURE__ */ pe(Bo, [["__file", "badge.vue"]]);
851
851
  const ko = rt(Lo), Vo = V({
852
852
  a11y: {
853
853
  type: Boolean,
@@ -1082,7 +1082,7 @@ const at = ["success", "info", "warning", "error"], h = Mo({
1082
1082
  _: 1
1083
1083
  }, 8, ["class", "onClick"])) : R("v-if", !0)
1084
1084
  ], 46, ["id"]), [
1085
- [Be, m.value]
1085
+ [Ae, m.value]
1086
1086
  ])
1087
1087
  ]),
1088
1088
  _: 3
@@ -1092,7 +1092,7 @@ const at = ["success", "info", "warning", "error"], h = Mo({
1092
1092
  var Qo = /* @__PURE__ */ pe(Jo, [["__file", "message.vue"]]);
1093
1093
  let Wo = 1;
1094
1094
  const st = (e) => {
1095
- const n = !e || Z(e) || Ae(e) || J(e) ? { message: e } : e, t = {
1095
+ const n = !e || Z(e) || Be(e) || J(e) ? { message: e } : e, t = {
1096
1096
  ...h,
1097
1097
  ...n
1098
1098
  };
@@ -1120,7 +1120,7 @@ const st = (e) => {
1120
1120
  onDestroy: () => {
1121
1121
  ge(null, s);
1122
1122
  }
1123
- }, i = se(Qo, a, J(a.message) || Ae(a.message) ? {
1123
+ }, i = se(Qo, a, J(a.message) || Be(a.message) ? {
1124
1124
  default: J(a.message) ? a.message : () => a.message
1125
1125
  } : null);
1126
1126
  i.appContext = t || M._context, ge(i, s), e.appendChild(s.firstElementChild);
@@ -1,8 +1,8 @@
1
1
  import { useAttrs as se, ref as p, computed as ae, inject as re, watch as F, resolveComponent as M, createElementBlock as f, openBlock as u, createElementVNode as c, createCommentVNode as h, createBlock as N, createVNode as v, mergeProps as de, unref as y, withCtx as O, normalizeStyle as _, normalizeClass as ue, Fragment as D, renderList as ce, toDisplayString as k, withDirectives as b, withModifiers as B, vShow as U, createTextVNode as j } from "vue";
2
- import { u as fe } from "./ossHook-g6Eqk_cJ.js";
3
- import { p as he } from "./index-CHjKzgsu.js";
2
+ import { u as fe } from "./ossHook-WDd0RZ0t.js";
3
+ import { p as he } from "./index-DWbO-nXt.js";
4
4
  import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import { E as L } from "./index-CblViX79.js";
5
+ import { E as L } from "./index-Bg5DA1N2.js";
6
6
  const ve = { class: "component-upload-image" }, me = { style: { display: "flex", width: "100%" } }, pe = {
7
7
  key: 0,
8
8
  class: "relative rounded overflow-hidden flex justify-center items-center",
@@ -74,7 +74,6 @@ const ve = { class: "component-upload-image" }, me = { style: { display: "flex",
74
74
  operations: {
75
75
  default: () => ({
76
76
  back: !1,
77
- close: !1,
78
77
  rotateLeft: !1,
79
78
  rotateRight: !1
80
79
  })
@@ -381,7 +380,7 @@ const ve = { class: "component-upload-image" }, me = { style: { display: "flex",
381
380
  ]);
382
381
  };
383
382
  }
384
- }, $e = /* @__PURE__ */ ge(Fe, [["__scopeId", "data-v-2cd55892"]]);
383
+ }, $e = /* @__PURE__ */ ge(Fe, [["__scopeId", "data-v-2ad87de1"]]);
385
384
  export {
386
385
  $e as default
387
386
  };