@fangzhongya/vue-archive 0.0.54 → 0.0.55

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,4 +1,4 @@
1
- import { getTextNotes as k } from "../../utils/index.js";
1
+ import { getTextNotes as T } from "../../utils/index.js";
2
2
  import "@fangzhongya/utils/basic/object/mergeObject";
3
3
  import "@fangzhongya/utils/basic/array/toggleArray";
4
4
  import "@fangzhongya/utils/name/humpToLine";
@@ -11,16 +11,16 @@ import "@fangzhongya/utils/basic/string/firstUpper";
11
11
  import "@fangzhongya/utils/urls/getSuffix";
12
12
  import "@fangzhongya/utils/basic/array/replaceAfter";
13
13
  import "@fangzhongya/utils/html/getVueText";
14
- import { props as m, emits as g, expose as d, slot as x } from "../../utils/props.js";
15
- const i = {
14
+ import { props as u, emits as x, expose as d, slot as E } from "../../utils/props.js";
15
+ const p = {
16
16
  titles: [],
17
17
  propss: [],
18
18
  slots: [],
19
19
  emitss: [],
20
20
  exposes: []
21
21
  };
22
- function O(e, s) {
23
- let r = e.charAt(0), l = [
22
+ function k(e, l) {
23
+ let r = e.charAt(0), s = [
24
24
  ['"', '"'],
25
25
  ["'", "'"],
26
26
  ["`", "`"],
@@ -28,49 +28,49 @@ function O(e, s) {
28
28
  ["{", "}"],
29
29
  ["[", "]"]
30
30
  ];
31
- const t = l.map((a) => a[0]);
31
+ const t = s.map((o) => o[0]);
32
32
  if (t.indexOf(r) != -1) {
33
- let a = [r];
34
- for (let o = 1; o < e.length; o++) {
35
- const p = e[o];
36
- if (t.includes(p))
37
- a.push(p);
33
+ let o = [r];
34
+ for (let n = 1; n < e.length; n++) {
35
+ const i = e[n];
36
+ if (t.includes(i))
37
+ o.push(i);
38
38
  else {
39
- let u = !1;
40
- for (let f of l)
41
- if (p === f[1] && a[a.length - 1] === f[0]) {
42
- u = !0;
39
+ let f = !1;
40
+ for (let m of s)
41
+ if (i === m[1] && o[o.length - 1] === m[0]) {
42
+ f = !0;
43
43
  break;
44
44
  }
45
- u && a.pop();
45
+ f && o.pop();
46
46
  }
47
- if (a.length === 0)
48
- return s && e[o + 1] === " ", e.substring(0, o + 1);
47
+ if (o.length === 0)
48
+ return l && e[n + 1] === " ", e.substring(0, n + 1);
49
49
  }
50
50
  } else
51
- return s ? e.substring(0, e.indexOf(" ")) : e;
51
+ return l ? e.substring(0, e.indexOf(" ")) : e;
52
52
  }
53
- function T(e) {
53
+ function q(e) {
54
54
  delete e.problems, delete e.source;
55
- let s = e.tag, r = e.name, l = e.description, t = e.default, n = "";
56
- if (s == "default")
57
- r = r.trim(), r = O(r) || r;
58
- else if (s == "selectable")
55
+ let l = e.tag, r = e.name, s = e.description, t = e.default, a = "", o = "";
56
+ if (l == "default")
57
+ r = r.trim(), r = k(r) || r;
58
+ else if (l == "selectable")
59
59
  r = r.trim();
60
60
  else {
61
61
  if (r.includes("=")) {
62
- const p = r.split("=");
63
- r = p[0];
64
- const u = p[1] + " " + l, f = O(u, !0);
65
- f ? (t = f, l = u.replace(f, "")) : t = e.default || p[1] || "";
62
+ const f = r.split("=");
63
+ r = f[0];
64
+ const m = f[1] + " " + s, g = k(m, !0);
65
+ g ? (t = g, s = m.replace(g, "")) : t = e.default || f[1] || "";
66
66
  }
67
- const o = /\s*\((.*)\)\s/gi.exec(l);
68
- o && o.length > 0 && (n = o[1], l = l.replace(o[0], ""));
67
+ const i = /\s*\((.*)\)\s/gi.exec(s);
68
+ i && i.length > 0 && (a = i[1], s = s.replace(i[0], ""));
69
69
  }
70
- return e.name = r, e.default = t || "", e.description = l, e.selectable = n, e;
70
+ return r.endsWith("*") && (o = "*", r = r.substring(0, r.length - 1)), e.name = r, e.required = o, e.default = t || "", e.description = s, e.selectable = a, e;
71
71
  }
72
72
  function y(e) {
73
- let s = [
73
+ let l = [
74
74
  "title",
75
75
  // 'name',
76
76
  "text",
@@ -78,51 +78,52 @@ function y(e) {
78
78
  "date"
79
79
  // 'description',
80
80
  // 'descriptions',
81
- ], r = b(e), l = {};
82
- s.forEach((t) => {
83
- l[t] = r.obj[t];
84
- }), E(l), r.arr.forEach((t) => {
81
+ ], r = b(e), s = {};
82
+ l.forEach((t) => {
83
+ s[t] = r.obj[t];
84
+ }), O(s), r.arr.forEach((t) => {
85
85
  h(t.key, t.value);
86
86
  });
87
87
  }
88
- function E(e) {
89
- i.titles.push(e);
88
+ function O(e) {
89
+ p.titles.push(e);
90
90
  }
91
91
  function j(e) {
92
- let s = [
92
+ let l = [
93
93
  "props",
94
94
  "name",
95
95
  "type",
96
96
  "default",
97
+ "required",
97
98
  "selectable",
98
99
  "description",
99
100
  "descriptions",
100
101
  "return"
101
- ], r = b(e), l = {};
102
- s.forEach((t) => {
103
- l[t] = r.obj[t];
104
- }), c(l, "props"), r.arr.forEach((t) => {
102
+ ], r = b(e), s = {};
103
+ l.forEach((t) => {
104
+ s[t] = r.obj[t];
105
+ }), c(s, "props"), r.arr.forEach((t) => {
105
106
  h(t.key, t.value);
106
107
  });
107
108
  }
108
109
  function w(e) {
109
- let s = ["slot", "name", "selectable", "description", "descriptions"], r = b(e), l = {};
110
- s.forEach((t) => {
111
- l[t] = r.obj[t];
112
- }), c(l, "slot"), r.arr.forEach((t) => {
110
+ let l = ["slot", "name", "selectable", "description", "descriptions"], r = b(e), s = {};
111
+ l.forEach((t) => {
112
+ s[t] = r.obj[t];
113
+ }), c(s, "slot"), r.arr.forEach((t) => {
113
114
  h(t.key, t.value);
114
115
  });
115
116
  }
116
117
  function F(e) {
117
- let s = ["emits", "name", "selectable", "description", "descriptions"], r = b(e), l = {};
118
- s.forEach((t) => {
119
- l[t] = r.obj[t];
120
- }), c(l, "emits"), r.arr.forEach((t) => {
118
+ let l = ["emits", "name", "selectable", "description", "descriptions"], r = b(e), s = {};
119
+ l.forEach((t) => {
120
+ s[t] = r.obj[t];
121
+ }), c(s, "emits"), r.arr.forEach((t) => {
121
122
  h(t.key, t.value);
122
123
  });
123
124
  }
124
125
  function N(e) {
125
- let s = [
126
+ let l = [
126
127
  "expose",
127
128
  "name",
128
129
  "type",
@@ -130,132 +131,142 @@ function N(e) {
130
131
  "selectable",
131
132
  "description",
132
133
  "descriptions"
133
- ], r = b(e), l = {};
134
- s.forEach((t) => {
135
- l[t] = r.obj[t];
136
- }), c(l, "expose"), r.arr.forEach((t) => {
134
+ ], r = b(e), s = {};
135
+ l.forEach((t) => {
136
+ s[t] = r.obj[t];
137
+ }), c(s, "expose"), r.arr.forEach((t) => {
137
138
  h(t.key, t.value);
138
139
  });
139
140
  }
140
- function c(e, s) {
141
- const r = i[s + "name"] || [], l = e.name ?? e[s]?.name, t = r.indexOf(l);
142
- t >= 0 && (i[s + "s"].splice(t, 1), r.splice(t, 1)), i[s + "s"].push(e), r.push(l), i[s + "name"] = r;
141
+ function c(e, l) {
142
+ const r = p[l + "name"] || [], s = e.name ?? e[l]?.name, t = r.indexOf(s);
143
+ t >= 0 && (p[l + "s"].splice(t, 1), r.splice(t, 1)), p[l + "s"].push(e), r.push(s), p[l + "name"] = r;
143
144
  }
144
145
  function P() {
145
- Object.keys(i).forEach((e) => {
146
- i[e] = [];
146
+ Object.keys(p).forEach((e) => {
147
+ p[e] = [];
147
148
  });
148
149
  }
149
- function b(e, s) {
150
+ function b(e, l) {
150
151
  const r = {
151
152
  descriptions: e?.description || ""
152
- }, l = [];
153
+ }, s = [];
153
154
  return e?.tags && e.tags?.forEach((t) => {
154
- let n = t.tag, a = T(t);
155
- if (!r.hasOwnProperty(n))
156
- r[n] = a;
155
+ let a = t.tag, o = q(t);
156
+ if (!r.hasOwnProperty(a))
157
+ r[a] = o;
157
158
  else {
158
- const o = {};
159
- o[n] = a, l.push({
160
- key: n,
161
- value: o
159
+ const n = {};
160
+ n[a] = o, s.push({
161
+ key: a,
162
+ value: n
162
163
  });
163
164
  }
164
165
  }), {
165
- arr: l,
166
+ arr: s,
166
167
  obj: r
167
168
  };
168
169
  }
169
- function h(e, s) {
170
+ function h(e, l) {
170
171
  switch (e) {
171
172
  case "title":
172
- return E(s), !0;
173
+ return O(l), !0;
173
174
  case "text":
174
- return E(s), !0;
175
+ return O(l), !0;
175
176
  case "props":
176
- return c(s, "props"), !0;
177
+ return c(l, "props"), !0;
177
178
  case "slot":
178
- return c(s, "slot"), !0;
179
+ return c(l, "slot"), !0;
179
180
  case "emits":
180
- return c(s, "emits"), !0;
181
+ return c(l, "emits"), !0;
181
182
  case "expose":
182
- return c(s, "expose"), !0;
183
+ return c(l, "expose"), !0;
183
184
  default:
184
185
  return !1;
185
186
  }
186
187
  }
187
- function S(e, s) {
188
+ function S(e, l) {
188
189
  switch (e) {
189
190
  case "title":
190
- return y(s), !0;
191
+ return y(l), !0;
191
192
  case "props":
192
- return j(s), !0;
193
+ return j(l), !0;
193
194
  case "slot":
194
- return w(s), !0;
195
+ return w(l), !0;
195
196
  case "emits":
196
- return F(s), !0;
197
+ return F(l), !0;
197
198
  case "expose":
198
- return N(s), !0;
199
+ return N(l), !0;
199
200
  default:
200
201
  return !1;
201
202
  }
202
203
  }
203
- function v(e) {
204
- return P(), e?.forEach((s) => {
205
- let r = s?.tags || [], l = r?.length || 0;
206
- if (l > 0)
207
- for (let t = 0; t < l; t++) {
208
- const n = r[t] || {};
209
- if (S(n.tag, s))
204
+ function z(e) {
205
+ return P(), e?.forEach((l) => {
206
+ let r = l?.tags || [], s = r?.length || 0;
207
+ if (s > 0)
208
+ for (let t = 0; t < s; t++) {
209
+ const a = r[t] || {};
210
+ if (S(a.tag, l))
210
211
  break;
211
212
  }
212
- }), i;
213
+ }), p;
213
214
  }
214
215
  function Q(e) {
215
- let s = k(e);
216
- return v(s);
216
+ let l = T(e);
217
+ return z(l);
217
218
  }
218
219
  const R = [
219
220
  {
220
221
  label: "属性名",
221
222
  prop: "name",
222
- formatter: m.name
223
+ formatter: u.name
223
224
  },
224
225
  {
225
226
  label: "说明",
226
227
  prop: "description",
227
- formatter: m.description
228
+ formatter: u.description
228
229
  },
229
230
  {
230
231
  label: "类型",
231
232
  prop: "type",
232
- formatter: m.type
233
+ formatter: u.type
233
234
  },
234
235
  {
235
236
  label: "可选值",
236
237
  prop: "selectable",
237
- formatter: m.selectable
238
+ formatter: u.selectable
238
239
  },
239
240
  {
240
241
  label: "默认值",
241
242
  prop: "default",
242
- formatter: m.default
243
+ formatter: u.default
244
+ },
245
+ {
246
+ label: "必传",
247
+ prop: "required",
248
+ formatter: u.required
249
+ },
250
+ {
251
+ label: "方法返回值",
252
+ prop: "return",
253
+ formatter: u.return
243
254
  }
244
255
  ], U = [
245
256
  {
246
257
  label: "事件名",
247
258
  prop: "name",
248
- formatter: g.name
259
+ formatter: x.name
249
260
  },
250
261
  {
251
262
  label: "说明",
252
263
  prop: "description",
253
- formatter: g.description
264
+ formatter: x.description
254
265
  },
255
266
  {
256
267
  label: "回调参数",
257
268
  prop: "selectable",
258
- formatter: g.selectable
269
+ formatter: x.selectable
259
270
  }
260
271
  ], V = [
261
272
  {
@@ -275,26 +286,33 @@ const R = [
275
286
  },
276
287
  {
277
288
  label: "返回值",
289
+ prop: "return",
290
+ formatter(e) {
291
+ return d.return(e) || e.expose.default || "";
292
+ }
293
+ },
294
+ {
295
+ label: "类型",
278
296
  prop: "type",
279
297
  formatter(e) {
280
- return d.return(e) ?? d.type(e);
298
+ return d.type(e) || "function";
281
299
  }
282
300
  }
283
- ], W = [
301
+ ], X = [
284
302
  {
285
303
  label: "插槽名",
286
304
  prop: "name",
287
- formatter: x.name
305
+ formatter: E.name
288
306
  },
289
307
  {
290
308
  label: "说明",
291
309
  prop: "description",
292
- formatter: x.description
310
+ formatter: E.description
293
311
  },
294
312
  {
295
313
  label: "作用域参数",
296
314
  prop: "selectable",
297
- formatter: x.selectable
315
+ formatter: E.selectable
298
316
  }
299
317
  ];
300
318
  export {
@@ -302,5 +320,5 @@ export {
302
320
  U as temits,
303
321
  V as texpose,
304
322
  R as tprops,
305
- W as tslot
323
+ X as tslot
306
324
  };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const z=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const H=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const w=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const c=require("./util.cjs"),T=require("../../utils/props.cjs"),J=require("@fangzhongya/utils/basic/string/toFunction"),N=["class"];function q(e,t){return e.filter(s=>s.name==t)[0]}function L(e){return e.map(t=>(t.prop||"...arr")+":"+c.setDataType(t.dataType)).join(",")}function A(e,t,s,n,o,h){const p=[],r=[];let b=!0;const v=T.getPropsValue(t.propss||[]),x=T.getEmitsValue(t.emitss||[]),B=T.getExposeValue(t.exposes||[]),C=T.getSlotValue(t.slots||[]);Object.keys(s).forEach(i=>{let m=s[i];if(/^on[A-Z]/.test(i)&&typeof m=="function"){let u=i.substring(2);const l=i.split(":");let g;if(l.length>1?(g=l[0]+l.slice(1).map(f=>w.firstUpper(f)).join(""),u=H.firstLower(u)):(g=l[0],u=z.humpToLine(u)),l.includes("-")){let f=g.split("-");f=f.map(($,V)=>V!=0?w.firstUpper($):$),g=f.join("")}p.push(" @"+u+'="'+g+'"');const a=q(x,u)||{},d=a.selectable||"",S=c.parseParamString(d),y=L(S);r.push(`// ${a.description} ${a.name}: (${a.selectable})`),r.push("function "+g+"("+y+") {"),S.forEach(f=>{const $=f.name||"arr";r.push(" console.log('"+f.label+"', "+$+")")}),r.push("}")}else{let u=i;N.includes(i)&&(u=i+"1"),p.push(" :"+i+'="'+u+'"');const l=q(v,i)||{},g=E(l);if(r.push(`// ${l.description} ${l.name}: {${l.type}} (${l.selectable})`),typeof m=="function")r.push("const "+i+" = "+P(m,i,o));else if(b&&(b=!1,r.unshift("import { ref } from 'vue';")),typeof m>"u")if(g.type=="function"){const a=Z(l);r.push("const "+u+" = "+a+";")}else{const a=c.getTypeValue(g.dataType);r.push("const "+u+" = ref("+(a==="undefined"?"":a)+");")}else{let a=j(m,i,o);r.push("const "+u+" = ref("+a+");")}}});const O=Object.values(h||{});O.length>0&&(b&&(b=!1,r.unshift("import { ref } from 'vue';")),p.unshift(' ref="refDom"'),r.push("const refDom = ref()"),O.forEach(i=>{const m=q(B,i.name)||{};r.push(`// ${m.description} ${m.name}:(${m.selectable}) ${m.type}`);const u=i.name+"Value",l=c.parseParamString(m?.selectable||""),g=[],a=i.params||[];l.forEach((d,S)=>{const y=d.name;if(y){const f=y+i.name,$=a[S];if(r.push(`// ${d.label}`),typeof $=="function")r.push("const "+f+" = "+P($,y,i.text));else if(typeof $>"u")r.push("const "+f+" = "+c.getTypeValue(d.dataType)+";");else{let V=j($,y,i.text);r.push("const "+f+" = "+V+";")}g.push(f)}}),i.type==="function"?r.push(`const ${u} = refDom.value?.${i.name}(${g.join(", ")})`):r.push(`const ${u} = refDom.value?.${i.name}`),r.push(`console.log('"${m.type}"', ${u})`)})),p.length>0&&p.unshift("");const U=M(n,C);return`<!--${e}-->
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const z=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const H=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const w=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const a=require("./util.cjs"),T=require("../../utils/props.cjs"),J=require("@fangzhongya/utils/basic/string/toFunction"),N=["class"];function q(e,n){return e.filter(s=>s.name==n)[0]}function L(e){return e.map(n=>(n.prop||"...arr")+":"+a.setDataType(n.dataType)).join(",")}function A(e,n,s,t,o,h){const g=[],r=[];let b=!0;const v=T.getPropsValue(n.propss||[]),x=T.getEmitsValue(n.emitss||[]),B=T.getExposeValue(n.exposes||[]),C=T.getSlotValue(n.slots||[]);Object.keys(s).forEach(i=>{let u=s[i];if(/^on[A-Z]/.test(i)&&typeof u=="function"){let c=i.substring(2);const f=i.split(":");let l;if(f.length>1?(l=f[0]+f.slice(1).map(m=>w.firstUpper(m)).join(""),c=H.firstLower(c)):(l=f[0],c=z.humpToLine(c)),f.includes("-")){let m=l.split("-");m=m.map(($,V)=>V!=0?w.firstUpper($):$),l=m.join("")}g.push(" @"+c+'="'+l+'"');const p=q(x,c)||{},d=p.selectable||"",S=a.parseParamString(d),y=L(S);r.push(`// ${p.description} ${p.name}: (${p.selectable})`),r.push("function "+l+"("+y+") {"),S.forEach(m=>{const $=m.name||"arr";r.push(" console.log('"+m.label+"', "+$+")")}),r.push("}")}else{let c=i;N.includes(i)&&(c=i+"1"),g.push(" :"+i+'="'+c+'"');const f=q(v,i)||{},l=E(f);if(r.push(`// ${f.description} ${f.name}: {${f.type}} (${f.selectable})`),typeof u=="function"||l.dataType.length==1&&l.type=="function"&&u)r.push("const "+i+" = "+P(u,i,o));else if(b&&(b=!1,r.unshift("import { ref } from 'vue';")),typeof u>"u")if(l.type=="function"){const p=Z(f);r.push("const "+c+" = "+p+";")}else{const p=a.getTypeValue(l.dataType);r.push("const "+c+" = ref("+(p==="undefined"?"":p)+");")}else{let p=j(u,i,o);r.push("const "+c+" = ref("+p+");")}}});const O=Object.values(h||{});O.length>0&&(b&&(b=!1,r.unshift("import { ref } from 'vue';")),g.unshift(' ref="refDom"'),r.push("const refDom = ref()"),O.forEach(i=>{const u=q(B,i.name)||{};r.push(`// ${u.description} ${u.name}:(${u.selectable}) ${u.type}`);const c=i.name+"Value",f=a.parseParamString(u?.selectable||""),l=[],p=i.params||[];f.forEach((d,S)=>{const y=d.name;if(y){const m=y+i.name,$=p[S];if(r.push(`// ${d.label}`),typeof $=="function")r.push("const "+m+" = "+P($,y,i.text));else if(typeof $>"u")r.push("const "+m+" = "+a.getTypeValue(d.dataType)+";");else{let V=j($,y,i.text);r.push("const "+m+" = "+V+";")}l.push(m)}}),i.type==="function"?(u.return?r.push(`const ${c} = refDom.value?.${i.name}(${l.join(", ")})`):r.push(`refDom.value?.${i.name}(${l.join(", ")})`),u.return&&r.push(`console.log('${u.return}', ${c})`)):(r.push(`const ${c} = refDom.value?.${i.name}`),r.push(`console.log('${u.type||u.name}', ${c})`))})),g.length>0&&g.unshift("");const U=M(t,C);return`<!--${e}-->
2
2
  <template>
3
3
  <div>
4
- <${e}${p.join(`
4
+ <${e}${g.join(`
5
5
  `)}>${U.join(`
6
6
  `)}
7
7
  </${e}>
@@ -11,11 +11,11 @@
11
11
  ${r.join(`
12
12
  `)}
13
13
  <\/script>
14
- `}function M(e={},t){const s=[];return Object.keys(e).forEach(n=>{const o=q(t,n)||{},h=e[n];if(h){const p=` <!-- ${o.description} ${o.name}:(${o.selectable}) -->
15
- <template #${n}="scope">
16
- ${c.vueFormat(h," ")}
17
- </template>`;s.push(p)}}),s&&s.length>0&&s.unshift(""),s}function P(e,t,s){const n=s?s[t]:"";return n&&(n.includes("=>")||n.includes("function"))?n:F(e.toString())}function F(e){const t=J.getFunctionFormat(c.prettierFormat(e));if(t){let s=`{
18
- ${c.vueFormat(c.getFunBody(t.body)," ")}
19
- }`;return`function (${t.param}) ${s}`}else return"undefined"}function Z(e){const t=c.parseParamString(e.selectable),s=L(t);let n="";e.return&&(n="return ");let o=`{
20
- ${c.vueFormat(c.getFunBody(n)," ")}
21
- }`;return`function (${s}) ${o}`}function G(e){const t=e.trim();return/^\(/.test(t)?F(t):JSON.stringify(e)}function j(e,t,s){const n=s?s[t]:"";return n||(typeof e=="string"?G(e+""):JSON.stringify(e))}function E(e){let t=c.parseTypeDefinition(e?.type),s=t.dataType,n=t.type;n=n.split("<")[0],n=n.trim().toLowerCase(),s.length>1&&(n="any");let o=(e?.selectable||"").trim(),h=[];return o&&n!="boolean"&&(o.includes("|")?o.split("|").forEach(p=>{if(p){let r=p.split(":");h.push({label:p,prop:D(r[0].trim())})}}):h=c.parseParamString(o),n=="array"?n="choice":n!="function"&&h.length>1&&(n="select")),{arr:h,type:n,dataType:s}}function D(e,t){try{if(t?.toLowerCase()=="function")if(typeof e=="string"){if(/^\((.|\n|\r)*\)$/.test(e))return e=e.substring(1,e.length-1),new Function(`{ return ${e} }`)()}else return e;else return new Function(`{ return ${e} }`)()}catch{return""+e}}function I(e,t=!0){const s=E(e),n=c.getTypeValue(s.dataType);if(t){const o=(e.default||"").trim();return D(o||n,s.dataType[0])}else{const o=(e.default||"").trim();return D(o,s.dataType[0])}}exports.getDefaultValue=I;exports.getHmtl=A;exports.getSpecType=E;exports.setValStringify=j;
14
+ `}function M(e={},n){const s=[];return Object.keys(e).forEach(t=>{const o=q(n,t)||{},h=e[t];if(h){const g=` <!-- ${o.description} ${o.name}:(${o.selectable}) -->
15
+ <template #${t}="scope">
16
+ ${a.vueFormat(h," ")}
17
+ </template>`;s.push(g)}}),s&&s.length>0&&s.unshift(""),s}function P(e,n,s){const t=s?s[n]:"";return t&&(t.includes("=>")||t.includes("function"))?t:F(e.toString())}function F(e){const n=J.getFunctionFormat(a.prettierFormat(e));if(n){let s=`{
18
+ ${a.vueFormat(a.getFunBody(n.body)," ")}
19
+ }`;return`function (${n.param.split(",").map(t=>t+":any").join(",")}) ${s}`}else return"undefined"}function Z(e){const n=a.parseParamString(e.selectable),s=L(n);let t="";e.return&&(t="return ");let o=`{
20
+ ${a.vueFormat(a.getFunBody(t)," ")}
21
+ }`;return`function (${s}) ${o}`}function G(e){const n=e.trim();return/^\(/.test(n)?F(n):JSON.stringify(e)}function j(e,n,s){const t=s?s[n]:"";return t||(typeof e=="string"?G(e+""):JSON.stringify(e))}function E(e){let n=a.parseTypeDefinition(e?.type),s=n.dataType,t=n.type;t=t.split("<")[0],t=t.trim().toLowerCase(),s.length>1&&(t="any");let o=(e?.selectable||"").trim(),h=[];return o&&t!="boolean"&&(o.includes("|")?o.split("|").forEach(g=>{if(g){let r=g.split(":");h.push({label:g,prop:D(r[0].trim())})}}):h=a.parseParamString(o),t=="array"?t="choice":t!="function"&&h.length>1&&(t="select")),{arr:h,type:t,dataType:s}}function D(e,n){try{if(n?.toLowerCase()=="function")if(typeof e=="string"){if(/^\((.|\n|\r)*\)$/.test(e))return e=e.substring(1,e.length-1),new Function(`{ return ${e} }`)()}else return e;else return new Function(`{ return ${e} }`)()}catch{return""+e}}function I(e,n=!0){const s=E(e),t=a.getTypeValue(s.dataType);if(n){const o=(e.default||"").trim();return D(o||t,s.dataType[0])}else{const o=(e.default||"").trim();return D(o,s.dataType[0])}}exports.getDefaultValue=I;exports.getHmtl=A;exports.getSpecType=E;exports.setValStringify=j;