@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.
- package/README.md +0 -2
- package/dist/index.css +2 -2
- package/dist/node/index.cjs +448 -358
- package/dist/node/index.d.cts +2 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +445 -358
- package/dist/packages/components/use/code.cjs +15 -16
- package/dist/packages/components/use/code.d.ts +25 -17
- package/dist/packages/components/use/code.js +76 -74
- package/dist/packages/components/use/edit.cjs +11 -11
- package/dist/packages/components/use/edit.d.ts +1 -1
- package/dist/packages/components/use/edit.js +119 -94
- package/dist/packages/components/use/prettier.cjs +1 -0
- package/dist/packages/components/use/prettier.d.ts +1 -4
- package/dist/packages/components/use/prettier.js +40 -0
- package/dist/packages/components/use/retrie/array/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/array/index.vue.js +17 -16
- package/dist/packages/components/use/retrie/function/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/function/index.vue.js +22 -20
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.cjs +3 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.js +58 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.cjs +1 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue.js +62 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.cjs +1 -0
- package/dist/packages/components/use/retrie/input/codemirror/codemirror.vue3.js +5 -0
- package/dist/packages/components/use/retrie/input/editor/editor.cjs +3 -0
- package/dist/packages/components/use/retrie/input/{codemirror.d.ts → editor/editor.d.ts} +9 -9
- package/dist/packages/components/use/retrie/input/editor/editor.js +39 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue.js +53 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue3.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/editor.vue3.js +5 -0
- package/dist/packages/components/use/retrie/input/editor/init.cjs +1 -0
- package/dist/packages/components/use/retrie/input/editor/init.d.ts +1 -0
- package/dist/packages/components/use/retrie/input/editor/init.js +16 -0
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +25 -15
- package/dist/packages/components/use/retrie/input/text.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/text.vue.js +21 -13
- package/dist/packages/components/use/retrie/number/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/number/index.vue.js +24 -22
- package/dist/packages/components/use/retrie/object/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/object/index.vue.js +15 -14
- package/dist/packages/components/use/retrie/other/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/other/index.vue.js +17 -16
- package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/slot/index.vue.js +19 -17
- package/dist/packages/components/use/retrie/string/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/string/index.vue.js +20 -18
- package/dist/packages/components/use/set-code.vue.cjs +1 -1
- package/dist/packages/components/use/set-code.vue.js +7 -7
- package/dist/packages/components/use/util.cjs +3 -3
- package/dist/packages/components/use/util.d.ts +10 -5
- package/dist/packages/components/use/util.js +88 -62
- package/dist/packages/config.d.ts +3 -1
- package/dist/packages/page/edit/index.vue2.cjs +1 -1
- package/dist/packages/page/edit/index.vue2.js +11 -7
- package/package.json +3 -2
- package/dist/packages/components/use/codemirror.cjs +0 -3
- package/dist/packages/components/use/codemirror.js +0 -31
- package/dist/packages/components/use/retrie/input/codemirror.vue.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror.vue.js +0 -43
- package/dist/packages/components/use/retrie/input/codemirror.vue2.cjs +0 -1
- package/dist/packages/components/use/retrie/input/codemirror.vue2.js +0 -4
- /package/dist/packages/components/use/{codemirror.d.ts → retrie/input/codemirror/codemirror.d.ts} +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 @@
|
|
|
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"),
|
|
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
|
|
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
|
-
|
|
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:
|
|
24
|
-
const e = n,
|
|
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(
|
|
29
|
-
|
|
32
|
+
set(r) {
|
|
33
|
+
p("update:modelValue", r);
|
|
30
34
|
}
|
|
31
35
|
});
|
|
32
|
-
return (
|
|
33
|
-
|
|
36
|
+
return (r, t) => (m(), s("div", _, [
|
|
37
|
+
u.value == 1 ? (m(), a(V, {
|
|
34
38
|
key: 0,
|
|
35
|
-
modelValue:
|
|
36
|
-
"onUpdate:modelValue":
|
|
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"])) : (
|
|
43
|
+
}, null, 8, ["modelValue", "format", "check"])) : u.value == 2 ? (m(), a(v, {
|
|
40
44
|
key: 1,
|
|
41
|
-
modelValue:
|
|
42
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
59
|
+
E as default
|
|
50
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
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
|
|
2
|
-
const
|
|
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(
|
|
17
|
-
const e = n,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 (
|
|
29
|
+
return (c, l) => d((f(), i("textarea", {
|
|
24
30
|
class: "form-input-text",
|
|
25
31
|
rows: "5",
|
|
26
|
-
|
|
27
|
-
onBlur:
|
|
28
|
-
}, null,
|
|
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
|
-
|
|
40
|
+
V as default
|
|
33
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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
|
|
2
|
-
const
|
|
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:
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
() =>
|
|
10
|
+
setup(u, { emit: i }) {
|
|
11
|
+
const n = u, r = i, o = c("");
|
|
12
|
+
f(
|
|
13
|
+
() => n.modelValue,
|
|
14
14
|
() => {
|
|
15
|
-
let
|
|
16
|
-
|
|
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
|
|
23
|
-
const
|
|
24
|
-
l(
|
|
22
|
+
function s(t) {
|
|
23
|
+
const e = o.value;
|
|
24
|
+
l(e);
|
|
25
25
|
}
|
|
26
|
-
function l(
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
if (isNaN(
|
|
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",
|
|
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 (
|
|
37
|
-
|
|
36
|
+
return (t, e) => (p(), d("div", b, [
|
|
37
|
+
v(N("input", {
|
|
38
38
|
class: "form-number-input",
|
|
39
|
-
|
|
39
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => o.value = a),
|
|
40
40
|
type: "number",
|
|
41
|
-
onBlur:
|
|
42
|
-
}, null,
|
|
41
|
+
onBlur: _(s, ["stop"])
|
|
42
|
+
}, null, 544), [
|
|
43
|
+
[V, o.value]
|
|
44
|
+
])
|
|
43
45
|
]));
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
x as default
|
|
48
50
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const
|
|
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)=>(
|
|
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
|
|
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
|
|
5
|
-
const
|
|
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(
|
|
14
|
-
const n =
|
|
15
|
-
|
|
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 =
|
|
19
|
+
l.value = await a(e) || e;
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
immediate: !0
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
function
|
|
25
|
+
function c(e) {
|
|
26
26
|
return new Function("", `{ return ${e} }`);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
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 =
|
|
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",
|
|
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:
|
|
48
|
+
check: a
|
|
48
49
|
}, null, 8, ["modelValue"])
|
|
49
50
|
]));
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
export {
|
|
53
|
-
|
|
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
|
|
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
|
|
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" },
|
|
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
|
|
28
|
+
const a = i, o = c, l = p("");
|
|
29
29
|
d(
|
|
30
|
-
() =>
|
|
31
|
-
() => {
|
|
32
|
-
let e =
|
|
33
|
-
|
|
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
|
|
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 =
|
|
47
|
-
V(u,
|
|
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) => (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
66
|
+
B as default
|
|
66
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
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
|
|
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
|
-
|
|
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(
|
|
13
|
-
const
|
|
14
|
-
function l() {
|
|
15
|
-
const
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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(
|
|
23
|
-
return
|
|
24
|
+
function c(t) {
|
|
25
|
+
return t;
|
|
24
26
|
}
|
|
25
|
-
return (
|
|
26
|
-
|
|
27
|
+
return (t, e) => (u(), m("div", h, [
|
|
28
|
+
p(_, {
|
|
27
29
|
format: "html",
|
|
28
|
-
modelValue:
|
|
29
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
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
|
-
|
|
42
|
+
C as default
|
|
41
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),
|
|
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;
|