sccba-ui 0.0.10 → 0.0.11
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 +47 -144
- 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 t=require("vue-demi"),e=require("vue"),m=(n,l)=>{const s=n.__vccOpts||n;for(const[a,r]of l)s[a]=r;return s},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(n){const l=n,s=t.useAttrs(),a=t.shallowRef(null),r=t.ref(null),u=t.computed(()=>({...l,...s}));return t.onMounted(()=>{t.isVue2?typeof window<"u"&&window.ELEMENT&&(a.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(a.value=window.ElementPlus.ElButton)}),(c,i)=>e.unref(a)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t.h)(e.unref(a),{...e.unref(u),ref:e.unref(r)},c.$slots)),{key:0})):e.createCommentVNode("",!0)}}),d=m(_,[["__scopeId","data-v-032e01c3"]]),b={name:"SccbaInput"},S=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(n,{expose:l,emit:s}){const a=n,r=t.useAttrs(),u=t.shallowRef(null),c=t.computed(()=>({...a,...r}));t.onMounted(()=>{t.isVue2?typeof window<"u"&&window.ELEMENT&&(u.value=window.ELEMENT.Input):typeof window<"u"&&window.ElementPlus&&(u.value=window.ElementPlus.ElInput)});const i=t.getCurrentInstance(),o=t.ref(null),g=f=>{o.value=f,t.isVue2&&i&&(i.exposed=f)};return l({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}),(f,h)=>e.unref(u)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t.h)(e.unref(u),{...e.unref(c),ref:g},f.$slots)),{key:0})):e.createCommentVNode("",!0)}}),p=m(S,[["__scopeId","data-v-76a60ef7"]]),w=[d,p],y=function(n){w.forEach(l=>{n.component(l.name,l)})};w.forEach(n=>{n.install=function(l){l.component(n.name,n)}});typeof window<"u"&&window.Vue&&y(window.Vue);const B={install:y,SccbaButton:d,SccbaInput:p};exports.SccbaButton=d;exports.SccbaInput=p;exports.default=B;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-032e01c3] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-032e01c3] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-032e01c3] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-032e01c3] .el-button{margin-right:10px}[data-v-032e01c3] .el-button:last-child{margin-right:0}[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-032e01c3] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-032e01c3] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-032e01c3] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-032e01c3] .el-button{margin-right:10px}[data-v-032e01c3] .el-button:last-child{margin-right:0}[data-v-76a60ef7] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-76a60ef7] .el-input__inner:focus{box-shadow:0 0 0 2px #3b82f633!important}
|
package/dist/sccba-ui.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useAttrs as
|
|
2
|
-
import { createBlock as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
for (const [o,
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
},
|
|
1
|
+
import { useAttrs as c, shallowRef as p, ref as y, computed as w, onMounted as m, isVue2 as d, h as g, getCurrentInstance as P } from "vue-demi";
|
|
2
|
+
import { createBlock as _, createCommentVNode as b, unref as l, openBlock as v, resolveDynamicComponent as E } from "vue";
|
|
3
|
+
const S = (e, n) => {
|
|
4
|
+
const u = e.__vccOpts || e;
|
|
5
|
+
for (const [o, s] of n)
|
|
6
|
+
u[o] = s;
|
|
7
|
+
return u;
|
|
8
|
+
}, k = {
|
|
9
9
|
name: "SccbaButton",
|
|
10
10
|
inheritAttrs: !1
|
|
11
|
-
},
|
|
11
|
+
}, C = /* @__PURE__ */ Object.assign(k, {
|
|
12
12
|
props: {
|
|
13
13
|
// 类型:primary/success/warning/danger/info/text
|
|
14
14
|
type: {
|
|
@@ -82,108 +82,14 @@ const v = (e, t) => {
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
setup(e) {
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
}), (
|
|
85
|
+
const n = e, u = c(), o = p(null), s = y(null), a = w(() => ({ ...n, ...u }));
|
|
86
|
+
return m(() => {
|
|
87
|
+
d ? typeof window < "u" && window.ELEMENT && (o.value = window.ELEMENT.Button) : typeof window < "u" && window.ElementPlus && (o.value = window.ElementPlus.ElButton);
|
|
88
|
+
}), (r, i) => l(o) ? (v(), _(E(l(g)(l(o), { ...l(a), ref: l(s) }, r.$slots)), { key: 0 })) : b("", !0);
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
91
|
-
name: "MyButton",
|
|
92
|
-
// 关闭自动继承attrs,因为我们要手动绑定到component
|
|
93
|
-
inheritAttrs: !1,
|
|
94
|
-
// 定义基本的props,确保代码提示和类型检查
|
|
95
|
-
props: {
|
|
96
|
-
// 类型:primary/success/warning/danger/info/text
|
|
97
|
-
type: {
|
|
98
|
-
type: String,
|
|
99
|
-
default: "default"
|
|
100
|
-
},
|
|
101
|
-
// 尺寸:large/medium/small/mini
|
|
102
|
-
size: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: "medium"
|
|
105
|
-
},
|
|
106
|
-
// 是否朴素按钮
|
|
107
|
-
plain: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
default: !1
|
|
110
|
-
},
|
|
111
|
-
// 是否圆角按钮
|
|
112
|
-
round: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: !1
|
|
115
|
-
},
|
|
116
|
-
// 是否圆形按钮
|
|
117
|
-
circle: {
|
|
118
|
-
type: Boolean,
|
|
119
|
-
default: !1
|
|
120
|
-
},
|
|
121
|
-
// 是否禁用
|
|
122
|
-
disabled: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: !1
|
|
125
|
-
},
|
|
126
|
-
// 是否加载中状态
|
|
127
|
-
loading: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: !1
|
|
130
|
-
},
|
|
131
|
-
// 图标类名
|
|
132
|
-
icon: {
|
|
133
|
-
type: String,
|
|
134
|
-
default: ""
|
|
135
|
-
},
|
|
136
|
-
// 按钮文本
|
|
137
|
-
label: {
|
|
138
|
-
type: String,
|
|
139
|
-
default: ""
|
|
140
|
-
},
|
|
141
|
-
// 按钮宽度
|
|
142
|
-
width: {
|
|
143
|
-
type: [String, Number],
|
|
144
|
-
default: ""
|
|
145
|
-
},
|
|
146
|
-
// 按钮高度
|
|
147
|
-
height: {
|
|
148
|
-
type: [String, Number],
|
|
149
|
-
default: ""
|
|
150
|
-
},
|
|
151
|
-
// 是否块级按钮
|
|
152
|
-
block: {
|
|
153
|
-
type: Boolean,
|
|
154
|
-
default: !1
|
|
155
|
-
},
|
|
156
|
-
// 原生type属性
|
|
157
|
-
nativeType: {
|
|
158
|
-
type: String,
|
|
159
|
-
default: "button"
|
|
160
|
-
},
|
|
161
|
-
// 占位符(虽然按钮一般不需要,但为了演示代码提示)
|
|
162
|
-
placeholder: {
|
|
163
|
-
type: String,
|
|
164
|
-
default: ""
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
setup(e, { attrs: t }) {
|
|
168
|
-
const n = p(null), o = c(() => ({ ...e, ...t })), a = S(), u = (f) => {
|
|
169
|
-
console.log(f, "elllll"), f && (a.exposed = f);
|
|
170
|
-
};
|
|
171
|
-
return y(() => {
|
|
172
|
-
i ? typeof window < "u" && window.ELEMENT && (n.value = window.ELEMENT.Button) : typeof window < "u" && window.ElementPlus && (n.value = window.ElementPlus.ElButton), console.log(n.value, "buttonComponent.value"), console.log(a, "vmmmmm");
|
|
173
|
-
}), {
|
|
174
|
-
buttonComponent: n,
|
|
175
|
-
allProps: o,
|
|
176
|
-
h: m,
|
|
177
|
-
changeRef: u
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
function R(e, t, n, o, a, u) {
|
|
182
|
-
return g(), w(b(e.h(e.buttonComponent, { ...e.allProps, ref: e.changeRef }, e.$slots)));
|
|
183
|
-
}
|
|
184
|
-
const N = /* @__PURE__ */ v(L, [["render", R], ["__scopeId", "data-v-f07b55f4"]]), x = {
|
|
90
|
+
}), h = /* @__PURE__ */ S(C, [["__scopeId", "data-v-032e01c3"]]), L = {
|
|
185
91
|
name: "SccbaInput"
|
|
186
|
-
},
|
|
92
|
+
}, M = /* @__PURE__ */ Object.assign(L, {
|
|
187
93
|
props: {
|
|
188
94
|
// 类型:text/password/textarea/number/email/url/date
|
|
189
95
|
type: {
|
|
@@ -257,53 +163,50 @@ const N = /* @__PURE__ */ v(L, [["render", R], ["__scopeId", "data-v-f07b55f4"]]
|
|
|
257
163
|
}
|
|
258
164
|
},
|
|
259
165
|
emits: ["input", "change", "focus", "blur", "clear"],
|
|
260
|
-
setup(e, { expose:
|
|
261
|
-
const o = e,
|
|
262
|
-
|
|
263
|
-
|
|
166
|
+
setup(e, { expose: n, emit: u }) {
|
|
167
|
+
const o = e, s = c(), a = p(null), r = w(() => ({ ...o, ...s }));
|
|
168
|
+
m(() => {
|
|
169
|
+
d ? typeof window < "u" && window.ELEMENT && (a.value = window.ELEMENT.Input) : typeof window < "u" && window.ElementPlus && (a.value = window.ElementPlus.ElInput);
|
|
264
170
|
});
|
|
265
|
-
const
|
|
266
|
-
|
|
171
|
+
const i = P(), t = y(null), x = (f) => {
|
|
172
|
+
t.value = f, d && i && (i.exposed = f);
|
|
267
173
|
};
|
|
268
|
-
return
|
|
174
|
+
return n({
|
|
269
175
|
// 暴露底层输入框实例
|
|
270
|
-
getInputInstance: () =>
|
|
176
|
+
getInputInstance: () => t.value,
|
|
271
177
|
// 常用的输入框方法
|
|
272
|
-
focus: () =>
|
|
273
|
-
blur: () =>
|
|
178
|
+
focus: () => t.value && t.value.focus(),
|
|
179
|
+
blur: () => t.value && t.value.blur(),
|
|
274
180
|
// 选择文本
|
|
275
|
-
select: () =>
|
|
181
|
+
select: () => t.value && t.value.select(),
|
|
276
182
|
// 清空输入框
|
|
277
|
-
clear: () =>
|
|
183
|
+
clear: () => t.value && t.value.clear(),
|
|
278
184
|
// 直接暴露实例(在某些情况下可能更方便)
|
|
279
|
-
inputRef:
|
|
280
|
-
}), (
|
|
185
|
+
inputRef: t
|
|
186
|
+
}), (f, T) => l(a) ? (v(), _(E(l(g)(l(a), { ...l(r), ref: x }, f.$slots)), { key: 0 })) : b("", !0);
|
|
281
187
|
}
|
|
282
|
-
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
e.component(t.name, t);
|
|
188
|
+
}), B = /* @__PURE__ */ S(M, [["__scopeId", "data-v-76a60ef7"]]), I = [
|
|
189
|
+
h,
|
|
190
|
+
B
|
|
191
|
+
], N = function(e) {
|
|
192
|
+
I.forEach((n) => {
|
|
193
|
+
e.component(n.name, n);
|
|
289
194
|
});
|
|
290
195
|
};
|
|
291
|
-
|
|
292
|
-
e.install = function(
|
|
293
|
-
|
|
196
|
+
I.forEach((e) => {
|
|
197
|
+
e.install = function(n) {
|
|
198
|
+
n.component(e.name, e);
|
|
294
199
|
};
|
|
295
200
|
});
|
|
296
|
-
typeof window < "u" && window.Vue &&
|
|
297
|
-
const
|
|
298
|
-
install:
|
|
299
|
-
SccbaButton:
|
|
300
|
-
|
|
301
|
-
SccbaInput: I
|
|
201
|
+
typeof window < "u" && window.Vue && N(window.Vue);
|
|
202
|
+
const $ = {
|
|
203
|
+
install: N,
|
|
204
|
+
SccbaButton: h,
|
|
205
|
+
SccbaInput: B
|
|
302
206
|
};
|
|
303
207
|
export {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
$ as install
|
|
208
|
+
h as SccbaButton,
|
|
209
|
+
B as SccbaInput,
|
|
210
|
+
$ as default,
|
|
211
|
+
N as install
|
|
309
212
|
};
|
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,t){"use strict";const w=(n,a)=>{const s=n.__vccOpts||n;for(const[u,d]of a)s[u]=d;return s},c=w(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){const a=n,s=e.useAttrs(),u=e.shallowRef(null),d=e.ref(null),f=e.computed(()=>({...a,...s}));return e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(u.value=window.ELEMENT.Button):typeof window<"u"&&window.ElementPlus&&(u.value=window.ElementPlus.ElButton)}),(y,_)=>t.unref(u)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(e.h)(t.unref(u),{...t.unref(f),ref:t.unref(d)},y.$slots)),{key:0})):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-032e01c3"]]),i=w(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:a,emit:s}){const u=n,d=e.useAttrs(),f=e.shallowRef(null),y=e.computed(()=>({...u,...d}));e.onMounted(()=>{e.isVue2?typeof window<"u"&&window.ELEMENT&&(f.value=window.ELEMENT.Input):typeof window<"u"&&window.ElementPlus&&(f.value=window.ElementPlus.ElInput)});const _=e.getCurrentInstance(),l=e.ref(null),b=r=>{l.value=r,e.isVue2&&_&&(_.exposed=r)};return a({getInputInstance:()=>l.value,focus:()=>l.value&&l.value.focus(),blur:()=>l.value&&l.value.blur(),select:()=>l.value&&l.value.select(),clear:()=>l.value&&l.value.clear(),inputRef:l}),(r,I)=>t.unref(f)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(e.h)(t.unref(f),{...t.unref(y),ref:b},r.$slots)),{key:0})):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76a60ef7"]]),m=[c,i],p=function(n){m.forEach(a=>{n.component(a.name,a)})};m.forEach(n=>{n.install=function(a){a.component(n.name,n)}}),typeof window<"u"&&window.Vue&&p(window.Vue);const g={install:p,SccbaButton:c,SccbaInput:i};o.SccbaButton=c,o.SccbaInput=i,o.default=g,o.install=p,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|