@fangzhongya/vue-archive 0.0.3-2 → 0.0.3-21

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.
Files changed (68) hide show
  1. package/dist/node/index.cjs +1473 -1139
  2. package/dist/node/index.js +1473 -1139
  3. package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.cjs +1 -0
  4. package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js +13 -0
  5. package/dist/node_modules/.pnpm/es-module-lexer@1.2.0/node_modules/es-module-lexer/dist/lexer.cjs +3 -0
  6. package/dist/node_modules/.pnpm/es-module-lexer@1.2.0/node_modules/es-module-lexer/dist/lexer.js +52 -0
  7. package/dist/packages/components/compo/index.vue.cjs +1 -1
  8. package/dist/packages/components/compo/index.vue.js +48 -42
  9. package/dist/packages/components/compo/top.cjs +1 -1
  10. package/dist/packages/components/compo/top.d.ts +1 -1
  11. package/dist/packages/components/compo/top.js +41 -40
  12. package/dist/packages/components/test/top.cjs +1 -1
  13. package/dist/packages/components/test/top.d.ts +1 -1
  14. package/dist/packages/components/test/top.js +52 -51
  15. package/dist/packages/components/use/code.cjs +10 -10
  16. package/dist/packages/components/use/code.d.ts +13 -0
  17. package/dist/packages/components/use/code.js +88 -59
  18. package/dist/packages/components/use/index.cjs +1 -1
  19. package/dist/packages/components/use/index.js +2 -2
  20. package/dist/packages/components/use/retrie/choice/index.vue.cjs +1 -1
  21. package/dist/packages/components/use/retrie/choice/index.vue.js +1 -1
  22. package/dist/packages/components/use/set-props.vue.cjs +1 -1
  23. package/dist/packages/components/use/set-props.vue.js +46 -63
  24. package/dist/packages/config.cjs +1 -1
  25. package/dist/packages/config.js +1 -1
  26. package/dist/packages/page/comprops/index.vue2.cjs +1 -1
  27. package/dist/packages/page/comprops/index.vue2.js +50 -40
  28. package/dist/packages/router/file.cjs +1 -0
  29. package/dist/packages/router/file.d.ts +8 -0
  30. package/dist/packages/router/file.js +43 -0
  31. package/dist/packages/router/index.cjs +1 -1
  32. package/dist/packages/router/index.d.ts +1 -0
  33. package/dist/packages/router/index.js +62 -89
  34. package/dist/packages/utils/common.cjs +1 -1
  35. package/dist/packages/utils/common.js +4 -4
  36. package/dist/packages/utils/glob.cjs +1 -1
  37. package/dist/packages/utils/glob.js +6 -6
  38. package/dist/packages/utils/index.cjs +1 -1
  39. package/dist/packages/utils/index.js +1 -1
  40. package/package.json +7 -7
  41. package/dist/markdown-it.d.ts +0 -1
  42. package/dist/node_modules/.pnpm/es-module-lexer@1.1.1/node_modules/es-module-lexer/dist/lexer.cjs +0 -3
  43. package/dist/node_modules/.pnpm/es-module-lexer@1.1.1/node_modules/es-module-lexer/dist/lexer.js +0 -52
  44. package/dist/packages/components/md/markdown-it.d.ts +0 -1
  45. package/dist/packages/components/use/prettier.d.ts +0 -7
  46. package/dist/prettier.d.ts +0 -7
  47. package/dist/src/vite-env.d.ts +0 -1
  48. package/dist/vite-env.d.ts +0 -1
  49. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs +0 -0
  50. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +0 -0
  51. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs +0 -0
  52. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +0 -0
  53. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.cjs +0 -0
  54. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js +0 -0
  55. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs +0 -0
  56. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +0 -0
  57. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs +0 -0
  58. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js +0 -0
  59. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.cjs +0 -0
  60. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +0 -0
  61. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.cjs +0 -0
  62. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +0 -0
  63. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs +0 -0
  64. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js +0 -0
  65. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs +0 -0
  66. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +0 -0
  67. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs +0 -0
  68. /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.7-18 → @fangzhongya_utils@0.0.7-20}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +0 -0
@@ -1,7 +1,8 @@
1
- import { defineComponent as u, h as c } from "vue";
2
- function f(d, e) {
3
- let s = [], r = [], p = [];
4
- const n = () => {
1
+ import { defineComponent as m, h as f } from "vue";
2
+ import { htmlEscape as v } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-NCSN3MC5.js";
3
+ function y(c, e, n) {
4
+ let s = [], u = [], p = [];
5
+ const r = (t) => n ? v(t) : t, l = () => {
5
6
  p.length > 0 && (s.push(
6
7
  e(
7
8
  "div",
@@ -11,8 +12,8 @@ function f(d, e) {
11
12
  p
12
13
  )
13
14
  ), p = []);
14
- }, l = () => {
15
- s.length > 0 && (r.push(
15
+ }, o = () => {
16
+ s.length > 0 && (u.push(
16
17
  e(
17
18
  "div",
18
19
  {
@@ -22,10 +23,10 @@ function f(d, e) {
22
23
  )
23
24
  ), s = []);
24
25
  };
25
- return d.forEach((t) => {
26
- const o = [];
26
+ return c.forEach((t) => {
27
+ const d = [];
27
28
  let a = !1;
28
- if (t.date && (a = !0, o.push(
29
+ if (t.date && (a = !0, d.push(
29
30
  e(
30
31
  "div",
31
32
  {
@@ -33,14 +34,14 @@ function f(d, e) {
33
34
  },
34
35
  [
35
36
  e("span", {}, "更新时间:"),
36
- e(
37
- "span",
38
- {},
39
- t.date.name + " " + t.date.description
40
- )
37
+ e("span", {}, [
38
+ r(
39
+ t.date.name + " " + t.date.description
40
+ )
41
+ ])
41
42
  ]
42
43
  )
43
- )), t.author && (a = !0, o.push(
44
+ )), t.author && (a = !0, d.push(
44
45
  e(
45
46
  "div",
46
47
  {
@@ -48,15 +49,15 @@ function f(d, e) {
48
49
  },
49
50
  [
50
51
  e("span", {}, "作者:"),
51
- e(
52
- "span",
53
- {},
54
- t.author.name + " " + t.author.description
55
- )
52
+ e("span", {}, [
53
+ r(
54
+ t.author.name + " " + t.author.description
55
+ )
56
+ ])
56
57
  ]
57
58
  )
58
59
  )), t.title && (t.title.type || t.title.name || t.title.description)) {
59
- n(), a && l();
60
+ l(), a && o();
60
61
  let i = t.title.type || "div";
61
62
  s.push(
62
63
  e(
@@ -65,22 +66,22 @@ function f(d, e) {
65
66
  class: "test-top-title"
66
67
  },
67
68
  [
68
- e(
69
- "span",
70
- {},
71
- t.title.name + " " + t.title.description
72
- )
69
+ e("span", {}, [
70
+ r(
71
+ t.title.name + " " + t.title.description
72
+ )
73
+ ])
73
74
  ]
74
75
  )
75
76
  );
76
77
  }
77
- if (a && (p.length > 0 && (n(), l()), s.push(
78
+ if (a && (p.length > 0 && (l(), o()), s.push(
78
79
  e(
79
80
  "div",
80
81
  {
81
82
  class: "test-top-info"
82
83
  },
83
- o
84
+ d
84
85
  )
85
86
  )), t.text) {
86
87
  let i = t.text.type || "div";
@@ -91,11 +92,11 @@ function f(d, e) {
91
92
  class: "test-top-text"
92
93
  },
93
94
  [
94
- e(
95
- "span",
96
- {},
97
- t.text.name + " " + t.text.description
98
- )
95
+ e("span", {}, [
96
+ r(
97
+ t.text.name + " " + t.text.description
98
+ )
99
+ ])
99
100
  ]
100
101
  )
101
102
  );
@@ -109,11 +110,11 @@ function f(d, e) {
109
110
  class: "test-top-proposal"
110
111
  },
111
112
  [
112
- e(
113
- "span",
114
- {},
115
- t.proposal.name + " " + t.proposal.description
116
- )
113
+ e("span", {}, [
114
+ r(
115
+ t.proposal.name + " " + t.proposal.description
116
+ )
117
+ ])
117
118
  ]
118
119
  )
119
120
  );
@@ -127,36 +128,36 @@ function f(d, e) {
127
128
  class: "test-top-error"
128
129
  },
129
130
  [
130
- e(
131
- "span",
132
- {},
133
- t.error.name + " " + t.error.description
134
- )
131
+ e("span", {}, [
132
+ r(
133
+ t.error.name + " " + t.error.description
134
+ )
135
+ ])
135
136
  ]
136
137
  )
137
138
  );
138
139
  }
139
- }), n(), l(), r;
140
+ }), l(), o(), u;
140
141
  }
141
- const v = u({
142
+ const T = m({
142
143
  /**
143
144
  * @props {Stinrg} value 插入数据
144
145
  */
145
146
  props: {
146
147
  value: Array
147
148
  },
148
- render(d, e, s) {
149
- const r = f(s.value, c);
150
- return c(
149
+ render(c, e, n) {
150
+ const s = y(n.value, f);
151
+ return f(
151
152
  "div",
152
153
  {
153
154
  class: "test-top"
154
155
  },
155
- r
156
+ s
156
157
  );
157
158
  }
158
159
  });
159
160
  export {
160
- v as default,
161
- f as getTestTopDom
161
+ T as default,
162
+ y as getTestTopDom
162
163
  };
@@ -1,18 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),m=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),F=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),p=require("./util.cjs");function b(r,t,i,e){const n=[],o=[];let h=!0;Object.keys(t).forEach(s=>{let f=t[s];if(/^on[A-Z]/.test(s)&&typeof f=="function"){let u=s.substring(2);const l=s.split(":");let c;if(l.length>1?(c=l[0]+l.slice(1).map(a=>m.firstUpper(a)).join(""),u=F.firstLower(u)):(c=l[0],u=j.humpToLine(u)),l.includes("-")){let a=c.split("-");a=a.map((g,$)=>$!=0?m.firstUpper(g):g),c=a.join("")}n.push(" @"+u+'="'+c+'"'),o.push("function "+c+"(...arr) {"),o.push(" console.log('"+c+"', arr)"),o.push("}")}else if(n.push(" :"+s+'="'+s+'"'),typeof f=="function")o.push("const "+s+" = "+O(f,s,e));else if(h&&(h=!1,o.unshift("import { ref } from 'vue';")),typeof f>"u")o.push("const "+s+" = ref();");else{let u=S(f,s,e);o.push("const "+s+" = ref("+u+");")}}),n.length>0&&n.unshift("");const d=v(i);return`<!--${r}-->
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs"),d=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs"),h=require("./util.cjs");function F(n,t,e,r){const o=[],i=[];let l=!0;Object.keys(t).forEach(s=>{let c=t[s];if(/^on[A-Z]/.test(s)&&typeof c=="function"){let u=s.substring(2);const a=s.split(":");let f;if(a.length>1?(f=a[0]+a.slice(1).map(p=>d.firstUpper(p)).join(""),u=j.firstLower(u)):(f=a[0],u=b.humpToLine(u)),a.includes("-")){let p=f.split("-");p=p.map((m,$)=>$!=0?d.firstUpper(m):m),f=p.join("")}o.push(" @"+u+'="'+f+'"'),i.push("function "+f+"(...arr) {"),i.push(" console.log('"+f+"', arr)"),i.push("}")}else if(o.push(" :"+s+'="'+s+'"'),typeof c=="function")i.push("const "+s+" = "+J(c,s,r));else if(l&&(l=!1,i.unshift("import { ref } from 'vue';")),typeof c>"u")i.push("const "+s+" = ref();");else{let u=S(c,s,r);i.push("const "+s+" = ref("+u+");")}}),o.length>0&&o.unshift("");const g=O(e);return`<!--${n}-->
2
2
  <template>
3
3
  <div>
4
- <${r}${n.join(`
5
- `)}>${d.join(`
4
+ <${n}${o.join(`
5
+ `)}>${g.join(`
6
6
  `)}
7
- </${r}>
7
+ </${n}>
8
8
  </div>
9
9
  </template>
10
10
  <script lang="ts" setup>
11
- ${o.join(`
11
+ ${i.join(`
12
12
  `)}
13
13
  <\/script>
14
- `}function v(r={}){const t=[];return Object.keys(r).forEach(i=>{const e=r[i];if(e){const n=` <template #${i}="scope">
15
- ${p.vueFormat(e," ")}
16
- </template>`;t.push(n)}}),t&&t.length>0&&t.unshift(""),t}function O(r,t,i){const e=i?i[t]:"";if(e)return"function"+e;{const n=p.getFunctionFormat(p.prettierFormat(r.toString()));if(n){let o=`{
17
- ${p.vueFormat(p.getFunBody(n.body)," ")}
18
- }`;return`function${n.param}${o}`}else return"undefined"}}function S(r,t,i){const e=i?i[t]:"";return e||JSON.stringify(r)}exports.getHmtl=b;
14
+ `}function O(n={}){const t=[];return Object.keys(n).forEach(e=>{const r=n[e];if(r){const o=` <template #${e}="scope">
15
+ ${h.vueFormat(r," ")}
16
+ </template>`;t.push(o)}}),t&&t.length>0&&t.unshift(""),t}function J(n,t,e){const r=e?e[t]:"";return r?"function "+r:y(n.toString())}function y(n){const t=h.getFunctionFormat(h.prettierFormat(n));if(t){let e=`{
17
+ ${h.vueFormat(h.getFunBody(t.body)," ")}
18
+ }`;return`function ${t.param} ${e}`}else return"undefined"}function E(n){const t=n.trim();return/^\(/.test(t)?y(t):JSON.stringify(n)}function S(n,t,e){const r=e?e[t]:"";return r||(typeof n=="string"?E(n+""):JSON.stringify(n))}function T(n){let t=q(n.type),e="any";t.length==1&&(e=t[0].split("<")[0]);const r=e;let o=(n.selectable||"").trim(),i=[];return o&&e!="boolean"&&(o.split(",").forEach(l=>{if(l){let g=l.split(":");i.push({label:l,prop:g[0].trim()})}}),e=="function"?e="function":e=="array"?e="choice":e="select"),{arr:i,zdtype:r,type:e,dataType:t}}function q(n){let t=[];return(n||"").trim().toLowerCase().split(",").forEach(r=>{r=r.trim(),r&&t.push(r)}),[...new Set(t)].sort()}exports.getHmtl=F;exports.getSpecType=T;exports.setValStringify=S;
@@ -1,2 +1,15 @@
1
1
  import type { ObjStr, ObjUnk } from '../../config';
2
+ import type { Spec } from '../../utils/index';
2
3
  export declare function getHmtl(propsname: string, value: ObjUnk, slotValue?: ObjStr, propsText?: ObjStr): string;
4
+ export declare function setValStringify(v: unknown, key: string, propsText?: ObjStr): string;
5
+ type SelectsObj = {
6
+ label: string;
7
+ prop: unknown;
8
+ };
9
+ export declare function getSpecType(val: Spec): {
10
+ arr: SelectsObj[];
11
+ zdtype: string;
12
+ type: string;
13
+ dataType: string[];
14
+ };
15
+ export {};
@@ -1,99 +1,128 @@
1
- import { humpToLine as j } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
2
- import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
3
- import { firstLower as F } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
4
- import { vueFormat as g, getFunctionFormat as b, prettierFormat as v, getFunBody as S } from "./util.js";
5
- function N(r, t, i, n) {
6
- const e = [], o = [];
7
- let a = !0;
1
+ import { humpToLine as b } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js";
2
+ import { firstUpper as g } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
3
+ import { firstLower as S } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js";
4
+ import { vueFormat as d, getFunctionFormat as j, prettierFormat as F, getFunBody as E } from "./util.js";
5
+ function T(n, t, e, r) {
6
+ const o = [], i = [];
7
+ let u = !0;
8
8
  Object.keys(t).forEach((s) => {
9
9
  let c = t[s];
10
10
  if (/^on[A-Z]/.test(s) && typeof c == "function") {
11
11
  let f = s.substring(2);
12
- const l = s.split(":");
13
- let u;
14
- if (l.length > 1 ? (u = l[0] + l.slice(1).map((p) => h(p)).join(""), f = F(f)) : (u = l[0], f = j(f)), l.includes("-")) {
15
- let p = u.split("-");
16
- p = p.map((m, $) => $ != 0 ? h(m) : m), u = p.join("");
12
+ const p = s.split(":");
13
+ let l;
14
+ if (p.length > 1 ? (l = p[0] + p.slice(1).map((a) => g(a)).join(""), f = S(f)) : (l = p[0], f = b(f)), p.includes("-")) {
15
+ let a = l.split("-");
16
+ a = a.map((h, y) => y != 0 ? g(h) : h), l = a.join("");
17
17
  }
18
- e.push(
19
- " @" + f + '="' + u + '"'
20
- ), o.push("function " + u + "(...arr) {"), o.push(
21
- " console.log('" + u + "', arr)"
22
- ), o.push("}");
23
- } else if (e.push(
18
+ o.push(
19
+ " @" + f + '="' + l + '"'
20
+ ), i.push("function " + l + "(...arr) {"), i.push(
21
+ " console.log('" + l + "', arr)"
22
+ ), i.push("}");
23
+ } else if (o.push(
24
24
  " :" + s + '="' + s + '"'
25
25
  ), typeof c == "function")
26
- o.push(
27
- "const " + s + " = " + B(
26
+ i.push(
27
+ "const " + s + " = " + w(
28
28
  c,
29
29
  s,
30
- n
30
+ r
31
31
  )
32
32
  );
33
- else if (a && (a = !1, o.unshift(
33
+ else if (u && (u = !1, i.unshift(
34
34
  "import { ref } from 'vue';"
35
35
  )), typeof c > "u")
36
- o.push("const " + s + " = ref();");
36
+ i.push("const " + s + " = ref();");
37
37
  else {
38
- let f = E(
38
+ let f = z(
39
39
  c,
40
40
  s,
41
- n
41
+ r
42
42
  );
43
- o.push(
43
+ i.push(
44
44
  "const " + s + " = ref(" + f + ");"
45
45
  );
46
46
  }
47
- }), e.length > 0 && e.unshift("");
48
- const d = O(i);
49
- return `<!--${r}-->
47
+ }), o.length > 0 && o.unshift("");
48
+ const m = O(e);
49
+ return `<!--${n}-->
50
50
  <template>
51
51
  <div>
52
- <${r}${e.join(`
53
- `)}>${d.join(`
52
+ <${n}${o.join(`
53
+ `)}>${m.join(`
54
54
  `)}
55
- </${r}>
55
+ </${n}>
56
56
  </div>
57
57
  </template>
58
58
  <script lang="ts" setup>
59
- ${o.join(`
59
+ ${i.join(`
60
60
  `)}
61
61
  <\/script>
62
62
  `;
63
63
  }
64
- function O(r = {}) {
64
+ function O(n = {}) {
65
65
  const t = [];
66
- return Object.keys(r).forEach((i) => {
67
- const n = r[i];
68
- if (n) {
69
- const e = ` <template #${i}="scope">
70
- ${g(n, " ")}
66
+ return Object.keys(n).forEach((e) => {
67
+ const r = n[e];
68
+ if (r) {
69
+ const o = ` <template #${e}="scope">
70
+ ${d(r, " ")}
71
71
  </template>`;
72
- t.push(e);
72
+ t.push(o);
73
73
  }
74
74
  }), t && t.length > 0 && t.unshift(""), t;
75
75
  }
76
- function B(r, t, i) {
77
- const n = i ? i[t] : "";
78
- if (n)
79
- return "function" + n;
80
- {
81
- const e = b(
82
- v(r.toString())
83
- );
84
- if (e) {
85
- let o = `{
86
- ${g(S(e.body), " ")}
76
+ function w(n, t, e) {
77
+ const r = e ? e[t] : "";
78
+ return r ? "function " + r : $(n.toString());
79
+ }
80
+ function $(n) {
81
+ const t = j(F(n));
82
+ if (t) {
83
+ let e = `{
84
+ ${d(E(t.body), " ")}
87
85
  }`;
88
- return `function${e.param}${o}`;
89
- } else
90
- return "undefined";
91
- }
86
+ return `function ${t.param} ${e}`;
87
+ } else
88
+ return "undefined";
89
+ }
90
+ function L(n) {
91
+ const t = n.trim();
92
+ return /^\(/.test(t) ? $(t) : JSON.stringify(n);
93
+ }
94
+ function z(n, t, e) {
95
+ const r = e ? e[t] : "";
96
+ return r || (typeof n == "string" ? L(n + "") : JSON.stringify(n));
97
+ }
98
+ function U(n) {
99
+ let t = B(n.type), e = "any";
100
+ t.length == 1 && (e = t[0].split("<")[0]);
101
+ const r = e;
102
+ let o = (n.selectable || "").trim(), i = [];
103
+ return o && e != "boolean" && (o.split(",").forEach((u) => {
104
+ if (u) {
105
+ let m = u.split(":");
106
+ i.push({
107
+ label: u,
108
+ prop: m[0].trim()
109
+ });
110
+ }
111
+ }), e == "function" ? e = "function" : e == "array" ? e = "choice" : e = "select"), {
112
+ arr: i,
113
+ zdtype: r,
114
+ type: e,
115
+ dataType: t
116
+ };
92
117
  }
93
- function E(r, t, i) {
94
- const n = i ? i[t] : "";
95
- return n || JSON.stringify(r);
118
+ function B(n) {
119
+ let t = [];
120
+ return (n || "").trim().toLowerCase().split(",").forEach((r) => {
121
+ r = r.trim(), r && t.push(r);
122
+ }), [...new Set(t)].sort();
96
123
  }
97
124
  export {
98
- N as getHmtl
125
+ T as getHmtl,
126
+ U as getSpecType,
127
+ z as setValStringify
99
128
  };
@@ -1 +1 @@
1
- "use strict";const s=require("vue"),x=require("./set-props.vue.cjs"),q=require("./set-emit.vue.cjs"),E=require("./set-code.vue.cjs"),b=require("./set-expose.vue.cjs"),C=require("./set-slot.vue.cjs"),i=require("../../utils/props.cjs"),V=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=s.defineComponent({props:{value:{type:Object},param:{type:Object}},render(O,T,v,D,a){console.log("render",new Date().getTime());const r=s.reactive({emitValue:{},slotValue:{}}),n=v.value;let c="div";n.component?c=s.defineAsyncComponent(n.component):n.name&&(c=s.resolveComponent(n.name));const u=v.param,d=i.getPropsValue(u.propss),m=i.getEmitsValue(u.emitss),y=i.getExposeValue(u.exposes),h=i.getSlotValue(u.slots),l={},f={};d.forEach(t=>{let e=t.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(l[e]=a.propsValue[e],o&&o.length>1&&m.push({name:"update:"+e,description:t.description,selectable:"value:["+t.type+"]"}))}}),m.forEach(t=>{let e=t.name;if(e.includes("-")){let p=e.split("-");p=p.map((_,U)=>V.firstUpper(_)),e=p.join("")}else e=V.firstUpper(e);const o="on"+e;l[o]=(...p)=>{const _={arr:p,_date_:new Date().getTime()};r.emitValue[t.name]=_}});let g;return h.forEach(t=>{const e=t.name||"default";f[e]=o=>{if(r.slotValue[e])return s.h(s.defineComponent({props:{scope:{type:Object}},template:r.slotValue[e]}),{scope:o})}}),s.h("div",{class:"use"},[s.h("div",{class:"use-props"},s.h(x,{name:n.name,list:d,onChange:(t,e)=>{a.propsValue=t,a.propsText=e}})),s.h("div",{class:"use-component"},s.h(c,{...l,ref:t=>{g=t}},f)),s.h("div",{class:"use-code"},s.h(E,{name:n.name,value:l,propsText:a.propsText,slotValue:r.slotValue})),s.h("div",{class:"use-emit"},s.h(q,{name:n.name,list:m,value:r.emitValue})),s.h("div",{class:"use-expose"},s.h(b,{name:n.name,list:y,getRef:()=>g})),s.h("div",{class:"use-slot"},s.h(C,{name:n.name,list:h,onChange:(t,e)=>{r.slotValue[t]=e}}))])},data(){return{propsValue:{},propsText:{}}}});module.exports=j;
1
+ "use strict";const t=require("vue"),x=require("./set-props.vue.cjs"),q=require("./set-emit.vue.cjs"),E=require("./set-code.vue.cjs"),b=require("./set-expose.vue.cjs"),C=require("./set-slot.vue.cjs"),i=require("../../utils/props.cjs"),V=require("../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs"),j=t.defineComponent({props:{value:{type:Object},param:{type:Object}},render(O,T,v,D,a){console.log("render",new Date().getTime());const r=t.reactive({emitValue:{},slotValue:{}}),n=v.value;let c="div";n.component?c=t.defineAsyncComponent(n.component):n.name&&(c=t.resolveComponent(n.name));const u=v.param,d=i.getPropsValue(u.props),m=i.getEmitsValue(u.emits),y=i.getExposeValue(u.expose),h=i.getSlotValue(u.slot),l={},f={};d.forEach(s=>{let e=s.name;if(!e.includes(".")){let o=e.split("/");e=(o[0]||"").trim(),e&&(l[e]=a.propsValue[e],o&&o.length>1&&m.push({name:"update:"+e,description:s.description,selectable:"value:["+s.type+"]"}))}}),m.forEach(s=>{let e=s.name;if(e.includes("-")){let p=e.split("-");p=p.map((_,U)=>V.firstUpper(_)),e=p.join("")}else e=V.firstUpper(e);const o="on"+e;l[o]=(...p)=>{const _={arr:p,_date_:new Date().getTime()};r.emitValue[s.name]=_}});let g;return h.forEach(s=>{const e=s.name||"default";f[e]=o=>{if(r.slotValue[e])return t.h(t.defineComponent({props:{scope:{type:Object}},template:r.slotValue[e]}),{scope:o})}}),t.h("div",{class:"use"},[t.h("div",{class:"use-props"},t.h(x,{name:n.name,list:d,onChange:(s,e)=>{a.propsValue=s,a.propsText=e}})),t.h("div",{class:"use-component"},t.h(c,{...l,ref:s=>{g=s}},f)),t.h("div",{class:"use-code"},t.h(E,{name:n.name,value:l,propsText:a.propsText,slotValue:r.slotValue})),t.h("div",{class:"use-emit"},t.h(q,{name:n.name,list:m,value:r.emitValue})),t.h("div",{class:"use-expose"},t.h(b,{name:n.name,list:y,getRef:()=>g})),t.h("div",{class:"use-slot"},t.h(C,{name:n.name,list:h,onChange:(s,e)=>{r.slotValue[s]=e}}))])},data(){return{propsValue:{},propsText:{}}}});module.exports=j;
@@ -5,7 +5,7 @@ import E from "./set-code.vue.js";
5
5
  import O from "./set-expose.vue.js";
6
6
  import $ from "./set-slot.vue.js";
7
7
  import { getPropsValue as D, getEmitsValue as w, getExposeValue as U, getSlotValue as k } from "../../utils/props.js";
8
- import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
8
+ import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
9
9
  const K = g({
10
10
  /**
11
11
  * @props {Stinrg} value 插入数据
@@ -26,7 +26,7 @@ const K = g({
26
26
  }), o = f.value;
27
27
  let i = "div";
28
28
  o.component ? i = j(o.component) : o.name && (i = T(o.name));
29
- const p = f.param, d = D(p.propss), c = w(p.emitss), x = U(p.exposes), V = k(p.slots), l = {}, v = {};
29
+ const p = f.param, d = D(p.props), c = w(p.emits), x = U(p.expose), V = k(p.slot), l = {}, v = {};
30
30
  d.forEach((s) => {
31
31
  let e = s.name;
32
32
  if (!e.includes(".")) {
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("vue"),S=require("../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.cjs"),v=require("../../util.cjs"),C={class:"form-select"},x=["value","disabled","onClick","onBlur"],A=["onMousemove","onMouseout"],j={class:"form-select-list"},O={key:0,class:"form-select-list-div"},T=["onClick"],q={key:1,class:"no-data"},L=e.defineComponent({__name:"index",props:{modelValue:{type:null},dataType:{type:[String,Array]},disabled:Boolean,list:{type:Array},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value","change"],setup(h,{emit:g}){const l=h,u=e.ref(),a=e.ref(!1),c=e.ref(!1),r=e.ref([]),y=e.computed(()=>r.value.map(t=>d(t)).join(",")),p=e.computed(()=>{let t=l.dataType||"";return(v.getSonType(t)||[])[1]});e.watch(()=>l.modelValue,()=>{b()},{immediate:!0});function _(t=[]){return p.value=="string"?t.map(n=>v.getString(n)):p.value=="number"?t.map(n=>{let o=Number(n);return isNaN(o)&&(o=0),o}):t}function k(t){return new Function("",`{
1
+ "use strict";const e=require("vue"),S=require("../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.cjs"),v=require("../../util.cjs"),C={class:"form-select"},x=["value","disabled","onClick","onBlur"],A=["onMousemove","onMouseout"],j={class:"form-select-list"},O={key:0,class:"form-select-list-div"},T=["onClick"],q={key:1,class:"no-data"},L=e.defineComponent({__name:"index",props:{modelValue:{type:null},dataType:{type:[String,Array]},disabled:Boolean,list:{type:Array},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value","change"],setup(h,{emit:g}){const l=h,u=e.ref(),a=e.ref(!1),c=e.ref(!1),r=e.ref([]),y=e.computed(()=>r.value.map(t=>d(t)).join(",")),p=e.computed(()=>{let t=l.dataType||"";return(v.getSonType(t)||[])[1]});e.watch(()=>l.modelValue,()=>{b()},{immediate:!0});function _(t=[]){return p.value=="string"?t.map(n=>v.getString(n)):p.value=="number"?t.map(n=>{let o=Number(n);return isNaN(o)&&(o=0),o}):t}function k(t){return new Function("",`{
2
2
  var a = ${t};
3
3
  return a;
4
4
  }`)}function b(){r.value=[];let t=l.modelValue,n=[];const o=k(t);if(o instanceof Array&&(n=o),l.list)for(let i=0;i<l.list.length;i++){const f=l.list[i];n.includes(s(f))&&r.value.push(f)}m()}function d(t){var o;let n=(o=l.config)==null?void 0:o.label;return n&&typeof t=="object"&&t?t[n]:t}function s(t){var o;let n=(o=l.config)==null?void 0:o.prop;return n&&typeof t=="object"&&t?t[n]:t}function B(t){return r.value.map(n=>s(n)).includes(s(t))}function w(){l.disabled||(a.value=!0)}function M(){c.value||(a.value=!1)}function V(){c.value=!0}function E(){c.value=!1}function N(t){u.value&&u.value.focus(),r.value=S.toggleArray(r.value,t,l.config.prop),m()}function m(){let t=_(r.value.map(n=>s(n)));g("value",t,JSON.stringify(t))}return(t,n)=>(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("input",{value:e.unref(y),readonly:"",placeholder:"请选择",type:"text",disabled:l.disabled,ref_key:"refInput",ref:u,onClick:e.withModifiers(w,["stop"]),onBlur:e.withModifiers(M,["stop"])},null,40,x),e.createElementVNode("div",{onMousemove:e.withModifiers(V,["stop"]),onMouseout:e.withModifiers(E,["stop"]),class:"form-select-box"},[e.withDirectives(e.createElementVNode("div",j,[l.list&&l.list.length>0?(e.openBlock(),e.createElementBlock("div",O,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-select-list-li",{active:B(o)}]),onClick:e.withModifiers(f=>N(o),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(d(o)),1)],10,T))),256))])):(e.openBlock(),e.createElementBlock("div",q," 暂无数据 "))],512),[[e.vShow,a.value]])],40,A)]))}});module.exports=L;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as T, ref as c, computed as h, watch as L, openBlock as s, createElementBlock as i, createElementVNode as f, unref as z, withModifiers as u, withDirectives as D, Fragment as E, renderList as F, normalizeClass as I, toDisplayString as O, vShow as $ } from "vue";
2
- import { toggleArray as J } from "../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-18/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js";
2
+ import { toggleArray as J } from "../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.7-20/node_modules/@fangzhongya/utils/dist/chunk-GOJN3OQ4.js";
3
3
  import { getSonType as P, getString as q } from "../../util.js";
4
4
  const G = { class: "form-select" }, H = ["value", "disabled", "onClick", "onBlur"], K = ["onMousemove", "onMouseout"], Q = { class: "form-select-list" }, R = {
5
5
  key: 0,
@@ -1 +1 @@
1
- "use strict";const l=require("vue"),w=require("./retrie/index.vue.cjs"),C={key:0,class:"set-props"},j=l.defineComponent({__name:"set-props",props:{name:String,list:Array},emits:["change"],setup(d,{emit:_}){const i=d,p=l.ref({}),y=l.ref(0),c=l.ref({}),a=l.ref([]);function b(){var e;c.value={};const r=[];(e=i.list)==null||e.forEach(s=>{let t=s.name;if(t.includes(".")?t="":t=(t.split("/")[0]||"").trim(),t){let o=V(s.type),n="any";o.length==1&&(n=o[0].split("<")[0]),c.value[t]=(s.default||"").trim();let m=(s.selectable||"").trim();if(m&&n!="boolean"){let h=[];m.split(",").forEach(u=>{if(u){let E=u.split(":");h.push({label:u,prop:E[0].trim()})}}),p.value[t]=h,n=="function"?n="function":n=="array"?n="choice":n="select"}let x={label:g(t,s),prop:t,type:n,dataType:o,select:t};r.push(x)}}),a.value=r}function g(r,e){let s=r+": { "+(e.type||"any")+" } "+e.description;return e.default&&(s+=" 默认值="+e.default),e.selectable&&(s+=" 可选值="+e.selectable),s}function V(r){let e=[];return(r||"").trim().toLowerCase().split(",").forEach(t=>{t=t.trim(),t&&e.push(t)}),[...new Set(e)].sort()}function T(r,e){let s=Object.assign({},r);_("change",s,e)}let f;function k(){clearTimeout(f),f=setTimeout(()=>{b()},400)}return l.watch(()=>i.name,()=>{a.value=[],l.nextTick(()=>{k()})},{immediate:!0}),(r,e)=>a.value&&a.value.length>0?(l.openBlock(),l.createElementBlock("div",C,[l.createVNode(w,{refresh:y.value,modelValue:c.value,selects:p.value,list:a.value,name:i.name,onQuery:T},null,8,["refresh","modelValue","selects","list","name"])])):l.createCommentVNode("",!0)}});module.exports=j;
1
+ "use strict";const t=require("vue"),V=require("./retrie/index.vue.cjs"),T=require("./code.cjs"),k={key:0,class:"set-props"},x=t.defineComponent({__name:"set-props",props:{name:String,list:Array},emits:["change"],setup(i,{emit:p}){const c=i,u=t.ref({}),f=t.ref(0),a=t.ref({}),l=t.ref([]);function m(){var e;a.value={};const r=[];(e=c.list)==null||e.forEach(s=>{let n=s.name;if(n.includes(".")?n="":n=(n.split("/")[0]||"").trim(),n){a.value[n]=(s.default||"").trim();const{arr:y,type:v,dataType:b}=T.getSpecType(s);u.value[n]=y;let g={label:d(n,s),prop:n,type:v,dataType:b,select:n};r.push(g)}}),l.value=r}function d(r,e){let s=r+": { "+(e.type||"any")+" } "+e.description;return e.default&&(s+=" 默认值="+e.default),e.selectable&&(s+=" 可选值="+e.selectable),s}function _(r,e){let s=Object.assign({},r);p("change",s,e)}let o;function h(){clearTimeout(o),o=setTimeout(()=>{m()},400)}return t.watch(()=>c.name,()=>{l.value=[],t.nextTick(()=>{h()})},{immediate:!0}),(r,e)=>l.value&&l.value.length>0?(t.openBlock(),t.createElementBlock("div",k,[t.createVNode(V,{refresh:f.value,modelValue:a.value,selects:u.value,list:l.value,name:c.name,onQuery:_},null,8,["refresh","modelValue","selects","list","name"])])):t.createCommentVNode("",!0)}});module.exports=x;