@fangzhongya/vue-archive 0.0.28 → 0.0.29
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.
package/dist/node/index.cjs
CHANGED
|
@@ -3250,7 +3250,7 @@ function getHmtl(propsname, param, value, slotValue, propsText, exposeText) {
|
|
|
3250
3250
|
z = key + "1";
|
|
3251
3251
|
}
|
|
3252
3252
|
tarr.push(" :" + key + '="' + z + '"');
|
|
3253
|
-
const sp = getSpecObjs(ps, key);
|
|
3253
|
+
const sp = getSpecObjs(ps, key) || {};
|
|
3254
3254
|
const t = getSpecType(sp);
|
|
3255
3255
|
sarr.push(
|
|
3256
3256
|
`// ${sp.description} ${sp.name}: {${sp.type}} (${sp.selectable})`
|
|
@@ -3289,7 +3289,7 @@ function getHmtl(propsname, param, value, slotValue, propsText, exposeText) {
|
|
|
3289
3289
|
tarr.unshift(' ref="refDom"');
|
|
3290
3290
|
sarr.push("const refDom = ref()");
|
|
3291
3291
|
ev.forEach((v) => {
|
|
3292
|
-
const s = getSpecObjs(res, v.name);
|
|
3292
|
+
const s = getSpecObjs(res, v.name) || {};
|
|
3293
3293
|
sarr.push(
|
|
3294
3294
|
`// ${s.description} ${s.name}\uFF1A(${s.selectable}) ${s.type}`
|
|
3295
3295
|
);
|
|
@@ -3350,7 +3350,7 @@ ${sarr.join("\n")}
|
|
|
3350
3350
|
function getSlots(obj = {}, ss) {
|
|
3351
3351
|
const arr = [];
|
|
3352
3352
|
Object.keys(obj).forEach((key) => {
|
|
3353
|
-
const sp = getSpecObjs(ss, key);
|
|
3353
|
+
const sp = getSpecObjs(ss, key) || {};
|
|
3354
3354
|
const v = obj[key];
|
|
3355
3355
|
if (v) {
|
|
3356
3356
|
const st = ` <!-- ${sp.description} ${sp.name}\uFF1A(${sp.selectable}) -->
|
package/dist/node/index.js
CHANGED
|
@@ -3235,7 +3235,7 @@ function getHmtl(propsname, param, value, slotValue, propsText, exposeText) {
|
|
|
3235
3235
|
z = key + "1";
|
|
3236
3236
|
}
|
|
3237
3237
|
tarr.push(" :" + key + '="' + z + '"');
|
|
3238
|
-
const sp = getSpecObjs(ps, key);
|
|
3238
|
+
const sp = getSpecObjs(ps, key) || {};
|
|
3239
3239
|
const t = getSpecType(sp);
|
|
3240
3240
|
sarr.push(
|
|
3241
3241
|
`// ${sp.description} ${sp.name}: {${sp.type}} (${sp.selectable})`
|
|
@@ -3274,7 +3274,7 @@ function getHmtl(propsname, param, value, slotValue, propsText, exposeText) {
|
|
|
3274
3274
|
tarr.unshift(' ref="refDom"');
|
|
3275
3275
|
sarr.push("const refDom = ref()");
|
|
3276
3276
|
ev.forEach((v) => {
|
|
3277
|
-
const s = getSpecObjs(res, v.name);
|
|
3277
|
+
const s = getSpecObjs(res, v.name) || {};
|
|
3278
3278
|
sarr.push(
|
|
3279
3279
|
`// ${s.description} ${s.name}\uFF1A(${s.selectable}) ${s.type}`
|
|
3280
3280
|
);
|
|
@@ -3335,7 +3335,7 @@ ${sarr.join("\n")}
|
|
|
3335
3335
|
function getSlots(obj = {}, ss) {
|
|
3336
3336
|
const arr = [];
|
|
3337
3337
|
Object.keys(obj).forEach((key) => {
|
|
3338
|
-
const sp = getSpecObjs(ss, key);
|
|
3338
|
+
const sp = getSpecObjs(ss, key) || {};
|
|
3339
3339
|
const v = obj[key];
|
|
3340
3340
|
if (v) {
|
|
3341
3341
|
const st = ` <!-- ${sp.description} ${sp.name}\uFF1A(${sp.selectable}) -->
|
|
@@ -1,4 +1,4 @@
|
|
|
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 f=[],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 p=e[r];if(/^on[A-Z]/.test(r)&&typeof p=="function"){let i=r.substring(2);const c=r.split(":");let a;if(c.length>1?(a=c[0]+c.slice(1).map(l=>V.firstUpper(l)).join(""),i=C.firstLower(i)):(a=c[0],i=B.humpToLine(i)),c.includes("-")){let l=a.split("-");l=l.map((m,T)=>T!=0?V.firstUpper(m):m),a=l.join("")}f.push(" @"+i+'="'+a+'"');const u=j(P,i)||{},y=u.selectable||"",q=g.getParametersObj(y),d=N(q);n.push(`// ${u.description} ${u.name}: (${u.selectable})`),n.push("function "+a+"("+d+") {"),q.forEach(l=>{const m=l.prop||"arr";n.push(" console.log('"+l.description+m+"', "+m+")")}),n.push("}")}else{let i=r;J.includes(r)&&(i=r+"1"),f.push(" :"+r+'="'+i+'"');const c=j(L,r),a=D(c);if(n.push(`// ${c.description} ${c.name}: {${c.type}} (${c.selectable})`),typeof p=="function")n.push("const "+r+" = "+F(p,r,h));else if(b&&(b=!1,n.unshift("import { ref } from 'vue';")),typeof p>"u"){const u=g.getTypeValue(a.dataType);u=="()=>{}"?n.push("const "+i+" = "+u+";"):n.push("const "+i+" = ref("+(u==="undefined"?"":u)+");")}else{let u=E(p,r,h);n.push("const "+i+" = ref("+u+");")}}});const O=Object.values($||{});O.length>0&&(b&&(b=!1,n.unshift("import { ref } from 'vue';")),f.unshift(' ref="refDom"'),n.push("const refDom = ref()"),O.forEach(r=>{const p=j(x,r.name);n.push(`// ${p.description} ${p.name}:(${p.selectable}) ${p.type}`);const i=r.name+"Value",c=g.getParametersObj(p?.selectable||""),a=[],u=r.params||[];c.forEach((y,q)=>{const d=y.prop;if(d){const l=d+r.name,m=u[q];if(n.push(`// ${y.label}`),typeof m=="function")n.push("const "+l+" = "+F(m,d,r.text));else if(typeof m>"u")n.push("const "+l+" = "+g.getTypeValue(y.dataType)+";");else{let T=E(m,d,r.text);n.push("const "+l+" = "+T+";")}a.push(l)}}),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('"${p.type}"', ${i})`)})),f.length>0&&f.unshift("");const U=M(o,z);return`<!--${s}-->
|
|
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 f=[],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 p=e[r];if(/^on[A-Z]/.test(r)&&typeof p=="function"){let i=r.substring(2);const c=r.split(":");let a;if(c.length>1?(a=c[0]+c.slice(1).map(l=>V.firstUpper(l)).join(""),i=C.firstLower(i)):(a=c[0],i=B.humpToLine(i)),c.includes("-")){let l=a.split("-");l=l.map((m,T)=>T!=0?V.firstUpper(m):m),a=l.join("")}f.push(" @"+i+'="'+a+'"');const u=j(P,i)||{},y=u.selectable||"",q=g.getParametersObj(y),d=N(q);n.push(`// ${u.description} ${u.name}: (${u.selectable})`),n.push("function "+a+"("+d+") {"),q.forEach(l=>{const m=l.prop||"arr";n.push(" console.log('"+l.description+m+"', "+m+")")}),n.push("}")}else{let i=r;J.includes(r)&&(i=r+"1"),f.push(" :"+r+'="'+i+'"');const c=j(L,r)||{},a=D(c);if(n.push(`// ${c.description} ${c.name}: {${c.type}} (${c.selectable})`),typeof p=="function")n.push("const "+r+" = "+F(p,r,h));else if(b&&(b=!1,n.unshift("import { ref } from 'vue';")),typeof p>"u"){const u=g.getTypeValue(a.dataType);u=="()=>{}"?n.push("const "+i+" = "+u+";"):n.push("const "+i+" = ref("+(u==="undefined"?"":u)+");")}else{let u=E(p,r,h);n.push("const "+i+" = ref("+u+");")}}});const O=Object.values($||{});O.length>0&&(b&&(b=!1,n.unshift("import { ref } from 'vue';")),f.unshift(' ref="refDom"'),n.push("const refDom = ref()"),O.forEach(r=>{const p=j(x,r.name)||{};n.push(`// ${p.description} ${p.name}:(${p.selectable}) ${p.type}`);const i=r.name+"Value",c=g.getParametersObj(p?.selectable||""),a=[],u=r.params||[];c.forEach((y,q)=>{const d=y.prop;if(d){const l=d+r.name,m=u[q];if(n.push(`// ${y.label}`),typeof m=="function")n.push("const "+l+" = "+F(m,d,r.text));else if(typeof m>"u")n.push("const "+l+" = "+g.getTypeValue(y.dataType)+";");else{let T=E(m,d,r.text);n.push("const "+l+" = "+T+";")}a.push(l)}}),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('"${p.type}"', ${i})`)})),f.length>0&&f.unshift("");const U=M(o,z);return`<!--${s}-->
|
|
2
2
|
<template>
|
|
3
3
|
<div>
|
|
4
4
|
<${s}${f.join(`
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
${n.join(`
|
|
12
12
|
`)}
|
|
13
13
|
<\/script>
|
|
14
|
-
`}function M(s={},t){const e=[];return Object.keys(s).forEach(o=>{const h=j(t,o),$=s[o];if($){const f=` <!-- ${h.description} ${h.name}:(${h.selectable}) -->
|
|
14
|
+
`}function M(s={},t){const e=[];return Object.keys(s).forEach(o=>{const h=j(t,o)||{},$=s[o];if($){const f=` <!-- ${h.description} ${h.name}:(${h.selectable}) -->
|
|
15
15
|
<template #${o}="scope">
|
|
16
16
|
${g.vueFormat($," ")}
|
|
17
17
|
</template>`;e.push(f)}}),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=`{
|
|
@@ -44,7 +44,7 @@ function at(s, e, t, r, h, $) {
|
|
|
44
44
|
} else {
|
|
45
45
|
let i = o;
|
|
46
46
|
M.includes(o) && (i = o + "1"), l.push(" :" + o + '="' + i + '"');
|
|
47
|
-
const c = j(z, o), a = X(c);
|
|
47
|
+
const c = j(z, o) || {}, a = X(c);
|
|
48
48
|
if (n.push(
|
|
49
49
|
`// ${c.description} ${c.name}: {${c.type}} (${c.selectable})`
|
|
50
50
|
), typeof u == "function")
|
|
@@ -64,7 +64,7 @@ function at(s, e, t, r, h, $) {
|
|
|
64
64
|
});
|
|
65
65
|
const E = Object.values($ || {});
|
|
66
66
|
E.length > 0 && (y && (y = !1, n.unshift("import { ref } from 'vue';")), l.unshift(' ref="refDom"'), n.push("const refDom = ref()"), E.forEach((o) => {
|
|
67
|
-
const u = j(P, o.name);
|
|
67
|
+
const u = j(P, o.name) || {};
|
|
68
68
|
n.push(
|
|
69
69
|
`// ${u.description} ${u.name}:(${u.selectable}) ${u.type}`
|
|
70
70
|
);
|
|
@@ -110,7 +110,7 @@ ${n.join(`
|
|
|
110
110
|
function R(s = {}, e) {
|
|
111
111
|
const t = [];
|
|
112
112
|
return Object.keys(s).forEach((r) => {
|
|
113
|
-
const h = j(e, r), $ = s[r];
|
|
113
|
+
const h = j(e, r) || {}, $ = s[r];
|
|
114
114
|
if ($) {
|
|
115
115
|
const l = ` <!-- ${h.description} ${h.name}:(${h.selectable}) -->
|
|
116
116
|
<template #${r}="scope">
|