@fangzhongya/vue-archive 0.1.8 → 0.1.10
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 +2184 -2033
- package/dist/node/index.js +2184 -2033
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.d.ts +0 -1
- package/dist/packages/components/compo/index.js +36 -235
- package/dist/packages/components/compo/info-top.vue.cjs +1 -1
- package/dist/packages/components/compo/info-top.vue.js +1 -1
- package/dist/packages/components/compo/props.vue.cjs +1 -1
- package/dist/packages/components/compo/props.vue.js +12 -11
- package/dist/packages/components/test/index.cjs +1 -1
- package/dist/packages/components/test/index.js +1 -1
- package/dist/packages/components/use/code.cjs +13 -13
- package/dist/packages/components/use/code.d.ts +25 -18
- package/dist/packages/components/use/code.js +6 -5
- package/dist/packages/components/use/retrie/expose/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/expose/index.vue.js +1 -1
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +0 -9
- package/dist/packages/components/use/util.js +106 -132
- package/dist/packages/utils/annotat.cjs +1 -0
- package/dist/packages/utils/annotat.d.ts +17 -0
- package/dist/packages/utils/annotat.js +321 -0
- package/dist/packages/utils/index.cjs +1 -1
- package/dist/packages/utils/index.d.ts +0 -1
- package/dist/packages/utils/index.js +6 -12
- package/dist/packages/utils/props.cjs +1 -1
- package/dist/packages/utils/props.js +4 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@fangzhongya/utils/basic/object/mergeObject");require("@fangzhongya/utils/html/getVueText");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/judge/matchsStart");require("@fangzhongya/utils/judge/matchsEnd");require("@fangzhongya/utils/basic/string/getImports");require("comment-parser");const e=require("../../utils/props.cjs"),t=[{label:"属性名",prop:"name",formatter:e.props.name},{label:"双向",prop:"model",formatter:e.props.model},{label:"说明",prop:"description",formatter:e.props.description},{label:"类型",prop:"type",formatter:e.props.type},{label:"可选值",prop:"selectable",formatter:e.props.selectable},{label:"默认值",prop:"default",formatter:e.props.default},{label:"必传",prop:"required",formatter:e.props.required},{label:"方法返回值",prop:"return",formatter:e.props.return}],o=[{label:"事件名",prop:"name",formatter:e.emits.name},{label:"说明",prop:"description",formatter:e.emits.description},{label:"回调参数",prop:"selectable",formatter:e.emits.selectable}],p=[{label:"方法名",prop:"name",formatter:e.expose.name},{label:"说明",prop:"description",formatter:e.expose.description},{label:"参数",prop:"selectable",formatter:e.expose.selectable},{label:"返回值",prop:"return",formatter(r){return e.expose.return(r)||r.expose.default||""}},{label:"类型",prop:"type",formatter(r){return e.expose.type(r)||"function"}}],l=[{label:"插槽名",prop:"name",formatter:e.slot.name},{label:"说明",prop:"description",formatter:e.slot.description},{label:"作用域参数",prop:"selectable",formatter:e.slot.selectable}];exports.temits=o;exports.texpose=p;exports.tprops=t;exports.tslot=l;
|
|
@@ -9,7 +9,6 @@ export type NotesObj = {
|
|
|
9
9
|
[key: string]: any[];
|
|
10
10
|
};
|
|
11
11
|
export declare function getNotes(key: string): Promise<NotesObj>;
|
|
12
|
-
export declare function getNotesText(text: string): NotesObj;
|
|
13
12
|
export type FTableFormatter = (data: SpecObjs, item?: FTableList, index?: number, key?: number) => string;
|
|
14
13
|
export type FTableList = {
|
|
15
14
|
label: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getTextNotes as y } from "../../utils/index.js";
|
|
2
1
|
import "@fangzhongya/utils/basic/object/mergeObject";
|
|
3
2
|
import "@fangzhongya/utils/html/getVueText";
|
|
4
3
|
import "@fangzhongya/utils/basic/array/toggleArray";
|
|
@@ -13,314 +12,116 @@ import "@fangzhongya/utils/urls/getSuffix";
|
|
|
13
12
|
import "@fangzhongya/utils/basic/array/replaceAfter";
|
|
14
13
|
import "@fangzhongya/utils/judge/matchsStart";
|
|
15
14
|
import "@fangzhongya/utils/judge/matchsEnd";
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
slots: [],
|
|
21
|
-
emitss: [],
|
|
22
|
-
exposes: []
|
|
23
|
-
};
|
|
24
|
-
function k(e, l) {
|
|
25
|
-
let t = e.charAt(0), s = [
|
|
26
|
-
['"', '"'],
|
|
27
|
-
["'", "'"],
|
|
28
|
-
["`", "`"],
|
|
29
|
-
["(", ")"],
|
|
30
|
-
["{", "}"],
|
|
31
|
-
["[", "]"]
|
|
32
|
-
];
|
|
33
|
-
const r = s.map((o) => o[0]);
|
|
34
|
-
let a = r.indexOf(t);
|
|
35
|
-
if (a != -1) {
|
|
36
|
-
let o = [t];
|
|
37
|
-
for (let i = 1; i < e.length; i++) {
|
|
38
|
-
if (t = e[i], a = r.indexOf(t), a != -1)
|
|
39
|
-
a > 2 ? o.push(t) : o[o.length - 1] === t ? o.pop() : o.push(t);
|
|
40
|
-
else {
|
|
41
|
-
let c = !1;
|
|
42
|
-
for (let u of s)
|
|
43
|
-
if (t === u[1] && o[o.length - 1] === u[0]) {
|
|
44
|
-
c = !0;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
c && o.pop();
|
|
48
|
-
}
|
|
49
|
-
if (o.length === 0)
|
|
50
|
-
return l && e[i + 1] === " ", e.substring(0, i + 1);
|
|
51
|
-
}
|
|
52
|
-
} else
|
|
53
|
-
return l ? e.substring(0, e.indexOf(" ")) : e;
|
|
54
|
-
}
|
|
55
|
-
function T(e) {
|
|
56
|
-
delete e.problems, delete e.source;
|
|
57
|
-
let l = e.tag, t = e.name, s = e.description, r = e.default, a = "", o = "";
|
|
58
|
-
if (l == "default")
|
|
59
|
-
t = t.trim(), t = k(t) || t;
|
|
60
|
-
else if (l == "selectable")
|
|
61
|
-
t = t.trim();
|
|
62
|
-
else {
|
|
63
|
-
if (t.includes("=")) {
|
|
64
|
-
const u = t.split("=");
|
|
65
|
-
t = u[0];
|
|
66
|
-
const O = u[1] + " " + s, h = k(O, !0);
|
|
67
|
-
h ? (r = h, s = O.replace(h, "")) : r = e.default || u[1] || "";
|
|
68
|
-
}
|
|
69
|
-
const c = /\s*\((.*)\)\s/gi.exec(s);
|
|
70
|
-
c && c.length > 0 && (a = c[1], s = s.replace(c[0], ""));
|
|
71
|
-
}
|
|
72
|
-
return t.endsWith("*") && (o = "*", t = t.substring(0, t.length - 1)), e.name = t, e.required = o, e.default = r || "", e.description = s, e.selectable = a, e;
|
|
73
|
-
}
|
|
74
|
-
function q(e) {
|
|
75
|
-
let l = [
|
|
76
|
-
"title",
|
|
77
|
-
// 'name',
|
|
78
|
-
"text",
|
|
79
|
-
"author",
|
|
80
|
-
"date"
|
|
81
|
-
// 'description',
|
|
82
|
-
// 'descriptions',
|
|
83
|
-
], t = d(e), s = {};
|
|
84
|
-
l.forEach((r) => {
|
|
85
|
-
s[r] = t.obj[r];
|
|
86
|
-
}), E(s), t.arr.forEach((r) => {
|
|
87
|
-
b(r.key, r.value);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function E(e) {
|
|
91
|
-
n.titles.push(e);
|
|
92
|
-
}
|
|
93
|
-
function N(e) {
|
|
94
|
-
let l = [
|
|
95
|
-
"props",
|
|
96
|
-
"name",
|
|
97
|
-
"type",
|
|
98
|
-
"default",
|
|
99
|
-
"required",
|
|
100
|
-
"selectable",
|
|
101
|
-
"description",
|
|
102
|
-
"descriptions",
|
|
103
|
-
"return"
|
|
104
|
-
], t = d(e), s = {};
|
|
105
|
-
l.forEach((r) => {
|
|
106
|
-
s[r] = t.obj[r];
|
|
107
|
-
}), p(s, "props"), t.arr.forEach((r) => {
|
|
108
|
-
b(r.key, r.value);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function S(e) {
|
|
112
|
-
let l = ["slot", "name", "selectable", "description", "descriptions"], t = d(e), s = {};
|
|
113
|
-
l.forEach((r) => {
|
|
114
|
-
s[r] = t.obj[r];
|
|
115
|
-
}), p(s, "slot"), t.arr.forEach((r) => {
|
|
116
|
-
b(r.key, r.value);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function j(e) {
|
|
120
|
-
let l = ["emits", "name", "selectable", "description", "descriptions"], t = d(e), s = {};
|
|
121
|
-
l.forEach((r) => {
|
|
122
|
-
s[r] = t.obj[r];
|
|
123
|
-
}), p(s, "emits"), t.arr.forEach((r) => {
|
|
124
|
-
b(r.key, r.value);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
function w(e) {
|
|
128
|
-
let l = [
|
|
129
|
-
"expose",
|
|
130
|
-
"name",
|
|
131
|
-
"type",
|
|
132
|
-
"return",
|
|
133
|
-
"selectable",
|
|
134
|
-
"description",
|
|
135
|
-
"descriptions"
|
|
136
|
-
], t = d(e), s = {};
|
|
137
|
-
l.forEach((r) => {
|
|
138
|
-
s[r] = t.obj[r];
|
|
139
|
-
}), p(s, "expose"), t.arr.forEach((r) => {
|
|
140
|
-
b(r.key, r.value);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
function p(e, l) {
|
|
144
|
-
const t = n[l + "name"] || [], s = e.name ?? e[l]?.name, r = t.indexOf(s);
|
|
145
|
-
r >= 0 && (n[l + "s"].splice(r, 1), t.splice(r, 1)), n[l + "s"].push(e), t.push(s), n[l + "name"] = t;
|
|
146
|
-
}
|
|
147
|
-
function F() {
|
|
148
|
-
Object.keys(n).forEach((e) => {
|
|
149
|
-
n[e] = [];
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
function d(e, l) {
|
|
153
|
-
const t = {
|
|
154
|
-
descriptions: e?.description || ""
|
|
155
|
-
}, s = [];
|
|
156
|
-
return e?.tags && e.tags?.forEach((r) => {
|
|
157
|
-
let a = r.tag, o = T(r);
|
|
158
|
-
if (!t.hasOwnProperty(a))
|
|
159
|
-
t[a] = o;
|
|
160
|
-
else {
|
|
161
|
-
const i = {};
|
|
162
|
-
i[a] = o, s.push({
|
|
163
|
-
key: a,
|
|
164
|
-
value: i
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}), {
|
|
168
|
-
arr: s,
|
|
169
|
-
obj: t
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function b(e, l) {
|
|
173
|
-
switch (e) {
|
|
174
|
-
case "title":
|
|
175
|
-
return E(l), !0;
|
|
176
|
-
case "text":
|
|
177
|
-
return E(l), !0;
|
|
178
|
-
case "props":
|
|
179
|
-
return p(l, "props"), !0;
|
|
180
|
-
case "slot":
|
|
181
|
-
return p(l, "slot"), !0;
|
|
182
|
-
case "emits":
|
|
183
|
-
return p(l, "emits"), !0;
|
|
184
|
-
case "expose":
|
|
185
|
-
return p(l, "expose"), !0;
|
|
186
|
-
default:
|
|
187
|
-
return !1;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
function J(e, l) {
|
|
191
|
-
switch (e) {
|
|
192
|
-
case "title":
|
|
193
|
-
return q(l), !0;
|
|
194
|
-
case "props":
|
|
195
|
-
return N(l), !0;
|
|
196
|
-
case "slot":
|
|
197
|
-
return S(l), !0;
|
|
198
|
-
case "emits":
|
|
199
|
-
return j(l), !0;
|
|
200
|
-
case "expose":
|
|
201
|
-
return w(l), !0;
|
|
202
|
-
default:
|
|
203
|
-
return !1;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
function P(e) {
|
|
207
|
-
return F(), e?.forEach((l) => {
|
|
208
|
-
let t = l?.tags || [], s = t?.length || 0;
|
|
209
|
-
if (s > 0)
|
|
210
|
-
for (let r = 0; r < s; r++) {
|
|
211
|
-
const a = t[r] || {};
|
|
212
|
-
if (J(a.tag, l))
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
}), JSON.parse(JSON.stringify(n));
|
|
216
|
-
}
|
|
217
|
-
function U(e) {
|
|
218
|
-
let l = y(e);
|
|
219
|
-
return P(l);
|
|
220
|
-
}
|
|
221
|
-
const V = [
|
|
15
|
+
import "@fangzhongya/utils/basic/string/getImports";
|
|
16
|
+
import "comment-parser";
|
|
17
|
+
import { props as e, emits as o, expose as r, slot as p } from "../../utils/props.js";
|
|
18
|
+
const v = [
|
|
222
19
|
{
|
|
223
20
|
label: "属性名",
|
|
224
21
|
prop: "name",
|
|
225
|
-
formatter:
|
|
22
|
+
formatter: e.name
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "双向",
|
|
26
|
+
prop: "model",
|
|
27
|
+
formatter: e.model
|
|
226
28
|
},
|
|
227
29
|
{
|
|
228
30
|
label: "说明",
|
|
229
31
|
prop: "description",
|
|
230
|
-
formatter:
|
|
32
|
+
formatter: e.description
|
|
231
33
|
},
|
|
232
34
|
{
|
|
233
35
|
label: "类型",
|
|
234
36
|
prop: "type",
|
|
235
|
-
formatter:
|
|
37
|
+
formatter: e.type
|
|
236
38
|
},
|
|
237
39
|
{
|
|
238
40
|
label: "可选值",
|
|
239
41
|
prop: "selectable",
|
|
240
|
-
formatter:
|
|
42
|
+
formatter: e.selectable
|
|
241
43
|
},
|
|
242
44
|
{
|
|
243
45
|
label: "默认值",
|
|
244
46
|
prop: "default",
|
|
245
|
-
formatter:
|
|
47
|
+
formatter: e.default
|
|
246
48
|
},
|
|
247
49
|
{
|
|
248
50
|
label: "必传",
|
|
249
51
|
prop: "required",
|
|
250
|
-
formatter:
|
|
52
|
+
formatter: e.required
|
|
251
53
|
},
|
|
252
54
|
{
|
|
253
55
|
label: "方法返回值",
|
|
254
56
|
prop: "return",
|
|
255
|
-
formatter:
|
|
57
|
+
formatter: e.return
|
|
256
58
|
}
|
|
257
|
-
],
|
|
59
|
+
], w = [
|
|
258
60
|
{
|
|
259
61
|
label: "事件名",
|
|
260
62
|
prop: "name",
|
|
261
|
-
formatter:
|
|
63
|
+
formatter: o.name
|
|
262
64
|
},
|
|
263
65
|
{
|
|
264
66
|
label: "说明",
|
|
265
67
|
prop: "description",
|
|
266
|
-
formatter:
|
|
68
|
+
formatter: o.description
|
|
267
69
|
},
|
|
268
70
|
{
|
|
269
71
|
label: "回调参数",
|
|
270
72
|
prop: "selectable",
|
|
271
|
-
formatter:
|
|
73
|
+
formatter: o.selectable
|
|
272
74
|
}
|
|
273
|
-
],
|
|
75
|
+
], z = [
|
|
274
76
|
{
|
|
275
77
|
label: "方法名",
|
|
276
78
|
prop: "name",
|
|
277
|
-
formatter:
|
|
79
|
+
formatter: r.name
|
|
278
80
|
},
|
|
279
81
|
{
|
|
280
82
|
label: "说明",
|
|
281
83
|
prop: "description",
|
|
282
|
-
formatter:
|
|
84
|
+
formatter: r.description
|
|
283
85
|
},
|
|
284
86
|
{
|
|
285
87
|
label: "参数",
|
|
286
88
|
prop: "selectable",
|
|
287
|
-
formatter:
|
|
89
|
+
formatter: r.selectable
|
|
288
90
|
},
|
|
289
91
|
{
|
|
290
92
|
label: "返回值",
|
|
291
93
|
prop: "return",
|
|
292
|
-
formatter(
|
|
293
|
-
return
|
|
94
|
+
formatter(t) {
|
|
95
|
+
return r.return(t) || t.expose.default || "";
|
|
294
96
|
}
|
|
295
97
|
},
|
|
296
98
|
{
|
|
297
99
|
label: "类型",
|
|
298
100
|
prop: "type",
|
|
299
|
-
formatter(
|
|
300
|
-
return
|
|
101
|
+
formatter(t) {
|
|
102
|
+
return r.type(t) || "function";
|
|
301
103
|
}
|
|
302
104
|
}
|
|
303
|
-
],
|
|
105
|
+
], A = [
|
|
304
106
|
{
|
|
305
107
|
label: "插槽名",
|
|
306
108
|
prop: "name",
|
|
307
|
-
formatter:
|
|
109
|
+
formatter: p.name
|
|
308
110
|
},
|
|
309
111
|
{
|
|
310
112
|
label: "说明",
|
|
311
113
|
prop: "description",
|
|
312
|
-
formatter:
|
|
114
|
+
formatter: p.description
|
|
313
115
|
},
|
|
314
116
|
{
|
|
315
117
|
label: "作用域参数",
|
|
316
118
|
prop: "selectable",
|
|
317
|
-
formatter:
|
|
119
|
+
formatter: p.selectable
|
|
318
120
|
}
|
|
319
121
|
];
|
|
320
122
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
Z as tslot
|
|
123
|
+
w as temits,
|
|
124
|
+
z as texpose,
|
|
125
|
+
v as tprops,
|
|
126
|
+
A as tslot
|
|
326
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),u=require("./top.cjs"),r=require("../../utils/annotat.cjs"),l=require("../../utils/glob.cjs"),i={class:"info-top"},p=e.defineComponent({__name:"info-top",props:{value:{type:Object}},setup(a){const t=a,o=e.ref([]);function n(){t.value?.key&&l.getLocalTextComponents(t.value?.key).then(c=>{const s=r.getNotesText(c);o.value=s.titles})}return e.watch(()=>t.value,()=>{n()}),n(),(c,s)=>(e.openBlock(),e.createElementBlock("div",i,[e.createVNode(e.unref(u.default),{value:o.value},null,8,["value"])]))}});module.exports=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as c, ref as l, watch as p, createElementBlock as s, openBlock as u, createVNode as i, unref as f } from "vue";
|
|
2
2
|
import m from "./top.js";
|
|
3
|
-
import { getNotesText as v } from "
|
|
3
|
+
import { getNotesText as v } from "../../utils/annotat.js";
|
|
4
4
|
import { getLocalTextComponents as _ } from "../../utils/glob.js";
|
|
5
5
|
const d = { class: "info-top" }, y = /* @__PURE__ */ c({
|
|
6
6
|
__name: "info-top",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),B=require("./top.cjs"),
|
|
1
|
+
"use strict";const e=require("vue"),B=require("./top.cjs"),l=require("./ftable.vue.cjs"),n=require("./index.cjs"),N=require("../../utils/annotat.cjs"),_={class:"compo"},V={key:0,class:"compo-top"},x={class:"compo-li compo-props"},C={class:"compo-li compo-emits"},E={class:"compo-li compo-expose"},y={class:"compo-li compo-slot"},g=e.defineComponent({__name:"props",props:{value:String,istop:Boolean},emits:["change"],setup(u,{emit:k}){const r=u,f=k,a=e.ref([]),t=e.reactive({props:!0,expose:!0,emits:!0,slot:!0,top:!0}),i=e.ref([]),p=e.ref([]),m=e.ref([]),v=e.ref([]);function d(){if(r.value){const s=N.getNotesText(r.value);a.value=s.titles,i.value=s.propss,v.value=s.slots,p.value=s.emitss,m.value=s.exposes,f("change",s)}}return e.watch(()=>r.value,()=>{d()}),d(),(s,o)=>(e.openBlock(),e.createElementBlock("div",_,[u.istop?(e.openBlock(),e.createElementBlock("div",V,[t.top?(e.openBlock(),e.createBlock(e.unref(B.default),{key:0,value:a.value},null,8,["value"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",x,[e.createElementVNode("h4",{onClick:o[0]||(o[0]=c=>t.props=!t.props)},"组件属性"),t.props?(e.openBlock(),e.createBlock(l,{key:0,list:e.unref(n.tprops),value:i.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",C,[e.createElementVNode("h4",{onClick:o[1]||(o[1]=c=>t.emits=!t.emits)},"组件事件"),t.emits?(e.openBlock(),e.createBlock(l,{key:0,list:e.unref(n.temits),value:p.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E,[e.createElementVNode("h4",{onClick:o[2]||(o[2]=c=>t.expose=!t.expose)},"组件方法"),t.expose?(e.openBlock(),e.createBlock(l,{key:0,list:e.unref(n.texpose),value:m.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",y,[e.createElementVNode("h4",{onClick:o[3]||(o[3]=c=>t.slot=!t.slot)},"组件插槽"),t.slot?(e.openBlock(),e.createBlock(l,{key:0,list:e.unref(n.tslot),value:v.value},null,8,["list","value"])):e.createCommentVNode("",!0)])]))}});module.exports=g;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { defineComponent as g, ref as p, reactive as $, watch as B, createElementBlock as h, openBlock as l, createCommentVNode as i, createElementVNode as o, createBlock as n, unref as u } from "vue";
|
|
2
2
|
import N from "./top.js";
|
|
3
3
|
import r from "./ftable.vue.js";
|
|
4
|
-
import { tprops as E, temits as T, texpose as V, tslot as b
|
|
4
|
+
import { tprops as E, temits as T, texpose as V, tslot as b } from "./index.js";
|
|
5
|
+
import { getNotesText as j } from "../../utils/annotat.js";
|
|
5
6
|
const w = { class: "compo" }, D = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "compo-top"
|
|
8
|
-
}, S = { class: "compo-li compo-props" }, q = { class: "compo-li compo-emits" }, z = { class: "compo-li compo-expose" }, A = { class: "compo-li compo-slot" },
|
|
9
|
+
}, S = { class: "compo-li compo-props" }, q = { class: "compo-li compo-emits" }, z = { class: "compo-li compo-expose" }, A = { class: "compo-li compo-slot" }, K = /* @__PURE__ */ g({
|
|
9
10
|
__name: "props",
|
|
10
11
|
props: {
|
|
11
12
|
value: String,
|
|
12
13
|
istop: Boolean
|
|
13
14
|
},
|
|
14
15
|
emits: ["change"],
|
|
15
|
-
setup(
|
|
16
|
-
const v =
|
|
16
|
+
setup(m, { emit: y }) {
|
|
17
|
+
const v = m, C = y, c = p([]), e = $({
|
|
17
18
|
props: !0,
|
|
18
19
|
expose: !0,
|
|
19
20
|
emits: !0,
|
|
20
21
|
slot: !0,
|
|
21
22
|
top: !0
|
|
22
|
-
}), d = p([]),
|
|
23
|
+
}), d = p([]), f = p([]), k = p([]), x = p([]);
|
|
23
24
|
function _() {
|
|
24
25
|
if (v.value) {
|
|
25
26
|
const s = j(v.value);
|
|
26
|
-
|
|
27
|
+
c.value = s.titles, d.value = s.propss, x.value = s.slots, f.value = s.emitss, k.value = s.exposes, C("change", s);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
return B(
|
|
@@ -32,10 +33,10 @@ const w = { class: "compo" }, D = {
|
|
|
32
33
|
_();
|
|
33
34
|
}
|
|
34
35
|
), _(), (s, t) => (l(), h("div", w, [
|
|
35
|
-
|
|
36
|
+
m.istop ? (l(), h("div", D, [
|
|
36
37
|
e.top ? (l(), n(u(N), {
|
|
37
38
|
key: 0,
|
|
38
|
-
value:
|
|
39
|
+
value: c.value
|
|
39
40
|
}, null, 8, ["value"])) : i("", !0)
|
|
40
41
|
])) : i("", !0),
|
|
41
42
|
o("div", S, [
|
|
@@ -55,7 +56,7 @@ const w = { class: "compo" }, D = {
|
|
|
55
56
|
e.emits ? (l(), n(r, {
|
|
56
57
|
key: 0,
|
|
57
58
|
list: u(T),
|
|
58
|
-
value:
|
|
59
|
+
value: f.value
|
|
59
60
|
}, null, 8, ["list", "value"])) : i("", !0)
|
|
60
61
|
]),
|
|
61
62
|
o("div", z, [
|
|
@@ -65,7 +66,7 @@ const w = { class: "compo" }, D = {
|
|
|
65
66
|
e.expose ? (l(), n(r, {
|
|
66
67
|
key: 0,
|
|
67
68
|
list: u(V),
|
|
68
|
-
value:
|
|
69
|
+
value: k.value
|
|
69
70
|
}, null, 8, ["list", "value"])) : i("", !0)
|
|
70
71
|
]),
|
|
71
72
|
o("div", A, [
|
|
@@ -82,5 +83,5 @@ const w = { class: "compo" }, D = {
|
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
K as default
|
|
86
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../utils/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../utils/annotat.cjs");function E(t){return delete t.problems,delete t.source,t}function d(t,e){const s={descriptions:t?.description||""},a=[];return t?.tags&&t?.tags?.forEach((r,o)=>{let n=r.tag,l=E(r);if(!s.hasOwnProperty(n)&&e.includes(n))s[n]=l;else{let f={};f[n]=l,a.push({key:n,value:f})}}),{arr:a,obj:s}}let u=[];function T(t){const e=["title","author","date"],s=d(t,e),a={};e.forEach(r=>{a[r]=s.obj[r]}),c(a),s.arr.forEach(r=>{h(r.key,r.value)})}let i=[];function v(t){const e=["state","type"],s=d(t,e),a={};e.forEach(r=>{a[r]=s.obj[r]}),g(a),s.arr.forEach(r=>{h(r.key,r.value)})}function c(t){u.push(t)}function y(t){u.push(t)}function S(t){u.push(t)}function g(t){i.push(t)}function h(t,e){switch(t){case"title":return c(e),!0;case"proposal":return y(e),!0;case"error":return S(e),!0;case"state":return g(e),!0;case"text":return c(e),!0;case"html":return c(e),!0;default:return!1}}function m(t,e){switch(t){case"title":return T(e),!0;case"state":return v(e),!0;default:return!1}}function w(t){return u=[],i=[],p.getTextNotes(t)?.forEach(s=>{let a=s?.tags||[],r=a?.length||0;if(r>0)for(let o=0;o<r;o++){const n=a[o]||{};if(m(n.tag,s))break}}),{titles:u,states:i}}exports.getNotes=w;
|
|
@@ -1,20 +1,20 @@
|
|
|
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 A=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 L=require("@fangzhongya/utils/basic/string/firstUpper");require("@fangzhongya/utils/urls/getSuffix");require("@fangzhongya/utils/basic/array/replaceAfter");const c=require("./util.cjs"),S=require("../../utils/props.cjs"),V=require("../../utils/annotat.cjs"),M=require("@fangzhongya/utils/basic/string/toFunction");function q(e,n){return e.filter(t=>t.name==n)[0]}function B(e){return e.map(n=>(n.prop||"...arr")+":"+c.setDataType(n.dataType)).join(",")}async function R(e,n,t,s,o,y){const g=[],r=[];let T=!0;const H=S.getPropsValue(n.propss||[]),U=S.getEmitsValue(n.emitss||[]),z=S.getExposeValue(n.exposes||[]),J=S.getSlotValue(n.slots||[]);Object.keys(t).forEach(async i=>{let u=t[i];if(/^on[A-Z]/.test(i)&&typeof u=="function"){let a=i.substring(2);const f=i.split(":");let l;if(f.length>1?(l=f[0]+f.slice(1).map(m=>L.firstUpper(m)).join(""),a=C.firstLower(a)):(l=f[0],a=A.humpToLine(a)),f.includes("-")){let m=l.split("-");m=m.map((h,F)=>F!=0?L.firstUpper(h):h),l=m.join("")}g.push(" @"+a+'="'+l+'"');const p=q(U,a)||{},d=p.selectable||"",b=V.parseParamString(d),$=B(b);r.push(`// ${p.description} ${p.name}: (${p.selectable})`),r.push("function "+l+"("+$+") {"),b.forEach(m=>{const h=m.name||"arr";r.push(" console.log('"+m.label+"', "+h+")")}),r.push("}")}else{let a=i;c.allReservedWords.includes(i)&&(a=i+"1"),g.push(" :"+i+'="'+a+'"');const f=q(H,i)||{},l=P(f);if(r.push(`// ${f.description} ${f.name}: {${f.type}} (${f.selectable})`),typeof u=="function"||l.dataType.length==1&&l.type=="function"&&u)r.push("const "+i+" = "+await x(u,i,o));else if(T&&(T=!1,r.unshift("import { ref } from 'vue';")),typeof u>"u")if(l.type=="function"){const p=Z(f);r.push("const "+a+" = "+p+";")}else{const p=c.getTypeValue(l.dataType);r.push("const "+a+" = ref("+(p==="undefined"?"":p)+");")}else{let p=O(u,i,o);r.push("const "+a+" = ref("+p+");")}}});const v=Object.values(y||{});v.length>0&&(T&&(T=!1,r.unshift("import { ref } from 'vue';")),g.unshift(' ref="refDom"'),r.push("const refDom = ref()"),v.forEach(i=>{const u=q(z,i.name)||{};r.push(`// ${u.description} ${u.name}:(${u.selectable}) ${u.type}`);const a=i.name+"Value",f=V.parseParamString(u?.selectable||""),l=[],p=i.params||[];f.forEach((d,b)=>{const $=d.name;if($){const m=$+i.name,h=p[b];if(r.push(`// ${d.label}`),typeof h=="function")r.push("const "+m+" = "+x(h,$,i.text));else if(typeof h>"u")r.push("const "+m+" = "+c.getTypeValue(d.dataType)+";");else{let F=O(h,$,i.text);r.push("const "+m+" = "+F+";")}l.push(m)}}),i.type==="function"?(u.return?r.push(`const ${a} = refDom.value?.${i.name}(${l.join(", ")})`):r.push(`refDom.value?.${i.name}(${l.join(", ")})`),u.return&&r.push(`console.log('${u.return}', ${a})`)):(r.push(`const ${a} = refDom.value?.${i.name}`),r.push(`console.log('${u.type||u.name}', ${a})`))})),g.length>0&&g.unshift("");const N=W(s,J);let j=`<template>
|
|
2
2
|
<div>
|
|
3
3
|
<${e}${g.join(`
|
|
4
|
-
`)}>${
|
|
4
|
+
`)}>${N.join(`
|
|
5
5
|
`)}
|
|
6
6
|
</${e}>
|
|
7
7
|
</div>
|
|
8
|
-
</template>`;
|
|
9
|
-
`);return
|
|
10
|
-
${V}
|
|
11
|
-
<script lang="ts" setup>
|
|
8
|
+
</template>`;j=await c.prettierHtml(j);let D=r.join(`
|
|
9
|
+
`);return D=await c.prettierTs(D),`<!--${e}-->
|
|
12
10
|
${j}
|
|
13
|
-
|
|
11
|
+
<script lang="ts" setup>
|
|
12
|
+
${D}
|
|
13
|
+
<\/script>`}function W(e={},n){const t=[];return Object.keys(e).forEach(s=>{const o=q(n,s)||{},y=e[s];if(y){const g=` <!-- ${o.description} ${o.name}:(${o.selectable}) -->
|
|
14
14
|
<template #${s}="scope">
|
|
15
|
-
${
|
|
16
|
-
</template>`;t.push(g)}}),t&&t.length>0&&t.unshift(""),t}function
|
|
17
|
-
${
|
|
18
|
-
}`;return`function (${n.param.split(",").map(s=>s+":any").join(",")}) ${t}`}else return"undefined"}function
|
|
19
|
-
${
|
|
20
|
-
}`;return`function (${t}) ${
|
|
15
|
+
${c.vueFormat(y," ")}
|
|
16
|
+
</template>`;t.push(g)}}),t&&t.length>0&&t.unshift(""),t}function x(e,n,t){const s=t?t[n]:"";return s&&(s.includes("=>")||s.includes("function"))?s:E(e.toString())}async function E(e){const n=M.getFunctionFormat(e);if(n){let t=`{
|
|
17
|
+
${c.vueFormat(c.getFunBody(n.body)," ")}
|
|
18
|
+
}`;return`function (${n.param.split(",").map(s=>s+":any").join(",")}) ${t}`}else return"undefined"}function Z(e){const n=V.parseParamString(e.selectable),t=B(n);let s="";e.return&&(s="return ");let o=`{
|
|
19
|
+
${c.vueFormat(c.getFunBody(s)," ")}
|
|
20
|
+
}`;return`function (${t}) ${o}`}function G(e){const n=e.trim();return/^\(/.test(n)?E(n):JSON.stringify(e)}function O(e,n,t){const s=t?t[n]:"";return s||(typeof e=="string"?G(e+""):JSON.stringify(e))}function P(e){let n=c.getDataType(c.parseTypeDefinition(e?.type)),t=c.getDataTypeType(n);n.length>1&&(t="any");let s=(e?.selectable||"").trim(),o=[];return s&&t!="boolean"&&(s.includes("|")?s.split("|").forEach(y=>{if(y){let g=y.split(":");o.push({label:y,prop:w(g[0].trim())})}}):o=V.parseParamString(s),t=="array"?t="choice":t!="function"&&o.length>1&&(t="select")),{arr:o,type:t,dataType:n}}function w(e,n){try{if(n=="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,n=!0){const t=P(e),s=c.getTypeValue(t.dataType);if(n){const o=(e.default||"").trim();return w(o||s,c.getDataTypeType(t.dataType))}else{const o=(e.default||"").trim();return w(o,c.getDataTypeType(t.dataType))}}exports.getDefaultValue=I;exports.getHmtl=R;exports.getSpecType=P;exports.setValStringify=O;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../vue/dist/vue.esm-bundler.js';
|
|
2
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
3
|
+
name: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
};
|
|
6
|
+
html: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default(): string;
|
|
9
|
+
};
|
|
10
|
+
}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
11
|
+
refresh: (...args: any[]) => void;
|
|
12
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
13
|
+
name: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
html: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default(): string;
|
|
19
|
+
};
|
|
20
|
+
}>> & Readonly<{
|
|
21
|
+
onRefresh?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
html: string;
|
|
24
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
25
|
+
export default _default;
|