@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.
- package/dist/node/index.cjs +110 -58
- package/dist/node/index.js +110 -58
- package/dist/packages/components/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +42 -50
- package/dist/packages/components/use/code.cjs +11 -10
- package/dist/packages/components/use/code.js +128 -111
- package/dist/packages/components/use/index.cjs +1 -1
- package/dist/packages/components/use/index.js +25 -25
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +1 -0
- package/dist/packages/components/use/util.js +49 -27
- package/package.json +1 -1
|
@@ -1,75 +1,67 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getConfig as
|
|
6
|
-
import
|
|
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
|
|
9
|
-
const
|
|
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
|
-
},
|
|
12
|
+
}, K = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "compo-md-list"
|
|
15
|
-
},
|
|
15
|
+
}, M = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "compo-use"
|
|
18
|
-
},
|
|
18
|
+
}, I = /* @__PURE__ */ g({
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
21
21
|
value: Object
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
23
|
+
setup(u) {
|
|
24
|
+
const t = u, _ = L("useparam"), c = m(""), l = h({
|
|
25
25
|
md: !0
|
|
26
|
-
}), a =
|
|
27
|
-
function
|
|
28
|
-
|
|
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
|
-
|
|
32
|
-
() =>
|
|
30
|
+
y(
|
|
31
|
+
() => t.value,
|
|
33
32
|
() => {
|
|
34
|
-
|
|
33
|
+
v();
|
|
35
34
|
}
|
|
36
35
|
);
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
45
|
-
r(
|
|
46
|
-
r(
|
|
47
|
-
onChange:
|
|
48
|
-
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 ? (
|
|
51
|
-
|
|
52
|
-
onClick:
|
|
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
|
-
|
|
56
|
-
(
|
|
57
|
-
])) :
|
|
58
|
-
])) :
|
|
59
|
-
|
|
60
|
-
r(
|
|
61
|
-
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
|
-
])) :
|
|
61
|
+
])) : s("", !0)
|
|
70
62
|
]));
|
|
71
63
|
}
|
|
72
64
|
});
|
|
73
65
|
export {
|
|
74
|
-
|
|
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
|
|
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
|
-
<${
|
|
5
|
-
`)}>${
|
|
4
|
+
<${s}${p.join(`
|
|
5
|
+
`)}>${U.join(`
|
|
6
6
|
`)}
|
|
7
|
-
</${
|
|
7
|
+
</${s}>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
<script lang="ts" setup>
|
|
11
|
-
${
|
|
11
|
+
${n.join(`
|
|
12
12
|
`)}
|
|
13
13
|
<\/script>
|
|
14
|
-
`}function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
13
|
-
import { getEmitsValue as
|
|
14
|
-
import { getFunctionFormat as
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
return
|
|
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
|
|
20
|
-
return
|
|
19
|
+
function Q(s) {
|
|
20
|
+
return s.map((e) => (e.prop || "...arr") + ":" + A(e.dataType)).join(",");
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
Object.keys(
|
|
27
|
-
let
|
|
28
|
-
if (/^on[A-Z]/.test(
|
|
29
|
-
let i =
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
let f =
|
|
34
|
-
f = f.map((
|
|
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
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
}),
|
|
43
|
+
}), n.push("}");
|
|
43
44
|
} else {
|
|
44
|
-
let i =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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 (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
<${
|
|
83
|
-
`)}>${
|
|
98
|
+
<${s}${u.join(`
|
|
99
|
+
`)}>${C.join(`
|
|
84
100
|
`)}
|
|
85
|
-
</${
|
|
101
|
+
</${s}>
|
|
86
102
|
</div>
|
|
87
103
|
</template>
|
|
88
104
|
<script lang="ts" setup>
|
|
89
|
-
${
|
|
105
|
+
${n.join(`
|
|
90
106
|
`)}
|
|
91
107
|
<\/script>
|
|
92
108
|
`;
|
|
93
109
|
}
|
|
94
|
-
function
|
|
110
|
+
function R(s = {}, e) {
|
|
95
111
|
const t = [];
|
|
96
|
-
return Object.keys(
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
|
|
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(
|
|
119
|
+
t.push(u);
|
|
103
120
|
}
|
|
104
121
|
}), t && t.length > 0 && t.unshift(""), t;
|
|
105
122
|
}
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
return
|
|
123
|
+
function T(s, e, t) {
|
|
124
|
+
const r = t ? t[e] : "";
|
|
125
|
+
return r || x(s.toString());
|
|
109
126
|
}
|
|
110
|
-
function
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
let
|
|
114
|
-
${
|
|
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 ${
|
|
133
|
+
return `function (${e.param}) ${t}`;
|
|
117
134
|
} else
|
|
118
135
|
return "undefined";
|
|
119
136
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return /^\(/.test(
|
|
137
|
+
function W(s) {
|
|
138
|
+
const e = s.trim();
|
|
139
|
+
return /^\(/.test(e) ? x(e) : JSON.stringify(s);
|
|
123
140
|
}
|
|
124
|
-
function
|
|
125
|
-
const
|
|
126
|
-
return
|
|
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
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
let
|
|
133
|
-
return
|
|
134
|
-
if (
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
label:
|
|
138
|
-
prop:
|
|
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
|
-
}),
|
|
142
|
-
arr:
|
|
143
|
-
zdtype:
|
|
144
|
-
type:
|
|
145
|
-
dataType:
|
|
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
|
|
149
|
-
let
|
|
150
|
-
return (
|
|
151
|
-
|
|
152
|
-
}), [...new Set(
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
172
|
+
at as getHmtl,
|
|
173
|
+
X as getSpecType,
|
|
174
|
+
D as setValStringify
|
|
158
175
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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
|
|
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
|
|
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
|
-
}),
|
|
37
|
+
}), o = f.value;
|
|
38
38
|
let l = "div";
|
|
39
|
-
|
|
40
|
-
const a = f.param, d = D(a.
|
|
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
|
|
73
|
+
return s(
|
|
74
74
|
_({
|
|
75
75
|
props: {
|
|
76
76
|
scope: {
|
|
@@ -85,31 +85,31 @@ const se = _({
|
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
}),
|
|
88
|
+
}), s(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
91
|
class: "use"
|
|
92
92
|
},
|
|
93
93
|
[
|
|
94
|
-
|
|
94
|
+
s(
|
|
95
95
|
"div",
|
|
96
96
|
{
|
|
97
97
|
class: "use-props"
|
|
98
98
|
},
|
|
99
|
-
|
|
100
|
-
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
|
-
|
|
107
|
+
s(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
110
|
class: "use-component"
|
|
111
111
|
},
|
|
112
|
-
|
|
112
|
+
s(
|
|
113
113
|
l,
|
|
114
114
|
{
|
|
115
115
|
...i,
|
|
@@ -120,13 +120,13 @@ const se = _({
|
|
|
120
120
|
V
|
|
121
121
|
)
|
|
122
122
|
),
|
|
123
|
-
|
|
123
|
+
s(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
126
|
class: "use-code"
|
|
127
127
|
},
|
|
128
|
-
|
|
129
|
-
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
|
-
|
|
137
|
+
s(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
140
|
class: "use-emit"
|
|
141
141
|
},
|
|
142
|
-
|
|
143
|
-
name:
|
|
142
|
+
s(y, {
|
|
143
|
+
name: o.name,
|
|
144
144
|
list: c,
|
|
145
145
|
value: r.emitValue
|
|
146
146
|
})
|
|
147
147
|
),
|
|
148
|
-
|
|
148
|
+
s(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
151
|
class: "use-expose"
|
|
152
152
|
},
|
|
153
|
-
|
|
154
|
-
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
|
-
|
|
162
|
+
s(
|
|
163
163
|
"div",
|
|
164
164
|
{
|
|
165
165
|
class: "use-slot"
|
|
166
166
|
},
|
|
167
|
-
|
|
168
|
-
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
|
-
|
|
194
|
+
oe as default
|
|
195
195
|
};
|