@fangzhongya/vue-archive 0.0.6 → 0.0.8
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 +3 -2
- package/dist/node/index.cjs +135 -71
- package/dist/node/index.d.cts +8 -0
- package/dist/node/index.d.ts +8 -0
- package/dist/node/index.js +118 -54
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.cjs +1 -0
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-LPMR5W6M.js +9 -0
- package/dist/packages/components/aside/index.vue.cjs +1 -1
- package/dist/packages/components/aside/index.vue.js +43 -45
- package/dist/packages/components/boxurl/index.vue.cjs +1 -1
- package/dist/packages/components/boxurl/index.vue.js +34 -37
- package/dist/packages/components/choice/choice.vue.cjs +1 -1
- package/dist/packages/components/choice/choice.vue.js +29 -32
- package/dist/packages/components/choice/index.vue.cjs +1 -1
- package/dist/packages/components/choice/index.vue.js +39 -42
- package/dist/packages/components/code/highlight.vue2.cjs +1 -1
- package/dist/packages/components/code/highlight.vue2.js +1 -1
- package/dist/packages/components/code/index.vue.cjs +1 -1
- package/dist/packages/components/code/index.vue.js +79 -87
- package/dist/packages/components/compo/ftable.vue.cjs +1 -1
- package/dist/packages/components/compo/ftable.vue.js +15 -15
- package/dist/packages/components/compo/index.cjs +1 -1
- package/dist/packages/components/compo/index.js +86 -97
- package/dist/packages/components/compo/index.vue.cjs +1 -1
- package/dist/packages/components/compo/index.vue.js +33 -34
- package/dist/packages/components/compo/info.vue.cjs +1 -1
- package/dist/packages/components/compo/info.vue.js +22 -25
- package/dist/packages/components/compo/top.cjs +1 -1
- package/dist/packages/components/compo/top.js +21 -21
- package/dist/packages/components/main/index.vue.cjs +1 -1
- package/dist/packages/components/main/index.vue.js +16 -17
- package/dist/packages/components/md/index.vue.cjs +1 -1
- package/dist/packages/components/md/index.vue.js +28 -32
- package/dist/packages/components/test/index.cjs +1 -1
- package/dist/packages/components/test/index.js +39 -42
- package/dist/packages/components/test/index.vue.cjs +1 -1
- package/dist/packages/components/test/index.vue.js +44 -49
- package/dist/packages/components/use/code.cjs +1 -1
- package/dist/packages/components/use/code.js +3 -3
- package/dist/packages/components/use/index.cjs +1 -1
- package/dist/packages/components/use/index.js +1 -1
- package/dist/packages/components/use/retrie/choice/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/choice/index.vue.js +32 -34
- package/dist/packages/components/use/retrie/expose/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/expose/index.vue.js +18 -19
- package/dist/packages/components/use/retrie/form/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/form/index.vue.js +110 -114
- package/dist/packages/components/use/retrie/function/index.vue.cjs +2 -2
- package/dist/packages/components/use/retrie/function/index.vue.js +1 -4
- package/dist/packages/components/use/retrie/input/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/input/index.vue.js +20 -21
- package/dist/packages/components/use/retrie/number/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/number/index.vue.js +12 -13
- package/dist/packages/components/use/retrie/select/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/select/index.vue.js +21 -23
- package/dist/packages/components/use/retrie/slot/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/slot/index.vue.js +15 -16
- package/dist/packages/components/use/retrie/string/index.vue.cjs +1 -1
- package/dist/packages/components/use/retrie/string/index.vue.js +14 -15
- package/dist/packages/components/use/set-emit.vue.cjs +1 -1
- package/dist/packages/components/use/set-emit.vue.js +20 -24
- package/dist/packages/components/use/set-expose.vue.cjs +1 -1
- package/dist/packages/components/use/set-expose.vue.js +15 -18
- package/dist/packages/components/use/set-props.vue.cjs +1 -1
- package/dist/packages/components/use/set-props.vue.js +48 -49
- package/dist/packages/config.cjs +1 -1
- package/dist/packages/config.d.ts +8 -1
- package/dist/packages/config.js +1 -1
- package/dist/packages/directives/adjust/index copy.d.ts +6 -0
- package/dist/packages/directives/adjust/index.cjs +1 -1
- package/dist/packages/directives/adjust/index.js +96 -97
- package/dist/packages/page/comprops/index.vue2.cjs +1 -1
- package/dist/packages/page/comprops/index.vue2.js +65 -71
- package/dist/packages/page/index/index.vue2.cjs +1 -1
- package/dist/packages/page/index/index.vue2.js +19 -23
- package/dist/packages/page/single/index.vue2.cjs +1 -1
- package/dist/packages/page/single/index.vue2.js +46 -49
- package/dist/packages/router/index.cjs +1 -1
- package/dist/packages/router/index.js +44 -46
- package/dist/packages/utils/common.cjs +1 -1
- package/dist/packages/utils/common.d.ts +4 -0
- package/dist/packages/utils/common.js +57 -54
- package/dist/packages/utils/glob.cjs +3 -3
- package/dist/packages/utils/glob.d.ts +1 -1
- package/dist/packages/utils/glob.js +269 -227
- package/dist/packages/utils/props.cjs +1 -1
- package/dist/packages/utils/props.js +34 -28
- package/dist/src/components/common/cs3.d.ts +4 -0
- package/dist/src/components/common/index.d.ts +4 -0
- package/dist/src/components/cs/expose/index.d.ts +4 -1
- package/dist/src/components/cs/expose/src/index.vue.d.ts +4 -1
- package/dist/vue-archive.css +1 -1
- package/package.json +19 -20
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.cjs +0 -1
- package/dist/node_modules/.pnpm/@fangzhongya_utils@0.0.8-77/node_modules/@fangzhongya/utils/dist/chunk-SNABGVNO.js +0 -9
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-4OBNLDTJ.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-5RZYHE3X.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-5RZYHE3X.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-AM67P3W7.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-J7CICTHH.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-Q6FMBSK4.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-RD4EP3M5.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-UOADEBDH.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VBS6YE6H.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VBS6YE6H.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VKE5JARB.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-VKE5JARB.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XCDKXZFR.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XUL6LPTN.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-XUL6LPTN.js +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@fangzhongya_utils@0.0.8-77 → @fangzhongya_utils@0.0.24}/node_modules/@fangzhongya/utils/dist/chunk-ZVBCHJA5.js +0 -0
- /package/dist/node_modules/.pnpm/{@highlightjs_vue-plugin@2.1_0b670f4f8863792fd47bf820772b9cbf → @highlightjs_vue-plugin@2.1_b586068ec461434c266304f56a34d01a}/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.cjs +0 -0
- /package/dist/node_modules/.pnpm/{@highlightjs_vue-plugin@2.1_0b670f4f8863792fd47bf820772b9cbf → @highlightjs_vue-plugin@2.1_b586068ec461434c266304f56a34d01a}/node_modules/@highlightjs/vue-plugin/dist/highlightjs-vue.esm.min.js +0 -0
|
@@ -5,7 +5,7 @@ import E from "./set-code.vue.js";
|
|
|
5
5
|
import O from "./set-expose.vue.js";
|
|
6
6
|
import $ from "./set-slot.vue.js";
|
|
7
7
|
import { getPropsValue as D, getEmitsValue as w, getExposeValue as U, getSlotValue as k } from "../../utils/props.js";
|
|
8
|
-
import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.
|
|
8
|
+
import { firstUpper as h } from "../../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-EWJJKQIO.js";
|
|
9
9
|
const K = g({
|
|
10
10
|
/**
|
|
11
11
|
* @props {Stinrg} value 插入数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.
|
|
1
|
+
"use strict";const e=require("vue"),C=require("../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.cjs"),v=require("../../util.cjs"),x={class:"form-select"},A=["value","disabled"],j={class:"form-select-list"},L={key:0,class:"form-select-list-div"},T=["onClick"],q={key:1,class:"no-data"},F=e.defineComponent({__name:"index",props:{modelValue:{type:null},dataType:{type:[String,Array]},disabled:Boolean,list:{type:Array},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value","change"],setup(h,{emit:g}){const l=h,y=g,u=e.ref(),a=e.ref(!1),c=e.ref(!1),r=e.ref([]),k=e.computed(()=>r.value.map(t=>d(t)).join(",")),p=e.computed(()=>{let t=l.dataType||"";return(v.getSonType(t)||[])[1]});e.watch(()=>l.modelValue,()=>{B()},{immediate:!0});function _(t=[]){return p.value=="string"?t.map(n=>v.getString(n)):p.value=="number"?t.map(n=>{let o=Number(n);return isNaN(o)&&(o=0),o}):t}function b(t){return new Function("",`{ return ${t}}`)}function B(){r.value=[];let t=l.modelValue,n=[];const o=b(t);if(o instanceof Array&&(n=o),l.list)for(let s=0;s<l.list.length;s++){const f=l.list[s];n.includes(i(f))&&r.value.push(f)}m()}function d(t){let n=l.config?.label;return n&&typeof t=="object"&&t?t[n]:t}function i(t){let n=l.config?.prop;return n&&typeof t=="object"&&t?t[n]:t}function w(t){return r.value.map(n=>i(n)).includes(i(t))}function V(){l.disabled||(a.value=!0)}function E(){c.value||(a.value=!1)}function M(){c.value=!0}function S(){c.value=!1}function N(t){u.value&&u.value.focus(),r.value=C.toggleArray(r.value,t,l.config.prop),m()}function m(){let t=_(r.value.map(n=>i(n)));y("value",t,JSON.stringify(t))}return(t,n)=>(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("input",{value:k.value,readonly:"",placeholder:"请选择",type:"text",disabled:l.disabled,ref_key:"refInput",ref:u,onClick:e.withModifiers(V,["stop"]),onBlur:e.withModifiers(E,["stop"])},null,40,A),e.createElementVNode("div",{onMousemove:e.withModifiers(M,["stop"]),onMouseout:e.withModifiers(S,["stop"]),class:"form-select-box"},[e.withDirectives(e.createElementVNode("div",j,[l.list&&l.list.length>0?(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-select-list-li",{active:w(o)}]),onClick:e.withModifiers(f=>N(o),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(d(o)),1)],10,T))),256))])):(e.openBlock(),e.createElementBlock("div",q,"暂无数据"))],512),[[e.vShow,a.value]])],32)]))}});module.exports=F;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as L, ref as c, computed as _, watch as z, createElementBlock as
|
|
2
|
-
import { toggleArray as J } from "../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.
|
|
1
|
+
import { defineComponent as L, ref as c, computed as _, watch as z, createElementBlock as r, openBlock as s, createElementVNode as f, withModifiers as i, withDirectives as D, Fragment as E, renderList as F, normalizeClass as I, toDisplayString as O, vShow as $ } from "vue";
|
|
2
|
+
import { toggleArray as J } from "../../../../../node_modules/.pnpm/@fangzhongya_utils@0.0.24/node_modules/@fangzhongya/utils/dist/chunk-APKFW4LU.js";
|
|
3
3
|
import { getSonType as P, getString as q } from "../../util.js";
|
|
4
4
|
const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "form-select-list" }, Q = {
|
|
5
5
|
key: 0,
|
|
@@ -30,12 +30,12 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
|
|
|
30
30
|
},
|
|
31
31
|
emits: ["value", "change"],
|
|
32
32
|
setup(b, { emit: k }) {
|
|
33
|
-
const
|
|
34
|
-
let e =
|
|
33
|
+
const n = b, S = k, p = c(), d = c(!1), m = c(!1), o = c([]), V = _(() => o.value.map((e) => y(e)).join(",")), g = _(() => {
|
|
34
|
+
let e = n.dataType || "";
|
|
35
35
|
return (P(e) || [])[1];
|
|
36
36
|
});
|
|
37
37
|
z(
|
|
38
|
-
() =>
|
|
38
|
+
() => n.modelValue,
|
|
39
39
|
() => {
|
|
40
40
|
x();
|
|
41
41
|
},
|
|
@@ -45,8 +45,8 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
|
|
|
45
45
|
);
|
|
46
46
|
function w(e = []) {
|
|
47
47
|
return g.value == "string" ? e.map((t) => q(t)) : g.value == "number" ? e.map((t) => {
|
|
48
|
-
let
|
|
49
|
-
return isNaN(
|
|
48
|
+
let l = Number(t);
|
|
49
|
+
return isNaN(l) && (l = 0), l;
|
|
50
50
|
}) : e;
|
|
51
51
|
}
|
|
52
52
|
function C(e) {
|
|
@@ -54,30 +54,28 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
|
|
|
54
54
|
}
|
|
55
55
|
function x() {
|
|
56
56
|
o.value = [];
|
|
57
|
-
let e =
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
for (let
|
|
61
|
-
const v =
|
|
62
|
-
t.includes(
|
|
57
|
+
let e = n.modelValue, t = [];
|
|
58
|
+
const l = C(e);
|
|
59
|
+
if (l instanceof Array && (t = l), n.list)
|
|
60
|
+
for (let a = 0; a < n.list.length; a++) {
|
|
61
|
+
const v = n.list[a];
|
|
62
|
+
t.includes(u(v)) && o.value.push(v);
|
|
63
63
|
}
|
|
64
64
|
h();
|
|
65
65
|
}
|
|
66
66
|
function y(e) {
|
|
67
|
-
|
|
68
|
-
let t = (n = l.config) == null ? void 0 : n.label;
|
|
67
|
+
let t = n.config?.label;
|
|
69
68
|
return t && typeof e == "object" && e ? e[t] : e;
|
|
70
69
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
let t = (n = l.config) == null ? void 0 : n.prop;
|
|
70
|
+
function u(e) {
|
|
71
|
+
let t = n.config?.prop;
|
|
74
72
|
return t && typeof e == "object" && e ? e[t] : e;
|
|
75
73
|
}
|
|
76
74
|
function A(e) {
|
|
77
|
-
return o.value.map((t) =>
|
|
75
|
+
return o.value.map((t) => u(t)).includes(u(e));
|
|
78
76
|
}
|
|
79
77
|
function B() {
|
|
80
|
-
|
|
78
|
+
n.disabled || (d.value = !0);
|
|
81
79
|
}
|
|
82
80
|
function M() {
|
|
83
81
|
m.value || (d.value = !1);
|
|
@@ -89,42 +87,42 @@ const G = { class: "form-select" }, H = ["value", "disabled"], K = { class: "for
|
|
|
89
87
|
m.value = !1;
|
|
90
88
|
}
|
|
91
89
|
function T(e) {
|
|
92
|
-
p.value && p.value.focus(), o.value = J(o.value, e,
|
|
90
|
+
p.value && p.value.focus(), o.value = J(o.value, e, n.config.prop), h();
|
|
93
91
|
}
|
|
94
92
|
function h() {
|
|
95
93
|
let e = w(
|
|
96
|
-
o.value.map((t) =>
|
|
94
|
+
o.value.map((t) => u(t))
|
|
97
95
|
);
|
|
98
96
|
S("value", e, JSON.stringify(e));
|
|
99
97
|
}
|
|
100
|
-
return (e, t) => (
|
|
98
|
+
return (e, t) => (s(), r("div", G, [
|
|
101
99
|
f("input", {
|
|
102
100
|
value: V.value,
|
|
103
101
|
readonly: "",
|
|
104
102
|
placeholder: "请选择",
|
|
105
103
|
type: "text",
|
|
106
|
-
disabled:
|
|
104
|
+
disabled: n.disabled,
|
|
107
105
|
ref_key: "refInput",
|
|
108
106
|
ref: p,
|
|
109
|
-
onClick:
|
|
110
|
-
onBlur:
|
|
107
|
+
onClick: i(B, ["stop"]),
|
|
108
|
+
onBlur: i(M, ["stop"])
|
|
111
109
|
}, null, 40, H),
|
|
112
110
|
f("div", {
|
|
113
|
-
onMousemove:
|
|
114
|
-
onMouseout:
|
|
111
|
+
onMousemove: i(N, ["stop"]),
|
|
112
|
+
onMouseout: i(j, ["stop"]),
|
|
115
113
|
class: "form-select-box"
|
|
116
114
|
}, [
|
|
117
115
|
D(f("div", K, [
|
|
118
|
-
|
|
119
|
-
(
|
|
116
|
+
n.list && n.list.length > 0 ? (s(), r("div", Q, [
|
|
117
|
+
(s(!0), r(E, null, F(n.list, (l, a) => (s(), r("div", {
|
|
120
118
|
class: I(["form-select-list-li", {
|
|
121
|
-
active: A(
|
|
119
|
+
active: A(l)
|
|
122
120
|
}]),
|
|
123
|
-
onClick:
|
|
121
|
+
onClick: i((v) => T(l), ["stop"])
|
|
124
122
|
}, [
|
|
125
|
-
f("span", null, O(y(
|
|
123
|
+
f("span", null, O(y(l)), 1)
|
|
126
124
|
], 10, R))), 256))
|
|
127
|
-
])) : (
|
|
125
|
+
])) : (s(), r("div", U, "暂无数据"))
|
|
128
126
|
], 512), [
|
|
129
127
|
[$, d.value]
|
|
130
128
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),g=require("../index.vue.cjs"),y=t.defineComponent({__name:"index",props:{getRef:{type:Function},name:String,value:{type:Object}},setup(m){const
|
|
1
|
+
"use strict";const t=require("vue"),g=require("../index.vue.cjs"),y=t.defineComponent({__name:"index",props:{getRef:{type:Function},name:String,value:{type:Object}},setup(m){const a=m,i=t.ref(""),o=t.ref(""),u=t.ref([]),v=t.computed(()=>{u.value=[];const e=a.value;if(e&&e.name){let n=(e.selectable+"").trim();if(i.value=e.name+": "+e.description+" 入参=("+n+") 返回值: "+e.type,n)return n.split(",").map(s=>{let l=s.split(":"),c=l[0];u.value.push(c);let p=f(l[1]);return{label:s,prop:c,type:p[0],dataType:p}})}return[]});function f(e){if(e){e=(e+"").trim().toLowerCase();let r=/^\<([a-z|\<|\>|\|]+)\>/.exec(e);return r&&r.length>0?r[1].split("|"):["any"]}else return["any"]}function d(e){let n=a.getRef?a.getRef():void 0,r=a.value?.name;if(r){let s=u.value.map(l=>e[l]);if(n&&n[r]){let l=n[r](...s);o.value=JSON.stringify(l)}}else console.log("请选择方法")}return(e,n)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",null,t.toDisplayString(i.value||"请选择方法"),1),t.createVNode(g,{list:v.value,name:a.name,queryName:"调用",onQuery:d},null,8,["list","name"]),t.createElementVNode("div",null,"返回值:"+t.toDisplayString(o.value),1)]))}});module.exports=y;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, ref as
|
|
1
|
+
import { defineComponent as _, ref as s, computed as b, createElementBlock as x, openBlock as N, createElementVNode as m, createVNode as h, toDisplayString as f } from "vue";
|
|
2
2
|
import R from "../index.vue.js";
|
|
3
3
|
const B = /* @__PURE__ */ _({
|
|
4
4
|
__name: "index",
|
|
@@ -12,19 +12,19 @@ const B = /* @__PURE__ */ _({
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
setup(v) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const e =
|
|
15
|
+
const a = v, i = s(""), u = s(""), o = s([]), d = b(() => {
|
|
16
|
+
o.value = [];
|
|
17
|
+
const e = a.value;
|
|
18
18
|
if (e && e.name) {
|
|
19
19
|
let t = (e.selectable + "").trim();
|
|
20
|
-
if (
|
|
21
|
-
return t.split(",").map((
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
let p = g(
|
|
20
|
+
if (i.value = e.name + ": " + e.description + " 入参=(" + t + ") 返回值: " + e.type, t)
|
|
21
|
+
return t.split(",").map((r) => {
|
|
22
|
+
let n = r.split(":"), c = n[0];
|
|
23
|
+
o.value.push(c);
|
|
24
|
+
let p = g(n[1]);
|
|
25
25
|
return {
|
|
26
|
-
label:
|
|
27
|
-
prop:
|
|
26
|
+
label: r,
|
|
27
|
+
prop: c,
|
|
28
28
|
type: p[0],
|
|
29
29
|
dataType: p
|
|
30
30
|
};
|
|
@@ -41,26 +41,25 @@ const B = /* @__PURE__ */ _({
|
|
|
41
41
|
return ["any"];
|
|
42
42
|
}
|
|
43
43
|
function y(e) {
|
|
44
|
-
|
|
45
|
-
let t = r.getRef ? r.getRef() : void 0, l = (n = r.value) == null ? void 0 : n.name;
|
|
44
|
+
let t = a.getRef ? a.getRef() : void 0, l = a.value?.name;
|
|
46
45
|
if (l) {
|
|
47
|
-
let
|
|
46
|
+
let r = o.value.map((n) => e[n]);
|
|
48
47
|
if (t && t[l]) {
|
|
49
|
-
let
|
|
50
|
-
|
|
48
|
+
let n = t[l](...r);
|
|
49
|
+
u.value = JSON.stringify(n);
|
|
51
50
|
}
|
|
52
51
|
} else
|
|
53
52
|
console.log("请选择方法");
|
|
54
53
|
}
|
|
55
54
|
return (e, t) => (N(), x("div", null, [
|
|
56
|
-
m("div", null, f(
|
|
55
|
+
m("div", null, f(i.value || "请选择方法"), 1),
|
|
57
56
|
h(R, {
|
|
58
57
|
list: d.value,
|
|
59
|
-
name:
|
|
58
|
+
name: a.name,
|
|
60
59
|
queryName: "调用",
|
|
61
60
|
onQuery: y
|
|
62
61
|
}, null, 8, ["list", "name"]),
|
|
63
|
-
m("div", null, "返回值:" + f(
|
|
62
|
+
m("div", null, "返回值:" + f(u.value), 1)
|
|
64
63
|
]));
|
|
65
64
|
}
|
|
66
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("vue"),
|
|
1
|
+
"use strict";const o=require("vue"),p=require("../function/index.vue.cjs"),f=require("../object/index.vue.cjs"),g=require("../array/index.vue.cjs"),_=require("../select/index.vue.cjs");;/* empty css */const y=require("../choice/index.vue.cjs");;/* empty css */const m=require("../boolean/index.vue.cjs"),b=require("../string/index.vue.cjs"),k=require("../number/index.vue.cjs"),V=require("../other/index.vue.cjs"),T=o.defineComponent({__name:"index",props:{selects:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}},modelValue:{type:null}},emits:["change"],setup(d,{emit:s}){const e=d,t=o.ref(!1),u=s;function c(l,...a){return l?typeof l.select=="string"?e.selects[l.select]:typeof l.select=="function"?l.select(l,...a):l.select:[]}function i(l,a){const r=e.config?.prop;u("change",r,l,a)}function n(l){t.value=l}return(l,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["form-item",{error:t.value}])},[e.config?.type=="select"?(o.openBlock(),o.createBlock(_,{key:0,modelValue:e.modelValue,class:"form-inp",disabled:e.config?.disabled,dataType:e.config.dataType,list:c(e.config),config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","disabled","dataType","list","config"])):e.config?.type=="choice"?(o.openBlock(),o.createBlock(y,{key:1,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,list:c(e.config),config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","list","config"])):e.config?.type=="boolean"?(o.openBlock(),o.createBlock(m,{key:2,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","config"])):e.config?.type=="string"?(o.openBlock(),o.createBlock(b,{key:3,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","config"])):e.config?.type=="number"?(o.openBlock(),o.createBlock(k,{key:4,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","config"])):e.config?.type=="object"?(o.openBlock(),o.createBlock(f,{key:5,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","config"])):e.config?.type=="array"?(o.openBlock(),o.createBlock(g,{key:6,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","disabled","config"])):e.config?.type=="function"?(o.openBlock(),o.createBlock(p,{key:7,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,list:c(e.config),disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","list","disabled","config"])):(o.openBlock(),o.createBlock(V,{key:8,modelValue:e.modelValue,class:"form-inp",dataType:e.config.dataType,list:c(e.config),disabled:e.config?.disabled,config:e.config?.config,onError:n,onValue:i},null,8,["modelValue","dataType","list","disabled","config"]))],2))}});module.exports=T;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as g, ref as r, createElementBlock as u, openBlock as i, normalizeClass as y, createBlock as n } from "vue";
|
|
2
|
+
import b from "../function/index.vue.js";
|
|
3
|
+
import V from "../object/index.vue.js";
|
|
4
|
+
import T from "../array/index.vue.js";
|
|
5
|
+
import _ from "../select/index.vue.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
import
|
|
7
|
+
import k from "../choice/index.vue.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import $ from "../boolean/index.vue.js";
|
|
10
|
+
import h from "../string/index.vue.js";
|
|
11
|
+
import j from "../number/index.vue.js";
|
|
12
|
+
import x from "../other/index.vue.js";
|
|
13
|
+
const H = /* @__PURE__ */ g({
|
|
14
14
|
__name: "index",
|
|
15
15
|
props: {
|
|
16
16
|
/**
|
|
@@ -36,114 +36,110 @@ const te = /* @__PURE__ */ H({
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
emits: ["change"],
|
|
39
|
-
setup(
|
|
40
|
-
const e =
|
|
41
|
-
function
|
|
42
|
-
return o ? typeof o.select == "string" ? e.selects[o.select] : typeof o.select == "function" ? o.select(o, ...
|
|
39
|
+
setup(t, { emit: s }) {
|
|
40
|
+
const e = t, f = r(!1), m = s;
|
|
41
|
+
function c(o, ...d) {
|
|
42
|
+
return o ? typeof o.select == "string" ? e.selects[o.select] : typeof o.select == "function" ? o.select(o, ...d) : o.select : [];
|
|
43
43
|
}
|
|
44
|
-
function a(o,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
G("change", t, o, f);
|
|
44
|
+
function a(o, d) {
|
|
45
|
+
const p = e.config?.prop;
|
|
46
|
+
m("change", p, o, d);
|
|
48
47
|
}
|
|
49
48
|
function l(o) {
|
|
50
|
-
|
|
49
|
+
f.value = o;
|
|
51
50
|
}
|
|
52
|
-
return (o,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}, null, 8, ["modelValue", "dataType", "list", "disabled", "config"]))
|
|
143
|
-
], 2);
|
|
144
|
-
};
|
|
51
|
+
return (o, d) => (i(), u("div", {
|
|
52
|
+
class: y(["form-item", { error: f.value }])
|
|
53
|
+
}, [
|
|
54
|
+
e.config?.type == "select" ? (i(), n(_, {
|
|
55
|
+
key: 0,
|
|
56
|
+
modelValue: e.modelValue,
|
|
57
|
+
class: "form-inp",
|
|
58
|
+
disabled: e.config?.disabled,
|
|
59
|
+
dataType: e.config.dataType,
|
|
60
|
+
list: c(e.config),
|
|
61
|
+
config: e.config?.config,
|
|
62
|
+
onError: l,
|
|
63
|
+
onValue: a
|
|
64
|
+
}, null, 8, ["modelValue", "disabled", "dataType", "list", "config"])) : e.config?.type == "choice" ? (i(), n(k, {
|
|
65
|
+
key: 1,
|
|
66
|
+
modelValue: e.modelValue,
|
|
67
|
+
class: "form-inp",
|
|
68
|
+
dataType: e.config.dataType,
|
|
69
|
+
disabled: e.config?.disabled,
|
|
70
|
+
list: c(e.config),
|
|
71
|
+
config: e.config?.config,
|
|
72
|
+
onError: l,
|
|
73
|
+
onValue: a
|
|
74
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "list", "config"])) : e.config?.type == "boolean" ? (i(), n($, {
|
|
75
|
+
key: 2,
|
|
76
|
+
modelValue: e.modelValue,
|
|
77
|
+
class: "form-inp",
|
|
78
|
+
dataType: e.config.dataType,
|
|
79
|
+
disabled: e.config?.disabled,
|
|
80
|
+
config: e.config?.config,
|
|
81
|
+
onError: l,
|
|
82
|
+
onValue: a
|
|
83
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "config"])) : e.config?.type == "string" ? (i(), n(h, {
|
|
84
|
+
key: 3,
|
|
85
|
+
modelValue: e.modelValue,
|
|
86
|
+
class: "form-inp",
|
|
87
|
+
dataType: e.config.dataType,
|
|
88
|
+
disabled: e.config?.disabled,
|
|
89
|
+
config: e.config?.config,
|
|
90
|
+
onError: l,
|
|
91
|
+
onValue: a
|
|
92
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "config"])) : e.config?.type == "number" ? (i(), n(j, {
|
|
93
|
+
key: 4,
|
|
94
|
+
modelValue: e.modelValue,
|
|
95
|
+
class: "form-inp",
|
|
96
|
+
dataType: e.config.dataType,
|
|
97
|
+
disabled: e.config?.disabled,
|
|
98
|
+
config: e.config?.config,
|
|
99
|
+
onError: l,
|
|
100
|
+
onValue: a
|
|
101
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "config"])) : e.config?.type == "object" ? (i(), n(V, {
|
|
102
|
+
key: 5,
|
|
103
|
+
modelValue: e.modelValue,
|
|
104
|
+
class: "form-inp",
|
|
105
|
+
dataType: e.config.dataType,
|
|
106
|
+
disabled: e.config?.disabled,
|
|
107
|
+
config: e.config?.config,
|
|
108
|
+
onError: l,
|
|
109
|
+
onValue: a
|
|
110
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "config"])) : e.config?.type == "array" ? (i(), n(T, {
|
|
111
|
+
key: 6,
|
|
112
|
+
modelValue: e.modelValue,
|
|
113
|
+
class: "form-inp",
|
|
114
|
+
dataType: e.config.dataType,
|
|
115
|
+
disabled: e.config?.disabled,
|
|
116
|
+
config: e.config?.config,
|
|
117
|
+
onError: l,
|
|
118
|
+
onValue: a
|
|
119
|
+
}, null, 8, ["modelValue", "dataType", "disabled", "config"])) : e.config?.type == "function" ? (i(), n(b, {
|
|
120
|
+
key: 7,
|
|
121
|
+
modelValue: e.modelValue,
|
|
122
|
+
class: "form-inp",
|
|
123
|
+
dataType: e.config.dataType,
|
|
124
|
+
list: c(e.config),
|
|
125
|
+
disabled: e.config?.disabled,
|
|
126
|
+
config: e.config?.config,
|
|
127
|
+
onError: l,
|
|
128
|
+
onValue: a
|
|
129
|
+
}, null, 8, ["modelValue", "dataType", "list", "disabled", "config"])) : (i(), n(x, {
|
|
130
|
+
key: 8,
|
|
131
|
+
modelValue: e.modelValue,
|
|
132
|
+
class: "form-inp",
|
|
133
|
+
dataType: e.config.dataType,
|
|
134
|
+
list: c(e.config),
|
|
135
|
+
disabled: e.config?.disabled,
|
|
136
|
+
config: e.config?.config,
|
|
137
|
+
onError: l,
|
|
138
|
+
onValue: a
|
|
139
|
+
}, null, 8, ["modelValue", "dataType", "list", "disabled", "config"]))
|
|
140
|
+
], 2));
|
|
145
141
|
}
|
|
146
142
|
});
|
|
147
143
|
export {
|
|
148
|
-
|
|
144
|
+
H as default
|
|
149
145
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("vue"),v=require("../input/index.vue.cjs"),f=require("../../util.cjs"),_={class:"form-function"},g=r.defineComponent({__name:"index",props:{modelValue:{type:null},list:{type:Array},config:{type:Object,default(){return{label:"label",prop:"prop"}}}},emits:["value","error"],setup(p,{emit:m}){const u=p,a=r.computed(()=>u.list?.map(e=>e[u.config.prop])||[]),n=m,l=r.ref("");r.watch(()=>u.modelValue,()=>{let e=u.modelValue;l.value=i(e)||e},{immediate:!0});function d(e){return new Function(...a.value,e)}function c(){return`(${a.value.join(", ")}) `}function i(e){let t;if(e)try{let o=f.getFunctionFormat(e);if(o){t=o.body;const s=d(t);s(),n("value",s,c()+t),n("error",!1)}}catch(o){n("error",!0),console.log("error",o)}else t=`{
|
|
2
2
|
|
|
3
|
-
}`,n("value",void 0,c()+t),n("error",!1);return t}return(e,t)=>(
|
|
3
|
+
}`,n("value",void 0,c()+t),n("error",!1);return t}return(e,t)=>(r.openBlock(),r.createElementBlock("div",_,[r.createVNode(v,{modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=o=>l.value=o),check:i},null,8,["modelValue"])]))}});module.exports=g;
|
|
@@ -22,10 +22,7 @@ const j = { class: "form-function" }, w = /* @__PURE__ */ f({
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["value", "error"],
|
|
24
24
|
setup(m, { emit: p }) {
|
|
25
|
-
const n = m, a = d(() =>
|
|
26
|
-
var e;
|
|
27
|
-
return ((e = n.list) == null ? void 0 : e.map((r) => r[n.config.prop])) || [];
|
|
28
|
-
}), o = p, l = v("");
|
|
25
|
+
const n = m, a = d(() => n.list?.map((e) => e[n.config.prop]) || []), o = p, l = v("");
|
|
29
26
|
_(
|
|
30
27
|
() => n.modelValue,
|
|
31
28
|
() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),v=require("../../codemirror.cjs"),k=["value"],_=e.defineComponent({__name:"index",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(
|
|
1
|
+
"use strict";const e=require("vue"),v=require("../../codemirror.cjs"),k=["value"],_=e.defineComponent({__name:"index",props:{modelValue:{type:null},check:{type:Function,default(){return""}}},emits:["update:modelValue"],setup(s,{emit:a}){const r=s,i=e.ref(!0),l=a,u=e.ref(),d=e.ref();function m(n){const t=n.target?.value;let o=r.check(t);o&&l("update:modelValue",o)}function p(n){const t=n.view,o=t.state.doc,f=o.toString().trim();let c=r.check(f);c&&(t.dispatch({changes:{from:0,to:o.length,insert:c}}),l("update:modelValue",c))}return e.onMounted(()=>{d.value=v.getJs(u.value,{onBlur:p})}),(n,t)=>i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"codemirror-div",ref_key:"refText",ref:u},null,512)):(e.openBlock(),e.createElementBlock("textarea",{key:1,rows:"5",value:r.modelValue,onBlur:m},null,40,k))}});module.exports=_;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as h, ref as
|
|
1
|
+
import { defineComponent as h, ref as r, onMounted as k, createElementBlock as a, openBlock as s } from "vue";
|
|
2
2
|
import { getJs as x } from "../../codemirror.js";
|
|
3
3
|
const y = ["value"], V = /* @__PURE__ */ h({
|
|
4
4
|
__name: "index",
|
|
@@ -14,39 +14,38 @@ const y = ["value"], V = /* @__PURE__ */ h({
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
t && u("update:modelValue", t);
|
|
17
|
+
setup(i, { emit: d }) {
|
|
18
|
+
const n = i, m = r(!0), c = d, u = r(), p = r();
|
|
19
|
+
function f(o) {
|
|
20
|
+
const e = o.target?.value;
|
|
21
|
+
let t = n.check(e);
|
|
22
|
+
t && c("update:modelValue", t);
|
|
24
23
|
}
|
|
25
|
-
function
|
|
26
|
-
const e = o.view, t = e.state.doc,
|
|
27
|
-
let
|
|
28
|
-
|
|
24
|
+
function v(o) {
|
|
25
|
+
const e = o.view, t = e.state.doc, _ = t.toString().trim();
|
|
26
|
+
let l = n.check(_);
|
|
27
|
+
l && (e.dispatch({
|
|
29
28
|
changes: {
|
|
30
29
|
from: 0,
|
|
31
30
|
to: t.length,
|
|
32
|
-
insert:
|
|
31
|
+
insert: l
|
|
33
32
|
}
|
|
34
|
-
}),
|
|
33
|
+
}), c("update:modelValue", l));
|
|
35
34
|
}
|
|
36
35
|
return k(() => {
|
|
37
|
-
|
|
38
|
-
onBlur:
|
|
36
|
+
p.value = x(u.value, {
|
|
37
|
+
onBlur: v
|
|
39
38
|
});
|
|
40
|
-
}), (o, e) =>
|
|
39
|
+
}), (o, e) => m.value ? (s(), a("div", {
|
|
41
40
|
key: 0,
|
|
42
41
|
class: "codemirror-div",
|
|
43
42
|
ref_key: "refText",
|
|
44
|
-
ref:
|
|
45
|
-
}, null, 512)) : (
|
|
43
|
+
ref: u
|
|
44
|
+
}, null, 512)) : (s(), a("textarea", {
|
|
46
45
|
key: 1,
|
|
47
46
|
rows: "5",
|
|
48
|
-
value:
|
|
49
|
-
onBlur:
|
|
47
|
+
value: n.modelValue,
|
|
48
|
+
onBlur: f
|
|
50
49
|
}, null, 40, y));
|
|
51
50
|
}
|
|
52
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("vue"),
|
|
1
|
+
"use strict";const r=require("vue"),c={class:"form-number"},m=["value"],v=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",{value:u.value,type:"number",onBlur:r.withModifiers(a,["stop"])},null,40,m)]))}});module.exports=v;
|