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.
- package/dist/sccba-ui.cjs.js +1 -1
- package/dist/sccba-ui.css +1 -1
- package/dist/sccba-ui.es.js +59 -68
- package/dist/sccba-ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/sccba-ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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-
|
|
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}
|
package/dist/sccba-ui.es.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { isVue2 as
|
|
2
|
-
import { createBlock as _, createCommentVNode as
|
|
3
|
-
async function
|
|
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 =
|
|
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
|
-
|
|
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
|
|
14
|
+
async function A() {
|
|
15
15
|
try {
|
|
16
|
-
const e =
|
|
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
|
-
|
|
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
|
|
26
|
-
const
|
|
27
|
-
for (const [
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
},
|
|
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
|
-
},
|
|
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
|
|
93
|
+
const l = e, s = f(), a = m(null), r = y(() => ({ ...l, ...s }));
|
|
94
94
|
g(async () => {
|
|
95
|
-
|
|
96
|
-
});
|
|
97
|
-
const
|
|
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: () =>
|
|
102
|
-
buttonRef:
|
|
103
|
-
}), (
|
|
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
|
-
}),
|
|
110
|
+
}), R = /* @__PURE__ */ E(q, [["__scopeId", "data-v-5e929c4c"]]), D = {
|
|
106
111
|
name: "SccbaInput"
|
|
107
|
-
},
|
|
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:
|
|
182
|
-
const
|
|
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
|
-
|
|
185
|
-
});
|
|
186
|
-
const
|
|
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,
|
|
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
|
-
}),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
],
|
|
207
|
-
|
|
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
|
-
|
|
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 &&
|
|
217
|
-
const
|
|
218
|
-
install:
|
|
219
|
-
SccbaButton:
|
|
220
|
-
SccbaInput:
|
|
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
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
214
|
+
R as SccbaButton,
|
|
215
|
+
$ as SccbaInput,
|
|
216
|
+
G as default,
|
|
217
|
+
V as install
|
|
227
218
|
};
|
package/dist/sccba-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,
|
|
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"}})}));
|