@fangzhongya/vue-archive 0.0.69 → 0.0.71

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 (65) hide show
  1. package/README.md +0 -2
  2. package/dist/index.css +2 -2
  3. package/dist/node/index.cjs +448 -358
  4. package/dist/node/index.d.cts +2 -0
  5. package/dist/node/index.d.ts +2 -0
  6. package/dist/node/index.js +445 -358
  7. package/dist/packages/components/use/code.cjs +15 -16
  8. package/dist/packages/components/use/code.d.ts +25 -17
  9. package/dist/packages/components/use/code.js +76 -74
  10. package/dist/packages/components/use/edit.cjs +11 -11
  11. package/dist/packages/components/use/edit.d.ts +1 -1
  12. package/dist/packages/components/use/edit.js +119 -94
  13. package/dist/packages/components/use/prettier.cjs +1 -0
  14. package/dist/packages/components/use/prettier.d.ts +1 -4
  15. package/dist/packages/components/use/prettier.js +40 -0
  16. package/dist/packages/components/use/retrie/array/index.vue.cjs +2 -2
  17. package/dist/packages/components/use/retrie/array/index.vue.js +17 -16
  18. package/dist/packages/components/use/retrie/function/index.vue.cjs +2 -2
  19. package/dist/packages/components/use/retrie/function/index.vue.js +22 -20
  20. package/dist/packages/components/use/retrie/input/codemirror/codemirror.cjs +3 -0
  21. package/dist/packages/components/use/retrie/input/codemirror/codemirror.js +58 -0
  22. package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.cjs +1 -0
  23. package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.js +62 -0
  24. package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.cjs +1 -0
  25. package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.js +5 -0
  26. package/dist/packages/components/use/retrie/input/editor/editor.cjs +3 -0
  27. package/dist/packages/components/use/retrie/input/{codemirror.d.ts → editor/editor.d.ts} +9 -9
  28. package/dist/packages/components/use/retrie/input/editor/editor.js +39 -0
  29. package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +1 -0
  30. package/dist/packages/components/use/retrie/input/editor/editor.vue.js +53 -0
  31. package/dist/packages/components/use/retrie/input/editor/editor.vue3.cjs +1 -0
  32. package/dist/packages/components/use/retrie/input/editor/editor.vue3.js +5 -0
  33. package/dist/packages/components/use/retrie/input/editor/init.cjs +1 -0
  34. package/dist/packages/components/use/retrie/input/editor/init.d.ts +1 -0
  35. package/dist/packages/components/use/retrie/input/editor/init.js +16 -0
  36. package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
  37. package/dist/packages/components/use/retrie/input/index.vue.js +25 -15
  38. package/dist/packages/components/use/retrie/input/text.vue.cjs +1 -1
  39. package/dist/packages/components/use/retrie/input/text.vue.js +21 -13
  40. package/dist/packages/components/use/retrie/number/index.vue.cjs +1 -1
  41. package/dist/packages/components/use/retrie/number/index.vue.js +24 -22
  42. package/dist/packages/components/use/retrie/object/index.vue.cjs +2 -2
  43. package/dist/packages/components/use/retrie/object/index.vue.js +15 -14
  44. package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
  45. package/dist/packages/components/use/retrie/other/index.vue.js +17 -16
  46. package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
  47. package/dist/packages/components/use/retrie/slot/index.vue.js +19 -17
  48. package/dist/packages/components/use/retrie/string/index.vue.cjs +1 -1
  49. package/dist/packages/components/use/retrie/string/index.vue.js +20 -18
  50. package/dist/packages/components/use/set-code.vue.cjs +1 -1
  51. package/dist/packages/components/use/set-code.vue.js +7 -7
  52. package/dist/packages/components/use/util.cjs +3 -3
  53. package/dist/packages/components/use/util.d.ts +10 -5
  54. package/dist/packages/components/use/util.js +88 -62
  55. package/dist/packages/config.d.ts +3 -1
  56. package/dist/packages/page/edit/index.vue2.cjs +1 -1
  57. package/dist/packages/page/edit/index.vue2.js +11 -7
  58. package/package.json +3 -2
  59. package/dist/packages/components/use/codemirror.cjs +0 -3
  60. package/dist/packages/components/use/codemirror.js +0 -31
  61. package/dist/packages/components/use/retrie/input/codemirror.vue.cjs +0 -1
  62. package/dist/packages/components/use/retrie/input/codemirror.vue.js +0 -43
  63. package/dist/packages/components/use/retrie/input/codemirror.vue2.cjs +0 -1
  64. package/dist/packages/components/use/retrie/input/codemirror.vue2.js +0 -4
  65. /package/dist/packages/components/use/{codemirror.d.ts → retrie/input/codemirror/codemirror.d.ts} +0 -0
@@ -1,18 +1,18 @@
1
- import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from '../../../../../vue/dist/vue.esm-bundler.js';
2
- declare const _default: DefineComponent<ExtractPropTypes<{
3
- modelValue: {
4
- type: null;
5
- };
6
- check: {
7
- type: FunctionConstructor;
8
- default(): string;
9
- };
1
+ import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
2
+ export declare function getJs(parent: HTMLElement): editor.IStandaloneCodeEditor;
3
+ export declare function getHtml(parent: HTMLElement): editor.IStandaloneCodeEditor;
4
+ export declare function getJson(parent: HTMLElement): editor.IStandaloneCodeEditor;
5
+ export declare function getCss(parent: HTMLElement): editor.IStandaloneCodeEditor;
6
+ ;
10
7
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
11
8
  "update:modelValue": (...args: any[]) => void;
12
9
  }, string, PublicProps, Readonly< ExtractPropTypes<{
13
10
  modelValue: {
14
11
  type: null;
15
12
  };
13
+ format: {
14
+ type: StringConstructor;
15
+ };
16
16
  check: {
17
17
  type: FunctionConstructor;
18
18
  default(): string;
@@ -0,0 +1,39 @@
1
+ import { editor as t } from "monaco-editor/esm/vs/editor/editor.api";
2
+ const n = {
3
+ theme: "vs",
4
+ value: `
5
+
6
+ `,
7
+ lineNumbers: "on",
8
+ automaticLayout: !0
9
+ };
10
+ function u(e) {
11
+ return t.create(e, {
12
+ ...n,
13
+ language: "typescript"
14
+ });
15
+ }
16
+ function a(e) {
17
+ return t.create(e, {
18
+ ...n,
19
+ language: "html"
20
+ });
21
+ }
22
+ function o(e) {
23
+ return t.create(e, {
24
+ ...n,
25
+ language: "json"
26
+ });
27
+ }
28
+ function c(e) {
29
+ return t.create(e, {
30
+ ...n,
31
+ language: "css"
32
+ });
33
+ }
34
+ export {
35
+ c as getCss,
36
+ a as getHtml,
37
+ u as getJs,
38
+ o as getJson
39
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),s=require("./editor.cjs"),d=require("./init.cjs"),v={class:"editor-div"},p=t.defineComponent({__name:"editor",props:{modelValue:{type:null},format:{type:String},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(u,{emit:a}){const e=u,i=a,r=t.ref(),o=t.shallowRef();function c(){d.init(),e.format==="js"||e.format==="ts"?o.value=s.getJs(r.value):e.format==="css"||e.format==="scss"?o.value=s.getCss(r.value):e.format==="html"||e.format==="vue"?o.value=s.getHtml(r.value):e.format==="json"&&(o.value=s.getJson(r.value))}function f(n){let l=e.check(n);l&&i("update:modelValue",l)}return t.onMounted(()=>{c(),o.value?.setValue(e.modelValue),o.value?.onDidBlurEditorText(n=>{if(o.value){const l=o.value.getValue();f(l)}})}),(n,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:r},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=p;
@@ -0,0 +1,53 @@
1
+ import { defineComponent as m, ref as f, shallowRef as c, onMounted as d, withDirectives as v, createElementBlock as p, openBlock as _, createElementVNode as h, unref as V } from "vue";
2
+ import g from "../../../../../directives/adjust/index.js";
3
+ import { getJs as k, getCss as x, getHtml as y, getJson as B } from "./editor.js";
4
+ import { init as j } from "./init.js";
5
+ const E = { class: "editor-div" }, F = /* @__PURE__ */ m({
6
+ __name: "editor",
7
+ props: {
8
+ modelValue: {
9
+ type: null
10
+ },
11
+ format: {
12
+ type: String
13
+ },
14
+ check: {
15
+ type: Function,
16
+ default() {
17
+ return "";
18
+ }
19
+ }
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(a, { emit: s }) {
23
+ const e = a, u = s, o = f(), t = c();
24
+ function n() {
25
+ j(), e.format === "js" || e.format === "ts" ? t.value = k(o.value) : e.format === "css" || e.format === "scss" ? t.value = x(o.value) : e.format === "html" || e.format === "vue" ? t.value = y(o.value) : e.format === "json" && (t.value = B(o.value));
26
+ }
27
+ function i(r) {
28
+ let l = e.check(r);
29
+ l && u("update:modelValue", l);
30
+ }
31
+ return d(() => {
32
+ n(), t.value?.setValue(e.modelValue), t.value?.onDidBlurEditorText((r) => {
33
+ if (t.value) {
34
+ const l = t.value.getValue();
35
+ i(l);
36
+ }
37
+ });
38
+ }), (r, l) => v((_(), p("div", E, [
39
+ h("div", {
40
+ class: "editor-code",
41
+ ref_key: "refText",
42
+ ref: o
43
+ }, null, 512)
44
+ ])), [
45
+ [V(g), {
46
+ bottom: {}
47
+ }]
48
+ ]);
49
+ }
50
+ });
51
+ export {
52
+ F as default
53
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./editor.vue.cjs");;/* empty css */module.exports=e;
@@ -0,0 +1,5 @@
1
+ import o from "./editor.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("monaco-editor/esm/vs/editor/editor.main"),t=require("monaco-editor/esm/vs/editor/editor.worker?worker"),n=require("monaco-editor/esm/vs/language/json/json.worker?worker"),s=require("monaco-editor/esm/vs/language/css/css.worker?worker"),i=require("monaco-editor/esm/vs/language/html/html.worker?worker"),o=require("monaco-editor/esm/vs/language/typescript/ts.worker?worker");function c(){self.MonacoEnvironment={getWorker(u,r){return r==="json"?new n:r==="css"||r==="scss"||r==="less"?new s:r==="html"||r==="handlebars"||r==="razor"?new i:r==="typescript"||r==="javascript"?new o:new t}},e.languages.typescript.typescriptDefaults.setEagerModelSync(!0)}exports.init=c;
@@ -0,0 +1 @@
1
+ export declare function init(): void;
@@ -0,0 +1,16 @@
1
+ import { languages as t } from "monaco-editor/esm/vs/editor/editor.main";
2
+ import o from "monaco-editor/esm/vs/editor/editor.worker?worker";
3
+ import e from "monaco-editor/esm/vs/language/json/json.worker?worker";
4
+ import n from "monaco-editor/esm/vs/language/css/css.worker?worker";
5
+ import s from "monaco-editor/esm/vs/language/html/html.worker?worker";
6
+ import i from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
7
+ function w() {
8
+ self.MonacoEnvironment = {
9
+ getWorker(m, r) {
10
+ return r === "json" ? new e() : r === "css" || r === "scss" || r === "less" ? new n() : r === "html" || r === "handlebars" || r === "razor" ? new s() : r === "typescript" || r === "javascript" ? new i() : new o();
11
+ }
12
+ }, t.typescript.typescriptDefaults.setEagerModelSync(!0);
13
+ }
14
+ export {
15
+ w as init
16
+ };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),p=require("./text.vue.cjs");;/* empty css */const m=require("./codemirror.vue.cjs"),d={class:"form-input"},i=e.defineComponent({__name:"index",props:{modelValue:{type:null},check:{type:Function,default(){return""}},format:{type:String,default:"js"}},emits:["update:modelValue"],setup(c,{emit:n}){const t=c,a=e.ref(0),s=n,o=e.computed({get(){return t.modelValue},set(r){s("update:modelValue",r)}});return(r,u)=>(e.openBlock(),e.createElementBlock("div",d,[a.value==1?(e.openBlock(),e.createBlock(m,{key:0,modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=l=>o.value=l),format:t.format,check:t.check},null,8,["modelValue","format","check"])):(e.openBlock(),e.createBlock(p,{key:1,modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=l=>o.value=l),check:t.check},null,8,["modelValue","check"]))]))}});module.exports=i;
1
+ "use strict";const e=require("vue"),s=require("./text.vue.cjs");;/* empty css */const m=require("./codemirror/codemirror.vue.cjs");;/* empty css */const d=require("./editor/editor.vue.cjs");;/* empty css */const i=require("../../../../config.cjs"),_={class:"form-input"},k=e.defineComponent({__name:"index",props:{modelValue:{type:null},check:{type:Function,default(){return""}},format:{type:String,default:"js"}},emits:["update:modelValue"],setup(n,{emit:a}){const t=n,r=e.ref(i.getConfig("editortype")||0),p=a,o=e.computed({get(){return t.modelValue},set(c){p("update:modelValue",c)}});return(c,u)=>(e.openBlock(),e.createElementBlock("div",_,[r.value==1?(e.openBlock(),e.createBlock(m,{key:0,modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=l=>o.value=l),format:t.format,check:t.check},null,8,["modelValue","format","check"])):r.value==2?(e.openBlock(),e.createBlock(d,{key:1,modelValue:o.value,"onUpdate:modelValue":u[1]||(u[1]=l=>o.value=l),format:t.format,check:t.check},null,8,["modelValue","format","check"])):(e.openBlock(),e.createBlock(s,{key:2,modelValue:o.value,"onUpdate:modelValue":u[2]||(u[2]=l=>o.value=l),check:t.check},null,8,["modelValue","check"]))]))}});module.exports=k;
@@ -1,8 +1,12 @@
1
- import { defineComponent as p, ref as s, computed as i, createElementBlock as f, openBlock as a, createBlock as u } from "vue";
1
+ import { defineComponent as d, ref as i, computed as f, createElementBlock as s, openBlock as m, createBlock as a } from "vue";
2
2
  import k from "./text.vue.js";
3
3
  /* empty css */
4
- import V from "./codemirror.vue.js";
5
- const _ = { class: "form-input" }, B = /* @__PURE__ */ p({
4
+ import V from "./codemirror/codemirror.vue.js";
5
+ /* empty css */
6
+ import v from "./editor/editor.vue.js";
7
+ /* empty css */
8
+ import { getConfig as y } from "../../../../config.js";
9
+ const _ = { class: "form-input" }, E = /* @__PURE__ */ d({
6
10
  __name: "index",
7
11
  props: {
8
12
  modelValue: {
@@ -20,31 +24,37 @@ const _ = { class: "form-input" }, B = /* @__PURE__ */ p({
20
24
  }
21
25
  },
22
26
  emits: ["update:modelValue"],
23
- setup(n, { emit: r }) {
24
- const e = n, c = s(0), d = r, t = i({
27
+ setup(n, { emit: c }) {
28
+ const e = n, u = i(y("editortype") || 0), p = c, o = f({
25
29
  get() {
26
30
  return e.modelValue;
27
31
  },
28
- set(m) {
29
- d("update:modelValue", m);
32
+ set(r) {
33
+ p("update:modelValue", r);
30
34
  }
31
35
  });
32
- return (m, o) => (a(), f("div", _, [
33
- c.value == 1 ? (a(), u(V, {
36
+ return (r, t) => (m(), s("div", _, [
37
+ u.value == 1 ? (m(), a(V, {
34
38
  key: 0,
35
- modelValue: t.value,
36
- "onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
39
+ modelValue: o.value,
40
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => o.value = l),
37
41
  format: e.format,
38
42
  check: e.check
39
- }, null, 8, ["modelValue", "format", "check"])) : (a(), u(k, {
43
+ }, null, 8, ["modelValue", "format", "check"])) : u.value == 2 ? (m(), a(v, {
40
44
  key: 1,
41
- modelValue: t.value,
42
- "onUpdate:modelValue": o[1] || (o[1] = (l) => t.value = l),
45
+ modelValue: o.value,
46
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => o.value = l),
47
+ format: e.format,
48
+ check: e.check
49
+ }, null, 8, ["modelValue", "format", "check"])) : (m(), a(k, {
50
+ key: 2,
51
+ modelValue: o.value,
52
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => o.value = l),
43
53
  check: e.check
44
54
  }, null, 8, ["modelValue", "check"]))
45
55
  ]));
46
56
  }
47
57
  });
48
58
  export {
49
- B as default
59
+ E as default
50
60
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),a=["value"],p=e.defineComponent({__name:"text",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(l,{emit:c}){const t=l,r=c;function s(n){const o=n.target?.value;let u=t.check(o);u&&r("update:modelValue",u)}return(n,o)=>(e.openBlock(),e.createElementBlock("textarea",{class:"form-input-text",rows:"5",value:t.modelValue,onBlur:s},null,40,a))}});module.exports=p;
1
+ "use strict";const e=require("vue"),i=e.defineComponent({__name:"text",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(n,{emit:a}){const t=n,c=a,l=e.ref(t.modelValue);e.watch(()=>t.modelValue,()=>{l.value=t.modelValue});async function r(s){const o=l.value;let u=await t.check(o);u&&c("update:modelValue",u)}return(s,o)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{class:"form-input-text",rows:"5","onUpdate:modelValue":o[0]||(o[0]=u=>l.value=u),onBlur:r},null,544)),[[e.vModelText,l.value]])}});module.exports=i;
@@ -1,5 +1,5 @@
1
- import { defineComponent as r, createElementBlock as s, openBlock as m } from "vue";
2
- const p = ["value"], d = /* @__PURE__ */ r({
1
+ import { defineComponent as m, ref as s, watch as p, withDirectives as d, createElementBlock as i, openBlock as f, vModelText as v } from "vue";
2
+ const V = /* @__PURE__ */ m({
3
3
  __name: "text",
4
4
  props: {
5
5
  modelValue: {
@@ -13,21 +13,29 @@ const p = ["value"], d = /* @__PURE__ */ r({
13
13
  }
14
14
  },
15
15
  emits: ["update:modelValue"],
16
- setup(n, { emit: u }) {
17
- const e = n, a = u;
18
- function c(t) {
19
- const o = t.target?.value;
20
- let l = e.check(o);
21
- l && a("update:modelValue", l);
16
+ setup(a, { emit: u }) {
17
+ const e = a, n = u, t = s(e.modelValue);
18
+ p(
19
+ () => e.modelValue,
20
+ () => {
21
+ t.value = e.modelValue;
22
+ }
23
+ );
24
+ async function r(c) {
25
+ const l = t.value;
26
+ let o = await e.check(l);
27
+ o && n("update:modelValue", o);
22
28
  }
23
- return (t, o) => (m(), s("textarea", {
29
+ return (c, l) => d((f(), i("textarea", {
24
30
  class: "form-input-text",
25
31
  rows: "5",
26
- value: e.modelValue,
27
- onBlur: c
28
- }, null, 40, p));
32
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => t.value = o),
33
+ onBlur: r
34
+ }, null, 544)), [
35
+ [v, t.value]
36
+ ]);
29
37
  }
30
38
  });
31
39
  export {
32
- d as default
40
+ V as default
33
41
  };
@@ -1 +1 @@
1
- "use strict";const r=require("vue"),c={class:"form-number"},m=["value"],f=r.defineComponent({__name:"index",props:{modelValue:{type:null}},emits:["value","error"],setup(s,{emit:i}){const o=s,n=i,u=r.ref("");r.watch(()=>o.modelValue,()=>{let e=o.modelValue;u.value=l(e)||e},{immediate:!0});function a(e){const t=e.target?.value;l(t)}function l(e){if(e){const t=Number(e);if(isNaN(t))n("error",!0);else return n("value",t,JSON.stringify(t)),n("error",!1),t}else return n("value",void 0,JSON.stringify(0)),n("error",!1),0}return(e,t)=>(r.openBlock(),r.createElementBlock("div",c,[r.createElementVNode("input",{class:"form-number-input",value:u.value,type:"number",onBlur:r.withModifiers(a,["stop"])},null,40,m)]))}});module.exports=f;
1
+ "use strict";const t=require("vue"),m={class:"form-number"},v=t.defineComponent({__name:"index",props:{modelValue:{type:null}},emits:["value","error"],setup(s,{emit:i}){const l=s,n=i,o=t.ref("");t.watch(()=>l.modelValue,()=>{let r=l.modelValue;o.value=u(r)||r},{immediate:!0});function a(r){const e=o.value;u(e)}function u(r){if(r){const e=Number(r);if(isNaN(e))n("error",!0);else return n("value",e,JSON.stringify(e)),n("error",!1),e}else return n("value",void 0,JSON.stringify(0)),n("error",!1),0}return(r,e)=>(t.openBlock(),t.createElementBlock("div",m,[t.withDirectives(t.createElementVNode("input",{class:"form-number-input","onUpdate:modelValue":e[0]||(e[0]=c=>o.value=c),type:"number",onBlur:t.withModifiers(a,["stop"])},null,544),[[t.vModelText,o.value]])]))}});module.exports=v;
@@ -1,5 +1,5 @@
1
- import { defineComponent as i, ref as c, watch as m, createElementBlock as f, openBlock as p, createElementVNode as d, withModifiers as v } from "vue";
2
- const _ = { class: "form-number" }, h = ["value"], b = /* @__PURE__ */ i({
1
+ import { defineComponent as m, ref as c, watch as f, createElementBlock as d, openBlock as p, withDirectives as v, createElementVNode as N, withModifiers as _, vModelText as V } from "vue";
2
+ const b = { class: "form-number" }, x = /* @__PURE__ */ m({
3
3
  __name: "index",
4
4
  props: {
5
5
  modelValue: {
@@ -7,42 +7,44 @@ const _ = { class: "form-number" }, h = ["value"], b = /* @__PURE__ */ i({
7
7
  }
8
8
  },
9
9
  emits: ["value", "error"],
10
- setup(u, { emit: s }) {
11
- const o = u, r = s, n = c("");
12
- m(
13
- () => o.modelValue,
10
+ setup(u, { emit: i }) {
11
+ const n = u, r = i, o = c("");
12
+ f(
13
+ () => n.modelValue,
14
14
  () => {
15
- let e = o.modelValue;
16
- n.value = l(e) || e;
15
+ let t = n.modelValue;
16
+ o.value = l(t) || t;
17
17
  },
18
18
  {
19
19
  immediate: !0
20
20
  }
21
21
  );
22
- function a(e) {
23
- const t = e.target?.value;
24
- l(t);
22
+ function s(t) {
23
+ const e = o.value;
24
+ l(e);
25
25
  }
26
- function l(e) {
27
- if (e) {
28
- const t = Number(e);
29
- if (isNaN(t))
26
+ function l(t) {
27
+ if (t) {
28
+ const e = Number(t);
29
+ if (isNaN(e))
30
30
  r("error", !0);
31
31
  else
32
- return r("value", t, JSON.stringify(t)), r("error", !1), t;
32
+ return r("value", e, JSON.stringify(e)), r("error", !1), e;
33
33
  } else
34
34
  return r("value", void 0, JSON.stringify(0)), r("error", !1), 0;
35
35
  }
36
- return (e, t) => (p(), f("div", _, [
37
- d("input", {
36
+ return (t, e) => (p(), d("div", b, [
37
+ v(N("input", {
38
38
  class: "form-number-input",
39
- value: n.value,
39
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
40
40
  type: "number",
41
- onBlur: v(a, ["stop"])
42
- }, null, 40, h)
41
+ onBlur: _(s, ["stop"])
42
+ }, null, 544), [
43
+ [V, o.value]
44
+ ])
43
45
  ]));
44
46
  }
45
47
  });
46
48
  export {
47
- b as default
49
+ x as default
48
50
  };
@@ -1,3 +1,3 @@
1
- "use strict";const l=require("vue"),m=require("../input/index.vue.cjs");;/* empty css */const f=require("../../util.cjs"),p={class:"form-object"},d=l.defineComponent({__name:"index",props:{modelValue:{type:null}},emits:["value","error"],setup(c,{emit:s}){const u=c,o=s,n=l.ref("");l.watch(()=>u.modelValue,()=>{let e=u.modelValue;n.value=i(e)||e},{immediate:!0});function a(e){return new Function("",`{ return ${e} }`)}function i(e){let r;if(e)try{let t=e;typeof e=="string"?(t=a(e)(),r=f.prettierObjFormat(e)):r=JSON.stringify(e),typeof t=="object"?(o("value",t,r),o("error",!1)):(o("error",!0),console.log("error","类型不匹配"))}catch(t){o("error",!0),console.log("error",t)}else r=`{
1
+ "use strict";const n=require("vue"),m=require("../input/index.vue.cjs");;/* empty css */const f=require("../../util.cjs"),p={class:"form-object"},d=n.defineComponent({__name:"index",props:{modelValue:{type:null}},emits:["value","error"],setup(i,{emit:c}){const u=i,o=c,l=n.ref("");n.watch(()=>u.modelValue,async()=>{let e=u.modelValue;l.value=await a(e)||e},{immediate:!0});function s(e){return new Function("",`{ return ${e} }`)}async function a(e){let r;if(e)try{let t=e;typeof e=="string"?(t=s(e)(),r=await f.prettierObjFormat(e)):r=JSON.stringify(e),typeof t=="object"?(o("value",t,r),o("error",!1)):(o("error",!0),console.log("error","类型不匹配"))}catch(t){o("error",!0),console.log("error",t)}else r=`{
2
2
 
3
- }`,o("value",void 0,r),o("error",!1);return r}return(e,r)=>(l.openBlock(),l.createElementBlock("div",p,[l.createVNode(m,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=t=>n.value=t),check:i},null,8,["modelValue"])]))}});module.exports=d;
3
+ }`,o("value",void 0,r),o("error",!1);return r}return(e,r)=>(n.openBlock(),n.createElementBlock("div",p,[n.createVNode(m,{format:"json",modelValue:l.value,"onUpdate:modelValue":r[0]||(r[0]=t=>l.value=t),check:a},null,8,["modelValue"])]))}});module.exports=d;
@@ -1,8 +1,8 @@
1
- import { defineComponent as c, ref as f, watch as s, createElementBlock as p, openBlock as d, createVNode as v } from "vue";
1
+ import { defineComponent as m, ref as s, watch as f, createElementBlock as p, openBlock as d, createVNode as v } from "vue";
2
2
  import _ from "../input/index.vue.js";
3
3
  /* empty css */
4
- import { prettierObjFormat as V } from "../../util.js";
5
- const g = { class: "form-object" }, x = /* @__PURE__ */ c({
4
+ import { prettierObjFormat as y } from "../../util.js";
5
+ const V = { class: "form-object" }, k = /* @__PURE__ */ m({
6
6
  __name: "index",
7
7
  props: {
8
8
  modelValue: {
@@ -10,27 +10,27 @@ const g = { class: "form-object" }, x = /* @__PURE__ */ c({
10
10
  }
11
11
  },
12
12
  emits: ["value", "error"],
13
- setup(a, { emit: i }) {
14
- const n = a, t = i, l = f("");
15
- s(
13
+ setup(u, { emit: i }) {
14
+ const n = u, t = i, l = s("");
15
+ f(
16
16
  () => n.modelValue,
17
- () => {
17
+ async () => {
18
18
  let e = n.modelValue;
19
- l.value = u(e) || e;
19
+ l.value = await a(e) || e;
20
20
  },
21
21
  {
22
22
  immediate: !0
23
23
  }
24
24
  );
25
- function m(e) {
25
+ function c(e) {
26
26
  return new Function("", `{ return ${e} }`);
27
27
  }
28
- function u(e) {
28
+ async function a(e) {
29
29
  let r;
30
30
  if (e)
31
31
  try {
32
32
  let o = e;
33
- typeof e == "string" ? (o = m(e)(), r = V(e)) : r = JSON.stringify(e), typeof o == "object" ? (t("value", o, r), t("error", !1)) : (t("error", !0), console.log("error", "类型不匹配"));
33
+ typeof e == "string" ? (o = c(e)(), r = await y(e)) : r = JSON.stringify(e), typeof o == "object" ? (t("value", o, r), t("error", !1)) : (t("error", !0), console.log("error", "类型不匹配"));
34
34
  } catch (o) {
35
35
  t("error", !0), console.log("error", o);
36
36
  }
@@ -40,15 +40,16 @@ const g = { class: "form-object" }, x = /* @__PURE__ */ c({
40
40
  }`, t("value", void 0, r), t("error", !1);
41
41
  return r;
42
42
  }
43
- return (e, r) => (d(), p("div", g, [
43
+ return (e, r) => (d(), p("div", V, [
44
44
  v(_, {
45
+ format: "json",
45
46
  modelValue: l.value,
46
47
  "onUpdate:modelValue": r[0] || (r[0] = (o) => l.value = o),
47
- check: u
48
+ check: a
48
49
  }, null, 8, ["modelValue"])
49
50
  ]));
50
51
  }
51
52
  });
52
53
  export {
53
- x as default
54
+ k as default
54
55
  };
@@ -1 +1 @@
1
- "use strict";const o=require("vue"),m=require("../input/index.vue.cjs");;/* empty css */const i=require("../../util.cjs"),f={class:"form-other"},v=o.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","error"],setup(c,{emit:p}){const u=c,t=p,n=o.ref("");o.watch(()=>u.modelValue,()=>{let e=u.modelValue;n.value=a(e)||e},{immediate:!0});function d(e){return new Function("",`{ return ${e} }`)}function a(e){let r;if(e)try{const s=d(e)();i.isTypeEqual(s,u.dataType||[])?(r=i.prettierFormat(e),t("value",s,r),t("error",!1)):(t("error",!0),console.log("error","类型不匹配"))}catch(l){t("error",!0),console.log("error",l)}else r="",t("value",void 0,r),t("error",!1);return r}return(e,r)=>(o.openBlock(),o.createElementBlock("div",f,[o.createVNode(m,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=l=>n.value=l),check:a},null,8,["modelValue"])]))}});module.exports=v;
1
+ "use strict";const o=require("vue"),m=require("../input/index.vue.cjs");;/* empty css */const i=require("../../util.cjs"),f={class:"form-other"},v=o.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","error"],setup(c,{emit:p}){const a=c,t=p,n=o.ref("");o.watch(()=>a.modelValue,async()=>{let e=a.modelValue;n.value=await u(e)||e},{immediate:!0});function d(e){return new Function("",`{ return ${e} }`)}async function u(e){let r;if(e)try{const s=d(e)();i.isTypeEqual(s,a.dataType||[])?(r=await i.prettierFormat(e),t("value",s,r),t("error",!1)):(t("error",!0),console.log("error","类型不匹配"))}catch(l){t("error",!0),console.log("error",l)}else r="",t("value",void 0,r),t("error",!1);return r}return(e,r)=>(o.openBlock(),o.createElementBlock("div",f,[o.createVNode(m,{format:"js",modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=l=>n.value=l),check:u},null,8,["modelValue"])]))}});module.exports=v;
@@ -1,8 +1,8 @@
1
- import { defineComponent as p, ref as s, watch as d, createElementBlock as f, openBlock as v, createVNode as y } from "vue";
1
+ import { defineComponent as m, ref as p, watch as d, createElementBlock as f, openBlock as y, createVNode as v } from "vue";
2
2
  import _ from "../input/index.vue.js";
3
3
  /* empty css */
4
4
  import { isTypeEqual as V, prettierFormat as g } from "../../util.js";
5
- const h = { class: "form-other" }, T = /* @__PURE__ */ p({
5
+ const h = { class: "form-other" }, B = /* @__PURE__ */ m({
6
6
  __name: "index",
7
7
  props: {
8
8
  modelValue: {
@@ -25,26 +25,26 @@ const h = { class: "form-other" }, T = /* @__PURE__ */ p({
25
25
  },
26
26
  emits: ["value", "error"],
27
27
  setup(i, { emit: c }) {
28
- const l = i, o = c, a = s("");
28
+ const a = i, o = c, l = p("");
29
29
  d(
30
- () => l.modelValue,
31
- () => {
32
- let e = l.modelValue;
33
- a.value = n(e) || e;
30
+ () => a.modelValue,
31
+ async () => {
32
+ let e = a.modelValue;
33
+ l.value = await n(e) || e;
34
34
  },
35
35
  {
36
36
  immediate: !0
37
37
  }
38
38
  );
39
- function m(e) {
39
+ function s(e) {
40
40
  return new Function("", `{ return ${e} }`);
41
41
  }
42
- function n(e) {
42
+ async function n(e) {
43
43
  let r;
44
44
  if (e)
45
45
  try {
46
- const u = m(e)();
47
- V(u, l.dataType || []) ? (r = g(e), o("value", u, r), o("error", !1)) : (o("error", !0), console.log("error", "类型不匹配"));
46
+ const u = s(e)();
47
+ V(u, a.dataType || []) ? (r = await g(e), o("value", u, r), o("error", !1)) : (o("error", !0), console.log("error", "类型不匹配"));
48
48
  } catch (t) {
49
49
  o("error", !0), console.log("error", t);
50
50
  }
@@ -52,15 +52,16 @@ const h = { class: "form-other" }, T = /* @__PURE__ */ p({
52
52
  r = "", o("value", void 0, r), o("error", !1);
53
53
  return r;
54
54
  }
55
- return (e, r) => (v(), f("div", h, [
56
- y(_, {
57
- modelValue: a.value,
58
- "onUpdate:modelValue": r[0] || (r[0] = (t) => a.value = t),
55
+ return (e, r) => (y(), f("div", h, [
56
+ v(_, {
57
+ format: "js",
58
+ modelValue: l.value,
59
+ "onUpdate:modelValue": r[0] || (r[0] = (t) => l.value = t),
59
60
  check: n
60
61
  }, null, 8, ["modelValue"])
61
62
  ]));
62
63
  }
63
64
  });
64
65
  export {
65
- T as default
66
+ B as default
66
67
  };
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),i=require("../input/index.vue.cjs");;/* empty css */const a={class:"slot"},_=e.defineComponent({__name:"index",props:{value:{type:Object}},emits:["change","error"],setup(d,{emit:c}){const o=e.ref(""),n=c;function s(){const t=o.value.toString();try{n("change",t),n("error",!1)}catch(r){n("error",!0),console.log("error",r)}}function l(t){return t}return(t,r)=>(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(i,{format:"html",modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=u=>o.value=u),check:l},null,8,["modelValue"]),e.createElementVNode("div",{onClick:e.withModifiers(s,["stop"]),class:"but-div"},"插入")]))}});module.exports=_;
1
+ "use strict";const t=require("vue"),u=require("../input/index.vue.cjs");;/* empty css */const a=require("../../util.cjs"),p={class:"slot"},_=t.defineComponent({__name:"index",props:{value:{type:Object}},emits:["change","error"],setup(d,{emit:s}){const o=t.ref(""),n=s;async function c(){const r=o.value.toString();try{const e=await a.prettierHtml(r);n("change",e,e),n("error",!1)}catch(e){n("error",!0),console.log("error",e)}}function l(r){return r}return(r,e)=>(t.openBlock(),t.createElementBlock("div",p,[t.createVNode(u,{format:"html",modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=i=>o.value=i),check:l},null,8,["modelValue"]),t.createElementVNode("div",{onClick:t.withModifiers(c,["stop"]),class:"but-div"},"插入")]))}});module.exports=_;
@@ -1,7 +1,8 @@
1
- import { defineComponent as i, ref as s, createElementBlock as m, openBlock as u, createVNode as d, createElementVNode as p, withModifiers as f } from "vue";
1
+ import { defineComponent as i, ref as s, createElementBlock as m, openBlock as u, createVNode as p, createElementVNode as d, withModifiers as f } from "vue";
2
2
  import _ from "../input/index.vue.js";
3
3
  /* empty css */
4
- const v = { class: "slot" }, x = /* @__PURE__ */ i({
4
+ import { prettierHtml as v } from "../../util.js";
5
+ const h = { class: "slot" }, C = /* @__PURE__ */ i({
5
6
  __name: "index",
6
7
  props: {
7
8
  value: {
@@ -9,27 +10,28 @@ const v = { class: "slot" }, x = /* @__PURE__ */ i({
9
10
  }
10
11
  },
11
12
  emits: ["change", "error"],
12
- setup(h, { emit: n }) {
13
- const t = s(""), r = n;
14
- function l() {
15
- const e = t.value.toString();
13
+ setup(k, { emit: n }) {
14
+ const o = s(""), r = n;
15
+ async function l() {
16
+ const t = o.value.toString();
16
17
  try {
17
- r("change", e), r("error", !1);
18
- } catch (o) {
19
- r("error", !0), console.log("error", o);
18
+ const e = await v(t);
19
+ r("change", e, e), r("error", !1);
20
+ } catch (e) {
21
+ r("error", !0), console.log("error", e);
20
22
  }
21
23
  }
22
- function c(e) {
23
- return e;
24
+ function c(t) {
25
+ return t;
24
26
  }
25
- return (e, o) => (u(), m("div", v, [
26
- d(_, {
27
+ return (t, e) => (u(), m("div", h, [
28
+ p(_, {
27
29
  format: "html",
28
- modelValue: t.value,
29
- "onUpdate:modelValue": o[0] || (o[0] = (a) => t.value = a),
30
+ modelValue: o.value,
31
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
30
32
  check: c
31
33
  }, null, 8, ["modelValue"]),
32
- p("div", {
34
+ d("div", {
33
35
  onClick: f(l, ["stop"]),
34
36
  class: "but-div"
35
37
  }, "插入")
@@ -37,5 +39,5 @@ const v = { class: "slot" }, x = /* @__PURE__ */ i({
37
39
  }
38
40
  });
39
41
  export {
40
- x as default
42
+ C as default
41
43
  };
@@ -1 +1 @@
1
- "use strict";const t=require("vue"),s=require("../../util.cjs"),m={class:"form-string"},p=["value"],v=t.defineComponent({__name:"index",props:{modelValue:{type:null},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value"],setup(i,{emit:a}){const n=i,r=a,o=t.ref("");t.watch(()=>n.modelValue,()=>{let e=n.modelValue;o.value=l(e)},{immediate:!0});function c(e){const u=e.target?.value;l(u)}function l(e){return e?(e=s.getString(e),r("value",e,JSON.stringify(e)),e):(r("value",void 0,JSON.stringify("")),"")}return(e,u)=>(t.openBlock(),t.createElementBlock("div",m,[t.createElementVNode("textarea",{class:"form-string-text",rows:"3",value:o.value,onBlur:t.withModifiers(c,["stop"])},null,40,p)]))}});module.exports=v;
1
+ "use strict";const t=require("vue"),m=require("../../util.cjs"),p={class:"form-string"},d=t.defineComponent({__name:"index",props:{modelValue:{type:null},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value"],setup(u,{emit:s}){const o=u,r=s,l=t.ref("");t.watch(()=>o.modelValue,()=>{let e=o.modelValue;l.value=i(e)},{immediate:!0});function a(e){const n=l.value;i(n)}function i(e){return e?(e=m.getString(e),r("value",e,JSON.stringify(e)),e):(r("value",void 0,JSON.stringify("")),"")}return(e,n)=>(t.openBlock(),t.createElementBlock("div",p,[t.withDirectives(t.createElementVNode("textarea",{class:"form-string-text",rows:"3","onUpdate:modelValue":n[0]||(n[0]=c=>l.value=c),onBlur:t.withModifiers(a,["stop"])},null,544),[[t.vModelText,l.value]])]))}});module.exports=d;