sccba-ui 0.0.10 → 0.0.13
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 +66 -147
- 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 a=require("vue-demi"),e=require("vue"),_=(n,l)=>{const r=n.__vccOpts||n;for(const[o,s]of l)r[o]=s;return r},v={name:"SccbaButton",inheritAttrs:!1},B=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,r=a.useAttrs(),o=a.ref(null),s=a.ref(null),u=a.computed(()=>({...l,...r}));return a.onMounted(()=>{a.isVue2,o.value="el-button"}),(t,y)=>e.unref(o)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),e.mergeProps({key:0},e.unref(u),{ref_key:"buttonRef",ref:s}),e.createSlots({_:2},[e.renderList(t.$slots,(c,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(t.$slots,f,e.normalizeProps(e.guardReactiveProps(m)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),i=_(B,[["__scopeId","data-v-e038302c"]]),h={name:"SccbaInput"},w=Object.assign(h,{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:r}){const o=n,s=a.useAttrs(),u=a.ref(null),t=a.ref(null),y=a.computed(()=>({...o,...s}));return a.onMounted(()=>{a.isVue2,u.value="el-input"}),l({getInputInstance:()=>t.value,focus:()=>t.value&&t.value.focus(),blur:()=>t.value&&t.value.blur(),select:()=>t.value&&t.value.select(),clear:()=>t.value&&t.value.clear(),inputRef:t}),(c,f)=>e.unref(u)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(u)),e.mergeProps({key:0},e.unref(y),{ref_key:"inputRef",ref:t}),e.createSlots({_:2},[e.renderList(c.$slots,(m,g)=>({name:g,fn:e.withCtx(b=>[e.renderSlot(c.$slots,g,e.normalizeProps(e.guardReactiveProps(b)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),p=_(w,[["__scopeId","data-v-25fe04e6"]]),S=[i,p],d=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&&d(window.Vue);const k={install:d,SccbaButton:i,SccbaInput:p};exports.SccbaButton=i;exports.SccbaInput=p;exports.default=k;exports.install=d;
|
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-e038302c] .el-button{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-e038302c] .el-button:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-1px)}[data-v-e038302c] .el-button:active{transform:translateY(0);box-shadow:0 2px 8px #00000026}[data-v-e038302c] .el-button{margin-right:10px}[data-v-e038302c] .el-button:last-child{margin-right:0}[data-v-25fe04e6] .el-input__inner{transition:all .3s cubic-bezier(.645,.045,.355,1)}[data-v-25fe04e6] .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 [
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
},
|
|
1
|
+
import { useAttrs as y, ref as s, computed as m, onMounted as _, isVue2 as g } from "vue-demi";
|
|
2
|
+
import { createBlock as b, createCommentVNode as S, unref as o, openBlock as v, resolveDynamicComponent as h, mergeProps as B, createSlots as w, renderList as k, withCtx as N, renderSlot as I, normalizeProps as P, guardReactiveProps as R } from "vue";
|
|
3
|
+
const $ = (t, n) => {
|
|
4
|
+
const u = t.__vccOpts || t;
|
|
5
|
+
for (const [a, r] of n)
|
|
6
|
+
u[a] = r;
|
|
7
|
+
return u;
|
|
8
|
+
}, j = {
|
|
9
9
|
name: "SccbaButton",
|
|
10
10
|
inheritAttrs: !1
|
|
11
|
-
},
|
|
11
|
+
}, A = /* @__PURE__ */ Object.assign(j, {
|
|
12
12
|
props: {
|
|
13
13
|
// 类型:primary/success/warning/danger/info/text
|
|
14
14
|
type: {
|
|
@@ -81,109 +81,25 @@ const v = (e, t) => {
|
|
|
81
81
|
default: ""
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
setup(
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
}), (
|
|
84
|
+
setup(t) {
|
|
85
|
+
const n = t, u = y(), a = s(null), r = s(null), l = m(() => ({ ...n, ...u }));
|
|
86
|
+
return _(() => {
|
|
87
|
+
a.value = "el-button";
|
|
88
|
+
}), (e, p) => o(a) ? (v(), b(h(o(a)), B({ key: 0 }, o(l), {
|
|
89
|
+
ref_key: "buttonRef",
|
|
90
|
+
ref: r
|
|
91
|
+
}), w({ _: 2 }, [
|
|
92
|
+
k(e.$slots, (f, c) => ({
|
|
93
|
+
name: c,
|
|
94
|
+
fn: N((i) => [
|
|
95
|
+
I(e.$slots, c, P(R(i)), void 0, !0)
|
|
96
|
+
])
|
|
97
|
+
}))
|
|
98
|
+
]), 1040)) : S("", !0);
|
|
89
99
|
}
|
|
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 = {
|
|
100
|
+
}), x = /* @__PURE__ */ $(A, [["__scopeId", "data-v-e038302c"]]), E = {
|
|
185
101
|
name: "SccbaInput"
|
|
186
|
-
},
|
|
102
|
+
}, L = /* @__PURE__ */ Object.assign(E, {
|
|
187
103
|
props: {
|
|
188
104
|
// 类型:text/password/textarea/number/email/url/date
|
|
189
105
|
type: {
|
|
@@ -257,53 +173,56 @@ const N = /* @__PURE__ */ v(L, [["render", R], ["__scopeId", "data-v-f07b55f4"]]
|
|
|
257
173
|
}
|
|
258
174
|
},
|
|
259
175
|
emits: ["input", "change", "focus", "blur", "clear"],
|
|
260
|
-
setup(
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
})
|
|
265
|
-
const r = S(), l = B(null), C = (d) => {
|
|
266
|
-
l.value = d, i && r && (r.exposed = d);
|
|
267
|
-
};
|
|
268
|
-
return t({
|
|
176
|
+
setup(t, { expose: n, emit: u }) {
|
|
177
|
+
const a = t, r = y(), l = s(null), e = s(null), p = m(() => ({ ...a, ...r }));
|
|
178
|
+
return _(() => {
|
|
179
|
+
l.value = "el-input";
|
|
180
|
+
}), n({
|
|
269
181
|
// 暴露底层输入框实例
|
|
270
|
-
getInputInstance: () =>
|
|
182
|
+
getInputInstance: () => e.value,
|
|
271
183
|
// 常用的输入框方法
|
|
272
|
-
focus: () =>
|
|
273
|
-
blur: () =>
|
|
184
|
+
focus: () => e.value && e.value.focus(),
|
|
185
|
+
blur: () => e.value && e.value.blur(),
|
|
274
186
|
// 选择文本
|
|
275
|
-
select: () =>
|
|
187
|
+
select: () => e.value && e.value.select(),
|
|
276
188
|
// 清空输入框
|
|
277
|
-
clear: () =>
|
|
189
|
+
clear: () => e.value && e.value.clear(),
|
|
278
190
|
// 直接暴露实例(在某些情况下可能更方便)
|
|
279
|
-
inputRef:
|
|
280
|
-
}), (
|
|
191
|
+
inputRef: e
|
|
192
|
+
}), (f, c) => o(l) ? (v(), b(h(o(l)), B({ key: 0 }, o(p), {
|
|
193
|
+
ref_key: "inputRef",
|
|
194
|
+
ref: e
|
|
195
|
+
}), w({ _: 2 }, [
|
|
196
|
+
k(f.$slots, (i, d) => ({
|
|
197
|
+
name: d,
|
|
198
|
+
fn: N((O) => [
|
|
199
|
+
I(f.$slots, d, P(R(O)), void 0, !0)
|
|
200
|
+
])
|
|
201
|
+
}))
|
|
202
|
+
]), 1040)) : S("", !0);
|
|
281
203
|
}
|
|
282
|
-
}),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
e.component(t.name, t);
|
|
204
|
+
}), V = /* @__PURE__ */ $(L, [["__scopeId", "data-v-25fe04e6"]]), z = [
|
|
205
|
+
x,
|
|
206
|
+
V
|
|
207
|
+
], C = function(t) {
|
|
208
|
+
z.forEach((n) => {
|
|
209
|
+
t.component(n.name, n);
|
|
289
210
|
});
|
|
290
211
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
212
|
+
z.forEach((t) => {
|
|
213
|
+
t.install = function(n) {
|
|
214
|
+
n.component(t.name, t);
|
|
294
215
|
};
|
|
295
216
|
});
|
|
296
|
-
typeof window < "u" && window.Vue &&
|
|
297
|
-
const
|
|
298
|
-
install:
|
|
299
|
-
SccbaButton:
|
|
300
|
-
|
|
301
|
-
SccbaInput: I
|
|
217
|
+
typeof window < "u" && window.Vue && C(window.Vue);
|
|
218
|
+
const M = {
|
|
219
|
+
install: C,
|
|
220
|
+
SccbaButton: x,
|
|
221
|
+
SccbaInput: V
|
|
302
222
|
};
|
|
303
223
|
export {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
$ as install
|
|
224
|
+
x as SccbaButton,
|
|
225
|
+
V as SccbaInput,
|
|
226
|
+
M as default,
|
|
227
|
+
C as install
|
|
309
228
|
};
|
package/dist/sccba-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(l,
|
|
1
|
+
(function(l,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):(l=typeof globalThis<"u"?globalThis:l||self,t(l.SccbaUI={},l.VueDemi,l.Vue))})(this,(function(l,t,e){"use strict";const _=(a,o)=>{const f=a.__vccOpts||a;for(const[r,u]of o)f[r]=u;return f},c=_(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(a){const o=a,f=t.useAttrs(),r=t.ref(null),u=t.ref(null),s=t.computed(()=>({...o,...f}));return t.onMounted(()=>{t.isVue2,r.value="el-button"}),(n,S)=>e.unref(r)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps({key:0},e.unref(s),{ref_key:"buttonRef",ref:u}),e.createSlots({_:2},[e.renderList(n.$slots,(p,y)=>({name:y,fn:e.withCtx(g=>[e.renderSlot(n.$slots,y,e.normalizeProps(e.guardReactiveProps(g)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e038302c"]]),d=_(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(a,{expose:o,emit:f}){const r=a,u=t.useAttrs(),s=t.ref(null),n=t.ref(null),S=t.computed(()=>({...r,...u}));return t.onMounted(()=>{t.isVue2,s.value="el-input"}),o({getInputInstance:()=>n.value,focus:()=>n.value&&n.value.focus(),blur:()=>n.value&&n.value.blur(),select:()=>n.value&&n.value.select(),clear:()=>n.value&&n.value.clear(),inputRef:n}),(p,y)=>e.unref(s)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),e.mergeProps({key:0},e.unref(S),{ref_key:"inputRef",ref:n}),e.createSlots({_:2},[e.renderList(p.$slots,(g,b)=>({name:b,fn:e.withCtx(B=>[e.renderSlot(p.$slots,b,e.normalizeProps(e.guardReactiveProps(B)),void 0,!0)])}))]),1040)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-25fe04e6"]]),m=[c,d],i=function(a){m.forEach(o=>{a.component(o.name,o)})};m.forEach(a=>{a.install=function(o){o.component(a.name,a)}}),typeof window<"u"&&window.Vue&&i(window.Vue);const h={install:i,SccbaButton:c,SccbaInput:d};l.SccbaButton=c,l.SccbaInput=d,l.default=h,l.install=i,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|