ss-component-new 1.1.76 → 1.1.78

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 (48) hide show
  1. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  2. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  3. package/dist/array-DQ6meJk7.cjs +9 -0
  4. package/dist/{array-BejyPB_1.js → array-Dsurpc08.js} +247 -241
  5. package/dist/cloneDeep-BH_aXSAH.cjs +1 -0
  6. package/dist/cloneDeep-MKlVykeI.js +318 -0
  7. package/dist/{index-ChCXzsYf.js → index-54P6MUQ5.js} +2 -2
  8. package/dist/index-BCHKDSAB.cjs +1 -0
  9. package/dist/index-Bc2TP6E4.cjs +1 -0
  10. package/dist/index-C8abtcPh.cjs +87 -0
  11. package/dist/index-CBzgTVRc.cjs +1 -0
  12. package/dist/index-CRm-Cd9v.cjs +1 -0
  13. package/dist/index-CTc_dwbb.js +3133 -0
  14. package/dist/index-ChZ6L8qy.js +371 -0
  15. package/dist/index-ClguzCrn.js +131 -0
  16. package/dist/{menu-oGClEGzK.js → index-D0v2_dMz.js} +1945 -1834
  17. package/dist/{index-BT8Pkr84.js → index-D9tWUDyO.js} +8 -6
  18. package/dist/index-DB-XsCH7.cjs +1 -0
  19. package/dist/{index-BvoThyOF.js → index-DBKxwOZZ.js} +2 -2
  20. package/dist/index-DtmWzVIG.cjs +6 -0
  21. package/dist/{index-10n3uNlg.js → index-HDBRQNLs.js} +4 -3
  22. package/dist/index-YSJ2XYuj.cjs +1 -0
  23. package/dist/index-qogZoGJJ.js +351 -0
  24. package/dist/index-sjmLPf8w.cjs +1 -0
  25. package/dist/index-zIb6b0kg.cjs +6 -0
  26. package/dist/index.vue_vue_type_script_setup_true_lang-D0K1veK2.cjs +1 -0
  27. package/dist/index.vue_vue_type_style_index_0_scoped_876d48c6_lang-BWOIM9wH.js +254 -0
  28. package/dist/index.vue_vue_type_style_index_0_scoped_876d48c6_lang-Csg3VsXp.cjs +4 -0
  29. package/dist/{index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DG5vph3h.js → index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DHffsUIJ.js} +39 -38
  30. package/dist/index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DzfJEE_l.cjs +1 -0
  31. package/dist/main-RfdttOpi.js +288 -0
  32. package/dist/main-u6M32FUn.cjs +1 -0
  33. package/dist/menu-BIINB-0Y.js +1013 -0
  34. package/dist/menu-B_Az9K_F.cjs +11 -0
  35. package/dist/{modelComp-CqA1NVfH.js → modelComp-B3sxj_Kp.js} +1 -1
  36. package/dist/modelComp-DAsVXKA0.cjs +1 -0
  37. package/dist/router.d.ts +1 -0
  38. package/dist/ss-component.cjs +1 -0
  39. package/dist/ss-component.css +1 -1
  40. package/dist/ss-component.js +26 -24
  41. package/dist/ss-component2.cjs +1 -0
  42. package/dist/ss-component2.js +5 -0
  43. package/package.json +11 -5
  44. package/dist/_plugin-vue_export-helper-B7R8Jogt.js +0 -524
  45. package/dist/index-CCr_UQBn.js +0 -3749
  46. package/dist/main-BUjoLIJC.js +0 -404
  47. package/dist/ss-component.umd.cjs +0 -115
  48. /package/dist/{ss-component.d.ts → main.d.ts} +0 -0
@@ -1,404 +0,0 @@
1
- import { createElementBlock as _, openBlock as r, Fragment as W, renderList as U, unref as ie, createElementVNode as b, createBlock as B, resolveDynamicComponent as q, toDisplayString as E, ref as w, watch as J, resolveComponent as ue, createVNode as z, withCtx as K, createCommentVNode as v, onMounted as _e } from "vue";
2
- import { p as A, s as fe, g as P, e as he, a as ye } from "./array-BejyPB_1.js";
3
- import { s as L, E as pe, u as ge } from "./menu-oGClEGzK.js";
4
- import { u as M } from "./modelComp-CqA1NVfH.js";
5
- import { _ as R, c as k } from "./_plugin-vue_export-helper-B7R8Jogt.js";
6
- const Ce = { class: "type-select" }, ke = ["onClick"], be = { class: "list-icon" }, Ie = {
7
- __name: "index",
8
- setup(T) {
9
- const $ = M(A), { itemData: e } = L($), j = (l) => pe[l], f = (l) => {
10
- const y = k(e.value);
11
- y.push({
12
- comp: l.comp,
13
- name: l.name,
14
- compData: []
15
- }), $.setItemData(y);
16
- };
17
- return (l, y) => (r(), _("div", Ce, [
18
- (r(!0), _(W, null, U(ie(fe), (h, s) => (r(), _("div", {
19
- class: "type-list",
20
- key: s
21
- }, [
22
- b("div", {
23
- class: "list-content",
24
- onClick: (p) => f(h)
25
- }, [
26
- b("div", be, [
27
- (r(), B(q(j(h.icon))))
28
- ]),
29
- b("div", null, E(h.name), 1)
30
- ], 8, ke)
31
- ]))), 128))
32
- ]));
33
- }
34
- }, De = /* @__PURE__ */ R(Ie, [["__scopeId", "data-v-fe4aecc8"]]), we = { class: "fill-content" }, $e = { class: "operate-content" }, je = { class: "collapse-title" }, xe = { class: "comp-child" }, Ve = {
35
- __name: "index",
36
- setup(T) {
37
- const $ = M(A), { itemData: e, originalData: j } = L($), f = w([]), l = w([]);
38
- J(
39
- () => e.value,
40
- () => {
41
- var s;
42
- !e.value || ((s = e.value) == null ? void 0 : s.length) === 0 || (f.value = k(e.value));
43
- },
44
- { deep: !0, immediate: !0 }
45
- );
46
- const y = (s) => P(s), h = (s, p, S) => {
47
- if (!s || s.length === 0) return;
48
- let n = k(e.value);
49
- const c = k(p);
50
- c.compData = s, n = n == null ? void 0 : n.map((g, d) => (d === S && (g = c), g)), $.setItemData(n);
51
- };
52
- return (s, p) => {
53
- const S = ue("el-collapse-item"), n = ue("el-collapse");
54
- return r(), _("div", we, [
55
- p[1] || (p[1] = b("div", { class: "fill-operate" }, E("操作栏"), -1)),
56
- b("div", $e, [
57
- z(n, {
58
- modelValue: l.value,
59
- "onUpdate:modelValue": p[0] || (p[0] = (c) => l.value = c),
60
- class: "collapse-content"
61
- }, {
62
- default: K(() => [
63
- (r(!0), _(W, null, U(f.value, (c, g) => (r(), B(S, {
64
- key: g,
65
- name: g
66
- }, {
67
- title: K(() => [
68
- b("div", je, E(c.name), 1)
69
- ]),
70
- default: K(() => {
71
- var d, O;
72
- return [
73
- b("div", xe, [
74
- (r(), B(q(y(c.comp + "Operate")), {
75
- itemContents: c == null ? void 0 : c.compData,
76
- originalItemContents: (O = (d = ie(j)) == null ? void 0 : d.find((N, G) => G === g)) == null ? void 0 : O.compData,
77
- onChange: (N) => h(N, c, g)
78
- }, null, 40, ["itemContents", "originalItemContents", "onChange"]))
79
- ])
80
- ];
81
- }),
82
- _: 2
83
- }, 1032, ["name"]))), 128))
84
- ]),
85
- _: 1
86
- }, 8, ["modelValue"])
87
- ])
88
- ]);
89
- };
90
- }
91
- }, Oe = /* @__PURE__ */ R(Ve, [["__scopeId", "data-v-a216b035"]]), Se = {
92
- key: 0,
93
- class: "show-content"
94
- }, Ne = {
95
- __name: "index",
96
- setup(T) {
97
- const $ = M(A), { itemData: e } = L($), j = w([]);
98
- J(
99
- () => e.value,
100
- () => {
101
- var l;
102
- !e.value || ((l = e.value) == null ? void 0 : l.length) === 0 || (j.value = k(e.value));
103
- },
104
- { deep: !0, immediate: !0 }
105
- );
106
- const f = (l) => P(l);
107
- return (l, y) => {
108
- var h;
109
- return ((h = j.value) == null ? void 0 : h.length) > 0 ? (r(), _("div", Se, [
110
- (r(!0), _(W, null, U(j.value, (s, p) => (r(), _("div", {
111
- class: "item-content",
112
- key: p
113
- }, [
114
- b("div", null, E(s.name), 1),
115
- (r(), B(q(f(s.comp)), {
116
- itemData: s == null ? void 0 : s.compData,
117
- childItemData: s == null ? void 0 : s.itemChildData,
118
- key: p
119
- }, null, 8, ["itemData", "childItemData"]))
120
- ]))), 128))
121
- ])) : v("", !0);
122
- };
123
- }
124
- }, Te = /* @__PURE__ */ R(Ne, [["__scopeId", "data-v-79320497"]]), F = [
125
- {
126
- key: "FormName",
127
- value: "Form"
128
- },
129
- {
130
- key: "TableName",
131
- value: "Table"
132
- }
133
- ], m = [
134
- {
135
- key: "FormDirect",
136
- value: "formFlex"
137
- },
138
- {
139
- key: "Form",
140
- value: "formContent"
141
- },
142
- {
143
- key: "FormButton",
144
- value: "formButton"
145
- },
146
- {
147
- key: "TableColumns",
148
- value: "header"
149
- },
150
- {
151
- key: "TableButton",
152
- value: "extraButton"
153
- },
154
- {
155
- key: "LineButton",
156
- value: "rowButton"
157
- },
158
- {
159
- key: "Table",
160
- value: "tableContents"
161
- },
162
- {
163
- key: "TableIndex",
164
- value: "tableIndex"
165
- }
166
- ], Fe = {
167
- key: 0,
168
- class: "show-content"
169
- }, ve = { class: "item-view-group" }, Be = {
170
- __name: "index",
171
- props: {
172
- content: String,
173
- jsonContents: Array
174
- },
175
- emits: ["change"],
176
- setup(T, { emit: $ }) {
177
- const e = T, j = $, f = M(A), { itemData: l } = L(f), y = w([]), h = w([]), s = (n) => {
178
- j("change", {
179
- wholeValue: y.value,
180
- editValue: n
181
- });
182
- }, p = (n) => {
183
- const c = k(y.value), g = c == null ? void 0 : c.map((d, O) => (O === (n == null ? void 0 : n.index) && (d.compData = n == null ? void 0 : n.contents), d));
184
- y.value = g;
185
- };
186
- J(
187
- () => l.value,
188
- () => {
189
- var n;
190
- !l.value || ((n = l.value) == null ? void 0 : n.length) === 0 || (h.value = l.value, y.value = l.value);
191
- },
192
- { deep: !0, immediate: !0 }
193
- ), J(
194
- () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
195
- () => {
196
- var c;
197
- if (((c = e == null ? void 0 : e.jsonContents) == null ? void 0 : c.length) > 0) {
198
- f.setOriginalData(e == null ? void 0 : e.jsonContents), f.setItemData(e == null ? void 0 : e.jsonContents);
199
- return;
200
- }
201
- if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
202
- const n = he(e == null ? void 0 : e.content);
203
- f.setOriginalData(n), f.setItemData(n);
204
- },
205
- { deep: !0, immediate: !0 }
206
- );
207
- const S = (n) => P(n);
208
- return (n, c) => {
209
- var g;
210
- return ((g = h.value) == null ? void 0 : g.length) > 0 ? (r(), _("div", Fe, [
211
- (r(!0), _(W, null, U(h.value, (d, O) => (r(), _("div", {
212
- class: "item-content",
213
- key: O
214
- }, [
215
- b("div", ve, E(d.name), 1),
216
- (r(), B(q(S(d.comp)), {
217
- itemData: d == null ? void 0 : d.compData,
218
- childItemData: d == null ? void 0 : d.itemChildData,
219
- key: O,
220
- onChange: s,
221
- index: O,
222
- onContentChange: p
223
- }, null, 40, ["itemData", "childItemData", "index"]))
224
- ]))), 128))
225
- ])) : v("", !0);
226
- };
227
- }
228
- }, Ee = /* @__PURE__ */ R(Be, [["__scopeId", "data-v-869e6e20"]]), Je = { class: "add-model-content" }, Ae = {
229
- key: 0,
230
- class: "model-import-data"
231
- }, Le = { class: "import-button" }, Me = { key: 0 }, Re = {
232
- key: 1,
233
- class: "model-operate"
234
- }, ze = { class: "model-select" }, We = { class: "model-fill" }, Ue = {
235
- key: 2,
236
- class: "model-view ssComponent"
237
- }, qe = {
238
- __name: "main",
239
- props: {
240
- mode: {
241
- type: String,
242
- default: "view"
243
- },
244
- content: {
245
- type: String,
246
- default: ""
247
- },
248
- jsonContents: {
249
- type: Array,
250
- default: () => []
251
- },
252
- showButton: {
253
- type: Boolean,
254
- default: !0
255
- }
256
- },
257
- emits: ["change"],
258
- setup(T, { emit: $ }) {
259
- const e = T, j = $, f = w(""), l = w([]), y = w(0), h = M(A);
260
- ge(A);
261
- const { itemData: s, originalData: p } = L(h), S = w(null), n = w(0), c = w(""), g = () => {
262
- y.value = window.innerWidth;
263
- }, d = async (u) => {
264
- var C;
265
- const o = (C = k(u == null ? void 0 : u.wholeValue)) == null ? void 0 : C.map((a) => {
266
- var x;
267
- return (a == null ? void 0 : a.comp) === "Form" && (a.compData = (x = a.compData) == null ? void 0 : x.map((V) => ((V == null ? void 0 : V.key) === "formContent" && (V.contents = ye(V == null ? void 0 : V.contents)), V))), a;
268
- });
269
- j("change", {
270
- originalContents: p.value,
271
- currentContents: u == null ? void 0 : u.wholeValue,
272
- editContent: u == null ? void 0 : u.editValue,
273
- stringContent: O(k(u == null ? void 0 : u.wholeValue)),
274
- arrayToContents: o
275
- });
276
- }, O = (u) => {
277
- var C;
278
- let o = [];
279
- return (C = k(u)) == null || C.forEach((a) => {
280
- var x, V;
281
- F != null && F.find((t) => (t == null ? void 0 : t.value) === (a == null ? void 0 : a.comp)) && o.push(((x = F == null ? void 0 : F.find((t) => (t == null ? void 0 : t.value) === (a == null ? void 0 : a.comp))) == null ? void 0 : x.key) + "=" + a.name + "/r/n"), (V = a == null ? void 0 : a.compData) == null || V.forEach((t) => {
282
- var Q, X, Y, Z, ee, te, ne, ae, oe, le, se, re;
283
- if (m != null && m.find((I) => (I == null ? void 0 : I.value) === (t == null ? void 0 : t.key)))
284
- if (!((Q = t == null ? void 0 : t.contents) != null && Q.length))
285
- o.push(((X = m == null ? void 0 : m.find((I) => (I == null ? void 0 : I.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + (t.contents === !0 ? '""' : "Vertical") + "/r/n");
286
- else {
287
- let I = (Y = t == null ? void 0 : t.contents) == null ? void 0 : Y[0];
288
- if (!I) return;
289
- if (Object.keys(I).includes("label") && Object.keys(I).includes("key") && Object.keys(I).includes("width"))
290
- if (((ee = (Z = t.contents) == null ? void 0 : Z.filter((D) => D.width !== 1)) == null ? void 0 : ee.length) === 0) {
291
- const D = (te = k(t == null ? void 0 : t.contents)) == null ? void 0 : te.map((i) => ({ [i.label]: i.value }));
292
- o.push(((ne = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : ne.key) + "=" + JSON.stringify(D) + "/r/n");
293
- } else {
294
- let D = [];
295
- (ae = k(t == null ? void 0 : t.contents)) == null || ae.reduce((i, H) => {
296
- var ce;
297
- return i[H.label] = H.key, ((ce = Object.keys(k(i))) == null ? void 0 : ce.length) >= H.width && (D.push(k(i)), i = {}), i;
298
- }, {}), o.push(((oe = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : oe.key) + "=" + JSON.stringify(D) + "/r/n");
299
- }
300
- else if (Object.keys(I).includes("label")) {
301
- const D = (le = k(t == null ? void 0 : t.contents)) == null ? void 0 : le.map((i) => i.label);
302
- o.push(((se = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : se.key) + "=" + JSON.stringify(D) + "/r/n");
303
- } else
304
- o.push(((re = m == null ? void 0 : m.find((D) => (D == null ? void 0 : D.value) === (t == null ? void 0 : t.key))) == null ? void 0 : re.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
305
- }
306
- });
307
- }), JSON.stringify(o);
308
- }, N = w([]), G = () => {
309
- S.value.click();
310
- }, de = (u) => {
311
- const o = u.target.files[0];
312
- if (!o) return;
313
- const C = new FileReader();
314
- C.onload = (a) => {
315
- try {
316
- f.value = a.target.result, N.value = me(a.target.result), n.value++;
317
- } catch (x) {
318
- console.error("解析失败:", x);
319
- }
320
- }, C.onerror = (a) => {
321
- console.error("文件读取错误:", a);
322
- }, C.readAsText(o);
323
- };
324
- _e(() => {
325
- window.addEventListener("resize", g);
326
- }), J(
327
- () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
328
- () => {
329
- f.value = e == null ? void 0 : e.content, l.value = e == null ? void 0 : e.jsonContents;
330
- },
331
- { deep: !0, immediate: !0 }
332
- ), J(
333
- () => n.value,
334
- () => {
335
- var u;
336
- ((u = N.value) == null ? void 0 : u.length) !== 0 && (h.setOriginalData(N.value), h.setItemData(N.value));
337
- },
338
- { deep: !0, immediate: !0 }
339
- );
340
- const me = (u) => {
341
- let o = u.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
342
- o = o.replace(/(\w+)\s*:/g, "$1:"), o = o.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), o = o.replace(/,\s*([}\]])/g, "$1"), o = o.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
343
- try {
344
- return JSON.parse(o);
345
- } catch (C) {
346
- try {
347
- const x = new Function(`return ${o}`)();
348
- if (Array.isArray(x) || typeof x == "object")
349
- return x;
350
- throw new Error(`解析结果不是有效的数组或对象: ${C}`);
351
- } catch (a) {
352
- throw new Error(`无法解析JSON: ${a.message}`);
353
- }
354
- }
355
- };
356
- return (u, o) => {
357
- var C;
358
- return r(), _("div", Je, [
359
- ((C = e == null ? void 0 : e.jsonContents) == null ? void 0 : C.length) === 0 ? (r(), _("div", Ae, [
360
- b("div", Le, [
361
- b("input", {
362
- type: "file",
363
- ref_key: "fileInput",
364
- ref: S,
365
- accept: ".txt",
366
- onChange: de,
367
- style: { display: "none" }
368
- }, null, 544),
369
- b("button", {
370
- onClick: G,
371
- class: "import-button-content"
372
- }, "导入文件"),
373
- c.value ? (r(), _("span", Me, E(c.value), 1)) : v("", !0)
374
- ])
375
- ])) : v("", !0),
376
- (e == null ? void 0 : e.mode) === "edit" ? (r(), _("div", Re, [
377
- b("div", ze, [
378
- z(De)
379
- ]),
380
- (r(), _("div", {
381
- class: "model-show",
382
- key: y.value
383
- }, [
384
- z(Te)
385
- ])),
386
- b("div", We, [
387
- z(Oe)
388
- ])
389
- ])) : v("", !0),
390
- (e == null ? void 0 : e.mode) === "view" ? (r(), _("div", Ue, [
391
- (r(), B(Ee, {
392
- content: f.value,
393
- onChange: d,
394
- jsonContents: l.value,
395
- key: y.value
396
- }, null, 8, ["content", "jsonContents"]))
397
- ])) : v("", !0)
398
- ]);
399
- };
400
- }
401
- }, Xe = /* @__PURE__ */ R(qe, [["__scopeId", "data-v-b25bde75"]]);
402
- export {
403
- Xe as default
404
- };