@fangzhongya/vue-archive 0.0.3-2 → 0.0.3-3

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.
@@ -66526,12 +66526,21 @@ ${vueFormat(getFunBody(st.body), " ")}
66526
66526
  }
66527
66527
  }
66528
66528
  }
66529
+ function getChange(str) {
66530
+ return new Function(
66531
+ "",
66532
+ `{
66533
+ var a = ${str};
66534
+ return a;
66535
+ }`
66536
+ );
66537
+ }
66529
66538
  function setValStringify(v, key, propsText) {
66530
66539
  const text = propsText ? propsText[key] : "";
66531
66540
  if (text) {
66532
66541
  return text;
66533
66542
  } else {
66534
- return JSON.stringify(v);
66543
+ return JSON.stringify(getChange(v + ""));
66535
66544
  }
66536
66545
  }
66537
66546
 
@@ -66526,12 +66526,21 @@ ${vueFormat(getFunBody(st.body), " ")}
66526
66526
  }
66527
66527
  }
66528
66528
  }
66529
+ function getChange(str) {
66530
+ return new Function(
66531
+ "",
66532
+ `{
66533
+ var a = ${str};
66534
+ return a;
66535
+ }`
66536
+ );
66537
+ }
66529
66538
  function setValStringify(v, key, propsText) {
66530
66539
  const text = propsText ? propsText[key] : "";
66531
66540
  if (text) {
66532
66541
  return text;
66533
66542
  } else {
66534
- return JSON.stringify(v);
66543
+ return JSON.stringify(getChange(v + ""));
66535
66544
  }
66536
66545
  }
66537
66546
 
@@ -1,18 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),m=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),F=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),p=require("./util.cjs");function b(r,t,i,e){const n=[],o=[];let h=!0;Object.keys(t).forEach(s=>{let f=t[s];if(/^on[A-Z]/.test(s)&&typeof f=="function"){let u=s.substring(2);const l=s.split(":");let c;if(l.length>1?(c=l[0]+l.slice(1).map(a=>m.firstUpper(a)).join(""),u=F.firstLower(u)):(c=l[0],u=j.humpToLine(u)),l.includes("-")){let a=c.split("-");a=a.map((g,$)=>$!=0?m.firstUpper(g):g),c=a.join("")}n.push(" @"+u+'="'+c+'"'),o.push("function "+c+"(...arr) {"),o.push(" console.log('"+c+"', arr)"),o.push("}")}else if(n.push(" :"+s+'="'+s+'"'),typeof f=="function")o.push("const "+s+" = "+O(f,s,e));else if(h&&(h=!1,o.unshift("import { ref } from 'vue';")),typeof f>"u")o.push("const "+s+" = ref();");else{let u=S(f,s,e);o.push("const "+s+" = ref("+u+");")}}),n.length>0&&n.unshift("");const d=v(i);return`<!--${r}-->
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),m=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),p=require("./util.cjs");function v(t,n,i,e){const r=[],o=[];let h=!0;Object.keys(n).forEach(s=>{let f=n[s];if(/^on[A-Z]/.test(s)&&typeof f=="function"){let u=s.substring(2);const l=s.split(":");let c;if(l.length>1?(c=l[0]+l.slice(1).map(a=>m.firstUpper(a)).join(""),u=j.firstLower(u)):(c=l[0],u=F.humpToLine(u)),l.includes("-")){let a=c.split("-");a=a.map((g,$)=>$!=0?m.firstUpper(g):g),c=a.join("")}r.push(" @"+u+'="'+c+'"'),o.push("function "+c+"(...arr) {"),o.push(" console.log('"+c+"', arr)"),o.push("}")}else if(r.push(" :"+s+'="'+s+'"'),typeof f=="function")o.push("const "+s+" = "+O(f,s,e));else if(h&&(h=!1,o.unshift("import { ref } from 'vue';")),typeof f>"u")o.push("const "+s+" = ref();");else{let u=J(f,s,e);o.push("const "+s+" = ref("+u+");")}}),r.length>0&&r.unshift("");const d=b(i);return`<!--${t}-->
2
2
  <template>
3
3
  <div>
4
- <${r}${n.join(`
4
+ <${t}${r.join(`
5
5
  `)}>${d.join(`
6
6
  `)}
7
- </${r}>
7
+ </${t}>
8
8
  </div>
9
9
  </template>
10
10
  <script lang="ts" setup>
11
11
  ${o.join(`
12
12
  `)}
13
13
  <\/script>
14
- `}function v(r={}){const t=[];return Object.keys(r).forEach(i=>{const e=r[i];if(e){const n=` <template #${i}="scope">
14
+ `}function b(t={}){const n=[];return Object.keys(t).forEach(i=>{const e=t[i];if(e){const r=` <template #${i}="scope">
15
15
  ${p.vueFormat(e," ")}
16
- </template>`;t.push(n)}}),t&&t.length>0&&t.unshift(""),t}function O(r,t,i){const e=i?i[t]:"";if(e)return"function"+e;{const n=p.getFunctionFormat(p.prettierFormat(r.toString()));if(n){let o=`{
17
- ${p.vueFormat(p.getFunBody(n.body)," ")}
18
- }`;return`function${n.param}${o}`}else return"undefined"}}function S(r,t,i){const e=i?i[t]:"";return e||JSON.stringify(r)}exports.getHmtl=b;
16
+ </template>`;n.push(r)}}),n&&n.length>0&&n.unshift(""),n}function O(t,n,i){const e=i?i[n]:"";if(e)return"function"+e;{const r=p.getFunctionFormat(p.prettierFormat(t.toString()));if(r){let o=`{
17
+ ${p.vueFormat(p.getFunBody(r.body)," ")}
18
+ }`;return`function${r.param}${o}`}else return"undefined"}}function S(t){return new Function("",`{
19
+ var a = ${t};
20
+ return a;
21
+ }`)}function J(t,n,i){const e=i?i[n]:"";return e||JSON.stringify(S(t+""))}exports.getHmtl=v;
@@ -1,58 +1,58 @@
1
- import { humpToLine as j } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
1
+ import { humpToLine as F } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
2
2
  import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
3
- import { firstLower as F } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
4
- import { vueFormat as g, getFunctionFormat as b, prettierFormat as v, getFunBody as S } from "./util.js";
5
- function N(r, t, i, n) {
6
- const e = [], o = [];
7
- let a = !0;
8
- Object.keys(t).forEach((s) => {
9
- let c = t[s];
10
- if (/^on[A-Z]/.test(s) && typeof c == "function") {
11
- let f = s.substring(2);
12
- const l = s.split(":");
3
+ import { firstLower as j } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
4
+ import { vueFormat as g, getFunctionFormat as v, prettierFormat as b, getFunBody as S } from "./util.js";
5
+ function N(t, n, s, e) {
6
+ const r = [], o = [];
7
+ let p = !0;
8
+ Object.keys(n).forEach((i) => {
9
+ let c = n[i];
10
+ if (/^on[A-Z]/.test(i) && typeof c == "function") {
11
+ let f = i.substring(2);
12
+ const l = i.split(":");
13
13
  let u;
14
- if (l.length > 1 ? (u = l[0] + l.slice(1).map((p) => h(p)).join(""), f = F(f)) : (u = l[0], f = j(f)), l.includes("-")) {
15
- let p = u.split("-");
16
- p = p.map((m, $) => $ != 0 ? h(m) : m), u = p.join("");
14
+ if (l.length > 1 ? (u = l[0] + l.slice(1).map((a) => h(a)).join(""), f = j(f)) : (u = l[0], f = F(f)), l.includes("-")) {
15
+ let a = u.split("-");
16
+ a = a.map((m, d) => d != 0 ? h(m) : m), u = a.join("");
17
17
  }
18
- e.push(
18
+ r.push(
19
19
  " @" + f + '="' + u + '"'
20
20
  ), o.push("function " + u + "(...arr) {"), o.push(
21
21
  " console.log('" + u + "', arr)"
22
22
  ), o.push("}");
23
- } else if (e.push(
24
- " :" + s + '="' + s + '"'
23
+ } else if (r.push(
24
+ " :" + i + '="' + i + '"'
25
25
  ), typeof c == "function")
26
26
  o.push(
27
- "const " + s + " = " + B(
27
+ "const " + i + " = " + w(
28
28
  c,
29
- s,
30
- n
29
+ i,
30
+ e
31
31
  )
32
32
  );
33
- else if (a && (a = !1, o.unshift(
33
+ else if (p && (p = !1, o.unshift(
34
34
  "import { ref } from 'vue';"
35
35
  )), typeof c > "u")
36
- o.push("const " + s + " = ref();");
36
+ o.push("const " + i + " = ref();");
37
37
  else {
38
38
  let f = E(
39
39
  c,
40
- s,
41
- n
40
+ i,
41
+ e
42
42
  );
43
43
  o.push(
44
- "const " + s + " = ref(" + f + ");"
44
+ "const " + i + " = ref(" + f + ");"
45
45
  );
46
46
  }
47
- }), e.length > 0 && e.unshift("");
48
- const d = O(i);
49
- return `<!--${r}-->
47
+ }), r.length > 0 && r.unshift("");
48
+ const $ = O(s);
49
+ return `<!--${t}-->
50
50
  <template>
51
51
  <div>
52
- <${r}${e.join(`
53
- `)}>${d.join(`
52
+ <${t}${r.join(`
53
+ `)}>${$.join(`
54
54
  `)}
55
- </${r}>
55
+ </${t}>
56
56
  </div>
57
57
  </template>
58
58
  <script lang="ts" setup>
@@ -61,38 +61,47 @@ ${o.join(`
61
61
  <\/script>
62
62
  `;
63
63
  }
64
- function O(r = {}) {
65
- const t = [];
66
- return Object.keys(r).forEach((i) => {
67
- const n = r[i];
68
- if (n) {
69
- const e = ` <template #${i}="scope">
70
- ${g(n, " ")}
64
+ function O(t = {}) {
65
+ const n = [];
66
+ return Object.keys(t).forEach((s) => {
67
+ const e = t[s];
68
+ if (e) {
69
+ const r = ` <template #${s}="scope">
70
+ ${g(e, " ")}
71
71
  </template>`;
72
- t.push(e);
72
+ n.push(r);
73
73
  }
74
- }), t && t.length > 0 && t.unshift(""), t;
74
+ }), n && n.length > 0 && n.unshift(""), n;
75
75
  }
76
- function B(r, t, i) {
77
- const n = i ? i[t] : "";
78
- if (n)
79
- return "function" + n;
76
+ function w(t, n, s) {
77
+ const e = s ? s[n] : "";
78
+ if (e)
79
+ return "function" + e;
80
80
  {
81
- const e = b(
82
- v(r.toString())
81
+ const r = v(
82
+ b(t.toString())
83
83
  );
84
- if (e) {
84
+ if (r) {
85
85
  let o = `{
86
- ${g(S(e.body), " ")}
86
+ ${g(S(r.body), " ")}
87
87
  }`;
88
- return `function${e.param}${o}`;
88
+ return `function${r.param}${o}`;
89
89
  } else
90
90
  return "undefined";
91
91
  }
92
92
  }
93
- function E(r, t, i) {
94
- const n = i ? i[t] : "";
95
- return n || JSON.stringify(r);
93
+ function B(t) {
94
+ return new Function(
95
+ "",
96
+ `{
97
+ var a = ${t};
98
+ return a;
99
+ }`
100
+ );
101
+ }
102
+ function E(t, n, s) {
103
+ const e = s ? s[n] : "";
104
+ return e || JSON.stringify(B(t + ""));
96
105
  }
97
106
  export {
98
107
  N as getHmtl
@@ -1 +1 @@
1
- "use strict";const s=require("vue"),x=require("./set-props.vue.cjs"),q=require("./set-emit.vue.cjs"),E=require("./set-code.vue.cjs"),b=require("./set-expose.vue.cjs"),C=require("./set-slot.vue.cjs"),i=require("../../utils/props.cjs"),V=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=s.defineComponent({props:{value:{type:Object},param:{type:Object}},render(O,T,v,D,a){console.log("render",new Date().getTime());const r=s.reactive({emitValue:{},slotValue:{}}),n=v.value;let c="div";n.component?c=s.defineAsyncComponent(n.component):n.name&&(c=s.resolveComponent(n.name));const u=v.param,d=i.getPropsValue(u.propss),m=i.getEmitsValue(u.emitss),y=i.getExposeValue(u.exposes),h=i.getSlotValue(u.slots),l={},f={};d.forEach(t=>{let e=t.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(l[e]=a.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 p=e.split("-");p=p.map((_,U)=>V.firstUpper(_)),e=p.join("")}else e=V.firstUpper(e);const o="on"+e;l[o]=(...p)=>{const _={arr:p,_date_:new Date().getTime()};r.emitValue[t.name]=_}});let g;return h.forEach(t=>{const e=t.name||"default";f[e]=o=>{if(r.slotValue[e])return s.h(s.defineComponent({props:{scope:{type:Object}},template:r.slotValue[e]}),{scope:o})}}),s.h("div",{class:"use"},[s.h("div",{class:"use-props"},s.h(x,{name:n.name,list:d,onChange:(t,e)=>{a.propsValue=t,a.propsText=e}})),s.h("div",{class:"use-component"},s.h(c,{...l,ref:t=>{g=t}},f)),s.h("div",{class:"use-code"},s.h(E,{name:n.name,value:l,propsText:a.propsText,slotValue:r.slotValue})),s.h("div",{class:"use-emit"},s.h(q,{name:n.name,list:m,value:r.emitValue})),s.h("div",{class:"use-expose"},s.h(b,{name:n.name,list:y,getRef:()=>g})),s.h("div",{class:"use-slot"},s.h(C,{name:n.name,list:h,onChange:(t,e)=>{r.slotValue[t]=e}}))])},data(){return{propsValue:{},propsText:{}}}});module.exports=j;
1
+ "use strict";const s=require("vue"),x=require("./set-props.vue.cjs"),q=require("./set-emit.vue.cjs"),E=require("./set-code.vue.cjs"),b=require("./set-expose.vue.cjs"),C=require("./set-slot.vue.cjs"),i=require("../../utils/props.cjs"),V=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=s.defineComponent({props:{value:{type:Object},param:{type:Object}},render(O,T,v,D,a){console.log("render",new Date().getTime());const r=s.reactive({emitValue:{},slotValue:{}}),n=v.value;let c="div";n.component?c=s.defineAsyncComponent(n.component):n.name&&(c=s.resolveComponent(n.name));const u=v.param,d=i.getPropsValue(u.propss||[]),m=i.getEmitsValue(u.emitss||[]),y=i.getExposeValue(u.exposes||[]),h=i.getSlotValue(u.slots||[]),l={},f={};d.forEach(t=>{let e=t.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(l[e]=a.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 p=e.split("-");p=p.map((_,U)=>V.firstUpper(_)),e=p.join("")}else e=V.firstUpper(e);const o="on"+e;l[o]=(...p)=>{const _={arr:p,_date_:new Date().getTime()};r.emitValue[t.name]=_}});let g;return h.forEach(t=>{const e=t.name||"default";f[e]=o=>{if(r.slotValue[e])return s.h(s.defineComponent({props:{scope:{type:Object}},template:r.slotValue[e]}),{scope:o})}}),s.h("div",{class:"use"},[s.h("div",{class:"use-props"},s.h(x,{name:n.name,list:d,onChange:(t,e)=>{a.propsValue=t,a.propsText=e}})),s.h("div",{class:"use-component"},s.h(c,{...l,ref:t=>{g=t}},f)),s.h("div",{class:"use-code"},s.h(E,{name:n.name,value:l,propsText:a.propsText,slotValue:r.slotValue})),s.h("div",{class:"use-emit"},s.h(q,{name:n.name,list:m,value:r.emitValue})),s.h("div",{class:"use-expose"},s.h(b,{name:n.name,list:y,getRef:()=>g})),s.h("div",{class:"use-slot"},s.h(C,{name:n.name,list:h,onChange:(t,e)=>{r.slotValue[t]=e}}))])},data(){return{propsValue:{},propsText:{}}}});module.exports=j;
@@ -26,7 +26,7 @@ const K = g({
26
26
  }), o = f.value;
27
27
  let i = "div";
28
28
  o.component ? i = j(o.component) : o.name && (i = T(o.name));
29
- const p = f.param, d = D(p.propss), c = w(p.emitss), x = U(p.exposes), V = k(p.slots), l = {}, v = {};
29
+ const p = f.param, d = D(p.propss || []), c = w(p.emitss || []), x = U(p.exposes || []), V = k(p.slots || []), l = {}, v = {};
30
30
  d.forEach((s) => {
31
31
  let e = s.name;
32
32
  if (!e.includes(".")) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.3-2",
4
+ "version": "0.0.3-3",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",