@fangzhongya/vue-archive 0.0.2-38 → 0.0.2-39

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.
@@ -62,11 +62,13 @@ interface ExampleObj {
62
62
  interface Config {
63
63
  router?: string;
64
64
  redirect?: boolean;
65
+ useparam?: boolean;
65
66
  components: Array<Components>;
66
67
  example?: ExampleObj;
67
68
  }
68
69
 
69
70
  interface TextObj {
71
+ name: string;
70
72
  value: string;
71
73
  suffix: string;
72
74
  key: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../utils/index.cjs"),b=require("../../utils/glob.cjs"),a=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function x(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]],o=l.map(i=>i[0]).indexOf(r);if(o!=-1){let n=new RegExp("^"+l[o][0]+"((.|\\n|\\r)+?)"+l[o][1]+(s?"\\s":""),"gi").exec(e);if(n)return n[0]}}function y(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,o="";if(s=="default")r=r.trim(),r=x(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const u=r.split("=");r=u[0];const h=u[1]+" "+l,d=x(h,!0);d?(t=d,l=h.replace(d,"")):t=e.default||u[1]||""}const n=/\s*\((.*)\)\s/gi.exec(l);n&&n.length>0&&(o=n[1],l=l.replace(n[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=o,e}function O(e){let s=["title","text","author","date"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{m(t.key,t.value)})}function g(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{m(t.key,t.value)})}function w(e){let s=["slot","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{m(t.key,t.value)})}function P(e){let s=["emits","name","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{m(t.key,t.value)})}function k(e){let s=["expose","name","type","selectable","description","descriptions"],r=f(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{m(t.key,t.value)})}function p(e,s){var o;const r=c[s+"name"]||[],l=e.name??((o=e[s])==null?void 0:o.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 q(){Object.keys(c).forEach(e=>{c[e]=[]})}function f(e,s){var t;const r={descriptions:(e==null?void 0:e.description)||""},l=[];return e!=null&&e.tags&&((t=e==null?void 0:e.tags)==null||t.forEach(o=>{let i=o.tag,n=y(o);if(!r.hasOwnProperty(i))r[i]=n;else{const u={};u[i]=n,l.push({key:i,value:u})}})),{arr:l,obj:r}}function m(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 M(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return w(s),!0;case"emits":return P(s),!0;case"expose":return k(s),!0;default:return!1}}function N(e){return q(),e==null||e.forEach(s=>{let r=(s==null?void 0:s.tags)||[],l=(r==null?void 0:r.length)||0;if(l>0)for(let t=0;t<l;t++){const o=r[t]||{};if(M(o.tag,s))break}}),c}function S(e){return new Promise(s=>{b.getLocalTextComponents(e).then(r=>{let l=E.getTextNotes(r);s(N(l))})})}const F=[{label:"属性名",prop:"name",formatter:a.props.name},{label:"说明",prop:"description",formatter:a.props.description},{label:"类型",prop:"type",formatter:a.props.type},{label:"可选值",prop:"selectable",formatter:a.props.selectable},{label:"默认值",prop:"default",formatter:a.props.default}],K=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],v=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"type",formatter:a.expose.type}],z=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getKeyMds=b.getKeyMds;exports.getNotes=S;exports.temits=K;exports.texpose=v;exports.tprops=F;exports.tslot=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../utils/index.cjs"),a=require("../../utils/props.cjs"),c={titles:[],propss:[],slots:[],emitss:[],exposes:[]};function h(e,s){let r=e.charAt(0),l=[['"','"'],["'","'"],["`","`"],["(",")"],["{","}"],["[","]"]],o=l.map(i=>i[0]).indexOf(r);if(o!=-1){let n=new RegExp("^"+l[o][0]+"((.|\\n|\\r)+?)"+l[o][1]+(s?"\\s":""),"gi").exec(e);if(n)return n[0]}}function E(e){delete e.problems,delete e.source;let s=e.tag,r=e.name,l=e.description,t=e.default,o="";if(s=="default")r=r.trim(),r=h(r)||r;else if(s=="selectable")r=r.trim();else{if(r.includes("=")){const f=r.split("=");r=f[0];const x=f[1]+" "+l,d=h(x,!0);d?(t=d,l=x.replace(d,"")):t=e.default||f[1]||""}const n=/\s*\((.*)\)\s/gi.exec(l);n&&n.length>0&&(o=n[1],l=l.replace(n[0],""))}return e.name=r,e.default=t||"",e.description=l,e.selectable=o,e}function O(e){let s=["title","text","author","date"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),g(l),r.arr.forEach(t=>{m(t.key,t.value)})}function g(e){c.titles.push(e)}function T(e){let s=["props","name","type","default","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"props"),r.arr.forEach(t=>{m(t.key,t.value)})}function y(e){let s=["slot","name","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"slot"),r.arr.forEach(t=>{m(t.key,t.value)})}function w(e){let s=["emits","name","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"emits"),r.arr.forEach(t=>{m(t.key,t.value)})}function k(e){let s=["expose","name","type","selectable","description","descriptions"],r=u(e),l={};s.forEach(t=>{l[t]=r.obj[t]}),p(l,"expose"),r.arr.forEach(t=>{m(t.key,t.value)})}function p(e,s){var o;const r=c[s+"name"]||[],l=e.name??((o=e[s])==null?void 0:o.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 N(){Object.keys(c).forEach(e=>{c[e]=[]})}function u(e,s){var t;const r={descriptions:(e==null?void 0:e.description)||""},l=[];return e!=null&&e.tags&&((t=e==null?void 0:e.tags)==null||t.forEach(o=>{let i=o.tag,n=E(o);if(!r.hasOwnProperty(i))r[i]=n;else{const f={};f[i]=n,l.push({key:i,value:f})}})),{arr:l,obj:r}}function m(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 P(e,s){switch(e){case"title":return O(s),!0;case"props":return T(s),!0;case"slot":return y(s),!0;case"emits":return w(s),!0;case"expose":return k(s),!0;default:return!1}}function S(e){return N(),e==null||e.forEach(s=>{let r=(s==null?void 0:s.tags)||[],l=(r==null?void 0:r.length)||0;if(l>0)for(let t=0;t<l;t++){const o=r[t]||{};if(P(o.tag,s))break}}),c}function q(e){let s=b.getTextNotes(e);return S(s)}const F=[{label:"属性名",prop:"name",formatter:a.props.name},{label:"说明",prop:"description",formatter:a.props.description},{label:"类型",prop:"type",formatter:a.props.type},{label:"可选值",prop:"selectable",formatter:a.props.selectable},{label:"默认值",prop:"default",formatter:a.props.default}],v=[{label:"事件名",prop:"name",formatter:a.emits.name},{label:"说明",prop:"description",formatter:a.emits.description},{label:"回调参数",prop:"selectable",formatter:a.emits.selectable}],z=[{label:"方法名",prop:"name",formatter:a.expose.name},{label:"说明",prop:"description",formatter:a.expose.description},{label:"参数",prop:"selectable",formatter:a.expose.selectable},{label:"返回值",prop:"type",formatter:a.expose.type}],A=[{label:"插槽名",prop:"name",formatter:a.slot.name},{label:"说明",prop:"description",formatter:a.slot.description},{label:"作用域参数",prop:"selectable",formatter:a.slot.selectable}];exports.getNotesText=q;exports.temits=v;exports.texpose=z;exports.tprops=F;exports.tslot=A;
@@ -1,6 +1,6 @@
1
1
  export { getKeyMds } from '../../utils/glob';
2
2
  import type { SpecObjs } from '../../utils/index';
3
- type NotesObj = {
3
+ export type NotesObj = {
4
4
  titles: SpecObjs[];
5
5
  propss: SpecObjs[];
6
6
  slots: SpecObjs[];
@@ -9,6 +9,7 @@ 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;
12
13
  export type FTableFormatter = (data: SpecObjs, item?: FTableList, index?: number, key?: number) => string;
13
14
  export type FTableList = {
14
15
  label: string;
@@ -1,6 +1,4 @@
1
- import { getTextNotes as y } from "../../utils/index.js";
2
- import { getLocalTextComponents as T } from "../../utils/glob.js";
3
- import { getKeyMds as H } from "../../utils/glob.js";
1
+ import { getTextNotes as T } from "../../utils/index.js";
4
2
  import { props as f, emits as h, expose as d, slot as x } from "../../utils/props.js";
5
3
  const c = {
6
4
  titles: [],
@@ -17,17 +15,17 @@ function O(e, s) {
17
15
  ["(", ")"],
18
16
  ["{", "}"],
19
17
  ["[", "]"]
20
- ], a = l.map((n) => n[0]).indexOf(r);
18
+ ], a = l.map((o) => o[0]).indexOf(r);
21
19
  if (a != -1) {
22
- let o = new RegExp(
20
+ let n = new RegExp(
23
21
  "^" + l[a][0] + "((.|\\n|\\r)+?)" + l[a][1] + (s ? "\\s" : ""),
24
22
  "gi"
25
23
  ).exec(e);
26
- if (o)
27
- return o[0];
24
+ if (n)
25
+ return n[0];
28
26
  }
29
27
  }
30
- function w(e) {
28
+ function y(e) {
31
29
  delete e.problems, delete e.source;
32
30
  let s = e.tag, r = e.name, l = e.description, t = e.default, a = "";
33
31
  if (s == "default")
@@ -41,12 +39,12 @@ function w(e) {
41
39
  const E = p[1] + " " + l, g = O(E, !0);
42
40
  g ? (t = g, l = E.replace(g, "")) : t = e.default || p[1] || "";
43
41
  }
44
- const o = /\s*\((.*)\)\s/gi.exec(l);
45
- o && o.length > 0 && (a = o[1], l = l.replace(o[0], ""));
42
+ const n = /\s*\((.*)\)\s/gi.exec(l);
43
+ n && n.length > 0 && (a = n[1], l = l.replace(n[0], ""));
46
44
  }
47
45
  return e.name = r, e.default = t || "", e.description = l, e.selectable = a, e;
48
46
  }
49
- function k(e) {
47
+ function w(e) {
50
48
  let s = [
51
49
  "title",
52
50
  // 'name',
@@ -65,7 +63,7 @@ function k(e) {
65
63
  function b(e) {
66
64
  c.titles.push(e);
67
65
  }
68
- function P(e) {
66
+ function k(e) {
69
67
  let s = [
70
68
  "props",
71
69
  "name",
@@ -109,7 +107,7 @@ function N(e) {
109
107
  m(t.key, t.value);
110
108
  });
111
109
  }
112
- function z(e) {
110
+ function P(e) {
113
111
  let s = [
114
112
  "expose",
115
113
  "name",
@@ -129,7 +127,7 @@ function i(e, s) {
129
127
  const r = c[s + "name"] || [], l = e.name ?? ((a = e[s]) == null ? void 0 : a.name), t = r.indexOf(l);
130
128
  t >= 0 && (c[s + "s"].splice(t, 1), r.splice(t, 1)), c[s + "s"].push(e), r.push(l), c[s + "name"] = r;
131
129
  }
132
- function A() {
130
+ function z() {
133
131
  Object.keys(c).forEach((e) => {
134
132
  c[e] = [];
135
133
  });
@@ -140,13 +138,13 @@ function u(e, s) {
140
138
  descriptions: (e == null ? void 0 : e.description) || ""
141
139
  }, l = [];
142
140
  return e != null && e.tags && ((t = e == null ? void 0 : e.tags) == null || t.forEach((a) => {
143
- let n = a.tag, o = w(a);
144
- if (!r.hasOwnProperty(n))
145
- r[n] = o;
141
+ let o = a.tag, n = y(a);
142
+ if (!r.hasOwnProperty(o))
143
+ r[o] = n;
146
144
  else {
147
145
  const p = {};
148
- p[n] = o, l.push({
149
- key: n,
146
+ p[o] = n, l.push({
147
+ key: o,
150
148
  value: p
151
149
  });
152
150
  }
@@ -173,42 +171,38 @@ function m(e, s) {
173
171
  return !1;
174
172
  }
175
173
  }
176
- function C(e, s) {
174
+ function A(e, s) {
177
175
  switch (e) {
178
176
  case "title":
179
- return k(s), !0;
177
+ return w(s), !0;
180
178
  case "props":
181
- return P(s), !0;
179
+ return k(s), !0;
182
180
  case "slot":
183
181
  return F(s), !0;
184
182
  case "emits":
185
183
  return N(s), !0;
186
184
  case "expose":
187
- return z(s), !0;
185
+ return P(s), !0;
188
186
  default:
189
187
  return !1;
190
188
  }
191
189
  }
192
190
  function D(e) {
193
- return A(), e == null || e.forEach((s) => {
191
+ return z(), e == null || e.forEach((s) => {
194
192
  let r = (s == null ? void 0 : s.tags) || [], l = (r == null ? void 0 : r.length) || 0;
195
193
  if (l > 0)
196
194
  for (let t = 0; t < l; t++) {
197
195
  const a = r[t] || {};
198
- if (C(a.tag, s))
196
+ if (A(a.tag, s))
199
197
  break;
200
198
  }
201
199
  }), c;
202
200
  }
203
- function R(e) {
204
- return new Promise((s) => {
205
- T(e).then((r) => {
206
- let l = y(r);
207
- s(D(l));
208
- });
209
- });
201
+ function _(e) {
202
+ let s = T(e);
203
+ return D(s);
210
204
  }
211
- const S = [
205
+ const q = [
212
206
  {
213
207
  label: "属性名",
214
208
  prop: "name",
@@ -234,7 +228,7 @@ const S = [
234
228
  prop: "default",
235
229
  formatter: f.default
236
230
  }
237
- ], _ = [
231
+ ], v = [
238
232
  {
239
233
  label: "事件名",
240
234
  prop: "name",
@@ -250,7 +244,7 @@ const S = [
250
244
  prop: "selectable",
251
245
  formatter: h.selectable
252
246
  }
253
- ], q = [
247
+ ], B = [
254
248
  {
255
249
  label: "方法名",
256
250
  prop: "name",
@@ -271,7 +265,7 @@ const S = [
271
265
  prop: "type",
272
266
  formatter: d.type
273
267
  }
274
- ], v = [
268
+ ], C = [
275
269
  {
276
270
  label: "插槽名",
277
271
  prop: "name",
@@ -289,10 +283,9 @@ const S = [
289
283
  }
290
284
  ];
291
285
  export {
292
- H as getKeyMds,
293
- R as getNotes,
294
- _ as temits,
295
- q as texpose,
296
- S as tprops,
297
- v as tslot
286
+ _ as getNotesText,
287
+ v as temits,
288
+ B as texpose,
289
+ q as tprops,
290
+ C as tslot
298
291
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),E=require("../use/index.cjs"),y=require("./info.vue.cjs"),C=require("../md/index.vue.cjs"),g=require("./top.cjs"),u=require("./ftable.vue.cjs"),n=require("./index.cjs"),q=require("../../utils/glob.cjs"),h={class:"compo"},$={class:"compo-top"},b={class:"compo-li compo-props"},j={class:"compo-li compo-emits"},w={class:"compo-li compo-expose"},D={class:"compo-li compo-slot"},F={key:0,class:"compo-md"},K={key:0,class:"compo-md-list"},L={class:"compo-use"},M=e.defineComponent({__name:"index",props:{value:Object},setup(m){const s=m,d=e.ref([]),t=e.reactive({props:!0,expose:!0,emits:!0,slot:!0,md:!0,top:!0}),c=e.ref([]),a=e.ref([]),i=e.ref([]),p=e.ref([]),r=e.ref([]);e.watch(()=>s.value,()=>{k()});function k(){var v,o,l;(v=s.value)!=null&&v.key&&(n.getNotes((o=s.value)==null?void 0:o.key).then(_=>{let{titles:N,propss:B,slots:V,emitss:f,exposes:x}=_;d.value=N,c.value=B,p.value=V,a.value=f,i.value=x}),r.value=q.getKeyMds((l=s.value)==null?void 0:l.key)||[])}return k(),(v,o)=>(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(y,{value:m.value},null,8,["value"]),e.createElementVNode("div",$,[t.top?(e.openBlock(),e.createBlock(e.unref(g.default),{key:0,value:d.value},null,8,["value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",b,[e.createElementVNode("h4",{onClick:o[0]||(o[0]=l=>t.props=!t.props)}," 组件属性 "),t.props?(e.openBlock(),e.createBlock(u,{key:0,list:e.unref(n.tprops),value:c.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",j,[e.createElementVNode("h4",{onClick:o[1]||(o[1]=l=>t.emits=!t.emits)}," 组件事件 "),t.emits?(e.openBlock(),e.createBlock(u,{key:0,list:e.unref(n.temits),value:a.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createElementVNode("h4",{onClick:o[2]||(o[2]=l=>t.expose=!t.expose)}," 组件方法 "),t.expose?(e.openBlock(),e.createBlock(u,{key:0,list:e.unref(n.texpose),value:i.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",D,[e.createElementVNode("h4",{onClick:o[3]||(o[3]=l=>t.slot=!t.slot)},"组件插槽"),t.slot?(e.openBlock(),e.createBlock(u,{key:0,list:e.unref(n.tslot),value:p.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),r.value&&r.value.length?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",{onClick:o[4]||(o[4]=l=>t.md=!t.md),class:"compo-md-name"}," 说明文档 "),t.md?(e.openBlock(),e.createElementBlock("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,l=>(e.openBlock(),e.createBlock(C,{value:l},null,8,["value"]))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",L,[e.createVNode(e.unref(E),{value:s.value,param:{props:c.value,slot:p.value,emits:a.value,expose:i.value}},null,8,["value","param"])])]))}});module.exports=M;
1
+ "use strict";const e=require("vue"),d=require("../use/index.cjs"),k=require("./info.vue.cjs"),f=require("./props.vue.cjs"),g=require("../../config.cjs"),B=require("../md/index.vue.cjs");require("./index.cjs");const v=require("../../utils/glob.cjs"),y={class:"compo"},q={key:0,class:"compo-md"},C={key:0,class:"compo-md-list"},h={key:1,class:"compo-use"},x=e.defineComponent({__name:"index",props:{value:Object},setup(l){const t=l,m=g.getConfig("useparam"),a=e.ref(""),r=e.reactive({md:!0}),c=e.ref([]),s=e.ref({});function p(o){s.value=o}e.watch(()=>t.value,()=>{i()});function i(){var o,n,u;(o=t.value)!=null&&o.key&&(v.getLocalTextComponents((n=t.value)==null?void 0:n.key).then(_=>{a.value=_}),c.value=v.getKeyMds((u=t.value)==null?void 0:u.key)||[])}return i(),(o,n)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(k,{value:l.value},null,8,["value"]),e.createVNode(f,{onChange:p,value:a.value},null,8,["value"]),c.value&&c.value.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",{onClick:n[0]||(n[0]=u=>r.md=!r.md),class:"compo-md-name"}," 说明文档 "),r.md?(e.openBlock(),e.createElementBlock("div",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createBlock(B,{value:u},null,8,["value"]))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(e.unref(d),{value:t.value,param:e.unref(s)},null,8,["value","param"])])):e.createCommentVNode("",!0)]))}});module.exports=x;
@@ -1,115 +1,70 @@
1
- import { defineComponent as b, ref as i, reactive as j, watch as w, openBlock as s, createElementBlock as p, createVNode as h, createElementVNode as o, createBlock as a, unref as v, createCommentVNode as u, Fragment as D, renderList as F } from "vue";
2
- import K from "../use/index.js";
3
- import L from "./info.vue.js";
4
- import M from "../md/index.vue.js";
5
- import O from "./top.js";
6
- import r from "./ftable.vue.js";
7
- import { getNotes as T, tprops as U, temits as q, texpose as z, tslot as A } from "./index.js";
8
- import { getKeyMds as G } from "../../utils/glob.js";
9
- const H = { class: "compo" }, I = { class: "compo-top" }, J = { class: "compo-li compo-props" }, P = { class: "compo-li compo-emits" }, Q = { class: "compo-li compo-expose" }, R = { class: "compo-li compo-slot" }, S = {
1
+ import { defineComponent as h, ref as s, reactive as y, watch as C, openBlock as e, createElementBlock as l, createVNode as u, createElementVNode as x, Fragment as $, renderList as B, createBlock as N, createCommentVNode as c, unref as i } from "vue";
2
+ import V from "../use/index.js";
3
+ import b from "./info.vue.js";
4
+ import j from "./props.vue.js";
5
+ import { getConfig as E } from "../../config.js";
6
+ import L from "../md/index.vue.js";
7
+ import "./index.js";
8
+ import { getLocalTextComponents as w, getKeyMds as D } from "../../utils/glob.js";
9
+ const F = { class: "compo" }, K = {
10
10
  key: 0,
11
11
  class: "compo-md"
12
- }, W = {
12
+ }, M = {
13
13
  key: 0,
14
14
  class: "compo-md-list"
15
- }, X = { class: "compo-use" }, ie = /* @__PURE__ */ b({
15
+ }, O = {
16
+ key: 1,
17
+ class: "compo-use"
18
+ }, J = /* @__PURE__ */ h({
16
19
  __name: "index",
17
20
  props: {
18
21
  value: Object
19
22
  },
20
- setup(x) {
21
- const m = x, y = i([]), e = j({
22
- props: !0,
23
- expose: !0,
24
- emits: !0,
25
- slot: !0,
26
- md: !0,
27
- top: !0
28
- }), c = i([]), d = i([]), f = i([]), k = i([]), n = i([]);
29
- w(
30
- () => m.value,
23
+ setup(v) {
24
+ const t = v, _ = E("useparam"), p = s(""), r = y({
25
+ md: !0
26
+ }), m = s([]), d = s({});
27
+ function k(o) {
28
+ d.value = o;
29
+ }
30
+ C(
31
+ () => t.value,
31
32
  () => {
32
- $();
33
+ f();
33
34
  }
34
35
  );
35
- function $() {
36
- var _, t, l;
37
- (_ = m.value) != null && _.key && (T((t = m.value) == null ? void 0 : t.key).then((C) => {
38
- let { titles: g, propss: N, slots: B, emitss: V, exposes: E } = C;
39
- y.value = g, c.value = N, k.value = B, d.value = V, f.value = E;
40
- }), n.value = G((l = m.value) == null ? void 0 : l.key) || []);
36
+ function f() {
37
+ var o, a, n;
38
+ (o = t.value) != null && o.key && (w((a = t.value) == null ? void 0 : a.key).then(
39
+ (g) => {
40
+ p.value = g;
41
+ }
42
+ ), m.value = D((n = t.value) == null ? void 0 : n.key) || []);
41
43
  }
42
- return $(), (_, t) => (s(), p("div", H, [
43
- h(L, { value: x.value }, null, 8, ["value"]),
44
- o("div", I, [
45
- e.top ? (s(), a(v(O), {
46
- key: 0,
47
- value: y.value
48
- }, null, 8, ["value"])) : u("", !0)
49
- ]),
50
- o("div", J, [
51
- o("h4", {
52
- onClick: t[0] || (t[0] = (l) => e.props = !e.props)
53
- }, " 组件属性 "),
54
- e.props ? (s(), a(r, {
55
- key: 0,
56
- list: v(U),
57
- value: c.value
58
- }, null, 8, ["list", "value"])) : u("", !0)
59
- ]),
60
- o("div", P, [
61
- o("h4", {
62
- onClick: t[1] || (t[1] = (l) => e.emits = !e.emits)
63
- }, " 组件事件 "),
64
- e.emits ? (s(), a(r, {
65
- key: 0,
66
- list: v(q),
67
- value: d.value
68
- }, null, 8, ["list", "value"])) : u("", !0)
69
- ]),
70
- o("div", Q, [
71
- o("h4", {
72
- onClick: t[2] || (t[2] = (l) => e.expose = !e.expose)
73
- }, " 组件方法 "),
74
- e.expose ? (s(), a(r, {
75
- key: 0,
76
- list: v(z),
77
- value: f.value
78
- }, null, 8, ["list", "value"])) : u("", !0)
79
- ]),
80
- o("div", R, [
81
- o("h4", {
82
- onClick: t[3] || (t[3] = (l) => e.slot = !e.slot)
83
- }, "组件插槽"),
84
- e.slot ? (s(), a(r, {
85
- key: 0,
86
- list: v(A),
87
- value: k.value
88
- }, null, 8, ["list", "value"])) : u("", !0)
89
- ]),
90
- n.value && n.value.length ? (s(), p("div", S, [
91
- o("div", {
92
- onClick: t[4] || (t[4] = (l) => e.md = !e.md),
44
+ return f(), (o, a) => (e(), l("div", F, [
45
+ u(b, { value: v.value }, null, 8, ["value"]),
46
+ u(j, {
47
+ onChange: k,
48
+ value: p.value
49
+ }, null, 8, ["value"]),
50
+ m.value && m.value.length ? (e(), l("div", K, [
51
+ x("div", {
52
+ onClick: a[0] || (a[0] = (n) => r.md = !r.md),
93
53
  class: "compo-md-name"
94
54
  }, " 说明文档 "),
95
- e.md ? (s(), p("div", W, [
96
- (s(!0), p(D, null, F(n.value, (l) => (s(), a(M, { value: l }, null, 8, ["value"]))), 256))
97
- ])) : u("", !0)
98
- ])) : u("", !0),
99
- o("div", X, [
100
- h(v(K), {
101
- value: m.value,
102
- param: {
103
- props: c.value,
104
- slot: k.value,
105
- emits: d.value,
106
- expose: f.value
107
- }
55
+ r.md ? (e(), l("div", M, [
56
+ (e(!0), l($, null, B(m.value, (n) => (e(), N(L, { value: n }, null, 8, ["value"]))), 256))
57
+ ])) : c("", !0)
58
+ ])) : c("", !0),
59
+ i(_) ? (e(), l("div", O, [
60
+ u(i(V), {
61
+ value: t.value,
62
+ param: i(d)
108
63
  }, null, 8, ["value", "param"])
109
- ])
64
+ ])) : c("", !0)
110
65
  ]));
111
66
  }
112
67
  });
113
68
  export {
114
- ie as default
69
+ J as default
115
70
  };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),f=require("./top.cjs"),n=require("./ftable.vue.cjs"),s=require("./index.cjs"),N={class:"compo-top"},_={class:"compo-li compo-props"},V={class:"compo-li compo-emits"},x={class:"compo-li compo-expose"},B={class:"compo-li compo-slot"},C=e.defineComponent({__name:"props",props:{value:String},emits:["change"],setup(d,{emit:k}){const r=d,u=e.ref([]),t=e.reactive({props:!0,expose:!0,emits:!0,slot:!0,top:!0}),p=e.ref([]),a=e.ref([]),i=e.ref([]),v=e.ref([]);function m(){if(r.value){const l=s.getNotesText(r.value);u.value=l.titles,p.value=l.propss,v.value=l.slots,a.value=l.emitss,i.value=l.exposes,k("change",l)}}return e.watch(()=>r.value,()=>{m()}),m(),(l,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",N,[t.top?(e.openBlock(),e.createBlock(e.unref(f.default),{key:0,value:u.value},null,8,["value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",_,[e.createElementVNode("h4",{onClick:o[0]||(o[0]=c=>t.props=!t.props)}," 组件属性 "),t.props?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.tprops),value:p.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",V,[e.createElementVNode("h4",{onClick:o[1]||(o[1]=c=>t.emits=!t.emits)}," 组件事件 "),t.emits?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.temits),value:a.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",x,[e.createElementVNode("h4",{onClick:o[2]||(o[2]=c=>t.expose=!t.expose)}," 组件方法 "),t.expose?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.texpose),value:i.value},null,8,["list","value"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",B,[e.createElementVNode("h4",{onClick:o[3]||(o[3]=c=>t.slot=!t.slot)},"组件插槽"),t.slot?(e.openBlock(),e.createBlock(n,{key:0,list:e.unref(s.tslot),value:v.value},null,8,["list","value"])):e.createCommentVNode("",!0)])]))}});module.exports=C;
@@ -0,0 +1,8 @@
1
+ declare const _sfc_main: import('./vue/dist/vue.esm-bundler.js').DefineComponent<{
2
+ value: StringConstructor;
3
+ }, {}, unknown, {}, {}, import('./vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('./vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, "change"[], "change", import('./vue/dist/vue.esm-bundler.js').VNodeProps & import('./vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('./vue/dist/vue.esm-bundler.js').ComponentCustomProps, Readonly<import('./vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
4
+ value: StringConstructor;
5
+ }>> & {
6
+ onChange?: ((...args: any[]) => any) | undefined;
7
+ }, {}>;
8
+ export default _sfc_main;
@@ -0,0 +1,82 @@
1
+ import { defineComponent as g, ref as p, reactive as h, watch as y, openBlock as l, createElementBlock as $, createElementVNode as t, createBlock as i, unref as n, createCommentVNode as u } from "vue";
2
+ import B from "./top.js";
3
+ import r from "./ftable.vue.js";
4
+ import { tprops as N, temits as E, texpose as T, tslot as V, getNotesText as b } from "./index.js";
5
+ const j = { class: "compo-top" }, w = { class: "compo-li compo-props" }, D = { class: "compo-li compo-emits" }, S = { class: "compo-li compo-expose" }, q = { class: "compo-li compo-slot" }, H = /* @__PURE__ */ g({
6
+ __name: "props",
7
+ props: {
8
+ value: String
9
+ },
10
+ emits: ["change"],
11
+ setup(_, { emit: C }) {
12
+ const v = _, m = p([]), e = h({
13
+ props: !0,
14
+ expose: !0,
15
+ emits: !0,
16
+ slot: !0,
17
+ top: !0
18
+ }), c = p([]), d = p([]), f = p([]), k = p([]);
19
+ function x() {
20
+ if (v.value) {
21
+ const s = b(v.value);
22
+ m.value = s.titles, c.value = s.propss, k.value = s.slots, d.value = s.emitss, f.value = s.exposes, C("change", s);
23
+ }
24
+ }
25
+ return y(
26
+ () => v.value,
27
+ () => {
28
+ x();
29
+ }
30
+ ), x(), (s, o) => (l(), $("div", null, [
31
+ t("div", j, [
32
+ e.top ? (l(), i(n(B), {
33
+ key: 0,
34
+ value: m.value
35
+ }, null, 8, ["value"])) : u("", !0)
36
+ ]),
37
+ t("div", w, [
38
+ t("h4", {
39
+ onClick: o[0] || (o[0] = (a) => e.props = !e.props)
40
+ }, " 组件属性 "),
41
+ e.props ? (l(), i(r, {
42
+ key: 0,
43
+ list: n(N),
44
+ value: c.value
45
+ }, null, 8, ["list", "value"])) : u("", !0)
46
+ ]),
47
+ t("div", D, [
48
+ t("h4", {
49
+ onClick: o[1] || (o[1] = (a) => e.emits = !e.emits)
50
+ }, " 组件事件 "),
51
+ e.emits ? (l(), i(r, {
52
+ key: 0,
53
+ list: n(E),
54
+ value: d.value
55
+ }, null, 8, ["list", "value"])) : u("", !0)
56
+ ]),
57
+ t("div", S, [
58
+ t("h4", {
59
+ onClick: o[2] || (o[2] = (a) => e.expose = !e.expose)
60
+ }, " 组件方法 "),
61
+ e.expose ? (l(), i(r, {
62
+ key: 0,
63
+ list: n(T),
64
+ value: f.value
65
+ }, null, 8, ["list", "value"])) : u("", !0)
66
+ ]),
67
+ t("div", q, [
68
+ t("h4", {
69
+ onClick: o[3] || (o[3] = (a) => e.slot = !e.slot)
70
+ }, "组件插槽"),
71
+ e.slot ? (l(), i(r, {
72
+ key: 0,
73
+ list: n(V),
74
+ value: k.value
75
+ }, null, 8, ["list", "value"])) : u("", !0)
76
+ ])
77
+ ]));
78
+ }
79
+ });
80
+ export {
81
+ H as default
82
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./props.vue.cjs");module.exports=e;
@@ -0,0 +1,4 @@
1
+ import f from "./props.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),f=require("../boxurl/index.vue.cjs"),x=require("./top.cjs"),h=require("../code/index.vue.cjs"),y=require("./index.cjs"),N=require("../../utils/glob.cjs"),g={class:"md-top-name"},k={class:"test-top"},V={class:"test-div"},B={class:"test-body"},C={key:0,class:"test-code"},q=e.defineComponent({__name:"index",props:{value:Object,read:{type:Boolean,default:!0}},emits:["state"],setup(_,{emit:p}){const t=_,s=e.ref(""),u=e.ref([]),l=e.ref("1");e.watch([()=>t.value,()=>t.read],()=>{i()});let r;function i(){var n,c;t.read&&(n=t.value)!=null&&n.key&&N.getLocalTextTests(t.value).then(a=>{var v;s.value=a;let{titles:m,states:d}=y.getNotes(a);console.log("states",d),u.value=m;const o=d[0];o&&o.type&&(console.log("so",o),l.value=o.type.type),p("state",l.value,(v=t.value)==null?void 0:v.key)}).catch(()=>{s.value=""}),(c=t.value)!=null&&c.component&&(r=e.defineAsyncComponent(t.value.component))}return i(),(n,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["test","state-"+l.value])},[e.createVNode(f,{value:t.value},{default:e.withCtx(()=>{var a;return[e.createElementVNode("div",g,e.toDisplayString((a=t.value)==null?void 0:a.value)+" 文件 示例代码 ",1)]}),_:1},8,["value"]),e.createElementVNode("div",k,[e.createVNode(e.unref(x.default),{value:u.value},null,8,["value"])]),e.createElementVNode("div",V,[e.createElementVNode("div",B,[(e.openBlock(),e.createBlock(e.Suspense,null,{fallback:e.withCtx(()=>[e.createTextVNode(" 示例加载中... ")]),default:e.withCtx(()=>[e.createVNode(e.unref(r))]),_:1}))]),t.read?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(h,{value:t.value,text:s.value},null,8,["value","text"])])):e.createCommentVNode("",!0)])],2))}});module.exports=q;
1
+ "use strict";const e=require("vue"),f=require("../boxurl/index.vue.cjs"),x=require("./top.cjs"),h=require("../code/index.vue.cjs"),y=require("./index.cjs"),N=require("../../utils/glob.cjs"),k={class:"md-top-name"},V={class:"test-top"},g={class:"test-div"},B={class:"test-body"},C={key:0,class:"test-code"},q=e.defineComponent({__name:"index",props:{value:Object,read:{type:Boolean,default:!0}},emits:["state"],setup(v,{emit:_}){const t=v,o=e.ref(""),u=e.ref([]),s=e.ref("1");e.watch([()=>t.value,()=>t.read],()=>{i()});let r;function i(){var l,n;t.read&&(l=t.value)!=null&&l.key&&N.getLocalTextTests(t.value).then(a=>{var d;o.value=a;let{titles:p,states:m}=y.getNotes(a);u.value=p;const c=m[0];c&&c.type&&(s.value=c.type.type),_("state",s.value,(d=t.value)==null?void 0:d.key)}).catch(()=>{o.value=""}),(n=t.value)!=null&&n.component&&(r=e.defineAsyncComponent(t.value.component))}return i(),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["test","state-"+s.value])},[e.createVNode(f,{value:t.value},{default:e.withCtx(()=>{var a;return[e.createElementVNode("div",k,e.toDisplayString((a=t.value)==null?void 0:a.value)+" 文件 示例代码 ",1)]}),_:1},8,["value"]),e.createElementVNode("div",V,[e.createVNode(e.unref(x.default),{value:u.value},null,8,["value"])]),e.createElementVNode("div",g,[e.createElementVNode("div",B,[(e.openBlock(),e.createBlock(e.Suspense,null,{fallback:e.withCtx(()=>[e.createTextVNode(" 示例加载中... ")]),default:e.withCtx(()=>[e.createVNode(e.unref(r))]),_:1}))]),t.read?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(h,{value:t.value,text:o.value},null,8,["value","text"])])):e.createCommentVNode("",!0)])],2))}});module.exports=q;
@@ -1,4 +1,4 @@
1
- import { defineComponent as C, ref as i, watch as N, defineAsyncComponent as B, openBlock as r, createElementBlock as h, normalizeClass as T, createVNode as o, withCtx as d, createElementVNode as s, toDisplayString as V, unref as y, createBlock as b, Suspense as w, createTextVNode as A, createCommentVNode as D } from "vue";
1
+ import { defineComponent as C, ref as i, watch as N, defineAsyncComponent as B, openBlock as r, createElementBlock as _, normalizeClass as T, createVNode as a, withCtx as d, createElementVNode as o, toDisplayString as V, unref as h, createBlock as b, Suspense as w, createTextVNode as A, createCommentVNode as D } from "vue";
2
2
  import E from "../boxurl/index.vue.js";
3
3
  import S from "./top.js";
4
4
  import $ from "../code/index.vue.js";
@@ -17,64 +17,64 @@ const L = { class: "md-top-name" }, O = { class: "test-top" }, P = { class: "tes
17
17
  }
18
18
  },
19
19
  emits: ["state"],
20
- setup(x, { emit: g }) {
21
- const e = x, l = i(""), v = i([]), n = i("1");
20
+ setup(y, { emit: x }) {
21
+ const e = y, s = i(""), v = i([]), l = i("1");
22
22
  N([() => e.value, () => e.read], () => {
23
23
  p();
24
24
  });
25
25
  let m;
26
26
  function p() {
27
- var c, u;
28
- e.read && (c = e.value) != null && c.key && z(e.value).then((t) => {
29
- var _;
30
- l.value = t;
31
- let { titles: k, states: f } = j(t);
32
- console.log("states", f), v.value = k;
33
- const a = f[0];
34
- a && a.type && (console.log("so", a), n.value = a.type.type), g(
27
+ var n, c;
28
+ e.read && (n = e.value) != null && n.key && z(e.value).then((t) => {
29
+ var f;
30
+ s.value = t;
31
+ let { titles: k, states: g } = j(t);
32
+ v.value = k;
33
+ const u = g[0];
34
+ u && u.type && (l.value = u.type.type), x(
35
35
  "state",
36
- n.value,
37
- (_ = e.value) == null ? void 0 : _.key
36
+ l.value,
37
+ (f = e.value) == null ? void 0 : f.key
38
38
  );
39
39
  }).catch(() => {
40
- l.value = "";
41
- }), (u = e.value) != null && u.component && (m = B(
40
+ s.value = "";
41
+ }), (c = e.value) != null && c.component && (m = B(
42
42
  e.value.component
43
43
  ));
44
44
  }
45
- return p(), (c, u) => (r(), h("div", {
46
- class: T(["test", "state-" + n.value])
45
+ return p(), (n, c) => (r(), _("div", {
46
+ class: T(["test", "state-" + l.value])
47
47
  }, [
48
- o(E, {
48
+ a(E, {
49
49
  value: e.value
50
50
  }, {
51
51
  default: d(() => {
52
52
  var t;
53
53
  return [
54
- s("div", L, V((t = e.value) == null ? void 0 : t.value) + " 文件 示例代码 ", 1)
54
+ o("div", L, V((t = e.value) == null ? void 0 : t.value) + " 文件 示例代码 ", 1)
55
55
  ];
56
56
  }),
57
57
  _: 1
58
58
  }, 8, ["value"]),
59
- s("div", O, [
60
- o(y(S), { value: v.value }, null, 8, ["value"])
59
+ o("div", O, [
60
+ a(h(S), { value: v.value }, null, 8, ["value"])
61
61
  ]),
62
- s("div", P, [
63
- s("div", q, [
62
+ o("div", P, [
63
+ o("div", q, [
64
64
  (r(), b(w, null, {
65
65
  fallback: d(() => [
66
66
  A(" 示例加载中... ")
67
67
  ]),
68
68
  default: d(() => [
69
- o(y(m))
69
+ a(h(m))
70
70
  ]),
71
71
  _: 1
72
72
  }))
73
73
  ]),
74
- e.read ? (r(), h("div", F, [
75
- o($, {
74
+ e.read ? (r(), _("div", F, [
75
+ a($, {
76
76
  value: e.value,
77
- text: l.value
77
+ text: s.value
78
78
  }, null, 8, ["value", "text"])
79
79
  ])) : D("", !0)
80
80
  ])