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.
- package/dist/sccba-ui.cjs.js +1 -1
- package/dist/sccba-ui.css +1 -1
- package/dist/sccba-ui.es.js +78 -50
- 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";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-
|
|
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}
|
package/dist/sccba-ui.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useAttrs as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
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 [
|
|
6
|
-
n[
|
|
5
|
+
for (const [p, u] of e)
|
|
6
|
+
n[p] = u;
|
|
7
7
|
return n;
|
|
8
|
-
},
|
|
8
|
+
}, k = {
|
|
9
9
|
name: "SccbaButton",
|
|
10
10
|
inheritAttrs: !1
|
|
11
|
-
},
|
|
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
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
}),
|
|
89
|
+
}), S = /* @__PURE__ */ I(q, [["__scopeId", "data-v-b193858b"]]), C = {
|
|
86
90
|
name: "SccbaInput"
|
|
87
|
-
},
|
|
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
|
|
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
|
-
}), (
|
|
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
|
-
}),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
],
|
|
169
|
-
if (
|
|
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
|
-
|
|
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 &&
|
|
205
|
-
const
|
|
206
|
-
install:
|
|
207
|
-
SccbaButton:
|
|
208
|
-
SccbaInput:
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
239
|
+
S as SccbaButton,
|
|
240
|
+
P as SccbaInput,
|
|
241
|
+
M as default,
|
|
242
|
+
N as install
|
|
215
243
|
};
|
package/dist/sccba-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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"}})}));
|