sccba-ui 0.0.18 → 0.0.20

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";var _=Object.create;var g=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(t,e,l,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!w.call(t,a)&&a!==l&&g(t,a,{get:()=>e[a],enumerable:!(r=h(e,a))||r.enumerable});return t};var d=(t,e,l)=>(l=t!=null?_(I(t)):{},E(e||!t||!t.__esModule?g(l,"default",{value:t,enumerable:!0}):l,t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue-demi"),o=require("vue"),v=(t,e)=>{const l=t.__vccOpts||t;for(const[r,a]of e)l[r]=a;return l},P={name:"SccbaButton",inheritAttrs:!1},k=Object.assign(P,{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,{expose:e}){const l=t,r=n.useAttrs(),a=n.shallowRef(null),i=n.computed(()=>({...l,...r}));n.onMounted(async()=>{if(n.isVue2){const s=await import("element-ui");a.value=s.Button}else{const s=await import("element-plus");a.value=s.ElButton}});const p=n.getCurrentInstance(),f=n.ref(null),u=s=>{f.value=s,n.isVue2&&p&&(p.exposed=s)};return e({getButtonInstance:()=>f.value,buttonRef:f}),(s,c)=>o.unref(a)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(n.h)(o.unref(a),{...o.unref(i),ref:u},s.$slots)),{key:0})):o.createCommentVNode("",!0)}}),m=v(k,[["__scopeId","data-v-b193858b"]]),x={name:"SccbaInput"},C=Object.assign(x,{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:e,emit:l}){const r=t,a=n.useAttrs(),i=n.shallowRef(null),p=n.computed(()=>({...r,...a}));n.onMounted(async()=>{if(n.isVue2){const c=await import("element-ui");i.value=c.Input}else{const c=await import("element-plus");i.value=c.ElInput}});const f=n.getCurrentInstance(),u=n.ref(null),s=c=>{u.value=c,n.isVue2&&f&&(f.exposed=c)};return e({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}),(c,q)=>o.unref(i)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(n.h)(o.unref(i),{...o.unref(p),ref:s},c.$slots)),{key:0})):o.createCommentVNode("",!0)}}),y=v(C,[["__scopeId","data-v-e40ba256"]]),B=[m,y],b=function(t){if(B.forEach(e=>{t.component(e.name,e)}),n.isVue2)try{const e=require("element-ui");t.component("el-button",e.Button),t.component("el-input",e.Input)}catch{console.warn("Element UI not found. Please install element-ui: npm install element-ui")}else try{const e=require("element-plus");t.component("el-button",e.ElButton),t.component("el-input",e.ElInput)}catch{console.warn("Element Plus not found. Please install element-plus: npm install element-plus")}};B.forEach(t=>{t.install=function(e){if(e.component(t.name,t),n.isVue2)try{const l=require("element-ui");e.component("el-button",l.Button),e.component("el-input",l.Input)}catch{console.warn("Element UI not found. Please install element-ui: npm install element-ui")}else try{const l=require("element-plus");e.component("el-button",l.ElButton),e.component("el-input",l.ElInput)}catch{console.warn("Element Plus not found. Please install element-plus: npm install element-plus")}}});typeof window<"u"&&window.Vue&&b(window.Vue);const N={install:b,SccbaButton:m,SccbaInput:y};exports.SccbaButton=m;exports.SccbaInput=y;exports.default=N;exports.install=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue-demi"),n=require("vue");async function S(){try{const e=t.isVue2?"element-ui":"element-plus",l=t.isVue2?"Button":"ElButton";return(await import(e))[l]}catch(e){return console.error(t.isVue2?"SccbaButton: Failed to load element-ui. Please install it with: npm install element-ui":"SccbaButton: Failed to load element-plus. Please install it with: npm install element-plus",e),null}}async function h(){try{const e=t.isVue2?"element-ui":"element-plus",l=t.isVue2?"Input":"ElInput";return(await import(e))[l]}catch(e){return console.error(t.isVue2?"SccbaInput: Failed to load element-ui. Please install it with: npm install element-ui":"SccbaInput: Failed to load element-plus. Please install it with: npm install element-plus",e),null}}const g=(e,l)=>{const o=e.__vccOpts||e;for(const[r,u]of l)o[r]=u;return o},v={name:"SccbaButton",inheritAttrs:!1},_=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(e,{expose:l}){const o=e,r=t.useAttrs(),u=t.shallowRef(null),i=t.computed(()=>({...o,...r}));t.onMounted(async()=>{u.value=await S()});const f=t.getCurrentInstance(),s=t.ref(null),a=c=>{s.value=c,isVue2&&f&&(f.exposed=c)};return l({getButtonInstance:()=>s.value,buttonRef:s}),(c,p)=>n.unref(u)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(t.h)(n.unref(u),{...n.unref(i),ref:a},c.$slots)),{key:0})):n.createCommentVNode("",!0)}}),d=g(_,[["__scopeId","data-v-1864f2a8"]]),B={name:"SccbaInput"},w=Object.assign(B,{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(e,{expose:l,emit:o}){const r=e,u=t.useAttrs(),i=t.shallowRef(null),f=t.computed(()=>({...r,...u}));t.onMounted(async()=>{i.value=await h()});const s=t.getCurrentInstance(),a=t.ref(null),c=p=>{a.value=p,isVue2&&s&&(s.exposed=p)};return l({getInputInstance:()=>a.value,focus:()=>a.value&&a.value.focus(),blur:()=>a.value&&a.value.blur(),select:()=>a.value&&a.value.select(),clear:()=>a.value&&a.value.clear(),inputRef:a}),(p,V)=>n.unref(i)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(t.h)(n.unref(i),{...n.unref(f),ref:c},p.$slots)),{key:0})):n.createCommentVNode("",!0)}}),m=g(w,[["__scopeId","data-v-833871b6"]]),b=[d,m],y=function(e){b.forEach(l=>{e.component(l.name,l)})};b.forEach(e=>{e.install=function(l){l.component(e.name,e)}});typeof window<"u"&&window.Vue&&y(window.Vue);const I={install:y,SccbaButton:d,SccbaInput:m};exports.SccbaButton=d;exports.SccbaInput=m;exports.default=I;exports.install=y;
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-b193858b] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-b193858b] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-b193858b] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-b193858b] .el-button{margin-right:10px}[data-v-b193858b] .el-button:last-child{margin-right:0}[data-v-e40ba256] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-e40ba256] .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-1864f2a8] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-1864f2a8] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-1864f2a8] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-1864f2a8] .el-button{margin-right:10px}[data-v-1864f2a8] .el-button:last-child{margin-right:0}[data-v-833871b6] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-833871b6] .el-input__inner:focus{box-shadow:0 0 0 2px #3b82f633!important}
@@ -1,14 +1,36 @@
1
- import { useAttrs as d, shallowRef as m, computed as y, onMounted as b, isVue2 as i, getCurrentInstance as g, ref as v, h as _ } from "vue-demi";
2
- import { createBlock as h, createCommentVNode as B, unref as s, openBlock as w, resolveDynamicComponent as E } from "vue";
3
- const I = (t, e) => {
4
- const n = t.__vccOpts || t;
5
- for (const [p, u] of e)
6
- n[p] = u;
7
- return n;
8
- }, k = {
1
+ import { isVue2 as c, useAttrs as d, shallowRef as m, computed as y, onMounted as g, getCurrentInstance as b, ref as h, h as S } from "vue-demi";
2
+ import { createBlock as _, createCommentVNode as v, unref as l, openBlock as B, resolveDynamicComponent as w } from "vue";
3
+ async function V() {
4
+ try {
5
+ const e = c ? "element-ui" : "element-plus", t = c ? "Button" : "ElButton";
6
+ return (await import(e))[t];
7
+ } catch (e) {
8
+ return console.error(
9
+ c ? "SccbaButton: Failed to load element-ui. Please install it with: npm install element-ui" : "SccbaButton: Failed to load element-plus. Please install it with: npm install element-plus",
10
+ e
11
+ ), null;
12
+ }
13
+ }
14
+ async function E() {
15
+ try {
16
+ const e = c ? "element-ui" : "element-plus", t = c ? "Input" : "ElInput";
17
+ return (await import(e))[t];
18
+ } catch (e) {
19
+ return console.error(
20
+ c ? "SccbaInput: Failed to load element-ui. Please install it with: npm install element-ui" : "SccbaInput: Failed to load element-plus. Please install it with: npm install element-plus",
21
+ e
22
+ ), null;
23
+ }
24
+ }
25
+ const I = (e, t) => {
26
+ const a = e.__vccOpts || e;
27
+ for (const [r, o] of t)
28
+ a[r] = o;
29
+ return a;
30
+ }, C = {
9
31
  name: "SccbaButton",
10
32
  inheritAttrs: !1
11
- }, q = /* @__PURE__ */ Object.assign(k, {
33
+ }, R = /* @__PURE__ */ Object.assign(C, {
12
34
  props: {
13
35
  type: {
14
36
  type: String,
@@ -67,28 +89,22 @@ const I = (t, e) => {
67
89
  default: ""
68
90
  }
69
91
  },
70
- setup(t, { expose: e }) {
71
- const n = t, p = d(), u = m(null), c = y(() => ({ ...n, ...p }));
72
- b(async () => {
73
- if (i) {
74
- const o = await import("element-ui");
75
- u.value = o.Button;
76
- } else {
77
- const o = await import("element-plus");
78
- u.value = o.ElButton;
79
- }
92
+ setup(e, { expose: t }) {
93
+ const a = e, r = d(), o = m(null), i = y(() => ({ ...a, ...r }));
94
+ g(async () => {
95
+ o.value = await V();
80
96
  });
81
- const f = g(), r = v(null), l = (o) => {
82
- r.value = o, i && f && (f.exposed = o);
97
+ const f = b(), u = h(null), n = (s) => {
98
+ u.value = s, isVue2 && f && (f.exposed = s);
83
99
  };
84
- return e({
85
- getButtonInstance: () => r.value,
86
- buttonRef: r
87
- }), (o, a) => s(u) ? (w(), h(E(s(_)(s(u), { ...s(c), ref: l }, o.$slots)), { key: 0 })) : B("", !0);
100
+ return t({
101
+ getButtonInstance: () => u.value,
102
+ buttonRef: u
103
+ }), (s, p) => l(o) ? (B(), _(w(l(S)(l(o), { ...l(i), ref: n }, s.$slots)), { key: 0 })) : v("", !0);
88
104
  }
89
- }), S = /* @__PURE__ */ I(q, [["__scopeId", "data-v-b193858b"]]), C = {
105
+ }), x = /* @__PURE__ */ I(R, [["__scopeId", "data-v-1864f2a8"]]), $ = {
90
106
  name: "SccbaInput"
91
- }, R = /* @__PURE__ */ Object.assign(C, {
107
+ }, F = /* @__PURE__ */ Object.assign($, {
92
108
  props: {
93
109
  // 类型:text/password/textarea/number/email/url/date
94
110
  type: {
@@ -162,82 +178,50 @@ const I = (t, e) => {
162
178
  }
163
179
  },
164
180
  emits: ["input", "change", "focus", "blur", "clear"],
165
- setup(t, { expose: e, emit: n }) {
166
- const p = t, u = d(), c = m(null), f = y(() => ({ ...p, ...u }));
167
- b(async () => {
168
- if (i) {
169
- const a = await import("element-ui");
170
- c.value = a.Input;
171
- } else {
172
- const a = await import("element-plus");
173
- c.value = a.ElInput;
174
- }
181
+ setup(e, { expose: t, emit: a }) {
182
+ const r = e, o = d(), i = m(null), f = y(() => ({ ...r, ...o }));
183
+ g(async () => {
184
+ i.value = await E();
175
185
  });
176
- const r = g(), l = v(null), o = (a) => {
177
- l.value = a, i && r && (r.exposed = a);
186
+ const u = b(), n = h(null), s = (p) => {
187
+ n.value = p, isVue2 && u && (u.exposed = p);
178
188
  };
179
- return e({
189
+ return t({
180
190
  // 暴露底层输入框实例
181
- getInputInstance: () => l.value,
191
+ getInputInstance: () => n.value,
182
192
  // 常用的输入框方法
183
- focus: () => l.value && l.value.focus(),
184
- blur: () => l.value && l.value.blur(),
193
+ focus: () => n.value && n.value.focus(),
194
+ blur: () => n.value && n.value.blur(),
185
195
  // 选择文本
186
- select: () => l.value && l.value.select(),
196
+ select: () => n.value && n.value.select(),
187
197
  // 清空输入框
188
- clear: () => l.value && l.value.clear(),
198
+ clear: () => n.value && n.value.clear(),
189
199
  // 直接暴露实例(在某些情况下可能更方便)
190
- inputRef: l
191
- }), (a, U) => s(c) ? (w(), h(E(s(_)(s(c), { ...s(f), ref: o }, a.$slots)), { key: 0 })) : B("", !0);
200
+ inputRef: n
201
+ }), (p, O) => l(i) ? (B(), _(w(l(S)(l(i), { ...l(f), ref: s }, p.$slots)), { key: 0 })) : v("", !0);
192
202
  }
193
- }), P = /* @__PURE__ */ I(R, [["__scopeId", "data-v-e40ba256"]]), x = [
194
- S,
195
- P
196
- ], N = function(t) {
197
- if (x.forEach((e) => {
198
- t.component(e.name, e);
199
- }), i)
200
- try {
201
- const e = require("element-ui");
202
- t.component("el-button", e.Button), t.component("el-input", e.Input);
203
- } catch {
204
- console.warn("Element UI not found. Please install element-ui: npm install element-ui");
205
- }
206
- else
207
- try {
208
- const e = require("element-plus");
209
- t.component("el-button", e.ElButton), t.component("el-input", e.ElInput);
210
- } catch {
211
- console.warn("Element Plus not found. Please install element-plus: npm install element-plus");
212
- }
203
+ }), N = /* @__PURE__ */ I(F, [["__scopeId", "data-v-833871b6"]]), k = [
204
+ x,
205
+ N
206
+ ], P = function(e) {
207
+ k.forEach((t) => {
208
+ e.component(t.name, t);
209
+ });
213
210
  };
214
- x.forEach((t) => {
215
- t.install = function(e) {
216
- if (e.component(t.name, t), i)
217
- try {
218
- const n = require("element-ui");
219
- e.component("el-button", n.Button), e.component("el-input", n.Input);
220
- } catch {
221
- console.warn("Element UI not found. Please install element-ui: npm install element-ui");
222
- }
223
- else
224
- try {
225
- const n = require("element-plus");
226
- e.component("el-button", n.ElButton), e.component("el-input", n.ElInput);
227
- } catch {
228
- console.warn("Element Plus not found. Please install element-plus: npm install element-plus");
229
- }
211
+ k.forEach((e) => {
212
+ e.install = function(t) {
213
+ t.component(e.name, e);
230
214
  };
231
215
  });
232
- typeof window < "u" && window.Vue && N(window.Vue);
233
- const M = {
234
- install: N,
235
- SccbaButton: S,
236
- SccbaInput: P
216
+ typeof window < "u" && window.Vue && P(window.Vue);
217
+ const A = {
218
+ install: P,
219
+ SccbaButton: x,
220
+ SccbaInput: N
237
221
  };
238
222
  export {
239
- S as SccbaButton,
240
- P as SccbaInput,
241
- M as default,
242
- N as install
223
+ x as SccbaButton,
224
+ N as SccbaInput,
225
+ A as default,
226
+ P as install
243
227
  };
@@ -1 +1 @@
1
- (function(s,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):(s=typeof globalThis<"u"?globalThis:s||self,e(s.SccbaUI={},s.VueDemi,s.Vue))})(this,(function(s,e,n){"use strict";const b=(l,t)=>{const o=l.__vccOpts||l;for(const[p,r]of t)o[p]=r;return o},m=b(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(l,{expose:t}){const o=l,p=e.useAttrs(),r=e.shallowRef(null),f=e.computed(()=>({...o,...p}));e.onMounted(async()=>{if(e.isVue2){const u=await import("element-ui");r.value=u.Button}else{const u=await import("element-plus");r.value=u.ElButton}});const d=e.getCurrentInstance(),i=e.ref(null),a=u=>{i.value=u,e.isVue2&&d&&(d.exposed=u)};return t({getButtonInstance:()=>i.value,buttonRef:i}),(u,c)=>n.unref(r)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(r),{...n.unref(f),ref:a},u.$slots)),{key:0})):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-b193858b"]]),y=b(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(l,{expose:t,emit:o}){const p=l,r=e.useAttrs(),f=e.shallowRef(null),d=e.computed(()=>({...p,...r}));e.onMounted(async()=>{if(e.isVue2){const c=await import("element-ui");f.value=c.Input}else{const c=await import("element-plus");f.value=c.ElInput}});const i=e.getCurrentInstance(),a=e.ref(null),u=c=>{a.value=c,e.isVue2&&i&&(i.exposed=c)};return t({getInputInstance:()=>a.value,focus:()=>a.value&&a.value.focus(),blur:()=>a.value&&a.value.blur(),select:()=>a.value&&a.value.select(),clear:()=>a.value&&a.value.clear(),inputRef:a}),(c,E)=>n.unref(f)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(f),{...n.unref(d),ref:u},c.$slots)),{key:0})):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-e40ba256"]]),g=[m,y],_=function(l){if(g.forEach(t=>{l.component(t.name,t)}),e.isVue2)try{const t=require("element-ui");l.component("el-button",t.Button),l.component("el-input",t.Input)}catch{console.warn("Element UI not found. Please install element-ui: npm install element-ui")}else try{const t=require("element-plus");l.component("el-button",t.ElButton),l.component("el-input",t.ElInput)}catch{console.warn("Element Plus not found. Please install element-plus: npm install element-plus")}};g.forEach(l=>{l.install=function(t){if(t.component(l.name,l),e.isVue2)try{const o=require("element-ui");t.component("el-button",o.Button),t.component("el-input",o.Input)}catch{console.warn("Element UI not found. Please install element-ui: npm install element-ui")}else try{const o=require("element-plus");t.component("el-button",o.ElButton),t.component("el-input",o.ElInput)}catch{console.warn("Element Plus not found. Please install element-plus: npm install element-plus")}}}),typeof window<"u"&&window.Vue&&_(window.Vue);const h={install:_,SccbaButton:m,SccbaInput:y};s.SccbaButton=m,s.SccbaInput=y,s.default=h,s.install=_,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(o,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):(o=typeof globalThis<"u"?globalThis:o||self,e(o.SccbaUI={},o.VueDemi,o.Vue))})(this,(function(o,e,n){"use strict";async function h(){try{const t=e.isVue2?"element-ui":"element-plus",l=e.isVue2?"Button":"ElButton";return(await import(t))[l]}catch(t){return console.error(e.isVue2?"SccbaButton: Failed to load element-ui. Please install it with: npm install element-ui":"SccbaButton: Failed to load element-plus. Please install it with: npm install element-plus",t),null}}async function S(){try{const t=e.isVue2?"element-ui":"element-plus",l=e.isVue2?"Input":"ElInput";return(await import(t))[l]}catch(t){return console.error(e.isVue2?"SccbaInput: Failed to load element-ui. Please install it with: npm install element-ui":"SccbaInput: Failed to load element-plus. Please install it with: npm install element-plus",t),null}}const b=(t,l)=>{const s=t.__vccOpts||t;for(const[i,u]of l)s[i]=u;return s},m=b(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(t,{expose:l}){const s=t,i=e.useAttrs(),u=e.shallowRef(null),f=e.computed(()=>({...s,...i}));e.onMounted(async()=>{u.value=await h()});const d=e.getCurrentInstance(),c=e.ref(null),a=r=>{c.value=r,isVue2&&d&&(d.exposed=r)};return l({getButtonInstance:()=>c.value,buttonRef:c}),(r,p)=>n.unref(u)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(u),{...n.unref(f),ref:a},r.$slots)),{key:0})):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-1864f2a8"]]),y=b(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(t,{expose:l,emit:s}){const i=t,u=e.useAttrs(),f=e.shallowRef(null),d=e.computed(()=>({...i,...u}));e.onMounted(async()=>{f.value=await S()});const c=e.getCurrentInstance(),a=e.ref(null),r=p=>{a.value=p,isVue2&&c&&(c.exposed=p)};return l({getInputInstance:()=>a.value,focus:()=>a.value&&a.value.focus(),blur:()=>a.value&&a.value.blur(),select:()=>a.value&&a.value.select(),clear:()=>a.value&&a.value.clear(),inputRef:a}),(p,N)=>n.unref(f)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(e.h)(n.unref(f),{...n.unref(d),ref:r},p.$slots)),{key:0})):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-833871b6"]]),g=[m,y],_=function(t){g.forEach(l=>{t.component(l.name,l)})};g.forEach(t=>{t.install=function(l){l.component(t.name,t)}}),typeof window<"u"&&window.Vue&&_(window.Vue);const B={install:_,SccbaButton:m,SccbaInput:y};o.SccbaButton=m,o.SccbaInput=y,o.default=B,o.install=_,Object.defineProperties(o,{__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.18",
3
+ "version": "0.0.20",
4
4
  "description": "一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容",
5
5
  "keywords": [
6
6
  "vue",
@@ -24,7 +24,9 @@
24
24
  "switch:vue3": "npx vue-demi-switch 3"
25
25
  },
26
26
  "peerDependencies": {
27
- "vue": "^2.7.0 || ^3.0.0"
27
+ "vue": "^2.7.0 || ^3.0.0",
28
+ "element-ui": "^2.15.0",
29
+ "element-plus": "^2.0.0"
28
30
  },
29
31
  "dependencies": {
30
32
  "sass": "^1.97.1",