@fangzhongya/vue-archive 0.0.75 → 0.0.77

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 (33) hide show
  1. package/dist/node/index.cjs +145 -108
  2. package/dist/node/index.js +145 -108
  3. package/dist/node/init.cjs +2 -4
  4. package/dist/node/init.js +0 -2
  5. package/dist/packages/components/use/code.cjs +12 -12
  6. package/dist/packages/components/use/code.d.ts +25 -17
  7. package/dist/packages/components/use/code.js +92 -92
  8. package/dist/packages/components/use/edit.cjs +5 -5
  9. package/dist/packages/components/use/edit.js +63 -63
  10. package/dist/packages/components/use/retrie/any/index.vue.cjs +1 -1
  11. package/dist/packages/components/use/retrie/any/index.vue.js +27 -49
  12. package/dist/packages/components/use/retrie/choice/index.d.ts +33 -2
  13. package/dist/packages/components/use/retrie/choice/index.vue.cjs +1 -1
  14. package/dist/packages/components/use/retrie/choice/index.vue.js +24 -27
  15. package/dist/packages/components/use/retrie/input/codemirror/codemirror.d.ts +0 -41
  16. package/dist/packages/components/use/retrie/input/editor/editor.cjs +1 -1
  17. package/dist/packages/components/use/retrie/input/editor/editor.d.ts +53 -4
  18. package/dist/packages/components/use/retrie/input/editor/editor.js +89 -20
  19. package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +2 -2
  20. package/dist/packages/components/use/retrie/input/editor/editor.vue.js +7 -7
  21. package/dist/packages/components/use/retrie/input/editor/getExtraLib.cjs +416 -0
  22. package/dist/packages/components/use/retrie/input/editor/getExtraLib.d.ts +2 -0
  23. package/dist/packages/components/use/retrie/input/editor/getExtraLib.js +427 -0
  24. package/dist/packages/components/use/retrie/other/index.d.ts +13 -12
  25. package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
  26. package/dist/packages/components/use/retrie/other/index.vue.js +1 -1
  27. package/dist/packages/components/use/retrie/select/index.d.ts +33 -2
  28. package/dist/packages/components/use/retrie/select/index.vue.cjs +1 -1
  29. package/dist/packages/components/use/retrie/select/index.vue.js +26 -26
  30. package/dist/packages/components/use/util.cjs +3 -3
  31. package/dist/packages/components/use/util.d.ts +23 -25
  32. package/dist/packages/components/use/util.js +161 -136
  33. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as d from "vue";
2
- import { defineComponent as h, defineAsyncComponent as C, resolveComponent as g, h as t, ref as x, onMounted as b } from "vue";
2
+ import { defineComponent as h, defineAsyncComponent as C, resolveComponent as g, h as n, ref as x, onMounted as b } from "vue";
3
3
  import j from "./code.vue.js";
4
- import v from "./retrie/input/index.vue.js";
4
+ import f from "./retrie/input/index.vue.js";
5
5
  /* empty css */
6
6
  import H from "./effect.vue.js";
7
7
  import { prettierHtml as $, prettierJs as k, prettierCss as V } from "./util.js";
@@ -25,24 +25,24 @@ const U = h({
25
25
  vueHtml: ""
26
26
  };
27
27
  },
28
- setup(a) {
29
- function f(o) {
30
- const c = document.getElementsByTagName("head")[0], r = "data-vite-dev-id", s = o + ".css", l = c.querySelector(`style[${r}="${s}"]`);
28
+ setup(u) {
29
+ function v(s) {
30
+ const c = document.getElementsByTagName("head")[0], r = "data-vite-dev-id", o = s + ".css", l = c.querySelector(`style[${r}="${o}"]`);
31
31
  if (l)
32
32
  return l;
33
33
  {
34
34
  let e = document.createElement("style");
35
- return e.appendChild(document.createTextNode("")), e.setAttribute("type", "text/css"), e.setAttribute(r, s), c.appendChild(e), e;
35
+ return e.appendChild(document.createTextNode("")), e.setAttribute("type", "text/css"), e.setAttribute(r, o), c.appendChild(e), e;
36
36
  }
37
37
  }
38
- async function u(o, c = "", r) {
39
- const s = [], l = a.value?.name;
38
+ async function a(s, c = "", r) {
39
+ const o = [], l = u.value?.name;
40
40
  let e = "";
41
41
  Object.keys(d).forEach((y) => {
42
- c.includes(y + "(") && s.push(y);
43
- }), s.length > 0 && (e = `import { ${s.join(" , ")} } from 'vue';`);
42
+ c.includes(y + "(") && o.push(y);
43
+ }), o.length > 0 && (e = `import { ${o.join(" , ")} } from 'vue';`);
44
44
  let m = `<template>
45
- ${o}
45
+ ${s}
46
46
  </template>`;
47
47
  m = await $(m);
48
48
  let p = `${e}
@@ -61,93 +61,93 @@ ${r}
61
61
  </style>
62
62
  `;
63
63
  }
64
- function i(o, c, r) {
64
+ function i(s, c, r) {
65
65
  try {
66
- const s = Object.keys(d);
66
+ const o = Object.keys(d);
67
67
  return new Function(
68
68
  "props",
69
69
  "ctx",
70
70
  "vue",
71
71
  ` "use strict";
72
- const { ${s.join(",")} } = vue;
73
- ${o}; `
72
+ const { ${o.join(",")} } = vue;
73
+ ${s}; `
74
74
  )(c, r, d);
75
- } catch (s) {
76
- console.error("Code block execution failed:", s);
75
+ } catch (o) {
76
+ console.error("Code block execution failed:", o);
77
77
  }
78
78
  }
79
- const n = x(null);
79
+ const t = x(null);
80
80
  return b(() => {
81
- n.value = f(a.value?.key);
81
+ t.value = v(u.value?.key);
82
82
  }), {
83
- getHmtlVue: u,
83
+ getHmtlVue: a,
84
84
  getCodeBlock: i,
85
- style: n
85
+ style: t
86
86
  };
87
87
  },
88
- render(a, f, u, i, n) {
89
- const o = u.value || {};
88
+ render(u, v, a, i, t) {
89
+ const s = a.value || {};
90
90
  let c = "div";
91
- o.component ? c = C(o.component) : o.name && (c = g(o.name));
91
+ s.component ? c = C(s.component) : s.name && (c = g(s.name));
92
92
  const r = {};
93
- r[o.name] = c;
94
- const s = async () => {
93
+ r[s.name] = c;
94
+ const o = async () => {
95
95
  const e = await i.getHmtlVue(
96
- n.template,
97
- n.script,
98
- n.style
96
+ t.template,
97
+ t.script,
98
+ t.style
99
99
  );
100
- n.vueHtml = e;
100
+ t.vueHtml = e;
101
101
  }, l = () => {
102
- i.style.innerHTML = n.style, s();
102
+ i.style.innerHTML = t.style, o();
103
103
  };
104
- return t(
104
+ return n(
105
105
  "div",
106
106
  {
107
107
  class: "code-edit"
108
108
  },
109
109
  [
110
- t(
110
+ n(
111
111
  "div",
112
112
  {
113
113
  class: "edit-effect use"
114
114
  },
115
115
  [
116
- t(
116
+ n(
117
117
  H,
118
118
  {
119
119
  class: "use-component"
120
120
  },
121
121
  {
122
- default: () => t(
122
+ default: () => n(
123
123
  h({
124
124
  components: r,
125
125
  setup(e, m) {
126
126
  return i.getCodeBlock(
127
- n.script,
127
+ t.script,
128
128
  e,
129
129
  m
130
130
  );
131
131
  },
132
- template: n.template || "<div></div>"
132
+ template: t.template || "<div></div>"
133
133
  })
134
134
  )
135
135
  }
136
136
  ),
137
- t(j, {
138
- html: n.vueHtml,
139
- name: o.name + "_edit",
140
- onRefresh: s
137
+ n(j, {
138
+ html: t.vueHtml,
139
+ name: s.name + "_edit",
140
+ onRefresh: o
141
141
  })
142
142
  ]
143
143
  ),
144
- t(
144
+ n(
145
145
  "div",
146
146
  {
147
147
  class: "edit-input"
148
148
  },
149
149
  [
150
- t(
150
+ n(
151
151
  "div",
152
152
  {
153
153
  class: "but-div",
@@ -155,50 +155,50 @@ ${r}
155
155
  },
156
156
  "运行"
157
157
  ),
158
- t("div", {}, [
159
- t("div", {}, "template"),
160
- t(
158
+ n("div", {}, [
159
+ n("div", {}, "template"),
160
+ n(
161
161
  "div",
162
162
  {},
163
- t(v, {
163
+ n(f, {
164
164
  format: "html",
165
165
  check: (e) => e,
166
- options: [o.name],
167
- modelValue: n.template,
166
+ options: [s.name],
167
+ modelValue: t.template,
168
168
  "onUpdate:modelValue": async (e) => {
169
- n.template = await $(e);
169
+ t.template = e, t.template = await $(e);
170
170
  }
171
171
  })
172
172
  )
173
173
  ]),
174
- t("div", {}, [
175
- t("div", {}, "script"),
176
- t("div", {}, "setup(props, ctx)"),
177
- t(
174
+ n("div", {}, [
175
+ n("div", {}, "script"),
176
+ n("div", {}, "setup(props, ctx)"),
177
+ n(
178
178
  "div",
179
179
  {},
180
- t(v, {
180
+ n(f, {
181
181
  format: "js",
182
182
  check: (e) => e,
183
183
  options: ["props", "ctx"],
184
- modelValue: n.script,
184
+ modelValue: t.script,
185
185
  "onUpdate:modelValue": async (e) => {
186
- n.script = await k(e);
186
+ t.script = e, t.script = await k(e);
187
187
  }
188
188
  })
189
189
  )
190
190
  ]),
191
- t("div", {}, [
192
- t("div", {}, "style"),
193
- t(
191
+ n("div", {}, [
192
+ n("div", {}, "style"),
193
+ n(
194
194
  "div",
195
195
  {},
196
- t(v, {
196
+ n(f, {
197
197
  format: "css",
198
198
  check: (e) => e,
199
- modelValue: n.style,
199
+ modelValue: t.style,
200
200
  "onUpdate:modelValue": async (e) => {
201
- n.style = await V(e);
201
+ t.style = e, t.style = await V(e);
202
202
  }
203
203
  })
204
204
  )
@@ -1 +1 @@
1
- "use strict";const n=require("vue"),p=require("../../util.cjs"),V=require("../form/index.vue.cjs"),h=require("../select/index.vue.cjs");;/* empty css */const j={class:"form-any"},x=n.defineComponent({__name:"index",props:{selects:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}},modelValue:{type:null}},emits:["change"],setup(f,{emit:d}){const o=f,r=n.ref([]),u=n.ref({}),m=d,s=n.ref(""),_=[{label:"string",prop:"string"},{label:"boolean",prop:"boolean"},{label:"number",prop:"number"},{label:"array",prop:"array"},{label:"object",prop:"object"},{label:"function",prop:"function"},{label:"其他",prop:""}];n.watch(()=>o.modelValue,()=>{b()},{immediate:!0});function g(e){for(let l=0;l<r.value.length;l++){const t=r.value[l].prop;if(t===e||t.startsWith(e))return t}}function c(e,l){let t=Object.assign({},o.config);if(l){const i=g(l);i&&(e=i)}let a=p.getSonType(e);t.type=a[0],t.dataType=e,u.value=t}function b(){let e=[];const l=o.config.dataType||[];if(l&&l.length>1)e=l.map(t=>{const a=t.split("<")[0];return{label:t,prop:a.toLowerCase()}});else{let t=l[0];if(t&&t!="any"){const a=t.split("<")[0];e=[{label:t,prop:a.toLowerCase()}]}else e=_}r.value=e,c(e[0].prop,p.isDefaultType(o.modelValue)),s.value=o.modelValue}function v(e){c(e),s.value=""}function y(...e){m("change",...e)}return(e,l)=>(n.openBlock(),n.createElementBlock("div",j,[n.createElementVNode("div",null,[n.createVNode(h,{noValue:"",onChange:v,modelValue:u.value.type,list:r.value},null,8,["modelValue","list"])]),n.createVNode(V,{config:u.value,selects:o.selects,modelValue:s.value,onChange:y},null,8,["config","selects","modelValue"])]))}});module.exports=x;
1
+ "use strict";const t=require("vue"),p=require("../../util.cjs"),v=require("../form/index.vue.cjs"),y=require("../select/index.vue.cjs");;/* empty css */const V={class:"form-any"},h=t.defineComponent({__name:"index",props:{selects:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}},modelValue:{type:null}},emits:["change"],setup(f,{emit:d}){const o=f,r=t.ref([]),u=t.ref({}),m=d,s=t.ref(""),c=[{label:"string",prop:"string"},{label:"boolean",prop:"boolean"},{label:"number",prop:"number"},{label:"array",prop:"array"},{label:"object",prop:"object"},{label:"function",prop:"function"},{label:"其他",prop:""}];t.watch(()=>o.modelValue,()=>{_()},{immediate:!0});function i(e,l){let a=Object.assign({},o.config);l?a.type=l:a.type=e,a.dataType=r.value,u.value=a}function _(){let e=[];const l=o.config.dataType||[];l&&l.length>0?(e=l.map(n=>typeof n=="string"?{label:n,prop:n.toLowerCase()}:{label:n.label,prop:p.getDataTypeType([n])}),e.map(n=>n.prop).includes("any")&&(e=[...c])):e=[...c],r.value=e,i(e[0].prop,p.isDefaultType(o.modelValue)),s.value=o.modelValue}function b(e){i(e),s.value=""}function g(...e){m("change",...e)}return(e,l)=>(t.openBlock(),t.createElementBlock("div",V,[t.createElementVNode("div",null,[t.createVNode(y,{noValue:"",onChange:b,modelValue:u.value.type,list:r.value},null,8,["modelValue","list"])]),t.createVNode(v,{config:u.value,selects:o.selects,modelValue:s.value,onChange:g},null,8,["config","selects","modelValue"])]))}});module.exports=h;
@@ -1,9 +1,9 @@
1
- import { defineComponent as h, ref as s, watch as v, createElementBlock as j, openBlock as C, createElementVNode as T, createVNode as u } from "vue";
2
- import { isDefaultType as x, getSonType as w } from "../../util.js";
3
- import L from "../form/index.vue.js";
1
+ import { defineComponent as V, ref as s, watch as _, createElementBlock as v, openBlock as h, createElementVNode as j, createVNode as u } from "vue";
2
+ import { getDataTypeType as T, isDefaultType as C } from "../../util.js";
3
+ import x from "../form/index.vue.js";
4
4
  import O from "../select/index.vue.js";
5
5
  /* empty css */
6
- const k = { class: "form-any" }, D = /* @__PURE__ */ h({
6
+ const k = { class: "form-any" }, N = /* @__PURE__ */ V({
7
7
  __name: "index",
8
8
  props: {
9
9
  /**
@@ -29,8 +29,8 @@ const k = { class: "form-any" }, D = /* @__PURE__ */ h({
29
29
  }
30
30
  },
31
31
  emits: ["change"],
32
- setup(f, { emit: m }) {
33
- const o = f, a = s([]), r = s({}), d = m, c = s(""), b = [
32
+ setup(m, { emit: f }) {
33
+ const o = m, n = s([]), r = s({}), d = f, c = s(""), i = [
34
34
  {
35
35
  label: "string",
36
36
  prop: "string"
@@ -60,76 +60,54 @@ const k = { class: "form-any" }, D = /* @__PURE__ */ h({
60
60
  prop: ""
61
61
  }
62
62
  ];
63
- v(
63
+ _(
64
64
  () => o.modelValue,
65
65
  () => {
66
- V();
66
+ b();
67
67
  },
68
68
  {
69
69
  immediate: !0
70
70
  }
71
71
  );
72
- function g(e) {
73
- for (let l = 0; l < a.value.length; l++) {
74
- const t = a.value[l].prop;
75
- if (t === e || t.startsWith(e))
76
- return t;
77
- }
78
- }
79
72
  function p(e, l) {
80
- let t = Object.assign({}, o.config);
81
- if (l) {
82
- const i = g(l);
83
- i && (e = i);
84
- }
85
- let n = w(e);
86
- t.type = n[0], t.dataType = e, r.value = t;
73
+ let a = Object.assign({}, o.config);
74
+ l ? a.type = l : a.type = e, a.dataType = n.value, r.value = a;
87
75
  }
88
- function V() {
76
+ function b() {
89
77
  let e = [];
90
78
  const l = o.config.dataType || [];
91
- if (l && l.length > 1)
92
- e = l.map((t) => {
93
- const n = t.split("<")[0];
94
- return {
95
- label: t,
96
- prop: n.toLowerCase()
97
- };
98
- });
99
- else {
100
- let t = l[0];
101
- if (t && t != "any") {
102
- const n = t.split("<")[0];
103
- e = [{ label: t, prop: n.toLowerCase() }];
104
- } else
105
- e = b;
106
- }
107
- a.value = e, p(e[0].prop, x(o.modelValue)), c.value = o.modelValue;
79
+ l && l.length > 0 ? (e = l.map((t) => typeof t == "string" ? {
80
+ label: t,
81
+ prop: t.toLowerCase()
82
+ } : {
83
+ label: t.label,
84
+ prop: T([t])
85
+ }), e.map((t) => t.prop).includes("any") && (e = [...i])) : e = [...i], n.value = e, p(e[0].prop, C(o.modelValue)), c.value = o.modelValue;
108
86
  }
109
- function y(e) {
87
+ function g(e) {
110
88
  p(e), c.value = "";
111
89
  }
112
- function _(...e) {
90
+ function y(...e) {
113
91
  d("change", ...e);
114
92
  }
115
- return (e, l) => (C(), j("div", k, [
116
- T("div", null, [
93
+ return (e, l) => (h(), v("div", k, [
94
+ j("div", null, [
117
95
  u(O, {
118
96
  noValue: "",
119
- onChange: y,
97
+ onChange: g,
120
98
  modelValue: r.value.type,
121
- list: a.value
99
+ list: n.value
122
100
  }, null, 8, ["modelValue", "list"])
123
101
  ]),
124
- u(L, {
102
+ u(x, {
125
103
  config: r.value,
126
104
  selects: o.selects,
127
105
  modelValue: c.value,
128
- onChange: _
106
+ onChange: y
129
107
  }, null, 8, ["config", "selects", "modelValue"])
130
108
  ]));
131
109
  }
132
110
  });
133
111
  export {
134
- D as default
112
+ N as default
135
113
  };
@@ -1,10 +1,26 @@
1
+ import { DataType } from '../../util';
1
2
  import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../../../vue/dist/vue.esm-bundler.js';
2
3
  declare const _default: DefineComponent<ExtractPropTypes<{
3
4
  modelValue: {
4
5
  type: null;
5
6
  };
6
7
  dataType: {
7
- type: (ArrayConstructor | StringConstructor)[];
8
+ type: {
9
+ (arrayLength: number): DataType[];
10
+ (...items: DataType[]): DataType[];
11
+ new (arrayLength: number): DataType[];
12
+ new (...items: DataType[]): DataType[];
13
+ isArray(arg: any): arg is any[];
14
+ readonly prototype: any[];
15
+ from<T>(arrayLike: ArrayLike<T>): T[];
16
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
17
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
18
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
19
+ of<T>(...items: T[]): T[];
20
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
21
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
22
+ readonly [Symbol.species]: ArrayConstructor;
23
+ }[];
8
24
  };
9
25
  disabled: BooleanConstructor;
10
26
  list: {
@@ -25,7 +41,22 @@ declare const _default: DefineComponent<ExtractPropTypes<{
25
41
  type: null;
26
42
  };
27
43
  dataType: {
28
- type: (ArrayConstructor | StringConstructor)[];
44
+ type: {
45
+ (arrayLength: number): DataType[];
46
+ (...items: DataType[]): DataType[];
47
+ new (arrayLength: number): DataType[];
48
+ new (...items: DataType[]): DataType[];
49
+ isArray(arg: any): arg is any[];
50
+ readonly prototype: any[];
51
+ from<T>(arrayLike: ArrayLike<T>): T[];
52
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
53
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
54
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
55
+ of<T>(...items: T[]): T[];
56
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
57
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
58
+ readonly [Symbol.species]: ArrayConstructor;
59
+ }[];
29
60
  };
30
61
  disabled: BooleanConstructor;
31
62
  list: {
@@ -1 +1 @@
1
- "use strict";const e=require("vue");require("@fangzhongya/utils/basic/object/mergeObject");const N=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");const v=require("../../util.cjs"),C={class:"form-select"},x=["value","disabled"],A={class:"form-select-list"},j={key:0,class:"form-select-list-div"},T=["onClick"],L={key:1,class:"no-data"},z=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(g,{emit:h}){const n=g,y=h,u=e.ref(),a=e.ref(!1),c=e.ref(!1),o=e.ref([]),_=e.computed(()=>o.value.map(t=>d(t)).join(",")),p=e.computed(()=>{let t=n.dataType||"";return(v.getSonType(t)||[])[1]});e.watch(()=>n.modelValue,()=>{q()},{immediate:!0});function k(t=[]){return p.value=="string"?t.map(l=>v.getString(l)):p.value=="number"?t.map(l=>{let r=Number(l);return isNaN(r)&&(r=0),r}):t}function b(t){return new Function("",`{ return ${t}}`)}function q(){o.value=[];let t=n.modelValue,l=[];const r=b(t);if(r instanceof Array&&(l=r),n.list)for(let s=0;s<n.list.length;s++){const f=n.list[s];l.includes(i(f))&&o.value.push(f)}m()}function d(t){let l=n.config?.label;return l&&typeof t=="object"&&t?t[l]:t}function i(t){let l=n.config?.prop;return l&&typeof t=="object"&&t?t[l]:t}function B(t){return o.value.map(l=>i(l)).includes(i(t))}function w(){n.disabled||(a.value=!0)}function V(){c.value||(a.value=!1)}function E(){c.value=!0}function M(){c.value=!1}function S(t){u.value&&u.value.focus(),o.value=N.toggleArray(o.value,t,n.config.prop),m()}function m(){let t=k(o.value.map(l=>i(l)));y("value",t,JSON.stringify(t))}return(t,l)=>(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("input",{value:_.value,readonly:"",placeholder:"请选择",type:"text",disabled:n.disabled,ref_key:"refInput",ref:u,onClick:e.withModifiers(w,["stop"]),onBlur:e.withModifiers(V,["stop"])},null,40,x),e.createElementVNode("div",{onMousemove:e.withModifiers(E,["stop"]),onMouseout:e.withModifiers(M,["stop"]),class:"form-select-box"},[e.withDirectives(e.createElementVNode("div",A,[n.list&&n.list.length>0?(e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-select-list-li",{active:B(r)}]),onClick:e.withModifiers(f=>S(r),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(d(r)),1)],10,T))),256))])):(e.openBlock(),e.createElementBlock("div",L,"暂无数据"))],512),[[e.vShow,a.value]])],32)]))}});module.exports=z;
1
+ "use strict";const e=require("vue");require("@fangzhongya/utils/basic/object/mergeObject");const C=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");const v=require("../../util.cjs"),S={class:"form-select"},x=["value","disabled"],A={class:"form-select-list"},T={key:0,class:"form-select-list-div"},j=["onClick"],D={key:1,class:"no-data"},L=e.defineComponent({__name:"index",props:{modelValue:{type:null},dataType:{type:[Array]},disabled:Boolean,list:{type:Array},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value","change"],setup(h,{emit:y}){const n=h,g=y,u=e.ref(),a=e.ref(!1),c=e.ref(!1),r=e.ref([]),_=e.computed(()=>r.value.map(t=>d(t)).join(",")),p=e.computed(()=>v.getDataTypeType(n.dataType||[]));e.watch(()=>n.modelValue,()=>{q()},{immediate:!0});function k(t=[]){return p.value=="string"?t.map(l=>v.getString(l)):p.value=="number"?t.map(l=>{let o=Number(l);return isNaN(o)&&(o=0),o}):t}function b(t){return new Function("",`{ return ${t}}`)}function q(){r.value=[];let t=n.modelValue,l=[];const o=b(t);if(o instanceof Array&&(l=o),n.list)for(let s=0;s<n.list.length;s++){const f=n.list[s];l.includes(i(f))&&r.value.push(f)}m()}function d(t){let l=n.config?.label;return l&&typeof t=="object"&&t?t[l]:t}function i(t){let l=n.config?.prop;return l&&typeof t=="object"&&t?t[l]:t}function B(t){return r.value.map(l=>i(l)).includes(i(t))}function w(){n.disabled||(a.value=!0)}function V(){c.value||(a.value=!1)}function E(){c.value=!0}function M(){c.value=!1}function N(t){u.value&&u.value.focus(),r.value=C.toggleArray(r.value,t,n.config.prop),m()}function m(){let t=k(r.value.map(l=>i(l)));g("value",t,JSON.stringify(t))}return(t,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("input",{value:_.value,readonly:"",placeholder:"请选择",type:"text",disabled:n.disabled,ref_key:"refInput",ref:u,onClick:e.withModifiers(w,["stop"]),onBlur:e.withModifiers(V,["stop"])},null,40,x),e.createElementVNode("div",{onMousemove:e.withModifiers(E,["stop"]),onMouseout:e.withModifiers(M,["stop"]),class:"form-select-box"},[e.withDirectives(e.createElementVNode("div",A,[n.list&&n.list.length>0?(e.openBlock(),e.createElementBlock("div",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.list,(o,s)=>(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,j))),256))])):(e.openBlock(),e.createElementBlock("div",D,"暂无数据"))],512),[[e.vShow,a.value]])],32)]))}});module.exports=L;
@@ -1,4 +1,4 @@
1
- import { defineComponent as L, ref as c, computed as _, watch as z, createElementBlock as r, openBlock as i, createElementVNode as p, withModifiers as s, withDirectives as D, Fragment as E, renderList as F, normalizeClass as I, toDisplayString as O, vShow as $ } from "vue";
1
+ import { defineComponent as D, ref as c, computed as _, watch as L, createElementBlock as i, openBlock as r, createElementVNode as p, withModifiers as s, withDirectives as z, Fragment as E, renderList as F, normalizeClass as I, toDisplayString as O, vShow as $ } from "vue";
2
2
  import "@fangzhongya/utils/basic/object/mergeObject";
3
3
  import { toggleArray as J } from "@fangzhongya/utils/basic/array/toggleArray";
4
4
  import "@fangzhongya/utils/name/humpToLine";
@@ -10,20 +10,20 @@ import "@fangzhongya/utils/basic/array/asyncMergeArray";
10
10
  import "@fangzhongya/utils/basic/string/firstUpper";
11
11
  import "@fangzhongya/utils/urls/getSuffix";
12
12
  import "@fangzhongya/utils/basic/array/replaceAfter";
13
- import { getSonType as P, getString as q } from "../../util.js";
13
+ import { getDataTypeType as P, getString as q } from "../../util.js";
14
14
  const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "form-select-list" }, Q = {
15
15
  key: 0,
16
16
  class: "form-select-list-div"
17
17
  }, R = ["onClick"], U = {
18
18
  key: 1,
19
19
  class: "no-data"
20
- }, ae = /* @__PURE__ */ L({
20
+ }, ae = /* @__PURE__ */ D({
21
21
  __name: "index",
22
22
  props: {
23
23
  modelValue: {
24
24
  type: null
25
25
  },
26
- dataType: { type: [String, Array] },
26
+ dataType: { type: [Array] },
27
27
  disabled: Boolean,
28
28
  list: {
29
29
  type: Array
@@ -40,11 +40,8 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
40
40
  },
41
41
  emits: ["value", "change"],
42
42
  setup(b, { emit: k }) {
43
- const o = b, S = k, f = c(), m = c(!1), d = c(!1), l = c([]), V = _(() => l.value.map((e) => y(e)).join(",")), g = _(() => {
44
- let e = o.dataType || "";
45
- return (P(e) || [])[1];
46
- });
47
- z(
43
+ const o = b, V = k, f = c(), m = c(!1), d = c(!1), l = c([]), w = _(() => l.value.map((e) => g(e)).join(",")), y = _(() => P(o.dataType || []));
44
+ L(
48
45
  () => o.modelValue,
49
46
  () => {
50
47
  x();
@@ -53,19 +50,19 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
53
50
  immediate: !0
54
51
  }
55
52
  );
56
- function w(e = []) {
57
- return g.value == "string" ? e.map((t) => q(t)) : g.value == "number" ? e.map((t) => {
53
+ function C(e = []) {
54
+ return y.value == "string" ? e.map((t) => q(t)) : y.value == "number" ? e.map((t) => {
58
55
  let n = Number(t);
59
56
  return isNaN(n) && (n = 0), n;
60
57
  }) : e;
61
58
  }
62
- function C(e) {
59
+ function S(e) {
63
60
  return new Function("", `{ return ${e}}`);
64
61
  }
65
62
  function x() {
66
63
  l.value = [];
67
64
  let e = o.modelValue, t = [];
68
- const n = C(e);
65
+ const n = S(e);
69
66
  if (n instanceof Array && (t = n), o.list)
70
67
  for (let a = 0; a < o.list.length; a++) {
71
68
  const v = o.list[a];
@@ -73,7 +70,7 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
73
70
  }
74
71
  h();
75
72
  }
76
- function y(e) {
73
+ function g(e) {
77
74
  let t = o.config?.label;
78
75
  return t && typeof e == "object" && e ? e[t] : e;
79
76
  }
@@ -93,21 +90,21 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
93
90
  function N() {
94
91
  d.value = !0;
95
92
  }
96
- function j() {
93
+ function T() {
97
94
  d.value = !1;
98
95
  }
99
- function T(e) {
96
+ function j(e) {
100
97
  f.value && f.value.focus(), l.value = J(l.value, e, o.config.prop), h();
101
98
  }
102
99
  function h() {
103
- let e = w(
100
+ let e = C(
104
101
  l.value.map((t) => u(t))
105
102
  );
106
- S("value", e, JSON.stringify(e));
103
+ V("value", e, JSON.stringify(e));
107
104
  }
108
- return (e, t) => (i(), r("div", G, [
105
+ return (e, t) => (r(), i("div", G, [
109
106
  p("input", {
110
- value: V.value,
107
+ value: w.value,
111
108
  readonly: "",
112
109
  placeholder: "请选择",
113
110
  type: "text",
@@ -119,20 +116,20 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
119
116
  }, null, 40, H),
120
117
  p("div", {
121
118
  onMousemove: s(N, ["stop"]),
122
- onMouseout: s(j, ["stop"]),
119
+ onMouseout: s(T, ["stop"]),
123
120
  class: "form-select-box"
124
121
  }, [
125
- D(p("div", K, [
126
- o.list && o.list.length > 0 ? (i(), r("div", Q, [
127
- (i(!0), r(E, null, F(o.list, (n, a) => (i(), r("div", {
122
+ z(p("div", K, [
123
+ o.list && o.list.length > 0 ? (r(), i("div", Q, [
124
+ (r(!0), i(E, null, F(o.list, (n, a) => (r(), i("div", {
128
125
  class: I(["form-select-list-li", {
129
126
  active: A(n)
130
127
  }]),
131
- onClick: s((v) => T(n), ["stop"])
128
+ onClick: s((v) => j(n), ["stop"])
132
129
  }, [
133
- p("span", null, O(y(n)), 1)
130
+ p("span", null, O(g(n)), 1)
134
131
  ], 10, R))), 256))
135
- ])) : (i(), r("div", U, "暂无数据"))
132
+ ])) : (r(), i("div", U, "暂无数据"))
136
133
  ], 512), [
137
134
  [$, m.value]
138
135
  ])
@@ -16,44 +16,3 @@ export declare function getHtml(parent: Element, obj: CreateStateOptions): Edito
16
16
  export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
17
17
  export declare function getCss(parent: Element, obj: CreateStateOptions): EditorView;
18
18
  export {};
19
- >): Promise<T[]>;
20
- fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
21
- readonly [Symbol.species]: ArrayConstructor;
22
- };
23
- };
24
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
25
- "update:modelValue": (...args: any[]) => void;
26
- }, string, PublicProps, Readonly< ExtractPropTypes<{
27
- modelValue: {
28
- type: StringConstructor;
29
- default: string;
30
- };
31
- format: {
32
- type: StringConstructor;
33
- };
34
- options: {
35
- type: {
36
- (arrayLength: number): string[];
37
- (...items: string[]): string[];
38
- new (arrayLength: number): string[];
39
- new (...items: string[]): string[];
40
- isArray(arg: any): arg is any[];
41
- readonly prototype: any[];
42
- from<T>(arrayLike: ArrayLike<T>): T[];
43
- from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
44
- from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
45
- from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
46
- of<T>(...items: T[]): T[];
47
- fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
48
- fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
49
- readonly [Symbol.species]: ArrayConstructor;
50
- };
51
- };
52
- }>> & Readonly<{
53
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
54
- }>, {
55
- modelValue: string;
56
- }, {}, {}, {}, string, ComponentProvideOptions, true, {
57
- refText: HTMLDivElement;
58
- }, HTMLDivElement>;
59
- export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("monaco-editor");function u(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=u(a),o={theme:"vs",value:""};function g(e,t){return r.editor.create(e,{...o,value:t,language:"typescript"})}function s(e,t){return r.editor.create(e,{...o,value:t,language:"html"})}function i(e,t){return r.editor.create(e,{...o,value:t,language:"json"})}function l(e,t){return r.editor.create(e,{...o,value:t,language:"css"})}exports.getCss=l;exports.getHtml=s;exports.getJs=g;exports.getJson=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("monaco-editor"),o=require("monaco-editor/esm/vs/editor/editor.api"),g=require("vue"),l=require("./getExtraLib.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=c(u),m=c(g),i={theme:"vs",value:""},p=(e=[])=>({provideCompletionItems:(r,t)=>({suggestions:e.map(s=>({label:s,kind:n.languages.CompletionItemKind.Text,insertText:"<"+s+">${1:}</"+s+">",insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:s+"组件",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["<","$"]});function d(e){return["props","ctx"].includes(e)?e+".${1:}":e+"(${1:})"}const f=(e=[])=>(e&&e.length>0&&(e=["props","ctx",...Object.keys(m)]),{provideCompletionItems:(r,t)=>({suggestions:e.map(s=>({label:s,kind:n.languages.CompletionItemKind.Text,insertText:d(s),insertTextRules:n.languages.CompletionItemInsertTextRule.InsertAsSnippet,detail:s+"方法",range:new n.Range(t.lineNumber,t.column-1,t.lineNumber,t.column)}))}),triggerCharacters:["$"]});function b(e,r,t="typescript"){const a=n.Uri.parse(`file:///editor-${Date.now()}.ts`),s=n.editor.createModel(r,t,a);return n.editor.create(e,{...i,value:r,model:s,language:t,minimap:{enabled:!1},theme:"vs",fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0})}function y(e,r,t){if(o.languages.typescript.typescriptDefaults.setEagerModelSync(!0),t&&t?.length>0){const a=f(t);o.languages.registerCompletionItemProvider("typescript",a),o.languages.typescript.typescriptDefaults.setExtraLibs([]),o.languages.typescript.typescriptDefaults.addExtraLib(l.getGlobals(),"globals.d.ts"),o.languages.typescript.typescriptDefaults.addExtraLib(l.getVue(),"vue.d.ts")}return b(e,r,"typescript")}function v(e,r,t){const a=p(t);return o.languages.registerCompletionItemProvider("html",a),n.editor.create(e,{...i,value:r,language:"html"})}function x(e,r,t){return n.editor.create(e,{...i,value:r,language:"json"})}function I(e,r,t){return n.editor.create(e,{...i,value:r,language:"css"})}exports.getCss=I;exports.getHtml=v;exports.getJs=y;exports.getJson=x;