sun-form-v3 1.0.49 → 1.0.51
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/sun-form-v3.es.js +57 -50
- package/dist/sun-form-v3.umd.js +1 -1
- package/package.json +1 -1
package/dist/sun-form-v3.es.js
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
import { openBlock as
|
2
|
-
const
|
1
|
+
import { openBlock as l, createElementBlock as m, Fragment as B, createTextVNode as w, createElementVNode as c, ref as I, resolveComponent as d, isRef as V, unref as t, toDisplayString as v, createBlock as f, withCtx as r, createVNode as u, renderSlot as j, createCommentVNode as O, getCurrentInstance as $, computed as A, onMounted as N, createSlots as S } from "vue";
|
2
|
+
const z = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
3
3
|
__name: "testBtn",
|
4
|
-
setup(
|
5
|
-
return (
|
4
|
+
setup(s) {
|
5
|
+
return (o, e) => " testBtn ";
|
6
6
|
}
|
7
|
-
}),
|
7
|
+
}), D = /* @__PURE__ */ c("input", { type: "text" }, null, -1), F = /* @__PURE__ */ Object.assign({ name: "testInput" }, {
|
8
8
|
__name: "testInput",
|
9
|
-
setup(
|
10
|
-
return (
|
9
|
+
setup(s) {
|
10
|
+
return (o, e) => (l(), m(B, null, [
|
11
11
|
w(" testInput "),
|
12
|
-
|
12
|
+
D
|
13
13
|
], 64));
|
14
14
|
}
|
15
|
-
}),
|
15
|
+
}), U = { class: "border-gray-200 border-t border-b" }, E = { class: "select-none" }, M = {
|
16
16
|
key: 0,
|
17
17
|
class: "px-3 py-2 bg-white"
|
18
|
-
},
|
18
|
+
}, R = /* @__PURE__ */ Object.assign({ name: "commonCard" }, {
|
19
19
|
__name: "index",
|
20
20
|
props: {
|
21
21
|
title: {
|
@@ -23,37 +23,37 @@ const S = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
|
23
23
|
default: "标题"
|
24
24
|
}
|
25
25
|
},
|
26
|
-
setup(
|
27
|
-
let
|
26
|
+
setup(s) {
|
27
|
+
let o = s, e = I(!0);
|
28
28
|
return (n, a) => {
|
29
|
-
const g =
|
30
|
-
return
|
31
|
-
|
29
|
+
const g = d("ArrowUp"), i = d("el-icon"), _ = d("ArrowDown");
|
30
|
+
return l(), m("div", U, [
|
31
|
+
c("div", {
|
32
32
|
class: "flex items-center justify-between p-2 bg-gray-100 cursor-pointer text-sm",
|
33
|
-
onClick: a[0] || (a[0] = (y) =>
|
33
|
+
onClick: a[0] || (a[0] = (y) => V(e) ? e.value = !t(e) : e = !t(e))
|
34
34
|
}, [
|
35
|
-
|
36
|
-
|
37
|
-
t(e) ? (
|
38
|
-
default:
|
35
|
+
c("span", E, v(t(o).title), 1),
|
36
|
+
c("span", null, [
|
37
|
+
t(e) ? (l(), f(i, { key: 0 }, {
|
38
|
+
default: r(() => [
|
39
39
|
u(g)
|
40
40
|
]),
|
41
41
|
_: 1
|
42
|
-
})) : (
|
43
|
-
default:
|
42
|
+
})) : (l(), f(i, { key: 1 }, {
|
43
|
+
default: r(() => [
|
44
44
|
u(_)
|
45
45
|
]),
|
46
46
|
_: 1
|
47
47
|
}))
|
48
48
|
])
|
49
49
|
]),
|
50
|
-
t(e) ? (
|
51
|
-
|
52
|
-
])) :
|
50
|
+
t(e) ? (l(), m("div", M, [
|
51
|
+
j(n.$slots, "default")
|
52
|
+
])) : O("", !0)
|
53
53
|
]);
|
54
54
|
};
|
55
55
|
}
|
56
|
-
}),
|
56
|
+
}), h = /* @__PURE__ */ Object.assign({ name: "widget-input" }, {
|
57
57
|
__name: "index",
|
58
58
|
props: {
|
59
59
|
designer: {
|
@@ -65,10 +65,10 @@ const S = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
|
65
65
|
default: () => ({})
|
66
66
|
}
|
67
67
|
},
|
68
|
-
setup(
|
69
|
-
let e =
|
70
|
-
e.designer.setVueIncetance(e.widget.id,
|
71
|
-
let n =
|
68
|
+
setup(s, { expose: o }) {
|
69
|
+
let e = s;
|
70
|
+
e.designer.setVueIncetance(e.widget.id, $());
|
71
|
+
let n = A(() => e.widget.props);
|
72
72
|
const a = (p) => {
|
73
73
|
e.designer.eventHandle({
|
74
74
|
eventType: "onChange",
|
@@ -81,7 +81,7 @@ const S = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
|
81
81
|
value: p,
|
82
82
|
widget: e.widget
|
83
83
|
});
|
84
|
-
},
|
84
|
+
}, i = () => {
|
85
85
|
e.designer.eventHandle({
|
86
86
|
eventType: "onFocus",
|
87
87
|
value: e.widget.props.value,
|
@@ -103,41 +103,41 @@ const S = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
|
103
103
|
return e.designer.eventHandle({
|
104
104
|
eventType: "onCreated",
|
105
105
|
widget: e.widget
|
106
|
-
}),
|
106
|
+
}), N(() => {
|
107
107
|
e.designer.eventHandle({
|
108
108
|
eventType: "onMounted",
|
109
109
|
widget: e.widget
|
110
110
|
});
|
111
|
-
}),
|
111
|
+
}), o({
|
112
112
|
changeHandle: a
|
113
113
|
}), (p, x) => {
|
114
|
-
const
|
115
|
-
return
|
116
|
-
default:
|
117
|
-
u(
|
114
|
+
const H = d("el-button"), T = d("el-input"), C = d("common-widget-label-container");
|
115
|
+
return l(), f(C, { props: t(n) }, {
|
116
|
+
default: r(() => [
|
117
|
+
u(T, {
|
118
118
|
onChange: a,
|
119
119
|
onInput: g,
|
120
|
-
onFocus:
|
120
|
+
onFocus: i,
|
121
121
|
modelValue: t(n).value,
|
122
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
122
|
+
"onUpdate:modelValue": x[0] || (x[0] = (k) => t(n).value = k),
|
123
123
|
type: t(n).type,
|
124
124
|
size: t(n).size,
|
125
125
|
onBlur: _,
|
126
126
|
placeholder: t(n).placeholder,
|
127
127
|
maxlength: t(n).maxlength
|
128
|
-
},
|
128
|
+
}, S({ _: 2 }, [
|
129
129
|
t(n).prependText ? {
|
130
130
|
name: "prepend",
|
131
|
-
fn:
|
131
|
+
fn: r(() => [
|
132
132
|
w(v(t(n).prependText), 1)
|
133
133
|
]),
|
134
134
|
key: "0"
|
135
135
|
} : void 0,
|
136
136
|
t(n).appendText ? {
|
137
137
|
name: "append",
|
138
|
-
fn:
|
139
|
-
u(
|
140
|
-
default:
|
138
|
+
fn: r(() => [
|
139
|
+
u(H, { onClick: y }, {
|
140
|
+
default: r(() => [
|
141
141
|
w(v(t(n).appendText), 1)
|
142
142
|
]),
|
143
143
|
_: 1
|
@@ -152,12 +152,19 @@ const S = /* @__PURE__ */ Object.assign({ name: "testBtn" }, {
|
|
152
152
|
};
|
153
153
|
}
|
154
154
|
});
|
155
|
-
console.log(
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
155
|
+
console.log(h);
|
156
|
+
let b = {
|
157
|
+
testBtn: z,
|
158
|
+
testInput: F,
|
159
|
+
commonCard: R,
|
160
|
+
widgetInput: h
|
161
|
+
};
|
162
|
+
const q = (s) => {
|
163
|
+
for (let o in b)
|
164
|
+
s.component(o, b[o]);
|
165
|
+
}, J = {
|
166
|
+
install: q
|
160
167
|
};
|
161
168
|
export {
|
162
|
-
|
169
|
+
J as default
|
163
170
|
};
|
package/dist/sun-form-v3.umd.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(e,
|
1
|
+
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.SunFormV3=l(e.Vue))})(this,function(e){"use strict";const l=Object.assign({name:"testBtn"},{__name:"testBtn",setup(r){return(o,t)=>" testBtn "}}),f=e.createElementVNode("input",{type:"text"},null,-1),u=Object.assign({name:"testInput"},{__name:"testInput",setup(r){return(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createTextVNode(" testInput "),f],64))}}),w={class:"border-gray-200 border-t border-b"},x={class:"select-none"},y={key:0,class:"px-3 py-2 bg-white"},h=Object.assign({name:"commonCard"},{__name:"index",props:{title:{type:String,default:"标题"}},setup(r){let o=r,t=e.ref(!0);return(n,s)=>{const a=e.resolveComponent("ArrowUp"),p=e.resolveComponent("el-icon"),i=e.resolveComponent("ArrowDown");return e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",{class:"flex items-center justify-between p-2 bg-gray-100 cursor-pointer text-sm",onClick:s[0]||(s[0]=g=>e.isRef(t)?t.value=!e.unref(t):t=!e.unref(t))},[e.createElementVNode("span",x,e.toDisplayString(e.unref(o).title),1),e.createElementVNode("span",null,[e.unref(t)?(e.openBlock(),e.createBlock(p,{key:0},{default:e.withCtx(()=>[e.createVNode(a)]),_:1})):(e.openBlock(),e.createBlock(p,{key:1},{default:e.withCtx(()=>[e.createVNode(i)]),_:1}))])]),e.unref(t)?(e.openBlock(),e.createElementBlock("div",y,[e.renderSlot(n.$slots,"default")])):e.createCommentVNode("",!0)])}}}),c=Object.assign({name:"widget-input"},{__name:"index",props:{designer:{type:Object,default:()=>({})},widget:{type:Object,default:()=>({})}},setup(r,{expose:o}){let t=r;t.designer.setVueIncetance(t.widget.id,e.getCurrentInstance());let n=e.computed(()=>t.widget.props);const s=d=>{t.designer.eventHandle({eventType:"onChange",value:d,widget:t.widget})},a=d=>{t.designer.eventHandle({eventType:"onInput",value:d,widget:t.widget})},p=()=>{t.designer.eventHandle({eventType:"onFocus",value:t.widget.props.value,widget:t.widget})},i=d=>{t.designer.eventHandle({eventType:"onBlur",value:t.widget.props.value,widget:t.widget})},g=()=>{t.designer.eventHandle({eventType:"onHandle",value:t.widget.props.value,widget:t.widget})};return t.designer.eventHandle({eventType:"onCreated",widget:t.widget}),e.onMounted(()=>{t.designer.eventHandle({eventType:"onMounted",widget:t.widget})}),o({changeHandle:s}),(d,_)=>{const C=e.resolveComponent("el-button"),k=e.resolveComponent("el-input"),b=e.resolveComponent("common-widget-label-container");return e.openBlock(),e.createBlock(b,{props:e.unref(n)},{default:e.withCtx(()=>[e.createVNode(k,{onChange:s,onInput:a,onFocus:p,modelValue:e.unref(n).value,"onUpdate:modelValue":_[0]||(_[0]=B=>e.unref(n).value=B),type:e.unref(n).type,size:e.unref(n).size,onBlur:i,placeholder:e.unref(n).placeholder,maxlength:e.unref(n).maxlength},e.createSlots({_:2},[e.unref(n).prependText?{name:"prepend",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).prependText),1)]),key:"0"}:void 0,e.unref(n).appendText?{name:"append",fn:e.withCtx(()=>[e.createVNode(C,{onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).appendText),1)]),_:1})]),key:"1"}:void 0]),1032,["modelValue","type","size","placeholder","maxlength"])]),_:1},8,["props"])}}});console.log(c);let m={testBtn:l,testInput:u,commonCard:h,widgetInput:c};return{install:r=>{for(let o in m)r.component(o,m[o])}}});
|