sccba-ui 0.0.20 → 0.0.21

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 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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue-demi"),e=require("vue");async function h(){try{const t=n.isVue2?"element-ui":"element-plus",l=n.isVue2?"Button":"ElButton";return(await import(t))[l]}catch(t){return console.error(n.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 v(){try{const t=n.isVue2?"element-ui":"element-plus",l=n.isVue2?"Input":"ElInput";return(await import(t))[l]}catch(t){return console.error(n.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 g=(t,l)=>{const o=t.__vccOpts||t;for(const[r,u]of l)o[r]=u;return o},B={name:"SccbaButton",inheritAttrs:!1},w=Object.assign(B,{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 o=t,r=n.useAttrs(),u=n.shallowRef(null),s=n.computed(()=>({...o,...r}));n.onMounted(async()=>{u.value=await h()}),n.getCurrentInstance();const c=n.ref(null);return l({getButtonInstance:()=>c.value,buttonRef:c}),(a,p)=>e.unref(u)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)),e.mergeProps({key:0},e.unref(s),{ref:"changeRef"}),e.createSlots({_:2},[e.renderList(a.$slots,(b,d)=>({name:d,fn:e.withCtx(i=>[e.renderSlot(a.$slots,d,e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),f=g(w,[["__scopeId","data-v-5e929c4c"]]),I={name:"SccbaInput"},P=Object.assign(I,{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:o}){const r=t,u=n.useAttrs(),s=n.shallowRef(null),c=n.computed(()=>({...r,...u}));n.onMounted(async()=>{s.value=await v()}),n.getCurrentInstance();const a=n.ref(null);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,b)=>e.unref(s)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),e.mergeProps({key:0},e.unref(c),{ref:"changeRef"}),e.createSlots({_:2},[e.renderList(p.$slots,(d,i)=>({name:i,fn:e.withCtx(_=>[e.renderSlot(p.$slots,i,e.normalizeProps(e.guardReactiveProps(_)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),m=g(P,[["__scopeId","data-v-c667f396"]]),S=[f,m],y=function(t){S.forEach(l=>{t.component(l.name,l)})};S.forEach(t=>{t.install=function(l){l.component(t.name,t)}});typeof window<"u"&&window.Vue&&y(window.Vue);const k={install:y,SccbaButton:f,SccbaInput:m};exports.SccbaButton=f;exports.SccbaInput=m;exports.default=k;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-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
+ :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-5e929c4c] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-5e929c4c] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-5e929c4c] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-5e929c4c] .el-button{margin-right:10px}[data-v-5e929c4c] .el-button:last-child{margin-right:0}[data-v-c667f396] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-c667f396] .el-input__inner:focus{box-shadow:0 0 0 2px #3b82f633!important}
@@ -1,36 +1,36 @@
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() {
1
+ import { isVue2 as o, useAttrs as f, shallowRef as m, computed as y, onMounted as g, getCurrentInstance as b, ref as S } from "vue-demi";
2
+ import { createBlock as _, createCommentVNode as h, unref as u, openBlock as B, resolveDynamicComponent as w, mergeProps as v, createSlots as I, renderList as P, withCtx as N, renderSlot as k, normalizeProps as x, guardReactiveProps as C } from "vue";
3
+ async function j() {
4
4
  try {
5
- const e = c ? "element-ui" : "element-plus", t = c ? "Button" : "ElButton";
5
+ const e = o ? "element-ui" : "element-plus", t = o ? "Button" : "ElButton";
6
6
  return (await import(e))[t];
7
7
  } catch (e) {
8
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",
9
+ o ? "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
10
  e
11
11
  ), null;
12
12
  }
13
13
  }
14
- async function E() {
14
+ async function A() {
15
15
  try {
16
- const e = c ? "element-ui" : "element-plus", t = c ? "Input" : "ElInput";
16
+ const e = o ? "element-ui" : "element-plus", t = o ? "Input" : "ElInput";
17
17
  return (await import(e))[t];
18
18
  } catch (e) {
19
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",
20
+ o ? "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
21
  e
22
22
  ), null;
23
23
  }
24
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 = {
25
+ const E = (e, t) => {
26
+ const l = e.__vccOpts || e;
27
+ for (const [s, a] of t)
28
+ l[s] = a;
29
+ return l;
30
+ }, L = {
31
31
  name: "SccbaButton",
32
32
  inheritAttrs: !1
33
- }, R = /* @__PURE__ */ Object.assign(C, {
33
+ }, q = /* @__PURE__ */ Object.assign(L, {
34
34
  props: {
35
35
  type: {
36
36
  type: String,
@@ -90,138 +90,129 @@ const I = (e, t) => {
90
90
  }
91
91
  },
92
92
  setup(e, { expose: t }) {
93
- const a = e, r = d(), o = m(null), i = y(() => ({ ...a, ...r }));
93
+ const l = e, s = f(), a = m(null), r = y(() => ({ ...l, ...s }));
94
94
  g(async () => {
95
- o.value = await V();
96
- });
97
- const f = b(), u = h(null), n = (s) => {
98
- u.value = s, isVue2 && f && (f.exposed = s);
99
- };
95
+ a.value = await j();
96
+ }), b();
97
+ const c = S(null);
100
98
  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);
99
+ getButtonInstance: () => c.value,
100
+ buttonRef: c
101
+ }), (n, p) => u(a) ? (B(), _(w(u(a)), v({ key: 0 }, u(r), { ref: "changeRef" }), I({ _: 2 }, [
102
+ P(n.$slots, (z, d) => ({
103
+ name: d,
104
+ fn: N((i) => [
105
+ k(n.$slots, d, x(C(i)), void 0, !0)
106
+ ])
107
+ }))
108
+ ]), 1040)) : h("", !0);
104
109
  }
105
- }), x = /* @__PURE__ */ I(R, [["__scopeId", "data-v-1864f2a8"]]), $ = {
110
+ }), R = /* @__PURE__ */ E(q, [["__scopeId", "data-v-5e929c4c"]]), D = {
106
111
  name: "SccbaInput"
107
- }, F = /* @__PURE__ */ Object.assign($, {
112
+ }, M = /* @__PURE__ */ Object.assign(D, {
108
113
  props: {
109
- // 类型:text/password/textarea/number/email/url/date
110
114
  type: {
111
115
  type: String,
112
116
  default: "text"
113
117
  },
114
- // 尺寸:large/medium/small
115
118
  size: {
116
119
  type: String,
117
120
  default: ""
118
121
  },
119
- // 占位符
120
122
  placeholder: {
121
123
  type: String,
122
124
  default: ""
123
125
  },
124
- // 是否禁用
125
126
  disabled: {
126
127
  type: Boolean,
127
128
  default: !1
128
129
  },
129
- // 是否只读
130
130
  readonly: {
131
131
  type: Boolean,
132
132
  default: !1
133
133
  },
134
- // 是否可清空
135
134
  clearable: {
136
135
  type: Boolean,
137
136
  default: !1
138
137
  },
139
- // 是否显示密码切换按钮
140
138
  showPassword: {
141
139
  type: Boolean,
142
140
  default: !1
143
141
  },
144
- // 最大输入长度
145
142
  maxlength: {
146
143
  type: [String, Number],
147
144
  default: null
148
145
  },
149
- // 是否显示字数统计
150
146
  showWordLimit: {
151
147
  type: Boolean,
152
148
  default: !1
153
149
  },
154
- // 自动完成
155
150
  autocomplete: {
156
151
  type: String,
157
152
  default: "off"
158
153
  },
159
- // 原生表单属性
160
154
  name: {
161
155
  type: String,
162
156
  default: ""
163
157
  },
164
- // 原生表单属性
165
158
  form: {
166
159
  type: String,
167
160
  default: ""
168
161
  },
169
- // 是否必填
170
162
  required: {
171
163
  type: Boolean,
172
164
  default: !1
173
165
  },
174
- // 输入框宽度
175
166
  width: {
176
167
  type: [String, Number],
177
168
  default: ""
178
169
  }
179
170
  },
180
171
  emits: ["input", "change", "focus", "blur", "clear"],
181
- setup(e, { expose: t, emit: a }) {
182
- const r = e, o = d(), i = m(null), f = y(() => ({ ...r, ...o }));
172
+ setup(e, { expose: t, emit: l }) {
173
+ const s = e, a = f(), r = m(null), c = y(() => ({ ...s, ...a }));
183
174
  g(async () => {
184
- i.value = await E();
185
- });
186
- const u = b(), n = h(null), s = (p) => {
187
- n.value = p, isVue2 && u && (u.exposed = p);
188
- };
175
+ r.value = await A();
176
+ }), b();
177
+ const n = S(null);
189
178
  return t({
190
- // 暴露底层输入框实例
191
179
  getInputInstance: () => n.value,
192
- // 常用的输入框方法
193
180
  focus: () => n.value && n.value.focus(),
194
181
  blur: () => n.value && n.value.blur(),
195
- // 选择文本
196
182
  select: () => n.value && n.value.select(),
197
- // 清空输入框
198
183
  clear: () => n.value && n.value.clear(),
199
- // 直接暴露实例(在某些情况下可能更方便)
200
184
  inputRef: n
201
- }), (p, O) => l(i) ? (B(), _(w(l(S)(l(i), { ...l(f), ref: s }, p.$slots)), { key: 0 })) : v("", !0);
185
+ }), (p, z) => u(r) ? (B(), _(w(u(r)), v({ key: 0 }, u(c), { ref: "changeRef" }), I({ _: 2 }, [
186
+ P(p.$slots, (d, i) => ({
187
+ name: i,
188
+ fn: N((O) => [
189
+ k(p.$slots, i, x(C(O)), void 0, !0)
190
+ ])
191
+ }))
192
+ ]), 1040)) : h("", !0);
202
193
  }
203
- }), N = /* @__PURE__ */ I(F, [["__scopeId", "data-v-833871b6"]]), k = [
204
- x,
205
- N
206
- ], P = function(e) {
207
- k.forEach((t) => {
194
+ }), $ = /* @__PURE__ */ E(M, [["__scopeId", "data-v-c667f396"]]), F = [
195
+ R,
196
+ $
197
+ ], V = function(e) {
198
+ F.forEach((t) => {
208
199
  e.component(t.name, t);
209
200
  });
210
201
  };
211
- k.forEach((e) => {
202
+ F.forEach((e) => {
212
203
  e.install = function(t) {
213
204
  t.component(e.name, e);
214
205
  };
215
206
  });
216
- typeof window < "u" && window.Vue && P(window.Vue);
217
- const A = {
218
- install: P,
219
- SccbaButton: x,
220
- SccbaInput: N
207
+ typeof window < "u" && window.Vue && V(window.Vue);
208
+ const G = {
209
+ install: V,
210
+ SccbaButton: R,
211
+ SccbaInput: $
221
212
  };
222
213
  export {
223
- x as SccbaButton,
224
- N as SccbaInput,
225
- A as default,
226
- P as install
214
+ R as SccbaButton,
215
+ $ as SccbaInput,
216
+ G as default,
217
+ V as install
227
218
  };
@@ -1 +1 @@
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"}})}));
1
+ (function(o,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):(o=typeof globalThis<"u"?globalThis:o||self,t(o.SccbaUI={},o.VueDemi,o.Vue))})(this,(function(o,t,e){"use strict";async function b(){try{const n=t.isVue2?"element-ui":"element-plus",l=t.isVue2?"Button":"ElButton";return(await import(n))[l]}catch(n){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",n),null}}async function h(){try{const n=t.isVue2?"element-ui":"element-plus",l=t.isVue2?"Input":"ElInput";return(await import(n))[l]}catch(n){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",n),null}}const g=(n,l)=>{const s=n.__vccOpts||n;for(const[u,r]of l)s[u]=r;return s},f=g(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,{expose:l}){const s=n,u=t.useAttrs(),r=t.shallowRef(null),c=t.computed(()=>({...s,...u}));t.onMounted(async()=>{r.value=await b()}),t.getCurrentInstance();const i=t.ref(null);return l({getButtonInstance:()=>i.value,buttonRef:i}),(a,y)=>e.unref(r)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps({key:0},e.unref(c),{ref:"changeRef"}),e.createSlots({_:2},[e.renderList(a.$slots,(w,_)=>({name:_,fn:e.withCtx(d=>[e.renderSlot(a.$slots,_,e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-5e929c4c"]]),p=g(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:l,emit:s}){const u=n,r=t.useAttrs(),c=t.shallowRef(null),i=t.computed(()=>({...u,...r}));t.onMounted(async()=>{c.value=await h()}),t.getCurrentInstance();const a=t.ref(null);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}),(y,w)=>e.unref(c)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c)),e.mergeProps({key:0},e.unref(i),{ref:"changeRef"}),e.createSlots({_:2},[e.renderList(y.$slots,(_,d)=>({name:d,fn:e.withCtx(I=>[e.renderSlot(y.$slots,d,e.normalizeProps(e.guardReactiveProps(I)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-c667f396"]]),S=[f,p],m=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&&m(window.Vue);const B={install:m,SccbaButton:f,SccbaInput:p};o.SccbaButton=f,o.SccbaInput=p,o.default=B,o.install=m,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.20",
3
+ "version": "0.0.21",
4
4
  "description": "一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容",
5
5
  "keywords": [
6
6
  "vue",