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.
- package/dist/sccba-ui.cjs.js +1 -1
- package/dist/sccba-ui.css +1 -1
- package/dist/sccba-ui.es.js +76 -92
- package/dist/sccba-ui.umd.js +1 -1
- package/package.json +4 -2
package/dist/sccba-ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
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-
|
|
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}
|
package/dist/sccba-ui.es.js
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { useAttrs as d, shallowRef as m, computed as y, onMounted as
|
|
2
|
-
import { createBlock as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
},
|
|
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(
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
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 =
|
|
82
|
-
|
|
97
|
+
const f = b(), u = h(null), n = (s) => {
|
|
98
|
+
u.value = s, isVue2 && f && (f.exposed = s);
|
|
83
99
|
};
|
|
84
|
-
return
|
|
85
|
-
getButtonInstance: () =>
|
|
86
|
-
buttonRef:
|
|
87
|
-
}), (
|
|
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
|
-
}),
|
|
105
|
+
}), x = /* @__PURE__ */ I(R, [["__scopeId", "data-v-1864f2a8"]]), $ = {
|
|
90
106
|
name: "SccbaInput"
|
|
91
|
-
},
|
|
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(
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
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
|
|
177
|
-
|
|
186
|
+
const u = b(), n = h(null), s = (p) => {
|
|
187
|
+
n.value = p, isVue2 && u && (u.exposed = p);
|
|
178
188
|
};
|
|
179
|
-
return
|
|
189
|
+
return t({
|
|
180
190
|
// 暴露底层输入框实例
|
|
181
|
-
getInputInstance: () =>
|
|
191
|
+
getInputInstance: () => n.value,
|
|
182
192
|
// 常用的输入框方法
|
|
183
|
-
focus: () =>
|
|
184
|
-
blur: () =>
|
|
193
|
+
focus: () => n.value && n.value.focus(),
|
|
194
|
+
blur: () => n.value && n.value.blur(),
|
|
185
195
|
// 选择文本
|
|
186
|
-
select: () =>
|
|
196
|
+
select: () => n.value && n.value.select(),
|
|
187
197
|
// 清空输入框
|
|
188
|
-
clear: () =>
|
|
198
|
+
clear: () => n.value && n.value.clear(),
|
|
189
199
|
// 直接暴露实例(在某些情况下可能更方便)
|
|
190
|
-
inputRef:
|
|
191
|
-
}), (
|
|
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
|
-
}),
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
],
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
})
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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 &&
|
|
233
|
-
const
|
|
234
|
-
install:
|
|
235
|
-
SccbaButton:
|
|
236
|
-
SccbaInput:
|
|
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
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
223
|
+
x as SccbaButton,
|
|
224
|
+
N as SccbaInput,
|
|
225
|
+
A as default,
|
|
226
|
+
P as install
|
|
243
227
|
};
|
package/dist/sccba-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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.
|
|
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",
|