sun-form-v3 1.0.45 → 1.0.46

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