@fangzhongya/vue-archive 0.0.19 → 0.0.21

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,75 +1,67 @@
1
- import { defineComponent as $, ref as e, reactive as B, watch as N, createElementBlock as s, openBlock as t, createVNode as r, createCommentVNode as c, createElementVNode as V, Fragment as E, renderList as L, createBlock as b, unref as g } from "vue";
2
- import j from "../use/index.js";
3
- import w from "./info.vue.js";
4
- import D from "./props.vue.js";
5
- import { getConfig as F } from "../../config.js";
6
- import K from "../md/index.vue.js";
1
+ import { defineComponent as g, ref as m, reactive as h, watch as y, createElementBlock as o, openBlock as e, createVNode as r, createCommentVNode as s, createElementVNode as C, Fragment as x, renderList as $, createBlock as B, unref as f } from "vue";
2
+ import N from "../use/index.js";
3
+ import V from "./info.vue.js";
4
+ import E from "./props.vue.js";
5
+ import { getConfig as L } from "../../config.js";
6
+ import b from "../md/index.vue.js";
7
7
  import "./index.js";
8
- import { getLocalTextComponents as M, getKeyMds as O } from "../../utils/glob.js";
9
- const T = { class: "compo" }, U = {
8
+ import { getLocalTextComponents as j, getKeyMds as w } from "../../utils/glob.js";
9
+ const D = { class: "compo" }, F = {
10
10
  key: 0,
11
11
  class: "compo-md"
12
- }, q = {
12
+ }, K = {
13
13
  key: 0,
14
14
  class: "compo-md-list"
15
- }, z = {
15
+ }, M = {
16
16
  key: 1,
17
17
  class: "compo-use"
18
- }, S = /* @__PURE__ */ $({
18
+ }, I = /* @__PURE__ */ g({
19
19
  __name: "index",
20
20
  props: {
21
21
  value: Object
22
22
  },
23
- setup(v) {
24
- const o = v, x = F("useparam"), i = e(""), m = B({
23
+ setup(u) {
24
+ const t = u, _ = L("useparam"), c = m(""), l = h({
25
25
  md: !0
26
- }), a = e([]), p = e([]), d = e([]), f = e([]), _ = e([]);
27
- function h(l) {
28
- let { propss: n, slots: u, emitss: y, exposes: C } = l;
29
- p.value = n, _.value = u, d.value = y, f.value = C;
26
+ }), a = m([]), i = m();
27
+ function k(n) {
28
+ i.value = n;
30
29
  }
31
- N(
32
- () => o.value,
30
+ y(
31
+ () => t.value,
33
32
  () => {
34
- k();
33
+ v();
35
34
  }
36
35
  );
37
- function k() {
38
- o.value?.key && (M(o.value?.key).then(
39
- (l) => {
40
- i.value = l;
41
- }
42
- ), a.value = O(o.value?.key) || []);
36
+ function v() {
37
+ t.value?.key && (j(t.value?.key).then((n) => {
38
+ c.value = n;
39
+ }), a.value = w(t.value?.key) || []);
43
40
  }
44
- return k(), (l, n) => (t(), s("div", T, [
45
- r(w, { value: v.value }, null, 8, ["value"]),
46
- r(D, {
47
- onChange: h,
48
- value: i.value
41
+ return v(), (n, d) => (e(), o("div", D, [
42
+ r(V, { value: u.value }, null, 8, ["value"]),
43
+ r(E, {
44
+ onChange: k,
45
+ value: c.value
49
46
  }, null, 8, ["value"]),
50
- a.value && a.value.length ? (t(), s("div", U, [
51
- V("div", {
52
- onClick: n[0] || (n[0] = (u) => m.md = !m.md),
47
+ a.value && a.value.length ? (e(), o("div", F, [
48
+ C("div", {
49
+ onClick: d[0] || (d[0] = (p) => l.md = !l.md),
53
50
  class: "compo-md-name"
54
- }, " 说明文档 "),
55
- m.md ? (t(), s("div", q, [
56
- (t(!0), s(E, null, L(a.value, (u) => (t(), b(K, { value: u }, null, 8, ["value"]))), 256))
57
- ])) : c("", !0)
58
- ])) : c("", !0),
59
- g(x) ? (t(), s("div", z, [
60
- r(g(j), {
61
- value: o.value,
62
- param: {
63
- props: p.value,
64
- slot: _.value,
65
- emits: d.value,
66
- expose: f.value
67
- }
51
+ }, "说明文档"),
52
+ l.md ? (e(), o("div", K, [
53
+ (e(!0), o(x, null, $(a.value, (p) => (e(), B(b, { value: p }, null, 8, ["value"]))), 256))
54
+ ])) : s("", !0)
55
+ ])) : s("", !0),
56
+ f(_) ? (e(), o("div", M, [
57
+ r(f(N), {
58
+ value: t.value,
59
+ param: i.value
68
60
  }, null, 8, ["value", "param"])
69
- ])) : c("", !0)
61
+ ])) : s("", !0)
70
62
  ]));
71
63
  }
72
64
  });
73
65
  export {
74
- S as default
66
+ I as default
75
67
  };
@@ -1,18 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const P=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const x=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const S=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const m=require("./util.cjs"),E=require("../../utils/props.cjs"),z=require("@fangzhongya/utils/basic/string/toFunction"),U=["class"];function O(t,e){return t.filter(n=>n.name==e)[0]}function B(t){return t.map(e=>e.prop+":"+m.setDataType(e.dataType)).join(",")}function C(t,e,n,i,a,d){const c=[],r=[];let y=!0;const w=E.getEmitsValue(e.emits),D=E.getExposeValue(e.expose);Object.keys(n).forEach(s=>{let p=n[s];if(/^on[A-Z]/.test(s)&&typeof p=="function"){let o=s.substring(2);const f=s.split(":");let l;if(f.length>1?(l=f[0]+f.slice(1).map(u=>S.firstUpper(u)).join(""),o=x.firstLower(o)):(l=f[0],o=P.humpToLine(o)),f.includes("-")){let u=l.split("-");u=u.map((b,V)=>V!=0?S.firstUpper(b):b),l=u.join("")}c.push(" @"+o+'="'+l+'"');const h=O(w,o).selectable,$=m.getParametersObj(h),g=B($);r.push("function "+l+"("+g+") {"),$.forEach(u=>{r.push(" console.log('"+u.description+u.prop+"', "+u.prop+")")}),r.push("}")}else{let o=s;if(U.includes(s)&&(o=s+"1"),c.push(" :"+s+'="'+o+'"'),typeof p=="function")r.push("const "+s+" = "+F(p,s,a));else if(y&&(y=!1,r.unshift("import { ref } from 'vue';")),typeof p>"u")r.push("const "+o+" = ref();");else{let f=q(p,s,a);r.push("const "+o+" = ref("+f+");")}}});const j=Object.values(d||{});j.length>0&&(y&&(y=!1,r.unshift("import { ref } from 'vue';")),c.unshift(' ref="refDom"'),r.push("const refDom = ref()"),j.forEach(s=>{r.push(`-------${s.name}--------`);const p=O(D,s.name),o=s.name+"Value",f=m.getParametersObj(p.selectable),l=[];s.params?.forEach((h,$)=>{const g=f[$].prop,u=g+s.name;if(typeof h=="function")r.push("const "+u+" = "+F(h,g,s.text));else if(typeof h>"u")r.push("const "+u+" = undefined;");else{let b=q(h,g,s.text);r.push("const "+u+" = "+b+";")}l.push(u)}),s.type==="function"?r.push(`const ${o} = refDom.value?.${s.name}(${l.join(", ")})`):r.push(`const ${o} = refDom.value?.${s.name}`),r.push(`console.log('"${p.description}"', ${o})`)})),c.length>0&&c.unshift("");const L=H(i);return`<!--${t}-->
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");const B=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const C=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const V=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const g=require("./util.cjs"),S=require("../../utils/props.cjs"),H=require("@fangzhongya/utils/basic/string/toFunction"),J=["class"];function j(s,t){return s.filter(e=>e.name==t)[0]}function N(s){return s.map(t=>(t.prop||"...arr")+":"+g.setDataType(t.dataType)).join(",")}function A(s,t,e,o,h,$){const p=[],n=[];let b=!0;const L=S.getPropsValue(t.propss||[]),P=S.getEmitsValue(t.emitss||[]),x=S.getExposeValue(t.exposes||[]),z=S.getSlotValue(t.slots||[]);Object.keys(e).forEach(r=>{let c=e[r];if(/^on[A-Z]/.test(r)&&typeof c=="function"){let i=r.substring(2);const u=r.split(":");let a;if(u.length>1?(a=u[0]+u.slice(1).map(f=>V.firstUpper(f)).join(""),i=C.firstLower(i)):(a=u[0],i=B.humpToLine(i)),u.includes("-")){let f=a.split("-");f=f.map((m,T)=>T!=0?V.firstUpper(m):m),a=f.join("")}p.push(" @"+i+'="'+a+'"');const l=j(P,i),y=l.selectable||"",q=g.getParametersObj(y),d=N(q);n.push(`// ${l.description} ${l.name}: (${l.selectable})`),n.push("function "+a+"("+d+") {"),q.forEach(f=>{const m=f.prop||"arr";n.push(" console.log('"+f.description+m+"', "+m+")")}),n.push("}")}else{let i=r;J.includes(r)&&(i=r+"1"),p.push(" :"+r+'="'+i+'"');const u=j(L,r),a=D(u);if(n.push(`// ${u.description} ${u.name}: {${u.type}} (${u.selectable})`),console.log("val",c),typeof c=="function")n.push("const "+r+" = "+F(c,r,h));else if(b&&(b=!1,n.unshift("import { ref } from 'vue';")),typeof c>"u"){const l=g.getTypeValue(a.dataType);l=="()=>{}"?n.push("const "+i+" = "+l+";"):n.push("const "+i+" = ref("+(l==="undefined"?"":l)+");")}else{let l=E(c,r,h);n.push("const "+i+" = ref("+l+");")}}});const O=Object.values($||{});O.length>0&&(b&&(b=!1,n.unshift("import { ref } from 'vue';")),p.unshift(' ref="refDom"'),n.push("const refDom = ref()"),O.forEach(r=>{const c=j(x,r.name);n.push(`// ${c.description} ${c.name}:(${c.selectable}) ${c.type}`);const i=r.name+"Value",u=g.getParametersObj(c?.selectable||""),a=[],l=r.params||[];u.forEach((y,q)=>{const d=y.prop;if(d){const f=d+r.name,m=l[q];if(n.push(`// ${y.label}`),typeof m=="function")n.push("const "+f+" = "+F(m,d,r.text));else if(typeof m>"u")n.push("const "+f+" = "+g.getTypeValue(y.dataType)+";");else{let T=E(m,d,r.text);n.push("const "+f+" = "+T+";")}a.push(f)}}),r.type==="function"?n.push(`const ${i} = refDom.value?.${r.name}(${a.join(", ")})`):n.push(`const ${i} = refDom.value?.${r.name}`),n.push(`console.log('"${c.type}"', ${i})`)})),p.length>0&&p.unshift("");const U=M(o,z);return`<!--${s}-->
2
2
  <template>
3
3
  <div>
4
- <${t}${c.join(`
5
- `)}>${L.join(`
4
+ <${s}${p.join(`
5
+ `)}>${U.join(`
6
6
  `)}
7
- </${t}>
7
+ </${s}>
8
8
  </div>
9
9
  </template>
10
10
  <script lang="ts" setup>
11
- ${r.join(`
11
+ ${n.join(`
12
12
  `)}
13
13
  <\/script>
14
- `}function H(t={}){const e=[];return Object.keys(t).forEach(n=>{const i=t[n];if(i){const a=` <template #${n}="scope">
15
- ${m.vueFormat(i," ")}
16
- </template>`;e.push(a)}}),e&&e.length>0&&e.unshift(""),e}function F(t,e,n){const i=n?n[e]:"";return i||T(t.toString())}function T(t){const e=z.getFunctionFormat(m.prettierFormat(t));if(e){let n=`{
17
- ${m.vueFormat(m.getFunBody(e.body)," ")}
18
- }`;return`function ${e.param} ${n}`}else return"undefined"}function J(t){const e=t.trim();return/^\(/.test(e)?T(e):JSON.stringify(t)}function q(t,e,n){const i=n?n[e]:"";return i||(typeof t=="string"?J(t+""):JSON.stringify(t))}function N(t){let e=A(t.type),n="any";e.length==1&&(n=e[0].split("<")[0]);const i=n;let a=(t.selectable||"").trim(),d=[];return a&&n!="boolean"&&(a.split(",").forEach(c=>{if(c){let r=c.split(":");d.push({label:c,prop:r[0].trim()})}}),n=="function"?n="function":n=="array"?n="choice":n="select"),{arr:d,zdtype:i,type:n,dataType:e}}function A(t){let e=[];return(t||"").trim().toLowerCase().split(",").forEach(i=>{i=i.trim(),i&&e.push(i)}),[...new Set(e)].sort()}exports.getHmtl=C;exports.getSpecType=N;exports.setValStringify=q;
14
+ `}function M(s={},t){const e=[];return Object.keys(s).forEach(o=>{const h=j(t,o),$=s[o];if($){const p=` <!-- ${h.description} ${h.name}:(${h.selectable}) -->
15
+ <template #${o}="scope">
16
+ ${g.vueFormat($," ")}
17
+ </template>`;e.push(p)}}),e&&e.length>0&&e.unshift(""),e}function F(s,t,e){const o=e?e[t]:"";return o||w(s.toString())}function w(s){const t=H.getFunctionFormat(g.prettierFormat(s));if(t){let e=`{
18
+ ${g.vueFormat(g.getFunBody(t.body)," ")}
19
+ }`;return`function (${t.param}) ${e}`}else return"undefined"}function Z(s){const t=s.trim();return/^\(/.test(t)?w(t):JSON.stringify(s)}function E(s,t,e){const o=e?e[t]:"";return o||(typeof s=="string"?Z(s+""):JSON.stringify(s))}function D(s){let t=G(s.type),e="any";t.length==1&&(e=t[0].split("<")[0]);const o=e;let h=(s.selectable||"").trim(),$=[];return h&&e!="boolean"&&(h.split(",").forEach(p=>{if(p){let n=p.split(":");$.push({label:p,prop:n[0].trim()})}}),e=="function"?e="function":e=="array"?e="choice":e="select"),{arr:$,zdtype:o,type:e,dataType:t}}function G(s){let t=[];return(s||"").trim().toLowerCase().split(",").forEach(o=>{o=o.trim(),o&&t.push(o)}),[...new Set(t)].sort()}exports.getHmtl=A;exports.getSpecType=D;exports.setValStringify=E;
@@ -1,158 +1,175 @@
1
1
  import "@fangzhongya/utils/basic/object/mergeObject";
2
2
  import "@fangzhongya/utils/basic/array/toggleArray";
3
- import { humpToLine as T } from "@fangzhongya/utils/name/humpToLine";
3
+ import { humpToLine as J } from "@fangzhongya/utils/name/humpToLine";
4
4
  import "@fangzhongya/utils/name/lineToLargeHump";
5
5
  import "@fangzhongya/utils/basic/string/appearNum";
6
- import { firstLower as B } from "@fangzhongya/utils/basic/string/firstLower";
6
+ import { firstLower as N } from "@fangzhongya/utils/basic/string/firstLower";
7
7
  import "@fangzhongya/utils/basic/array/duplicateRemoval";
8
8
  import "@fangzhongya/utils/basic/array/asyncMergeArray";
9
- import { firstUpper as j } from "@fangzhongya/utils/basic/string/firstUpper";
9
+ import { firstUpper as O } from "@fangzhongya/utils/basic/string/firstUpper";
10
10
  import "@fangzhongya/utils/urls/getSuffix";
11
11
  import "@fangzhongya/utils/basic/array/replaceAfter";
12
- import { getParametersObj as E, setDataType as C, vueFormat as D, prettierFormat as J, getFunBody as N } from "./util.js";
13
- import { getEmitsValue as P, getExposeValue as A } from "../../utils/props.js";
14
- import { getFunctionFormat as H } from "@fangzhongya/utils/basic/string/toFunction";
15
- const U = ["class"];
16
- function S(e, t) {
17
- return e.filter((n) => n.name == t)[0];
12
+ import { getParametersObj as V, getTypeValue as F, setDataType as A, vueFormat as w, prettierFormat as H, getFunBody as U } from "./util.js";
13
+ import { getPropsValue as Z, getEmitsValue as q, getExposeValue as G, getSlotValue as I } from "../../utils/props.js";
14
+ import { getFunctionFormat as K } from "@fangzhongya/utils/basic/string/toFunction";
15
+ const M = ["class"];
16
+ function j(s, e) {
17
+ return s.filter((t) => t.name == e)[0];
18
18
  }
19
- function Z(e) {
20
- return e.map((t) => t.prop + ":" + C(t.dataType)).join(",");
19
+ function Q(s) {
20
+ return s.map((e) => (e.prop || "...arr") + ":" + A(e.dataType)).join(",");
21
21
  }
22
- function ot(e, t, n, o, a, g) {
23
- const c = [], r = [];
24
- let d = !0;
25
- const x = P(t.emits), V = A(t.expose);
26
- Object.keys(n).forEach((s) => {
27
- let l = n[s];
28
- if (/^on[A-Z]/.test(s) && typeof l == "function") {
29
- let i = s.substring(2);
30
- const u = s.split(":");
31
- let p;
32
- if (u.length > 1 ? (p = u[0] + u.slice(1).map((f) => j(f)).join(""), i = B(i)) : (p = u[0], i = T(i)), u.includes("-")) {
33
- let f = p.split("-");
34
- f = f.map((y, L) => L != 0 ? j(y) : y), p = f.join("");
22
+ function at(s, e, t, r, h, $) {
23
+ const u = [], n = [];
24
+ let y = !0;
25
+ const z = Z(e.propss || []), L = q(e.emitss || []), P = G(e.exposes || []), B = I(e.slots || []);
26
+ Object.keys(t).forEach((o) => {
27
+ let c = t[o];
28
+ if (/^on[A-Z]/.test(o) && typeof c == "function") {
29
+ let i = o.substring(2);
30
+ const l = o.split(":");
31
+ let a;
32
+ if (l.length > 1 ? (a = l[0] + l.slice(1).map((f) => O(f)).join(""), i = N(i)) : (a = l[0], i = J(i)), l.includes("-")) {
33
+ let f = a.split("-");
34
+ f = f.map((m, S) => S != 0 ? O(m) : m), a = f.join("");
35
35
  }
36
- c.push(" @" + i + '="' + p + '"');
37
- const m = S(x, i).selectable, $ = E(m), h = Z($);
38
- r.push("function " + p + "(" + h + ") {"), $.forEach((f) => {
39
- r.push(
40
- " console.log('" + f.description + f.prop + "', " + f.prop + ")"
36
+ u.push(" @" + i + '="' + a + '"');
37
+ const p = j(L, i), d = p.selectable || "", b = V(d), g = Q(b);
38
+ n.push(`// ${p.description} ${p.name}: (${p.selectable})`), n.push("function " + a + "(" + g + ") {"), b.forEach((f) => {
39
+ const m = f.prop || "arr";
40
+ n.push(
41
+ " console.log('" + f.description + m + "', " + m + ")"
41
42
  );
42
- }), r.push("}");
43
+ }), n.push("}");
43
44
  } else {
44
- let i = s;
45
- if (U.includes(s) && (i = s + "1"), c.push(" :" + s + '="' + i + '"'), typeof l == "function")
46
- r.push(
47
- "const " + s + " = " + O(l, s, a)
45
+ let i = o;
46
+ M.includes(o) && (i = o + "1"), u.push(" :" + o + '="' + i + '"');
47
+ const l = j(z, o), a = X(l);
48
+ if (n.push(
49
+ `// ${l.description} ${l.name}: {${l.type}} (${l.selectable})`
50
+ ), console.log("val", c), typeof c == "function")
51
+ n.push(
52
+ "const " + o + " = " + T(c, o, h)
48
53
  );
49
- else if (d && (d = !1, r.unshift("import { ref } from 'vue';")), typeof l > "u")
50
- r.push("const " + i + " = ref();");
51
- else {
52
- let u = F(l, s, a);
53
- r.push("const " + i + " = ref(" + u + ");");
54
+ else if (y && (y = !1, n.unshift("import { ref } from 'vue';")), typeof c > "u") {
55
+ const p = F(a.dataType);
56
+ p == "()=>{}" ? n.push("const " + i + " = " + p + ";") : n.push(
57
+ "const " + i + " = ref(" + (p === "undefined" ? "" : p) + ");"
58
+ );
59
+ } else {
60
+ let p = D(c, o, h);
61
+ n.push("const " + i + " = ref(" + p + ");");
54
62
  }
55
63
  }
56
64
  });
57
- const b = Object.values(g || {});
58
- b.length > 0 && (d && (d = !1, r.unshift("import { ref } from 'vue';")), c.unshift(' ref="refDom"'), r.push("const refDom = ref()"), b.forEach((s) => {
59
- r.push(`-------${s.name}--------`);
60
- const l = S(V, s.name), i = s.name + "Value", u = E(l.selectable), p = [];
61
- s.params?.forEach((m, $) => {
62
- const h = u[$].prop, f = h + s.name;
63
- if (typeof m == "function")
64
- r.push(
65
- "const " + f + " = " + O(m, h, s.text)
66
- );
67
- else if (typeof m > "u")
68
- r.push("const " + f + " = undefined;");
69
- else {
70
- let y = F(m, h, s.text);
71
- r.push("const " + f + " = " + y + ";");
65
+ const E = Object.values($ || {});
66
+ E.length > 0 && (y && (y = !1, n.unshift("import { ref } from 'vue';")), u.unshift(' ref="refDom"'), n.push("const refDom = ref()"), E.forEach((o) => {
67
+ const c = j(P, o.name);
68
+ n.push(
69
+ `// ${c.description} ${c.name}:(${c.selectable}) ${c.type}`
70
+ );
71
+ const i = o.name + "Value", l = V(c?.selectable || ""), a = [], p = o.params || [];
72
+ l.forEach((d, b) => {
73
+ const g = d.prop;
74
+ if (g) {
75
+ const f = g + o.name, m = p[b];
76
+ if (n.push(`// ${d.label}`), typeof m == "function")
77
+ n.push(
78
+ "const " + f + " = " + T(m, g, o.text)
79
+ );
80
+ else if (typeof m > "u")
81
+ n.push(
82
+ "const " + f + " = " + F(d.dataType) + ";"
83
+ );
84
+ else {
85
+ let S = D(m, g, o.text);
86
+ n.push("const " + f + " = " + S + ";");
87
+ }
88
+ a.push(f);
72
89
  }
73
- p.push(f);
74
- }), s.type === "function" ? r.push(
75
- `const ${i} = refDom.value?.${s.name}(${p.join(", ")})`
76
- ) : r.push(`const ${i} = refDom.value?.${s.name}`), r.push(`console.log('"${l.description}"', ${i})`);
77
- })), c.length > 0 && c.unshift("");
78
- const z = q(o);
79
- return `<!--${e}-->
90
+ }), o.type === "function" ? n.push(
91
+ `const ${i} = refDom.value?.${o.name}(${a.join(", ")})`
92
+ ) : n.push(`const ${i} = refDom.value?.${o.name}`), n.push(`console.log('"${c.type}"', ${i})`);
93
+ })), u.length > 0 && u.unshift("");
94
+ const C = R(r, B);
95
+ return `<!--${s}-->
80
96
  <template>
81
97
  <div>
82
- <${e}${c.join(`
83
- `)}>${z.join(`
98
+ <${s}${u.join(`
99
+ `)}>${C.join(`
84
100
  `)}
85
- </${e}>
101
+ </${s}>
86
102
  </div>
87
103
  </template>
88
104
  <script lang="ts" setup>
89
- ${r.join(`
105
+ ${n.join(`
90
106
  `)}
91
107
  <\/script>
92
108
  `;
93
109
  }
94
- function q(e = {}) {
110
+ function R(s = {}, e) {
95
111
  const t = [];
96
- return Object.keys(e).forEach((n) => {
97
- const o = e[n];
98
- if (o) {
99
- const a = ` <template #${n}="scope">
100
- ${D(o, " ")}
112
+ return Object.keys(s).forEach((r) => {
113
+ const h = j(e, r), $ = s[r];
114
+ if ($) {
115
+ const u = ` <!-- ${h.description} ${h.name}:(${h.selectable}) -->
116
+ <template #${r}="scope">
117
+ ${w($, " ")}
101
118
  </template>`;
102
- t.push(a);
119
+ t.push(u);
103
120
  }
104
121
  }), t && t.length > 0 && t.unshift(""), t;
105
122
  }
106
- function O(e, t, n) {
107
- const o = n ? n[t] : "";
108
- return o || w(e.toString());
123
+ function T(s, e, t) {
124
+ const r = t ? t[e] : "";
125
+ return r || x(s.toString());
109
126
  }
110
- function w(e) {
111
- const t = H(J(e));
112
- if (t) {
113
- let n = `{
114
- ${D(N(t.body), " ")}
127
+ function x(s) {
128
+ const e = K(H(s));
129
+ if (e) {
130
+ let t = `{
131
+ ${w(U(e.body), " ")}
115
132
  }`;
116
- return `function ${t.param} ${n}`;
133
+ return `function (${e.param}) ${t}`;
117
134
  } else
118
135
  return "undefined";
119
136
  }
120
- function G(e) {
121
- const t = e.trim();
122
- return /^\(/.test(t) ? w(t) : JSON.stringify(e);
137
+ function W(s) {
138
+ const e = s.trim();
139
+ return /^\(/.test(e) ? x(e) : JSON.stringify(s);
123
140
  }
124
- function F(e, t, n) {
125
- const o = n ? n[t] : "";
126
- return o || (typeof e == "string" ? G(e + "") : JSON.stringify(e));
141
+ function D(s, e, t) {
142
+ const r = t ? t[e] : "";
143
+ return r || (typeof s == "string" ? W(s + "") : JSON.stringify(s));
127
144
  }
128
- function it(e) {
129
- let t = I(e.type), n = "any";
130
- t.length == 1 && (n = t[0].split("<")[0]);
131
- const o = n;
132
- let a = (e.selectable || "").trim(), g = [];
133
- return a && n != "boolean" && (a.split(",").forEach((c) => {
134
- if (c) {
135
- let r = c.split(":");
136
- g.push({
137
- label: c,
138
- prop: r[0].trim()
145
+ function X(s) {
146
+ let e = Y(s.type), t = "any";
147
+ e.length == 1 && (t = e[0].split("<")[0]);
148
+ const r = t;
149
+ let h = (s.selectable || "").trim(), $ = [];
150
+ return h && t != "boolean" && (h.split(",").forEach((u) => {
151
+ if (u) {
152
+ let n = u.split(":");
153
+ $.push({
154
+ label: u,
155
+ prop: n[0].trim()
139
156
  });
140
157
  }
141
- }), n == "function" ? n = "function" : n == "array" ? n = "choice" : n = "select"), {
142
- arr: g,
143
- zdtype: o,
144
- type: n,
145
- dataType: t
158
+ }), t == "function" ? t = "function" : t == "array" ? t = "choice" : t = "select"), {
159
+ arr: $,
160
+ zdtype: r,
161
+ type: t,
162
+ dataType: e
146
163
  };
147
164
  }
148
- function I(e) {
149
- let t = [];
150
- return (e || "").trim().toLowerCase().split(",").forEach((o) => {
151
- o = o.trim(), o && t.push(o);
152
- }), [...new Set(t)].sort();
165
+ function Y(s) {
166
+ let e = [];
167
+ return (s || "").trim().toLowerCase().split(",").forEach((r) => {
168
+ r = r.trim(), r && e.push(r);
169
+ }), [...new Set(e)].sort();
153
170
  }
154
171
  export {
155
- ot as getHmtl,
156
- it as getSpecType,
157
- F as setValStringify
172
+ at as getHmtl,
173
+ X as getSpecType,
174
+ D as setValStringify
158
175
  };
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),g=require("./set-props.vue.cjs"),y=require("./set-emit.vue.cjs");;/* empty css */const T=require("./set-code.vue.cjs"),C=require("./set-expose.vue.cjs");;/* empty css */const b=require("./set-slot.vue.cjs"),l=require("../../utils/props.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const x=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const E=t.defineComponent({props:{value:{type:Object},param:{type:Object}},render(j,O,v,U,p){const u=t.reactive({emitValue:{},slotValue:{}}),r=v.value;let c="div";r.component?c=t.defineAsyncComponent(r.component):r.name&&(c=t.resolveComponent(r.name));const i=v.param,h=l.getPropsValue(i.props),m=l.getEmitsValue(i.emits),V=l.getExposeValue(i.expose),f=l.getSlotValue(i.slot),a={},q={};h.forEach(s=>{let e=s.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(a[e]=p.propsValue[e],o&&o.length>1&&m.push({name:"update:"+e,description:s.description,selectable:"value:["+s.type+"]"}))}}),m.forEach(s=>{let e=s.name;if(e.includes("-")){let n=e.split("-");n=n.map((_,D)=>x.firstUpper(_)),e=n.join("")}else e=x.firstUpper(e);const o="on"+e;a[o]=(...n)=>{const _={arr:n,_date_:new Date().getTime()};u.emitValue[s.name]=_}});let d;return f.forEach(s=>{const e=s.name||"default";q[e]=o=>{if(u.slotValue[e]){const n=u.slotValue[e];return t.h(t.defineComponent({props:{scope:{type:Object}},template:n}),{scope:o})}}}),t.h("div",{class:"use"},[t.h("div",{class:"use-props"},t.h(g,{name:r.name,list:h,onChange:(s,e)=>{p.propsValue=s,p.propsText=e}})),t.h("div",{class:"use-component"},t.h(c,{...a,ref:s=>{d=s}},q)),t.h("div",{class:"use-code"},t.h(T,{name:r.name,param:i,value:a,propsText:p.propsText,exposeText:p.exposeText,slotValue:u.slotValue})),t.h("div",{class:"use-emit"},t.h(y,{name:r.name,list:m,value:u.emitValue})),t.h("div",{class:"use-expose"},t.h(C,{name:r.name,list:V,getRef:()=>d,onChange:s=>{p.exposeText=s}})),t.h("div",{class:"use-slot"},t.h(b,{name:r.name,list:f,onChange:(s,e)=>{u.slotValue[s]=e}}))])},data(){return{propsValue:{},propsText:{},exposeText:{}}}});module.exports=E;
1
+ "use strict";const s=require("vue"),g=require("./set-props.vue.cjs"),y=require("./set-emit.vue.cjs");;/* empty css */const T=require("./set-code.vue.cjs"),C=require("./set-expose.vue.cjs");;/* empty css */const b=require("./set-slot.vue.cjs"),l=require("../../utils/props.cjs");require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/basic/array/toggleArray");require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const x=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const E=s.defineComponent({props:{value:{type:Object},param:{type:Object}},render(j,O,v,U,p){const u=s.reactive({emitValue:{},slotValue:{}}),r=v.value;let c="div";r.component?c=s.defineAsyncComponent(r.component):r.name&&(c=s.resolveComponent(r.name));const i=v.param||{},h=l.getPropsValue(i.propss||[]),m=l.getEmitsValue(i.emitss||[]),V=l.getExposeValue(i.exposes||[]),f=l.getSlotValue(i.slots||[]),a={},q={};h.forEach(t=>{let e=t.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(a[e]=p.propsValue[e],o&&o.length>1&&m.push({name:"update:"+e,description:t.description,selectable:"value:["+t.type+"]"}))}}),m.forEach(t=>{let e=t.name;if(e.includes("-")){let n=e.split("-");n=n.map((_,D)=>x.firstUpper(_)),e=n.join("")}else e=x.firstUpper(e);const o="on"+e;a[o]=(...n)=>{const _={arr:n,_date_:new Date().getTime()};u.emitValue[t.name]=_}});let d;return f.forEach(t=>{const e=t.name||"default";q[e]=o=>{if(u.slotValue[e]){const n=u.slotValue[e];return s.h(s.defineComponent({props:{scope:{type:Object}},template:n}),{scope:o})}}}),s.h("div",{class:"use"},[s.h("div",{class:"use-props"},s.h(g,{name:r.name,list:h,onChange:(t,e)=>{p.propsValue=t,p.propsText=e}})),s.h("div",{class:"use-component"},s.h(c,{...a,ref:t=>{d=t}},q)),s.h("div",{class:"use-code"},s.h(T,{name:r.name,param:i,value:a,propsText:p.propsText,exposeText:p.exposeText,slotValue:u.slotValue})),s.h("div",{class:"use-emit"},s.h(y,{name:r.name,list:m,value:u.emitValue})),s.h("div",{class:"use-expose"},s.h(C,{name:r.name,list:V,getRef:()=>d,onChange:t=>{p.exposeText=t}})),s.h("div",{class:"use-slot"},s.h(b,{name:r.name,list:f,onChange:(t,e)=>{u.slotValue[t]=e}}))])},data(){return{propsValue:{},propsText:{},exposeText:{}}}});module.exports=E;
@@ -1,4 +1,4 @@
1
- import { defineComponent as _, reactive as T, defineAsyncComponent as b, resolveComponent as j, h as o } from "vue";
1
+ import { defineComponent as _, reactive as T, defineAsyncComponent as b, resolveComponent as j, h as s } from "vue";
2
2
  import C from "./set-props.vue.js";
3
3
  import y from "./set-emit.vue.js";
4
4
  /* empty css */
@@ -18,7 +18,7 @@ import "@fangzhongya/utils/basic/array/asyncMergeArray";
18
18
  import { firstUpper as g } from "@fangzhongya/utils/basic/string/firstUpper";
19
19
  import "@fangzhongya/utils/urls/getSuffix";
20
20
  import "@fangzhongya/utils/basic/array/replaceAfter";
21
- const se = _({
21
+ const oe = _({
22
22
  /**
23
23
  * @props {Stinrg} value 插入数据
24
24
  */
@@ -34,10 +34,10 @@ const se = _({
34
34
  const r = T({
35
35
  emitValue: {},
36
36
  slotValue: {}
37
- }), s = f.value;
37
+ }), o = f.value;
38
38
  let l = "div";
39
- s.component ? l = b(s.component) : s.name && (l = j(s.name));
40
- const a = f.param, d = D(a.props), c = U(a.emits), h = k(a.expose), x = w(a.slot), i = {}, V = {};
39
+ o.component ? l = b(o.component) : o.name && (l = j(o.name));
40
+ const a = f.param || {}, d = D(a.propss || []), c = U(a.emitss || []), h = k(a.exposes || []), x = w(a.slots || []), i = {}, V = {};
41
41
  d.forEach((t) => {
42
42
  let e = t.name;
43
43
  if (!e.includes(".")) {
@@ -70,7 +70,7 @@ const se = _({
70
70
  V[e] = (p) => {
71
71
  if (r.slotValue[e]) {
72
72
  const m = r.slotValue[e];
73
- return o(
73
+ return s(
74
74
  _({
75
75
  props: {
76
76
  scope: {
@@ -85,31 +85,31 @@ const se = _({
85
85
  );
86
86
  }
87
87
  };
88
- }), o(
88
+ }), s(
89
89
  "div",
90
90
  {
91
91
  class: "use"
92
92
  },
93
93
  [
94
- o(
94
+ s(
95
95
  "div",
96
96
  {
97
97
  class: "use-props"
98
98
  },
99
- o(C, {
100
- name: s.name,
99
+ s(C, {
100
+ name: o.name,
101
101
  list: d,
102
102
  onChange: (t, e) => {
103
103
  n.propsValue = t, n.propsText = e;
104
104
  }
105
105
  })
106
106
  ),
107
- o(
107
+ s(
108
108
  "div",
109
109
  {
110
110
  class: "use-component"
111
111
  },
112
- o(
112
+ s(
113
113
  l,
114
114
  {
115
115
  ...i,
@@ -120,13 +120,13 @@ const se = _({
120
120
  V
121
121
  )
122
122
  ),
123
- o(
123
+ s(
124
124
  "div",
125
125
  {
126
126
  class: "use-code"
127
127
  },
128
- o(E, {
129
- name: s.name,
128
+ s(E, {
129
+ name: o.name,
130
130
  param: a,
131
131
  value: i,
132
132
  propsText: n.propsText,
@@ -134,24 +134,24 @@ const se = _({
134
134
  slotValue: r.slotValue
135
135
  })
136
136
  ),
137
- o(
137
+ s(
138
138
  "div",
139
139
  {
140
140
  class: "use-emit"
141
141
  },
142
- o(y, {
143
- name: s.name,
142
+ s(y, {
143
+ name: o.name,
144
144
  list: c,
145
145
  value: r.emitValue
146
146
  })
147
147
  ),
148
- o(
148
+ s(
149
149
  "div",
150
150
  {
151
151
  class: "use-expose"
152
152
  },
153
- o(O, {
154
- name: s.name,
153
+ s(O, {
154
+ name: o.name,
155
155
  list: h,
156
156
  getRef: () => v,
157
157
  onChange: (t) => {
@@ -159,13 +159,13 @@ const se = _({
159
159
  }
160
160
  })
161
161
  ),
162
- o(
162
+ s(
163
163
  "div",
164
164
  {
165
165
  class: "use-slot"
166
166
  },
167
- o($, {
168
- name: s.name,
167
+ s($, {
168
+ name: o.name,
169
169
  list: x,
170
170
  onChange: (t, e) => {
171
171
  r.slotValue[t] = e;
@@ -191,5 +191,5 @@ const se = _({
191
191
  // },
192
192
  });
193
193
  export {
194
- se as default
194
+ oe as default
195
195
  };