@fangzhongya/vue-archive 0.0.45 → 0.0.47
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 +184 -112
- package/dist/node/index.js +184 -112
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.js +98 -85
- package/dist/packages/components/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +18 -16
- package/dist/packages/components/compo/info-top.vue.cjs +1 -0
- package/dist/packages/components/compo/info-top.vue.js +32 -0
- package/dist/packages/components/compo/info-top.vue2.cjs +1 -0
- package/dist/packages/components/compo/info-top.vue2.js +4 -0
- package/dist/packages/components/compo/props.vue.cjs +1 -1
- package/dist/packages/components/compo/props.vue.js +44 -40
- package/dist/packages/components/compo/top.cjs +1 -1
- package/dist/packages/components/compo/top.js +69 -48
- package/dist/packages/components/main/index.vue.cjs +1 -1
- package/dist/packages/components/main/index.vue.js +30 -25
- package/dist/packages/components/test/index.cjs +1 -1
- package/dist/packages/components/test/index.js +24 -22
- package/dist/packages/components/test/top.cjs +1 -1
- package/dist/packages/components/test/top.js +69 -84
- package/dist/packages/components/use/code.cjs +6 -6
- package/dist/packages/components/use/code.js +74 -66
- 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/page/develop/index.vue2.cjs +1 -1
- package/dist/packages/page/develop/index.vue2.js +2 -1
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -2579,6 +2579,9 @@ function addTags(tag, obj) {
|
|
|
2579
2579
|
case "text":
|
|
2580
2580
|
addTitle(obj);
|
|
2581
2581
|
return true;
|
|
2582
|
+
case "html":
|
|
2583
|
+
addTitle(obj);
|
|
2584
|
+
return true;
|
|
2582
2585
|
default:
|
|
2583
2586
|
return false;
|
|
2584
2587
|
}
|
|
@@ -2711,22 +2714,32 @@ function getTopDom(props2, h4, isZy) {
|
|
|
2711
2714
|
if (is) {
|
|
2712
2715
|
setDivision();
|
|
2713
2716
|
}
|
|
2714
|
-
let type = obj.title.type || "div";
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
{
|
|
2719
|
-
class: "compo-top-title"
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
]
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2717
|
+
let type = (obj.title.type || "div").split(".");
|
|
2718
|
+
let c = type[1] || "";
|
|
2719
|
+
if (type[0] == "html") {
|
|
2720
|
+
doms.push(
|
|
2721
|
+
h4("div", {
|
|
2722
|
+
class: "compo-top-title " + c,
|
|
2723
|
+
innerHTML: obj.title.name + " " + obj.title.description
|
|
2724
|
+
})
|
|
2725
|
+
);
|
|
2726
|
+
} else {
|
|
2727
|
+
doms.push(
|
|
2728
|
+
h4(
|
|
2729
|
+
type[0],
|
|
2730
|
+
{
|
|
2731
|
+
class: "compo-top-title " + c
|
|
2732
|
+
},
|
|
2733
|
+
[
|
|
2734
|
+
h4("span", {}, [
|
|
2735
|
+
getValue(
|
|
2736
|
+
obj.title.name + " " + obj.title.description
|
|
2737
|
+
)
|
|
2738
|
+
])
|
|
2739
|
+
]
|
|
2740
|
+
)
|
|
2741
|
+
);
|
|
2742
|
+
}
|
|
2730
2743
|
}
|
|
2731
2744
|
if (is) {
|
|
2732
2745
|
if (list.length > 0) {
|
|
@@ -2743,24 +2756,46 @@ function getTopDom(props2, h4, isZy) {
|
|
|
2743
2756
|
)
|
|
2744
2757
|
);
|
|
2745
2758
|
}
|
|
2746
|
-
if (obj.
|
|
2747
|
-
let type = obj.
|
|
2759
|
+
if (obj.html) {
|
|
2760
|
+
let type = (obj.html.type || "div").split(".");
|
|
2761
|
+
let c = type[1] || "";
|
|
2748
2762
|
list.push(
|
|
2749
|
-
h4(
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
},
|
|
2754
|
-
[
|
|
2755
|
-
h4("span", {}, [
|
|
2756
|
-
getValue(
|
|
2757
|
-
obj.text.name + " " + obj.text.description
|
|
2758
|
-
)
|
|
2759
|
-
])
|
|
2760
|
-
]
|
|
2761
|
-
)
|
|
2763
|
+
h4(type[0], {
|
|
2764
|
+
class: "compo-top-html " + c,
|
|
2765
|
+
innerHTML: obj.html.name + " " + obj.html.description
|
|
2766
|
+
})
|
|
2762
2767
|
);
|
|
2763
2768
|
}
|
|
2769
|
+
["text"].forEach((v) => {
|
|
2770
|
+
if (obj[v]) {
|
|
2771
|
+
let type = (obj[v].type || "div").split(".");
|
|
2772
|
+
let c = type[1] || "";
|
|
2773
|
+
if (type[0] == "html") {
|
|
2774
|
+
list.push(
|
|
2775
|
+
h4("div", {
|
|
2776
|
+
class: "compo-top-" + v + " " + c,
|
|
2777
|
+
innerHTML: obj[v].name + " " + obj[v].description
|
|
2778
|
+
})
|
|
2779
|
+
);
|
|
2780
|
+
} else {
|
|
2781
|
+
list.push(
|
|
2782
|
+
h4(
|
|
2783
|
+
type[0],
|
|
2784
|
+
{
|
|
2785
|
+
class: "compo-top-" + v + " " + c
|
|
2786
|
+
},
|
|
2787
|
+
[
|
|
2788
|
+
h4("span", {}, [
|
|
2789
|
+
getValue(
|
|
2790
|
+
obj[v].name + " " + obj[v].description
|
|
2791
|
+
)
|
|
2792
|
+
])
|
|
2793
|
+
]
|
|
2794
|
+
)
|
|
2795
|
+
);
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
});
|
|
2764
2799
|
});
|
|
2765
2800
|
setTitle3();
|
|
2766
2801
|
setDivision();
|
|
@@ -2872,22 +2907,32 @@ function getTestTopDom(props2, h4, isZy) {
|
|
|
2872
2907
|
if (is) {
|
|
2873
2908
|
setDivision();
|
|
2874
2909
|
}
|
|
2875
|
-
let type = obj.title.type || "div";
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
{
|
|
2880
|
-
class: "test-top-title"
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
]
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2910
|
+
let type = (obj.title.type || "div").split(".");
|
|
2911
|
+
let c = type[1] || "";
|
|
2912
|
+
if (type[0] == "html") {
|
|
2913
|
+
doms.push(
|
|
2914
|
+
h4("div", {
|
|
2915
|
+
class: "test-top-title " + c,
|
|
2916
|
+
innerHTML: obj.title.name + " " + obj.title.description
|
|
2917
|
+
})
|
|
2918
|
+
);
|
|
2919
|
+
} else {
|
|
2920
|
+
doms.push(
|
|
2921
|
+
h4(
|
|
2922
|
+
type[0],
|
|
2923
|
+
{
|
|
2924
|
+
class: "test-top-title " + c
|
|
2925
|
+
},
|
|
2926
|
+
[
|
|
2927
|
+
h4("span", {}, [
|
|
2928
|
+
getValue(
|
|
2929
|
+
obj.title.name + " " + obj.title.description
|
|
2930
|
+
)
|
|
2931
|
+
])
|
|
2932
|
+
]
|
|
2933
|
+
)
|
|
2934
|
+
);
|
|
2935
|
+
}
|
|
2891
2936
|
}
|
|
2892
2937
|
if (is) {
|
|
2893
2938
|
if (list.length > 0) {
|
|
@@ -2904,60 +2949,46 @@ function getTestTopDom(props2, h4, isZy) {
|
|
|
2904
2949
|
)
|
|
2905
2950
|
);
|
|
2906
2951
|
}
|
|
2907
|
-
if (obj.
|
|
2908
|
-
let type = obj.
|
|
2909
|
-
|
|
2910
|
-
h4(
|
|
2911
|
-
type,
|
|
2912
|
-
{
|
|
2913
|
-
class: "test-top-text"
|
|
2914
|
-
},
|
|
2915
|
-
[
|
|
2916
|
-
h4("span", {}, [
|
|
2917
|
-
getValue(
|
|
2918
|
-
obj.text.name + " " + obj.text.description
|
|
2919
|
-
)
|
|
2920
|
-
])
|
|
2921
|
-
]
|
|
2922
|
-
)
|
|
2923
|
-
);
|
|
2924
|
-
}
|
|
2925
|
-
if (obj.proposal) {
|
|
2926
|
-
let type = obj.proposal.type || "div";
|
|
2927
|
-
list.push(
|
|
2928
|
-
h4(
|
|
2929
|
-
type,
|
|
2930
|
-
{
|
|
2931
|
-
class: "test-top-proposal"
|
|
2932
|
-
},
|
|
2933
|
-
[
|
|
2934
|
-
h4("span", {}, [
|
|
2935
|
-
getValue(
|
|
2936
|
-
obj.proposal.name + " " + obj.proposal.description
|
|
2937
|
-
)
|
|
2938
|
-
])
|
|
2939
|
-
]
|
|
2940
|
-
)
|
|
2941
|
-
);
|
|
2942
|
-
}
|
|
2943
|
-
if (obj.error) {
|
|
2944
|
-
let type = obj.error.type || "div";
|
|
2952
|
+
if (obj.html) {
|
|
2953
|
+
let type = (obj.html.type || "div").split(".");
|
|
2954
|
+
let c = type[1] || "";
|
|
2945
2955
|
list.push(
|
|
2946
|
-
h4(
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
},
|
|
2951
|
-
[
|
|
2952
|
-
h4("span", {}, [
|
|
2953
|
-
getValue(
|
|
2954
|
-
obj.error.name + " " + obj.error.description
|
|
2955
|
-
)
|
|
2956
|
-
])
|
|
2957
|
-
]
|
|
2958
|
-
)
|
|
2956
|
+
h4(type[0], {
|
|
2957
|
+
class: "test-top-html " + c,
|
|
2958
|
+
innerHTML: obj.html.name + " " + obj.html.description
|
|
2959
|
+
})
|
|
2959
2960
|
);
|
|
2960
2961
|
}
|
|
2962
|
+
["text", "proposal", "error"].forEach((v) => {
|
|
2963
|
+
if (obj[v]) {
|
|
2964
|
+
let type = (obj[v].type || "div").split(".");
|
|
2965
|
+
let c = type[1] || "";
|
|
2966
|
+
if (type[0] == "html") {
|
|
2967
|
+
list.push(
|
|
2968
|
+
h4("div", {
|
|
2969
|
+
class: "test-top-" + v + " " + c,
|
|
2970
|
+
innerHTML: obj[v].name + " " + obj[v].description
|
|
2971
|
+
})
|
|
2972
|
+
);
|
|
2973
|
+
} else {
|
|
2974
|
+
list.push(
|
|
2975
|
+
h4(
|
|
2976
|
+
type[0],
|
|
2977
|
+
{
|
|
2978
|
+
class: "test-top-" + v + " " + c
|
|
2979
|
+
},
|
|
2980
|
+
[
|
|
2981
|
+
h4("span", {}, [
|
|
2982
|
+
getValue(
|
|
2983
|
+
obj[v].name + " " + obj[v].description
|
|
2984
|
+
)
|
|
2985
|
+
])
|
|
2986
|
+
]
|
|
2987
|
+
)
|
|
2988
|
+
);
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
});
|
|
2961
2992
|
});
|
|
2962
2993
|
setTitle3();
|
|
2963
2994
|
setDivision();
|
|
@@ -3437,7 +3468,13 @@ ${vueFormat(v, " ")}
|
|
|
3437
3468
|
function getFunctionBody(v, key, propsText) {
|
|
3438
3469
|
const text = propsText ? propsText[key] : "";
|
|
3439
3470
|
if (text) {
|
|
3440
|
-
|
|
3471
|
+
if (text.includes("=>")) {
|
|
3472
|
+
return text;
|
|
3473
|
+
} else if (text.includes("function")) {
|
|
3474
|
+
return text;
|
|
3475
|
+
} else {
|
|
3476
|
+
return funstr(v.toString());
|
|
3477
|
+
}
|
|
3441
3478
|
} else {
|
|
3442
3479
|
return funstr(v.toString());
|
|
3443
3480
|
}
|
|
@@ -3540,22 +3577,33 @@ function getType(value) {
|
|
|
3540
3577
|
});
|
|
3541
3578
|
return [...new Set(arr)].sort();
|
|
3542
3579
|
}
|
|
3543
|
-
function getObjValue(d) {
|
|
3580
|
+
function getObjValue(d, type) {
|
|
3544
3581
|
try {
|
|
3545
|
-
|
|
3582
|
+
if (type?.toLowerCase() == "function") {
|
|
3583
|
+
if (typeof d === "string") {
|
|
3584
|
+
if (/^\((.|\n|\r)*\)$/.test(d)) {
|
|
3585
|
+
d = d.substring(1, d.length - 1);
|
|
3586
|
+
return new Function(`{ return ${d} }`)();
|
|
3587
|
+
}
|
|
3588
|
+
} else {
|
|
3589
|
+
return d;
|
|
3590
|
+
}
|
|
3591
|
+
} else {
|
|
3592
|
+
return new Function(`{ return ${d} }`)();
|
|
3593
|
+
}
|
|
3546
3594
|
} catch (error) {
|
|
3547
3595
|
return "" + d;
|
|
3548
3596
|
}
|
|
3549
3597
|
}
|
|
3550
3598
|
function getDefaultValue(obj, is = true) {
|
|
3599
|
+
const vo = getSpecType(obj);
|
|
3600
|
+
const v = getTypeValue(vo.dataType);
|
|
3551
3601
|
if (is) {
|
|
3552
|
-
const vo = getSpecType(obj);
|
|
3553
|
-
const v = getTypeValue(vo.dataType);
|
|
3554
3602
|
const d = (obj.default || "").trim();
|
|
3555
|
-
return getObjValue(d || v);
|
|
3603
|
+
return getObjValue(d || v, vo.dataType[0]);
|
|
3556
3604
|
} else {
|
|
3557
3605
|
const d = (obj.default || "").trim();
|
|
3558
|
-
return getObjValue(d);
|
|
3606
|
+
return getObjValue(d, vo.dataType[0]);
|
|
3559
3607
|
}
|
|
3560
3608
|
}
|
|
3561
3609
|
|
|
@@ -3580,13 +3628,37 @@ function getDefault(ss, iss) {
|
|
|
3580
3628
|
const cs = css.map((o) => o[0]);
|
|
3581
3629
|
let ci = cs.indexOf(c);
|
|
3582
3630
|
if (ci != -1) {
|
|
3583
|
-
let
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3631
|
+
let bracketStack = [c];
|
|
3632
|
+
for (let i = 1; i < ss.length; i++) {
|
|
3633
|
+
const char = ss[i];
|
|
3634
|
+
if (cs.includes(char)) {
|
|
3635
|
+
bracketStack.push(char);
|
|
3636
|
+
} else {
|
|
3637
|
+
let is = false;
|
|
3638
|
+
char === "]" && bracketStack[bracketStack.length - 1] === "[";
|
|
3639
|
+
for (let v of css) {
|
|
3640
|
+
if (char === v[1] && bracketStack[bracketStack.length - 1] === v[0]) {
|
|
3641
|
+
is = true;
|
|
3642
|
+
break;
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
if (is) {
|
|
3646
|
+
bracketStack.pop();
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
if (bracketStack.length === 0) {
|
|
3650
|
+
if (iss && ss[i + 1] === " ") {
|
|
3651
|
+
return ss.substring(0, i + 1);
|
|
3652
|
+
} else {
|
|
3653
|
+
return ss.substring(0, i + 1);
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
} else {
|
|
3658
|
+
if (iss) {
|
|
3659
|
+
return ss.substring(0, ss.indexOf(" "));
|
|
3660
|
+
} else {
|
|
3661
|
+
return ss;
|
|
3590
3662
|
}
|
|
3591
3663
|
}
|
|
3592
3664
|
}
|
|
@@ -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;
|