sccba-ui 0.0.17 → 0.0.18

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 a=require("vue-demi"),n=require("vue"),d=(t,e)=>{const l=t.__vccOpts||t;for(const[u,s]of e)l[u]=s;return l},_={name:"SccbaButton",inheritAttrs:!1},b=Object.assign(_,{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 e=t,l=a.useAttrs(),u=a.ref(null),s=a.computed(()=>({...e,...l}));return(o,p)=>{const c=n.resolveComponent("el-button");return n.openBlock(),n.createBlock(c,n.mergeProps(n.unref(s),{ref_key:"buttonRef",ref:u}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},16)}}}),r=d(b,[["__scopeId","data-v-1ea6dd1b"]]),g={name:"SccbaInput"},S=Object.assign(g,{props:{type:{type:String,default:"text"},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 u=t,s=a.useAttrs(),o=a.ref(null),p=a.computed(()=>({...u,...s}));return e({getInputInstance:()=>o.value,focus:()=>o.value&&o.value.focus(),blur:()=>o.value&&o.value.blur(),select:()=>o.value&&o.value.select(),clear:()=>o.value&&o.value.clear(),inputRef:o}),(c,h)=>{const y=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(y,n.mergeProps(n.unref(p),{ref_key:"inputRef",ref:o}),{default:n.withCtx(()=>[n.renderSlot(c.$slots,"default",{},void 0,!0)]),_:3},16)}}}),i=d(S,[["__scopeId","data-v-119d013b"]]),m=[r,i],f=function(t){if(m.forEach(e=>{t.component(e.name,e)}),a.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")}};m.forEach(t=>{t.install=function(e){if(e.component(t.name,t),a.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&&f(window.Vue);const B={install:f,SccbaButton:r,SccbaInput:i};exports.SccbaButton=r;exports.SccbaInput=i;exports.default=B;exports.install=f;
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;
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-1ea6dd1b] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-1ea6dd1b] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-1ea6dd1b] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-1ea6dd1b] .el-button{margin-right:10px}[data-v-1ea6dd1b] .el-button:last-child{margin-right:0}[data-v-119d013b] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-119d013b] .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-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,14 +1,14 @@
1
- import { useAttrs as c, ref as r, computed as f, isVue2 as i } from "vue-demi";
2
- import { resolveComponent as p, createBlock as d, openBlock as m, mergeProps as y, unref as _, withCtx as b, renderSlot as g } from "vue";
3
- const h = (t, e) => {
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
4
  const n = t.__vccOpts || t;
5
- for (const [o, a] of e)
6
- n[o] = a;
5
+ for (const [p, u] of e)
6
+ n[p] = u;
7
7
  return n;
8
- }, I = {
8
+ }, k = {
9
9
  name: "SccbaButton",
10
10
  inheritAttrs: !1
11
- }, P = /* @__PURE__ */ Object.assign(I, {
11
+ }, q = /* @__PURE__ */ Object.assign(k, {
12
12
  props: {
13
13
  type: {
14
14
  type: String,
@@ -67,73 +67,95 @@ const h = (t, e) => {
67
67
  default: ""
68
68
  }
69
69
  },
70
- setup(t) {
71
- const e = t, n = c(), o = r(null), a = f(() => ({ ...e, ...n }));
72
- return (l, s) => {
73
- const u = p("el-button");
74
- return m(), d(u, y(_(a), {
75
- ref_key: "buttonRef",
76
- ref: o
77
- }), {
78
- default: b(() => [
79
- g(l.$slots, "default", {}, void 0, !0)
80
- ]),
81
- _: 3
82
- }, 16);
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
+ }
80
+ });
81
+ const f = g(), r = v(null), l = (o) => {
82
+ r.value = o, i && f && (f.exposed = o);
83
83
  };
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);
84
88
  }
85
- }), B = /* @__PURE__ */ h(P, [["__scopeId", "data-v-1ea6dd1b"]]), x = {
89
+ }), S = /* @__PURE__ */ I(q, [["__scopeId", "data-v-b193858b"]]), C = {
86
90
  name: "SccbaInput"
87
- }, k = /* @__PURE__ */ Object.assign(x, {
91
+ }, R = /* @__PURE__ */ Object.assign(C, {
88
92
  props: {
93
+ // 类型:text/password/textarea/number/email/url/date
89
94
  type: {
90
95
  type: String,
91
96
  default: "text"
92
97
  },
98
+ // 尺寸:large/medium/small
99
+ size: {
100
+ type: String,
101
+ default: ""
102
+ },
103
+ // 占位符
93
104
  placeholder: {
94
105
  type: String,
95
106
  default: ""
96
107
  },
108
+ // 是否禁用
97
109
  disabled: {
98
110
  type: Boolean,
99
111
  default: !1
100
112
  },
113
+ // 是否只读
101
114
  readonly: {
102
115
  type: Boolean,
103
116
  default: !1
104
117
  },
118
+ // 是否可清空
105
119
  clearable: {
106
120
  type: Boolean,
107
121
  default: !1
108
122
  },
123
+ // 是否显示密码切换按钮
109
124
  showPassword: {
110
125
  type: Boolean,
111
126
  default: !1
112
127
  },
128
+ // 最大输入长度
113
129
  maxlength: {
114
130
  type: [String, Number],
115
131
  default: null
116
132
  },
133
+ // 是否显示字数统计
117
134
  showWordLimit: {
118
135
  type: Boolean,
119
136
  default: !1
120
137
  },
138
+ // 自动完成
121
139
  autocomplete: {
122
140
  type: String,
123
141
  default: "off"
124
142
  },
143
+ // 原生表单属性
125
144
  name: {
126
145
  type: String,
127
146
  default: ""
128
147
  },
148
+ // 原生表单属性
129
149
  form: {
130
150
  type: String,
131
151
  default: ""
132
152
  },
153
+ // 是否必填
133
154
  required: {
134
155
  type: Boolean,
135
156
  default: !1
136
157
  },
158
+ // 输入框宽度
137
159
  width: {
138
160
  type: [String, Number],
139
161
  default: ""
@@ -141,32 +163,38 @@ const h = (t, e) => {
141
163
  },
142
164
  emits: ["input", "change", "focus", "blur", "clear"],
143
165
  setup(t, { expose: e, emit: n }) {
144
- const o = t, a = c(), l = r(null), s = f(() => ({ ...o, ...a }));
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
+ }
175
+ });
176
+ const r = g(), l = v(null), o = (a) => {
177
+ l.value = a, i && r && (r.exposed = a);
178
+ };
145
179
  return e({
180
+ // 暴露底层输入框实例
146
181
  getInputInstance: () => l.value,
182
+ // 常用的输入框方法
147
183
  focus: () => l.value && l.value.focus(),
148
184
  blur: () => l.value && l.value.blur(),
185
+ // 选择文本
149
186
  select: () => l.value && l.value.select(),
187
+ // 清空输入框
150
188
  clear: () => l.value && l.value.clear(),
189
+ // 直接暴露实例(在某些情况下可能更方便)
151
190
  inputRef: l
152
- }), (u, N) => {
153
- const v = p("el-input");
154
- return m(), d(v, y(_(s), {
155
- ref_key: "inputRef",
156
- ref: l
157
- }), {
158
- default: b(() => [
159
- g(u.$slots, "default", {}, void 0, !0)
160
- ]),
161
- _: 3
162
- }, 16);
163
- };
191
+ }), (a, U) => s(c) ? (w(), h(E(s(_)(s(c), { ...s(f), ref: o }, a.$slots)), { key: 0 })) : B("", !0);
164
192
  }
165
- }), S = /* @__PURE__ */ h(k, [["__scopeId", "data-v-119d013b"]]), E = [
166
- B,
167
- S
168
- ], w = function(t) {
169
- if (E.forEach((e) => {
193
+ }), P = /* @__PURE__ */ I(R, [["__scopeId", "data-v-e40ba256"]]), x = [
194
+ S,
195
+ P
196
+ ], N = function(t) {
197
+ if (x.forEach((e) => {
170
198
  t.component(e.name, e);
171
199
  }), i)
172
200
  try {
@@ -183,7 +211,7 @@ const h = (t, e) => {
183
211
  console.warn("Element Plus not found. Please install element-plus: npm install element-plus");
184
212
  }
185
213
  };
186
- E.forEach((t) => {
214
+ x.forEach((t) => {
187
215
  t.install = function(e) {
188
216
  if (e.component(t.name, t), i)
189
217
  try {
@@ -201,15 +229,15 @@ E.forEach((t) => {
201
229
  }
202
230
  };
203
231
  });
204
- typeof window < "u" && window.Vue && w(window.Vue);
205
- const $ = {
206
- install: w,
207
- SccbaButton: B,
208
- SccbaInput: S
232
+ typeof window < "u" && window.Vue && N(window.Vue);
233
+ const M = {
234
+ install: N,
235
+ SccbaButton: S,
236
+ SccbaInput: P
209
237
  };
210
238
  export {
211
- B as SccbaButton,
212
- S as SccbaInput,
213
- $ as default,
214
- w as install
239
+ S as SccbaButton,
240
+ P as SccbaInput,
241
+ M as default,
242
+ N as install
215
243
  };
@@ -1 +1 @@
1
- (function(u,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue-demi"),require("vue")):typeof define=="function"&&define.amd?define(["exports","vue-demi","vue"],a):(u=typeof globalThis<"u"?globalThis:u||self,a(u.SccbaUI={},u.VueDemi,u.Vue))})(this,(function(u,a,n){"use strict";const p=(t,e)=>{const l=t.__vccOpts||t;for(const[s,c]of e)l[s]=c;return l},r=p(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){const e=t,l=a.useAttrs(),s=a.ref(null),c=a.computed(()=>({...e,...l}));return(o,_)=>{const d=n.resolveComponent("el-button");return n.openBlock(),n.createBlock(d,n.mergeProps(n.unref(c),{ref_key:"buttonRef",ref:s}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},16)}}}),[["__scopeId","data-v-1ea6dd1b"]]),f=p(Object.assign({name:"SccbaInput"},{props:{type:{type:String,default:"text"},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 s=t,c=a.useAttrs(),o=a.ref(null),_=a.computed(()=>({...s,...c}));return e({getInputInstance:()=>o.value,focus:()=>o.value&&o.value.focus(),blur:()=>o.value&&o.value.blur(),select:()=>o.value&&o.value.select(),clear:()=>o.value&&o.value.clear(),inputRef:o}),(d,E)=>{const b=n.resolveComponent("el-input");return n.openBlock(),n.createBlock(b,n.mergeProps(n.unref(_),{ref_key:"inputRef",ref:o}),{default:n.withCtx(()=>[n.renderSlot(d.$slots,"default",{},void 0,!0)]),_:3},16)}}}),[["__scopeId","data-v-119d013b"]]),m=[r,f],i=function(t){if(m.forEach(e=>{t.component(e.name,e)}),a.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")}};m.forEach(t=>{t.install=function(e){if(e.component(t.name,t),a.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&&i(window.Vue);const y={install:i,SccbaButton:r,SccbaInput:f};u.SccbaButton=r,u.SccbaInput=f,u.default=y,u.install=i,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
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"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccba-ui",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "一个基于 Vue 2/3 的 UI 组件库,使用 vue-demi 实现跨版本兼容",
5
5
  "keywords": [
6
6
  "vue",