sccba-ui 0.0.10 → 0.0.13

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue-demi"),n=require("vue"),p=(t,o)=>{const l=t.__vccOpts||t;for(const[a,s]of o)l[a]=s;return l},v={name:"SccbaButton",inheritAttrs:!1},B=Object.assign(v,{props:{type:{type:String,default:"default"},size:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(t){const o=t,l=e.useAttrs(),a=e.shallowRef(null),s=e.ref(null),f=e.computed(()=>({...o,...l}));return e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(a.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(a.value=window.ElementPlus.ElButton)}),(r,d)=>n.unref(a)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(a),{...n.unref(f),ref:n.unref(s)},r.$slots)),{key:0})):n.createCommentVNode("",!0)}}),c=p(B,[["__scopeId","data-v-032e01c3"]]),h=e.defineComponent({name:"MyButton",inheritAttrs:!1,props:{type:{type:String,default:"default"},size:{type:String,default:"medium"},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(t,{attrs:o}){const l=e.shallowRef(null),a=e.computed(()=>({...t,...o})),s=e.getCurrentInstance(),f=r=>{console.log(r,"elllll"),r&&(s.exposed=r)};return e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(l.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(l.value=window.ElementPlus.ElButton),console.log(l.value,"buttonComponent.value"),console.log(s,"vmmmmm")}),{buttonComponent:l,allProps:a,h:e.h,changeRef:f}}});function S(t,o,l,a,s,f){return n.openBlock(),n.createBlock(n.resolveDynamicComponent(t.h(t.buttonComponent,{...t.allProps,ref:t.changeRef},t.$slots)))}const y=p(h,[["render",S],["__scopeId","data-v-f07b55f4"]]),E={name:"SccbaInput"},_=Object.assign(E,{props:{type:{type:String,default:"text"},size:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{type:[String,Number],default:null},showWordLimit:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},name:{type:String,default:""},form:{type:String,default:""},required:{type:Boolean,default:!1},width:{type:[String,Number],default:""}},emits:["input","change","focus","blur","clear"],setup(t,{expose:o,emit:l}){const a=t,s=e.useAttrs(),f=e.shallowRef(null),r=e.computed(()=>({...a,...s}));e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(f.value=window.ELEMENT.Input):typeof window<"u"&&window.ElementPlus&&(f.value=window.ElementPlus.ElInput)});const d=e.getCurrentInstance(),u=e.ref(null),b=i=>{u.value=i,e.isVue2&&d&&(d.exposed=i)};return o({getInputInstance:()=>u.value,focus:()=>u.value&&u.value.focus(),blur:()=>u.value&&u.value.blur(),select:()=>u.value&&u.value.select(),clear:()=>u.value&&u.value.clear(),inputRef:u}),(i,N)=>n.unref(f)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(f),{...n.unref(r),ref:b},i.$slots)),{key:0})):n.createCommentVNode("",!0)}}),m=p(_,[["__scopeId","data-v-76a60ef7"]]),g=[c,y,m],w=function(t){g.forEach(o=>{t.component(o.name,o)})};g.forEach(t=>{t.install=function(o){o.component(t.name,t)}});typeof window<"u"&&window.Vue&&w(window.Vue);const M={install:w,SccbaButton:c,MyButton1:y,SccbaInput:m};exports.MyButton1=y;exports.SccbaButton=c;exports.SccbaInput=m;exports.default=M;exports.install=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue-demi"),e=require("vue"),_=(n,l)=>{const r=n.__vccOpts||n;for(const[o,s]of l)r[o]=s;return r},v={name:"SccbaButton",inheritAttrs:!1},B=Object.assign(v,{props:{type:{type:String,default:"default"},size:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(n){const l=n,r=a.useAttrs(),o=a.ref(null),s=a.ref(null),u=a.computed(()=>({...l,...r}));return a.onMounted(()=>{a.isVue2,o.value="el-button"}),(t,y)=>e.unref(o)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),e.mergeProps({key:0},e.unref(u),{ref_key:"buttonRef",ref:s}),e.createSlots({_:2},[e.renderList(t.$slots,(c,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(t.$slots,f,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),i=_(B,[["__scopeId","data-v-e038302c"]]),h={name:"SccbaInput"},w=Object.assign(h,{props:{type:{type:String,default:"text"},size:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{type:[String,Number],default:null},showWordLimit:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},name:{type:String,default:""},form:{type:String,default:""},required:{type:Boolean,default:!1},width:{type:[String,Number],default:""}},emits:["input","change","focus","blur","clear"],setup(n,{expose:l,emit:r}){const o=n,s=a.useAttrs(),u=a.ref(null),t=a.ref(null),y=a.computed(()=>({...o,...s}));return a.onMounted(()=>{a.isVue2,u.value="el-input"}),l({getInputInstance:()=>t.value,focus:()=>t.value&&t.value.focus(),blur:()=>t.value&&t.value.blur(),select:()=>t.value&&t.value.select(),clear:()=>t.value&&t.value.clear(),inputRef:t}),(c,f)=>e.unref(u)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)),e.mergeProps({key:0},e.unref(y),{ref_key:"inputRef",ref:t}),e.createSlots({_:2},[e.renderList(c.$slots,(m,g)=>({name:g,fn:e.withCtx(b=>[e.renderSlot(c.$slots,g,e.normalizeProps(e.guardReactiveProps(b)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),p=_(w,[["__scopeId","data-v-25fe04e6"]]),S=[i,p],d=function(n){S.forEach(l=>{n.component(l.name,l)})};S.forEach(n=>{n.install=function(l){l.component(n.name,n)}});typeof window<"u"&&window.Vue&&d(window.Vue);const k={install:d,SccbaButton:i,SccbaInput:p};exports.SccbaButton=i;exports.SccbaInput=p;exports.default=k;exports.install=d;
package/dist/sccba-ui.css CHANGED
@@ -1 +1 @@
1
- :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}.card{padding:2em}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}[data-v-032e01c3] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-032e01c3] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-032e01c3] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-032e01c3] .el-button{margin-right:10px}[data-v-032e01c3] .el-button:last-child{margin-right:0}[data-v-f07b55f4] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-f07b55f4] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-f07b55f4] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-f07b55f4] .el-button{margin-right:10px}[data-v-f07b55f4] .el-button:last-child{margin-right:0}[data-v-76a60ef7] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-76a60ef7] .el-input__inner:focus{box-shadow:0 0 0 2px #3b82f633!important}
1
+ :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}.card{padding:2em}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}[data-v-e038302c] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-e038302c] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-e038302c] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-e038302c] .el-button{margin-right:10px}[data-v-e038302c] .el-button:last-child{margin-right:0}[data-v-25fe04e6] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-25fe04e6] .el-input__inner:focus{box-shadow:0 0 0 2px #3b82f633!important}
@@ -1,14 +1,14 @@
1
- import { useAttrs as E, shallowRef as p, ref as B, computed as c, onMounted as y, isVue2 as i, h as m, defineComponent as M, getCurrentInstance as S } from "vue-demi";
2
- import { createBlock as w, createCommentVNode as h, unref as s, openBlock as g, resolveDynamicComponent as b } from "vue";
3
- const v = (e, t) => {
4
- const n = e.__vccOpts || e;
5
- for (const [o, a] of t)
6
- n[o] = a;
7
- return n;
8
- }, T = {
1
+ import { useAttrs as y, ref as s, computed as m, onMounted as _, isVue2 as g } from "vue-demi";
2
+ import { createBlock as b, createCommentVNode as S, unref as o, openBlock as v, resolveDynamicComponent as h, mergeProps as B, createSlots as w, renderList as k, withCtx as N, renderSlot as I, normalizeProps as P, guardReactiveProps as R } from "vue";
3
+ const $ = (t, n) => {
4
+ const u = t.__vccOpts || t;
5
+ for (const [a, r] of n)
6
+ u[a] = r;
7
+ return u;
8
+ }, j = {
9
9
  name: "SccbaButton",
10
10
  inheritAttrs: !1
11
- }, k = /* @__PURE__ */ Object.assign(T, {
11
+ }, A = /* @__PURE__ */ Object.assign(j, {
12
12
  props: {
13
13
  // 类型:primary/success/warning/danger/info/text
14
14
  type: {
@@ -81,109 +81,25 @@ const v = (e, t) => {
81
81
  default: ""
82
82
  }
83
83
  },
84
- setup(e) {
85
- const t = e, n = E(), o = p(null), a = B(null), u = c(() => ({ ...t, ...n }));
86
- return y(() => {
87
- i ? typeof window < "u" && window.ELEMENT && (o.value = window.ELEMENT.Button) : typeof window < "u" && window.ElementPlus && (o.value = window.ElementPlus.ElButton);
88
- }), (f, r) => s(o) ? (g(), w(b(s(m)(s(o), { ...s(u), ref: s(a) }, f.$slots)), { key: 0 })) : h("", !0);
84
+ setup(t) {
85
+ const n = t, u = y(), a = s(null), r = s(null), l = m(() => ({ ...n, ...u }));
86
+ return _(() => {
87
+ a.value = "el-button";
88
+ }), (e, p) => o(a) ? (v(), b(h(o(a)), B({ key: 0 }, o(l), {
89
+ ref_key: "buttonRef",
90
+ ref: r
91
+ }), w({ _: 2 }, [
92
+ k(e.$slots, (f, c) => ({
93
+ name: c,
94
+ fn: N((i) => [
95
+ I(e.$slots, c, P(R(i)), void 0, !0)
96
+ ])
97
+ }))
98
+ ]), 1040)) : S("", !0);
89
99
  }
90
- }), _ = /* @__PURE__ */ v(k, [["__scopeId", "data-v-032e01c3"]]), L = M({
91
- name: "MyButton",
92
- // 关闭自动继承attrs,因为我们要手动绑定到component
93
- inheritAttrs: !1,
94
- // 定义基本的props,确保代码提示和类型检查
95
- props: {
96
- // 类型:primary/success/warning/danger/info/text
97
- type: {
98
- type: String,
99
- default: "default"
100
- },
101
- // 尺寸:large/medium/small/mini
102
- size: {
103
- type: String,
104
- default: "medium"
105
- },
106
- // 是否朴素按钮
107
- plain: {
108
- type: Boolean,
109
- default: !1
110
- },
111
- // 是否圆角按钮
112
- round: {
113
- type: Boolean,
114
- default: !1
115
- },
116
- // 是否圆形按钮
117
- circle: {
118
- type: Boolean,
119
- default: !1
120
- },
121
- // 是否禁用
122
- disabled: {
123
- type: Boolean,
124
- default: !1
125
- },
126
- // 是否加载中状态
127
- loading: {
128
- type: Boolean,
129
- default: !1
130
- },
131
- // 图标类名
132
- icon: {
133
- type: String,
134
- default: ""
135
- },
136
- // 按钮文本
137
- label: {
138
- type: String,
139
- default: ""
140
- },
141
- // 按钮宽度
142
- width: {
143
- type: [String, Number],
144
- default: ""
145
- },
146
- // 按钮高度
147
- height: {
148
- type: [String, Number],
149
- default: ""
150
- },
151
- // 是否块级按钮
152
- block: {
153
- type: Boolean,
154
- default: !1
155
- },
156
- // 原生type属性
157
- nativeType: {
158
- type: String,
159
- default: "button"
160
- },
161
- // 占位符(虽然按钮一般不需要,但为了演示代码提示)
162
- placeholder: {
163
- type: String,
164
- default: ""
165
- }
166
- },
167
- setup(e, { attrs: t }) {
168
- const n = p(null), o = c(() => ({ ...e, ...t })), a = S(), u = (f) => {
169
- console.log(f, "elllll"), f && (a.exposed = f);
170
- };
171
- return y(() => {
172
- i ? typeof window < "u" && window.ELEMENT && (n.value = window.ELEMENT.Button) : typeof window < "u" && window.ElementPlus && (n.value = window.ElementPlus.ElButton), console.log(n.value, "buttonComponent.value"), console.log(a, "vmmmmm");
173
- }), {
174
- buttonComponent: n,
175
- allProps: o,
176
- h: m,
177
- changeRef: u
178
- };
179
- }
180
- });
181
- function R(e, t, n, o, a, u) {
182
- return g(), w(b(e.h(e.buttonComponent, { ...e.allProps, ref: e.changeRef }, e.$slots)));
183
- }
184
- const N = /* @__PURE__ */ v(L, [["render", R], ["__scopeId", "data-v-f07b55f4"]]), x = {
100
+ }), x = /* @__PURE__ */ $(A, [["__scopeId", "data-v-e038302c"]]), E = {
185
101
  name: "SccbaInput"
186
- }, V = /* @__PURE__ */ Object.assign(x, {
102
+ }, L = /* @__PURE__ */ Object.assign(E, {
187
103
  props: {
188
104
  // 类型:text/password/textarea/number/email/url/date
189
105
  type: {
@@ -257,53 +173,56 @@ const N = /* @__PURE__ */ v(L, [["render", R], ["__scopeId", "data-v-f07b55f4"]]
257
173
  }
258
174
  },
259
175
  emits: ["input", "change", "focus", "blur", "clear"],
260
- setup(e, { expose: t, emit: n }) {
261
- const o = e, a = E(), u = p(null), f = c(() => ({ ...o, ...a }));
262
- y(() => {
263
- i ? typeof window < "u" && window.ELEMENT && (u.value = window.ELEMENT.Input) : typeof window < "u" && window.ElementPlus && (u.value = window.ElementPlus.ElInput);
264
- });
265
- const r = S(), l = B(null), C = (d) => {
266
- l.value = d, i && r && (r.exposed = d);
267
- };
268
- return t({
176
+ setup(t, { expose: n, emit: u }) {
177
+ const a = t, r = y(), l = s(null), e = s(null), p = m(() => ({ ...a, ...r }));
178
+ return _(() => {
179
+ l.value = "el-input";
180
+ }), n({
269
181
  // 暴露底层输入框实例
270
- getInputInstance: () => l.value,
182
+ getInputInstance: () => e.value,
271
183
  // 常用的输入框方法
272
- focus: () => l.value && l.value.focus(),
273
- blur: () => l.value && l.value.blur(),
184
+ focus: () => e.value && e.value.focus(),
185
+ blur: () => e.value && e.value.blur(),
274
186
  // 选择文本
275
- select: () => l.value && l.value.select(),
187
+ select: () => e.value && e.value.select(),
276
188
  // 清空输入框
277
- clear: () => l.value && l.value.clear(),
189
+ clear: () => e.value && e.value.clear(),
278
190
  // 直接暴露实例(在某些情况下可能更方便)
279
- inputRef: l
280
- }), (d, z) => s(u) ? (g(), w(b(s(m)(s(u), { ...s(f), ref: C }, d.$slots)), { key: 0 })) : h("", !0);
191
+ inputRef: e
192
+ }), (f, c) => o(l) ? (v(), b(h(o(l)), B({ key: 0 }, o(p), {
193
+ ref_key: "inputRef",
194
+ ref: e
195
+ }), w({ _: 2 }, [
196
+ k(f.$slots, (i, d) => ({
197
+ name: d,
198
+ fn: N((O) => [
199
+ I(f.$slots, d, P(R(O)), void 0, !0)
200
+ ])
201
+ }))
202
+ ]), 1040)) : S("", !0);
281
203
  }
282
- }), I = /* @__PURE__ */ v(V, [["__scopeId", "data-v-76a60ef7"]]), P = [
283
- _,
284
- N,
285
- I
286
- ], $ = function(e) {
287
- P.forEach((t) => {
288
- e.component(t.name, t);
204
+ }), V = /* @__PURE__ */ $(L, [["__scopeId", "data-v-25fe04e6"]]), z = [
205
+ x,
206
+ V
207
+ ], C = function(t) {
208
+ z.forEach((n) => {
209
+ t.component(n.name, n);
289
210
  });
290
211
  };
291
- P.forEach((e) => {
292
- e.install = function(t) {
293
- t.component(e.name, e);
212
+ z.forEach((t) => {
213
+ t.install = function(n) {
214
+ n.component(t.name, t);
294
215
  };
295
216
  });
296
- typeof window < "u" && window.Vue && $(window.Vue);
297
- const j = {
298
- install: $,
299
- SccbaButton: _,
300
- MyButton1: N,
301
- SccbaInput: I
217
+ typeof window < "u" && window.Vue && C(window.Vue);
218
+ const M = {
219
+ install: C,
220
+ SccbaButton: x,
221
+ SccbaInput: V
302
222
  };
303
223
  export {
304
- N as MyButton1,
305
- _ as SccbaButton,
306
- I as SccbaInput,
307
- j as default,
308
- $ as install
224
+ x as SccbaButton,
225
+ V as SccbaInput,
226
+ M as default,
227
+ C as install
309
228
  };
@@ -1 +1 @@
1
- (function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue-demi"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vue-demi","vue"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.SccbaUI={},l.VueDemi,l.Vue))})(this,(function(l,e,t){"use strict";const c=(n,o)=>{const a=n.__vccOpts||n;for(const[u,s]of o)a[u]=s;return a},p=c(Object.assign({name:"SccbaButton",inheritAttrs:!1},{props:{type:{type:String,default:"default"},size:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(n){const o=n,a=e.useAttrs(),u=e.shallowRef(null),s=e.ref(null),d=e.computed(()=>({...o,...a}));return e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(u.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(u.value=window.ElementPlus.ElButton)}),(r,m)=>t.unref(u)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(e.h)(t.unref(u),{...t.unref(d),ref:t.unref(s)},r.$slots)),{key:0})):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-032e01c3"]]),b=e.defineComponent({name:"MyButton",inheritAttrs:!1,props:{type:{type:String,default:"default"},size:{type:String,default:"medium"},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(n,{attrs:o}){const a=e.shallowRef(null),u=e.computed(()=>({...n,...o})),s=e.getCurrentInstance(),d=r=>{console.log(r,"elllll"),r&&(s.exposed=r)};return e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(a.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(a.value=window.ElementPlus.ElButton),console.log(a.value,"buttonComponent.value"),console.log(s,"vmmmmm")}),{buttonComponent:a,allProps:u,h:e.h,changeRef:d}}});function h(n,o,a,u,s,d){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.h(n.buttonComponent,{...n.allProps,ref:n.changeRef},n.$slots)))}const y=c(b,[["render",h],["__scopeId","data-v-f07b55f4"]]),w=c(Object.assign({name:"SccbaInput"},{props:{type:{type:String,default:"text"},size:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{type:[String,Number],default:null},showWordLimit:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},name:{type:String,default:""},form:{type:String,default:""},required:{type:Boolean,default:!1},width:{type:[String,Number],default:""}},emits:["input","change","focus","blur","clear"],setup(n,{expose:o,emit:a}){const u=n,s=e.useAttrs(),d=e.shallowRef(null),r=e.computed(()=>({...u,...s}));e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(d.value=window.ELEMENT.Input):typeof window<"u"&&window.ElementPlus&&(d.value=window.ElementPlus.ElInput)});const m=e.getCurrentInstance(),f=e.ref(null),S=i=>{f.value=i,e.isVue2&&m&&(m.exposed=i)};return o({getInputInstance:()=>f.value,focus:()=>f.value&&f.value.focus(),blur:()=>f.value&&f.value.blur(),select:()=>f.value&&f.value.select(),clear:()=>f.value&&f.value.clear(),inputRef:f}),(i,C)=>t.unref(d)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(e.h)(t.unref(d),{...t.unref(r),ref:S},i.$slots)),{key:0})):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76a60ef7"]]),_=[p,y,w],g=function(n){_.forEach(o=>{n.component(o.name,o)})};_.forEach(n=>{n.install=function(o){o.component(n.name,n)}}),typeof window<"u"&&window.Vue&&g(window.Vue);const B={install:g,SccbaButton:p,MyButton1:y,SccbaInput:w};l.MyButton1=y,l.SccbaButton=p,l.SccbaInput=w,l.default=B,l.install=g,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue-demi"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vue-demi","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.SccbaUI={},l.VueDemi,l.Vue))})(this,(function(l,t,e){"use strict";const _=(a,o)=>{const f=a.__vccOpts||a;for(const[r,u]of o)f[r]=u;return f},c=_(Object.assign({name:"SccbaButton",inheritAttrs:!1},{props:{type:{type:String,default:"default"},size:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{type:String,default:""},label:{type:String,default:""},width:{type:[String,Number],default:""},height:{type:[String,Number],default:""},block:{type:Boolean,default:!1},nativeType:{type:String,default:"button"},placeholder:{type:String,default:""}},setup(a){const o=a,f=t.useAttrs(),r=t.ref(null),u=t.ref(null),s=t.computed(()=>({...o,...f}));return t.onMounted(()=>{t.isVue2,r.value="el-button"}),(n,S)=>e.unref(r)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps({key:0},e.unref(s),{ref_key:"buttonRef",ref:u}),e.createSlots({_:2},[e.renderList(n.$slots,(p,y)=>({name:y,fn:e.withCtx(g=>[e.renderSlot(n.$slots,y,e.normalizeProps(e.guardReactiveProps(g)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e038302c"]]),d=_(Object.assign({name:"SccbaInput"},{props:{type:{type:String,default:"text"},size:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{type:[String,Number],default:null},showWordLimit:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},name:{type:String,default:""},form:{type:String,default:""},required:{type:Boolean,default:!1},width:{type:[String,Number],default:""}},emits:["input","change","focus","blur","clear"],setup(a,{expose:o,emit:f}){const r=a,u=t.useAttrs(),s=t.ref(null),n=t.ref(null),S=t.computed(()=>({...r,...u}));return t.onMounted(()=>{t.isVue2,s.value="el-input"}),o({getInputInstance:()=>n.value,focus:()=>n.value&&n.value.focus(),blur:()=>n.value&&n.value.blur(),select:()=>n.value&&n.value.select(),clear:()=>n.value&&n.value.clear(),inputRef:n}),(p,y)=>e.unref(s)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),e.mergeProps({key:0},e.unref(S),{ref_key:"inputRef",ref:n}),e.createSlots({_:2},[e.renderList(p.$slots,(g,b)=>({name:b,fn:e.withCtx(B=>[e.renderSlot(p.$slots,b,e.normalizeProps(e.guardReactiveProps(B)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-25fe04e6"]]),m=[c,d],i=function(a){m.forEach(o=>{a.component(o.name,o)})};m.forEach(a=>{a.install=function(o){o.component(a.name,a)}}),typeof window<"u"&&window.Vue&&i(window.Vue);const h={install:i,SccbaButton:c,SccbaInput:d};l.SccbaButton=c,l.SccbaInput=d,l.default=h,l.install=i,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccba-ui",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容",
5
5
  "keywords": [
6
6
  "vue",