@fangzhongya/vue-archive 0.0.48 → 0.0.50
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 +30 -39
- package/dist/node/index.js +30 -39
- package/dist/packages/components/aside/index.vue.cjs +1 -1
- package/dist/packages/components/aside/index.vue.js +1 -1
- package/dist/packages/components/use/code.cjs +9 -9
- package/dist/packages/components/use/code.d.ts +1 -2
- package/dist/packages/components/use/code.js +100 -108
- package/dist/packages/components/use/retrie/any/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/any/index.vue.js +45 -43
- package/dist/packages/components/use/set-props.vue.cjs +1 -1
- package/dist/packages/components/use/set-props.vue.js +33 -28
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +5 -1
- package/dist/packages/components/use/util.js +33 -26
- package/package.json +2 -2
package/dist/node/index.cjs
CHANGED
|
@@ -24,12 +24,12 @@ __export(index_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(index_exports);
|
|
26
26
|
|
|
27
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
27
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
|
|
28
28
|
function isArray(obj) {
|
|
29
29
|
return Object.prototype.toString.call(obj) == "[object Array]";
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
32
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
|
|
33
33
|
function getStartSames(str, val) {
|
|
34
34
|
let s = "";
|
|
35
35
|
const vs = [...val];
|
|
@@ -45,7 +45,7 @@ function getStartSames(str, val) {
|
|
|
45
45
|
return [s, str.substring(index), val.substring(index)];
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
48
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-AWC672JW.js
|
|
49
49
|
function getImportUrl(url, imp) {
|
|
50
50
|
const arr = getStartSames(url, imp);
|
|
51
51
|
const ts = arr[0];
|
|
@@ -72,12 +72,12 @@ function getImportUrl(url, imp) {
|
|
|
72
72
|
return ds.join("") + arr[2].replace(/\\/g, "/");
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
75
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
|
|
76
76
|
function firstUpper(str) {
|
|
77
77
|
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
80
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
|
|
81
81
|
function lineToLargeHump(name) {
|
|
82
82
|
let arr = name.split("-");
|
|
83
83
|
arr = arr.map((vs) => {
|
|
@@ -786,7 +786,7 @@ function runDev(config2, configCallback) {
|
|
|
786
786
|
return new FangMd(config2, configCallback);
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
789
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
|
|
790
790
|
var zObj = {
|
|
791
791
|
"<": "<",
|
|
792
792
|
">": ">",
|
|
@@ -807,7 +807,7 @@ function htmlEscape(str) {
|
|
|
807
807
|
// packages/node/index.ts
|
|
808
808
|
var import_node_path = require("path");
|
|
809
809
|
|
|
810
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
810
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
|
|
811
811
|
function mergeObject(a, b, j = 0, i) {
|
|
812
812
|
if (a instanceof Array) {
|
|
813
813
|
if (j > 0 && i) {
|
|
@@ -850,7 +850,7 @@ function mergeObject(a, b, j = 0, i) {
|
|
|
850
850
|
return a;
|
|
851
851
|
}
|
|
852
852
|
|
|
853
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
853
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
854
854
|
function humpToLine(name) {
|
|
855
855
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
856
856
|
let result;
|
|
@@ -872,7 +872,7 @@ function humpToLine(name) {
|
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
|
|
875
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
875
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.js
|
|
876
876
|
function appearNum(str, t) {
|
|
877
877
|
let reg = t;
|
|
878
878
|
if (typeof t == "string") {
|
|
@@ -883,12 +883,12 @@ function appearNum(str, t) {
|
|
|
883
883
|
return c;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
886
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
|
|
887
887
|
function firstLower(str) {
|
|
888
888
|
return str.slice(0, 1).toLowerCase() + str.slice(1);
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
891
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
|
|
892
892
|
function asyncMergeArray(arr, callback) {
|
|
893
893
|
return new Promise((resolve2, reject) => {
|
|
894
894
|
let index = 0;
|
|
@@ -912,7 +912,7 @@ function asyncMergeArray(arr, callback) {
|
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
915
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js
|
|
916
916
|
function getSuffix2(url) {
|
|
917
917
|
const reg = /\.([a-z|A-Z]+)$/;
|
|
918
918
|
const regs = reg.exec(url);
|
|
@@ -933,7 +933,7 @@ function getConfig(key) {
|
|
|
933
933
|
return config[key];
|
|
934
934
|
}
|
|
935
935
|
|
|
936
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
936
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
937
937
|
function getVueText(content) {
|
|
938
938
|
const result = {
|
|
939
939
|
template: "",
|
|
@@ -1522,7 +1522,7 @@ function parse(source, options = {}) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
var stringify = getStringifier();
|
|
1524
1524
|
|
|
1525
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1525
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
|
|
1526
1526
|
function deComment(code) {
|
|
1527
1527
|
let output = "";
|
|
1528
1528
|
let state = "code";
|
|
@@ -1614,7 +1614,7 @@ function deComment(code) {
|
|
|
1614
1614
|
return output;
|
|
1615
1615
|
}
|
|
1616
1616
|
|
|
1617
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1617
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-DILPRD5C.js
|
|
1618
1618
|
function getImports(code, includeType = false) {
|
|
1619
1619
|
code = deComment(code);
|
|
1620
1620
|
const imports = /* @__PURE__ */ new Set();
|
|
@@ -3029,7 +3029,7 @@ var top_default2 = (0, import_vue2.defineComponent)({
|
|
|
3029
3029
|
}
|
|
3030
3030
|
});
|
|
3031
3031
|
|
|
3032
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
3032
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
|
|
3033
3033
|
var FUNCTION_REGEX = /^\s*(?:(async)\s+)?(?:function\s*(\*?)\s*(\w*)\s*\(([\s\S]*?)\)|(\*?\s*)\b(\w+)\s*\(([\s\S]*?)\)|\(([\s\S]*?)\)|([^=>,\(\)]+?))\s*(?:=>)?\s*(?:\{([\s\S]*?)\}|([\s\S]*))$/;
|
|
3034
3034
|
function getFunctionFormat(v) {
|
|
3035
3035
|
if (!v) return;
|
|
@@ -3253,9 +3253,10 @@ var parseTypeDefinition = (typeDef) => {
|
|
|
3253
3253
|
dataType: types
|
|
3254
3254
|
};
|
|
3255
3255
|
} else {
|
|
3256
|
+
const types = splitIgnoringNesting(typeDef, ",");
|
|
3256
3257
|
return {
|
|
3257
|
-
type:
|
|
3258
|
-
dataType:
|
|
3258
|
+
type: types[0] || "any",
|
|
3259
|
+
dataType: types
|
|
3259
3260
|
};
|
|
3260
3261
|
}
|
|
3261
3262
|
};
|
|
@@ -3542,22 +3543,24 @@ function setValStringify(v, key, propsText) {
|
|
|
3542
3543
|
}
|
|
3543
3544
|
}
|
|
3544
3545
|
}
|
|
3545
|
-
function getSpecType(val) {
|
|
3546
|
-
let
|
|
3547
|
-
let
|
|
3546
|
+
function getSpecType(val, v) {
|
|
3547
|
+
let ds = parseTypeDefinition(val?.type);
|
|
3548
|
+
let tarr = ds.dataType;
|
|
3549
|
+
let type = v || ds.type;
|
|
3548
3550
|
if (tarr.length == 1) {
|
|
3549
3551
|
type = tarr[0].split("<")[0];
|
|
3552
|
+
} else if (tarr.length > 0) {
|
|
3553
|
+
type = "any";
|
|
3550
3554
|
}
|
|
3551
|
-
const zdtype = type;
|
|
3552
3555
|
let selectable = (val?.selectable || "").trim();
|
|
3553
3556
|
let arr = [];
|
|
3554
3557
|
if (selectable && type != "boolean") {
|
|
3555
3558
|
if (selectable.includes("|")) {
|
|
3556
|
-
selectable.split("|").forEach((
|
|
3557
|
-
if (
|
|
3558
|
-
let z =
|
|
3559
|
+
selectable.split("|").forEach((v2) => {
|
|
3560
|
+
if (v2) {
|
|
3561
|
+
let z = v2.split(":");
|
|
3559
3562
|
arr.push({
|
|
3560
|
-
label:
|
|
3563
|
+
label: v2,
|
|
3561
3564
|
prop: getObjValue(z[0].trim())
|
|
3562
3565
|
});
|
|
3563
3566
|
}
|
|
@@ -3577,22 +3580,10 @@ function getSpecType(val) {
|
|
|
3577
3580
|
}
|
|
3578
3581
|
return {
|
|
3579
3582
|
arr,
|
|
3580
|
-
|
|
3581
|
-
type,
|
|
3583
|
+
type: type.toLowerCase(),
|
|
3582
3584
|
dataType: tarr
|
|
3583
3585
|
};
|
|
3584
3586
|
}
|
|
3585
|
-
function getType(value) {
|
|
3586
|
-
let arr = [];
|
|
3587
|
-
let str = (value || "").trim().toLowerCase();
|
|
3588
|
-
str.split(",").forEach((v) => {
|
|
3589
|
-
v = v.trim();
|
|
3590
|
-
if (v) {
|
|
3591
|
-
arr.push(v);
|
|
3592
|
-
}
|
|
3593
|
-
});
|
|
3594
|
-
return [...new Set(arr)].sort();
|
|
3595
|
-
}
|
|
3596
3587
|
function getObjValue(d, type) {
|
|
3597
3588
|
try {
|
|
3598
3589
|
if (type?.toLowerCase() == "function") {
|
package/dist/node/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-5PX3AFSC.js
|
|
2
2
|
function isArray(obj) {
|
|
3
3
|
return Object.prototype.toString.call(obj) == "[object Array]";
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
6
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-A276ZDLP.js
|
|
7
7
|
function getStartSames(str, val) {
|
|
8
8
|
let s = "";
|
|
9
9
|
const vs = [...val];
|
|
@@ -19,7 +19,7 @@ function getStartSames(str, val) {
|
|
|
19
19
|
return [s, str.substring(index), val.substring(index)];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
22
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-AWC672JW.js
|
|
23
23
|
function getImportUrl(url, imp) {
|
|
24
24
|
const arr = getStartSames(url, imp);
|
|
25
25
|
const ts = arr[0];
|
|
@@ -46,12 +46,12 @@ function getImportUrl(url, imp) {
|
|
|
46
46
|
return ds.join("") + arr[2].replace(/\\/g, "/");
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
49
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js
|
|
50
50
|
function firstUpper(str) {
|
|
51
51
|
return str.slice(0, 1).toUpperCase() + str.slice(1);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
54
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js
|
|
55
55
|
function lineToLargeHump(name) {
|
|
56
56
|
let arr = name.split("-");
|
|
57
57
|
arr = arr.map((vs) => {
|
|
@@ -771,7 +771,7 @@ function runDev(config2, configCallback) {
|
|
|
771
771
|
return new FangMd(config2, configCallback);
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
774
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js
|
|
775
775
|
var zObj = {
|
|
776
776
|
"<": "<",
|
|
777
777
|
">": ">",
|
|
@@ -792,7 +792,7 @@ function htmlEscape(str) {
|
|
|
792
792
|
// packages/node/index.ts
|
|
793
793
|
import { join as join4 } from "path";
|
|
794
794
|
|
|
795
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
795
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js
|
|
796
796
|
function mergeObject(a, b, j = 0, i) {
|
|
797
797
|
if (a instanceof Array) {
|
|
798
798
|
if (j > 0 && i) {
|
|
@@ -835,7 +835,7 @@ function mergeObject(a, b, j = 0, i) {
|
|
|
835
835
|
return a;
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
838
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js
|
|
839
839
|
function humpToLine(name) {
|
|
840
840
|
const reg = /(([A-Z])([^A-Z]*))/g;
|
|
841
841
|
let result;
|
|
@@ -857,7 +857,7 @@ function humpToLine(name) {
|
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
859
|
|
|
860
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
860
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.js
|
|
861
861
|
function appearNum(str, t) {
|
|
862
862
|
let reg = t;
|
|
863
863
|
if (typeof t == "string") {
|
|
@@ -868,12 +868,12 @@ function appearNum(str, t) {
|
|
|
868
868
|
return c;
|
|
869
869
|
}
|
|
870
870
|
|
|
871
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
871
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js
|
|
872
872
|
function firstLower(str) {
|
|
873
873
|
return str.slice(0, 1).toLowerCase() + str.slice(1);
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
876
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js
|
|
877
877
|
function asyncMergeArray(arr, callback) {
|
|
878
878
|
return new Promise((resolve2, reject) => {
|
|
879
879
|
let index = 0;
|
|
@@ -897,7 +897,7 @@ function asyncMergeArray(arr, callback) {
|
|
|
897
897
|
});
|
|
898
898
|
}
|
|
899
899
|
|
|
900
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
900
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js
|
|
901
901
|
function getSuffix2(url) {
|
|
902
902
|
const reg = /\.([a-z|A-Z]+)$/;
|
|
903
903
|
const regs = reg.exec(url);
|
|
@@ -918,7 +918,7 @@ function getConfig(key) {
|
|
|
918
918
|
return config[key];
|
|
919
919
|
}
|
|
920
920
|
|
|
921
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
921
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7PJ2D3KR.js
|
|
922
922
|
function getVueText(content) {
|
|
923
923
|
const result = {
|
|
924
924
|
template: "",
|
|
@@ -1507,7 +1507,7 @@ function parse(source, options = {}) {
|
|
|
1507
1507
|
}
|
|
1508
1508
|
var stringify = getStringifier();
|
|
1509
1509
|
|
|
1510
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1510
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-FS4JPT23.js
|
|
1511
1511
|
function deComment(code) {
|
|
1512
1512
|
let output = "";
|
|
1513
1513
|
let state = "code";
|
|
@@ -1599,7 +1599,7 @@ function deComment(code) {
|
|
|
1599
1599
|
return output;
|
|
1600
1600
|
}
|
|
1601
1601
|
|
|
1602
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
1602
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-DILPRD5C.js
|
|
1603
1603
|
function getImports(code, includeType = false) {
|
|
1604
1604
|
code = deComment(code);
|
|
1605
1605
|
const imports = /* @__PURE__ */ new Set();
|
|
@@ -3014,7 +3014,7 @@ var top_default2 = defineComponent2({
|
|
|
3014
3014
|
}
|
|
3015
3015
|
});
|
|
3016
3016
|
|
|
3017
|
-
// node_modules/.pnpm/@fangzhongya+utils@0.0.
|
|
3017
|
+
// node_modules/.pnpm/@fangzhongya+utils@0.0.28/node_modules/@fangzhongya/utils/dist/chunk-7O4MJOHM.js
|
|
3018
3018
|
var FUNCTION_REGEX = /^\s*(?:(async)\s+)?(?:function\s*(\*?)\s*(\w*)\s*\(([\s\S]*?)\)|(\*?\s*)\b(\w+)\s*\(([\s\S]*?)\)|\(([\s\S]*?)\)|([^=>,\(\)]+?))\s*(?:=>)?\s*(?:\{([\s\S]*?)\}|([\s\S]*))$/;
|
|
3019
3019
|
function getFunctionFormat(v) {
|
|
3020
3020
|
if (!v) return;
|
|
@@ -3238,9 +3238,10 @@ var parseTypeDefinition = (typeDef) => {
|
|
|
3238
3238
|
dataType: types
|
|
3239
3239
|
};
|
|
3240
3240
|
} else {
|
|
3241
|
+
const types = splitIgnoringNesting(typeDef, ",");
|
|
3241
3242
|
return {
|
|
3242
|
-
type:
|
|
3243
|
-
dataType:
|
|
3243
|
+
type: types[0] || "any",
|
|
3244
|
+
dataType: types
|
|
3244
3245
|
};
|
|
3245
3246
|
}
|
|
3246
3247
|
};
|
|
@@ -3527,22 +3528,24 @@ function setValStringify(v, key, propsText) {
|
|
|
3527
3528
|
}
|
|
3528
3529
|
}
|
|
3529
3530
|
}
|
|
3530
|
-
function getSpecType(val) {
|
|
3531
|
-
let
|
|
3532
|
-
let
|
|
3531
|
+
function getSpecType(val, v) {
|
|
3532
|
+
let ds = parseTypeDefinition(val?.type);
|
|
3533
|
+
let tarr = ds.dataType;
|
|
3534
|
+
let type = v || ds.type;
|
|
3533
3535
|
if (tarr.length == 1) {
|
|
3534
3536
|
type = tarr[0].split("<")[0];
|
|
3537
|
+
} else if (tarr.length > 0) {
|
|
3538
|
+
type = "any";
|
|
3535
3539
|
}
|
|
3536
|
-
const zdtype = type;
|
|
3537
3540
|
let selectable = (val?.selectable || "").trim();
|
|
3538
3541
|
let arr = [];
|
|
3539
3542
|
if (selectable && type != "boolean") {
|
|
3540
3543
|
if (selectable.includes("|")) {
|
|
3541
|
-
selectable.split("|").forEach((
|
|
3542
|
-
if (
|
|
3543
|
-
let z =
|
|
3544
|
+
selectable.split("|").forEach((v2) => {
|
|
3545
|
+
if (v2) {
|
|
3546
|
+
let z = v2.split(":");
|
|
3544
3547
|
arr.push({
|
|
3545
|
-
label:
|
|
3548
|
+
label: v2,
|
|
3546
3549
|
prop: getObjValue(z[0].trim())
|
|
3547
3550
|
});
|
|
3548
3551
|
}
|
|
@@ -3562,22 +3565,10 @@ function getSpecType(val) {
|
|
|
3562
3565
|
}
|
|
3563
3566
|
return {
|
|
3564
3567
|
arr,
|
|
3565
|
-
|
|
3566
|
-
type,
|
|
3568
|
+
type: type.toLowerCase(),
|
|
3567
3569
|
dataType: tarr
|
|
3568
3570
|
};
|
|
3569
3571
|
}
|
|
3570
|
-
function getType(value) {
|
|
3571
|
-
let arr = [];
|
|
3572
|
-
let str = (value || "").trim().toLowerCase();
|
|
3573
|
-
str.split(",").forEach((v) => {
|
|
3574
|
-
v = v.trim();
|
|
3575
|
-
if (v) {
|
|
3576
|
-
arr.push(v);
|
|
3577
|
-
}
|
|
3578
|
-
});
|
|
3579
|
-
return [...new Set(arr)].sort();
|
|
3580
|
-
}
|
|
3581
3572
|
function getObjValue(d, type) {
|
|
3582
3573
|
try {
|
|
3583
3574
|
if (type?.toLowerCase() == "function") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h=require("../boxurl/index.vue.cjs"),c=require("../../utils/glob.cjs"),_=require("../../utils/common.cjs"),N={class:"aside-search"},C={class:"aside-list"},E=["onClick"],B={class:"aside-li-name"},V={class:"aside-li-name-name"},x={class:"aside-li-name-aliass"},T=e.defineComponent({__name:"index",props:{value:Object},emits:["change"],setup(k,{emit:f}){const r=k,i=e.ref(),o=e.ref([]);o.value=c.getCompoNameObj();const l=e.ref(r.value);if(!l.value||!l.value.key){let t=_.getAsideKey();t?l.value=c.getCompoNameKey(t):l.value=o.value[0]}const n=e.ref("");e.watch(()=>r.value,()=>{l.value=r.value,u()}),e.watch(()=>n.value,()=>{g()});const d=f;function v(t){return t?t.replace(/[\.|\/|\s]/g,"-"):"a"}function y(t){l.value=t,u(),d("change",t)}let m;function g(){clearTimeout(m),m=setTimeout(()=>{let t=n.value;t?o.value=c.getCompoName(t,!0):o.value=c.getCompoNameObj()},400)}function u(){let t=l.value?.key||"";_.setAsideKey(t)}return u(),d("change",l.value),e.onMounted(()=>{e.nextTick(()=>{const t=i.value.querySelector(".aside-li."+v(l.value?.key));if(t){const s=t.offsetTop,a=i.value.parentNode;a.scrollTop=s}})}),(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"aside",ref_key:"refAside",ref:i},[e.createElementVNode("div",N,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a)},null,512),[[e.vModelText,n.value]])]),e.createElementVNode("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(a,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["aside-li",v(a.key)+" "+(a.key==l.value
|
|
1
|
+
"use strict";const e=require("vue"),h=require("../boxurl/index.vue.cjs"),c=require("../../utils/glob.cjs"),_=require("../../utils/common.cjs"),N={class:"aside-search"},C={class:"aside-list"},E=["onClick"],B={class:"aside-li-name"},V={class:"aside-li-name-name"},x={class:"aside-li-name-aliass"},T=e.defineComponent({__name:"index",props:{value:Object},emits:["change"],setup(k,{emit:f}){const r=k,i=e.ref(),o=e.ref([]);o.value=c.getCompoNameObj();const l=e.ref(r.value);if(!l.value||!l.value.key){let t=_.getAsideKey();t?l.value=c.getCompoNameKey(t):l.value=o.value[0]}const n=e.ref("");e.watch(()=>r.value,()=>{l.value=r.value,u()}),e.watch(()=>n.value,()=>{g()});const d=f;function v(t){return t?t.replace(/[\.|\/|\s]/g,"-"):"a"}function y(t){l.value=t,u(),d("change",t)}let m;function g(){clearTimeout(m),m=setTimeout(()=>{let t=n.value;t?o.value=c.getCompoName(t,!0):o.value=c.getCompoNameObj()},400)}function u(){let t=l.value?.key||"";_.setAsideKey(t)}return u(),d("change",l.value),e.onMounted(()=>{e.nextTick(()=>{const t=i.value.querySelector(".aside-li."+v(l.value?.key));if(t){const s=t.offsetTop,a=i.value.parentNode;a.scrollTop=s}})}),(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"aside",ref_key:"refAside",ref:i},[e.createElementVNode("div",N,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a)},null,512),[[e.vModelText,n.value]])]),e.createElementVNode("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(a,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["aside-li",v(a.key)+" "+(a.key==l.value?.key?"on":"")]),onClick:p=>y(a)},[e.createVNode(h,{value:a},{default:e.withCtx(()=>[e.createElementVNode("div",B,[e.createElementVNode("div",V,e.toDisplayString(a.name),1),e.createElementVNode("span",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.aliasNames,p=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(p),1))),256))])])]),_:2},1032,["value"])],10,E))),256))])],512))}});module.exports=T;
|
|
@@ -72,7 +72,7 @@ const q = { class: "aside-search" }, F = { class: "aside-list" }, L = ["onClick"
|
|
|
72
72
|
(n(!0), o(y, null, h(l.value, (a, I) => (n(), o("div", {
|
|
73
73
|
class: j([
|
|
74
74
|
"aside-li",
|
|
75
|
-
f(a.key) + " " + (a.key == t.value
|
|
75
|
+
f(a.key) + " " + (a.key == t.value?.key ? "on" : "")
|
|
76
76
|
]),
|
|
77
77
|
onClick: (_) => T(a)
|
|
78
78
|
}, [
|
|
@@ -1,7 +1,7 @@
|
|
|
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 z=require("@fangzhongya/utils/name/humpToLine");require("@fangzhongya/utils/name/lineToLargeHump");require("@fangzhongya/utils/basic/string/appearNum");const H=require("@fangzhongya/utils/basic/string/firstLower");require("@fangzhongya/utils/basic/array/duplicateRemoval");require("@fangzhongya/utils/basic/array/asyncMergeArray");const w=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const c=require("./util.cjs"),T=require("../../utils/props.cjs"),J=require("@fangzhongya/utils/basic/string/toFunction"),N=["class"];function q(e,t){return e.filter(n=>n.name==t)[0]}function L(e){return e.map(t=>(t.prop||"...arr")+":"+c.setDataType(t.dataType)).join(",")}function A(e,t,n,s,i,h){const a=[],r=[];let $=!0;const v=T.getPropsValue(t.propss||[]),x=T.getEmitsValue(t.emitss||[]),B=T.getExposeValue(t.exposes||[]),C=T.getSlotValue(t.slots||[]);Object.keys(n).forEach(o=>{let g=n[o];if(/^on[A-Z]/.test(o)&&typeof g=="function"){let u=o.substring(2);const l=o.split(":");let m;if(l.length>1?(m=l[0]+l.slice(1).map(p=>w.firstUpper(p)).join(""),u=H.firstLower(u)):(m=l[0],u=z.humpToLine(u)),l.includes("-")){let p=m.split("-");p=p.map((y,F)=>F!=0?w.firstUpper(y):y),m=p.join("")}a.push(" @"+u+'="'+m+'"');const f=q(x,u)||{},b=f.selectable||"",S=c.parseParamString(b),d=L(S);r.push(`// ${f.description} ${f.name}: (${f.selectable})`),r.push("function "+m+"("+d+") {"),S.forEach(p=>{const y=p.name||"arr";r.push(" console.log('"+p.label+"', "+y+")")}),r.push("}")}else{let u=o;N.includes(o)&&(u=o+"1"),a.push(" :"+o+'="'+u+'"');const l=q(v,o)||{},m=E(l);if(r.push(`// ${l.description} ${l.name}: {${l.type}} (${l.selectable})`),typeof g=="function")r.push("const "+o+" = "+P(g,o,i));else if($&&($=!1,r.unshift("import { ref } from 'vue';")),typeof g>"u")if(m.type=="function"){const f=Z(l);r.push("const "+u+" = "+f+";")}else{const f=c.getTypeValue(m.dataType);r.push("const "+u+" = ref("+(f==="undefined"?"":f)+");")}else{let f=D(g,o,i);r.push("const "+u+" = ref("+f+");")}}});const O=Object.values(h||{});O.length>0&&($&&($=!1,r.unshift("import { ref } from 'vue';")),a.unshift(' ref="refDom"'),r.push("const refDom = ref()"),O.forEach(o=>{const g=q(B,o.name)||{};r.push(`// ${g.description} ${g.name}:(${g.selectable}) ${g.type}`);const u=o.name+"Value",l=c.parseParamString(g?.selectable||""),m=[],f=o.params||[];l.forEach((b,S)=>{const d=b.name;if(d){const p=d+o.name,y=f[S];if(r.push(`// ${b.label}`),typeof y=="function")r.push("const "+p+" = "+P(y,d,o.text));else if(typeof y>"u")r.push("const "+p+" = "+c.getTypeValue(b.dataType)+";");else{let F=D(y,d,o.text);r.push("const "+p+" = "+F+";")}m.push(p)}}),o.type==="function"?r.push(`const ${u} = refDom.value?.${o.name}(${m.join(", ")})`):r.push(`const ${u} = refDom.value?.${o.name}`),r.push(`console.log('"${g.type}"', ${u})`)})),a.length>0&&a.unshift("");const U=M(s,C);return`<!--${e}-->
|
|
2
2
|
<template>
|
|
3
3
|
<div>
|
|
4
|
-
<${e}${
|
|
4
|
+
<${e}${a.join(`
|
|
5
5
|
`)}>${U.join(`
|
|
6
6
|
`)}
|
|
7
7
|
</${e}>
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
${r.join(`
|
|
12
12
|
`)}
|
|
13
13
|
<\/script>
|
|
14
|
-
`}function
|
|
14
|
+
`}function M(e={},t){const n=[];return Object.keys(e).forEach(s=>{const i=q(t,s)||{},h=e[s];if(h){const a=` <!-- ${i.description} ${i.name}:(${i.selectable}) -->
|
|
15
15
|
<template #${s}="scope">
|
|
16
|
-
${
|
|
17
|
-
</template>`;
|
|
18
|
-
${
|
|
19
|
-
}`;return`function (${
|
|
20
|
-
${
|
|
21
|
-
}`;return`function (${
|
|
16
|
+
${c.vueFormat(h," ")}
|
|
17
|
+
</template>`;n.push(a)}}),n&&n.length>0&&n.unshift(""),n}function P(e,t,n){const s=n?n[t]:"";return s&&(s.includes("=>")||s.includes("function"))?s:j(e.toString())}function j(e){const t=J.getFunctionFormat(c.prettierFormat(e));if(t){let n=`{
|
|
18
|
+
${c.vueFormat(c.getFunBody(t.body)," ")}
|
|
19
|
+
}`;return`function (${t.param}) ${n}`}else return"undefined"}function Z(e){const t=c.parseParamString(e.selectable),n=L(t);let s="";e.return&&(s="return ");let i=`{
|
|
20
|
+
${c.vueFormat(c.getFunBody(s)," ")}
|
|
21
|
+
}`;return`function (${n}) ${i}`}function G(e){const t=e.trim();return/^\(/.test(t)?j(t):JSON.stringify(e)}function D(e,t,n){const s=n?n[t]:"";return s?typeof s=="string"?V(s):s:typeof e=="string"?G(e+""):JSON.stringify(e)}function E(e,t){let n=c.parseTypeDefinition(e?.type),s=n.dataType,i=t||n.type;s.length==1?i=s[0].split("<")[0]:s.length>0&&(i="any");let h=(e?.selectable||"").trim(),a=[];return h&&i!="boolean"&&(h.includes("|")?h.split("|").forEach(r=>{if(r){let $=r.split(":");a.push({label:r,prop:V($[0].trim())})}}):a=c.parseParamString(h),i=="function"?i="function":i=="array"?i="choice":a.length>1&&(i="select")),{arr:a,type:i.toLowerCase(),dataType:s}}function V(e,t){try{if(t?.toLowerCase()=="function")if(typeof e=="string"){if(/^\((.|\n|\r)*\)$/.test(e))return e=e.substring(1,e.length-1),new Function(`{ return ${e} }`)()}else return e;else return new Function(`{ return ${e} }`)()}catch{return""+e}}function I(e,t=!0){const n=E(e),s=c.getTypeValue(n.dataType);if(t){const i=(e.default||"").trim();return V(i||s,n.dataType[0])}else{const i=(e.default||"").trim();return V(i,n.dataType[0])}}exports.getDefaultValue=I;exports.getHmtl=A;exports.getSpecType=E;exports.setValStringify=D;
|
|
@@ -8,9 +8,8 @@ type SelectsObj = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
prop: unknown;
|
|
10
10
|
};
|
|
11
|
-
export declare function getSpecType(val: Spec): {
|
|
11
|
+
export declare function getSpecType(val: Spec, v?: string): {
|
|
12
12
|
arr: SelectsObj[];
|
|
13
|
-
zdtype: string;
|
|
14
13
|
type: string;
|
|
15
14
|
dataType: string[];
|
|
16
15
|
};
|