@fangzhongya/vue-archive 0.0.27 → 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}) -->
|
|
@@ -3411,7 +3411,7 @@ function getSpecType(val) {
|
|
|
3411
3411
|
type = tarr[0].split("<")[0];
|
|
3412
3412
|
}
|
|
3413
3413
|
const zdtype = type;
|
|
3414
|
-
let selectable = (val
|
|
3414
|
+
let selectable = (val?.selectable || "").trim();
|
|
3415
3415
|
let arr = [];
|
|
3416
3416
|
if (selectable && type != "boolean") {
|
|
3417
3417
|
selectable.split(",").forEach((v) => {
|
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}) -->
|
|
@@ -3396,7 +3396,7 @@ function getSpecType(val) {
|
|
|
3396
3396
|
type = tarr[0].split("<")[0];
|
|
3397
3397
|
}
|
|
3398
3398
|
const zdtype = type;
|
|
3399
|
-
let selectable = (val
|
|
3399
|
+
let selectable = (val?.selectable || "").trim();
|
|
3400
3400
|
let arr = [];
|
|
3401
3401
|
if (selectable && type != "boolean") {
|
|
3402
3402
|
selectable.split(",").forEach((v) => {
|
|
@@ -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,9 +11,9 @@
|
|
|
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=`{
|
|
18
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
|
|
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(f=>{if(f){let n=f.split(":");$.push({label:f,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;
|
|
@@ -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">
|
|
@@ -146,7 +146,7 @@ function X(s) {
|
|
|
146
146
|
let e = Y(s?.type), t = "any";
|
|
147
147
|
e.length == 1 && (t = e[0].split("<")[0]);
|
|
148
148
|
const r = t;
|
|
149
|
-
let h = (s
|
|
149
|
+
let h = (s?.selectable || "").trim(), $ = [];
|
|
150
150
|
return h && t != "boolean" && (h.split(",").forEach((l) => {
|
|
151
151
|
if (l) {
|
|
152
152
|
let n = l.split(":");
|