@fangzhongya/vue-archive 0.0.44 → 0.0.46
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 +61 -16
- package/dist/node/index.js +61 -16
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.js +98 -85
- package/dist/packages/components/use/code.cjs +9 -9
- package/dist/packages/components/use/code.d.ts +1 -1
- package/dist/packages/components/use/code.js +117 -104
- package/dist/packages/components/use/index.cjs +1 -1
- package/dist/packages/components/use/index.js +1 -1
- package/dist/packages/components/use/retrie/array/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/array/index.vue.js +16 -16
- package/dist/packages/components/use/retrie/object/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/object/index.vue.js +17 -17
- package/dist/packages/components/use/set-props.vue.cjs +1 -1
- package/dist/packages/components/use/set-props.vue.js +15 -17
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -3452,7 +3452,13 @@ ${vueFormat(v, " ")}
|
|
|
3452
3452
|
function getFunctionBody(v, key, propsText) {
|
|
3453
3453
|
const text = propsText ? propsText[key] : "";
|
|
3454
3454
|
if (text) {
|
|
3455
|
-
|
|
3455
|
+
if (text.includes("=>")) {
|
|
3456
|
+
return text;
|
|
3457
|
+
} else if (text.includes("function")) {
|
|
3458
|
+
return text;
|
|
3459
|
+
} else {
|
|
3460
|
+
return funstr(v.toString());
|
|
3461
|
+
}
|
|
3456
3462
|
} else {
|
|
3457
3463
|
return funstr(v.toString());
|
|
3458
3464
|
}
|
|
@@ -3520,7 +3526,7 @@ function getSpecType(val) {
|
|
|
3520
3526
|
let z = v.split(":");
|
|
3521
3527
|
arr.push({
|
|
3522
3528
|
label: v,
|
|
3523
|
-
prop: z[0].trim()
|
|
3529
|
+
prop: getObjValue(z[0].trim())
|
|
3524
3530
|
});
|
|
3525
3531
|
}
|
|
3526
3532
|
});
|
|
@@ -3555,18 +3561,34 @@ function getType(value) {
|
|
|
3555
3561
|
});
|
|
3556
3562
|
return [...new Set(arr)].sort();
|
|
3557
3563
|
}
|
|
3558
|
-
function getObjValue(d) {
|
|
3564
|
+
function getObjValue(d, type) {
|
|
3559
3565
|
try {
|
|
3560
|
-
|
|
3566
|
+
if (type?.toLowerCase() == "function") {
|
|
3567
|
+
if (typeof d === "string") {
|
|
3568
|
+
if (/^\((.|\n|\r)*\)$/.test(d)) {
|
|
3569
|
+
d = d.substring(1, d.length - 1);
|
|
3570
|
+
return new Function(`{ return ${d} }`)();
|
|
3571
|
+
}
|
|
3572
|
+
} else {
|
|
3573
|
+
return d;
|
|
3574
|
+
}
|
|
3575
|
+
} else {
|
|
3576
|
+
return new Function(`{ return ${d} }`)();
|
|
3577
|
+
}
|
|
3561
3578
|
} catch (error) {
|
|
3562
3579
|
return "" + d;
|
|
3563
3580
|
}
|
|
3564
3581
|
}
|
|
3565
|
-
function getDefaultValue(obj) {
|
|
3582
|
+
function getDefaultValue(obj, is = true) {
|
|
3566
3583
|
const vo = getSpecType(obj);
|
|
3567
3584
|
const v = getTypeValue(vo.dataType);
|
|
3568
|
-
|
|
3569
|
-
|
|
3585
|
+
if (is) {
|
|
3586
|
+
const d = (obj.default || "").trim();
|
|
3587
|
+
return getObjValue(d || v, vo.dataType[0]);
|
|
3588
|
+
} else {
|
|
3589
|
+
const d = (obj.default || "").trim();
|
|
3590
|
+
return getObjValue(d, vo.dataType[0]);
|
|
3591
|
+
}
|
|
3570
3592
|
}
|
|
3571
3593
|
|
|
3572
3594
|
// packages/components/compo/index.ts
|
|
@@ -3590,13 +3612,37 @@ function getDefault(ss, iss) {
|
|
|
3590
3612
|
const cs = css.map((o) => o[0]);
|
|
3591
3613
|
let ci = cs.indexOf(c);
|
|
3592
3614
|
if (ci != -1) {
|
|
3593
|
-
let
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3615
|
+
let bracketStack = [c];
|
|
3616
|
+
for (let i = 1; i < ss.length; i++) {
|
|
3617
|
+
const char = ss[i];
|
|
3618
|
+
if (cs.includes(char)) {
|
|
3619
|
+
bracketStack.push(char);
|
|
3620
|
+
} else {
|
|
3621
|
+
let is = false;
|
|
3622
|
+
char === "]" && bracketStack[bracketStack.length - 1] === "[";
|
|
3623
|
+
for (let v of css) {
|
|
3624
|
+
if (char === v[1] && bracketStack[bracketStack.length - 1] === v[0]) {
|
|
3625
|
+
is = true;
|
|
3626
|
+
break;
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
if (is) {
|
|
3630
|
+
bracketStack.pop();
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
if (bracketStack.length === 0) {
|
|
3634
|
+
if (iss && ss[i + 1] === " ") {
|
|
3635
|
+
return ss.substring(0, i + 1);
|
|
3636
|
+
} else {
|
|
3637
|
+
return ss.substring(0, i + 1);
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
} else {
|
|
3642
|
+
if (iss) {
|
|
3643
|
+
return ss.substring(0, ss.indexOf(" "));
|
|
3644
|
+
} else {
|
|
3645
|
+
return ss;
|
|
3600
3646
|
}
|
|
3601
3647
|
}
|
|
3602
3648
|
}
|
|
@@ -4035,8 +4081,7 @@ function setVue(propsname, param, url) {
|
|
|
4035
4081
|
let arr = name.split("/");
|
|
4036
4082
|
name = (arr[0] || "").trim();
|
|
4037
4083
|
if (name) {
|
|
4038
|
-
|
|
4039
|
-
propsObj[name] = dv;
|
|
4084
|
+
propsObj[name] = getDefaultValue(val);
|
|
4040
4085
|
if (arr && arr.length > 1) {
|
|
4041
4086
|
es.push({
|
|
4042
4087
|
name: "update:" + name,
|
package/dist/node/index.js
CHANGED
|
@@ -3437,7 +3437,13 @@ ${vueFormat(v, " ")}
|
|
|
3437
3437
|
function getFunctionBody(v, key, propsText) {
|
|
3438
3438
|
const text = propsText ? propsText[key] : "";
|
|
3439
3439
|
if (text) {
|
|
3440
|
-
|
|
3440
|
+
if (text.includes("=>")) {
|
|
3441
|
+
return text;
|
|
3442
|
+
} else if (text.includes("function")) {
|
|
3443
|
+
return text;
|
|
3444
|
+
} else {
|
|
3445
|
+
return funstr(v.toString());
|
|
3446
|
+
}
|
|
3441
3447
|
} else {
|
|
3442
3448
|
return funstr(v.toString());
|
|
3443
3449
|
}
|
|
@@ -3505,7 +3511,7 @@ function getSpecType(val) {
|
|
|
3505
3511
|
let z = v.split(":");
|
|
3506
3512
|
arr.push({
|
|
3507
3513
|
label: v,
|
|
3508
|
-
prop: z[0].trim()
|
|
3514
|
+
prop: getObjValue(z[0].trim())
|
|
3509
3515
|
});
|
|
3510
3516
|
}
|
|
3511
3517
|
});
|
|
@@ -3540,18 +3546,34 @@ function getType(value) {
|
|
|
3540
3546
|
});
|
|
3541
3547
|
return [...new Set(arr)].sort();
|
|
3542
3548
|
}
|
|
3543
|
-
function getObjValue(d) {
|
|
3549
|
+
function getObjValue(d, type) {
|
|
3544
3550
|
try {
|
|
3545
|
-
|
|
3551
|
+
if (type?.toLowerCase() == "function") {
|
|
3552
|
+
if (typeof d === "string") {
|
|
3553
|
+
if (/^\((.|\n|\r)*\)$/.test(d)) {
|
|
3554
|
+
d = d.substring(1, d.length - 1);
|
|
3555
|
+
return new Function(`{ return ${d} }`)();
|
|
3556
|
+
}
|
|
3557
|
+
} else {
|
|
3558
|
+
return d;
|
|
3559
|
+
}
|
|
3560
|
+
} else {
|
|
3561
|
+
return new Function(`{ return ${d} }`)();
|
|
3562
|
+
}
|
|
3546
3563
|
} catch (error) {
|
|
3547
3564
|
return "" + d;
|
|
3548
3565
|
}
|
|
3549
3566
|
}
|
|
3550
|
-
function getDefaultValue(obj) {
|
|
3567
|
+
function getDefaultValue(obj, is = true) {
|
|
3551
3568
|
const vo = getSpecType(obj);
|
|
3552
3569
|
const v = getTypeValue(vo.dataType);
|
|
3553
|
-
|
|
3554
|
-
|
|
3570
|
+
if (is) {
|
|
3571
|
+
const d = (obj.default || "").trim();
|
|
3572
|
+
return getObjValue(d || v, vo.dataType[0]);
|
|
3573
|
+
} else {
|
|
3574
|
+
const d = (obj.default || "").trim();
|
|
3575
|
+
return getObjValue(d, vo.dataType[0]);
|
|
3576
|
+
}
|
|
3555
3577
|
}
|
|
3556
3578
|
|
|
3557
3579
|
// packages/components/compo/index.ts
|
|
@@ -3575,13 +3597,37 @@ function getDefault(ss, iss) {
|
|
|
3575
3597
|
const cs = css.map((o) => o[0]);
|
|
3576
3598
|
let ci = cs.indexOf(c);
|
|
3577
3599
|
if (ci != -1) {
|
|
3578
|
-
let
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3600
|
+
let bracketStack = [c];
|
|
3601
|
+
for (let i = 1; i < ss.length; i++) {
|
|
3602
|
+
const char = ss[i];
|
|
3603
|
+
if (cs.includes(char)) {
|
|
3604
|
+
bracketStack.push(char);
|
|
3605
|
+
} else {
|
|
3606
|
+
let is = false;
|
|
3607
|
+
char === "]" && bracketStack[bracketStack.length - 1] === "[";
|
|
3608
|
+
for (let v of css) {
|
|
3609
|
+
if (char === v[1] && bracketStack[bracketStack.length - 1] === v[0]) {
|
|
3610
|
+
is = true;
|
|
3611
|
+
break;
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
if (is) {
|
|
3615
|
+
bracketStack.pop();
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
if (bracketStack.length === 0) {
|
|
3619
|
+
if (iss && ss[i + 1] === " ") {
|
|
3620
|
+
return ss.substring(0, i + 1);
|
|
3621
|
+
} else {
|
|
3622
|
+
return ss.substring(0, i + 1);
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
}
|
|
3626
|
+
} else {
|
|
3627
|
+
if (iss) {
|
|
3628
|
+
return ss.substring(0, ss.indexOf(" "));
|
|
3629
|
+
} else {
|
|
3630
|
+
return ss;
|
|
3585
3631
|
}
|
|
3586
3632
|
}
|
|
3587
3633
|
}
|
|
@@ -4020,8 +4066,7 @@ function setVue(propsname, param, url) {
|
|
|
4020
4066
|
let arr = name.split("/");
|
|
4021
4067
|
name = (arr[0] || "").trim();
|
|
4022
4068
|
if (name) {
|
|
4023
|
-
|
|
4024
|
-
propsObj[name] = dv;
|
|
4069
|
+
propsObj[name] = getDefaultValue(val);
|
|
4025
4070
|
if (arr && arr.length > 1) {
|
|
4026
4071
|
es.push({
|
|
4027
4072
|
name: "update:" + name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../../utils/index.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");require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");require("@fangzhongya/utils/html/getVueText");const o=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function h(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]];const t=l.map(n=>n[0]);if(t.indexOf(r)!=-1){let n=[r];for(let a=1;a<e.length;a++){const u=e[a];if(t.includes(u))n.push(u);else{let m=!1;for(let f of l)if(u===f[1]&&n[n.length-1]===f[0]){m=!0;break}m&&n.pop()}if(n.length===0)return s&&e[a+1]===" ",e.substring(0,a+1)}}else return s?e.substring(0,e.indexOf(" ")):e}function E(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,i="";if(s=="default")r=r.trim(),r=h(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const u=r.split("=");r=u[0];const m=u[1]+" "+l,f=h(m,!0);f?(t=f,l=m.replace(f,"")):t=e.default||u[1]||""}const a=/\s*\((.*)\)\s/gi.exec(l);a&&a.length>0&&(i=a[1],l=l.replace(a[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=i,e}function q(e){let s=["title","text","author","date"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{b(t.key,t.value)})}function g(e){c.titles.push(e)}function O(e){let s=["props","name","type","default","selectable","description","descriptions","return"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{b(t.key,t.value)})}function T(e){let s=["slot","name","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{b(t.key,t.value)})}function y(e){let s=["emits","name","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{b(t.key,t.value)})}function k(e){let s=["expose","name","type","return","selectable","description","descriptions"],r=d(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{b(t.key,t.value)})}function p(e,s){const r=c[s+"name"]||[],l=e.name??e[s]?.name,t=r.indexOf(l);t>=0&&(c[s+"s"].splice(t,1),r.splice(t,1)),c[s+"s"].push(e),r.push(l),c[s+"name"]=r}function j(){Object.keys(c).forEach(e=>{c[e]=[]})}function d(e,s){const r={descriptions:e?.description||""},l=[];return e?.tags&&e.tags?.forEach(t=>{let i=t.tag,n=E(t);if(!r.hasOwnProperty(i))r[i]=n;else{const a={};a[i]=n,l.push({key:i,value:a})}}),{arr:l,obj:r}}function b(e,s){switch(e){case"title":return g(s),!0;case"text":return g(s),!0;case"props":return p(s,"props"),!0;case"slot":return p(s,"slot"),!0;case"emits":return p(s,"emits"),!0;case"expose":return p(s,"expose"),!0;default:return!1}}function S(e,s){switch(e){case"title":return q(s),!0;case"props":return O(s),!0;case"slot":return T(s),!0;case"emits":return y(s),!0;case"expose":return k(s),!0;default:return!1}}function w(e){return j(),e?.forEach(s=>{let r=s?.tags||[],l=r?.length||0;if(l>0)for(let t=0;t<l;t++){const i=r[t]||{};if(S(i.tag,s))break}}),c}function N(e){let s=x.getTextNotes(e);return w(s)}const P=[{label:"属性名",prop:"name",formatter:o.props.name},{label:"说明",prop:"description",formatter:o.props.description},{label:"类型",prop:"type",formatter:o.props.type},{label:"可选值",prop:"selectable",formatter:o.props.selectable},{label:"默认值",prop:"default",formatter:o.props.default}],v=[{label:"事件名",prop:"name",formatter:o.emits.name},{label:"说明",prop:"description",formatter:o.emits.description},{label:"回调参数",prop:"selectable",formatter:o.emits.selectable}],F=[{label:"方法名",prop:"name",formatter:o.expose.name},{label:"说明",prop:"description",formatter:o.expose.description},{label:"参数",prop:"selectable",formatter:o.expose.selectable},{label:"返回值",prop:"type",formatter(e){return o.expose.return(e)??o.expose.type(e)}}],z=[{label:"插槽名",prop:"name",formatter:o.slot.name},{label:"说明",prop:"description",formatter:o.slot.description},{label:"作用域参数",prop:"selectable",formatter:o.slot.selectable}];exports.getNotesText=N;exports.temits=v;exports.texpose=F;exports.tprops=P;exports.tslot=z;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTextNotes as
|
|
1
|
+
import { getTextNotes as k } from "../../utils/index.js";
|
|
2
2
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
3
3
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
4
4
|
import "@fangzhongya/utils/name/humpToLine";
|
|
@@ -11,8 +11,8 @@ import "@fangzhongya/utils/basic/string/firstUpper";
|
|
|
11
11
|
import "@fangzhongya/utils/urls/getSuffix";
|
|
12
12
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
13
13
|
import "@fangzhongya/utils/html/getVueText";
|
|
14
|
-
import { props as
|
|
15
|
-
const
|
|
14
|
+
import { props as m, emits as g, expose as d, slot as x } from "../../utils/props.js";
|
|
15
|
+
const i = {
|
|
16
16
|
titles: [],
|
|
17
17
|
propss: [],
|
|
18
18
|
slots: [],
|
|
@@ -27,36 +27,49 @@ function O(e, s) {
|
|
|
27
27
|
["(", ")"],
|
|
28
28
|
["{", "}"],
|
|
29
29
|
["[", "]"]
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
];
|
|
31
|
+
const t = l.map((a) => a[0]);
|
|
32
|
+
if (t.indexOf(r) != -1) {
|
|
33
|
+
let a = [r];
|
|
34
|
+
for (let o = 1; o < e.length; o++) {
|
|
35
|
+
const p = e[o];
|
|
36
|
+
if (t.includes(p))
|
|
37
|
+
a.push(p);
|
|
38
|
+
else {
|
|
39
|
+
let u = !1;
|
|
40
|
+
for (let f of l)
|
|
41
|
+
if (p === f[1] && a[a.length - 1] === f[0]) {
|
|
42
|
+
u = !0;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
u && a.pop();
|
|
46
|
+
}
|
|
47
|
+
if (a.length === 0)
|
|
48
|
+
return s && e[o + 1] === " ", e.substring(0, o + 1);
|
|
49
|
+
}
|
|
50
|
+
} else
|
|
51
|
+
return s ? e.substring(0, e.indexOf(" ")) : e;
|
|
39
52
|
}
|
|
40
|
-
function
|
|
53
|
+
function T(e) {
|
|
41
54
|
delete e.problems, delete e.source;
|
|
42
|
-
let s = e.tag, r = e.name, l = e.description, t = e.default,
|
|
55
|
+
let s = e.tag, r = e.name, l = e.description, t = e.default, n = "";
|
|
43
56
|
if (s == "default")
|
|
44
57
|
r = r.trim(), r = O(r) || r;
|
|
45
58
|
else if (s == "selectable")
|
|
46
59
|
r = r.trim();
|
|
47
60
|
else {
|
|
48
61
|
if (r.includes("=")) {
|
|
49
|
-
const
|
|
50
|
-
r =
|
|
51
|
-
const
|
|
52
|
-
|
|
62
|
+
const p = r.split("=");
|
|
63
|
+
r = p[0];
|
|
64
|
+
const u = p[1] + " " + l, f = O(u, !0);
|
|
65
|
+
f ? (t = f, l = u.replace(f, "")) : t = e.default || p[1] || "";
|
|
53
66
|
}
|
|
54
|
-
const
|
|
55
|
-
|
|
67
|
+
const o = /\s*\((.*)\)\s/gi.exec(l);
|
|
68
|
+
o && o.length > 0 && (n = o[1], l = l.replace(o[0], ""));
|
|
56
69
|
}
|
|
57
|
-
return e.name = r, e.default = t || "", e.description = l, e.selectable =
|
|
70
|
+
return e.name = r, e.default = t || "", e.description = l, e.selectable = n, e;
|
|
58
71
|
}
|
|
59
|
-
function
|
|
72
|
+
function y(e) {
|
|
60
73
|
let s = [
|
|
61
74
|
"title",
|
|
62
75
|
// 'name',
|
|
@@ -65,15 +78,15 @@ function w(e) {
|
|
|
65
78
|
"date"
|
|
66
79
|
// 'description',
|
|
67
80
|
// 'descriptions',
|
|
68
|
-
], r =
|
|
81
|
+
], r = b(e), l = {};
|
|
69
82
|
s.forEach((t) => {
|
|
70
83
|
l[t] = r.obj[t];
|
|
71
|
-
}),
|
|
72
|
-
|
|
84
|
+
}), E(l), r.arr.forEach((t) => {
|
|
85
|
+
h(t.key, t.value);
|
|
73
86
|
});
|
|
74
87
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
88
|
+
function E(e) {
|
|
89
|
+
i.titles.push(e);
|
|
77
90
|
}
|
|
78
91
|
function j(e) {
|
|
79
92
|
let s = [
|
|
@@ -85,27 +98,27 @@ function j(e) {
|
|
|
85
98
|
"description",
|
|
86
99
|
"descriptions",
|
|
87
100
|
"return"
|
|
88
|
-
], r =
|
|
101
|
+
], r = b(e), l = {};
|
|
89
102
|
s.forEach((t) => {
|
|
90
103
|
l[t] = r.obj[t];
|
|
91
|
-
}),
|
|
92
|
-
|
|
104
|
+
}), c(l, "props"), r.arr.forEach((t) => {
|
|
105
|
+
h(t.key, t.value);
|
|
93
106
|
});
|
|
94
107
|
}
|
|
95
|
-
function
|
|
96
|
-
let s = ["slot", "name", "selectable", "description", "descriptions"], r =
|
|
108
|
+
function w(e) {
|
|
109
|
+
let s = ["slot", "name", "selectable", "description", "descriptions"], r = b(e), l = {};
|
|
97
110
|
s.forEach((t) => {
|
|
98
111
|
l[t] = r.obj[t];
|
|
99
|
-
}),
|
|
100
|
-
|
|
112
|
+
}), c(l, "slot"), r.arr.forEach((t) => {
|
|
113
|
+
h(t.key, t.value);
|
|
101
114
|
});
|
|
102
115
|
}
|
|
103
116
|
function F(e) {
|
|
104
|
-
let s = ["emits", "name", "selectable", "description", "descriptions"], r =
|
|
117
|
+
let s = ["emits", "name", "selectable", "description", "descriptions"], r = b(e), l = {};
|
|
105
118
|
s.forEach((t) => {
|
|
106
119
|
l[t] = r.obj[t];
|
|
107
|
-
}),
|
|
108
|
-
|
|
120
|
+
}), c(l, "emits"), r.arr.forEach((t) => {
|
|
121
|
+
h(t.key, t.value);
|
|
109
122
|
});
|
|
110
123
|
}
|
|
111
124
|
function N(e) {
|
|
@@ -117,35 +130,35 @@ function N(e) {
|
|
|
117
130
|
"selectable",
|
|
118
131
|
"description",
|
|
119
132
|
"descriptions"
|
|
120
|
-
], r =
|
|
133
|
+
], r = b(e), l = {};
|
|
121
134
|
s.forEach((t) => {
|
|
122
135
|
l[t] = r.obj[t];
|
|
123
|
-
}),
|
|
124
|
-
|
|
136
|
+
}), c(l, "expose"), r.arr.forEach((t) => {
|
|
137
|
+
h(t.key, t.value);
|
|
125
138
|
});
|
|
126
139
|
}
|
|
127
|
-
function
|
|
128
|
-
const r =
|
|
129
|
-
t >= 0 && (
|
|
140
|
+
function c(e, s) {
|
|
141
|
+
const r = i[s + "name"] || [], l = e.name ?? e[s]?.name, t = r.indexOf(l);
|
|
142
|
+
t >= 0 && (i[s + "s"].splice(t, 1), r.splice(t, 1)), i[s + "s"].push(e), r.push(l), i[s + "name"] = r;
|
|
130
143
|
}
|
|
131
144
|
function P() {
|
|
132
|
-
Object.keys(
|
|
133
|
-
|
|
145
|
+
Object.keys(i).forEach((e) => {
|
|
146
|
+
i[e] = [];
|
|
134
147
|
});
|
|
135
148
|
}
|
|
136
|
-
function
|
|
149
|
+
function b(e, s) {
|
|
137
150
|
const r = {
|
|
138
151
|
descriptions: e?.description || ""
|
|
139
152
|
}, l = [];
|
|
140
153
|
return e?.tags && e.tags?.forEach((t) => {
|
|
141
|
-
let
|
|
142
|
-
if (!r.hasOwnProperty(
|
|
143
|
-
r[
|
|
154
|
+
let n = t.tag, a = T(t);
|
|
155
|
+
if (!r.hasOwnProperty(n))
|
|
156
|
+
r[n] = a;
|
|
144
157
|
else {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
key:
|
|
148
|
-
value:
|
|
158
|
+
const o = {};
|
|
159
|
+
o[n] = a, l.push({
|
|
160
|
+
key: n,
|
|
161
|
+
value: o
|
|
149
162
|
});
|
|
150
163
|
}
|
|
151
164
|
}), {
|
|
@@ -153,32 +166,32 @@ function u(e, s) {
|
|
|
153
166
|
obj: r
|
|
154
167
|
};
|
|
155
168
|
}
|
|
156
|
-
function
|
|
169
|
+
function h(e, s) {
|
|
157
170
|
switch (e) {
|
|
158
171
|
case "title":
|
|
159
|
-
return
|
|
172
|
+
return E(s), !0;
|
|
160
173
|
case "text":
|
|
161
|
-
return
|
|
174
|
+
return E(s), !0;
|
|
162
175
|
case "props":
|
|
163
|
-
return
|
|
176
|
+
return c(s, "props"), !0;
|
|
164
177
|
case "slot":
|
|
165
|
-
return
|
|
178
|
+
return c(s, "slot"), !0;
|
|
166
179
|
case "emits":
|
|
167
|
-
return
|
|
180
|
+
return c(s, "emits"), !0;
|
|
168
181
|
case "expose":
|
|
169
|
-
return
|
|
182
|
+
return c(s, "expose"), !0;
|
|
170
183
|
default:
|
|
171
184
|
return !1;
|
|
172
185
|
}
|
|
173
186
|
}
|
|
174
|
-
function
|
|
187
|
+
function S(e, s) {
|
|
175
188
|
switch (e) {
|
|
176
189
|
case "title":
|
|
177
|
-
return
|
|
190
|
+
return y(s), !0;
|
|
178
191
|
case "props":
|
|
179
192
|
return j(s), !0;
|
|
180
193
|
case "slot":
|
|
181
|
-
return
|
|
194
|
+
return w(s), !0;
|
|
182
195
|
case "emits":
|
|
183
196
|
return F(s), !0;
|
|
184
197
|
case "expose":
|
|
@@ -187,46 +200,46 @@ function z(e, s) {
|
|
|
187
200
|
return !1;
|
|
188
201
|
}
|
|
189
202
|
}
|
|
190
|
-
function
|
|
203
|
+
function v(e) {
|
|
191
204
|
return P(), e?.forEach((s) => {
|
|
192
205
|
let r = s?.tags || [], l = r?.length || 0;
|
|
193
206
|
if (l > 0)
|
|
194
207
|
for (let t = 0; t < l; t++) {
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
208
|
+
const n = r[t] || {};
|
|
209
|
+
if (S(n.tag, s))
|
|
197
210
|
break;
|
|
198
211
|
}
|
|
199
|
-
}),
|
|
212
|
+
}), i;
|
|
200
213
|
}
|
|
201
|
-
function
|
|
202
|
-
let s =
|
|
203
|
-
return
|
|
214
|
+
function Q(e) {
|
|
215
|
+
let s = k(e);
|
|
216
|
+
return v(s);
|
|
204
217
|
}
|
|
205
|
-
const
|
|
218
|
+
const R = [
|
|
206
219
|
{
|
|
207
220
|
label: "属性名",
|
|
208
221
|
prop: "name",
|
|
209
|
-
formatter:
|
|
222
|
+
formatter: m.name
|
|
210
223
|
},
|
|
211
224
|
{
|
|
212
225
|
label: "说明",
|
|
213
226
|
prop: "description",
|
|
214
|
-
formatter:
|
|
227
|
+
formatter: m.description
|
|
215
228
|
},
|
|
216
229
|
{
|
|
217
230
|
label: "类型",
|
|
218
231
|
prop: "type",
|
|
219
|
-
formatter:
|
|
232
|
+
formatter: m.type
|
|
220
233
|
},
|
|
221
234
|
{
|
|
222
235
|
label: "可选值",
|
|
223
236
|
prop: "selectable",
|
|
224
|
-
formatter:
|
|
237
|
+
formatter: m.selectable
|
|
225
238
|
},
|
|
226
239
|
{
|
|
227
240
|
label: "默认值",
|
|
228
241
|
prop: "default",
|
|
229
|
-
formatter:
|
|
242
|
+
formatter: m.default
|
|
230
243
|
}
|
|
231
244
|
], U = [
|
|
232
245
|
{
|
|
@@ -248,46 +261,46 @@ const Q = [
|
|
|
248
261
|
{
|
|
249
262
|
label: "方法名",
|
|
250
263
|
prop: "name",
|
|
251
|
-
formatter:
|
|
264
|
+
formatter: d.name
|
|
252
265
|
},
|
|
253
266
|
{
|
|
254
267
|
label: "说明",
|
|
255
268
|
prop: "description",
|
|
256
|
-
formatter:
|
|
269
|
+
formatter: d.description
|
|
257
270
|
},
|
|
258
271
|
{
|
|
259
272
|
label: "参数",
|
|
260
273
|
prop: "selectable",
|
|
261
|
-
formatter:
|
|
274
|
+
formatter: d.selectable
|
|
262
275
|
},
|
|
263
276
|
{
|
|
264
277
|
label: "返回值",
|
|
265
278
|
prop: "type",
|
|
266
279
|
formatter(e) {
|
|
267
|
-
return
|
|
280
|
+
return d.return(e) ?? d.type(e);
|
|
268
281
|
}
|
|
269
282
|
}
|
|
270
283
|
], W = [
|
|
271
284
|
{
|
|
272
285
|
label: "插槽名",
|
|
273
286
|
prop: "name",
|
|
274
|
-
formatter:
|
|
287
|
+
formatter: x.name
|
|
275
288
|
},
|
|
276
289
|
{
|
|
277
290
|
label: "说明",
|
|
278
291
|
prop: "description",
|
|
279
|
-
formatter:
|
|
292
|
+
formatter: x.description
|
|
280
293
|
},
|
|
281
294
|
{
|
|
282
295
|
label: "作用域参数",
|
|
283
296
|
prop: "selectable",
|
|
284
|
-
formatter:
|
|
297
|
+
formatter: x.selectable
|
|
285
298
|
}
|
|
286
299
|
];
|
|
287
300
|
export {
|
|
288
|
-
|
|
301
|
+
Q as getNotesText,
|
|
289
302
|
U as temits,
|
|
290
303
|
V as texpose,
|
|
291
|
-
|
|
304
|
+
R as tprops,
|
|
292
305
|
W as tslot
|
|
293
306
|
};
|